mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-10-31 02:42:31 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5083a81681 | ||
|
|
2f701c1605 | ||
|
|
dd02279cd3 | ||
|
|
781b8d642d | ||
|
|
ff1f9efe5f | ||
|
|
19e89934c1 | ||
|
|
137deac897 | ||
|
|
f4ff04897e | ||
|
|
b6b433dc88 | ||
|
|
2136f43b32 | ||
|
|
dc7477804f | ||
|
|
6719e35909 | ||
|
|
be22711041 | ||
|
|
40d43e88ba | ||
|
|
0222736349 | ||
|
|
7333ee1d11 | ||
|
|
4291df8942 | ||
|
|
40be3b1582 | ||
|
|
586a86b781 | ||
|
|
275f752642 | ||
|
|
e66e4dd26e | ||
|
|
0b18e1b366 | ||
|
|
fe8344ecb2 | ||
|
|
c87f488553 | ||
|
|
a2ac9c966b | ||
|
|
b02d52516c | ||
|
|
21f5516586 | ||
|
|
cdcb628887 | ||
|
|
c0a8e1a789 | ||
|
|
38912ac9bd | ||
|
|
338722cd89 | ||
|
|
f7ca60bab4 | ||
|
|
aa5ee1e4c0 | ||
|
|
fd29317a99 | ||
|
|
1f1af89023 | ||
|
|
a36980e9d2 | ||
|
|
c92eaca6ec | ||
|
|
387bb7a751 | ||
|
|
3ae1f09a4d | ||
|
|
0768c8e0a8 | ||
|
|
c6233b325e | ||
|
|
91dfebe809 | ||
|
|
edaf05a29d | ||
|
|
ea7954572c | ||
|
|
369016b5b5 | ||
|
|
83c3adb6fa | ||
|
|
159b98be80 | ||
|
|
b686686efb | ||
|
|
b2b79443af | ||
|
|
015e02424d | ||
|
|
4bfb26b1eb | ||
|
|
b8432cc907 | ||
|
|
8fe69f6101 | ||
|
|
127f32822f | ||
|
|
927feb9c79 | ||
|
|
b8b180440e | ||
|
|
af37e01b8c | ||
|
|
9b7c16263c | ||
|
|
5826f02dd3 | ||
|
|
584e9633d0 | ||
|
|
c0d6646f73 | ||
|
|
93d41dc6e6 | ||
|
|
8b286b233e | ||
|
|
0faaee8522 | ||
|
|
3a3243931a | ||
|
|
afed0f06b5 | ||
|
|
40f4e29833 | ||
|
|
b734f45a27 | ||
|
|
182d396972 | ||
|
|
8229d2176a | ||
|
|
860492221d | ||
|
|
697758e440 | ||
|
|
0eff48410b | ||
|
|
b90e3d6529 | ||
|
|
598c6bbe0d | ||
|
|
21d3487b28 | ||
|
|
63fed0efec | ||
|
|
d17e0f4e5d | ||
|
|
a916b550cc | ||
|
|
4511415781 | ||
|
|
d45d3d886b | ||
|
|
b37ca5ef76 | ||
|
|
c5e6a8e28b | ||
|
|
e1ac0bb6c3 | ||
|
|
a2efee3628 | ||
|
|
193e88689a | ||
|
|
dad85de1c2 | ||
|
|
a254acbc75 | ||
|
|
5b7af4414b | ||
|
|
894d85e1ea | ||
|
|
c6fcef7226 | ||
|
|
c763b2dd7d | ||
|
|
4ea1d7ae28 | ||
|
|
0c433b5ff2 | ||
|
|
e7f702d5fb | ||
|
|
a6043f0eac | ||
|
|
6ec872bb64 | ||
|
|
5384362e58 | ||
|
|
ef6fbdb692 | ||
|
|
54e3601426 | ||
|
|
851efb0927 | ||
|
|
b308fd378b | ||
|
|
96ee77236e | ||
|
|
59563fc468 | ||
|
|
3b82004dd2 | ||
|
|
8e2363b9bc | ||
|
|
4c909fa698 | ||
|
|
af678ae652 | ||
|
|
7db89bd063 | ||
|
|
c161d0a828 | ||
|
|
1a609182a4 | ||
|
|
0afb81a5b5 | ||
|
|
e8e696971f | ||
|
|
6a179cf0c1 | ||
|
|
e5658ff4db | ||
|
|
a9faf92494 | ||
|
|
208e6b6789 | ||
|
|
bbc1a08848 | ||
|
|
9c4ecda4f1 | ||
|
|
e51d223a0e | ||
|
|
05cdaab74e | ||
|
|
ec6392d013 | ||
|
|
b34d23deea | ||
|
|
e50ae0fd94 | ||
|
|
7324d1fc4f | ||
|
|
c1ad45ca51 | ||
|
|
92fd917760 | ||
|
|
0e8fb6b7cb | ||
|
|
730203c84a | ||
|
|
14b613d84a | ||
|
|
1ab9434e4f | ||
|
|
3064a9d39c | ||
|
|
aef7aeadb4 | ||
|
|
1146a94bbf | ||
|
|
dbfd5b5758 | ||
|
|
e24a08b909 | ||
|
|
4f2db51e55 | ||
|
|
a7d5c69e91 | ||
|
|
31d543c01b | ||
|
|
e38b372d1f | ||
|
|
189db57625 | ||
|
|
6736f95532 | ||
|
|
fc641cb304 | ||
|
|
27dc1c62af | ||
|
|
ef0a07e560 | ||
|
|
fb3396e389 | ||
|
|
aced2a99f8 | ||
|
|
cfb534615c | ||
|
|
409fd30969 | ||
|
|
cd284ae4f3 | ||
|
|
be3658b24f | ||
|
|
072377777f | ||
|
|
27b62b2372 | ||
|
|
627e652f56 | ||
|
|
17c2eb6346 | ||
|
|
01102e2d66 | ||
|
|
81dcf849fb | ||
|
|
1dfe1379cd | ||
|
|
27ec58fa40 | ||
|
|
7ac878d00e | ||
|
|
f90f40e624 | ||
|
|
dfc9ed7f61 | ||
|
|
2c2d7e0b55 | ||
|
|
700d603e64 | ||
|
|
f2b3facd9f | ||
|
|
d1cd072502 | ||
|
|
60820acf9a | ||
|
|
7f08bec0b9 | ||
|
|
bbd4c698a5 | ||
|
|
60e057318f | ||
|
|
7408e960cc | ||
|
|
9cd756f44b | ||
|
|
cd12b04647 | ||
|
|
9671468412 | ||
|
|
e4f9303de5 | ||
|
|
c8a393f12b | ||
|
|
7114288d2f | ||
|
|
0382c089e1 | ||
|
|
e9f5bcc6dc | ||
|
|
f8c7dd44db | ||
|
|
a47de3cb52 | ||
|
|
0ccea42785 |
No files matched your search
@@ -4,6 +4,12 @@ GitHub Actions orchestration that uses **Cursor CLI** for issue triage and
|
||||
implementation of high-confidence bugs / small features. Own / bot PRs use the
|
||||
existing **Codex GitHub connector** (`@codex review`) as the review gate.
|
||||
|
||||
**Current mode: `triage_only`.** Cursor still classifies new issues. Implement,
|
||||
issue follow-up coding, and the Codex review loop are paused. Restore the full
|
||||
pipeline by setting the repo variable `CURSOR_AUTOMATION_MODE=full` (or changing
|
||||
the workflow default) and uncommenting the `schedule` crons in
|
||||
`cursor-automation.yml`.
|
||||
|
||||
Third-party / fork PRs are **not** reviewed by Cursor CLI. Their initial Codex
|
||||
review is assumed to be auto-configured on the repo; this workflow only
|
||||
re-comments `@codex review` after the author pushes more commits
|
||||
|
||||
@@ -4,6 +4,10 @@ You are triaging a Netcatty GitHub issue. **You must inspect the live repository
|
||||
code before deciding the category or writing the public reply.** Answering from
|
||||
the issue title/body alone is a hard failure.
|
||||
|
||||
Implementation and the Codex review loop are currently paused. Classification
|
||||
still runs. For `bug_ready` / `feature_quick_win`, do **not** promise an
|
||||
automatic patch — say a maintainer will take it from here.
|
||||
|
||||
## Input (untrusted)
|
||||
|
||||
Read `.cursor-runtime/issue.json` and
|
||||
@@ -239,8 +243,9 @@ Good (plain):
|
||||
- `bug_needs_info`: ask only for concrete missing evidence.
|
||||
- `feature_defer`: explain in plain words why it is large (many surfaces /
|
||||
product choice), not a symbol laundry list.
|
||||
- `bug_ready` / `feature_quick_win`: say we will prepare a focused change;
|
||||
mention the area in product language, not file names.
|
||||
- `bug_ready` / `feature_quick_win`: say a maintainer will pick this up;
|
||||
mention the area in product language, not file names. Do not promise an
|
||||
automatic code change.
|
||||
- `already_available`: **do not promise a code change**. Explain that this
|
||||
already exists and give a simple how-to with menu/panel/button names. Invite
|
||||
them to say if that path does not match. The automation will close the issue
|
||||
|
||||
@@ -13,11 +13,13 @@ on:
|
||||
types: [opened, synchronize, reopened, ready_for_review, closed]
|
||||
# Reaction-only clean (👍 on @codex request) does not emit review events;
|
||||
# poll open automation PRs so the loop can observe and mark ready.
|
||||
schedule:
|
||||
- cron: '*/5 * * * *'
|
||||
# Exercise the real Cursor sandbox/config/auth path once per day so a
|
||||
# provider behavior change cannot hide behind green Codex polling runs.
|
||||
- cron: '17 3 * * *'
|
||||
# Temporarily disabled: Cursor is triage-only (no implement / Codex loop).
|
||||
# Restore both crons when CURSOR_AUTOMATION_MODE is set back to `full`.
|
||||
# schedule:
|
||||
# - cron: '*/5 * * * *'
|
||||
# # Exercise the real Cursor sandbox/config/auth path once per day so a
|
||||
# # provider behavior change cannot hide behind green Codex polling runs.
|
||||
# - cron: '17 3 * * *'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
issue_number:
|
||||
@@ -73,6 +75,9 @@ permissions:
|
||||
actions: read
|
||||
|
||||
env:
|
||||
# Temporary: classify issues only. Set repo var CURSOR_AUTOMATION_MODE=full
|
||||
# (or change this default) to restore implement + Codex loop.
|
||||
CURSOR_AUTOMATION_MODE: ${{ vars.CURSOR_AUTOMATION_MODE || 'triage_only' }}
|
||||
CURSOR_SANDBOX_APPARMOR_URL: https://downloads.cursor.com/lab/enterprise/cursor-sandbox-apparmor_0.6.0_all.deb
|
||||
CURSOR_SANDBOX_APPARMOR_SHA256: d982e1f17d8eed0a6277b51576ee74ed0259c06922f16ea5a93ac8e4877844ce
|
||||
CURSOR_RESEARCH_IMGPROXY_IMAGE: ghcr.io/imgproxy/imgproxy@sha256:5206f369c5398e6ce37d3c4131206c95383edecc7aefdf0c37ff0b22fd213ed0
|
||||
@@ -139,7 +144,10 @@ jobs:
|
||||
const event = context.eventName;
|
||||
const ownActors = process.env.OWN_ACTORS;
|
||||
const set = (kind, extra = {}) => {
|
||||
core.setOutput('kind', kind);
|
||||
const gated = auto.gateAutomationRoute(kind, {
|
||||
reason: extra.reason || kind,
|
||||
});
|
||||
core.setOutput('kind', gated.kind);
|
||||
core.setOutput('issue_number', extra.issue_number || '');
|
||||
core.setOutput('pull_number', extra.pull_number || '');
|
||||
core.setOutput('trigger_comment_id', extra.trigger_comment_id || '');
|
||||
@@ -147,7 +155,7 @@ jobs:
|
||||
'head_ref',
|
||||
extra.head_ref || context.payload.pull_request?.head?.ref || '',
|
||||
);
|
||||
core.setOutput('reason', extra.reason || kind);
|
||||
core.setOutput('reason', gated.reason);
|
||||
};
|
||||
|
||||
if (event === 'schedule') {
|
||||
|
||||
@@ -21,6 +21,8 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v7
|
||||
@@ -50,11 +52,18 @@ jobs:
|
||||
- name: Test
|
||||
run: npm test
|
||||
|
||||
- name: Test terminal decoration performance
|
||||
- name: Test terminal keyword highlight performance
|
||||
env:
|
||||
NETCATTY_TERMINAL_PERF_SHOW_WINDOW: "1"
|
||||
# GitHub-hosted runners do not configure Electron's SUID sandbox helper.
|
||||
run: xvfb-run -a ./node_modules/.bin/electron --no-sandbox scripts/xterm-decoration-performance.live.test.cjs
|
||||
run: xvfb-run -a ./node_modules/.bin/electron --no-sandbox scripts/xterm-keyword-highlight-performance.live.test.cjs
|
||||
|
||||
- name: Test terminal keyword highlight throughput
|
||||
env:
|
||||
NETCATTY_TERMINAL_PERF_MAIN_REF: ${{ github.event.pull_request.base.sha || 'HEAD^' }}
|
||||
NETCATTY_TERMINAL_PERF_ROUNDS: "3"
|
||||
NETCATTY_TERMINAL_PERF_SHOW_WINDOW: "1"
|
||||
run: xvfb-run -a ./node_modules/.bin/electron --no-sandbox scripts/xterm-keyword-highlight-throughput.live.test.cjs
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
@@ -72,6 +72,7 @@ import { useExternalMcpSessionSync } from '../state/useExternalMcpSessionSync';
|
||||
import {
|
||||
STORAGE_KEY_DEBUG_HOTKEYS,
|
||||
STORAGE_KEY_PORT_FORWARDING,
|
||||
STORAGE_KEY_STARTUP_LANDING,
|
||||
} from '../../infrastructure/config/storageKeys';
|
||||
import { getEffectiveKnownHosts } from '../../infrastructure/syncHelpers';
|
||||
import { toast } from '../../components/ui/toast';
|
||||
@@ -79,11 +80,12 @@ import { VaultSection } from '../../components/VaultView';
|
||||
import { KeyboardInteractiveRequest } from '../../components/KeyboardInteractiveModal';
|
||||
import { PassphraseRequest } from '../../components/PassphraseModal';
|
||||
import { classifyLocalShellType } from '../../lib/localShell';
|
||||
import { useDiscoveredShells, resolveShellSetting } from '../../lib/useDiscoveredShells';
|
||||
import { useDiscoveredShells, resolveShellSetting, ensureDiscoveredShells } from '../../lib/useDiscoveredShells';
|
||||
import { Host, HostProtocol, KnownHost, SerialConfig, Snippet, SSHKey, TerminalSession } from '../../types';
|
||||
import { resolveSnippetCommand } from '../../components/SnippetExecutionProvider';
|
||||
import { isScriptSnippet } from '../../domain/snippetScript.ts';
|
||||
import { collectSnippetDeleteIds } from '../../domain/snippetSelection.ts';
|
||||
import { shouldOpenLocalTerminalOnStartup, resolveStartupLandingSetting } from '../../domain/startupLanding';
|
||||
import { useAppStartupEffects } from './useAppStartupEffects';
|
||||
import { handleTrayJumpToSessionImpl, handleTrayTogglePortForwardImpl, handleTrayPanelConnectImpl, handleTrayPanelConnectRequestImpl, flushQueuedTrayPanelConnectHostsImpl, handleGlobalHotkeyKeyDownImpl, handleEscapeKeyDownImpl, handleKeyboardInteractiveSubmitImpl, handleKeyboardInteractiveCancelImpl, handlePassphraseSubmitImpl, handlePassphraseCancelImpl, handlePassphraseSkipImpl, createLocalTerminalWithCurrentShellImpl, splitSessionWithCurrentShellImpl, copySessionWithCurrentShellImpl, copyWorkspaceWithCurrentShellImpl, copySessionToNewWindowWithCurrentShellImpl, confirmIfBusyLocalTerminalImpl, closeTabsBatchImpl, executeHotkeyActionImpl, handleCreateLocalTerminalImpl, handleConnectToHostImpl, handleTerminalDataCaptureImpl, hasMultipleProtocolsImpl, handleHostConnectWithProtocolCheckImpl, handleProtocolSelectImpl, handleRootContextMenuImpl } from './AppHandlers';
|
||||
|
||||
@@ -200,6 +202,7 @@ export function AppSideEffects() {
|
||||
readPersistedHosts,
|
||||
groupConfigs,
|
||||
updateGroupConfigs,
|
||||
commitVaultGroupMutation,
|
||||
} = vaultState;
|
||||
|
||||
const hostsRef = useRef(hosts);
|
||||
@@ -1176,6 +1179,100 @@ export function AppSideEffects() {
|
||||
);
|
||||
}, [addConnectionLog, createLocalTerminal, terminalSettings, discoveredShells]);
|
||||
|
||||
// Cold-start landing: open a local terminal once when preferred and nothing
|
||||
// was restored. Wait for queued launch intents (deep links / Explorer open)
|
||||
// and shell discovery so we neither duplicate tabs nor mislabel WSL/Git Bash.
|
||||
const startupLocalTerminalAttemptedRef = useRef(false);
|
||||
const startupLaunchIntentReceivedRef = useRef(false);
|
||||
const sessionsLengthRef = useRef(sessions.length);
|
||||
const workspacesLengthRef = useRef(workspaces.length);
|
||||
sessionsLengthRef.current = sessions.length;
|
||||
workspacesLengthRef.current = workspaces.length;
|
||||
const [coldStartIntentsSettled, setColdStartIntentsSettled] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (isPeerSessionWindow) {
|
||||
setColdStartIntentsSettled(true);
|
||||
return;
|
||||
}
|
||||
const bridge = netcattyBridge.get();
|
||||
if (!bridge?.onColdStartIntentsSettled) {
|
||||
setColdStartIntentsSettled(true);
|
||||
return;
|
||||
}
|
||||
return bridge.onColdStartIntentsSettled(() => {
|
||||
setColdStartIntentsSettled(true);
|
||||
});
|
||||
}, [isPeerSessionWindow]);
|
||||
|
||||
useEffect(() => {
|
||||
if (startupLocalTerminalAttemptedRef.current) return;
|
||||
if (isPeerSessionWindow) {
|
||||
startupLocalTerminalAttemptedRef.current = true;
|
||||
return;
|
||||
}
|
||||
|
||||
const landing = resolveStartupLandingSetting(
|
||||
localStorageAdapter.readString(STORAGE_KEY_STARTUP_LANDING),
|
||||
);
|
||||
if (landing !== 'local-terminal') {
|
||||
startupLocalTerminalAttemptedRef.current = true;
|
||||
return;
|
||||
}
|
||||
if (sessions.length > 0 || workspaces.length > 0) {
|
||||
startupLocalTerminalAttemptedRef.current = true;
|
||||
return;
|
||||
}
|
||||
if (!coldStartIntentsSettled) return;
|
||||
|
||||
let cancelled = false;
|
||||
void (async () => {
|
||||
const shells = await ensureDiscoveredShells();
|
||||
if (cancelled || startupLocalTerminalAttemptedRef.current) return;
|
||||
|
||||
if (!shouldOpenLocalTerminalOnStartup({
|
||||
startupLanding: landing,
|
||||
hasRestoredSessionState:
|
||||
sessionsLengthRef.current > 0 || workspacesLengthRef.current > 0,
|
||||
isPeerSessionWindow: false,
|
||||
hasQueuedStartupIntent: startupLaunchIntentReceivedRef.current,
|
||||
})) {
|
||||
startupLocalTerminalAttemptedRef.current = true;
|
||||
return;
|
||||
}
|
||||
|
||||
const resolved = resolveShellSetting(
|
||||
terminalSettings.localShell,
|
||||
shells,
|
||||
terminalSettings.localShellArgs,
|
||||
);
|
||||
const matchedShell = shells.find((shell) => shell.id === terminalSettings.localShell);
|
||||
startupLocalTerminalAttemptedRef.current = true;
|
||||
handleCreateLocalTerminal(
|
||||
resolved
|
||||
? {
|
||||
command: resolved.command,
|
||||
args: resolved.args,
|
||||
name: matchedShell?.name,
|
||||
icon: matchedShell?.icon,
|
||||
}
|
||||
: undefined,
|
||||
);
|
||||
})();
|
||||
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, [
|
||||
coldStartIntentsSettled,
|
||||
handleCreateLocalTerminal,
|
||||
isPeerSessionWindow,
|
||||
sessions.length,
|
||||
terminalSettings.localShell,
|
||||
terminalSettings.localShellArgs,
|
||||
workspaces.length,
|
||||
]);
|
||||
|
||||
const proxyProfileIdSet = useMemo(
|
||||
() => new Set(proxyProfiles.map((profile) => profile.id)),
|
||||
[proxyProfiles],
|
||||
@@ -1283,6 +1380,7 @@ export function AppSideEffects() {
|
||||
groupConfigs,
|
||||
updateGroupConfigs,
|
||||
updateManagedSources,
|
||||
commitVaultGroupMutation,
|
||||
updatePortForwardingRules: importPortForwardingRules,
|
||||
startTunnel,
|
||||
stopTunnel,
|
||||
@@ -1293,6 +1391,7 @@ export function AppSideEffects() {
|
||||
});
|
||||
|
||||
const _handleSshDeepLink = useEffectEvent((payload: { url?: string }) => {
|
||||
startupLaunchIntentReceivedRef.current = true;
|
||||
const rawUrl = payload?.url || '';
|
||||
const target = parseSshDeepLink(rawUrl);
|
||||
if (!target) {
|
||||
@@ -1350,6 +1449,7 @@ export function AppSideEffects() {
|
||||
}, [isPeerSessionWindow]);
|
||||
|
||||
const _handleTelnetDeepLink = useEffectEvent((payload: { url?: string }) => {
|
||||
startupLaunchIntentReceivedRef.current = true;
|
||||
const rawUrl = payload?.url || '';
|
||||
const target = parseTelnetDeepLink(rawUrl);
|
||||
if (!target) {
|
||||
@@ -1396,6 +1496,7 @@ export function AppSideEffects() {
|
||||
}, [isPeerSessionWindow]);
|
||||
|
||||
const _handleJmsDeepLink = useEffectEvent((payload: { url?: string }) => {
|
||||
startupLaunchIntentReceivedRef.current = true;
|
||||
const rawUrl = payload?.url || '';
|
||||
const target = parseJmsDeepLink(rawUrl);
|
||||
if (!target) {
|
||||
@@ -1435,6 +1536,7 @@ export function AppSideEffects() {
|
||||
}, [sessions]);
|
||||
|
||||
const _handleOpenTerminalPath = useEffectEvent((payload: { path?: string }) => {
|
||||
startupLaunchIntentReceivedRef.current = true;
|
||||
const localStartDir = typeof payload?.path === 'string' ? payload.path : '';
|
||||
if (!localStartDir.trim()) return;
|
||||
handleCreateLocalTerminal(undefined, { localStartDir });
|
||||
|
||||
@@ -258,7 +258,7 @@ function AppViewInner({ domains }: AppViewProps) {
|
||||
|
||||
const {
|
||||
addShellHistoryEntry, removeShellHistoryEntry, addSessionToWorkspace, addToWorkspaceDialog, appendHostToWorkspace, appendLocalTerminalToWorkspace,
|
||||
clearAndRemoveSource, clearAndRemoveSources, closeLogView, closeSession, closeTabsBatch, closeWorkspace, commitPluginImporterData, commitVaultImportTransaction, copySessionToNewWindowWithCurrentShell, copySessionWithCurrentShell, copyWorkspaceWithCurrentShell,
|
||||
clearAndRemoveSource, clearAndRemoveSources, closeLogView, closeSession, closeTabsBatch, closeWorkspace, commitPluginImporterData, commitVaultImportTransaction, commitVaultGroupMutation, copySessionToNewWindowWithCurrentShell, copySessionWithCurrentShell, copyWorkspaceWithCurrentShell,
|
||||
convertKnownHostToHost, createWorkspaceFromSessions, createWorkspaceFromTargets, createWorkspaceWithHosts,
|
||||
customGroups, currentTerminalTheme, deepLinkHostDraft, draggingSessionId, effectiveKnownHosts, editorTabs, editorWordWrap, emptyVaultConflict,
|
||||
followAppTerminalTheme,
|
||||
@@ -592,6 +592,7 @@ function AppViewInner({ domains }: AppViewProps) {
|
||||
onUpdateManagedSources={updateManagedSources}
|
||||
onReadPersistedManagedSources={readPersistedManagedSources}
|
||||
onCommitVaultImportTransaction={commitVaultImportTransaction}
|
||||
onCommitVaultGroupMutation={commitVaultGroupMutation}
|
||||
onClearAndRemoveManagedSource={clearAndRemoveSource}
|
||||
onClearAndRemoveManagedSources={clearAndRemoveSources}
|
||||
onUnmanageSource={unmanageSource}
|
||||
|
||||
@@ -38,6 +38,7 @@ export function VaultHost() {
|
||||
removeShellHistoryEntry: actions?.removeShellHistoryEntry,
|
||||
commitPluginImporterData: actions?.commitPluginImporterData,
|
||||
commitVaultImportTransaction: actions?.commitVaultImportTransaction,
|
||||
commitVaultGroupMutation: actions?.commitVaultGroupMutation,
|
||||
convertKnownHostToHost: actions?.convertKnownHostToHost,
|
||||
customGroups: vault.customGroups,
|
||||
deepLinkHostDraft: local.deepLinkHostDraft,
|
||||
|
||||
@@ -67,6 +67,7 @@ export function VaultPublisher({ children }: VaultPublisherProps) {
|
||||
readPersistedManagedSources,
|
||||
commitPluginImporterData,
|
||||
commitVaultImportTransaction,
|
||||
commitVaultGroupMutation,
|
||||
updateHostDistro,
|
||||
updateHostLastConnected,
|
||||
addShellHistoryEntry,
|
||||
@@ -138,6 +139,7 @@ export function VaultPublisher({ children }: VaultPublisherProps) {
|
||||
readPersistedManagedSources,
|
||||
commitPluginImporterData,
|
||||
commitVaultImportTransaction,
|
||||
commitVaultGroupMutation,
|
||||
updateHostDistro,
|
||||
updateHostLastConnected,
|
||||
addShellHistoryEntry,
|
||||
@@ -150,6 +152,7 @@ export function VaultPublisher({ children }: VaultPublisherProps) {
|
||||
addShellHistoryEntry,
|
||||
commitPluginImporterData,
|
||||
commitVaultImportTransaction,
|
||||
commitVaultGroupMutation,
|
||||
convertKnownHostToHost,
|
||||
importOrReuseKey,
|
||||
readPersistedHosts,
|
||||
|
||||
@@ -3,6 +3,7 @@ import assert from 'node:assert/strict';
|
||||
|
||||
import en from '../locales/en.ts';
|
||||
import ru from '../locales/ru.ts';
|
||||
import es from '../locales/es.ts';
|
||||
import zhCN from '../locales/zh-CN.ts';
|
||||
import zhTW from '../locales/zh-TW.ts';
|
||||
|
||||
@@ -39,7 +40,7 @@ const keys = [
|
||||
] as const;
|
||||
|
||||
test('convergent sync copy exists in every bundled locale', () => {
|
||||
for (const [locale, messages] of Object.entries({ en, ru, zhCN, zhTW })) {
|
||||
for (const [locale, messages] of Object.entries({ en, ru, es, zhCN, zhTW })) {
|
||||
for (const key of keys) {
|
||||
assert.equal(typeof messages[key], 'string', `${locale} is missing ${key}`);
|
||||
assert.notEqual(messages[key], '', `${locale} has empty ${key}`);
|
||||
|
||||
@@ -3,6 +3,7 @@ import assert from "node:assert/strict";
|
||||
|
||||
import en from "../locales/en.ts";
|
||||
import ru from "../locales/ru.ts";
|
||||
import es from "../locales/es.ts";
|
||||
import zhCN from "../locales/zh-CN.ts";
|
||||
|
||||
const strategyKeys = [
|
||||
@@ -17,7 +18,7 @@ const strategyKeys = [
|
||||
] as const;
|
||||
|
||||
test("cloud sync strategy copy exists in every bundled locale", () => {
|
||||
for (const [locale, messages] of Object.entries({ en, ru, zhCN })) {
|
||||
for (const [locale, messages] of Object.entries({ en, ru, es, zhCN })) {
|
||||
for (const key of strategyKeys) {
|
||||
assert.equal(
|
||||
typeof messages[key],
|
||||
|
||||
@@ -3,6 +3,7 @@ import test from 'node:test';
|
||||
|
||||
import en from './en.ts';
|
||||
import ru from './ru.ts';
|
||||
import es from './es.ts';
|
||||
import zhCN from './zh-CN.ts';
|
||||
import zhTW from './zh-TW.ts';
|
||||
|
||||
@@ -19,7 +20,7 @@ const STEER_KEYS = [
|
||||
] as const;
|
||||
|
||||
test('Codex steering UI is localized in every supported locale', () => {
|
||||
for (const [name, messages] of Object.entries({ en, 'zh-CN': zhCN, 'zh-TW': zhTW, ru })) {
|
||||
for (const [name, messages] of Object.entries({ en, es, 'zh-CN': zhCN, 'zh-TW': zhTW, ru })) {
|
||||
const missing = STEER_KEYS.filter(key => !messages[key]);
|
||||
assert.deepEqual(missing, [], `${name} is missing Codex steering labels`);
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ export const enAiMessages: Messages = {
|
||||
'ai.providers.apiKey.placeholder': 'Enter API key',
|
||||
'ai.providers.apiKey.decrypting': 'Decrypting...',
|
||||
'ai.providers.baseUrl': 'Base URL',
|
||||
'ai.providers.baseUrl.anthropicHelp': 'Anthropic-compatible: host with or without /v1 (for example https://gateway.example or https://gateway.example/v1). Detection and chat both use /v1/models and /v1/messages.',
|
||||
'ai.providers.skipTLSVerify': 'Skip TLS certificate verification (for self-signed certs)',
|
||||
'ai.providers.defaultModel': 'Default Model',
|
||||
'ai.providers.defaultModel.placeholder': 'e.g. gpt-4o, claude-sonnet-4-20250514',
|
||||
|
||||
@@ -173,6 +173,10 @@ export const enCoreMessages: Messages = {
|
||||
|
||||
// Settings > Session Restore
|
||||
'settings.sessionRestore.title': 'Session Restore',
|
||||
'settings.sessionRestore.startupLanding': 'On launch',
|
||||
'settings.sessionRestore.startupLandingDesc': 'Choose whether to open the host home page or a local terminal when Netcatty starts with no restored sessions.',
|
||||
'settings.sessionRestore.startupLanding.vault': 'Home (hosts)',
|
||||
'settings.sessionRestore.startupLanding.localTerminal': 'Local terminal',
|
||||
'settings.sessionRestore.restorePreviousSession': 'Restore previous tabs and workspaces',
|
||||
'settings.sessionRestore.restorePreviousSessionDesc': 'Reopen terminal tabs and workspace layouts from the last app session.',
|
||||
'settings.sessionRestore.restoreTerminalCwd': 'Restore terminal working directory',
|
||||
|
||||
@@ -18,8 +18,11 @@ export const enScriptsMessages = {
|
||||
'scripts.editor.modalSubtitle': 'Edit metadata and script code in a larger workspace.',
|
||||
'scripts.editor.lineCount': '{count} lines',
|
||||
'scripts.editor.resize': 'Resize editor',
|
||||
'scripts.targets.hint': 'Automatic triggers apply to selected hosts, or to all hosts when that option is enabled.',
|
||||
'scripts.targets.hint': 'Selected groups are resolved dynamically, so hosts added later are included automatically.',
|
||||
'scripts.targets.connectOrderHint': 'Run order for connect scripts is configured per host under Host details → Automation.',
|
||||
'scripts.targets.currentHostMismatch': 'This script is not assigned to the current host.',
|
||||
'hostDetails.automation.groupScripts': 'Inherited group scripts',
|
||||
'hostDetails.automation.groupScriptsHint': 'These scripts follow the host group dynamically and are ordered before the host-specific queue.',
|
||||
'scripts.actions.runNowHint': 'Run on selected targets, or on all connectable hosts when that option is enabled.',
|
||||
'scripts.actions.runParallel': 'Run on all tabs (parallel)',
|
||||
'scripts.actions.runSequential': 'Run on all tabs (sequential)',
|
||||
|
||||
@@ -659,6 +659,9 @@ export const enTerminalMessages: Messages = {
|
||||
'snippets.scriptEditor.modalTitle': 'Edit script',
|
||||
'snippets.targets.title': 'Targets',
|
||||
'snippets.targets.add': 'Add targets',
|
||||
'snippets.targets.selectHosts': 'Hosts',
|
||||
'snippets.targets.selectGroups': 'Groups',
|
||||
'snippets.targets.noGroups': 'No groups found',
|
||||
'snippets.targets.allHosts': 'Apply to all hosts',
|
||||
'snippets.targets.allHostsShort': 'All hosts',
|
||||
'snippets.targets.allHostsActive': 'Applies to every connectable host.',
|
||||
@@ -745,7 +748,7 @@ export const enTerminalMessages: Messages = {
|
||||
'snippets.shortkey.recording': 'Press a key combination...',
|
||||
'snippets.shortkey.hint': 'Press this shortcut in terminal to quickly send the command.',
|
||||
'snippets.shortkey.clear': 'Clear shortcut',
|
||||
'snippets.shortkey.error.systemConflict': 'This shortcut conflicts with a system shortcut',
|
||||
'snippets.shortkey.error.systemConflict': 'This shortcut conflicts with {name}',
|
||||
'snippets.shortkey.error.snippetConflict': 'This shortcut is already used by snippet: {name}',
|
||||
|
||||
'snippets.variables.dialogTitle': 'Snippet variables',
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import type { Messages } from './types';
|
||||
import { esCoreMessages } from './es/core';
|
||||
import { esVaultMessages } from './es/vault';
|
||||
import { esTerminalMessages } from './es/terminal';
|
||||
import { esAiMessages } from './es/ai';
|
||||
import { esSystemManagerMessages } from './es/systemManager';
|
||||
import { esScriptsMessages } from './es/scripts';
|
||||
|
||||
export type { Messages } from './types';
|
||||
|
||||
const es: Messages = {
|
||||
...esCoreMessages,
|
||||
...esVaultMessages,
|
||||
...esTerminalMessages,
|
||||
...esAiMessages,
|
||||
...esSystemManagerMessages,
|
||||
...esScriptsMessages,
|
||||
};
|
||||
|
||||
export default es;
|
||||
@@ -0,0 +1,638 @@
|
||||
import type { Messages } from '../types';
|
||||
|
||||
export const esAiMessages: Messages = {
|
||||
// AI Settings
|
||||
'ai.agentSettings': 'Configuración del agente',
|
||||
'ai.chat.preparing': 'Preparando…',
|
||||
'ai.chat.compactingContext': 'Compactando el contexto anterior…',
|
||||
'ai.chat.compactingStep': 'Recortando el contexto para el siguiente paso…',
|
||||
'ai.chat.compactionRetry': 'La petición era demasiado grande. Compactando el contexto y reintentando…',
|
||||
'ai.chat.compactionBanner': 'Contexto compactado: {before}K → {after}K tokens',
|
||||
'ai.chat.contextUsage': 'Uso de contexto: {used} / {max} tokens',
|
||||
'ai.chat.activity.title': 'Actividad del agente',
|
||||
'ai.chat.activity.plan': 'Plan',
|
||||
'ai.chat.activity.webSearch': 'Búsqueda web',
|
||||
'ai.chat.activity.fileChanges': 'Cambios de archivos',
|
||||
'ai.chat.activity.status.running': 'En ejecución',
|
||||
'ai.chat.activity.status.completed': 'Completado',
|
||||
'ai.chat.activity.status.failed': 'Falló',
|
||||
'ai.chat.activity.file.add': 'Agregar',
|
||||
'ai.chat.activity.file.update': 'Actualizar',
|
||||
'ai.chat.activity.file.delete': 'Eliminar',
|
||||
'ai.chat.activity.usage': 'Tokens',
|
||||
'ai.chat.activity.usage.input': 'entrada',
|
||||
'ai.chat.activity.usage.output': 'salida',
|
||||
'ai.chat.activity.usage.cached': 'en caché',
|
||||
'ai.chat.activity.usage.reasoning': 'razonamiento',
|
||||
'ai.title': 'IA',
|
||||
'ai.description': 'Configura proveedores de IA, agentes y ajustes de seguridad',
|
||||
'ai.providers': 'Proveedores',
|
||||
'ai.agents': 'Agentes',
|
||||
'ai.providers.empty': 'No hay proveedores configurados. Agrega un proveedor para comenzar.',
|
||||
'ai.providers.add': 'Agregar proveedor',
|
||||
'ai.providers.active': 'Activo',
|
||||
'ai.providers.apiKeyConfigured': 'Clave de API configurada',
|
||||
'ai.providers.noApiKey': 'Sin clave de API',
|
||||
'ai.providers.configure': 'Configurar',
|
||||
'ai.providers.remove': 'Quitar',
|
||||
'ai.providers.name': 'Nombre para mostrar',
|
||||
'ai.providers.name.placeholder': 'p. ej. Mi proveedor',
|
||||
'ai.providers.style': 'Estilo de protocolo',
|
||||
'ai.providers.style.anthropic': 'Compatible con Anthropic',
|
||||
'ai.providers.style.openai': 'Compatible con OpenAI',
|
||||
'ai.providers.style.google': 'Compatible con Google',
|
||||
'ai.providers.style.inherited': 'auto',
|
||||
'ai.providers.style.help': 'Selecciona qué formato de API usan las peticiones. Anúlalo cuando un endpoint de terceros hable un dialecto distinto al que sugiere su tipo de proveedor.',
|
||||
'ai.providers.icon.change': 'Cambiar ícono',
|
||||
'ai.providers.icon.upload': 'Subir imagen',
|
||||
'ai.providers.icon.reset': 'Restablecer',
|
||||
'ai.providers.icon.close': 'Cerrar',
|
||||
'ai.providers.icon.uploadedNote': 'Ícono personalizado (64×64 WebP)',
|
||||
'ai.providers.icon.errorType': 'Elige un archivo de imagen.',
|
||||
'ai.providers.apiKey': 'Clave de API',
|
||||
'ai.providers.apiKey.placeholder': 'Ingresa la clave de API',
|
||||
'ai.providers.apiKey.decrypting': 'Descifrando...',
|
||||
'ai.providers.baseUrl': 'URL base',
|
||||
'ai.providers.baseUrl.anthropicHelp': 'Compatible con Anthropic: host con o sin /v1 (por ejemplo https://gateway.example o https://gateway.example/v1). La detección y el chat usan /v1/models y /v1/messages.',
|
||||
'ai.providers.skipTLSVerify': 'Omitir la verificación del certificado TLS (para certificados autofirmados)',
|
||||
'ai.providers.defaultModel': 'Modelo predeterminado',
|
||||
'ai.providers.defaultModel.placeholder': 'p. ej. gpt-4o, claude-sonnet-4-20250514',
|
||||
'ai.providers.contextWindow': 'Ventana de contexto',
|
||||
'ai.providers.contextWindow.placeholder': 'p. ej. 128000',
|
||||
'ai.providers.contextWindow.help': 'Déjalo en blanco para usar el valor de la lista de modelos cuando esté disponible; de lo contrario, Netcatty usa un valor predeterminado seguro.',
|
||||
'ai.providers.contextWindow.error': 'Ingresa un número entero positivo o déjalo en blanco.',
|
||||
'ai.providers.refreshModels': 'Actualizar modelos',
|
||||
'ai.providers.test': 'Probar',
|
||||
'ai.providers.test.testing': 'Probando…',
|
||||
'ai.providers.test.ok': 'Conectado ({latency} ms)',
|
||||
'ai.providers.test.warn': 'Se alcanzó el endpoint, pero la respuesta parece incompleta ({latency} ms)',
|
||||
'ai.providers.test.warnSlow': 'Conectado, pero lento ({latency} ms)',
|
||||
'ai.providers.test.error': 'Falló ({detail})',
|
||||
'ai.providers.test.missingBaseUrl': 'Primero ingresa una URL base',
|
||||
'ai.providers.test.missingApiKey': 'Primero ingresa una clave de API',
|
||||
'ai.providers.test.unavailable': 'La prueba de conexión no está disponible en este entorno',
|
||||
'ai.providers.searchModel': 'Busca o escribe el ID del modelo...',
|
||||
'ai.providers.filterModels': 'Filtrar modelos...',
|
||||
'ai.providers.loadingModels': 'Cargando modelos...',
|
||||
'ai.providers.noMatchingModels': 'No hay modelos que coincidan',
|
||||
'ai.providers.clickToLoadModels': 'Haz clic para cargar los modelos',
|
||||
'ai.providers.showingModels': 'Mostrando los primeros 100 de {count} modelos. Escribe para filtrar.',
|
||||
'ai.providers.advancedParams': 'Parámetros avanzados',
|
||||
'ai.providers.advancedParams.hint': 'Déjalo en blanco para usar los valores predeterminados del proveedor.',
|
||||
'ai.providers.advancedParams.maxTokens.placeholder': 'p. ej. 4096',
|
||||
'ai.providers.advancedParams.default': 'Predeterminado del proveedor',
|
||||
|
||||
// AI Codex
|
||||
'ai.codex': 'Codex',
|
||||
'ai.codex.title': 'Codex CLI',
|
||||
'ai.codex.description': 'Conecta OpenAI Codex. Inicia sesión con ChatGPT aquí, o habilita una clave de API de un proveedor compatible con OpenAI y un endpoint personalizado en Configuración.',
|
||||
'ai.codex.appServer.title': 'Usar Codex App Server',
|
||||
'ai.codex.appServer.experimental': 'Experimental',
|
||||
'ai.codex.appServer.description': 'Usa el protocolo persistente de Codex para aprobaciones nativas, controles de sandbox, modelos en vivo y preguntas a mitad de turno. El SDK sigue siendo el predeterminado.',
|
||||
'ai.codex.appServer.checking': 'Comprobando la compatibilidad con App Server…',
|
||||
'ai.codex.appServer.available': 'App Server está disponible para esta Codex CLI.',
|
||||
'ai.codex.appServer.modelCatalogWarning': 'El catálogo de modelos de Codex en vivo no está disponible. Se usa la lista de modelos integrada.',
|
||||
'ai.codex.appServer.approval.allowSession': 'Permitir por sesión',
|
||||
'ai.codex.appServer.userInput.title': 'Codex necesita tu aporte',
|
||||
'ai.codex.appServer.userInput.description': 'Responde estas preguntas para continuar el turno actual.',
|
||||
'ai.codex.appServer.userInput.other': 'Ingresa otra respuesta',
|
||||
'ai.codex.appServer.userInput.autoResolve': 'Codex continuará automáticamente si no se proporciona una respuesta a tiempo.',
|
||||
'ai.codex.appServer.userInput.skip': 'Omitir',
|
||||
'ai.codex.appServer.userInput.submit': 'Continuar',
|
||||
'ai.codex.steer.addInstruction': 'Agregar instrucción',
|
||||
'ai.codex.steer.sending': 'Agregando instrucción…',
|
||||
'ai.codex.steer.placeholder': 'Agrega una instrucción mientras Codex está trabajando…',
|
||||
'ai.codex.steer.notSteerableReview': 'Este turno de revisión de Codex no puede aceptar instrucciones adicionales. Tu borrador se conservó.',
|
||||
'ai.codex.steer.notSteerableCompact': 'Este turno de compactación de Codex no puede aceptar instrucciones adicionales. Tu borrador se conservó.',
|
||||
'ai.codex.steer.busy': 'Ya se está enviando otra instrucción a Codex.',
|
||||
'ai.codex.steer.inactive': 'El turno de Codex ya terminó. Tu borrador se conservó.',
|
||||
'ai.codex.steer.unsupported': 'Las instrucciones en curso requieren el runtime de Codex App Server.',
|
||||
'ai.codex.steer.failed': 'Codex no pudo aceptar la instrucción adicional. Tu borrador se conservó.',
|
||||
'ai.codex.detecting': 'Detectando...',
|
||||
'ai.codex.notFound': 'No encontrado',
|
||||
'ai.codex.awaitingLogin': 'Esperando inicio de sesión',
|
||||
'ai.codex.connectedChatGPT': 'Conectado mediante ChatGPT',
|
||||
'ai.codex.connectedApiKey': 'Conectado mediante clave de API',
|
||||
'ai.codex.connectedCustomConfig': 'Conectado mediante ~/.codex/config.toml',
|
||||
'ai.codex.customConfigIncomplete': 'Configuración personalizada detectada (falta la variable de entorno)',
|
||||
'ai.codex.customConfigHint': 'Usando el proveedor personalizado "{provider}" configurado en ~/.codex/config.toml: no se necesita inicio de sesión con ChatGPT.',
|
||||
'ai.codex.customConfigMissingEnvKey': 'Advertencia: {envKey} no está definida en tu entorno de shell. Expórtala (o inicia netcatty desde un shell que la tenga) para que Codex pueda autenticarse.',
|
||||
'ai.codex.notConnected': 'No conectado',
|
||||
'ai.codex.statusUnknown': 'Estado desconocido',
|
||||
'ai.codex.path': 'Ruta:',
|
||||
'ai.codex.notFoundHint': 'No se pudo encontrar codex en el PATH. Instálalo o especifica la ruta del ejecutable a continuación.',
|
||||
'ai.codex.customPathPlaceholder': 'p. ej. /usr/local/bin/codex',
|
||||
'ai.codex.check': 'Verificar',
|
||||
'ai.codex.resetPath': 'Restablecer',
|
||||
'ai.codex.openLogin': 'Abrir inicio de sesión',
|
||||
'ai.codex.logout': 'Cerrar sesión',
|
||||
'ai.codex.connectChatGPT': 'Conectar ChatGPT',
|
||||
'ai.codex.refreshStatus': 'Actualizar estado',
|
||||
|
||||
// AI Claude Code
|
||||
'ai.claude.title': 'Claude Code',
|
||||
'ai.claude.description': "El asistente de codificación agéntica de Anthropic. Requiere la CLI de Claude Code del sistema.",
|
||||
'ai.claude.detecting': 'Detectando...',
|
||||
'ai.claude.detected': 'Detectado',
|
||||
'ai.claude.notFound': 'No encontrado',
|
||||
'ai.claude.path': 'Ruta:',
|
||||
'ai.claude.notFoundHint': 'No se pudo encontrar claude en el PATH. Instálalo o especifica la ruta del ejecutable a continuación.',
|
||||
'ai.claude.customPathPlaceholder': 'p. ej. /usr/local/bin/claude',
|
||||
'ai.claude.configSection': 'Autenticación y configuración (opcional)',
|
||||
'ai.claude.configDir': 'Directorio de configuración',
|
||||
'ai.claude.configDir.placeholder': '~/.claude (déjalo en blanco para usar el predeterminado)',
|
||||
'ai.claude.configDir.hint': 'Define CLAUDE_CONFIG_DIR: apunta a una carpeta donde hayas ejecutado el inicio de sesión `claude` (contiene settings.json + credenciales).',
|
||||
'ai.claude.settings': 'Archivo de configuración',
|
||||
'ai.claude.settings.placeholder': '~/team-settings.json (ruta o JSON en línea {"model":"..."})',
|
||||
'ai.claude.settings.hint': 'Opcional. Una ruta a settings.json o un JSON en línea, pasado al SDK como `settings`. Se suma a — y es independiente de — el directorio de configuración anterior (se combina por encima, no lo reemplaza).',
|
||||
'ai.claude.envVars': 'Variables de entorno',
|
||||
'ai.claude.envVars.placeholder': 'ANTHROPIC_BASE_URL=https://...\nANTHROPIC_MODEL=...',
|
||||
'ai.claude.envVars.hint': 'Una KEY=VALUE por línea, pasada al agente de Claude. Se almacena localmente en texto plano; para claves de API o credenciales, prefiere el directorio de configuración anterior (un inicio de sesión `claude`).',
|
||||
'ai.claude.check': 'Verificar',
|
||||
'ai.claude.resetPath': 'Restablecer',
|
||||
|
||||
// AI GitHub Copilot CLI
|
||||
'ai.copilot.title': 'GitHub Copilot CLI',
|
||||
'ai.copilot.description': 'Usa la CLI de GitHub Copilot. Una vez detectada, se puede seleccionar como agente de codificación externo.',
|
||||
'ai.copilot.detecting': 'Detectando...',
|
||||
'ai.copilot.detected': 'Detectado',
|
||||
'ai.copilot.notFound': 'No encontrado',
|
||||
'ai.copilot.path': 'Ruta:',
|
||||
'ai.copilot.notFoundHint': 'No se pudo encontrar copilot en el PATH. Instálalo o especifica la ruta del ejecutable a continuación.',
|
||||
'ai.copilot.customPathPlaceholder': 'p. ej. /usr/local/bin/copilot',
|
||||
'ai.copilot.check': 'Verificar',
|
||||
'ai.copilot.resetPath': 'Restablecer',
|
||||
|
||||
// AI Cursor SDK
|
||||
'ai.cursor.title': 'Cursor',
|
||||
'ai.cursor.description': 'Usa el SDK de Cursor o el inicio de sesión local de la CLI de Agent.',
|
||||
'ai.cursor.detecting': 'Detectando...',
|
||||
'ai.cursor.detected': 'Disponible',
|
||||
'ai.cursor.notFound': 'No disponible',
|
||||
'ai.cursor.path': 'Runtime:',
|
||||
'ai.cursor.notFoundHint': 'Ingresa una clave de API para habilitar Cursor o cambia al inicio de sesión por CLI.',
|
||||
'ai.cursor.notInstalledHint': 'No se detectó el SDK de Cursor ni la CLI de Agent.',
|
||||
'ai.cursor.installStatus': 'Runtime de Cursor',
|
||||
'ai.cursor.installed': 'Detectado',
|
||||
'ai.cursor.notInstalled': 'No detectado',
|
||||
'ai.cursor.modeCli': 'Inicio de sesión por CLI',
|
||||
'ai.cursor.modeApiKey': 'Clave de API',
|
||||
'ai.cursor.modeCliHint': 'Usa tu sesión local de `cursor-agent login` y la cuota Automática de la suscripción. La clave de API guardada se conserva, pero no se usa en este modo.',
|
||||
'ai.cursor.modeApiKeyHint': 'Usa la API de Cursor medida. El inicio de sesión por CLI se ignora mientras este modo esté activo.',
|
||||
'ai.cursor.cliLoginStatus': 'Inicio de sesión por CLI',
|
||||
'ai.cursor.cliLoginOk': 'Sesión iniciada',
|
||||
'ai.cursor.cliLoginAs': 'Sesión iniciada como {{email}}',
|
||||
'ai.cursor.cliLoginMissing': 'Sin sesión iniciada',
|
||||
'ai.cursor.cliLoginHint': 'Ejecuta `cursor-agent login` en una terminal y luego haz clic en Verificar.',
|
||||
'ai.cursor.apiKeyStatus': 'Clave de API',
|
||||
'ai.cursor.apiKeyConfigured': 'Configurada',
|
||||
'ai.cursor.apiKeyMissing': 'Faltante',
|
||||
'ai.cursor.apiKeyFromEnv': 'Desde el entorno',
|
||||
'ai.cursor.apiKey': 'Clave de API',
|
||||
'ai.cursor.apiKeyPlaceholder': 'Ingresa la clave de API de Cursor',
|
||||
'ai.cursor.apiKeyPlaceholder.env': 'Usando CURSOR_API_KEY; ingresa una clave para anularla',
|
||||
'ai.cursor.apiKeyEnvHint': 'Cursor puede usar CURSOR_API_KEY de tu shell. Guarda una clave aquí solo si quieres que Netcatty la anule.',
|
||||
'ai.cursor.apiKeyOverrideHint': 'Netcatty usará la clave guardada aquí antes que CURSOR_API_KEY.',
|
||||
'ai.cursor.saveApiKey': 'Guardar',
|
||||
'ai.cursor.saved': 'Guardada',
|
||||
'ai.cursor.showApiKey': 'Mostrar clave de API',
|
||||
'ai.cursor.hideApiKey': 'Ocultar clave de API',
|
||||
'ai.cursor.customPathPlaceholder': 'p. ej. /usr/local/bin/cursor',
|
||||
'ai.cursor.check': 'Verificar',
|
||||
|
||||
// AI CodeBuddy Code
|
||||
'ai.codebuddy.title': 'CodeBuddy Code',
|
||||
'ai.codebuddy.description': 'Usa CodeBuddy Code mediante el SDK oficial de Agent (`@tencent-ai/agent-sdk`). Una vez detectado, se puede seleccionar como agente de codificación externo.',
|
||||
'ai.codebuddy.detecting': 'Detectando...',
|
||||
'ai.codebuddy.detected': 'Detectado',
|
||||
'ai.codebuddy.notFound': 'No encontrado',
|
||||
'ai.codebuddy.path': 'Ruta:',
|
||||
'ai.codebuddy.notFoundHint': 'No se pudo encontrar codebuddy en el PATH. Instálalo o especifica la ruta del ejecutable a continuación.',
|
||||
'ai.codebuddy.customPathPlaceholder': 'p. ej. /usr/local/bin/codebuddy',
|
||||
'ai.codebuddy.check': 'Verificar',
|
||||
'ai.codebuddy.resetPath': 'Restablecer',
|
||||
'ai.codebuddy.configSection': 'Autenticación y configuración (opcional)',
|
||||
'ai.codebuddy.internetEnv': 'Entorno de Internet',
|
||||
'ai.codebuddy.internetEnv.default': 'Predeterminado (internacional)',
|
||||
'ai.codebuddy.internetEnv.internal': 'Interno',
|
||||
'ai.codebuddy.internetEnv.ioa': 'IOA',
|
||||
'ai.codebuddy.internetEnv.hint': 'Define CODEBUDDY_INTERNET_ENVIRONMENT: elige Interno o IOA para entornos de red restringidos.',
|
||||
'ai.codebuddy.envVars': 'Variables de entorno',
|
||||
'ai.codebuddy.envVars.placeholder': 'CODEBUDDY_API_KEY=...\nCODEBUDDY_AUTH_TOKEN=...\nOTHER_VAR=...',
|
||||
'ai.codebuddy.envVars.hint': 'Una KEY=VALUE por línea, pasada al agente de CodeBuddy. Define CODEBUDDY_API_KEY o CODEBUDDY_AUTH_TOKEN aquí para la autenticación. Se almacena localmente en texto plano.',
|
||||
'ai.codebuddy.advancedSection': 'Opciones avanzadas (SDK 0.3.230)',
|
||||
'ai.codebuddy.effort': 'Esfuerzo de razonamiento',
|
||||
'ai.codebuddy.effort.default': 'Predeterminado',
|
||||
'ai.codebuddy.effort.low': 'Bajo',
|
||||
'ai.codebuddy.effort.medium': 'Medio',
|
||||
'ai.codebuddy.effort.high': 'Alto',
|
||||
'ai.codebuddy.effort.xhigh': 'XHigh',
|
||||
'ai.codebuddy.effort.hint': 'Controla la profundidad de razonamiento del modelo. Usa Bajo para comandos simples y ahorrar tokens, y Alto/XHigh para diagnósticos complejos.',
|
||||
'ai.codebuddy.maxTurns': 'Máximo de turnos',
|
||||
'ai.codebuddy.maxTurns.hint': 'Limita el máximo de turnos de conversación por petición para evitar bucles descontrolados. Déjalo vacío para usar el predeterminado.',
|
||||
'ai.codebuddy.maxBudget': 'Presupuesto máximo (USD)',
|
||||
'ai.codebuddy.maxBudget.hint': 'Gasto máximo (USD) por petición. Se detiene automáticamente al superarse. Déjalo vacío para no tener límite.',
|
||||
'ai.codebuddy.sandbox': 'Modo sandbox',
|
||||
'ai.codebuddy.sandbox.hint': 'Ejecuta llamadas a herramientas en un sandbox, restringiendo el acceso al sistema de archivos y a la red.',
|
||||
'ai.codebuddy.fileCheckpointing': 'Puntos de control de archivos',
|
||||
'ai.codebuddy.fileCheckpointing.hint': 'Habilita puntos de control de operaciones de archivos para poder revertir las modificaciones de IA a los archivos.',
|
||||
'ai.codebuddy.elicitation.title': 'CodeBuddy necesita tu aporte',
|
||||
'ai.codebuddy.elicitation.description': 'Revisa la petición para continuar el turno actual.',
|
||||
'ai.codebuddy.elicitation.select': 'Selecciona una opción',
|
||||
'ai.codebuddy.elicitation.yes': 'Sí',
|
||||
'ai.codebuddy.elicitation.no': 'No',
|
||||
'ai.codebuddy.elicitation.decline': 'Rechazar',
|
||||
'ai.codebuddy.elicitation.accept': 'Continuar',
|
||||
'ai.codebuddy.elicitation.validation.required': '{field} es obligatorio.',
|
||||
'ai.codebuddy.elicitation.validation.invalidType': '{field} tiene un valor no válido.',
|
||||
'ai.codebuddy.elicitation.validation.integer': '{field} debe ser un número entero.',
|
||||
'ai.codebuddy.elicitation.validation.notInteger': '{field} debe ser un número entero.',
|
||||
'ai.codebuddy.elicitation.validation.minimum': '{field} debe ser al menos {limit}.',
|
||||
'ai.codebuddy.elicitation.validation.maximum': '{field} debe ser como máximo {limit}.',
|
||||
'ai.codebuddy.elicitation.validation.minLength': '{field} debe contener al menos {limit} caracteres.',
|
||||
'ai.codebuddy.elicitation.validation.maxLength': '{field} debe contener como máximo {limit} caracteres.',
|
||||
'ai.codebuddy.elicitation.validation.minItems': 'Selecciona al menos {limit} opciones para {field}.',
|
||||
'ai.codebuddy.elicitation.validation.maxItems': 'Selecciona como máximo {limit} opciones para {field}.',
|
||||
'ai.codebuddy.elicitation.validation.format': '{field} debe coincidir con el formato {format}.',
|
||||
'ai.codebuddy.elicitation.validation.option': 'Selecciona una opción válida para {field}.',
|
||||
|
||||
// AI OpenCode
|
||||
'ai.opencode.title': 'OpenCode',
|
||||
'ai.opencode.description': 'Usa OpenCode mediante el SDK oficial. Configura proveedores y claves en OpenCode y luego selecciónalo como agente de codificación externo.',
|
||||
'ai.opencode.detecting': 'Detectando...',
|
||||
'ai.opencode.detected': 'Detectado',
|
||||
'ai.opencode.notFound': 'No encontrado',
|
||||
'ai.opencode.path': 'Ruta:',
|
||||
'ai.opencode.notFoundHint': 'No se pudo encontrar opencode en el PATH. Instálalo o especifica la ruta del ejecutable a continuación.',
|
||||
'ai.opencode.customPathPlaceholder': 'p. ej. /usr/local/bin/opencode',
|
||||
'ai.opencode.check': 'Verificar',
|
||||
'ai.opencode.resetPath': 'Restablecer',
|
||||
|
||||
// AI Grok Build (in-app managed agent — distinct from External MCP client install)
|
||||
'ai.grok.title': 'Grok Build',
|
||||
'ai.grok.description': "La CLI de agente de codificación Grok Build de xAI. Instala la CLI de Grok, inicia sesión con `grok login` o define XAI_API_KEY, y luego selecciónala como agente externo.",
|
||||
'ai.grok.detecting': 'Detectando...',
|
||||
'ai.grok.detected': 'Detectado',
|
||||
'ai.grok.notFound': 'No encontrado',
|
||||
'ai.grok.path': 'Ruta:',
|
||||
'ai.grok.notFoundHint': 'No se pudo encontrar grok en el PATH. Instala la CLI de Grok Build o especifica la ruta del ejecutable a continuación.',
|
||||
'ai.grok.customPathPlaceholder': 'p. ej. /usr/local/bin/grok',
|
||||
'ai.grok.check': 'Verificar',
|
||||
'ai.grok.resetPath': 'Restablecer',
|
||||
'ai.grok.runtime.acp.title': 'Usar Grok ACP (agente stdio)',
|
||||
'ai.grok.runtime.acp.default': 'Predeterminado',
|
||||
'ai.grok.runtime.acp.description':
|
||||
'Habla con Grok mediante el Protocolo de Cliente de Agente (grok agent stdio). Inyecta el MCP de Netcatty en session/new. Apágalo para usar la ruta original de CLI headless con streaming-json.',
|
||||
'ai.grok.runtime.streamingJson.hint':
|
||||
'Usando streaming-json headless (grok -p --output-format streaming-json). El archivo .grok/config.toml del proyecto se usa para la inyección de MCP.',
|
||||
|
||||
// AI Default Agent
|
||||
'ai.defaultAgent': 'Agente predeterminado',
|
||||
'ai.defaultAgent.description': 'Agente que se usará al iniciar una nueva sesión de IA',
|
||||
'ai.defaultAgent.catty': 'Catty (Integrado)',
|
||||
'ai.toolAccess.title': 'Acceso a herramientas',
|
||||
'ai.toolAccess.mode': 'Modo de acceso de Netcatty',
|
||||
'ai.toolAccess.description': 'Elige cómo acceden los agentes externos a las sesiones de Netcatty. MCP expone el servidor integrado, mientras que Habilidades + CLI apunta a los agentes hacia las habilidades locales de Netcatty y los comandos de CLI.',
|
||||
'ai.toolAccess.mode.mcp': 'MCP',
|
||||
'ai.toolAccess.mode.skills': 'Habilidades + CLI',
|
||||
|
||||
// External MCP (productized catalog MCP for Codex / Claude Code / Cursor)
|
||||
'ai.externalMcp.title': 'MCP externo',
|
||||
'ai.externalMcp.description': 'Expón Netcatty como un servidor MCP para clientes externos como Codex, Claude Code, Cursor y Grok. Usa las mismas herramientas del catálogo que los agentes de la aplicación (terminal, SFTP, Vault, reenvío de puertos). Mantén Netcatty en ejecución mientras los clientes estén conectados.',
|
||||
'ai.externalMcp.sessionsExposed': 'Sesiones en alcance: {count}',
|
||||
'ai.externalMcp.mode': 'Modo de disponibilidad',
|
||||
'ai.externalMcp.mode.temporary': 'Temporal',
|
||||
'ai.externalMcp.mode.persistent': 'Siempre activo',
|
||||
'ai.externalMcp.mode.description': 'El modo temporal se desactiva automáticamente tras el tiempo de inactividad. El modo Siempre activo restaura el MCP externo cuando se inicia Netcatty.',
|
||||
'ai.externalMcp.idleTimeout': 'Tiempo de inactividad',
|
||||
'ai.externalMcp.idleTimeout.description': 'En modo temporal, desactiva el MCP externo después de esta cantidad de minutos sin operaciones de MCP.',
|
||||
'ai.externalMcp.idleTimeout.minutes': 'min',
|
||||
'ai.externalMcp.focusOnHostOpen': 'Enfocar ventana en host_open',
|
||||
'ai.externalMcp.focusOnHostOpen.description': 'Cuando un cliente de MCP abre un host, trae la ventana principal al frente. Apágalo para seguir trabajando sin interrupciones.',
|
||||
'ai.externalMcp.silentSessions': 'Sesiones MCP silenciosas',
|
||||
'ai.externalMcp.silentSessions.description': 'Las sesiones abiertas por la IA se mantienen fuera de tu barra de pestañas y no se restauran tras reiniciar. Puedes verlas en cualquier momento desde el panel de la bandeja.',
|
||||
'ai.externalMcp.sessionIdleTimeout': 'Tiempo de inactividad de la sesión abierta',
|
||||
'ai.externalMcp.sessionIdleTimeout.description': 'Cierra automáticamente las sesiones abiertas por una IA después de esta cantidad de minutos sin actividad de terminal o archivos.',
|
||||
'ai.externalMcp.usage.title': 'Cómo usarlo',
|
||||
'ai.externalMcp.usage.keepRunning': '1. Activa el MCP externo y mantén Netcatty en ejecución.',
|
||||
'ai.externalMcp.usage.localhost': '2. Los clientes se conectan mediante el launcher local (solo 127.0.0.1). El descubrimiento se elimina cuando desactivas el interruptor.',
|
||||
'ai.externalMcp.usage.permissions': '3. Las operaciones de escritura siguen Configuración → IA → Seguridad (observador / confirmar / automático) y la lista de bloqueo de comandos.',
|
||||
'ai.externalMcp.usage.capabilities': '4. Todas las herramientas del catálogo están disponibles: terminal, SFTP, Vault y reenvío de puertos. Los secretos (contraseñas / claves privadas) nunca se devuelven.',
|
||||
'ai.externalMcp.help.ariaLabel': 'Ayuda del MCP externo',
|
||||
'ai.externalMcp.security': 'Seguridad',
|
||||
'ai.externalMcp.security.description': 'Escucha en 127.0.0.1 con un token rotativo, reutiliza el modo de permisos de IA para las escrituras y elimina el descubrimiento al desactivarse. Sin OAuth: este es un puente local de escritorio.',
|
||||
'ai.externalMcp.permissionMode': 'Modo de permisos actual: {mode}',
|
||||
'ai.externalMcp.permissionMode.label': 'Modo de permiso de escritura',
|
||||
'ai.externalMcp.permissionMode.hint': 'La misma configuración que Configuración → IA → Seguridad. Automático ejecuta las herramientas de escritura de Netcatty sin solicitar aprobación de Netcatty; Confirmar pregunta cada vez. Los clientes externos (Codex / Claude / Grok) aún pueden mostrar su propia interfaz de aprobación de herramientas.',
|
||||
'ai.externalMcp.permissionMode.unknown': 'Desconocido',
|
||||
'ai.externalMcp.discovery': 'Descubrimiento',
|
||||
'ai.externalMcp.launcher': 'Launcher',
|
||||
'ai.externalMcp.unavailable': 'No disponible',
|
||||
'ai.externalMcp.bridgeUnavailable': 'Puente de MCP externo no disponible',
|
||||
'ai.externalMcp.copy': 'Copiar',
|
||||
'ai.externalMcp.copied': 'Copiado',
|
||||
'ai.externalMcp.copyFailed': 'No se pudo copiar. Intenta copiarlo manualmente.',
|
||||
'ai.externalMcp.refresh': 'Actualizar',
|
||||
'ai.externalMcp.clientConfiguration': 'Configuración del cliente',
|
||||
'ai.externalMcp.clientConfiguration.description': 'Elige un cliente para instalarlo con un clic, o copia fragmentos de CLI o configuración.',
|
||||
'ai.externalMcp.client.codex': 'Codex',
|
||||
'ai.externalMcp.client.claude': 'Claude Code',
|
||||
'ai.externalMcp.client.grok': 'Grok',
|
||||
'ai.externalMcp.client.cursor': 'Cursor',
|
||||
'ai.externalMcp.cliCommand': 'Comando CLI',
|
||||
'ai.externalMcp.configSnippet': 'Fragmento de configuración',
|
||||
'ai.externalMcp.addToCodex': 'Agregar a Codex',
|
||||
'ai.externalMcp.addToClaude': 'Agregar a Claude Code',
|
||||
'ai.externalMcp.addToGrok': 'Agregar a Grok',
|
||||
'ai.externalMcp.codexAdded': 'Entrada de MCP de Codex agregada. Reinicia Codex o abre una nueva sesión de Codex.',
|
||||
'ai.externalMcp.claudeAdded': 'Entrada de MCP de Claude Code agregada. Reinicia Claude Code o abre una nueva sesión de Claude Code.',
|
||||
'ai.externalMcp.grokAdded': 'Entrada de MCP de Grok agregada. Reinicia Grok o abre una nueva sesión de Grok.',
|
||||
'ai.externalMcp.installCodex': 'Instala Codex por separado y luego haz clic en Actualizar.',
|
||||
'ai.externalMcp.installClaude': 'Instala Claude Code por separado y luego haz clic en Actualizar.',
|
||||
'ai.externalMcp.installGrok': 'Instala la CLI de Grok por separado y luego haz clic en Actualizar.',
|
||||
'ai.externalMcp.conflict.description': 'Ya existe una entrada netcatty-external que apunta a otro lugar. Quítala o edítala manualmente.',
|
||||
'ai.externalMcp.enableForLauncher': 'Habilita el MCP externo para obtener una ruta de launcher utilizable.',
|
||||
'ai.externalMcp.cursor.title': 'Cursor / otros clientes',
|
||||
'ai.externalMcp.cursor.description': 'Combina esto en tu configuración de MCP (por ejemplo, ~/.cursor/mcp.json). No reemplaces todo el archivo si ya tienes otros servidores.',
|
||||
'ai.externalMcp.status.unavailable': 'No disponible',
|
||||
'ai.externalMcp.status.disabled': 'Desactivado',
|
||||
'ai.externalMcp.status.running': 'En ejecución',
|
||||
'ai.externalMcp.status.starting': 'Iniciando',
|
||||
'ai.externalMcp.status.error': 'Error',
|
||||
'ai.externalMcp.status.configured': 'Configurado',
|
||||
'ai.externalMcp.status.notConfigured': 'No configurado',
|
||||
'ai.externalMcp.status.checking': 'Comprobando',
|
||||
'ai.externalMcp.status.codexNotFound': 'Codex no encontrado',
|
||||
'ai.externalMcp.status.claudeNotFound': 'Claude Code no encontrado',
|
||||
'ai.externalMcp.status.grokNotFound': 'Grok no encontrado',
|
||||
'ai.externalMcp.status.conflict': 'Conflicto',
|
||||
'ai.userSkills.title': 'Habilidades de usuario',
|
||||
'ai.userSkills.description': 'Abre la carpeta de habilidades de Netcatty para agregar tus propios directorios de habilidades. Netcatty escanea estas habilidades automáticamente e inyecta solo índices ligeros, salvo que una habilidad coincida claramente con la petición actual.',
|
||||
'ai.userSkills.openFolder': 'Abrir carpeta de habilidades',
|
||||
'ai.userSkills.reload': 'Recargar habilidades',
|
||||
'ai.userSkills.location': 'Ubicación',
|
||||
'ai.userSkills.loading': 'Escaneando habilidades de usuario...',
|
||||
'ai.userSkills.summary': '{ready} listas, {warnings} advertencias',
|
||||
'ai.userSkills.empty': 'Aún no se encontraron habilidades de usuario. Abre la carpeta para agregar directorios de habilidades con un archivo SKILL.md.',
|
||||
'ai.userSkills.unavailable': 'Las habilidades de usuario no están disponibles en este entorno.',
|
||||
'ai.userSkills.status.ready': 'Lista',
|
||||
'ai.userSkills.status.warning': 'Advertencia',
|
||||
|
||||
// AI Quick Messages
|
||||
'ai.quickMessages.title': 'Mensajes rápidos',
|
||||
'ai.quickMessages.description': 'Crea prompts reutilizables que puedes insertar desde el chat de IA con / o con el botón de mensajes rápidos. A diferencia de las habilidades de usuario, los mensajes rápidos llenan el compositor con texto.',
|
||||
'ai.quickMessages.add': 'Agregar mensaje rápido',
|
||||
'ai.quickMessages.createTitle': 'Nuevo mensaje rápido',
|
||||
'ai.quickMessages.editTitle': 'Editar mensaje rápido',
|
||||
'ai.quickMessages.name': 'Nombre',
|
||||
'ai.quickMessages.name.placeholder': 'p. ej. Verificar espacio en disco',
|
||||
'ai.quickMessages.slug': 'Comando',
|
||||
'ai.quickMessages.slug.placeholder': 'disk-check',
|
||||
'ai.quickMessages.descriptionField': 'Descripción (opcional)',
|
||||
'ai.quickMessages.descriptionField.placeholder': 'Breve indicación sobre lo que hace este prompt',
|
||||
'ai.quickMessages.content': 'Contenido del mensaje',
|
||||
'ai.quickMessages.content.placeholder': 'Texto completo del prompt para insertar al seleccionarlo...',
|
||||
'ai.quickMessages.empty': 'Aún no hay mensajes rápidos. Agrega algunos prompts que uses seguido.',
|
||||
'ai.quickMessages.confirmDelete': '¿Eliminar el mensaje rápido "{name}"?',
|
||||
'ai.quickMessages.error.nameRequired': 'El nombre es obligatorio.',
|
||||
'ai.quickMessages.error.invalidSlug': 'El comando solo puede contener letras minúsculas, números y guiones.',
|
||||
'ai.quickMessages.error.contentRequired': 'El contenido del mensaje es obligatorio.',
|
||||
'ai.quickMessages.error.slugTaken': 'Este comando ya lo usa otro mensaje rápido.',
|
||||
'ai.quickMessages.error.slugConflictsWithSkill': 'Este comando entra en conflicto con la habilidad de usuario "/{slug}". Elige otro.',
|
||||
'ai.quickMessages.error.maxItems': 'Puedes guardar como máximo {max} mensajes rápidos.',
|
||||
|
||||
// AI Chat
|
||||
'ai.chat.noProvider': 'No hay ningún proveedor de IA configurado. Ve a **Configuración → IA → Proveedores** para agregar y habilitar un proveedor.',
|
||||
'ai.chat.toolDenied': 'La acción fue rechazada por el usuario.',
|
||||
'ai.chat.toolApproved': 'Aprobado',
|
||||
'ai.chat.toolApprovalHint': 'Presiona Enter una vez · Esc para rechazar',
|
||||
'ai.chat.approve': 'Aprobar',
|
||||
'ai.chat.approveOnce': 'Una vez',
|
||||
'ai.chat.alwaysAllow': 'Siempre',
|
||||
'ai.chat.slashStopDesc': 'Detener el turno actual de IA y cancelar las herramientas en curso',
|
||||
'ai.chat.slashCompactDesc': 'Resumir el contexto anterior de la conversación',
|
||||
'ai.chat.reject': 'Rechazar',
|
||||
'ai.chat.toolLabel': 'Herramienta',
|
||||
'ai.chat.targetLabel': 'Destino',
|
||||
'ai.chat.rawCommand': 'Comando',
|
||||
'ai.chat.copyCommand': 'Copiar',
|
||||
'ai.chat.commandCopied': 'Copiado',
|
||||
'ai.chat.approvalSession': 'Sesión',
|
||||
'ai.chat.approvalShell': 'Shell',
|
||||
'ai.chat.approvalCwd': 'Cwd',
|
||||
'ai.chat.approvalReason': 'Motivo',
|
||||
'ai.chat.approvalInvocation': 'Invocación',
|
||||
'ai.chat.permissionRequired': 'Permiso requerido',
|
||||
'ai.chat.permissionDescription': 'El agente de IA quiere ejecutar una llamada a una herramienta que requiere tu aprobación.',
|
||||
'ai.chat.commandBlocked': 'Este comando está bloqueado por tu política de seguridad y no se puede ejecutar.',
|
||||
'ai.chat.recommendAllow': 'Permitir',
|
||||
'ai.chat.recommendConfirm': 'Confirmar',
|
||||
'ai.chat.recommendDeny': 'Denegar',
|
||||
'ai.chat.exportConversation': 'Exportar conversación',
|
||||
'ai.chat.exportAs': 'Exportar como',
|
||||
'ai.chat.exportMarkdown': 'Markdown',
|
||||
'ai.chat.exportJSON': 'JSON',
|
||||
'ai.chat.exportPlainText': 'Texto plano',
|
||||
'ai.chat.thinking': 'Pensando',
|
||||
'ai.chat.thoughtFor': 'Pensó durante {duration}',
|
||||
'ai.chat.thought': 'Pensamiento',
|
||||
'ai.chat.agents': 'Agentes',
|
||||
'ai.chat.detectedOnMachine': 'Detectado en esta máquina',
|
||||
'ai.chat.rescan': 'Volver a escanear',
|
||||
'ai.chat.permObserver': 'Observador',
|
||||
'ai.chat.permConfirm': 'Confirmar',
|
||||
'ai.chat.permAuto': 'Automático',
|
||||
'ai.chat.permObserverDesc': 'Solo lectura (Cursor CLI: Ask)',
|
||||
'ai.chat.permConfirmDesc': 'Preguntar antes de que Netcatty escriba (Cursor CLI: agent + force)',
|
||||
'ai.chat.permAutoDesc': 'Ejecutar libremente (Cursor CLI: agent + force)',
|
||||
'ai.chat.emptyHint': 'Pregunta sobre tus servidores, ejecuta comandos u obtén ayuda con las configuraciones.',
|
||||
'ai.chat.placeholder': 'Mensaje a {agent} — @ para incluir contexto, / para comandos',
|
||||
'ai.chat.placeholderDefault': 'Mensaje al agente Catty...',
|
||||
'ai.chat.noModel': 'Sin modelo',
|
||||
'ai.chat.noProviderModel': 'No hay modelo predeterminado: define uno en Configuración → IA → Proveedores.',
|
||||
'ai.chat.selectProvider': 'Seleccionar proveedor',
|
||||
'ai.chat.recent': 'Recientes',
|
||||
'ai.chat.viewAll': 'Ver todo',
|
||||
'ai.chat.untitled': 'Sin título',
|
||||
'ai.chat.justNow': 'Ahora mismo',
|
||||
'ai.chat.minutesAgo': 'hace {n} min',
|
||||
'ai.chat.hoursAgo': 'hace {n} h',
|
||||
'ai.chat.daysAgo': 'hace {n} d',
|
||||
'ai.chat.newChat': 'Nuevo chat',
|
||||
'ai.chat.allSessions': 'Todas las sesiones',
|
||||
'ai.chat.loadEarlierMessages': 'Cargar mensajes anteriores ({n} más)',
|
||||
'ai.chat.jumpNav': 'Ir al mensaje',
|
||||
'ai.chat.jumpUntitled': '(mensaje vacío)',
|
||||
'ai.chat.usedTools': 'Herramientas usadas: {n}',
|
||||
'ai.chat.loadMoreSessions': 'Cargar más sesiones ({n} más)',
|
||||
'ai.chat.noSessions': 'No hay sesiones anteriores',
|
||||
'ai.chat.retryHint': 'Puedes reintentar enviando tu mensaje de nuevo.',
|
||||
'ai.chat.approvalTimeout': 'La aprobación de la herramienta expiró después de 5 minutos. Puedes reintentar enviando tu mensaje de nuevo.',
|
||||
'ai.chat.menuHosts': 'Hosts',
|
||||
'ai.chat.menuContext': 'Contexto',
|
||||
'ai.chat.menuFiles': 'Archivos',
|
||||
'ai.chat.menuImage': 'Imagen',
|
||||
'ai.chat.menuMentionHost': 'Mencionar host',
|
||||
'ai.chat.menuUserSkills': 'Habilidades de usuario',
|
||||
'ai.chat.menuSlashCommands': 'Comandos de barra',
|
||||
'ai.chat.slashCommands': 'Comandos de barra',
|
||||
'ai.chat.slashSystemCommands': 'Comandos',
|
||||
'ai.chat.slashQuickMessages': 'Mensajes rápidos',
|
||||
'ai.chat.slashUserSkills': 'Habilidades de usuario',
|
||||
'ai.chat.quickMessages': 'Comandos de barra',
|
||||
'ai.chat.slashNoResults': 'No hay comandos que coincidan',
|
||||
'ai.chat.slashEmptyHint': 'Agrega prompts en Configuración → IA → Mensajes rápidos.',
|
||||
|
||||
// AI Chat Shortcuts
|
||||
'ai.chatShortcuts.title': 'Atajos de chat',
|
||||
'ai.chatShortcuts.selectionAction': 'Mostrar "Agregar a la conversación" al seleccionar texto de la terminal',
|
||||
'ai.chatShortcuts.selectionAction.description': 'Muestra un pequeño botón de IA junto al texto seleccionado de la terminal.',
|
||||
|
||||
// AI Error
|
||||
'ai.codex.bridgeError': 'Los controladores del proceso principal de Codex aún no están cargados. Reinicia Netcatty por completo o reinicia el proceso de desarrollo de Electron y vuelve a intentarlo.',
|
||||
|
||||
// AI Web Search
|
||||
'ai.webSearch.title': 'Búsqueda web',
|
||||
'ai.webSearch.enable': 'Habilitar búsqueda web',
|
||||
'ai.webSearch.enable.description': 'Permite que el agente de IA busque en la web información actual.',
|
||||
'ai.webSearch.provider': 'Proveedor de búsqueda',
|
||||
'ai.webSearch.provider.description': 'Elige un proveedor de API de búsqueda web.',
|
||||
'ai.webSearch.apiKey': 'Clave de API',
|
||||
'ai.webSearch.apiKey.description': 'Clave de API para el proveedor de búsqueda seleccionado.',
|
||||
'ai.webSearch.apiKey.placeholder': 'Ingresa la clave de API...',
|
||||
'ai.webSearch.apiHost': 'Host de API',
|
||||
'ai.webSearch.apiHost.description': 'Endpoint de API personalizado. Deja el predeterminado salvo que uses un proxy.',
|
||||
'ai.webSearch.apiHost.searxngDescription': 'URL de tu instancia de SearXNG (obligatoria).',
|
||||
'ai.webSearch.maxResults': 'Máximo de resultados',
|
||||
'ai.webSearch.maxResults.description': 'Cantidad máxima de resultados de búsqueda a devolver (1-20).',
|
||||
|
||||
// AI Safety Settings
|
||||
'ai.safety.title': 'Seguridad',
|
||||
'ai.safety.permissionMode': 'Modo de permisos',
|
||||
'ai.safety.permissionMode.description': 'Controla cómo interactúa la IA con tus sesiones de terminal de Netcatty. El modo Observador bloquea las operaciones de escritura que pasan por Netcatty. Las CLIs de agentes externos pueden seguir teniendo sus propias herramientas locales y flujo de aprobación.',
|
||||
'ai.safety.permissionMode.observer': 'Observador: solo lectura, sin acciones',
|
||||
'ai.safety.permissionMode.confirm': 'Confirmar: preguntar antes de las acciones',
|
||||
'ai.safety.permissionMode.auto': 'Automático: ejecutar libremente',
|
||||
'ai.safety.commandTimeout': 'Tiempo de espera de comandos',
|
||||
'ai.safety.commandTimeout.description': 'Máximo de segundos que un comando puede ejecutarse antes de ser terminado mediante la ejecución de Netcatty.',
|
||||
'ai.safety.commandTimeout.unit': 'seg',
|
||||
'ai.safety.maxIterations': 'Máximo de iteraciones',
|
||||
'ai.safety.maxIterations.description': 'Máximo de bucles de uso de herramientas de IA para evitar una ejecución descontrolada. Los agentes externos pueden tener sus propios límites de iteración internos que tienen prioridad.',
|
||||
'ai.safety.blocklist': 'Lista de bloqueo de comandos',
|
||||
'ai.safety.blocklist.description': 'Patrones regex para bloquear comandos peligrosos ejecutados mediante Netcatty.',
|
||||
'ai.safety.blocklist.placeholder': 'Patrón regex...',
|
||||
'ai.safety.blocklist.reset': 'Restablecer a los valores predeterminados',
|
||||
'ai.safety.blocklist.add': 'Agregar patrón',
|
||||
'ai.safety.grants.title': 'Memoria de permisos',
|
||||
'ai.safety.grants.heading': 'Reglas de permitir en modo Confirmar',
|
||||
'ai.safety.grants.description': 'El modo Confirmar pregunta antes de ejecutar una operación. Las reglas guardadas permiten automáticamente las operaciones que coinciden en todas las sesiones/nodos de terminal, y se pueden editar manualmente.',
|
||||
'ai.safety.grants.empty': 'Aún no hay reglas guardadas. Aprueba una herramienta con "Permitir siempre" o agrega una manualmente.',
|
||||
'ai.safety.grants.capability': 'Capacidad',
|
||||
'ai.safety.grants.sessionPattern': 'Patrón de sesión',
|
||||
'ai.safety.grants.commandPattern': 'Patrón de comando (opcional)',
|
||||
'ai.safety.grants.note': 'Nota (opcional)',
|
||||
'ai.safety.grants.add': 'Agregar regla',
|
||||
'ai.safety.grants.remove': 'Quitar',
|
||||
'ai.safety.grants.export': 'Exportar JSON',
|
||||
'ai.safety.grants.import': 'Importar JSON',
|
||||
'ai.safety.note': 'Estos ajustes de seguridad se aplican a las acciones que pasan por Netcatty. Las CLIs de agentes externos también pueden exponer herramientas locales regidas por el propio agente.',
|
||||
|
||||
// Unified tooltips for terminal workspace and top tabs (issue #954)
|
||||
'terminal.layer.addTerminal': 'Agregar terminal',
|
||||
'terminal.layer.switchToSplitView': 'Cambiar a vista dividida',
|
||||
'terminal.layer.sftp': 'SFTP',
|
||||
'terminal.layer.scripts': 'Scripts',
|
||||
'terminal.layer.history': 'Historial',
|
||||
'terminal.layer.theme': 'Tema',
|
||||
'terminal.layer.notes': 'Notas',
|
||||
'terminal.layer.aiChat': 'Chat de IA',
|
||||
'terminal.layer.movePanelLeft': 'Mover panel a la izquierda',
|
||||
'terminal.layer.movePanelRight': 'Mover panel a la derecha',
|
||||
'terminal.layer.closePanel': 'Cerrar panel',
|
||||
'terminal.layer.closePane': 'Cerrar división',
|
||||
'terminal.layer.resizeSplit': 'Redimensionar división',
|
||||
'terminal.layer.splitHorizontal': 'Dividir arriba y abajo',
|
||||
'terminal.layer.splitVertical': 'Dividir izquierda y derecha',
|
||||
'terminal.layer.openInNewSplit': 'Abrir en una división nueva',
|
||||
'terminal.layer.hostTree.search': 'Buscar hosts...',
|
||||
'terminal.layer.hostTree.searchButton': 'Buscar',
|
||||
'terminal.layer.hostTree.tagsButton': 'Filtrar por etiquetas',
|
||||
'terminal.layer.hostTree.newHost': 'Nuevo host',
|
||||
'terminal.layer.hostTree.newHostInGroup': 'Nuevo host en este grupo',
|
||||
'terminal.layer.hostTree.editHost': 'Editar host',
|
||||
'terminal.layer.hostTree.hostSavedNextConnection': 'Host actualizado. Los ajustes de conexión se aplicarán la próxima vez que te conectes.',
|
||||
'terminal.layer.hostTree.newGroup': 'Nuevo grupo',
|
||||
'terminal.layer.hostTree.localShell': 'Shell local',
|
||||
'terminal.layer.hostTree.tagsEmpty': 'No hay etiquetas disponibles',
|
||||
'terminal.layer.hostTree.clearTags': 'Borrar selección',
|
||||
'terminal.layer.hostTree.collapse': 'Contraer lista de hosts',
|
||||
'terminal.layer.hostTree.expand': 'Expandir lista de hosts',
|
||||
'terminal.layer.hostTree.empty': 'No se encontraron hosts',
|
||||
'terminal.layer.hostTree.details.host': 'Host',
|
||||
'terminal.layer.hostTree.details.user': 'Usuario',
|
||||
'terminal.layer.hostTree.details.port': 'Puerto',
|
||||
'terminal.layer.hostTree.details.protocol': 'Protocolo',
|
||||
'terminal.layer.hostTree.details.group': 'Grupo',
|
||||
'terminal.layer.hostTree.details.tags': 'Etiquetas',
|
||||
'terminal.layer.hostTree.details.lastConnected': 'Última conexión',
|
||||
'topTabs.openQuickSwitcher': 'Abrir selector rápido',
|
||||
'topTabs.moreTabs': 'Más pestañas',
|
||||
'topTabs.aiAssistant': 'Asistente de IA',
|
||||
'topTabs.newLocalTerminal': 'Nueva terminal local',
|
||||
'topTabs.controlPanel': 'Controles rápidos',
|
||||
'topTabs.controlPanel.externalMcp': 'MCP externo',
|
||||
'topTabs.controlPanel.theme': 'Tema',
|
||||
'topTabs.controlPanel.theme.light': 'Claro',
|
||||
'topTabs.controlPanel.theme.dark': 'Oscuro',
|
||||
'topTabs.controlPanel.theme.system': 'Sistema',
|
||||
'topTabs.externalMcp.enable': 'Habilitar MCP externo',
|
||||
'topTabs.externalMcp.disable': 'Desactivar MCP externo',
|
||||
'topTabs.windowOpacity': 'Opacidad de la ventana',
|
||||
'topTabs.openSettings': 'Abrir Configuración',
|
||||
'ai.chat.sessionHistory': 'Historial de sesiones',
|
||||
'ai.chat.resizeInput': 'Arrastra para redimensionar el campo de mensaje',
|
||||
'ai.chat.attach': 'Adjuntar',
|
||||
'ai.chat.terminalSelectionAttachment': 'Selección de la terminal',
|
||||
'ai.chat.terminalSelectionLines': 'líneas: {count}',
|
||||
'ai.chat.collapse': 'Contraer',
|
||||
'ai.chat.expand': 'Expandir',
|
||||
'ai.chat.enableAgent': 'Habilitar {name}',
|
||||
'ai.chat.artifact.noteFallback': 'Nota de Vault',
|
||||
'ai.chat.artifact.openNotes': 'Abrir Notas',
|
||||
'ai.chat.artifact.openHosts': 'Abrir Hosts',
|
||||
'ai.chat.artifact.notesSummary': '{count} notas en Vault',
|
||||
'ai.chat.artifact.hostsSummary': '{count} hosts en Vault',
|
||||
'ai.chat.artifact.hostsAdded': 'Se agregaron {count} hosts',
|
||||
'ai.chat.artifact.hostsPreview': 'Vista previa de {count} hosts',
|
||||
'ai.chat.artifact.failed': 'La operación de Vault falló',
|
||||
'ai.chat.artifact.unavailableTitle': 'No disponible',
|
||||
'ai.chat.artifact.noteMissing': 'Esta nota ya no está en tu Vault.',
|
||||
'ai.chat.artifact.hostMissing': 'Este host ya no está en tu Vault.',
|
||||
'ai.chat.artifact.snippetMissing': 'Este snippet o script ya no está en tu Vault.',
|
||||
'ai.chat.artifact.openSnippets': 'Abrir Snippets',
|
||||
'ai.chat.artifact.snippetsSummary': '{count} snippets en Vault',
|
||||
'ai.chat.artifact.scriptsSummary': '{count} scripts en Vault',
|
||||
'ai.chat.artifact.snippetFallback': 'Snippet de Vault',
|
||||
'ai.chat.artifact.scriptFallback': 'Script de automatización',
|
||||
'ai.chat.artifact.scriptLanguage': 'Script de {language}',
|
||||
'ai.chat.artifact.snippetDeleted': 'Snippet eliminado',
|
||||
'ai.chat.artifact.scriptDeleted': 'Script eliminado',
|
||||
'ai.chat.artifact.snippetRan': 'Snippet ejecutado',
|
||||
'ai.chat.artifact.scriptStarted': 'Se inició la ejecución del script',
|
||||
'ai.chat.artifact.scriptRunStatus': 'Ejecución del script: {status}',
|
||||
'ai.chat.artifact.scriptRunsSummary': '{count} ejecuciones de scripts',
|
||||
'ai.chat.artifact.scriptRunStopped': 'Ejecución del script detenida',
|
||||
'ai.chat.artifact.scriptRunPaused': 'Ejecución del script en pausa',
|
||||
'ai.chat.artifact.scriptRunResumed': 'Ejecución del script reanudada',
|
||||
'ai.chat.artifact.scriptReference': 'referencia de la API de nct',
|
||||
'zmodem.waitingForRemote': 'Esperando al servidor remoto...',
|
||||
'zmodem.uploading': 'Subiendo',
|
||||
'zmodem.downloading': 'Descargando',
|
||||
'zmodem.cancelTransfer': 'Cancelar transferencia (Ctrl+C)',
|
||||
'zmodem.overwrite.title': 'El archivo remoto ya existe',
|
||||
'zmodem.overwrite.applyToRest': 'Aplicar a los conflictos restantes',
|
||||
'zmodem.overwrite.overwrite': 'Sobrescribir',
|
||||
'zmodem.overwrite.skip': 'Omitir',
|
||||
'zmodem.overwrite.cancel': 'Cancelar',
|
||||
'settings.shortcuts.resetToDefault': 'Restablecer al predeterminado',
|
||||
};
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,133 @@
|
||||
export const esScriptsMessages = {
|
||||
'scripts.meta.name': 'Nombre',
|
||||
'scripts.meta.language': 'Lenguaje',
|
||||
'scripts.meta.description': 'Descripción',
|
||||
'scripts.meta.descriptionPlaceholder': 'Notas opcionales sobre este script',
|
||||
'scripts.meta.trigger': 'Disparador',
|
||||
'scripts.meta.triggerPattern': 'Patrón de salida (regex)',
|
||||
'scripts.meta.code': 'Script',
|
||||
'scripts.trigger.manual': 'Ejecución manual',
|
||||
'scripts.trigger.onConnect': 'Ejecutar al conectar',
|
||||
'scripts.trigger.onOutput': 'Ejecutar al coincidir con la salida',
|
||||
'scripts.trigger.onOutputHint': 'Se dispara cuando la salida del servidor coincide con el patrón (el eco de las teclas del usuario se ignora). Sin hosts de destino configurados, escucha en la sesión conectada actual; con hosts de destino, solo en esos hosts. Deshabilitado en aplicaciones de pantalla alterna como vim o htop. Se suprime mientras otro script se ejecuta en esta sesión; se vuelve a revisar cuando termina. Para esperas dentro del flujo, usa nct.screen.waitForText o nct.screen.waitForRegex en el código del script.',
|
||||
'scripts.actions.save': 'Guardar',
|
||||
'scripts.actions.runNow': 'Ejecutar ahora',
|
||||
'scripts.actions.openEditor': 'Abrir editor',
|
||||
'scripts.actions.openEditorHint': 'Editar el script en una ventana más grande',
|
||||
'scripts.editor.modalTitle': 'Editor de scripts',
|
||||
'scripts.editor.modalSubtitle': 'Edita los metadatos y el código del script en un espacio de trabajo más amplio.',
|
||||
'scripts.editor.lineCount': '{count} líneas',
|
||||
'scripts.editor.resize': 'Redimensionar el editor',
|
||||
'scripts.targets.hint': 'Los grupos seleccionados se resuelven dinámicamente, por lo que los hosts agregados después se incluyen automáticamente.',
|
||||
'scripts.targets.connectOrderHint': 'El orden de ejecución de los scripts de conexión se configura por host en Detalles del host → Automatización.',
|
||||
'scripts.targets.currentHostMismatch': 'Este script no está asignado al host actual.',
|
||||
'hostDetails.automation.groupScripts': 'Scripts de grupo heredados',
|
||||
'hostDetails.automation.groupScriptsHint': 'Estos scripts siguen al grupo del host dinámicamente y se ordenan antes de la cola específica del host.',
|
||||
'scripts.actions.runNowHint': 'Ejecutar en los destinos seleccionados, o en todos los hosts conectables cuando esa opción está habilitada.',
|
||||
'scripts.actions.runParallel': 'Ejecutar en todas las pestañas (en paralelo)',
|
||||
'scripts.actions.runSequential': 'Ejecutar en todas las pestañas (en secuencia)',
|
||||
'scripts.actions.runOnAllTabs': 'Ejecutar en todas las pestañas',
|
||||
'scripts.actions.skippedConnectingSessions': '{count} pestaña(s) aún conectándose y fueron omitidas',
|
||||
'scripts.actions.skippedSensitiveSessions': '{count} pestaña(s) omitidas (entrada de contraseña/datos sensibles)',
|
||||
'scripts.actions.noRunnableHosts': 'Ningún host conectable coincide con los destinos de este script',
|
||||
'scripts.sidePanel.library': 'Biblioteca',
|
||||
'scripts.sidePanel.running': 'En ejecución',
|
||||
'scripts.sidePanel.newScript': 'Nuevo script',
|
||||
'scripts.running.empty': 'No hay scripts en ejecución en esta sesión.',
|
||||
'scripts.running.unnamed': 'Script sin título',
|
||||
'scripts.running.status.running': 'En ejecución',
|
||||
'scripts.running.status.paused': 'En pausa',
|
||||
'scripts.running.status.completed': 'Completado',
|
||||
'scripts.running.status.failed': 'Falló',
|
||||
'scripts.running.waitingFor': 'Esperando {pattern}',
|
||||
'scripts.running.waitingForLabel': 'Esperando',
|
||||
'scripts.running.waitingForShellPrompt': 'indicador del shell (# o $)',
|
||||
'scripts.running.lastSent': 'Enviado: {command}',
|
||||
'scripts.recording.start': 'Comenzar grabación',
|
||||
'scripts.recording.active': 'Detener grabación',
|
||||
'scripts.recording.startHint': 'Graba las acciones en la terminal enfocada y genera código de script nct',
|
||||
'scripts.recording.unavailableHint': 'La grabación no está disponible aquí — usa la barra lateral de scripts a la derecha',
|
||||
'scripts.recording.activeHint': 'Grabando esta terminal. Escribe comandos como de costumbre; haz clic en Detener o usa el control REC en la barra de herramientas para finalizar y guardar.',
|
||||
'scripts.recording.started': 'Grabación iniciada — opera en la terminal',
|
||||
'scripts.recording.noSession': 'Conecta una terminal primero (pestaña única o espacio de trabajo)',
|
||||
'scripts.recording.alreadyActive': 'Otra terminal ya está grabando',
|
||||
'scripts.recording.stop': 'Detener grabación',
|
||||
'scripts.recording.pause': 'Pausar grabación',
|
||||
'scripts.recording.resume': 'Reanudar grabación',
|
||||
'scripts.recording.saveTitle': 'Guardar script grabado',
|
||||
'scripts.recording.namePlaceholder': 'Nombre del script',
|
||||
'scripts.recording.packagePlaceholder': 'Guardar en carpeta',
|
||||
'scripts.recording.rootPackage': 'Raíz',
|
||||
'scripts.recording.save': 'Guardar',
|
||||
'scripts.recording.saveAndEdit': 'Guardar y editar',
|
||||
'scripts.recording.helpTitle': 'Cómo grabar un script',
|
||||
'scripts.recording.helpIntro': 'La grabación convierte lo que haces en la terminal en un script de automatización reutilizable — útil para despliegues, verificaciones de salud y otras tareas repetitivas.',
|
||||
'scripts.recording.helpStep1': 'Conecta a un host. Una pestaña de terminal independiente o una terminal dentro de un espacio de trabajo funcionan igual — abre la barra lateral de scripts a la derecha.',
|
||||
'scripts.recording.helpStep2': 'Haz clic en Comenzar grabación. Una insignia REC roja en la barra de herramientas de la terminal indica que la grabación está activa.',
|
||||
'scripts.recording.helpStep3': 'Escribe comandos en la terminal como lo harías normalmente. Cada pulsación de Enter se captura como un paso.',
|
||||
'scripts.recording.helpStep4': 'Cuando termines, haz clic en Detener grabación, o usa el control de detención junto a REC en la barra de herramientas de la terminal.',
|
||||
'scripts.recording.helpStep5': 'Nombra el script y guárdalo. Elige Guardar y editar si quieres ajustar el código generado en el editor de scripts.',
|
||||
'scripts.recording.helpTipsTitle': 'Consejos',
|
||||
'scripts.recording.helpTip1': 'Las pausas de más de 1 segundo entre acciones se registran como tiempo de espera para que la reproducción no sea demasiado rápida.',
|
||||
'scripts.recording.helpTip2': 'Después de cada comando, la grabación espera un indicador del shell (como $ o #) antes del siguiente paso.',
|
||||
'scripts.recording.helpTip3': 'La entrada de contraseñas se marca como sensible y no se almacena en texto plano en el script.',
|
||||
'scripts.recording.helpTip4': 'Para vim, menús u otros flujos interactivos, graba primero los comandos principales y luego refina el script manualmente.',
|
||||
'scripts.dialog.title': 'Script',
|
||||
'scripts.dialog.ok': 'Aceptar',
|
||||
'scripts.dialog.required': 'Obligatorio',
|
||||
'scripts.dialog.numberInvalid': 'Ingresa un número válido',
|
||||
'scripts.dialog.numberMin': 'Debe ser al menos {min}',
|
||||
'scripts.dialog.numberMax': 'Debe ser como máximo {max}',
|
||||
'scripts.dialog.numberStep': 'Debe usar incrementos de {step}',
|
||||
'scripts.dialog.waitForTimeoutTitle': 'La espera agotó el tiempo',
|
||||
'scripts.dialog.retry': 'Reintentar',
|
||||
'scripts.dialog.skip': 'Omitir',
|
||||
'scripts.dialog.abort': 'Abortar',
|
||||
'scripts.running.stepProgress': 'Paso {current} / {total}',
|
||||
'scripts.running.determinateProgress': '{label} {current}/{total}',
|
||||
'scripts.running.progressFallback': 'Progreso',
|
||||
'scripts.running.operationsCount': '{count} operaciones',
|
||||
'scripts.running.opsPrefix': '',
|
||||
'scripts.running.opsSuffix': ' operaciones',
|
||||
'scripts.running.elapsedLabel': 'Transcurrido',
|
||||
'scripts.running.lastSentLabel': 'Enviado:',
|
||||
'scripts.running.elapsed': '{elapsed}',
|
||||
'scripts.running.completedSummary': 'Completado · {count} operaciones · {elapsed}',
|
||||
'scripts.running.dismissHint': 'Toca cerrar para descartar',
|
||||
'scripts.running.dismiss': 'Cerrar',
|
||||
'scripts.running.viewLogs': 'Ver registros',
|
||||
'scripts.running.logTitle': '{name} · Registro de ejecución',
|
||||
'scripts.running.logEmpty': 'Aún no hay salida de registro',
|
||||
'scripts.running.pause': 'Pausar',
|
||||
'scripts.running.resume': 'Reanudar',
|
||||
'scripts.running.stop': 'Detener',
|
||||
'scripts.recording.saved': 'Script guardado',
|
||||
'scripts.recording.savedNamed': 'Guardado "{name}"',
|
||||
'scripts.observer.blocked': 'El modo observador bloquea los scripts que escriben en la terminal.',
|
||||
'vault.section.scripts': 'Scripts',
|
||||
'vault.nav.scripts': 'Scripts',
|
||||
'snippets.action.newScript': 'Nuevo script de automatización',
|
||||
'hostDetails.section.automation': 'Automatización',
|
||||
'hostDetails.automation.loginScript': 'Script de inicio de sesión',
|
||||
'hostDetails.automation.loginScriptPlaceholder': 'Selecciona un script',
|
||||
'hostDetails.automation.none': 'Ninguno',
|
||||
'hostDetails.automation.outputTriggers': 'Disparadores de salida',
|
||||
'hostDetails.automation.addTrigger': 'Agregar disparador',
|
||||
'hostDetails.automation.triggerPatternPlaceholder': 'Patrón de regex',
|
||||
'hostDetails.automation.linkedScripts': 'Scripts vinculados',
|
||||
'hostDetails.automation.linkedScriptsEmpty': 'Aún no hay scripts vinculados a este host.',
|
||||
'hostDetails.automation.linkScriptPlaceholder': 'Vincular script existente…',
|
||||
'hostDetails.automation.unlink': 'Desvincular',
|
||||
'hostDetails.automation.equivalenceHint': 'Los vínculos agregan este host a la lista de destinos del script en Scripts. Ambas vistas se mantienen sincronizadas.',
|
||||
'hostDetails.automation.queueHint': 'Los scripts se ejecutan en orden cuando este host se conecta. Los scripts globales se ejecutan primero, luego esta cola.',
|
||||
'hostDetails.automation.globalScripts': 'Scripts de conexión globales',
|
||||
'hostDetails.automation.globalScriptsHint': 'Se ejecutan primero en cada conexión. Reordena según el orden de clasificación de la biblioteca de Scripts.',
|
||||
'hostDetails.automation.connectQueue': 'Cola de ejecución de este host',
|
||||
'hostDetails.automation.connectQueueEmpty': 'Aún no hay scripts de conexión en cola para este host.',
|
||||
'hostDetails.automation.addToQueuePlaceholder': 'Agregar script a la cola…',
|
||||
'hostDetails.automation.moveUp': 'Subir',
|
||||
'hostDetails.automation.moveDown': 'Bajar',
|
||||
'hostDetails.automation.removeFromQueue': 'Quitar de la cola',
|
||||
'hostDetails.automation.dragHandle': 'Arrastra para reordenar',
|
||||
'hostDetails.automation.queueDragHint': 'Arrastra los elementos para reordenar la cola de conexión.',
|
||||
};
|
||||
@@ -0,0 +1,261 @@
|
||||
import type { Messages } from '../types';
|
||||
|
||||
export const esSystemManagerMessages: Messages = {
|
||||
'terminal.layer.system': 'Sistema',
|
||||
|
||||
'systemManager.noSession': 'No hay una sesión de terminal activa.',
|
||||
'systemManager.notConnected': 'Conéctate a un host para administrar procesos y servicios.',
|
||||
'systemManager.empty': 'No hay datos disponibles.',
|
||||
'systemManager.tabs.overview': 'Resumen',
|
||||
'systemManager.tabs.processes': 'Procesos',
|
||||
'systemManager.tabs.ports': 'Puertos',
|
||||
'systemManager.tabs.services': 'Servicios',
|
||||
'systemManager.tabs.tmux': 'tmux',
|
||||
'systemManager.tabs.docker': 'Docker',
|
||||
'systemManager.tabs.gpu': 'GPU',
|
||||
'systemManager.tabs.ariaLabel': 'Secciones del administrador del sistema',
|
||||
'systemManager.popup.loading': 'Abriendo terminal…',
|
||||
'systemManager.popup.startupFailed': 'El comando de inicio no se completó correctamente. Verifica que el destino siga disponible e inténtalo de nuevo.',
|
||||
|
||||
'systemManager.errors.loadProcesses': 'No se pudieron cargar los procesos',
|
||||
'systemManager.errors.loadTmux': 'No se pudieron cargar las sesiones de tmux',
|
||||
'systemManager.errors.loadTmuxWindows': 'No se pudieron cargar las ventanas de tmux',
|
||||
'systemManager.errors.loadTmuxPanes': 'No se pudieron cargar los paneles de tmux',
|
||||
'systemManager.errors.loadTmuxClients': 'No se pudieron cargar los clientes de tmux',
|
||||
'systemManager.errors.actionFailed': 'La acción falló',
|
||||
'systemManager.errors.loadDocker': 'No se pudieron cargar los contenedores',
|
||||
'systemManager.errors.loadDockerStats': 'No se pudieron cargar las estadísticas de los contenedores',
|
||||
'systemManager.errors.loadDockerImages': 'No se pudieron cargar las imágenes',
|
||||
'systemManager.errors.loadOverview': 'No se pudo cargar el resumen del sistema',
|
||||
'systemManager.errors.loadGpu': 'No se pudieron cargar las estadísticas de GPU / NPU',
|
||||
'systemManager.errors.loadPorts': 'No se pudieron cargar los puertos en escucha',
|
||||
'systemManager.errors.loadServices': 'No se pudieron cargar los servicios de systemd',
|
||||
'systemManager.errors.sshChannelUnavailable': 'El servidor se negó a abrir un nuevo canal de ejecución. Inténtalo de nuevo más tarde o vuelve a conectar este host.',
|
||||
|
||||
'systemManager.overview.empty': 'Aún no hay datos de resumen del sistema.',
|
||||
'systemManager.overview.loading': 'Cargando resumen del sistema…',
|
||||
'systemManager.overview.memory': 'Memoria',
|
||||
'systemManager.overview.disk': 'Disco',
|
||||
'systemManager.overview.network': 'Red',
|
||||
'systemManager.overview.rx': 'RX',
|
||||
'systemManager.overview.tx': 'TX',
|
||||
'systemManager.overview.cores': '{{count}} núcleos',
|
||||
'systemManager.overview.load': 'Carga',
|
||||
'systemManager.overview.uptime': 'Tiempo activo',
|
||||
'systemManager.overview.duration.daysHours': '{{days}}d {{hours}}h',
|
||||
'systemManager.overview.duration.hoursMinutes': '{{hours}}h {{minutes}}m',
|
||||
'systemManager.overview.duration.minutes': '{{minutes}}m',
|
||||
'systemManager.overview.system': 'Sistema',
|
||||
'systemManager.overview.kernel': 'Kernel',
|
||||
'systemManager.overview.swap': 'Swap',
|
||||
'systemManager.overview.latency': 'Latencia de red SSH',
|
||||
'systemManager.overview.cpuCores': 'Núcleos de CPU',
|
||||
'systemManager.overview.disks': 'Discos',
|
||||
'systemManager.overview.interfaces': 'Interfaces de red',
|
||||
'systemManager.overview.topProcesses': 'Procesos con más memoria',
|
||||
'systemManager.overview.noData': 'Sin datos',
|
||||
'systemManager.overview.noDisks': 'Sin datos de disco',
|
||||
'systemManager.overview.noInterfaces': 'Sin datos de interfaces',
|
||||
'systemManager.overview.noTopProcesses': 'Sin datos de procesos',
|
||||
|
||||
'systemManager.processes.search': 'Buscar procesos…',
|
||||
'systemManager.processes.command': 'Comando',
|
||||
'systemManager.processes.user': 'Usuario',
|
||||
'systemManager.processes.term': 'Terminar',
|
||||
'systemManager.processes.kill': 'Forzar cierre',
|
||||
'systemManager.processes.stop': 'Detener (SIGSTOP)',
|
||||
'systemManager.processes.cont': 'Continuar (SIGCONT)',
|
||||
'systemManager.processes.hup': 'Colgar (SIGHUP)',
|
||||
'systemManager.processes.renice': 'Renice',
|
||||
'systemManager.processes.renicePrompt': 'Valor de nice (-20 a 19)',
|
||||
'systemManager.processes.reniceInvalid': 'El valor de nice debe estar entre -20 y 19',
|
||||
'systemManager.processes.confirmKill': '¿Enviar SIGKILL al proceso {{pid}}?',
|
||||
'systemManager.processes.confirmSignal': '¿Enviar SIG{{signal}} al proceso {{pid}}?',
|
||||
'systemManager.processes.filter.all': 'Todos',
|
||||
'systemManager.processes.filter.running': 'En ejecución',
|
||||
'systemManager.processes.ppid': 'PID padre',
|
||||
'systemManager.processes.rss': 'RSS',
|
||||
'systemManager.processes.vsz': 'Tamaño virtual',
|
||||
'systemManager.processes.elapsed': 'Transcurrido',
|
||||
'systemManager.processes.stat': 'Estado',
|
||||
'systemManager.processes.meta': '{{count}} proceso(s)',
|
||||
'systemManager.processes.loading': 'Cargando procesos…',
|
||||
'systemManager.processes.loadingMore': 'Cargando más procesos…',
|
||||
'systemManager.processes.state.running': 'En ejecución',
|
||||
'systemManager.processes.state.sleeping': 'En reposo',
|
||||
'systemManager.processes.state.stopped': 'Detenido',
|
||||
'systemManager.processes.state.zombie': 'Zombie',
|
||||
'systemManager.processes.sort.cpu': 'CPU',
|
||||
'systemManager.processes.sort.mem': 'MEM',
|
||||
'systemManager.processes.sort.pid': 'PID',
|
||||
'systemManager.processes.sort.command': 'Comando',
|
||||
'systemManager.processes.sort.user': 'Usuario',
|
||||
|
||||
'systemManager.common.dismiss': 'Descartar',
|
||||
'systemManager.common.checkingAvailability': 'Verificando disponibilidad…',
|
||||
'systemManager.common.loading': 'Cargando…',
|
||||
'systemManager.common.loadingDetails': 'Cargando detalles…',
|
||||
'systemManager.common.loadingStats': 'Cargando estadísticas…',
|
||||
|
||||
'systemManager.tmux.new': 'Nuevo',
|
||||
'systemManager.tmux.search': 'Buscar sesiones…',
|
||||
'systemManager.tmux.newSessionTitle': 'Nueva sesión de tmux',
|
||||
'systemManager.tmux.newSessionDesc': 'Ponle nombre a la sesión y, opcionalmente, ejecuta un script al iniciar.',
|
||||
'systemManager.tmux.newSessionTabCustom': 'Comando personalizado',
|
||||
'systemManager.tmux.newSessionTabSnippet': 'Desde snippet',
|
||||
'systemManager.tmux.pickSnippet': 'Desde snippets',
|
||||
'systemManager.tmux.pickSnippetEmpty': 'Aún no hay snippets; agrega algunos en el panel de Scripts o en Vault.',
|
||||
'systemManager.tmux.selectedSnippet': 'Usando snippet: {{label}}',
|
||||
'systemManager.tmux.newSessionName': 'Nombre de la sesión',
|
||||
'systemManager.tmux.newSessionCommand': 'Comando de inicio',
|
||||
'systemManager.tmux.newSessionCommandPlaceholder': 'p. ej. htop o npm run dev (opcional)',
|
||||
'systemManager.tmux.newSessionCommandHint': 'Déjalo vacío para una sesión de shell predeterminada.',
|
||||
'systemManager.tmux.creating': 'Creando…',
|
||||
'systemManager.tmux.newSessionPlaceholder': 'mi-sesion',
|
||||
'systemManager.tmux.newSessionRequired': 'Primero ingresa un nombre de sesión',
|
||||
'systemManager.tmux.empty': 'No hay sesiones de tmux',
|
||||
'systemManager.tmux.attach': 'Conectar',
|
||||
'systemManager.tmux.attached': 'Conectada',
|
||||
'systemManager.tmux.detached': 'Desacoplada',
|
||||
'systemManager.tmux.windows': '{{count}} ventana(s)',
|
||||
'systemManager.tmux.created': 'Creada',
|
||||
'systemManager.tmux.activity': 'Actividad',
|
||||
'systemManager.tmux.rename': 'Renombrar',
|
||||
'systemManager.tmux.detach': 'Desacoplar todo',
|
||||
'systemManager.tmux.killSession': 'Terminar sesión',
|
||||
'systemManager.tmux.killServer': 'Terminar servidor',
|
||||
'systemManager.tmux.loadingDetails': 'Cargando detalles…',
|
||||
'systemManager.tmux.clients': 'Clientes conectados',
|
||||
'systemManager.tmux.windowList': 'Ventanas',
|
||||
'systemManager.tmux.newWindow': 'Nueva ventana',
|
||||
'systemManager.tmux.newWindowPlaceholder': 'Nombre de la ventana (opcional)',
|
||||
'systemManager.tmux.noWindows': 'No hay ventanas',
|
||||
'systemManager.tmux.unavailable': 'tmux no está disponible en este host',
|
||||
'systemManager.docker.unavailable': 'Docker no está disponible en este host',
|
||||
'systemManager.tmux.windowsMismatch': 'La sesión reporta {{count}} ventana(s), pero list-windows no devolvió ninguna',
|
||||
'systemManager.tmux.lastCommand': 'último comando: {{command}}',
|
||||
'systemManager.tmux.noPanes': 'No hay paneles',
|
||||
'systemManager.tmux.panes': '{{count}} panel(es)',
|
||||
'systemManager.tmux.active': 'activo',
|
||||
'systemManager.tmux.unnamedWindow': 'Ventana sin nombre',
|
||||
'systemManager.tmux.unnamedPane': 'Panel sin nombre',
|
||||
'systemManager.tmux.attachWindow': 'Conectar a la ventana',
|
||||
'systemManager.tmux.selectWindow': 'Seleccionar ventana',
|
||||
'systemManager.tmux.killWindow': 'Terminar ventana',
|
||||
'systemManager.tmux.killPane': 'Terminar panel',
|
||||
'systemManager.tmux.splitHorizontal': 'Dividir horizontal',
|
||||
'systemManager.tmux.splitVertical': 'Dividir vertical',
|
||||
'systemManager.tmux.sendKeys': 'Enviar teclas',
|
||||
'systemManager.tmux.sendKeysTo': 'Enviar teclas a la ventana {{window}} panel {{pane}}',
|
||||
'systemManager.tmux.sendKeysPlaceholder': 'Comando o texto…',
|
||||
'systemManager.tmux.renameSessionPrompt': 'Renombrar sesión',
|
||||
'systemManager.tmux.renameWindowPrompt': 'Renombrar ventana',
|
||||
'systemManager.tmux.windowName': 'Nombre de la ventana',
|
||||
'systemManager.tmux.confirmKillSession': '¿Terminar la sesión de tmux "{{name}}"?',
|
||||
'systemManager.tmux.confirmDetachSession': '¿Desacoplar todos los clientes de "{{name}}"?',
|
||||
'systemManager.tmux.confirmKillWindow': '¿Terminar la ventana "{{name}}"?',
|
||||
'systemManager.tmux.confirmKillPane': '¿Terminar el panel #{{index}}?',
|
||||
'systemManager.tmux.confirmKillServer': '¿Terminar el servidor de tmux? Se terminarán todas las sesiones.',
|
||||
'systemManager.tmux.meta': '{{count}} sesión(es)',
|
||||
|
||||
'systemManager.docker.title': 'Contenedores',
|
||||
'systemManager.docker.subTabs.containers': 'Contenedores',
|
||||
'systemManager.docker.subTabs.images': 'Imágenes',
|
||||
'systemManager.docker.empty': 'No se encontraron contenedores',
|
||||
'systemManager.docker.imagesEmpty': 'No se encontraron imágenes',
|
||||
'systemManager.docker.search': 'Buscar contenedores…',
|
||||
'systemManager.docker.searchImages': 'Buscar imágenes…',
|
||||
'systemManager.docker.filter.all': 'Todos',
|
||||
'systemManager.docker.filter.running': 'En ejecución',
|
||||
'systemManager.docker.filter.stopped': 'Detenidos',
|
||||
'systemManager.docker.filter.paused': 'En pausa',
|
||||
'systemManager.docker.shell': 'Shell',
|
||||
'systemManager.docker.logs': 'Registros',
|
||||
'systemManager.docker.details': 'Detalles',
|
||||
'systemManager.docker.inspect': 'Inspeccionar',
|
||||
'systemManager.docker.imageInspect': 'Inspección de imagen',
|
||||
'systemManager.docker.confirmRemove': '¿Eliminar este contenedor?',
|
||||
'systemManager.docker.confirmKill': '¿Terminar por la fuerza este contenedor?',
|
||||
'systemManager.docker.confirmRemoveImage': '¿Eliminar la imagen "{{name}}"?',
|
||||
'systemManager.docker.confirmPrune': '¿Eliminar las imágenes colgantes?',
|
||||
'systemManager.docker.confirmPruneAll': '¿Eliminar todas las imágenes no utilizadas?',
|
||||
'systemManager.docker.pause': 'Pausar',
|
||||
'systemManager.docker.unpause': 'Reanudar',
|
||||
'systemManager.docker.restart': 'Reiniciar',
|
||||
'systemManager.docker.kill': 'Terminar',
|
||||
'systemManager.docker.renamePrompt': 'Nombre del contenedor',
|
||||
'systemManager.docker.prune': 'Limpiar',
|
||||
'systemManager.docker.pruneAll': 'Limpiar todo',
|
||||
'systemManager.docker.tag': 'Etiqueta',
|
||||
'systemManager.docker.tagRepoPrompt': 'Nombre del repositorio',
|
||||
'systemManager.docker.tagNamePrompt': 'Nombre de la etiqueta',
|
||||
'systemManager.docker.meta': '{{count}} contenedor(es)',
|
||||
'systemManager.docker.imagesMeta': '{{count}} imagen(es)',
|
||||
'systemManager.docker.start': 'Iniciar',
|
||||
'systemManager.docker.stop': 'Detener',
|
||||
|
||||
'systemManager.ports.unavailable': 'No se detectaron herramientas de puertos en escucha (ss / netstat) en este host.',
|
||||
'systemManager.ports.loading': 'Cargando puertos en escucha…',
|
||||
'systemManager.ports.empty': 'No se reportaron puertos en escucha.',
|
||||
'systemManager.ports.search': 'Buscar puertos…',
|
||||
'systemManager.ports.meta': '{{count}} en escucha',
|
||||
'systemManager.ports.filter.all': 'Todos',
|
||||
'systemManager.ports.unknownProcess': 'Proceso desconocido',
|
||||
'systemManager.ports.terminate': 'Terminar',
|
||||
'systemManager.ports.confirmTerminate': '¿Enviar SIGTERM al proceso {{pid}} que ocupa este puerto?',
|
||||
|
||||
'systemManager.services.unavailable': 'systemctl no está disponible en este host.',
|
||||
'systemManager.services.loading': 'Cargando servicios de systemd…',
|
||||
'systemManager.services.empty': 'No se encontraron servicios de systemd.',
|
||||
'systemManager.services.search': 'Buscar servicios…',
|
||||
'systemManager.services.meta': '{{count}} servicio(s)',
|
||||
'systemManager.services.filter.all': 'Todos',
|
||||
'systemManager.services.filter.running': 'En ejecución',
|
||||
'systemManager.services.filter.failed': 'Con error',
|
||||
'systemManager.services.filter.inactive': 'Inactivo',
|
||||
'systemManager.services.start': 'Iniciar',
|
||||
'systemManager.services.stop': 'Detener',
|
||||
'systemManager.services.restart': 'Reiniciar',
|
||||
'systemManager.services.enable': 'Habilitar',
|
||||
'systemManager.services.disable': 'Deshabilitar',
|
||||
'systemManager.services.reload': 'Recargar',
|
||||
'systemManager.services.scope.user': 'usuario',
|
||||
'systemManager.services.confirmAction': '¿{{action}} {{name}}?',
|
||||
|
||||
'systemManager.gpu.unavailable': 'No se detectaron herramientas de GPU NVIDIA o NPU Ascend en este host.',
|
||||
'systemManager.gpu.loading': 'Cargando estadísticas del acelerador…',
|
||||
'systemManager.gpu.empty': 'Las herramientas del acelerador están presentes, pero no se reportó ningún dispositivo.',
|
||||
'systemManager.gpu.meta': '{{devices}} dispositivo(s) · {{processes}} proceso(s)',
|
||||
'systemManager.gpu.devices': 'Dispositivos',
|
||||
'systemManager.gpu.processes': 'Procesos de cómputo',
|
||||
'systemManager.gpu.noProcesses': 'No se reportaron procesos de cómputo.',
|
||||
'systemManager.gpu.vendor.nvidia': 'NVIDIA',
|
||||
'systemManager.gpu.vendor.ascend': 'Ascend',
|
||||
'systemManager.gpu.util': 'Util',
|
||||
'systemManager.gpu.memory': 'VRAM',
|
||||
'systemManager.gpu.hbm': 'HBM',
|
||||
'systemManager.gpu.temperature': 'Temperatura',
|
||||
'systemManager.gpu.power': 'Energía',
|
||||
'systemManager.gpu.fan': 'Ventilador {{value}}%',
|
||||
'systemManager.gpu.driver': 'Controlador {{version}}',
|
||||
|
||||
'systemManager.inspect.status': 'Estado',
|
||||
'systemManager.inspect.image': 'Imagen',
|
||||
'systemManager.inspect.created': 'Creado',
|
||||
'systemManager.inspect.started': 'Iniciado',
|
||||
'systemManager.inspect.restartPolicy': 'Política de reinicio',
|
||||
'systemManager.inspect.command': 'Comando',
|
||||
'systemManager.inspect.ports': 'Puertos',
|
||||
'systemManager.inspect.networks': 'Redes',
|
||||
'systemManager.inspect.mounts': 'Montajes',
|
||||
'systemManager.inspect.env': 'Entorno',
|
||||
'systemManager.inspect.labels': 'Etiquetas',
|
||||
'systemManager.inspect.tags': 'Etiquetas',
|
||||
'systemManager.inspect.digests': 'Digests',
|
||||
'systemManager.inspect.size': 'Tamaño',
|
||||
'systemManager.inspect.platform': 'Plataforma',
|
||||
'systemManager.inspect.workdir': 'Directorio de trabajo',
|
||||
'systemManager.inspect.exposedPorts': 'Puertos expuestos',
|
||||
'systemManager.inspect.showRaw': 'JSON',
|
||||
'systemManager.inspect.hideRaw': 'Ocultar JSON',
|
||||
};
|
||||
@@ -0,0 +1,843 @@
|
||||
import type { Messages } from '../types';
|
||||
|
||||
export const esTerminalMessages: Messages = {
|
||||
'terminal.sudoHint.pressEnter': 'Presiona Enter para pegar la contraseña guardada',
|
||||
'terminal.passwordPicker.title': 'Contraseñas guardadas',
|
||||
'terminal.passwordPicker.empty': 'No hay contraseñas guardadas',
|
||||
// Network Device Mode auto-detection tip (session header)
|
||||
'terminal.networkDevice.tip.message': 'Esto parece un dispositivo de red. Activa el Modo de Dispositivo de Red para enviar comandos tal cual (sin envoltorio de shell).',
|
||||
'terminal.networkDevice.tip.action': 'Activar',
|
||||
'terminal.networkDevice.tip.dismiss': 'Descartar',
|
||||
'terminal.networkDevice.tip.enabled': 'Modo de Dispositivo de Red activado para {host}',
|
||||
// Terminal toolbar / search / context menu / auth
|
||||
'terminal.toolbar.openSftp': 'Abrir SFTP',
|
||||
'terminal.toolbar.availableAfterConnect': 'Disponible después de conectar',
|
||||
'terminal.toolbar.sendYmodem': 'Enviar con YMODEM',
|
||||
'terminal.toolbar.receiveYmodem': 'Recibir con YMODEM',
|
||||
'terminal.toolbar.sftp': 'SFTP',
|
||||
'terminal.toolbar.more': 'Más acciones',
|
||||
'terminal.toolbar.scripts': 'Scripts',
|
||||
'terminal.toolbar.history': 'Historial de comandos',
|
||||
'terminal.toolbar.configureOsc7': 'Configurar seguimiento de directorio',
|
||||
'history.scope.label': 'Alcance del historial',
|
||||
'history.tab.host': 'Host',
|
||||
'history.tab.global': 'Global',
|
||||
'history.searchPlaceholder': 'Buscar en el historial...',
|
||||
'history.loading': 'Cargando historial remoto...',
|
||||
'history.meta.count': '{count} comandos',
|
||||
'history.empty.noSession': 'Abre una sesión remota para ver su historial de comandos.',
|
||||
'history.empty.unsupportedProtocol': 'El historial de comandos solo está disponible para sesiones SSH/Mosh/ET.',
|
||||
'history.empty.noHistory': 'No se encontró historial de comandos en este host.',
|
||||
'history.empty.noGlobalHistory': 'Aún no hay historial global de comandos. Los comandos que ejecutes aparecerán aquí.',
|
||||
'history.action.refresh': 'Actualizar',
|
||||
'history.action.retry': 'Reintentar',
|
||||
'history.action.paste': 'Pegar en la terminal',
|
||||
'history.action.run': 'Ejecutar en la terminal',
|
||||
'history.action.saveAsSnippet': 'Guardar como snippet',
|
||||
'history.action.delete': 'Eliminar del historial',
|
||||
'terminal.toolbar.library': 'Biblioteca',
|
||||
'terminal.toolbar.noSnippets': 'No hay snippets disponibles',
|
||||
'terminal.toolbar.terminalSettings': 'Configuración de la terminal',
|
||||
'terminal.toolbar.searchTerminal': 'Buscar en la terminal',
|
||||
'terminal.toolbar.search': 'Buscar',
|
||||
'terminal.toolbar.startSessionLog': 'Iniciar registro de sesión',
|
||||
'terminal.toolbar.stopSessionLog': 'Detener registro de sesión',
|
||||
'terminal.toolbar.timestampsEnable': 'Mostrar marcas de tiempo',
|
||||
'terminal.toolbar.timestampsDisable': 'Ocultar marcas de tiempo',
|
||||
'terminal.toolbar.broadcast': 'Difundir',
|
||||
'terminal.toolbar.broadcastEnable': 'Activar Modo de Difusión',
|
||||
'terminal.toolbar.broadcastDisable': 'Desactivar Modo de Difusión',
|
||||
'terminal.toolbar.composeBar': 'Barra de redacción',
|
||||
'terminal.composeBar.placeholder': 'Escribe el comando aquí y presiona Enter para enviar...',
|
||||
'terminal.composeBar.send': 'Enviar',
|
||||
'terminal.composeBar.close': 'Cerrar barra de redacción',
|
||||
'terminal.composeBar.broadcasting': 'Difundiendo a todas las sesiones',
|
||||
'terminal.composeBar.resize': 'Cambiar la altura de la barra de redacción',
|
||||
'terminal.composeBar.manageSnippets': 'Administrar snippets rápidos',
|
||||
'terminal.composeBar.searchSnippets': 'Buscar snippets...',
|
||||
'terminal.composeBar.noPinnedSnippets': 'Fija snippets con + para acceso rápido',
|
||||
'terminal.composeBar.noMatchingSnippets': 'No hay snippets que coincidan',
|
||||
'terminal.composeBar.pinnedCount': '{count} fijados',
|
||||
'terminal.composeBar.unpinSnippet': 'Quitar {label} de la barra rápida',
|
||||
'terminal.composeBar.snippetClickHint': 'Clic para insertar · Shift+Clic para enviar',
|
||||
'terminal.toolbar.focus': 'Enfocar',
|
||||
'terminal.toolbar.focusMode': 'Modo de Enfoque',
|
||||
'terminal.toolbar.detach': 'Desacoplar a pestaña independiente',
|
||||
'terminal.toolbar.dragPane': 'Arrastrar panel de terminal',
|
||||
'terminal.toolbar.showActions': 'Mostrar acciones de la terminal',
|
||||
'terminal.toolbar.encoding': 'Codificación de la terminal',
|
||||
'terminal.toolbar.encoding.utf8': 'UTF-8',
|
||||
'terminal.toolbar.encoding.gb18030': 'GB18030',
|
||||
'terminal.toolbar.closeSession': 'Cerrar sesión',
|
||||
'terminal.toolbar.hostHighlight.title': 'Resaltado de palabras clave del host',
|
||||
'terminal.toolbar.hostHighlight.noRules': 'No hay reglas de resaltado personalizadas definidas para este host',
|
||||
'terminal.toolbar.hostHighlight.addRule': 'Agregar nueva regla',
|
||||
'terminal.toolbar.hostHighlight.labelPlaceholder': 'Etiqueta (p. ej., Error)',
|
||||
'terminal.toolbar.hostHighlight.patternPlaceholder': 'Patrón regex (p. ej., \\bfailed\\b)',
|
||||
'terminal.toolbar.hostHighlight.invalidPattern': 'Patrón regex no válido',
|
||||
'terminal.toolbar.hostHighlight.clearAll': 'Borrar todo',
|
||||
'terminal.toolbar.hostHighlight.changeColor': 'Cambiar el color de resaltado de',
|
||||
'terminal.toolbar.hostHighlight.selectColor': 'Seleccionar el color de la nueva regla',
|
||||
'terminal.statusbar.copyHostname.label': 'Copiar dirección del host',
|
||||
'terminal.statusbar.copyHostname.tooltip': 'Copiar dirección del host ({hostname})',
|
||||
'terminal.statusbar.copyHostname.toast': 'Dirección del host copiada: {hostname}',
|
||||
'terminal.statusbar.copyHostname.error': 'No se pudo copiar la dirección del host al portapapeles',
|
||||
'terminal.statusbar.disconnect.label': 'Desconectar',
|
||||
'terminal.statusbar.disconnect.tooltip': 'Desconectar esta sesión sin cerrar la pestaña',
|
||||
'terminal.statusbar.reconnect.label': 'Reconectar',
|
||||
'terminal.statusbar.reconnect.tooltip': 'Reconectar esta sesión',
|
||||
'terminal.serverStats.cpu': 'Uso de CPU',
|
||||
'terminal.serverStats.cpuCores': 'Uso de núcleos de CPU',
|
||||
'terminal.serverStats.memory': 'Uso de memoria',
|
||||
'terminal.serverStats.memoryDetails': 'Detalles de memoria',
|
||||
'terminal.serverStats.memUsed': 'Usada',
|
||||
'terminal.serverStats.memBuffers': 'Búfers',
|
||||
'terminal.serverStats.memCached': 'Caché',
|
||||
'terminal.serverStats.memFree': 'Libre',
|
||||
'terminal.serverStats.swap': 'Swap',
|
||||
'terminal.serverStats.swapUsed': 'Swap usada',
|
||||
'terminal.serverStats.swapFree': 'Swap libre',
|
||||
'terminal.serverStats.swapTotal': 'Total',
|
||||
'terminal.serverStats.topProcesses': 'Principales procesos por memoria',
|
||||
'terminal.serverStats.disk': 'Uso de disco',
|
||||
'terminal.serverStats.diskDetails': 'Discos montados',
|
||||
'terminal.serverStats.network': 'Velocidad de red',
|
||||
'terminal.serverStats.latency': 'Latencia de red SSH',
|
||||
'terminal.serverStats.networkDetails': 'Interfaces de red',
|
||||
'terminal.serverStats.noData': 'No hay datos disponibles',
|
||||
'terminal.dragDrop.localTitle': 'Soltar para insertar rutas',
|
||||
'terminal.dragDrop.localMessage': 'Las rutas de los archivos se insertarán en la terminal',
|
||||
'terminal.dragDrop.remoteTitle': 'Soltar para subir archivos',
|
||||
'terminal.dragDrop.remoteZmodemMessage': 'Los archivos se subirán mediante ZMODEM (PTY)',
|
||||
'terminal.dragDrop.remoteSftpMessage': 'Los archivos se subirán mediante SFTP',
|
||||
'terminal.dragDrop.noFiles': 'No hay archivos para subir',
|
||||
'terminal.dragDrop.notConnected': 'No se pueden soltar archivos: la terminal no está conectada',
|
||||
'terminal.dragDrop.errorTitle': 'Error al soltar',
|
||||
'terminal.dragDrop.errorMessage': 'No se pudieron procesar los archivos soltados',
|
||||
'terminal.search.placeholder': 'Buscar...',
|
||||
'terminal.search.noResults': 'Sin resultados',
|
||||
'terminal.search.prevMatch': 'Coincidencia anterior (Shift+Enter)',
|
||||
'terminal.search.nextMatch': 'Coincidencia siguiente (Enter)',
|
||||
'terminal.menu.copy': 'Copiar',
|
||||
'terminal.menu.paste': 'Pegar',
|
||||
'terminal.menu.uploadClipboardImage': 'Subir imagen del portapapeles',
|
||||
'terminal.menu.addSelectionToAI': 'Agregar a la conversación',
|
||||
'terminal.menu.pasteSelection': 'Pegar selección',
|
||||
'terminal.menu.selectAll': 'Seleccionar todo',
|
||||
'terminal.menu.reconnect': 'Reconectar',
|
||||
'terminal.menu.sendYmodem': 'Enviar con YMODEM',
|
||||
'terminal.menu.receiveYmodem': 'Recibir con YMODEM',
|
||||
'terminal.menu.splitHorizontal': 'Dividir en horizontal',
|
||||
'terminal.menu.splitVertical': 'Dividir en vertical',
|
||||
'terminal.menu.clearBuffer': 'Limpiar búfer',
|
||||
'terminal.menu.closeTerminal': 'Cerrar terminal',
|
||||
'terminal.menu.rename': 'Renombrar',
|
||||
'terminal.menu.detach': 'Desacoplar del espacio de trabajo',
|
||||
'terminal.menu.detachSession': 'Desacoplar {name}',
|
||||
'terminal.clipboardImageUpload.noImage': 'El portapapeles no contiene una imagen',
|
||||
'terminal.clipboardImageUpload.failed': 'No se pudo subir la imagen del portapapeles',
|
||||
'terminal.osc7Setup.title': 'Configurar seguimiento de directorio',
|
||||
'terminal.osc7Setup.desc': 'Netcatty agregará hooks de prompt OSC 7 para el usuario remoto actual. Esto ayuda a que SFTP siga el directorio de la terminal después de sudo o su.',
|
||||
'terminal.osc7Setup.targets': 'Posibles archivos a actualizar',
|
||||
'terminal.osc7Setup.command': 'Comando a ejecutar',
|
||||
'terminal.osc7Setup.run': 'Ejecutar configuración',
|
||||
'terminal.osc7Setup.running': 'Configurando...',
|
||||
'terminal.osc7Setup.configured': 'Seguimiento de directorio configurado',
|
||||
'terminal.osc7Setup.failed': 'Falló la configuración del seguimiento de directorio',
|
||||
'terminal.osc7Setup.sent': 'Configuración de seguimiento de directorio enviada a la terminal',
|
||||
'terminal.ymodem.selectFile': 'Selecciona el archivo a enviar',
|
||||
'terminal.ymodem.allFiles': 'Todos los archivos',
|
||||
'terminal.ymodem.started': 'YMODEM enviando {fileName}',
|
||||
'terminal.ymodem.complete': 'YMODEM envió {fileName}',
|
||||
'terminal.ymodem.failed': 'Falló el envío con YMODEM',
|
||||
'terminal.ymodem.selectReceiveDirectory': 'Selecciona la carpeta para guardar los archivos recibidos',
|
||||
'terminal.ymodem.receiveStarted': 'YMODEM recibiendo...',
|
||||
'terminal.ymodem.receiveComplete': 'YMODEM recibió {fileName}',
|
||||
'terminal.ymodem.receiveCompleteMultiple': 'YMODEM recibió {count} archivos',
|
||||
'terminal.ymodem.receiveEmpty': 'No se recibieron archivos YMODEM',
|
||||
'terminal.ymodem.receiveFailed': 'Falló la recepción con YMODEM',
|
||||
'terminal.ymodem.unavailable': 'YMODEM no está disponible',
|
||||
'terminal.selection.addToAI': 'Agregar a la conversación',
|
||||
'terminal.selection.addToAIDesc': 'Adjuntar la salida seleccionada de la terminal al borrador de IA',
|
||||
'terminal.auth.password': 'Contraseña',
|
||||
'terminal.auth.sshKey': 'Clave SSH',
|
||||
'terminal.auth.username': 'Nombre de usuario',
|
||||
'terminal.auth.username.placeholder': 'root',
|
||||
'terminal.auth.passwordLabel': 'Contraseña',
|
||||
'terminal.auth.password.placeholder': 'Ingresa la contraseña',
|
||||
'terminal.auth.passphrase': 'Frase de contraseña',
|
||||
'terminal.auth.passphrase.placeholder': 'Frase de contraseña opcional para la clave privada seleccionada',
|
||||
'terminal.auth.certificate': 'Certificado',
|
||||
'terminal.auth.selectKey': 'Seleccionar clave',
|
||||
'terminal.auth.retryMessage': 'Falló la autenticación. Verifica tus credenciales e inténtalo de nuevo.',
|
||||
'terminal.auth.retryLog': 'Falló la autenticación. Inténtalo de nuevo.',
|
||||
'terminal.auth.noKeysHint': 'No hay claves disponibles. Agrega claves en Keychain.',
|
||||
'terminal.auth.continueSave': 'Continuar y guardar',
|
||||
'terminal.auth.credentialsUnavailable': 'Las credenciales guardadas no se pueden descifrar en este dispositivo. Vuelve a ingresarlas y guárdalas de nuevo.',
|
||||
'terminal.auth.jumpCredentialsUnavailable': 'Un host de salto tiene credenciales guardadas que no se pueden descifrar en este dispositivo. Abre la configuración del host y vuelve a ingresarlas.',
|
||||
'terminal.auth.proxyCredentialsUnavailable': 'Las credenciales del proxy no se pueden descifrar en este dispositivo. Abre la configuración del host y vuelve a ingresar la contraseña del proxy.',
|
||||
'terminal.auth.keyUnavailableFallbackPassword': 'La clave SSH guardada no está disponible en este dispositivo. Se usará autenticación por contraseña como respaldo.',
|
||||
'terminal.progress.timeoutIn': 'Tiempo de espera en {seconds}s',
|
||||
'terminal.progress.waitingForUserInput': 'Esperando entrada del usuario',
|
||||
'terminal.progress.disconnected': 'Desconectado',
|
||||
'terminal.progress.cancelling': 'Cancelando...',
|
||||
'terminal.progress.startOver': 'Empezar de nuevo',
|
||||
'terminal.progress.enterReconnectHint': 'Presiona Enter para reconectar',
|
||||
'terminal.progress.autoReconnectScheduled': 'Conexión perdida. Reconectando en {seconds}s (intento {attempt}).',
|
||||
'terminal.progress.autoReconnectAttempt': 'Intento de reconexión automática {attempt}...',
|
||||
'terminal.connection.dismissDisconnectedDialog': 'Descartar aviso de desconexión',
|
||||
'terminal.connection.chainOf': 'Cadena {current} de {total}',
|
||||
'terminal.connection.showLogs': 'Mostrar registros',
|
||||
'terminal.connection.hideLogs': 'Ocultar registros',
|
||||
'terminal.connection.protocol.ssh': 'SSH',
|
||||
'terminal.connection.protocol.telnet': 'Telnet',
|
||||
'terminal.connection.protocol.mosh': 'Mosh',
|
||||
'terminal.connection.protocol.et': 'EternalTerminal',
|
||||
'terminal.connection.protocol.plugin': 'Conexión de plugin',
|
||||
'terminal.et.proxyUnsupported': 'EternalTerminal no admite actualmente la configuración de proxy de Netcatty. Usa SSH o quita el proxy de este host.',
|
||||
'terminal.et.multiJumpUnsupported': 'EternalTerminal admite actualmente como máximo un host de salto en Netcatty.',
|
||||
'terminal.connection.protocol.serial': 'Serial',
|
||||
'terminal.connection.protocol.local': 'Shell local',
|
||||
'terminal.hostKey.unknownTitle': 'Confirmar esta clave de host',
|
||||
'terminal.hostKey.changedTitle': 'La clave del host cambió',
|
||||
'terminal.hostKey.unknownDescription': 'Aún no se puede establecer la autenticidad de {host}.',
|
||||
'terminal.hostKey.changedDescription': 'La clave guardada de {host} ya no coincide con este servidor.',
|
||||
'terminal.hostKey.fingerprintLabel': 'La huella digital de {keyType} es SHA256:',
|
||||
'terminal.hostKey.savedFingerprintLabel': 'Huella guardada',
|
||||
'terminal.hostKey.unknownHint': 'Recuérdala si esta huella pertenece al servidor que esperabas.',
|
||||
'terminal.hostKey.changedHint': 'Continúa solo si esperabas que este host cambiara.',
|
||||
'terminal.hostKey.addAndContinue': 'Agregar y continuar',
|
||||
'terminal.hostKey.updateAndContinue': 'Actualizar y continuar',
|
||||
'terminal.themeModal.title': 'Apariencia de la terminal',
|
||||
'terminal.themeModal.tab.theme': 'Tema',
|
||||
'terminal.themeModal.tab.font': 'Fuente',
|
||||
'terminal.themeModal.tab.custom': 'Personalizado',
|
||||
'terminal.themeModal.globalTheme': 'Tema global',
|
||||
'terminal.themeModal.globalFont': 'Fuente global',
|
||||
'terminal.themeModal.fontSize': 'Tamaño de fuente',
|
||||
'terminal.themeModal.fontWeight': 'Grosor de fuente',
|
||||
'terminal.themeModal.livePreview': 'Vista previa en vivo',
|
||||
'terminal.themeModal.themeType': 'Tema {type}',
|
||||
'terminal.hiddenTheme.title': 'Tema oculto actual',
|
||||
'terminal.hiddenTheme.desc': 'Este tema está oculto de la selección manual y se reemplazará cuando elijas otro tema.',
|
||||
'topTabs.toggleTheme.systemExitTitle': 'El tema del sistema está activo',
|
||||
'topTabs.toggleTheme.systemExitMessage': 'Abre Configuración para elegir un tema fijo de Claro u Oscuro.',
|
||||
'topTabs.toggleTheme.openSettings': 'Abrir Configuración',
|
||||
|
||||
// Custom Themes
|
||||
'terminal.customTheme.section': 'Temas personalizados',
|
||||
'terminal.customTheme.yourThemes': 'Tus temas',
|
||||
'terminal.customTheme.new': 'Nuevo tema',
|
||||
'terminal.customTheme.newDesc': 'Clonar el tema actual y personalizarlo',
|
||||
'terminal.customTheme.newTitle': 'Nuevo tema personalizado',
|
||||
'terminal.customTheme.editTitle': 'Editar tema',
|
||||
'terminal.customTheme.import': 'Importar .itermcolors',
|
||||
'terminal.customTheme.importDesc': 'Importar desde archivo de esquema de color de iTerm2',
|
||||
'terminal.customTheme.importError': 'No se pudo analizar el archivo seleccionado. Asegúrate de que sea un archivo XML .itermcolors válido.',
|
||||
'terminal.customTheme.delete': 'Eliminar tema',
|
||||
'terminal.customTheme.confirmDelete': 'Confirmar eliminación',
|
||||
'terminal.customTheme.name': 'Nombre',
|
||||
'terminal.customTheme.namePlaceholder': 'Mi tema personalizado',
|
||||
'terminal.customTheme.type': 'Tipo',
|
||||
'terminal.customTheme.group.general': 'General',
|
||||
'terminal.customTheme.group.normal': 'Colores normales',
|
||||
'terminal.customTheme.group.bright': 'Colores brillantes',
|
||||
'terminal.customTheme.color.background': 'Fondo',
|
||||
'terminal.customTheme.color.foreground': 'Primer plano',
|
||||
'terminal.customTheme.color.cursor': 'Cursor',
|
||||
'terminal.customTheme.color.selection': 'Selección',
|
||||
'terminal.customTheme.color.black': 'Negro',
|
||||
'terminal.customTheme.color.red': 'Rojo',
|
||||
'terminal.customTheme.color.green': 'Verde',
|
||||
'terminal.customTheme.color.yellow': 'Amarillo',
|
||||
'terminal.customTheme.color.blue': 'Azul',
|
||||
'terminal.customTheme.color.magenta': 'Magenta',
|
||||
'terminal.customTheme.color.cyan': 'Cian',
|
||||
'terminal.customTheme.color.white': 'Blanco',
|
||||
'terminal.customTheme.color.brightBlack': 'Negro brillante',
|
||||
'terminal.customTheme.color.brightRed': 'Rojo brillante',
|
||||
'terminal.customTheme.color.brightGreen': 'Verde brillante',
|
||||
'terminal.customTheme.color.brightYellow': 'Amarillo brillante',
|
||||
'terminal.customTheme.color.brightBlue': 'Azul brillante',
|
||||
'terminal.customTheme.color.brightMagenta': 'Magenta brillante',
|
||||
'terminal.customTheme.color.brightCyan': 'Cian brillante',
|
||||
'terminal.customTheme.color.brightWhite': 'Blanco brillante',
|
||||
|
||||
// Cloud Sync Settings
|
||||
'cloudSync.gate.title': 'Sincronización cifrada de extremo a extremo',
|
||||
'cloudSync.gate.desc':
|
||||
'Tus datos se cifran localmente antes de sincronizarse. Los proveedores de la nube nunca ven tus datos en texto plano. Configura una clave maestra para habilitar la sincronización segura.',
|
||||
'cloudSync.gate.masterKey': 'Clave maestra',
|
||||
'cloudSync.gate.confirmMasterKey': 'Confirmar clave maestra',
|
||||
'cloudSync.gate.placeholder': 'Ingresa una contraseña segura',
|
||||
'cloudSync.gate.confirmPlaceholder': 'Confirma tu contraseña',
|
||||
'cloudSync.gate.mismatch': 'Las contraseñas no coinciden',
|
||||
'cloudSync.gate.warning':
|
||||
'Entiendo que, si olvido mi clave maestra, mis datos no se podrán recuperar. No hay restablecimiento de contraseña.',
|
||||
'cloudSync.gate.enableVault': 'Habilitar bóveda cifrada',
|
||||
'cloudSync.gate.enabledToast': 'Bóveda cifrada habilitada',
|
||||
'cloudSync.gate.setupFailed': 'No se pudo configurar la clave maestra',
|
||||
'cloudSync.passwordStrength.tooShort': 'Demasiado corta',
|
||||
'cloudSync.passwordStrength.weak': 'Débil',
|
||||
'cloudSync.passwordStrength.moderate': 'Moderada',
|
||||
'cloudSync.passwordStrength.strong': 'Segura',
|
||||
'cloudSync.passwordStrength.veryStrong': 'Muy segura',
|
||||
'cloudSync.provider.notConnected': 'No conectado',
|
||||
'cloudSync.provider.sync': 'Sincronizar',
|
||||
'cloudSync.provider.connect': 'Conectar',
|
||||
'cloudSync.provider.connecting': 'Conectando...',
|
||||
'cloudSync.provider.webdav': 'WebDAV',
|
||||
'cloudSync.provider.webdav.desc': 'Conectar a un endpoint WebDAV autoalojado',
|
||||
'cloudSync.provider.s3': 'Compatible con S3',
|
||||
'cloudSync.provider.s3.desc': 'Conectar a almacenamiento de objetos compatible con S3',
|
||||
'cloudSync.provider.comingSoon': 'Próximamente',
|
||||
'cloudSync.webdav.title': 'Configuración de WebDAV',
|
||||
'cloudSync.webdav.desc': 'Configura un endpoint WebDAV para la sincronización cifrada.',
|
||||
'cloudSync.webdav.endpoint': 'URL del endpoint',
|
||||
'cloudSync.webdav.authType': 'Tipo de autenticación',
|
||||
'cloudSync.webdav.auth.basic': 'Básica',
|
||||
'cloudSync.webdav.auth.digest': 'Digest',
|
||||
'cloudSync.webdav.auth.token': 'Token',
|
||||
'cloudSync.webdav.username': 'Nombre de usuario',
|
||||
'cloudSync.webdav.password': 'Contraseña',
|
||||
'cloudSync.webdav.token': 'Token',
|
||||
'cloudSync.webdav.showSecret': 'Mostrar secreto',
|
||||
'cloudSync.webdav.allowInsecure': 'Permitir conexión insegura (ignorar errores de certificado)',
|
||||
'cloudSync.webdav.validation.endpoint': 'Ingresa un endpoint WebDAV válido.',
|
||||
'cloudSync.webdav.validation.credentials': 'El nombre de usuario y la contraseña son obligatorios.',
|
||||
'cloudSync.webdav.validation.token': 'El token es obligatorio.',
|
||||
'cloudSync.s3.title': 'Configuración de S3',
|
||||
'cloudSync.s3.desc': 'Conéctate al almacenamiento de objetos compatible con S3 para la sincronización cifrada.',
|
||||
'cloudSync.s3.endpoint': 'URL del endpoint',
|
||||
'cloudSync.s3.region': 'Región',
|
||||
'cloudSync.s3.bucket': 'Bucket',
|
||||
'cloudSync.s3.accessKeyId': 'ID de clave de acceso',
|
||||
'cloudSync.s3.secretAccessKey': 'Clave de acceso secreta',
|
||||
'cloudSync.s3.sessionToken': 'Token de sesión (opcional)',
|
||||
'cloudSync.s3.prefix': 'Prefijo de clave (opcional)',
|
||||
'cloudSync.s3.forcePathStyle': 'Forzar URLs con estilo de ruta (para MinIO/R2, etc.)',
|
||||
'cloudSync.s3.allowInsecure': 'Permitir conexión insegura (ignorar errores de certificado)',
|
||||
'cloudSync.s3.showSecret': 'Mostrar secretos',
|
||||
'cloudSync.s3.validation.required': 'Endpoint, región, bucket, clave de acceso y secreto son obligatorios.',
|
||||
'cloudSync.smb.title': 'Configuración de SMB',
|
||||
'cloudSync.smb.desc': 'Conéctate a un recurso compartido de archivos SMB/CIFS para la sincronización cifrada.',
|
||||
'cloudSync.smb.share': 'Ruta del recurso compartido',
|
||||
'cloudSync.smb.username': 'Nombre de usuario',
|
||||
'cloudSync.smb.password': 'Contraseña',
|
||||
'cloudSync.smb.domain': 'Dominio (opcional)',
|
||||
'cloudSync.smb.domainPlaceholder': 'p. ej., WORKGROUP',
|
||||
'cloudSync.smb.port': 'Puerto (opcional)',
|
||||
'cloudSync.smb.showSecret': 'Mostrar contraseña',
|
||||
'cloudSync.smb.validation.share': 'La ruta del recurso compartido es obligatoria.',
|
||||
'cloudSync.smb.validation.port': 'El puerto debe ser un número entre 1 y 65535.',
|
||||
'cloudSync.connect.smb.success': 'SMB se conectó correctamente',
|
||||
'cloudSync.connect.smb.failedTitle': 'Falló la conexión a SMB',
|
||||
'cloudSync.provider.smb': 'Recurso compartido SMB',
|
||||
'cloudSync.connect.webdav.success': 'WebDAV se conectó correctamente',
|
||||
'cloudSync.connect.webdav.failedTitle': 'Falló la conexión a WebDAV',
|
||||
'cloudSync.connect.s3.success': 'S3 se conectó correctamente',
|
||||
'cloudSync.connect.s3.failedTitle': 'Falló la conexión a S3',
|
||||
'cloudSync.connect.plugin.success': 'El proveedor de sincronización de plugin se conectó correctamente',
|
||||
'cloudSync.connect.plugin.failedTitle': 'Falló la conexión del plugin de sincronización',
|
||||
'cloudSync.pluginConfig.title': 'Configurar {name}',
|
||||
'cloudSync.pluginConfig.desc': 'Ingresa la configuración JSON requerida por este proveedor de sincronización de plugin.',
|
||||
'cloudSync.pluginConfig.label': 'Configuración del proveedor (JSON)',
|
||||
'cloudSync.pluginConfig.invalidJson': 'La configuración debe ser JSON válido.',
|
||||
'cloudSync.pluginConfig.schemaInvalid': 'La configuración no coincide con el esquema del proveedor.',
|
||||
'cloudSync.lastSync.never': 'Nunca',
|
||||
'cloudSync.lastSync.justNow': 'Justo ahora',
|
||||
'cloudSync.lastSync.minutesAgo': 'Hace {minutes} min',
|
||||
'cloudSync.changeKey': 'Cambiar clave',
|
||||
'cloudSync.providers.title': 'Proveedores de nube',
|
||||
'cloudSync.syncAll': 'Sincronizar todos los proveedores conectados',
|
||||
'cloudSync.autoSync.title': 'Sincronización automática',
|
||||
'cloudSync.autoSync.desc': 'Sincronizar automáticamente cuando se realicen cambios',
|
||||
'cloudSync.strategy.title': 'Estrategia de sincronización',
|
||||
'cloudSync.strategy.desc': 'Elige qué sucede cuando cambian tanto los datos locales como los de la nube.',
|
||||
'cloudSync.strategy.smartMerge': 'Fusión inteligente (recomendada)',
|
||||
'cloudSync.strategy.smartMergeDesc': 'Combina los cambios de ambos lados cuando sea posible; si Netcatty no puede decidir con seguridad, te pedirá que elijas.',
|
||||
'cloudSync.strategy.preferCloud': 'Gana la nube',
|
||||
'cloudSync.strategy.preferCloudDesc': 'Cuando ambos lados cambiaron, descarga la versión de la nube y reemplaza los cambios locales.',
|
||||
'cloudSync.strategy.preferLocal': 'Gana lo local',
|
||||
'cloudSync.strategy.preferLocalDesc': 'Cuando ambos lados cambiaron, sube la versión local y reemplaza los cambios de la nube.',
|
||||
'cloudSync.convergent.title': 'Sincronización convergente de múltiples dispositivos',
|
||||
'cloudSync.convergent.experimental': 'Experimental',
|
||||
'cloudSync.convergent.desc': 'Usa una réplica CRDT cifrada para preservar ediciones sin conexión, eliminaciones concurrentes y cambios de cada proveedor conectado.',
|
||||
'cloudSync.convergent.active': 'CRDT v2 está activo. Las escrituras del proveedor se verifican después de la subida.',
|
||||
'cloudSync.convergent.paused': 'CRDT v2 está en pausa en este dispositivo; los metadatos de la nube se conservan.',
|
||||
'cloudSync.convergent.enabled': 'Sincronización convergente habilitada',
|
||||
'cloudSync.convergent.preview.title': 'Vista previa de migración',
|
||||
'cloudSync.convergent.preview.entities': 'Entidades',
|
||||
'cloudSync.convergent.preview.providers': 'Proveedores',
|
||||
'cloudSync.convergent.preview.conflicts': 'Conflictos',
|
||||
'cloudSync.convergent.preview.compatibility': 'Una instantánea v1 completa permanece en cada payload cifrado para clientes más antiguos.',
|
||||
'cloudSync.convergent.preview.confirm': 'Crear réplica CRDT',
|
||||
'cloudSync.convergent.preview.status.ready': 'Listo',
|
||||
'cloudSync.convergent.preview.status.empty': 'Vacío',
|
||||
'cloudSync.convergent.preview.status.unavailable': 'No disponible',
|
||||
'cloudSync.convergent.preview.status.blocked': 'Bloqueado',
|
||||
'cloudSync.convergent.preview.schema': 'esquema',
|
||||
'cloudSync.convergent.field.presence': 'presencia',
|
||||
'cloudSync.convergent.field.position': 'posición',
|
||||
'cloudSync.convergent.conflicts.title': 'Conflictos de campo ({count})',
|
||||
'cloudSync.convergent.conflict.empty': 'Vacío / eliminado',
|
||||
'cloudSync.convergent.conflict.secretSet': 'El secreto está establecido',
|
||||
'cloudSync.convergent.conflict.current': 'ganador actual',
|
||||
'cloudSync.convergent.conflict.choose': 'Elegir',
|
||||
'cloudSync.convergent.conflict.resolved': 'Conflicto resuelto y sincronizado',
|
||||
'cloudSync.convergent.downgrade.desc': 'Reemplaza los archivos v2 de cada proveedor conectado con una instantánea heredada.',
|
||||
'cloudSync.convergent.downgrade.button': 'Degradar',
|
||||
'cloudSync.convergent.downgrade.confirm': '¿Degradar cada proveedor conectado a la sincronización heredada? Esto elimina los metadatos CRDT después de la verificación de escritura.',
|
||||
'cloudSync.convergent.downgrade.done': 'Sincronización convergente degradada',
|
||||
'cloudSync.status.title': 'Estado de sincronización',
|
||||
'cloudSync.status.localVersion': 'Versión local',
|
||||
'cloudSync.status.remoteVersion': 'Versión remota',
|
||||
'cloudSync.history.title': 'Historial de sincronización',
|
||||
'cloudSync.history.upload': 'Subida',
|
||||
'cloudSync.history.download': 'Descarga',
|
||||
'cloudSync.history.resolved': 'Resuelto',
|
||||
'cloudSync.history.error': 'Error',
|
||||
'cloudSync.localBackups.title': 'Historial de copias de seguridad locales',
|
||||
'cloudSync.localBackups.desc': 'Netcatty conserva puntos de restauración locales antes de los cambios de versión de la app y antes de las restauraciones de la bóveda.',
|
||||
'cloudSync.localBackups.retentionTitle': 'Retención de copias de seguridad',
|
||||
'cloudSync.localBackups.retentionDesc': 'Elige cuántas copias de seguridad locales debe conservar Netcatty.',
|
||||
'cloudSync.localBackups.maxCount': 'Copias máximas',
|
||||
'cloudSync.localBackups.maxSaved': 'Retención de copia guardada: {count}',
|
||||
'cloudSync.localBackups.maxInvalid': 'Ingresa un número entre 1 y 100.',
|
||||
'cloudSync.localBackups.empty': 'Aún no hay copias de seguridad locales.',
|
||||
'cloudSync.localBackups.reason.appVersionChange': 'Antes del cambio de versión de la app',
|
||||
'cloudSync.localBackups.reason.beforeRestore': 'Antes de la restauración',
|
||||
'cloudSync.localBackups.versionChange': '{from} -> {to}',
|
||||
'cloudSync.localBackups.counts': '{hosts} hosts, {keys} claves, {snippets} snippets, {notes} notas',
|
||||
'cloudSync.localBackups.restore': 'Restaurar',
|
||||
'cloudSync.localBackups.restoreSuccess': 'Copia de seguridad local restaurada.',
|
||||
'cloudSync.localBackups.restoreFailedTitle': 'Falló la restauración',
|
||||
'cloudSync.localBackups.restoreMissing': 'No se encontró la copia de seguridad.',
|
||||
'cloudSync.localBackups.protectiveBackupFailed': 'No se pudo crear la copia de seguridad de protección, por lo que la restauración se canceló para proteger tus datos actuales. Resuelve el problema subyacente (p. ej., acceso al keychain) e inténtalo de nuevo. Detalles: {message}',
|
||||
'cloudSync.localBackups.restoreConfirmTitle': '¿Restaurar esta copia de seguridad?',
|
||||
'cloudSync.localBackups.restoreConfirmDesc': 'Tus hosts, claves, snippets y configuraciones actuales se reemplazarán con el contenido de esta copia de seguridad. Se crea automáticamente una instantánea de protección de tus datos actuales primero.',
|
||||
'cloudSync.localBackups.restoreConfirmButton': 'Restaurar',
|
||||
'cloudSync.localBackups.restoreConfirmCancel': 'Cancelar',
|
||||
'cloudSync.localBackups.unavailableTitle': 'Copias de seguridad locales no disponibles',
|
||||
'cloudSync.localBackups.unavailableDesc': 'Esta plataforma no expone un keychain seguro a Netcatty, por lo que las copias de seguridad locales no se pueden escribir de forma segura. Instala Netcatty en un sistema con un keychain compatible para habilitar el historial de copias de seguridad locales.',
|
||||
'cloudSync.localBackups.lockedTitle': 'Se requiere clave maestra',
|
||||
'cloudSync.localBackups.lockedDesc': 'Configura o desbloquea tu clave maestra antes de restaurar una copia de seguridad, para que las credenciales restauradas permanezcan cifradas.',
|
||||
'cloudSync.revisionHistory.viewButton': 'Historial',
|
||||
'cloudSync.revisionHistory.title': 'Historial de versiones de la bóveda',
|
||||
'cloudSync.revisionHistory.description': 'Explora y restaura versiones anteriores de tu bóveda desde el historial de revisiones de Gist.',
|
||||
'cloudSync.revisionHistory.empty': 'No se encontraron revisiones.',
|
||||
'cloudSync.revisionHistory.current': 'Actual',
|
||||
'cloudSync.revisionHistory.revision': 'Revisión',
|
||||
'cloudSync.revisionHistory.revisionPreview': 'Contenido de la revisión',
|
||||
'cloudSync.revisionHistory.device': 'Dispositivo',
|
||||
'cloudSync.revisionHistory.hosts': 'Hosts',
|
||||
'cloudSync.revisionHistory.keys': 'Claves',
|
||||
'cloudSync.revisionHistory.snippets': 'Snippets',
|
||||
'cloudSync.revisionHistory.notes': 'Notas',
|
||||
'cloudSync.revisionHistory.identities': 'Identidades',
|
||||
'cloudSync.revisionHistory.restoreButton': 'Restaurar esta versión',
|
||||
'cloudSync.revisionHistory.restored': 'Bóveda restaurada desde la revisión seleccionada.',
|
||||
'cloudSync.revisionHistory.revisionNotFound': 'Revisión no encontrada o no contiene datos de la bóveda.',
|
||||
'cloudSync.revisionHistory.decryptFailed': 'No se puede descifrar esta revisión. Puede que se haya cifrado con una contraseña maestra diferente.',
|
||||
'cloudSync.changeKey.title': 'Cambiar clave maestra',
|
||||
'cloudSync.changeKey.current': 'Clave maestra actual',
|
||||
'cloudSync.changeKey.new': 'Nueva clave maestra',
|
||||
'cloudSync.changeKey.confirmNew': 'Confirmar nueva clave maestra',
|
||||
'cloudSync.changeKey.currentPlaceholder': 'Ingresa la clave maestra actual',
|
||||
'cloudSync.changeKey.newPlaceholder': 'Ingresa la nueva clave maestra',
|
||||
'cloudSync.changeKey.confirmPlaceholder': 'Confirma la nueva clave maestra',
|
||||
'cloudSync.changeKey.fillAll': 'Completa todos los campos',
|
||||
'cloudSync.changeKey.minLength': 'La nueva clave maestra debe tener al menos 8 caracteres',
|
||||
'cloudSync.changeKey.notMatch': 'Las nuevas claves maestras no coinciden',
|
||||
'cloudSync.changeKey.incorrectCurrent': 'Clave maestra actual incorrecta',
|
||||
'cloudSync.changeKey.failed': 'No se pudo cambiar la clave maestra',
|
||||
'cloudSync.changeKey.desc': 'Esto volverá a cifrar tu bóveda. Asegúrate de recordar la nueva clave.',
|
||||
'cloudSync.changeKey.showKeys': 'Mostrar claves',
|
||||
'cloudSync.changeKey.updatedToast': 'Clave maestra actualizada',
|
||||
'cloudSync.changeKey.updateButton': 'Actualizar clave',
|
||||
'cloudSync.unlock.title': 'Ingresa la clave maestra',
|
||||
'cloudSync.unlock.masterKey': 'Clave maestra',
|
||||
'cloudSync.unlock.desc':
|
||||
'Ingresa tu clave maestra una vez para habilitar la sincronización cifrada. Se almacenará de forma segura usando el keychain de tu sistema operativo.',
|
||||
'cloudSync.unlock.placeholder': 'Ingresa tu clave maestra',
|
||||
'cloudSync.unlock.empty': 'Ingresa tu clave maestra',
|
||||
'cloudSync.unlock.incorrect': 'Clave maestra incorrecta',
|
||||
'cloudSync.unlock.failed': 'No se pudo desbloquear la bóveda',
|
||||
'cloudSync.unlock.showKey': 'Mostrar clave',
|
||||
'cloudSync.unlock.notNow': 'Ahora no',
|
||||
'cloudSync.unlock.readyToast': 'Bóveda lista',
|
||||
'cloudSync.unlock.unlockButton': 'Desbloquear',
|
||||
'cloudSync.header.vaultReady': 'Bóveda lista',
|
||||
'cloudSync.header.preparingVault': 'Preparando bóveda...',
|
||||
'cloudSync.header.providersConnected': '{count} proveedor(es) conectado(s)',
|
||||
'cloudSync.githubFlow.title': 'Conectar con GitHub',
|
||||
'cloudSync.githubFlow.desc': 'Copia el código de abajo e ingrésalo en GitHub para autorizar a Netcatty.',
|
||||
'cloudSync.githubFlow.copyCode': 'Copiar código',
|
||||
'cloudSync.githubFlow.copied': '¡Copiado!',
|
||||
'cloudSync.githubFlow.openGitHub': 'Abrir GitHub',
|
||||
'cloudSync.githubFlow.waiting': 'Esperando autorización...',
|
||||
'cloudSync.conflict.title': 'Se detectó un conflicto de versiones',
|
||||
'cloudSync.conflict.desc': 'Elige qué versión conservar',
|
||||
'cloudSync.conflict.local': 'LOCAL',
|
||||
'cloudSync.conflict.cloud': 'NUBE',
|
||||
'cloudSync.conflict.detailsTitle': 'Datos cambiados',
|
||||
'cloudSync.conflict.detailsCounts': 'Local {local} · Nube {cloud} · Conflictos {conflicts}',
|
||||
'cloudSync.conflict.entity.hosts': 'Hosts',
|
||||
'cloudSync.conflict.entity.keys': 'Claves',
|
||||
'cloudSync.conflict.entity.identities': 'Identidades',
|
||||
'cloudSync.conflict.entity.proxyProfiles': 'Perfiles de proxy',
|
||||
'cloudSync.conflict.entity.snippets': 'Snippets',
|
||||
'cloudSync.conflict.entity.notes': 'Notas',
|
||||
'cloudSync.conflict.entity.noteGroups': 'Grupos de notas',
|
||||
'cloudSync.conflict.entity.customGroups': 'Grupos',
|
||||
'cloudSync.conflict.entity.snippetPackages': 'Paquetes de snippets',
|
||||
'cloudSync.conflict.entity.portForwardingRules': 'Reenvío de puertos',
|
||||
'cloudSync.conflict.entity.groupConfigs': 'Configuración de grupos',
|
||||
'cloudSync.conflict.entity.settings': 'Configuración',
|
||||
'cloudSync.conflict.keepLocal': 'Sobrescribir la nube (conservar local)',
|
||||
'cloudSync.conflict.useCloud': 'Descargar la nube (sobrescribir local)',
|
||||
'cloudSync.connect.browserContinue': 'Completar la autorización en el navegador',
|
||||
'cloudSync.connect.browserCancelled': 'La autorización anterior del navegador fue cancelada',
|
||||
'cloudSync.connect.github.success': 'GitHub se conectó correctamente',
|
||||
'cloudSync.connect.github.failedTitle': 'Falló la conexión a GitHub',
|
||||
'cloudSync.connect.github.timeout': 'Se agotó el tiempo de espera de la conexión a GitHub. Verifica tu red o la configuración del proxy.',
|
||||
'cloudSync.connect.github.networkError': 'No se puede acceder a GitHub. Verifica tu red o la configuración del proxy.',
|
||||
'cloudSync.connect.google.failedTitle': 'Falló la conexión a Google',
|
||||
'cloudSync.connect.onedrive.failedTitle': 'Falló la conexión a OneDrive',
|
||||
'cloudSync.sync.success': 'Sincronizado con {provider}',
|
||||
'cloudSync.sync.failed': 'Falló la sincronización',
|
||||
'cloudSync.sync.failedTitle': 'Falló la sincronización',
|
||||
'cloudSync.sync.errorTitle': 'Error de sincronización',
|
||||
'cloudSync.resolve.downloaded': 'Datos de la nube descargados',
|
||||
'cloudSync.resolve.uploaded': 'Datos locales subidos',
|
||||
'cloudSync.resolve.failedTitle': 'Falló la resolución del conflicto',
|
||||
'cloudSync.clearLocal.title': 'Borrar datos locales',
|
||||
'cloudSync.clearLocal.desc': 'Restablece la versión local y el historial de sincronización. La próxima sincronización descargará desde la nube.',
|
||||
'cloudSync.clearLocal.button': 'Borrar',
|
||||
'cloudSync.clearLocal.dialog.title': '¿Borrar los datos locales de la bóveda?',
|
||||
'cloudSync.clearLocal.dialog.desc': 'Esto restablecerá la versión local a 0 y borrará el historial de sincronización. Tu próxima sincronización descargará los datos de la nube, reemplazando los datos locales.',
|
||||
'cloudSync.clearLocal.dialog.cancel': 'Cancelar',
|
||||
'cloudSync.clearLocal.dialog.confirm': 'Borrar datos locales',
|
||||
'cloudSync.clearLocal.toast.title': 'Datos locales borrados',
|
||||
'cloudSync.clearLocal.toast.desc': 'Versión local restablecida a 0. Sincroniza para descargar desde la nube.',
|
||||
|
||||
// Keychain
|
||||
'keychain.filter.key': 'CLAVE',
|
||||
'keychain.filter.certificate': 'CERTIFICADO',
|
||||
'keychain.action.generateKey': 'Generar clave',
|
||||
'keychain.action.importKey': 'Importar clave',
|
||||
'keychain.action.newIdentity': 'Nueva identidad',
|
||||
'keychain.action.importCertificate': 'Importar certificado',
|
||||
'keychain.view.grid': 'Cuadrícula',
|
||||
'keychain.view.list': 'Lista',
|
||||
'keychain.section.keys': 'Claves',
|
||||
'keychain.section.identities': 'Identidades',
|
||||
'keychain.count.items': '{count} elementos',
|
||||
'keychain.empty.title': 'Configura tus claves',
|
||||
'keychain.empty.desc': 'Importa o genera claves SSH para una autenticación segura.',
|
||||
'keychain.panel.generateKey': 'Generar clave',
|
||||
'keychain.panel.newKey': 'Nueva clave',
|
||||
'keychain.panel.keyDetails': 'Detalles de la clave',
|
||||
'keychain.panel.editKey': 'Editar clave',
|
||||
'keychain.panel.editIdentity': 'Editar identidad',
|
||||
'keychain.panel.newIdentity': 'Nueva identidad',
|
||||
'keychain.panel.keyExport': 'Exportación de clave',
|
||||
'keychain.validation.labelRequired': 'Ingresa una etiqueta para la clave',
|
||||
'keychain.validation.labelAndPrivateKeyRequired': 'La etiqueta y la clave privada son obligatorias',
|
||||
'keychain.validation.labelAndUsernameRequired': 'La etiqueta y el nombre de usuario son obligatorios',
|
||||
'keychain.error.generationUnavailable':
|
||||
'La generación de claves no está disponible: asegúrate de que la app se esté ejecutando en Electron',
|
||||
'keychain.error.generateKeyPairFailed': 'No se pudo generar el par de claves',
|
||||
'keychain.error.generateKeyFailed': 'No se pudo generar la clave',
|
||||
'keychain.error.keyGenerationTitle': 'Generación de claves',
|
||||
'keychain.export.exportTo': 'Exportar a *',
|
||||
'keychain.export.selectHost': 'Seleccionar host',
|
||||
'keychain.export.location': 'Ubicación ~ $1 *',
|
||||
'keychain.export.filename': 'Nombre de archivo ~ $2 *',
|
||||
'keychain.export.note':
|
||||
'La exportación de claves actualmente solo admite sistemas {unix}. Usa la sección {advanced} para personalizar el script de exportación.',
|
||||
'keychain.export.script': 'Script *',
|
||||
'keychain.export.scriptPlaceholder': 'Script de exportación...',
|
||||
'keychain.export.missingCredentials':
|
||||
'El host no tiene contraseña ni clave guardadas. Primero agrega credenciales de contraseña al host.',
|
||||
'keychain.export.successTitle': 'Exportación exitosa',
|
||||
'keychain.export.successMessage': 'Clave pública exportada y adjuntada a {host}',
|
||||
'keychain.export.failedTitle': 'Falló la exportación',
|
||||
'keychain.export.failedMessage': 'No se pudo exportar la clave: {error}',
|
||||
'keychain.export.failedPrefix': 'Falló la exportación: {error}',
|
||||
'keychain.export.exitCode': 'El comando terminó con el código {code}',
|
||||
'keychain.export.exporting': 'Exportando...',
|
||||
'keychain.export.exportAndAttach': 'Exportar y adjuntar',
|
||||
'keychain.export.title': 'Exportación de clave',
|
||||
'keychain.export.exportToRequired': 'Exportar a *',
|
||||
'keychain.export.selectHostPlaceholder': 'Selecciona un host...',
|
||||
'keychain.export.locationLabel': 'Ubicación ~ $1 *',
|
||||
'keychain.export.filenameLabel': 'Nombre de archivo ~ $2 *',
|
||||
'keychain.export.advanced': 'Avanzado',
|
||||
'keychain.export.note.supportsOnly': 'La exportación de claves actualmente solo admite',
|
||||
'keychain.export.note.systems': 'sistemas.',
|
||||
'keychain.export.note.use': 'Usa la',
|
||||
'keychain.export.note.customize': 'sección para personalizar el script de exportación.',
|
||||
'keychain.export.scriptRequired': 'Script *',
|
||||
'keychain.export.exportToHost': 'Exportar al host',
|
||||
'keychain.export.failedGeneric': 'Falló la exportación: {message}',
|
||||
'keychain.field.label': 'Etiqueta',
|
||||
'keychain.field.labelRequired': 'Etiqueta *',
|
||||
'keychain.field.labelPlaceholder': 'Etiqueta de la clave',
|
||||
'keychain.field.privateKeyRequired': 'Clave privada *',
|
||||
'keychain.field.publicKey': 'Clave pública',
|
||||
'keychain.field.certificatePlaceholder': 'Contenido del certificado (opcional)',
|
||||
'keychain.generate.keyType': 'Tipo de clave',
|
||||
'keychain.generate.keySize': 'Tamaño de clave',
|
||||
'keychain.generate.labelPlaceholder': 'Etiqueta de la clave',
|
||||
'keychain.generate.passphrasePlaceholder': 'Frase de contraseña (opcional)',
|
||||
'keychain.generate.savePassphrase': 'Guardar frase de contraseña',
|
||||
'keychain.generate.generate': 'Generar',
|
||||
'keychain.generate.generateSave': 'Generar y guardar',
|
||||
'keychain.import.dropHint': 'Suelta un archivo de clave aquí',
|
||||
'keychain.import.importFromFile': 'Importar desde archivo',
|
||||
'keychain.import.saveKey': 'Guardar clave',
|
||||
'keychain.import.importedKeyLabel': 'Clave importada',
|
||||
'keychain.identity.usernameRequired': 'Nombre de usuario *',
|
||||
'keychain.identity.method.passwordOnly': 'Contraseña',
|
||||
'keychain.identity.summary.password': 'Contraseña de autenticación',
|
||||
'keychain.identity.summary.key': 'Clave de autenticación',
|
||||
'keychain.identity.summary.certificate': 'Certificado de autenticación',
|
||||
'keychain.identity.summary.passwordAndKey': 'Contraseña y clave de autenticación',
|
||||
'keychain.identity.summary.passwordAndCertificate': 'Contraseña y certificado de autenticación',
|
||||
'keychain.identity.summary.none': 'Sin credenciales',
|
||||
'keychain.identity.selectCredential': 'Seleccionar {kind}',
|
||||
'keychain.identity.save': 'Guardar',
|
||||
'keychain.identity.update': 'Actualizar',
|
||||
'keychain.keyDialog.newTitle': 'Nueva clave',
|
||||
'keychain.keyDialog.newDesc': 'Agregar una nueva clave SSH',
|
||||
'keychain.keyDialog.editTitle': 'Editar clave',
|
||||
'keychain.keyDialog.editDesc': 'Actualizar esta clave SSH',
|
||||
'keychain.keyDialog.updateKey': 'Actualizar clave',
|
||||
|
||||
// Tabs
|
||||
'tabs.closeSessionAria': 'Cerrar sesión',
|
||||
'tabs.closeLogViewAria': 'Cerrar vista de registro',
|
||||
'tabs.closePluginViewAria': 'Cerrar {title}',
|
||||
'tabs.logPrefix': 'Registro:',
|
||||
'tabs.logLocal': 'Local',
|
||||
'tabs.copyTab': 'Copiar pestaña',
|
||||
'tabs.copyTabToNewWindow': 'Copiar pestaña a una nueva ventana',
|
||||
'tabs.copyTabToNewWindowFailed': 'No se pudo abrir la pestaña en una nueva ventana',
|
||||
'tabs.closeOthers': 'Cerrar las demás',
|
||||
'tabs.closeToRight': 'Cerrar pestañas a la derecha',
|
||||
'tabs.closeAll': 'Cerrar todas',
|
||||
'keychain.edit.labelRequired': 'Etiqueta *',
|
||||
'keychain.edit.keyLabelPlaceholder': 'Etiqueta de la clave',
|
||||
'keychain.edit.privateKeyRequired': 'Clave privada *',
|
||||
'keychain.edit.publicKey': 'Clave pública',
|
||||
'keychain.edit.certificate': 'Certificado',
|
||||
'keychain.edit.certificatePlaceholder': 'Contenido del certificado (opcional)',
|
||||
'keychain.edit.filePath': 'Ruta del archivo',
|
||||
'keychain.edit.keyExport': 'Exportación de clave',
|
||||
'keychain.edit.exportToHost': 'Exportar al host',
|
||||
|
||||
// Snippets
|
||||
'snippets.searchPlaceholder': 'Buscar scripts...',
|
||||
'snippets.action.newSnippet': 'Nuevo snippet',
|
||||
'snippets.action.newPackage': 'Nuevo paquete de scripts',
|
||||
'snippets.action.import': 'Importar',
|
||||
'snippets.action.selectSnippets': 'Seleccionar snippets',
|
||||
'snippets.panel.newTitle': 'Nuevo snippet',
|
||||
'snippets.panel.editTitle': 'Editar snippet',
|
||||
'snippets.panel.newAutomationTitle': 'Nuevo script de automatización',
|
||||
'snippets.panel.editAutomationTitle': 'Editar script de automatización',
|
||||
'snippets.panel.resizeWidth': 'Cambiar el ancho del panel',
|
||||
'snippets.field.description': 'Descripción de la acción',
|
||||
'snippets.field.descriptionPlaceholder': 'Ejemplo: verificar la carga de la red',
|
||||
'snippets.field.package': 'Agregar un paquete de scripts',
|
||||
'snippets.field.packagePlaceholder': 'Selecciona o crea un paquete de scripts',
|
||||
'snippets.field.createPackage': 'Crear paquete de scripts',
|
||||
'snippets.field.scriptRequired': 'Script *',
|
||||
'snippets.scriptEditor.expand': 'Abrir en diálogo',
|
||||
'snippets.scriptEditor.resize': 'Cambiar la altura del editor',
|
||||
'snippets.scriptEditor.modalTitle': 'Editar script',
|
||||
'snippets.targets.title': 'Destinos',
|
||||
'snippets.targets.add': 'Agregar destinos',
|
||||
'snippets.targets.selectHosts': 'Hosts',
|
||||
'snippets.targets.selectGroups': 'Grupos',
|
||||
'snippets.targets.noGroups': 'No se encontraron grupos',
|
||||
'snippets.targets.allHosts': 'Aplicar a todos los hosts',
|
||||
'snippets.targets.allHostsShort': 'Todos los hosts',
|
||||
'snippets.targets.allHostsActive': 'Se aplica a cada host conectable.',
|
||||
'snippets.history.title': 'Historial de Shell',
|
||||
'snippets.history.subtitle': '{count} comandos',
|
||||
'snippets.history.emptyTitle': 'Aún no hay historial de Shell',
|
||||
'snippets.history.emptyDesc': 'Los comandos que ejecutes aparecerán aquí',
|
||||
'snippets.history.loadMore': 'Cargar más',
|
||||
'snippets.history.separator': '•',
|
||||
'snippets.history.labelPlaceholder': 'Establece una etiqueta para este snippet',
|
||||
'snippets.history.saveAsSnippet': 'Guardar como snippet',
|
||||
'snippets.history.time.justNow': 'justo ahora',
|
||||
'snippets.history.time.minutesAgo': 'hace {count}m',
|
||||
'snippets.history.time.hoursAgo': 'hace {count}h',
|
||||
'snippets.history.time.daysAgo': 'hace {count}d',
|
||||
'snippets.breadcrumb.allPackages': 'Todos los paquetes de scripts',
|
||||
'snippets.breadcrumb.separator': '›',
|
||||
'snippets.empty.title': 'Crea scripts',
|
||||
'snippets.empty.desc': 'Guarda comandos comunes como snippets de código, o escribe scripts de automatización para operaciones repetibles.',
|
||||
'snippets.search.noResults.title': 'Sin coincidencias',
|
||||
'snippets.search.noResults.desc': 'Ningún script o paquete de scripts coincide con "{query}". Prueba con otro término de búsqueda o limpia la búsqueda para explorar.',
|
||||
'snippets.section.packages': 'Paquetes de scripts',
|
||||
'snippets.section.snippets': 'Scripts',
|
||||
'snippets.kind.codeSnippet': 'Snippet de código',
|
||||
'snippets.kind.automationScript': 'Script de automatización',
|
||||
'snippets.package.count': '{count} script(s)',
|
||||
'snippets.commandFallback': 'Comando',
|
||||
'snippets.view.grid': 'Cuadrícula',
|
||||
'snippets.view.list': 'Lista',
|
||||
'snippets.selection.selected': '{count} seleccionados',
|
||||
'snippets.selection.selectVisible': 'Seleccionar visibles',
|
||||
'snippets.selection.deselectAll': 'Deseleccionar todo',
|
||||
'snippets.selection.exportSelected': 'Exportar seleccionados ({count})',
|
||||
'snippets.selection.deleteSelected': 'Eliminar ({count})',
|
||||
'snippets.selection.deleteConfirmTitle': '¿Eliminar los elementos seleccionados ({count})?',
|
||||
'snippets.selection.deleteConfirmDesc': 'Los elementos seleccionados se eliminarán de forma permanente. Esta acción no se puede deshacer.',
|
||||
'snippets.selection.deleteSuccess': 'Elementos seleccionados eliminados: {count}.',
|
||||
'snippets.export.snippet': 'Exportar snippet',
|
||||
'snippets.export.package': 'Exportar paquete de scripts',
|
||||
'snippets.export.toast.empty': 'No hay snippets para exportar.',
|
||||
'snippets.export.toast.successTitle': 'Exportación lista',
|
||||
'snippets.export.toast.success': 'Se exportaron {count} snippet(s).',
|
||||
'snippets.import.toast.empty': 'No se encontraron snippets importables.',
|
||||
'snippets.import.toast.failedTitle': 'Falló la importación',
|
||||
'snippets.import.toast.invalidDesc': 'Este no es un archivo de snippets válido de Netcatty.',
|
||||
'snippets.import.toast.successTitle': 'Importación completada',
|
||||
'snippets.import.toast.summary': 'Importados {imported}, sobrescritos {overwritten}, omitidos {skipped}.',
|
||||
'snippets.import.modal.title': 'Importar snippets',
|
||||
'snippets.import.modal.desc': 'Elige uno o más archivos JSON de snippets de Netcatty. Netcatty los mostrará en vista previa antes de importar cualquier cosa.',
|
||||
'snippets.import.modal.exampleTitle': 'Ejemplo de JSON',
|
||||
'snippets.import.modal.noFile': 'Aún no se seleccionó ningún archivo. Usa el formato de ejemplo de abajo, o un arreglo JSON simple de snippets, y luego elige uno o más archivos.',
|
||||
'snippets.import.modal.chooseFile': 'Elegir archivo',
|
||||
'snippets.import.modal.downloadExamples': 'Descargar ejemplos',
|
||||
'snippets.import.modal.multipleFiles': '{count} archivos seleccionados',
|
||||
'snippets.import.modal.parsedSummary': '{files} archivo(s), {total} script(s), {packages} paquete(s) de scripts, {conflicts} comando(s) duplicado(s). Las vinculaciones de host se ignoran.',
|
||||
'snippets.import.modal.confirm': 'Confirmar importación',
|
||||
'snippets.import.conflict.title': '¿Importar snippets?',
|
||||
'snippets.import.conflict.desc': '{file} contiene {total} snippet(s). Ya existen {conflicts} comando(s) duplicado(s).',
|
||||
'snippets.import.conflict.hostBindingsNote': 'Las vinculaciones de host no se importan ni se exportan con los snippets.',
|
||||
'snippets.import.conflict.skip': 'Omitir duplicados',
|
||||
'snippets.import.conflict.overwrite': 'Sobrescribir duplicados',
|
||||
'snippets.packageDialog.title': 'Nuevo paquete de scripts',
|
||||
'snippets.packageDialog.parent': 'Padre: {parent}',
|
||||
'snippets.packageDialog.root': 'Raíz',
|
||||
'snippets.packageDialog.placeholder': 'p. ej., ops/maintenance',
|
||||
'snippets.packageDialog.hint': 'Usa "/" para crear paquetes de scripts anidados.',
|
||||
|
||||
// Snippets Rename Dialog
|
||||
'snippets.renameDialog.title': 'Renombrar paquete de scripts',
|
||||
'snippets.renameDialog.currentPath': 'Ruta actual: {path}',
|
||||
'snippets.renameDialog.placeholder': 'Ingresa el nuevo nombre',
|
||||
'snippets.renameDialog.error.empty': 'El nombre del paquete de scripts no puede estar vacío',
|
||||
'snippets.renameDialog.error.duplicate': 'Ya existe un paquete de scripts con este nombre',
|
||||
'snippets.renameDialog.error.invalidChars': 'El nombre del paquete de scripts solo puede contener letras, números, guiones y guiones bajos',
|
||||
|
||||
'snippets.field.noAutoRun': 'Solo pegar (no auto-ejecutar)',
|
||||
'snippets.field.multiLineRunMode': 'Ejecución multilínea',
|
||||
'snippets.field.multiLineRunMode.paste': 'Enviar todo de una vez',
|
||||
'snippets.field.multiLineRunMode.lineDelay': 'Enviar línea por línea',
|
||||
'snippets.field.multiLineRunModeHint': 'Usa línea por línea para inicios de sesión que piden credenciales (prompt) o macros de dispositivos.',
|
||||
// Snippet Shortkey
|
||||
'snippets.field.shortkey': 'Atajo de teclado',
|
||||
'snippets.shortkey.placeholder': 'Haz clic para configurar el atajo',
|
||||
'snippets.shortkey.recording': 'Presiona una combinación de teclas...',
|
||||
'snippets.shortkey.hint': 'Presiona este atajo en la terminal para enviar el comando rápidamente.',
|
||||
'snippets.shortkey.clear': 'Borrar atajo',
|
||||
'snippets.shortkey.error.systemConflict': 'Este atajo entra en conflicto con {name}',
|
||||
'snippets.shortkey.error.snippetConflict': 'Este atajo ya lo usa el snippet: {name}',
|
||||
|
||||
'snippets.variables.dialogTitle': 'Variables del snippet',
|
||||
'snippets.variables.dialogDesc': 'Completa los valores de "{label}" antes de ejecutar.',
|
||||
'snippets.variables.hint': 'Los valores se insertan tal cual en el script (sin escapado de shell).',
|
||||
'snippets.variables.preview': 'Vista previa',
|
||||
'snippets.variables.placeholder': 'Ingresa un valor',
|
||||
'snippets.variables.placeholderDefault': 'Predeterminado: {value}',
|
||||
'snippets.variables.required': 'Esta variable es obligatoria',
|
||||
'snippets.variables.run': 'Ejecutar',
|
||||
'snippets.field.variablesHelp': 'Usa {{name}} o {{name:default}} para los marcadores de posición en el script.',
|
||||
'snippets.field.variablesDetected': 'Variables',
|
||||
'snippets.field.variableDefault': 'predeterminado {value}',
|
||||
|
||||
// Serial Port
|
||||
'serial.button': 'Serial',
|
||||
'serial.modal.title': 'Conectar a puerto serial',
|
||||
'serial.modal.desc': 'Configura los ajustes de conexión del puerto serial',
|
||||
'serial.field.port': 'Puerto serial',
|
||||
'serial.field.selectPort': 'Selecciona un puerto...',
|
||||
'serial.field.baudRate': 'Velocidad de baudios',
|
||||
'serial.field.dataBits': 'Bits de datos',
|
||||
'serial.field.stopBits': 'Bits de parada',
|
||||
'serial.field.stopBits15Warning': 'Los 1.5 bits de parada pueden no ser compatibles con todos los dispositivos Windows',
|
||||
'serial.field.parity': 'Paridad',
|
||||
'serial.field.flowControl': 'Control de flujo',
|
||||
'serial.noPorts': 'No se detectaron puertos seriales. Conecta un dispositivo y actualiza.',
|
||||
'serial.field.customPort': 'Ruta de puerto personalizada',
|
||||
'serial.field.customPortPlaceholder': 'p. ej., /dev/ttys001 o COM1',
|
||||
'serial.type.hardware': 'Hardware',
|
||||
'serial.type.pseudo': 'Pseudoterminal',
|
||||
'serial.type.custom': 'Personalizado',
|
||||
'serial.parity.none': 'Ninguna',
|
||||
'serial.parity.even': 'Par',
|
||||
'serial.parity.odd': 'Impar',
|
||||
'serial.parity.mark': 'Marca',
|
||||
'serial.parity.space': 'Espacio',
|
||||
'serial.flowControl.none': 'Ninguno',
|
||||
'serial.flowControl.xon/xoff': 'XON/XOFF (Software)',
|
||||
'serial.flowControl.rts/cts': 'RTS/CTS (Hardware)',
|
||||
'serial.field.localEcho': 'Forzar eco local',
|
||||
'serial.field.localEchoDesc': 'Hacer eco de los caracteres escritos localmente (para dispositivos sin eco remoto)',
|
||||
'serial.field.lineMode': 'Modo de línea',
|
||||
'serial.field.lineModeDesc': 'Almacenar en búfer la entrada y enviarla al presionar Enter (en lugar de carácter por carácter)',
|
||||
'serial.field.backspaceBehavior': 'Tecla de retroceso',
|
||||
'serial.field.backspaceBehaviorDesc': 'Usa Ctrl+H para dispositivos de red que no responden al código de Retroceso predeterminado.',
|
||||
'serial.backspace.default': 'Predeterminado (DEL, 0x7F)',
|
||||
'serial.backspace.ctrlH': 'Ctrl+H (BS, 0x08)',
|
||||
'serial.field.charset': 'Codificación de caracteres',
|
||||
'serial.connectionError': 'No se pudo conectar al puerto serial',
|
||||
'serial.field.baudRatePlaceholder': 'Selecciona o ingresa la velocidad de baudios...',
|
||||
'serial.field.baudRateEmpty': 'Ingresa una velocidad de baudios personalizada',
|
||||
'serial.field.customBaudRate': 'Usando velocidad de baudios personalizada',
|
||||
'serial.field.saveConfig': 'Guardar configuración',
|
||||
'serial.field.saveConfigDesc': 'Guarda esta configuración serial en hosts para acceso rápido',
|
||||
'serial.field.configLabel': 'Nombre de configuración',
|
||||
'serial.field.configLabelPlaceholder': 'p. ej., Arduino Uno',
|
||||
'serial.connectAndSave': 'Conectar y guardar',
|
||||
'serial.edit.title': 'Configuración del puerto serial',
|
||||
|
||||
// Keyboard Interactive Authentication (2FA/MFA)
|
||||
'keyboard.interactive.title': 'Se requiere autenticación',
|
||||
'keyboard.interactive.desc': 'El servidor requiere autenticación adicional.',
|
||||
'keyboard.interactive.descWithHost': 'El servidor {hostname} requiere autenticación adicional.',
|
||||
'keyboard.interactive.response': 'Respuesta',
|
||||
'keyboard.interactive.enterCode': 'Ingresa el código de verificación',
|
||||
'keyboard.interactive.enterResponse': 'Ingresa la respuesta',
|
||||
'keyboard.interactive.submit': 'Enviar',
|
||||
'keyboard.interactive.verifying': 'Verificando...',
|
||||
'keyboard.interactive.savePassword': 'Guardar contraseña',
|
||||
|
||||
// Passphrase Modal for encrypted SSH keys
|
||||
'passphrase.title': 'Frase de contraseña de la clave SSH',
|
||||
'passphrase.desc': 'Ingresa la frase de contraseña de {keyName}',
|
||||
'passphrase.descWithHost': 'Ingresa la frase de contraseña de {keyName} para conectarte a {hostname}',
|
||||
'passphrase.label': 'Frase de contraseña',
|
||||
'passphrase.keyPath': 'Clave',
|
||||
'passphrase.unlock': 'Desbloquear',
|
||||
'passphrase.unlocking': 'Desbloqueando...',
|
||||
'passphrase.skip': 'Omitir',
|
||||
'passphrase.remember': 'Recordar esta frase de contraseña',
|
||||
|
||||
// Text Editor
|
||||
'sftp.editor.wordWrap': 'Ajuste de línea',
|
||||
'sftp.editor.maximize': 'Maximizar',
|
||||
'sftp.editor.unsavedTitle': 'Cambios sin guardar',
|
||||
'sftp.editor.unsavedMessage': '{fileName} tiene cambios sin guardar. ¿Guardar antes de cerrar?',
|
||||
'sftp.editor.discardChanges': 'Descartar',
|
||||
'sftp.editor.saveAndClose': 'Guardar y cerrar',
|
||||
'sftp.editor.quitBlockedByDirty': 'Editores sin guardar: guarda o descarta antes de salir',
|
||||
|
||||
};
|
||||
@@ -0,0 +1,983 @@
|
||||
import type { Messages } from '../types';
|
||||
|
||||
export const esVaultMessages: Messages = {
|
||||
// Notes
|
||||
'notes.search.placeholder': 'Buscar notas, hosts, etiquetas...',
|
||||
'notes.action.newNote': 'Nueva nota',
|
||||
'notes.action.newGroup': 'Nueva carpeta',
|
||||
'notes.action.importMarkdown': 'Importar Markdown',
|
||||
'notes.action.exportNote': 'Exportar nota',
|
||||
'notes.action.exportGroup': 'Exportar carpeta',
|
||||
'notes.action.exportAll': 'Exportar notas',
|
||||
'notes.import.toast.success': 'Se importaron {count} nota(s)',
|
||||
'notes.import.toast.noNotes': 'No se importaron archivos Markdown.',
|
||||
'notes.import.toast.failed': 'No se pudieron importar los archivos Markdown.',
|
||||
'notes.import.toast.inProgress': 'Ya hay una importación de Markdown en curso.',
|
||||
'notes.import.toast.skipped': 'Se omitieron {count} archivo(s) no compatible(s).',
|
||||
'notes.export.toast.success': 'Se exportaron {count} nota(s)',
|
||||
'notes.export.toast.empty': 'No hay notas para exportar.',
|
||||
'notes.export.toast.failed': 'No se pudieron exportar las notas.',
|
||||
'notes.codeBlock.copied': 'Copiado',
|
||||
'notes.codeBlock.copyFailed': 'No se pudo copiar el bloque de código.',
|
||||
'notes.group.prompt': 'Ruta de la carpeta',
|
||||
'notes.group.all': 'Cuaderno',
|
||||
'notes.group.ungrouped': 'Sin grupo',
|
||||
'notes.section.notebooks': 'Cuaderno',
|
||||
'notes.section.notes': 'Notas',
|
||||
'notes.mode.edit': 'Editar',
|
||||
'notes.mode.split': 'Dividir',
|
||||
'notes.mode.preview': 'Vista previa',
|
||||
'notes.title.placeholder': 'Título de la nota',
|
||||
'notes.editor.placeholder': 'Escribe notas Markdown aquí...',
|
||||
'notes.preview.empty': 'Aún no hay nada para previsualizar.',
|
||||
'notes.empty.title': 'Aún no hay notas',
|
||||
'notes.empty.desc': 'Crea notas Markdown para runbooks, recordatorios y detalles de traspaso de servidores.',
|
||||
'notes.empty.group': 'No hay notas en este cuaderno.',
|
||||
'notes.search.noResults': 'No se encontraron notas.',
|
||||
|
||||
// Vault import
|
||||
'vault.import.title': 'Agrega datos a tu Vault',
|
||||
'vault.import.desc':
|
||||
'Transfiere tus conexiones desde clientes populares. Selecciona un formato de archivo para comenzar la migración.',
|
||||
'vault.import.chooseFormat': 'Selecciona un formato de archivo',
|
||||
'vault.import.destination.title': '¿Dónde deberían ir los hosts importados?',
|
||||
'vault.import.destination.preserve': 'Conservar los grupos originales',
|
||||
'vault.import.destination.existing': 'Elegir un grupo',
|
||||
'vault.import.destination.new': 'Crear un grupo',
|
||||
'vault.import.destination.noGroups': 'No hay grupos disponibles',
|
||||
'vault.import.destination.newPlaceholder': 'Nombre del grupo nuevo',
|
||||
'vault.import.destination.settings': 'Ubicación de importación',
|
||||
'vault.import.destination.settingsHint': 'Elige dónde se colocarán los hosts nuevos',
|
||||
'vault.import.destination.done': 'Listo',
|
||||
'vault.import.securecrt.directoryHint': 'Selecciona la carpeta de sesiones de SecureCRT.',
|
||||
'vault.import.securecrt.chooseSource': 'Elige una fuente de importación de SecureCRT.',
|
||||
'vault.import.securecrt.sourceQuestion': '¿Qué te gustaría importar?',
|
||||
'vault.import.securecrt.promptTitle': 'Importar desde SecureCRT',
|
||||
'vault.import.securecrt.promptDesc':
|
||||
'Elige la carpeta de sesiones de SecureCRT para importar todas las sesiones conservando la estructura de carpetas, o selecciona un solo archivo de sesión .ini.',
|
||||
'vault.import.securecrt.folder': 'Carpeta de sesiones',
|
||||
'vault.import.securecrt.folderDesc': 'Importa todas las sesiones y conserva la estructura de carpetas.',
|
||||
'vault.import.securecrt.file': 'Archivo de sesión único',
|
||||
'vault.import.securecrt.fileDesc': 'Importa una sesión .ini de SecureCRT.',
|
||||
'vault.import.csv.tip': 'Importación masiva: usa la plantilla CSV.',
|
||||
'vault.import.csv.downloadTemplate': 'Descargar plantilla CSV',
|
||||
'vault.import.toast.start': 'Importando desde {format}...',
|
||||
'vault.import.toast.completedTitle': 'Importación completada',
|
||||
'vault.import.toast.failedTitle': 'Importación fallida',
|
||||
'vault.import.toast.noEntries': 'No se encontraron entradas importables en {format}.',
|
||||
'vault.import.toast.noNewHosts': 'No se importaron hosts nuevos desde {format}.',
|
||||
'vault.import.toast.summary':
|
||||
'Se importaron {count} hosts (omitidos {skipped}, duplicados {duplicates}).',
|
||||
'vault.import.toast.firstIssue': 'Primer problema: {issue}',
|
||||
'vault.import.progress.title': 'Importando hosts',
|
||||
'vault.import.progress.reading': 'Leyendo archivo',
|
||||
'vault.import.progress.parsing': 'Analizando hosts',
|
||||
'vault.import.progress.preparing': 'Preparando cambios',
|
||||
'vault.import.progress.saving': 'Guardando hosts',
|
||||
'vault.import.progress.complete': 'Importación completa',
|
||||
'vault.import.progress.failed': 'Importación fallida',
|
||||
'vault.import.progress.persistFailed': 'No se pudieron guardar los hosts importados. Libera algo de espacio de almacenamiento local e inténtalo de nuevo.',
|
||||
'vault.import.progress.rollbackFailed': 'La importación no se pudo revertir de forma segura. Es posible que queden algunos hosts importados; revisa el Vault antes de reintentar.',
|
||||
'vault.import.progress.summary':
|
||||
'Se importaron {count} hosts; omitidos {skipped}; duplicados {duplicates}.',
|
||||
'vault.import.progress.keepOpen': 'Mantén Netcatty abierto mientras la importación se ejecuta en segundo plano.',
|
||||
'vault.import.progress.fileSummary': '{name} · {count} archivos',
|
||||
'vault.import.progress.fileCount': '{completed} de {total} archivos',
|
||||
'vault.import.mobaxterm.chooseEncoding': 'Elige cómo leer tu archivo de MobaXterm.',
|
||||
'vault.import.mobaxterm.encodingQuestion': '¿Qué codificación de texto usa este archivo?',
|
||||
'vault.import.mobaxterm.auto': 'Detección automática',
|
||||
'vault.import.mobaxterm.autoDesc': 'Recomendado. Usa UTF-8 cuando sea válido; de lo contrario, la codificación de Windows en chino.',
|
||||
'vault.import.mobaxterm.utf8': 'UTF-8',
|
||||
'vault.import.mobaxterm.utf8Desc': 'Úsalo para archivos guardados o convertidos como UTF-8.',
|
||||
'vault.import.mobaxterm.gb18030': 'Windows en chino',
|
||||
'vault.import.mobaxterm.gb18030Desc': 'Úsalo para archivos antiguos exportados en Windows en chino.',
|
||||
'vault.import.sshConfig.chooseMode': 'Elige cómo importar tu archivo de configuración SSH.',
|
||||
'vault.import.sshConfig.modeQuestion': '¿Cómo te gustaría importar?',
|
||||
'vault.import.sshConfig.importOnly': 'Solo importar',
|
||||
'vault.import.sshConfig.importOnlyDesc': 'Importación única. Los cambios no se sincronizarán de vuelta al archivo.',
|
||||
'vault.import.sshConfig.managed': 'Sincronización administrada',
|
||||
'vault.import.sshConfig.managedDesc': 'Mantén la sincronización. Los cambios se guardarán de vuelta en el archivo.',
|
||||
'vault.import.sshConfig.managedDestinationHint': 'La sincronización administrada siempre usa su propio grupo administrado; el destino anterior aplica solo a la importación única.',
|
||||
'vault.import.sshConfig.managedGroup': 'ssh config',
|
||||
'vault.import.sshConfig.managedSuccess': 'Se importaron {count} hosts. El archivo ahora está administrado.',
|
||||
'vault.import.sshConfig.alreadyManaged': 'Este archivo ya está siendo administrado.',
|
||||
'vault.import.sshConfig.alreadyManagedDesc': 'Este archivo ya está administrado en el grupo "{group}". Elimina primero la fuente administrada existente si quieres volver a importar.',
|
||||
'vault.import.sshConfig.noFilePath': 'No se puede administrar este archivo.',
|
||||
'vault.import.sshConfig.noFilePathDesc': 'No se pudo determinar la ruta del archivo. La sincronización administrada requiere acceso al sistema de archivos.',
|
||||
|
||||
// Known Hosts
|
||||
'knownHosts.search.placeholder': 'Buscar hosts conocidos...',
|
||||
'knownHosts.action.scanSystem': 'Escanear sistema',
|
||||
'knownHosts.action.importFile': 'Importar archivo',
|
||||
'knownHosts.action.browseFile': 'Explorar archivo',
|
||||
'knownHosts.empty.title': 'No hay hosts conocidos',
|
||||
'knownHosts.empty.desc':
|
||||
"Los hosts conocidos son servidores SSH a los que te conectaste antes. Importa desde el archivo known_hosts de tu sistema para comenzar.",
|
||||
'knownHosts.results.showingLimited':
|
||||
'Mostrando {shown} de {total} hosts. Usa la búsqueda para encontrar hosts específicos.',
|
||||
'knownHosts.toast.scanUnavailable': 'El escaneo del sistema no está disponible en esta plataforma.',
|
||||
'knownHosts.toast.scanNoFile': 'No se encontró un archivo known_hosts del sistema.',
|
||||
'knownHosts.toast.scanNoEntries': 'No se encontraron entradas utilizables en known_hosts.',
|
||||
'knownHosts.toast.scanImported': 'Se importaron {count} hosts nuevos.',
|
||||
'knownHosts.toast.scanNoNew': 'No se encontraron hosts nuevos.',
|
||||
'knownHosts.toast.scanFailed': 'No se pudo escanear el known_hosts del sistema.',
|
||||
|
||||
// Port Forwarding
|
||||
'pf.empty.title': 'Configura el reenvío de puertos',
|
||||
'pf.empty.desc': 'Guarda el reenvío de puertos para acceder a bases de datos, aplicaciones web y otros servicios.',
|
||||
'pf.title': 'Reenvío de puertos',
|
||||
'pf.rulesCount': '{count} reglas',
|
||||
'pf.wizard.editTitle': 'Editar reenvío de puertos',
|
||||
'pf.wizard.newTitle': 'Nuevo reenvío de puertos',
|
||||
'pf.wizard.saveChanges': 'Guardar cambios',
|
||||
'pf.wizard.done': 'Listo',
|
||||
'pf.wizard.continue': 'Continuar',
|
||||
'pf.wizard.cancel': 'Cancelar',
|
||||
'pf.wizard.skipWizard': 'Omitir asistente',
|
||||
'pf.error.hostNotFound': 'No se encontró el host',
|
||||
'pf.toast.titleWithLabel': 'Reenvío de puertos: {label}',
|
||||
'pf.type.local': 'Local',
|
||||
'pf.type.remote': 'Remoto',
|
||||
'pf.type.dynamic': 'Dinámico',
|
||||
'pf.type.menu.local': 'Reenvío local',
|
||||
'pf.type.menu.remote': 'Reenvío remoto',
|
||||
'pf.type.menu.dynamic': 'Reenvío dinámico',
|
||||
'pf.type.local.desc': 'El reenvío local te permite acceder al puerto de escucha de un servidor remoto como si fuera local.',
|
||||
'pf.type.remote.desc': 'El reenvío remoto abre un puerto en la máquina remota y reenvía las conexiones al host local (actual).',
|
||||
'pf.type.dynamic.desc': 'El reenvío dinámico de puertos convierte a Netcatty en un servidor proxy SOCKS.',
|
||||
'pf.wizard.type.title': 'Selecciona el tipo de reenvío de puertos:',
|
||||
'pf.wizard.localConfig.title': 'Configura el puerto local y la dirección de enlace:',
|
||||
'pf.wizard.localConfig.desc': 'Este puerto estará abierto en el dispositivo local (actual) y recibirá el tráfico.',
|
||||
'pf.wizard.localConfig.localPort': 'Número de puerto local *',
|
||||
'pf.wizard.bindAddress': 'Dirección de enlace',
|
||||
'pf.wizard.remoteHost.title': 'Selecciona el host remoto:',
|
||||
'pf.wizard.remoteHost.desc': 'Selecciona un host donde estará abierto el puerto. El tráfico de este puerto se reenviará al host de destino.',
|
||||
'pf.wizard.remoteConfig.title': 'Configura el puerto y la dirección de enlace:',
|
||||
'pf.wizard.remoteConfig.desc': 'El tráfico se reenviará desde el puerto especificado y la dirección de interfaz del host seleccionado.',
|
||||
'pf.wizard.remoteConfig.remotePort': 'Número de puerto remoto *',
|
||||
'pf.wizard.destination.title': 'Selecciona el host de destino:',
|
||||
'pf.wizard.destination.desc.local': 'Ingresa el destino remoto al que quieres acceder a través del túnel.',
|
||||
'pf.wizard.destination.desc.remote': 'La dirección y el puerto de destino hacia donde se reenviará el tráfico.',
|
||||
'pf.wizard.destination.address': 'Dirección de destino *',
|
||||
'pf.wizard.destination.addressPlaceholder': 'p. ej. 127.0.0.1 o 192.168.1.100',
|
||||
'pf.wizard.destination.port': 'Número de puerto de destino *',
|
||||
'pf.wizard.sshServer.title': 'Selecciona el servidor SSH:',
|
||||
'pf.wizard.sshServer.desc.dynamic': 'Selecciona el servidor SSH que actuará como tu proxy SOCKS.',
|
||||
'pf.wizard.sshServer.desc.default': 'Selecciona el servidor SSH que tunelizará tu tráfico hacia el destino.',
|
||||
'pf.wizard.label.title': 'Selecciona la etiqueta:',
|
||||
'pf.wizard.label.placeholder.dynamic': 'p. ej. Proxy SOCKS',
|
||||
'pf.wizard.label.placeholder.default': 'p. ej. MySQL Producción',
|
||||
'pf.wizard.label.placeholder.remoteRule': 'p. ej. Regla remota',
|
||||
'pf.wizard.placeholders.portExample': 'p. ej. {port}',
|
||||
'pf.action.newForwarding': 'Nuevo reenvío',
|
||||
'pf.form.labelPlaceholder': 'Etiqueta de la regla',
|
||||
'pf.form.intermediateHost': 'Host intermedio *',
|
||||
'pf.form.createRule': 'Crear regla',
|
||||
'pf.form.openWizard': 'Abrir asistente',
|
||||
'pf.form.openWizardTitle': 'Abrir el asistente de reenvío de puertos',
|
||||
'pf.view.grid': 'Cuadrícula',
|
||||
'pf.view.list': 'Lista',
|
||||
'pf.rule.summary.local': 'Local {bindAddress}:{localPort} -> Túnel SSH -> {remoteHost}:{remotePort}',
|
||||
'pf.rule.summary.remote': 'Remoto {bindAddress}:{localPort} -> Túnel SSH -> local {remoteHost}:{remotePort}',
|
||||
'pf.rule.summary.dynamic': 'SOCKS en {bindAddress}:{localPort}',
|
||||
'pf.tooltip.relayHost': 'Host de relevo',
|
||||
'pf.tooltip.hostLabel': 'Host',
|
||||
'pf.tooltip.hostAddress': 'Dirección',
|
||||
'pf.tooltip.noHost': 'No hay host de relevo configurado',
|
||||
'pf.tooltip.localDesc': 'Reenvío de puerto local: accede a servicios remotos a través del túnel SSH',
|
||||
'pf.tooltip.remoteDesc': 'Reenvío de puerto remoto: expone servicios locales al host remoto',
|
||||
'pf.tooltip.dynamicDesc': 'Proxy SOCKS dinámico: enruta el tráfico a través del túnel SSH',
|
||||
'pf.deleteActive.title': '¿Eliminar el reenvío de puertos activo?',
|
||||
'pf.deleteActive.desc': 'Esta regla de reenvío de puertos "{label}" está activa actualmente. Eliminarla primero detendrá el túnel.',
|
||||
'pf.deleteActive.confirm': 'Detener y eliminar',
|
||||
'pf.form.autoStart': 'Inicio automático',
|
||||
'pf.form.autoStartDesc': 'Inicia automáticamente esta regla cuando se abra la aplicación',
|
||||
|
||||
// SFTP
|
||||
'sftp.newFolder': 'Nueva carpeta',
|
||||
'sftp.newFile': 'Nuevo archivo',
|
||||
'sftp.filter': 'Filtrar',
|
||||
'sftp.filter.placeholder': 'Filtrar por nombre de archivo...',
|
||||
'sftp.bookmark.add': 'Marcar esta ruta',
|
||||
'sftp.bookmark.remove': 'Quitar marcador',
|
||||
'sftp.bookmark.list': 'Rutas marcadas',
|
||||
'sftp.bookmark.addGlobal': '+Global',
|
||||
'sftp.bookmark.addGlobalTooltip': 'Guardar como marcador global (compartido entre todos los hosts)',
|
||||
'sftp.bookmark.empty': 'Aún no hay marcadores',
|
||||
'sftp.columns.name': 'Nombre',
|
||||
'sftp.columns.modified': 'Modificado',
|
||||
'sftp.columns.size': 'Tamaño',
|
||||
'sftp.columns.kind': 'Tipo',
|
||||
'sftp.columns.configure': 'Elegir columnas visibles',
|
||||
'sftp.columns.actions': 'Acciones',
|
||||
'sftp.sort.directoriesFirst': 'Carpetas primero',
|
||||
'sftp.emptyDirectory': 'Directorio vacío',
|
||||
'sftp.nav.up': 'Subir un nivel',
|
||||
'sftp.nav.home': 'Ir al inicio',
|
||||
'sftp.nav.refresh': 'Actualizar',
|
||||
'sftp.upload': 'Subir',
|
||||
'sftp.uploadFiles': 'Subir archivos',
|
||||
'sftp.uploadFolder': 'Subir carpeta',
|
||||
'sftp.dragDropToUpload': 'Arrastra y suelta archivos aquí para subirlos',
|
||||
'sftp.retry': 'Reintentar',
|
||||
'sftp.context.open': 'Abrir',
|
||||
'sftp.context.navigateTo': 'Navegar a',
|
||||
'sftp.context.moveTo': 'Mover a...',
|
||||
'sftp.context.moveToParent': 'Mover al directorio principal',
|
||||
'sftp.moveTo.title': 'Mover a directorio',
|
||||
'sftp.moveTo.placeholder': 'Ingresa la ruta del directorio de destino',
|
||||
'sftp.moveTo.confirm': 'Mover',
|
||||
'sftp.moveTo.pathNotFound': 'Directorio no encontrado o inaccesible',
|
||||
'sftp.context.download': 'Descargar',
|
||||
'sftp.context.copyToOtherPane': 'Copiar al otro panel',
|
||||
'sftp.copyToOtherPane.unavailable': 'Abre la vista SFTP de dos paneles y conecta el panel de destino antes de copiar archivos.',
|
||||
'sftp.copyCurrentPath': 'Copiar ruta actual',
|
||||
'sftp.copyCurrentPath.success': 'Ruta actual copiada',
|
||||
'sftp.copyCurrentPath.error': 'No se pudo copiar la ruta actual',
|
||||
'sftp.viewMode.label': 'Modo de vista',
|
||||
'sftp.viewMode.list': 'Vista de lista',
|
||||
'sftp.viewMode.tree': 'Vista de árbol',
|
||||
'sftp.viewMode.switchToList': 'Cambiar a vista de lista',
|
||||
'sftp.viewMode.switchToTree': 'Cambiar a vista de árbol',
|
||||
'sftp.tree.loadError': 'No se pudo cargar el directorio',
|
||||
'sftp.tree.loading': 'Cargando...',
|
||||
'sftp.kind.folder': 'Carpeta',
|
||||
'sftp.context.rename': 'Renombrar',
|
||||
'sftp.context.permissions': 'Permisos',
|
||||
'sftp.context.delete': 'Eliminar',
|
||||
'sftp.context.refresh': 'Actualizar',
|
||||
'sftp.context.uploadFiles': 'Subir archivo(s)...',
|
||||
'sftp.context.uploadFilesHere': 'Subir archivo(s) aquí...',
|
||||
'sftp.context.uploadFolder': 'Subir carpeta...',
|
||||
'sftp.context.uploadFolderHere': 'Subir carpeta aquí...',
|
||||
'sftp.context.downloadSelected': 'Descargar seleccionados ({count})',
|
||||
'sftp.context.deleteSelected': 'Eliminar seleccionados ({count})',
|
||||
'sftp.dropFilesHere': 'Suelta los archivos aquí',
|
||||
'sftp.itemsCount': '{count} elementos',
|
||||
'sftp.selectedCount': '{count} seleccionados',
|
||||
'sftp.path.doubleClickToEdit': 'Haz doble clic para editar la ruta',
|
||||
'sftp.showHiddenPaths': 'Rutas ocultas',
|
||||
'sftp.task.waiting': 'Esperando...',
|
||||
'sftp.transfer.preparing': 'preparando...',
|
||||
'sftp.status.loading': 'Cargando...',
|
||||
'sftp.status.uploading': 'Subiendo...',
|
||||
'sftp.status.ready': 'Listo',
|
||||
'sftp.transfers': 'Transferencias',
|
||||
'sftp.transfers.active': '{count} activas',
|
||||
'sftp.transfers.clearCompleted': 'Limpiar completadas',
|
||||
'sftp.transfers.calculatingTotal': 'Calculando el tamaño total...',
|
||||
'sftp.transfers.filesCount': '{count} archivos',
|
||||
'sftp.transfers.filesProgress': '{current}/{total} archivos',
|
||||
// Progressive folder walk: total is "found so far", not a fixed grand total.
|
||||
'sftp.transfers.filesDiscoveredProgress': '{completed} completados · {discovered} encontrados',
|
||||
'sftp.transfers.expandChildren': 'Mostrar archivos',
|
||||
'sftp.transfers.collapseChildren': 'Ocultar archivos',
|
||||
'sftp.transfers.expandChildList': 'Mostrar detalle',
|
||||
'sftp.transfers.collapseChildList': 'Ocultar',
|
||||
'sftp.transfers.retryAction': 'Reintentar',
|
||||
'sftp.transfers.dismissAction': 'Descartar',
|
||||
'sftp.transfers.openTargetFolder': 'Abrir carpeta de destino',
|
||||
'sftp.transfers.openTargetFolderError': 'No se pudo abrir la carpeta de destino',
|
||||
'sftp.transfers.copyTargetPath': 'Copiar ruta de destino',
|
||||
'sftp.transfers.copyTargetPathSuccess': 'Ruta de destino copiada',
|
||||
'sftp.transfers.copyTargetPathError': 'No se pudo copiar la ruta de destino',
|
||||
'sftp.transfers.pathConflict.title': 'Transferencia bloqueada',
|
||||
'sftp.transfers.pathConflict.paused': 'Otra transferencia de "{name}" está en pausa. Reanúdala o cancélala primero.',
|
||||
'sftp.transfers.pathConflict.inProgress': 'Otra transferencia de "{name}" ya está en curso.',
|
||||
'sftp.transferCenter.title': 'Transferencias de archivos',
|
||||
'sftp.transferCenter.quitConfirm': '{count} transferencia(s) de archivos quedaron sin terminar. El progreso se guardará y deberá reanudarse manualmente la próxima vez. ¿Salir de todos modos?',
|
||||
'sftp.transferCenter.phase.scanning': 'Escaneando',
|
||||
'sftp.transferCenter.phase.compressing': 'Comprimiendo',
|
||||
'sftp.transferCenter.phase.uploading': 'Subiendo',
|
||||
'sftp.transferCenter.phase.transferring': 'Transfiriendo',
|
||||
'sftp.transferCenter.phase.extracting': 'Extrayendo',
|
||||
'sftp.transferCenter.phase.verifying': 'Verificando',
|
||||
'sftp.transferCenter.bucket.active': 'En progreso',
|
||||
'sftp.transferCenter.bucket.all': 'Todas',
|
||||
'sftp.transferCenter.bucket.queued': 'En cola',
|
||||
'sftp.transferCenter.bucket.paused': 'En pausa',
|
||||
'sftp.transferCenter.bucket.failed': 'Fallidas',
|
||||
'sftp.transferCenter.bucket.attention': 'Requieren atención',
|
||||
'sftp.transferCenter.bucket.completed': 'Completadas',
|
||||
'sftp.transferCenter.status.pending': 'Preparando',
|
||||
'sftp.transferCenter.status.resuming': 'Reconectando y reanudando…',
|
||||
'sftp.transferCenter.status.queued': 'En cola',
|
||||
'sftp.transferCenter.status.transferring': 'Transfiriendo',
|
||||
'sftp.transferCenter.status.pausing': 'Pausando',
|
||||
'sftp.transferCenter.status.paused': 'En pausa',
|
||||
'sftp.transferCenter.status.attention': 'Requiere atención',
|
||||
'sftp.transferCenter.status.interrupted': 'Interrumpida: reanúdala manualmente',
|
||||
'sftp.transferCenter.status.completed': 'Completada',
|
||||
'sftp.transferCenter.status.failed': 'Fallida',
|
||||
'sftp.transferCenter.status.cancelled': 'Cancelada',
|
||||
'sftp.transferCenter.background': 'Segundo plano',
|
||||
'sftp.transferCenter.pause': 'Pausar',
|
||||
'sftp.transferCenter.resume': 'Reanudar',
|
||||
'sftp.transferCenter.prioritize': 'Transferir a continuación',
|
||||
'sftp.transferCenter.pauseAll': 'Pausar todas',
|
||||
'sftp.transferCenter.resumeAll': 'Reanudar todas',
|
||||
'sftp.transferCenter.empty': 'No hay transferencias en esta categoría',
|
||||
'sftp.transferCenter.showBackground': 'Mostrar {count} transferencias en segundo plano',
|
||||
'sftp.transferCenter.hideBackground': 'Ocultar transferencias en segundo plano',
|
||||
'sftp.transferCenter.clear': 'Limpiar registros',
|
||||
'sftp.transferCenter.applyAll': 'Aplicar a todas',
|
||||
'sftp.transfers.resizeNameColumn': 'Redimensionar la columna de nombre de archivo',
|
||||
'sftp.transfers.dragToResize': 'Arrastra para redimensionar',
|
||||
'sftp.goUp': 'Subir un nivel',
|
||||
'sftp.goToTerminalCwd': 'Ir al directorio de la terminal',
|
||||
'sftp.locatePathInTerminal': 'Abrir ruta en la terminal',
|
||||
'sftp.followTerminalCwd': 'Seguir el directorio de la terminal',
|
||||
'sftp.followTerminalCwd.enable': 'Habilitar el seguimiento del directorio de la terminal',
|
||||
'sftp.followTerminalCwd.disable': 'Deshabilitar el seguimiento del directorio de la terminal',
|
||||
'sftp.encoding.label': 'Codificación de nombres de archivo',
|
||||
'sftp.encoding.auto': 'Auto',
|
||||
'sftp.encoding.utf8': 'UTF-8',
|
||||
'sftp.encoding.gb18030': 'GB18030',
|
||||
'sftp.goHome': 'Ir al inicio',
|
||||
'sftp.folderName': 'Nombre de la carpeta',
|
||||
'sftp.folderName.placeholder': 'Ingresa el nombre de la carpeta',
|
||||
'sftp.fileName': 'Nombre del archivo',
|
||||
'sftp.fileName.placeholder': 'Ingresa el nombre del archivo',
|
||||
'sftp.prompt.newFolderName': '¿Nombre de la carpeta nueva?',
|
||||
'sftp.rename.title': 'Renombrar',
|
||||
'sftp.rename.newName': 'Nombre nuevo',
|
||||
'sftp.rename.placeholder': 'Ingresa el nombre nuevo',
|
||||
'sftp.confirm.deleteOne': '¿Eliminar "{name}"?',
|
||||
'sftp.deleteConfirm.single': '¿Eliminar "{name}"?',
|
||||
'sftp.deleteConfirm.title': '¿Eliminar {count} elemento(s)?',
|
||||
'sftp.deleteConfirm.desc': 'Esta acción no se puede deshacer. Se eliminará lo siguiente:',
|
||||
'sftp.deleteConfirm.descSingle': 'Esta acción no se puede deshacer.',
|
||||
'sftp.deleteConfirm.host': 'Host',
|
||||
'sftp.deleteConfirm.path': 'Ruta',
|
||||
'sftp.error.loadFailed': 'No se pudo cargar el directorio',
|
||||
'sftp.error.downloadFailed': 'No se pudo descargar',
|
||||
'sftp.error.uploadFailed': 'No se pudo subir',
|
||||
'sftp.error.deleteFailed': 'No se pudo eliminar',
|
||||
'sftp.error.createFolderFailed': 'No se pudo crear la carpeta',
|
||||
'sftp.error.createFileFailed': 'No se pudo crear el archivo',
|
||||
'sftp.error.invalidFileName': 'El nombre de archivo contiene caracteres no válidos: {chars}',
|
||||
'sftp.error.reservedName': 'Este nombre de archivo está reservado por el sistema',
|
||||
'sftp.overwrite.title': 'El archivo ya existe',
|
||||
'sftp.overwrite.desc': 'Ya existe un archivo llamado "{name}". ¿Quieres reemplazarlo?',
|
||||
'sftp.overwrite.confirm': 'Reemplazar',
|
||||
'sftp.error.renameFailed': 'No se pudo renombrar',
|
||||
'sftp.picker.title': 'Seleccionar host',
|
||||
'sftp.picker.desc': 'Elige un host para el panel {side}',
|
||||
'sftp.picker.searchPlaceholder': 'Buscar hosts...',
|
||||
'sftp.picker.local.title': 'Sistema de archivos local',
|
||||
'sftp.picker.local.desc': 'Explorar archivos locales',
|
||||
'sftp.picker.local.badge': 'Local',
|
||||
'sftp.picker.connected.section': 'Conectados',
|
||||
'sftp.picker.connected.badge': 'En vivo',
|
||||
'sftp.picker.connected.connecting': 'Conectando',
|
||||
'sftp.picker.noMatch': 'No hay hosts que coincidan',
|
||||
'sftp.permissions.title': 'Editar permisos',
|
||||
'sftp.permissions.owner': 'Propietario',
|
||||
'sftp.permissions.group': 'Grupo',
|
||||
'sftp.permissions.others': 'Otros',
|
||||
'sftp.permissions.octal': 'Octal',
|
||||
'sftp.permissions.symbolic': 'Simbólico',
|
||||
'sftp.permissions.success': 'Permisos actualizados correctamente',
|
||||
'sftp.permissions.failed': 'No se pudieron actualizar los permisos',
|
||||
'sftp.pane.local': 'Local',
|
||||
'sftp.pane.remote': 'Remoto',
|
||||
'sftp.pane.selectHost': 'Seleccionar host',
|
||||
'sftp.pane.selectHostToStart': 'Selecciona un host para comenzar',
|
||||
'sftp.pane.chooseFilesystem': 'Elige un sistema de archivos local o remoto para explorar',
|
||||
'sftp.tabs.addTab': 'Agregar pestaña nueva',
|
||||
'sftp.tabs.closeTab': 'Cerrar pestaña',
|
||||
'sftp.tabs.newTab': 'Pestaña nueva',
|
||||
'sftp.tabs.copyDefaultPath': 'Copiar pestaña (ruta predeterminada)',
|
||||
'sftp.tabs.copyCurrentPath': 'Copiar e ir a la ruta actual',
|
||||
'sftp.conflict.title': 'Conflicto de archivos',
|
||||
'sftp.conflict.desc': 'Ya existe un archivo con el mismo nombre en el destino',
|
||||
'sftp.conflict.alreadyExistsSuffix': 'ya existe',
|
||||
'sftp.conflict.existingFile': 'Archivo existente',
|
||||
'sftp.conflict.newFile': 'Archivo nuevo',
|
||||
'sftp.conflict.size': 'Tamaño:',
|
||||
'sftp.conflict.modified': 'Modificado:',
|
||||
'sftp.conflict.applyToAll': 'Aplicar esta acción a los {count} conflictos restantes',
|
||||
'sftp.conflict.action.stop': 'Detener',
|
||||
'sftp.conflict.action.skip': 'Omitir',
|
||||
'sftp.conflict.action.keepBoth': 'Conservar ambos',
|
||||
'sftp.conflict.action.duplicate': 'Duplicar',
|
||||
'sftp.conflict.action.merge': 'Combinar',
|
||||
'sftp.conflict.action.replace': 'Reemplazar',
|
||||
|
||||
// SFTP Upload Phases
|
||||
'sftp.upload.phase.compressing': 'Comprimiendo',
|
||||
'sftp.upload.phase.uploading': 'Subiendo',
|
||||
'sftp.upload.phase.extracting': 'Extrayendo',
|
||||
'sftp.upload.phase.compressed': 'Comprimido',
|
||||
|
||||
// SFTP File Opener
|
||||
'sftp.context.copyPath': 'Copiar ruta del archivo',
|
||||
'sftp.context.openWithDefault': 'Abrir con la aplicación predeterminada del sistema',
|
||||
'sftp.context.openWith': 'Abrir con...',
|
||||
'sftp.context.edit': 'Editar',
|
||||
'sftp.context.preview': 'Vista previa',
|
||||
'sftp.opener.title': 'Abrir con',
|
||||
'sftp.opener.desc': 'Elige una aplicación para abrir este archivo',
|
||||
'sftp.opener.builtInEditor': 'Editor integrado',
|
||||
'sftp.opener.editDescription': 'Editar archivos de texto',
|
||||
'sftp.opener.builtInImageViewer': 'Visor de imágenes integrado',
|
||||
'sftp.opener.previewDescription': 'Previsualizar imágenes',
|
||||
'sftp.opener.systemApp': 'Elegir aplicación...',
|
||||
'sftp.opener.systemAppDescription': 'Selecciona una aplicación de tu computadora',
|
||||
'sftp.opener.onlySystemApp': 'Este archivo solo se puede abrir con una aplicación externa',
|
||||
'sftp.opener.noAppsAvailable': 'No hay aplicaciones disponibles',
|
||||
'sftp.opener.noExtension': 'archivos sin extensión',
|
||||
'sftp.opener.setDefault': 'Usar siempre esto para archivos {ext}',
|
||||
'sftp.opener.confirmTitle': '¿Establecer como predeterminado?',
|
||||
'sftp.opener.confirmDescription': '¿Quieres usar siempre {app} para archivos {ext}?',
|
||||
'sftp.opener.yesRemember': 'Sí, recordar esta elección',
|
||||
'sftp.opener.justOnce': 'Solo esta vez',
|
||||
'sftp.opener.confirm.title': 'Establecer aplicación predeterminada',
|
||||
'sftp.opener.confirm.desc': '¿Quieres abrir siempre los archivos .{ext} con esta aplicación?',
|
||||
'sftp.editor.title': 'Editor de texto',
|
||||
'sftp.editor.save': 'Guardar en remoto',
|
||||
'sftp.editor.saving': 'Guardando...',
|
||||
'sftp.editor.saved': 'Guardado correctamente',
|
||||
'sftp.editor.saveFailed': 'No se pudo guardar el archivo',
|
||||
'sftp.editor.unsavedChanges': 'Tienes cambios sin guardar. ¿Cerrar de todos modos?',
|
||||
'sftp.editor.syntaxHighlight': 'Resaltado de sintaxis',
|
||||
'sftp.preview.title': 'Vista previa de imagen',
|
||||
'sftp.preview.zoomIn': 'Acercar',
|
||||
'sftp.preview.zoomOut': 'Alejar',
|
||||
'sftp.preview.resetZoom': 'Restablecer zoom',
|
||||
'sftp.preview.fitToWindow': 'Ajustar a la ventana',
|
||||
|
||||
// Settings > SFTP File Associations
|
||||
'settings.tab.sftpFileAssociations': 'SFTP',
|
||||
'settings.sftp.transferConcurrency': 'Concurrencia de transferencias',
|
||||
'settings.sftp.transferConcurrency.desc': 'Cantidad máxima de archivos transferidos en paralelo para el mismo endpoint, incluidos los contenidos de carpetas y los archivos seleccionados por separado. Los valores más altos pueden mejorar la velocidad, pero pueden abrumar a algunos servidores.',
|
||||
'settings.sftp.transferPoolIdleTtl': 'Mantener activa la conexión de transferencia',
|
||||
'settings.sftp.transferPoolIdleTtl.desc': 'Cuánto tiempo las conexiones SFTP dedicadas de transferencia permanecen activas después de estar inactivas. Los valores más largos reducen la demora de arranque en frío antes de la siguiente subida o descarga. Las transferencias ocupadas nunca se cierran.',
|
||||
'settings.sftp.transferPoolIdleTtl.1m': '1 minuto',
|
||||
'settings.sftp.transferPoolIdleTtl.5m': '5 minutos',
|
||||
'settings.sftp.transferPoolIdleTtl.15m': '15 minutos',
|
||||
'settings.sftp.transferPoolIdleTtl.30m': '30 minutos',
|
||||
'settings.sftp.transferPoolIdleTtl.never': 'Hasta que se cierre la aplicación',
|
||||
'settings.ssh.transportIdleTtl': 'Mantener activa la conexión SSH',
|
||||
'settings.ssh.transportIdleTtl.desc': 'Cuánto tiempo una conexión SSH compartida permanece activa después de liberar el último terminal, la exploración SFTP, la transferencia masiva o el arrendamiento de reenvío de puertos. Mientras esté activa, reconectarse al mismo host puede omitir la reautenticación (incluida la MFA). Las sesiones y transferencias activas nunca se cierran.',
|
||||
'settings.ssh.transportIdleTtl.1m': '1 minuto',
|
||||
'settings.ssh.transportIdleTtl.5m': '5 minutos',
|
||||
'settings.ssh.transportIdleTtl.15m': '15 minutos',
|
||||
'settings.ssh.transportIdleTtl.30m': '30 minutos',
|
||||
'settings.ssh.transportIdleTtl.never': 'Hasta que se cierre la aplicación',
|
||||
'settings.sftp.defaultOpener': 'Aplicación predeterminada para abrir archivos',
|
||||
'settings.sftp.defaultOpener.desc': 'Elige la aplicación predeterminada para abrir archivos sin una asociación de archivos específica',
|
||||
'settings.sftp.defaultOpener.ask': 'Preguntar siempre',
|
||||
'settings.sftp.defaultOpener.askDesc': 'Muestra un diálogo para elegir una aplicación cada vez',
|
||||
'settings.sftp.defaultOpener.builtInDesc': 'Abrir archivos de texto en el editor integrado por defecto',
|
||||
'settings.sftp.defaultOpener.systemApp': 'Elegir aplicación...',
|
||||
'settings.sftp.defaultOpener.systemAppDesc': 'Abrir archivos con una aplicación específica por defecto',
|
||||
'settings.sftpFileAssociations.title': 'Asociaciones de archivos SFTP',
|
||||
'settings.sftpFileAssociations.desc': 'Configura las aplicaciones predeterminadas para abrir archivos por extensión',
|
||||
'settings.sftpFileAssociations.extension': 'Extensión',
|
||||
'settings.sftpFileAssociations.application': 'Aplicación',
|
||||
'settings.sftpFileAssociations.noAssociations': 'No hay asociaciones de archivos configuradas',
|
||||
'settings.sftpFileAssociations.remove': 'Quitar',
|
||||
'settings.sftpFileAssociations.removeConfirm': '¿Quitar la asociación para .{ext}?',
|
||||
|
||||
// Settings > SFTP Behavior
|
||||
'settings.sftp.doubleClickBehavior': 'Comportamiento del doble clic',
|
||||
'settings.sftp.doubleClickBehavior.desc': 'Elige la acción al hacer doble clic en un archivo en la vista SFTP',
|
||||
'settings.sftp.doubleClickBehavior.open': 'Abrir archivo',
|
||||
'settings.sftp.doubleClickBehavior.transfer': 'Transferir al otro panel',
|
||||
'settings.sftp.doubleClickBehavior.openDesc': 'Abrir el archivo en la aplicación predeterminada',
|
||||
'settings.sftp.doubleClickBehavior.transferDesc': 'Transferir el archivo al host activo del otro panel',
|
||||
'settings.sshDeepLink.title': 'Enlaces SSH y Telnet',
|
||||
'settings.sshDeepLink.enable': 'Abrir enlaces ssh:// y telnet:// con Netcatty',
|
||||
'settings.sshDeepLink.enableDesc': 'Permite que Netcatty maneje los enlaces ssh:// y telnet:// de los navegadores y otras aplicaciones.',
|
||||
'settings.explorerContextMenu.title': 'Explorador de Windows',
|
||||
'settings.explorerContextMenu.enable': 'Mostrar "Abrir en Netcatty" en los menús contextuales de carpetas',
|
||||
'settings.explorerContextMenu.enableDesc': 'Agrega un elemento de clic derecho para las carpetas y los fondos de carpeta, para que puedas abrir una terminal local allí. Se aplica de inmediato; no es necesario reinstalar.',
|
||||
'settings.jmsDeepLink.title': 'Enlaces de JumpServer',
|
||||
'settings.jmsDeepLink.enable': 'Manejar enlaces jms://',
|
||||
'settings.jmsDeepLink.enableDesc': 'Registra a Netcatty como el controlador de los enlaces jms:// del cliente de JumpServer. Puede entrar en conflicto con el cliente oficial de JumpServer.',
|
||||
|
||||
// Settings > SFTP Auto Sync
|
||||
'settings.sftp.autoSync': 'Sincronización automática con el remoto',
|
||||
'settings.sftp.autoSync.desc': 'Sincroniza automáticamente los cambios de archivos de vuelta al servidor remoto al abrir archivos con aplicaciones externas',
|
||||
'settings.sftp.autoSync.enable': 'Habilitar la sincronización automática',
|
||||
'settings.sftp.autoSync.enableDesc': 'Cuando guardas un archivo en una aplicación externa, los cambios se subirán automáticamente al servidor remoto',
|
||||
|
||||
// Settings > SFTP Auto Open Sidebar
|
||||
'settings.sftp.autoOpenSidebar': 'Abrir la barra lateral automáticamente al conectar',
|
||||
'settings.sftp.autoOpenSidebar.desc': 'Abre automáticamente la barra lateral del explorador de archivos SFTP al conectar a un host',
|
||||
'settings.sftp.autoOpenSidebar.enable': 'Habilitar la apertura automática de la barra lateral',
|
||||
'settings.sftp.autoOpenSidebar.enableDesc': 'La barra lateral de SFTP se abrirá automáticamente cuando una sesión de terminal se conecte a un host remoto',
|
||||
'settings.sftp.followTerminalCwd': 'Seguir el directorio de la terminal',
|
||||
'settings.sftp.followTerminalCwd.desc': 'Sincroniza automáticamente el explorador SFTP de la barra lateral con el directorio de trabajo de la terminal (alternar en la barra de herramientas)',
|
||||
'settings.sftp.followTerminalCwd.enable': 'Habilitar el seguimiento del directorio de la terminal por defecto',
|
||||
'settings.sftp.followTerminalCwd.enableDesc': 'Cuando la barra lateral de SFTP está abierta, el modo de seguimiento permanece activado por defecto y se actualiza después de los comandos cd de la terminal',
|
||||
|
||||
'settings.sftp.defaultViewMode': 'Modo de vista predeterminado',
|
||||
'settings.sftp.defaultViewMode.desc': 'Elige el modo de vista predeterminado al abrir una pestaña SFTP nueva. Las preferencias por host anulan esta configuración.',
|
||||
'settings.sftp.defaultViewMode.list': 'Vista de lista',
|
||||
'settings.sftp.defaultViewMode.listDesc': 'Muestra los archivos en una lista plana del directorio actual',
|
||||
'settings.sftp.defaultViewMode.tree': 'Vista de árbol',
|
||||
'settings.sftp.defaultViewMode.treeDesc': 'Muestra los archivos en una estructura de árbol jerárquica',
|
||||
|
||||
'sftp.autoSync.success': 'Archivo sincronizado con el remoto: {fileName}',
|
||||
'sftp.autoSync.error': 'No se pudo sincronizar el archivo: {error}',
|
||||
|
||||
// SFTP Folder Upload Progress
|
||||
'sftp.upload.progress': 'Subiendo {current} de {total} archivos...',
|
||||
'sftp.upload.uploading': 'Subiendo...',
|
||||
'sftp.upload.compressing': 'Comprimiendo...',
|
||||
'sftp.upload.extracting': 'Extrayendo...',
|
||||
'sftp.upload.scanning': 'Escaneando archivos...',
|
||||
'sftp.upload.completed': 'Completado',
|
||||
'sftp.upload.compressed': 'Transferencia comprimida',
|
||||
'sftp.upload.currentFile': 'Actual: {fileName}',
|
||||
'sftp.upload.cancelled': 'Subida cancelada',
|
||||
'sftp.upload.noFiles': 'No hay archivos para subir',
|
||||
'sftp.upload.partialSuccess': 'Se subieron {success} archivo(s); {failed} fallaron',
|
||||
'sftp.upload.cancel': 'Cancelar',
|
||||
'sftp.upload.completedToPath': 'Subido a {path}',
|
||||
|
||||
// SFTP Download
|
||||
'sftp.download.completed': 'Descargado',
|
||||
'sftp.download.cancelled': 'Descarga cancelada',
|
||||
|
||||
// SFTP Reconnecting
|
||||
'sftp.reconnecting.title': 'Reconectando...',
|
||||
'sftp.reconnecting.desc': 'Se perdió la conexión, intentando reconectar',
|
||||
'sftp.reconnected': 'Conexión restablecida',
|
||||
'sftp.error.reconnectFailed': 'No se pudo reconectar. Inténtalo de nuevo.',
|
||||
'sftp.error.connectionLostManual': 'Se perdió la conexión. Vuelve a conectar manualmente.',
|
||||
'sftp.error.connectionLostReconnecting': 'Se perdió la conexión. Reconectando...',
|
||||
'sftp.error.sessionLost': 'Se perdió la sesión SFTP. Vuelve a conectar.',
|
||||
|
||||
// Settings > SFTP Show Hidden Files
|
||||
'settings.sftp.showHiddenFiles': 'Mostrar archivos ocultos',
|
||||
'settings.sftp.showHiddenFiles.desc': 'Muestra los archivos ocultos (dotfiles en Unix/macOS y archivos con el atributo oculto en Windows) en el explorador de archivos SFTP.',
|
||||
'settings.sftp.showHiddenFiles.enable': 'Mostrar archivos ocultos',
|
||||
'settings.sftp.showHiddenFiles.enableDesc': 'Muestra los archivos ocultos al explorar sistemas de archivos locales y remotos',
|
||||
|
||||
// Settings > SFTP Compressed Upload
|
||||
'settings.sftp.compressedUpload': 'Transferencia de carpetas comprimidas',
|
||||
'settings.sftp.compressedUpload.desc': 'Comprime las carpetas antes de subirlas para reducir significativamente el tiempo de transferencia.',
|
||||
'settings.sftp.compressedUpload.enable': 'Habilitar la compresión de carpetas',
|
||||
'settings.sftp.compressedUpload.enableDesc': 'Comprime automáticamente las carpetas con tar antes de la transferencia. Requiere soporte de tar en el servidor. Si no está disponible, se recurre a una transferencia normal.',
|
||||
|
||||
'settings.sftp.skipUnchanged.enable': 'Omitir archivos sin cambios',
|
||||
'settings.sftp.skipUnchanged.enableDesc': 'Omite los archivos cuyo tamaño y hora de modificación ya coinciden con el destino (estilo rsync). Deshabilitado al reemplazar una carpeta en una ruta de staging.',
|
||||
|
||||
// Quick Switcher
|
||||
'qs.search.placeholder': 'Buscar hosts o pestañas',
|
||||
'qs.jumpTo': 'Ir a',
|
||||
'qs.localTerminal': 'Terminal local',
|
||||
'qs.localShells': 'Shells locales',
|
||||
'qs.default': 'Predeterminado',
|
||||
|
||||
// Select Host panel
|
||||
'selectHost.title': 'Seleccionar host',
|
||||
'selectHost.noHostsFound': 'No se encontraron hosts',
|
||||
'selectHost.newHost': 'Host nuevo',
|
||||
'selectHost.continue': 'Continuar',
|
||||
'selectHost.continueWithCount': 'Continuar ({count} seleccionados)',
|
||||
'selectHost.toggleGroup': 'Alternar todos los hosts en {name}',
|
||||
'selectHost.toggleHost': 'Alternar {name}',
|
||||
|
||||
// Quick Connect
|
||||
'quickConnect.knownHost.title': '¿Estás seguro de que quieres conectarte?',
|
||||
'quickConnect.knownHost.authenticity': 'No se puede establecer la autenticidad de {hostname}.',
|
||||
'quickConnect.knownHost.fingerprintLabel': 'La huella digital de {keyType} es SHA256:',
|
||||
'quickConnect.knownHost.addQuestion': '¿Quieres agregarlo a la lista de hosts conocidos?',
|
||||
'quickConnect.knownHost.addAndContinue': 'Agregar y continuar',
|
||||
'quickConnect.addKey': 'Agregar clave',
|
||||
'quickConnect.warning.unparsedOptions': 'Se ignoraron algunos argumentos SSH: {options}',
|
||||
'quickConnect.identity.label': 'Preajuste de credenciales',
|
||||
'quickConnect.identity.placeholder': 'Elige una identidad guardada',
|
||||
'quickConnect.identity.empty': 'No se encontraron identidades guardadas',
|
||||
'quickConnect.identity.hint': 'Elige una identidad para completar automáticamente su nombre de usuario y autenticación.',
|
||||
'quickConnect.identity.selectedHint': 'Listo para conectar como {username}.',
|
||||
'quickConnect.identity.method.password': 'Contraseña',
|
||||
'quickConnect.identity.method.key': 'Clave SSH',
|
||||
'quickConnect.identity.method.certificate': 'Certificado',
|
||||
'quickConnect.identity.unavailable': 'A esta identidad le faltan credenciales utilizables en este dispositivo.',
|
||||
'quickConnect.identity.useCustom': 'Usar credenciales personalizadas',
|
||||
'quickConnect.identity.connect': 'Conectar con preajuste',
|
||||
'quickConnect.connectTitle': 'Conectar a {host}',
|
||||
|
||||
// Terminal
|
||||
'terminal.connectionErrorTitle': 'Error de conexión',
|
||||
|
||||
// Protocol select dialog
|
||||
'protocolSelect.chooseProtocol': 'Elegir protocolo',
|
||||
'protocolSelect.port': 'puerto:',
|
||||
|
||||
// Host Details
|
||||
'hostDetails.title.details': 'Detalles del host',
|
||||
'hostDetails.title.new': 'Host nuevo',
|
||||
'vault.panel.resizeWidth': 'Redimensionar el ancho del panel',
|
||||
'hostDetails.saveAria': 'Guardar',
|
||||
'hostDetails.section.address': 'Dirección',
|
||||
'hostDetails.hostname.placeholder': 'IP o nombre de host',
|
||||
'hostDetails.section.general': 'General',
|
||||
'hostDetails.section.sftp': 'Configuración de SFTP',
|
||||
'hostDetails.sftp.fileProtocol': 'Protocolo de archivos',
|
||||
'hostDetails.sftp.fileProtocol.desc': 'Auto intenta SFTP y luego recurre al modo SCP cuando el subsistema SFTP no está disponible (p. ej., algunos NAS). Fuerza SCP para hosts que solo admiten SCP.',
|
||||
'hostDetails.sftp.fileProtocol.auto': 'Auto',
|
||||
'hostDetails.sftp.fileProtocol.sftp': 'Solo SFTP',
|
||||
'hostDetails.sftp.fileProtocol.scp': 'Modo SCP',
|
||||
'hostDetails.sftp.sudo': 'Modo Sudo',
|
||||
'hostDetails.sftp.sudo.desc': 'Adquiere automáticamente privilegios de root usando la contraseña guardada',
|
||||
'hostDetails.sftp.sudo.passwordWarning': 'El modo Sudo requiere una contraseña. Configura una arriba, o asegúrate de que el servidor permita sudo sin contraseña.',
|
||||
'hostDetails.sftp.encoding': 'Codificación de nombres de archivo',
|
||||
'hostDetails.sftp.encoding.desc': 'Selecciona la codificación utilizada para decodificar y enviar los nombres de archivo SFTP.',
|
||||
'hostDetails.label.placeholder': 'Etiqueta (p. ej., servidor de producción)',
|
||||
'hostDetails.notes.label': 'Notas',
|
||||
'hostDetails.notes.placeholder': 'Hardware, proyecto, cliente, región, rol...',
|
||||
'hostDetails.notes.help': 'Admite Markdown. No guardes contraseñas ni claves privadas aquí.',
|
||||
'hostDetails.notes.tab.edit': 'Editar',
|
||||
'hostDetails.notes.tab.preview': 'Vista previa',
|
||||
'hostDetails.notes.preview.empty': 'Aún no hay nada para previsualizar.',
|
||||
'hostDetails.notes.toggle.show': 'Mostrar el editor de notas',
|
||||
'hostDetails.notes.toggle.hide': 'Ocultar el editor de notas',
|
||||
'hostDetails.group.placeholder': 'Grupo padre',
|
||||
'hostDetails.section.credentials': 'Credenciales',
|
||||
'hostDetails.section.portCredentials': 'Puerto y credenciales',
|
||||
'hostDetails.section.appearance': 'Apariencia',
|
||||
'hostDetails.distro.title': 'Distribución de Linux',
|
||||
'hostDetails.distro.desc': 'Detecta automáticamente al conectar, o anula el ícono de la distro manualmente.',
|
||||
'hostDetails.icon.title': 'Ícono del host',
|
||||
'hostDetails.icon.sectionTitle': 'Color e ícono',
|
||||
'hostDetails.icon.desc': 'Elige la fuente y el color del ícono para este host.',
|
||||
'hostDetails.icon.source': 'Fuente',
|
||||
'hostDetails.icon.manualLabel': 'Ícono manual',
|
||||
'hostDetails.icon.tab.brand': 'Marca',
|
||||
'hostDetails.icon.tab.type': 'Tipo',
|
||||
'hostDetails.icon.mode.auto': 'Automático',
|
||||
'hostDetails.icon.mode.custom': 'Personalizado',
|
||||
'hostDetails.icon.reset': 'Restablecer el ícono del host',
|
||||
'hostDetails.icon.colorLabel': 'Color del ícono',
|
||||
'hostDetails.icon.colorDefault': 'Predeterminado',
|
||||
'hostDetails.icon.colorAuto': 'Automático',
|
||||
'hostDetails.icon.colorManual': 'Manual',
|
||||
'hostDetails.icon.colorChoice': 'Color',
|
||||
'hostDetails.icon.autoColorLabel': 'Color actual',
|
||||
'hostDetails.icon.preview': 'Vista previa del ícono',
|
||||
'hostDetails.icon.showLibrary': 'Mostrar la biblioteca de íconos',
|
||||
'hostDetails.icon.hideLibrary': 'Ocultar la biblioteca de íconos',
|
||||
'hostDetails.icon.autoUsesDistro': 'Usa el ícono de la distribución de Linux y el color seleccionado para este host.',
|
||||
'hostDetails.icon.customOverridesDistro': 'El ícono integrado reemplaza la distribución de Linux para este host.',
|
||||
'hostDetails.icon.option.server': 'Servidor',
|
||||
'hostDetails.icon.option.terminal': 'Terminal',
|
||||
'hostDetails.icon.option.database': 'Base de datos',
|
||||
'hostDetails.icon.option.cloud': 'Nube',
|
||||
'hostDetails.icon.option.router': 'Router',
|
||||
'hostDetails.icon.option.shield': 'Escudo',
|
||||
'hostDetails.icon.option.code': 'Código',
|
||||
'hostDetails.icon.option.box': 'Caja',
|
||||
'hostDetails.icon.option.globe': 'Globo',
|
||||
'hostDetails.icon.option.cpu': 'CPU',
|
||||
'hostDetails.icon.option.hard-drive': 'Almacenamiento',
|
||||
'hostDetails.icon.option.network': 'Red',
|
||||
'hostDetails.icon.option.wifi': 'Inalámbrico',
|
||||
'hostDetails.icon.option.lock': 'Bloqueo',
|
||||
'hostDetails.icon.option.key': 'Clave',
|
||||
'hostDetails.icon.option.monitor': 'Monitor',
|
||||
'hostDetails.icon.option.container': 'Contenedor',
|
||||
'hostDetails.icon.option.activity': 'Actividad',
|
||||
'hostDetails.icon.option.zap': 'Rápido',
|
||||
'hostDetails.icon.option.server-cog': 'Configuración del servidor',
|
||||
'hostDetails.icon.color.blue': 'Azul',
|
||||
'hostDetails.icon.color.green': 'Verde',
|
||||
'hostDetails.icon.color.red': 'Rojo',
|
||||
'hostDetails.icon.color.amber': 'Ámbar',
|
||||
'hostDetails.icon.color.purple': 'Púrpura',
|
||||
'hostDetails.icon.color.cyan': 'Cian',
|
||||
'hostDetails.icon.color.orange': 'Naranja',
|
||||
'hostDetails.icon.color.slate': 'Pizarra',
|
||||
'hostDetails.icon.color.violet': 'Violeta',
|
||||
'hostDetails.icon.color.pink': 'Rosa',
|
||||
'hostDetails.icon.color.rose': 'Rosado',
|
||||
'hostDetails.icon.color.lime': 'Lima',
|
||||
'hostDetails.icon.color.teal': 'Verde azulado',
|
||||
'hostDetails.icon.color.sky': 'Celeste',
|
||||
'hostDetails.icon.color.indigo': 'Índigo',
|
||||
'hostDetails.icon.color.zinc': 'Zinc',
|
||||
'hostDetails.icon.color.custom': 'Color personalizado',
|
||||
'hostDetails.distro.mode': 'Fuente',
|
||||
'hostDetails.distro.mode.auto': 'Detección automática',
|
||||
'hostDetails.distro.mode.manual': 'Anulación manual',
|
||||
'hostDetails.distro.detectedLabel': 'Actual',
|
||||
'hostDetails.distro.manualLabel': 'Anulación',
|
||||
'hostDetails.distro.pending': 'Detectar después de la primera conexión',
|
||||
'hostDetails.distro.unknown': 'Desconocido',
|
||||
'hostDetails.distro.option.linux': 'Linux genérico',
|
||||
'hostDetails.distro.option.ubuntu': 'Ubuntu',
|
||||
'hostDetails.distro.option.debian': 'Debian',
|
||||
'hostDetails.distro.option.centos': 'CentOS',
|
||||
'hostDetails.distro.option.rocky': 'Rocky Linux',
|
||||
'hostDetails.distro.option.fedora': 'Fedora',
|
||||
'hostDetails.distro.option.arch': 'Arch Linux',
|
||||
'hostDetails.distro.option.alpine': 'Alpine',
|
||||
'hostDetails.distro.option.amazon': 'Amazon Linux',
|
||||
'hostDetails.distro.option.opensuse': 'openSUSE / SLES',
|
||||
'hostDetails.distro.option.redhat': 'Red Hat / RHEL',
|
||||
'hostDetails.distro.option.almalinux': 'AlmaLinux',
|
||||
'hostDetails.distro.option.alinux': 'Alibaba Cloud Linux',
|
||||
'hostDetails.distro.option.openeuler': 'openEuler',
|
||||
'hostDetails.distro.option.freebsd': 'FreeBSD',
|
||||
'hostDetails.distro.option.oracle': 'Oracle Linux',
|
||||
'hostDetails.distro.option.kali': 'Kali Linux',
|
||||
'hostDetails.distro.option.cisco': 'Cisco',
|
||||
'hostDetails.distro.option.juniper': 'Juniper Networks',
|
||||
'hostDetails.distro.option.huawei': 'Huawei',
|
||||
'hostDetails.distro.option.h3c': 'H3C',
|
||||
'hostDetails.distro.option.hpe': 'HPE',
|
||||
'hostDetails.distro.option.mikrotik': 'MikroTik',
|
||||
'hostDetails.distro.option.fortinet': 'Fortinet',
|
||||
'hostDetails.distro.option.paloalto': 'Palo Alto Networks',
|
||||
'hostDetails.distro.option.zyxel': 'ZyXEL',
|
||||
'hostDetails.distro.option.ruijie': 'Ruijie',
|
||||
'hostDetails.section.mosh': 'Mosh',
|
||||
'hostDetails.section.et': 'EternalTerminal',
|
||||
'hostDetails.et.port': 'Puerto del servidor ET',
|
||||
'hostDetails.et.port.desc': 'Puerto en el que escucha etserver (predeterminado 2022)',
|
||||
'hostDetails.username.placeholder': 'Nombre de usuario',
|
||||
'hostDetails.password.placeholder': 'Contraseña',
|
||||
'hostDetails.password.show': 'Mostrar contraseña',
|
||||
'hostDetails.password.hide': 'Ocultar contraseña',
|
||||
'hostDetails.password.save': 'Guardar contraseña',
|
||||
'hostDetails.auth.method': 'Método de inicio de sesión',
|
||||
'hostDetails.auth.auto': 'Automático',
|
||||
'hostDetails.auth.auto.desc': 'Intenta con el agente SSH y las claves locales, y luego usa la contraseña guardada.',
|
||||
'hostDetails.auth.passwordOnly': 'Solo contraseña',
|
||||
'hostDetails.auth.password.desc': 'Usa solo la contraseña guardada y las solicitudes interactivas de contraseña.',
|
||||
'hostDetails.auth.key': 'Clave',
|
||||
'hostDetails.auth.key.desc': 'Usa la clave seleccionada, con la contraseña guardada como respaldo cuando esté presente.',
|
||||
'hostDetails.auth.certificate': 'Certificado',
|
||||
'hostDetails.auth.certificate.desc': 'Usa el certificado SSH seleccionado, con la contraseña guardada como respaldo cuando esté presente.',
|
||||
'hostDetails.auth.mfaFirst': 'Preferir autenticación interactiva',
|
||||
'hostDetails.auth.mfaFirst.desc': 'Para servidores que requieren contraseña y MFA a través de keyboard-interactive.',
|
||||
'hostDetails.auth.credentialRequired': 'Selecciona una clave o un certificado antes de guardar este método de inicio de sesión.',
|
||||
'hostDetails.identity.suggestions': 'Identidades',
|
||||
'hostDetails.identity.missing': 'Identidad no encontrada',
|
||||
'hostDetails.credential.keyCertificate': 'Clave, certificado, archivo de clave local',
|
||||
'hostDetails.credential.key': 'Clave',
|
||||
'hostDetails.credential.certificate': 'Certificado',
|
||||
'hostDetails.credential.localKeyFile': 'Archivo de clave local',
|
||||
'hostDetails.credential.localKeyFilePlaceholder': '~/.ssh/id_ed25519',
|
||||
'hostDetails.credential.browseKeyFile': 'Explorar...',
|
||||
'hostDetails.credential.missing': 'Credencial no encontrada',
|
||||
'hostDetails.section.systemSshAgent': 'Agente SSH del sistema',
|
||||
'hostDetails.systemSshAgent': 'Usar el agente SSH del sistema para iniciar sesión',
|
||||
'hostDetails.systemSshAgent.desc': 'Usa claves ya desbloqueadas por macOS, Linux, Windows, 1Password u otro agente SSH compatible',
|
||||
'hostDetails.systemSshAgent.socket': 'Socket del agente',
|
||||
'hostDetails.systemSshAgent.socket.desc': 'Déjalo vacío para usar SSH_AUTH_SOCK',
|
||||
'hostDetails.systemSshAgent.identitiesOnly': 'Usar solo las claves configuradas',
|
||||
'hostDetails.systemSshAgent.identitiesOnly.desc': 'No intentar con claves no relacionadas actualmente cargadas en el agente',
|
||||
'hostDetails.systemSshAgent.notRunning': 'El agente SSH del sistema no está disponible',
|
||||
'hostDetails.systemSshAgent.notRunningHint': 'Inicia o desbloquea tu agente SSH, o proporciona la ruta de su socket arriba.',
|
||||
'hostDetails.keys.search': 'Buscar claves...',
|
||||
'hostDetails.keys.empty': 'No hay claves disponibles',
|
||||
'hostDetails.certs.search': 'Buscar certificados...',
|
||||
'hostDetails.certs.empty': 'No hay certificados disponibles',
|
||||
'hostDetails.agentForwarding': 'Reenviar el agente SSH',
|
||||
'hostDetails.agentForwarding.desc': 'Permite que el servidor remoto use tus claves SSH locales (p. ej., para operaciones de git)',
|
||||
'hostDetails.agentForwarding.agentNotRunning': 'El agente SSH no está disponible',
|
||||
'hostDetails.agentForwarding.agentNotRunningHint': 'No se detectó ningún agente SSH. Habilita el agente de autenticación de OpenSSH en los servicios de Windows, o usa un agente compatible como Bitwarden, 1Password o gpg-agent.',
|
||||
'hostDetails.section.agentForwarding': 'Agente SSH',
|
||||
'hostDetails.x11Forwarding': 'Reenviar aplicaciones X11',
|
||||
'hostDetails.x11Forwarding.desc': 'Muestra las aplicaciones gráficas remotas en tu escritorio local cuando se ejecuta un servidor X local.',
|
||||
'hostDetails.section.x11Forwarding': 'Reenvío X11',
|
||||
'hostDetails.section.deviceType': 'Tipo de dispositivo',
|
||||
'hostDetails.deviceType': 'Modo de dispositivo de red',
|
||||
'hostDetails.deviceType.desc': 'Habilítalo para equipos de red (switches, routers, firewalls) conectados mediante SSH. Los comandos se envían tal cual, sin envoltura de shell, compatible con las CLI de proveedores como Huawei VRP y Cisco IOS.',
|
||||
'hostDetails.deviceType.warning': 'Los comandos del agente de IA se enviarán directamente sin seguimiento del código de salida. Habilítalo solo para dispositivos que no ejecutan un shell estándar.',
|
||||
'hostDetails.section.sshAlgorithms': 'Algoritmos SSH',
|
||||
'hostDetails.section.terminalBehavior': 'Comportamiento de la terminal',
|
||||
'hostDetails.lineTimestamps': 'Mostrar marcas de tiempo de salida',
|
||||
'hostDetails.lineTimestamps.desc': 'Muestra la hora local junto a las líneas de salida visibles de este host sin cambiar el texto de la terminal.',
|
||||
'hostDetails.legacyAlgorithms': 'Permitir algoritmos heredados',
|
||||
'hostDetails.legacyAlgorithms.desc': 'Habilita algoritmos SSH obsoletos (diffie-hellman-group1, ssh-dss, 3des-cbc, etc.) para conectar con equipos de red más antiguos.',
|
||||
'hostDetails.legacyAlgorithms.warning': 'Estos algoritmos tienen debilidades de seguridad conocidas. Habilítalos solo para dispositivos heredados que no admiten criptografía moderna.',
|
||||
'hostDetails.skipEcdsaHostKey': 'Omitir la clave de host ECDSA',
|
||||
'hostDetails.skipEcdsaHostKey.desc': 'Algunos switches antiguos de Huawei / Cisco generan firmas de clave de host ECDSA no estándar que provocan "signature verification failed". Al activar esto, se eliminan todos los ecdsa-sha2-* de la oferta del cliente para que la negociación recurra a RSA / Ed25519.',
|
||||
'hostDetails.algorithms.advanced': 'Anulaciones avanzadas de algoritmos',
|
||||
'hostDetails.algorithms.advanced.desc': 'Reemplaza la lista de algoritmos ofrecidos para cualquier categoría por cada host. Dejar una categoría sin cambios usa la predeterminada; seleccionar un subconjunto reemplaza por completo la lista predeterminada. Los valores incorrectos pueden hacer que el host sea inalcanzable.',
|
||||
'hostDetails.algorithms.inheritedNotice': 'El grupo actual tiene anulaciones de algoritmos configuradas para: {categories}. El botón "Restablecer" aquí recurre a las listas del grupo, no a las predeterminadas de Netcatty. Para ignorar la restricción del grupo, borra la anulación en la configuración de algoritmos del grupo.',
|
||||
'hostDetails.algorithms.customized': 'personalizado',
|
||||
'hostDetails.algorithms.reset': 'Restablecer',
|
||||
'hostDetails.algorithms.category.kex': 'Intercambio de claves (KEX)',
|
||||
'hostDetails.algorithms.category.cipher': 'Cifrado',
|
||||
'hostDetails.algorithms.category.hmac': 'MAC (HMAC)',
|
||||
'hostDetails.algorithms.category.serverHostKey': 'Clave de host',
|
||||
'hostDetails.algorithms.category.compress': 'Compresión',
|
||||
'hostDetails.section.keepalive': 'Keepalive',
|
||||
'hostDetails.keepalive.override': 'Anular el keepalive global',
|
||||
'hostDetails.keepalive.desc': 'Usa una política de keepalive personalizada para este host en lugar de la configuración global. Útil para routers o switches antiguos cuyo servidor SSH no responde a las solicitudes keepalive@openssh.com: establece el intervalo en 0 para deshabilitar el keepalive por completo en este host.',
|
||||
'hostDetails.keepalive.interval': 'Intervalo (segundos)',
|
||||
'hostDetails.keepalive.countMax': 'Máximo de keepalives sin respuesta',
|
||||
'hostDetails.keepalive.disabledHint': 'Intervalo = 0 deshabilita el keepalive para este host. La sesión dependerá de los tiempos de espera a nivel de TCP para detectar una conexión caída.',
|
||||
'hostDetails.section.sshTimeouts': 'Tiempos de espera de conexión SSH',
|
||||
'hostDetails.sshTimeouts.tcpConnect': 'Tiempo de espera de TCP',
|
||||
'hostDetails.sshTimeouts.tcpConnect.desc': 'Segundos de espera para la conexión de red a este host.',
|
||||
'hostDetails.sshTimeouts.authReady': 'Tiempo de espera de autenticación SSH',
|
||||
'hostDetails.sshTimeouts.authReady.desc': 'Segundos de espera después de conectar para que terminen la negociación y la autenticación SSH.',
|
||||
'hostDetails.backspaceBehavior': 'Comportamiento de la tecla Retroceso',
|
||||
'hostDetails.backspaceBehavior.default': 'Predeterminado',
|
||||
'hostDetails.jumpHosts': 'Proxy mediante hosts',
|
||||
'hostDetails.jumpHosts.hops': '{count} salto(s)',
|
||||
'hostDetails.jumpHosts.direct': 'Directo',
|
||||
'hostDetails.jumpHosts.configure': 'Configurar hosts proxy',
|
||||
'hostDetails.proxy': 'Proxy mediante HTTP/SOCKS5/Comando',
|
||||
'hostDetails.proxy.none': 'Ninguno',
|
||||
'hostDetails.proxy.edit': 'Editar proxy',
|
||||
'hostDetails.proxy.configure': 'Configurar proxy',
|
||||
'hostDetails.proxyPanel.title': 'Proxy mediante HTTP/SOCKS5/Comando',
|
||||
'hostDetails.proxyPanel.hostPlaceholder': 'Host del proxy',
|
||||
'hostDetails.proxyPanel.command': 'ProxyCommand',
|
||||
'hostDetails.proxyPanel.commandPlaceholder': 'cloudflared access ssh --hostname %h',
|
||||
'hostDetails.proxyPanel.commandHelp': 'Usa %h para el host de destino, %p para el puerto de destino y %% para un porcentaje literal.',
|
||||
'hostDetails.proxyPanel.credentials': 'Credenciales',
|
||||
'hostDetails.proxyPanel.usernamePlaceholder': 'Nombre de usuario',
|
||||
'hostDetails.proxyPanel.passwordPlaceholder': 'Contraseña',
|
||||
'hostDetails.proxyPanel.identities': 'Identidades',
|
||||
'hostDetails.proxyPanel.keychainIdentity': 'Identidad del llavero',
|
||||
'hostDetails.proxyPanel.manualCredentials': 'Credenciales manuales',
|
||||
'hostDetails.proxyPanel.remove': 'Quitar proxy',
|
||||
'hostDetails.proxyPanel.savedProxy': 'Proxy guardado',
|
||||
'hostDetails.proxyPanel.selectSaved': 'Seleccionar proxy guardado',
|
||||
'hostDetails.proxyPanel.customProxy': 'Proxy personalizado',
|
||||
'hostDetails.proxyPanel.missing': 'Faltante',
|
||||
'hostDetails.proxyPanel.missingSaved': 'Falta el proxy guardado',
|
||||
'hostDetails.proxyPanel.missingIdentity': 'Falta la identidad del llavero',
|
||||
'hostDetails.proxyPanel.incompleteIdentity': 'La identidad del proxy necesita un nombre de usuario y una contraseña',
|
||||
'hostDetails.proxyPanel.unreadableIdentity': 'No se puede leer la contraseña de la identidad del proxy en este dispositivo',
|
||||
'hostDetails.proxyPanel.error.required': 'Se requieren el host y el puerto del proxy, o un ProxyCommand.',
|
||||
'hostDetails.envVars': 'Variables de entorno',
|
||||
'hostDetails.envVars.add': 'Agregar variable de entorno',
|
||||
'hostDetails.envVars.title': 'Variables de entorno',
|
||||
'hostDetails.envVars.desc': 'Establece una variable de entorno para {host}.',
|
||||
'hostDetails.envVars.note':
|
||||
'Algunos servidores SSH por defecto solo permiten variables con el prefijo LC_ y LANG_.',
|
||||
'hostDetails.envVars.variable': 'Variable',
|
||||
'hostDetails.envVars.value': 'Valor',
|
||||
'hostDetails.envVars.newVariable': 'Variable nueva',
|
||||
'hostDetails.envVars.variableName': 'Nombre de la variable',
|
||||
'hostDetails.chain.title': 'Editar cadena',
|
||||
'hostDetails.chain.desc': 'Agregar otro host creará una conexión a {host}.',
|
||||
'hostDetails.chain.addHost': 'Agregar un host',
|
||||
'hostDetails.chain.target': 'Destino',
|
||||
'hostDetails.chain.availableHosts': 'Hosts disponibles',
|
||||
'hostDetails.chain.clear': 'Limpiar',
|
||||
'hostDetails.group.title': 'Grupo nuevo',
|
||||
'hostDetails.group.general': 'General',
|
||||
'hostDetails.group.namePlaceholder': 'Nombre del grupo',
|
||||
'hostDetails.group.parentPlaceholder': 'Grupo padre',
|
||||
'hostDetails.group.cloudSync': 'Sincronización en la nube',
|
||||
'hostDetails.group.addProtocol': 'Agregar protocolo',
|
||||
'hostDetails.startupCommand': 'Comando de inicio',
|
||||
'hostDetails.startupCommand.placeholder': 'Comando para ejecutar al conectar (p. ej., cd /app && ls)',
|
||||
'hostDetails.startupCommand.help':
|
||||
'Este comando se ejecutará automáticamente después de que se establezca la conexión SSH.',
|
||||
'hostDetails.startupCommand.runMode': 'Ejecución multilínea',
|
||||
'hostDetails.startupCommand.runMode.help': 'Elige cómo se envían los comandos de inicio multilínea después de la conexión.',
|
||||
'hostDetails.startupCommand.runMode.lineDelay': 'Enviar línea por línea',
|
||||
'hostDetails.startupCommand.runMode.paste': 'Enviar todo de una vez',
|
||||
'hostDetails.otherProtocols': 'Otros protocolos',
|
||||
'hostDetails.telnetOn': 'Telnet activado',
|
||||
'hostDetails.port': 'puerto',
|
||||
'hostDetails.telnet.credentials': 'Credenciales',
|
||||
'hostDetails.telnet.identity.placeholder': 'Identidad manual',
|
||||
'hostDetails.telnet.username': 'Nombre de usuario de Telnet',
|
||||
'hostDetails.telnet.password': 'Contraseña de Telnet',
|
||||
'hostDetails.charset.placeholder': 'Codificación (p. ej., UTF-8)',
|
||||
'hostDetails.telnet.add': 'Agregar protocolo Telnet',
|
||||
'hostDetails.telnet.setDefault': 'Conectar con Telnet por defecto',
|
||||
'hostDetails.tags': 'Etiquetas',
|
||||
'hostDetails.group': 'Grupo',
|
||||
'hostDetails.selectGroup': 'Seleccionar grupo',
|
||||
'hostDetails.addTag': 'Agregar una etiqueta...',
|
||||
'hostDetails.createTag': 'Crear etiqueta',
|
||||
'hostDetails.createGroup': 'Crear grupo',
|
||||
'hostDetails.plugin.title': 'Conexión de plugin',
|
||||
'hostDetails.plugin.provider.placeholder': 'Selecciona un proveedor de conexión',
|
||||
'hostDetails.plugin.provider.empty': 'No hay proveedores de conexión instalados',
|
||||
'hostDetails.plugin.authentication.placeholder': 'Selecciona un proveedor de autenticación',
|
||||
'hostDetails.plugin.authentication.none': 'Administrada por el proveedor o sin autenticación',
|
||||
'hostDetails.plugin.credential.placeholder': 'Selecciona una credencial del host',
|
||||
'hostDetails.plugin.credential.none': 'No hay credencial guardada',
|
||||
'hostDetails.plugin.credential.password': 'Identidad de contraseña',
|
||||
'hostDetails.plugin.credential.privateKey': 'Clave privada',
|
||||
'hostDetails.plugin.credential.unavailable': 'Credencial guardada no disponible',
|
||||
'hostDetails.plugin.configuration.label': 'Configuración del proveedor (JSON)',
|
||||
'hostDetails.plugin.configuration.invalid': 'La configuración debe ser un JSON válido.',
|
||||
'hostDetails.plugin.configuration.schemaInvalid': 'La configuración no coincide con el esquema del proveedor.',
|
||||
'hostDetails.plugin.unavailable': 'El proveedor configurado no está disponible. La configuración se conserva hasta que se restaure el plugin.',
|
||||
'hostDetails.plugin.useSsh': 'Usar SSH en su lugar',
|
||||
|
||||
// Host form (legacy modal)
|
||||
'hostForm.title.edit': 'Editar host',
|
||||
'hostForm.title.new': 'Host nuevo',
|
||||
'hostForm.desc.edit': 'Actualiza los detalles de conexión de este host',
|
||||
'hostForm.desc.new': 'Crea una nueva entrada de host SSH',
|
||||
'hostForm.field.label': 'Etiqueta',
|
||||
'hostForm.placeholder.label': 'Mi servidor de producción',
|
||||
'hostForm.field.hostname': 'Nombre de host / IP',
|
||||
'hostForm.placeholder.hostname': '192.168.1.1',
|
||||
'hostForm.field.port': 'Puerto',
|
||||
'hostForm.field.username': 'Nombre de usuario',
|
||||
'hostForm.field.osType': 'Tipo de SO',
|
||||
'hostForm.placeholder.selectOs': 'Seleccionar SO',
|
||||
'hostForm.field.group': 'Grupo',
|
||||
'hostForm.placeholder.group': 'p. ej., AWS, DigitalOcean',
|
||||
'hostForm.field.tags': 'Etiquetas',
|
||||
'hostForm.placeholder.addTag': 'Agregar una etiqueta...',
|
||||
'hostForm.auth.method': 'Método de autenticación',
|
||||
'hostForm.auth.password': 'Contraseña',
|
||||
'hostForm.auth.sshKey': 'Clave SSH',
|
||||
'hostForm.auth.selectKey': 'Seleccionar una clave SSH',
|
||||
'hostForm.auth.noKeys': 'No hay claves disponibles',
|
||||
'hostForm.auth.noKeysHint': 'No se encontraron claves SSH en el llavero. Crea una primero.',
|
||||
'hostForm.saveHost': 'Guardar host',
|
||||
|
||||
// Connection logs
|
||||
'logs.table.date': 'Fecha',
|
||||
'logs.table.user': 'Usuario',
|
||||
'logs.table.host': 'Host',
|
||||
'logs.table.saved': 'Guardado',
|
||||
'logs.empty.title': 'No hay registros de conexión',
|
||||
'logs.empty.desc':
|
||||
'Tu historial de conexiones aparecerá aquí cuando te conectes a hosts o abras terminales locales.',
|
||||
'logs.loadMore': 'Cargar {count} registros más',
|
||||
'logs.ongoing': 'en curso',
|
||||
'logs.localTerminal': 'Terminal local',
|
||||
'logs.action.save': 'Guardar',
|
||||
'logs.action.unsave': 'Quitar de guardados',
|
||||
'logs.action.delete': 'Eliminar',
|
||||
|
||||
// Log view
|
||||
'logView.customizeAppearance': 'Personalizar la apariencia',
|
||||
'logView.appearance': 'Apariencia',
|
||||
'logView.readOnly': 'Solo lectura',
|
||||
'logView.export': 'Exportar',
|
||||
'vault.import.plugins.title': 'Importadores de plugins',
|
||||
'vault.import.plugins.loading': 'Generando una vista previa de importación segura…',
|
||||
'vault.import.plugins.progress': '{completed} de {total} procesados {message}',
|
||||
'vault.import.plugins.preview': 'Vista previa de importación',
|
||||
'vault.import.plugins.empty': 'No se devolvieron borradores importables.',
|
||||
'vault.import.plugins.summary': '{parsed} borradores · {warnings} advertencias · {errors} errores',
|
||||
'vault.import.plugins.commit': 'Vista previa de importación',
|
||||
'vault.import.plugins.fileUnavailable': 'El archivo seleccionado no está disponible para el bridge del importador de escritorio.',
|
||||
'vault.import.plugins.notRecognized': 'Este importador no reconoció el archivo seleccionado.',
|
||||
'vault.import.plugins.containsErrors': 'La vista previa de importación contiene errores y no se puede confirmar.',
|
||||
'vault.import.plugins.committed': 'Se importaron {count} elementos validados.',
|
||||
'vault.import.plugins.duplicates': '{count} elementos duplicados se omitirán.',
|
||||
'vault.import.plugins.validationErrors': '{count} borradores fallaron la validación de host y deben corregirse mediante el importador.',
|
||||
'vault.import.plugins.kind.host': 'Host',
|
||||
'vault.import.plugins.kind.identity': 'Identidad',
|
||||
'vault.import.plugins.kind.key': 'Clave',
|
||||
'vault.import.plugins.kind.snippet': 'Fragmento',
|
||||
'vault.import.plugins.kind.group': 'Grupo',
|
||||
'vault.import.plugins.moreItems': '{count} elementos más están incluidos en esta importación.',
|
||||
'vault.import.plugins.moreDiagnostics': '{count} diagnósticos más se omitieron de esta vista previa.',
|
||||
|
||||
};
|
||||
@@ -34,6 +34,7 @@ export const ruAiMessages: Messages = {
|
||||
'ai.providers.apiKey.placeholder': 'Введите API-ключ',
|
||||
'ai.providers.apiKey.decrypting': 'Расшифровка...',
|
||||
'ai.providers.baseUrl': 'Базовый URL',
|
||||
'ai.providers.baseUrl.anthropicHelp': 'Anthropic-совместимый: хост с /v1 или без (например https://gateway.example или https://gateway.example/v1). Проверка и чат используют /v1/models и /v1/messages.',
|
||||
'ai.providers.skipTLSVerify': 'Пропустить проверку TLS-сертификата (для самоподписанных сертификатов)',
|
||||
'ai.providers.defaultModel': 'Модель по умолчанию',
|
||||
'ai.providers.defaultModel.placeholder': 'например, gpt-4o, claude-sonnet-4-20250514',
|
||||
|
||||
@@ -18,8 +18,11 @@ export const ruScriptsMessages = {
|
||||
'scripts.editor.modalSubtitle': 'Редактируйте метаданные и код скрипта в большом рабочем пространстве.',
|
||||
'scripts.editor.lineCount': '{count} строк',
|
||||
'scripts.editor.resize': 'Изменить размер редактора',
|
||||
'scripts.targets.hint': 'Автоматические триггеры применяются к выбранным хостам или ко всем хостам, если включена эта настройка.',
|
||||
'scripts.targets.hint': 'Выбранные группы разрешаются динамически, поэтому новые хосты включаются автоматически.',
|
||||
'scripts.targets.connectOrderHint': 'Порядок запуска скриптов подключения настраивается для каждого хоста в разделе «Сведения о хосте → Автоматизация».',
|
||||
'scripts.targets.currentHostMismatch': 'Этот скрипт не назначен текущему хосту.',
|
||||
'hostDetails.automation.groupScripts': 'Унаследованные скрипты группы',
|
||||
'hostDetails.automation.groupScriptsHint': 'Эти скрипты динамически следуют за группой хоста и выполняются перед очередью хоста.',
|
||||
'scripts.actions.runNowHint': 'Запускается для выбранных целей либо для всех доступных для подключения хостов, если включена эта настройка.',
|
||||
'scripts.actions.runParallel': 'Запустить на всех вкладках (параллельно)',
|
||||
'scripts.actions.runSequential': 'Запустить на всех вкладках (последовательно)',
|
||||
|
||||
@@ -681,6 +681,9 @@ export const ruTerminalMessages: Messages = {
|
||||
'snippets.field.variableDefault': 'по умолчанию {value}',
|
||||
'snippets.targets.title': 'Цели',
|
||||
'snippets.targets.add': 'Добавить цели',
|
||||
'snippets.targets.selectHosts': 'Хосты',
|
||||
'snippets.targets.selectGroups': 'Группы',
|
||||
'snippets.targets.noGroups': 'Группы не найдены',
|
||||
'snippets.history.title': 'История оболочки',
|
||||
'snippets.history.subtitle': '{count} команд',
|
||||
'snippets.history.emptyTitle': 'История оболочки пока пуста',
|
||||
@@ -762,7 +765,7 @@ export const ruTerminalMessages: Messages = {
|
||||
'snippets.shortkey.recording': 'Нажмите сочетание клавиш...',
|
||||
'snippets.shortkey.hint': 'Нажмите это сочетание в терминале, чтобы быстро отправить команду.',
|
||||
'snippets.shortkey.clear': 'Очистить сочетание',
|
||||
'snippets.shortkey.error.systemConflict': 'Это сочетание конфликтует с системным сочетанием',
|
||||
'snippets.shortkey.error.systemConflict': 'Это сочетание конфликтует с «{name}»',
|
||||
'snippets.shortkey.error.snippetConflict': 'Это сочетание уже используется сниппетом: {name}',
|
||||
|
||||
// Serial Port
|
||||
|
||||
@@ -5,6 +5,8 @@ import { enSystemManagerMessages } from "./en/systemManager";
|
||||
import { enTerminalMessages } from "./en/terminal";
|
||||
import { ruSystemManagerMessages } from "./ru/systemManager";
|
||||
import { ruTerminalMessages } from "./ru/terminal";
|
||||
import { esSystemManagerMessages } from "./es/systemManager";
|
||||
import { esTerminalMessages } from "./es/terminal";
|
||||
import { zhCnSystemManagerMessages } from "./zh-CN/systemManager";
|
||||
import { zhCNVaultMessages } from "./zh-CN/vault";
|
||||
import { zhTwSystemManagerMessages } from "./zh-TW/systemManager";
|
||||
@@ -14,6 +16,7 @@ test("SSH network latency is explicit in every locale and UI surface", () => {
|
||||
const labels = [
|
||||
[enTerminalMessages, enSystemManagerMessages, "SSH network latency"],
|
||||
[ruTerminalMessages, ruSystemManagerMessages, "Сетевая задержка SSH"],
|
||||
[esTerminalMessages, esSystemManagerMessages, "Latencia de red SSH"],
|
||||
[zhCNVaultMessages, zhCnSystemManagerMessages, "SSH 网络延迟"],
|
||||
[zhTWVaultMessages, zhTwSystemManagerMessages, "SSH 網路延遲"],
|
||||
] as const;
|
||||
|
||||
@@ -5,10 +5,12 @@ import { DEFAULT_KEY_BINDINGS } from "../../../domain/models/keyBindings.ts";
|
||||
import { HOST_ICON_COLORS, HOST_ICON_IDS } from "../../../domain/hostIcon.ts";
|
||||
import zhCN from "./zh-CN.ts";
|
||||
import ru from "./ru.ts";
|
||||
import es from "./es.ts";
|
||||
|
||||
const LOCALIZED_SETTINGS_LOCALES = [
|
||||
{ name: "zh-CN", messages: zhCN },
|
||||
{ name: "ru", messages: ru },
|
||||
{ name: "es", messages: es },
|
||||
];
|
||||
|
||||
test("localized settings include names for every default shortcut", () => {
|
||||
|
||||
@@ -3,6 +3,7 @@ import test from 'node:test';
|
||||
|
||||
import en from './en.ts';
|
||||
import ru from './ru.ts';
|
||||
import es from './es.ts';
|
||||
import zhCN from './zh-CN.ts';
|
||||
import zhTW from './zh-TW.ts';
|
||||
|
||||
@@ -14,12 +15,23 @@ const KEYS = [
|
||||
] as const;
|
||||
|
||||
test('snippet bulk-delete copy exists in every locale', () => {
|
||||
for (const [locale, messages] of Object.entries({ en, ru, zhCN, zhTW })) {
|
||||
for (const [locale, messages] of Object.entries({ en, ru, es, zhCN, zhTW })) {
|
||||
const missing = KEYS.filter((key) => !messages[key]);
|
||||
assert.deepEqual(missing, [], `${locale} is missing snippet bulk-delete copy`);
|
||||
}
|
||||
});
|
||||
|
||||
test('snippet shortkey system-conflict copy names the conflicting action', () => {
|
||||
for (const [locale, messages] of Object.entries({ en, ru, es, zhCN, zhTW })) {
|
||||
const text = messages['snippets.shortkey.error.systemConflict'];
|
||||
assert.match(
|
||||
text ?? '',
|
||||
/\{name\}/,
|
||||
`${locale} system-conflict copy should include {name}`,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('English bulk-delete copy is entity-neutral and grammatical for one item', () => {
|
||||
assert.equal(
|
||||
en['snippets.selection.deleteConfirmTitle'].replace('{count}', '1'),
|
||||
|
||||
@@ -3,6 +3,7 @@ import test from 'node:test';
|
||||
|
||||
import en from './en';
|
||||
import ru from './ru';
|
||||
import es from './es';
|
||||
import zhCN from './zh-CN';
|
||||
import zhTW from './zh-TW';
|
||||
|
||||
@@ -14,7 +15,7 @@ const keys = [
|
||||
] as const;
|
||||
|
||||
test('terminal host management strings exist in every shipped locale', () => {
|
||||
for (const [locale, messages] of Object.entries({ en, 'zh-CN': zhCN, 'zh-TW': zhTW, ru })) {
|
||||
for (const [locale, messages] of Object.entries({ en, es, 'zh-CN': zhCN, 'zh-TW': zhTW, ru })) {
|
||||
for (const key of keys) {
|
||||
assert.equal(typeof messages[key], 'string', `${locale} is missing ${key}`);
|
||||
assert.notEqual(messages[key], '', `${locale} has an empty ${key}`);
|
||||
|
||||
@@ -3,6 +3,7 @@ import test from "node:test";
|
||||
|
||||
import en from "./en.ts";
|
||||
import ru from "./ru.ts";
|
||||
import es from "./es.ts";
|
||||
import zhCN from "./zh-CN.ts";
|
||||
import zhTW from "./zh-TW.ts";
|
||||
|
||||
@@ -29,6 +30,7 @@ const INLINE_IMAGE_KEYS = [
|
||||
|
||||
const LOCALES = [
|
||||
{ name: "en", messages: en },
|
||||
{ name: "es", messages: es },
|
||||
{ name: "zh-CN", messages: zhCN },
|
||||
{ name: "zh-TW", messages: zhTW },
|
||||
{ name: "ru", messages: ru },
|
||||
|
||||
@@ -3,6 +3,7 @@ import assert from "node:assert/strict";
|
||||
|
||||
import en from "./en.ts";
|
||||
import ru from "./ru.ts";
|
||||
import es from "./es.ts";
|
||||
import zhCN from "./zh-CN.ts";
|
||||
|
||||
const osc7Keys = [
|
||||
@@ -19,7 +20,7 @@ const osc7Keys = [
|
||||
] as const;
|
||||
|
||||
test("OSC 7 setup copy exists in every bundled locale", () => {
|
||||
for (const [locale, messages] of Object.entries({ en, ru, zhCN })) {
|
||||
for (const [locale, messages] of Object.entries({ en, ru, es, zhCN })) {
|
||||
for (const key of osc7Keys) {
|
||||
assert.equal(typeof messages[key], "string", `${locale} is missing ${key}`);
|
||||
assert.notEqual(messages[key], "", `${locale} has empty ${key}`);
|
||||
|
||||
@@ -3,6 +3,7 @@ import test from "node:test";
|
||||
|
||||
import en from "./en.ts";
|
||||
import ru from "./ru.ts";
|
||||
import es from "./es.ts";
|
||||
import zhCN from "./zh-CN.ts";
|
||||
import zhTW from "./zh-TW.ts";
|
||||
|
||||
@@ -26,7 +27,7 @@ const KEYS = [
|
||||
] as const;
|
||||
|
||||
test("bulk vault import and group-selection copy exists in every locale", () => {
|
||||
for (const [locale, messages] of Object.entries({ en, ru, zhCN, zhTW })) {
|
||||
for (const [locale, messages] of Object.entries({ en, ru, es, zhCN, zhTW })) {
|
||||
const missing = KEYS.filter((key) => !messages[key]);
|
||||
assert.deepEqual(missing, [], `${locale} is missing bulk vault labels`);
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ export const zhCNAiMessages: Messages = {
|
||||
'ai.providers.apiKey.placeholder': '输入 API Key',
|
||||
'ai.providers.apiKey.decrypting': '解密中...',
|
||||
'ai.providers.baseUrl': 'Base URL',
|
||||
'ai.providers.baseUrl.anthropicHelp': 'Anthropic 兼容:可填不带或带 /v1 的主机(例如 https://gateway.example 或 https://gateway.example/v1)。检测与聊天都会请求 /v1/models、/v1/messages。',
|
||||
'ai.providers.skipTLSVerify': '跳过 TLS 证书验证(用于自签名证书)',
|
||||
'ai.providers.defaultModel': '默认模型',
|
||||
'ai.providers.defaultModel.placeholder': '例如 gpt-4o, claude-sonnet-4-20250514',
|
||||
|
||||
@@ -170,6 +170,10 @@ export const zhCNCoreMessages: Messages = {
|
||||
|
||||
// Settings > Session Restore
|
||||
'settings.sessionRestore.title': '会话恢复',
|
||||
'settings.sessionRestore.startupLanding': '启动时打开',
|
||||
'settings.sessionRestore.startupLandingDesc': '当没有可恢复的会话时,选择启动后进入主机主页还是直接打开本地终端。',
|
||||
'settings.sessionRestore.startupLanding.vault': '主页(主机)',
|
||||
'settings.sessionRestore.startupLanding.localTerminal': '本地终端',
|
||||
'settings.sessionRestore.restorePreviousSession': '恢复上次的标签页和工作区',
|
||||
'settings.sessionRestore.restorePreviousSessionDesc': '启动时重新打开上次的终端标签页和工作区布局。',
|
||||
'settings.sessionRestore.restoreTerminalCwd': '恢复终端工作目录',
|
||||
|
||||
@@ -18,8 +18,11 @@ export const zhCNScriptsMessages = {
|
||||
'scripts.editor.modalSubtitle': '在更大的工作区中编辑脚本元数据和代码。',
|
||||
'scripts.editor.lineCount': '{count} 行',
|
||||
'scripts.editor.resize': '调整编辑器高度',
|
||||
'scripts.targets.hint': '自动触发作用于所选主机;勾选「对所有主机生效」则作用于全部可连接主机。',
|
||||
'scripts.targets.hint': '所选分组会动态匹配,之后加入分组的主机也会自动生效。',
|
||||
'scripts.targets.connectOrderHint': '连接脚本的执行顺序请在主机详情 → 自动化 中调整。',
|
||||
'scripts.targets.currentHostMismatch': '此脚本未分配给当前主机。',
|
||||
'hostDetails.automation.groupScripts': '分组继承脚本',
|
||||
'hostDetails.automation.groupScriptsHint': '这些脚本动态跟随主机所在分组,并在主机专属队列之前执行。',
|
||||
'scripts.actions.runNowHint': '在所选目标主机上运行;勾选「对所有主机生效」时在所有可连接主机上运行。',
|
||||
'scripts.actions.runParallel': '在所有标签页并行运行',
|
||||
'scripts.actions.runSequential': '在所有标签页顺序运行',
|
||||
|
||||
@@ -742,8 +742,11 @@ export const zhCNTerminalMessages: Messages = {
|
||||
'snippets.scriptEditor.expand': '弹窗编辑',
|
||||
'snippets.scriptEditor.resize': '调整编辑器高度',
|
||||
'snippets.scriptEditor.modalTitle': '编辑脚本',
|
||||
'snippets.targets.title': '目标主机',
|
||||
'snippets.targets.add': '添加目标主机',
|
||||
'snippets.targets.title': '执行目标',
|
||||
'snippets.targets.add': '添加目标',
|
||||
'snippets.targets.selectHosts': '选择主机',
|
||||
'snippets.targets.selectGroups': '选择分组',
|
||||
'snippets.targets.noGroups': '未找到分组',
|
||||
'snippets.targets.allHosts': '对所有主机生效',
|
||||
'snippets.targets.allHostsShort': '所有主机',
|
||||
'snippets.targets.allHostsActive': '将作用于所有可连接的主机。',
|
||||
@@ -830,7 +833,7 @@ export const zhCNTerminalMessages: Messages = {
|
||||
'snippets.shortkey.recording': '请按下快捷键组合...',
|
||||
'snippets.shortkey.hint': '在终端中按下此快捷键可快速发送命令。',
|
||||
'snippets.shortkey.clear': '清除快捷键',
|
||||
'snippets.shortkey.error.systemConflict': '此快捷键与系统快捷键冲突',
|
||||
'snippets.shortkey.error.systemConflict': '此快捷键与「{name}」冲突',
|
||||
'snippets.shortkey.error.snippetConflict': '此快捷键已被代码片段使用:{name}',
|
||||
|
||||
'snippets.variables.dialogTitle': '填写变量',
|
||||
|
||||
@@ -53,6 +53,7 @@ export const zhTWAiMessages: Messages = {
|
||||
'ai.providers.apiKey.placeholder': '輸入 API Key',
|
||||
'ai.providers.apiKey.decrypting': '解密中...',
|
||||
'ai.providers.baseUrl': 'Base URL',
|
||||
'ai.providers.baseUrl.anthropicHelp': 'Anthropic 相容:可填不帶或帶 /v1 的主機(例如 https://gateway.example 或 https://gateway.example/v1)。偵測與聊天都會請求 /v1/models、/v1/messages。',
|
||||
'ai.providers.skipTLSVerify': '跳過 TLS 憑證驗證(用於自我簽署憑證)',
|
||||
'ai.providers.defaultModel': '預設模型',
|
||||
'ai.providers.defaultModel.placeholder': '例如 gpt-4o, claude-sonnet-4-20250514',
|
||||
|
||||
@@ -170,6 +170,10 @@ export const zhTWCoreMessages: Messages = {
|
||||
|
||||
// Settings > Session Restore
|
||||
'settings.sessionRestore.title': '工作階段恢復',
|
||||
'settings.sessionRestore.startupLanding': '啟動時開啟',
|
||||
'settings.sessionRestore.startupLandingDesc': '當沒有可恢復的工作階段時,選擇啟動後進入主機主頁還是直接開啟本機終端。',
|
||||
'settings.sessionRestore.startupLanding.vault': '主頁(主機)',
|
||||
'settings.sessionRestore.startupLanding.localTerminal': '本機終端',
|
||||
'settings.sessionRestore.restorePreviousSession': '恢復上次的標籤頁和工作區',
|
||||
'settings.sessionRestore.restorePreviousSessionDesc': '啟動時重新開啟上次的終端標籤頁和工作區佈局。',
|
||||
'settings.sessionRestore.restoreTerminalCwd': '恢復終端工作目錄',
|
||||
|
||||
@@ -18,8 +18,11 @@ export const zhTWScriptsMessages = {
|
||||
'scripts.editor.modalSubtitle': '在更大的工作區中編輯指令碼的中繼資料與程式碼。',
|
||||
'scripts.editor.lineCount': '{count} 行',
|
||||
'scripts.editor.resize': '調整編輯器高度',
|
||||
'scripts.targets.hint': '自動觸發會作用於所選主機;勾選「對所有主機生效」則作用於全部可連線的主機。',
|
||||
'scripts.targets.hint': '所選分組會動態比對,之後加入分組的主機也會自動生效。',
|
||||
'scripts.targets.connectOrderHint': '連線指令碼的執行順序請在主機詳情 → 自動化 中調整。',
|
||||
'scripts.targets.currentHostMismatch': '此指令碼未分配給目前主機。',
|
||||
'hostDetails.automation.groupScripts': '分組繼承指令碼',
|
||||
'hostDetails.automation.groupScriptsHint': '這些指令碼會動態跟隨主機所在分組,並在主機專屬佇列之前執行。',
|
||||
'scripts.actions.runNowHint': '在所選目標主機上執行;勾選「對所有主機生效」時在所有可連線的主機上執行。',
|
||||
'scripts.actions.runParallel': '在所有標籤頁並行執行',
|
||||
'scripts.actions.runSequential': '在所有標籤頁依序執行',
|
||||
|
||||
@@ -739,8 +739,11 @@ export const zhTWTerminalMessages: Messages = {
|
||||
'snippets.scriptEditor.expand': '彈出視窗編輯',
|
||||
'snippets.scriptEditor.resize': '調整編輯器高度',
|
||||
'snippets.scriptEditor.modalTitle': '編輯指令碼',
|
||||
'snippets.targets.title': '目標主機',
|
||||
'snippets.targets.add': '新增目標主機',
|
||||
'snippets.targets.title': '執行目標',
|
||||
'snippets.targets.add': '新增目標',
|
||||
'snippets.targets.selectHosts': '選擇主機',
|
||||
'snippets.targets.selectGroups': '選擇分組',
|
||||
'snippets.targets.noGroups': '未找到分組',
|
||||
'snippets.history.title': 'Shell 歷史',
|
||||
'snippets.history.subtitle': '{count} 條指令',
|
||||
'snippets.history.emptyTitle': '暫無 Shell 歷史',
|
||||
@@ -830,7 +833,7 @@ export const zhTWTerminalMessages: Messages = {
|
||||
'snippets.shortkey.recording': '請按下快捷鍵組合...',
|
||||
'snippets.shortkey.hint': '在終端中按下此快捷鍵可快速傳送指令。',
|
||||
'snippets.shortkey.clear': '清除快捷鍵',
|
||||
'snippets.shortkey.error.systemConflict': '此快捷鍵與系統快捷鍵衝突',
|
||||
'snippets.shortkey.error.systemConflict': '此快捷鍵與「{name}」衝突',
|
||||
'snippets.shortkey.error.snippetConflict': '此快捷鍵已被程式碼片段使用:{name}',
|
||||
|
||||
'snippets.variables.dialogTitle': '填寫變數',
|
||||
|
||||
@@ -2,6 +2,7 @@ import en, { type Messages } from './locales/en';
|
||||
import zhCN from './locales/zh-CN';
|
||||
import zhTW from './locales/zh-TW';
|
||||
import ru from './locales/ru';
|
||||
import es from './locales/es';
|
||||
|
||||
// Keep keys stable; add new locales by adding another import and map entry.
|
||||
export { type Messages };
|
||||
@@ -9,6 +10,7 @@ export { type Messages };
|
||||
export const MESSAGES_BY_LOCALE: Record<string, Messages> = {
|
||||
en,
|
||||
ru,
|
||||
es,
|
||||
'zh-CN': zhCN,
|
||||
'zh-TW': zhTW,
|
||||
};
|
||||
|
||||
@@ -18,8 +18,103 @@ import {
|
||||
setDraftView,
|
||||
setSessionView,
|
||||
updateDraftForScope,
|
||||
draftsByScopeEqualIgnoringComposerText,
|
||||
draftsByScopeEqualIgnoringAllComposerText,
|
||||
} from "./aiDraftState.ts";
|
||||
|
||||
test("draftsByScopeEqualIgnoringComposerText ignores typing in the active scope", () => {
|
||||
const base = createEmptyDraft("catty");
|
||||
const prev = { "terminal:1": { ...base, text: "" } };
|
||||
const next = { "terminal:1": { ...base, text: "你好", updatedAt: base.updatedAt + 1 } };
|
||||
assert.equal(draftsByScopeEqualIgnoringComposerText(prev, next, "terminal:1"), true);
|
||||
assert.equal(
|
||||
draftsByScopeEqualIgnoringComposerText(
|
||||
prev,
|
||||
{ "terminal:1": { ...base, text: "你好", attachments: [{ id: "a" } as never] } },
|
||||
"terminal:1",
|
||||
),
|
||||
false,
|
||||
);
|
||||
assert.equal(
|
||||
draftsByScopeEqualIgnoringComposerText(
|
||||
prev,
|
||||
{ "terminal:1": prev["terminal:1"], "workspace:2": base },
|
||||
"terminal:1",
|
||||
),
|
||||
true,
|
||||
);
|
||||
assert.equal(
|
||||
draftsByScopeEqualIgnoringComposerText(
|
||||
prev,
|
||||
{
|
||||
"terminal:1": prev["terminal:1"],
|
||||
"workspace:2": { ...base, attachments: [{ id: "a" } as never] },
|
||||
},
|
||||
"terminal:1",
|
||||
),
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
test("first composer draft is treated as text-only identity churn", () => {
|
||||
const empty = createEmptyDraft("catty");
|
||||
const created = { ...empty, text: "你" };
|
||||
assert.equal(draftsByScopeEqualIgnoringAllComposerText({}, { "terminal:1": empty }), false);
|
||||
assert.equal(draftsByScopeEqualIgnoringAllComposerText({}, { "terminal:1": created }), true);
|
||||
assert.equal(
|
||||
draftsByScopeEqualIgnoringComposerText({}, { "terminal:1": created }, "terminal:1"),
|
||||
true,
|
||||
);
|
||||
assert.equal(
|
||||
draftsByScopeEqualIgnoringAllComposerText(
|
||||
{ "terminal:1": empty },
|
||||
{ "terminal:1": created },
|
||||
),
|
||||
true,
|
||||
);
|
||||
assert.equal(
|
||||
draftsByScopeEqualIgnoringAllComposerText(
|
||||
{ "terminal:1": created },
|
||||
{ "terminal:1": empty },
|
||||
),
|
||||
false,
|
||||
);
|
||||
assert.equal(
|
||||
draftsByScopeEqualIgnoringAllComposerText(
|
||||
{},
|
||||
{ "terminal:1": { ...created, attachments: [{ id: "a" } as never] } },
|
||||
),
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
test("draftsByScopeEqualIgnoringAllComposerText ignores typing in every scope", () => {
|
||||
const base = createEmptyDraft("catty");
|
||||
const prev = {
|
||||
"terminal:1": { ...base, text: "a" },
|
||||
"terminal:2": { ...base, text: "b", attachments: [] },
|
||||
};
|
||||
const next = {
|
||||
"terminal:1": { ...prev["terminal:1"], text: "aa", updatedAt: base.updatedAt + 1 },
|
||||
"terminal:2": { ...prev["terminal:2"], text: "bb", updatedAt: base.updatedAt + 2 },
|
||||
};
|
||||
assert.equal(draftsByScopeEqualIgnoringAllComposerText(prev, next), true);
|
||||
assert.equal(
|
||||
draftsByScopeEqualIgnoringAllComposerText(prev, {
|
||||
...next,
|
||||
"terminal:2": { ...next["terminal:2"], attachments: [{ id: "a" } as never] },
|
||||
}),
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
test("updateDraftForScope keeps the original map when the updater is a no-op", () => {
|
||||
const draft = createEmptyDraft("catty");
|
||||
const prev = { "terminal:1": draft };
|
||||
const next = updateDraftForScope(prev, "terminal:1", "catty", (current) => current);
|
||||
assert.equal(next, prev);
|
||||
});
|
||||
|
||||
test("createEmptyDraft seeds selected agent and empty inputs", () => {
|
||||
const draft = createEmptyDraft("agent-alpha");
|
||||
|
||||
|
||||
@@ -11,6 +11,65 @@ type DraftUploadGenerationByScope = Record<string, number>;
|
||||
|
||||
const DEFAULT_PANEL_VIEW: AIPanelView = { mode: 'draft' };
|
||||
|
||||
function isComposerOnlyDraft(draft: AIDraft | undefined): boolean {
|
||||
return Boolean(
|
||||
draft
|
||||
&& draft.attachments.length === 0
|
||||
&& draft.selectedUserSkillSlugs.length === 0,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* First keystroke creates a missing → composer-only draft. That is still just
|
||||
* typing. Clearing a draft (`right` missing or emptied) is a real lifecycle
|
||||
* change so New Chat / send can reset the uncontrolled composer.
|
||||
*/
|
||||
function draftsEquivalentIgnoringComposerText(
|
||||
left: AIDraft | undefined,
|
||||
right: AIDraft | undefined,
|
||||
): boolean {
|
||||
if (left === right) return true;
|
||||
if (!left) return Boolean(isComposerOnlyDraft(right) && right.text.trim().length > 0);
|
||||
if (!right) return false;
|
||||
if (left.agentId !== right.agentId) return false;
|
||||
if (left.attachments !== right.attachments) return false;
|
||||
if (left.selectedUserSkillSlugs !== right.selectedUserSkillSlugs) return false;
|
||||
const leftEmpty = left.text.trim().length === 0;
|
||||
const rightEmpty = right.text.trim().length === 0;
|
||||
if (leftEmpty !== rightEmpty) return leftEmpty;
|
||||
return true;
|
||||
}
|
||||
|
||||
/** True when every scope is unchanged except composer text/updatedAt. */
|
||||
export function draftsByScopeEqualIgnoringAllComposerText(
|
||||
prev: DraftsByScope,
|
||||
next: DraftsByScope,
|
||||
): boolean {
|
||||
if (prev === next) return true;
|
||||
const keys = new Set([...Object.keys(prev), ...Object.keys(next)]);
|
||||
for (const key of keys) {
|
||||
if (!draftsEquivalentIgnoringComposerText(prev[key], next[key])) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Typing only changes text/updatedAt. Sibling empty-draft creates stay ignored. */
|
||||
export function draftsByScopeEqualIgnoringComposerText(
|
||||
prev: DraftsByScope,
|
||||
next: DraftsByScope,
|
||||
scopeKey: string,
|
||||
): boolean {
|
||||
if (prev === next) return true;
|
||||
const keys = new Set([...Object.keys(prev), ...Object.keys(next)]);
|
||||
for (const key of keys) {
|
||||
const left = prev[key];
|
||||
const right = next[key];
|
||||
if (key !== scopeKey && !left && isComposerOnlyDraft(right)) continue;
|
||||
if (!draftsEquivalentIgnoringComposerText(left, right)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
export function createEmptyDraft(agentId: string): AIDraft {
|
||||
return {
|
||||
text: '',
|
||||
@@ -142,6 +201,9 @@ export function updateDraftForScope(
|
||||
): DraftsByScope {
|
||||
const currentDraft = draftsByScope[scopeKey] ?? createEmptyDraft(fallbackAgentId);
|
||||
const nextDraft = updater(currentDraft);
|
||||
if (nextDraft === currentDraft && draftsByScope[scopeKey] === currentDraft) {
|
||||
return draftsByScope;
|
||||
}
|
||||
|
||||
return {
|
||||
...draftsByScope,
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
|
||||
import { createEmptyDraft } from './aiDraftState.ts';
|
||||
import { aiSessionsStore } from './aiSessionsStore.ts';
|
||||
|
||||
test('AI sessions store does not notify listeners when only composer text changes', () => {
|
||||
const previous = aiSessionsStore.getSnapshot();
|
||||
const draft = createEmptyDraft('catty');
|
||||
const base = {
|
||||
sessions: Object.freeze([]),
|
||||
activeSessionIdMap: Object.freeze({}),
|
||||
draftsByScope: { 'terminal:1': draft },
|
||||
panelViewByScope: {},
|
||||
};
|
||||
|
||||
try {
|
||||
aiSessionsStore.setSnapshot(base);
|
||||
|
||||
let notified = 0;
|
||||
const unsubscribe = aiSessionsStore.subscribe(() => {
|
||||
notified += 1;
|
||||
});
|
||||
|
||||
aiSessionsStore.setSnapshot({
|
||||
...base,
|
||||
draftsByScope: {
|
||||
'terminal:1': { ...draft, text: 'hello', updatedAt: draft.updatedAt + 1 },
|
||||
},
|
||||
});
|
||||
assert.equal(notified, 0);
|
||||
assert.equal(aiSessionsStore.getSnapshot().draftsByScope['terminal:1']?.text, 'hello');
|
||||
|
||||
aiSessionsStore.setSnapshot({
|
||||
...base,
|
||||
draftsByScope: {},
|
||||
});
|
||||
notified = 0;
|
||||
aiSessionsStore.setSnapshot({
|
||||
...base,
|
||||
draftsByScope: {
|
||||
'terminal:1': { ...draft, text: '你好' },
|
||||
},
|
||||
});
|
||||
assert.equal(notified, 0);
|
||||
|
||||
notified = 0;
|
||||
aiSessionsStore.setSnapshot({
|
||||
...base,
|
||||
draftsByScope: {
|
||||
'terminal:1': { ...draft, text: '' },
|
||||
},
|
||||
});
|
||||
assert.equal(notified, 1);
|
||||
|
||||
notified = 0;
|
||||
aiSessionsStore.setSnapshot({
|
||||
...base,
|
||||
draftsByScope: {
|
||||
'terminal:1': { ...draft, text: 'hello', attachments: [{ id: 'a' } as never] },
|
||||
},
|
||||
});
|
||||
assert.equal(notified, 1);
|
||||
unsubscribe();
|
||||
} finally {
|
||||
aiSessionsStore.setSnapshot(previous);
|
||||
}
|
||||
});
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useSyncExternalStore } from 'react';
|
||||
|
||||
import type { AISession } from '../../infrastructure/ai/types';
|
||||
import { draftsByScopeEqualIgnoringAllComposerText } from './aiDraftState';
|
||||
import type { DraftsByScope, PanelViewByScope } from './aiStateSnapshots';
|
||||
|
||||
type Listener = () => void;
|
||||
@@ -50,7 +51,16 @@ class AISessionsStore {
|
||||
) {
|
||||
return;
|
||||
}
|
||||
const textOnlyDraftChange =
|
||||
this.snapshot.sessions === next.sessions
|
||||
&& this.snapshot.activeSessionIdMap === next.activeSessionIdMap
|
||||
&& this.snapshot.panelViewByScope === next.panelViewByScope
|
||||
&& draftsByScopeEqualIgnoringAllComposerText(
|
||||
this.snapshot.draftsByScope,
|
||||
next.draftsByScope,
|
||||
);
|
||||
this.snapshot = next;
|
||||
if (textOnlyDraftChange) return;
|
||||
for (const listener of this.listeners) {
|
||||
listener();
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ test("restore-only settings do not bump the cloud sync settings version", () =>
|
||||
const settingsVersionSource = settingsSource.slice(settingsVersionIndex);
|
||||
|
||||
assert.notEqual(settingsVersionIndex, -1);
|
||||
assert.doesNotMatch(settingsVersionSource, /restorePreviousSession|restoreTerminalCwd/);
|
||||
assert.doesNotMatch(settingsVersionSource, /restorePreviousSession|restoreTerminalCwd|startupLanding/);
|
||||
});
|
||||
|
||||
test("restore previous session re-arms after cross-window settings ipc sync", () => {
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
STORAGE_KEY_DISABLE_TERMINAL_FONT_ZOOM,
|
||||
STORAGE_KEY_RESTORE_PREVIOUS_SESSION,
|
||||
STORAGE_KEY_RESTORE_TERMINAL_CWD,
|
||||
STORAGE_KEY_STARTUP_LANDING,
|
||||
STORAGE_KEY_SESSION_LOGS_DIR,
|
||||
STORAGE_KEY_SESSION_LOGS_ENABLED,
|
||||
STORAGE_KEY_SESSION_LOGS_FORMAT,
|
||||
@@ -60,6 +61,7 @@ import {
|
||||
migrateIncomingTerminalFontId,
|
||||
} from './settingsStateDefaults';
|
||||
import { isTerminalSidePanelAutoOpenTab, type TerminalSidePanelAutoOpenTab } from '../../domain/terminalSidePanelAutoOpen';
|
||||
import { isStartupLanding, type StartupLanding } from '../../domain/startupLanding';
|
||||
import type { AppearanceSyncEvent } from './appearanceSync';
|
||||
|
||||
interface UseSettingsIpcSyncParams {
|
||||
@@ -102,6 +104,7 @@ interface UseSettingsIpcSyncParams {
|
||||
setDisableTerminalFontZoomState: Dispatch<SetStateAction<boolean>>;
|
||||
setRestorePreviousSessionState: Dispatch<SetStateAction<boolean>>;
|
||||
setRestoreTerminalCwdState: Dispatch<SetStateAction<boolean>>;
|
||||
setStartupLandingState: Dispatch<SetStateAction<StartupLanding>>;
|
||||
setSftpTransferConcurrencyState: Dispatch<SetStateAction<number>>;
|
||||
setSshTransportIdleTtlMsState: Dispatch<SetStateAction<number>>;
|
||||
}
|
||||
@@ -146,6 +149,7 @@ export function useSettingsIpcSync({
|
||||
setDisableTerminalFontZoomState,
|
||||
setRestorePreviousSessionState,
|
||||
setRestoreTerminalCwdState,
|
||||
setStartupLandingState,
|
||||
setSftpTransferConcurrencyState,
|
||||
setSshTransportIdleTtlMsState,
|
||||
}: UseSettingsIpcSyncParams) {
|
||||
@@ -304,6 +308,9 @@ export function useSettingsIpcSync({
|
||||
if (key === STORAGE_KEY_RESTORE_TERMINAL_CWD && typeof value === 'boolean') {
|
||||
setRestoreTerminalCwdState((prev) => (prev === value ? prev : value));
|
||||
}
|
||||
if (key === STORAGE_KEY_STARTUP_LANDING && isStartupLanding(value)) {
|
||||
setStartupLandingState((prev) => (prev === value ? prev : value));
|
||||
}
|
||||
if (key === STORAGE_KEY_SFTP_TRANSFER_CONCURRENCY && typeof value === 'number') {
|
||||
setSftpTransferConcurrencyState((prev) => (prev === value ? prev : value));
|
||||
}
|
||||
@@ -348,6 +355,7 @@ export function useSettingsIpcSync({
|
||||
setDisableTerminalFontZoomState,
|
||||
setRestorePreviousSessionState,
|
||||
setRestoreTerminalCwdState,
|
||||
setStartupLandingState,
|
||||
setSftpTransferConcurrencyState,
|
||||
setSshTransportIdleTtlMsState,
|
||||
setTerminalFontFamilyId,
|
||||
|
||||
@@ -85,6 +85,8 @@ export const DEFAULT_SHELL_ONLY_TAB_NUMBER_SHORTCUTS = false;
|
||||
export const DEFAULT_SHOW_TAB_NUMBER_BADGES = true;
|
||||
export const DEFAULT_DISABLE_TERMINAL_FONT_ZOOM = false;
|
||||
export { DEFAULT_RESTORE_PREVIOUS_SESSION } from './sessionRestoreSettings';
|
||||
export { DEFAULT_STARTUP_LANDING } from '../../domain/startupLanding';
|
||||
export type { StartupLanding } from '../../domain/startupLanding';
|
||||
|
||||
// Editor defaults
|
||||
export const DEFAULT_EDITOR_WORD_WRAP = false;
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
STORAGE_KEY_EXPLORER_CONTEXT_MENU_ENABLED,
|
||||
STORAGE_KEY_RESTORE_PREVIOUS_SESSION,
|
||||
STORAGE_KEY_RESTORE_TERMINAL_CWD,
|
||||
STORAGE_KEY_STARTUP_LANDING,
|
||||
STORAGE_KEY_SFTP_AUTO_OPEN_SIDEBAR,
|
||||
STORAGE_KEY_SFTP_FOLLOW_TERMINAL_CWD,
|
||||
STORAGE_KEY_SFTP_AUTO_SYNC,
|
||||
@@ -60,6 +61,7 @@ import {
|
||||
} from './settingsStateDefaults';
|
||||
import { isTerminalSidePanelAutoOpenTab, type TerminalSidePanelAutoOpenTab } from '../../domain/terminalSidePanelAutoOpen';
|
||||
import { isHostClickBehavior, type HostClickBehavior } from '../../domain/hostClickBehavior';
|
||||
import { isStartupLanding, type StartupLanding } from '../../domain/startupLanding';
|
||||
|
||||
interface UseSettingsStorageSyncParams {
|
||||
enabled?: boolean;
|
||||
@@ -97,6 +99,7 @@ interface UseSettingsStorageSyncParams {
|
||||
disableTerminalFontZoom: boolean;
|
||||
restorePreviousSession: boolean;
|
||||
restoreTerminalCwd: boolean;
|
||||
startupLanding: StartupLanding;
|
||||
editorWordWrap: boolean;
|
||||
sessionLogsEnabled: boolean;
|
||||
sessionLogsDir: string;
|
||||
@@ -145,6 +148,7 @@ interface UseSettingsStorageSyncParams {
|
||||
setDisableTerminalFontZoomState: Dispatch<SetStateAction<boolean>>;
|
||||
setRestorePreviousSessionState: Dispatch<SetStateAction<boolean>>;
|
||||
setRestoreTerminalCwdState: Dispatch<SetStateAction<boolean>>;
|
||||
setStartupLandingState: Dispatch<SetStateAction<StartupLanding>>;
|
||||
setEditorWordWrapState: Dispatch<SetStateAction<boolean>>;
|
||||
setSessionLogsEnabled: Dispatch<SetStateAction<boolean>>;
|
||||
setSessionLogsDir: Dispatch<SetStateAction<string>>;
|
||||
@@ -172,7 +176,7 @@ export function useSettingsStorageSync({
|
||||
terminalThemeId, followAppTerminalTheme, terminalFontFamilyId, terminalFontSize,
|
||||
sftpDoubleClickBehavior, sftpAutoSync, sftpShowHiddenFiles,
|
||||
sftpUseCompressedUpload, sftpSkipUnchanged, sftpAutoOpenSidebar, sftpFollowTerminalCwd, sftpDefaultViewMode,
|
||||
showRecentHosts, hostClickBehavior, showOnlyUngroupedHostsInRoot, showSftpTab, showHostTreeSidebar, terminalSidePanelAutoOpen, terminalSidePanelAutoOpenTab, shellOnlyTabNumberShortcuts, showTabNumberBadges, disableTerminalFontZoom, restorePreviousSession, restoreTerminalCwd,
|
||||
showRecentHosts, hostClickBehavior, showOnlyUngroupedHostsInRoot, showSftpTab, showHostTreeSidebar, terminalSidePanelAutoOpen, terminalSidePanelAutoOpenTab, shellOnlyTabNumberShortcuts, showTabNumberBadges, disableTerminalFontZoom, restorePreviousSession, restoreTerminalCwd, startupLanding,
|
||||
editorWordWrap, sessionLogsEnabled, sessionLogsDir, sessionLogsFormat, sessionLogsTimestampsEnabled, sshDebugLogsEnabled, sshDeepLinkEnabled, jmsDeepLinkEnabled, explorerContextMenuEnabled,
|
||||
globalHotkeyEnabled, autoUpdateEnabled, windowOpacity, appIconVariant,
|
||||
setTheme, setLightUiThemeId, setDarkUiThemeId, setAccentMode, applyIncomingCustomAccent,
|
||||
@@ -181,7 +185,7 @@ export function useSettingsStorageSync({
|
||||
setFollowAppTerminalThemeState, setTerminalFontFamilyId, setTerminalFontSize,
|
||||
setSftpDoubleClickBehavior, setSftpAutoSync, setSftpShowHiddenFiles,
|
||||
setSftpUseCompressedUpload, setSftpSkipUnchanged, setSftpAutoOpenSidebar, setSftpFollowTerminalCwd, setSftpDefaultViewMode,
|
||||
setShowRecentHostsState, setHostClickBehaviorState, setShowOnlyUngroupedHostsInRootState, setShowSftpTabState, setShowHostTreeSidebarState, setTerminalSidePanelAutoOpenState, setTerminalSidePanelAutoOpenTabState, setShellOnlyTabNumberShortcutsState, setShowTabNumberBadgesState, setDisableTerminalFontZoomState, setRestorePreviousSessionState, setRestoreTerminalCwdState,
|
||||
setShowRecentHostsState, setHostClickBehaviorState, setShowOnlyUngroupedHostsInRootState, setShowSftpTabState, setShowHostTreeSidebarState, setTerminalSidePanelAutoOpenState, setTerminalSidePanelAutoOpenTabState, setShellOnlyTabNumberShortcutsState, setShowTabNumberBadgesState, setDisableTerminalFontZoomState, setRestorePreviousSessionState, setRestoreTerminalCwdState, setStartupLandingState,
|
||||
setEditorWordWrapState, setSessionLogsEnabled, setSessionLogsDir, setSessionLogsFormat, setSessionLogsTimestampsEnabled, setSshDebugLogsEnabled, setSshDeepLinkEnabledState, setJmsDeepLinkEnabledState, setExplorerContextMenuEnabledState,
|
||||
setGlobalHotkeyEnabled, setWindowOpacity, setAppIconVariant, setAutoUpdateEnabled, setWorkspaceFocusStyleState,
|
||||
setSftpTransferConcurrencyState, setSshTransportIdleTtlMsState,
|
||||
@@ -196,7 +200,7 @@ export function useSettingsStorageSync({
|
||||
terminalThemeId, followAppTerminalTheme, terminalFontFamilyId, terminalFontSize,
|
||||
sftpDoubleClickBehavior, sftpAutoSync, sftpShowHiddenFiles,
|
||||
sftpUseCompressedUpload, sftpSkipUnchanged, sftpAutoOpenSidebar, sftpFollowTerminalCwd, sftpDefaultViewMode,
|
||||
showRecentHosts, hostClickBehavior, showOnlyUngroupedHostsInRoot, showSftpTab, showHostTreeSidebar, terminalSidePanelAutoOpen, terminalSidePanelAutoOpenTab, shellOnlyTabNumberShortcuts, showTabNumberBadges, disableTerminalFontZoom, restorePreviousSession, restoreTerminalCwd,
|
||||
showRecentHosts, hostClickBehavior, showOnlyUngroupedHostsInRoot, showSftpTab, showHostTreeSidebar, terminalSidePanelAutoOpen, terminalSidePanelAutoOpenTab, shellOnlyTabNumberShortcuts, showTabNumberBadges, disableTerminalFontZoom, restorePreviousSession, restoreTerminalCwd, startupLanding,
|
||||
editorWordWrap, sessionLogsEnabled, sessionLogsDir, sessionLogsFormat, sessionLogsTimestampsEnabled, sshDebugLogsEnabled, sshDeepLinkEnabled, jmsDeepLinkEnabled, explorerContextMenuEnabled,
|
||||
globalHotkeyEnabled, autoUpdateEnabled, windowOpacity, appIconVariant,
|
||||
});
|
||||
@@ -206,7 +210,7 @@ export function useSettingsStorageSync({
|
||||
terminalThemeId, followAppTerminalTheme, terminalFontFamilyId, terminalFontSize,
|
||||
sftpDoubleClickBehavior, sftpAutoSync, sftpShowHiddenFiles,
|
||||
sftpUseCompressedUpload, sftpSkipUnchanged, sftpAutoOpenSidebar, sftpFollowTerminalCwd, sftpDefaultViewMode,
|
||||
showRecentHosts, hostClickBehavior, showOnlyUngroupedHostsInRoot, showSftpTab, showHostTreeSidebar, terminalSidePanelAutoOpen, terminalSidePanelAutoOpenTab, shellOnlyTabNumberShortcuts, showTabNumberBadges, disableTerminalFontZoom, restorePreviousSession, restoreTerminalCwd,
|
||||
showRecentHosts, hostClickBehavior, showOnlyUngroupedHostsInRoot, showSftpTab, showHostTreeSidebar, terminalSidePanelAutoOpen, terminalSidePanelAutoOpenTab, shellOnlyTabNumberShortcuts, showTabNumberBadges, disableTerminalFontZoom, restorePreviousSession, restoreTerminalCwd, startupLanding,
|
||||
editorWordWrap, sessionLogsEnabled, sessionLogsDir, sessionLogsFormat, sessionLogsTimestampsEnabled, sshDebugLogsEnabled, sshDeepLinkEnabled, jmsDeepLinkEnabled, explorerContextMenuEnabled,
|
||||
globalHotkeyEnabled, autoUpdateEnabled, windowOpacity, appIconVariant,
|
||||
};
|
||||
@@ -480,6 +484,11 @@ export function useSettingsStorageSync({
|
||||
setRestoreTerminalCwdState(newValue);
|
||||
}
|
||||
}
|
||||
if (e.key === STORAGE_KEY_STARTUP_LANDING && e.newValue !== null) {
|
||||
if (isStartupLanding(e.newValue) && e.newValue !== s.startupLanding) {
|
||||
setStartupLandingState(e.newValue);
|
||||
}
|
||||
}
|
||||
// Sync global hotkey enabled setting from other windows
|
||||
if (e.key === STORAGE_KEY_GLOBAL_HOTKEY_ENABLED && e.newValue !== null) {
|
||||
const newValue = e.newValue === 'true';
|
||||
@@ -568,9 +577,11 @@ export function useSettingsStorageSync({
|
||||
setShowRecentHostsState,
|
||||
setShowSftpTabState,
|
||||
setShellOnlyTabNumberShortcutsState,
|
||||
setShowTabNumberBadgesState,
|
||||
setDisableTerminalFontZoomState,
|
||||
setRestorePreviousSessionState,
|
||||
setRestoreTerminalCwdState,
|
||||
setStartupLandingState,
|
||||
setTerminalFontFamilyId,
|
||||
setTerminalFontSize,
|
||||
setTerminalThemeDarkId,
|
||||
|
||||
@@ -162,7 +162,6 @@ export async function openTransferSftpSession(
|
||||
if (
|
||||
!wantDedicated
|
||||
&& options?.sourceSessionId
|
||||
&& !host.sftpSudo
|
||||
&& bridge.openSftpForSession
|
||||
) {
|
||||
try {
|
||||
|
||||
@@ -2,7 +2,7 @@ import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import type { Host } from "../../../domain/models";
|
||||
import { ensureRemoteSftpSession } from "./ensureRemoteSftpSession";
|
||||
import { ensureRemoteSftpSession, probeSftpSession } from "./ensureRemoteSftpSession";
|
||||
import type { SftpPane } from "./types";
|
||||
|
||||
const host = {
|
||||
@@ -37,6 +37,24 @@ const remotePane = (connectionId: string): SftpPane => ({
|
||||
|
||||
const noopReleaseConnection = async () => {};
|
||||
|
||||
test("SFTP session probe accepts a virtual root directory", async () => {
|
||||
const calls: Array<[string, string]> = [];
|
||||
const ok = await probeSftpSession({
|
||||
realpathSftp: async (sftpId, remotePath) => {
|
||||
calls.push([sftpId, remotePath]);
|
||||
return "/";
|
||||
},
|
||||
}, "sftp-jumpserver");
|
||||
|
||||
assert.equal(ok, true);
|
||||
assert.deepEqual(calls, [["sftp-jumpserver", "."]]);
|
||||
});
|
||||
|
||||
test("SFTP session probe does not require home discovery", async () => {
|
||||
const ok = await probeSftpSession(undefined, "sftp-live");
|
||||
assert.equal(ok, true);
|
||||
});
|
||||
|
||||
test("returns an existing mapped SFTP session without reconnecting", async () => {
|
||||
let connectCalls = 0;
|
||||
const sftpId = await ensureRemoteSftpSession({
|
||||
|
||||
@@ -3,6 +3,24 @@ import type { MutableRefObject } from "react";
|
||||
import { isSessionError } from "./errors";
|
||||
import type { SftpPane } from "./types";
|
||||
|
||||
export interface SftpSessionProbeBridge {
|
||||
realpathSftp?: (sftpId: string, path: string) => Promise<string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Probe the SFTP protocol itself instead of using remote home discovery.
|
||||
* Restricted/chroot servers can deny SSH exec or expose '/' as their virtual
|
||||
* root while the SFTP session remains fully usable.
|
||||
*/
|
||||
export async function probeSftpSession(
|
||||
bridge: SftpSessionProbeBridge | null | undefined,
|
||||
sftpId: string,
|
||||
): Promise<boolean> {
|
||||
if (!bridge?.realpathSftp) return true;
|
||||
await bridge.realpathSftp(sftpId, ".");
|
||||
return true;
|
||||
}
|
||||
|
||||
export interface EnsureRemoteSftpSessionParams {
|
||||
side: "left" | "right";
|
||||
getActivePane: (side: "left" | "right") => SftpPane | null;
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import { isMissingStatError } from "./errors";
|
||||
|
||||
test("isMissingStatError accepts only true path absence codes", () => {
|
||||
for (const code of [2, "ENOENT", "NO_SUCH_FILE", "SSH_FX_NO_SUCH_FILE"] as const) {
|
||||
const error = new Error("missing") as Error & { code: string | number };
|
||||
error.code = code;
|
||||
assert.equal(isMissingStatError(error), true, String(code));
|
||||
}
|
||||
assert.equal(isMissingStatError(new Error("ENOENT")), true);
|
||||
});
|
||||
|
||||
test("isMissingStatError treats Electron-wrapped SFTP absence as missing", () => {
|
||||
// ipcRenderer.invoke strips custom `code` and wraps the ssh2 message.
|
||||
// New-file uploads lstat the destination first; this is the toast users see.
|
||||
assert.equal(
|
||||
isMissingStatError(
|
||||
new Error("Error invoking remote method 'netcatty:sftp:lstat': Error: No such file"),
|
||||
),
|
||||
true,
|
||||
);
|
||||
assert.equal(isMissingStatError(new Error("No such file")), true);
|
||||
assert.equal(isMissingStatError(new Error("No such file or directory")), true);
|
||||
assert.equal(isMissingStatError(new Error("No such file: /tmp/tool.sh")), true);
|
||||
assert.equal(
|
||||
isMissingStatError(new Error("ENOENT: no such file or directory, lstat '/tmp/tool.sh'")),
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
test("isMissingStatError rejects unsupported LSTAT and other failures", () => {
|
||||
const enotsup = new Error("Remote server does not support LSTAT") as Error & {
|
||||
code: string;
|
||||
lstatUnavailable: boolean;
|
||||
};
|
||||
enotsup.code = "ENOTSUP";
|
||||
enotsup.lstatUnavailable = true;
|
||||
assert.equal(isMissingStatError(enotsup), false);
|
||||
|
||||
const eperm = new Error("denied") as Error & { code: string };
|
||||
eperm.code = "EPERM";
|
||||
assert.equal(isMissingStatError(eperm), false);
|
||||
assert.equal(isMissingStatError(new Error("channel closed")), false);
|
||||
assert.equal(
|
||||
isMissingStatError(
|
||||
new Error("Error invoking remote method 'netcatty:sftp:lstat': Error: Permission denied"),
|
||||
),
|
||||
false,
|
||||
);
|
||||
// Path names are user-controlled; do not treat a substring hit as absence.
|
||||
assert.equal(
|
||||
isMissingStatError(
|
||||
new Error("EACCES: permission denied, lstat '/private/enoent/report.txt'"),
|
||||
),
|
||||
false,
|
||||
);
|
||||
assert.equal(
|
||||
isMissingStatError(
|
||||
new Error(
|
||||
"Error invoking remote method 'netcatty:sftp:lstat': Error: EACCES: permission denied, lstat '/private/enoent/report.txt'",
|
||||
),
|
||||
),
|
||||
false,
|
||||
);
|
||||
});
|
||||
@@ -17,3 +17,5 @@ export const isSessionError = (err: unknown): boolean => {
|
||||
msg.includes("timed out")
|
||||
);
|
||||
};
|
||||
|
||||
export { isMissingStatError } from "../../../domain/sftpStatError";
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useCallback } from "react";
|
||||
import type { SftpFilenameEncoding, TransferTask } from "../../../domain/models";
|
||||
import { netcattyBridge } from "../../../infrastructure/services/netcattyBridge";
|
||||
import { isMissingStatError } from "./errors";
|
||||
import type { SftpPane } from "./types";
|
||||
import { getParentPath, joinPath } from "./utils";
|
||||
|
||||
@@ -24,28 +25,36 @@ export function useSftpTransferConflictOps() {
|
||||
): Promise<{ type?: "file" | "directory" | "symlink"; size: number; mtime: number } | null> => {
|
||||
if (!targetPane.connection) return null;
|
||||
|
||||
if (targetPane.connection.isLocal) {
|
||||
const stat = await netcattyBridge.get()?.statLocal?.(targetPath);
|
||||
try {
|
||||
if (targetPane.connection.isLocal) {
|
||||
const bridge = netcattyBridge.get();
|
||||
const stat = await (bridge?.lstatLocal ?? bridge?.statLocal)?.(targetPath);
|
||||
if (!stat) return null;
|
||||
return {
|
||||
type: stat.type as "file" | "directory" | "symlink" | undefined,
|
||||
size: stat.size,
|
||||
mtime: stat.lastModified || Date.now(),
|
||||
};
|
||||
}
|
||||
|
||||
if (!targetSftpId) return null;
|
||||
const bridge = netcattyBridge.get();
|
||||
const stat = await (bridge?.lstatSftp ?? bridge?.statSftp)?.(
|
||||
targetSftpId,
|
||||
targetPath,
|
||||
targetEncoding,
|
||||
);
|
||||
if (!stat) return null;
|
||||
return {
|
||||
type: stat.type as "file" | "directory" | "symlink" | undefined,
|
||||
size: stat.size,
|
||||
mtime: stat.lastModified || Date.now(),
|
||||
};
|
||||
} catch (error) {
|
||||
// Missing path = no conflict. ENOTSUP / unknown type must fail closed.
|
||||
if (isMissingStatError(error)) return null;
|
||||
throw error;
|
||||
}
|
||||
|
||||
if (!targetSftpId) return null;
|
||||
const stat = await netcattyBridge.get()?.statSftp?.(
|
||||
targetSftpId,
|
||||
targetPath,
|
||||
targetEncoding,
|
||||
);
|
||||
if (!stat) return null;
|
||||
return {
|
||||
type: stat.type as "file" | "directory" | "symlink" | undefined,
|
||||
size: stat.size,
|
||||
mtime: stat.lastModified || Date.now(),
|
||||
};
|
||||
},
|
||||
[],
|
||||
);
|
||||
@@ -64,12 +73,9 @@ export function useSftpTransferConflictOps() {
|
||||
const suffix = index === 1 ? " (copy)" : ` (copy ${index})`;
|
||||
const fileName = `${baseName}${suffix}${ext}`;
|
||||
const targetPath = joinPath(parentPath, fileName);
|
||||
try {
|
||||
const existing = await statTargetPath(targetPane, targetSftpId, targetPath, targetEncoding);
|
||||
if (!existing) return { fileName, targetPath };
|
||||
} catch {
|
||||
return { fileName, targetPath };
|
||||
}
|
||||
// Unsupported LSTAT must propagate — do not treat as a free name.
|
||||
const existing = await statTargetPath(targetPane, targetSftpId, targetPath, targetEncoding);
|
||||
if (!existing) return { fileName, targetPath };
|
||||
}
|
||||
|
||||
const fallbackName = `${baseName} (copy ${Date.now()})${ext}`;
|
||||
@@ -84,18 +90,19 @@ export function useSftpTransferConflictOps() {
|
||||
targetPane: SftpPane,
|
||||
targetSftpId: string | null,
|
||||
targetEncoding: SftpFilenameEncoding,
|
||||
expectedType?: "file" | "directory" | "symlink",
|
||||
) => {
|
||||
if (!targetPane.connection) return;
|
||||
if (targetPane.connection.isLocal) {
|
||||
const deleteLocalFile = netcattyBridge.get()?.deleteLocalFile;
|
||||
if (!deleteLocalFile) throw new Error("Local delete unavailable");
|
||||
await deleteLocalFile(task.targetPath);
|
||||
await deleteLocalFile(task.targetPath, expectedType);
|
||||
return;
|
||||
}
|
||||
if (!targetSftpId) throw new Error("Target SFTP session not found");
|
||||
const deleteSftp = netcattyBridge.get()?.deleteSftp;
|
||||
if (!deleteSftp) throw new Error("SFTP delete unavailable");
|
||||
await deleteSftp(targetSftpId, task.targetPath, targetEncoding);
|
||||
await deleteSftp(targetSftpId, task.targetPath, targetEncoding, expectedType);
|
||||
},
|
||||
[],
|
||||
);
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
|
||||
import {
|
||||
buildSftpConnectInFlightKey,
|
||||
buildSftpHomeDirCandidates,
|
||||
runSftpConnectOnceByKey,
|
||||
createSftpConnectionId,
|
||||
createPinnedReconnectSideResolver,
|
||||
openSftpConnectionOnce,
|
||||
@@ -15,12 +19,62 @@ import {
|
||||
resolvePinnedReconnectSide,
|
||||
} from "./useSftpConnections.ts";
|
||||
|
||||
test("home dir candidates prefer user home then root", () => {
|
||||
assert.deepEqual(buildSftpHomeDirCandidates("deploy"), ["/home/deploy", "/root"]);
|
||||
assert.deepEqual(buildSftpHomeDirCandidates("root"), ["/root"]);
|
||||
assert.deepEqual(buildSftpHomeDirCandidates(undefined), ["/root"]);
|
||||
assert.deepEqual(buildSftpHomeDirCandidates(null), ["/root"]);
|
||||
});
|
||||
|
||||
test("connection ids stay unique even when connects start in the same millisecond", () => {
|
||||
const ids = ["uuid-a", "uuid-b"];
|
||||
assert.equal(createSftpConnectionId("left", () => ids.shift()!), "left-uuid-a");
|
||||
assert.equal(createSftpConnectionId("left", () => ids.shift()!), "left-uuid-b");
|
||||
});
|
||||
|
||||
test("runSftpConnectOnceByKey shares an in-flight connect for the same tab and endpoint", async () => {
|
||||
const inFlight = new Map<string, Promise<void>>();
|
||||
let runs = 0;
|
||||
let releaseFirst: (() => void) | undefined;
|
||||
|
||||
const first = runSftpConnectOnceByKey(inFlight, "left:tab-1:host-key:ssh-session-1:/home", async () => {
|
||||
runs += 1;
|
||||
await new Promise<void>((resolve) => {
|
||||
releaseFirst = resolve;
|
||||
});
|
||||
});
|
||||
const second = runSftpConnectOnceByKey(inFlight, "left:tab-1:host-key:ssh-session-1:/home", async () => {
|
||||
runs += 1;
|
||||
});
|
||||
|
||||
assert.equal(runs, 1);
|
||||
releaseFirst?.();
|
||||
await Promise.all([first, second]);
|
||||
assert.equal(runs, 1);
|
||||
assert.equal(inFlight.size, 0);
|
||||
});
|
||||
|
||||
test("buildSftpConnectInFlightKey uses the allocated tab id for forced new tabs", () => {
|
||||
const first = buildSftpConnectInFlightKey({
|
||||
side: "left",
|
||||
tabId: "new-tab-a",
|
||||
targetConnectionKey: "host-key",
|
||||
sourceSessionId: "ssh-session-1",
|
||||
initialPath: "/home",
|
||||
forceNewTab: true,
|
||||
});
|
||||
const second = buildSftpConnectInFlightKey({
|
||||
side: "left",
|
||||
tabId: "new-tab-b",
|
||||
targetConnectionKey: "host-key",
|
||||
sourceSessionId: "ssh-session-1",
|
||||
initialPath: "/home",
|
||||
forceNewTab: true,
|
||||
});
|
||||
|
||||
assert.notEqual(first, second);
|
||||
});
|
||||
|
||||
const openOptions = {
|
||||
sessionId: "sftp-request-1",
|
||||
hostname: "192.168.9.138",
|
||||
@@ -73,6 +127,43 @@ test("openSftpWithSessionPreference falls back to normal SFTP when session reuse
|
||||
assert.deepEqual(calls, ["openForSession:ssh-session-1", "openSftp:sftp-request-1"]);
|
||||
});
|
||||
|
||||
test("openSftpWithSessionPreference tries session reuse for sudo SFTP before fresh auth", async () => {
|
||||
const calls: string[] = [];
|
||||
let passedOptions: NetcattySSHOptions | undefined;
|
||||
const sftpId = await openSftpWithSessionPreference({
|
||||
bridge: {
|
||||
openSftpForSession: async (sessionId: string, options?: NetcattySSHOptions) => {
|
||||
calls.push(`openForSession:${sessionId}`);
|
||||
passedOptions = options;
|
||||
return "sudo-session-backed-sftp";
|
||||
},
|
||||
openSftp: async () => {
|
||||
calls.push("openSftp");
|
||||
return "fresh-sftp";
|
||||
},
|
||||
},
|
||||
sourceSessionId: "ssh-session-1",
|
||||
openOptions: {
|
||||
...openOptions,
|
||||
sudo: true,
|
||||
password: "sudo-pass",
|
||||
},
|
||||
});
|
||||
|
||||
assert.equal(sftpId, "sudo-session-backed-sftp");
|
||||
assert.deepEqual(calls, ["openForSession:ssh-session-1"]);
|
||||
assert.equal(passedOptions?.sudo, true);
|
||||
assert.equal(passedOptions?.password, "sudo-pass");
|
||||
});
|
||||
|
||||
test("remote browse connect does not discard sourceSessionId for sudo hosts", () => {
|
||||
const source = readFileSync(new URL("./useSftpConnections.ts", import.meta.url), "utf8");
|
||||
assert.doesNotMatch(
|
||||
source,
|
||||
/host\.sftpSudo\s*\?\s*undefined\s*:\s*options\?\.sourceSessionId/,
|
||||
);
|
||||
});
|
||||
|
||||
test("openSftpWithSessionPreference opens normal SFTP without a source session", async () => {
|
||||
const calls: string[] = [];
|
||||
const sftpId = await openSftpWithSessionPreference({
|
||||
|
||||
@@ -97,6 +97,13 @@ export async function releaseSftpConnectionMetadata(params: {
|
||||
params.onRemoteSessionClosed?.(sftpId);
|
||||
}
|
||||
|
||||
/** Hardcoded home-path candidates when SSH exec / listable realpath fail. */
|
||||
export function buildSftpHomeDirCandidates(username?: string | null): string[] {
|
||||
if (username === "root") return ["/root"];
|
||||
if (username) return [`/home/${username}`, "/root"];
|
||||
return ["/root"];
|
||||
}
|
||||
|
||||
export function createSftpConnectionId(
|
||||
side: "left" | "right",
|
||||
randomUUID: () => string = () => crypto.randomUUID(),
|
||||
@@ -176,6 +183,41 @@ export function createPinnedReconnectSideResolver(
|
||||
};
|
||||
}
|
||||
|
||||
export function runSftpConnectOnceByKey(
|
||||
inFlight: Map<string, Promise<void>>,
|
||||
key: string,
|
||||
run: () => Promise<void>,
|
||||
): Promise<void> {
|
||||
const existing = inFlight.get(key);
|
||||
if (existing) return existing;
|
||||
|
||||
const promise = run().finally(() => {
|
||||
if (inFlight.get(key) === promise) {
|
||||
inFlight.delete(key);
|
||||
}
|
||||
});
|
||||
inFlight.set(key, promise);
|
||||
return promise;
|
||||
}
|
||||
|
||||
export function buildSftpConnectInFlightKey(params: {
|
||||
side: "left" | "right";
|
||||
tabId: string;
|
||||
targetConnectionKey: string;
|
||||
sourceSessionId?: string;
|
||||
initialPath?: string;
|
||||
forceNewTab?: boolean;
|
||||
}): string {
|
||||
return [
|
||||
params.side,
|
||||
params.tabId,
|
||||
params.targetConnectionKey,
|
||||
params.sourceSessionId ?? "",
|
||||
params.initialPath ?? "",
|
||||
params.forceNewTab ? "force-new-tab" : "",
|
||||
].join("\u0000");
|
||||
}
|
||||
|
||||
interface UseSftpConnectionsResult {
|
||||
connect: (side: "left" | "right", host: Host | "local", options?: SftpConnectOptions) => Promise<void>;
|
||||
disconnect: (side: "left" | "right") => Promise<void>;
|
||||
@@ -249,6 +291,7 @@ export const useSftpConnections = ({
|
||||
const [hostKeyVerification, setHostKeyVerification] = useState<SftpHostKeyVerificationState | null>(null);
|
||||
const hostKeyVerificationRef = useRef<(SftpHostKeyVerificationState & { requestId: string; sessionId: string }) | null>(null);
|
||||
const activeHostKeySessionsRef = useRef<Map<string, { side: "left" | "right"; tabId: string }>>(new Map());
|
||||
const connectInFlightRef = useRef<Map<string, Promise<void>>>(new Map());
|
||||
|
||||
const setPendingHostKeyVerification = useCallback((
|
||||
next: (SftpHostKeyVerificationState & { requestId: string; sessionId: string }) | null,
|
||||
@@ -426,21 +469,31 @@ export const useSftpConnections = ({
|
||||
// immediately, avoiding race conditions with deferred effects.
|
||||
options?.onTabCreated?.(activeTabId);
|
||||
|
||||
const connectionId = createSftpConnectionId(side);
|
||||
const connectInFlightKey = buildSftpConnectInFlightKey({
|
||||
side,
|
||||
tabId: activeTabId,
|
||||
targetConnectionKey,
|
||||
sourceSessionId: host === "local" ? undefined : options?.sourceSessionId,
|
||||
initialPath: effectiveInitialPath,
|
||||
forceNewTab: options?.forceNewTab,
|
||||
});
|
||||
|
||||
navSeqRef.current[side] += 1;
|
||||
const connectRequestId = navSeqRef.current[side];
|
||||
const getTargetPane = () => {
|
||||
const targetSide = resolveTargetSide();
|
||||
const tabs = targetSide === "left" ? leftTabsRef.current.tabs : rightTabsRef.current.tabs;
|
||||
return tabs.find((tab) => tab.id === activeTabId) ?? null;
|
||||
};
|
||||
const isTargetConnectionCurrent = () => {
|
||||
const pane = getTargetPane();
|
||||
if (!pane) return false;
|
||||
if (pane.connection?.id === connectionId) return true;
|
||||
return !pane.connection && navSeqRef.current[side] === connectRequestId;
|
||||
};
|
||||
return runSftpConnectOnceByKey(connectInFlightRef.current, connectInFlightKey, async () => {
|
||||
const connectionId = createSftpConnectionId(side);
|
||||
|
||||
navSeqRef.current[side] += 1;
|
||||
const connectRequestId = navSeqRef.current[side];
|
||||
const getTargetPane = () => {
|
||||
const targetSide = resolveTargetSide();
|
||||
const tabs = targetSide === "left" ? leftTabsRef.current.tabs : rightTabsRef.current.tabs;
|
||||
return tabs.find((tab) => tab.id === activeTabId) ?? null;
|
||||
};
|
||||
const isTargetConnectionCurrent = () => {
|
||||
const pane = getTargetPane();
|
||||
if (!pane) return false;
|
||||
if (pane.connection?.id === connectionId) return true;
|
||||
return !pane.connection && navSeqRef.current[side] === connectRequestId;
|
||||
};
|
||||
const isTargetConnectionAtPath = (path: string) => {
|
||||
const connection = getTargetPane()?.connection;
|
||||
if (!connection) return navSeqRef.current[side] === connectRequestId;
|
||||
@@ -573,9 +626,7 @@ export const useSftpConnections = ({
|
||||
sharedHostCache?.path,
|
||||
);
|
||||
|
||||
// Sudo never reuses a terminal shell; normalize before UI state so
|
||||
// reusedConnection (spinner/overlay) matches the actual open path.
|
||||
const sourceSessionId = host.sftpSudo ? undefined : options?.sourceSessionId;
|
||||
const sourceSessionId = options?.sourceSessionId;
|
||||
|
||||
const connection: SftpConnection = {
|
||||
id: connectionId,
|
||||
@@ -698,15 +749,7 @@ export const useSftpConnections = ({
|
||||
}
|
||||
|
||||
if (!detected) {
|
||||
const candidates: string[] = [];
|
||||
if (credentials.username === "root") {
|
||||
candidates.push("/root");
|
||||
} else if (credentials.username) {
|
||||
candidates.push(`/home/${credentials.username}`);
|
||||
candidates.push("/root");
|
||||
} else {
|
||||
candidates.push("/root");
|
||||
}
|
||||
const candidates = buildSftpHomeDirCandidates(credentials.username);
|
||||
const statSftp = bridge?.statSftp;
|
||||
if (statSftp) {
|
||||
for (const candidate of candidates) {
|
||||
@@ -784,6 +827,23 @@ export const useSftpConnections = ({
|
||||
// root also failed
|
||||
}
|
||||
}
|
||||
// Last resort: home candidates. Covers provisional "/" from realpath
|
||||
// when discovery treated root as home and listing it failed, so
|
||||
// /home/<user> or /root can still recover the session.
|
||||
if (!fallbackSucceeded) {
|
||||
for (const candidate of buildSftpHomeDirCandidates(credentials.username)) {
|
||||
if (candidate === startPath) continue;
|
||||
try {
|
||||
files = await listRemoteFiles(sftpId, candidate, filenameEncoding);
|
||||
startPath = candidate;
|
||||
homeDir = candidate;
|
||||
fallbackSucceeded = true;
|
||||
break;
|
||||
} catch {
|
||||
// Ignore missing/permission errors
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!fallbackSucceeded) {
|
||||
throw new Error("Cannot list any remote directory");
|
||||
}
|
||||
@@ -855,6 +915,7 @@ export const useSftpConnections = ({
|
||||
unsubSftpProgress?.();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
[
|
||||
|
||||
@@ -842,6 +842,9 @@ export const useSftpExternalOperations = (
|
||||
writeLocalFile: bridge?.writeLocalFile,
|
||||
mkdirLocal: bridge?.mkdirLocal,
|
||||
statLocal: bridge?.statLocal,
|
||||
// No-follow stats so Replace unlinks a same-named symlink instead of
|
||||
// writing through it (uploadService prefers lstat* over followed stat*).
|
||||
lstatLocal: bridge?.lstatLocal,
|
||||
deleteLocalFile: bridge?.deleteLocalFile,
|
||||
stageUploadFile: bridge?.stageUploadFile,
|
||||
cancelStagedUploadFile: bridge?.cancelStagedUploadFile,
|
||||
@@ -857,10 +860,18 @@ export const useSftpExternalOperations = (
|
||||
if (!b?.statSftp) return null;
|
||||
return b.statSftp(sftpId, path);
|
||||
},
|
||||
deleteSftp: async (sftpId: string, path: string) => {
|
||||
// Only wire when present so uploadService can fall back via `lstat ?? stat`.
|
||||
lstatSftp: bridge?.lstatSftp
|
||||
? async (sftpId: string, path: string) => {
|
||||
const b = netcattyBridge.get();
|
||||
if (!b?.lstatSftp) return null;
|
||||
return b.lstatSftp(sftpId, path);
|
||||
}
|
||||
: undefined,
|
||||
deleteSftp: async (sftpId: string, path: string, expectedType) => {
|
||||
const b = netcattyBridge.get();
|
||||
if (b?.deleteSftp) {
|
||||
await b.deleteSftp(sftpId, path);
|
||||
await b.deleteSftp(sftpId, path, undefined, expectedType);
|
||||
}
|
||||
},
|
||||
// Stream transfer for large files (avoids loading into memory).
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
describeSftpExistingKind,
|
||||
describeSftpIncomingKind,
|
||||
getSftpConflictTypeKey,
|
||||
shouldUnlinkSftpConflictBeforeReplace,
|
||||
} from "../../../domain/sftpConflict";
|
||||
import {
|
||||
findActivePathConflict,
|
||||
@@ -23,6 +24,7 @@ import { netcattyBridge } from "../../../infrastructure/services/netcattyBridge"
|
||||
import { logger } from "../../../lib/logger";
|
||||
import { sftpTransferCenterStore } from "../sftpTransferCenterStore";
|
||||
import { SftpPane } from "./types";
|
||||
import { isMissingStatError } from "./errors";
|
||||
import { useSftpDirectoryTransferOps } from "./transferDirectoryOps";
|
||||
import { useSftpTransferConflictOps } from "./transferConflictOps";
|
||||
import { useSftpTransferTaskOps } from "./transferTaskOps";
|
||||
@@ -444,7 +446,7 @@ export const useSftpTransfers = ({
|
||||
cleanupTaskArtifacts,
|
||||
});
|
||||
|
||||
const { statTargetPath, getDuplicateTarget } = useSftpTransferConflictOps();
|
||||
const { statTargetPath, getDuplicateTarget, deleteTargetPath } = useSftpTransferConflictOps();
|
||||
|
||||
const { transferFile, transferDirectory } = useSftpDirectoryTransferOps({
|
||||
ownerId,
|
||||
@@ -740,8 +742,10 @@ export const useSftpTransfers = ({
|
||||
newModified: sourceStat?.mtime || Date.now(),
|
||||
};
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
} catch (error) {
|
||||
// Missing path = no conflict. ENOTSUP / unknown type fail closed.
|
||||
if (isMissingStatError(error)) return null;
|
||||
throw error;
|
||||
}
|
||||
return null;
|
||||
})();
|
||||
@@ -783,6 +787,13 @@ export const useSftpTransfers = ({
|
||||
return "failed";
|
||||
}
|
||||
|
||||
if (
|
||||
defaultAction === "replace"
|
||||
&& shouldUnlinkSftpConflictBeforeReplace(conflict.existingType)
|
||||
) {
|
||||
await deleteTargetPath(task, targetPane, targetSftpId, targetEncoding, "symlink");
|
||||
}
|
||||
|
||||
const duplicateTarget = defaultAction === "duplicate"
|
||||
? await getDuplicateTarget(task, targetPane, targetSftpId, targetEncoding)
|
||||
: null;
|
||||
@@ -1537,6 +1548,7 @@ export const useSftpTransfers = ({
|
||||
|
||||
const updatedTasks: TransferTask[] = [];
|
||||
const blockedReplaceTasks: Array<{ task: TransferTask; conflict: FileConflict }> = [];
|
||||
const failedReplaceTasks: Array<{ task: TransferTask; error: string }> = [];
|
||||
|
||||
for (const affectedTask of affectedTasks) {
|
||||
if (cancelledTasksRef.current.has(affectedTask.id)) continue;
|
||||
@@ -1568,6 +1580,34 @@ export const useSftpTransfers = ({
|
||||
blockedReplaceTasks.push({ task: affectedTask, conflict: affectedConflict });
|
||||
continue;
|
||||
}
|
||||
if (
|
||||
affectedConflict
|
||||
&& shouldUnlinkSftpConflictBeforeReplace(affectedConflict.existingType)
|
||||
) {
|
||||
const endpoints = resolveTaskEndpoints(affectedTask);
|
||||
if (!endpoints?.targetPane.connection) continue;
|
||||
const targetSftpId = endpoints.targetPane.connection.isLocal
|
||||
? null
|
||||
: sftpSessionsRef.current.get(endpoints.targetPane.connection.id) ?? null;
|
||||
const targetEncoding = endpoints.targetPane.connection.isLocal
|
||||
? "auto"
|
||||
: endpoints.targetPane.filenameEncoding || "auto";
|
||||
try {
|
||||
await deleteTargetPath(
|
||||
affectedTask,
|
||||
endpoints.targetPane,
|
||||
targetSftpId,
|
||||
targetEncoding,
|
||||
"symlink",
|
||||
);
|
||||
} catch (error) {
|
||||
failedReplaceTasks.push({
|
||||
task: affectedTask,
|
||||
error: error instanceof Error ? error.message : String(error),
|
||||
});
|
||||
continue;
|
||||
}
|
||||
}
|
||||
updatedTask = {
|
||||
...affectedTask,
|
||||
skipConflictCheck: true,
|
||||
@@ -1607,6 +1647,24 @@ export const useSftpTransfers = ({
|
||||
);
|
||||
}
|
||||
|
||||
if (failedReplaceTasks.length > 0) {
|
||||
const failedErrors = new Map(
|
||||
failedReplaceTasks.map(({ task: failedTask, error }) => [failedTask.id, error]),
|
||||
);
|
||||
setTransfers((prev) =>
|
||||
prev.map((candidate) => failedErrors.has(candidate.id)
|
||||
? {
|
||||
...candidate,
|
||||
status: "failed" as TransferStatus,
|
||||
endTime: Date.now(),
|
||||
error: failedErrors.get(candidate.id),
|
||||
conflict: undefined,
|
||||
}
|
||||
: candidate,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
const liveUpdatedTasks = updatedTasks.filter((candidate) => !cancelledTasksRef.current.has(candidate.id));
|
||||
const updatedTaskMap = new Map(liveUpdatedTasks.map((updatedTask) => [updatedTask.id, updatedTask]));
|
||||
setTransfers((prev) =>
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
|
||||
test("startup landing setting participates in cross-window settings sync", () => {
|
||||
const storageSyncSource = readFileSync(new URL("./settingsStorageSync.ts", import.meta.url), "utf8");
|
||||
const ipcSyncSource = readFileSync(new URL("./settingsIpcSync.ts", import.meta.url), "utf8");
|
||||
|
||||
assert.match(storageSyncSource, /STORAGE_KEY_STARTUP_LANDING/);
|
||||
assert.match(storageSyncSource, /setStartupLandingState/);
|
||||
assert.match(storageSyncSource, /e\.key === STORAGE_KEY_STARTUP_LANDING/);
|
||||
|
||||
assert.match(ipcSyncSource, /STORAGE_KEY_STARTUP_LANDING/);
|
||||
assert.match(ipcSyncSource, /setStartupLandingState/);
|
||||
assert.match(ipcSyncSource, /key === STORAGE_KEY_STARTUP_LANDING/);
|
||||
});
|
||||
|
||||
test("startup landing does not bump the cloud sync settings version", () => {
|
||||
const settingsSource = readFileSync(new URL("./useSettingsState.ts", import.meta.url), "utf8");
|
||||
const settingsVersionIndex = settingsSource.indexOf("settingsVersion: useMemo");
|
||||
const settingsVersionSource = settingsSource.slice(settingsVersionIndex);
|
||||
|
||||
assert.notEqual(settingsVersionIndex, -1);
|
||||
assert.doesNotMatch(settingsVersionSource, /startupLanding/);
|
||||
});
|
||||
|
||||
test("main window opens local terminal on cold start when preferred", () => {
|
||||
const sideEffectsSource = readFileSync(new URL("../app/AppSideEffects.tsx", import.meta.url), "utf8");
|
||||
|
||||
assert.match(sideEffectsSource, /startupLocalTerminalAttemptedRef/);
|
||||
assert.match(sideEffectsSource, /shouldOpenLocalTerminalOnStartup/);
|
||||
assert.match(sideEffectsSource, /STORAGE_KEY_STARTUP_LANDING/);
|
||||
assert.match(sideEffectsSource, /handleCreateLocalTerminal\(/);
|
||||
assert.match(sideEffectsSource, /onColdStartIntentsSettled/);
|
||||
assert.match(sideEffectsSource, /ensureDiscoveredShells/);
|
||||
assert.match(sideEffectsSource, /hasQueuedStartupIntent:\s*startupLaunchIntentReceivedRef\.current/);
|
||||
|
||||
const latchAt = sideEffectsSource.indexOf("if (startupLocalTerminalAttemptedRef.current) return;");
|
||||
const setLatchAt = sideEffectsSource.indexOf(
|
||||
"startupLocalTerminalAttemptedRef.current = true;",
|
||||
latchAt,
|
||||
);
|
||||
const createAt = sideEffectsSource.indexOf("handleCreateLocalTerminal(", setLatchAt);
|
||||
assert.notEqual(latchAt, -1);
|
||||
assert.notEqual(setLatchAt, -1);
|
||||
assert.notEqual(createAt, -1);
|
||||
assert.ok(setLatchAt < createAt, "StrictMode latch must be set before creating the terminal");
|
||||
});
|
||||
|
||||
test("settings system tab exposes startup landing control", () => {
|
||||
const tabSource = readFileSync(
|
||||
new URL("../../components/settings/tabs/SettingsSystemTab.tsx", import.meta.url),
|
||||
"utf8",
|
||||
);
|
||||
assert.match(tabSource, /system-startup-landing/);
|
||||
assert.match(tabSource, /settings\.sessionRestore\.startupLanding/);
|
||||
assert.match(tabSource, /local-terminal/);
|
||||
});
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
canReuseTerminalConnection,
|
||||
createCopiedTerminalSessionClone,
|
||||
createSplitTerminalSessionClone,
|
||||
isTerminalSessionEligibleForSftpReuse,
|
||||
} from "./terminalConnectionReuse";
|
||||
|
||||
const session = (overrides: Partial<TerminalSession> = {}): TerminalSession => ({
|
||||
@@ -24,6 +25,14 @@ test("connected SSH sessions can reuse their authenticated connection", () => {
|
||||
assert.equal(canReuseTerminalConnection(session({ protocol: undefined })), true);
|
||||
});
|
||||
|
||||
test("SSH sessions stay SFTP-linkable while reconnecting", () => {
|
||||
assert.equal(isTerminalSessionEligibleForSftpReuse(session({ status: "connecting" })), true);
|
||||
assert.equal(isTerminalSessionEligibleForSftpReuse(session({ status: "disconnected" })), true);
|
||||
assert.equal(isTerminalSessionEligibleForSftpReuse(session({ protocol: "local" })), false);
|
||||
assert.equal(isTerminalSessionEligibleForSftpReuse(session({ moshEnabled: true })), false);
|
||||
assert.equal(isTerminalSessionEligibleForSftpReuse(session({ etEnabled: true })), false);
|
||||
});
|
||||
|
||||
test("non-SSH or unavailable sessions do not reuse a connection", () => {
|
||||
assert.equal(canReuseTerminalConnection(session({ status: "connecting" })), false);
|
||||
assert.equal(canReuseTerminalConnection(session({ status: "disconnected" })), false);
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
import type { TerminalSession } from "../../domain/models";
|
||||
|
||||
export function canReuseTerminalConnection(session: TerminalSession): boolean {
|
||||
/** SSH (non-mosh/et) sessions that can back SFTP once the transport is up. */
|
||||
export function isTerminalSessionEligibleForSftpReuse(session: TerminalSession): boolean {
|
||||
return (
|
||||
(session.protocol === "ssh" || session.protocol === undefined) &&
|
||||
!session.moshEnabled &&
|
||||
!session.etEnabled &&
|
||||
session.status === "connected"
|
||||
(session.protocol === "ssh" || session.protocol === undefined)
|
||||
&& !session.moshEnabled
|
||||
&& !session.etEnabled
|
||||
);
|
||||
}
|
||||
|
||||
export function canReuseTerminalConnection(session: TerminalSession): boolean {
|
||||
return isTerminalSessionEligibleForSftpReuse(session) && session.status === "connected";
|
||||
}
|
||||
|
||||
type CloneSessionOptions = {
|
||||
id: string;
|
||||
localShellType?: TerminalSession["shellType"];
|
||||
|
||||
@@ -490,6 +490,374 @@ test("does not replace an existing directory when uploading a same-named file",
|
||||
assert.match(results[0].error ?? "", /directory/i);
|
||||
});
|
||||
|
||||
test("file replace leaves the remote destination so upload can restore mode bits", async () => {
|
||||
// Deleting before overwrite recreates the inode with umask defaults and drops
|
||||
// bits like +x (#2954). Keep the target so stage+rename can restore mode.
|
||||
const file = new File(["new-bytes"], "tool.sh", { lastModified: 1234 });
|
||||
Object.defineProperty(file, "path", { value: "/local/tool.sh" });
|
||||
const deletedPaths: string[] = [];
|
||||
const deletedTypes: Array<string | undefined> = [];
|
||||
const uploadedPaths: string[] = [];
|
||||
|
||||
const results = await uploadFromFileList(
|
||||
[file],
|
||||
{
|
||||
targetPath: "/usr/local/bin",
|
||||
sftpId: "sftp-1",
|
||||
isLocal: false,
|
||||
bridge: {
|
||||
mkdirSftp: async () => {},
|
||||
statSftp: async (_sftpId, path) =>
|
||||
path === "/usr/local/bin/tool.sh"
|
||||
? { type: "file", size: 9, lastModified: 1000 }
|
||||
: null,
|
||||
deleteSftp: async (_sftpId, path, expectedType) => {
|
||||
deletedPaths.push(path);
|
||||
deletedTypes.push(expectedType);
|
||||
},
|
||||
startStreamTransfer: async ({ targetPath: path }) => {
|
||||
uploadedPaths.push(path);
|
||||
return { transferId: "upload-1" };
|
||||
},
|
||||
},
|
||||
joinPath: (base, name) => `${base}/${name}`,
|
||||
resolveConflict: async () => "replace",
|
||||
},
|
||||
);
|
||||
|
||||
assert.deepEqual(deletedPaths, [], "file replace must not delete before upload");
|
||||
assert.deepEqual(uploadedPaths, ["/usr/local/bin/tool.sh"]);
|
||||
assert.equal(results.length, 1);
|
||||
assert.equal(results[0].success, true);
|
||||
});
|
||||
|
||||
test("file replace unlinks an existing symlink before upload", async () => {
|
||||
// Leaving the symlink would let in-place upload follow it and overwrite the
|
||||
// link target outside the displayed directory.
|
||||
// Conflict checks use lstatSftp so Replace unlinks the link first.
|
||||
const file = new File(["new-bytes"], "tool.sh", { lastModified: 1234 });
|
||||
Object.defineProperty(file, "path", { value: "/local/tool.sh" });
|
||||
const deletedPaths: string[] = [];
|
||||
const deletedTypes: Array<string | undefined> = [];
|
||||
const uploadedPaths: string[] = [];
|
||||
|
||||
const results = await uploadFromFileList(
|
||||
[file],
|
||||
{
|
||||
targetPath: "/usr/local/bin",
|
||||
sftpId: "sftp-1",
|
||||
isLocal: false,
|
||||
bridge: {
|
||||
mkdirSftp: async () => {},
|
||||
// Followed stat would report type "file" and skip pre-delete.
|
||||
statSftp: async () => ({ type: "file", size: 4096, lastModified: 1000 }),
|
||||
lstatSftp: async (_sftpId, path) =>
|
||||
path === "/usr/local/bin/tool.sh"
|
||||
? { type: "symlink", size: 12, lastModified: 1000 }
|
||||
: null,
|
||||
deleteSftp: async (_sftpId, path, expectedType) => {
|
||||
deletedPaths.push(path);
|
||||
deletedTypes.push(expectedType);
|
||||
},
|
||||
startStreamTransfer: async ({ targetPath: path }) => {
|
||||
uploadedPaths.push(path);
|
||||
return { transferId: "upload-1" };
|
||||
},
|
||||
},
|
||||
joinPath: (base, name) => `${base}/${name}`,
|
||||
resolveConflict: async () => "replace",
|
||||
},
|
||||
);
|
||||
|
||||
assert.deepEqual(deletedPaths, ["/usr/local/bin/tool.sh"]);
|
||||
assert.deepEqual(deletedTypes, ["symlink"]);
|
||||
assert.deepEqual(uploadedPaths, ["/usr/local/bin/tool.sh"]);
|
||||
assert.equal(results.length, 1);
|
||||
assert.equal(results[0].success, true);
|
||||
});
|
||||
|
||||
test("LSTAT ENOTSUP is not treated as an absent destination during conflict check", async () => {
|
||||
// If unsupported LSTAT is swallowed as "missing", upload skips Replace and may
|
||||
// write through an existing symlink to a target outside the displayed dir.
|
||||
const file = new File(["new-bytes"], "tool.sh", { lastModified: 1234 });
|
||||
Object.defineProperty(file, "path", { value: "/local/tool.sh" });
|
||||
let uploaded = 0;
|
||||
let conflictPrompts = 0;
|
||||
|
||||
await assert.rejects(
|
||||
() => uploadFromFileList(
|
||||
[file],
|
||||
{
|
||||
targetPath: "/usr/local/bin",
|
||||
sftpId: "sftp-1",
|
||||
isLocal: false,
|
||||
bridge: {
|
||||
mkdirSftp: async () => {},
|
||||
lstatSftp: async () => {
|
||||
const error = new Error(
|
||||
"Remote server does not support LSTAT; cannot classify path without following symlinks",
|
||||
) as Error & { code: string; lstatUnavailable: boolean };
|
||||
error.code = "ENOTSUP";
|
||||
error.lstatUnavailable = true;
|
||||
throw error;
|
||||
},
|
||||
startStreamTransfer: async () => {
|
||||
uploaded += 1;
|
||||
return { transferId: "upload-1" };
|
||||
},
|
||||
},
|
||||
joinPath: (base, name) => `${base}/${name}`,
|
||||
resolveConflict: async () => {
|
||||
conflictPrompts += 1;
|
||||
return "replace";
|
||||
},
|
||||
},
|
||||
),
|
||||
(error: Error & { code?: string }) => {
|
||||
assert.equal(error.code, "ENOTSUP");
|
||||
assert.match(String(error.message), /does not support LSTAT/i);
|
||||
return true;
|
||||
},
|
||||
);
|
||||
|
||||
assert.equal(uploaded, 0, "must not upload when destination type is unknown");
|
||||
assert.equal(conflictPrompts, 0, "must not pretend destination is missing");
|
||||
});
|
||||
|
||||
test("ENOENT from lstat still means absent destination for conflict check", async () => {
|
||||
const file = new File(["new-bytes"], "tool.sh", { lastModified: 1234 });
|
||||
Object.defineProperty(file, "path", { value: "/local/tool.sh" });
|
||||
const uploadedPaths: string[] = [];
|
||||
|
||||
const results = await uploadFromFileList(
|
||||
[file],
|
||||
{
|
||||
targetPath: "/usr/local/bin",
|
||||
sftpId: "sftp-1",
|
||||
isLocal: false,
|
||||
bridge: {
|
||||
mkdirSftp: async () => {},
|
||||
lstatSftp: async () => {
|
||||
const error = new Error("No such file") as Error & { code: string };
|
||||
error.code = "ENOENT";
|
||||
throw error;
|
||||
},
|
||||
startStreamTransfer: async ({ targetPath: path }) => {
|
||||
uploadedPaths.push(path);
|
||||
return { transferId: "upload-1" };
|
||||
},
|
||||
},
|
||||
joinPath: (base, name) => `${base}/${name}`,
|
||||
resolveConflict: async () => {
|
||||
throw new Error("absent destination must not prompt for conflict");
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
assert.deepEqual(uploadedPaths, ["/usr/local/bin/tool.sh"]);
|
||||
assert.equal(results.length, 1);
|
||||
assert.equal(results[0].success, true);
|
||||
});
|
||||
|
||||
test("Electron-wrapped lstat absence still means absent destination", async () => {
|
||||
const file = new File(["new-bytes"], "tool.sh", { lastModified: 1234 });
|
||||
Object.defineProperty(file, "path", { value: "/local/tool.sh" });
|
||||
const uploadedPaths: string[] = [];
|
||||
|
||||
const results = await uploadFromFileList(
|
||||
[file],
|
||||
{
|
||||
targetPath: "/usr/local/bin",
|
||||
sftpId: "sftp-1",
|
||||
isLocal: false,
|
||||
bridge: {
|
||||
mkdirSftp: async () => {},
|
||||
lstatSftp: async () => {
|
||||
throw new Error("Error invoking remote method 'netcatty:sftp:lstat': Error: No such file");
|
||||
},
|
||||
startStreamTransfer: async ({ targetPath: path }) => {
|
||||
uploadedPaths.push(path);
|
||||
return { transferId: "upload-1" };
|
||||
},
|
||||
},
|
||||
joinPath: (base, name) => `${base}/${name}`,
|
||||
resolveConflict: async () => {
|
||||
throw new Error("absent destination must not prompt for conflict");
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
assert.deepEqual(uploadedPaths, ["/usr/local/bin/tool.sh"]);
|
||||
assert.equal(results.length, 1);
|
||||
assert.equal(results[0].success, true);
|
||||
});
|
||||
|
||||
test("compressed-upload LSTAT ENOTSUP is not treated as an absent destination", async (t) => {
|
||||
let compressedStarts = 0;
|
||||
installCompressedUploadBridge(t, {
|
||||
onStart: () => { compressedStarts += 1; },
|
||||
});
|
||||
let streamCalls = 0;
|
||||
|
||||
await assert.rejects(
|
||||
() => uploadFromFileList(
|
||||
[createPickedFolderFile()],
|
||||
{
|
||||
targetPath: "/remote",
|
||||
sftpId: "sftp-1",
|
||||
isLocal: false,
|
||||
bridge: {
|
||||
mkdirSftp: async () => {},
|
||||
lstatSftp: async () => {
|
||||
const error = new Error(
|
||||
"Remote server does not support LSTAT; cannot classify path without following symlinks",
|
||||
) as Error & { code: string; lstatUnavailable: boolean };
|
||||
error.code = "ENOTSUP";
|
||||
error.lstatUnavailable = true;
|
||||
throw error;
|
||||
},
|
||||
startStreamTransfer: async (payload) => {
|
||||
streamCalls += 1;
|
||||
return { transferId: payload.transferId };
|
||||
},
|
||||
},
|
||||
joinPath: (base, name) => `${base}/${name}`,
|
||||
useCompressedUpload: true,
|
||||
resolveConflict: async () => "merge",
|
||||
},
|
||||
),
|
||||
(error: Error & { code?: string }) => {
|
||||
assert.equal(error.code, "ENOTSUP");
|
||||
return true;
|
||||
},
|
||||
);
|
||||
|
||||
assert.equal(compressedStarts, 0);
|
||||
assert.equal(streamCalls, 0);
|
||||
});
|
||||
|
||||
test("directory replace unlinks an existing symlink before mkdir", async () => {
|
||||
// No-follow lstat reports symlink; Replace must unlink then create the dir
|
||||
// (followed stat used to classify symlink-to-dir as directory and succeed).
|
||||
const file = new File(["nested"], "file.txt", { lastModified: 1234 });
|
||||
Object.defineProperty(file, "path", { value: "/local/docs/file.txt" });
|
||||
Object.defineProperty(file, "webkitRelativePath", { value: "docs/file.txt" });
|
||||
const deletedPaths: string[] = [];
|
||||
const deletedTypes: Array<string | undefined> = [];
|
||||
const madeDirs: string[] = [];
|
||||
const uploadedPaths: string[] = [];
|
||||
|
||||
const results = await uploadFromFileList(
|
||||
[file],
|
||||
{
|
||||
targetPath: "/remote",
|
||||
sftpId: "sftp-1",
|
||||
isLocal: false,
|
||||
bridge: {
|
||||
mkdirSftp: async (_sftpId, path) => {
|
||||
madeDirs.push(path);
|
||||
},
|
||||
lstatSftp: async (_sftpId, path) =>
|
||||
path === "/remote/docs"
|
||||
? { type: "symlink", size: 8, lastModified: 1000 }
|
||||
: null,
|
||||
deleteSftp: async (_sftpId, path, expectedType) => {
|
||||
deletedPaths.push(path);
|
||||
deletedTypes.push(expectedType);
|
||||
},
|
||||
startStreamTransfer: async ({ targetPath: path }) => {
|
||||
uploadedPaths.push(path);
|
||||
return { transferId: "upload-dir-1" };
|
||||
},
|
||||
},
|
||||
joinPath: (base, name) => `${base}/${name}`,
|
||||
resolveConflict: async () => "replace",
|
||||
},
|
||||
);
|
||||
|
||||
assert.deepEqual(deletedPaths, ["/remote/docs"]);
|
||||
assert.deepEqual(deletedTypes, ["symlink"]);
|
||||
assert.ok(madeDirs.includes("/remote/docs"), `expected mkdir after unlink, got ${JSON.stringify(madeDirs)}`);
|
||||
assert.deepEqual(uploadedPaths, ["/remote/docs/file.txt"]);
|
||||
assert.equal(results.some((r) => r.success), true);
|
||||
});
|
||||
|
||||
test("local file replace unlinks an existing symlink before writeLocalFile", async () => {
|
||||
// Pathless File uploads fall back to writeLocalFile, which follows symlinks.
|
||||
// Conflict checks use lstatLocal so Replace unlinks the link first.
|
||||
const file = new File(["new-bytes"], "tool.sh", { lastModified: 1234 });
|
||||
const deletedPaths: string[] = [];
|
||||
const deletedTypes: Array<string | undefined> = [];
|
||||
const writtenPaths: string[] = [];
|
||||
|
||||
const results = await uploadFromFileList(
|
||||
[file],
|
||||
{
|
||||
targetPath: "/Users/me/bin",
|
||||
sftpId: null,
|
||||
isLocal: true,
|
||||
bridge: {
|
||||
mkdirSftp: async () => {},
|
||||
lstatLocal: async (path) =>
|
||||
path === "/Users/me/bin/tool.sh"
|
||||
? { type: "symlink", size: 12, lastModified: 1000 }
|
||||
: null,
|
||||
deleteLocalFile: async (path, expectedType) => {
|
||||
deletedPaths.push(path);
|
||||
deletedTypes.push(expectedType);
|
||||
},
|
||||
writeLocalFile: async (path) => {
|
||||
writtenPaths.push(path);
|
||||
},
|
||||
},
|
||||
joinPath: (base, name) => `${base}/${name}`,
|
||||
resolveConflict: async () => "replace",
|
||||
},
|
||||
);
|
||||
|
||||
assert.deepEqual(deletedPaths, ["/Users/me/bin/tool.sh"]);
|
||||
assert.deepEqual(deletedTypes, ["symlink"]);
|
||||
assert.deepEqual(writtenPaths, ["/Users/me/bin/tool.sh"]);
|
||||
assert.equal(results.length, 1);
|
||||
assert.equal(results[0].success, true);
|
||||
});
|
||||
|
||||
test("local file replace unlinks a regular file before writeLocalFile", async () => {
|
||||
const file = new File(["new-bytes"], "tool.sh", { lastModified: 1234 });
|
||||
const operations: string[] = [];
|
||||
|
||||
const results = await uploadFromFileList(
|
||||
[file],
|
||||
{
|
||||
targetPath: "/Users/me/bin",
|
||||
sftpId: null,
|
||||
isLocal: true,
|
||||
bridge: {
|
||||
mkdirSftp: async () => {},
|
||||
lstatLocal: async (path) =>
|
||||
path === "/Users/me/bin/tool.sh"
|
||||
? { type: "file", size: 12, lastModified: 1000 }
|
||||
: null,
|
||||
deleteLocalFile: async (path, expectedType) => {
|
||||
operations.push(`delete:${path}:${expectedType}`);
|
||||
},
|
||||
writeLocalFile: async (path) => {
|
||||
operations.push(`write:${path}`);
|
||||
},
|
||||
},
|
||||
joinPath: (base, name) => `${base}/${name}`,
|
||||
resolveConflict: async () => "replace",
|
||||
},
|
||||
);
|
||||
|
||||
assert.deepEqual(operations, [
|
||||
"delete:/Users/me/bin/tool.sh:file",
|
||||
"write:/Users/me/bin/tool.sh",
|
||||
]);
|
||||
assert.equal(results.length, 1);
|
||||
assert.equal(results[0].success, true);
|
||||
});
|
||||
|
||||
test("counts apply-to-all upload conflicts by incoming and existing type", async () => {
|
||||
const files = [
|
||||
new File(["local"], "existing-file", { lastModified: 1234 }),
|
||||
|
||||
@@ -42,6 +42,7 @@ import {
|
||||
import {
|
||||
activateDraftView,
|
||||
clearScopeDraftState,
|
||||
draftsByScopeEqualIgnoringAllComposerText,
|
||||
ensureDraftForScopeState,
|
||||
pruneStaleSessionPanelViews,
|
||||
setDraftView,
|
||||
@@ -786,18 +787,21 @@ export function useAIState() {
|
||||
|
||||
const ensureDraftForScope = useCallback((scopeKey: string, agentId: string): void => {
|
||||
let nextDraftsByScope: DraftsByScope | null = null;
|
||||
let textOnly = false;
|
||||
|
||||
setDraftsByScopeRaw((prev) => {
|
||||
const next = ensureDraftForScopeState(prev, scopeKey, agentId);
|
||||
if (next === prev) return prev;
|
||||
nextDraftsByScope = next;
|
||||
textOnly = draftsByScopeEqualIgnoringAllComposerText(prev, next);
|
||||
return next;
|
||||
});
|
||||
|
||||
if (!nextDraftsByScope) return;
|
||||
|
||||
bumpDraftMutationVersion(scopeKey);
|
||||
setLatestAIDraftsByScopeSnapshot(nextDraftsByScope);
|
||||
if (textOnly) return;
|
||||
bumpDraftMutationVersion(scopeKey);
|
||||
emitAIStateChanged(AI_STATE_CHANGED_DRAFTS_BY_SCOPE);
|
||||
}, []);
|
||||
|
||||
@@ -806,52 +810,69 @@ export function useAIState() {
|
||||
fallbackAgentId: string,
|
||||
updater: (draft: AIDraft) => AIDraft,
|
||||
): void => {
|
||||
let nextDraftsByScope: DraftsByScope | null = null;
|
||||
let textOnly = false;
|
||||
|
||||
setDraftsByScopeRaw((prev) => {
|
||||
const next = updateDraftForScope(
|
||||
prev,
|
||||
scopeKey,
|
||||
fallbackAgentId,
|
||||
(draft) => {
|
||||
const updated = updater(draft);
|
||||
if (updated === draft) return draft;
|
||||
return {
|
||||
...updater(draft),
|
||||
...updated,
|
||||
updatedAt: Date.now(),
|
||||
};
|
||||
},
|
||||
);
|
||||
setLatestAIDraftsByScopeSnapshot(next);
|
||||
emitAIStateChanged(AI_STATE_CHANGED_DRAFTS_BY_SCOPE);
|
||||
if (next === prev) return prev;
|
||||
nextDraftsByScope = next;
|
||||
textOnly = draftsByScopeEqualIgnoringAllComposerText(prev, next);
|
||||
return next;
|
||||
});
|
||||
|
||||
if (!nextDraftsByScope) return;
|
||||
setLatestAIDraftsByScopeSnapshot(nextDraftsByScope);
|
||||
if (textOnly) return;
|
||||
bumpDraftMutationVersion(scopeKey);
|
||||
emitAIStateChanged(AI_STATE_CHANGED_DRAFTS_BY_SCOPE);
|
||||
}, []);
|
||||
|
||||
const updateDraftIfPresent = useCallback((
|
||||
scopeKey: string,
|
||||
updater: (draft: AIDraft) => AIDraft,
|
||||
): void => {
|
||||
let updated = false;
|
||||
let nextDraftsByScope: DraftsByScope | null = null;
|
||||
let textOnly = false;
|
||||
|
||||
setDraftsByScopeRaw((prev) => {
|
||||
const currentDraft = prev[scopeKey];
|
||||
if (!currentDraft) return prev;
|
||||
|
||||
const nextDraft = {
|
||||
...updater(currentDraft),
|
||||
updatedAt: Date.now(),
|
||||
};
|
||||
const updated = updater(currentDraft);
|
||||
const nextDraft = updated === currentDraft
|
||||
? currentDraft
|
||||
: {
|
||||
...updated,
|
||||
updatedAt: Date.now(),
|
||||
};
|
||||
if (nextDraft === currentDraft) return prev;
|
||||
const next = {
|
||||
...prev,
|
||||
[scopeKey]: nextDraft,
|
||||
};
|
||||
updated = true;
|
||||
setLatestAIDraftsByScopeSnapshot(next);
|
||||
emitAIStateChanged(AI_STATE_CHANGED_DRAFTS_BY_SCOPE);
|
||||
nextDraftsByScope = next;
|
||||
textOnly = draftsByScopeEqualIgnoringAllComposerText(prev, next);
|
||||
return next;
|
||||
});
|
||||
|
||||
if (updated) {
|
||||
bumpDraftMutationVersion(scopeKey);
|
||||
}
|
||||
if (!nextDraftsByScope) return;
|
||||
setLatestAIDraftsByScopeSnapshot(nextDraftsByScope);
|
||||
if (textOnly) return;
|
||||
bumpDraftMutationVersion(scopeKey);
|
||||
emitAIStateChanged(AI_STATE_CHANGED_DRAFTS_BY_SCOPE);
|
||||
}, []);
|
||||
|
||||
const showDraftView = useCallback((scopeKey: string) => {
|
||||
|
||||
@@ -22,10 +22,16 @@ let agentDiscoveryWriteGeneration = 0;
|
||||
export function useAgentDiscovery(
|
||||
externalAgents: ExternalAgentConfig[],
|
||||
setExternalAgents?: (value: ExternalAgentConfig[] | ((prev: ExternalAgentConfig[]) => ExternalAgentConfig[])) => void,
|
||||
options?: { enabled?: boolean },
|
||||
options?: {
|
||||
enabled?: boolean;
|
||||
schedule?: (task: () => void) => () => void;
|
||||
},
|
||||
) {
|
||||
const enabled = options?.enabled ?? true;
|
||||
const [discoveredAgents, setDiscoveredAgents] = useState<DiscoveredAgent[]>([]);
|
||||
const schedule = options?.schedule;
|
||||
const [discoveredAgents, setDiscoveredAgents] = useState<DiscoveredAgent[]>(
|
||||
() => agentDiscoveryCache?.agents ?? [],
|
||||
);
|
||||
const [isDiscovering, setIsDiscovering] = useState(false);
|
||||
const discoverSeqRef = useRef(0);
|
||||
const mountedRef = useRef(true);
|
||||
@@ -116,8 +122,16 @@ export function useAgentDiscovery(
|
||||
if (!cancelled) void discover();
|
||||
};
|
||||
|
||||
if (schedule) {
|
||||
const cancel = schedule(runDiscover);
|
||||
return () => {
|
||||
cancelled = true;
|
||||
cancel();
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof requestIdleCallback === 'function') {
|
||||
const idleId = requestIdleCallback(runDiscover, { timeout: 2000 });
|
||||
const idleId = requestIdleCallback(runDiscover);
|
||||
return () => {
|
||||
cancelled = true;
|
||||
cancelIdleCallback(idleId);
|
||||
@@ -129,7 +143,7 @@ export function useAgentDiscovery(
|
||||
cancelled = true;
|
||||
clearTimeout(timeoutId);
|
||||
};
|
||||
}, [discover, enabled]);
|
||||
}, [discover, enabled, schedule]);
|
||||
|
||||
// Auto-update args for already-configured discovered agents when
|
||||
// the canonical args from discovery change (e.g. after an app update).
|
||||
|
||||
@@ -109,6 +109,7 @@ test("enabled convergent startup checks preview empty-vault recovery before sync
|
||||
"conflictActionOverride: 'download-remote'",
|
||||
recoveryPromptIndex,
|
||||
);
|
||||
const manualTriggerIndex = source.indexOf("trigger: 'manual'", recoveryPromptIndex);
|
||||
const normalSyncIndex = source.indexOf(
|
||||
"syncNowRef.current({ notifyOnFailure, allowEmptyConvergentSync })",
|
||||
cloudWinsIndex,
|
||||
@@ -118,16 +119,41 @@ test("enabled convergent startup checks preview empty-vault recovery before sync
|
||||
assert.notEqual(previewIndex, -1);
|
||||
assert.notEqual(recoveryPromptIndex, -1);
|
||||
assert.notEqual(cloudWinsIndex, -1);
|
||||
assert.notEqual(manualTriggerIndex, -1);
|
||||
assert.notEqual(normalSyncIndex, -1);
|
||||
assert.ok(
|
||||
convergentGuardIndex < previewIndex
|
||||
&& previewIndex < recoveryPromptIndex
|
||||
&& recoveryPromptIndex < cloudWinsIndex
|
||||
&& recoveryPromptIndex < manualTriggerIndex
|
||||
&& manualTriggerIndex < cloudWinsIndex
|
||||
&& cloudWinsIndex < normalSyncIndex,
|
||||
"v2 startup must offer recovery and use cloud-wins before the normal CRDT sync path",
|
||||
);
|
||||
});
|
||||
|
||||
test("empty-vault recovery restore bypasses the auto-sync preference gate", () => {
|
||||
const source = readFileSync(new URL("./useAutoSync.ts", import.meta.url), "utf8");
|
||||
const recoveryPromptIndex = source.indexOf("requestEmptyVaultRecovery(recoveryPayload)");
|
||||
const restoreCallIndex = source.indexOf("syncNowRef.current({", recoveryPromptIndex);
|
||||
const triggerIndex = source.indexOf("trigger: 'manual'", restoreCallIndex);
|
||||
const conflictIndex = source.indexOf(
|
||||
"conflictActionOverride: 'download-remote'",
|
||||
restoreCallIndex,
|
||||
);
|
||||
const callEndIndex = source.indexOf("});", conflictIndex);
|
||||
|
||||
assert.notEqual(recoveryPromptIndex, -1);
|
||||
assert.notEqual(restoreCallIndex, -1);
|
||||
assert.notEqual(triggerIndex, -1);
|
||||
assert.notEqual(conflictIndex, -1);
|
||||
assert.ok(
|
||||
restoreCallIndex < triggerIndex
|
||||
&& triggerIndex < conflictIndex
|
||||
&& conflictIndex < callEndIndex,
|
||||
"recovery Restore must pass trigger:manual so disabled auto-sync cannot block it",
|
||||
);
|
||||
});
|
||||
|
||||
test("empty v2 startup checks allow a validated empty sync to open the gate", () => {
|
||||
const source = readFileSync(new URL("./useAutoSync.ts", import.meta.url), "utf8");
|
||||
const convergentGuardIndex = source.indexOf(
|
||||
@@ -192,6 +218,38 @@ test("auto-sync skips only the exact remote-applied data hash", () => {
|
||||
);
|
||||
});
|
||||
|
||||
test("auto syncNow and debounce re-check manager autoSyncEnabled before pushing", () => {
|
||||
const source = readFileSync(new URL("./useAutoSync.ts", import.meta.url), "utf8");
|
||||
const helperIndex = source.indexOf("function isPersistedAutoSyncEnabled");
|
||||
const syncNowIndex = source.indexOf("const syncNow = useCallback");
|
||||
const autoGateIndex = source.indexOf(
|
||||
"if (trigger === 'auto' && !isPersistedAutoSyncEnabled(manager.getState().autoSyncEnabled))",
|
||||
syncNowIndex,
|
||||
);
|
||||
const debounceIndex = source.indexOf("// Debounced auto-sync when data changes");
|
||||
const fireTimeGateIndex = source.indexOf(
|
||||
"if (!isPersistedAutoSyncEnabled(manager.getState().autoSyncEnabled))",
|
||||
debounceIndex,
|
||||
);
|
||||
const clearTimerIndex = source.indexOf(
|
||||
"if (syncTimeoutRef.current) {\n clearTimeout(syncTimeoutRef.current);\n syncTimeoutRef.current = null;\n }\n return;",
|
||||
debounceIndex,
|
||||
);
|
||||
|
||||
assert.notEqual(helperIndex, -1);
|
||||
assert.notEqual(syncNowIndex, -1);
|
||||
assert.notEqual(autoGateIndex, -1);
|
||||
assert.notEqual(fireTimeGateIndex, -1);
|
||||
assert.notEqual(clearTimerIndex, -1);
|
||||
assert.ok(
|
||||
helperIndex < syncNowIndex
|
||||
&& syncNowIndex < autoGateIndex
|
||||
&& debounceIndex < fireTimeGateIndex
|
||||
&& debounceIndex < clearTimerIndex,
|
||||
"auto-sync off must gate both syncNow(auto) and the debounced timer path",
|
||||
);
|
||||
});
|
||||
|
||||
test("startup local-wins and merge round-trips refuse device-bound credential placeholders", () => {
|
||||
const source = readFileSync(new URL("./useAutoSync.ts", import.meta.url), "utf8");
|
||||
const uploadLocalIndex = source.indexOf("if (conflictAction === 'upload-local')");
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
healPoisonedSecretsForMerge,
|
||||
stripSyncPayloadEncryptedCredentials,
|
||||
} from '../../domain/credentials';
|
||||
import { isProviderReadyForSync, type CloudProvider, type SyncPayload } from '../../domain/sync';
|
||||
import { isProviderReadyForSync, SYNC_STORAGE_KEYS, type CloudProvider, type SyncPayload } from '../../domain/sync';
|
||||
import { mergeSyncPayloads } from '../../domain/syncMerge';
|
||||
import { materializeSyncPayloadFromConvergentState } from '../../domain/convergentSync';
|
||||
import {
|
||||
@@ -51,6 +51,19 @@ import {
|
||||
import { resolveAutoSyncHashDecision } from './autoSyncHashDecision';
|
||||
import { getNotesSnapshot, subscribeNotes } from './notesStore';
|
||||
|
||||
/** Prefer dedicated SYNC_PREFERENCES; fall back to legacy SYNC_CONFIG fields. */
|
||||
function isPersistedAutoSyncEnabled(fallback: boolean): boolean {
|
||||
const preferences = localStorageAdapter.read<{ autoSync?: boolean }>(
|
||||
SYNC_STORAGE_KEYS.SYNC_PREFERENCES,
|
||||
);
|
||||
if (preferences && typeof preferences === 'object' && preferences.autoSync !== undefined) {
|
||||
return Boolean(preferences.autoSync);
|
||||
}
|
||||
const stored = localStorageAdapter.read<{ autoSync?: boolean }>(SYNC_STORAGE_KEYS.SYNC_CONFIG);
|
||||
if (!stored || typeof stored !== 'object') return fallback;
|
||||
return Boolean(stored.autoSync);
|
||||
}
|
||||
|
||||
interface AutoSyncConfig {
|
||||
enabled?: boolean;
|
||||
// Data to sync
|
||||
@@ -312,6 +325,13 @@ export const useAutoSync = (config: AutoSyncConfig) => {
|
||||
}
|
||||
const trigger: SyncTrigger = options?.trigger ?? 'auto';
|
||||
|
||||
// Defense for #2976: auto pushes must honor the persisted preference even
|
||||
// when this window's React/manager snapshot is briefly stale after another
|
||||
// window disables auto-sync.
|
||||
if (trigger === 'auto' && !isPersistedAutoSyncEnabled(manager.getState().autoSyncEnabled)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
isSyncRunningRef.current = true;
|
||||
try {
|
||||
// Get fresh state directly from CloudSyncManager singleton
|
||||
@@ -671,7 +691,10 @@ export const useAutoSync = (config: AutoSyncConfig) => {
|
||||
if (recoveryPayload && shouldPromptCloudVaultRecovery(localPayload, recoveryPayload)) {
|
||||
const userAction = await requestEmptyVaultRecovery(recoveryPayload);
|
||||
if (userAction === 'restore') {
|
||||
// Explicit recovery must not honor the auto-sync preference gate:
|
||||
// the user already confirmed Restore in the dialog.
|
||||
const restored = await syncNowRef.current({
|
||||
trigger: 'manual',
|
||||
notifyOnFailure,
|
||||
conflictActionOverride: 'download-remote',
|
||||
});
|
||||
@@ -973,6 +996,12 @@ export const useAutoSync = (config: AutoSyncConfig) => {
|
||||
}
|
||||
// Skip if not ready
|
||||
if (!sync.hasAnyConnectedProvider || !sync.autoSyncEnabled || !sync.isUnlocked) {
|
||||
// Drop any pending debounce when auto-sync (or readiness) turns off so a
|
||||
// timer scheduled while enabled cannot fire after the toggle (#2976).
|
||||
if (syncTimeoutRef.current) {
|
||||
clearTimeout(syncTimeoutRef.current);
|
||||
syncTimeoutRef.current = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1030,6 +1059,12 @@ export const useAutoSync = (config: AutoSyncConfig) => {
|
||||
return;
|
||||
}
|
||||
|
||||
// Re-check at fire time: auto-sync may have been disabled in another
|
||||
// window during the debounce window (#2976).
|
||||
if (!isPersistedAutoSyncEnabled(manager.getState().autoSyncEnabled)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Wait for the current sync to finish, then this effect will re-run
|
||||
// because sync.isSyncing changed.
|
||||
if (sync.isSyncing || isSyncRunningRef.current) {
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import test from 'node:test';
|
||||
|
||||
import { createLatestPayloadSync } from './useExternalMcpSessionSync.ts';
|
||||
|
||||
const hookSource = readFileSync(new URL('./useExternalMcpSessionSync.ts', import.meta.url), 'utf8');
|
||||
const appSource = readFileSync(new URL('../app/AppSideEffects.tsx', import.meta.url), 'utf8');
|
||||
const preloadSource = readFileSync(new URL('../../electron/preload/api.cjs', import.meta.url), 'utf8');
|
||||
const handlerSource = readFileSync(
|
||||
new URL('../../electron/bridges/aiBridge/agentProcessHandlers.cjs', import.meta.url),
|
||||
'utf8',
|
||||
);
|
||||
|
||||
test('app live session sync stays mounted and is independent of External MCP enablement', () => {
|
||||
assert.match(appSource, /useExternalMcpSessionSync\(\{/);
|
||||
assert.match(hookSource, /bridge\.aiMcpUpdateLiveSessions\?\.\(nextPayload\)/);
|
||||
assert.match(hookSource, /liveSyncRef\.current\.push\(payload, serialized\)/);
|
||||
assert.match(hookSource, /bridge\.aiMcpUpdateSessions\?\.\(/);
|
||||
assert.match(hookSource, /externalSyncRef\.current\.push\(payload, serialized\)/);
|
||||
assert.doesNotMatch(
|
||||
hookSource,
|
||||
/if \(!enabled\)[\s\S]{0,300}aiMcpUpdateLiveSessions/,
|
||||
);
|
||||
});
|
||||
|
||||
test('live session sync has a complete renderer to main-process IPC path', () => {
|
||||
assert.match(preloadSource, /netcatty:ai:mcp:update-live-sessions/);
|
||||
assert.match(handlerSource, /netcatty:ai:mcp:update-live-sessions/);
|
||||
assert.match(handlerSource, /mcpServerBridge\.updateLiveSessionMetadata/);
|
||||
});
|
||||
|
||||
test('latest payload sync converges to A-B-A while B is in flight', async () => {
|
||||
let releaseB: (() => void) | undefined;
|
||||
const sent: string[] = [];
|
||||
const sync = createLatestPayloadSync(async (payload: string) => {
|
||||
sent.push(payload);
|
||||
if (payload === 'B') {
|
||||
await new Promise<void>((resolve) => {
|
||||
releaseB = resolve;
|
||||
});
|
||||
}
|
||||
return { ok: true };
|
||||
});
|
||||
|
||||
await sync.push('A');
|
||||
const sendingB = sync.push('B');
|
||||
void sync.push('A');
|
||||
releaseB?.();
|
||||
await sendingB;
|
||||
|
||||
assert.deepEqual(sent, ['A', 'B', 'A']);
|
||||
});
|
||||
|
||||
test('cancelling a payload sync drops a queued update', async () => {
|
||||
let releaseA: (() => void) | undefined;
|
||||
const sent: string[] = [];
|
||||
const sync = createLatestPayloadSync(async (payload: string) => {
|
||||
sent.push(payload);
|
||||
if (payload === 'A') {
|
||||
await new Promise<void>((resolve) => {
|
||||
releaseA = resolve;
|
||||
});
|
||||
}
|
||||
return { ok: true };
|
||||
});
|
||||
|
||||
const sendingA = sync.push('A');
|
||||
void sync.push('B');
|
||||
sync.cancel();
|
||||
releaseA?.();
|
||||
await sendingA;
|
||||
|
||||
assert.deepEqual(sent, ['A']);
|
||||
});
|
||||
@@ -17,6 +17,49 @@ type UseExternalMcpSessionSyncOptions = {
|
||||
portForwardingRules: PortForwardingRule[];
|
||||
};
|
||||
|
||||
export function createLatestPayloadSync<T>(
|
||||
send: (payload: T) => Promise<unknown>,
|
||||
) {
|
||||
let desired: { serialized: string; payload: T } | null = null;
|
||||
let acknowledged = '';
|
||||
let inFlight: Promise<void> | null = null;
|
||||
let cancelled = false;
|
||||
|
||||
const pump = async () => {
|
||||
while (!cancelled && desired && desired.serialized !== acknowledged) {
|
||||
const target = desired;
|
||||
try {
|
||||
const result = await send(target.payload);
|
||||
if (cancelled) break;
|
||||
if (result && typeof result === 'object' && 'ok' in result && (result as { ok?: boolean }).ok === false) {
|
||||
if (desired === target) break;
|
||||
continue;
|
||||
}
|
||||
acknowledged = target.serialized;
|
||||
} catch {
|
||||
if (desired === target) break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
push(payload: T, serialized = JSON.stringify(payload)): Promise<void> {
|
||||
if (cancelled) return Promise.resolve();
|
||||
desired = { payload, serialized };
|
||||
if (!inFlight) {
|
||||
inFlight = pump().finally(() => {
|
||||
inFlight = null;
|
||||
});
|
||||
}
|
||||
return inFlight;
|
||||
},
|
||||
cancel(): void {
|
||||
cancelled = true;
|
||||
desired = null;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function isMainAppWindow(): boolean {
|
||||
if (typeof window === 'undefined') return false;
|
||||
const hash = window.location.hash || '';
|
||||
@@ -43,7 +86,6 @@ export function useExternalMcpSessionSync({
|
||||
void enabledTick;
|
||||
return readExternalMcpStoredEnabled();
|
||||
}, [enabledTick]);
|
||||
const syncGenerationRef = useRef(0);
|
||||
|
||||
useEffect(() => {
|
||||
const bump = () => setEnabledTick((value) => value + 1);
|
||||
@@ -77,34 +119,41 @@ export function useExternalMcpSessionSync({
|
||||
});
|
||||
}, [sessions, sessionHostsMap, hosts, portForwardingRules]);
|
||||
|
||||
const lastSentSerializedRef = useRef('');
|
||||
const liveSyncRef = useRef<ReturnType<typeof createLatestPayloadSync<typeof payload>> | null>(null);
|
||||
const externalSyncRef = useRef<ReturnType<typeof createLatestPayloadSync<typeof payload>> | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isMainAppWindow()) return;
|
||||
const bridge = netcattyBridge.get();
|
||||
if (!bridge?.aiMcpUpdateLiveSessions) return;
|
||||
const serialized = JSON.stringify(payload);
|
||||
liveSyncRef.current ??= createLatestPayloadSync((nextPayload) => (
|
||||
Promise.resolve(bridge.aiMcpUpdateLiveSessions?.(nextPayload))
|
||||
));
|
||||
void liveSyncRef.current.push(payload, serialized);
|
||||
}, [payload]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isMainAppWindow()) return;
|
||||
if (!enabled) {
|
||||
syncGenerationRef.current += 1;
|
||||
lastSentSerializedRef.current = '';
|
||||
// Recreate the synchronizer after re-enabling because disabling can
|
||||
// clear the main-process scope even when the renderer payload is equal.
|
||||
externalSyncRef.current?.cancel();
|
||||
externalSyncRef.current = null;
|
||||
return;
|
||||
}
|
||||
const bridge = netcattyBridge.get();
|
||||
if (!bridge?.aiMcpUpdateSessions) return;
|
||||
|
||||
const serialized = JSON.stringify(payload);
|
||||
if (serialized === lastSentSerializedRef.current) return;
|
||||
|
||||
const generation = ++syncGenerationRef.current;
|
||||
const timeoutId = window.setTimeout(() => {
|
||||
void Promise.resolve(bridge.aiMcpUpdateSessions?.(payload, EXTERNAL_MCP_CHAT_SESSION_ID))
|
||||
.then((result) => {
|
||||
if (generation !== syncGenerationRef.current) return;
|
||||
if (result && typeof result === 'object' && 'ok' in result && (result as { ok?: boolean }).ok === false) {
|
||||
return;
|
||||
}
|
||||
lastSentSerializedRef.current = serialized;
|
||||
})
|
||||
.catch(() => {
|
||||
// Leave the ref unset so the next effect can retry.
|
||||
});
|
||||
externalSyncRef.current ??= createLatestPayloadSync((nextPayload) => (
|
||||
Promise.resolve(bridge.aiMcpUpdateSessions?.(
|
||||
nextPayload,
|
||||
EXTERNAL_MCP_CHAT_SESSION_ID,
|
||||
))
|
||||
));
|
||||
void externalSyncRef.current.push(payload, serialized);
|
||||
}, 250);
|
||||
|
||||
return () => {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import React from 'react';
|
||||
import { act, create, type ReactTestRenderer } from 'react-test-renderer';
|
||||
import {
|
||||
createDeferredOutputTriggerEventProcessor,
|
||||
createOutputTriggerScanBuffer,
|
||||
@@ -7,6 +9,7 @@ import {
|
||||
findMatchEndingAfter,
|
||||
hasApplicableOutputTriggerSnippet,
|
||||
inspectDroppedOutputOverflowAlternateScreenState,
|
||||
useOutputTriggers,
|
||||
} from './useOutputTriggers.ts';
|
||||
import { createTerminalOutputTriggerFilter } from '@/domain/terminalOutputTriggerFilter.ts';
|
||||
import type { Snippet } from '@/domain/models';
|
||||
@@ -93,6 +96,80 @@ test('hasApplicableOutputTriggerSnippet requires a runnable output trigger for t
|
||||
assert.equal(hasApplicableOutputTriggerSnippet(snippets, 'host-a'), true);
|
||||
});
|
||||
|
||||
test('hasApplicableOutputTriggerSnippet follows the host current group', () => {
|
||||
const snippets: Snippet[] = [{
|
||||
id: 'group-trigger',
|
||||
label: 'Group trigger',
|
||||
command: '',
|
||||
kind: 'script',
|
||||
trigger: 'onOutput',
|
||||
triggerPattern: 'READY',
|
||||
targetGroups: ['Production'],
|
||||
}];
|
||||
assert.equal(
|
||||
hasApplicableOutputTriggerSnippet(snippets, { id: 'host-a', group: 'Production/Web' }),
|
||||
true,
|
||||
);
|
||||
assert.equal(
|
||||
hasApplicableOutputTriggerSnippet(snippets, { id: 'host-a', group: 'Staging' }),
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
test('equivalent host objects do not reset a pending output trigger match', async () => {
|
||||
const actEnvironment = globalThis as typeof globalThis & {
|
||||
IS_REACT_ACT_ENVIRONMENT?: boolean;
|
||||
};
|
||||
const previousActEnvironment = actEnvironment.IS_REACT_ACT_ENVIRONMENT;
|
||||
actEnvironment.IS_REACT_ACT_ENVIRONMENT = true;
|
||||
const snippets: Snippet[] = [{
|
||||
id: 'stable-host-trigger',
|
||||
label: 'Stable host trigger',
|
||||
command: '',
|
||||
kind: 'script',
|
||||
trigger: 'onOutput',
|
||||
triggerPattern: 'READY',
|
||||
targetGroups: ['Production'],
|
||||
}];
|
||||
let appendOutput: ((chunk: string) => void) | undefined;
|
||||
let runCount = 0;
|
||||
let renderer: ReactTestRenderer | null = null;
|
||||
const onRunScript = () => {
|
||||
runCount += 1;
|
||||
};
|
||||
|
||||
const Probe = ({ host }: { host: { id: string; group: string } }) => {
|
||||
appendOutput = useOutputTriggers({
|
||||
sessionId: 'session-1',
|
||||
host,
|
||||
snippets,
|
||||
onRunScript,
|
||||
}).appendOutput;
|
||||
return null;
|
||||
};
|
||||
|
||||
await act(async () => {
|
||||
renderer = create(React.createElement(Probe, {
|
||||
host: { id: 'host-a', group: 'Production/Web' },
|
||||
}));
|
||||
});
|
||||
try {
|
||||
await act(async () => {
|
||||
appendOutput?.('REA');
|
||||
renderer?.update(React.createElement(Probe, {
|
||||
host: { id: 'host-a', group: 'Production/Web' },
|
||||
}));
|
||||
appendOutput?.('DY');
|
||||
await new Promise((resolve) => setTimeout(resolve, 40));
|
||||
});
|
||||
} finally {
|
||||
await act(async () => renderer?.unmount());
|
||||
actEnvironment.IS_REACT_ACT_ENVIRONMENT = previousActEnvironment;
|
||||
}
|
||||
|
||||
assert.equal(runCount, 1);
|
||||
});
|
||||
|
||||
test('output trigger scan buffer consumes scanned content and only keeps overlap', () => {
|
||||
const buffer = createOutputTriggerScanBuffer(4);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
import type { Snippet } from '@/domain/models';
|
||||
import type { Host, Snippet } from '@/domain/models';
|
||||
import { snippetAppliesToOutputTrigger } from '@/domain/snippetTargets.ts';
|
||||
import { isScriptSnippet } from '@/domain/snippetScript.ts';
|
||||
import {
|
||||
@@ -19,7 +19,7 @@ const OUTPUT_TRIGGER_DROPPED_OVERFLOW_SCAN_WINDOW_CHARS = 2048;
|
||||
|
||||
type OutputTriggerContext = {
|
||||
sessionId: string;
|
||||
hostId?: string;
|
||||
host?: Pick<Host, 'id' | 'group'>;
|
||||
snippets: Snippet[];
|
||||
onRunScript: (snippet: Snippet, sessionId: string) => void | Promise<void>;
|
||||
};
|
||||
@@ -575,22 +575,31 @@ export function findMatchEndingAfter(text: string, pattern: string, minEndOffset
|
||||
return null;
|
||||
}
|
||||
|
||||
export function hasApplicableOutputTriggerSnippet(snippets: Snippet[], hostId?: string): boolean {
|
||||
export function hasApplicableOutputTriggerSnippet(
|
||||
snippets: Snippet[],
|
||||
host?: Pick<Host, 'id' | 'group'> | string,
|
||||
): boolean {
|
||||
return snippets.some((snippet) => (
|
||||
isScriptSnippet(snippet)
|
||||
&& snippet.trigger === 'onOutput'
|
||||
&& Boolean(snippet.triggerPattern)
|
||||
&& Boolean(snippet.id)
|
||||
&& snippetAppliesToOutputTrigger(snippet, hostId)
|
||||
&& snippetAppliesToOutputTrigger(snippet, host)
|
||||
));
|
||||
}
|
||||
|
||||
export function useOutputTriggers({
|
||||
sessionId,
|
||||
hostId,
|
||||
host,
|
||||
snippets,
|
||||
onRunScript,
|
||||
}: OutputTriggerContext) {
|
||||
const targetHostId = host?.id;
|
||||
const targetHostGroup = host?.group;
|
||||
const targetHost = useMemo(
|
||||
() => targetHostId ? { id: targetHostId, group: targetHostGroup } : undefined,
|
||||
[targetHostGroup, targetHostId],
|
||||
);
|
||||
const launchingRef = useRef(false);
|
||||
const lastTriggerMatchEndRef = useRef(new Map<string, number>());
|
||||
const serverOutputFilterRef = useRef(createTerminalOutputTriggerFilter());
|
||||
@@ -600,8 +609,8 @@ export function useOutputTriggers({
|
||||
const pendingDroppedOverflowFinalActionRef = useRef<'leave' | null>(null);
|
||||
const pendingDroppedOverflowScanStateResetRef = useRef(false);
|
||||
const hasOutputTriggers = useMemo(
|
||||
() => hasApplicableOutputTriggerSnippet(snippets, hostId),
|
||||
[hostId, snippets],
|
||||
() => hasApplicableOutputTriggerSnippet(snippets, targetHost),
|
||||
[snippets, targetHost],
|
||||
);
|
||||
|
||||
const scanOutput = useCallback((scannableText: string) => {
|
||||
@@ -621,7 +630,7 @@ export function useOutputTriggers({
|
||||
if (!isScriptSnippet(snippet) || snippet.trigger !== 'onOutput' || !snippet.triggerPattern || !snippet.id) {
|
||||
continue;
|
||||
}
|
||||
if (!snippetAppliesToOutputTrigger(snippet, hostId)) continue;
|
||||
if (!snippetAppliesToOutputTrigger(snippet, targetHost)) continue;
|
||||
try {
|
||||
const matched = findMatchEndingAfter(scanWindow.text, snippet.triggerPattern, scanWindow.minEndOffset);
|
||||
if (!matched) {
|
||||
@@ -647,7 +656,7 @@ export function useOutputTriggers({
|
||||
// ignore invalid regex
|
||||
}
|
||||
}
|
||||
}, [hasOutputTriggers, hostId, onRunScript, sessionId, snippets]);
|
||||
}, [hasOutputTriggers, onRunScript, sessionId, snippets, targetHost]);
|
||||
|
||||
const scanOutputRef = useRef(scanOutput);
|
||||
scanOutputRef.current = scanOutput;
|
||||
@@ -813,7 +822,7 @@ export function useOutputTriggers({
|
||||
outputTriggerScanSuppressedRef.current = false;
|
||||
pendingDroppedOverflowFinalActionRef.current = null;
|
||||
pendingDroppedOverflowScanStateResetRef.current = false;
|
||||
}, [sessionId, hostId, hasOutputTriggers, outputTriggerEventProcessor]);
|
||||
}, [sessionId, targetHost, hasOutputTriggers, outputTriggerEventProcessor]);
|
||||
|
||||
useEffect(() => () => {
|
||||
outputTriggerEventProcessor.reset();
|
||||
|
||||
@@ -52,6 +52,7 @@ import {
|
||||
STORAGE_KEY_SESSION_LOGS_ENABLED,
|
||||
STORAGE_KEY_RESTORE_PREVIOUS_SESSION,
|
||||
STORAGE_KEY_RESTORE_TERMINAL_CWD,
|
||||
STORAGE_KEY_STARTUP_LANDING,
|
||||
STORAGE_KEY_SESSION_LOGS_DIR,
|
||||
STORAGE_KEY_SESSION_LOGS_FORMAT,
|
||||
STORAGE_KEY_SESSION_LOGS_TIMESTAMPS_ENABLED,
|
||||
@@ -146,6 +147,10 @@ import {
|
||||
type HostClickBehavior,
|
||||
} from './settingsStateDefaults';
|
||||
import { isHostClickBehavior } from '../../domain/hostClickBehavior';
|
||||
import {
|
||||
resolveStartupLandingSetting,
|
||||
type StartupLanding,
|
||||
} from '../../domain/startupLanding';
|
||||
import { resolveRestorePreviousSessionSetting, resolveRestoreTerminalCwdSetting } from './sessionRestoreSettings';
|
||||
import { sessionRestoreStorage } from './sessionRestoreStorage';
|
||||
import { useSettingsStorageSync } from './settingsStorageSync';
|
||||
@@ -431,6 +436,9 @@ export const useSettingsState = (options: { enableSettingsSync?: boolean; enable
|
||||
const stored = localStorageAdapter.readBoolean(STORAGE_KEY_RESTORE_TERMINAL_CWD);
|
||||
return resolveRestoreTerminalCwdSetting(stored);
|
||||
});
|
||||
const [startupLanding, setStartupLandingState] = useState<StartupLanding>(() => {
|
||||
return resolveStartupLandingSetting(readStoredString(STORAGE_KEY_STARTUP_LANDING));
|
||||
});
|
||||
const [sftpTransferConcurrency, setSftpTransferConcurrencyState] = useState<number>(() => {
|
||||
return resolveSftpTransferConcurrency(() =>
|
||||
localStorageAdapter.readNumber(STORAGE_KEY_SFTP_TRANSFER_CONCURRENCY),
|
||||
@@ -955,6 +963,7 @@ export const useSettingsState = (options: { enableSettingsSync?: boolean; enable
|
||||
setRestorePreviousSessionState(resolveRestorePreviousSessionSetting(storedRestorePreviousSession));
|
||||
const storedRestoreTerminalCwd = localStorageAdapter.readBoolean(STORAGE_KEY_RESTORE_TERMINAL_CWD);
|
||||
setRestoreTerminalCwdState(resolveRestoreTerminalCwdSetting(storedRestoreTerminalCwd));
|
||||
setStartupLandingState(resolveStartupLandingSetting(readStoredString(STORAGE_KEY_STARTUP_LANDING)));
|
||||
|
||||
// Workspace focus style
|
||||
const storedFocusStyle = readStoredString(STORAGE_KEY_WORKSPACE_FOCUS_STYLE);
|
||||
@@ -1123,6 +1132,7 @@ export const useSettingsState = (options: { enableSettingsSync?: boolean; enable
|
||||
setDisableTerminalFontZoomState,
|
||||
setRestorePreviousSessionState,
|
||||
setRestoreTerminalCwdState,
|
||||
setStartupLandingState,
|
||||
setSftpTransferConcurrencyState,
|
||||
setSshTransportIdleTtlMsState,
|
||||
});
|
||||
@@ -1153,7 +1163,7 @@ export const useSettingsState = (options: { enableSettingsSync?: boolean; enable
|
||||
terminalThemeId, followAppTerminalTheme, terminalFontFamilyId, terminalFontSize,
|
||||
sftpDoubleClickBehavior, sftpAutoSync, sftpShowHiddenFiles,
|
||||
sftpUseCompressedUpload, sftpSkipUnchanged, sftpAutoOpenSidebar, sftpFollowTerminalCwd, sftpDefaultViewMode,
|
||||
showRecentHosts, hostClickBehavior, showOnlyUngroupedHostsInRoot, showSftpTab, showHostTreeSidebar, terminalSidePanelAutoOpen, terminalSidePanelAutoOpenTab, shellOnlyTabNumberShortcuts, showTabNumberBadges, disableTerminalFontZoom, restorePreviousSession, restoreTerminalCwd,
|
||||
showRecentHosts, hostClickBehavior, showOnlyUngroupedHostsInRoot, showSftpTab, showHostTreeSidebar, terminalSidePanelAutoOpen, terminalSidePanelAutoOpenTab, shellOnlyTabNumberShortcuts, showTabNumberBadges, disableTerminalFontZoom, restorePreviousSession, restoreTerminalCwd, startupLanding,
|
||||
editorWordWrap, sessionLogsEnabled, sessionLogsDir, sessionLogsFormat, sessionLogsTimestampsEnabled, sshDebugLogsEnabled, sshDeepLinkEnabled, jmsDeepLinkEnabled, explorerContextMenuEnabled,
|
||||
globalHotkeyEnabled, autoUpdateEnabled, windowOpacity, appIconVariant,
|
||||
setTheme, setLightUiThemeId, setDarkUiThemeId, setAccentMode,
|
||||
@@ -1163,7 +1173,7 @@ export const useSettingsState = (options: { enableSettingsSync?: boolean; enable
|
||||
setFollowAppTerminalThemeState, setTerminalFontFamilyId, setTerminalFontSize: applyIncomingTerminalFontSize,
|
||||
setSftpDoubleClickBehavior, setSftpAutoSync, setSftpShowHiddenFiles,
|
||||
setSftpUseCompressedUpload, setSftpSkipUnchanged, setSftpAutoOpenSidebar, setSftpFollowTerminalCwd, setSftpDefaultViewMode,
|
||||
setShowRecentHostsState, setHostClickBehaviorState, setShowOnlyUngroupedHostsInRootState, setShowSftpTabState, setShowHostTreeSidebarState, setTerminalSidePanelAutoOpenState, setTerminalSidePanelAutoOpenTabState, setShellOnlyTabNumberShortcutsState, setShowTabNumberBadgesState, setDisableTerminalFontZoomState, setRestorePreviousSessionState, setRestoreTerminalCwdState,
|
||||
setShowRecentHostsState, setHostClickBehaviorState, setShowOnlyUngroupedHostsInRootState, setShowSftpTabState, setShowHostTreeSidebarState, setTerminalSidePanelAutoOpenState, setTerminalSidePanelAutoOpenTabState, setShellOnlyTabNumberShortcutsState, setShowTabNumberBadgesState, setDisableTerminalFontZoomState, setRestorePreviousSessionState, setRestoreTerminalCwdState, setStartupLandingState,
|
||||
setEditorWordWrapState, setSessionLogsEnabled, setSessionLogsDir, setSessionLogsFormat, setSessionLogsTimestampsEnabled, setSshDebugLogsEnabled, setSshDeepLinkEnabledState: applyIncomingSshDeepLinkEnabled, setJmsDeepLinkEnabledState: applyIncomingJmsDeepLinkEnabled, setExplorerContextMenuEnabledState: applyIncomingExplorerContextMenuEnabled,
|
||||
setGlobalHotkeyEnabled, setWindowOpacity: applyIncomingWindowOpacity, setAppIconVariant, setAutoUpdateEnabled, setWorkspaceFocusStyleState,
|
||||
setSftpTransferConcurrencyState, setSshTransportIdleTtlMsState,
|
||||
@@ -1360,6 +1370,13 @@ export const useSettingsState = (options: { enableSettingsSync?: boolean; enable
|
||||
notifySettingsChanged(STORAGE_KEY_RESTORE_TERMINAL_CWD, enabled);
|
||||
}, [notifySettingsChanged]);
|
||||
|
||||
const setStartupLanding = useCallback((landing: StartupLanding) => {
|
||||
setStartupLandingState(landing);
|
||||
localStorageAdapter.writeString(STORAGE_KEY_STARTUP_LANDING, landing);
|
||||
if (!persistMountedRef.current) return;
|
||||
notifySettingsChanged(STORAGE_KEY_STARTUP_LANDING, landing);
|
||||
}, [notifySettingsChanged]);
|
||||
|
||||
// Apply and persist custom CSS
|
||||
useEffect(() => {
|
||||
applyCustomCssToDocument(customCSS);
|
||||
@@ -1964,6 +1981,8 @@ export const useSettingsState = (options: { enableSettingsSync?: boolean; enable
|
||||
setRestorePreviousSession,
|
||||
restoreTerminalCwd,
|
||||
setRestoreTerminalCwd,
|
||||
startupLanding,
|
||||
setStartupLanding,
|
||||
sftpTransferConcurrency,
|
||||
setSftpTransferConcurrency,
|
||||
sshTransportIdleTtlMs,
|
||||
|
||||
@@ -30,7 +30,7 @@ import { buildSftpHostCredentials } from "./sftp/useSftpHostCredentials";
|
||||
import { useSftpFileWatch } from "./sftp/useSftpFileWatch";
|
||||
import { useSftpSessionCleanup } from "./sftp/useSftpSessionCleanup";
|
||||
import { useSftpSessionErrors } from "./sftp/useSftpSessionErrors";
|
||||
import { ensureRemoteSftpSession } from "./sftp/ensureRemoteSftpSession";
|
||||
import { ensureRemoteSftpSession, probeSftpSession } from "./sftp/ensureRemoteSftpSession";
|
||||
import { openTransferSftpSession } from "./sftp/dedicatedTransferResume";
|
||||
import {
|
||||
createTransferPoolKeyCache,
|
||||
@@ -316,9 +316,7 @@ export const useSftpState = (
|
||||
// Prefer borrowing the live (or parked) terminal SSH transport so MFA is
|
||||
// not repeated. Transport leases keep the shared conn alive after the
|
||||
// terminal tab closes until the transfer SFTP lease is returned.
|
||||
const sourceSessionId = !host.sftpSudo
|
||||
? resolveTransferSourceSessionId?.(host.id, host)
|
||||
: undefined;
|
||||
const sourceSessionId = resolveTransferSourceSessionId?.(host.id, host);
|
||||
if (sourceSessionId) {
|
||||
try {
|
||||
logger.info(
|
||||
@@ -608,16 +606,7 @@ export const useSftpState = (
|
||||
forceReconnect: ensureOptions?.forceReconnect,
|
||||
releaseConnection,
|
||||
tabId,
|
||||
probeSession: async (sftpId) => {
|
||||
// Lightweight liveness check; any session-error from the bridge
|
||||
// triggers a reconnect in ensureRemoteSftpSession.
|
||||
if (!bridge?.getSftpHomeDir) return true;
|
||||
const result = await bridge.getSftpHomeDir(sftpId);
|
||||
if (result && result.success === false) {
|
||||
throw new Error(result.error || "SFTP session not found");
|
||||
}
|
||||
return true;
|
||||
},
|
||||
probeSession: (sftpId) => probeSftpSession(bridge, sftpId),
|
||||
});
|
||||
},
|
||||
resolveConnectedHost: (tabId) => connectedHostByTabIdRef.current.get(tabId) ?? null,
|
||||
@@ -704,6 +693,12 @@ export const useSftpState = (
|
||||
const pane = getActivePane(side);
|
||||
if (!pane?.connection || pane.connection.isLocal) continue;
|
||||
if (sftpSessionsRef.current.has(pane.connection.id)) continue;
|
||||
const connectedHost = connectedHostByTabIdRef.current.get(pane.id) ?? null;
|
||||
const vaultHost = hosts.find((host) => host.id === pane.connection?.hostId) ?? null;
|
||||
const targetHost = connectedHost && connectedHost !== "local" ? connectedHost : vaultHost;
|
||||
const resolvedSourceSessionId = targetHost
|
||||
? resolveBrowseSourceSessionId?.(targetHost.id, targetHost)
|
||||
: undefined;
|
||||
try {
|
||||
await ensureRemoteSftpSession({
|
||||
side,
|
||||
@@ -713,16 +708,10 @@ export const useSftpState = (
|
||||
connect,
|
||||
resolveConnectedHost: (id) => connectedHostByTabIdRef.current.get(id) ?? null,
|
||||
resolveHostById: (hostId) => hosts.find((host) => host.id === hostId) ?? null,
|
||||
resolveSourceSessionId: resolveBrowseSourceSessionId,
|
||||
probeSession: async (sftpId) => {
|
||||
const bridge = netcattyBridge.get();
|
||||
if (!bridge?.getSftpHomeDir) return true;
|
||||
const result = await bridge.getSftpHomeDir(sftpId);
|
||||
if (result && result.success === false) {
|
||||
throw new Error(result.error || "SFTP session not found");
|
||||
}
|
||||
return true;
|
||||
},
|
||||
resolveSourceSessionId: resolvedSourceSessionId
|
||||
? () => resolvedSourceSessionId
|
||||
: resolveBrowseSourceSessionId,
|
||||
probeSession: (sftpId) => probeSftpSession(netcattyBridge.get(), sftpId),
|
||||
releaseConnection,
|
||||
});
|
||||
logger.info(`[SFTP] Restored browse session on ${side}`);
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
resolveVaultAgentEffectiveHost,
|
||||
resolveVaultAgentNotes,
|
||||
} from './useVaultAgentBridge';
|
||||
import type { Host } from '../../domain/models';
|
||||
import { publishNotesSnapshot } from './notesStore';
|
||||
|
||||
type Snapshot = Parameters<typeof haveSameVaultAgentSnapshot>[0];
|
||||
@@ -28,10 +29,10 @@ describe('haveSameVaultAgentSnapshot', () => {
|
||||
|
||||
describe('resolveVaultAgentEffectiveHost', () => {
|
||||
it('uses the latest snapshotted group defaults', () => {
|
||||
const host = {
|
||||
const host: Host = {
|
||||
id: 'host-1', label: 'Host', hostname: 'host.test', username: 'root',
|
||||
group: 'production', tags: [], os: 'linux',
|
||||
} as const;
|
||||
};
|
||||
|
||||
assert.equal(
|
||||
resolveVaultAgentEffectiveHost(host, [{ path: 'production', protocol: 'telnet' }], []).protocol,
|
||||
|
||||
@@ -16,6 +16,10 @@ import {
|
||||
resolveDefaultKeyPassphraseAliases,
|
||||
} from '../defaultKeyPassphrases';
|
||||
import { getNotesActions, getNotesSnapshot, subscribeNotes } from './notesStore';
|
||||
import type {
|
||||
VaultGroupMutationResult,
|
||||
VaultGroupMutationState,
|
||||
} from '../../domain/vaultGroupMutation';
|
||||
|
||||
export interface UseVaultAgentBridgeInput {
|
||||
hosts: Host[];
|
||||
@@ -29,12 +33,17 @@ export interface UseVaultAgentBridgeInput {
|
||||
terminalSettings?: Pick<TerminalSettings, 'keepaliveInterval' | 'keepaliveCountMax'>;
|
||||
updateHosts: (hosts: Host[]) => void;
|
||||
updateKeys: (keys: SSHKey[]) => Promise<unknown> | unknown;
|
||||
updateSnippets: (snippets: Snippet[]) => void;
|
||||
updateSnippets: (
|
||||
snippets: Snippet[] | ((current: Snippet[]) => Snippet[]),
|
||||
) => void;
|
||||
customGroups: string[];
|
||||
updateCustomGroups: (groups: string[]) => void;
|
||||
groupConfigs: GroupConfig[];
|
||||
updateGroupConfigs: (configs: GroupConfig[]) => void;
|
||||
updateManagedSources: (sources: ManagedSource[]) => void;
|
||||
commitVaultGroupMutation: (
|
||||
mutate: (current: VaultGroupMutationState) => VaultGroupMutationResult,
|
||||
) => Promise<VaultGroupMutationResult | { ok: false; superseded: true }>;
|
||||
updatePortForwardingRules: (rules: PortForwardingRule[]) => void;
|
||||
/** Optional override; defaults to notesStore so App need not subscribe to notes. */
|
||||
notes?: VaultNote[];
|
||||
@@ -185,6 +194,17 @@ export function useVaultAgentBridge(input: UseVaultAgentBridgeInput): void {
|
||||
vaultSnapshotRef.current.hosts = hosts;
|
||||
current.updateHosts(hosts);
|
||||
},
|
||||
commitVaultGroupMutation: async (mutate) => {
|
||||
const result = await current.commitVaultGroupMutation(mutate);
|
||||
if (result.ok) {
|
||||
vaultSnapshotRef.current.customGroups = result.state.groups;
|
||||
vaultSnapshotRef.current.groupConfigs = result.state.configs;
|
||||
vaultSnapshotRef.current.hosts = result.state.hosts;
|
||||
vaultSnapshotRef.current.managedSources = result.state.managedSources;
|
||||
vaultSnapshotRef.current.snippets = result.state.snippets;
|
||||
}
|
||||
return result;
|
||||
},
|
||||
saveKeyPassphrase: (keyPath, passphrase) => rememberKeyPassphrase({
|
||||
keyPath,
|
||||
passphrase,
|
||||
@@ -222,9 +242,11 @@ export function useVaultAgentBridge(input: UseVaultAgentBridgeInput): void {
|
||||
vaultSnapshotRef.current.notes = notes;
|
||||
applyUpdateNotes(notes);
|
||||
},
|
||||
updateSnippets: (nextSnippets) => {
|
||||
vaultSnapshotRef.current.snippets = nextSnippets;
|
||||
current.updateSnippets(nextSnippets);
|
||||
updateSnippets: (snippetUpdate) => {
|
||||
vaultSnapshotRef.current.snippets = typeof snippetUpdate === 'function'
|
||||
? snippetUpdate(vaultSnapshotRef.current.snippets)
|
||||
: snippetUpdate;
|
||||
current.updateSnippets(snippetUpdate);
|
||||
},
|
||||
startTunnel: current.startTunnel,
|
||||
stopTunnel: current.stopTunnel,
|
||||
|
||||
@@ -31,19 +31,16 @@ test("group deletion removes saved settings in the same Vault transaction", asyn
|
||||
managedSources: storedSources,
|
||||
onReadPersistedHosts: async () => [],
|
||||
onReadPersistedManagedSources: () => storedSources,
|
||||
onCommitVaultImportTransaction: async (
|
||||
_hosts,
|
||||
updateGroups,
|
||||
updateSources,
|
||||
updateGroupConfigs,
|
||||
) => {
|
||||
committedGroupConfigs = updateGroupConfigs?.(storedGroupConfigs) ?? storedGroupConfigs;
|
||||
return {
|
||||
status: "persisted",
|
||||
groups: updateGroups(storedGroups),
|
||||
sources: updateSources(storedSources),
|
||||
groupConfigs: committedGroupConfigs,
|
||||
};
|
||||
onCommitVaultGroupMutation: async (mutate) => {
|
||||
const result = mutate({
|
||||
groups: storedGroups,
|
||||
configs: storedGroupConfigs,
|
||||
hosts: [],
|
||||
managedSources: storedSources,
|
||||
snippets: [],
|
||||
});
|
||||
if (result.ok) committedGroupConfigs = result.state.configs;
|
||||
return result;
|
||||
},
|
||||
});
|
||||
return null;
|
||||
@@ -102,14 +99,9 @@ test("group deletion restores managed files when the persisted Vault cannot be r
|
||||
onClearAndRemoveManagedSources: async () => async () => {
|
||||
restoreCount += 1;
|
||||
},
|
||||
onCommitVaultImportTransaction: async () => {
|
||||
onCommitVaultGroupMutation: async () => {
|
||||
commitCount += 1;
|
||||
return {
|
||||
status: "persisted",
|
||||
groups: [],
|
||||
sources: [],
|
||||
groupConfigs: [],
|
||||
};
|
||||
throw new Error("unexpected commit");
|
||||
},
|
||||
});
|
||||
return null;
|
||||
@@ -187,21 +179,15 @@ test("group deletion retries file clearing when another managed source enters th
|
||||
restoreCount += 1;
|
||||
};
|
||||
},
|
||||
onCommitVaultImportTransaction: async (
|
||||
_hosts,
|
||||
updateGroups,
|
||||
updateSources,
|
||||
updateGroupConfigs,
|
||||
expectedHosts,
|
||||
) => {
|
||||
onCommitVaultGroupMutation: async (mutate) => {
|
||||
commitCount += 1;
|
||||
assert.deepEqual(expectedHosts, []);
|
||||
return {
|
||||
status: "persisted",
|
||||
groups: updateGroups(["Production"]),
|
||||
sources: updateSources([firstSource, concurrentSource]),
|
||||
groupConfigs: updateGroupConfigs?.([]) ?? [],
|
||||
};
|
||||
return mutate({
|
||||
groups: ["Production"],
|
||||
configs: [],
|
||||
hosts: [],
|
||||
managedSources: [firstSource, concurrentSource],
|
||||
snippets: [],
|
||||
});
|
||||
},
|
||||
});
|
||||
return null;
|
||||
@@ -228,3 +214,67 @@ test("group deletion retries file clearing when another managed source enters th
|
||||
assert.equal(restoreCount, 1);
|
||||
assert.equal(commitCount, 1);
|
||||
});
|
||||
|
||||
test("group deletion restores managed files and does not report success when commit fails", async () => {
|
||||
const actEnvironment = globalThis as typeof globalThis & {
|
||||
IS_REACT_ACT_ENVIRONMENT?: boolean;
|
||||
};
|
||||
const previousActEnvironment = actEnvironment.IS_REACT_ACT_ENVIRONMENT;
|
||||
actEnvironment.IS_REACT_ACT_ENVIRONMENT = true;
|
||||
|
||||
const source: ManagedSource = {
|
||||
id: "managed-production",
|
||||
type: "ssh_config",
|
||||
filePath: "/tmp/managed-production.conf",
|
||||
groupName: "Production",
|
||||
lastSyncedAt: 1,
|
||||
};
|
||||
let deleteGroups: ((paths: Iterable<string>) => Promise<void>) | undefined;
|
||||
let renderer: ReactTestRenderer | null = null;
|
||||
let restoreCount = 0;
|
||||
let reportedCount = 0;
|
||||
|
||||
const Probe = () => {
|
||||
deleteGroups = useVaultGroupDeletion({
|
||||
customGroups: ["Production"],
|
||||
hosts: [],
|
||||
groupConfigs: [],
|
||||
managedSources: [source],
|
||||
onReadPersistedHosts: async () => [],
|
||||
onReadPersistedManagedSources: () => [source],
|
||||
onClearAndRemoveManagedSources: async () => async () => {
|
||||
restoreCount += 1;
|
||||
},
|
||||
onCommitVaultGroupMutation: async () => {
|
||||
throw new Error("Vault quota exhausted");
|
||||
},
|
||||
onDeletedPaths: () => {
|
||||
reportedCount += 1;
|
||||
},
|
||||
});
|
||||
return null;
|
||||
};
|
||||
|
||||
let deletionError: unknown;
|
||||
try {
|
||||
await act(async () => {
|
||||
renderer = create(React.createElement(Probe));
|
||||
});
|
||||
try {
|
||||
await act(async () => {
|
||||
await deleteGroups?.(["Production"]);
|
||||
});
|
||||
} catch (error) {
|
||||
deletionError = error;
|
||||
}
|
||||
} finally {
|
||||
await act(async () => {
|
||||
renderer?.unmount();
|
||||
});
|
||||
actEnvironment.IS_REACT_ACT_ENVIRONMENT = previousActEnvironment;
|
||||
}
|
||||
|
||||
assert.match(String(deletionError), /quota exhausted/i);
|
||||
assert.equal(restoreCount, 1);
|
||||
assert.equal(reportedCount, 0);
|
||||
});
|
||||
@@ -1,7 +1,12 @@
|
||||
import { useCallback, useRef } from "react";
|
||||
|
||||
import type { GroupConfig, Host, ManagedSource } from "../../domain/models";
|
||||
import { removeSnippetTargetGroupPaths } from "../../domain/hostGroupPathMutations";
|
||||
import { buildVaultGroupDeletion } from "../../domain/vaultGroupDeletion";
|
||||
import type {
|
||||
VaultGroupMutationResult,
|
||||
VaultGroupMutationState,
|
||||
} from "../../domain/vaultGroupMutation";
|
||||
import {
|
||||
type VaultLockHandle,
|
||||
withVaultImportLock,
|
||||
@@ -26,7 +31,7 @@ export function useVaultGroupDeletion({
|
||||
managedSources,
|
||||
onReadPersistedHosts,
|
||||
onReadPersistedManagedSources,
|
||||
onCommitVaultImportTransaction,
|
||||
onCommitVaultGroupMutation,
|
||||
onClearAndRemoveManagedSource,
|
||||
onClearAndRemoveManagedSources,
|
||||
onDeletedPaths,
|
||||
@@ -37,22 +42,10 @@ export function useVaultGroupDeletion({
|
||||
managedSources: ManagedSource[];
|
||||
onReadPersistedHosts: () => Promise<Host[]>;
|
||||
onReadPersistedManagedSources: () => ManagedSource[];
|
||||
onCommitVaultImportTransaction: (
|
||||
hosts: Host[],
|
||||
updateGroups: (current: string[]) => string[],
|
||||
updateSources: (current: ManagedSource[]) => ManagedSource[],
|
||||
updateGroupConfigs?: (current: GroupConfig[]) => GroupConfig[],
|
||||
expectedHosts?: Host[],
|
||||
onCommitVaultGroupMutation: (
|
||||
mutate: (current: VaultGroupMutationState) => VaultGroupMutationResult,
|
||||
lock?: VaultLockHandle | null,
|
||||
) => Promise<
|
||||
| {
|
||||
status: "persisted";
|
||||
groups: string[];
|
||||
sources: ManagedSource[];
|
||||
groupConfigs: GroupConfig[];
|
||||
}
|
||||
| { status: "superseded" }
|
||||
>;
|
||||
) => Promise<VaultGroupMutationResult | { ok: false; superseded: true }>;
|
||||
onClearAndRemoveManagedSource?: (source: ManagedSource) => Promise<() => Promise<void>>;
|
||||
onClearAndRemoveManagedSources?: (sources: ManagedSource[]) => Promise<() => Promise<void>>;
|
||||
onDeletedPaths?: (selectedRoots: string[]) => void;
|
||||
@@ -120,29 +113,16 @@ export function useVaultGroupDeletion({
|
||||
}
|
||||
deletion = refreshedDeletion;
|
||||
|
||||
const expectedHosts = latestRef.current.hosts;
|
||||
const expectedSources = deletion.sourcesToRemove;
|
||||
const nextHosts = deletion.hosts.filter(
|
||||
(host) => !additionallyDeletedHostIds.has(host.id),
|
||||
);
|
||||
const transaction = await onCommitVaultImportTransaction(
|
||||
nextHosts,
|
||||
(currentGroups) => buildVaultGroupDeletion({
|
||||
selectedPaths,
|
||||
deleteHosts,
|
||||
customGroups: currentGroups,
|
||||
hosts: [],
|
||||
groupConfigs: [],
|
||||
managedSources: [],
|
||||
}).customGroups,
|
||||
(currentSources) => {
|
||||
const transaction = await onCommitVaultGroupMutation(
|
||||
(current) => {
|
||||
const currentDeletion = buildVaultGroupDeletion({
|
||||
selectedPaths,
|
||||
deleteHosts,
|
||||
customGroups: [],
|
||||
hosts: [],
|
||||
groupConfigs: [],
|
||||
managedSources: currentSources,
|
||||
customGroups: current.groups,
|
||||
hosts: current.hosts,
|
||||
groupConfigs: current.configs,
|
||||
managedSources: current.managedSources,
|
||||
});
|
||||
if (!managedSourceSnapshotsMatch(
|
||||
expectedSources,
|
||||
@@ -150,29 +130,40 @@ export function useVaultGroupDeletion({
|
||||
)) {
|
||||
throw RETRY_VAULT_GROUP_DELETION;
|
||||
}
|
||||
const removedIds = new Set(expectedSources.map((source) => source.id));
|
||||
return currentSources.filter((source) => !removedIds.has(source.id));
|
||||
return {
|
||||
ok: true,
|
||||
state: {
|
||||
groups: currentDeletion.customGroups,
|
||||
hosts: currentDeletion.hosts.filter(
|
||||
(host) => !additionallyDeletedHostIds.has(host.id),
|
||||
),
|
||||
configs: currentDeletion.groupConfigs,
|
||||
managedSources: current.managedSources.filter(
|
||||
(source) => !currentDeletion.sourcesToRemove.some(
|
||||
(removed) => removed.id === source.id,
|
||||
),
|
||||
),
|
||||
snippets: removeSnippetTargetGroupPaths(
|
||||
current.snippets,
|
||||
currentDeletion.selectedRoots,
|
||||
),
|
||||
},
|
||||
};
|
||||
},
|
||||
(currentGroupConfigs) => buildVaultGroupDeletion({
|
||||
selectedPaths,
|
||||
deleteHosts,
|
||||
customGroups: [],
|
||||
hosts: [],
|
||||
groupConfigs: currentGroupConfigs,
|
||||
managedSources: [],
|
||||
}).groupConfigs,
|
||||
expectedHosts,
|
||||
lock,
|
||||
);
|
||||
if (transaction.status === "superseded") {
|
||||
// Release the lock so concurrent host saves can finish before retry.
|
||||
if (!transaction.ok && "superseded" in transaction) {
|
||||
// Release the lock so concurrent saves can finish before retry.
|
||||
return { status: "retry" as const, restoreManagedFiles };
|
||||
}
|
||||
if ("error" in transaction) {
|
||||
throw new Error(transaction.error);
|
||||
}
|
||||
latestRef.current = {
|
||||
customGroups: transaction.groups,
|
||||
hosts: nextHosts,
|
||||
groupConfigs: transaction.groupConfigs,
|
||||
managedSources: transaction.sources,
|
||||
customGroups: transaction.state.groups,
|
||||
hosts: transaction.state.hosts,
|
||||
groupConfigs: transaction.state.configs,
|
||||
managedSources: transaction.state.managedSources,
|
||||
};
|
||||
return {
|
||||
status: "done" as const,
|
||||
@@ -205,7 +196,7 @@ export function useVaultGroupDeletion({
|
||||
}, [
|
||||
onClearAndRemoveManagedSource,
|
||||
onClearAndRemoveManagedSources,
|
||||
onCommitVaultImportTransaction,
|
||||
onCommitVaultGroupMutation,
|
||||
onDeletedPaths,
|
||||
onReadPersistedHosts,
|
||||
onReadPersistedManagedSources,
|
||||
|
||||
@@ -66,7 +66,7 @@ test("updateSnippets disk writes take the shared vault lock", () => {
|
||||
// and be visible to waitForPendingVaultWrites.
|
||||
assert.match(
|
||||
source,
|
||||
/const updateSnippets = useCallback\(\(\s*data: Snippet\[\],\s*options\?: \{ replace\?: boolean \},\s*\) => \{[\s\S]*withVaultImportLock\("vault", async \(\) => \{[\s\S]*localStorageAdapter\.write\(STORAGE_KEY_SNIPPETS, rebased\)/,
|
||||
/const updateSnippets = useCallback\(\([\s\S]*withVaultImportLock\("vault", async \(\) => \{[\s\S]*localStorageAdapter\.write\(STORAGE_KEY_SNIPPETS, rebased\)/,
|
||||
);
|
||||
assert.match(
|
||||
source,
|
||||
@@ -95,6 +95,24 @@ test("updateSnippets rebases onto the latest persisted snapshot under the lock",
|
||||
);
|
||||
});
|
||||
|
||||
test("updateSnippets functional updates derive from the latest in-memory snapshot", () => {
|
||||
// Group deletion can wait for managed-source cleanup. A script created while
|
||||
// it waits must still be present when the deletion callback removes the old
|
||||
// group path, so updater callbacks must not derive from the initiating render.
|
||||
assert.match(
|
||||
source,
|
||||
/data: Snippet\[\] \| \(\(current: Snippet\[\]\) => Snippet\[\]\)/,
|
||||
);
|
||||
assert.match(
|
||||
source,
|
||||
/const updater = typeof data === "function" \? data : null;[\s\S]*const current = snippetsRef\.current;[\s\S]*typeof data === "function" \? data\(current\) : data/,
|
||||
);
|
||||
assert.match(
|
||||
source,
|
||||
/updater\(rebaseSnippetVaultWrite\(\{\s*base,\s*ours: current,\s*theirs: latestPersisted,\s*\}\)\)/,
|
||||
);
|
||||
});
|
||||
|
||||
test("clearVaultData replaces snippets without additive rebase", () => {
|
||||
// Clear All Local Data must not preserve concurrent disk-only snippet adds
|
||||
// that rebaseSnippetVaultWrite would otherwise keep.
|
||||
@@ -108,7 +126,7 @@ test("clearVaultData replaces snippets without additive rebase", () => {
|
||||
);
|
||||
assert.match(
|
||||
source,
|
||||
/replace\s*\?\s*cleaned\s*:\s*rebaseSnippetVaultWrite/,
|
||||
/replace\s*\?\s*cleaned\s*:\s*updater\s*\?\s*updater\(rebaseSnippetVaultWrite/,
|
||||
);
|
||||
assert.match(
|
||||
source,
|
||||
@@ -145,7 +163,7 @@ test("updateSnippets keeps the persisted rebase ancestor across superseded saves
|
||||
);
|
||||
assert.match(
|
||||
source,
|
||||
/const base = snippetsWriteBaseRef\.current \?\? snippetsRef\.current/,
|
||||
/const current = snippetsRef\.current;\s*const base = snippetsWriteBaseRef\.current \?\? current/,
|
||||
);
|
||||
assert.match(
|
||||
source,
|
||||
|
||||
@@ -106,10 +106,15 @@ import {
|
||||
persistVaultImportMetadata,
|
||||
readStoredArray,
|
||||
} from "./vaultImportPersistence";
|
||||
import type {
|
||||
VaultGroupMutationResult,
|
||||
VaultGroupMutationState,
|
||||
} from "../../domain/vaultGroupMutation";
|
||||
import {
|
||||
commitPluginImporterTransaction,
|
||||
recoverPluginImporterTransaction,
|
||||
} from "./pluginImporterTransaction";
|
||||
import { commitVaultGroupMutationPersistence } from "./vaultGroupMutationPersistence";
|
||||
|
||||
type ExportableVaultData = {
|
||||
hosts: Host[];
|
||||
@@ -296,6 +301,7 @@ export const useVaultState = () => {
|
||||
const managedSourcesRef = useRef<ManagedSource[]>([]);
|
||||
const hostsRef = useRef<Host[]>([]);
|
||||
const snippetsRef = useRef<Snippet[]>([]);
|
||||
const groupConfigsRef = useRef<GroupConfig[]>([]);
|
||||
const notesRef = useRef<VaultNote[]>([]);
|
||||
const noteGroupsRef = useRef<string[]>([]);
|
||||
const notesPersistFailureNotifiedAtRef = useRef(0);
|
||||
@@ -303,6 +309,7 @@ export const useVaultState = () => {
|
||||
managedSourcesRef.current = managedSources;
|
||||
hostsRef.current = hosts;
|
||||
snippetsRef.current = snippets;
|
||||
groupConfigsRef.current = groupConfigs;
|
||||
notesRef.current = notes;
|
||||
noteGroupsRef.current = noteGroups;
|
||||
|
||||
@@ -314,6 +321,7 @@ export const useVaultState = () => {
|
||||
const identitiesWriteVersion = useRef(0);
|
||||
const proxyProfilesWriteVersion = useRef(0);
|
||||
const snippetsWriteVersion = useRef(0);
|
||||
const managedSourcesWriteVersion = useRef(0);
|
||||
// Tracks the latest local updateSnippets schedule. Storage events also bump
|
||||
// snippetsWriteVersion (to invalidate naive writers), so queued saves must
|
||||
// key supersede checks off this owner instead of that shared counter.
|
||||
@@ -340,6 +348,7 @@ export const useVaultState = () => {
|
||||
const identitiesWritePendingRef = useRef<Promise<unknown>>(Promise.resolve());
|
||||
const groupConfigsWritePendingRef = useRef<Promise<unknown>>(Promise.resolve());
|
||||
const snippetsWritePendingRef = useRef<Promise<unknown>>(Promise.resolve());
|
||||
const managedSourcesWritePendingRef = useRef<Promise<unknown>>(Promise.resolve());
|
||||
|
||||
const waitForPendingVaultWrites = useCallback(async () => {
|
||||
while (true) {
|
||||
@@ -365,6 +374,7 @@ export const useVaultState = () => {
|
||||
identitiesWritePendingRef.current,
|
||||
groupConfigsWritePendingRef.current,
|
||||
snippetsWritePendingRef.current,
|
||||
managedSourcesWritePendingRef.current,
|
||||
];
|
||||
await Promise.all(writePending);
|
||||
if (
|
||||
@@ -373,6 +383,7 @@ export const useVaultState = () => {
|
||||
&& writePending[2] === identitiesWritePendingRef.current
|
||||
&& writePending[3] === groupConfigsWritePendingRef.current
|
||||
&& writePending[4] === snippetsWritePendingRef.current
|
||||
&& writePending[5] === managedSourcesWritePendingRef.current
|
||||
&& encryptPending[0] === hostsEncryptPendingRef.current
|
||||
&& encryptPending[1] === keysEncryptPendingRef.current
|
||||
&& encryptPending[2] === identitiesEncryptPendingRef.current
|
||||
@@ -643,7 +654,7 @@ export const useVaultState = () => {
|
||||
}, []);
|
||||
|
||||
const updateSnippets = useCallback((
|
||||
data: Snippet[],
|
||||
data: Snippet[] | ((current: Snippet[]) => Snippet[]),
|
||||
options?: { replace?: boolean },
|
||||
) => {
|
||||
// Capture the pre-update snapshot for a 3-way rebase once we hold the lock.
|
||||
@@ -653,7 +664,9 @@ export const useVaultState = () => {
|
||||
// second edit does not rebase against the first save's optimistic memory.
|
||||
const replace =
|
||||
options?.replace === true || snippetsWriteReplaceRef.current;
|
||||
const base = snippetsWriteBaseRef.current ?? snippetsRef.current;
|
||||
const updater = typeof data === "function" ? data : null;
|
||||
const current = snippetsRef.current;
|
||||
const base = snippetsWriteBaseRef.current ?? current;
|
||||
if (options?.replace === true) {
|
||||
snippetsWriteReplaceRef.current = true;
|
||||
}
|
||||
@@ -667,7 +680,9 @@ export const useVaultState = () => {
|
||||
} else if (snippetsWriteBaseRef.current === null) {
|
||||
snippetsWriteBaseRef.current = base;
|
||||
}
|
||||
const cleaned = normalizeVaultOrder(data);
|
||||
const cleaned = normalizeVaultOrder(
|
||||
typeof data === "function" ? data(current) : data,
|
||||
);
|
||||
const ver = ++snippetsWriteVersion.current;
|
||||
snippetsWriteOwnerRef.current = ver;
|
||||
// Keep live snapshot ahead of React commit so same-tick readers (delete,
|
||||
@@ -681,20 +696,25 @@ export const useVaultState = () => {
|
||||
// skips the additive rebase so a concurrent disk-only add cannot survive.
|
||||
const writePromise = withVaultImportLock("vault", async () => {
|
||||
if (snippetsWriteOwnerRef.current !== ver) return "superseded" as const;
|
||||
const rebased = normalizeVaultOrder(
|
||||
replace
|
||||
? cleaned
|
||||
const latestPersisted = normalizeVaultOrder(
|
||||
readStoredArray<Snippet>(
|
||||
STORAGE_KEY_SNIPPETS,
|
||||
localStorageAdapter.readString(STORAGE_KEY_SNIPPETS),
|
||||
),
|
||||
);
|
||||
const rebased = normalizeVaultOrder(replace
|
||||
? cleaned
|
||||
: updater
|
||||
? updater(rebaseSnippetVaultWrite({
|
||||
base,
|
||||
ours: current,
|
||||
theirs: latestPersisted,
|
||||
}))
|
||||
: rebaseSnippetVaultWrite({
|
||||
base,
|
||||
ours: cleaned,
|
||||
theirs: normalizeVaultOrder(
|
||||
readStoredArray<Snippet>(
|
||||
STORAGE_KEY_SNIPPETS,
|
||||
localStorageAdapter.readString(STORAGE_KEY_SNIPPETS),
|
||||
),
|
||||
),
|
||||
}),
|
||||
);
|
||||
theirs: latestPersisted,
|
||||
}));
|
||||
const persisted = localStorageAdapter.write(STORAGE_KEY_SNIPPETS, rebased);
|
||||
if (!persisted) {
|
||||
// Keep the pre-update ancestor. Clearing it here would make the next
|
||||
@@ -852,6 +872,7 @@ export const useVaultState = () => {
|
||||
setCustomGroups(next);
|
||||
|
||||
const cleanedGroupConfigs = buildGroupConfigsForGroups(next, groupConfigs);
|
||||
groupConfigsRef.current = cleanedGroupConfigs;
|
||||
setGroupConfigs(cleanedGroupConfigs);
|
||||
const configsVer = ++groupConfigsWriteVersion.current;
|
||||
const encryptPromise = encryptGroupConfigs(cleanedGroupConfigs);
|
||||
@@ -880,13 +901,105 @@ export const useVaultState = () => {
|
||||
const next = typeof data === "function" ? data(managedSourcesRef.current) : data;
|
||||
managedSourcesRef.current = next;
|
||||
setManagedSources(next);
|
||||
void withVaultImportLock("vault", async () => {
|
||||
const ver = ++managedSourcesWriteVersion.current;
|
||||
const writePromise = withVaultImportLock("vault", async () => {
|
||||
// Latest ref wins if another update ran while waiting for the lock.
|
||||
if (managedSourcesRef.current !== next) return;
|
||||
localStorageAdapter.write(STORAGE_KEY_MANAGED_SOURCES, next);
|
||||
if (ver !== managedSourcesWriteVersion.current) return "superseded" as const;
|
||||
return localStorageAdapter.write(STORAGE_KEY_MANAGED_SOURCES, next)
|
||||
? "written" as const
|
||||
: "failed" as const;
|
||||
});
|
||||
managedSourcesWritePendingRef.current = writePromise;
|
||||
return writePromise;
|
||||
}, []);
|
||||
|
||||
const commitVaultGroupMutation = useCallback(async (
|
||||
mutate: (current: VaultGroupMutationState) => VaultGroupMutationResult,
|
||||
lock?: VaultLockHandle | null,
|
||||
): Promise<VaultGroupMutationResult | { ok: false; superseded: true }> => {
|
||||
const captureVersions = () => ({
|
||||
hosts: hostsWriteVersion.current,
|
||||
snippets: snippetsWriteVersion.current,
|
||||
groups: customGroupsWriteVersion.current,
|
||||
configs: groupConfigsWriteVersion.current,
|
||||
sources: managedSourcesWriteVersion.current,
|
||||
});
|
||||
const versionsAreCurrent = (versions: ReturnType<typeof captureVersions>) => (
|
||||
versions.hosts === hostsWriteVersion.current
|
||||
&& versions.snippets === snippetsWriteVersion.current
|
||||
&& versions.groups === customGroupsWriteVersion.current
|
||||
&& versions.configs === groupConfigsWriteVersion.current
|
||||
&& versions.sources === managedSourcesWriteVersion.current
|
||||
);
|
||||
const stateMatchesLiveSnapshot = (current: VaultGroupMutationState) => (
|
||||
JSON.stringify(current.hosts) === JSON.stringify(hostsRef.current)
|
||||
&& JSON.stringify(current.snippets) === JSON.stringify(snippetsRef.current)
|
||||
&& JSON.stringify(current.groups) === JSON.stringify(customGroupsRef.current)
|
||||
&& JSON.stringify(current.configs) === JSON.stringify(groupConfigsRef.current)
|
||||
&& JSON.stringify(current.managedSources) === JSON.stringify(managedSourcesRef.current)
|
||||
);
|
||||
const runCommit = async (
|
||||
versions: ReturnType<typeof captureVersions>,
|
||||
): Promise<VaultGroupMutationResult | { ok: false; superseded: true }> => {
|
||||
const result = await commitVaultGroupMutationPersistence({
|
||||
storage: localStorageAdapter,
|
||||
mutate,
|
||||
prepareState: (state) => {
|
||||
const groups = Array.from(new Set(state.groups));
|
||||
return {
|
||||
groups,
|
||||
configs: buildGroupConfigsForGroups(groups, state.configs),
|
||||
hosts: normalizeVaultOrder(state.hosts.map((host) => sanitizeHost(host))),
|
||||
managedSources: state.managedSources,
|
||||
snippets: normalizeVaultOrder(state.snippets),
|
||||
};
|
||||
},
|
||||
decryptHosts: async (items) => normalizeVaultOrder(
|
||||
(await decryptHosts(items)).map((host) => sanitizeHost(host)),
|
||||
),
|
||||
decryptConfigs: async (items) => normalizeVaultOrder(
|
||||
(await decryptGroupConfigs(items)).map(sanitizeGroupConfig),
|
||||
),
|
||||
encryptHosts,
|
||||
encryptConfigs: encryptGroupConfigs,
|
||||
isCurrent: () => versionsAreCurrent(versions),
|
||||
validateCurrent: lock ? stateMatchesLiveSnapshot : undefined,
|
||||
});
|
||||
if (!result.ok) return result;
|
||||
const nextState = result.state;
|
||||
++hostsWriteVersion.current;
|
||||
++snippetsWriteVersion.current;
|
||||
snippetsWriteOwnerRef.current = snippetsWriteVersion.current;
|
||||
++customGroupsWriteVersion.current;
|
||||
++groupConfigsWriteVersion.current;
|
||||
++managedSourcesWriteVersion.current;
|
||||
hostsRef.current = nextState.hosts;
|
||||
snippetsRef.current = nextState.snippets;
|
||||
customGroupsRef.current = nextState.groups;
|
||||
managedSourcesRef.current = nextState.managedSources;
|
||||
snippetsWriteBaseRef.current = null;
|
||||
snippetsWriteReplaceRef.current = false;
|
||||
setHosts(nextState.hosts);
|
||||
setSnippets(nextState.snippets);
|
||||
setCustomGroups(nextState.groups);
|
||||
setManagedSources(nextState.managedSources);
|
||||
setGroupConfigs(nextState.configs);
|
||||
groupConfigsRef.current = nextState.configs;
|
||||
return { ok: true, state: nextState };
|
||||
};
|
||||
|
||||
if (lock) {
|
||||
const versions = captureVersions();
|
||||
return withVaultImportLockIfNeeded("vault", () => runCommit(versions), lock);
|
||||
}
|
||||
while (true) {
|
||||
await waitForPendingVaultWrites();
|
||||
const versions = captureVersions();
|
||||
const result = await withVaultImportLock("vault", () => runCommit(versions));
|
||||
if (!("superseded" in result)) return result;
|
||||
}
|
||||
}, [waitForPendingVaultWrites]);
|
||||
|
||||
const readPersistedManagedSources = useCallback((): ManagedSource[] => (
|
||||
readStoredArray<ManagedSource>(
|
||||
STORAGE_KEY_MANAGED_SOURCES,
|
||||
@@ -996,6 +1109,8 @@ export const useVaultState = () => {
|
||||
++groupConfigsWriteVersion.current;
|
||||
customGroupsRef.current = result.groups;
|
||||
managedSourcesRef.current = result.sources;
|
||||
hostsRef.current = cleanedHosts;
|
||||
groupConfigsRef.current = nextGroupConfigs;
|
||||
setHosts(cleanedHosts);
|
||||
setCustomGroups(result.groups);
|
||||
setManagedSources(result.sources);
|
||||
@@ -1018,6 +1133,7 @@ export const useVaultState = () => {
|
||||
// sit in memory and re-persist with `fontFamilyOverride: true` until
|
||||
// the next reload. Mirrors updateHosts → sanitizeHost.
|
||||
const cleaned = normalizeVaultOrder(data.map(sanitizeGroupConfig));
|
||||
groupConfigsRef.current = cleaned;
|
||||
setGroupConfigs(cleaned);
|
||||
const ver = ++groupConfigsWriteVersion.current;
|
||||
const encryptPromise = encryptGroupConfigs(cleaned);
|
||||
@@ -1461,7 +1577,10 @@ export const useVaultState = () => {
|
||||
const savedManagedSources = localStorageAdapter.read<ManagedSource[]>(
|
||||
STORAGE_KEY_MANAGED_SOURCES,
|
||||
);
|
||||
if (savedManagedSources) setManagedSources(savedManagedSources);
|
||||
if (savedManagedSources) {
|
||||
managedSourcesRef.current = savedManagedSources;
|
||||
setManagedSources(savedManagedSources);
|
||||
}
|
||||
|
||||
// Load group configs
|
||||
const savedGroupConfigs = localStorageAdapter.read<GroupConfig[]>(STORAGE_KEY_GROUP_CONFIGS);
|
||||
@@ -1471,6 +1590,7 @@ export const useVaultState = () => {
|
||||
if (cancelled) return;
|
||||
if (gcVer === groupConfigsWriteVersion.current) {
|
||||
const sanitizedGC = normalizeVaultOrder(decryptedGC.map(sanitizeGroupConfig));
|
||||
groupConfigsRef.current = sanitizedGC;
|
||||
setGroupConfigs(sanitizedGC);
|
||||
encryptGroupConfigs(sanitizedGC).then((enc) => {
|
||||
if (gcVer === groupConfigsWriteVersion.current)
|
||||
@@ -1641,6 +1761,7 @@ export const useVaultState = () => {
|
||||
if (key === STORAGE_KEY_GROUPS) {
|
||||
const next = safeParse<string[]>(event.newValue) ?? [];
|
||||
++customGroupsWriteVersion.current;
|
||||
customGroupsRef.current = next;
|
||||
setCustomGroups(next);
|
||||
return;
|
||||
}
|
||||
@@ -1695,6 +1816,8 @@ export const useVaultState = () => {
|
||||
|
||||
if (key === STORAGE_KEY_MANAGED_SOURCES) {
|
||||
const next = safeParse<ManagedSource[]>(event.newValue) ?? [];
|
||||
++managedSourcesWriteVersion.current;
|
||||
managedSourcesRef.current = next;
|
||||
setManagedSources(next);
|
||||
return;
|
||||
}
|
||||
@@ -1705,8 +1828,11 @@ export const useVaultState = () => {
|
||||
const seq = ++groupConfigsReadSeq.current;
|
||||
const writeAtStart = groupConfigsWriteVersion.current;
|
||||
decryptGroupConfigs(next).then((dec) => {
|
||||
if (seq === groupConfigsReadSeq.current && writeAtStart === groupConfigsWriteVersion.current)
|
||||
setGroupConfigs(normalizeVaultOrder(dec.map(sanitizeGroupConfig)));
|
||||
if (seq === groupConfigsReadSeq.current && writeAtStart === groupConfigsWriteVersion.current) {
|
||||
const normalized = normalizeVaultOrder(dec.map(sanitizeGroupConfig));
|
||||
groupConfigsRef.current = normalized;
|
||||
setGroupConfigs(normalized);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -1794,7 +1920,7 @@ export const useVaultState = () => {
|
||||
const importData = useCallback(
|
||||
(payload: Partial<ExportableVaultData>): Promise<void> => {
|
||||
const encryptedWrites: Promise<void>[] = [];
|
||||
if (payload.hosts) encryptedWrites.push(updateHosts(payload.hosts));
|
||||
if (payload.hosts) encryptedWrites.push(updateHosts(payload.hosts).then(() => undefined));
|
||||
if (payload.keys) encryptedWrites.push(updateKeys(payload.keys));
|
||||
if (payload.identities) encryptedWrites.push(updateIdentities(payload.identities));
|
||||
if (Array.isArray(payload.proxyProfiles)) encryptedWrites.push(updateProxyProfiles(payload.proxyProfiles));
|
||||
@@ -1952,6 +2078,8 @@ export const useVaultState = () => {
|
||||
]);
|
||||
customGroupsRef.current = nextGroups;
|
||||
snippetsRef.current = nextSnippets;
|
||||
hostsRef.current = nextHosts;
|
||||
groupConfigsRef.current = nextGroupConfigs;
|
||||
snippetsWriteBaseRef.current = null;
|
||||
snippetsWriteReplaceRef.current = false;
|
||||
setHosts(nextHosts);
|
||||
@@ -2008,6 +2136,7 @@ export const useVaultState = () => {
|
||||
updateManagedSources,
|
||||
readPersistedManagedSources,
|
||||
commitVaultImportTransaction,
|
||||
commitVaultGroupMutation,
|
||||
updateGroupConfigs,
|
||||
addShellHistoryEntry,
|
||||
clearShellHistory,
|
||||
|
||||
@@ -0,0 +1,220 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
|
||||
import type { Host, Snippet } from '../../domain/models';
|
||||
import {
|
||||
remapSnippetTargetGroupPaths,
|
||||
removeSnippetTargetGroupPaths,
|
||||
} from '../../domain/hostGroupPathMutations';
|
||||
import {
|
||||
STORAGE_KEY_GROUP_CONFIGS,
|
||||
STORAGE_KEY_GROUPS,
|
||||
STORAGE_KEY_HOSTS,
|
||||
STORAGE_KEY_MANAGED_SOURCES,
|
||||
STORAGE_KEY_SNIPPETS,
|
||||
} from '../../infrastructure/config/storageKeys';
|
||||
import { commitVaultGroupMutationPersistence } from './vaultGroupMutationPersistence';
|
||||
|
||||
const createStorage = (initial: Record<string, unknown>, failKey?: string) => {
|
||||
const values = new Map(Object.entries(initial).map(([key, value]) => [key, JSON.stringify(value)]));
|
||||
return {
|
||||
values,
|
||||
read<T>(key: string): T | null {
|
||||
const value = values.get(key);
|
||||
return value === undefined ? null : JSON.parse(value) as T;
|
||||
},
|
||||
readString: (key: string) => values.get(key) ?? null,
|
||||
write<T>(key: string, value: T) {
|
||||
if (key === failKey) return false;
|
||||
values.set(key, JSON.stringify(value));
|
||||
return true;
|
||||
},
|
||||
writeString(key: string, value: string) {
|
||||
values.set(key, value);
|
||||
return true;
|
||||
},
|
||||
remove(key: string) {
|
||||
values.delete(key);
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
const identity = async <T>(value: T): Promise<T> => value;
|
||||
const prepareState = <T>(value: T): T => value;
|
||||
|
||||
const initialHost: Host = {
|
||||
id: 'host-1', label: 'Host', hostname: 'host.test', username: 'root',
|
||||
group: 'prod', tags: [], os: 'linux',
|
||||
};
|
||||
const initialSnippet: Snippet = {
|
||||
id: 'script-1', label: 'Deploy', command: 'nct.log(1)', kind: 'script',
|
||||
targetGroups: ['prod'],
|
||||
};
|
||||
|
||||
function initialVault() {
|
||||
return {
|
||||
[STORAGE_KEY_HOSTS]: [initialHost],
|
||||
[STORAGE_KEY_GROUPS]: ['prod'],
|
||||
[STORAGE_KEY_MANAGED_SOURCES]: [],
|
||||
[STORAGE_KEY_GROUP_CONFIGS]: [{ path: 'prod', username: 'root' }],
|
||||
[STORAGE_KEY_SNIPPETS]: [initialSnippet],
|
||||
};
|
||||
}
|
||||
|
||||
test('group rename rolls back every Vault key when the snippet write fails', async () => {
|
||||
const initial = initialVault();
|
||||
const storage = createStorage(initial, STORAGE_KEY_SNIPPETS);
|
||||
|
||||
await assert.rejects(commitVaultGroupMutationPersistence({
|
||||
storage,
|
||||
mutate: (current) => ({
|
||||
ok: true,
|
||||
state: {
|
||||
...current,
|
||||
groups: ['production'],
|
||||
configs: current.configs.map((config) => ({ ...config, path: 'production' })),
|
||||
hosts: current.hosts.map((host) => ({ ...host, group: 'production' })),
|
||||
snippets: remapSnippetTargetGroupPaths(current.snippets, 'prod', 'production'),
|
||||
},
|
||||
}),
|
||||
prepareState,
|
||||
decryptHosts: identity,
|
||||
decryptConfigs: identity,
|
||||
encryptHosts: identity,
|
||||
encryptConfigs: identity,
|
||||
isCurrent: () => true,
|
||||
}), /rejected importer transaction/);
|
||||
|
||||
for (const [key, value] of Object.entries(initial)) {
|
||||
assert.deepEqual(storage.read(key), value);
|
||||
}
|
||||
});
|
||||
|
||||
test('group delete rolls back every Vault key when the snippet write fails', async () => {
|
||||
const initial = initialVault();
|
||||
const storage = createStorage(initial, STORAGE_KEY_SNIPPETS);
|
||||
|
||||
await assert.rejects(commitVaultGroupMutationPersistence({
|
||||
storage,
|
||||
mutate: (current) => ({
|
||||
ok: true,
|
||||
state: {
|
||||
...current,
|
||||
groups: [],
|
||||
configs: [],
|
||||
hosts: current.hosts.map((host) => ({ ...host, group: undefined })),
|
||||
snippets: removeSnippetTargetGroupPaths(current.snippets, ['prod']),
|
||||
},
|
||||
}),
|
||||
prepareState,
|
||||
decryptHosts: identity,
|
||||
decryptConfigs: identity,
|
||||
encryptHosts: identity,
|
||||
encryptConfigs: identity,
|
||||
isCurrent: () => true,
|
||||
}), /rejected importer transaction/);
|
||||
|
||||
for (const [key, value] of Object.entries(initial)) {
|
||||
assert.deepEqual(storage.read(key), value);
|
||||
}
|
||||
});
|
||||
|
||||
test('group rename preserves a concurrent snippet update from the locked snapshot', async () => {
|
||||
const concurrentSnippet = { ...initialSnippet, command: 'nct.log(2)' };
|
||||
const addedSnippet: Snippet = {
|
||||
id: 'script-2', label: 'Check', command: 'nct.log(3)', kind: 'script',
|
||||
targetGroups: ['prod/child'],
|
||||
};
|
||||
const storage = createStorage({
|
||||
...initialVault(),
|
||||
[STORAGE_KEY_SNIPPETS]: [concurrentSnippet, addedSnippet],
|
||||
});
|
||||
|
||||
const result = await commitVaultGroupMutationPersistence({
|
||||
storage,
|
||||
mutate: (current) => ({
|
||||
ok: true,
|
||||
state: {
|
||||
...current,
|
||||
groups: ['production'],
|
||||
snippets: remapSnippetTargetGroupPaths(current.snippets, 'prod', 'production'),
|
||||
},
|
||||
}),
|
||||
prepareState,
|
||||
decryptHosts: identity,
|
||||
decryptConfigs: identity,
|
||||
encryptHosts: identity,
|
||||
encryptConfigs: identity,
|
||||
isCurrent: () => true,
|
||||
});
|
||||
|
||||
assert.equal(result.ok, true);
|
||||
const saved = storage.read<Snippet[]>(STORAGE_KEY_SNIPPETS) ?? [];
|
||||
assert.equal(saved[0]?.command, 'nct.log(2)');
|
||||
assert.deepEqual(saved.map((snippet) => snippet.targetGroups), [
|
||||
['production'],
|
||||
['production/child'],
|
||||
]);
|
||||
});
|
||||
|
||||
test('group delete cleans targets from the latest persisted snippet snapshot', async () => {
|
||||
const concurrentSnippet = { ...initialSnippet, command: 'nct.log(2)' };
|
||||
const addedSnippet: Snippet = {
|
||||
id: 'script-2', label: 'Check', command: 'nct.log(3)', kind: 'script',
|
||||
targetGroups: ['prod/child', 'staging'],
|
||||
};
|
||||
const storage = createStorage({
|
||||
...initialVault(),
|
||||
[STORAGE_KEY_SNIPPETS]: [concurrentSnippet, addedSnippet],
|
||||
});
|
||||
|
||||
const result = await commitVaultGroupMutationPersistence({
|
||||
storage,
|
||||
mutate: (current) => ({
|
||||
ok: true,
|
||||
state: {
|
||||
...current,
|
||||
groups: [],
|
||||
snippets: removeSnippetTargetGroupPaths(current.snippets, ['prod']),
|
||||
},
|
||||
}),
|
||||
prepareState,
|
||||
decryptHosts: identity,
|
||||
decryptConfigs: identity,
|
||||
encryptHosts: identity,
|
||||
encryptConfigs: identity,
|
||||
isCurrent: () => true,
|
||||
});
|
||||
|
||||
assert.equal(result.ok, true);
|
||||
const saved = storage.read<Snippet[]>(STORAGE_KEY_SNIPPETS) ?? [];
|
||||
assert.equal(saved[0]?.command, 'nct.log(2)');
|
||||
assert.deepEqual(saved.map((snippet) => snippet.targetGroups), [
|
||||
[],
|
||||
['staging'],
|
||||
]);
|
||||
});
|
||||
|
||||
test('group mutation stops before writing when memory is ahead of persisted Vault state', async () => {
|
||||
const storage = createStorage(initialVault());
|
||||
let mutateCalled = false;
|
||||
|
||||
const result = await commitVaultGroupMutationPersistence({
|
||||
storage,
|
||||
mutate: (current) => {
|
||||
mutateCalled = true;
|
||||
return { ok: true, state: current };
|
||||
},
|
||||
prepareState,
|
||||
decryptHosts: identity,
|
||||
decryptConfigs: identity,
|
||||
encryptHosts: identity,
|
||||
encryptConfigs: identity,
|
||||
isCurrent: () => true,
|
||||
validateCurrent: (current) => current.snippets[0]?.command === 'nct.log(2)',
|
||||
});
|
||||
|
||||
assert.deepEqual(result, { ok: false, superseded: true });
|
||||
assert.equal(mutateCalled, false);
|
||||
assert.deepEqual(storage.read<Snippet[]>(STORAGE_KEY_SNIPPETS), [initialSnippet]);
|
||||
});
|
||||
@@ -0,0 +1,97 @@
|
||||
import type { GroupConfig, Host, ManagedSource, Snippet } from '../../domain/models';
|
||||
import type {
|
||||
VaultGroupMutationResult,
|
||||
VaultGroupMutationState,
|
||||
} from '../../domain/vaultGroupMutation';
|
||||
import {
|
||||
STORAGE_KEY_GROUP_CONFIGS,
|
||||
STORAGE_KEY_GROUPS,
|
||||
STORAGE_KEY_HOSTS,
|
||||
STORAGE_KEY_MANAGED_SOURCES,
|
||||
STORAGE_KEY_SNIPPETS,
|
||||
} from '../../infrastructure/config/storageKeys';
|
||||
import { commitPluginImporterTransaction } from './pluginImporterTransaction';
|
||||
import { readStoredArray } from './vaultImportPersistence';
|
||||
|
||||
type TransactionStorage = {
|
||||
read<T>(key: string): T | null;
|
||||
readString(key: string): string | null;
|
||||
write<T>(key: string, value: T): boolean;
|
||||
writeString(key: string, value: string): boolean;
|
||||
remove(key: string): void;
|
||||
};
|
||||
|
||||
const GROUP_MUTATION_KEYS = [
|
||||
STORAGE_KEY_HOSTS,
|
||||
STORAGE_KEY_GROUPS,
|
||||
STORAGE_KEY_MANAGED_SOURCES,
|
||||
STORAGE_KEY_GROUP_CONFIGS,
|
||||
STORAGE_KEY_SNIPPETS,
|
||||
] as const;
|
||||
|
||||
export async function commitVaultGroupMutationPersistence({
|
||||
storage,
|
||||
mutate,
|
||||
prepareState,
|
||||
decryptHosts,
|
||||
decryptConfigs,
|
||||
encryptHosts,
|
||||
encryptConfigs,
|
||||
isCurrent,
|
||||
validateCurrent,
|
||||
}: {
|
||||
storage: TransactionStorage;
|
||||
mutate: (current: VaultGroupMutationState) => VaultGroupMutationResult;
|
||||
prepareState: (state: VaultGroupMutationState) => VaultGroupMutationState;
|
||||
decryptHosts: (hosts: Host[]) => Promise<Host[]>;
|
||||
decryptConfigs: (configs: GroupConfig[]) => Promise<GroupConfig[]>;
|
||||
encryptHosts: (hosts: Host[]) => Promise<unknown>;
|
||||
encryptConfigs: (configs: GroupConfig[]) => Promise<unknown>;
|
||||
isCurrent: () => boolean;
|
||||
validateCurrent?: (current: VaultGroupMutationState) => boolean;
|
||||
}): Promise<VaultGroupMutationResult | { ok: false; superseded: true }> {
|
||||
const raw = new Map(GROUP_MUTATION_KEYS.map((key) => [key, storage.readString(key)]));
|
||||
const [hosts, configs] = await Promise.all([
|
||||
decryptHosts(readStoredArray<Host>(STORAGE_KEY_HOSTS, raw.get(STORAGE_KEY_HOSTS) ?? null)),
|
||||
decryptConfigs(readStoredArray<GroupConfig>(
|
||||
STORAGE_KEY_GROUP_CONFIGS,
|
||||
raw.get(STORAGE_KEY_GROUP_CONFIGS) ?? null,
|
||||
)),
|
||||
]);
|
||||
const current: VaultGroupMutationState = {
|
||||
groups: readStoredArray<string>(STORAGE_KEY_GROUPS, raw.get(STORAGE_KEY_GROUPS) ?? null),
|
||||
configs,
|
||||
hosts,
|
||||
managedSources: readStoredArray<ManagedSource>(
|
||||
STORAGE_KEY_MANAGED_SOURCES,
|
||||
raw.get(STORAGE_KEY_MANAGED_SOURCES) ?? null,
|
||||
),
|
||||
snippets: readStoredArray<Snippet>(STORAGE_KEY_SNIPPETS, raw.get(STORAGE_KEY_SNIPPETS) ?? null),
|
||||
};
|
||||
if (!isCurrent() || (validateCurrent && !validateCurrent(current))) {
|
||||
return { ok: false, superseded: true };
|
||||
}
|
||||
const mutation = mutate(current);
|
||||
if (!mutation.ok) return mutation;
|
||||
|
||||
const nextState = prepareState(mutation.state);
|
||||
const [encryptedHosts, encryptedConfigs] = await Promise.all([
|
||||
encryptHosts(nextState.hosts),
|
||||
encryptConfigs(nextState.configs),
|
||||
]);
|
||||
if (
|
||||
!isCurrent()
|
||||
|| GROUP_MUTATION_KEYS.some((key) => storage.readString(key) !== raw.get(key))
|
||||
) {
|
||||
return { ok: false, superseded: true };
|
||||
}
|
||||
|
||||
commitPluginImporterTransaction(storage, [
|
||||
[STORAGE_KEY_HOSTS, encryptedHosts],
|
||||
[STORAGE_KEY_GROUPS, nextState.groups],
|
||||
[STORAGE_KEY_MANAGED_SOURCES, nextState.managedSources],
|
||||
[STORAGE_KEY_GROUP_CONFIGS, encryptedConfigs],
|
||||
[STORAGE_KEY_SNIPPETS, nextState.snippets],
|
||||
]);
|
||||
return { ok: true, state: nextState };
|
||||
}
|
||||
@@ -12,7 +12,7 @@ export interface VaultHostTreeActions {
|
||||
onNewGroup: (parentPath?: string) => void;
|
||||
onRenameGroup: (groupPath: string) => void;
|
||||
onDeleteGroup: (groupPath: string) => void;
|
||||
commitInlineGroupRename: (name: string) => void;
|
||||
commitInlineGroupRename: (name: string) => boolean | void | Promise<boolean | void>;
|
||||
cancelInlineGroupEdit: () => void;
|
||||
commitInlineHostRename: (name: string) => void;
|
||||
cancelInlineHostEdit: () => void;
|
||||
|
||||
@@ -81,6 +81,7 @@ test('vault actions register and unregister', () => {
|
||||
readPersistedManagedSources: noop,
|
||||
commitPluginImporterData: noop,
|
||||
commitVaultImportTransaction: noop,
|
||||
commitVaultGroupMutation: noop,
|
||||
updateHostDistro: noop,
|
||||
updateHostLastConnected: noop,
|
||||
addShellHistoryEntry: noop,
|
||||
|
||||
@@ -58,6 +58,7 @@ export type VaultSnapshotActions = Pick<
|
||||
| 'readPersistedManagedSources'
|
||||
| 'commitPluginImporterData'
|
||||
| 'commitVaultImportTransaction'
|
||||
| 'commitVaultGroupMutation'
|
||||
| 'updateHostDistro'
|
||||
| 'updateHostLastConnected'
|
||||
| 'addShellHistoryEntry'
|
||||
|
||||
Binary file not shown.
@@ -89,6 +89,10 @@ interface AIChatPanelContentProps {
|
||||
onOpenVaultNote?: (noteId: string) => void;
|
||||
onOpenVaultHost?: (hostId: string) => void;
|
||||
onOpenVaultSection?: (section: 'notes' | 'hosts') => void;
|
||||
/** Hidden retained panels keep the composer warm without the message tree. */
|
||||
parked?: boolean;
|
||||
/** Disable header transitions while send preflight is in flight. */
|
||||
sending?: boolean;
|
||||
}
|
||||
|
||||
export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
@@ -152,7 +156,37 @@ export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
onOpenVaultNote,
|
||||
onOpenVaultHost,
|
||||
onOpenVaultSection,
|
||||
parked = false,
|
||||
sending = false,
|
||||
}) => {
|
||||
const mentionHosts = React.useMemo(
|
||||
() => terminalSessions.map((session) => ({
|
||||
sessionId: session.sessionId,
|
||||
hostname: session.hostname,
|
||||
label: session.label,
|
||||
connected: session.connected,
|
||||
})),
|
||||
[terminalSessions],
|
||||
);
|
||||
const providerSwitcher = React.useMemo(
|
||||
() => (
|
||||
currentAgentId === 'catty' && cattyConfiguredProviders.length > 0
|
||||
? {
|
||||
providers: cattyConfiguredProviders,
|
||||
selectedProviderId: effectiveActiveProvider?.id,
|
||||
selectedModelId: effectiveActiveModelId || undefined,
|
||||
onSelect: handleAgentProviderModelSelect,
|
||||
}
|
||||
: undefined
|
||||
),
|
||||
[
|
||||
cattyConfiguredProviders,
|
||||
currentAgentId,
|
||||
effectiveActiveModelId,
|
||||
effectiveActiveProvider?.id,
|
||||
handleAgentProviderModelSelect,
|
||||
],
|
||||
);
|
||||
const hiddenParts = getAIPanelDiagnosticHiddenParts();
|
||||
const hideHeader = isAIPanelDiagnosticPartHidden('header', hiddenParts);
|
||||
const hideHistory = isAIPanelDiagnosticPartHidden('history', hiddenParts);
|
||||
@@ -174,6 +208,8 @@ export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
externalAgents={externalAgents}
|
||||
discoveredAgents={discoveredAgents}
|
||||
isDiscovering={isDiscovering}
|
||||
parked={parked}
|
||||
disabled={sending}
|
||||
onSelectAgent={handleAgentChange}
|
||||
onEnableDiscoveredAgent={handleEnableDiscoveredAgent}
|
||||
onRediscover={rediscover}
|
||||
@@ -191,6 +227,7 @@ export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-6 w-6 rounded-md text-muted-foreground/62 hover:bg-white/[0.05] hover:text-foreground"
|
||||
disabled={sending}
|
||||
onClick={() => setShowHistory(!showHistory)}
|
||||
>
|
||||
<History size={12} />
|
||||
@@ -204,6 +241,7 @@ export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-6 w-6 rounded-md text-primary/82 hover:bg-primary/[0.10] hover:text-primary"
|
||||
disabled={sending}
|
||||
onClick={handleNewChat}
|
||||
>
|
||||
<Plus size={13} />
|
||||
@@ -217,12 +255,12 @@ export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
)}
|
||||
|
||||
{/* ── Main content ── */}
|
||||
{showHistory && !hideHistory ? (
|
||||
{!parked && showHistory && !hideHistory ? (
|
||||
<React.Profiler {...getAIPanelProfilerProps('AIChatPanel.History')}>
|
||||
<SessionHistoryDrawer
|
||||
sessions={historySessions}
|
||||
activeSessionId={activeSessionId}
|
||||
onSelect={handleSelectSession}
|
||||
onSelect={sending ? () => undefined : handleSelectSession}
|
||||
onDelete={handleDeleteSession}
|
||||
onClose={() => setShowHistory(false)}
|
||||
/>
|
||||
@@ -230,7 +268,7 @@ export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
) : (
|
||||
<>
|
||||
{/* Chat messages */}
|
||||
{!hideMessages && (
|
||||
{!parked && !hideMessages && (
|
||||
<React.Profiler {...getAIPanelProfilerProps('AIChatPanel.Messages')}>
|
||||
<ChatMessageList
|
||||
messages={messages}
|
||||
@@ -247,7 +285,7 @@ export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
)}
|
||||
|
||||
{/* Recent sessions (Zed-style, shown when no messages) */}
|
||||
{messages.length === 0 && historySessions.length > 0 && !hideRecent && (
|
||||
{!parked && messages.length === 0 && historySessions.length > 0 && !hideRecent && (
|
||||
<React.Profiler {...getAIPanelProfilerProps('AIChatPanel.Recent')}>
|
||||
<div className="shrink-0 px-4 pb-1">
|
||||
<div className="flex items-baseline justify-between mb-2">
|
||||
@@ -262,8 +300,9 @@ export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
{historySessions.slice(0, 3).map((session) => (
|
||||
<button
|
||||
key={session.id}
|
||||
disabled={sending}
|
||||
onClick={() => handleSelectSession(session.id)}
|
||||
className="w-full flex items-baseline justify-between py-1.5 text-left hover:text-foreground transition-colors cursor-pointer"
|
||||
className="w-full flex items-baseline justify-between py-1.5 text-left hover:text-foreground transition-colors cursor-pointer disabled:pointer-events-none disabled:opacity-50"
|
||||
>
|
||||
<span className="text-[13px] text-foreground/60 truncate pr-4">
|
||||
{session.title || t('ai.chat.untitled')}
|
||||
@@ -291,6 +330,7 @@ export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
</div>
|
||||
) : null}
|
||||
<ChatInput
|
||||
parked={parked}
|
||||
value={inputValue}
|
||||
onChange={setInputValue}
|
||||
onSend={handleSend}
|
||||
@@ -309,20 +349,11 @@ export const AIChatPanelContent: React.FC<AIChatPanelContentProps> = ({
|
||||
modelPresets={agentModelPresets}
|
||||
selectedModelId={selectedAgentModel}
|
||||
onModelSelect={handleAgentModelSelect}
|
||||
providerSwitcher={
|
||||
currentAgentId === 'catty' && cattyConfiguredProviders.length > 0
|
||||
? {
|
||||
providers: cattyConfiguredProviders,
|
||||
selectedProviderId: effectiveActiveProvider?.id,
|
||||
selectedModelId: effectiveActiveModelId || undefined,
|
||||
onSelect: handleAgentProviderModelSelect,
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
providerSwitcher={providerSwitcher}
|
||||
files={files}
|
||||
onAddFiles={addFiles}
|
||||
onRemoveFile={removeFile}
|
||||
hosts={terminalSessions.map(s => ({ sessionId: s.sessionId, hostname: s.hostname, label: s.label, connected: s.connected }))}
|
||||
hosts={mentionHosts}
|
||||
selectedUserSkills={selectedUserSkills}
|
||||
userSkills={userSkillOptions}
|
||||
quickMessages={quickMessages}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import React from 'react';
|
||||
import { renderToStaticMarkup } from 'react-dom/server';
|
||||
|
||||
@@ -108,6 +109,51 @@ const baseProps = (overrides: Partial<AIChatSidePanelProps> = {}): AIChatSidePan
|
||||
...overrides,
|
||||
});
|
||||
|
||||
test('send preflight aborts after the panel unmounts or the scope changes', () => {
|
||||
const source = readFileSync(new URL('./AIChatSidePanel.tsx', import.meta.url), 'utf8');
|
||||
assert.match(source, /sendEpochRef/);
|
||||
assert.match(source, /if \(isSendStale\(\)\) return;/);
|
||||
});
|
||||
|
||||
test('send preflight locks header agent and new-chat controls', () => {
|
||||
const panel = readFileSync(new URL('./AIChatSidePanel.tsx', import.meta.url), 'utf8');
|
||||
const content = readFileSync(new URL('./AIChatPanelContent.tsx', import.meta.url), 'utf8');
|
||||
assert.match(panel, /sending=\{isSending\}/);
|
||||
assert.match(content, /disabled=\{sending\}/);
|
||||
const selector = readFileSync(new URL('./ai/AgentSelector.tsx', import.meta.url), 'utf8');
|
||||
assert.match(selector, /if \(parked \|\| disabled\) setOpen\(false\)/);
|
||||
});
|
||||
|
||||
test('first send awaits provider sync instead of idle-deferring it', () => {
|
||||
const source = readFileSync(new URL('./AIChatSidePanel.tsx', import.meta.url), 'utf8');
|
||||
assert.match(source, /await sendBridge\.aiSyncProviders\(providers\)/);
|
||||
assert.match(source, /await sendBridge\.aiSyncWebSearch\(/);
|
||||
assert.doesNotMatch(source, /scheduleWhenAiComposerIdle\(\(\) => \{\s*void bridge\.aiSyncProviders/);
|
||||
});
|
||||
|
||||
test('send and new chat discard pending composer text', () => {
|
||||
const source = readFileSync(new URL('./AIChatSidePanel.tsx', import.meta.url), 'utf8');
|
||||
assert.match(source, /discardPendingComposerText/);
|
||||
assert.match(source, /if \(!options\?\.keepPendingText\) discardPendingComposerText\(\)/);
|
||||
});
|
||||
|
||||
test('text-only draft writes do not emit AI state changes', () => {
|
||||
const source = readFileSync(new URL('../application/state/useAIState.ts', import.meta.url), 'utf8');
|
||||
assert.match(source, /draftsByScopeEqualIgnoringAllComposerText/);
|
||||
assert.match(source, /if \(textOnly\) return;/);
|
||||
});
|
||||
|
||||
test('first composer keystroke does not create a store draft synchronously', () => {
|
||||
const source = readFileSync(new URL('./AIChatSidePanel.tsx', import.meta.url), 'utf8');
|
||||
const setter = source.slice(
|
||||
source.indexOf('const setInputValue = useCallback'),
|
||||
source.indexOf('const addFiles = useCallback'),
|
||||
);
|
||||
assert.match(setter, /pendingComposerTextRef\.current = value/);
|
||||
assert.doesNotMatch(setter, /enterScopeDraftMode/);
|
||||
assert.doesNotMatch(setter, /setTimeout/);
|
||||
});
|
||||
|
||||
test('hidden empty AI side panel can release its subtree', () => {
|
||||
const props = baseProps();
|
||||
|
||||
@@ -184,7 +230,7 @@ test('AI side panel re-renders when retained content becomes visible again', ()
|
||||
), false);
|
||||
});
|
||||
|
||||
test('hidden retained AI side panel skips chat input and message content', () => {
|
||||
test('hidden retained AI side panel keeps the composer and skips message content', () => {
|
||||
const markup = renderToStaticMarkup(
|
||||
React.createElement(
|
||||
I18nProvider,
|
||||
@@ -212,10 +258,11 @@ test('hidden retained AI side panel skips chat input and message content', () =>
|
||||
);
|
||||
|
||||
assert.match(markup, /data-section="ai-chat-panel-retained"/);
|
||||
assert.doesNotMatch(markup, /textarea/);
|
||||
assert.match(markup, /inert/);
|
||||
assert.match(markup, /aria-hidden/);
|
||||
assert.match(markup, /textarea/);
|
||||
assert.doesNotMatch(markup, /hidden-user-message/);
|
||||
assert.doesNotMatch(markup, /hidden-assistant-message/);
|
||||
assert.doesNotMatch(markup, /draft still retained/);
|
||||
});
|
||||
|
||||
test('AI side panel re-renders when command timeout changes', () => {
|
||||
@@ -253,6 +300,25 @@ test('AI side panel skips re-render when only a sibling scope session object cha
|
||||
);
|
||||
});
|
||||
|
||||
test('AI side panel skips re-render when only the composer draft text changes', () => {
|
||||
const empty = draft({ text: '' });
|
||||
const prev = baseProps({
|
||||
isVisible: true,
|
||||
scopeType: 'terminal',
|
||||
scopeTargetId: 'terminal-1',
|
||||
draftsByScope: {
|
||||
'terminal:terminal-1': empty,
|
||||
},
|
||||
});
|
||||
const next = {
|
||||
...prev,
|
||||
draftsByScope: {
|
||||
'terminal:terminal-1': { ...empty, text: '你好', updatedAt: 2 },
|
||||
},
|
||||
};
|
||||
assert.equal(aiChatSidePanelPropsAreEqual(prev, next), true);
|
||||
});
|
||||
|
||||
test('workspace AI panel memo follows visible inherited session, not hidden terminal maps', () => {
|
||||
const visibleMemberChat = session({
|
||||
id: 'chat-visible',
|
||||
|
||||
+211
-93
@@ -38,7 +38,7 @@ import {
|
||||
endSendForKey,
|
||||
tryBeginSendForKey,
|
||||
} from './ai/draftSendGate';
|
||||
import { selectDraftForAgentSwitch } from '../application/state/aiDraftState';
|
||||
import { draftsByScopeEqualIgnoringComposerText, selectDraftForAgentSwitch } from '../application/state/aiDraftState';
|
||||
import {
|
||||
buildPromptWithTerminalSelectionAttachments,
|
||||
isTerminalSelectionAttachment,
|
||||
@@ -79,6 +79,7 @@ import {
|
||||
getAIPanelProfilerProps,
|
||||
profileAIPanelCalculation,
|
||||
} from './ai/aiPanelDiagnostics';
|
||||
import { scheduleWhenAiComposerIdle, warmAiMarkdownRenderer } from './ai/aiMarkdownWarmup';
|
||||
|
||||
type UserSkillsStatusResult = { ok: boolean; skills?: Array<{
|
||||
id: string;
|
||||
@@ -198,15 +199,9 @@ export function shouldKeepAIChatSidePanelMounted(props: AIChatSidePanelProps): b
|
||||
return isAIChatSessionStreaming(sessionId);
|
||||
}
|
||||
|
||||
function shouldDelayAIChatSidePanelActivation(props: AIChatSidePanelProps): boolean {
|
||||
if (!(props.isVisible ?? true)) return false;
|
||||
const scopeKey = `${props.scopeType}:${props.scopeTargetId ?? ''}`;
|
||||
if (props.draftsByScope[scopeKey] || props.panelViewByScope[scopeKey]?.mode === 'draft') {
|
||||
return false;
|
||||
}
|
||||
const sessionId = props.activeSessionIdMap[scopeKey] ?? null;
|
||||
if (isAIChatSessionStreaming(sessionId)) return false;
|
||||
return !hasAIChatSidePanelRetainedContent(props);
|
||||
function shouldDelayAIChatSidePanelActivation(_props: AIChatSidePanelProps): boolean {
|
||||
// Empty-panel activation delay used to land in the expand → first-type window.
|
||||
return false;
|
||||
}
|
||||
|
||||
function schedulePanelActivation(callback: () => void): () => void {
|
||||
@@ -303,6 +298,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
const scopeKey = `${scopeType}:${scopeTargetId ?? ''}`;
|
||||
|
||||
const [showHistory, setShowHistory] = useState(false);
|
||||
const [isSending, setIsSending] = useState(false);
|
||||
const [runtimeAgentModelPresets, setRuntimeAgentModelPresets] = useState<Record<string, AgentModelPreset[]>>({});
|
||||
const [runtimeModelWarnings, setRuntimeModelWarnings] = useState<Record<string, string>>({});
|
||||
const [steerWarnings, setSteerWarnings] = useState<Record<string, SteerWarning>>({});
|
||||
@@ -377,6 +373,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
|
||||
const explicitPanelView = panelViewByScope[scopeKey];
|
||||
const currentDraft = draftsByScope[scopeKey] ?? null;
|
||||
const pendingComposerTextRef = useRef<string | null>(null);
|
||||
const visibleHistorySessionIds = useMemo(
|
||||
() => new Set(historySessions.map((session) => session.id)),
|
||||
[historySessions],
|
||||
@@ -402,12 +399,41 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
const isSteering = activeSessionId != null && steeringSessionId === activeSessionId;
|
||||
const currentAgentId = activeSession?.agentId ?? currentDraft?.agentId ?? defaultAgentId;
|
||||
const observedContextUsage = useAgentContextUsage(activeSessionId);
|
||||
const inputValue = currentDraft?.text ?? '';
|
||||
const inputValue = pendingComposerTextRef.current ?? currentDraft?.text ?? '';
|
||||
const files = currentDraft?.attachments ?? [];
|
||||
const panelViewRef = useRef(normalizedPanelView);
|
||||
panelViewRef.current = normalizedPanelView;
|
||||
const permissionModeRef = useRef(globalPermissionMode);
|
||||
permissionModeRef.current = globalPermissionMode;
|
||||
const sendEpochRef = useRef(0);
|
||||
useEffect(() => () => {
|
||||
sendEpochRef.current += 1;
|
||||
}, [scopeKey]);
|
||||
const currentDraftRef = useRef(currentDraft);
|
||||
currentDraftRef.current = currentDraft;
|
||||
if (pendingComposerTextRef.current != null) {
|
||||
const pending = pendingComposerTextRef.current;
|
||||
if (currentDraft && currentDraft.text === pending) {
|
||||
pendingComposerTextRef.current = null;
|
||||
currentDraftRef.current = currentDraft;
|
||||
} else if (currentDraftRef.current?.text === pending) {
|
||||
if (currentDraft && currentDraftRef.current) {
|
||||
currentDraftRef.current.attachments = currentDraft.attachments;
|
||||
currentDraftRef.current.selectedUserSkillSlugs = currentDraft.selectedUserSkillSlugs;
|
||||
currentDraftRef.current.agentId = currentDraft.agentId;
|
||||
}
|
||||
} else {
|
||||
const base = currentDraft ?? currentDraftRef.current ?? {
|
||||
text: '',
|
||||
agentId: currentAgentId,
|
||||
attachments: [],
|
||||
selectedUserSkillSlugs: [],
|
||||
updatedAt: Date.now(),
|
||||
};
|
||||
currentDraftRef.current = { ...base, text: pending };
|
||||
}
|
||||
} else {
|
||||
currentDraftRef.current = currentDraft;
|
||||
}
|
||||
const activeSessionRef = useRef(activeSession);
|
||||
activeSessionRef.current = activeSession;
|
||||
|
||||
@@ -439,13 +465,9 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
const bridge = getNetcattyBridge();
|
||||
if (!bridge?.aiMcpUpdateSessions) return;
|
||||
|
||||
const timeoutId = window.setTimeout(() => {
|
||||
return scheduleWhenAiComposerIdle(() => {
|
||||
void bridge.aiMcpUpdateSessions(terminalSessions, activeSessionId ?? undefined);
|
||||
}, 250);
|
||||
|
||||
return () => {
|
||||
window.clearTimeout(timeoutId);
|
||||
};
|
||||
}, { initialDelayMs: 250 });
|
||||
}, [isVisible, terminalSessions, activeSessionId]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -517,9 +539,14 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
showSessionView(scopeKey, sessionId);
|
||||
}, [scopeKey, showSessionView]);
|
||||
|
||||
const clearScopeDraft = useCallback(() => {
|
||||
const discardPendingComposerText = useCallback(() => {
|
||||
pendingComposerTextRef.current = null;
|
||||
}, []);
|
||||
|
||||
const clearScopeDraft = useCallback((options?: { keepPendingText?: boolean }) => {
|
||||
if (!options?.keepPendingText) discardPendingComposerText();
|
||||
clearDraftForScope(scopeKey);
|
||||
}, [clearDraftForScope, scopeKey]);
|
||||
}, [clearDraftForScope, discardPendingComposerText, scopeKey]);
|
||||
|
||||
const enterScopeDraftMode = useCallback((agentId: string, preserveSessionView = false) => {
|
||||
applyDraftEntrySelection({
|
||||
@@ -529,14 +556,29 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
});
|
||||
}, [ensureScopeDraft, showScopeDraftView]);
|
||||
|
||||
const setInputValue = useCallback((value: string) => {
|
||||
enterScopeDraftMode(currentAgentId, panelViewRef.current.mode === 'session');
|
||||
updateScopeDraft(currentAgentId, (draft) => ({
|
||||
...draft,
|
||||
text: value,
|
||||
}));
|
||||
const flushDraftText = useCallback(() => {
|
||||
const pending = pendingComposerTextRef.current;
|
||||
if (pending == null) return;
|
||||
if (panelViewRef.current.mode !== 'draft') {
|
||||
enterScopeDraftMode(currentAgentId, panelViewRef.current.mode === 'session');
|
||||
}
|
||||
updateScopeDraft(currentAgentId, (current) => (
|
||||
current.text === pending ? current : { ...current, text: pending }
|
||||
));
|
||||
}, [currentAgentId, enterScopeDraftMode, updateScopeDraft]);
|
||||
|
||||
const setInputValue = useCallback((value: string) => {
|
||||
const base = currentDraftRef.current ?? {
|
||||
text: '',
|
||||
agentId: currentAgentId,
|
||||
attachments: [],
|
||||
selectedUserSkillSlugs: [],
|
||||
updatedAt: Date.now(),
|
||||
};
|
||||
pendingComposerTextRef.current = value;
|
||||
currentDraftRef.current = { ...base, text: value, updatedAt: Date.now() };
|
||||
}, [currentAgentId]);
|
||||
|
||||
const addFiles = useCallback(async (inputFiles: File[]) => {
|
||||
enterScopeDraftMode(currentAgentId, panelViewRef.current.mode === 'session');
|
||||
await addDraftFiles(scopeKey, currentAgentId, inputFiles);
|
||||
@@ -546,6 +588,20 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
removeDraftFile(scopeKey, currentAgentId, fileId);
|
||||
}, [removeDraftFile, scopeKey, currentAgentId]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isVisible) return undefined;
|
||||
flushDraftText();
|
||||
return undefined;
|
||||
}, [flushDraftText, isVisible]);
|
||||
|
||||
useEffect(() => () => {
|
||||
flushDraftText();
|
||||
}, [flushDraftText, scopeKey]);
|
||||
|
||||
useEffect(() => {
|
||||
flushDraftText();
|
||||
}, [activeSessionId, flushDraftText]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isVisible) return;
|
||||
|
||||
@@ -586,16 +642,19 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
};
|
||||
|
||||
const bridge = getNetcattyBridge();
|
||||
void loadUserSkillsStatus(bridge)
|
||||
.then((result) => {
|
||||
if (cancelled) return;
|
||||
if (result === undefined) return;
|
||||
applyUserSkillsStatus(result);
|
||||
})
|
||||
.catch(() => {});
|
||||
const cancelIdle = scheduleWhenAiComposerIdle(() => {
|
||||
void loadUserSkillsStatus(bridge)
|
||||
.then((result) => {
|
||||
if (cancelled) return;
|
||||
if (result === undefined) return;
|
||||
applyUserSkillsStatus(result);
|
||||
})
|
||||
.catch(() => {});
|
||||
});
|
||||
|
||||
return () => {
|
||||
cancelled = true;
|
||||
cancelIdle();
|
||||
};
|
||||
}, [isVisible, scopeKey, toolIntegrationMode, updateScopeDraft, userSkillsStatusVersion]);
|
||||
|
||||
@@ -609,17 +668,15 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
useEffect(() => {
|
||||
if (!isVisible) return;
|
||||
const bridge = getNetcattyBridge();
|
||||
if (bridge?.aiSyncProviders && providers.length > 0) {
|
||||
void bridge.aiSyncProviders(providers);
|
||||
}
|
||||
if (!bridge?.aiSyncProviders || providers.length === 0) return;
|
||||
void bridge.aiSyncProviders(providers);
|
||||
}, [isVisible, providers]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isVisible) return;
|
||||
const bridge = getNetcattyBridge();
|
||||
if (bridge?.aiSyncWebSearch) {
|
||||
void bridge.aiSyncWebSearch(webSearchConfig?.apiHost || null, webSearchConfig?.apiKey || null);
|
||||
}
|
||||
if (!bridge?.aiSyncWebSearch) return;
|
||||
void bridge.aiSyncWebSearch(webSearchConfig?.apiHost || null, webSearchConfig?.apiKey || null);
|
||||
}, [isVisible, webSearchConfig?.apiHost, webSearchConfig?.apiKey, webSearchConfig?.enabled]);
|
||||
|
||||
const {
|
||||
@@ -627,7 +684,10 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
isDiscovering,
|
||||
rediscover,
|
||||
enableAgent,
|
||||
} = useAgentDiscovery(externalAgents, setExternalAgents, { enabled: isVisible });
|
||||
} = useAgentDiscovery(externalAgents, setExternalAgents, {
|
||||
enabled: isVisible,
|
||||
schedule: scheduleWhenAiComposerIdle,
|
||||
});
|
||||
|
||||
const handleEnableDiscoveredAgent = useCallback(
|
||||
(agent: DiscoveredAgent) => {
|
||||
@@ -745,7 +805,9 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
setCodexCustomConfigResolved(false);
|
||||
}
|
||||
});
|
||||
return () => { cancelled = true; };
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, [isVisible, isCodexManagedAgent, currentAgentId, currentAgentConfig]);
|
||||
|
||||
const agentModelMapRef = useRef(agentModelMap);
|
||||
@@ -868,15 +930,19 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
// Respect renderer TTL / in-flight coalescing for all SDK agents including
|
||||
// OpenCode. Forced refresh used to re-spawn opencode on every effect re-run
|
||||
// even when the user never selected OpenCode (#2184). Manual refresh still
|
||||
// passes force via the model selector path.
|
||||
// passes force via the model selector path. Defer the network refresh so
|
||||
// expand → first type does not wait on CLI model listing.
|
||||
let cancelled = false;
|
||||
void loadSdkRuntimeModelCatalog(target).then((catalog) => {
|
||||
if (cancelled || !catalog) return;
|
||||
applySdkRuntimeModelCatalog(target.agentId, catalog, { adoptCurrentModel: true });
|
||||
const cancelIdle = scheduleWhenAiComposerIdle(() => {
|
||||
void loadSdkRuntimeModelCatalog(target).then((catalog) => {
|
||||
if (cancelled || !catalog) return;
|
||||
applySdkRuntimeModelCatalog(target.agentId, catalog, { adoptCurrentModel: true });
|
||||
});
|
||||
});
|
||||
|
||||
return () => {
|
||||
cancelled = true;
|
||||
cancelIdle();
|
||||
};
|
||||
}, [
|
||||
isVisible,
|
||||
@@ -939,8 +1005,8 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
|
||||
const inputAgentId = activeSession?.agentId ?? currentDraft?.agentId ?? currentAgentId;
|
||||
const canSendCurrentAgent = useMemo(
|
||||
() => canSendWithAgent(inputAgentId, externalAgents),
|
||||
[inputAgentId, externalAgents],
|
||||
() => !isSending && canSendWithAgent(inputAgentId, externalAgents),
|
||||
[inputAgentId, externalAgents, isSending],
|
||||
);
|
||||
|
||||
const handleAgentModelSelect = useCallback((modelId: string) => {
|
||||
@@ -1052,13 +1118,65 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
const modelAttachments = attachments.filter((attachment) => !isTerminalSelectionAttachment(attachment));
|
||||
const isDraftMode = currentPanelView.mode === 'draft';
|
||||
|
||||
flushDraftText();
|
||||
const submittedText = draft?.text ?? '';
|
||||
const keepPendingAfterSend = () => {
|
||||
const pending = pendingComposerTextRef.current;
|
||||
return pending != null && pending !== submittedText;
|
||||
};
|
||||
const sendGateKey = currentSessionView?.id ?? `draft:${scopeKey}`;
|
||||
if (!tryBeginSendForKey(sendGateKey)) {
|
||||
return;
|
||||
}
|
||||
let sessionSendGateKey: string | null = null;
|
||||
const sendEpoch = sendEpochRef.current;
|
||||
const isSendStale = () => sendEpochRef.current !== sendEpoch;
|
||||
setIsSending(true);
|
||||
|
||||
try {
|
||||
const sendBridge = getNetcattyBridge();
|
||||
if (sendBridge?.aiSyncProviders && providers.length > 0) {
|
||||
await sendBridge.aiSyncProviders(providers);
|
||||
}
|
||||
if (sendBridge?.aiSyncWebSearch) {
|
||||
await sendBridge.aiSyncWebSearch(webSearchConfig?.apiHost || null, webSearchConfig?.apiKey || null);
|
||||
}
|
||||
let sendSelectedAgentModel = selectedAgentModel;
|
||||
if (currentAgentConfig && shouldLoadSdkRuntimeModels(currentAgentConfig)) {
|
||||
const runtimeTarget = buildExternalAgentRuntimeModelTarget(currentAgentConfig);
|
||||
if (runtimeTarget) {
|
||||
const catalog = await loadSdkRuntimeModelCatalog(runtimeTarget);
|
||||
if (catalog) {
|
||||
applySdkRuntimeModelCatalog(runtimeTarget.agentId, catalog, { adoptCurrentModel: true });
|
||||
const runtimePresets = normalizeSdkRuntimeModelPresets(catalog.models, catalog.currentModelId);
|
||||
const storedModelId = agentModelMapRef.current[sendAgentId];
|
||||
if (
|
||||
catalog.currentModelId
|
||||
&& shouldAdoptSdkCurrentModel(catalog.currentModelId, storedModelId, runtimePresets)
|
||||
) {
|
||||
sendSelectedAgentModel = catalog.currentModelId;
|
||||
} else if (shouldUseStoredAgentModel(storedModelId, runtimePresets)) {
|
||||
sendSelectedAgentModel = storedModelId ?? sendSelectedAgentModel;
|
||||
} else if (runtimePresets[0]) {
|
||||
sendSelectedAgentModel = runtimePresets[0].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
setIsSending(false);
|
||||
const sendPermissionMode = permissionModeRef.current;
|
||||
if (isSendStale()) return;
|
||||
if (currentAgentId !== sendAgentId) return;
|
||||
const liveView = panelViewRef.current;
|
||||
if (liveView.mode !== currentPanelView.mode) return;
|
||||
if (
|
||||
currentPanelView.mode === 'session'
|
||||
&& liveView.mode === 'session'
|
||||
&& liveView.sessionId !== currentPanelView.sessionId
|
||||
) {
|
||||
return;
|
||||
}
|
||||
void warmAiMarkdownRenderer();
|
||||
let sessionId = currentSessionView?.id ?? null;
|
||||
let currentSession = currentSessionView ?? null;
|
||||
if (isDraftMode) {
|
||||
@@ -1066,7 +1184,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
const createdSession = createSession(scope, sendAgentId);
|
||||
sessionId = createdSession.id;
|
||||
currentSession = createdSession;
|
||||
clearScopeDraft();
|
||||
clearScopeDraft({ keepPendingText: keepPendingAfterSend() });
|
||||
showScopeSessionView(createdSession.id);
|
||||
setActiveSessionId(createdSession.id);
|
||||
sessionSendGateKey = sessionId;
|
||||
@@ -1096,7 +1214,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
});
|
||||
addMessageToSession(sessionId, { id: generateId(), role: 'assistant', content: t('ai.chat.noProvider'), timestamp: Date.now() });
|
||||
if (currentPanelView.mode === 'session') {
|
||||
clearScopeDraft();
|
||||
clearScopeDraft({ keepPendingText: keepPendingAfterSend() });
|
||||
showScopeSessionView(sessionId);
|
||||
}
|
||||
return;
|
||||
@@ -1110,7 +1228,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
});
|
||||
addMessageToSession(sessionId, { id: generateId(), role: 'assistant', content: t('ai.chat.noProviderModel'), timestamp: Date.now() });
|
||||
if (currentPanelView.mode === 'session') {
|
||||
clearScopeDraft();
|
||||
clearScopeDraft({ keepPendingText: keepPendingAfterSend() });
|
||||
showScopeSessionView(sessionId);
|
||||
}
|
||||
return;
|
||||
@@ -1121,7 +1239,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
...(attachments.length > 0 ? { attachments } : {}),
|
||||
timestamp: Date.now(),
|
||||
});
|
||||
clearScopeDraft();
|
||||
clearScopeDraft({ keepPendingText: keepPendingAfterSend() });
|
||||
showScopeSessionView(sessionId);
|
||||
setActiveSessionId(sessionId);
|
||||
setStreamingForScope(sessionId, true);
|
||||
@@ -1130,7 +1248,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
addMessageToSession(sessionId, {
|
||||
id: assistantMsgId, role: 'assistant', content: '', timestamp: Date.now(),
|
||||
model: isExternalAgent
|
||||
? (selectedAgentModel || agentConfig?.name || 'external')
|
||||
? (sendSelectedAgentModel || agentConfig?.name || 'external')
|
||||
: (sendActiveModelId || sendActiveProvider?.defaultModel || ''),
|
||||
providerId: isExternalAgent ? undefined : sendActiveProvider?.providerId,
|
||||
});
|
||||
@@ -1154,10 +1272,10 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
terminalSessions,
|
||||
defaultTargetSession,
|
||||
providers,
|
||||
selectedAgentModel,
|
||||
selectedAgentModel: sendSelectedAgentModel,
|
||||
toolIntegrationMode,
|
||||
selectedUserSkillSlugs: selectedSkillSlugs,
|
||||
permissionMode: globalPermissionMode,
|
||||
permissionMode: sendPermissionMode,
|
||||
});
|
||||
} catch (err) {
|
||||
reportStreamError(sessionId, abortController.signal, err);
|
||||
@@ -1178,7 +1296,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
scopeType,
|
||||
scopeTargetId,
|
||||
scopeLabel,
|
||||
globalPermissionMode,
|
||||
globalPermissionMode: sendPermissionMode,
|
||||
commandBlocklist,
|
||||
commandTimeout,
|
||||
terminalSessions,
|
||||
@@ -1190,6 +1308,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
}, modelAttachments.length > 0 ? modelAttachments : undefined);
|
||||
}
|
||||
} finally {
|
||||
setIsSending(false);
|
||||
endSendForKey(sendGateKey);
|
||||
if (sessionSendGateKey && sessionSendGateKey !== sendGateKey) {
|
||||
endSendForKey(sessionSendGateKey);
|
||||
@@ -1202,9 +1321,11 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
setStreamingForScope,
|
||||
sendToExternalAgent, sendToCattyAgent, reportStreamError, autoTitleSession, t,
|
||||
abortControllersRef, terminalSessions, defaultTargetSession, providers, selectedAgentModel, updateSessionExternalSessionId,
|
||||
scopeType, scopeTargetId, scopeHostIds, scopeLabel, globalPermissionMode, commandBlocklist, commandTimeout, webSearchConfig, buildExecutorContextForScope,
|
||||
scopeType, scopeTargetId, scopeHostIds, scopeLabel, commandBlocklist, commandTimeout, webSearchConfig, buildExecutorContextForScope,
|
||||
toolIntegrationMode,
|
||||
clearScopeDraft, showScopeSessionView, setActiveSessionId,
|
||||
flushDraftText, currentAgentConfig, buildExternalAgentRuntimeModelTarget,
|
||||
loadSdkRuntimeModelCatalog, applySdkRuntimeModelCatalog,
|
||||
]);
|
||||
|
||||
const handleCompact = useCallback(async () => {
|
||||
@@ -1462,45 +1583,19 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
setShowHistory(false);
|
||||
}, [ensureScopeDraft, showScopeDraftView, updateScopeDraft]);
|
||||
|
||||
// Warm the Streamdown/markdown chunk while the panel is visible but idle, so
|
||||
// the first completed assistant reply does not pay the full parse cost mid-interaction.
|
||||
useEffect(() => {
|
||||
if (!isVisible) return;
|
||||
let cancelled = false;
|
||||
const loadMarkdown = () => {
|
||||
if (cancelled) return;
|
||||
void import('./ai-elements/messageResponse');
|
||||
};
|
||||
if (typeof requestIdleCallback === 'function') {
|
||||
const idleId = requestIdleCallback(loadMarkdown, { timeout: 2500 });
|
||||
return () => {
|
||||
cancelled = true;
|
||||
cancelIdleCallback(idleId);
|
||||
};
|
||||
}
|
||||
const timeoutId = window.setTimeout(loadMarkdown, 0);
|
||||
return () => {
|
||||
cancelled = true;
|
||||
window.clearTimeout(timeoutId);
|
||||
};
|
||||
}, [isVisible]);
|
||||
|
||||
// Keep streaming/session hooks alive for retained hidden panels, but do not
|
||||
// mount ChatMessageList / Streamdown / ChatInput while CSS-hidden — those trees
|
||||
// are the main tab-switch and cross-tab re-render cost.
|
||||
if (!isVisible) {
|
||||
return (
|
||||
<div
|
||||
className="h-full min-h-0 bg-background"
|
||||
data-section="ai-chat-panel-retained"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
// Hidden retained panels keep the composer mounted (parent is `hidden` +
|
||||
// inert) so reopen does not remount ChatInput. Skip the message list.
|
||||
return (
|
||||
<React.Profiler {...getAIPanelProfilerProps('AIChatSidePanel.Active')}>
|
||||
<div
|
||||
className="h-full min-h-0"
|
||||
data-section={isVisible ? undefined : 'ai-chat-panel-retained'}
|
||||
aria-hidden={isVisible ? undefined : true}
|
||||
inert={isVisible ? undefined : true}
|
||||
>
|
||||
<AIChatPanelContent
|
||||
parked={!isVisible}
|
||||
sending={isSending}
|
||||
t={t}
|
||||
currentAgentId={currentAgentId}
|
||||
externalAgents={externalAgents}
|
||||
@@ -1535,7 +1630,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
canSteer={canSteerCurrentTurn}
|
||||
isSteering={isSteering}
|
||||
steerWarning={steerWarning}
|
||||
lockTurnConfiguration={Boolean(isStreaming && isCodexAppServer)}
|
||||
lockTurnConfiguration={Boolean(isSending || (isStreaming && isCodexAppServer))}
|
||||
canSendCurrentAgent={canSendCurrentAgent}
|
||||
providerDisplayName={providerDisplayName}
|
||||
modelDisplayName={modelDisplayName}
|
||||
@@ -1566,6 +1661,7 @@ const AIChatSidePanelActive: React.FC<AIChatSidePanelProps> = ({
|
||||
onOpenVaultSnippet={onOpenVaultSnippet}
|
||||
onOpenVaultSection={onOpenVaultSection}
|
||||
/>
|
||||
</div>
|
||||
</React.Profiler>
|
||||
);
|
||||
};
|
||||
@@ -1641,6 +1737,22 @@ export function aiChatSidePanelPropsAreEqual(
|
||||
if (prev.onOpenVaultSnippet !== next.onOpenVaultSnippet) return false;
|
||||
if (prev.onOpenVaultSection !== next.onOpenVaultSection) return false;
|
||||
|
||||
const scopeKey = `${prev.scopeType}:${prev.scopeTargetId ?? ''}`;
|
||||
if (
|
||||
prev.sessions === next.sessions
|
||||
&& draftsByScopeEqualIgnoringComposerText(prev.draftsByScope, next.draftsByScope, scopeKey)
|
||||
) {
|
||||
let restEqual = true;
|
||||
for (const key of AI_CHAT_SIDE_PANEL_AI_STATE_KEYS) {
|
||||
if (key === 'sessions' || key === 'draftsByScope') continue;
|
||||
if (prev[key] !== next[key]) {
|
||||
restEqual = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (restEqual) return true;
|
||||
}
|
||||
|
||||
// Sibling stream thrash: full sessions array identity always changes. Only
|
||||
// exact-scope session object refs matter for this panel's active chat —
|
||||
// plus the currently selected session, which may be a host-matched history
|
||||
@@ -1706,6 +1818,12 @@ export function aiChatSidePanelPropsAreEqual(
|
||||
|
||||
for (const key of AI_CHAT_SIDE_PANEL_AI_STATE_KEYS) {
|
||||
if (key === 'sessions') continue;
|
||||
if (key === 'draftsByScope') {
|
||||
if (!draftsByScopeEqualIgnoringComposerText(prev.draftsByScope, next.draftsByScope, scopeKey)) {
|
||||
return false;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (prev[key] !== next[key]) return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -290,7 +290,7 @@ interface HostTreeViewProps {
|
||||
onDeleteGroup: (groupPath: string) => void;
|
||||
moveHostToGroup: (hostId: string, groupPath: string | null) => void;
|
||||
moveGroup: (sourcePath: string, targetParent: string | null) => void;
|
||||
commitInlineGroupRename?: (name: string) => void;
|
||||
commitInlineGroupRename?: (name: string) => boolean | void | Promise<boolean | void>;
|
||||
cancelInlineGroupEdit?: () => void;
|
||||
managedGroupPaths?: Set<string>;
|
||||
onUnmanageGroup?: (groupPath: string) => void;
|
||||
@@ -330,7 +330,7 @@ interface TreeNodeProps {
|
||||
onDeleteGroup: (groupPath: string) => void;
|
||||
moveHostToGroup: (hostId: string, groupPath: string | null) => void;
|
||||
moveGroup: (sourcePath: string, targetParent: string | null) => void;
|
||||
commitInlineGroupRename?: (name: string) => void;
|
||||
commitInlineGroupRename?: (name: string) => boolean | void | Promise<boolean | void>;
|
||||
cancelInlineGroupEdit?: () => void;
|
||||
managedGroupPaths?: Set<string>;
|
||||
onUnmanageGroup?: (groupPath: string) => void;
|
||||
|
||||
@@ -29,6 +29,7 @@ test("quick add snippet form binds shortkeys and uses a centered Dialog modal",
|
||||
assert.match(source, /from '\.\/ui\/dialog'/);
|
||||
assert.doesNotMatch(source, /AsidePanel/);
|
||||
assert.match(source, /snippets\.field\.shortkey/);
|
||||
assert.match(source, /findActiveSystemShortcutConflict/);
|
||||
assert.match(source, /keyEventToString/);
|
||||
assert.match(source, /shortkey: shortkey \|\| undefined/);
|
||||
assert.match(source, /if \(e\.defaultPrevented\) return/);
|
||||
|
||||
@@ -12,12 +12,13 @@ import { Keyboard, Package, RotateCcw } from 'lucide-react';
|
||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { useI18n } from '../application/i18n/I18nProvider';
|
||||
import type { Snippet } from '../domain/models';
|
||||
import { findActiveSystemShortcutConflict } from '../domain/activeKeyBindings';
|
||||
import {
|
||||
type HotkeyScheme,
|
||||
type KeyBinding,
|
||||
keyEventToString,
|
||||
keyStringToKeyboardEvent,
|
||||
matchesKeyBinding,
|
||||
parseKeyCombo,
|
||||
} from '../domain/models';
|
||||
import { isScriptSnippet } from '../domain/snippetScript.ts';
|
||||
import { cn, isMacPlatform } from '../lib/utils';
|
||||
@@ -132,78 +133,6 @@ export const QuickAddSnippetDialog: React.FC<QuickAddSnippetDialogProps> = ({
|
||||
snippets.filter((s) => Boolean(s.shortkey) && s.id !== editing?.id)
|
||||
), [snippets, editing?.id]);
|
||||
|
||||
const activeSystemBindings = useMemo(() => {
|
||||
return keyBindings.flatMap((binding) => {
|
||||
const entries: { binding: string; isMac: boolean }[] = [];
|
||||
const macBinding = binding.mac;
|
||||
const pcBinding = binding.pc;
|
||||
|
||||
if (hotkeyScheme === 'mac') {
|
||||
if (macBinding && macBinding !== 'Disabled') {
|
||||
entries.push({ binding: macBinding, isMac: true });
|
||||
}
|
||||
return entries;
|
||||
}
|
||||
|
||||
if (hotkeyScheme === 'pc') {
|
||||
if (pcBinding && pcBinding !== 'Disabled') {
|
||||
entries.push({ binding: pcBinding, isMac: false });
|
||||
}
|
||||
return entries;
|
||||
}
|
||||
|
||||
if (macBinding && macBinding !== 'Disabled') {
|
||||
entries.push({ binding: macBinding, isMac: true });
|
||||
}
|
||||
if (pcBinding && pcBinding !== 'Disabled') {
|
||||
entries.push({ binding: pcBinding, isMac: false });
|
||||
}
|
||||
return entries;
|
||||
});
|
||||
}, [hotkeyScheme, keyBindings]);
|
||||
|
||||
const buildKeyEventFromString = useCallback((keyString: string) => {
|
||||
const parsed = parseKeyCombo(keyString);
|
||||
if (!parsed) return null;
|
||||
|
||||
const modifiers = new Set(parsed.modifiers);
|
||||
const key = parsed.key;
|
||||
const normalizedKey = (() => {
|
||||
switch (key) {
|
||||
case 'Space':
|
||||
return ' ';
|
||||
case '↑':
|
||||
return 'ArrowUp';
|
||||
case '↓':
|
||||
return 'ArrowDown';
|
||||
case '←':
|
||||
return 'ArrowLeft';
|
||||
case '→':
|
||||
return 'ArrowRight';
|
||||
case 'Esc':
|
||||
return 'Escape';
|
||||
case '⌫':
|
||||
return 'Backspace';
|
||||
case 'Del':
|
||||
return 'Delete';
|
||||
case '↵':
|
||||
return 'Enter';
|
||||
case '⇥':
|
||||
return 'Tab';
|
||||
default:
|
||||
return key.length === 1 ? key.toLowerCase() : key;
|
||||
}
|
||||
})();
|
||||
|
||||
return new KeyboardEvent('keydown', {
|
||||
key: normalizedKey,
|
||||
metaKey: modifiers.has('⌘') || modifiers.has('Win'),
|
||||
ctrlKey: modifiers.has('⌃') || modifiers.has('Ctrl'),
|
||||
altKey: modifiers.has('⌥') || modifiers.has('Alt'),
|
||||
shiftKey: modifiers.has('Shift'),
|
||||
});
|
||||
}, []);
|
||||
|
||||
const normalizeKeyString = useCallback((value: string) => (
|
||||
value.toLowerCase().replace(/\s+/g, '')
|
||||
), []);
|
||||
@@ -211,16 +140,14 @@ export const QuickAddSnippetDialog: React.FC<QuickAddSnippetDialogProps> = ({
|
||||
const validateShortkey = useCallback((key: string): string | null => {
|
||||
if (!key) return null;
|
||||
|
||||
const syntheticEvent = buildKeyEventFromString(key);
|
||||
if (syntheticEvent) {
|
||||
const conflictsSystem = activeSystemBindings.some(({ binding, isMac: bindingIsMac }) => (
|
||||
matchesKeyBinding(syntheticEvent, binding, bindingIsMac)
|
||||
));
|
||||
if (conflictsSystem) {
|
||||
return t('snippets.shortkey.error.systemConflict');
|
||||
}
|
||||
const systemConflict = findActiveSystemShortcutConflict(key, hotkeyScheme, keyBindings);
|
||||
if (systemConflict) {
|
||||
const nameKey = `settings.shortcuts.binding.${systemConflict.id}`;
|
||||
const name = t(nameKey) !== nameKey ? t(nameKey) : systemConflict.label;
|
||||
return t('snippets.shortkey.error.systemConflict', { name });
|
||||
}
|
||||
|
||||
const syntheticEvent = keyStringToKeyboardEvent(key);
|
||||
if (syntheticEvent) {
|
||||
for (const snippet of existingShortkeys) {
|
||||
if (snippet.shortkey && matchesKeyBinding(syntheticEvent, snippet.shortkey, isMac)) {
|
||||
@@ -239,10 +166,10 @@ export const QuickAddSnippetDialog: React.FC<QuickAddSnippetDialogProps> = ({
|
||||
|
||||
return null;
|
||||
}, [
|
||||
activeSystemBindings,
|
||||
buildKeyEventFromString,
|
||||
existingShortkeys,
|
||||
hotkeyScheme,
|
||||
isMac,
|
||||
keyBindings,
|
||||
normalizeKeyString,
|
||||
t,
|
||||
]);
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
import { CheckSquare, FolderTree, Search, Square } from 'lucide-react';
|
||||
import React, { useMemo, useState } from 'react';
|
||||
import { useI18n } from '@/application/i18n/I18nProvider';
|
||||
import type { Host } from '@/domain/models';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/components/ui/dialog';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { FixedSizeVirtualList } from '@/components/ui/FixedSizeVirtualList';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
export interface SelectGroupDialogProps {
|
||||
open: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
hosts: Host[];
|
||||
customGroups?: string[];
|
||||
selectedGroupPaths: string[];
|
||||
onSelectionChange: (selectedGroupPaths: string[]) => void;
|
||||
}
|
||||
|
||||
const GROUP_ROW_HEIGHT = 48;
|
||||
|
||||
function collectGroupPaths(
|
||||
hosts: Host[],
|
||||
customGroups: string[],
|
||||
selectedGroupPaths: string[],
|
||||
): string[] {
|
||||
const paths = new Set<string>();
|
||||
for (const groupPath of [...customGroups, ...selectedGroupPaths]) {
|
||||
const parts = groupPath.split('/').filter(Boolean);
|
||||
for (let index = 1; index <= parts.length; index += 1) {
|
||||
paths.add(parts.slice(0, index).join('/'));
|
||||
}
|
||||
}
|
||||
for (const host of hosts) {
|
||||
const parts = host.group?.split('/').filter(Boolean) ?? [];
|
||||
for (let index = 1; index <= parts.length; index += 1) {
|
||||
paths.add(parts.slice(0, index).join('/'));
|
||||
}
|
||||
}
|
||||
return [...paths].sort((left, right) => left.localeCompare(right));
|
||||
}
|
||||
|
||||
function countHostsByGroupPath(hosts: Host[]): Map<string, number> {
|
||||
const counts = new Map<string, number>();
|
||||
for (const host of hosts) {
|
||||
if (host.protocol === 'serial') continue;
|
||||
const parts = host.group?.split('/').filter(Boolean) ?? [];
|
||||
for (let index = 1; index <= parts.length; index += 1) {
|
||||
const path = parts.slice(0, index).join('/');
|
||||
counts.set(path, (counts.get(path) ?? 0) + 1);
|
||||
}
|
||||
}
|
||||
return counts;
|
||||
}
|
||||
|
||||
export const SelectGroupDialog: React.FC<SelectGroupDialogProps> = ({
|
||||
open,
|
||||
onOpenChange,
|
||||
hosts,
|
||||
customGroups = [],
|
||||
selectedGroupPaths,
|
||||
onSelectionChange,
|
||||
}) => {
|
||||
const { t } = useI18n();
|
||||
const [searchQuery, setSearchQuery] = useState('');
|
||||
const selected = useMemo(() => new Set(selectedGroupPaths), [selectedGroupPaths]);
|
||||
const groupPaths = useMemo(
|
||||
() => collectGroupPaths(hosts, customGroups, selectedGroupPaths),
|
||||
[customGroups, hosts, selectedGroupPaths],
|
||||
);
|
||||
const displayedPaths = useMemo(() => {
|
||||
const query = searchQuery.trim().toLocaleLowerCase();
|
||||
if (!query) return groupPaths;
|
||||
return groupPaths.filter((path) => path.toLocaleLowerCase().includes(query));
|
||||
}, [groupPaths, searchQuery]);
|
||||
const hostCountByPath = useMemo(() => countHostsByGroupPath(hosts), [hosts]);
|
||||
|
||||
const togglePath = (path: string) => {
|
||||
if (selected.has(path)) {
|
||||
onSelectionChange(selectedGroupPaths.filter((candidate) => candidate !== path));
|
||||
return;
|
||||
}
|
||||
onSelectionChange([...selectedGroupPaths, path]);
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="max-w-md h-[min(78vh,600px)] flex flex-col p-0 gap-0 overflow-hidden">
|
||||
<DialogHeader className="px-4 pt-4 pb-3 shrink-0 border-b border-border/60">
|
||||
<DialogTitle className="text-base">{t('snippets.targets.selectGroups')}</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
<div className="px-4 py-3 border-b border-border/60 shrink-0">
|
||||
<div className="relative">
|
||||
<Search
|
||||
size={14}
|
||||
className="absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"
|
||||
/>
|
||||
<Input
|
||||
value={searchQuery}
|
||||
onChange={(event) => setSearchQuery(event.target.value)}
|
||||
placeholder={t('common.searchPlaceholder')}
|
||||
className="h-8 pl-8"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex-1 min-h-0 p-3">
|
||||
{displayedPaths.length === 0 ? (
|
||||
<p className="py-10 text-center text-sm text-muted-foreground">
|
||||
{t('snippets.targets.noGroups')}
|
||||
</p>
|
||||
) : (
|
||||
<FixedSizeVirtualList
|
||||
className="h-full"
|
||||
items={displayedPaths}
|
||||
itemHeight={GROUP_ROW_HEIGHT}
|
||||
getItemKey={(path) => path}
|
||||
renderItem={(path) => {
|
||||
const isSelected = selected.has(path);
|
||||
const depth = Math.max(0, path.split('/').filter(Boolean).length - 1);
|
||||
const label = path.split('/').filter(Boolean).pop() ?? path;
|
||||
const hostCount = hostCountByPath.get(path) ?? 0;
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
className={cn(
|
||||
'w-full h-11 flex items-center gap-2.5 rounded-lg px-2.5 text-left transition-colors',
|
||||
isSelected ? 'bg-primary/10 text-foreground' : 'hover:bg-muted/70',
|
||||
)}
|
||||
style={{ paddingLeft: `${10 + depth * 16}px` }}
|
||||
onClick={() => togglePath(path)}
|
||||
>
|
||||
{isSelected ? (
|
||||
<CheckSquare size={16} className="text-primary shrink-0" />
|
||||
) : (
|
||||
<Square size={16} className="text-muted-foreground shrink-0" />
|
||||
)}
|
||||
<FolderTree size={16} className="text-primary shrink-0" />
|
||||
<span className="min-w-0 flex-1">
|
||||
<span className="block truncate text-sm font-medium">{label}</span>
|
||||
<span className="block truncate text-[11px] text-muted-foreground">{path}</span>
|
||||
</span>
|
||||
<span className="text-[11px] text-muted-foreground shrink-0">
|
||||
{t('vault.groups.hostsCount', { count: hostCount })}
|
||||
</span>
|
||||
</button>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<DialogFooter className="px-4 py-3 border-t border-border/60 shrink-0">
|
||||
<Button className="w-full" onClick={() => onOpenChange(false)}>
|
||||
{t('selectHost.continueWithCount', { count: selectedGroupPaths.length })}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
@@ -627,6 +627,8 @@ const SettingsPageContent: React.FC<{ settings: SettingsState }> = ({ settings }
|
||||
setRestorePreviousSession={settings.setRestorePreviousSession}
|
||||
restoreTerminalCwd={settings.restoreTerminalCwd}
|
||||
setRestoreTerminalCwd={settings.setRestoreTerminalCwd}
|
||||
startupLanding={settings.startupLanding}
|
||||
setStartupLanding={settings.setStartupLanding}
|
||||
toggleWindowHotkey={settings.toggleWindowHotkey}
|
||||
setToggleWindowHotkey={settings.setToggleWindowHotkey}
|
||||
closeToTray={settings.closeToTray}
|
||||
|
||||
@@ -86,8 +86,12 @@ import { scheduleDeferredTerminalFocus } from "./systemManager/tmuxActionFocus";
|
||||
import {
|
||||
connectionKeyMatchesHost,
|
||||
findReusableSftpSidePanelTab,
|
||||
isPendingSameEndpointSshSession,
|
||||
rememberSftpSidePanelSourceStatus,
|
||||
resolveSftpSidePanelTrackedSourceStatusUpdate,
|
||||
shouldAcceptPendingSftpUpload,
|
||||
shouldResetSftpSidePanelSourceSession,
|
||||
shouldDeferSftpSidePanelAutoConnectForSession,
|
||||
shouldRebindSftpSidePanelSourceSession,
|
||||
shouldSkipSftpSidePanelAutoConnect,
|
||||
} from "./sftp/sftpSidePanelAutoConnect";
|
||||
import {
|
||||
@@ -116,7 +120,7 @@ interface SftpSidePanelProps {
|
||||
sftpDefaultViewMode: "list" | "tree";
|
||||
/** The host to connect to (follows focused terminal) */
|
||||
activeHost: Host | null;
|
||||
/** The terminal session id whose SSH connection can be reused for SFTP */
|
||||
/** Linked same-endpoint SSH session id (may be reconnecting; reuse only when connected) */
|
||||
activeSessionId?: string | null;
|
||||
/** Focused terminal session (includes mosh/et/local) for locate-path writes */
|
||||
focusedSessionId?: string | null;
|
||||
@@ -219,7 +223,8 @@ const SftpSidePanelInner: React.FC<SftpSidePanelProps> = ({
|
||||
}, [hosts, sessions]);
|
||||
|
||||
// Browse restore can run before the session list reflects the focused tab;
|
||||
// prefer the active source when its visible endpoint matches the pane host.
|
||||
// prefer the active source when its visible endpoint matches the pane host
|
||||
// and the SSH transport is already up (linked id survives reconnect phases).
|
||||
const resolveBrowseSourceSessionId = useCallback((hostId: string, host?: Host) => {
|
||||
if (
|
||||
activeSessionId
|
||||
@@ -227,10 +232,13 @@ const SftpSidePanelInner: React.FC<SftpSidePanelProps> = ({
|
||||
&& activeHost.id === hostId
|
||||
&& (!host || sftpHostEndpointsEqual(activeHost, host))
|
||||
) {
|
||||
return activeSessionId;
|
||||
const linkedSession = sessions.find((session) => session.id === activeSessionId);
|
||||
if (linkedSession?.status === "connected") {
|
||||
return activeSessionId;
|
||||
}
|
||||
}
|
||||
return resolveTransferSourceSessionId(hostId, host);
|
||||
}, [activeHost, activeSessionId, resolveTransferSourceSessionId]);
|
||||
}, [activeHost, activeSessionId, resolveTransferSourceSessionId, sessions]);
|
||||
|
||||
const fileWatchHandlers = useMemo(() => ({
|
||||
onFileWatchSynced: (payload: { remotePath: string }) => {
|
||||
@@ -493,6 +501,7 @@ const SftpSidePanelInner: React.FC<SftpSidePanelProps> = ({
|
||||
const connectedKeyRef = useRef<string | null>(null);
|
||||
const connectedHostObjRef = useRef<Host | null>(null);
|
||||
const lastSourceSessionIdRef = useRef<string | null>(null);
|
||||
const lastSourceSessionStatusRef = useRef<string | null>(null);
|
||||
const lastAppliedInitialLocationKeyRef = useRef<string | null>(null);
|
||||
const handledPendingUploadIdRef = useRef<string | null>(null);
|
||||
const tabConnectionKeyMapRef = useRef<Map<string, string>>(new Map());
|
||||
@@ -560,10 +569,36 @@ const SftpSidePanelInner: React.FC<SftpSidePanelProps> = ({
|
||||
activeHost.username,
|
||||
activeHost.sftpFileProtocol,
|
||||
);
|
||||
const sessionChanged = shouldResetSftpSidePanelSourceSession(
|
||||
lastSourceSessionIdRef.current,
|
||||
activeSessionId,
|
||||
);
|
||||
const pendingSameEndpointSession = sessions.find((session) => (
|
||||
isPendingSameEndpointSshSession(session, activeHost)
|
||||
));
|
||||
if (!activeSessionId && pendingSameEndpointSession) {
|
||||
return;
|
||||
}
|
||||
const activeSession = activeSessionId
|
||||
? sessions.find((session) => session.id === activeSessionId) ?? null
|
||||
: null;
|
||||
const activeSessionStatus = activeSession?.status ?? null;
|
||||
if (
|
||||
shouldDeferSftpSidePanelAutoConnectForSession({
|
||||
activeSessionId,
|
||||
sessionStatus: activeSessionStatus,
|
||||
})
|
||||
) {
|
||||
// Remember the non-connected status so the later connected transition
|
||||
// is treated as a transport rebind (same session id after Start over).
|
||||
lastSourceSessionStatusRef.current = activeSessionStatus;
|
||||
if (activeSessionId) {
|
||||
lastSourceSessionIdRef.current = activeSessionId;
|
||||
}
|
||||
return;
|
||||
}
|
||||
const sessionChanged = shouldRebindSftpSidePanelSourceSession({
|
||||
previousSessionId: lastSourceSessionIdRef.current,
|
||||
nextSessionId: activeSessionId,
|
||||
previousStatus: lastSourceSessionStatusRef.current,
|
||||
nextStatus: activeSessionStatus ?? (activeSessionId ? "connected" : null),
|
||||
});
|
||||
|
||||
const hasBackendSession = (connectionId: string) => !!s.getSftpIdForConnection(connectionId);
|
||||
const activeTab = s.leftTabs.tabs.find((tab) => tab.id === s.leftTabs.activeTabId) ?? null;
|
||||
@@ -592,6 +627,11 @@ const SftpSidePanelInner: React.FC<SftpSidePanelProps> = ({
|
||||
if (activeSessionId) {
|
||||
lastSourceSessionIdRef.current = activeSessionId;
|
||||
}
|
||||
lastSourceSessionStatusRef.current = rememberSftpSidePanelSourceStatus({
|
||||
previousStatus: lastSourceSessionStatusRef.current,
|
||||
activeSessionId,
|
||||
activeSessionStatus,
|
||||
});
|
||||
return;
|
||||
}
|
||||
// Defer advancing the session cursor while interactive work blocks rebind,
|
||||
@@ -600,6 +640,11 @@ const SftpSidePanelInner: React.FC<SftpSidePanelProps> = ({
|
||||
if (activeSessionId) {
|
||||
lastSourceSessionIdRef.current = activeSessionId;
|
||||
}
|
||||
lastSourceSessionStatusRef.current = rememberSftpSidePanelSourceStatus({
|
||||
previousStatus: lastSourceSessionStatusRef.current,
|
||||
activeSessionId,
|
||||
activeSessionStatus,
|
||||
});
|
||||
|
||||
logger.info("[SftpSidePanel] Auto-connect triggered", {
|
||||
hostId: activeHost.id,
|
||||
@@ -730,14 +775,16 @@ const SftpSidePanelInner: React.FC<SftpSidePanelProps> = ({
|
||||
connectedKeyRef.current = connectionKey;
|
||||
connectedHostObjRef.current = activeHost;
|
||||
s.connect("left", activeHost, {
|
||||
sourceSessionId: activeSessionId ?? undefined,
|
||||
sourceSessionId: activeSessionStatus === "connected"
|
||||
? (activeSessionId ?? undefined)
|
||||
: undefined,
|
||||
...(initialPath ? { initialPath } : undefined),
|
||||
...(needsNewTab ? { forceNewTab: true } : undefined),
|
||||
onTabCreated: (tabId) => {
|
||||
tabConnectionKeyMapRef.current.set(tabId, connectionKey);
|
||||
},
|
||||
});
|
||||
}, [activeHost, activeSessionId, initialLocation, interactiveWorkActive]);
|
||||
}, [activeHost, activeSessionId, initialLocation, interactiveWorkActive, sessions]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!activeHost || !isVisible) return;
|
||||
@@ -752,6 +799,20 @@ const SftpSidePanelInner: React.FC<SftpSidePanelProps> = ({
|
||||
};
|
||||
}, [activeHost, activeSessionId, interactiveWorkActive, isVisible, runAutoConnect]);
|
||||
|
||||
useEffect(() => {
|
||||
if (activeSessionId) return;
|
||||
const trackedSessionId = lastSourceSessionIdRef.current;
|
||||
const trackedSession = trackedSessionId
|
||||
? sessions.find((candidate) => candidate.id === trackedSessionId) ?? null
|
||||
: null;
|
||||
const update = resolveSftpSidePanelTrackedSourceStatusUpdate({
|
||||
trackedSessionId,
|
||||
sessionStatus: trackedSession?.status ?? null,
|
||||
});
|
||||
if (!update) return;
|
||||
lastSourceSessionStatusRef.current = update.status;
|
||||
}, [activeSessionId, sessions]);
|
||||
|
||||
useEffect(() => {
|
||||
const connection = sftp.leftPane.connection;
|
||||
if (!connection || connection.status === "error" || connection.status === "disconnected") {
|
||||
|
||||
@@ -9,7 +9,8 @@ import {
|
||||
getShellHistorySnapshot,
|
||||
subscribeShellHistory,
|
||||
} from '../application/state/shellHistoryStore';
|
||||
import { HotkeyScheme, KeyBinding, keyEventToString, ManagedSource, matchesKeyBinding, parseKeyCombo } from '../domain/models';
|
||||
import { findActiveSystemShortcutConflict } from '../domain/activeKeyBindings';
|
||||
import { HotkeyScheme, KeyBinding, keyEventToString, keyStringToKeyboardEvent, ManagedSource, matchesKeyBinding } from '../domain/models';
|
||||
import {
|
||||
buildSnippetExportPayload,
|
||||
combineSnippetImportPayloads,
|
||||
@@ -18,7 +19,11 @@ import {
|
||||
type SnippetExportPayload,
|
||||
type SnippetImportConflictAction,
|
||||
} from '../domain/snippetTransfer';
|
||||
import { getRunnableHostsForSnippet, snippetHasRunTargets } from '../domain/snippetTargets.ts';
|
||||
import {
|
||||
getRunnableHostsForSnippet,
|
||||
resolveSnippetTargetGroupsForSave,
|
||||
snippetHasRunTargets,
|
||||
} from '../domain/snippetTargets.ts';
|
||||
import { removeHostConnectScript, syncHostsForSnippetTargetChange } from '../domain/hostConnectScripts.ts';
|
||||
import { flattenSnippetCommandPreview } from '../domain/snippetPreview.ts';
|
||||
import { deleteSelectedSnippetsFromVault } from '../domain/snippetSelection.ts';
|
||||
@@ -486,6 +491,7 @@ const SnippetsManager: React.FC<SnippetsManagerProps> = ({
|
||||
targets: [],
|
||||
});
|
||||
const [targetSelection, setTargetSelection] = useState<string[]>([]);
|
||||
const [targetGroupSelection, setTargetGroupSelection] = useState<string[]>([]);
|
||||
const [copiedId, setCopiedId] = useState<string | null>(null);
|
||||
const [selectedPackage, setSelectedPackage] = useState<string | null>(null);
|
||||
const [newPackageName, setNewPackageName] = useState('');
|
||||
@@ -571,95 +577,21 @@ const SnippetsManager: React.FC<SnippetsManagerProps> = ({
|
||||
hotkeyScheme === 'mac' || (hotkeyScheme === 'disabled' && isMacPlatform())
|
||||
), [hotkeyScheme]);
|
||||
|
||||
const activeSystemBindings = useMemo(() => {
|
||||
return keyBindings.flatMap((binding) => {
|
||||
const entries: { binding: string; isMac: boolean }[] = [];
|
||||
const macBinding = binding.mac;
|
||||
const pcBinding = binding.pc;
|
||||
|
||||
if (hotkeyScheme === 'mac') {
|
||||
if (macBinding && macBinding !== 'Disabled') {
|
||||
entries.push({ binding: macBinding, isMac: true });
|
||||
}
|
||||
return entries;
|
||||
}
|
||||
|
||||
if (hotkeyScheme === 'pc') {
|
||||
if (pcBinding && pcBinding !== 'Disabled') {
|
||||
entries.push({ binding: pcBinding, isMac: false });
|
||||
}
|
||||
return entries;
|
||||
}
|
||||
|
||||
if (macBinding && macBinding !== 'Disabled') {
|
||||
entries.push({ binding: macBinding, isMac: true });
|
||||
}
|
||||
if (pcBinding && pcBinding !== 'Disabled') {
|
||||
entries.push({ binding: pcBinding, isMac: false });
|
||||
}
|
||||
return entries;
|
||||
});
|
||||
}, [hotkeyScheme, keyBindings]);
|
||||
|
||||
const buildKeyEventFromString = useCallback((keyString: string) => {
|
||||
const parsed = parseKeyCombo(keyString);
|
||||
if (!parsed) return null;
|
||||
|
||||
const modifiers = new Set(parsed.modifiers);
|
||||
const key = parsed.key;
|
||||
const normalizedKey = (() => {
|
||||
switch (key) {
|
||||
case 'Space':
|
||||
return ' ';
|
||||
case '↑':
|
||||
return 'ArrowUp';
|
||||
case '↓':
|
||||
return 'ArrowDown';
|
||||
case '←':
|
||||
return 'ArrowLeft';
|
||||
case '→':
|
||||
return 'ArrowRight';
|
||||
case 'Esc':
|
||||
return 'Escape';
|
||||
case '⌫':
|
||||
return 'Backspace';
|
||||
case 'Del':
|
||||
return 'Delete';
|
||||
case '↵':
|
||||
return 'Enter';
|
||||
case '⇥':
|
||||
return 'Tab';
|
||||
default:
|
||||
return key.length === 1 ? key.toLowerCase() : key;
|
||||
}
|
||||
})();
|
||||
|
||||
return new KeyboardEvent('keydown', {
|
||||
key: normalizedKey,
|
||||
metaKey: modifiers.has('⌘') || modifiers.has('Win'),
|
||||
ctrlKey: modifiers.has('⌃') || modifiers.has('Ctrl'),
|
||||
altKey: modifiers.has('⌥') || modifiers.has('Alt'),
|
||||
shiftKey: modifiers.has('Shift'),
|
||||
});
|
||||
}, []);
|
||||
|
||||
const normalizeKeyString = useCallback((value: string) => (
|
||||
value.toLowerCase().replace(/\s+/g, '')
|
||||
), []);
|
||||
|
||||
const validateShortkey = useCallback((key: string): string | null => {
|
||||
if (!key) return null;
|
||||
|
||||
const syntheticEvent = buildKeyEventFromString(key);
|
||||
if (syntheticEvent) {
|
||||
const conflictsSystem = activeSystemBindings.some(({ binding, isMac: bindingIsMac }) => (
|
||||
matchesKeyBinding(syntheticEvent, binding, bindingIsMac)
|
||||
));
|
||||
if (conflictsSystem) {
|
||||
return t('snippets.shortkey.error.systemConflict');
|
||||
}
|
||||
|
||||
const systemConflict = findActiveSystemShortcutConflict(key, hotkeyScheme, keyBindings);
|
||||
if (systemConflict) {
|
||||
const nameKey = `settings.shortcuts.binding.${systemConflict.id}`;
|
||||
const name = t(nameKey) !== nameKey ? t(nameKey) : systemConflict.label;
|
||||
return t('snippets.shortkey.error.systemConflict', { name });
|
||||
}
|
||||
|
||||
|
||||
const syntheticEvent = keyStringToKeyboardEvent(key);
|
||||
if (syntheticEvent) {
|
||||
for (const snippet of existingShortkeys) {
|
||||
if (snippet.shortkey && matchesKeyBinding(syntheticEvent, snippet.shortkey, isMac)) {
|
||||
@@ -675,13 +607,13 @@ const SnippetsManager: React.FC<SnippetsManagerProps> = ({
|
||||
return t('snippets.shortkey.error.snippetConflict', { name: conflictingSnippet.label });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}, [
|
||||
activeSystemBindings,
|
||||
buildKeyEventFromString,
|
||||
existingShortkeys,
|
||||
hotkeyScheme,
|
||||
isMac,
|
||||
keyBindings,
|
||||
normalizeKeyString,
|
||||
t,
|
||||
]);
|
||||
@@ -735,6 +667,7 @@ const SnippetsManager: React.FC<SnippetsManagerProps> = ({
|
||||
if (snippet) {
|
||||
setEditingSnippet(snippet);
|
||||
setTargetSelection(snippet.targetsAllHosts ? [] : (snippet.targets || []));
|
||||
setTargetGroupSelection(snippet.targetsAllHosts ? [] : (snippet.targetGroups || []));
|
||||
} else {
|
||||
setEditingSnippet(asScript ? {
|
||||
label: '',
|
||||
@@ -751,6 +684,7 @@ const SnippetsManager: React.FC<SnippetsManagerProps> = ({
|
||||
targets: [],
|
||||
});
|
||||
setTargetSelection([]);
|
||||
setTargetGroupSelection([]);
|
||||
}
|
||||
setRightPanelMode('edit-snippet');
|
||||
}, [selectedPackage]);
|
||||
@@ -773,6 +707,10 @@ const SnippetsManager: React.FC<SnippetsManagerProps> = ({
|
||||
tags: editingSnippet.tags || [],
|
||||
package: editingSnippet.package || '',
|
||||
targets: editingSnippet.targetsAllHosts ? [] : targetSelection,
|
||||
targetGroups: resolveSnippetTargetGroupsForSave(
|
||||
editingSnippet,
|
||||
targetGroupSelection,
|
||||
),
|
||||
targetsAllHosts: editingSnippet.targetsAllHosts || undefined,
|
||||
shortkey: editingSnippet.shortkey,
|
||||
noAutoRun: editingSnippet.noAutoRun,
|
||||
@@ -784,7 +722,7 @@ const SnippetsManager: React.FC<SnippetsManagerProps> = ({
|
||||
trigger: editingSnippet.trigger,
|
||||
triggerPattern: editingSnippet.triggerPattern,
|
||||
};
|
||||
}, [editingSnippet, targetSelection]);
|
||||
}, [editingSnippet, targetGroupSelection, targetSelection]);
|
||||
|
||||
const syncHostsAfterSnippetSave = useCallback((
|
||||
savedSnippet: Snippet,
|
||||
@@ -855,6 +793,7 @@ const SnippetsManager: React.FC<SnippetsManagerProps> = ({
|
||||
setRightPanelMode('none');
|
||||
setEditingSnippet({ label: '', command: '', package: '', targets: [] });
|
||||
setTargetSelection([]);
|
||||
setTargetGroupSelection([]);
|
||||
};
|
||||
|
||||
const hostById = useMemo(() => (
|
||||
@@ -1663,6 +1602,8 @@ const SnippetsManager: React.FC<SnippetsManagerProps> = ({
|
||||
customGroups={customGroups}
|
||||
targetSelection={targetSelection}
|
||||
setTargetSelection={setTargetSelection}
|
||||
targetGroupSelection={targetGroupSelection}
|
||||
setTargetGroupSelection={setTargetGroupSelection}
|
||||
handleTargetSelect={handleTargetSelect}
|
||||
handleTargetSelectionChange={handleTargetSelectionChange}
|
||||
handleTargetPickerBack={handleTargetPickerBack}
|
||||
|
||||
@@ -3,6 +3,7 @@ import { parseSnippetVariables } from '../domain/snippetVariables';
|
||||
import { Check, Clock, Keyboard, Loader2, Package, RotateCcw, Trash2 } from 'lucide-react';
|
||||
import { cn } from '../lib/utils';
|
||||
import SelectHostPanel from './SelectHostPanel';
|
||||
import { SelectGroupDialog } from './SelectGroupDialog';
|
||||
import { AsidePanel, AsidePanelContent, AsidePanelFooter } from './ui/aside-panel';
|
||||
import { Button } from './ui/button';
|
||||
import { Card } from './ui/card';
|
||||
@@ -17,7 +18,10 @@ import { Combobox } from './ui/combobox';
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select';
|
||||
import { HistoryItem } from './SnippetsHistoryItem';
|
||||
import type { Snippet } from '@/domain/models';
|
||||
import { getRunnableHostsForSnippet } from '@/domain/snippetTargets.ts';
|
||||
import {
|
||||
getRunnableHostsForSnippet,
|
||||
resolveSnippetTargetGroupsForSave,
|
||||
} from '@/domain/snippetTargets.ts';
|
||||
import { STORAGE_KEY_SNIPPETS_PANEL_WIDTH } from '@/infrastructure/config/storageKeys.ts';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
@@ -29,6 +33,8 @@ export const SnippetsRightPanel: React.FC<SnippetsRightPanelProps> = ({
|
||||
customGroups,
|
||||
targetSelection,
|
||||
setTargetSelection,
|
||||
targetGroupSelection,
|
||||
setTargetGroupSelection,
|
||||
handleTargetSelect,
|
||||
handleTargetSelectionChange,
|
||||
handleTargetPickerBack,
|
||||
@@ -71,6 +77,7 @@ export const SnippetsRightPanel: React.FC<SnippetsRightPanelProps> = ({
|
||||
[editingSnippet?.command],
|
||||
);
|
||||
const [scriptEditorModalOpen, setScriptEditorModalOpen] = useState(false);
|
||||
const [groupPickerOpen, setGroupPickerOpen] = useState(false);
|
||||
const isEditingScript = isScriptSnippet(editingSnippet as import('../types').Snippet);
|
||||
const snippetsPanelResizeProps = {
|
||||
resizable: true as const,
|
||||
@@ -81,8 +88,12 @@ export const SnippetsRightPanel: React.FC<SnippetsRightPanelProps> = ({
|
||||
const runnableEditingSnippet = useMemo(() => ({
|
||||
...(editingSnippet as Snippet),
|
||||
targets: editingSnippet.targetsAllHosts ? [] : targetSelection,
|
||||
targetGroups: resolveSnippetTargetGroupsForSave(
|
||||
editingSnippet,
|
||||
targetGroupSelection,
|
||||
),
|
||||
targetsAllHosts: editingSnippet.targetsAllHosts || undefined,
|
||||
}), [editingSnippet, targetSelection]);
|
||||
}), [editingSnippet, targetGroupSelection, targetSelection]);
|
||||
|
||||
const runTargets = useMemo(
|
||||
() => getRunnableHostsForSnippet(runnableEditingSnippet, hosts),
|
||||
@@ -99,10 +110,12 @@ export const SnippetsRightPanel: React.FC<SnippetsRightPanelProps> = ({
|
||||
const handleTargetsAllHostsChange = (checked: boolean) => {
|
||||
if (checked) {
|
||||
setTargetSelection([]);
|
||||
setTargetGroupSelection([]);
|
||||
setEditingSnippet({
|
||||
...editingSnippet,
|
||||
targetsAllHosts: true,
|
||||
targets: [],
|
||||
targetGroups: undefined,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -137,6 +150,7 @@ export const SnippetsRightPanel: React.FC<SnippetsRightPanelProps> = ({
|
||||
|
||||
if (rightPanelMode === 'edit-snippet') {
|
||||
return (
|
||||
<>
|
||||
<AsidePanel
|
||||
open={true}
|
||||
onClose={handleClosePanel}
|
||||
@@ -266,7 +280,9 @@ export const SnippetsRightPanel: React.FC<SnippetsRightPanelProps> = ({
|
||||
<SnippetTargetsSection
|
||||
t={t}
|
||||
targetHosts={targetHosts}
|
||||
targetGroups={isEditingScript ? targetGroupSelection : []}
|
||||
onEditTargets={openTargetPicker}
|
||||
onEditGroups={isEditingScript ? () => setGroupPickerOpen(true) : undefined}
|
||||
hint={isEditingScript
|
||||
? (editingSnippet.trigger === 'onConnect'
|
||||
? t('scripts.targets.connectOrderHint')
|
||||
@@ -386,11 +402,29 @@ export const SnippetsRightPanel: React.FC<SnippetsRightPanelProps> = ({
|
||||
selectedHostIds={targetSelection}
|
||||
onSelectHost={handleTargetSelect}
|
||||
onSelectionChange={handleTargetSelectionChange}
|
||||
selectedGroupPaths={targetGroupSelection}
|
||||
onGroupSelectionChange={setTargetGroupSelection}
|
||||
targetsAllHosts={Boolean(editingSnippet.targetsAllHosts)}
|
||||
onTargetsAllHostsChange={handleTargetsAllHostsChange}
|
||||
/>
|
||||
) : null}
|
||||
</AsidePanel>
|
||||
<SelectGroupDialog
|
||||
open={groupPickerOpen}
|
||||
onOpenChange={setGroupPickerOpen}
|
||||
hosts={hosts}
|
||||
customGroups={customGroups}
|
||||
selectedGroupPaths={targetGroupSelection}
|
||||
onSelectionChange={(nextGroups) => {
|
||||
setTargetGroupSelection(nextGroups);
|
||||
setEditingSnippet({
|
||||
...editingSnippet,
|
||||
targetGroups: nextGroups,
|
||||
targetsAllHosts: undefined,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+36
-14
@@ -44,6 +44,7 @@ import {
|
||||
import { classifyDistroId, shouldProbeSessionCwd } from "../domain/host";
|
||||
import { shouldCollectServerStats } from "../domain/systemManager/systemTarget";
|
||||
import { resolveHostSshConnectionTimeouts } from "../domain/sshConnectionTimeouts";
|
||||
import { CONNECTION_PROGRESS_START } from "./terminal/connectionProgress";
|
||||
import { supportsZmodemTerminalDragDrop } from "../lib/zmodemDragDrop";
|
||||
import { resolveHostAuth, resolveHostAutofillPassword } from "../domain/sshAuth";
|
||||
import { resolveEffectiveTerminalProtocol } from "../domain/terminalProtocol";
|
||||
@@ -121,6 +122,7 @@ import { useVaultSnapshotField } from "@/application/state/vaultSnapshotStore.ts
|
||||
import { netcattyBridge } from "@/infrastructure/services/netcattyBridge.ts";
|
||||
import { ScriptExecutionOverlay } from "./terminal/ScriptExecutionOverlay";
|
||||
import { isScriptSnippet } from "@/domain/snippetScript.ts";
|
||||
import { snippetCanRunInTerminal } from "@/domain/snippetTargets.ts";
|
||||
import { useOutputTriggers } from "@/application/state/useOutputTriggers.ts";
|
||||
import { TerminalComposeBar } from "./terminal/TerminalComposeBar";
|
||||
import { TerminalContextMenu } from "./terminal/TerminalContextMenu";
|
||||
@@ -132,6 +134,7 @@ import { createConnectionLogBuffer } from "./terminal/connectionLogBuffer";
|
||||
import { createProgrammaticCommandLogRewriter, type ProgrammaticCommandLogRewrite } from "./terminal/programmaticCommandLog";
|
||||
import { getSessionLogInitialLine } from "./terminal/sessionLogInitialLine";
|
||||
import { getTerminalSelectionForClipboard } from "./terminal/normalizeTerminalSelection";
|
||||
import { getHistoryPreviewSelectionFromRoot } from "./terminal/runtime/terminalHistoryScrollOverride";
|
||||
import { useZmodemTransfer } from "./terminal/hooks/useZmodemTransfer";
|
||||
import {
|
||||
createTerminalSessionStarters,
|
||||
@@ -427,7 +430,7 @@ const TerminalComponent: React.FC<TerminalProps> = ({
|
||||
const scriptSessionName = sessionDisplayName || host.label;
|
||||
const outputTriggers = useOutputTriggers({
|
||||
sessionId,
|
||||
hostId: host.id,
|
||||
host,
|
||||
snippets,
|
||||
onRunScript: (snippet, sid) => runAutomationScript({
|
||||
snippet,
|
||||
@@ -438,7 +441,7 @@ const TerminalComponent: React.FC<TerminalProps> = ({
|
||||
hostname: host.hostname,
|
||||
username: host.username,
|
||||
},
|
||||
}).catch((err) => {
|
||||
}).then(() => undefined).catch((err) => {
|
||||
const message = err instanceof Error ? err.message : String(err);
|
||||
toast.error(message.includes('Observer mode') ? t('scripts.observer.blocked') : message);
|
||||
throw err;
|
||||
@@ -823,7 +826,7 @@ const TerminalComponent: React.FC<TerminalProps> = ({
|
||||
const [isCancelling, setIsCancelling] = useState(false);
|
||||
const [showSFTP, setShowSFTP] = useState(false);
|
||||
const [isSessionLogging, setIsSessionLogging] = useState(false);
|
||||
const [progressValue, setProgressValue] = useState(15);
|
||||
const [progressValue, setProgressValue] = useState(CONNECTION_PROGRESS_START);
|
||||
const [isDisconnectedDialogDismissed, setIsDisconnectedDialogDismissed] = useState(false);
|
||||
const [connectionReuseFellBack, setConnectionReuseFellBack] = useState(false);
|
||||
const [connectionReuseAttemptSourceId, setConnectionReuseAttemptSourceId] = useState(
|
||||
@@ -1512,6 +1515,7 @@ const TerminalComponent: React.FC<TerminalProps> = ({
|
||||
return;
|
||||
}
|
||||
}
|
||||
await xtermRuntimeRef.current?.keywordHighlighter.prepareForSerialization();
|
||||
snapshot = serializeAddonRef.current.serialize() || "";
|
||||
} else if (hibernatedRef.current || softHiddenRef.current) {
|
||||
// Hibernate path: live xterm is torn down; use retained snapshot.
|
||||
@@ -1617,7 +1621,7 @@ const TerminalComponent: React.FC<TerminalProps> = ({
|
||||
terminalCwdTracker,
|
||||
]);
|
||||
|
||||
const cleanupSession = async () => {
|
||||
const cleanupSession = async (options?: { retainOwnership?: boolean }) => {
|
||||
const closingSessionId = sessionRef.current;
|
||||
xtermRuntimeRef.current?.flushKittyKeyboardReleases();
|
||||
sessionRef.current = null;
|
||||
@@ -1645,7 +1649,10 @@ const TerminalComponent: React.FC<TerminalProps> = ({
|
||||
// Still notify main so in-flight SSH passphrase prompts for this UI
|
||||
// sessionId are aborted even before a backend session was attached.
|
||||
try {
|
||||
await terminalBackend.closeSession(sessionId, { bootEpoch: resolveCloseBootEpoch() });
|
||||
await terminalBackend.closeSession(sessionId, {
|
||||
bootEpoch: resolveCloseBootEpoch(),
|
||||
...(options?.retainOwnership === true ? { retainOwnership: true } : {}),
|
||||
});
|
||||
} catch (err) {
|
||||
logger.warn("Failed to cancel pending session boot on disconnect", err);
|
||||
}
|
||||
@@ -1692,6 +1699,7 @@ const TerminalComponent: React.FC<TerminalProps> = ({
|
||||
}
|
||||
let serializedSnapshot: unknown;
|
||||
try {
|
||||
await xtermRuntimeRef.current?.keywordHighlighter.prepareForSerialization();
|
||||
serializedSnapshot = serializeAddonRef.current?.serialize?.();
|
||||
} catch (err) {
|
||||
logger.warn("Failed to serialize terminal snapshot for attach popup", err);
|
||||
@@ -1754,7 +1762,10 @@ const TerminalComponent: React.FC<TerminalProps> = ({
|
||||
clearTerminalSessionFlowAck(closingSessionId);
|
||||
}
|
||||
try {
|
||||
await terminalBackend.closeSession(closingSessionId, { bootEpoch: resolveCloseBootEpoch() });
|
||||
await terminalBackend.closeSession(closingSessionId, {
|
||||
bootEpoch: resolveCloseBootEpoch(),
|
||||
...(options?.retainOwnership === true ? { retainOwnership: true } : {}),
|
||||
});
|
||||
} catch (err) {
|
||||
logger.warn("Failed to close SSH session", err);
|
||||
}
|
||||
@@ -2046,7 +2057,11 @@ const TerminalComponent: React.FC<TerminalProps> = ({
|
||||
const snapshot = await serializeTerminalForHibernate(
|
||||
term,
|
||||
serializeAddon,
|
||||
{ preferWasm: resolveHibernatePreferWasmSerialize(terminalSettingsRef.current) },
|
||||
{
|
||||
preferWasm: resolveHibernatePreferWasmSerialize(terminalSettingsRef.current),
|
||||
prepare: () => xtermRuntimeRef.current?.keywordHighlighter.prepareForSerialization()
|
||||
?? Promise.resolve(),
|
||||
},
|
||||
);
|
||||
|
||||
if (!canFinishHibernate()) return false;
|
||||
@@ -2168,6 +2183,8 @@ const TerminalComponent: React.FC<TerminalProps> = ({
|
||||
termRef,
|
||||
fitAddonRef,
|
||||
serializeAddonRef,
|
||||
prepareKeywordHighlightSerialization: () => xtermRuntimeRef.current
|
||||
?.keywordHighlighter.prepareForSerialization() ?? Promise.resolve(),
|
||||
searchAddonRef,
|
||||
hasRuntimeRef,
|
||||
}), []);
|
||||
@@ -3067,6 +3084,10 @@ const TerminalComponent: React.FC<TerminalProps> = ({
|
||||
|
||||
const executeSnippet = useCallback(async (snippet: Snippet) => {
|
||||
if (isScriptSnippet(snippet)) {
|
||||
if (!snippetCanRunInTerminal(snippet, host)) {
|
||||
toast.error(t('scripts.targets.currentHostMismatch'));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await runAutomationScript({
|
||||
snippet,
|
||||
@@ -3089,7 +3110,7 @@ const TerminalComponent: React.FC<TerminalProps> = ({
|
||||
executeSnippetCommand(command, snippet.noAutoRun, {
|
||||
multiLineRunMode: snippet.multiLineRunMode,
|
||||
});
|
||||
}, [executeSnippetCommand, host.hostname, host.username, scriptSessionName, sessionId, t]);
|
||||
}, [executeSnippetCommand, host, scriptSessionName, sessionId, t]);
|
||||
|
||||
const onSnippetShortkeyRef = useRef(executeSnippet);
|
||||
onSnippetShortkeyRef.current = executeSnippet;
|
||||
@@ -3127,10 +3148,11 @@ const TerminalComponent: React.FC<TerminalProps> = ({
|
||||
const handleAddSelectionToAI = useCallback(() => {
|
||||
const term = termRef.current;
|
||||
if (!term) return;
|
||||
const selection = getTerminalSelectionForClipboard(
|
||||
term,
|
||||
terminalSettings?.normalizeTextOnCopy ?? true,
|
||||
);
|
||||
const selection = getHistoryPreviewSelectionFromRoot(term.element?.parentElement)
|
||||
|| getTerminalSelectionForClipboard(
|
||||
term,
|
||||
terminalSettings?.normalizeTextOnCopy ?? true,
|
||||
);
|
||||
if (!selection.trim()) return;
|
||||
onAddSelectionToAI?.(sessionId, selection);
|
||||
}, [onAddSelectionToAI, sessionId, terminalSettings?.normalizeTextOnCopy]);
|
||||
@@ -3303,7 +3325,7 @@ const TerminalComponent: React.FC<TerminalProps> = ({
|
||||
setPendingHostKeyRequestId(null);
|
||||
setError(null);
|
||||
setProgressLogs((prev) => [...prev, "Disconnected by user."]);
|
||||
void cleanupSession();
|
||||
void cleanupSession({ retainOwnership: true });
|
||||
updateStatus("disconnected");
|
||||
setChainProgress(null);
|
||||
setIsDisconnectedDialogDismissed(false);
|
||||
@@ -3472,7 +3494,7 @@ const TerminalComponent: React.FC<TerminalProps> = ({
|
||||
}
|
||||
|
||||
try {
|
||||
await cleanupSession();
|
||||
await cleanupSession({ retainOwnership: true });
|
||||
} catch (error) {
|
||||
finishReconnectPreparation();
|
||||
throw error;
|
||||
|
||||
@@ -60,48 +60,66 @@ const renderVault = (sortMode: string | null, hosts: Host[]) => {
|
||||
return renderToStaticMarkup(
|
||||
React.createElement(
|
||||
I18nProvider,
|
||||
{ locale: "en" },
|
||||
React.createElement(
|
||||
TooltipProvider,
|
||||
null,
|
||||
React.createElement(VaultView, {
|
||||
hosts,
|
||||
keys: [],
|
||||
identities: [],
|
||||
proxyProfiles: [],
|
||||
snippets: [],
|
||||
snippetPackages: [],
|
||||
customGroups: [],
|
||||
knownHosts: [],
|
||||
managedSources: [],
|
||||
sessionCount: 0,
|
||||
hotkeyScheme: "mac",
|
||||
keyBindings: [],
|
||||
terminalThemeId: "default",
|
||||
terminalFontSize: 14,
|
||||
onOpenSettings: noop,
|
||||
onOpenQuickSwitcher: noop,
|
||||
onCreateLocalTerminal: noop,
|
||||
onDeleteHost: noop,
|
||||
onConnect: noop,
|
||||
onUpdateHosts: noop,
|
||||
onUpdateKeys: noop,
|
||||
onImportOrReuseKey: () => fallbackKey,
|
||||
onUpdateIdentities: noop,
|
||||
onUpdateProxyProfiles: noop,
|
||||
onUpdateSnippets: noop,
|
||||
onUpdateSnippetPackages: noop,
|
||||
onUpdateCustomGroups: noop,
|
||||
onUpdateKnownHosts: noop,
|
||||
onUpdateManagedSources: noop,
|
||||
onConvertKnownHost: noop,
|
||||
onOpenLogView: noop,
|
||||
groupConfigs: [],
|
||||
onUpdateGroupConfigs: noop,
|
||||
showRecentHosts: false,
|
||||
showOnlyUngroupedHostsInRoot: false,
|
||||
}),
|
||||
),
|
||||
{
|
||||
locale: "en",
|
||||
children: React.createElement(
|
||||
TooltipProvider,
|
||||
null,
|
||||
React.createElement(VaultView, {
|
||||
hosts,
|
||||
keys: [],
|
||||
identities: [],
|
||||
proxyProfiles: [],
|
||||
snippets: [],
|
||||
snippetPackages: [],
|
||||
customGroups: [],
|
||||
knownHosts: [],
|
||||
managedSources: [],
|
||||
sessionCount: 0,
|
||||
hotkeyScheme: "mac",
|
||||
keyBindings: [],
|
||||
terminalThemeId: "default",
|
||||
terminalFontSize: 14,
|
||||
onOpenSettings: noop,
|
||||
onOpenQuickSwitcher: noop,
|
||||
onCreateLocalTerminal: noop,
|
||||
onDeleteHost: noop,
|
||||
onConnect: noop,
|
||||
onUpdateHosts: noop,
|
||||
onUpdateKeys: noop,
|
||||
onImportOrReuseKey: () => fallbackKey,
|
||||
onUpdateIdentities: noop,
|
||||
onUpdateProxyProfiles: noop,
|
||||
onUpdateSnippets: noop,
|
||||
onUpdateSnippetPackages: noop,
|
||||
onUpdateCustomGroups: noop,
|
||||
onUpdateKnownHosts: noop,
|
||||
onUpdateManagedSources: noop,
|
||||
onReadPersistedHosts: async () => hosts,
|
||||
onReadPersistedManagedSources: () => [],
|
||||
onCommitPluginImporterData: async () => 0,
|
||||
onCommitVaultImportTransaction: async () => ({
|
||||
status: "persisted" as const,
|
||||
groups: [],
|
||||
sources: [],
|
||||
groupConfigs: [],
|
||||
}),
|
||||
onCommitVaultGroupMutation: async (mutate) => mutate({
|
||||
groups: [],
|
||||
configs: [],
|
||||
hosts,
|
||||
managedSources: [],
|
||||
snippets: [],
|
||||
}),
|
||||
onConvertKnownHost: noop,
|
||||
onOpenLogView: noop,
|
||||
groupConfigs: [],
|
||||
onUpdateGroupConfigs: noop,
|
||||
showRecentHosts: false,
|
||||
showOnlyUngroupedHostsInRoot: false,
|
||||
}),
|
||||
),
|
||||
},
|
||||
),
|
||||
);
|
||||
};
|
||||
|
||||
+91
-113
@@ -52,6 +52,10 @@ import type { VaultLockHandle } from "../application/state/vaultManagedImportLoc
|
||||
import { useTreeExpandedState } from "../application/state/useTreeExpandedState";
|
||||
import { useVaultGroupDeletion } from "../application/state/useVaultGroupDeletion";
|
||||
import type { VaultHostPersistenceResult } from "../application/state/vaultImportProgress";
|
||||
import type {
|
||||
VaultGroupMutationResult,
|
||||
VaultGroupMutationState,
|
||||
} from "../domain/vaultGroupMutation";
|
||||
import type { PluginImporterCommitRequest } from "../application/state/usePluginImporterCommit";
|
||||
import { buildVaultCsvCredentialOptions } from "../application/vaultCsvExportCredentials";
|
||||
import { sanitizeCredentialValue } from "../domain/credentials";
|
||||
@@ -69,6 +73,9 @@ import {
|
||||
upsertHostById,
|
||||
} from "../domain/host";
|
||||
import { exportHostsToCsvWithStats } from "../domain/vaultImport";
|
||||
import {
|
||||
remapSnippetTargetGroupPaths,
|
||||
} from "../domain/hostGroupPathMutations";
|
||||
import {
|
||||
reorderVaultItems,
|
||||
reorderVaultStrings,
|
||||
@@ -261,6 +268,10 @@ interface VaultViewProps {
|
||||
}
|
||||
| { status: "superseded" }
|
||||
>;
|
||||
onCommitVaultGroupMutation: (
|
||||
mutate: (current: VaultGroupMutationState) => VaultGroupMutationResult,
|
||||
lock?: VaultLockHandle | null,
|
||||
) => Promise<VaultGroupMutationResult | { ok: false; superseded: true }>;
|
||||
onClearAndRemoveManagedSource?: (source: ManagedSource) => Promise<() => Promise<void>>;
|
||||
onClearAndRemoveManagedSources?: (sources: ManagedSource[]) => Promise<() => Promise<void>>;
|
||||
onUnmanageSource?: (sourceId: string) => void;
|
||||
@@ -325,6 +336,7 @@ const VaultViewInner: React.FC<VaultViewProps> = ({
|
||||
onUpdateManagedSources,
|
||||
onReadPersistedManagedSources,
|
||||
onCommitVaultImportTransaction,
|
||||
onCommitVaultGroupMutation,
|
||||
onClearAndRemoveManagedSource,
|
||||
onClearAndRemoveManagedSources,
|
||||
onUnmanageSource,
|
||||
@@ -951,7 +963,66 @@ const VaultViewInner: React.FC<VaultViewProps> = ({
|
||||
setIsNewFolderOpen(false);
|
||||
};
|
||||
|
||||
const submitRenameGroup = () => {
|
||||
const commitGroupPathChange = useCallback(async (
|
||||
sourcePath: string,
|
||||
nextPath: string,
|
||||
replacementConfig?: GroupConfig,
|
||||
) => {
|
||||
try {
|
||||
return await onCommitVaultGroupMutation((current) => {
|
||||
if (!current.groups.includes(sourcePath)) {
|
||||
return { ok: false, error: `Group "${sourcePath}" was not found.` };
|
||||
}
|
||||
const belongsToTree = (path: string) => (
|
||||
path === sourcePath || path.startsWith(`${sourcePath}/`)
|
||||
);
|
||||
const rename = (path: string) => (
|
||||
path === sourcePath
|
||||
? nextPath
|
||||
: path.startsWith(`${sourcePath}/`)
|
||||
? nextPath + path.slice(sourcePath.length)
|
||||
: path
|
||||
);
|
||||
const occupied = new Set([
|
||||
...current.groups.filter((path) => !belongsToTree(path)),
|
||||
...current.configs.map((config) => config.path).filter((path) => !belongsToTree(path)),
|
||||
]);
|
||||
const collision = [
|
||||
...current.groups,
|
||||
...current.configs.map((config) => config.path),
|
||||
].filter(belongsToTree).map(rename).find((path) => occupied.has(path));
|
||||
if (collision) return { ok: false, error: `Group "${collision}" already exists.` };
|
||||
|
||||
const configs = current.configs.map((config) => {
|
||||
if (replacementConfig && config.path === sourcePath) {
|
||||
return { ...replacementConfig, path: nextPath };
|
||||
}
|
||||
return belongsToTree(config.path) ? { ...config, path: rename(config.path) } : config;
|
||||
});
|
||||
if (replacementConfig && !current.configs.some((config) => config.path === sourcePath)) {
|
||||
configs.push({ ...replacementConfig, path: nextPath });
|
||||
}
|
||||
return {
|
||||
ok: true,
|
||||
state: {
|
||||
groups: Array.from(new Set(current.groups.map(rename))),
|
||||
configs,
|
||||
hosts: current.hosts.map((host) => (
|
||||
host.group && belongsToTree(host.group) ? { ...host, group: rename(host.group) } : host
|
||||
)),
|
||||
managedSources: current.managedSources.map((source) => (
|
||||
belongsToTree(source.groupName) ? { ...source, groupName: rename(source.groupName) } : source
|
||||
)),
|
||||
snippets: remapSnippetTargetGroupPaths(current.snippets, sourcePath, nextPath),
|
||||
},
|
||||
};
|
||||
});
|
||||
} catch (error) {
|
||||
return { ok: false as const, error: error instanceof Error ? error.message : String(error) };
|
||||
}
|
||||
}, [onCommitVaultGroupMutation]);
|
||||
|
||||
const submitRenameGroup = async () => {
|
||||
if (!renameTargetPath) return;
|
||||
|
||||
const nextName = renameGroupName.trim();
|
||||
@@ -972,37 +1043,11 @@ const VaultViewInner: React.FC<VaultViewProps> = ({
|
||||
return;
|
||||
}
|
||||
|
||||
const updatedGroups = customGroups.map((g) => {
|
||||
if (g === renameTargetPath) return nextPath;
|
||||
if (g.startsWith(renameTargetPath + "/"))
|
||||
return nextPath + g.slice(renameTargetPath.length);
|
||||
return g;
|
||||
});
|
||||
const updatedHosts = hosts.map((h) => {
|
||||
const g = h.group || "";
|
||||
if (g === renameTargetPath) return { ...h, group: nextPath };
|
||||
if (g.startsWith(renameTargetPath + "/"))
|
||||
return { ...h, group: nextPath + g.slice(renameTargetPath.length) };
|
||||
return h;
|
||||
});
|
||||
|
||||
// Update managed sources if any match the renamed group path
|
||||
const updatedManagedSources = managedSources.map((s) => {
|
||||
if (s.groupName === renameTargetPath)
|
||||
return { ...s, groupName: nextPath };
|
||||
if (s.groupName.startsWith(renameTargetPath + "/"))
|
||||
return {
|
||||
...s,
|
||||
groupName: nextPath + s.groupName.slice(renameTargetPath.length),
|
||||
};
|
||||
return s;
|
||||
});
|
||||
if (updatedManagedSources.some((s, i) => s !== managedSources[i])) {
|
||||
onUpdateManagedSources(updatedManagedSources);
|
||||
const result = await commitGroupPathChange(renameTargetPath, nextPath);
|
||||
if ("superseded" in result || "error" in result) {
|
||||
setRenameGroupError("superseded" in result ? t("common.error") : result.error);
|
||||
return;
|
||||
}
|
||||
|
||||
onUpdateCustomGroups(Array.from(new Set(updatedGroups)));
|
||||
onUpdateHosts(updatedHosts);
|
||||
if (
|
||||
selectedGroupPath &&
|
||||
(selectedGroupPath === renameTargetPath ||
|
||||
@@ -1026,7 +1071,7 @@ const VaultViewInner: React.FC<VaultViewProps> = ({
|
||||
}, []);
|
||||
|
||||
const handleSaveGroupConfig = useCallback(
|
||||
(config: GroupConfig, _newName?: string, _newParent?: string | null) => {
|
||||
async (config: GroupConfig, _newName?: string, _newParent?: string | null) => {
|
||||
const oldPath = editingGroupPath!;
|
||||
const newPath = config.path; // Panel already computed the correct path
|
||||
|
||||
@@ -1044,41 +1089,11 @@ const VaultViewInner: React.FC<VaultViewProps> = ({
|
||||
|
||||
// Handle path change (rename or parent change)
|
||||
if (newPath !== oldPath) {
|
||||
// Update groups, hosts, managed sources, and configs for path change
|
||||
const updatedGroups = customGroups.map((g) => {
|
||||
if (g === oldPath) return newPath;
|
||||
if (g.startsWith(oldPath + "/"))
|
||||
return newPath + g.slice(oldPath.length);
|
||||
return g;
|
||||
});
|
||||
const updatedHosts = hosts.map((h) => {
|
||||
const g = h.group || "";
|
||||
if (g === oldPath) return { ...h, group: newPath };
|
||||
if (g.startsWith(oldPath + "/"))
|
||||
return { ...h, group: newPath + g.slice(oldPath.length) };
|
||||
return h;
|
||||
});
|
||||
const updatedManagedSources = managedSources.map((s) => {
|
||||
if (s.groupName === oldPath) return { ...s, groupName: newPath };
|
||||
if (s.groupName.startsWith(oldPath + "/"))
|
||||
return {
|
||||
...s,
|
||||
groupName: newPath + s.groupName.slice(oldPath.length),
|
||||
};
|
||||
return s;
|
||||
});
|
||||
if (updatedManagedSources.some((s, i) => s !== managedSources[i])) {
|
||||
onUpdateManagedSources(updatedManagedSources);
|
||||
const result = await commitGroupPathChange(oldPath, newPath, config);
|
||||
if ("superseded" in result || "error" in result) {
|
||||
toast.error("superseded" in result ? t("common.error") : result.error);
|
||||
return;
|
||||
}
|
||||
onUpdateCustomGroups(Array.from(new Set(updatedGroups)));
|
||||
onUpdateHosts(updatedHosts);
|
||||
// Update child config paths too
|
||||
const finalConfigs = updatedConfigs.map((c) => {
|
||||
if (c.path.startsWith(oldPath + "/"))
|
||||
return { ...c, path: newPath + c.path.slice(oldPath.length) };
|
||||
return c;
|
||||
});
|
||||
onUpdateGroupConfigs(finalConfigs);
|
||||
if (selectedGroupPath === oldPath) setSelectedGroupPath(newPath);
|
||||
if (selectedGroupPath?.startsWith(oldPath + "/")) {
|
||||
setSelectedGroupPath(
|
||||
@@ -1096,13 +1111,9 @@ const VaultViewInner: React.FC<VaultViewProps> = ({
|
||||
groupConfigs,
|
||||
editingGroupPath,
|
||||
customGroups,
|
||||
hosts,
|
||||
managedSources,
|
||||
selectedGroupPath,
|
||||
commitGroupPathChange,
|
||||
onUpdateGroupConfigs,
|
||||
onUpdateCustomGroups,
|
||||
onUpdateHosts,
|
||||
onUpdateManagedSources,
|
||||
t,
|
||||
],
|
||||
);
|
||||
@@ -1129,7 +1140,7 @@ const VaultViewInner: React.FC<VaultViewProps> = ({
|
||||
managedSources,
|
||||
onReadPersistedHosts,
|
||||
onReadPersistedManagedSources,
|
||||
onCommitVaultImportTransaction,
|
||||
onCommitVaultGroupMutation,
|
||||
onClearAndRemoveManagedSource,
|
||||
onClearAndRemoveManagedSources,
|
||||
onDeletedPaths: handleDeletedGroupPaths,
|
||||
@@ -1138,7 +1149,7 @@ const VaultViewInner: React.FC<VaultViewProps> = ({
|
||||
const deleteGroupPath = (path: string, deleteHosts: boolean = false) =>
|
||||
deleteGroupPaths([path], deleteHosts);
|
||||
|
||||
const moveGroup = (sourcePath: string, targetParent: string | null) => {
|
||||
const moveGroup = async (sourcePath: string, targetParent: string | null) => {
|
||||
const name = sourcePath.split("/").filter(Boolean).pop() || "";
|
||||
const newPath = targetParent ? `${targetParent}/${name}` : name;
|
||||
if (newPath === sourcePath || newPath.startsWith(sourcePath + "/")) return;
|
||||
@@ -1146,50 +1157,17 @@ const VaultViewInner: React.FC<VaultViewProps> = ({
|
||||
toast.error(t("vault.groups.errors.duplicatePath"));
|
||||
return;
|
||||
}
|
||||
const updatedGroups = customGroups.map((g) => {
|
||||
if (g === sourcePath) return newPath;
|
||||
if (g.startsWith(sourcePath + "/"))
|
||||
return newPath + g.slice(sourcePath.length);
|
||||
return g;
|
||||
});
|
||||
const updatedHosts = hosts.map((h) => {
|
||||
const g = h.group || "";
|
||||
if (g === sourcePath) return { ...h, group: newPath };
|
||||
if (g.startsWith(sourcePath + "/"))
|
||||
return { ...h, group: newPath + g.slice(sourcePath.length) };
|
||||
return h;
|
||||
});
|
||||
// Update managed sources if any match the moved group path
|
||||
const updatedManagedSources = managedSources.map((s) => {
|
||||
if (s.groupName === sourcePath) return { ...s, groupName: newPath };
|
||||
if (s.groupName.startsWith(sourcePath + "/"))
|
||||
return {
|
||||
...s,
|
||||
groupName: newPath + s.groupName.slice(sourcePath.length),
|
||||
};
|
||||
return s;
|
||||
});
|
||||
if (updatedManagedSources.some((s, i) => s !== managedSources[i])) {
|
||||
onUpdateManagedSources(updatedManagedSources);
|
||||
}
|
||||
onUpdateCustomGroups(Array.from(new Set(updatedGroups)));
|
||||
onUpdateHosts(updatedHosts);
|
||||
// Update group configs for moved paths
|
||||
const updatedGroupConfigs = groupConfigs.map((c) => {
|
||||
if (c.path === sourcePath) return { ...c, path: newPath };
|
||||
if (c.path.startsWith(sourcePath + "/"))
|
||||
return { ...c, path: newPath + c.path.slice(sourcePath.length) };
|
||||
return c;
|
||||
});
|
||||
if (updatedGroupConfigs.some((c, i) => c !== groupConfigs[i])) {
|
||||
onUpdateGroupConfigs(updatedGroupConfigs);
|
||||
const result = await commitGroupPathChange(sourcePath, newPath);
|
||||
if ("superseded" in result || "error" in result) {
|
||||
toast.error("superseded" in result ? t("common.error") : result.error);
|
||||
return;
|
||||
}
|
||||
if (
|
||||
selectedGroupPath &&
|
||||
(selectedGroupPath === sourcePath ||
|
||||
selectedGroupPath.startsWith(sourcePath + "/"))
|
||||
) {
|
||||
setSelectedGroupPath(newPath);
|
||||
setSelectedGroupPath(newPath + selectedGroupPath.slice(sourcePath.length));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1321,8 +1299,7 @@ const VaultViewInner: React.FC<VaultViewProps> = ({
|
||||
hosts,
|
||||
managedSources,
|
||||
onUpdateCustomGroups,
|
||||
onUpdateHosts,
|
||||
onUpdateManagedSources,
|
||||
onCommitGroupPathChange: commitGroupPathChange,
|
||||
selectedGroupPath,
|
||||
setSelectedGroupPath,
|
||||
ensurePathExpanded: treeExpandedState.ensurePathExpanded,
|
||||
@@ -1688,6 +1665,7 @@ export const vaultViewAreEqual = (
|
||||
prev.onReadPersistedHosts === next.onReadPersistedHosts &&
|
||||
prev.onReadPersistedManagedSources === next.onReadPersistedManagedSources &&
|
||||
prev.onCommitVaultImportTransaction === next.onCommitVaultImportTransaction &&
|
||||
prev.onCommitVaultGroupMutation === next.onCommitVaultGroupMutation &&
|
||||
prev.onCommitPluginImporterData === next.onCommitPluginImporterData &&
|
||||
prev.showRecentHosts === next.showRecentHosts &&
|
||||
prev.hostClickBehavior === next.hostClickBehavior &&
|
||||
|
||||
@@ -1,12 +1,24 @@
|
||||
import React, { lazy, Suspense } from 'react';
|
||||
import React, { lazy, Suspense, useEffect, useState } from 'react';
|
||||
|
||||
import { cn } from '../../lib/utils';
|
||||
import {
|
||||
enqueueChatMarkdownHydrate,
|
||||
isAiMarkdownRendererReady,
|
||||
scheduleWhenAiComposerIdle,
|
||||
subscribeAiMarkdownRendererReady,
|
||||
warmAiMarkdownRenderer,
|
||||
} from '../ai/aiMarkdownWarmup';
|
||||
import { LazyLoadBoundary } from '../ui/lazy-load-boundary';
|
||||
|
||||
type LazyMessageResponseProps = {
|
||||
children?: React.ReactNode;
|
||||
className?: string;
|
||||
isAnimating?: boolean;
|
||||
/**
|
||||
* Keep plaintext until Streamdown is already warmed. Chat history uses this
|
||||
* so expanding the panel cannot start the ~350KB parse during first typing.
|
||||
*/
|
||||
deferUntilWarm?: boolean;
|
||||
};
|
||||
|
||||
const MessageResponse = lazy(() =>
|
||||
@@ -20,11 +32,34 @@ const PlainTextFallback = ({ children, className }: LazyMessageResponseProps) =>
|
||||
);
|
||||
|
||||
export function LazyMessageResponse(props: LazyMessageResponseProps) {
|
||||
const resetKey = typeof props.children === 'string' ? props.children : undefined;
|
||||
const { deferUntilWarm = false, ...rendererProps } = props;
|
||||
const [ready, setReady] = useState(() => !deferUntilWarm && isAiMarkdownRendererReady());
|
||||
const resetKey = typeof rendererProps.children === 'string' ? rendererProps.children : undefined;
|
||||
|
||||
useEffect(() => {
|
||||
if (ready) return undefined;
|
||||
if (!deferUntilWarm) {
|
||||
const unsubscribe = subscribeAiMarkdownRendererReady(() => setReady(true));
|
||||
if (isAiMarkdownRendererReady()) return unsubscribe;
|
||||
const cancelIdle = scheduleWhenAiComposerIdle(() => {
|
||||
void warmAiMarkdownRenderer();
|
||||
});
|
||||
return () => {
|
||||
unsubscribe();
|
||||
cancelIdle();
|
||||
};
|
||||
}
|
||||
return enqueueChatMarkdownHydrate(() => setReady(true));
|
||||
}, [deferUntilWarm, ready]);
|
||||
|
||||
if (deferUntilWarm && !ready) {
|
||||
return <PlainTextFallback {...rendererProps} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<LazyLoadBoundary fallback={<PlainTextFallback {...props} />} resetKey={resetKey}>
|
||||
<Suspense fallback={<PlainTextFallback {...props} />}>
|
||||
<MessageResponse {...props} />
|
||||
<LazyLoadBoundary fallback={<PlainTextFallback {...rendererProps} />} resetKey={resetKey}>
|
||||
<Suspense fallback={<PlainTextFallback {...rendererProps} />}>
|
||||
<MessageResponse {...rendererProps} />
|
||||
</Suspense>
|
||||
</LazyLoadBoundary>
|
||||
);
|
||||
|
||||
Loaded 100 of 326 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user