@qilin-agent/client-ui-chat 3.1.3 → 3.1.4

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.
@@ -1,14 +1,16 @@
1
- /**
2
- * Runtime vocabulary derived from the persisted work-details mode. Renderers
3
- * and seats select single fields of this policy; none of them compares the
4
- * mode enum, so adding a mode changes only the table below.
5
- */
1
+ /** Chat presentation derived from Host-backed detail and in-memory collapse timing. */
6
2
  import type { ObservableSnapshot } from '@qilin-agent/client-store';
7
3
  import type { TranscriptViewMode } from '../chat-settings.ts';
4
+ /** Available points when a completed Turn returns to its historical presentation. */
5
+ export declare const COLLAPSE_TIMINGS: readonly ["completion", "next-input"];
6
+ /** When a completed Turn returns to its historical presentation. */
7
+ export type CollapseTiming = typeof COLLAPSE_TIMINGS[number];
8
8
  /** Presentation capabilities that one work-details mode enables. */
9
9
  export interface ChatPresentationPolicy {
10
- /** Mode this policy was derived from; for diagnostics, never for branching in renderers. */
10
+ /** Preference identity for layout resets and diagnostics; renderers select the capabilities below. */
11
11
  readonly mode: TranscriptViewMode;
12
+ /** Browser-local experiment; completion retains the default immediate folding and scrolling. */
13
+ readonly collapseTiming: CollapseTiming;
12
14
  /** Whether a normally completed Turn folds its process rows behind the whole-Turn control. */
13
15
  readonly foldCompletedTurns: boolean;
14
16
  /** Collapsible group headers for all Turns, historical Turns only, or no Turns. */
@@ -19,17 +21,17 @@ export interface ChatPresentationPolicy {
19
21
  readonly settledReasoningPreview: boolean;
20
22
  }
21
23
  /**
22
- * Resolve the policy constant for one mode. The same mode always yields the
23
- * same object, so selectors over a policy see stable identities.
24
+ * Resolve a stable policy for one detail mode and collapse timing.
24
25
  * @param mode - persisted work-details mode.
25
- * @returns the mode's presentation policy.
26
+ * @param collapseTiming - in-memory timing; defaults to immediate completion folding.
27
+ * @returns the same policy object for the same pair of choices.
26
28
  */
27
- export declare function presentationPolicyFor(mode: TranscriptViewMode): ChatPresentationPolicy;
29
+ export declare function presentationPolicyFor(mode: TranscriptViewMode, collapseTiming?: CollapseTiming): ChatPresentationPolicy;
28
30
  /**
29
- * Derive a policy observable from the mode observable without a subscription of
30
- * its own: reads are a table lookup and change notifications are the mode's.
31
+ * Combine Host-backed detail and in-memory timing without owning subscriptions.
31
32
  * @param mode - live work-details mode.
32
- * @returns observable policy that changes exactly when the mode changes.
33
+ * @param collapseTiming - live, in-memory collapse timing.
34
+ * @returns observable policy whose subscriptions follow both preferences.
33
35
  */
34
- export declare function derivePresentationPolicy(mode: ObservableSnapshot<TranscriptViewMode>): ObservableSnapshot<ChatPresentationPolicy>;
36
+ export declare function derivePresentationPolicy(mode: ObservableSnapshot<TranscriptViewMode>, collapseTiming: ObservableSnapshot<CollapseTiming>): ObservableSnapshot<ChatPresentationPolicy>;
35
37
  //# sourceMappingURL=presentation-policy.d.ts.map
@@ -2,21 +2,26 @@
2
2
  import type { SnapshotStore } from '@qilin-agent/client-store';
3
3
  import type { InjectFace, PropsLocale, PropsRuntime } from '@qilin-agent/client-ui-slots';
4
4
  import { type TranscriptViewMode } from '../../chat-settings.ts';
5
+ import type { CollapseTiming } from '../presentation-policy.ts';
5
6
  /** Registration-side work-details preference face. */
6
7
  export interface TranscriptViewRowInjected {
7
8
  hooks: {
8
9
  /** Persisted work-details preference bound as useTranscriptView. */
9
10
  transcriptView: SnapshotStore<TranscriptViewMode>;
11
+ /** Browser-local timing bound as useCollapseTiming. */
12
+ collapseTiming: SnapshotStore<CollapseTiming>;
10
13
  };
11
14
  /** Change the work-details presentation. */
12
15
  setTranscriptView: (mode: TranscriptViewMode) => void;
16
+ /** Save collapse timing in this browser without changing Host settings. */
17
+ setCollapseTiming: (timing: CollapseTiming) => void;
13
18
  }
14
19
  /** Full Settings-row props. */
15
20
  export type TranscriptViewRowProps = PropsRuntime<'settings.general.item'> & PropsLocale<'chat'> & InjectFace<TranscriptViewRowInjected>;
16
21
  /**
17
- * Render the work-details mode selector.
22
+ * Render work-details and browser-local collapse-timing selectors.
18
23
  * @param props - composed Settings slot props.
19
24
  * @returns the preference row.
20
25
  */
21
- export declare function TranscriptViewRow({ useTranscriptView, setTranscriptView, t }: TranscriptViewRowProps): import("react").JSX.Element;
26
+ export declare function TranscriptViewRow({ useTranscriptView, setTranscriptView, useCollapseTiming, setCollapseTiming, t, }: TranscriptViewRowProps): import("react").JSX.Element;
22
27
  //# sourceMappingURL=TranscriptViewRow.d.ts.map
@@ -1,16 +1,26 @@
1
1
  /** Per-Session Chat view store. */
2
2
  import { type EngineStoreHandle } from '@qilin-agent/client-store';
3
3
  import type { ChatStoreState, TurnProcessViewEntry } from './contract/store.ts';
4
+ import type { TurnProcessSpec } from './contract/turn-process.ts';
4
5
  type ChatActions = {
5
6
  setTurnProcessOpen: (draft: ChatStoreState, turn: number, answerStep: number, open: boolean) => void;
6
7
  };
7
8
  /**
8
- * Resolve the manually expanded answer for one Turn.
9
+ * Resolve the manual disclosure choice for one Turn.
9
10
  * @param state - Chat store snapshot.
10
11
  * @param turn - owning Turn.
11
12
  * @returns the Turn's stored entry, when present.
12
13
  */
13
14
  export declare function storedTurnProcessEntry(state: Readonly<ChatStoreState>, turn: number): Readonly<TurnProcessViewEntry> | undefined;
15
+ /**
16
+ * Whether a foldable Turn's process is open: the reader's choice for the current answer generation
17
+ * wins; otherwise the latest completed Turn stays open until the next input, and older Turns fold.
18
+ * @param state - Chat store snapshot.
19
+ * @param spec - the Turn's process specification.
20
+ * @param defaultOpen - whether this Turn is exempt from automatic folding.
21
+ * @returns the effective open state.
22
+ */
23
+ export declare function turnProcessOpen(state: Readonly<ChatStoreState>, spec: Pick<TurnProcessSpec, 'turn' | 'answerStep'>, defaultOpen: boolean): boolean;
14
24
  /**
15
25
  * Create the Chat view store handle.
16
26
  * @returns a handle instantiated once per rendered Session scope.
@@ -1,17 +1,22 @@
1
- /** Host-backed work-details presentation policy. */
1
+ /** Host-backed work details and independent, in-memory collapse timing. */
2
2
  import { type SnapshotStore } from '@qilin-agent/client-store';
3
3
  import type { ConfigForm } from '@qilin-agent/client-ui-settings/client';
4
+ import type { CollapseTiming } from './presentation-policy.ts';
4
5
  import { type ChatSettings, type TranscriptViewMode } from '../chat-settings.ts';
5
6
  /** Live work-details preference consumed by Chat and its Settings row. */
6
7
  export declare class TranscriptViewPolicy {
7
8
  private readonly host;
9
+ private readonly defaultMode;
8
10
  private readonly unsubscribe;
9
- /** Reactive current mode; defaults to Standard before Host settings arrive. */
11
+ /** Reactive current mode, including the client default before Host settings arrive. */
10
12
  readonly mode: SnapshotStore<TranscriptViewMode>;
13
+ /** Independent Client-lifetime choice; each new instance starts with completion-time folding. */
14
+ readonly collapseTiming: SnapshotStore<CollapseTiming>;
11
15
  /**
12
16
  * @param host - durable Chat settings scope.
17
+ * @param defaultMode - presentation used without an explicit saved mode.
13
18
  */
14
- constructor(host: ConfigForm<ChatSettings>);
19
+ constructor(host: ConfigForm<ChatSettings>, defaultMode?: TranscriptViewMode);
15
20
  /** Release the accepted-value subscription. */
16
21
  dispose(): void;
17
22
  /**
@@ -19,6 +24,11 @@ export declare class TranscriptViewPolicy {
19
24
  * @param mode - Compact, Standard, Detailed, or Verbose work details.
20
25
  */
21
26
  setMode(mode: TranscriptViewMode): void;
27
+ /**
28
+ * Keep collapse timing in memory without writing Host or browser storage.
29
+ * @param timing - immediate completion folding or deferred folding at the next input.
30
+ */
31
+ setCollapseTiming(timing: CollapseTiming): void;
22
32
  /** Adopt the latest accepted Host section without writing it back. */
23
33
  private adopt;
24
34
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qilin-agent/client-ui-chat",
3
3
  "description": "Chat Conversation target, node definitions, renderers, and details surface",
4
- "version": "3.1.3",
4
+ "version": "3.1.4",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -56,43 +56,43 @@
56
56
  "react": "^18.2.0",
57
57
  "react-dom": "^18.2.0",
58
58
  "@tanstack/react-virtual": "^3.14.9",
59
- "@qilin-agent/api-remotes": "3.1.3",
60
- "@qilin-agent/api-session-controller": "3.1.3",
61
59
  "@qilin-agent/kylin": "~4.0.3",
62
- "@qilin-agent/api-workspace-controller": "3.1.3",
63
- "@qilin-agent/agent": "3.1.3",
64
- "@qilin-agent/api-workspace-files": "3.1.3",
65
- "@qilin-agent/attachment": "3.1.3",
66
- "@qilin-agent/client-store": "3.1.3",
67
- "@qilin-agent/client-ui-approval": "3.1.3",
68
- "@qilin-agent/client-ui-conversation": "3.1.3",
69
- "@qilin-agent/client-ui-layout": "3.1.3",
70
- "@qilin-agent/client-locale": "3.1.3",
71
- "@qilin-agent/client-ui-primitives": "3.1.3",
72
- "@qilin-agent/client-ui-session": "3.1.3",
73
- "@qilin-agent/client-ui-settings": "3.1.3",
74
- "@qilin-agent/client-ui-renderer": "3.1.3",
75
- "@qilin-agent/client-ui-sidebar-browser": "3.1.3",
76
- "@qilin-agent/client-ui-sidebar-right": "3.1.3",
77
- "@qilin-agent/client-ui-sidebar-documentpreview": "3.1.3",
78
- "@qilin-agent/client-ui-trajectory": "3.1.3",
79
- "@qilin-agent/client-ui-slots": "3.1.3",
80
- "@qilin-agent/client-ui-workspace": "3.1.3",
81
- "@qilin-agent/commands": "3.1.3",
82
- "@qilin-agent/compaction": "3.1.3",
83
- "@qilin-agent/llm": "3.1.3",
84
- "@qilin-agent/llm-retry": "3.1.3",
85
- "@qilin-agent/session-stats": "3.1.3",
86
- "@qilin-agent/session": "3.1.3",
87
- "@qilin-agent/session-turn-outline": "3.1.3",
88
- "@qilin-agent/token-meter": "3.1.3",
89
- "@qilin-agent/subagent": "3.1.3",
90
- "@qilin-agent/settings": "3.1.3",
91
- "@qilin-agent/tools": "3.1.3",
92
- "@qilin-agent/util-workspace-path": "3.1.3",
93
- "@qilin-agent/client-ui-input-trigger": "3.1.3",
94
- "@qilin-agent/util-values": "3.1.3",
95
- "@qilin-agent/brand": "3.1.3"
60
+ "@qilin-agent/api-remotes": "3.1.4",
61
+ "@qilin-agent/agent": "3.1.4",
62
+ "@qilin-agent/api-session-controller": "3.1.4",
63
+ "@qilin-agent/api-workspace-controller": "3.1.4",
64
+ "@qilin-agent/api-workspace-files": "3.1.4",
65
+ "@qilin-agent/client-locale": "3.1.4",
66
+ "@qilin-agent/client-store": "3.1.4",
67
+ "@qilin-agent/client-ui-approval": "3.1.4",
68
+ "@qilin-agent/client-ui-conversation": "3.1.4",
69
+ "@qilin-agent/client-ui-layout": "3.1.4",
70
+ "@qilin-agent/client-ui-primitives": "3.1.4",
71
+ "@qilin-agent/attachment": "3.1.4",
72
+ "@qilin-agent/client-ui-session": "3.1.4",
73
+ "@qilin-agent/client-ui-settings": "3.1.4",
74
+ "@qilin-agent/client-ui-renderer": "3.1.4",
75
+ "@qilin-agent/client-ui-sidebar-right": "3.1.4",
76
+ "@qilin-agent/client-ui-sidebar-documentpreview": "3.1.4",
77
+ "@qilin-agent/client-ui-trajectory": "3.1.4",
78
+ "@qilin-agent/client-ui-sidebar-browser": "3.1.4",
79
+ "@qilin-agent/client-ui-slots": "3.1.4",
80
+ "@qilin-agent/commands": "3.1.4",
81
+ "@qilin-agent/client-ui-workspace": "3.1.4",
82
+ "@qilin-agent/compaction": "3.1.4",
83
+ "@qilin-agent/llm-retry": "3.1.4",
84
+ "@qilin-agent/session-turn-outline": "3.1.4",
85
+ "@qilin-agent/session": "3.1.4",
86
+ "@qilin-agent/llm": "3.1.4",
87
+ "@qilin-agent/subagent": "3.1.4",
88
+ "@qilin-agent/settings": "3.1.4",
89
+ "@qilin-agent/token-meter": "3.1.4",
90
+ "@qilin-agent/tools": "3.1.4",
91
+ "@qilin-agent/util-workspace-path": "3.1.4",
92
+ "@qilin-agent/util-values": "3.1.4",
93
+ "@qilin-agent/brand": "3.1.4",
94
+ "@qilin-agent/client-ui-input-trigger": "3.1.4",
95
+ "@qilin-agent/session-stats": "3.1.4"
96
96
  },
97
97
  "dependencies": {
98
98
  "@qilin-agent/schemastery": "~3.18.3"