@xmoon76/dsh-pi-tui 0.4.7-alpha.2 → 0.4.9

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/dist/index.d.mts CHANGED
@@ -3,7 +3,7 @@ import z from "@deepseek-ai/schemastery";
3
3
  import { Agent, ModelSelectionRef } from "@deepseek-ai/dsh-agent";
4
4
  import { ContentBlock } from "@deepseek-ai/dsh-llm";
5
5
  import { SessionId } from "@deepseek-ai/dsh-session";
6
- import { Context } from "@deepseek-ai/cordis";
6
+ import { Context, Volatile } from "@deepseek-ai/cordis";
7
7
  //#region src/image/admission.d.ts
8
8
  /** Structural subset of `ImageAttachmentRef`. */
9
9
  interface ImageAttachmentRefLike {
@@ -84,6 +84,43 @@ interface DraftImageStoreLike {
84
84
  values(): readonly DraftImage[];
85
85
  }
86
86
  //#endregion
87
+ //#region src/display-preset.d.ts
88
+ /**
89
+ * Canonical transcript display presets and their layered disclosure policy.
90
+ *
91
+ * DisplayPreset is the one runtime vocabulary for presentation state. Every
92
+ * preset whose projection exists in this build is available; the availability
93
+ * gate exists so a future preset can never be claimed by another preset's
94
+ * renderer before its own projection ships.
95
+ * @module @xmoon76/dsh-pi-tui/display-preset
96
+ */
97
+ /** The complete display vocabulary. */
98
+ type DisplayPreset = 'focus' | 'compact' | 'full';
99
+ /** The shared mutable display authority passed between the runner, prompt and UI. */
100
+ interface DisplayState {
101
+ preset: DisplayPreset;
102
+ }
103
+ //#endregion
104
+ //#region src/diag.d.ts
105
+ interface Diag {
106
+ debug(message: string, fields?: Record<string, unknown>): void;
107
+ info(message: string, fields?: Record<string, unknown>): void;
108
+ warn(message: string, fields?: Record<string, unknown>): void;
109
+ error(message: string, fields?: Record<string, unknown>): void;
110
+ /** Release the file handle, if one is open. */
111
+ dispose(): void;
112
+ }
113
+ //#endregion
114
+ //#region src/communication-policy.d.ts
115
+ type ProgressUpdates = 'off' | 'milestones' | 'frequent';
116
+ type ResponseStyle = 'default' | 'concise' | 'explanatory';
117
+ interface ProgressUpdatesState {
118
+ mode: ProgressUpdates;
119
+ }
120
+ interface ResponseStyleState {
121
+ style: ResponseStyle;
122
+ }
123
+ //#endregion
87
124
  //#region src/skill-catalog.d.ts
88
125
  /**
89
126
  * The standing-scope skill catalog adapter: the SINGLE narrow seam between
@@ -123,16 +160,6 @@ interface HumanSkillCatalog {
123
160
  readonly complete: boolean;
124
161
  }
125
162
  //#endregion
126
- //#region src/diag.d.ts
127
- interface Diag {
128
- debug(message: string, fields?: Record<string, unknown>): void;
129
- info(message: string, fields?: Record<string, unknown>): void;
130
- warn(message: string, fields?: Record<string, unknown>): void;
131
- error(message: string, fields?: Record<string, unknown>): void;
132
- /** Release the file handle, if one is open. */
133
- dispose(): void;
134
- }
135
- //#endregion
136
163
  //#region src/tui-app.d.ts
137
164
  /** The compaction lifecycle phase the working row advertises: idle (no
138
165
  * compaction), summarizing (compaction/start seen, the summary is being
@@ -265,7 +292,12 @@ type HostCommandClaim = {
265
292
  declare const name = "tui-runner";
266
293
  /** Core services required before the TUI can mount. */
267
294
  declare const inject: string[];
268
- /** Plugin config: the session to resume, resolved from the startup service. */
295
+ /** Plugin config: the session to resume, resolved from the startup service,
296
+ * plus the DSH 0.1.7 profile-owned live TUI preferences. Every preference
297
+ * field is a schemastery `.volatile()` reference (PR A): the `tui-app`
298
+ * plugin's Config is the ONE runtime authority, Loader commits live updates
299
+ * into the references without remounting, and the Settings service projects
300
+ * these fields into editable forms keyed by the `tui-app` profile entry. */
269
301
  interface Config {
270
302
  /** Resumed session id; a fresh session is created when absent. */
271
303
  sessionId?: string;
@@ -279,6 +311,58 @@ interface Config {
279
311
  readonly isTTY?: boolean;
280
312
  write(text: string): unknown;
281
313
  };
314
+ /** Theme values: auto | dark | light | custom:<name>. */
315
+ readonly theme: Volatile<string>;
316
+ readonly iconStyle: Volatile<string>;
317
+ readonly footer: Volatile<string>;
318
+ /** The user's LAST NATIVE footer mode ('default' | 'compact' | 'custom'):
319
+ * persisted separately because `footer` itself is overwritten by
320
+ * 'command' when the command surface arms — the command surface's failure
321
+ * fallback resolves from THIS, so a compact user's fallback survives a
322
+ * restart. */
323
+ readonly footerFallbackMode: Volatile<string>;
324
+ /** The M2 versioned custom footer layout (a nested object, never a JSON
325
+ * string). No schema default: parseFooterLayout is the authority on the
326
+ * persisted value and resolves absence to the builtin default layout. */
327
+ readonly footerLayout: Volatile<unknown>;
328
+ /** PR C: the Custom Text/Command definition collection, retained as raw
329
+ * data — the fail-soft parser (footer/custom-items.ts) owns validation. */
330
+ readonly footerCustomItems: Volatile<unknown>;
331
+ /** M5: the trusted command status-line config (armed ONLY while the USER
332
+ * profile layer owns it — see resolveTrustedFooterCommand). */
333
+ readonly footerCommand: Volatile<unknown>;
334
+ readonly fullscreen: Volatile<string>;
335
+ /** Busy-Enter delivery for plain Enter while the agent runs: 'queue'
336
+ * (default) or 'steer'. */
337
+ readonly busyEnter: Volatile<string>;
338
+ /** Local-shell sandbox for user-typed `!`/`!!` commands: 'bypass'
339
+ * (default) runs them outside the dsh sandbox, 'sandbox' routes them
340
+ * through the dsh shell capability's policy. */
341
+ readonly localShellSandbox: Volatile<string>;
342
+ /** Home/End navigation behavior (issue #9): 'input' (default) moves
343
+ * within the input, 'viewport' keeps Home/End scrolling. */
344
+ readonly homeEndKeys: Volatile<string>;
345
+ /** Canonical transcript display preset (focus | compact | full). */
346
+ readonly displayPreset: Volatile<string>;
347
+ /** Mid-turn progress-update cadence (off | milestones | frequent). */
348
+ readonly progressUpdates: Volatile<string>;
349
+ /** Visible-answer density guidance (default | concise | explanatory). */
350
+ readonly responseStyle: Volatile<string>;
351
+ /** Completion-notification mode ('unfocused' | 'always' | 'off'). */
352
+ readonly notificationMode: Volatile<string>;
353
+ /** Completion-notification method ('auto' | 'osc9' | 'osc777' | 'bell'). */
354
+ readonly notificationMethod: Volatile<string>;
355
+ /** Fullscreen mouse-wheel step ('1' | '2' | '3' | '5' | '8'). */
356
+ readonly wheelScrollLines: Volatile<string>;
357
+ /** The user keybinding overrides as a whole-value RAW field. The
358
+ * keybindings parser (src/keybindings/config.ts) is the only
359
+ * validation/parsing authority — the keybinding business schema
360
+ * deliberately stays out of the plugin Config. */
361
+ readonly keybindings: Volatile<unknown>;
362
+ /** Internal one-shot legacy-migration marker (PR A §8.3): never a
363
+ * product row, never a behavior switch — it only keeps the retired
364
+ * settings.yaml(.imported) from re-overwriting newer user values. */
365
+ readonly legacySettingsMigrationVersion: Volatile<number>;
282
366
  }
283
367
  declare const Config: z<Config>;
284
368
  /**
@@ -672,20 +756,43 @@ declare function foldQueueRows(messages: readonly QueueInboxMessage[], mode: 'fo
672
756
  */
673
757
  declare function dangerCommand(command: string): boolean;
674
758
  /**
675
- * The dsh profile this process was launched with (the `--profile` flag),
676
- * so the exit-time resume hint names the profile the TUI actually runs
677
- * under. Falls back to `pi-tui` when the flag is absent (the TUI bundle
678
- * cannot load without a profile, so this is defensive only).
759
+ * The dsh profile named by the `--profile` flag in `argv`, in both spellings.
760
+ * This is the ARGV-ONLY fallback: it cannot see the positional `dsh <name>`
761
+ * launch form, because the launcher consumes that bare name by synthesizing
762
+ * `['--profile', ...argv]` for its OWN commander parse and leaves
763
+ * `process.argv` untouched. Prefer {@link hostRunningProfile}, which reads the
764
+ * Host's profile identity instead of scraping the command line.
679
765
  * @param argv - the process argument vector.
680
766
  * @param fallback - the default profile.
681
767
  */
682
768
  declare function runningProfile(argv?: readonly string[], fallback?: string): string;
769
+ /** The one context read {@link hostRunningProfile} needs (a cordis Context satisfies it). */
770
+ interface ProfileContextReadLike {
771
+ get(name: string): unknown;
772
+ }
773
+ /**
774
+ * The profile this process actually runs — the official Host
775
+ * `profileContext.name` when it is composed, else {@link runningProfile}'s
776
+ * argv scrape.
777
+ *
778
+ * `profileContext.name` is the launcher's own profile identity, so it is
779
+ * correct for EVERY launch form: `--profile <name>`, `--profile=<name>`, the
780
+ * positional `dsh <name>`, and `--from-default-profile <name>`. The argv
781
+ * scrape only knows the flag form, which is why it is the fallback for a
782
+ * profile-less mount (tests, an embedded surface) rather than the primary
783
+ * source.
784
+ * @param ctx - the plugin context (or any structural `get`-only stand-in).
785
+ * @param argv - the process argument vector for the fallback path.
786
+ * @param fallback - the default profile for the fallback path.
787
+ * @returns the running profile name.
788
+ */
789
+ declare function hostRunningProfile(ctx: ProfileContextReadLike, argv?: readonly string[], fallback?: string): string;
683
790
  /**
684
791
  * The interactive-quit resume hint (pi parity): `dsh --profile <p>
685
792
  * --session <id>`, printed after the terminal restores so the user can
686
793
  * re-enter the session later. Returns undefined when there is no session
687
794
  * to resume (deferred start never created one).
688
- * @param profile - the running profile ({@link runningProfile}).
795
+ * @param profile - the running profile ({@link hostRunningProfile}).
689
796
  * @param sessionId - the live session id.
690
797
  * @returns the resume command line, or undefined without a session.
691
798
  */
@@ -806,23 +913,22 @@ interface LegacyAgentComposition {
806
913
  * standalone composition callers; that branch installs the caller-owned ref
807
914
  * and does not require an Agent.
808
915
  * @param presetId - the requested preset, or `undefined` for the default.
809
- * @param focusState - the shared Focus runtime state (STRUCTURAL on
810
- * purpose: the public declaration bundle must not inline src/focus.ts —
811
- * the parameter only ever carries the runner's FocusState object, so a
812
- * bare `{ enabled: boolean }` keeps the shipped .d.mts clean); when
813
- * provided, the setup ALSO installs the dynamic Focus system-prompt
916
+ * @param displayState - the shared canonical DisplayState. When provided, the
917
+ * setup also installs the dynamic Focus system-prompt
814
918
  * section exactly once per composed agent (plan §9 — every composed
815
919
  * root TUI agent gets it; /focus toggles never re-register).
816
920
  * @param diag - the diagnostics channel, when the caller has one.
921
+ * @param progressUpdatesState - optional live mid-turn update cadence. The
922
+ * effective text is derived from this state AND `displayState` (Focus
923
+ * suppresses the progress section without mutating this state), so a
924
+ * progress state without a display state is not installable.
925
+ * @param responseStyleState - optional live visible-answer style guidance,
926
+ * independent of display.
817
927
  * @returns the id to record on the header (absent without a roster) and the setup callback.
818
928
  * @throws when the roster supplies no such preset.
819
929
  */
820
- declare function composeAgent(ctx: Context, installSelection: ModelSelectionRef, presetId?: string, focusState?: {
821
- enabled: boolean;
822
- }, diag?: Diag): Promise<LegacyAgentComposition>;
823
- declare function composeAgent(ctx: Context, installSelection: (agentCtx: Context, agent: Agent) => void, presetId?: string, focusState?: {
824
- enabled: boolean;
825
- }, diag?: Diag): Promise<AgentComposition>;
930
+ declare function composeAgent(ctx: Context, installSelection: ModelSelectionRef, presetId?: string, displayState?: DisplayState, diag?: Diag, progressUpdatesState?: ProgressUpdatesState, responseStyleState?: ResponseStyleState): Promise<LegacyAgentComposition>;
931
+ declare function composeAgent(ctx: Context, installSelection: (agentCtx: Context, agent: Agent) => void, presetId?: string, displayState?: DisplayState, diag?: Diag, progressUpdatesState?: ProgressUpdatesState, responseStyleState?: ResponseStyleState): Promise<AgentComposition>;
826
932
  /**
827
933
  * The preset a persisted session actually runs, read from the DSH 0.1.6 V3
828
934
  * session projection (header initialization plus the latest selection event).
@@ -839,4 +945,4 @@ declare function recordedPreset(ctx: Context, sessionId: string): Promise<string
839
945
  */
840
946
  declare function apply(ctx: Context, config: Config): void;
841
947
  //#endregion
842
- export { AgentComposition, CompactionFold, CompactionSettleSurface, Config, HOST_COMMAND_CATALOG, InitialCatalogResolution, InterruptAgentLike, InterruptWriteOutcome, InterruptWriterLike, LOCAL_COMMANDS, PendingSubagentCall, QueueFoldResult, QueueInboxMessage, ResolveInitialCatalogOptions, SESSIONLESS_COMMANDS, ViewerOpenToken, apply, busyAfterTurnBoundary, commandIsLocalForAttachments, commandRejectsImages, compactingFromLog, composeAgent, contextRefreshKind, createViewerOpenToken, dangerCommand, foldCompactionEvent, foldQueueRows, inject, interruptAgent, isBareCommandLine, isLocalCommandLine, isPlainExitPrompt, matchPendingSubagentCall, name, normalizeSkillInvocation, recordedPreset, resolveInitialCatalog, resolveSubmitDelivery, resumeCommand, runningProfile, settleCompactionSurface, shouldConsumeAdvertisedMiss, subagentJobTranscriptId, subagentJobViewHint, taskRowSelectionDisposition, teardownViewerForSessionSwap, viewerActionCapability };
948
+ export { AgentComposition, CompactionFold, CompactionSettleSurface, Config, HOST_COMMAND_CATALOG, InitialCatalogResolution, InterruptAgentLike, InterruptWriteOutcome, InterruptWriterLike, LOCAL_COMMANDS, PendingSubagentCall, ProfileContextReadLike, QueueFoldResult, QueueInboxMessage, ResolveInitialCatalogOptions, SESSIONLESS_COMMANDS, ViewerOpenToken, apply, busyAfterTurnBoundary, commandIsLocalForAttachments, commandRejectsImages, compactingFromLog, composeAgent, contextRefreshKind, createViewerOpenToken, dangerCommand, foldCompactionEvent, foldQueueRows, hostRunningProfile, inject, interruptAgent, isBareCommandLine, isLocalCommandLine, isPlainExitPrompt, matchPendingSubagentCall, name, normalizeSkillInvocation, recordedPreset, resolveInitialCatalog, resolveSubmitDelivery, resumeCommand, runningProfile, settleCompactionSurface, shouldConsumeAdvertisedMiss, subagentJobTranscriptId, subagentJobViewHint, taskRowSelectionDisposition, teardownViewerForSessionSwap, viewerActionCapability };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { A as shouldConsumeAdvertisedMiss, C as normalizeSkillInvocation, D as resumeCommand, E as resolveSubmitDelivery, F as viewerActionCapability, M as subagentJobViewHint, N as taskRowSelectionDisposition, O as runningProfile, P as teardownViewerForSessionSwap, S as name, T as resolveInitialCatalog, _ as interruptAgent, a as apply, b as isPlainExitPrompt, c as commandRejectsImages, d as contextRefreshKind, f as createViewerOpenToken, g as inject, h as foldQueueRows, i as SESSIONLESS_COMMANDS, j as subagentJobTranscriptId, k as settleCompactionSurface, l as compactingFromLog, m as foldCompactionEvent, n as HOST_COMMAND_CATALOG, o as busyAfterTurnBoundary, p as dangerCommand, r as LOCAL_COMMANDS, s as commandIsLocalForAttachments, t as Config, u as composeAgent, v as isBareCommandLine, w as recordedPreset, x as matchPendingSubagentCall, y as isLocalCommandLine } from "./src-5aY9svZj.mjs";
2
- export { Config, HOST_COMMAND_CATALOG, LOCAL_COMMANDS, SESSIONLESS_COMMANDS, apply, busyAfterTurnBoundary, commandIsLocalForAttachments, commandRejectsImages, compactingFromLog, composeAgent, contextRefreshKind, createViewerOpenToken, dangerCommand, foldCompactionEvent, foldQueueRows, inject, interruptAgent, isBareCommandLine, isLocalCommandLine, isPlainExitPrompt, matchPendingSubagentCall, name, normalizeSkillInvocation, recordedPreset, resolveInitialCatalog, resolveSubmitDelivery, resumeCommand, runningProfile, settleCompactionSurface, shouldConsumeAdvertisedMiss, subagentJobTranscriptId, subagentJobViewHint, taskRowSelectionDisposition, teardownViewerForSessionSwap, viewerActionCapability };
1
+ import { A as settleCompactionSurface, C as name, D as resolveSubmitDelivery, E as resolveInitialCatalog, F as teardownViewerForSessionSwap, I as viewerActionCapability, M as subagentJobTranscriptId, N as subagentJobViewHint, O as resumeCommand, P as taskRowSelectionDisposition, S as matchPendingSubagentCall, T as recordedPreset, _ as inject, a as apply, b as isLocalCommandLine, c as commandRejectsImages, d as contextRefreshKind, f as createViewerOpenToken, g as hostRunningProfile, h as foldQueueRows, i as SESSIONLESS_COMMANDS, j as shouldConsumeAdvertisedMiss, k as runningProfile, l as compactingFromLog, m as foldCompactionEvent, n as HOST_COMMAND_CATALOG, o as busyAfterTurnBoundary, p as dangerCommand, r as LOCAL_COMMANDS, s as commandIsLocalForAttachments, t as Config, u as composeAgent, v as interruptAgent, w as normalizeSkillInvocation, x as isPlainExitPrompt, y as isBareCommandLine } from "./src-BAwPimrH.mjs";
2
+ export { Config, HOST_COMMAND_CATALOG, LOCAL_COMMANDS, SESSIONLESS_COMMANDS, apply, busyAfterTurnBoundary, commandIsLocalForAttachments, commandRejectsImages, compactingFromLog, composeAgent, contextRefreshKind, createViewerOpenToken, dangerCommand, foldCompactionEvent, foldQueueRows, hostRunningProfile, inject, interruptAgent, isBareCommandLine, isLocalCommandLine, isPlainExitPrompt, matchPendingSubagentCall, name, normalizeSkillInvocation, recordedPreset, resolveInitialCatalog, resolveSubmitDelivery, resumeCommand, runningProfile, settleCompactionSurface, shouldConsumeAdvertisedMiss, subagentJobTranscriptId, subagentJobViewHint, taskRowSelectionDisposition, teardownViewerForSessionSwap, viewerActionCapability };