@xmoon76/dsh-pi-tui 0.5.7 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +13 -11
- package/README.md +13 -11
- package/dist/{bootstrap-C9nl6e13.mjs → bootstrap-CMIjGyuk.mjs} +532 -416
- package/dist/builtins.mjs +2 -2
- package/dist/{client-bootstrap-CGezi85O.mjs → client-bootstrap-BjGPc-DM.mjs} +826 -3
- package/dist/{daemon-launcher-H_1r5Cqs.mjs → daemon-launcher-Dult7Jxv.mjs} +121 -4
- package/dist/daemon-launcher.mjs +1 -1
- package/dist/{entry-control-jBfKn1qO.mjs → entry-control-DjNsE3I0.mjs} +1 -1
- package/dist/{extensions-6a5vvJUT.mjs → extensions-B4uLpSTv.mjs} +1 -4
- package/dist/extensions.mjs +1 -1
- package/dist/{host-foundation-probe-DK7n5jDu.mjs → host-foundation-probe-DMNTmNrH.mjs} +1 -1
- package/dist/index.mjs +532 -298
- package/dist/{local-acp-listener-CNkguN5-.mjs → local-acp-listener-B65J0Bx4.mjs} +561 -12
- package/dist/local-client.mjs +442 -45
- package/dist/{local-daemon-control-Cu_4FIdd.mjs → local-daemon-control-C14q9KnD.mjs} +5 -2
- package/dist/{local-daemon-control-Bg9s2aYi.mjs → local-daemon-control-TCnERL7n.mjs} +3 -3
- package/dist/{local-discovery-Bq3jLAn1.mjs → local-discovery-DOSsCh9q.mjs} +1 -1
- package/dist/{local-discovery-BMoNXZjJ.mjs → local-discovery-egN4_gsQ.mjs} +1 -1
- package/dist/{local-discovery-BPZw1wEd.mjs → local-discovery-uOBfFq5j.mjs} +1 -1
- package/dist/local-host.mjs +24 -6
- package/dist/local-profile-daemon-admin-BmQSdzT0.mjs +210 -0
- package/dist/{local-scope-DEuGAy8l.mjs → local-scope-DamiMqPd.mjs} +118 -1
- package/dist/{local-transport-X4ZCe2uE.mjs → local-transport-Iwo0mtu3.mjs} +2 -2
- package/dist/{local-web-control-DKWtXIkr.mjs → local-web-control-DMrjwCkl.mjs} +2 -2
- package/dist/{session-DC0XQr5O.mjs → session-C6tSs86s.mjs} +2 -2
- package/dist/{session-Cihe8PPS.mjs → session-CstInGIA.mjs} +1 -1
- package/dist/{startup-CARqn3kV.mjs → startup-EG5UqIcd.mjs} +3 -3
- package/dist/startup.mjs +1 -1
- package/dist/{terminal-progress-source-D4DHyXDo.mjs → terminal-progress-source-CpfpQO_h.mjs} +3 -6
- package/dist/{transcript-view-hvNVkPtv.mjs → transcript-view-C1YtJ49Y.mjs} +191 -192
- package/dist/{transcript-view-a7cROAaI.mjs → transcript-view-CuJYWkhp.mjs} +190 -191
- package/package.json +6 -6
- package/dist/local-profile-daemon-admin-AXgVH-6y.mjs +0 -91
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { $ as SESSIONLESS_COMMANDS, $t as isValidKeyId, A as detachedSessionStatus, At as projectMcpServerEntry, B as remoteFailureMessage, Bt as readWebApiBilling, C as projectShellExecutionSettings, Ct as baseDictKeysOf, Dt as mcpEditOps, Et as mcpAddOps, Ft as assertSearchProviderId, Gt as isPhysicalEscapeAction, Ht as webProviderSelectionFactsOf, It as assertSearchProviderReplaceable, Jt as APP_KEYBINDINGS, K as ScheduleOutcomeUnknownError, Kt as isTerminalAmbiguousKeyId, L as copyFailureDetails, Lt as assertWebApiBilling, M as classifySubagentPromptSettlement, Mt as assertFetchProviderId, N as safeSubagentErrorMessage, Nt as assertFetchProviderReplaceable, O as QuestionAnswerError, Ot as mcpRemoveOps, P as DIRECT_IMPLEMENTED_CAPABILITIES, Pt as assertSearchApiCount, Q as LOCAL_COMMANDS, Qt as isTextProducingKeyId, Rt as isWebApiBilling, S as projectSessionLogUpload, St as CuaAccessUnavailableError, T as projectSubagentModelSelection, Tt as diffMcpServerDraft, Vt as webApiAdvancedFactsOf, Wt as isEditorSubmitPreSubmitKey, X as InvalidateBatcher, Xt as canonicalizeKeyId, Y as PI_TUI_EXTENSIONS_SERVICE, Yt as VIEWER_BLOCKED_PARENT_ACTIONS, Z as IMMEDIATE_SESSIONLESS_COMMANDS, Zt as isRuntimeBindableKeyId, _ as ownedClientExtensionEntryIds, a as detachMcpProbeResult, an as providerOptionsFor, at as localCommandMayWrite, b as snapshotExtensionConfigOps, bt as requireCreated, c as detachChange, cn as contextPressureOccupancy, ct as copyModelSelection, d as detachPhase, dn as TUI_STARTUP_SERVICE, dt as sameModelSelection, en as PROTOCOL_CHOICES, et as SESSION_NAVIGATION_COMMANDS, f as detachPluginManagerSnapshot, ft as normalizeInputEvent, g as pluginInstallRequestId, gt as WorkspaceSelectionError, h as detachPluginVersionList, ht as LifecycleError, i as PluginManagerStaleResultError, in as getPath, it as isPlainExitPrompt, j as detachedTurnOutline, jt as validateMcpServerDraft, k as questionAnswerError, kt as mcpSetEnabledOps, l as detachInspection, ln as bundleVersion, lt as normalizeModelSelection, m as detachPluginUpdateResult, mt as deliveredFileReadErrorFrom, nn as classifyCredentialArg, nt as classifyExitIntent, o as detachMcpServerRoster, on as providerProfileProjectionOf, ot as normalizeSkillInvocation, p as detachPluginUpdateProgress, pt as DeliveredFileReadError, q as ScheduleUnavailableError, qt as parseUserKeybindings, r as createClientExtensionMountOwner, rn as deriveKeyRef, rt as isBareCommandLine, s as hostDirectoryBrowseFailureOutcome, sn as SupersededReadError, st as shouldConsumeAdvertisedMiss, t as consumeRemoteTerminalProgress, tn as ROUTE_PATTERN, tt as classifyCommandLine, u as detachLog, un as dshVersion, ut as rawSelectionFromRequestHeader, v as extensionConfigUserDataPresent, vt as directAgentOf, w as projectSubagentLimits, wt as classifyMcpServerProvenance, x as projectAgentLoopSettings, xt as requireOpened, y as projectExtensionConfigData, yt as ownerHandleOf, z as remoteFailureCode, zt as maskWebProviderOverrideUrl } from "./terminal-progress-source-
|
|
2
|
-
import { g as listKernelGroupMembers, x as sameKernelProcess, y as readKernelProcess } from "./local-scope-
|
|
1
|
+
import { $ as SESSIONLESS_COMMANDS, $t as isValidKeyId, A as detachedSessionStatus, At as projectMcpServerEntry, B as remoteFailureMessage, Bt as readWebApiBilling, C as projectShellExecutionSettings, Ct as baseDictKeysOf, Dt as mcpEditOps, Et as mcpAddOps, Ft as assertSearchProviderId, Gt as isPhysicalEscapeAction, Ht as webProviderSelectionFactsOf, It as assertSearchProviderReplaceable, Jt as APP_KEYBINDINGS, K as ScheduleOutcomeUnknownError, Kt as isTerminalAmbiguousKeyId, L as copyFailureDetails, Lt as assertWebApiBilling, M as classifySubagentPromptSettlement, Mt as assertFetchProviderId, N as safeSubagentErrorMessage, Nt as assertFetchProviderReplaceable, O as QuestionAnswerError, Ot as mcpRemoveOps, P as DIRECT_IMPLEMENTED_CAPABILITIES, Pt as assertSearchApiCount, Q as LOCAL_COMMANDS, Qt as isTextProducingKeyId, Rt as isWebApiBilling, S as projectSessionLogUpload, St as CuaAccessUnavailableError, T as projectSubagentModelSelection, Tt as diffMcpServerDraft, Vt as webApiAdvancedFactsOf, Wt as isEditorSubmitPreSubmitKey, X as InvalidateBatcher, Xt as canonicalizeKeyId, Y as PI_TUI_EXTENSIONS_SERVICE, Yt as VIEWER_BLOCKED_PARENT_ACTIONS, Z as IMMEDIATE_SESSIONLESS_COMMANDS, Zt as isRuntimeBindableKeyId, _ as ownedClientExtensionEntryIds, a as detachMcpProbeResult, an as providerOptionsFor, at as localCommandMayWrite, b as snapshotExtensionConfigOps, bt as requireCreated, c as detachChange, cn as contextPressureOccupancy, ct as copyModelSelection, d as detachPhase, dn as TUI_STARTUP_SERVICE, dt as sameModelSelection, en as PROTOCOL_CHOICES, et as SESSION_NAVIGATION_COMMANDS, f as detachPluginManagerSnapshot, ft as normalizeInputEvent, g as pluginInstallRequestId, gt as WorkspaceSelectionError, h as detachPluginVersionList, ht as LifecycleError, i as PluginManagerStaleResultError, in as getPath, it as isPlainExitPrompt, j as detachedTurnOutline, jt as validateMcpServerDraft, k as questionAnswerError, kt as mcpSetEnabledOps, l as detachInspection, ln as bundleVersion, lt as normalizeModelSelection, m as detachPluginUpdateResult, mt as deliveredFileReadErrorFrom, nn as classifyCredentialArg, nt as classifyExitIntent, o as detachMcpServerRoster, on as providerProfileProjectionOf, ot as normalizeSkillInvocation, p as detachPluginUpdateProgress, pt as DeliveredFileReadError, q as ScheduleUnavailableError, qt as parseUserKeybindings, r as createClientExtensionMountOwner, rn as deriveKeyRef, rt as isBareCommandLine, s as hostDirectoryBrowseFailureOutcome, sn as SupersededReadError, st as shouldConsumeAdvertisedMiss, t as consumeRemoteTerminalProgress, tn as ROUTE_PATTERN, tt as classifyCommandLine, u as detachLog, un as dshVersion, ut as rawSelectionFromRequestHeader, v as extensionConfigUserDataPresent, vt as directAgentOf, w as projectSubagentLimits, wt as classifyMcpServerProvenance, x as projectAgentLoopSettings, xt as requireOpened, y as projectExtensionConfigData, yt as ownerHandleOf, z as remoteFailureCode, zt as maskWebProviderOverrideUrl } from "./terminal-progress-source-CpfpQO_h.mjs";
|
|
2
|
+
import { g as listKernelGroupMembers, x as sameKernelProcess, y as readKernelProcess } from "./local-scope-DamiMqPd.mjs";
|
|
3
3
|
import { n as runSyncDisposalStepsWithPrimary, t as runSyncDisposalSteps } from "./disposal-BYBbEpVY.mjs";
|
|
4
4
|
import { a as runOwned, i as runDetached, n as isCancellation, o as safeErrorMessage, r as observeSettled, s as safeErrorString, t as cancellationError } from "./tasks-D_z5Yjjr.mjs";
|
|
5
|
-
import { n as profileDaemonAdminRun, r as resolveDirectDaemonAdminProfile, t as createProfileDaemonAdmin } from "./local-profile-daemon-admin-
|
|
6
|
-
import { $ as effectiveWorkflowRunOpen, $r as createBoundedFinderCandidateCollector, $t as askAnswersLines, A as summarizeWorkSpan, An as admitSvg, Ar as modelIdentity, At as authorizeSvg, B as FocusActivityComponent, Bi as userBlocksVisibleNow, Bn as formatSessionAge, Br as
|
|
5
|
+
import { a as dshHome, i as diagFromEnv, n as profileDaemonAdminRun, r as resolveDirectDaemonAdminProfile, t as createProfileDaemonAdmin } from "./local-profile-daemon-admin-BmQSdzT0.mjs";
|
|
6
|
+
import { $ as effectiveWorkflowRunOpen, $r as createBoundedFinderCandidateCollector, $t as askAnswersLines, A as summarizeWorkSpan, An as admitSvg, Ar as modelIdentity, At as authorizeSvg, B as FocusActivityComponent, Bi as userBlocksVisibleNow, Bn as formatSessionAge, Br as taskStatusWord, Bt as workspaceRowStatusLabel, C as proveCaretEdit, Ci as textOf, Cn as toolIconSemantic, Ct as setAssistantVisualPresentation, D as contextClusterSummaryParts, Di as transcriptSearchSourceKey, Dn as webCardLines, Dr as PROVIDER_DEFAULT, E as FocusTimingStore, Ei as transcriptSearchMatchKey, En as toolTitle, Er as presetDisplayText, Et as isModelOnlyReplacement, F as clusterByMemberOf, Fi as isSurfacedInteractionTool, Fn as imageProtocolPreference, Fr as markdownTheme, Ft as SESSION_PENDING_LABEL, G as compactActionSlotLine, Gi as historyFilePath, Gn as chooseListedSession, Gr as sanitizeDisplayText, Gt as subagentJobTranscriptId, H as formatCompactDuration, Hi as isAssistantTokenDelta, Hn as sessionBrowserErrorNotice, Hr as singlePhysicalLine, Ht as isTaskItemFailure, I as isFoldableWorkContext, Ii as latestLine, In as thinkingPreviewTail, Ir as selectListTheme, It as SESSION_SOURCE_LABEL, J as compactSlotLine, Jn as sessionRowMatchesQuery, Jr as ClientLocalDiscoveryDriver, Jt as taskRowSelectionDisposition, K as compactActionStatsSignature, Ki as loadHistoryFile, Kn as findSessionMatch, Kr as FILE_ARGUMENT_COMMANDS, Kt as subagentJobViewHint, L as projectTranscriptStructure, Li as finalizedBlockFallbackText, Ln as iconFor, Lr as setTheme, Lt as buildSessionWorkspaceView, Mi as isVisualToolName, Mn as SVG_MAX_RASTER_PIXELS, Mr as HOST_MARKDOWN_OPTIONS, Ni as recentTurnThreshold, Nn as SVG_MAX_RASTER_SIDE, Nr as color, Nt as chartDisplayTitle, O as activityClockOf, Oi as workflowReadablePhase, On as writeFoldedPreview, Or as effortChoicesOf, Ot as visualPartsForStatus, P as projectFocus, Pi as isSurfacedContext, Pn as SVG_RASTER_TIMEOUT_MS, Pr as editorTheme, Pt as chartTextRows, Q as effectiveWorkflowPhaseOpen, Qn as renderWelcomeWhaleLines, Qr as escapeFinderRegex, Qt as GOAL_TOOL_NAMES, R as workByMemberOf, Ri as openOpaqueBlockFallbackText, Rn as iconLead, Rr as settingsListTheme, Rt as currentWorkspaceOf, S as pastedBodySpan, Si as subCallDisplayStatus, Sn as toolCardHeader, Sr as formatLeaderSequence, St as clearAssistantVisualPresentation, T as isLocalShellCard, Ti as rawSourceRangeForNormalizedMatch, Tn as toolSummaryKeys, Tr as isBuiltInPresetRow, Tt as collectPublishedVisuals, U as compactActionPresentation, Ui as usageFromAssistantSettlement, Un as workspaceKey, Ur as sanitizeDisplayLog, Ut as projectTaskItems, V as compactActionStatParts, Vi as StepUsageAccumulator, Vn as sanitizeTerminalText, Vr as sanitizedPhysicalLine, Vt as isTaskItemActive, W as compactActionSignature, Wi as appendHistoryRecord, Wn as canonicalFullSessionId, Wr as sanitizeDisplaySegment, Wt as rowGroup, X as createDisplayProjection, Xn as WELCOME_WHALE_WIDTH, Xr as createFinderRecordStream, Xt as viewerAccessHint, Y as compactThinkSlotLine, Yn as shortSessionId, Yr as clientPathQueryEnvironment, Yt as taskTreePrefix, Z as advanceWorkflowDisclosureState, Zn as pickWelcomeWhaleVariant, Zr as discoverForQuery, Zt as FOLDED_JSON_RESULT_TOOLS, _i as resolveTspNativeFooterConfig, _n as relativizeToCwd, _t as FileHistorySearchSource, ai as attachmentCountLabel, an as foldedResultSummaryFor, ar as FooterItemRegistry, at as eligibleFinalAssistant, bi as assistantStepOf, bn as subagentModelDisplay, br as formatHintKeys, bt as assistantVisualPresentation, ci as SessionOperationBarrier, cn as goalResultSummary, cr as HISTORY_CHORDS, di as createSessionScopeAuthority, dn as parseCallPreview, dr as SESSION_WORKSPACE_CHORDS, ei as rankPathCandidates, en as askAnswersSummary, et as workflowCountsText, fi as darkColors, fn as parseImageEnvelope, fr as SVG_VIEWER_CHORDS, ft as extractInlineSkillPrefix, gn as readFoldedPreview, gt as shellPrefixForMode, hi as withSearchCurrentTokens, hn as parseWriteEnvelope, ht as serializedDraftHasPayload, ii as QueueManagerController, in as foldedCallPreview, ir as tasksItem, it as workflowStatusCounts, j as projectCompact, ji as humanFacingVisualResult, jr as projectModelDirectory, jt as svgDetailRows, k as resolveWorkLifetimes, kn as fileAttachmentSummary, kr as initialEffortOf, l as toolRowImageBlocks, li as TransitionInProgressError, ln as imageFoldedPreview, lr as JOB_LOCAL_KEYS, mi as lightColors, mn as parseSkillEnvelope, mt as serializeEditorInput, ni as resolvePathQuery, nn as compactToolPresentation, nr as createBuiltinFooterRegistry, nt as workflowRunSummaryText, oi as queueManagerCommandResult, on as genericRawInputLines, or as shortCwd$1, ot as createInstalledAutocompleteProvider, pi as detectThemeFromBackground, pn as parseReadEnvelopes, pr as SVG_VIEWER_SCROLL_LABEL, pt as editorModeFromHistoryEntry, q as compactPreparingSummary, qi as loadHistoryRecords, qn as sanitizeSessionSearchInput, qr as suggestPathArgument, qt as taskRowLabel, ri as separatorOfRaw, rn as firstLine, rr as modelItem, rt as workflowRunViewAllVisible, s as imageIdentityText, si as formatBytes, sn as goalResultLines, sr as DELIVERED_FILES_CHORDS, st as classifyFileCompletionContext, ti as reattachDisplayBase, tn as compactToolExpandedLines, tr as FooterCustomItemCatalog, tt as workflowPhasePresentations, u as toolRowProjectsImages, ui as SessionScopeSupersededError, un as isCompactActionTool, ur as QUEUE_CHORDS, vi as TranscriptFolder, vn as resultTextLines, vt as createHistoryRecallScope, w as candidateImagePathFromPaste, wi as TranscriptWindowController, wn as toolPresenterFrom, wr as parseShellWords, wt as asVisualSessionEvents, x as PasteRangeTracker, xi as childOwnEvents, xn as systemContextBody, xr as formatKeyId, xt as assistantVisualPresentationRevision, yi as assistantPresentationRevision, yn as skillFoldedPreview, yt as planVisualPlacement, z as contextPresentationKind, zi as textWithAttachmentMarkers, zn as iconPrefix, zr as taskStatusColor, zt as visibleWorkspaceBrowserRows } from "./transcript-view-CuJYWkhp.mjs";
|
|
7
7
|
import { i as resolveDisplayPreset, n as isDisplayPresetAvailable, r as isFocusDisplayPreset, t as isDisplayPreset } from "./preset-BcWqOtY7.mjs";
|
|
8
8
|
import { a as resolveUserLayerFooterMode, d as resolveCommandFooterFallback, f as stripControlChars, i as resolveUserCommandItemFallbackActivationIds, l as isFooterLayout, n as resolveTrustedFooterCommand, o as MAX_COMMAND_TIMEOUT_MS, r as resolveUserCommandItemActivationIds, s as defaultHideInTsp, u as parseFooterLayout } from "./command-trust-DChWUamk.mjs";
|
|
9
9
|
import { $ as parseFooterCustomItems, A as imageFallback, B as truncateToWidth, C as findAltScreenSearchMatches, D as getGraphemeSegmenter, E as getCellDimensions, F as parseKey, G as activeFooterItemIds, H as wrapTextWithAnsi, I as registerKittyImageMetadata, J as customItemName, K as customCommandConfigOf, L as renderFakeCursor, M as isKeyRelease, N as isKeyRepeat, O as getKeybindings, P as matchesKey, Q as parseFooterCustomItem, R as sliceByColumn, S as dispatchMouseEvent, T as getCapabilities, V as visibleWidth, W as DEFAULT_CUSTOM_COMMAND_REFRESH_MS, X as effectiveCustomCommandTimeoutMs, Y as effectiveCustomCommandRefreshMs, Z as executableCommandItemIds, _ as TuiAltScreen, a as Editor, b as decodeKittyPrintable, c as Input, d as MouseRegion, f as ProcessTerminal, g as Text, h as Spacer$1, i as Container, j as isFocusable, k as getOsc8LinkAtColumn, l as Key, m as SettingsList, n as CURSOR_MARKER, o as HStack, p as ScrollView, q as customItemId, s as Image, t as AltScreenSearchIndex, u as Markdown, v as TuiMainScreen, x as decodePrintableKey, y as VStack, z as stripTerminalSequences } from "./dist-BFgC-5tL.mjs";
|
|
@@ -13,7 +13,7 @@ import { o as migrateProfileTuiPreferences } from "./profile-preferences-migrati
|
|
|
13
13
|
import { t as extensionConfigRowId } from "./row-id-DPbyt9Nn.mjs";
|
|
14
14
|
import { createRequire } from "node:module";
|
|
15
15
|
import { createHash, randomBytes, randomInt, randomUUID } from "node:crypto";
|
|
16
|
-
import { accessSync,
|
|
16
|
+
import { accessSync, constants, existsSync, lstatSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
17
17
|
import { basename, delimiter, dirname, isAbsolute, join, posix, resolve, win32 } from "node:path";
|
|
18
18
|
import { pathToFileURL } from "node:url";
|
|
19
19
|
import { homedir, tmpdir } from "node:os";
|
|
@@ -2743,124 +2743,6 @@ function createSessionPolicyObservation(source) {
|
|
|
2743
2743
|
};
|
|
2744
2744
|
}
|
|
2745
2745
|
//#endregion
|
|
2746
|
-
//#region src/runtime/process/diagnostics.ts
|
|
2747
|
-
/**
|
|
2748
|
-
* Structured process diagnostics for the TUI.
|
|
2749
|
-
*
|
|
2750
|
-
* The TUI cannot rely on `ctx.logger` for human-visible troubleshooting:
|
|
2751
|
-
* no dsh server-side package registers a logger exporter, so those lines
|
|
2752
|
-
* only fill cordis's in-memory buffer. This module owns a dedicated
|
|
2753
|
-
* diagnostics channel instead — one line per event, written to stderr
|
|
2754
|
-
* (warn/error by default, matching the legacy `[tui]` fd-2 lines) and to a
|
|
2755
|
-
* log file (info by default) under `$DSH_HOME/logs/`.
|
|
2756
|
-
*
|
|
2757
|
-
* Configuration (env):
|
|
2758
|
-
* - `DSH_PI_TUI_LOG` — log file path, or `off` to disable the file sink.
|
|
2759
|
-
* - `DSH_PI_TUI_LOG_LEVEL` — one of debug/info/warn/error (default `info`).
|
|
2760
|
-
*
|
|
2761
|
-
* Writes are best-effort and never throw; a failed file sink is disabled
|
|
2762
|
-
* silently so diagnostics can never take the TUI down.
|
|
2763
|
-
* @module @xmoon76/dsh-pi-tui/runtime/process/diagnostics
|
|
2764
|
-
*/
|
|
2765
|
-
const LEVEL_RANK = {
|
|
2766
|
-
debug: 0,
|
|
2767
|
-
info: 1,
|
|
2768
|
-
warn: 2,
|
|
2769
|
-
error: 3
|
|
2770
|
-
};
|
|
2771
|
-
/** `2026-08-15T10:00:00.000+08:00` — local wall time with the zone offset. */
|
|
2772
|
-
function formatDiagTime(date) {
|
|
2773
|
-
const pad = (value, width = 2) => String(value).padStart(width, "0");
|
|
2774
|
-
const offsetMinutes = -date.getTimezoneOffset();
|
|
2775
|
-
const offset = `${offsetMinutes >= 0 ? "+" : "-"}${pad(Math.floor(Math.abs(offsetMinutes) / 60))}:${pad(Math.abs(offsetMinutes) % 60)}`;
|
|
2776
|
-
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}.${pad(date.getMilliseconds(), 3)}${offset}`;
|
|
2777
|
-
}
|
|
2778
|
-
/** Render a single field value for the `k=v` line format. */
|
|
2779
|
-
function formatField(value) {
|
|
2780
|
-
if (typeof value === "string") return value;
|
|
2781
|
-
if (typeof value === "number" || typeof value === "boolean" || value === null || value === void 0) return String(value);
|
|
2782
|
-
try {
|
|
2783
|
-
return JSON.stringify(value) ?? String(value);
|
|
2784
|
-
} catch {
|
|
2785
|
-
return safeErrorMessage(value);
|
|
2786
|
-
}
|
|
2787
|
-
}
|
|
2788
|
-
/** The dsh home directory (`$DSH_HOME`, defaulting to `~/.dsh`). */
|
|
2789
|
-
function dshHome(env) {
|
|
2790
|
-
const explicit = env.DSH_HOME;
|
|
2791
|
-
if (explicit !== void 0 && explicit !== "") return explicit;
|
|
2792
|
-
return join(homedir(), ".dsh");
|
|
2793
|
-
}
|
|
2794
|
-
/** Build the default diagnostics log path: `$DSH_HOME/logs/pi-tui-<pid>.log`. */
|
|
2795
|
-
function defaultDiagLogPath(env) {
|
|
2796
|
-
const configured = env.DSH_PI_TUI_LOG;
|
|
2797
|
-
if (configured === "off" || configured === "") return void 0;
|
|
2798
|
-
if (configured !== void 0) return configured;
|
|
2799
|
-
return join(dshHome(env), "logs", `pi-tui-${process.pid}.log`);
|
|
2800
|
-
}
|
|
2801
|
-
/** Resolve the effective file level from `DSH_PI_TUI_LOG_LEVEL`. */
|
|
2802
|
-
function diagLevelFromEnv(env) {
|
|
2803
|
-
const configured = env.DSH_PI_TUI_LOG_LEVEL;
|
|
2804
|
-
if (configured === "debug" || configured === "info" || configured === "warn" || configured === "error") return configured;
|
|
2805
|
-
return "info";
|
|
2806
|
-
}
|
|
2807
|
-
/** Create the diagnostics channel from the process environment. */
|
|
2808
|
-
function diagFromEnv(env) {
|
|
2809
|
-
return createDiag({
|
|
2810
|
-
fileLevel: diagLevelFromEnv(env),
|
|
2811
|
-
filePath: defaultDiagLogPath(env)
|
|
2812
|
-
});
|
|
2813
|
-
}
|
|
2814
|
-
/** Create one diagnostics channel. Writes are best-effort, never throw. */
|
|
2815
|
-
function createDiag(options = {}) {
|
|
2816
|
-
const fileLevel = options.fileLevel ?? "info";
|
|
2817
|
-
const stderrLevel = options.stderrLevel ?? "warn";
|
|
2818
|
-
const now = options.now ?? (() => /* @__PURE__ */ new Date());
|
|
2819
|
-
const sinks = [...options.sinks ?? []];
|
|
2820
|
-
let fileHandle;
|
|
2821
|
-
let fileDisabled = false;
|
|
2822
|
-
if (options.filePath !== void 0) try {
|
|
2823
|
-
const dir = options.filePath.slice(0, Math.max(options.filePath.lastIndexOf("/"), 0));
|
|
2824
|
-
if (dir !== "") mkdirSync(dir, { recursive: true });
|
|
2825
|
-
fileHandle = openSync(options.filePath, "a");
|
|
2826
|
-
} catch {
|
|
2827
|
-
fileDisabled = true;
|
|
2828
|
-
}
|
|
2829
|
-
const emit = (level, message, fields) => {
|
|
2830
|
-
const stamp = formatDiagTime(now());
|
|
2831
|
-
const suffix = fields === void 0 ? "" : ` ${Object.entries(fields).map(([key, value]) => `${key}=${formatField(value)}`).join(" ")}`;
|
|
2832
|
-
const line = `[tui] ${stamp} ${level.toUpperCase()} ${message}${suffix}\n`;
|
|
2833
|
-
for (const sink of sinks) try {
|
|
2834
|
-
sink.write(line);
|
|
2835
|
-
} catch {}
|
|
2836
|
-
if (stderrLevel !== "off" && LEVEL_RANK[level] >= LEVEL_RANK[stderrLevel]) try {
|
|
2837
|
-
writeSync(2, line);
|
|
2838
|
-
} catch {}
|
|
2839
|
-
if (fileHandle !== void 0 && !fileDisabled && LEVEL_RANK[level] >= LEVEL_RANK[fileLevel]) try {
|
|
2840
|
-
writeSync(fileHandle, line);
|
|
2841
|
-
} catch {
|
|
2842
|
-
fileDisabled = true;
|
|
2843
|
-
try {
|
|
2844
|
-
writeSync(2, `[tui] ${formatDiagTime(now())} WARN diag file sink disabled\n`);
|
|
2845
|
-
} catch {}
|
|
2846
|
-
}
|
|
2847
|
-
};
|
|
2848
|
-
return {
|
|
2849
|
-
debug: (message, fields) => emit("debug", message, fields),
|
|
2850
|
-
info: (message, fields) => emit("info", message, fields),
|
|
2851
|
-
warn: (message, fields) => emit("warn", message, fields),
|
|
2852
|
-
error: (message, fields) => emit("error", message, fields),
|
|
2853
|
-
dispose: () => {
|
|
2854
|
-
if (fileHandle !== void 0) {
|
|
2855
|
-
try {
|
|
2856
|
-
closeSync(fileHandle);
|
|
2857
|
-
} catch {}
|
|
2858
|
-
fileHandle = void 0;
|
|
2859
|
-
}
|
|
2860
|
-
}
|
|
2861
|
-
};
|
|
2862
|
-
}
|
|
2863
|
-
//#endregion
|
|
2864
2746
|
//#region src/app/submission/history-persist.ts
|
|
2865
2747
|
/**
|
|
2866
2748
|
* The Ctrl+R session-scope persist gate (plan M-gate): an agent-facing
|
|
@@ -4681,7 +4563,8 @@ const TSP_B2A_RESULT_NOTICE_COMMANDS = /* @__PURE__ */ new Set([
|
|
|
4681
4563
|
"search",
|
|
4682
4564
|
"logout",
|
|
4683
4565
|
"reload-client",
|
|
4684
|
-
"queue"
|
|
4566
|
+
"queue",
|
|
4567
|
+
"skill"
|
|
4685
4568
|
]);
|
|
4686
4569
|
/**
|
|
4687
4570
|
* Whether one ALREADY-AUTHORITATIVELY-SELECTED TUI builtin can run on the TSP
|
|
@@ -4845,122 +4728,6 @@ function registerExitCommand({ runner, registerTuiCommand }) {
|
|
|
4845
4728
|
handler: exitHandler
|
|
4846
4729
|
});
|
|
4847
4730
|
}
|
|
4848
|
-
/** `/help` — the effective keymap plus the current scoped command list. */
|
|
4849
|
-
function registerHelpCommand({ runner, registerOne }) {
|
|
4850
|
-
const app = runner.app;
|
|
4851
|
-
registerOne({
|
|
4852
|
-
name: "help",
|
|
4853
|
-
description: "Show keybindings and available commands",
|
|
4854
|
-
handler: () => {
|
|
4855
|
-
if (app === void 0) return {
|
|
4856
|
-
kind: "error",
|
|
4857
|
-
text: "keymap labels are unavailable in this renderer"
|
|
4858
|
-
};
|
|
4859
|
-
const keybindings = app.keybindingsManager();
|
|
4860
|
-
const keysLabel = (action) => {
|
|
4861
|
-
const label = keybindings.keysLabelFor(action);
|
|
4862
|
-
return label === "" ? "—" : label;
|
|
4863
|
-
};
|
|
4864
|
-
const rows = [
|
|
4865
|
-
{
|
|
4866
|
-
id: "k-enter",
|
|
4867
|
-
label: keysLabel("app.input.submit"),
|
|
4868
|
-
description: "Submit the draft; while the agent is busy, delivery follows the \"Submit while busy\" preference (skill commands steer too, UI commands run locally)",
|
|
4869
|
-
currentValue: ""
|
|
4870
|
-
},
|
|
4871
|
-
{
|
|
4872
|
-
id: "k-queue",
|
|
4873
|
-
label: keysLabel("app.input.submitAccelerated"),
|
|
4874
|
-
description: "Submit with the OPPOSITE of the \"Submit while busy\" behavior (the web accelerated-submit chord)",
|
|
4875
|
-
currentValue: ""
|
|
4876
|
-
},
|
|
4877
|
-
{
|
|
4878
|
-
id: "k-exit",
|
|
4879
|
-
label: keysLabel("app.exit.request"),
|
|
4880
|
-
description: "Exit this TUI (a daemon Host keeps running; while the session is working the default key cancels it once, and an idle exit needs a same-key second press)",
|
|
4881
|
-
currentValue: ""
|
|
4882
|
-
},
|
|
4883
|
-
{
|
|
4884
|
-
id: "k-cancel",
|
|
4885
|
-
label: keysLabel("app.agent.interrupt"),
|
|
4886
|
-
description: "Cancel the active turn / tool / shell command (one interrupt while the agent is busy; press the interrupt action twice while idle — with an empty editor it opens the rewind picker)",
|
|
4887
|
-
currentValue: ""
|
|
4888
|
-
},
|
|
4889
|
-
{
|
|
4890
|
-
id: "k-fold",
|
|
4891
|
-
label: keysLabel("app.transcript.toggleExpand"),
|
|
4892
|
-
description: `Expand/collapse recent transcript detail; in regular Focus it reveals the recent Thought detail; in fullscreen Focus it controls the Thought-root bulk (per-card detail stays mouse-owned). Thinking detail is separate: ${keysLabel("app.transcript.toggleThinking")}`,
|
|
4893
|
-
currentValue: ""
|
|
4894
|
-
},
|
|
4895
|
-
{
|
|
4896
|
-
id: "k-todo",
|
|
4897
|
-
label: keysLabel("app.todo.toggle"),
|
|
4898
|
-
description: "Toggle the todo panel",
|
|
4899
|
-
currentValue: ""
|
|
4900
|
-
},
|
|
4901
|
-
{
|
|
4902
|
-
id: "k-think",
|
|
4903
|
-
label: keysLabel("app.transcript.toggleThinking"),
|
|
4904
|
-
description: "Expand/collapse thinking detail (detail level — blocks stay visible)",
|
|
4905
|
-
currentValue: ""
|
|
4906
|
-
},
|
|
4907
|
-
{
|
|
4908
|
-
id: "k-steer",
|
|
4909
|
-
label: keysLabel("app.input.steer"),
|
|
4910
|
-
description: "Steer the running turn with the draft",
|
|
4911
|
-
currentValue: ""
|
|
4912
|
-
},
|
|
4913
|
-
{
|
|
4914
|
-
id: "k-editor",
|
|
4915
|
-
label: keysLabel("app.editor.external"),
|
|
4916
|
-
description: "Edit the draft in $VISUAL/$EDITOR",
|
|
4917
|
-
currentValue: ""
|
|
4918
|
-
},
|
|
4919
|
-
{
|
|
4920
|
-
id: "k-search",
|
|
4921
|
-
label: keysLabel("app.transcript.search"),
|
|
4922
|
-
description: `Search the transcript (${keysLabel("app.transcript.search.next")}/${keysLabel("app.transcript.search.previous")} jump, ${keysLabel("app.transcript.search.close")} closes)`,
|
|
4923
|
-
currentValue: ""
|
|
4924
|
-
},
|
|
4925
|
-
{
|
|
4926
|
-
id: "k-tab",
|
|
4927
|
-
label: "Tab",
|
|
4928
|
-
description: "Autocomplete slash commands and file paths",
|
|
4929
|
-
currentValue: ""
|
|
4930
|
-
},
|
|
4931
|
-
{
|
|
4932
|
-
id: "k-hist",
|
|
4933
|
-
label: "↑/↓",
|
|
4934
|
-
description: "Recall input history on an empty line",
|
|
4935
|
-
currentValue: ""
|
|
4936
|
-
},
|
|
4937
|
-
{
|
|
4938
|
-
id: "k-bang",
|
|
4939
|
-
label: "! cmd",
|
|
4940
|
-
description: "Host user-shell execution is available only when the backend provides it; ! submits the completed command and its output to the Session, !! keeps the result presentation-only",
|
|
4941
|
-
currentValue: ""
|
|
4942
|
-
},
|
|
4943
|
-
{
|
|
4944
|
-
id: "sep-help",
|
|
4945
|
-
label: color.border("─".repeat(34)),
|
|
4946
|
-
currentValue: ""
|
|
4947
|
-
},
|
|
4948
|
-
...runner.listScopedCommands().map((command) => ({
|
|
4949
|
-
id: `cmd-${command.name}`,
|
|
4950
|
-
label: `/${command.name}`,
|
|
4951
|
-
description: command.description,
|
|
4952
|
-
currentValue: ""
|
|
4953
|
-
}))
|
|
4954
|
-
];
|
|
4955
|
-
if (app === void 0) return {
|
|
4956
|
-
kind: "error",
|
|
4957
|
-
text: "the settings panel is unavailable in this renderer"
|
|
4958
|
-
};
|
|
4959
|
-
app.openSettings(rows, () => {}, () => {});
|
|
4960
|
-
return { kind: "success" };
|
|
4961
|
-
}
|
|
4962
|
-
});
|
|
4963
|
-
}
|
|
4964
4731
|
//#endregion
|
|
4965
4732
|
//#region src/tui/commands/tasks.ts
|
|
4966
4733
|
/** `/tasks` (`/subagents`) — the merged Task Center browser behind the
|
|
@@ -7692,60 +7459,22 @@ function createModelCommands(deps) {
|
|
|
7692
7459
|
}
|
|
7693
7460
|
//#endregion
|
|
7694
7461
|
//#region src/tui/commands/skills.ts
|
|
7695
|
-
/** /skill — load one skill into the live session
|
|
7462
|
+
/** /skill — load one explicit skill into the live session. */
|
|
7696
7463
|
function registerSkillCommand(deps) {
|
|
7697
|
-
const { runner,
|
|
7464
|
+
const { runner, registerOne, loadSkill, takeDelivery, splitSkillLine } = deps;
|
|
7698
7465
|
registerOne({
|
|
7699
7466
|
name: "skill",
|
|
7700
7467
|
description: "Load a skill into the session context",
|
|
7701
7468
|
input: { hint: "<name>" },
|
|
7702
7469
|
handler: async (invocation) => {
|
|
7703
7470
|
const delivery = takeDelivery();
|
|
7704
|
-
const scope = await runner.requireLiveSessionScope();
|
|
7705
7471
|
const [name, ...args] = splitSkillLine(invocation.rawInput);
|
|
7706
|
-
if (name
|
|
7707
|
-
let catalog;
|
|
7708
|
-
try {
|
|
7709
|
-
catalog = await runner.listScopedSkills(scope, runner.signal);
|
|
7710
|
-
} catch (error) {
|
|
7711
|
-
if (error instanceof SupersededReadError) return {
|
|
7712
|
-
kind: "error",
|
|
7713
|
-
text: "the session changed while loading skills — try again"
|
|
7714
|
-
};
|
|
7715
|
-
throw error;
|
|
7716
|
-
}
|
|
7717
|
-
if (catalog === void 0) return {
|
|
7472
|
+
if (name === "") return {
|
|
7718
7473
|
kind: "error",
|
|
7719
|
-
text: "skill
|
|
7474
|
+
text: "Usage: /skill <name> [args]. Type / to discover available skills."
|
|
7720
7475
|
};
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
text: "no skills available"
|
|
7724
|
-
};
|
|
7725
|
-
app.openSettings(catalog.skills.map((skill) => ({
|
|
7726
|
-
id: skill.name,
|
|
7727
|
-
label: abbreviateName$1(skill.name, 34),
|
|
7728
|
-
searchText: skill.name,
|
|
7729
|
-
description: skill.description === "" ? skill.name : `${skill.name} — ${skill.description}`,
|
|
7730
|
-
currentValue: "",
|
|
7731
|
-
values: ["✓"]
|
|
7732
|
-
})), (id) => {
|
|
7733
|
-
let running;
|
|
7734
|
-
try {
|
|
7735
|
-
running = runner.currentSessionActivity(scope).running;
|
|
7736
|
-
} catch (error) {
|
|
7737
|
-
if (error instanceof SupersededReadError) {
|
|
7738
|
-
app.notify("the session changed while loading skills — try again", "error");
|
|
7739
|
-
return;
|
|
7740
|
-
}
|
|
7741
|
-
throw error;
|
|
7742
|
-
}
|
|
7743
|
-
const delivery = resolveComposerDelivery(running, "enter", runner.tuiSettings?.get().busyEnter);
|
|
7744
|
-
detach("skill load", () => loadSkill(scope, id, "", runner.signal, delivery).then((result) => {
|
|
7745
|
-
if (result.kind === "error") app.notify(result.text);
|
|
7746
|
-
}), { notify: true });
|
|
7747
|
-
}, () => {});
|
|
7748
|
-
return { kind: "success" };
|
|
7476
|
+
const scope = await runner.requireLiveSessionScope();
|
|
7477
|
+
return loadSkill(scope, name, args.join(" "), invocation.signal ?? runner.signal, delivery, invocation.commandId);
|
|
7749
7478
|
}
|
|
7750
7479
|
});
|
|
7751
7480
|
}
|
|
@@ -10128,48 +9857,66 @@ function selectedLine(label, selected, width) {
|
|
|
10128
9857
|
return truncateToWidth(text, Math.max(1, width));
|
|
10129
9858
|
}
|
|
10130
9859
|
/** Keep the selected binding visible in a short terminal while retaining the
|
|
10131
|
-
* detail footer.
|
|
10132
|
-
*
|
|
10133
|
-
|
|
9860
|
+
* detail footer. An optional conflict-diagnostic prefix is PINNED above the
|
|
9861
|
+
* scroll window: the counterpart must stay readable even when the grant is
|
|
9862
|
+
* too short to show the whole detail. */
|
|
9863
|
+
function actionViewport(lines, selectedLineIndex, maxRows, selectableLineIndices = [], pinnedRange) {
|
|
10134
9864
|
const limit = Math.max(1, maxRows);
|
|
10135
|
-
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
|
|
9865
|
+
const footer = lines[lines.length - 1];
|
|
9866
|
+
let content = lines.slice(0, -1);
|
|
9867
|
+
let selected = selectedLineIndex;
|
|
9868
|
+
let selectableIndices = [...selectableLineIndices];
|
|
9869
|
+
let pinned = [];
|
|
9870
|
+
if (pinnedRange !== void 0 && pinnedRange.count > 0) {
|
|
9871
|
+
pinned = content.slice(pinnedRange.start, pinnedRange.start + pinnedRange.count);
|
|
9872
|
+
content = content.slice(0, pinnedRange.start).concat(content.slice(pinnedRange.start + pinnedRange.count));
|
|
9873
|
+
const before = pinnedRange.start + pinnedRange.count;
|
|
9874
|
+
selectableIndices = selectableIndices.map((index) => index >= before ? index - pinnedRange.count : index);
|
|
9875
|
+
selected = selected === void 0 ? void 0 : selected >= before ? selected - pinnedRange.count : selected;
|
|
9876
|
+
}
|
|
9877
|
+
if (pinned.length + content.length + 1 <= limit) return {
|
|
9878
|
+
lines: [
|
|
9879
|
+
...pinned,
|
|
9880
|
+
...content,
|
|
9881
|
+
footer
|
|
9882
|
+
],
|
|
9883
|
+
selectableRows: selectableIndices.map((row, ordinal) => ({
|
|
9884
|
+
row: row + pinned.length,
|
|
10139
9885
|
ordinal
|
|
10140
9886
|
}))
|
|
10141
9887
|
};
|
|
10142
|
-
|
|
10143
|
-
|
|
10144
|
-
lines: [footer],
|
|
9888
|
+
if (limit - pinned.length - 1 < 1) return {
|
|
9889
|
+
lines: [...pinned.slice(0, Math.max(0, limit - 1)), footer],
|
|
10145
9890
|
selectableRows: []
|
|
10146
9891
|
};
|
|
10147
|
-
const
|
|
10148
|
-
|
|
10149
|
-
lines: [footer],
|
|
10150
|
-
selectableRows: []
|
|
10151
|
-
};
|
|
10152
|
-
const windowSize = Math.max(1, limit - 1);
|
|
10153
|
-
const selected = selectedLineIndex === void 0 ? Math.min(content.length - 1, Math.floor(windowSize / 2)) : Math.min(content.length - 1, Math.max(0, selectedLineIndex));
|
|
9892
|
+
const windowSize = limit - pinned.length - 1;
|
|
9893
|
+
const chosen = selected === void 0 ? Math.min(content.length - 1, Math.floor(windowSize / 2)) : Math.min(content.length - 1, Math.max(0, selected));
|
|
10154
9894
|
const maxStart = Math.max(0, content.length - windowSize);
|
|
10155
|
-
const start = Math.min(maxStart, Math.max(0,
|
|
9895
|
+
const start = Math.min(maxStart, Math.max(0, chosen - Math.floor(windowSize / 2)));
|
|
10156
9896
|
const end = Math.min(content.length, start + windowSize);
|
|
10157
9897
|
const viewport = content.slice(start, end);
|
|
10158
|
-
let selectableRows =
|
|
9898
|
+
let selectableRows = selectableIndices.map((index, ordinal) => ({
|
|
10159
9899
|
row: index - start,
|
|
10160
9900
|
ordinal
|
|
10161
9901
|
})).filter((entry) => entry.row >= 0 && entry.row < viewport.length);
|
|
10162
|
-
if (start > 0 &&
|
|
9902
|
+
if (start > 0 && chosen > start) {
|
|
10163
9903
|
viewport[0] = color.textDim(`↑ ${start} more lines`);
|
|
10164
9904
|
selectableRows = selectableRows.filter((entry) => entry.row !== 0);
|
|
10165
9905
|
}
|
|
10166
|
-
if (end < content.length &&
|
|
9906
|
+
if (end < content.length && chosen < end - 1) {
|
|
10167
9907
|
viewport[viewport.length - 1] = color.textDim(`↓ ${content.length - end} more lines`);
|
|
10168
9908
|
selectableRows = selectableRows.filter((entry) => entry.row !== viewport.length - 1);
|
|
10169
9909
|
}
|
|
10170
9910
|
return {
|
|
10171
|
-
lines: [
|
|
10172
|
-
|
|
9911
|
+
lines: [
|
|
9912
|
+
...pinned,
|
|
9913
|
+
...viewport,
|
|
9914
|
+
footer
|
|
9915
|
+
],
|
|
9916
|
+
selectableRows: selectableRows.map((entry) => ({
|
|
9917
|
+
row: entry.row + pinned.length,
|
|
9918
|
+
ordinal: entry.ordinal
|
|
9919
|
+
}))
|
|
10173
9920
|
};
|
|
10174
9921
|
}
|
|
10175
9922
|
var ActionEditorPanel = class {
|
|
@@ -10182,6 +9929,7 @@ var ActionEditorPanel = class {
|
|
|
10182
9929
|
maxRows;
|
|
10183
9930
|
mode = "edit";
|
|
10184
9931
|
selectedIndex = 0;
|
|
9932
|
+
conflictScroll = 0;
|
|
10185
9933
|
recorder;
|
|
10186
9934
|
pending = false;
|
|
10187
9935
|
/** A settlement whose result has NOT been painted yet. The page keeps the
|
|
@@ -10191,6 +9939,7 @@ var ActionEditorPanel = class {
|
|
|
10191
9939
|
mutationGeneration = 0;
|
|
10192
9940
|
disposed = false;
|
|
10193
9941
|
message;
|
|
9942
|
+
messageKind;
|
|
10194
9943
|
/** Physical row → hit entry from the LAST render (mouse parity). */
|
|
10195
9944
|
hitMap = [];
|
|
10196
9945
|
/** The pressed binding identity (mouse parity): a click may only act on
|
|
@@ -10215,6 +9964,8 @@ var ActionEditorPanel = class {
|
|
|
10215
9964
|
* content columns). Cleared on every render start, so a sub-view that paints
|
|
10216
9965
|
* its own bar can never leave the previous frame's geometry clickable. */
|
|
10217
9966
|
paintedEscapeSpanValue;
|
|
9967
|
+
/** The delegated non-Esc Action Bar spans this page painted. */
|
|
9968
|
+
paintedBarSpansValue = [];
|
|
10218
9969
|
constructor(options) {
|
|
10219
9970
|
this.model = options.model;
|
|
10220
9971
|
this.row = options.action;
|
|
@@ -10241,16 +9992,71 @@ var ActionEditorPanel = class {
|
|
|
10241
9992
|
paintedEscapeSpan() {
|
|
10242
9993
|
return this.paintedEscapeSpanValue;
|
|
10243
9994
|
}
|
|
9995
|
+
/** The delegated `c details` Action Bar span, in this page's columns. */
|
|
9996
|
+
paintedBarSpans() {
|
|
9997
|
+
return this.paintedBarSpansValue;
|
|
9998
|
+
}
|
|
9999
|
+
/** Open the readonly conflict reader from the painted bar span. */
|
|
10000
|
+
activateBarSpan(id) {
|
|
10001
|
+
if (id !== "conflict-details") return;
|
|
10002
|
+
if (this.mode !== "edit" || this.conflictDiagnostics().length === 0) return;
|
|
10003
|
+
this.mode = "conflict-details";
|
|
10004
|
+
this.conflictScroll = 0;
|
|
10005
|
+
this.requestRender();
|
|
10006
|
+
}
|
|
10007
|
+
/** Only a genuinely conflicted row may enter the Conflict details reader;
|
|
10008
|
+
* ordinary disabled/ambiguous diagnostics keep their inline presentation. */
|
|
10009
|
+
conflictDiagnostics() {
|
|
10010
|
+
if (!this.row.conflict) return [];
|
|
10011
|
+
return this.row.diagnostics.filter((message) => message.includes("conflict") || message.includes("ambiguous"));
|
|
10012
|
+
}
|
|
10244
10013
|
render(width) {
|
|
10245
10014
|
const safeWidth = Math.max(1, width);
|
|
10246
10015
|
this.settlementAwaitingPaint = false;
|
|
10247
10016
|
this.paintedEscapeSpanValue = void 0;
|
|
10017
|
+
this.paintedBarSpansValue = [];
|
|
10248
10018
|
if (this.recorder !== void 0) {
|
|
10249
10019
|
const lines = this.recorder.render(safeWidth);
|
|
10250
10020
|
this.paintedEscapeSpanValue = this.recorder.paintedEscapeSpan();
|
|
10251
10021
|
return lines;
|
|
10252
10022
|
}
|
|
10253
10023
|
if (this.mode === "choose-binding") return this.renderBindingChoice(safeWidth);
|
|
10024
|
+
if (this.mode === "conflict-details") return this.renderConflictDetails(safeWidth);
|
|
10025
|
+
if (this.maxRows() === 1 && this.message !== void 0) {
|
|
10026
|
+
this.hitMap = [{ kind: "inert" }];
|
|
10027
|
+
this.hasPainted = true;
|
|
10028
|
+
this.paintedBodyRows = 0;
|
|
10029
|
+
this.paintedSelection = false;
|
|
10030
|
+
this.paintedAdd = false;
|
|
10031
|
+
this.paintedChoice = false;
|
|
10032
|
+
this.selectableKeys = [];
|
|
10033
|
+
this.lastRenderWidth = Math.max(1, width);
|
|
10034
|
+
this.paintedBarSpansValue = [];
|
|
10035
|
+
const escape = "Back [Esc]";
|
|
10036
|
+
const escapeWidth = visibleWidth(escape);
|
|
10037
|
+
if (safeWidth < escapeWidth) {
|
|
10038
|
+
this.paintedEscapeSpanValue = void 0;
|
|
10039
|
+
const painted = this.messageKind === "success" ? color.success(this.message) : color.error(this.message);
|
|
10040
|
+
return [truncateToWidth(painted, safeWidth)];
|
|
10041
|
+
}
|
|
10042
|
+
if (safeWidth < escapeWidth + 3) {
|
|
10043
|
+
const marker = safeWidth >= escapeWidth + 2 && this.messageKind === "success" ? "✓ " : safeWidth >= escapeWidth + 2 ? "! " : "";
|
|
10044
|
+
const startCol = visibleWidth(marker);
|
|
10045
|
+
this.paintedEscapeSpanValue = {
|
|
10046
|
+
startCol,
|
|
10047
|
+
endCol: startCol + escapeWidth
|
|
10048
|
+
};
|
|
10049
|
+
return [truncateToWidth(`${marker === "" ? "" : this.messageKind === "success" ? color.success(marker) : color.error(marker)}${paintActionSpan$2(escape, "secondary")}`, safeWidth)];
|
|
10050
|
+
}
|
|
10051
|
+
const message = truncateToWidth(this.message, safeWidth - escapeWidth - 3);
|
|
10052
|
+
const startCol = visibleWidth(message) + 3;
|
|
10053
|
+
this.paintedEscapeSpanValue = {
|
|
10054
|
+
startCol,
|
|
10055
|
+
endCol: startCol + escapeWidth
|
|
10056
|
+
};
|
|
10057
|
+
const paintedMessage = this.messageKind === "success" ? color.success(message) : color.error(message);
|
|
10058
|
+
return [truncateToWidth(`${paintedMessage}${color.textDim(" · ")}${paintActionSpan$2(escape, "secondary")}`, safeWidth)];
|
|
10059
|
+
}
|
|
10254
10060
|
const lines = [color.textStrong(this.row.label), ""];
|
|
10255
10061
|
const selectableLineIndices = [];
|
|
10256
10062
|
lines.push(...wrapTextWithAnsi(this.row.description, safeWidth).map((line) => color.text(line)));
|
|
@@ -10301,10 +10107,15 @@ var ActionEditorPanel = class {
|
|
|
10301
10107
|
const baselineOrdinary = this.row.customized ? configuredOrdinary : this.row.defaults;
|
|
10302
10108
|
if (this.row.configurable && !sameBindingList(effectiveOrdinary, baselineOrdinary)) lines.push(color.textDim(`Effective now: ${formatEditorBindings(effectiveOrdinary)}`));
|
|
10303
10109
|
if (this.row.diagnostics.length > 0) for (const diagnostic of this.row.diagnostics.slice(0, 2)) lines.push(color.warning(truncateToWidth(diagnostic, safeWidth)));
|
|
10110
|
+
const messageStart = lines.length;
|
|
10304
10111
|
if (this.message !== void 0) lines.push(color.error(truncateToWidth(this.message, safeWidth)));
|
|
10112
|
+
const messageCount = lines.length - messageStart;
|
|
10305
10113
|
if (this.pending) lines.push(color.accent("Saving…"));
|
|
10306
10114
|
lines.push("");
|
|
10307
|
-
const viewport = actionViewport(lines, selectableLineIndices[this.selectedIndex], this.maxRows(), selectableLineIndices
|
|
10115
|
+
const viewport = actionViewport(lines, selectableLineIndices[this.selectedIndex], this.maxRows(), selectableLineIndices, messageCount > 0 ? {
|
|
10116
|
+
start: messageStart,
|
|
10117
|
+
count: messageCount
|
|
10118
|
+
} : void 0);
|
|
10308
10119
|
this.lastRenderWidth = safeWidth;
|
|
10309
10120
|
this.hasPainted = true;
|
|
10310
10121
|
const visibleOrdinals = new Set(viewport.selectableRows.map((row) => row.ordinal));
|
|
@@ -10313,6 +10124,13 @@ var ActionEditorPanel = class {
|
|
|
10313
10124
|
const addOrdinal = this.selectableKeys.indexOf("add");
|
|
10314
10125
|
this.paintedAdd = addOrdinal >= 0 && visibleOrdinals.has(addOrdinal);
|
|
10315
10126
|
const bar = this.actionBar(editable.length, safeWidth);
|
|
10127
|
+
const conflictLabel = "c details";
|
|
10128
|
+
const conflictStart = bar.text.indexOf(conflictLabel);
|
|
10129
|
+
this.paintedBarSpansValue = conflictStart < 0 ? [] : [{
|
|
10130
|
+
id: "conflict-details",
|
|
10131
|
+
startCol: conflictStart,
|
|
10132
|
+
endCol: conflictStart + visibleWidth(conflictLabel)
|
|
10133
|
+
}];
|
|
10316
10134
|
this.paintedEscapeSpanValue = bar.escape;
|
|
10317
10135
|
viewport.lines[viewport.lines.length - 1] = paintWholeBar(bar, safeWidth);
|
|
10318
10136
|
this.hitMap = viewport.lines.map((_, row) => {
|
|
@@ -10330,9 +10148,10 @@ var ActionEditorPanel = class {
|
|
|
10330
10148
|
* cannot show is not advertised, and a bar-only grant keeps only Esc. */
|
|
10331
10149
|
actionBar(editableLength, width) {
|
|
10332
10150
|
if (this.pending) return plainWording$2("Saving… · one write at a time");
|
|
10151
|
+
const conflicts = this.conflictDiagnostics().length > 0 ? "c details" : void 0;
|
|
10333
10152
|
if (this.paintedBodyRows === 0) return escapeWording$3("", "Back");
|
|
10334
|
-
if (this.row.fixed || this.row.reserved || this.row.safeMode) return escapeWording$3("", "Back");
|
|
10335
|
-
if (!this.row.configurable) return escapeWording$3("", "Back");
|
|
10153
|
+
if (this.row.fixed || this.row.reserved || this.row.safeMode) return escapeWording$3(conflicts ?? "", "Back");
|
|
10154
|
+
if (!this.row.configurable) return escapeWording$3(conflicts ?? "", "Back");
|
|
10336
10155
|
const selectedBinding = this.selectedIndex < editableLength;
|
|
10337
10156
|
const primary = selectedBinding ? this.paintedSelection ? "Enter edit" : void 0 : this.paintedAdd ? "Enter add" : void 0;
|
|
10338
10157
|
const add = this.paintedAdd ? "a add" : void 0;
|
|
@@ -10341,6 +10160,7 @@ var ActionEditorPanel = class {
|
|
|
10341
10160
|
return pickWording$1([
|
|
10342
10161
|
variant([
|
|
10343
10162
|
primary,
|
|
10163
|
+
conflicts,
|
|
10344
10164
|
add,
|
|
10345
10165
|
remove,
|
|
10346
10166
|
"r reset",
|
|
@@ -10348,18 +10168,25 @@ var ActionEditorPanel = class {
|
|
|
10348
10168
|
]),
|
|
10349
10169
|
variant([
|
|
10350
10170
|
primary,
|
|
10171
|
+
conflicts,
|
|
10351
10172
|
add,
|
|
10352
10173
|
"r reset",
|
|
10353
10174
|
"d disable"
|
|
10354
10175
|
]),
|
|
10355
10176
|
variant([
|
|
10356
10177
|
primary,
|
|
10178
|
+
conflicts,
|
|
10357
10179
|
add,
|
|
10358
10180
|
"r reset"
|
|
10359
10181
|
]),
|
|
10360
|
-
variant([
|
|
10182
|
+
variant([
|
|
10183
|
+
primary,
|
|
10184
|
+
conflicts,
|
|
10185
|
+
add
|
|
10186
|
+
]),
|
|
10187
|
+
variant([primary, conflicts]),
|
|
10361
10188
|
variant([primary]),
|
|
10362
|
-
escapeWording$3("r reset · d disable", "Back"),
|
|
10189
|
+
escapeWording$3(conflicts ?? "r reset · d disable", "Back"),
|
|
10363
10190
|
escapeWording$3("", "Back")
|
|
10364
10191
|
], width, "Esc back");
|
|
10365
10192
|
}
|
|
@@ -10384,6 +10211,20 @@ var ActionEditorPanel = class {
|
|
|
10384
10211
|
}
|
|
10385
10212
|
if (this.hasPainted && this.paintedBodyRows === 0 && !matchesKey(data, "escape")) return;
|
|
10386
10213
|
if (this.pending || this.settlementAwaitingPaint) return;
|
|
10214
|
+
if (this.mode === "conflict-details") {
|
|
10215
|
+
this.handleConflictDetailsInput(data);
|
|
10216
|
+
return;
|
|
10217
|
+
}
|
|
10218
|
+
if (this.mode === "choose-binding") {
|
|
10219
|
+
this.handleBindingChoice(data);
|
|
10220
|
+
return;
|
|
10221
|
+
}
|
|
10222
|
+
if (commandKey$1(data, "c") && this.conflictDiagnostics().length > 0) {
|
|
10223
|
+
this.mode = "conflict-details";
|
|
10224
|
+
this.conflictScroll = 0;
|
|
10225
|
+
this.requestRender();
|
|
10226
|
+
return;
|
|
10227
|
+
}
|
|
10387
10228
|
if (this.row.safeMode) {
|
|
10388
10229
|
if (matchesKey(data, "escape")) {
|
|
10389
10230
|
this.dispose();
|
|
@@ -10391,10 +10232,6 @@ var ActionEditorPanel = class {
|
|
|
10391
10232
|
}
|
|
10392
10233
|
return;
|
|
10393
10234
|
}
|
|
10394
|
-
if (this.mode === "choose-binding") {
|
|
10395
|
-
this.handleBindingChoice(data);
|
|
10396
|
-
return;
|
|
10397
|
-
}
|
|
10398
10235
|
if (matchesKey(data, "escape")) {
|
|
10399
10236
|
this.dispose();
|
|
10400
10237
|
this.onBack();
|
|
@@ -10478,6 +10315,16 @@ var ActionEditorPanel = class {
|
|
|
10478
10315
|
if (event.width !== this.lastRenderWidth) return void 0;
|
|
10479
10316
|
if (this.recorder !== void 0) return void 0;
|
|
10480
10317
|
if (this.pending || this.settlementAwaitingPaint) return void 0;
|
|
10318
|
+
if (this.mode === "conflict-details") {
|
|
10319
|
+
if (event.type === "wheel" && event.wheelDelta) {
|
|
10320
|
+
this.scrollConflictDetails(event.wheelDelta < 0 ? -1 : 1);
|
|
10321
|
+
return {
|
|
10322
|
+
handled: true,
|
|
10323
|
+
render: true
|
|
10324
|
+
};
|
|
10325
|
+
}
|
|
10326
|
+
return;
|
|
10327
|
+
}
|
|
10481
10328
|
const hit = this.hitMap[event.y];
|
|
10482
10329
|
if (!hit || hit.kind === "inert") return void 0;
|
|
10483
10330
|
if (event.type === "wheel" && event.wheelDelta) {
|
|
@@ -10539,7 +10386,72 @@ var ActionEditorPanel = class {
|
|
|
10539
10386
|
} else this.startRecorder(editable[this.selectedIndex].kind, editable[this.selectedIndex]);
|
|
10540
10387
|
return { handled: true };
|
|
10541
10388
|
}
|
|
10389
|
+
/** The read-only diagnostic reader: every wrapped conflict line is
|
|
10390
|
+
* reachable with Up/Down/PgUp/PgDn and the only bar action is Back. */
|
|
10391
|
+
renderConflictDetails(width) {
|
|
10392
|
+
this.paintedBarSpansValue = [];
|
|
10393
|
+
const lines = [color.textStrong(`Conflict details · ${this.row.label}`), ""];
|
|
10394
|
+
for (const diagnostic of this.conflictDiagnostics()) for (const line of wrapTextWithAnsi(diagnostic, width)) lines.push(color.warning(line));
|
|
10395
|
+
const bar = escapeWording$3("", "Back");
|
|
10396
|
+
const limit = Math.max(1, this.maxRows());
|
|
10397
|
+
if (limit === 1) {
|
|
10398
|
+
this.hitMap = [];
|
|
10399
|
+
this.hasPainted = true;
|
|
10400
|
+
this.paintedBodyRows = 0;
|
|
10401
|
+
this.paintedSelection = false;
|
|
10402
|
+
this.paintedAdd = false;
|
|
10403
|
+
this.paintedChoice = false;
|
|
10404
|
+
this.selectableKeys = [];
|
|
10405
|
+
this.lastRenderWidth = Math.max(1, width);
|
|
10406
|
+
this.paintedEscapeSpanValue = bar.escape;
|
|
10407
|
+
return [paintBarWording$2(bar)];
|
|
10408
|
+
}
|
|
10409
|
+
const bodyLimit = limit - 1;
|
|
10410
|
+
const maxStart = Math.max(0, lines.length - bodyLimit);
|
|
10411
|
+
this.conflictScroll = Math.min(Math.max(0, this.conflictScroll), maxStart);
|
|
10412
|
+
const body = lines.slice(this.conflictScroll, this.conflictScroll + bodyLimit);
|
|
10413
|
+
const rendered = [...body, paintBarWording$2(bar)];
|
|
10414
|
+
this.hitMap = rendered.map(() => ({ kind: "inert" }));
|
|
10415
|
+
this.hasPainted = true;
|
|
10416
|
+
this.paintedBodyRows = body.length;
|
|
10417
|
+
this.paintedSelection = false;
|
|
10418
|
+
this.paintedAdd = false;
|
|
10419
|
+
this.paintedChoice = false;
|
|
10420
|
+
this.selectableKeys = [];
|
|
10421
|
+
this.lastRenderWidth = Math.max(1, width);
|
|
10422
|
+
this.paintedEscapeSpanValue = bar.escape;
|
|
10423
|
+
return rendered.map((line) => truncateToWidth(line, Math.max(1, width)));
|
|
10424
|
+
}
|
|
10425
|
+
handleConflictDetailsInput(data) {
|
|
10426
|
+
if (matchesKey(data, "escape")) {
|
|
10427
|
+
this.mode = "edit";
|
|
10428
|
+
this.conflictScroll = 0;
|
|
10429
|
+
this.requestRender();
|
|
10430
|
+
return;
|
|
10431
|
+
}
|
|
10432
|
+
if (matchesKey(data, "up")) {
|
|
10433
|
+
this.scrollConflictDetails(-1);
|
|
10434
|
+
return;
|
|
10435
|
+
}
|
|
10436
|
+
if (matchesKey(data, "down")) {
|
|
10437
|
+
this.scrollConflictDetails(1);
|
|
10438
|
+
return;
|
|
10439
|
+
}
|
|
10440
|
+
if (matchesKey(data, "pageUp")) {
|
|
10441
|
+
this.scrollConflictDetails(-Math.max(1, this.maxRows() - 1));
|
|
10442
|
+
return;
|
|
10443
|
+
}
|
|
10444
|
+
if (matchesKey(data, "pageDown")) this.scrollConflictDetails(Math.max(1, this.maxRows() - 1));
|
|
10445
|
+
}
|
|
10446
|
+
scrollConflictDetails(delta) {
|
|
10447
|
+
const lines = 2 + this.conflictDiagnostics().reduce((total, diagnostic) => total + wrapTextWithAnsi(diagnostic, this.lastRenderWidth || 1).length, 0);
|
|
10448
|
+
const bodyLimit = Math.max(1, this.maxRows() - 1);
|
|
10449
|
+
const maxStart = Math.max(0, lines - bodyLimit);
|
|
10450
|
+
this.conflictScroll = Math.min(maxStart, Math.max(0, this.conflictScroll + delta));
|
|
10451
|
+
this.requestRender();
|
|
10452
|
+
}
|
|
10542
10453
|
renderBindingChoice(width) {
|
|
10454
|
+
this.paintedBarSpansValue = [];
|
|
10543
10455
|
const lines = [
|
|
10544
10456
|
color.textStrong(`Add shortcut › ${this.row.label}`),
|
|
10545
10457
|
"",
|
|
@@ -10638,6 +10550,7 @@ var ActionEditorPanel = class {
|
|
|
10638
10550
|
const generation = ++this.mutationGeneration;
|
|
10639
10551
|
this.pending = true;
|
|
10640
10552
|
this.message = void 0;
|
|
10553
|
+
this.messageKind = void 0;
|
|
10641
10554
|
this.requestRender();
|
|
10642
10555
|
try {
|
|
10643
10556
|
this.runMutation(mutation, (result) => this.applyMutationResult(generation, result), (error) => this.applyMutationError(generation, error));
|
|
@@ -10651,6 +10564,7 @@ var ActionEditorPanel = class {
|
|
|
10651
10564
|
this.settlementAwaitingPaint = true;
|
|
10652
10565
|
if (result.kind !== "applied") {
|
|
10653
10566
|
this.message = result.message;
|
|
10567
|
+
this.messageKind = "error";
|
|
10654
10568
|
this.requestRender();
|
|
10655
10569
|
return;
|
|
10656
10570
|
}
|
|
@@ -10660,6 +10574,7 @@ var ActionEditorPanel = class {
|
|
|
10660
10574
|
const editableCount = this.row.customized ? this.row.configured.length : this.row.editableDefaults.length;
|
|
10661
10575
|
this.selectedIndex = Math.min(this.selectedIndex, editableCount);
|
|
10662
10576
|
this.message = result.message;
|
|
10577
|
+
this.messageKind = "success";
|
|
10663
10578
|
this.onModelChange(result.model);
|
|
10664
10579
|
this.requestRender();
|
|
10665
10580
|
}
|
|
@@ -10668,6 +10583,7 @@ var ActionEditorPanel = class {
|
|
|
10668
10583
|
this.pending = false;
|
|
10669
10584
|
this.settlementAwaitingPaint = true;
|
|
10670
10585
|
this.message = error instanceof Error ? error.message : "Could not save keyboard shortcuts.";
|
|
10586
|
+
this.messageKind = "error";
|
|
10671
10587
|
this.requestRender();
|
|
10672
10588
|
}
|
|
10673
10589
|
};
|
|
@@ -10834,6 +10750,8 @@ var KeybindingEditorPanel = class {
|
|
|
10834
10750
|
}
|
|
10835
10751
|
selectedId = "leader";
|
|
10836
10752
|
selectedIndex = 0;
|
|
10753
|
+
/** The ONE local view mode (transient, never persisted). */
|
|
10754
|
+
filter;
|
|
10837
10755
|
actionEditor;
|
|
10838
10756
|
leaderRecorder;
|
|
10839
10757
|
leaderEditing = false;
|
|
@@ -10857,6 +10775,12 @@ var KeybindingEditorPanel = class {
|
|
|
10857
10775
|
/** Undefined before the first frame: a direct panel harness may feed input
|
|
10858
10776
|
* before a paint, while a REAL surface always paints first. */
|
|
10859
10777
|
paintedSelectableIds;
|
|
10778
|
+
/** The complete spans of the LAST painted view-mode row; undefined when the
|
|
10779
|
+
* frame painted no switchable mode row (bar-only/short grants). */
|
|
10780
|
+
paintedFilterSpans;
|
|
10781
|
+
/** A pressed filter option (mouse parity): the exact mode, gesture identity
|
|
10782
|
+
* and painted width the press was admitted against. */
|
|
10783
|
+
mousePressedFilter;
|
|
10860
10784
|
/** A detail-mutation settlement that has not painted its frame yet. */
|
|
10861
10785
|
settlementAwaitingPaint = false;
|
|
10862
10786
|
/** The width the hit map was painted at; a stale-width event is rejected. */
|
|
@@ -10874,6 +10798,7 @@ var KeybindingEditorPanel = class {
|
|
|
10874
10798
|
this.onDispose = options.onDispose ?? (() => {});
|
|
10875
10799
|
this.requestRender = options.requestRender ?? (() => {});
|
|
10876
10800
|
this.standaloneRows = options.maxRows ?? (() => 18);
|
|
10801
|
+
this.filter = options.initialFilter ?? "all";
|
|
10877
10802
|
this.maxRows = () => Math.max(1, Math.min(this.standaloneRows(), this.parentContentRows ?? Number.POSITIVE_INFINITY));
|
|
10878
10803
|
}
|
|
10879
10804
|
/** The parent's live row grant (the Settings root when embedded). A repeated
|
|
@@ -10903,7 +10828,7 @@ var KeybindingEditorPanel = class {
|
|
|
10903
10828
|
viewKey() {
|
|
10904
10829
|
if (this.actionEditor !== void 0) return `action:${this.actionEditor.actionId()}`;
|
|
10905
10830
|
if (this.leaderEditing) return "leader";
|
|
10906
|
-
return
|
|
10831
|
+
return `list:${this.filter}`;
|
|
10907
10832
|
}
|
|
10908
10833
|
render(width) {
|
|
10909
10834
|
const safeWidth = Math.max(1, width);
|
|
@@ -10912,6 +10837,7 @@ var KeybindingEditorPanel = class {
|
|
|
10912
10837
|
this.paintedView = this.viewKey();
|
|
10913
10838
|
this.settlementAwaitingPaint = false;
|
|
10914
10839
|
this.paintedEscapeSpanValue = void 0;
|
|
10840
|
+
this.paintedFilterSpans = void 0;
|
|
10915
10841
|
if (this.actionEditor !== void 0) {
|
|
10916
10842
|
const lines = this.actionEditor.render(safeWidth);
|
|
10917
10843
|
this.paintedEscapeSpanValue = this.actionEditor.paintedEscapeSpan();
|
|
@@ -10920,23 +10846,36 @@ var KeybindingEditorPanel = class {
|
|
|
10920
10846
|
if (this.leaderEditing) return this.renderLeaderEditor(safeWidth);
|
|
10921
10847
|
const limit = Math.max(1, this.maxRows());
|
|
10922
10848
|
const searchRow = this.searchRow(safeWidth);
|
|
10849
|
+
const filterRow = this.filterRow(safeWidth);
|
|
10850
|
+
const filterSwitchable = filterRow.spans.length > 0;
|
|
10851
|
+
const filterPainted = filterSwitchable && limit >= 3;
|
|
10923
10852
|
const escVerb = this.query === "" ? "Back" : "Clear";
|
|
10924
10853
|
const plainEscVerb = this.query === "" ? "close" : "clear";
|
|
10925
10854
|
const back = this.query === "" ? " · ← Back" : "";
|
|
10855
|
+
const viewHint = filterPainted ? "Tab view · " : "";
|
|
10926
10856
|
const hintWording = pickWording([
|
|
10927
|
-
escapeWording$2(
|
|
10928
|
-
escapeWording$2(
|
|
10929
|
-
escapeWording$2(
|
|
10930
|
-
escapeWording$2(
|
|
10857
|
+
escapeWording$2(`${viewHint}Enter details · type search · ←→ edit · ↑↓ move${back}`, escVerb),
|
|
10858
|
+
escapeWording$2(`${viewHint}Enter details · type search · ←→ edit${back}`, escVerb),
|
|
10859
|
+
escapeWording$2(`${viewHint}Enter details · type search${back}`, escVerb),
|
|
10860
|
+
escapeWording$2(`${viewHint}Enter details${back}`, escVerb),
|
|
10861
|
+
escapeWording$2(`${viewHint}Enter details`, escVerb),
|
|
10862
|
+
escapeWording$2(`${viewHint}type search${back}`, escVerb),
|
|
10931
10863
|
escapeWording$2("Enter details", escVerb),
|
|
10932
10864
|
escapeWording$2("", escVerb)
|
|
10933
10865
|
], safeWidth, `Esc ${plainEscVerb}`);
|
|
10934
10866
|
const passiveWording = pickWording([
|
|
10867
|
+
escapeWording$2(`${viewHint}type search${back}`, escVerb),
|
|
10935
10868
|
escapeWording$2(`type search${back}`, escVerb),
|
|
10936
10869
|
...this.query === "" ? [escapeWording$2("← Back", escVerb)] : [],
|
|
10937
10870
|
escapeWording$2("", escVerb)
|
|
10938
10871
|
], safeWidth, `Esc ${plainEscVerb}`);
|
|
10939
10872
|
const barOnlyWording = pickWording([...this.query === "" ? [escapeWording$2("← Back", escVerb)] : [], escapeWording$2("", escVerb)], safeWidth, `Esc ${plainEscVerb}`);
|
|
10873
|
+
const modeWording = pickWording([
|
|
10874
|
+
escapeWording$2(`${viewHint}type search${back}`, escVerb),
|
|
10875
|
+
escapeWording$2(`type search${back}`, escVerb),
|
|
10876
|
+
...this.query === "" ? [escapeWording$2("← Back", escVerb)] : [],
|
|
10877
|
+
escapeWording$2("", escVerb)
|
|
10878
|
+
], safeWidth, `Esc ${plainEscVerb}`);
|
|
10940
10879
|
const hint = paintBarWording$1(hintWording);
|
|
10941
10880
|
if (limit === 1) {
|
|
10942
10881
|
this.hitMap = [{ kind: "inert" }];
|
|
@@ -10952,16 +10891,20 @@ var KeybindingEditorPanel = class {
|
|
|
10952
10891
|
}
|
|
10953
10892
|
if (limit === 3) {
|
|
10954
10893
|
this.hitMap = [
|
|
10894
|
+
filterSwitchable ? {
|
|
10895
|
+
kind: "filter",
|
|
10896
|
+
spans: filterRow.spans
|
|
10897
|
+
} : { kind: "inert" },
|
|
10955
10898
|
{ kind: "search" },
|
|
10956
|
-
{ kind: "inert" },
|
|
10957
10899
|
{ kind: "inert" }
|
|
10958
10900
|
];
|
|
10959
10901
|
this.paintedSelectableIds = /* @__PURE__ */ new Set();
|
|
10960
|
-
this.
|
|
10902
|
+
this.paintedFilterSpans = filterPainted ? filterRow.spans : void 0;
|
|
10903
|
+
this.paintedEscapeSpanValue = modeWording.escape;
|
|
10961
10904
|
return [
|
|
10905
|
+
filterRow.text,
|
|
10962
10906
|
searchRow,
|
|
10963
|
-
|
|
10964
|
-
paintBarWording$1(passiveWording)
|
|
10907
|
+
paintBarWording$1(modeWording)
|
|
10965
10908
|
];
|
|
10966
10909
|
}
|
|
10967
10910
|
const entries = this.displayEntries();
|
|
@@ -10983,6 +10926,13 @@ var KeybindingEditorPanel = class {
|
|
|
10983
10926
|
hit: { kind: "inert" },
|
|
10984
10927
|
drop: 30
|
|
10985
10928
|
});
|
|
10929
|
+
rows.push({
|
|
10930
|
+
text: filterRow.text,
|
|
10931
|
+
hit: filterSwitchable ? {
|
|
10932
|
+
kind: "filter",
|
|
10933
|
+
spans: filterRow.spans
|
|
10934
|
+
} : { kind: "inert" }
|
|
10935
|
+
});
|
|
10986
10936
|
rows.push({
|
|
10987
10937
|
text: searchRow,
|
|
10988
10938
|
hit: { kind: "search" }
|
|
@@ -10997,13 +10947,14 @@ var KeybindingEditorPanel = class {
|
|
|
10997
10947
|
drop: 10
|
|
10998
10948
|
});
|
|
10999
10949
|
if (entries.length === 0) rows.push({
|
|
11000
|
-
text: color.textDim(
|
|
10950
|
+
text: color.textDim(truncateToWidth(this.emptyListText(), safeWidth)),
|
|
11001
10951
|
hit: { kind: "inert" }
|
|
11002
10952
|
});
|
|
11003
10953
|
else {
|
|
11004
10954
|
for (const entry of entries.slice(start, end)) if (entry.kind === "header") rows.push({
|
|
11005
|
-
text: color.textStrong(entry.label),
|
|
11006
|
-
hit: { kind: "inert" }
|
|
10955
|
+
text: color.textStrong(truncateToWidth(entry.label, safeWidth)),
|
|
10956
|
+
hit: { kind: "inert" },
|
|
10957
|
+
drop: 22
|
|
11007
10958
|
});
|
|
11008
10959
|
else {
|
|
11009
10960
|
const selectableIndex = selectable.indexOf(entry);
|
|
@@ -11043,6 +10994,7 @@ var KeybindingEditorPanel = class {
|
|
|
11043
10994
|
});
|
|
11044
10995
|
const kept = trimToGrant(rows, limit);
|
|
11045
10996
|
this.hitMap = kept.map((row) => row.hit);
|
|
10997
|
+
this.paintedFilterSpans = filterSwitchable && kept.some((row) => row.hit.kind === "filter") ? filterRow.spans : void 0;
|
|
11046
10998
|
this.paintedSelectableIds = new Set(kept.flatMap((row) => row.hit.kind === "select" ? [row.hit.id] : []));
|
|
11047
10999
|
this.paintedEscapeSpanValue = hintWording.escape;
|
|
11048
11000
|
if (this.paintedSelectableIds.size === 0 && kept.length > 0) {
|
|
@@ -11054,6 +11006,45 @@ var KeybindingEditorPanel = class {
|
|
|
11054
11006
|
}
|
|
11055
11007
|
return kept.map((row) => row.text);
|
|
11056
11008
|
}
|
|
11009
|
+
/** The ONE local view-mode row: two complete painted spans when the whole
|
|
11010
|
+
* wording fits, otherwise a read-only statement of the active mode with no
|
|
11011
|
+
* hit geometry (a half token is never clickable). */
|
|
11012
|
+
filterRow(width) {
|
|
11013
|
+
const allToken = this.filter === "all" ? "[All]" : "All";
|
|
11014
|
+
const conflictsLabel = `Conflicts (${this.model.conflictCount} affected actions)`;
|
|
11015
|
+
const conflictsToken = this.filter === "conflicts" ? `[${conflictsLabel}]` : conflictsLabel;
|
|
11016
|
+
const prefix = "View: ";
|
|
11017
|
+
const plain = `${prefix}${allToken} · ${conflictsToken}`;
|
|
11018
|
+
if (visibleWidth(plain) <= width) {
|
|
11019
|
+
const allStart = visibleWidth(prefix);
|
|
11020
|
+
const allEnd = allStart + visibleWidth(allToken);
|
|
11021
|
+
const conflictsStart = allEnd + visibleWidth(" · ");
|
|
11022
|
+
const conflictsEnd = conflictsStart + visibleWidth(conflictsToken);
|
|
11023
|
+
return {
|
|
11024
|
+
text: `${color.textDim(prefix)}${this.filter === "all" ? color.textStrong("[All]", "primary") : color.textDim("All")}${color.textDim(" · ")}${this.filter === "conflicts" ? color.textStrong(`[${conflictsLabel}]`, "primary") : color.textDim(conflictsLabel)}`,
|
|
11025
|
+
spans: [{
|
|
11026
|
+
mode: "all",
|
|
11027
|
+
startCol: allStart,
|
|
11028
|
+
endCol: allEnd
|
|
11029
|
+
}, {
|
|
11030
|
+
mode: "conflicts",
|
|
11031
|
+
startCol: conflictsStart,
|
|
11032
|
+
endCol: conflictsEnd
|
|
11033
|
+
}]
|
|
11034
|
+
};
|
|
11035
|
+
}
|
|
11036
|
+
const label = this.filter === "all" ? "All" : "Conflicts";
|
|
11037
|
+
return {
|
|
11038
|
+
text: truncateToWidth(`${color.textDim(prefix)}${color.textStrong(`[${label}]`, "primary")}`, Math.max(1, width)),
|
|
11039
|
+
spans: []
|
|
11040
|
+
};
|
|
11041
|
+
}
|
|
11042
|
+
emptyListText() {
|
|
11043
|
+
if (this.filter !== "conflicts") return "No matching shortcuts.";
|
|
11044
|
+
if (this.query.trim() !== "") return "No conflicted shortcuts match your search.";
|
|
11045
|
+
if (this.model.conflictCount === 0) return "No conflicts in the current keymap.";
|
|
11046
|
+
return "No conflicted shortcuts match your search.";
|
|
11047
|
+
}
|
|
11057
11048
|
/** The search row: the `Search: ` label combined with the shared
|
|
11058
11049
|
* Input's real render (the user sees the actual cursor position while
|
|
11059
11050
|
* editing the query). An empty query keeps the dim placeholder. The
|
|
@@ -11080,6 +11071,7 @@ var KeybindingEditorPanel = class {
|
|
|
11080
11071
|
if (matchesKey(data, "escape")) {
|
|
11081
11072
|
if (this.query !== "") {
|
|
11082
11073
|
this.searchInput.setValue("");
|
|
11074
|
+
this.mousePressedFilter = void 0;
|
|
11083
11075
|
this.selectedId = "leader";
|
|
11084
11076
|
this.selectedIndex = 0;
|
|
11085
11077
|
this.message = void 0;
|
|
@@ -11096,6 +11088,11 @@ var KeybindingEditorPanel = class {
|
|
|
11096
11088
|
return;
|
|
11097
11089
|
}
|
|
11098
11090
|
if (this.maxRows() < 2) return;
|
|
11091
|
+
if (matchesKey(data, "tab") || matchesKey(data, "shift+tab")) {
|
|
11092
|
+
if (this.paintedFilterSpans === void 0) return;
|
|
11093
|
+
this.setFilter(this.filter === "all" ? "conflicts" : "all");
|
|
11094
|
+
return;
|
|
11095
|
+
}
|
|
11099
11096
|
const selectable = this.selectableEntries(this.displayEntries());
|
|
11100
11097
|
this.ensureSelection(selectable);
|
|
11101
11098
|
if (matchesKey(data, "up")) {
|
|
@@ -11124,6 +11121,7 @@ var KeybindingEditorPanel = class {
|
|
|
11124
11121
|
const before = this.searchInput.getValue();
|
|
11125
11122
|
this.searchInput.handleInput(data);
|
|
11126
11123
|
if (this.searchInput.getValue() !== before) {
|
|
11124
|
+
this.mousePressedFilter = void 0;
|
|
11127
11125
|
this.selectedId = "leader";
|
|
11128
11126
|
this.selectedIndex = 0;
|
|
11129
11127
|
this.message = void 0;
|
|
@@ -11143,16 +11141,46 @@ var KeybindingEditorPanel = class {
|
|
|
11143
11141
|
const pressedId = this.mousePressedId;
|
|
11144
11142
|
const pressedGrant = this.mousePressedGrant;
|
|
11145
11143
|
const pressedView = this.mousePressedView;
|
|
11144
|
+
const pressedFilter = this.mousePressedFilter;
|
|
11146
11145
|
if (event.type === "click" || event.type === "wheel") {
|
|
11147
11146
|
this.mousePressedId = void 0;
|
|
11148
11147
|
this.mousePressedGrant = void 0;
|
|
11149
11148
|
this.mousePressedView = void 0;
|
|
11149
|
+
this.mousePressedFilter = void 0;
|
|
11150
11150
|
}
|
|
11151
11151
|
if (event.width !== this.lastRenderWidth) return void 0;
|
|
11152
11152
|
if (this.actionEditor !== void 0) return this.actionEditor.handleMouse?.(event);
|
|
11153
11153
|
if (this.leaderEditing) return void 0;
|
|
11154
11154
|
const hit = this.hitMap[event.y];
|
|
11155
11155
|
if (!hit) return void 0;
|
|
11156
|
+
if (hit.kind === "filter") {
|
|
11157
|
+
if (event.button !== "left" || event.type !== "press" && event.type !== "click") return void 0;
|
|
11158
|
+
const span = hit.spans.find((candidate) => event.x >= candidate.startCol && event.x < candidate.endCol);
|
|
11159
|
+
if (span === void 0) return void 0;
|
|
11160
|
+
if (event.type === "press") {
|
|
11161
|
+
this.mousePressedId = void 0;
|
|
11162
|
+
this.mousePressedGrant = void 0;
|
|
11163
|
+
this.mousePressedView = void 0;
|
|
11164
|
+
this.mousePressedFilter = {
|
|
11165
|
+
spans: hit.spans,
|
|
11166
|
+
mode: span.mode,
|
|
11167
|
+
grant: this.parentContentRows,
|
|
11168
|
+
view: this.gestureIdentity(),
|
|
11169
|
+
width: this.lastRenderWidth
|
|
11170
|
+
};
|
|
11171
|
+
return {
|
|
11172
|
+
handled: true,
|
|
11173
|
+
focus: true
|
|
11174
|
+
};
|
|
11175
|
+
}
|
|
11176
|
+
if (pressedFilter === void 0 || pressedFilter.mode !== span.mode) return void 0;
|
|
11177
|
+
const pressedSpan = pressedFilter.spans.find((candidate) => candidate.mode === pressedFilter.mode);
|
|
11178
|
+
if (pressedSpan === void 0 || pressedSpan.startCol !== span.startCol || pressedSpan.endCol !== span.endCol) return void 0;
|
|
11179
|
+
if (pressedFilter.grant !== this.parentContentRows || pressedFilter.width !== this.lastRenderWidth) return void 0;
|
|
11180
|
+
if (pressedFilter.view !== this.gestureIdentity()) return void 0;
|
|
11181
|
+
this.setFilter(span.mode);
|
|
11182
|
+
return { handled: true };
|
|
11183
|
+
}
|
|
11156
11184
|
if (hit.kind === "search") {
|
|
11157
11185
|
if (event.type !== "press") return void 0;
|
|
11158
11186
|
const result = dispatchMouseEvent(this.searchInput, {
|
|
@@ -11179,6 +11207,7 @@ var KeybindingEditorPanel = class {
|
|
|
11179
11207
|
if (event.button !== "left" || event.type !== "press" && event.type !== "click") return void 0;
|
|
11180
11208
|
if (event.type === "press") {
|
|
11181
11209
|
this.mousePressedId = void 0;
|
|
11210
|
+
this.mousePressedFilter = void 0;
|
|
11182
11211
|
const currentIndex = this.selectableEntries(this.displayEntries()).findIndex((entry) => this.entryId(entry) === hit.id);
|
|
11183
11212
|
if (currentIndex === -1) return void 0;
|
|
11184
11213
|
this.mousePressedId = hit.id;
|
|
@@ -11215,13 +11244,21 @@ var KeybindingEditorPanel = class {
|
|
|
11215
11244
|
paintedEscapeSpan() {
|
|
11216
11245
|
return this.paintedEscapeSpanValue;
|
|
11217
11246
|
}
|
|
11247
|
+
/** The Action detail's delegated non-Esc bar spans, when that sub-view is
|
|
11248
|
+
* mounted; the Settings root owns the physical row and forwards releases. */
|
|
11249
|
+
paintedBarSpans() {
|
|
11250
|
+
return this.actionEditor?.paintedBarSpans?.() ?? [];
|
|
11251
|
+
}
|
|
11252
|
+
activateBarSpan(id) {
|
|
11253
|
+
this.actionEditor?.activateBarSpan?.(id);
|
|
11254
|
+
}
|
|
11218
11255
|
/** The page's own SEMANTIC identity for a pointer gesture: the sub-view
|
|
11219
11256
|
* (list / leader editor / action detail), the query stage and the pending
|
|
11220
11257
|
* leader write decide what its Esc really does. The Settings root stores it
|
|
11221
11258
|
* at press and re-proves it at the release. */
|
|
11222
11259
|
gestureIdentity() {
|
|
11223
11260
|
const detail = this.actionEditor === void 0 ? "" : this.actionEditor.gestureIdentity();
|
|
11224
|
-
return `${this.viewKey()}:${detail}:${this.query === "" ? "empty" :
|
|
11261
|
+
return `${this.viewKey()}:${detail}:${this.query === "" ? "empty" : `query:${this.query}`}:${this.leaderPending ? "pending" : "idle"}`;
|
|
11225
11262
|
}
|
|
11226
11263
|
dispose() {
|
|
11227
11264
|
if (this.disposed) return;
|
|
@@ -11236,6 +11273,7 @@ var KeybindingEditorPanel = class {
|
|
|
11236
11273
|
this.onDispose();
|
|
11237
11274
|
}
|
|
11238
11275
|
displayEntries() {
|
|
11276
|
+
if (this.filter === "conflicts") return this.displayConflictEntries();
|
|
11239
11277
|
const matches = searchKeybindingRows(this.model.rows, this.query);
|
|
11240
11278
|
const matchedRows = new Set(matches.map((match) => match.row.id));
|
|
11241
11279
|
const entries = [];
|
|
@@ -11257,15 +11295,47 @@ var KeybindingEditorPanel = class {
|
|
|
11257
11295
|
}
|
|
11258
11296
|
return entries;
|
|
11259
11297
|
}
|
|
11298
|
+
/** The Conflicts view: only affected editable builtin actions. Every
|
|
11299
|
+
* production conflict record has a builtin/user participant, so the
|
|
11300
|
+
* action rows are the complete projection. */
|
|
11301
|
+
displayConflictEntries() {
|
|
11302
|
+
const entries = [];
|
|
11303
|
+
const matches = searchKeybindingRows(this.model.rows, this.query);
|
|
11304
|
+
const matchedRows = new Set(matches.map((match) => match.row.id));
|
|
11305
|
+
const affected = [];
|
|
11306
|
+
for (const section of this.model.sections) {
|
|
11307
|
+
const rows = section.rows.filter((row) => row.conflict && matchedRows.has(row.id));
|
|
11308
|
+
if (rows.length === 0) continue;
|
|
11309
|
+
affected.push({
|
|
11310
|
+
kind: "header",
|
|
11311
|
+
label: section.category
|
|
11312
|
+
});
|
|
11313
|
+
for (const row of rows) affected.push({
|
|
11314
|
+
kind: "action",
|
|
11315
|
+
row
|
|
11316
|
+
});
|
|
11317
|
+
}
|
|
11318
|
+
if (affected.length > 0) {
|
|
11319
|
+
entries.push({
|
|
11320
|
+
kind: "header",
|
|
11321
|
+
label: "Affected actions"
|
|
11322
|
+
});
|
|
11323
|
+
entries.push(...affected);
|
|
11324
|
+
}
|
|
11325
|
+
return entries;
|
|
11326
|
+
}
|
|
11260
11327
|
selectableEntries(entries) {
|
|
11261
11328
|
return entries.filter((entry) => entry.kind !== "header");
|
|
11262
11329
|
}
|
|
11263
11330
|
isSelectedEntry(entry) {
|
|
11264
|
-
|
|
11331
|
+
if (entry.kind === "leader") return this.selectedId === "leader";
|
|
11332
|
+
if (entry.kind === "action") return this.selectedId === entry.row.id;
|
|
11333
|
+
return false;
|
|
11265
11334
|
}
|
|
11266
11335
|
ensureSelection(selectable) {
|
|
11267
11336
|
if (selectable.length === 0) {
|
|
11268
11337
|
this.selectedIndex = 0;
|
|
11338
|
+
this.selectedId = "";
|
|
11269
11339
|
return;
|
|
11270
11340
|
}
|
|
11271
11341
|
const existing = selectable.findIndex((entry) => this.isSelectedEntry(entry));
|
|
@@ -11277,7 +11347,9 @@ var KeybindingEditorPanel = class {
|
|
|
11277
11347
|
this.selectedId = this.entryId(selectable[this.selectedIndex]);
|
|
11278
11348
|
}
|
|
11279
11349
|
entryId(entry) {
|
|
11280
|
-
|
|
11350
|
+
if (entry.kind === "leader") return "leader";
|
|
11351
|
+
if (entry.kind === "action") return entry.row.id;
|
|
11352
|
+
return "";
|
|
11281
11353
|
}
|
|
11282
11354
|
moveSelection(delta, selectable) {
|
|
11283
11355
|
if (selectable.length === 0) return;
|
|
@@ -11323,6 +11395,21 @@ var KeybindingEditorPanel = class {
|
|
|
11323
11395
|
this.actionEditor = detail;
|
|
11324
11396
|
this.requestRender();
|
|
11325
11397
|
}
|
|
11398
|
+
/** The ONE mode transition used by Tab/Shift+Tab and the painted spans.
|
|
11399
|
+
* Filtering is presentation-only: no mutation, no reload, no keymap write.
|
|
11400
|
+
* It preserves the query, cancels any mouse gesture and repositions a
|
|
11401
|
+
* selection that the new mode no longer contains. */
|
|
11402
|
+
setFilter(next) {
|
|
11403
|
+
if (this.filter === next) return;
|
|
11404
|
+
this.filter = next;
|
|
11405
|
+
this.mousePressedId = void 0;
|
|
11406
|
+
this.mousePressedGrant = void 0;
|
|
11407
|
+
this.mousePressedView = void 0;
|
|
11408
|
+
this.mousePressedFilter = void 0;
|
|
11409
|
+
this.message = void 0;
|
|
11410
|
+
this.ensureSelection(this.selectableEntries(this.displayEntries()));
|
|
11411
|
+
this.requestRender();
|
|
11412
|
+
}
|
|
11326
11413
|
renderLeaderEditor(width) {
|
|
11327
11414
|
this.paintedEscapeSpanValue = void 0;
|
|
11328
11415
|
if (this.leaderRecorder !== void 0) {
|
|
@@ -36505,6 +36592,18 @@ function createSessionCommands(deps) {
|
|
|
36505
36592
|
//#endregion
|
|
36506
36593
|
//#region src/tui/commands/settings.ts
|
|
36507
36594
|
/**
|
|
36595
|
+
* Built-in command definitions for the TUI settings/display domain
|
|
36596
|
+
* (/settings, /footer, /display, /focus, /keybindings) plus their
|
|
36597
|
+
* domain-local helpers.
|
|
36598
|
+
*
|
|
36599
|
+
* Registration is explicit: the coordinator (src/commands.ts) calls each
|
|
36600
|
+
* registrar at its frozen position in the built-in registration sequence and
|
|
36601
|
+
* owns catalog/provenance/disposal state. This module owns command-definition
|
|
36602
|
+
* and presentation logic only — never TUI settings persistence authority:
|
|
36603
|
+
* every write still goes through the same runner settings/config seams.
|
|
36604
|
+
* @module @xmoon76/dsh-pi-tui/commands/settings
|
|
36605
|
+
*/
|
|
36606
|
+
/**
|
|
36508
36607
|
* M6 UX PR2 Step D: the ONE decision rule for the transient user-conversion
|
|
36509
36608
|
* intent. Only a verified `daemon → direct` save made by a process that is
|
|
36510
36609
|
* STILL running the daemon backend grants the exit-intent owner permission to
|
|
@@ -37553,10 +37652,13 @@ function createSettingsCommands(deps) {
|
|
|
37553
37652
|
/** FR4: the ONE open MCP page's controller (a Settings refresh re-reads it). */
|
|
37554
37653
|
let activeMcpController;
|
|
37555
37654
|
const openSettingsWorkspaceWith = (spec) => {
|
|
37556
|
-
|
|
37557
|
-
|
|
37558
|
-
|
|
37655
|
+
const { initialKeybindingsFilter, onKeybindingsPageFailure, ...workspaceSpec } = spec;
|
|
37656
|
+
let keybindingsFilterPending = initialKeybindingsFilter;
|
|
37657
|
+
if (workspaceSpec.initialSpecialist !== void 0) {
|
|
37658
|
+
const requires = SETTINGS_SPECIALIST_ROUTE_ROW[workspaceSpec.initialSpecialist];
|
|
37659
|
+
if (workspaceSpec.initialRowId !== requires) throw new Error(`the ${workspaceSpec.initialSpecialist} deeplink requires the ${requires} row`);
|
|
37559
37660
|
}
|
|
37661
|
+
if (initialKeybindingsFilter !== void 0 && (workspaceSpec.initialSpecialist !== "keybindings" || workspaceSpec.initialRowId !== "keyboard-shortcuts")) throw new Error("the keybindings conflicts view requires the keyboard-shortcuts keybindings deeplink");
|
|
37560
37662
|
const token = {};
|
|
37561
37663
|
let approvalScope;
|
|
37562
37664
|
let approvalScopePinned = false;
|
|
@@ -37807,7 +37909,13 @@ function createSettingsCommands(deps) {
|
|
|
37807
37909
|
return page;
|
|
37808
37910
|
},
|
|
37809
37911
|
createFooterConfiguratorPage: (done, onAuthoritativeChange) => createFooterWorkspacePage(done, onAuthoritativeChange),
|
|
37810
|
-
createKeybindingsPage: (done, onAuthoritativeChange) =>
|
|
37912
|
+
createKeybindingsPage: (done, onAuthoritativeChange) => {
|
|
37913
|
+
const filter = keybindingsFilterPending ?? "all";
|
|
37914
|
+
const notifyOnFailure = keybindingsFilterPending !== "conflicts";
|
|
37915
|
+
const onFailure = keybindingsFilterPending === "conflicts" ? onKeybindingsPageFailure : void 0;
|
|
37916
|
+
keybindingsFilterPending = void 0;
|
|
37917
|
+
return createKeybindingsWorkspacePage(done, onAuthoritativeChange, filter, notifyOnFailure, onFailure);
|
|
37918
|
+
},
|
|
37811
37919
|
createMcpServersPage: (done) => {
|
|
37812
37920
|
const port = runner.mcpServers;
|
|
37813
37921
|
if (port === void 0) return void 0;
|
|
@@ -37872,7 +37980,7 @@ function createSettingsCommands(deps) {
|
|
|
37872
37980
|
onAboutLeave: () => {
|
|
37873
37981
|
aboutStatusSource().leave();
|
|
37874
37982
|
},
|
|
37875
|
-
...
|
|
37983
|
+
...workspaceSpec,
|
|
37876
37984
|
onClose: (reason) => {
|
|
37877
37985
|
const wasActive = activeSettingsWorkspace?.token === token;
|
|
37878
37986
|
if (wasActive) activeSettingsWorkspace = void 0;
|
|
@@ -37926,7 +38034,7 @@ function createSettingsCommands(deps) {
|
|
|
37926
38034
|
startAcpRuntimeRead();
|
|
37927
38035
|
});
|
|
37928
38036
|
startPolicyRead(false);
|
|
37929
|
-
if (
|
|
38037
|
+
if (workspaceSpec.initialCategory === void 0 && workspaceSpec.initialRowId === void 0 && workspaceSpec.initialModelsView === void 0 && workspaceSpec.initialAccountView === void 0) aboutStatusSource().enter();
|
|
37930
38038
|
return handle;
|
|
37931
38039
|
};
|
|
37932
38040
|
const openSettingsWorkspaceAt = (initialRowId) => {
|
|
@@ -38025,7 +38133,7 @@ function createSettingsCommands(deps) {
|
|
|
38025
38133
|
/** Build the one editor used by /keybindings and the /settings submenu.
|
|
38026
38134
|
* The settings row is only a launcher; all reads/writes still go through
|
|
38027
38135
|
* the controller and the same panel state machine. */
|
|
38028
|
-
const createKeybindingEditorPanel = (onClose, onModelChange = () => {}) => {
|
|
38136
|
+
const createKeybindingEditorPanel = (onClose, onModelChange = () => {}, initialFilter = "all", notifyOnFailure = true, onFailure) => {
|
|
38029
38137
|
const settings = runner.tuiSettings;
|
|
38030
38138
|
if (settings === void 0) return void 0;
|
|
38031
38139
|
const controller = new KeybindingEditorController({
|
|
@@ -38040,6 +38148,7 @@ function createSettingsCommands(deps) {
|
|
|
38040
38148
|
let unregister = () => {};
|
|
38041
38149
|
panel = new KeybindingEditorPanel({
|
|
38042
38150
|
model,
|
|
38151
|
+
initialFilter,
|
|
38043
38152
|
onClose,
|
|
38044
38153
|
onModelChange,
|
|
38045
38154
|
onDispose: () => unregister(),
|
|
@@ -38057,7 +38166,8 @@ function createSettingsCommands(deps) {
|
|
|
38057
38166
|
unregister = app.trackKeybindingEditor(panel);
|
|
38058
38167
|
return panel;
|
|
38059
38168
|
} catch (error) {
|
|
38060
|
-
|
|
38169
|
+
onFailure?.(error);
|
|
38170
|
+
if (notifyOnFailure) app.notify(`Could not open keyboard shortcuts: ${safeErrorMessage(error)}`, "error");
|
|
38061
38171
|
return;
|
|
38062
38172
|
}
|
|
38063
38173
|
};
|
|
@@ -40384,10 +40494,10 @@ function createSettingsCommands(deps) {
|
|
|
40384
40494
|
* `createKeybindingEditorPanel` (the same controller/projector/recorder). A
|
|
40385
40495
|
* successful mutation refreshes the row summary from the controller's own
|
|
40386
40496
|
* read; `done` returns to the Input & Terminal row. */
|
|
40387
|
-
function createKeybindingsWorkspacePage(done, onAuthoritativeChange) {
|
|
40497
|
+
function createKeybindingsWorkspacePage(done, onAuthoritativeChange, initialFilter = "all", notifyOnFailure = true, onFailure) {
|
|
40388
40498
|
return createKeybindingEditorPanel(done, () => {
|
|
40389
40499
|
onAuthoritativeChange();
|
|
40390
|
-
});
|
|
40500
|
+
}, initialFilter, notifyOnFailure, onFailure);
|
|
40391
40501
|
}
|
|
40392
40502
|
const registerFooter = () => {
|
|
40393
40503
|
registerTuiCommand({
|
|
@@ -40494,6 +40604,69 @@ function createSettingsCommands(deps) {
|
|
|
40494
40604
|
}
|
|
40495
40605
|
});
|
|
40496
40606
|
};
|
|
40607
|
+
/** The conflicts-only degraded receipt: the typed Settings page could not be
|
|
40608
|
+
* opened, so the message names the real cause AND the CURRENT runtime
|
|
40609
|
+
* conflict records (read fresh from the Manager — never the count cached
|
|
40610
|
+
* before the open attempt). It returns an error result even when the
|
|
40611
|
+
* runtime keymap is conflict-free: the editor really did not open. */
|
|
40612
|
+
const reportConflictDegraded = (reason) => {
|
|
40613
|
+
const conflicts = app.keybindingsManager().snapshot().conflicts;
|
|
40614
|
+
const lines = [`Could not open Keyboard shortcuts: ${reason}. Runtime keybinding conflict records: ${conflicts.length}.`];
|
|
40615
|
+
if (conflicts.length === 0) lines.push("No conflicts in the current runtime keymap; the Settings editor is unavailable.");
|
|
40616
|
+
else for (const conflict of conflicts) lines.push(`- ${formatKeyId(conflict.key)}: ${conflict.actions.map((action) => `${action.action} (${action.scope}, ${action.source})`).join(" vs ")}`);
|
|
40617
|
+
return {
|
|
40618
|
+
kind: "error",
|
|
40619
|
+
text: lines.join("\n")
|
|
40620
|
+
};
|
|
40621
|
+
};
|
|
40622
|
+
/** The ONE typed Keyboard shortcuts entry. Both the ordinary page and the
|
|
40623
|
+
* conflicts view take the SAME Settings lease and mount the SAME editor;
|
|
40624
|
+
* only the initial transient filter differs. The ordinary path keeps its
|
|
40625
|
+
* exact pre-PR2 failure texts. */
|
|
40626
|
+
const openKeyboardShortcuts = async (initialFilter) => {
|
|
40627
|
+
const settings = runner.tuiSettings;
|
|
40628
|
+
if (settings === void 0) return initialFilter === "conflicts" ? reportConflictDegraded("the settings service is unavailable") : {
|
|
40629
|
+
kind: "error",
|
|
40630
|
+
text: "settings service unavailable"
|
|
40631
|
+
};
|
|
40632
|
+
try {
|
|
40633
|
+
settings.get();
|
|
40634
|
+
} catch (error) {
|
|
40635
|
+
return initialFilter === "conflicts" ? reportConflictDegraded(`the settings document could not be read: ${safeErrorMessage(error)}`) : {
|
|
40636
|
+
kind: "error",
|
|
40637
|
+
text: `could not open keyboard shortcuts: ${safeErrorMessage(error)}`
|
|
40638
|
+
};
|
|
40639
|
+
}
|
|
40640
|
+
let handle;
|
|
40641
|
+
let pageFailure;
|
|
40642
|
+
try {
|
|
40643
|
+
handle = openSettingsWorkspaceWith({
|
|
40644
|
+
initialRowId: "keyboard-shortcuts",
|
|
40645
|
+
initialSpecialist: "keybindings",
|
|
40646
|
+
...initialFilter === "conflicts" ? {
|
|
40647
|
+
initialKeybindingsFilter: "conflicts",
|
|
40648
|
+
onKeybindingsPageFailure: (error) => {
|
|
40649
|
+
pageFailure = error;
|
|
40650
|
+
}
|
|
40651
|
+
} : {}
|
|
40652
|
+
});
|
|
40653
|
+
} catch (error) {
|
|
40654
|
+
return initialFilter === "conflicts" ? reportConflictDegraded(`the Settings workspace could not be opened: ${safeErrorMessage(error)}`) : {
|
|
40655
|
+
kind: "error",
|
|
40656
|
+
text: `could not open the settings workspace: ${safeErrorMessage(error)}`
|
|
40657
|
+
};
|
|
40658
|
+
}
|
|
40659
|
+
const settlement = await handle.whenInitialSpecialistSettled();
|
|
40660
|
+
if (!settlement.ok) {
|
|
40661
|
+
handle.close();
|
|
40662
|
+
const reason = pageFailure === void 0 ? settlement.reason : safeErrorMessage(pageFailure);
|
|
40663
|
+
return initialFilter === "conflicts" ? reportConflictDegraded(`the Keyboard shortcuts page could not be created: ${reason}`) : {
|
|
40664
|
+
kind: "error",
|
|
40665
|
+
text: `could not open keyboard shortcuts: ${reason}`
|
|
40666
|
+
};
|
|
40667
|
+
}
|
|
40668
|
+
return { kind: "success" };
|
|
40669
|
+
};
|
|
40497
40670
|
const registerKeybindings = () => {
|
|
40498
40671
|
registerOne({
|
|
40499
40672
|
name: "keybindings",
|
|
@@ -40502,24 +40675,7 @@ function createSettingsCommands(deps) {
|
|
|
40502
40675
|
handler: async (invocation) => {
|
|
40503
40676
|
const verb = invocation.rawInput.trim().split(/\s+/)[0]?.toLowerCase() ?? "";
|
|
40504
40677
|
const keybindings = app.keybindingsManager();
|
|
40505
|
-
if (verb === "conflicts")
|
|
40506
|
-
const conflicts = keybindings.snapshot().conflicts;
|
|
40507
|
-
if (conflicts.length === 0) {
|
|
40508
|
-
app.notify("No keybinding conflicts.", "info");
|
|
40509
|
-
return {
|
|
40510
|
-
kind: "success",
|
|
40511
|
-
text: "No keybinding conflicts."
|
|
40512
|
-
};
|
|
40513
|
-
}
|
|
40514
|
-
const rows = conflicts.flatMap((conflict) => [{
|
|
40515
|
-
id: `conflict-${conflict.key}`,
|
|
40516
|
-
label: color.warning(formatKeyId(conflict.key)),
|
|
40517
|
-
description: conflict.actions.map((entry) => `${entry.action} (${entry.scope}, ${entry.source})`).join(" vs "),
|
|
40518
|
-
currentValue: "conflict"
|
|
40519
|
-
}]);
|
|
40520
|
-
app.openSettings(rows, () => {}, () => {});
|
|
40521
|
-
return { kind: "success" };
|
|
40522
|
-
}
|
|
40678
|
+
if (verb === "conflicts") return openKeyboardShortcuts("conflicts");
|
|
40523
40679
|
if (verb === "reload") {
|
|
40524
40680
|
const settings = runner.tuiSettings;
|
|
40525
40681
|
if (settings === void 0) return {
|
|
@@ -40580,40 +40736,7 @@ function createSettingsCommands(deps) {
|
|
|
40580
40736
|
}
|
|
40581
40737
|
});
|
|
40582
40738
|
}
|
|
40583
|
-
|
|
40584
|
-
if (settings === void 0) return {
|
|
40585
|
-
kind: "error",
|
|
40586
|
-
text: "settings service unavailable"
|
|
40587
|
-
};
|
|
40588
|
-
try {
|
|
40589
|
-
settings.get();
|
|
40590
|
-
} catch (error) {
|
|
40591
|
-
return {
|
|
40592
|
-
kind: "error",
|
|
40593
|
-
text: `could not open keyboard shortcuts: ${safeErrorMessage(error)}`
|
|
40594
|
-
};
|
|
40595
|
-
}
|
|
40596
|
-
let handle;
|
|
40597
|
-
try {
|
|
40598
|
-
handle = openSettingsWorkspaceWith({
|
|
40599
|
-
initialRowId: "keyboard-shortcuts",
|
|
40600
|
-
initialSpecialist: "keybindings"
|
|
40601
|
-
});
|
|
40602
|
-
} catch (error) {
|
|
40603
|
-
return {
|
|
40604
|
-
kind: "error",
|
|
40605
|
-
text: `could not open the settings workspace: ${safeErrorMessage(error)}`
|
|
40606
|
-
};
|
|
40607
|
-
}
|
|
40608
|
-
const settlement = await handle.whenInitialSpecialistSettled();
|
|
40609
|
-
if (!settlement.ok) {
|
|
40610
|
-
handle.close();
|
|
40611
|
-
return {
|
|
40612
|
-
kind: "error",
|
|
40613
|
-
text: `could not open keyboard shortcuts: ${settlement.reason}`
|
|
40614
|
-
};
|
|
40615
|
-
}
|
|
40616
|
-
return { kind: "success" };
|
|
40739
|
+
return openKeyboardShortcuts("all");
|
|
40617
40740
|
}
|
|
40618
40741
|
});
|
|
40619
40742
|
};
|
|
@@ -42426,8 +42549,7 @@ function registerTuiCommands(runner, initial, catalogSeams = {}, modelPresentati
|
|
|
42426
42549
|
captureExtensionHealthRef,
|
|
42427
42550
|
loadSkill,
|
|
42428
42551
|
takeDelivery,
|
|
42429
|
-
splitSkillLine
|
|
42430
|
-
resolveComposerDelivery
|
|
42552
|
+
splitSkillLine
|
|
42431
42553
|
};
|
|
42432
42554
|
registerSkillCommand(skillsCommandDeps);
|
|
42433
42555
|
registerReloadCommand(skillsCommandDeps);
|
|
@@ -42489,10 +42611,6 @@ function registerTuiCommands(runner, initial, catalogSeams = {}, modelPresentati
|
|
|
42489
42611
|
});
|
|
42490
42612
|
authCommands.registerLogin();
|
|
42491
42613
|
authCommands.registerLogout();
|
|
42492
|
-
registerHelpCommand({
|
|
42493
|
-
runner,
|
|
42494
|
-
registerOne
|
|
42495
|
-
});
|
|
42496
42614
|
settingsCommands.registerKeybindings();
|
|
42497
42615
|
if (initial?.snapshot !== void 0) installSurfaceSnapshot(initial.snapshot);
|
|
42498
42616
|
else if (initial?.skills !== void 0) withCommandCommit(() => {
|
|
@@ -64470,7 +64588,7 @@ var FooterConfiguratorPanel = class {
|
|
|
64470
64588
|
}
|
|
64471
64589
|
if (entry.kind === "custom-command") {
|
|
64472
64590
|
const value = customItem?.kind === "command" ? customItem.command : void 0;
|
|
64473
|
-
return this.menuRow(marker, "Command", value === void 0 ? void 0 : color.text(
|
|
64591
|
+
return this.menuRow(marker, "Command", value === void 0 ? void 0 : color.text(value), active);
|
|
64474
64592
|
}
|
|
64475
64593
|
if (entry.kind === "custom-refresh") {
|
|
64476
64594
|
const value = customItem?.kind === "command" ? formatRefreshMs(effectiveCustomCommandRefreshMs(customItem)) : void 0;
|
|
@@ -64651,7 +64769,7 @@ var FooterConfiguratorPanel = class {
|
|
|
64651
64769
|
case "create-refresh": {
|
|
64652
64770
|
const lines = [
|
|
64653
64771
|
this.menuRow(" ", "Name", color.text(state.customName), false),
|
|
64654
|
-
this.menuRow(" ", "Command", color.text(
|
|
64772
|
+
this.menuRow(" ", "Command", color.text(stripControlChars(state.customCommand)), false),
|
|
64655
64773
|
color.textStrong("Refresh"),
|
|
64656
64774
|
...CUSTOM_COMMAND_REFRESH_CHOICES_MS.map((ms, index) => {
|
|
64657
64775
|
const active = index === state.pickerIndex;
|
|
@@ -64681,7 +64799,7 @@ var FooterConfiguratorPanel = class {
|
|
|
64681
64799
|
case "create-timeout": {
|
|
64682
64800
|
const lines = [
|
|
64683
64801
|
this.menuRow(" ", "Name", color.text(state.customName), false),
|
|
64684
|
-
this.menuRow(" ", "Command", color.text(
|
|
64802
|
+
this.menuRow(" ", "Command", color.text(stripControlChars(state.customCommand)), false),
|
|
64685
64803
|
color.textStrong("Timeout"),
|
|
64686
64804
|
...CUSTOM_COMMAND_TIMEOUT_CHOICES_MS.map((ms, index) => {
|
|
64687
64805
|
const active = index === state.pickerIndex;
|
|
@@ -64713,7 +64831,7 @@ var FooterConfiguratorPanel = class {
|
|
|
64713
64831
|
const content = state.customKind === "command" ? state.customCommand : state.customText;
|
|
64714
64832
|
const lines = [
|
|
64715
64833
|
this.menuRow(" ", "Name", color.text(state.customName), false),
|
|
64716
|
-
this.menuRow(" ", contentLabel, color.text(
|
|
64834
|
+
this.menuRow(" ", contentLabel, color.text(stripControlChars(content)), false),
|
|
64717
64835
|
color.textStrong("Tone"),
|
|
64718
64836
|
...FOOTER_TONE_CHOICES.map((choice, index) => {
|
|
64719
64837
|
const marker = index === state.pickerIndex ? color.primary("›") : " ";
|
|
@@ -64869,7 +64987,7 @@ var FooterConfiguratorPanel = class {
|
|
|
64869
64987
|
* applied (tone replaces every span's tone; prefix/suffix wrap). */
|
|
64870
64988
|
itemPreview(ref) {
|
|
64871
64989
|
const def = this.registry.get(ref.id);
|
|
64872
|
-
if (def === void 0) return color.textMuted(
|
|
64990
|
+
if (def === void 0) return color.textMuted(stripControlChars(ref.id));
|
|
64873
64991
|
try {
|
|
64874
64992
|
const segment = def.render(this.snapshot(), ref, "preferred", {
|
|
64875
64993
|
taskBrowserAvailable: this.taskBrowserAvailable(),
|
|
@@ -64919,7 +65037,7 @@ var FooterConfiguratorPanel = class {
|
|
|
64919
65037
|
itemLabel(rowIndex, flat) {
|
|
64920
65038
|
const ref = this.refAt(rowIndex, flat);
|
|
64921
65039
|
if (ref === void 0) return "(no item)";
|
|
64922
|
-
return
|
|
65040
|
+
return this.refLabel(ref);
|
|
64923
65041
|
}
|
|
64924
65042
|
/** Count all layout references to a definition before a delete. */
|
|
64925
65043
|
referenceCount(id) {
|
|
@@ -64990,10 +65108,6 @@ function longestPasteStartSuffix(data) {
|
|
|
64990
65108
|
function toneMenuLabel(kind) {
|
|
64991
65109
|
return kind === "custom-tone" ? "Default tone" : "Tone";
|
|
64992
65110
|
}
|
|
64993
|
-
/** Clip a title-part label (titles truncate ANSI-safely anyway). */
|
|
64994
|
-
function clipText(text, max = 40) {
|
|
64995
|
-
return text.length <= max ? text : `${text.slice(0, Math.max(0, max - 1))}…`;
|
|
64996
|
-
}
|
|
64997
65111
|
/** Build one wording whose LAST segment is `Verb [Esc]`, the form the design
|
|
64998
65112
|
* language reserves for an affordance with a key (§7.1). */
|
|
64999
65113
|
function escapeWording(lead, verb) {
|
|
@@ -75960,8 +76074,8 @@ var EffectiveKeymap = class {
|
|
|
75960
76074
|
* rules as keysFor/editorKeysFor/keyHint — a working user override
|
|
75961
76075
|
* never leaves the replaced builtin advertised (review finding: the
|
|
75962
76076
|
* snapshot used to iterate the raw top-trigger set, so /keybindings
|
|
75963
|
-
* showed `Ctrl+X + Enter` for a working submit remap while
|
|
75964
|
-
* right). */
|
|
76077
|
+
* showed `Ctrl+X + Enter` for a working submit remap while the effective
|
|
76078
|
+
* key hint was right). */
|
|
75965
76079
|
snapshot() {
|
|
75966
76080
|
const bindings = [...new Set(this.visibleRules.map((rule) => rule.action))].sort().map((action) => {
|
|
75967
76081
|
const rules = this.visibleRulesFor(action);
|
|
@@ -94636,6 +94750,7 @@ var TuiApp = class TuiApp {
|
|
|
94636
94750
|
}
|
|
94637
94751
|
if (widthChanged) {
|
|
94638
94752
|
this.rebuildQueuePane(width);
|
|
94753
|
+
this.renderDock();
|
|
94639
94754
|
this.renderGoalLine();
|
|
94640
94755
|
}
|
|
94641
94756
|
if (widthChanged || heightChanged) {
|
|
@@ -94934,7 +95049,7 @@ var TuiApp = class TuiApp {
|
|
|
94934
95049
|
const active = todos.filter((todo) => todo.status !== "completed");
|
|
94935
95050
|
const done = todos.length - active.length;
|
|
94936
95051
|
const first = active[0];
|
|
94937
|
-
const label = first === void 0 ? "" : sanitizedPhysicalLine(first.content
|
|
95052
|
+
const label = first === void 0 ? "" : sanitizedPhysicalLine(first.content);
|
|
94938
95053
|
return [
|
|
94939
95054
|
done > 0 ? `${done} todo done` : "",
|
|
94940
95055
|
active.length > 0 ? `${active.length} active` : "",
|
|
@@ -95558,7 +95673,7 @@ var TuiApp = class TuiApp {
|
|
|
95558
95673
|
renderDock() {
|
|
95559
95674
|
const extensionDock = this.extensionHost?.dockText() ?? "";
|
|
95560
95675
|
const summary = this.todoSummaryText();
|
|
95561
|
-
const hostLine = summary === "" ? "" : color.textDim(`☑ ${summary}
|
|
95676
|
+
const hostLine = summary === "" ? "" : color.textDim(truncateToWidth(`☑ ${summary}`, this.terminal.columns, "…"));
|
|
95562
95677
|
this.extensionHost?.setDockMaxRows(2);
|
|
95563
95678
|
if (this.extensionHost !== void 0) {
|
|
95564
95679
|
this.dock.setText(extensionDock);
|
|
@@ -105672,7 +105787,7 @@ function createSubmissionController(deps) {
|
|
|
105672
105787
|
line: commandLine,
|
|
105673
105788
|
signal: commandSignal
|
|
105674
105789
|
}).then((execution) => {
|
|
105675
|
-
if (execution !== void 0 && execution.result.kind === "error" && execution.result.text !== "" && !deps.isCleanedUp() && deps.scope.isCurrent(scope) && parsedAtSubmit !== void 0 && TSP_B2A_RESULT_NOTICE_COMMANDS.has(parsedAtSubmit.name)) deps.app().notify(execution.result.text, "error");
|
|
105790
|
+
if (execution !== void 0 && execution.result.kind === "error" && execution.result.text !== "" && !deps.isCleanedUp() && deps.scope.isCurrent(scope) && parsedAtSubmit !== void 0 && (TSP_B2A_RESULT_NOTICE_COMMANDS.has(parsedAtSubmit.name) || parsedAtSubmit.name === "keybindings" && execution.result.text.startsWith("Could not open Keyboard shortcuts:"))) deps.app().notify(execution.result.text, "error");
|
|
105676
105791
|
return execution === void 0 ? {
|
|
105677
105792
|
kind: "committed",
|
|
105678
105793
|
matched: false
|
|
@@ -106248,7 +106363,8 @@ function createSubmissionController(deps) {
|
|
|
106248
106363
|
}
|
|
106249
106364
|
const isSessionless = parsed !== void 0 && classification.kind === "client-command" && classification.source === "tui" && SESSIONLESS_COMMANDS.has(parsed.name);
|
|
106250
106365
|
const tuiLocalLine = classification.kind === "client-command";
|
|
106251
|
-
const
|
|
106366
|
+
const needsBusyEnter = parsed === void 0 || parsed.name === "skill" && (parsed.rawInput?.trim() ?? "") !== "" || !tuiLocalLine;
|
|
106367
|
+
const delivery = request === "explicit-queue" ? "queue" : resolveSubmitDelivery(parsed, deps.liveAgent()?.status === "running", request, needsBusyEnter ? deps.tuiSettings?.get().busyEnter : void 0, tuiLocalLine);
|
|
106252
106368
|
if (classification.kind === "host-command") {
|
|
106253
106369
|
settleHoldForLegacyRoute();
|
|
106254
106370
|
dispatchViaSession(text, persistHistory, delivery);
|
|
@@ -131851,7 +131967,7 @@ async function selectRendererMount(deps) {
|
|
|
131851
131967
|
/** The PRODUCTION connector: lazy import + the official SDK connect. */
|
|
131852
131968
|
function productionTspConnector(deps) {
|
|
131853
131969
|
return async () => {
|
|
131854
|
-
const { connectTspRenderer } = await import("./session-
|
|
131970
|
+
const { connectTspRenderer } = await import("./session-CstInGIA.mjs");
|
|
131855
131971
|
return connectTspRenderer(deps);
|
|
131856
131972
|
};
|
|
131857
131973
|
}
|