@xmoon76/dsh-pi-tui 0.3.5 → 0.4.0-alpha.1

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
@@ -5,6 +5,7 @@ import { ContentBlock } from "@deepseek-ai/dsh-llm";
5
5
  import { SessionEvent, SessionId } from "@deepseek-ai/dsh-session";
6
6
  import { CommandDescriptor } from "@deepseek-ai/dsh-commands";
7
7
  import { Context } from "@deepseek-ai/cordis";
8
+ import { SessionEvent as SessionEvent$1 } from "@deepseek-ai/dsh-session/types";
8
9
  //#region src/image/admission.d.ts
9
10
  /** Structural subset of `ImageAttachmentRef`. */
10
11
  interface ImageAttachmentRefLike {
@@ -210,6 +211,16 @@ declare const inject: string[];
210
211
  interface Config {
211
212
  /** Resumed session id; a fresh session is created when absent. */
212
213
  sessionId?: string;
214
+ /** Test seam: the pre-mount status output (defaults to process.stdout,
215
+ * TTY-gated). Injectable so the runner tests capture the status writes
216
+ * without patching the global stdout (which would fight the test
217
+ * reporter's own writes). STRUCTURAL on purpose: the public Config type
218
+ * must not reference the internal startup-status module (the public
219
+ * .d.mts leak gate). */
220
+ startupStatusOutput?: {
221
+ readonly isTTY?: boolean;
222
+ write(text: string): unknown;
223
+ };
213
224
  }
214
225
  declare const Config: z<Config>;
215
226
  /**
@@ -467,6 +478,11 @@ interface ResolveInitialCatalogOptions {
467
478
  /** The context surface the collectors read services from. */
468
479
  readonly ctx: SurfaceCatalogContext;
469
480
  readonly diag: Diag;
481
+ /** Suspend the pre-mount startup status before an ordinary log write
482
+ * (the status owns the current terminal line; a TTY shares one cursor
483
+ * between stdout and stderr). Called right before every diag.warn this
484
+ * function may emit. */
485
+ readonly onLog?: () => void;
470
486
  }
471
487
  declare function resolveInitialCatalog(options: ResolveInitialCatalogOptions): Promise<InitialCatalogResolution>;
472
488
  declare function subagentJobTranscriptId(snapshot: unknown): string | undefined;
@@ -635,6 +651,15 @@ declare function settleCompactionSurface(app: CompactionSettleSurface, refreshSt
635
651
  * turn can close (turn/end) before its compaction settles, and the
636
652
  * single-Esc cancel must stay armed until compaction/end. */
637
653
  declare function busyAfterTurnBoundary(eventType: 'turn/start' | 'turn/end', compacting: boolean): boolean;
654
+ /** PR D2 test seam: whether a session event type marks the model-visible
655
+ * context dirty (re-measure through the SessionReader port) or only
656
+ * repaints cheaply (cached measurement). The firehose routes every event
657
+ * through this classification — the single source of truth for the
658
+ * status/measurement split. `compaction/end` is classified 'measure' but
659
+ * the firehose deliberately SKIPS it here: a matched compaction settle
660
+ * re-measures through the fold-outcome path (settleCompactionSurface), so
661
+ * a STALE compaction/end can never trigger a measurement. */
662
+ declare function contextRefreshKind(eventType: string): 'measure' | 'cheap';
638
663
  /**
639
664
  * The in-flight compaction state a resumed session log implies: the newest
640
665
  * compaction bracket decides. A `session/end-seed` boundary makes any
@@ -670,7 +695,10 @@ interface AgentComposition {
670
695
  * A deployment with no roster composes nothing and every session shares the
671
696
  * host composition, which is the behavior before presets existed.
672
697
  * @param ctx - the runner context (services read through `ctx.get`).
673
- * @param selected - the mutable model selection every setup installs.
698
+ * @param installSelection - installs a fresh Agent-local model selection ref
699
+ * during setup. A ModelSelectionRef is still accepted for source
700
+ * compatibility with standalone composition callers; the runner always
701
+ * supplies the Agent-local installer.
674
702
  * @param presetId - the requested preset, or `undefined` for the default.
675
703
  * @param focusState - the shared Focus runtime state (STRUCTURAL on
676
704
  * purpose: the public declaration bundle must not inline src/focus.ts —
@@ -683,13 +711,12 @@ interface AgentComposition {
683
711
  * @returns the id to record on the header (absent without a roster) and the setup callback.
684
712
  * @throws when the roster supplies no such preset.
685
713
  */
686
- declare function composeAgent(ctx: Context, selected: ModelSelectionRef, presetId?: string, focusState?: {
714
+ declare function composeAgent(ctx: Context, installSelection: ((agentCtx: Context) => void) | ModelSelectionRef, presetId?: string, focusState?: {
687
715
  enabled: boolean;
688
716
  }, diag?: Diag): Promise<AgentComposition>;
689
717
  /**
690
- * The preset a persisted session actually runs, from its log (newest
691
- * selection winning), or undefined when persistence is absent, the session is
692
- * unknown, or its log predates the roster.
718
+ * The preset a persisted session actually runs, resolved by the DSH 0.1.2+
719
+ * session projection (header initialization plus the latest selection event).
693
720
  * @param ctx - the runner context.
694
721
  * @param sessionId - the persisted session id.
695
722
  * @returns the recorded preset id, or undefined to compose the default.
@@ -698,7 +725,7 @@ declare function recordedPreset(ctx: Context, sessionId: string): Promise<string
698
725
  /** The session surface {@link recomposeBlank} needs: its log and the append seam. */
699
726
  interface RecomposableSession {
700
727
  readonly id: string;
701
- readonly events: readonly SessionEvent[];
728
+ readonly events: readonly SessionEvent$1[];
702
729
  append(type: 'agent-preset/selected', data: {
703
730
  agentPreset: string;
704
731
  }): unknown;
@@ -735,4 +762,4 @@ declare function recomposeBlank(ctx: Context, agent: {
735
762
  */
736
763
  declare function apply(ctx: Context, config: Config): void;
737
764
  //#endregion
738
- export { AgentComposition, CompactionFold, CompactionSettleSurface, Config, HOST_COMMAND_CATALOG, InitialCatalogResolution, InterruptAgentLike, InterruptWriterLike, LOCAL_COMMANDS, PendingSubagentCall, QueueFoldResult, QueueInboxMessage, QueueNoticeSource, RecomposableSession, RecomposeOutcome, ResolveInitialCatalogOptions, SESSIONLESS_COMMANDS, SessionLockRefusedError, ViewerOpenToken, apply, busyAfterTurnBoundary, commandRejectsImages, compactingFromLog, composeAgent, createViewerOpenToken, dangerCommand, foldCompactionEvent, foldQueueRows, forkSeed, inject, interruptAgent, isPlainExitPrompt, isSubagentSettlementNotice, isUserQueueInput, matchPendingSubagentCall, name, normalizeSkillInvocation, recomposeBlank, recordedPreset, resolveInitialCatalog, resumeCommand, runningProfile, settleCompactionSurface, shouldConsumeAdvertisedMiss, shouldSteerOnEnter, subagentJobTranscriptId, subagentJobViewHint, subagentNoticeIsFailure, teardownViewerForSessionSwap, viewerActionCapability };
765
+ export { AgentComposition, CompactionFold, CompactionSettleSurface, Config, HOST_COMMAND_CATALOG, InitialCatalogResolution, InterruptAgentLike, InterruptWriterLike, LOCAL_COMMANDS, PendingSubagentCall, QueueFoldResult, QueueInboxMessage, QueueNoticeSource, RecomposableSession, RecomposeOutcome, ResolveInitialCatalogOptions, SESSIONLESS_COMMANDS, SessionLockRefusedError, ViewerOpenToken, apply, busyAfterTurnBoundary, commandRejectsImages, compactingFromLog, composeAgent, contextRefreshKind, createViewerOpenToken, dangerCommand, foldCompactionEvent, foldQueueRows, forkSeed, inject, interruptAgent, isPlainExitPrompt, isSubagentSettlementNotice, isUserQueueInput, matchPendingSubagentCall, name, normalizeSkillInvocation, recomposeBlank, recordedPreset, resolveInitialCatalog, resumeCommand, runningProfile, settleCompactionSurface, shouldConsumeAdvertisedMiss, shouldSteerOnEnter, subagentJobTranscriptId, subagentJobViewHint, subagentNoticeIsFailure, teardownViewerForSessionSwap, viewerActionCapability };
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
+ import { A as shouldConsumeAdvertisedMiss, C as normalizeSkillInvocation, D as resumeCommand, E as resolveInitialCatalog, F as teardownViewerForSessionSwap, I as viewerActionCapability, M as subagentJobTranscriptId, N as subagentJobViewHint, O as runningProfile, P as subagentNoticeIsFailure, R as forkSeed, S as name, T as recordedPreset, _ as interruptAgent, a as SessionLockRefusedError, b as isUserQueueInput, c as commandRejectsImages, d as contextRefreshKind, f as createViewerOpenToken, g as inject, h as foldQueueRows, i as SESSIONLESS_COMMANDS, j as shouldSteerOnEnter, k as settleCompactionSurface, l as compactingFromLog, m as foldCompactionEvent, n as HOST_COMMAND_CATALOG, o as apply, p as dangerCommand, r as LOCAL_COMMANDS, s as busyAfterTurnBoundary, t as Config, u as composeAgent, v as isPlainExitPrompt, w as recomposeBlank, x as matchPendingSubagentCall, y as isSubagentSettlementNotice } from "./src-syk6h8J9.mjs";
1
2
  import "./startup.mjs";
2
- import { A as shouldSteerOnEnter, C as recomposeBlank, D as runningProfile, E as resumeCommand, F as viewerActionCapability, L as forkSeed, M as subagentJobViewHint, N as subagentNoticeIsFailure, O as settleCompactionSurface, P as teardownViewerForSessionSwap, S as normalizeSkillInvocation, T as resolveInitialCatalog, _ as isPlainExitPrompt, a as SessionLockRefusedError, b as matchPendingSubagentCall, c as commandRejectsImages, d as createViewerOpenToken, f as dangerCommand, g as interruptAgent, h as inject, i as SESSIONLESS_COMMANDS, j as subagentJobTranscriptId, k as shouldConsumeAdvertisedMiss, l as compactingFromLog, m as foldQueueRows, n as HOST_COMMAND_CATALOG, o as apply, p as foldCompactionEvent, r as LOCAL_COMMANDS, s as busyAfterTurnBoundary, t as Config, u as composeAgent, v as isSubagentSettlementNotice, w as recordedPreset, x as name, y as isUserQueueInput } from "./src-B93JMbsv.mjs";
3
- export { Config, HOST_COMMAND_CATALOG, LOCAL_COMMANDS, SESSIONLESS_COMMANDS, SessionLockRefusedError, apply, busyAfterTurnBoundary, commandRejectsImages, compactingFromLog, composeAgent, createViewerOpenToken, dangerCommand, foldCompactionEvent, foldQueueRows, forkSeed, inject, interruptAgent, isPlainExitPrompt, isSubagentSettlementNotice, isUserQueueInput, matchPendingSubagentCall, name, normalizeSkillInvocation, recomposeBlank, recordedPreset, resolveInitialCatalog, resumeCommand, runningProfile, settleCompactionSurface, shouldConsumeAdvertisedMiss, shouldSteerOnEnter, subagentJobTranscriptId, subagentJobViewHint, subagentNoticeIsFailure, teardownViewerForSessionSwap, viewerActionCapability };
3
+ export { Config, HOST_COMMAND_CATALOG, LOCAL_COMMANDS, SESSIONLESS_COMMANDS, SessionLockRefusedError, apply, busyAfterTurnBoundary, commandRejectsImages, compactingFromLog, composeAgent, contextRefreshKind, createViewerOpenToken, dangerCommand, foldCompactionEvent, foldQueueRows, forkSeed, inject, interruptAgent, isPlainExitPrompt, isSubagentSettlementNotice, isUserQueueInput, matchPendingSubagentCall, name, normalizeSkillInvocation, recomposeBlank, recordedPreset, resolveInitialCatalog, resumeCommand, runningProfile, settleCompactionSurface, shouldConsumeAdvertisedMiss, shouldSteerOnEnter, subagentJobTranscriptId, subagentJobViewHint, subagentNoticeIsFailure, teardownViewerForSessionSwap, viewerActionCapability };