@kirkchinese/dsh-citeciter 0.9.0-alpha.3 → 0.9.0-beta.2

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.
Files changed (89) hide show
  1. package/README.md +68 -139
  2. package/README.zh.md +70 -141
  3. package/lib/client.js +4020 -1830
  4. package/lib/index.js +16928 -16567
  5. package/lib/{typert-common-BQpqe5Ph.js → typert-common-g1lnIG8u.js} +3 -5
  6. package/lib/typert.host.js +2 -2
  7. package/lib/typert.remote-client.js +1 -1
  8. package/lib/types/actions.d.ts +22 -14
  9. package/lib/types/blackboard-tool.d.ts +6 -0
  10. package/lib/types/blocking-question-recovery.d.ts +16 -0
  11. package/lib/types/board.d.ts +0 -15
  12. package/lib/types/client/action-controller.d.ts +9 -2
  13. package/lib/types/client/action-executor.d.ts +5 -1
  14. package/lib/types/client/board-citation.d.ts +8 -0
  15. package/lib/types/client/citer-session-face.d.ts +3 -2
  16. package/lib/types/client/companion-controller.d.ts +18 -9
  17. package/lib/types/client/components/{WheelSettings.d.ts → ActionSettings.d.ts} +2 -2
  18. package/lib/types/client/components/ActionWheel.d.ts +4 -4
  19. package/lib/types/client/components/CiteCiterSettings.d.ts +1 -1
  20. package/lib/types/client/components/CiteLauncher.d.ts +7 -2
  21. package/lib/types/client/components/CitePanel.d.ts +4 -1
  22. package/lib/types/client/components/CiterPet.d.ts +10 -0
  23. package/lib/types/client/components/DocumentReader.d.ts +2 -4
  24. package/lib/types/client/components/LearningRoute.d.ts +3 -4
  25. package/lib/types/client/components/ModelChoice.d.ts +7 -3
  26. package/lib/types/client/components/QuestionCard.d.ts +8 -4
  27. package/lib/types/client/components/QuestionReplyBody.d.ts +5 -0
  28. package/lib/types/client/components/ReferenceAttachments.d.ts +6 -2
  29. package/lib/types/client/components/SelectionToolbar.d.ts +19 -0
  30. package/lib/types/client/components/ToolMessage.d.ts +1 -1
  31. package/lib/types/client/components/TopicActions.d.ts +15 -4
  32. package/lib/types/client/components/TopicComposer.d.ts +2 -1
  33. package/lib/types/client/components/TopicHeader.d.ts +8 -3
  34. package/lib/types/client/components/TopicNavigation.d.ts +4 -4
  35. package/lib/types/client/components/TopicQuestions.d.ts +10 -0
  36. package/lib/types/client/components/TopicTitle.d.ts +6 -2
  37. package/lib/types/client/components/UserMessageBody.d.ts +4 -1
  38. package/lib/types/client/conversation-dom.d.ts +0 -7
  39. package/lib/types/client/draft-controller.d.ts +3 -6
  40. package/lib/types/client/draft-merge.d.ts +8 -0
  41. package/lib/types/client/draft-references.d.ts +6 -0
  42. package/lib/types/client/host-dock.d.ts +1 -1
  43. package/lib/types/client/host-icons.d.ts +2 -13
  44. package/lib/types/client/host-image-preview.d.ts +2 -1
  45. package/lib/types/client/host-source-chat.d.ts +11 -0
  46. package/lib/types/client/host-ui-adapter.d.ts +2 -2
  47. package/lib/types/client/native-composer.d.ts +15 -0
  48. package/lib/types/client/prompt.d.ts +4 -4
  49. package/lib/types/client/question-draft-controller.d.ts +50 -0
  50. package/lib/types/client/question-interaction.d.ts +33 -0
  51. package/lib/types/client/request-guard.d.ts +3 -13
  52. package/lib/types/client/selection-toolbar.d.ts +36 -0
  53. package/lib/types/client/tool-presentation.d.ts +14 -0
  54. package/lib/types/client/topic-presentation.d.ts +0 -7
  55. package/lib/types/client/topic-question-controller.d.ts +80 -0
  56. package/lib/types/client/types.d.ts +3 -4
  57. package/lib/types/client/wheel-gesture.d.ts +6 -1
  58. package/lib/types/document-access.d.ts +7 -2
  59. package/lib/types/host-agent-modules.d.ts +16 -6
  60. package/lib/types/host-session-adapter.d.ts +7 -4
  61. package/lib/types/host-settings-adapter.d.ts +5 -5
  62. package/lib/types/index.d.ts +8 -8
  63. package/lib/types/learning-cards-tool.d.ts +5 -0
  64. package/lib/types/learning.d.ts +0 -4
  65. package/lib/types/legacy-migration.d.ts +16 -0
  66. package/lib/types/observer.d.ts +0 -7
  67. package/lib/types/question-draft-contract.d.ts +55 -0
  68. package/lib/types/question-draft-lifecycle.d.ts +8 -0
  69. package/lib/types/question-draft-store.d.ts +38 -0
  70. package/lib/types/question-reply.d.ts +23 -0
  71. package/lib/types/source-read-tool.d.ts +3 -4
  72. package/lib/types/tool-approval-projection.d.ts +10 -0
  73. package/lib/types/tool-events.d.ts +2 -0
  74. package/lib/types/tool-outcome-contract.d.ts +3 -0
  75. package/lib/types/topic-deletion-receipts.d.ts +40 -0
  76. package/lib/types/topic-index.d.ts +26 -30
  77. package/lib/types/topic-log.d.ts +41 -0
  78. package/lib/types/topic-prompts.d.ts +8 -1
  79. package/lib/types/topic-question-bridge.d.ts +10 -0
  80. package/lib/types/topic-questions.d.ts +53 -0
  81. package/lib/types/topic-runtime.d.ts +21 -317
  82. package/lib/types/topic.d.ts +219 -177
  83. package/lib/types/typert-codec.d.ts +2 -4
  84. package/lib/types/typert-common.d.ts +251 -1138
  85. package/lib/types/typert.host.d.ts +525 -2584
  86. package/lib/types/update.d.ts +0 -7
  87. package/lib/{update-CRD1jFLf.js → update-B_0nN1_f.js} +215 -121
  88. package/package.json +68 -79
  89. package/lib/types/client/components/TopicSettingsDialog.d.ts +0 -21
@@ -1,19 +1,17 @@
1
- import { f as citeCiterRequestSchema, p as citeCiterResponseSchema, r as updateCheckResponseSchema } from "./update-CRD1jFLf.js";
1
+ import { d as citeCiterRequestSchema, f as citeCiterResponseSchema, r as updateCheckResponseSchema } from "./update-B_0nN1_f.js";
2
2
  //#region lib/types/typert-codec.js
3
- /** Public Typert schema forms: 0.1.5 reads schema; 0.1.7 creates it lazily. Both refer to one schema. */
3
+ /** Official Typert lazily resolves schemas after module registration. */
4
4
  function strictCodec(typeSymbol, schema) {
5
5
  return {
6
6
  mode: "strict",
7
7
  typeSymbol,
8
- schema,
9
8
  create: () => schema
10
9
  };
11
10
  }
12
- /** Publish the same named schema through both supported registry contracts. */
11
+ /** Register one named schema through the official registry contract. */
13
12
  function namedSchema(name, schema) {
14
13
  return {
15
14
  name,
16
- schema,
17
15
  create: () => schema
18
16
  };
19
17
  }
@@ -1,5 +1,5 @@
1
- import { C as topicSummarySchema, S as topicSnapshotSchema, f as citeCiterRequestSchema, l as citationDraftSchema, p as citeCiterResponseSchema, r as updateCheckResponseSchema, u as citationRecordSchema } from "./update-CRD1jFLf.js";
2
- import { n as updateCheckDescriptor, r as namedSchema, t as citeCiterRequestDescriptor } from "./typert-common-BQpqe5Ph.js";
1
+ import { S as topicSummarySchema, c as citationDraftSchema, d as citeCiterRequestSchema, f as citeCiterResponseSchema, l as citationRecordSchema, r as updateCheckResponseSchema, x as topicSnapshotSchema } from "./update-B_0nN1_f.js";
2
+ import { n as updateCheckDescriptor, r as namedSchema, t as citeCiterRequestDescriptor } from "./typert-common-g1lnIG8u.js";
3
3
  //#region lib/types/typert.host.js
4
4
  /** Handwritten strict Host contribution matching the single Remote decorator. */
5
5
  const TYPERT = {
@@ -1,4 +1,4 @@
1
- import { n as updateCheckDescriptor, t as citeCiterRequestDescriptor } from "./typert-common-BQpqe5Ph.js";
1
+ import { n as updateCheckDescriptor, t as citeCiterRequestDescriptor } from "./typert-common-g1lnIG8u.js";
2
2
  //#region lib/types/typert.remote-client.js
3
3
  /** Browser contribution mounted by the CiteCiter Client fiber. */
4
4
  const TYPERT_REMOTE = {
@@ -1,13 +1,14 @@
1
1
  import { z } from 'zod';
2
- /** One persisted wheel slot; its prompt is sent as a durable user message. */
2
+ /**
3
+ * One persisted action slot, shown in the selection toolbar and the optional wheel.
4
+ * An `ask` action opens the composer for the user's own question; any other action
5
+ * sends its prompt as a durable user message. Fields saved by older versions, such as
6
+ * `scenario` and `target`, are read but no longer change where an action goes.
7
+ */
3
8
  export declare const citeActionSchema: z.ZodObject<{
4
9
  label: z.ZodString;
5
10
  prompt: z.ZodString;
6
11
  ask: z.ZodBoolean;
7
- scenario: z.ZodEnum<{
8
- qa: "qa";
9
- present: "present";
10
- }>;
11
12
  presentation: z.ZodEnum<{
12
13
  side: "side";
13
14
  floating: "floating";
@@ -16,16 +17,12 @@ export declare const citeActionSchema: z.ZodObject<{
16
17
  current: "current";
17
18
  new: "new";
18
19
  }>>;
19
- }, z.core.$strict>;
20
+ }, z.core.$strip>;
20
21
  export type CiteAction = z.infer<typeof citeActionSchema>;
21
22
  export declare const wheelSlotsSchema: z.ZodArray<z.ZodNullable<z.ZodObject<{
22
23
  label: z.ZodString;
23
24
  prompt: z.ZodString;
24
25
  ask: z.ZodBoolean;
25
- scenario: z.ZodEnum<{
26
- qa: "qa";
27
- present: "present";
28
- }>;
29
26
  presentation: z.ZodEnum<{
30
27
  side: "side";
31
28
  floating: "floating";
@@ -34,7 +31,7 @@ export declare const wheelSlotsSchema: z.ZodArray<z.ZodNullable<z.ZodObject<{
34
31
  current: "current";
35
32
  new: "new";
36
33
  }>>;
37
- }, z.core.$strict>>>;
34
+ }, z.core.$strip>>>;
38
35
  export declare const wheelTriggerSchema: z.ZodEnum<{
39
36
  "right-button": "right-button";
40
37
  Alt: "Alt";
@@ -43,15 +40,26 @@ export declare const wheelTriggerSchema: z.ZodEnum<{
43
40
  Meta: "Meta";
44
41
  }>;
45
42
  export type WheelTrigger = z.infer<typeof wheelTriggerSchema>;
43
+ /** Whether a preset action sends at once or only fills the composer. */
44
+ export declare const actionDeliverySchema: z.ZodEnum<{
45
+ send: "send";
46
+ draft: "draft";
47
+ }>;
48
+ export type ActionDelivery = z.infer<typeof actionDeliverySchema>;
46
49
  export type PanelPresentation = CiteAction['presentation'];
47
50
  export declare const actionModelSchema: z.ZodObject<{
48
51
  provider: z.ZodString;
49
52
  model: z.ZodString;
50
53
  }, z.core.$strict>;
51
54
  export type ActionModel = z.infer<typeof actionModelSchema>;
52
- /** Clockwise from twelve o'clock. Empty slots retain their positions. */
55
+ /** Toolbar order, and clockwise from twelve o'clock on the wheel. Empty slots retain their positions. */
53
56
  export declare const DEFAULT_WHEEL_SLOTS: readonly (CiteAction | null)[];
54
- /** Preserve customized legacy slots; only the unchanged built-in free question gains append behavior. */
55
- export declare function actionTarget(action: CiteAction): 'current' | 'new';
57
+ /**
58
+ * Decide how a chosen action is delivered.
59
+ * @param action - the chosen slot.
60
+ * @param preference - the user's preset-action setting.
61
+ * @returns `draft` for questions the user writes, otherwise the preference.
62
+ */
63
+ export declare function actionDelivery(action: CiteAction, preference: ActionDelivery | undefined): ActionDelivery;
56
64
  /** Combine a mode and optional user question without hidden system state. */
57
65
  export declare function actionQuestion(action: CiteAction, question: string): string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Create the blackboard_apply tool. A successful call only validates and records the batch;
3
+ * the board itself is replayed from committed results.
4
+ * @returns a tool definition for one Topic tool registry.
5
+ */
6
+ export declare function createBlackboardApplyTool(): import("@deepseek-ai/dsh-tools").ToolDefinition;
@@ -0,0 +1,16 @@
1
+ import type { SessionEvent } from '@deepseek-ai/dsh-session';
2
+ import type { QuestionDraftRecord } from './question-draft-contract.ts';
3
+ import type { PendingQuestion } from './topic.ts';
4
+ /**
5
+ * Prove that an unfinished PTC child belongs to the exact run_code invocation
6
+ * repaired by DSH after a crash. Every parent link must be logged in the same
7
+ * turn; an ordinary parent failure, settled child or unrelated repair is not proof.
8
+ * @param events - only the owning Topic's post-seed events, in append order.
9
+ */
10
+ export declare function hasInterruptedPtcParent(callId: string, events: readonly SessionEvent[]): boolean;
11
+ /**
12
+ * Recover only a Host-identified blocking draft and its exact committed ask.
13
+ * Missing/invalid logs never fabricate a question; cancellation and accepted
14
+ * replies remain closed. The returned card can submit only on a user's action.
15
+ */
16
+ export declare function recoverBlockingQuestion(sessionId: string, record: QuestionDraftRecord, events: readonly SessionEvent[], inheritedEventCount: number): PendingQuestion | undefined;
@@ -220,18 +220,3 @@ export declare const boardSnapshotSchema: z.ZodObject<{
220
220
  export type BoardSnapshot = z.infer<typeof boardSnapshotSchema>;
221
221
  /** Empty snapshot used before any board commit. */
222
222
  export declare const EMPTY_BOARD_SNAPSHOT: BoardSnapshot;
223
- /**
224
- * Read renderable elements from one final-state snapshot.
225
- * @param snapshot - projected final board state.
226
- * @returns ordered elements plus the committed revision.
227
- */
228
- export declare function foldBoardSnapshot(snapshot: BoardSnapshot): {
229
- readonly elements: readonly BoardElementState[];
230
- readonly revision: number;
231
- };
232
- /**
233
- * Fold a raw op list from first-set order; used by protocol tests.
234
- * @param ops - one validated op batch.
235
- * @returns final elements in insertion order.
236
- */
237
- export declare function foldBoardElements(ops: readonly BoardOp[]): readonly BoardElementState[];
@@ -33,6 +33,7 @@ export interface ActionSnapshot {
33
33
  readonly action: CiteAction;
34
34
  readonly x: number;
35
35
  readonly y: number;
36
+ readonly newTopic: boolean;
36
37
  } | null;
37
38
  submitting: boolean;
38
39
  error: string | null;
@@ -40,8 +41,13 @@ export interface ActionSnapshot {
40
41
  }
41
42
  /** Direction around the actual displayed centre; no action inside the dead zone or outside the wheel. */
42
43
  export declare function wheelSector(dx: number, dy: number): number | null;
43
- /** Prepare a draft through the action's destination policy; the Topic composer owns input and submission. */
44
- export declare function createActionController(execute: (source: ActionSource, action: CiteAction, question: string, model?: ActionModel) => Promise<void>, defaultModel?: () => ActionModel | undefined): {
44
+ /**
45
+ * Run a chosen action through the executor: the selected Topic by default, a new Topic on request.
46
+ * Questions the user writes go to the composer; preset prompts follow the delivery setting.
47
+ */
48
+ export declare function createActionController(execute: (source: ActionSource, action: CiteAction, question: string, model?: ActionModel, options?: {
49
+ readonly newTopic?: boolean;
50
+ }) => Promise<void>, defaultModel?: () => ActionModel | undefined): {
45
51
  getSnapshot: () => ActionSnapshot;
46
52
  subscribe: (fn: () => void) => () => void;
47
53
  open(source: ActionSource, x: number, y: number, slots: readonly (CiteAction | null)[], held: boolean): void;
@@ -51,6 +57,7 @@ export declare function createActionController(execute: (source: ActionSource, a
51
57
  /** Focus loss cancels only the transient gesture; the Topic composer retains its draft. */
52
58
  dismissWheel(): void;
53
59
  choose: (index: number | null) => void;
60
+ run: (source: ActionSource, action: CiteAction, x: number, y: number, newTopic?: boolean) => void;
54
61
  cancel: () => void;
55
62
  submit: () => Promise<void>;
56
63
  dispose(): Promise<void>;
@@ -2,5 +2,9 @@ import { type CiteAction, type ActionModel, type PanelPresentation } from '../ac
2
2
  import { type ActionSource } from './action-controller.ts';
3
3
  import type { CompanionFace } from './companion-controller.ts';
4
4
  import type { ReaderFace } from './reader-controller.ts';
5
+ /** Where a chosen action goes: the selected Topic by default, or a new Topic when the user asks for one. */
6
+ export interface ActionRunOptions {
7
+ readonly newTopic?: boolean;
8
+ }
5
9
  /** Bind explicit Topic and document services. No UI, global listeners or Cordis discovery. */
6
- export declare function createActionExecutor(companion: CompanionFace, reader: ReaderFace, open: (presentation: PanelPresentation) => void): (source: ActionSource, action: CiteAction, question: string, modelRoute?: ActionModel) => Promise<void>;
10
+ export declare function createActionExecutor(companion: CompanionFace, reader: ReaderFace, open: (presentation: PanelPresentation) => void): (source: ActionSource, action: CiteAction, question: string, modelRoute?: ActionModel, options?: ActionRunOptions) => Promise<void>;
@@ -0,0 +1,8 @@
1
+ import type { BoardElementState } from '../board.ts';
2
+ /**
3
+ * Quote the selected board element without exposing its raw SVG/HTML or image bytes.
4
+ * @param element - the actual selected element from the current Topic board.
5
+ * @returns removable draft content; graphic-only references ask for visual inspection
6
+ * after manual submission rather than inventing text or starting a model request.
7
+ */
8
+ export declare function boardCitationPrompt(element: BoardElementState): string;
@@ -20,6 +20,7 @@ type Submission = Parameters<SessionFace['beginSubmission']>[0];
20
20
  export declare class CiterSessionFace implements SessionFace {
21
21
  private readonly ctx;
22
22
  readonly sessionId: SessionId;
23
+ private readonly onDeleted?;
23
24
  private readonly store;
24
25
  private readonly pending;
25
26
  private readonly lifetime;
@@ -33,7 +34,7 @@ export declare class CiterSessionFace implements SessionFace {
33
34
  private nextRequestId;
34
35
  /** Use the draft's durable identity for this explicit send, including retries after restart. */
35
36
  prepareSubmission(requestId: string): void;
36
- constructor(ctx: Context, sessionId: SessionId);
37
+ constructor(ctx: Context, sessionId: SessionId, onDeleted?: (() => void) | undefined);
37
38
  getSnapshot: () => CiterSessionSnapshot;
38
39
  subscribe: (listener: () => void) => (() => void);
39
40
  /** Establish ownership and obtain a real baseline before accepting composer work. */
@@ -69,7 +70,7 @@ export declare class CiterSessionFace implements SessionFace {
69
70
  loadThrough: () => Promise<void>;
70
71
  private schedule;
71
72
  private refresh;
72
- /** Stop polling and settle each owned submission exactly once when its plugin closes. */
73
+ /** Stop polling and settle each owned submission exactly once when its owner closes or confirms deletion. */
73
74
  dispose(): void;
74
75
  }
75
76
  export {};
@@ -5,13 +5,12 @@ import type { SettingsForm } from './host-ui-adapter.ts';
5
5
  import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
6
6
  import type { ChatSnapshot } from '@deepseek-ai/dsh-client-ui-chat/client';
7
7
  import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol';
8
- import { type CiteCiterRequest, type CiteCiterResponse, type CiteCiterSettings, type ProviderOption, type QuestionAnswer, type TopicScenario, type TopicSnapshot, type TopicSummary } from '../topic.ts';
9
- import { type CreateMode, type DocumentClaimIntent } from './request-guard.ts';
10
- import type { ActionModel } from '../actions.ts';
8
+ import { type CiteCiterRequest, type CiteCiterResponse, type CiteCiterSettings, type ProviderOption, type QuestionAnswer, type TopicSnapshot, type TopicSummary } from '../topic.ts';
9
+ import { type DocumentClaimIntent } from './request-guard.ts';
10
+ import type { ActionDelivery, ActionModel } from '../actions.ts';
11
11
  import type { CiteSelection } from './types.ts';
12
12
  import { type DraftReference } from './draft-references.ts';
13
13
  export type CompanionPhase = 'idle' | 'creating' | 'ready' | 'running' | 'stopping' | 'stopped' | 'error';
14
- export type { CreateMode } from './request-guard.ts';
15
14
  export type TopicsStatus = 'idle' | 'loading' | 'ready' | 'error';
16
15
  export type SettingsSaveStatus = 'idle' | 'saving' | 'saved' | 'error';
17
16
  export interface ComposeSeed {
@@ -49,15 +48,24 @@ export interface CompanionFace {
49
48
  subscribe(listener: () => void): () => void;
50
49
  setSource(sessionId: SessionId | null): void;
51
50
  retainVisible(): () => void;
52
- create(selection: CiteSelection, question: string, mode?: CreateMode, scenario?: TopicScenario, modelRoute?: ActionModel): Promise<void>;
53
- createFree(question: string, scenario: Extract<TopicScenario, 'qa' | 'present'>): Promise<boolean>;
51
+ /** Resolve once the Topic list refresh in progress, including reopening the last Topic, has finished. */
52
+ settle(): Promise<void>;
53
+ /**
54
+ * Create a Topic from a conversation selection.
55
+ * @param delivery - `draft` fills the new Topic's composer; `send` sends the question with its references at once.
56
+ */
57
+ create(selection: CiteSelection, question: string, modelRoute?: ActionModel, delivery?: ActionDelivery): Promise<void>;
58
+ createFree(question: string): Promise<boolean>;
54
59
  /** Create a Reading Topic; rejects on failure so the Reader retains the unsent question. */
55
- createFromDocument(claim: DocumentClaimIntent, question: string, sourceSessionId?: SessionId, modelRoute?: ActionModel): Promise<void>;
60
+ createFromDocument(claim: DocumentClaimIntent, question: string, sourceSessionId?: SessionId, modelRoute?: ActionModel, delivery?: ActionDelivery): Promise<void>;
56
61
  openTopic(sessionId: string): Promise<void>;
57
62
  /** Resolve only the explicitly selected, unarchived Topic; null means create a new one. */
58
63
  resolveDraftTopic(sourceSessionId: SessionId): Promise<string | null>;
59
- /** Append to the exact still-selected Topic; never change its route, permissions or running turn. */
60
- appendSelection(sourceSessionId: SessionId, topicSessionId: string, question: string, references: readonly DraftReference[]): void;
64
+ /**
65
+ * Append to the exact still-selected Topic; never change its route, permissions, existing draft or running turn.
66
+ * @param delivery - `draft` adds the question and references to the composer; `send` queues them as their own message.
67
+ */
68
+ appendSelection(sourceSessionId: SessionId, topicSessionId: string, question: string, references: readonly DraftReference[], delivery?: ActionDelivery): Promise<void>;
61
69
  /** Acknowledge a draft event only after its UI consumer accepted it. */
62
70
  consumeComposeSeed(id: string): void;
63
71
  ask(question: string, attachments?: readonly DraftAttachmentId[], mode?: DeliveryMode, requestId?: string, expectedSessionId?: string): Promise<boolean>;
@@ -79,3 +87,4 @@ export interface CompanionFace {
79
87
  export declare const INITIAL_COMPANION_SNAPSHOT: CompanionSnapshot;
80
88
  /** Bind private Topic Remote calls to one browser snapshot and polling lifecycle. */
81
89
  export declare function createCompanionController(readChat: (sessionId: SessionId) => ChatSnapshot | undefined, configForms: SettingsForm<CiteCiterSettings>, request: RemoteRequest, onAutoOpen: () => void, store: SnapshotStore<CompanionSnapshot>, nativeComposer: NativeComposer): CompanionFace;
90
+ export {};
@@ -1,7 +1,7 @@
1
1
  import type { CompanionSnapshot } from '../companion-controller.ts';
2
2
  import type { CompanionActions } from '../view-actions.ts';
3
- /** Edit eight stable slots as one validated settings transaction. */
4
- export declare function WheelSettings({ snapshot, companion }: {
3
+ /** Selection entry points, preset-action delivery, the new-Topic model and the eight action slots, saved together. */
4
+ export declare function ActionSettings({ snapshot, companion }: {
5
5
  snapshot: CompanionSnapshot;
6
6
  companion: CompanionActions;
7
7
  }): import("react").JSX.Element;
@@ -1,10 +1,10 @@
1
1
  import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-store';
2
2
  import { type ActionController, type ActionSnapshot } from '../action-controller.ts';
3
- import type { CompanionActions } from '../view-actions.ts';
3
+ import type { CompanionSnapshot } from '../companion-controller.ts';
4
4
  export type ActionCallbacks = Omit<ActionController, 'getSnapshot' | 'subscribe' | 'dispose'>;
5
- /** Public wheel and creation-error retry. Questions and models are edited only in the Topic composer. */
6
- export declare function ActionWheel({ useActions, actions, companion }: {
5
+ /** Optional wheel and the action retry prompt. Questions and models are edited only in the Topic composer. */
6
+ export declare function ActionWheel({ useActions, useCompanion, actions }: {
7
7
  useActions: SnapshotSelectorHook<ActionSnapshot>;
8
+ useCompanion: SnapshotSelectorHook<CompanionSnapshot>;
8
9
  actions: ActionCallbacks;
9
- companion: CompanionActions;
10
10
  }): import("react").JSX.Element;
@@ -12,5 +12,5 @@ export interface CiteCiterSettingsProps extends SettingsSectionOwnerProps {
12
12
  readonly settingsDocument: SettingsDocumentActions;
13
13
  readonly updateController: UpdateActions;
14
14
  }
15
- /** Native DSH settings page for CiteCiter-owned preferences. */
15
+ /** Native DSH settings page for Citer preferences. */
16
16
  export declare function CiteCiterSettings({ useCompanion, useDocument, useUpdate, companion, settingsDocument, updateController }: CiteCiterSettingsProps): import("react").JSX.Element;
@@ -1,9 +1,14 @@
1
1
  import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-store';
2
2
  import type { CiteOverlaySnapshot } from '../types.ts';
3
3
  import type { CompanionSnapshot } from '../companion-controller.ts';
4
- /** Independent entry back to the current learning workspace; owns no selection state. */
5
- export declare function CiteLauncher({ useCompanion, useOverlay, openPanel }: {
4
+ import type { CompanionActions } from '../view-actions.ts';
5
+ /**
6
+ * Entry back to Citer while its panel is closed. While an answer is still running it keeps
7
+ * the Topic refreshing, so the pet can mark the finished answer; opening Citer clears the mark.
8
+ */
9
+ export declare function CiteLauncher({ useCompanion, useOverlay, companion, openPanel }: {
6
10
  useCompanion: SnapshotSelectorHook<CompanionSnapshot>;
7
11
  useOverlay: SnapshotSelectorHook<CiteOverlaySnapshot>;
12
+ companion: CompanionActions;
8
13
  openPanel: () => void;
9
14
  }): import("react").JSX.Element | null;
@@ -2,6 +2,7 @@ import type { NativeComposer, DeliveryMode } from '../native-composer.ts';
2
2
  import { type DraftController, type DraftSnapshot } from '../draft-controller.ts';
3
3
  import type { InteractionSnapshot } from '../host-ui-adapter.ts';
4
4
  import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-store';
5
+ import type { UseSessions } from '@deepseek-ai/dsh-client-ui-session/client';
5
6
  import type { CiteOverlaySnapshot } from '../types.ts';
6
7
  import type { CompanionSnapshot } from '../companion-controller.ts';
7
8
  import type { CompanionActions, OverlayActions } from '../view-actions.ts';
@@ -18,10 +19,12 @@ export interface CitePanelProps {
18
19
  readonly closePanel: () => void;
19
20
  readonly openReader: () => void;
20
21
  readonly reportParseError: (messageId: string) => void;
22
+ /** Host standard prop: the session list, used to show source titles on reference chips. */
23
+ readonly useSessions?: UseSessions;
21
24
  }
22
25
  /**
23
26
  * Render the independent Topic workspace on the right edge of the shell.
24
27
  * @param props - shared panel bus, Topic controller, and host callbacks.
25
28
  * @returns the responsive Topic dock and its dialogs, or null while closed.
26
29
  */
27
- export declare function CitePanel({ nativeComposer, drafts, useDrafts, useCompanion, useOverlay, useInteractions, useSubmission, bus, companion, closePanel, openReader, reportParseError }: CitePanelProps): import("react").JSX.Element | null;
30
+ export declare function CitePanel({ nativeComposer, drafts, useDrafts, useCompanion, useOverlay, useInteractions, useSubmission, useSessions, bus, companion, closePanel, openReader, reportParseError }: CitePanelProps): import("react").JSX.Element | null;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The collapsed Citer entry: the mascot peeking over a window edge. It stands up when the
3
+ * pointer comes near or it receives focus, opens Citer on click, and can be dragged to
4
+ * either side; the side and height are remembered in this browser.
5
+ * @param attention - show a dot because an answer finished or a question waits while Citer is closed.
6
+ */
7
+ export declare function CiterPet({ attention, onOpen }: {
8
+ readonly attention: boolean;
9
+ readonly onOpen: () => void;
10
+ }): import("react").JSX.Element;
@@ -1,14 +1,12 @@
1
1
  import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-store';
2
2
  import type { ReaderSnapshot } from '../reader-controller.ts';
3
- import type { CiteOverlaySnapshot } from '../types.ts';
4
3
  import type { ReaderActions } from '../view-actions.ts';
5
4
  import type { SessionId } from '@deepseek-ai/dsh-session/types';
6
5
  import type { SelectionSurfaces } from '../wheel-gesture.ts';
7
- /** Reader shell-overlay entry: compact trigger plus the document library panel. */
8
- export declare function DocumentReader({ reader, useReader, useOverlay, registerSurface, sourceSessionId }: {
6
+ /** The document library panel, opened from the Topic menu. */
7
+ export declare function DocumentReader({ reader, useReader, registerSurface, sourceSessionId }: {
9
8
  readonly reader: ReaderActions;
10
9
  readonly useReader: SnapshotSelectorHook<ReaderSnapshot>;
11
- readonly useOverlay: SnapshotSelectorHook<CiteOverlaySnapshot>;
12
10
  readonly registerSurface: SelectionSurfaces['register'];
13
11
  readonly sourceSessionId: () => SessionId | null;
14
12
  }): import("react").JSX.Element;
@@ -1,7 +1,6 @@
1
1
  import type { TopicMessage } from '../../topic.ts';
2
- /** Optional native todo projection. The user toggles planning; the model owns plan contents. */
3
- export declare function LearningRoute({ enabled, messages, onChange }: {
2
+ /** Progress of the optional learning route. It is switched in the Topic menu; the model owns the plan. */
3
+ export declare function LearningRoute({ enabled, messages }: {
4
4
  readonly enabled: boolean;
5
5
  readonly messages: readonly TopicMessage[];
6
- readonly onChange: (enabled: boolean) => void;
7
- }): import("react").JSX.Element;
6
+ }): import("react").JSX.Element | null;
@@ -1,10 +1,14 @@
1
1
  import type { ActionModel } from '../../actions.ts';
2
2
  import type { ProviderOption } from '../../topic.ts';
3
- /** Model identities are encoded together, so provider-local model IDs never collide. */
4
- export declare function ModelChoice({ providers, value, onChange, disabled, label }: {
3
+ /**
4
+ * Model select for settings rows; the row supplies the visible label.
5
+ * Model identities are encoded together, so provider-local model IDs never collide.
6
+ */
7
+ export declare function ModelChoice({ providers, value, onChange, disabled, label, className }: {
5
8
  providers: readonly ProviderOption[];
6
9
  value: ActionModel | undefined;
7
10
  onChange: (value: ActionModel | undefined) => void;
8
11
  disabled?: boolean;
9
- label?: string;
12
+ label: string;
13
+ className?: string | undefined;
10
14
  }): import("react").JSX.Element;
@@ -1,14 +1,18 @@
1
+ import { type RefObject } from 'react';
1
2
  import type { AskUserQuestionAnswer } from '@deepseek-ai/dsh-user-questions';
2
3
  import type { PendingQuestion } from '../../topic.ts';
4
+ import type { QuestionInteraction } from '../question-interaction.ts';
5
+ import type { QuestionDraftController } from '../question-draft-controller.ts';
3
6
  export interface QuestionCardProps {
4
7
  readonly pending: {
5
8
  readonly key: string;
6
- readonly questions: readonly (PendingQuestion['questions'][number] & {
7
- readonly detail?: string;
8
- })[];
9
+ readonly questions: readonly PendingQuestion['questions'][number][];
9
10
  };
10
11
  readonly onAnswer: (answer: AskUserQuestionAnswer) => Promise<unknown>;
11
12
  readonly onCancel: () => Promise<unknown>;
13
+ readonly interaction?: QuestionInteraction;
14
+ readonly surface?: RefObject<HTMLFormElement>;
15
+ readonly draftStore?: QuestionDraftController | undefined;
12
16
  }
13
17
  /** Collect one standard DSH ask_user_question answer batch inside the private Topic. */
14
- export declare function QuestionCard({ onAnswer, onCancel, pending }: QuestionCardProps): import("react").JSX.Element | null;
18
+ export declare function QuestionCard({ onAnswer, onCancel, pending, interaction, surface, draftStore }: QuestionCardProps): import("react").JSX.Element | null;
@@ -0,0 +1,5 @@
1
+ import type { QuestionReply } from '../../question-reply.ts';
2
+ /** Show the user's recorded choices as text, without interpreting their answer as Markdown or replaying internal prompts. */
3
+ export declare function QuestionReplyBody({ reply }: {
4
+ readonly reply: QuestionReply;
5
+ }): import("react").JSX.Element;
@@ -1,6 +1,10 @@
1
1
  import { type DraftReference } from '../draft-references.ts';
2
- /** Removable draft chips and rendered previews. No model calls or source reads. */
3
- export declare function ReferenceAttachments({ references, onRemove }: {
2
+ /**
3
+ * Removable draft chips and rendered previews. No model calls or source reads.
4
+ * @param sourceTitle - resolves a source session's display title for its chip.
5
+ */
6
+ export declare function ReferenceAttachments({ references, onRemove, sourceTitle }: {
4
7
  readonly references: readonly DraftReference[];
5
8
  readonly onRemove?: (id: string) => void;
9
+ readonly sourceTitle?: ((sessionId: string) => string | undefined) | undefined;
6
10
  }): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-store';
2
+ import { type CiteAction } from '../../actions.ts';
3
+ import type { ActionSource } from '../action-controller.ts';
4
+ import type { CompanionSnapshot } from '../companion-controller.ts';
5
+ import type { SelectionToolbarSnapshot } from '../selection-toolbar.ts';
6
+ /** Toolbar callbacks; the controllers stay with the Client plugin. */
7
+ export interface SelectionToolbarActions {
8
+ readonly dismiss: () => void;
9
+ readonly run: (source: ActionSource, action: CiteAction, x: number, y: number, newTopic?: boolean) => void;
10
+ }
11
+ /**
12
+ * Actions for the current selection: the first configured actions inline, the rest and
13
+ * "新 Topic" under a menu. Pressing a button never moves focus or clears the selection first.
14
+ */
15
+ export declare function SelectionToolbar({ useToolbar, useCompanion, toolbar }: {
16
+ readonly useToolbar: SnapshotSelectorHook<SelectionToolbarSnapshot>;
17
+ readonly useCompanion: SnapshotSelectorHook<CompanionSnapshot>;
18
+ readonly toolbar: SelectionToolbarActions;
19
+ }): import("react").JSX.Element | null;
@@ -1,6 +1,6 @@
1
1
  import type { TopicMessage } from '../../topic.ts';
2
2
  import type { NativeComposer } from '../native-composer.ts';
3
- /** Show returned files immediately while keeping diagnostic arguments and results collapsible. */
3
+ /** Show returned files immediately; the readable title and summary expand to the exact arguments and result. */
4
4
  export declare function ToolRow({ message, sessionId, load }: {
5
5
  readonly message: Extract<TopicMessage, {
6
6
  role: 'tool';
@@ -1,6 +1,17 @@
1
- /** Workspace actions remain reachable without a floating launcher over the composer. Callbacks own their dialogs and services. */
2
- export declare function TopicActions({ hasTopic, onSettings, onReader }: {
3
- readonly hasTopic: boolean;
4
- readonly onSettings: () => void;
1
+ /** Everything the Topic menu offers; callbacks own their dialogs and services. */
2
+ export interface TopicMenu {
3
+ readonly topic: {
4
+ readonly archived: boolean;
5
+ } | undefined;
6
+ readonly busy: boolean;
7
+ readonly learningRoute: boolean;
8
+ readonly onRename: () => void;
9
+ readonly onLearningRoute: (enabled: boolean) => void;
5
10
  readonly onReader: () => void;
11
+ readonly onArchive: (archived: boolean) => void;
12
+ readonly onDelete: () => void;
13
+ }
14
+ /** The "⋯" menu: rename, learning route, document reader, archive and permanent deletion. */
15
+ export declare function TopicActions({ menu }: {
16
+ readonly menu: TopicMenu;
6
17
  }): import("react").JSX.Element;
@@ -8,7 +8,7 @@ import type { DeliveryMode } from '../native-composer.ts';
8
8
  * @param props - controlled draft, model route, request state and user-action callbacks.
9
9
  * @returns one form; model changes and sending remain owned by the Topic controller.
10
10
  */
11
- export declare function TopicComposer({ question, placeholder, route, providers, phase, canSend, routeSaving, folded, inputRef, onExpand, onQuestion, onSubmit, onStop, onModel, onReasoning, attachments, permission, onPermission, onFiles, delivery, onDelivery }: {
11
+ export declare function TopicComposer({ question, placeholder, route, providers, phase, canSend, routeSaving, folded, inputRef, onExpand, onQuestion, onComposition, onSubmit, onStop, onModel, onReasoning, attachments, permission, onPermission, onFiles, delivery, onDelivery }: {
12
12
  readonly permission: PermissionMode;
13
13
  readonly onPermission: (mode: PermissionMode) => void;
14
14
  readonly onFiles: (files: readonly File[]) => void;
@@ -26,6 +26,7 @@ export declare function TopicComposer({ question, placeholder, route, providers,
26
26
  readonly inputRef: Ref<HTMLTextAreaElement>;
27
27
  readonly onExpand: () => void;
28
28
  readonly onQuestion: (question: string) => void;
29
+ readonly onComposition: (composing: boolean) => void;
29
30
  readonly onSubmit: (event: FormEvent, mode?: DeliveryMode) => void;
30
31
  readonly onStop: () => void;
31
32
  readonly onModel: (provider: string, model: string) => void;
@@ -1,10 +1,15 @@
1
1
  import type { PointerEventHandler, ReactNode } from 'react';
2
- /** Layout-only header: navigation, title and drag behavior are supplied by their independent controllers. */
3
- export declare function TopicHeader({ compact, onBack, onDrag, title, status, children }: {
2
+ /**
3
+ * Layout-only header. The Citer mark identifies the panel; dragging the header floats it.
4
+ * Navigation, title and closing are supplied by their own controllers.
5
+ * @param status - shown only while something is happening or needs attention.
6
+ */
7
+ export declare function TopicHeader({ compact, onBack, onClose, onDrag, title, status, children }: {
4
8
  readonly compact: boolean;
5
9
  readonly onBack: () => void;
10
+ readonly onClose: () => void;
6
11
  readonly onDrag: PointerEventHandler<HTMLElement>;
7
12
  readonly title: ReactNode;
8
- readonly status: string;
13
+ readonly status: string | null;
9
14
  readonly children: ReactNode;
10
15
  }): import("react").JSX.Element;
@@ -1,12 +1,12 @@
1
1
  import type { TopicSummary } from '../../topic.ts';
2
- /** Session-list navigation with search. Receives domain rows and callbacks, without service discovery. */
3
- export declare function TopicNavigation({ topics, activeId, archived, onOpen, onNew, onArchiveView, onSettings, onReader }: {
2
+ import { type TopicMenu } from './TopicActions.tsx';
3
+ /** Topic list with search, new Topic and the Topic menu. Receives domain rows and callbacks, without service discovery. */
4
+ export declare function TopicNavigation({ topics, activeId, archived, onOpen, onNew, onArchiveView, menu }: {
4
5
  readonly topics: readonly TopicSummary[];
5
6
  readonly activeId: string | undefined;
6
7
  readonly archived: boolean;
7
8
  readonly onOpen: (id: string) => void;
8
9
  readonly onNew: () => void;
9
10
  readonly onArchiveView: (archived: boolean) => void;
10
- readonly onSettings: () => void;
11
- readonly onReader: () => void;
11
+ readonly menu: TopicMenu;
12
12
  }): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { PendingQuestion } from '../../topic.ts';
3
+ import type { NativeComposer } from '../native-composer.ts';
4
+ /** Private Topic questions share native wait semantics without joining the Host's Session list. */
5
+ export declare function TopicQuestions({ sessionId, pending, native, children }: {
6
+ readonly sessionId: string;
7
+ readonly pending: readonly PendingQuestion[];
8
+ readonly native: NativeComposer;
9
+ readonly children: ReactNode;
10
+ }): import("react").JSX.Element;
@@ -1,6 +1,10 @@
1
- /** Inline rename committed by Enter or blur, cancelled by Escape. Double-click and F2 start editing. */
2
- export declare function TopicTitle({ id, title, onRename }: {
1
+ /**
2
+ * Inline rename committed by Enter or blur, cancelled by Escape. Double-click, F2 or a
3
+ * changed `renameRequest` (the Topic menu) start editing.
4
+ */
5
+ export declare function TopicTitle({ id, title, onRename, renameRequest }: {
3
6
  readonly id: string;
4
7
  readonly title: string;
5
8
  readonly onRename: (title: string) => Promise<boolean>;
9
+ readonly renameRequest?: number;
6
10
  }): import("react").JSX.Element;