@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
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { i as TUI_STARTUP_SERVICE } from "./startup-
|
|
1
|
+
import { i as TUI_STARTUP_SERVICE } from "./startup-EG5UqIcd.mjs";
|
|
2
2
|
import { $ as isFocusDisplayPreset, A as discoverForQuery, B as projectedWorkingDirectory, C as HostUserShellSandboxRunnerError, F as resolvePathQuery, G as runDetached, H as cancellationError, I as separatorOfRaw, J as safeErrorString, K as runOwned, L as CANONICAL_TUI_SETTINGS_NS, N as rankPathCandidates, O as parseGitAttributionMode, P as reattachDisplayBase, Q as isDisplayPresetAvailable, R as serializeTuiSettingsMutation, S as HostUserShellOutcomeUnknownError, U as isCancellation, V as isUserInvocableSkill, W as observeSettled, X as parseResponseStyle, Y as parseProgressUpdates, Z as isDisplayPreset, _ as listPiTuiHostFileReferences, b as hostPathQueryEnvironment, et as resolveDisplayPreset, f as HostShellExecutionVeto, g as listPiTuiExplicitHostFileReferences, h as isExplicitHostFileQuery, i as installResponseStyleSection, l as createTerminalProgressInterval, n as installGitAttributionSection, o as liveDisplayTurnPolicy, p as executeHostShellOnce, q as safeErrorMessage, r as installProgressUpdatesSection, t as installFocusSection, u as installTuiPromptTurnLatch, v as OfficialWorkspaceSearchPool, x as resolveFdPath, y as DirectHostDiscoveryDriver, z as effectiveAgentCwd } from "./prompt-sections-DUKmWb8g.mjs";
|
|
3
|
-
import { $ as effectiveWorkflowRunOpen, $r as customItemName, $t as isCompactActionTool, A as summarizeWorkSpan, Ai as appendHistoryRecord, An as findSessionMatch, Ar as FILE_ARGUMENT_COMMANDS, At as isTaskItemActive, B as FocusActivityComponent, Bn as createBuiltinFooterRegistry, Br as SessionScopeSupersededError, Bt as FOLDED_JSON_RESULT_TOOLS, C as proveCaretEdit, Ci as isSurfacedContext, Cn as iconPrefix, Cr as
|
|
3
|
+
import { $ as effectiveWorkflowRunOpen, $r as customItemName, $t as isCompactActionTool, A as summarizeWorkSpan, Ai as appendHistoryRecord, An as findSessionMatch, Ar as FILE_ARGUMENT_COMMANDS, At as isTaskItemActive, B as FocusActivityComponent, Bn as createBuiltinFooterRegistry, Br as SessionScopeSupersededError, Bt as FOLDED_JSON_RESULT_TOOLS, C as proveCaretEdit, Ci as isSurfacedContext, Cn as iconPrefix, Cr as taskStatusColor, Ct as setAssistantVisualPresentation, D as contextClusterSummaryParts, Di as openOpaqueBlockFallbackText, Dn as workspaceKey, Dr as sanitizeDisplayLog, Dt as currentWorkspaceOf, E as FocusTimingStore, Ei as finalizedBlockFallbackText, En as sessionBrowserErrorNotice, Er as singlePhysicalLine, Et as buildSessionWorkspaceView, F as clusterByMemberOf, Fn as pickWelcomeWhaleVariant, Fr as attachmentCountLabel, Ft as subagentJobViewHint, G as compactActionSlotLine, Gn as DELIVERED_FILES_CHORDS, Gr as withSearchCurrentTokens, Gt as compactToolPresentation, H as formatCompactDuration, Hn as tasksItem, Hr as darkColors, Ht as askAnswersLines, I as isFoldableWorkContext, In as renderWelcomeWhaleLines, Ir as queueManagerCommandResult, It as taskRowLabel, J as compactSlotLine, Jn as QUEUE_CHORDS, Jt as foldedResultSummaryFor, K as compactActionStatsSignature, Kn as HISTORY_CHORDS, Kt as firstLine, L as projectTranscriptStructure, Lr as formatBytes, Lt as taskRowSelectionDisposition, Mi as loadHistoryFile, Mn as sessionRowMatchesQuery, Mr as ClientLocalDiscoveryDriver, Mt as projectTaskItems, Ni as loadHistoryRecords, Nn as shortSessionId, Nr as clientPathQueryEnvironment, Nt as rowGroup, O as activityClockOf, Oi as textWithAttachmentMarkers, On as canonicalFullSessionId, Or as sanitizeDisplaySegment, Ot as visibleWorkspaceBrowserRows, P as projectFocus, Pn as WELCOME_WHALE_WIDTH, Pr as QueueManagerController, Pt as subagentJobTranscriptId, Q as effectiveWorkflowPhaseOpen, Qr as customItemId, Qt as imageFoldedPreview, R as workByMemberOf, Rr as SessionOperationBarrier, Rt as taskTreePrefix, S as pastedBodySpan, Si as recentTurnThreshold, Sn as iconLead, Sr as settingsListTheme, St as clearAssistantVisualPresentation, T as isLocalShellCard, Ti as latestLine, Tn as sanitizeTerminalText, Tr as sanitizedPhysicalLine, Tt as SESSION_SOURCE_LABEL, U as compactActionPresentation, Un as FooterItemRegistry, Ur as detectThemeFromBackground, Ut as askAnswersSummary, V as compactActionStatParts, Vn as modelItem, Vr as createSessionScopeAuthority, Vt as GOAL_TOOL_NAMES, W as compactActionSignature, Wn as shortCwd$1, Wr as lightColors, Wt as compactToolExpandedLines, X as createDisplayProjection, Xn as SVG_VIEWER_CHORDS, Xr as activeFooterItemIds, Xt as goalResultLines, Y as compactThinkSlotLine, Yn as SESSION_WORKSPACE_CHORDS, Yr as DEFAULT_CUSTOM_COMMAND_REFRESH_MS, Yt as genericRawInputLines, Z as advanceWorkflowDisclosureState, Zn as SVG_VIEWER_SCROLL_LABEL, Zr as customCommandConfigOf, Zt as goalResultSummary, _i as TranscriptWindowController, _n as writeFoldedPreview, _r as color, _t as FileHistorySearchSource, ai as parseFooterCommandConfig, an as readFoldedPreview, ar as formatKeyId, at as eligibleFinalAssistant, bi as transcriptSearchSourceKey, bn as thinkingPreviewTail, br as selectListTheme, bt as assistantVisualPresentation, ci as resolveUserCommandItemFallbackActivationIds, cn as skillFoldedPreview, cr as parseShellWords, di as TranscriptFolder, dn as toolCardHeader, dr as PROVIDER_DEFAULT, ei as effectiveCustomCommandRefreshMs, en as parseCallPreview, et as workflowCountsText, fi as assistantPresentationRevision, fn as toolIconSemantic, fr as effortChoicesOf, ft as extractInlineSkillPrefix, gi as textOf, gn as webCardLines, gr as HOST_MARKDOWN_OPTIONS, gt as shellPrefixForMode, hi as subCallDisplayStatus, hn as toolTitle, hr as projectModelDirectory, ht as serializedDraftHasPayload, ii as parseFooterCustomItems, in as parseWriteEnvelope, ir as formatHintKeys, it as workflowStatusCounts, j as projectCompact, ji as historyFilePath, jn as sanitizeSessionSearchInput, jr as suggestPathArgument, jt as isTaskItemFailure, k as resolveWorkLifetimes, ki as userBlocksVisibleNow, kn as chooseListedSession, kr as sanitizeDisplayText, kt as workspaceRowStatusLabel, l as toolRowImageBlocks, li as resolveUserLayerFooterMode, ln as subagentModelDisplay, lr as isBuiltInPresetRow, mi as childOwnEvents, mn as toolSummaryKeys, mr as modelIdentity, mt as serializeEditorInput, ni as executableCommandItemIds, nn as parseReadEnvelopes, nt as workflowRunSummaryText, oi as resolveTrustedFooterCommand, on as relativizeToCwd, or as formatLeaderSequence, ot as createInstalledAutocompleteProvider, pi as assistantStepOf, pn as toolPresenterFrom, pr as initialEffortOf, pt as editorModeFromHistoryEntry, q as compactPreparingSummary, qn as JOB_LOCAL_KEYS, qr as resolveTspNativeFooterConfig, qt as foldedCallPreview, ri as parseFooterCustomItem, rn as parseSkillEnvelope, rt as workflowRunViewAllVisible, s as imageIdentityText, si as resolveUserCommandItemActivationIds, sn as resultTextLines, st as classifyFileCompletionContext, ti as effectiveCustomCommandTimeoutMs, tn as parseImageEnvelope, tt as workflowPhasePresentations, u as toolRowProjectsImages, ui as MAX_COMMAND_TIMEOUT_MS, un as systemContextBody, ur as presetDisplayText, vi as rawSourceRangeForNormalizedMatch, vn as fileAttachmentSummary, vr as editorTheme, vt as createHistoryRecallScope, w as candidateImagePathFromPaste, wi as isSurfacedInteractionTool, wn as formatSessionAge, wr as taskStatusWord, wt as SESSION_PENDING_LABEL, x as PasteRangeTracker, xi as workflowReadablePhase, xn as iconFor, xr as setTheme, xt as assistantVisualPresentationRevision, yi as transcriptSearchMatchKey, yn as imageProtocolPreference, yr as markdownTheme, yt as planVisualPlacement, z as contextPresentationKind, zn as FooterCustomItemCatalog, zr as TransitionInProgressError, zt as viewerAccessHint } from "./transcript-view-C1YtJ49Y.mjs";
|
|
4
4
|
import { c as usageFromAssistantSettlement, i as StepUsageAccumulator, n as derivePerformance, o as isAssistantTokenDelta } from "./performance-view-CfGvLZyD.mjs";
|
|
5
5
|
import { A as SVG_MAX_RASTER_SIDE, D as admitSvg, I as humanFacingVisualResult, L as isVisualToolName, T as chartTextRows, a as isModelOnlyReplacement, g as svgDetailRows, j as SVG_RASTER_TIMEOUT_MS, k as SVG_MAX_RASTER_PIXELS, l as visualPartsForStatus, n as asVisualSessionEvents, p as authorizeSvg, r as collectPublishedVisuals, t as VISUAL_TOOLS_STATUS_SERVICE, x as chartDisplayTitle } from "./runtime-status-v-FTnWcD.mjs";
|
|
6
6
|
import { n as dshVersion, t as bundleVersion } from "./version-B9yC7bBk.mjs";
|
|
7
7
|
import { n as runSyncDisposalStepsWithPrimary, t as runSyncDisposalSteps } from "./disposal-BYBbEpVY.mjs";
|
|
8
|
-
import { $ as decodeKittyPrintable, A as canonicalizeKeyId, B as Image, D as parseUserKeybindings, Dt as stripControlChars, E as isTerminalAmbiguousKeyId, Et as resolveCommandFooterFallback, F as CURSOR_MARKER, G as ProcessTerminal, H as Key, J as Spacer$1, K as ScrollView, L as Container, M as isTextProducingKeyId, N as isValidKeyId, O as APP_KEYBINDINGS, P as AltScreenSearchIndex, Q as VStack, R as Editor, S as normalizeInputEvent, St as defaultHideInTsp, T as isPhysicalEscapeAction, Tt as parseFooterLayout, U as Markdown, V as Input, W as MouseRegion, X as TuiAltScreen, Y as Text, Z as TuiMainScreen, _ as isLocalCommandLine, _t as sliceByColumn, at as getCellDimensions, b as normalizeSkillInvocation, bt as visibleWidth, c as HOST_COMMAND_CATALOG, ct as getOsc8LinkAtColumn, d as SESSIONLESS_COMMANDS, dt as isKeyRelease, et as decodePrintableKey, f as SESSION_NAVIGATION_COMMANDS, ft as isKeyRepeat, g as isBareCommandLine, gt as renderFakeCursor, h as commandIsLocalForAttachments, ht as registerKittyImageMetadata, i as PI_TUI_EXTENSIONS_SERVICE, it as getCapabilities, j as isRuntimeBindableKeyId, k as VIEWER_BLOCKED_PARENT_ACTIONS, l as IMMEDIATE_SESSIONLESS_COMMANDS, lt as imageFallback, m as classifyExitIntent, mt as parseKey, nt as findAltScreenSearchMatches, ot as getGraphemeSegmenter, p as classifyCommandLine, pt as matchesKey, q as SettingsList, s as InvalidateBatcher, st as getKeybindings, tt as dispatchMouseEvent, u as LOCAL_COMMANDS, ut as isFocusable, v as isPlainExitPrompt, vt as stripTerminalSequences, w as isEditorSubmitPreSubmitKey, wt as isFooterLayout, x as shouldConsumeAdvertisedMiss, xt as wrapTextWithAnsi, y as localCommandMayWrite, yt as truncateToWidth, z as HStack } from "./extensions-
|
|
8
|
+
import { $ as decodeKittyPrintable, A as canonicalizeKeyId, B as Image, D as parseUserKeybindings, Dt as stripControlChars, E as isTerminalAmbiguousKeyId, Et as resolveCommandFooterFallback, F as CURSOR_MARKER, G as ProcessTerminal, H as Key, J as Spacer$1, K as ScrollView, L as Container, M as isTextProducingKeyId, N as isValidKeyId, O as APP_KEYBINDINGS, P as AltScreenSearchIndex, Q as VStack, R as Editor, S as normalizeInputEvent, St as defaultHideInTsp, T as isPhysicalEscapeAction, Tt as parseFooterLayout, U as Markdown, V as Input, W as MouseRegion, X as TuiAltScreen, Y as Text, Z as TuiMainScreen, _ as isLocalCommandLine, _t as sliceByColumn, at as getCellDimensions, b as normalizeSkillInvocation, bt as visibleWidth, c as HOST_COMMAND_CATALOG, ct as getOsc8LinkAtColumn, d as SESSIONLESS_COMMANDS, dt as isKeyRelease, et as decodePrintableKey, f as SESSION_NAVIGATION_COMMANDS, ft as isKeyRepeat, g as isBareCommandLine, gt as renderFakeCursor, h as commandIsLocalForAttachments, ht as registerKittyImageMetadata, i as PI_TUI_EXTENSIONS_SERVICE, it as getCapabilities, j as isRuntimeBindableKeyId, k as VIEWER_BLOCKED_PARENT_ACTIONS, l as IMMEDIATE_SESSIONLESS_COMMANDS, lt as imageFallback, m as classifyExitIntent, mt as parseKey, nt as findAltScreenSearchMatches, ot as getGraphemeSegmenter, p as classifyCommandLine, pt as matchesKey, q as SettingsList, s as InvalidateBatcher, st as getKeybindings, tt as dispatchMouseEvent, u as LOCAL_COMMANDS, ut as isFocusable, v as isPlainExitPrompt, vt as stripTerminalSequences, w as isEditorSubmitPreSubmitKey, wt as isFooterLayout, x as shouldConsumeAdvertisedMiss, xt as wrapTextWithAnsi, y as localCommandMayWrite, yt as truncateToWidth, z as HStack } from "./extensions-B4uLpSTv.mjs";
|
|
9
9
|
import { t as openExternalUrl } from "./open-CmOBxSjN.mjs";
|
|
10
|
-
import { C as listKernelGroupMembers, D as sameKernelProcess, T as readKernelProcess, b as readInstalledDshVersion, u as resolveProfilePackageRoot } from "./daemon-launcher-
|
|
10
|
+
import { C as listKernelGroupMembers, D as sameKernelProcess, T as readKernelProcess, b as readInstalledDshVersion, u as resolveProfilePackageRoot } from "./daemon-launcher-Dult7Jxv.mjs";
|
|
11
11
|
import { n as PREFERENCE_FIELD_NAMES, r as PreferencesConfig, t as Config } from "./schema-qE_P09zJ.mjs";
|
|
12
12
|
import { createRequire } from "node:module";
|
|
13
13
|
import { accessSync, closeSync, constants, existsSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync, writeSync } from "node:fs";
|
|
@@ -5037,7 +5037,8 @@ const TSP_B2A_RESULT_NOTICE_COMMANDS = /* @__PURE__ */ new Set([
|
|
|
5037
5037
|
"search",
|
|
5038
5038
|
"logout",
|
|
5039
5039
|
"reload-client",
|
|
5040
|
-
"queue"
|
|
5040
|
+
"queue",
|
|
5041
|
+
"skill"
|
|
5041
5042
|
]);
|
|
5042
5043
|
/**
|
|
5043
5044
|
* Whether one ALREADY-AUTHORITATIVELY-SELECTED TUI builtin can run on the TSP
|
|
@@ -5185,122 +5186,6 @@ function registerExitCommand({ runner, registerTuiCommand }) {
|
|
|
5185
5186
|
handler: exitHandler
|
|
5186
5187
|
});
|
|
5187
5188
|
}
|
|
5188
|
-
/** `/help` — the effective keymap plus the current scoped command list. */
|
|
5189
|
-
function registerHelpCommand({ runner, registerOne }) {
|
|
5190
|
-
const app = runner.app;
|
|
5191
|
-
registerOne({
|
|
5192
|
-
name: "help",
|
|
5193
|
-
description: "Show keybindings and available commands",
|
|
5194
|
-
handler: () => {
|
|
5195
|
-
if (app === void 0) return {
|
|
5196
|
-
kind: "error",
|
|
5197
|
-
text: "keymap labels are unavailable in this renderer"
|
|
5198
|
-
};
|
|
5199
|
-
const keybindings = app.keybindingsManager();
|
|
5200
|
-
const keysLabel = (action) => {
|
|
5201
|
-
const label = keybindings.keysLabelFor(action);
|
|
5202
|
-
return label === "" ? "—" : label;
|
|
5203
|
-
};
|
|
5204
|
-
const rows = [
|
|
5205
|
-
{
|
|
5206
|
-
id: "k-enter",
|
|
5207
|
-
label: keysLabel("app.input.submit"),
|
|
5208
|
-
description: "Submit the draft; while the agent is busy, delivery follows the \"Submit while busy\" preference (skill commands steer too, UI commands run locally)",
|
|
5209
|
-
currentValue: ""
|
|
5210
|
-
},
|
|
5211
|
-
{
|
|
5212
|
-
id: "k-queue",
|
|
5213
|
-
label: keysLabel("app.input.submitAccelerated"),
|
|
5214
|
-
description: "Submit with the OPPOSITE of the \"Submit while busy\" behavior (the web accelerated-submit chord)",
|
|
5215
|
-
currentValue: ""
|
|
5216
|
-
},
|
|
5217
|
-
{
|
|
5218
|
-
id: "k-exit",
|
|
5219
|
-
label: keysLabel("app.exit.request"),
|
|
5220
|
-
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)",
|
|
5221
|
-
currentValue: ""
|
|
5222
|
-
},
|
|
5223
|
-
{
|
|
5224
|
-
id: "k-cancel",
|
|
5225
|
-
label: keysLabel("app.agent.interrupt"),
|
|
5226
|
-
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)",
|
|
5227
|
-
currentValue: ""
|
|
5228
|
-
},
|
|
5229
|
-
{
|
|
5230
|
-
id: "k-fold",
|
|
5231
|
-
label: keysLabel("app.transcript.toggleExpand"),
|
|
5232
|
-
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")}`,
|
|
5233
|
-
currentValue: ""
|
|
5234
|
-
},
|
|
5235
|
-
{
|
|
5236
|
-
id: "k-todo",
|
|
5237
|
-
label: keysLabel("app.todo.toggle"),
|
|
5238
|
-
description: "Toggle the todo panel",
|
|
5239
|
-
currentValue: ""
|
|
5240
|
-
},
|
|
5241
|
-
{
|
|
5242
|
-
id: "k-think",
|
|
5243
|
-
label: keysLabel("app.transcript.toggleThinking"),
|
|
5244
|
-
description: "Expand/collapse thinking detail (detail level — blocks stay visible)",
|
|
5245
|
-
currentValue: ""
|
|
5246
|
-
},
|
|
5247
|
-
{
|
|
5248
|
-
id: "k-steer",
|
|
5249
|
-
label: keysLabel("app.input.steer"),
|
|
5250
|
-
description: "Steer the running turn with the draft",
|
|
5251
|
-
currentValue: ""
|
|
5252
|
-
},
|
|
5253
|
-
{
|
|
5254
|
-
id: "k-editor",
|
|
5255
|
-
label: keysLabel("app.editor.external"),
|
|
5256
|
-
description: "Edit the draft in $VISUAL/$EDITOR",
|
|
5257
|
-
currentValue: ""
|
|
5258
|
-
},
|
|
5259
|
-
{
|
|
5260
|
-
id: "k-search",
|
|
5261
|
-
label: keysLabel("app.transcript.search"),
|
|
5262
|
-
description: `Search the transcript (${keysLabel("app.transcript.search.next")}/${keysLabel("app.transcript.search.previous")} jump, ${keysLabel("app.transcript.search.close")} closes)`,
|
|
5263
|
-
currentValue: ""
|
|
5264
|
-
},
|
|
5265
|
-
{
|
|
5266
|
-
id: "k-tab",
|
|
5267
|
-
label: "Tab",
|
|
5268
|
-
description: "Autocomplete slash commands and file paths",
|
|
5269
|
-
currentValue: ""
|
|
5270
|
-
},
|
|
5271
|
-
{
|
|
5272
|
-
id: "k-hist",
|
|
5273
|
-
label: "↑/↓",
|
|
5274
|
-
description: "Recall input history on an empty line",
|
|
5275
|
-
currentValue: ""
|
|
5276
|
-
},
|
|
5277
|
-
{
|
|
5278
|
-
id: "k-bang",
|
|
5279
|
-
label: "! cmd",
|
|
5280
|
-
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",
|
|
5281
|
-
currentValue: ""
|
|
5282
|
-
},
|
|
5283
|
-
{
|
|
5284
|
-
id: "sep-help",
|
|
5285
|
-
label: color.border("─".repeat(34)),
|
|
5286
|
-
currentValue: ""
|
|
5287
|
-
},
|
|
5288
|
-
...runner.listScopedCommands().map((command) => ({
|
|
5289
|
-
id: `cmd-${command.name}`,
|
|
5290
|
-
label: `/${command.name}`,
|
|
5291
|
-
description: command.description,
|
|
5292
|
-
currentValue: ""
|
|
5293
|
-
}))
|
|
5294
|
-
];
|
|
5295
|
-
if (app === void 0) return {
|
|
5296
|
-
kind: "error",
|
|
5297
|
-
text: "the settings panel is unavailable in this renderer"
|
|
5298
|
-
};
|
|
5299
|
-
app.openSettings(rows, () => {}, () => {});
|
|
5300
|
-
return { kind: "success" };
|
|
5301
|
-
}
|
|
5302
|
-
});
|
|
5303
|
-
}
|
|
5304
5189
|
//#endregion
|
|
5305
5190
|
//#region src/tui/commands/tasks.ts
|
|
5306
5191
|
/** `/tasks` (`/subagents`) — the merged Task Center browser behind the
|
|
@@ -8032,60 +7917,22 @@ function createModelCommands(deps) {
|
|
|
8032
7917
|
}
|
|
8033
7918
|
//#endregion
|
|
8034
7919
|
//#region src/tui/commands/skills.ts
|
|
8035
|
-
/** /skill — load one skill into the live session
|
|
7920
|
+
/** /skill — load one explicit skill into the live session. */
|
|
8036
7921
|
function registerSkillCommand(deps) {
|
|
8037
|
-
const { runner,
|
|
7922
|
+
const { runner, registerOne, loadSkill, takeDelivery, splitSkillLine } = deps;
|
|
8038
7923
|
registerOne({
|
|
8039
7924
|
name: "skill",
|
|
8040
7925
|
description: "Load a skill into the session context",
|
|
8041
7926
|
input: { hint: "<name>" },
|
|
8042
7927
|
handler: async (invocation) => {
|
|
8043
7928
|
const delivery = takeDelivery();
|
|
8044
|
-
const scope = await runner.requireLiveSessionScope();
|
|
8045
7929
|
const [name, ...args] = splitSkillLine(invocation.rawInput);
|
|
8046
|
-
if (name
|
|
8047
|
-
let catalog;
|
|
8048
|
-
try {
|
|
8049
|
-
catalog = await runner.listScopedSkills(scope, runner.signal);
|
|
8050
|
-
} catch (error) {
|
|
8051
|
-
if (error instanceof SupersededReadError) return {
|
|
8052
|
-
kind: "error",
|
|
8053
|
-
text: "the session changed while loading skills — try again"
|
|
8054
|
-
};
|
|
8055
|
-
throw error;
|
|
8056
|
-
}
|
|
8057
|
-
if (catalog === void 0) return {
|
|
7930
|
+
if (name === "") return {
|
|
8058
7931
|
kind: "error",
|
|
8059
|
-
text: "skill
|
|
7932
|
+
text: "Usage: /skill <name> [args]. Type / to discover available skills."
|
|
8060
7933
|
};
|
|
8061
|
-
|
|
8062
|
-
|
|
8063
|
-
text: "no skills available"
|
|
8064
|
-
};
|
|
8065
|
-
app.openSettings(catalog.skills.map((skill) => ({
|
|
8066
|
-
id: skill.name,
|
|
8067
|
-
label: abbreviateName$1(skill.name, 34),
|
|
8068
|
-
searchText: skill.name,
|
|
8069
|
-
description: skill.description === "" ? skill.name : `${skill.name} — ${skill.description}`,
|
|
8070
|
-
currentValue: "",
|
|
8071
|
-
values: ["✓"]
|
|
8072
|
-
})), (id) => {
|
|
8073
|
-
let running;
|
|
8074
|
-
try {
|
|
8075
|
-
running = runner.currentSessionActivity(scope).running;
|
|
8076
|
-
} catch (error) {
|
|
8077
|
-
if (error instanceof SupersededReadError) {
|
|
8078
|
-
app.notify("the session changed while loading skills — try again", "error");
|
|
8079
|
-
return;
|
|
8080
|
-
}
|
|
8081
|
-
throw error;
|
|
8082
|
-
}
|
|
8083
|
-
const delivery = resolveComposerDelivery(running, "enter", runner.tuiSettings?.get().busyEnter);
|
|
8084
|
-
detach("skill load", () => loadSkill(scope, id, "", runner.signal, delivery).then((result) => {
|
|
8085
|
-
if (result.kind === "error") app.notify(result.text);
|
|
8086
|
-
}), { notify: true });
|
|
8087
|
-
}, () => {});
|
|
8088
|
-
return { kind: "success" };
|
|
7934
|
+
const scope = await runner.requireLiveSessionScope();
|
|
7935
|
+
return loadSkill(scope, name, args.join(" "), invocation.signal ?? runner.signal, delivery, invocation.commandId);
|
|
8089
7936
|
}
|
|
8090
7937
|
});
|
|
8091
7938
|
}
|
|
@@ -10615,48 +10462,66 @@ function selectedLine(label, selected, width) {
|
|
|
10615
10462
|
return truncateToWidth(text, Math.max(1, width));
|
|
10616
10463
|
}
|
|
10617
10464
|
/** Keep the selected binding visible in a short terminal while retaining the
|
|
10618
|
-
* detail footer.
|
|
10619
|
-
*
|
|
10620
|
-
|
|
10465
|
+
* detail footer. An optional conflict-diagnostic prefix is PINNED above the
|
|
10466
|
+
* scroll window: the counterpart must stay readable even when the grant is
|
|
10467
|
+
* too short to show the whole detail. */
|
|
10468
|
+
function actionViewport(lines, selectedLineIndex, maxRows, selectableLineIndices = [], pinnedRange) {
|
|
10621
10469
|
const limit = Math.max(1, maxRows);
|
|
10622
|
-
|
|
10623
|
-
|
|
10624
|
-
|
|
10625
|
-
|
|
10470
|
+
const footer = lines[lines.length - 1];
|
|
10471
|
+
let content = lines.slice(0, -1);
|
|
10472
|
+
let selected = selectedLineIndex;
|
|
10473
|
+
let selectableIndices = [...selectableLineIndices];
|
|
10474
|
+
let pinned = [];
|
|
10475
|
+
if (pinnedRange !== void 0 && pinnedRange.count > 0) {
|
|
10476
|
+
pinned = content.slice(pinnedRange.start, pinnedRange.start + pinnedRange.count);
|
|
10477
|
+
content = content.slice(0, pinnedRange.start).concat(content.slice(pinnedRange.start + pinnedRange.count));
|
|
10478
|
+
const before = pinnedRange.start + pinnedRange.count;
|
|
10479
|
+
selectableIndices = selectableIndices.map((index) => index >= before ? index - pinnedRange.count : index);
|
|
10480
|
+
selected = selected === void 0 ? void 0 : selected >= before ? selected - pinnedRange.count : selected;
|
|
10481
|
+
}
|
|
10482
|
+
if (pinned.length + content.length + 1 <= limit) return {
|
|
10483
|
+
lines: [
|
|
10484
|
+
...pinned,
|
|
10485
|
+
...content,
|
|
10486
|
+
footer
|
|
10487
|
+
],
|
|
10488
|
+
selectableRows: selectableIndices.map((row, ordinal) => ({
|
|
10489
|
+
row: row + pinned.length,
|
|
10626
10490
|
ordinal
|
|
10627
10491
|
}))
|
|
10628
10492
|
};
|
|
10629
|
-
|
|
10630
|
-
|
|
10631
|
-
lines: [footer],
|
|
10493
|
+
if (limit - pinned.length - 1 < 1) return {
|
|
10494
|
+
lines: [...pinned.slice(0, Math.max(0, limit - 1)), footer],
|
|
10632
10495
|
selectableRows: []
|
|
10633
10496
|
};
|
|
10634
|
-
const
|
|
10635
|
-
|
|
10636
|
-
lines: [footer],
|
|
10637
|
-
selectableRows: []
|
|
10638
|
-
};
|
|
10639
|
-
const windowSize = Math.max(1, limit - 1);
|
|
10640
|
-
const selected = selectedLineIndex === void 0 ? Math.min(content.length - 1, Math.floor(windowSize / 2)) : Math.min(content.length - 1, Math.max(0, selectedLineIndex));
|
|
10497
|
+
const windowSize = limit - pinned.length - 1;
|
|
10498
|
+
const chosen = selected === void 0 ? Math.min(content.length - 1, Math.floor(windowSize / 2)) : Math.min(content.length - 1, Math.max(0, selected));
|
|
10641
10499
|
const maxStart = Math.max(0, content.length - windowSize);
|
|
10642
|
-
const start = Math.min(maxStart, Math.max(0,
|
|
10500
|
+
const start = Math.min(maxStart, Math.max(0, chosen - Math.floor(windowSize / 2)));
|
|
10643
10501
|
const end = Math.min(content.length, start + windowSize);
|
|
10644
10502
|
const viewport = content.slice(start, end);
|
|
10645
|
-
let selectableRows =
|
|
10503
|
+
let selectableRows = selectableIndices.map((index, ordinal) => ({
|
|
10646
10504
|
row: index - start,
|
|
10647
10505
|
ordinal
|
|
10648
10506
|
})).filter((entry) => entry.row >= 0 && entry.row < viewport.length);
|
|
10649
|
-
if (start > 0 &&
|
|
10507
|
+
if (start > 0 && chosen > start) {
|
|
10650
10508
|
viewport[0] = color.textDim(`↑ ${start} more lines`);
|
|
10651
10509
|
selectableRows = selectableRows.filter((entry) => entry.row !== 0);
|
|
10652
10510
|
}
|
|
10653
|
-
if (end < content.length &&
|
|
10511
|
+
if (end < content.length && chosen < end - 1) {
|
|
10654
10512
|
viewport[viewport.length - 1] = color.textDim(`↓ ${content.length - end} more lines`);
|
|
10655
10513
|
selectableRows = selectableRows.filter((entry) => entry.row !== viewport.length - 1);
|
|
10656
10514
|
}
|
|
10657
10515
|
return {
|
|
10658
|
-
lines: [
|
|
10659
|
-
|
|
10516
|
+
lines: [
|
|
10517
|
+
...pinned,
|
|
10518
|
+
...viewport,
|
|
10519
|
+
footer
|
|
10520
|
+
],
|
|
10521
|
+
selectableRows: selectableRows.map((entry) => ({
|
|
10522
|
+
row: entry.row + pinned.length,
|
|
10523
|
+
ordinal: entry.ordinal
|
|
10524
|
+
}))
|
|
10660
10525
|
};
|
|
10661
10526
|
}
|
|
10662
10527
|
var ActionEditorPanel = class {
|
|
@@ -10669,6 +10534,7 @@ var ActionEditorPanel = class {
|
|
|
10669
10534
|
maxRows;
|
|
10670
10535
|
mode = "edit";
|
|
10671
10536
|
selectedIndex = 0;
|
|
10537
|
+
conflictScroll = 0;
|
|
10672
10538
|
recorder;
|
|
10673
10539
|
pending = false;
|
|
10674
10540
|
/** A settlement whose result has NOT been painted yet. The page keeps the
|
|
@@ -10678,6 +10544,7 @@ var ActionEditorPanel = class {
|
|
|
10678
10544
|
mutationGeneration = 0;
|
|
10679
10545
|
disposed = false;
|
|
10680
10546
|
message;
|
|
10547
|
+
messageKind;
|
|
10681
10548
|
/** Physical row → hit entry from the LAST render (mouse parity). */
|
|
10682
10549
|
hitMap = [];
|
|
10683
10550
|
/** The pressed binding identity (mouse parity): a click may only act on
|
|
@@ -10702,6 +10569,8 @@ var ActionEditorPanel = class {
|
|
|
10702
10569
|
* content columns). Cleared on every render start, so a sub-view that paints
|
|
10703
10570
|
* its own bar can never leave the previous frame's geometry clickable. */
|
|
10704
10571
|
paintedEscapeSpanValue;
|
|
10572
|
+
/** The delegated non-Esc Action Bar spans this page painted. */
|
|
10573
|
+
paintedBarSpansValue = [];
|
|
10705
10574
|
constructor(options) {
|
|
10706
10575
|
this.model = options.model;
|
|
10707
10576
|
this.row = options.action;
|
|
@@ -10728,16 +10597,71 @@ var ActionEditorPanel = class {
|
|
|
10728
10597
|
paintedEscapeSpan() {
|
|
10729
10598
|
return this.paintedEscapeSpanValue;
|
|
10730
10599
|
}
|
|
10600
|
+
/** The delegated `c details` Action Bar span, in this page's columns. */
|
|
10601
|
+
paintedBarSpans() {
|
|
10602
|
+
return this.paintedBarSpansValue;
|
|
10603
|
+
}
|
|
10604
|
+
/** Open the readonly conflict reader from the painted bar span. */
|
|
10605
|
+
activateBarSpan(id) {
|
|
10606
|
+
if (id !== "conflict-details") return;
|
|
10607
|
+
if (this.mode !== "edit" || this.conflictDiagnostics().length === 0) return;
|
|
10608
|
+
this.mode = "conflict-details";
|
|
10609
|
+
this.conflictScroll = 0;
|
|
10610
|
+
this.requestRender();
|
|
10611
|
+
}
|
|
10612
|
+
/** Only a genuinely conflicted row may enter the Conflict details reader;
|
|
10613
|
+
* ordinary disabled/ambiguous diagnostics keep their inline presentation. */
|
|
10614
|
+
conflictDiagnostics() {
|
|
10615
|
+
if (!this.row.conflict) return [];
|
|
10616
|
+
return this.row.diagnostics.filter((message) => message.includes("conflict") || message.includes("ambiguous"));
|
|
10617
|
+
}
|
|
10731
10618
|
render(width) {
|
|
10732
10619
|
const safeWidth = Math.max(1, width);
|
|
10733
10620
|
this.settlementAwaitingPaint = false;
|
|
10734
10621
|
this.paintedEscapeSpanValue = void 0;
|
|
10622
|
+
this.paintedBarSpansValue = [];
|
|
10735
10623
|
if (this.recorder !== void 0) {
|
|
10736
10624
|
const lines = this.recorder.render(safeWidth);
|
|
10737
10625
|
this.paintedEscapeSpanValue = this.recorder.paintedEscapeSpan();
|
|
10738
10626
|
return lines;
|
|
10739
10627
|
}
|
|
10740
10628
|
if (this.mode === "choose-binding") return this.renderBindingChoice(safeWidth);
|
|
10629
|
+
if (this.mode === "conflict-details") return this.renderConflictDetails(safeWidth);
|
|
10630
|
+
if (this.maxRows() === 1 && this.message !== void 0) {
|
|
10631
|
+
this.hitMap = [{ kind: "inert" }];
|
|
10632
|
+
this.hasPainted = true;
|
|
10633
|
+
this.paintedBodyRows = 0;
|
|
10634
|
+
this.paintedSelection = false;
|
|
10635
|
+
this.paintedAdd = false;
|
|
10636
|
+
this.paintedChoice = false;
|
|
10637
|
+
this.selectableKeys = [];
|
|
10638
|
+
this.lastRenderWidth = Math.max(1, width);
|
|
10639
|
+
this.paintedBarSpansValue = [];
|
|
10640
|
+
const escape = "Back [Esc]";
|
|
10641
|
+
const escapeWidth = visibleWidth(escape);
|
|
10642
|
+
if (safeWidth < escapeWidth) {
|
|
10643
|
+
this.paintedEscapeSpanValue = void 0;
|
|
10644
|
+
const painted = this.messageKind === "success" ? color.success(this.message) : color.error(this.message);
|
|
10645
|
+
return [truncateToWidth(painted, safeWidth)];
|
|
10646
|
+
}
|
|
10647
|
+
if (safeWidth < escapeWidth + 3) {
|
|
10648
|
+
const marker = safeWidth >= escapeWidth + 2 && this.messageKind === "success" ? "✓ " : safeWidth >= escapeWidth + 2 ? "! " : "";
|
|
10649
|
+
const startCol = visibleWidth(marker);
|
|
10650
|
+
this.paintedEscapeSpanValue = {
|
|
10651
|
+
startCol,
|
|
10652
|
+
endCol: startCol + escapeWidth
|
|
10653
|
+
};
|
|
10654
|
+
return [truncateToWidth(`${marker === "" ? "" : this.messageKind === "success" ? color.success(marker) : color.error(marker)}${paintActionSpan$2(escape, "secondary")}`, safeWidth)];
|
|
10655
|
+
}
|
|
10656
|
+
const message = truncateToWidth(this.message, safeWidth - escapeWidth - 3);
|
|
10657
|
+
const startCol = visibleWidth(message) + 3;
|
|
10658
|
+
this.paintedEscapeSpanValue = {
|
|
10659
|
+
startCol,
|
|
10660
|
+
endCol: startCol + escapeWidth
|
|
10661
|
+
};
|
|
10662
|
+
const paintedMessage = this.messageKind === "success" ? color.success(message) : color.error(message);
|
|
10663
|
+
return [truncateToWidth(`${paintedMessage}${color.textDim(" · ")}${paintActionSpan$2(escape, "secondary")}`, safeWidth)];
|
|
10664
|
+
}
|
|
10741
10665
|
const lines = [color.textStrong(this.row.label), ""];
|
|
10742
10666
|
const selectableLineIndices = [];
|
|
10743
10667
|
lines.push(...wrapTextWithAnsi(this.row.description, safeWidth).map((line) => color.text(line)));
|
|
@@ -10788,10 +10712,15 @@ var ActionEditorPanel = class {
|
|
|
10788
10712
|
const baselineOrdinary = this.row.customized ? configuredOrdinary : this.row.defaults;
|
|
10789
10713
|
if (this.row.configurable && !sameBindingList(effectiveOrdinary, baselineOrdinary)) lines.push(color.textDim(`Effective now: ${formatEditorBindings(effectiveOrdinary)}`));
|
|
10790
10714
|
if (this.row.diagnostics.length > 0) for (const diagnostic of this.row.diagnostics.slice(0, 2)) lines.push(color.warning(truncateToWidth(diagnostic, safeWidth)));
|
|
10715
|
+
const messageStart = lines.length;
|
|
10791
10716
|
if (this.message !== void 0) lines.push(color.error(truncateToWidth(this.message, safeWidth)));
|
|
10717
|
+
const messageCount = lines.length - messageStart;
|
|
10792
10718
|
if (this.pending) lines.push(color.accent("Saving…"));
|
|
10793
10719
|
lines.push("");
|
|
10794
|
-
const viewport = actionViewport(lines, selectableLineIndices[this.selectedIndex], this.maxRows(), selectableLineIndices
|
|
10720
|
+
const viewport = actionViewport(lines, selectableLineIndices[this.selectedIndex], this.maxRows(), selectableLineIndices, messageCount > 0 ? {
|
|
10721
|
+
start: messageStart,
|
|
10722
|
+
count: messageCount
|
|
10723
|
+
} : void 0);
|
|
10795
10724
|
this.lastRenderWidth = safeWidth;
|
|
10796
10725
|
this.hasPainted = true;
|
|
10797
10726
|
const visibleOrdinals = new Set(viewport.selectableRows.map((row) => row.ordinal));
|
|
@@ -10800,6 +10729,13 @@ var ActionEditorPanel = class {
|
|
|
10800
10729
|
const addOrdinal = this.selectableKeys.indexOf("add");
|
|
10801
10730
|
this.paintedAdd = addOrdinal >= 0 && visibleOrdinals.has(addOrdinal);
|
|
10802
10731
|
const bar = this.actionBar(editable.length, safeWidth);
|
|
10732
|
+
const conflictLabel = "c details";
|
|
10733
|
+
const conflictStart = bar.text.indexOf(conflictLabel);
|
|
10734
|
+
this.paintedBarSpansValue = conflictStart < 0 ? [] : [{
|
|
10735
|
+
id: "conflict-details",
|
|
10736
|
+
startCol: conflictStart,
|
|
10737
|
+
endCol: conflictStart + visibleWidth(conflictLabel)
|
|
10738
|
+
}];
|
|
10803
10739
|
this.paintedEscapeSpanValue = bar.escape;
|
|
10804
10740
|
viewport.lines[viewport.lines.length - 1] = paintWholeBar(bar, safeWidth);
|
|
10805
10741
|
this.hitMap = viewport.lines.map((_, row) => {
|
|
@@ -10817,9 +10753,10 @@ var ActionEditorPanel = class {
|
|
|
10817
10753
|
* cannot show is not advertised, and a bar-only grant keeps only Esc. */
|
|
10818
10754
|
actionBar(editableLength, width) {
|
|
10819
10755
|
if (this.pending) return plainWording$2("Saving… · one write at a time");
|
|
10756
|
+
const conflicts = this.conflictDiagnostics().length > 0 ? "c details" : void 0;
|
|
10820
10757
|
if (this.paintedBodyRows === 0) return escapeWording$3("", "Back");
|
|
10821
|
-
if (this.row.fixed || this.row.reserved || this.row.safeMode) return escapeWording$3("", "Back");
|
|
10822
|
-
if (!this.row.configurable) return escapeWording$3("", "Back");
|
|
10758
|
+
if (this.row.fixed || this.row.reserved || this.row.safeMode) return escapeWording$3(conflicts ?? "", "Back");
|
|
10759
|
+
if (!this.row.configurable) return escapeWording$3(conflicts ?? "", "Back");
|
|
10823
10760
|
const selectedBinding = this.selectedIndex < editableLength;
|
|
10824
10761
|
const primary = selectedBinding ? this.paintedSelection ? "Enter edit" : void 0 : this.paintedAdd ? "Enter add" : void 0;
|
|
10825
10762
|
const add = this.paintedAdd ? "a add" : void 0;
|
|
@@ -10828,6 +10765,7 @@ var ActionEditorPanel = class {
|
|
|
10828
10765
|
return pickWording$1([
|
|
10829
10766
|
variant([
|
|
10830
10767
|
primary,
|
|
10768
|
+
conflicts,
|
|
10831
10769
|
add,
|
|
10832
10770
|
remove,
|
|
10833
10771
|
"r reset",
|
|
@@ -10835,18 +10773,25 @@ var ActionEditorPanel = class {
|
|
|
10835
10773
|
]),
|
|
10836
10774
|
variant([
|
|
10837
10775
|
primary,
|
|
10776
|
+
conflicts,
|
|
10838
10777
|
add,
|
|
10839
10778
|
"r reset",
|
|
10840
10779
|
"d disable"
|
|
10841
10780
|
]),
|
|
10842
10781
|
variant([
|
|
10843
10782
|
primary,
|
|
10783
|
+
conflicts,
|
|
10844
10784
|
add,
|
|
10845
10785
|
"r reset"
|
|
10846
10786
|
]),
|
|
10847
|
-
variant([
|
|
10787
|
+
variant([
|
|
10788
|
+
primary,
|
|
10789
|
+
conflicts,
|
|
10790
|
+
add
|
|
10791
|
+
]),
|
|
10792
|
+
variant([primary, conflicts]),
|
|
10848
10793
|
variant([primary]),
|
|
10849
|
-
escapeWording$3("r reset · d disable", "Back"),
|
|
10794
|
+
escapeWording$3(conflicts ?? "r reset · d disable", "Back"),
|
|
10850
10795
|
escapeWording$3("", "Back")
|
|
10851
10796
|
], width, "Esc back");
|
|
10852
10797
|
}
|
|
@@ -10871,6 +10816,20 @@ var ActionEditorPanel = class {
|
|
|
10871
10816
|
}
|
|
10872
10817
|
if (this.hasPainted && this.paintedBodyRows === 0 && !matchesKey(data, "escape")) return;
|
|
10873
10818
|
if (this.pending || this.settlementAwaitingPaint) return;
|
|
10819
|
+
if (this.mode === "conflict-details") {
|
|
10820
|
+
this.handleConflictDetailsInput(data);
|
|
10821
|
+
return;
|
|
10822
|
+
}
|
|
10823
|
+
if (this.mode === "choose-binding") {
|
|
10824
|
+
this.handleBindingChoice(data);
|
|
10825
|
+
return;
|
|
10826
|
+
}
|
|
10827
|
+
if (commandKey$1(data, "c") && this.conflictDiagnostics().length > 0) {
|
|
10828
|
+
this.mode = "conflict-details";
|
|
10829
|
+
this.conflictScroll = 0;
|
|
10830
|
+
this.requestRender();
|
|
10831
|
+
return;
|
|
10832
|
+
}
|
|
10874
10833
|
if (this.row.safeMode) {
|
|
10875
10834
|
if (matchesKey(data, "escape")) {
|
|
10876
10835
|
this.dispose();
|
|
@@ -10878,10 +10837,6 @@ var ActionEditorPanel = class {
|
|
|
10878
10837
|
}
|
|
10879
10838
|
return;
|
|
10880
10839
|
}
|
|
10881
|
-
if (this.mode === "choose-binding") {
|
|
10882
|
-
this.handleBindingChoice(data);
|
|
10883
|
-
return;
|
|
10884
|
-
}
|
|
10885
10840
|
if (matchesKey(data, "escape")) {
|
|
10886
10841
|
this.dispose();
|
|
10887
10842
|
this.onBack();
|
|
@@ -10965,6 +10920,16 @@ var ActionEditorPanel = class {
|
|
|
10965
10920
|
if (event.width !== this.lastRenderWidth) return void 0;
|
|
10966
10921
|
if (this.recorder !== void 0) return void 0;
|
|
10967
10922
|
if (this.pending || this.settlementAwaitingPaint) return void 0;
|
|
10923
|
+
if (this.mode === "conflict-details") {
|
|
10924
|
+
if (event.type === "wheel" && event.wheelDelta) {
|
|
10925
|
+
this.scrollConflictDetails(event.wheelDelta < 0 ? -1 : 1);
|
|
10926
|
+
return {
|
|
10927
|
+
handled: true,
|
|
10928
|
+
render: true
|
|
10929
|
+
};
|
|
10930
|
+
}
|
|
10931
|
+
return;
|
|
10932
|
+
}
|
|
10968
10933
|
const hit = this.hitMap[event.y];
|
|
10969
10934
|
if (!hit || hit.kind === "inert") return void 0;
|
|
10970
10935
|
if (event.type === "wheel" && event.wheelDelta) {
|
|
@@ -11026,7 +10991,72 @@ var ActionEditorPanel = class {
|
|
|
11026
10991
|
} else this.startRecorder(editable[this.selectedIndex].kind, editable[this.selectedIndex]);
|
|
11027
10992
|
return { handled: true };
|
|
11028
10993
|
}
|
|
10994
|
+
/** The read-only diagnostic reader: every wrapped conflict line is
|
|
10995
|
+
* reachable with Up/Down/PgUp/PgDn and the only bar action is Back. */
|
|
10996
|
+
renderConflictDetails(width) {
|
|
10997
|
+
this.paintedBarSpansValue = [];
|
|
10998
|
+
const lines = [color.textStrong(`Conflict details · ${this.row.label}`), ""];
|
|
10999
|
+
for (const diagnostic of this.conflictDiagnostics()) for (const line of wrapTextWithAnsi(diagnostic, width)) lines.push(color.warning(line));
|
|
11000
|
+
const bar = escapeWording$3("", "Back");
|
|
11001
|
+
const limit = Math.max(1, this.maxRows());
|
|
11002
|
+
if (limit === 1) {
|
|
11003
|
+
this.hitMap = [];
|
|
11004
|
+
this.hasPainted = true;
|
|
11005
|
+
this.paintedBodyRows = 0;
|
|
11006
|
+
this.paintedSelection = false;
|
|
11007
|
+
this.paintedAdd = false;
|
|
11008
|
+
this.paintedChoice = false;
|
|
11009
|
+
this.selectableKeys = [];
|
|
11010
|
+
this.lastRenderWidth = Math.max(1, width);
|
|
11011
|
+
this.paintedEscapeSpanValue = bar.escape;
|
|
11012
|
+
return [paintBarWording$2(bar)];
|
|
11013
|
+
}
|
|
11014
|
+
const bodyLimit = limit - 1;
|
|
11015
|
+
const maxStart = Math.max(0, lines.length - bodyLimit);
|
|
11016
|
+
this.conflictScroll = Math.min(Math.max(0, this.conflictScroll), maxStart);
|
|
11017
|
+
const body = lines.slice(this.conflictScroll, this.conflictScroll + bodyLimit);
|
|
11018
|
+
const rendered = [...body, paintBarWording$2(bar)];
|
|
11019
|
+
this.hitMap = rendered.map(() => ({ kind: "inert" }));
|
|
11020
|
+
this.hasPainted = true;
|
|
11021
|
+
this.paintedBodyRows = body.length;
|
|
11022
|
+
this.paintedSelection = false;
|
|
11023
|
+
this.paintedAdd = false;
|
|
11024
|
+
this.paintedChoice = false;
|
|
11025
|
+
this.selectableKeys = [];
|
|
11026
|
+
this.lastRenderWidth = Math.max(1, width);
|
|
11027
|
+
this.paintedEscapeSpanValue = bar.escape;
|
|
11028
|
+
return rendered.map((line) => truncateToWidth(line, Math.max(1, width)));
|
|
11029
|
+
}
|
|
11030
|
+
handleConflictDetailsInput(data) {
|
|
11031
|
+
if (matchesKey(data, "escape")) {
|
|
11032
|
+
this.mode = "edit";
|
|
11033
|
+
this.conflictScroll = 0;
|
|
11034
|
+
this.requestRender();
|
|
11035
|
+
return;
|
|
11036
|
+
}
|
|
11037
|
+
if (matchesKey(data, "up")) {
|
|
11038
|
+
this.scrollConflictDetails(-1);
|
|
11039
|
+
return;
|
|
11040
|
+
}
|
|
11041
|
+
if (matchesKey(data, "down")) {
|
|
11042
|
+
this.scrollConflictDetails(1);
|
|
11043
|
+
return;
|
|
11044
|
+
}
|
|
11045
|
+
if (matchesKey(data, "pageUp")) {
|
|
11046
|
+
this.scrollConflictDetails(-Math.max(1, this.maxRows() - 1));
|
|
11047
|
+
return;
|
|
11048
|
+
}
|
|
11049
|
+
if (matchesKey(data, "pageDown")) this.scrollConflictDetails(Math.max(1, this.maxRows() - 1));
|
|
11050
|
+
}
|
|
11051
|
+
scrollConflictDetails(delta) {
|
|
11052
|
+
const lines = 2 + this.conflictDiagnostics().reduce((total, diagnostic) => total + wrapTextWithAnsi(diagnostic, this.lastRenderWidth || 1).length, 0);
|
|
11053
|
+
const bodyLimit = Math.max(1, this.maxRows() - 1);
|
|
11054
|
+
const maxStart = Math.max(0, lines - bodyLimit);
|
|
11055
|
+
this.conflictScroll = Math.min(maxStart, Math.max(0, this.conflictScroll + delta));
|
|
11056
|
+
this.requestRender();
|
|
11057
|
+
}
|
|
11029
11058
|
renderBindingChoice(width) {
|
|
11059
|
+
this.paintedBarSpansValue = [];
|
|
11030
11060
|
const lines = [
|
|
11031
11061
|
color.textStrong(`Add shortcut › ${this.row.label}`),
|
|
11032
11062
|
"",
|
|
@@ -11125,6 +11155,7 @@ var ActionEditorPanel = class {
|
|
|
11125
11155
|
const generation = ++this.mutationGeneration;
|
|
11126
11156
|
this.pending = true;
|
|
11127
11157
|
this.message = void 0;
|
|
11158
|
+
this.messageKind = void 0;
|
|
11128
11159
|
this.requestRender();
|
|
11129
11160
|
try {
|
|
11130
11161
|
this.runMutation(mutation, (result) => this.applyMutationResult(generation, result), (error) => this.applyMutationError(generation, error));
|
|
@@ -11138,6 +11169,7 @@ var ActionEditorPanel = class {
|
|
|
11138
11169
|
this.settlementAwaitingPaint = true;
|
|
11139
11170
|
if (result.kind !== "applied") {
|
|
11140
11171
|
this.message = result.message;
|
|
11172
|
+
this.messageKind = "error";
|
|
11141
11173
|
this.requestRender();
|
|
11142
11174
|
return;
|
|
11143
11175
|
}
|
|
@@ -11147,6 +11179,7 @@ var ActionEditorPanel = class {
|
|
|
11147
11179
|
const editableCount = this.row.customized ? this.row.configured.length : this.row.editableDefaults.length;
|
|
11148
11180
|
this.selectedIndex = Math.min(this.selectedIndex, editableCount);
|
|
11149
11181
|
this.message = result.message;
|
|
11182
|
+
this.messageKind = "success";
|
|
11150
11183
|
this.onModelChange(result.model);
|
|
11151
11184
|
this.requestRender();
|
|
11152
11185
|
}
|
|
@@ -11155,6 +11188,7 @@ var ActionEditorPanel = class {
|
|
|
11155
11188
|
this.pending = false;
|
|
11156
11189
|
this.settlementAwaitingPaint = true;
|
|
11157
11190
|
this.message = error instanceof Error ? error.message : "Could not save keyboard shortcuts.";
|
|
11191
|
+
this.messageKind = "error";
|
|
11158
11192
|
this.requestRender();
|
|
11159
11193
|
}
|
|
11160
11194
|
};
|
|
@@ -11321,6 +11355,8 @@ var KeybindingEditorPanel = class {
|
|
|
11321
11355
|
}
|
|
11322
11356
|
selectedId = "leader";
|
|
11323
11357
|
selectedIndex = 0;
|
|
11358
|
+
/** The ONE local view mode (transient, never persisted). */
|
|
11359
|
+
filter;
|
|
11324
11360
|
actionEditor;
|
|
11325
11361
|
leaderRecorder;
|
|
11326
11362
|
leaderEditing = false;
|
|
@@ -11344,6 +11380,12 @@ var KeybindingEditorPanel = class {
|
|
|
11344
11380
|
/** Undefined before the first frame: a direct panel harness may feed input
|
|
11345
11381
|
* before a paint, while a REAL surface always paints first. */
|
|
11346
11382
|
paintedSelectableIds;
|
|
11383
|
+
/** The complete spans of the LAST painted view-mode row; undefined when the
|
|
11384
|
+
* frame painted no switchable mode row (bar-only/short grants). */
|
|
11385
|
+
paintedFilterSpans;
|
|
11386
|
+
/** A pressed filter option (mouse parity): the exact mode, gesture identity
|
|
11387
|
+
* and painted width the press was admitted against. */
|
|
11388
|
+
mousePressedFilter;
|
|
11347
11389
|
/** A detail-mutation settlement that has not painted its frame yet. */
|
|
11348
11390
|
settlementAwaitingPaint = false;
|
|
11349
11391
|
/** The width the hit map was painted at; a stale-width event is rejected. */
|
|
@@ -11361,6 +11403,7 @@ var KeybindingEditorPanel = class {
|
|
|
11361
11403
|
this.onDispose = options.onDispose ?? (() => {});
|
|
11362
11404
|
this.requestRender = options.requestRender ?? (() => {});
|
|
11363
11405
|
this.standaloneRows = options.maxRows ?? (() => 18);
|
|
11406
|
+
this.filter = options.initialFilter ?? "all";
|
|
11364
11407
|
this.maxRows = () => Math.max(1, Math.min(this.standaloneRows(), this.parentContentRows ?? Number.POSITIVE_INFINITY));
|
|
11365
11408
|
}
|
|
11366
11409
|
/** The parent's live row grant (the Settings root when embedded). A repeated
|
|
@@ -11390,7 +11433,7 @@ var KeybindingEditorPanel = class {
|
|
|
11390
11433
|
viewKey() {
|
|
11391
11434
|
if (this.actionEditor !== void 0) return `action:${this.actionEditor.actionId()}`;
|
|
11392
11435
|
if (this.leaderEditing) return "leader";
|
|
11393
|
-
return
|
|
11436
|
+
return `list:${this.filter}`;
|
|
11394
11437
|
}
|
|
11395
11438
|
render(width) {
|
|
11396
11439
|
const safeWidth = Math.max(1, width);
|
|
@@ -11399,6 +11442,7 @@ var KeybindingEditorPanel = class {
|
|
|
11399
11442
|
this.paintedView = this.viewKey();
|
|
11400
11443
|
this.settlementAwaitingPaint = false;
|
|
11401
11444
|
this.paintedEscapeSpanValue = void 0;
|
|
11445
|
+
this.paintedFilterSpans = void 0;
|
|
11402
11446
|
if (this.actionEditor !== void 0) {
|
|
11403
11447
|
const lines = this.actionEditor.render(safeWidth);
|
|
11404
11448
|
this.paintedEscapeSpanValue = this.actionEditor.paintedEscapeSpan();
|
|
@@ -11407,23 +11451,36 @@ var KeybindingEditorPanel = class {
|
|
|
11407
11451
|
if (this.leaderEditing) return this.renderLeaderEditor(safeWidth);
|
|
11408
11452
|
const limit = Math.max(1, this.maxRows());
|
|
11409
11453
|
const searchRow = this.searchRow(safeWidth);
|
|
11454
|
+
const filterRow = this.filterRow(safeWidth);
|
|
11455
|
+
const filterSwitchable = filterRow.spans.length > 0;
|
|
11456
|
+
const filterPainted = filterSwitchable && limit >= 3;
|
|
11410
11457
|
const escVerb = this.query === "" ? "Back" : "Clear";
|
|
11411
11458
|
const plainEscVerb = this.query === "" ? "close" : "clear";
|
|
11412
11459
|
const back = this.query === "" ? " · ← Back" : "";
|
|
11460
|
+
const viewHint = filterPainted ? "Tab view · " : "";
|
|
11413
11461
|
const hintWording = pickWording([
|
|
11414
|
-
escapeWording$2(
|
|
11415
|
-
escapeWording$2(
|
|
11416
|
-
escapeWording$2(
|
|
11417
|
-
escapeWording$2(
|
|
11462
|
+
escapeWording$2(`${viewHint}Enter details · type search · ←→ edit · ↑↓ move${back}`, escVerb),
|
|
11463
|
+
escapeWording$2(`${viewHint}Enter details · type search · ←→ edit${back}`, escVerb),
|
|
11464
|
+
escapeWording$2(`${viewHint}Enter details · type search${back}`, escVerb),
|
|
11465
|
+
escapeWording$2(`${viewHint}Enter details${back}`, escVerb),
|
|
11466
|
+
escapeWording$2(`${viewHint}Enter details`, escVerb),
|
|
11467
|
+
escapeWording$2(`${viewHint}type search${back}`, escVerb),
|
|
11418
11468
|
escapeWording$2("Enter details", escVerb),
|
|
11419
11469
|
escapeWording$2("", escVerb)
|
|
11420
11470
|
], safeWidth, `Esc ${plainEscVerb}`);
|
|
11421
11471
|
const passiveWording = pickWording([
|
|
11472
|
+
escapeWording$2(`${viewHint}type search${back}`, escVerb),
|
|
11422
11473
|
escapeWording$2(`type search${back}`, escVerb),
|
|
11423
11474
|
...this.query === "" ? [escapeWording$2("← Back", escVerb)] : [],
|
|
11424
11475
|
escapeWording$2("", escVerb)
|
|
11425
11476
|
], safeWidth, `Esc ${plainEscVerb}`);
|
|
11426
11477
|
const barOnlyWording = pickWording([...this.query === "" ? [escapeWording$2("← Back", escVerb)] : [], escapeWording$2("", escVerb)], safeWidth, `Esc ${plainEscVerb}`);
|
|
11478
|
+
const modeWording = pickWording([
|
|
11479
|
+
escapeWording$2(`${viewHint}type search${back}`, escVerb),
|
|
11480
|
+
escapeWording$2(`type search${back}`, escVerb),
|
|
11481
|
+
...this.query === "" ? [escapeWording$2("← Back", escVerb)] : [],
|
|
11482
|
+
escapeWording$2("", escVerb)
|
|
11483
|
+
], safeWidth, `Esc ${plainEscVerb}`);
|
|
11427
11484
|
const hint = paintBarWording$1(hintWording);
|
|
11428
11485
|
if (limit === 1) {
|
|
11429
11486
|
this.hitMap = [{ kind: "inert" }];
|
|
@@ -11439,16 +11496,20 @@ var KeybindingEditorPanel = class {
|
|
|
11439
11496
|
}
|
|
11440
11497
|
if (limit === 3) {
|
|
11441
11498
|
this.hitMap = [
|
|
11499
|
+
filterSwitchable ? {
|
|
11500
|
+
kind: "filter",
|
|
11501
|
+
spans: filterRow.spans
|
|
11502
|
+
} : { kind: "inert" },
|
|
11442
11503
|
{ kind: "search" },
|
|
11443
|
-
{ kind: "inert" },
|
|
11444
11504
|
{ kind: "inert" }
|
|
11445
11505
|
];
|
|
11446
11506
|
this.paintedSelectableIds = /* @__PURE__ */ new Set();
|
|
11447
|
-
this.
|
|
11507
|
+
this.paintedFilterSpans = filterPainted ? filterRow.spans : void 0;
|
|
11508
|
+
this.paintedEscapeSpanValue = modeWording.escape;
|
|
11448
11509
|
return [
|
|
11510
|
+
filterRow.text,
|
|
11449
11511
|
searchRow,
|
|
11450
|
-
|
|
11451
|
-
paintBarWording$1(passiveWording)
|
|
11512
|
+
paintBarWording$1(modeWording)
|
|
11452
11513
|
];
|
|
11453
11514
|
}
|
|
11454
11515
|
const entries = this.displayEntries();
|
|
@@ -11470,6 +11531,13 @@ var KeybindingEditorPanel = class {
|
|
|
11470
11531
|
hit: { kind: "inert" },
|
|
11471
11532
|
drop: 30
|
|
11472
11533
|
});
|
|
11534
|
+
rows.push({
|
|
11535
|
+
text: filterRow.text,
|
|
11536
|
+
hit: filterSwitchable ? {
|
|
11537
|
+
kind: "filter",
|
|
11538
|
+
spans: filterRow.spans
|
|
11539
|
+
} : { kind: "inert" }
|
|
11540
|
+
});
|
|
11473
11541
|
rows.push({
|
|
11474
11542
|
text: searchRow,
|
|
11475
11543
|
hit: { kind: "search" }
|
|
@@ -11484,13 +11552,14 @@ var KeybindingEditorPanel = class {
|
|
|
11484
11552
|
drop: 10
|
|
11485
11553
|
});
|
|
11486
11554
|
if (entries.length === 0) rows.push({
|
|
11487
|
-
text: color.textDim(
|
|
11555
|
+
text: color.textDim(truncateToWidth(this.emptyListText(), safeWidth)),
|
|
11488
11556
|
hit: { kind: "inert" }
|
|
11489
11557
|
});
|
|
11490
11558
|
else {
|
|
11491
11559
|
for (const entry of entries.slice(start, end)) if (entry.kind === "header") rows.push({
|
|
11492
|
-
text: color.textStrong(entry.label),
|
|
11493
|
-
hit: { kind: "inert" }
|
|
11560
|
+
text: color.textStrong(truncateToWidth(entry.label, safeWidth)),
|
|
11561
|
+
hit: { kind: "inert" },
|
|
11562
|
+
drop: 22
|
|
11494
11563
|
});
|
|
11495
11564
|
else {
|
|
11496
11565
|
const selectableIndex = selectable.indexOf(entry);
|
|
@@ -11530,6 +11599,7 @@ var KeybindingEditorPanel = class {
|
|
|
11530
11599
|
});
|
|
11531
11600
|
const kept = trimToGrant(rows, limit);
|
|
11532
11601
|
this.hitMap = kept.map((row) => row.hit);
|
|
11602
|
+
this.paintedFilterSpans = filterSwitchable && kept.some((row) => row.hit.kind === "filter") ? filterRow.spans : void 0;
|
|
11533
11603
|
this.paintedSelectableIds = new Set(kept.flatMap((row) => row.hit.kind === "select" ? [row.hit.id] : []));
|
|
11534
11604
|
this.paintedEscapeSpanValue = hintWording.escape;
|
|
11535
11605
|
if (this.paintedSelectableIds.size === 0 && kept.length > 0) {
|
|
@@ -11541,6 +11611,45 @@ var KeybindingEditorPanel = class {
|
|
|
11541
11611
|
}
|
|
11542
11612
|
return kept.map((row) => row.text);
|
|
11543
11613
|
}
|
|
11614
|
+
/** The ONE local view-mode row: two complete painted spans when the whole
|
|
11615
|
+
* wording fits, otherwise a read-only statement of the active mode with no
|
|
11616
|
+
* hit geometry (a half token is never clickable). */
|
|
11617
|
+
filterRow(width) {
|
|
11618
|
+
const allToken = this.filter === "all" ? "[All]" : "All";
|
|
11619
|
+
const conflictsLabel = `Conflicts (${this.model.conflictCount} affected actions)`;
|
|
11620
|
+
const conflictsToken = this.filter === "conflicts" ? `[${conflictsLabel}]` : conflictsLabel;
|
|
11621
|
+
const prefix = "View: ";
|
|
11622
|
+
const plain = `${prefix}${allToken} · ${conflictsToken}`;
|
|
11623
|
+
if (visibleWidth(plain) <= width) {
|
|
11624
|
+
const allStart = visibleWidth(prefix);
|
|
11625
|
+
const allEnd = allStart + visibleWidth(allToken);
|
|
11626
|
+
const conflictsStart = allEnd + visibleWidth(" · ");
|
|
11627
|
+
const conflictsEnd = conflictsStart + visibleWidth(conflictsToken);
|
|
11628
|
+
return {
|
|
11629
|
+
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)}`,
|
|
11630
|
+
spans: [{
|
|
11631
|
+
mode: "all",
|
|
11632
|
+
startCol: allStart,
|
|
11633
|
+
endCol: allEnd
|
|
11634
|
+
}, {
|
|
11635
|
+
mode: "conflicts",
|
|
11636
|
+
startCol: conflictsStart,
|
|
11637
|
+
endCol: conflictsEnd
|
|
11638
|
+
}]
|
|
11639
|
+
};
|
|
11640
|
+
}
|
|
11641
|
+
const label = this.filter === "all" ? "All" : "Conflicts";
|
|
11642
|
+
return {
|
|
11643
|
+
text: truncateToWidth(`${color.textDim(prefix)}${color.textStrong(`[${label}]`, "primary")}`, Math.max(1, width)),
|
|
11644
|
+
spans: []
|
|
11645
|
+
};
|
|
11646
|
+
}
|
|
11647
|
+
emptyListText() {
|
|
11648
|
+
if (this.filter !== "conflicts") return "No matching shortcuts.";
|
|
11649
|
+
if (this.query.trim() !== "") return "No conflicted shortcuts match your search.";
|
|
11650
|
+
if (this.model.conflictCount === 0) return "No conflicts in the current keymap.";
|
|
11651
|
+
return "No conflicted shortcuts match your search.";
|
|
11652
|
+
}
|
|
11544
11653
|
/** The search row: the `Search: ` label combined with the shared
|
|
11545
11654
|
* Input's real render (the user sees the actual cursor position while
|
|
11546
11655
|
* editing the query). An empty query keeps the dim placeholder. The
|
|
@@ -11567,6 +11676,7 @@ var KeybindingEditorPanel = class {
|
|
|
11567
11676
|
if (matchesKey(data, "escape")) {
|
|
11568
11677
|
if (this.query !== "") {
|
|
11569
11678
|
this.searchInput.setValue("");
|
|
11679
|
+
this.mousePressedFilter = void 0;
|
|
11570
11680
|
this.selectedId = "leader";
|
|
11571
11681
|
this.selectedIndex = 0;
|
|
11572
11682
|
this.message = void 0;
|
|
@@ -11583,6 +11693,11 @@ var KeybindingEditorPanel = class {
|
|
|
11583
11693
|
return;
|
|
11584
11694
|
}
|
|
11585
11695
|
if (this.maxRows() < 2) return;
|
|
11696
|
+
if (matchesKey(data, "tab") || matchesKey(data, "shift+tab")) {
|
|
11697
|
+
if (this.paintedFilterSpans === void 0) return;
|
|
11698
|
+
this.setFilter(this.filter === "all" ? "conflicts" : "all");
|
|
11699
|
+
return;
|
|
11700
|
+
}
|
|
11586
11701
|
const selectable = this.selectableEntries(this.displayEntries());
|
|
11587
11702
|
this.ensureSelection(selectable);
|
|
11588
11703
|
if (matchesKey(data, "up")) {
|
|
@@ -11611,6 +11726,7 @@ var KeybindingEditorPanel = class {
|
|
|
11611
11726
|
const before = this.searchInput.getValue();
|
|
11612
11727
|
this.searchInput.handleInput(data);
|
|
11613
11728
|
if (this.searchInput.getValue() !== before) {
|
|
11729
|
+
this.mousePressedFilter = void 0;
|
|
11614
11730
|
this.selectedId = "leader";
|
|
11615
11731
|
this.selectedIndex = 0;
|
|
11616
11732
|
this.message = void 0;
|
|
@@ -11630,16 +11746,46 @@ var KeybindingEditorPanel = class {
|
|
|
11630
11746
|
const pressedId = this.mousePressedId;
|
|
11631
11747
|
const pressedGrant = this.mousePressedGrant;
|
|
11632
11748
|
const pressedView = this.mousePressedView;
|
|
11749
|
+
const pressedFilter = this.mousePressedFilter;
|
|
11633
11750
|
if (event.type === "click" || event.type === "wheel") {
|
|
11634
11751
|
this.mousePressedId = void 0;
|
|
11635
11752
|
this.mousePressedGrant = void 0;
|
|
11636
11753
|
this.mousePressedView = void 0;
|
|
11754
|
+
this.mousePressedFilter = void 0;
|
|
11637
11755
|
}
|
|
11638
11756
|
if (event.width !== this.lastRenderWidth) return void 0;
|
|
11639
11757
|
if (this.actionEditor !== void 0) return this.actionEditor.handleMouse?.(event);
|
|
11640
11758
|
if (this.leaderEditing) return void 0;
|
|
11641
11759
|
const hit = this.hitMap[event.y];
|
|
11642
11760
|
if (!hit) return void 0;
|
|
11761
|
+
if (hit.kind === "filter") {
|
|
11762
|
+
if (event.button !== "left" || event.type !== "press" && event.type !== "click") return void 0;
|
|
11763
|
+
const span = hit.spans.find((candidate) => event.x >= candidate.startCol && event.x < candidate.endCol);
|
|
11764
|
+
if (span === void 0) return void 0;
|
|
11765
|
+
if (event.type === "press") {
|
|
11766
|
+
this.mousePressedId = void 0;
|
|
11767
|
+
this.mousePressedGrant = void 0;
|
|
11768
|
+
this.mousePressedView = void 0;
|
|
11769
|
+
this.mousePressedFilter = {
|
|
11770
|
+
spans: hit.spans,
|
|
11771
|
+
mode: span.mode,
|
|
11772
|
+
grant: this.parentContentRows,
|
|
11773
|
+
view: this.gestureIdentity(),
|
|
11774
|
+
width: this.lastRenderWidth
|
|
11775
|
+
};
|
|
11776
|
+
return {
|
|
11777
|
+
handled: true,
|
|
11778
|
+
focus: true
|
|
11779
|
+
};
|
|
11780
|
+
}
|
|
11781
|
+
if (pressedFilter === void 0 || pressedFilter.mode !== span.mode) return void 0;
|
|
11782
|
+
const pressedSpan = pressedFilter.spans.find((candidate) => candidate.mode === pressedFilter.mode);
|
|
11783
|
+
if (pressedSpan === void 0 || pressedSpan.startCol !== span.startCol || pressedSpan.endCol !== span.endCol) return void 0;
|
|
11784
|
+
if (pressedFilter.grant !== this.parentContentRows || pressedFilter.width !== this.lastRenderWidth) return void 0;
|
|
11785
|
+
if (pressedFilter.view !== this.gestureIdentity()) return void 0;
|
|
11786
|
+
this.setFilter(span.mode);
|
|
11787
|
+
return { handled: true };
|
|
11788
|
+
}
|
|
11643
11789
|
if (hit.kind === "search") {
|
|
11644
11790
|
if (event.type !== "press") return void 0;
|
|
11645
11791
|
const result = dispatchMouseEvent(this.searchInput, {
|
|
@@ -11666,6 +11812,7 @@ var KeybindingEditorPanel = class {
|
|
|
11666
11812
|
if (event.button !== "left" || event.type !== "press" && event.type !== "click") return void 0;
|
|
11667
11813
|
if (event.type === "press") {
|
|
11668
11814
|
this.mousePressedId = void 0;
|
|
11815
|
+
this.mousePressedFilter = void 0;
|
|
11669
11816
|
const currentIndex = this.selectableEntries(this.displayEntries()).findIndex((entry) => this.entryId(entry) === hit.id);
|
|
11670
11817
|
if (currentIndex === -1) return void 0;
|
|
11671
11818
|
this.mousePressedId = hit.id;
|
|
@@ -11702,13 +11849,21 @@ var KeybindingEditorPanel = class {
|
|
|
11702
11849
|
paintedEscapeSpan() {
|
|
11703
11850
|
return this.paintedEscapeSpanValue;
|
|
11704
11851
|
}
|
|
11852
|
+
/** The Action detail's delegated non-Esc bar spans, when that sub-view is
|
|
11853
|
+
* mounted; the Settings root owns the physical row and forwards releases. */
|
|
11854
|
+
paintedBarSpans() {
|
|
11855
|
+
return this.actionEditor?.paintedBarSpans?.() ?? [];
|
|
11856
|
+
}
|
|
11857
|
+
activateBarSpan(id) {
|
|
11858
|
+
this.actionEditor?.activateBarSpan?.(id);
|
|
11859
|
+
}
|
|
11705
11860
|
/** The page's own SEMANTIC identity for a pointer gesture: the sub-view
|
|
11706
11861
|
* (list / leader editor / action detail), the query stage and the pending
|
|
11707
11862
|
* leader write decide what its Esc really does. The Settings root stores it
|
|
11708
11863
|
* at press and re-proves it at the release. */
|
|
11709
11864
|
gestureIdentity() {
|
|
11710
11865
|
const detail = this.actionEditor === void 0 ? "" : this.actionEditor.gestureIdentity();
|
|
11711
|
-
return `${this.viewKey()}:${detail}:${this.query === "" ? "empty" :
|
|
11866
|
+
return `${this.viewKey()}:${detail}:${this.query === "" ? "empty" : `query:${this.query}`}:${this.leaderPending ? "pending" : "idle"}`;
|
|
11712
11867
|
}
|
|
11713
11868
|
dispose() {
|
|
11714
11869
|
if (this.disposed) return;
|
|
@@ -11723,6 +11878,7 @@ var KeybindingEditorPanel = class {
|
|
|
11723
11878
|
this.onDispose();
|
|
11724
11879
|
}
|
|
11725
11880
|
displayEntries() {
|
|
11881
|
+
if (this.filter === "conflicts") return this.displayConflictEntries();
|
|
11726
11882
|
const matches = searchKeybindingRows(this.model.rows, this.query);
|
|
11727
11883
|
const matchedRows = new Set(matches.map((match) => match.row.id));
|
|
11728
11884
|
const entries = [];
|
|
@@ -11744,15 +11900,47 @@ var KeybindingEditorPanel = class {
|
|
|
11744
11900
|
}
|
|
11745
11901
|
return entries;
|
|
11746
11902
|
}
|
|
11903
|
+
/** The Conflicts view: only affected editable builtin actions. Every
|
|
11904
|
+
* production conflict record has a builtin/user participant, so the
|
|
11905
|
+
* action rows are the complete projection. */
|
|
11906
|
+
displayConflictEntries() {
|
|
11907
|
+
const entries = [];
|
|
11908
|
+
const matches = searchKeybindingRows(this.model.rows, this.query);
|
|
11909
|
+
const matchedRows = new Set(matches.map((match) => match.row.id));
|
|
11910
|
+
const affected = [];
|
|
11911
|
+
for (const section of this.model.sections) {
|
|
11912
|
+
const rows = section.rows.filter((row) => row.conflict && matchedRows.has(row.id));
|
|
11913
|
+
if (rows.length === 0) continue;
|
|
11914
|
+
affected.push({
|
|
11915
|
+
kind: "header",
|
|
11916
|
+
label: section.category
|
|
11917
|
+
});
|
|
11918
|
+
for (const row of rows) affected.push({
|
|
11919
|
+
kind: "action",
|
|
11920
|
+
row
|
|
11921
|
+
});
|
|
11922
|
+
}
|
|
11923
|
+
if (affected.length > 0) {
|
|
11924
|
+
entries.push({
|
|
11925
|
+
kind: "header",
|
|
11926
|
+
label: "Affected actions"
|
|
11927
|
+
});
|
|
11928
|
+
entries.push(...affected);
|
|
11929
|
+
}
|
|
11930
|
+
return entries;
|
|
11931
|
+
}
|
|
11747
11932
|
selectableEntries(entries) {
|
|
11748
11933
|
return entries.filter((entry) => entry.kind !== "header");
|
|
11749
11934
|
}
|
|
11750
11935
|
isSelectedEntry(entry) {
|
|
11751
|
-
|
|
11936
|
+
if (entry.kind === "leader") return this.selectedId === "leader";
|
|
11937
|
+
if (entry.kind === "action") return this.selectedId === entry.row.id;
|
|
11938
|
+
return false;
|
|
11752
11939
|
}
|
|
11753
11940
|
ensureSelection(selectable) {
|
|
11754
11941
|
if (selectable.length === 0) {
|
|
11755
11942
|
this.selectedIndex = 0;
|
|
11943
|
+
this.selectedId = "";
|
|
11756
11944
|
return;
|
|
11757
11945
|
}
|
|
11758
11946
|
const existing = selectable.findIndex((entry) => this.isSelectedEntry(entry));
|
|
@@ -11764,7 +11952,9 @@ var KeybindingEditorPanel = class {
|
|
|
11764
11952
|
this.selectedId = this.entryId(selectable[this.selectedIndex]);
|
|
11765
11953
|
}
|
|
11766
11954
|
entryId(entry) {
|
|
11767
|
-
|
|
11955
|
+
if (entry.kind === "leader") return "leader";
|
|
11956
|
+
if (entry.kind === "action") return entry.row.id;
|
|
11957
|
+
return "";
|
|
11768
11958
|
}
|
|
11769
11959
|
moveSelection(delta, selectable) {
|
|
11770
11960
|
if (selectable.length === 0) return;
|
|
@@ -11810,6 +12000,21 @@ var KeybindingEditorPanel = class {
|
|
|
11810
12000
|
this.actionEditor = detail;
|
|
11811
12001
|
this.requestRender();
|
|
11812
12002
|
}
|
|
12003
|
+
/** The ONE mode transition used by Tab/Shift+Tab and the painted spans.
|
|
12004
|
+
* Filtering is presentation-only: no mutation, no reload, no keymap write.
|
|
12005
|
+
* It preserves the query, cancels any mouse gesture and repositions a
|
|
12006
|
+
* selection that the new mode no longer contains. */
|
|
12007
|
+
setFilter(next) {
|
|
12008
|
+
if (this.filter === next) return;
|
|
12009
|
+
this.filter = next;
|
|
12010
|
+
this.mousePressedId = void 0;
|
|
12011
|
+
this.mousePressedGrant = void 0;
|
|
12012
|
+
this.mousePressedView = void 0;
|
|
12013
|
+
this.mousePressedFilter = void 0;
|
|
12014
|
+
this.message = void 0;
|
|
12015
|
+
this.ensureSelection(this.selectableEntries(this.displayEntries()));
|
|
12016
|
+
this.requestRender();
|
|
12017
|
+
}
|
|
11813
12018
|
renderLeaderEditor(width) {
|
|
11814
12019
|
this.paintedEscapeSpanValue = void 0;
|
|
11815
12020
|
if (this.leaderRecorder !== void 0) {
|
|
@@ -37540,6 +37745,18 @@ function createSessionCommands(deps) {
|
|
|
37540
37745
|
//#endregion
|
|
37541
37746
|
//#region src/tui/commands/settings.ts
|
|
37542
37747
|
/**
|
|
37748
|
+
* Built-in command definitions for the TUI settings/display domain
|
|
37749
|
+
* (/settings, /footer, /display, /focus, /keybindings) plus their
|
|
37750
|
+
* domain-local helpers.
|
|
37751
|
+
*
|
|
37752
|
+
* Registration is explicit: the coordinator (src/commands.ts) calls each
|
|
37753
|
+
* registrar at its frozen position in the built-in registration sequence and
|
|
37754
|
+
* owns catalog/provenance/disposal state. This module owns command-definition
|
|
37755
|
+
* and presentation logic only — never TUI settings persistence authority:
|
|
37756
|
+
* every write still goes through the same runner settings/config seams.
|
|
37757
|
+
* @module @xmoon76/dsh-pi-tui/commands/settings
|
|
37758
|
+
*/
|
|
37759
|
+
/**
|
|
37543
37760
|
* M6 UX PR2 Step D: the ONE decision rule for the transient user-conversion
|
|
37544
37761
|
* intent. Only a verified `daemon → direct` save made by a process that is
|
|
37545
37762
|
* STILL running the daemon backend grants the exit-intent owner permission to
|
|
@@ -38588,10 +38805,13 @@ function createSettingsCommands(deps) {
|
|
|
38588
38805
|
/** FR4: the ONE open MCP page's controller (a Settings refresh re-reads it). */
|
|
38589
38806
|
let activeMcpController;
|
|
38590
38807
|
const openSettingsWorkspaceWith = (spec) => {
|
|
38591
|
-
|
|
38592
|
-
|
|
38593
|
-
|
|
38808
|
+
const { initialKeybindingsFilter, onKeybindingsPageFailure, ...workspaceSpec } = spec;
|
|
38809
|
+
let keybindingsFilterPending = initialKeybindingsFilter;
|
|
38810
|
+
if (workspaceSpec.initialSpecialist !== void 0) {
|
|
38811
|
+
const requires = SETTINGS_SPECIALIST_ROUTE_ROW[workspaceSpec.initialSpecialist];
|
|
38812
|
+
if (workspaceSpec.initialRowId !== requires) throw new Error(`the ${workspaceSpec.initialSpecialist} deeplink requires the ${requires} row`);
|
|
38594
38813
|
}
|
|
38814
|
+
if (initialKeybindingsFilter !== void 0 && (workspaceSpec.initialSpecialist !== "keybindings" || workspaceSpec.initialRowId !== "keyboard-shortcuts")) throw new Error("the keybindings conflicts view requires the keyboard-shortcuts keybindings deeplink");
|
|
38595
38815
|
const token = {};
|
|
38596
38816
|
let approvalScope;
|
|
38597
38817
|
let approvalScopePinned = false;
|
|
@@ -38842,7 +39062,13 @@ function createSettingsCommands(deps) {
|
|
|
38842
39062
|
return page;
|
|
38843
39063
|
},
|
|
38844
39064
|
createFooterConfiguratorPage: (done, onAuthoritativeChange) => createFooterWorkspacePage(done, onAuthoritativeChange),
|
|
38845
|
-
createKeybindingsPage: (done, onAuthoritativeChange) =>
|
|
39065
|
+
createKeybindingsPage: (done, onAuthoritativeChange) => {
|
|
39066
|
+
const filter = keybindingsFilterPending ?? "all";
|
|
39067
|
+
const notifyOnFailure = keybindingsFilterPending !== "conflicts";
|
|
39068
|
+
const onFailure = keybindingsFilterPending === "conflicts" ? onKeybindingsPageFailure : void 0;
|
|
39069
|
+
keybindingsFilterPending = void 0;
|
|
39070
|
+
return createKeybindingsWorkspacePage(done, onAuthoritativeChange, filter, notifyOnFailure, onFailure);
|
|
39071
|
+
},
|
|
38846
39072
|
createMcpServersPage: (done) => {
|
|
38847
39073
|
const port = runner.mcpServers;
|
|
38848
39074
|
if (port === void 0) return void 0;
|
|
@@ -38907,7 +39133,7 @@ function createSettingsCommands(deps) {
|
|
|
38907
39133
|
onAboutLeave: () => {
|
|
38908
39134
|
aboutStatusSource().leave();
|
|
38909
39135
|
},
|
|
38910
|
-
...
|
|
39136
|
+
...workspaceSpec,
|
|
38911
39137
|
onClose: (reason) => {
|
|
38912
39138
|
const wasActive = activeSettingsWorkspace?.token === token;
|
|
38913
39139
|
if (wasActive) activeSettingsWorkspace = void 0;
|
|
@@ -38961,7 +39187,7 @@ function createSettingsCommands(deps) {
|
|
|
38961
39187
|
startAcpRuntimeRead();
|
|
38962
39188
|
});
|
|
38963
39189
|
startPolicyRead(false);
|
|
38964
|
-
if (
|
|
39190
|
+
if (workspaceSpec.initialCategory === void 0 && workspaceSpec.initialRowId === void 0 && workspaceSpec.initialModelsView === void 0 && workspaceSpec.initialAccountView === void 0) aboutStatusSource().enter();
|
|
38965
39191
|
return handle;
|
|
38966
39192
|
};
|
|
38967
39193
|
const openSettingsWorkspaceAt = (initialRowId) => {
|
|
@@ -39060,7 +39286,7 @@ function createSettingsCommands(deps) {
|
|
|
39060
39286
|
/** Build the one editor used by /keybindings and the /settings submenu.
|
|
39061
39287
|
* The settings row is only a launcher; all reads/writes still go through
|
|
39062
39288
|
* the controller and the same panel state machine. */
|
|
39063
|
-
const createKeybindingEditorPanel = (onClose, onModelChange = () => {}) => {
|
|
39289
|
+
const createKeybindingEditorPanel = (onClose, onModelChange = () => {}, initialFilter = "all", notifyOnFailure = true, onFailure) => {
|
|
39064
39290
|
const settings = runner.tuiSettings;
|
|
39065
39291
|
if (settings === void 0) return void 0;
|
|
39066
39292
|
const controller = new KeybindingEditorController({
|
|
@@ -39075,6 +39301,7 @@ function createSettingsCommands(deps) {
|
|
|
39075
39301
|
let unregister = () => {};
|
|
39076
39302
|
panel = new KeybindingEditorPanel({
|
|
39077
39303
|
model,
|
|
39304
|
+
initialFilter,
|
|
39078
39305
|
onClose,
|
|
39079
39306
|
onModelChange,
|
|
39080
39307
|
onDispose: () => unregister(),
|
|
@@ -39092,7 +39319,8 @@ function createSettingsCommands(deps) {
|
|
|
39092
39319
|
unregister = app.trackKeybindingEditor(panel);
|
|
39093
39320
|
return panel;
|
|
39094
39321
|
} catch (error) {
|
|
39095
|
-
|
|
39322
|
+
onFailure?.(error);
|
|
39323
|
+
if (notifyOnFailure) app.notify(`Could not open keyboard shortcuts: ${safeErrorMessage(error)}`, "error");
|
|
39096
39324
|
return;
|
|
39097
39325
|
}
|
|
39098
39326
|
};
|
|
@@ -41419,10 +41647,10 @@ function createSettingsCommands(deps) {
|
|
|
41419
41647
|
* `createKeybindingEditorPanel` (the same controller/projector/recorder). A
|
|
41420
41648
|
* successful mutation refreshes the row summary from the controller's own
|
|
41421
41649
|
* read; `done` returns to the Input & Terminal row. */
|
|
41422
|
-
function createKeybindingsWorkspacePage(done, onAuthoritativeChange) {
|
|
41650
|
+
function createKeybindingsWorkspacePage(done, onAuthoritativeChange, initialFilter = "all", notifyOnFailure = true, onFailure) {
|
|
41423
41651
|
return createKeybindingEditorPanel(done, () => {
|
|
41424
41652
|
onAuthoritativeChange();
|
|
41425
|
-
});
|
|
41653
|
+
}, initialFilter, notifyOnFailure, onFailure);
|
|
41426
41654
|
}
|
|
41427
41655
|
const registerFooter = () => {
|
|
41428
41656
|
registerTuiCommand({
|
|
@@ -41529,6 +41757,69 @@ function createSettingsCommands(deps) {
|
|
|
41529
41757
|
}
|
|
41530
41758
|
});
|
|
41531
41759
|
};
|
|
41760
|
+
/** The conflicts-only degraded receipt: the typed Settings page could not be
|
|
41761
|
+
* opened, so the message names the real cause AND the CURRENT runtime
|
|
41762
|
+
* conflict records (read fresh from the Manager — never the count cached
|
|
41763
|
+
* before the open attempt). It returns an error result even when the
|
|
41764
|
+
* runtime keymap is conflict-free: the editor really did not open. */
|
|
41765
|
+
const reportConflictDegraded = (reason) => {
|
|
41766
|
+
const conflicts = app.keybindingsManager().snapshot().conflicts;
|
|
41767
|
+
const lines = [`Could not open Keyboard shortcuts: ${reason}. Runtime keybinding conflict records: ${conflicts.length}.`];
|
|
41768
|
+
if (conflicts.length === 0) lines.push("No conflicts in the current runtime keymap; the Settings editor is unavailable.");
|
|
41769
|
+
else for (const conflict of conflicts) lines.push(`- ${formatKeyId(conflict.key)}: ${conflict.actions.map((action) => `${action.action} (${action.scope}, ${action.source})`).join(" vs ")}`);
|
|
41770
|
+
return {
|
|
41771
|
+
kind: "error",
|
|
41772
|
+
text: lines.join("\n")
|
|
41773
|
+
};
|
|
41774
|
+
};
|
|
41775
|
+
/** The ONE typed Keyboard shortcuts entry. Both the ordinary page and the
|
|
41776
|
+
* conflicts view take the SAME Settings lease and mount the SAME editor;
|
|
41777
|
+
* only the initial transient filter differs. The ordinary path keeps its
|
|
41778
|
+
* exact pre-PR2 failure texts. */
|
|
41779
|
+
const openKeyboardShortcuts = async (initialFilter) => {
|
|
41780
|
+
const settings = runner.tuiSettings;
|
|
41781
|
+
if (settings === void 0) return initialFilter === "conflicts" ? reportConflictDegraded("the settings service is unavailable") : {
|
|
41782
|
+
kind: "error",
|
|
41783
|
+
text: "settings service unavailable"
|
|
41784
|
+
};
|
|
41785
|
+
try {
|
|
41786
|
+
settings.get();
|
|
41787
|
+
} catch (error) {
|
|
41788
|
+
return initialFilter === "conflicts" ? reportConflictDegraded(`the settings document could not be read: ${safeErrorMessage(error)}`) : {
|
|
41789
|
+
kind: "error",
|
|
41790
|
+
text: `could not open keyboard shortcuts: ${safeErrorMessage(error)}`
|
|
41791
|
+
};
|
|
41792
|
+
}
|
|
41793
|
+
let handle;
|
|
41794
|
+
let pageFailure;
|
|
41795
|
+
try {
|
|
41796
|
+
handle = openSettingsWorkspaceWith({
|
|
41797
|
+
initialRowId: "keyboard-shortcuts",
|
|
41798
|
+
initialSpecialist: "keybindings",
|
|
41799
|
+
...initialFilter === "conflicts" ? {
|
|
41800
|
+
initialKeybindingsFilter: "conflicts",
|
|
41801
|
+
onKeybindingsPageFailure: (error) => {
|
|
41802
|
+
pageFailure = error;
|
|
41803
|
+
}
|
|
41804
|
+
} : {}
|
|
41805
|
+
});
|
|
41806
|
+
} catch (error) {
|
|
41807
|
+
return initialFilter === "conflicts" ? reportConflictDegraded(`the Settings workspace could not be opened: ${safeErrorMessage(error)}`) : {
|
|
41808
|
+
kind: "error",
|
|
41809
|
+
text: `could not open the settings workspace: ${safeErrorMessage(error)}`
|
|
41810
|
+
};
|
|
41811
|
+
}
|
|
41812
|
+
const settlement = await handle.whenInitialSpecialistSettled();
|
|
41813
|
+
if (!settlement.ok) {
|
|
41814
|
+
handle.close();
|
|
41815
|
+
const reason = pageFailure === void 0 ? settlement.reason : safeErrorMessage(pageFailure);
|
|
41816
|
+
return initialFilter === "conflicts" ? reportConflictDegraded(`the Keyboard shortcuts page could not be created: ${reason}`) : {
|
|
41817
|
+
kind: "error",
|
|
41818
|
+
text: `could not open keyboard shortcuts: ${reason}`
|
|
41819
|
+
};
|
|
41820
|
+
}
|
|
41821
|
+
return { kind: "success" };
|
|
41822
|
+
};
|
|
41532
41823
|
const registerKeybindings = () => {
|
|
41533
41824
|
registerOne({
|
|
41534
41825
|
name: "keybindings",
|
|
@@ -41537,24 +41828,7 @@ function createSettingsCommands(deps) {
|
|
|
41537
41828
|
handler: async (invocation) => {
|
|
41538
41829
|
const verb = invocation.rawInput.trim().split(/\s+/)[0]?.toLowerCase() ?? "";
|
|
41539
41830
|
const keybindings = app.keybindingsManager();
|
|
41540
|
-
if (verb === "conflicts")
|
|
41541
|
-
const conflicts = keybindings.snapshot().conflicts;
|
|
41542
|
-
if (conflicts.length === 0) {
|
|
41543
|
-
app.notify("No keybinding conflicts.", "info");
|
|
41544
|
-
return {
|
|
41545
|
-
kind: "success",
|
|
41546
|
-
text: "No keybinding conflicts."
|
|
41547
|
-
};
|
|
41548
|
-
}
|
|
41549
|
-
const rows = conflicts.flatMap((conflict) => [{
|
|
41550
|
-
id: `conflict-${conflict.key}`,
|
|
41551
|
-
label: color.warning(formatKeyId(conflict.key)),
|
|
41552
|
-
description: conflict.actions.map((entry) => `${entry.action} (${entry.scope}, ${entry.source})`).join(" vs "),
|
|
41553
|
-
currentValue: "conflict"
|
|
41554
|
-
}]);
|
|
41555
|
-
app.openSettings(rows, () => {}, () => {});
|
|
41556
|
-
return { kind: "success" };
|
|
41557
|
-
}
|
|
41831
|
+
if (verb === "conflicts") return openKeyboardShortcuts("conflicts");
|
|
41558
41832
|
if (verb === "reload") {
|
|
41559
41833
|
const settings = runner.tuiSettings;
|
|
41560
41834
|
if (settings === void 0) return {
|
|
@@ -41615,40 +41889,7 @@ function createSettingsCommands(deps) {
|
|
|
41615
41889
|
}
|
|
41616
41890
|
});
|
|
41617
41891
|
}
|
|
41618
|
-
|
|
41619
|
-
if (settings === void 0) return {
|
|
41620
|
-
kind: "error",
|
|
41621
|
-
text: "settings service unavailable"
|
|
41622
|
-
};
|
|
41623
|
-
try {
|
|
41624
|
-
settings.get();
|
|
41625
|
-
} catch (error) {
|
|
41626
|
-
return {
|
|
41627
|
-
kind: "error",
|
|
41628
|
-
text: `could not open keyboard shortcuts: ${safeErrorMessage(error)}`
|
|
41629
|
-
};
|
|
41630
|
-
}
|
|
41631
|
-
let handle;
|
|
41632
|
-
try {
|
|
41633
|
-
handle = openSettingsWorkspaceWith({
|
|
41634
|
-
initialRowId: "keyboard-shortcuts",
|
|
41635
|
-
initialSpecialist: "keybindings"
|
|
41636
|
-
});
|
|
41637
|
-
} catch (error) {
|
|
41638
|
-
return {
|
|
41639
|
-
kind: "error",
|
|
41640
|
-
text: `could not open the settings workspace: ${safeErrorMessage(error)}`
|
|
41641
|
-
};
|
|
41642
|
-
}
|
|
41643
|
-
const settlement = await handle.whenInitialSpecialistSettled();
|
|
41644
|
-
if (!settlement.ok) {
|
|
41645
|
-
handle.close();
|
|
41646
|
-
return {
|
|
41647
|
-
kind: "error",
|
|
41648
|
-
text: `could not open keyboard shortcuts: ${settlement.reason}`
|
|
41649
|
-
};
|
|
41650
|
-
}
|
|
41651
|
-
return { kind: "success" };
|
|
41892
|
+
return openKeyboardShortcuts("all");
|
|
41652
41893
|
}
|
|
41653
41894
|
});
|
|
41654
41895
|
};
|
|
@@ -43461,8 +43702,7 @@ function registerTuiCommands(runner, initial, catalogSeams = {}, modelPresentati
|
|
|
43461
43702
|
captureExtensionHealthRef,
|
|
43462
43703
|
loadSkill,
|
|
43463
43704
|
takeDelivery,
|
|
43464
|
-
splitSkillLine
|
|
43465
|
-
resolveComposerDelivery
|
|
43705
|
+
splitSkillLine
|
|
43466
43706
|
};
|
|
43467
43707
|
registerSkillCommand(skillsCommandDeps);
|
|
43468
43708
|
registerReloadCommand(skillsCommandDeps);
|
|
@@ -43524,10 +43764,6 @@ function registerTuiCommands(runner, initial, catalogSeams = {}, modelPresentati
|
|
|
43524
43764
|
});
|
|
43525
43765
|
authCommands.registerLogin();
|
|
43526
43766
|
authCommands.registerLogout();
|
|
43527
|
-
registerHelpCommand({
|
|
43528
|
-
runner,
|
|
43529
|
-
registerOne
|
|
43530
|
-
});
|
|
43531
43767
|
settingsCommands.registerKeybindings();
|
|
43532
43768
|
if (initial?.snapshot !== void 0) installSurfaceSnapshot(initial.snapshot);
|
|
43533
43769
|
else if (initial?.skills !== void 0) withCommandCommit(() => {
|
|
@@ -65554,7 +65790,7 @@ var FooterConfiguratorPanel = class {
|
|
|
65554
65790
|
}
|
|
65555
65791
|
if (entry.kind === "custom-command") {
|
|
65556
65792
|
const value = customItem?.kind === "command" ? customItem.command : void 0;
|
|
65557
|
-
return this.menuRow(marker, "Command", value === void 0 ? void 0 : color.text(
|
|
65793
|
+
return this.menuRow(marker, "Command", value === void 0 ? void 0 : color.text(value), active);
|
|
65558
65794
|
}
|
|
65559
65795
|
if (entry.kind === "custom-refresh") {
|
|
65560
65796
|
const value = customItem?.kind === "command" ? formatRefreshMs(effectiveCustomCommandRefreshMs(customItem)) : void 0;
|
|
@@ -65735,7 +65971,7 @@ var FooterConfiguratorPanel = class {
|
|
|
65735
65971
|
case "create-refresh": {
|
|
65736
65972
|
const lines = [
|
|
65737
65973
|
this.menuRow(" ", "Name", color.text(state.customName), false),
|
|
65738
|
-
this.menuRow(" ", "Command", color.text(
|
|
65974
|
+
this.menuRow(" ", "Command", color.text(stripControlChars(state.customCommand)), false),
|
|
65739
65975
|
color.textStrong("Refresh"),
|
|
65740
65976
|
...CUSTOM_COMMAND_REFRESH_CHOICES_MS.map((ms, index) => {
|
|
65741
65977
|
const active = index === state.pickerIndex;
|
|
@@ -65765,7 +66001,7 @@ var FooterConfiguratorPanel = class {
|
|
|
65765
66001
|
case "create-timeout": {
|
|
65766
66002
|
const lines = [
|
|
65767
66003
|
this.menuRow(" ", "Name", color.text(state.customName), false),
|
|
65768
|
-
this.menuRow(" ", "Command", color.text(
|
|
66004
|
+
this.menuRow(" ", "Command", color.text(stripControlChars(state.customCommand)), false),
|
|
65769
66005
|
color.textStrong("Timeout"),
|
|
65770
66006
|
...CUSTOM_COMMAND_TIMEOUT_CHOICES_MS.map((ms, index) => {
|
|
65771
66007
|
const active = index === state.pickerIndex;
|
|
@@ -65797,7 +66033,7 @@ var FooterConfiguratorPanel = class {
|
|
|
65797
66033
|
const content = state.customKind === "command" ? state.customCommand : state.customText;
|
|
65798
66034
|
const lines = [
|
|
65799
66035
|
this.menuRow(" ", "Name", color.text(state.customName), false),
|
|
65800
|
-
this.menuRow(" ", contentLabel, color.text(
|
|
66036
|
+
this.menuRow(" ", contentLabel, color.text(stripControlChars(content)), false),
|
|
65801
66037
|
color.textStrong("Tone"),
|
|
65802
66038
|
...FOOTER_TONE_CHOICES.map((choice, index) => {
|
|
65803
66039
|
const marker = index === state.pickerIndex ? color.primary("›") : " ";
|
|
@@ -65953,7 +66189,7 @@ var FooterConfiguratorPanel = class {
|
|
|
65953
66189
|
* applied (tone replaces every span's tone; prefix/suffix wrap). */
|
|
65954
66190
|
itemPreview(ref) {
|
|
65955
66191
|
const def = this.registry.get(ref.id);
|
|
65956
|
-
if (def === void 0) return color.textMuted(
|
|
66192
|
+
if (def === void 0) return color.textMuted(stripControlChars(ref.id));
|
|
65957
66193
|
try {
|
|
65958
66194
|
const segment = def.render(this.snapshot(), ref, "preferred", {
|
|
65959
66195
|
taskBrowserAvailable: this.taskBrowserAvailable(),
|
|
@@ -66003,7 +66239,7 @@ var FooterConfiguratorPanel = class {
|
|
|
66003
66239
|
itemLabel(rowIndex, flat) {
|
|
66004
66240
|
const ref = this.refAt(rowIndex, flat);
|
|
66005
66241
|
if (ref === void 0) return "(no item)";
|
|
66006
|
-
return
|
|
66242
|
+
return this.refLabel(ref);
|
|
66007
66243
|
}
|
|
66008
66244
|
/** Count all layout references to a definition before a delete. */
|
|
66009
66245
|
referenceCount(id) {
|
|
@@ -66074,10 +66310,6 @@ function longestPasteStartSuffix(data) {
|
|
|
66074
66310
|
function toneMenuLabel(kind) {
|
|
66075
66311
|
return kind === "custom-tone" ? "Default tone" : "Tone";
|
|
66076
66312
|
}
|
|
66077
|
-
/** Clip a title-part label (titles truncate ANSI-safely anyway). */
|
|
66078
|
-
function clipText(text, max = 40) {
|
|
66079
|
-
return text.length <= max ? text : `${text.slice(0, Math.max(0, max - 1))}…`;
|
|
66080
|
-
}
|
|
66081
66313
|
/** Build one wording whose LAST segment is `Verb [Esc]`, the form the design
|
|
66082
66314
|
* language reserves for an affordance with a key (§7.1). */
|
|
66083
66315
|
function escapeWording(lead, verb) {
|
|
@@ -77044,8 +77276,8 @@ var EffectiveKeymap = class {
|
|
|
77044
77276
|
* rules as keysFor/editorKeysFor/keyHint — a working user override
|
|
77045
77277
|
* never leaves the replaced builtin advertised (review finding: the
|
|
77046
77278
|
* snapshot used to iterate the raw top-trigger set, so /keybindings
|
|
77047
|
-
* showed `Ctrl+X + Enter` for a working submit remap while
|
|
77048
|
-
* right). */
|
|
77279
|
+
* showed `Ctrl+X + Enter` for a working submit remap while the effective
|
|
77280
|
+
* key hint was right). */
|
|
77049
77281
|
snapshot() {
|
|
77050
77282
|
const bindings = [...new Set(this.visibleRules.map((rule) => rule.action))].sort().map((action) => {
|
|
77051
77283
|
const rules = this.visibleRulesFor(action);
|
|
@@ -95720,6 +95952,7 @@ var TuiApp = class TuiApp {
|
|
|
95720
95952
|
}
|
|
95721
95953
|
if (widthChanged) {
|
|
95722
95954
|
this.rebuildQueuePane(width);
|
|
95955
|
+
this.renderDock();
|
|
95723
95956
|
this.renderGoalLine();
|
|
95724
95957
|
}
|
|
95725
95958
|
if (widthChanged || heightChanged) {
|
|
@@ -96018,7 +96251,7 @@ var TuiApp = class TuiApp {
|
|
|
96018
96251
|
const active = todos.filter((todo) => todo.status !== "completed");
|
|
96019
96252
|
const done = todos.length - active.length;
|
|
96020
96253
|
const first = active[0];
|
|
96021
|
-
const label = first === void 0 ? "" : sanitizedPhysicalLine(first.content
|
|
96254
|
+
const label = first === void 0 ? "" : sanitizedPhysicalLine(first.content);
|
|
96022
96255
|
return [
|
|
96023
96256
|
done > 0 ? `${done} todo done` : "",
|
|
96024
96257
|
active.length > 0 ? `${active.length} active` : "",
|
|
@@ -96642,7 +96875,7 @@ var TuiApp = class TuiApp {
|
|
|
96642
96875
|
renderDock() {
|
|
96643
96876
|
const extensionDock = this.extensionHost?.dockText() ?? "";
|
|
96644
96877
|
const summary = this.todoSummaryText();
|
|
96645
|
-
const hostLine = summary === "" ? "" : color.textDim(`☑ ${summary}
|
|
96878
|
+
const hostLine = summary === "" ? "" : color.textDim(truncateToWidth(`☑ ${summary}`, this.terminal.columns, "…"));
|
|
96646
96879
|
this.extensionHost?.setDockMaxRows(2);
|
|
96647
96880
|
if (this.extensionHost !== void 0) {
|
|
96648
96881
|
this.dock.setText(extensionDock);
|
|
@@ -106838,7 +107071,7 @@ function createSubmissionController(deps) {
|
|
|
106838
107071
|
line: commandLine,
|
|
106839
107072
|
signal: commandSignal
|
|
106840
107073
|
}).then((execution) => {
|
|
106841
|
-
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");
|
|
107074
|
+
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");
|
|
106842
107075
|
return execution === void 0 ? {
|
|
106843
107076
|
kind: "committed",
|
|
106844
107077
|
matched: false
|
|
@@ -107414,7 +107647,8 @@ function createSubmissionController(deps) {
|
|
|
107414
107647
|
}
|
|
107415
107648
|
const isSessionless = parsed !== void 0 && classification.kind === "client-command" && classification.source === "tui" && SESSIONLESS_COMMANDS.has(parsed.name);
|
|
107416
107649
|
const tuiLocalLine = classification.kind === "client-command";
|
|
107417
|
-
const
|
|
107650
|
+
const needsBusyEnter = parsed === void 0 || parsed.name === "skill" && (parsed.rawInput?.trim() ?? "") !== "" || !tuiLocalLine;
|
|
107651
|
+
const delivery = request === "explicit-queue" ? "queue" : resolveSubmitDelivery(parsed, deps.liveAgent()?.status === "running", request, needsBusyEnter ? deps.tuiSettings?.get().busyEnter : void 0, tuiLocalLine);
|
|
107418
107652
|
if (classification.kind === "host-command") {
|
|
107419
107653
|
settleHoldForLegacyRoute();
|
|
107420
107654
|
dispatchViaSession(text, persistHistory, delivery);
|
|
@@ -121620,7 +121854,7 @@ function createProfileDaemonAdmin(profile, deps) {
|
|
|
121620
121854
|
*/
|
|
121621
121855
|
function profileDaemonAdminRun(profile, deps = {}) {
|
|
121622
121856
|
return async (verb) => {
|
|
121623
|
-
const { runDaemonControl } = await import("./local-daemon-control-
|
|
121857
|
+
const { runDaemonControl } = await import("./local-daemon-control-C14q9KnD.mjs");
|
|
121624
121858
|
return await runDaemonControl({ verb }, profile, deps);
|
|
121625
121859
|
};
|
|
121626
121860
|
}
|
|
@@ -134643,7 +134877,7 @@ async function selectRendererMount(deps) {
|
|
|
134643
134877
|
/** The PRODUCTION connector: lazy import + the official SDK connect. */
|
|
134644
134878
|
function productionTspConnector(deps) {
|
|
134645
134879
|
return async () => {
|
|
134646
|
-
const { connectTspRenderer } = await import("./session-
|
|
134880
|
+
const { connectTspRenderer } = await import("./session-C6tSs86s.mjs");
|
|
134647
134881
|
return connectTspRenderer(deps);
|
|
134648
134882
|
};
|
|
134649
134883
|
}
|