@xiongtao.xt/tau-plugins 0.57.0 → 0.59.0

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 (120) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/docs/README.md +1 -1
  3. package/docs/ai.md +1 -1
  4. package/docs/app-surfaces.md +1 -1
  5. package/docs/getting-started.md +1 -1
  6. package/docs/notifications-and-voice.md +3 -1
  7. package/docs/pages.md +73 -4
  8. package/docs/permissions.md +1 -1
  9. package/docs/plugin-basics.md +1 -1
  10. package/docs/portability.md +34 -33
  11. package/docs/references.md +2 -0
  12. package/docs/settings-and-commands.md +3 -0
  13. package/docs/windows.md +18 -18
  14. package/package.json +1 -1
  15. package/publish-artifacts.js +20 -18
  16. package/tailwind.css +3 -3
  17. package/types/packages/collaboration/src/document-history-edit.d.ts +11 -0
  18. package/types/packages/collaboration/src/document-history.d.ts +91 -0
  19. package/types/packages/collaboration/src/index.d.ts +2 -0
  20. package/types/packages/collaboration/src/node-document.d.ts +1 -1
  21. package/types/packages/db-schema/content-identities.d.ts +1 -1
  22. package/types/packages/editor/src/core/CoreEditor.d.ts +10 -1
  23. package/types/packages/editor/src/core/api/extension.d.ts +0 -1
  24. package/types/packages/editor/src/core/api/index.d.ts +3 -1
  25. package/types/packages/editor/src/core/utils/nodeOperations.d.ts +1 -0
  26. package/types/packages/editor/src/core/utils/undoStep.d.ts +6 -0
  27. package/types/packages/editor/src/core/utils/wrapInlineText.d.ts +4 -0
  28. package/types/packages/editor/src/extensions/kbd/src/types.d.ts +2 -2
  29. package/types/packages/editor/src/extensions/link/src/types.d.ts +2 -2
  30. package/types/packages/editor/src/extensions/styled-text/src/types.d.ts +2 -2
  31. package/types/packages/editor/src/extensions/underline/src/types.d.ts +2 -2
  32. package/types/packages/markdown/src/codec.d.ts +6 -2
  33. package/types/packages/markdown/src/markdown.d.ts +2 -1
  34. package/types/packages/markdown/src/positionMapper.d.ts +7 -1
  35. package/types/packages/plugins/src/app.d.ts +2 -0
  36. package/types/packages/plugins/src/index.d.ts +1 -1
  37. package/types/packages/plugins/src/notifications.d.ts +2 -0
  38. package/types/packages/plugins/src/pages.d.ts +8 -2
  39. package/types/packages/shared/src/chat-core/aiRunProtocol.d.ts +1 -1
  40. package/types/packages/shared/src/chat-core/messages.d.ts +13 -4
  41. package/types/packages/themes/src/themes/ink.theme.d.ts +1 -2
  42. package/types/packages/themes/src/themes/mint.theme.d.ts +1 -2
  43. package/types/packages/themes/src/themes/ocean.theme.d.ts +1 -2
  44. package/types/packages/themes/src/themes/paper.theme.d.ts +1 -2
  45. package/types/packages/themes/src/themes/sakura.theme.d.ts +1 -2
  46. package/types/packages/themes/src/themes/wisteria.theme.d.ts +1 -2
  47. package/types/packages/ui/src/cn.d.ts +1 -1
  48. package/types/packages/ui/src/primitives/AnchoredPanel.d.ts +3 -3
  49. package/types/packages/ui/src/primitives/Button.d.ts +4 -4
  50. package/types/packages/ui/src/primitives/Checkbox.d.ts +2 -2
  51. package/types/packages/ui/src/primitives/ConfirmDialog.d.ts +3 -3
  52. package/types/packages/ui/src/primitives/Dialog.d.ts +4 -4
  53. package/types/packages/ui/src/primitives/Loading.d.ts +1 -1
  54. package/types/packages/ui/src/primitives/Menu.d.ts +1 -1
  55. package/types/packages/ui/src/primitives/Notification.d.ts +4 -2
  56. package/types/packages/ui/src/primitives/Popover.d.ts +3 -3
  57. package/types/packages/ui/src/primitives/Radio.d.ts +2 -3
  58. package/types/packages/ui/src/primitives/RadioGroup.d.ts +1 -1
  59. package/types/packages/ui/src/primitives/Segmented.d.ts +3 -3
  60. package/types/packages/ui/src/primitives/Select.d.ts +6 -6
  61. package/types/packages/ui/src/primitives/Switch.d.ts +2 -2
  62. package/types/packages/ui/src/primitives/Tag.d.ts +2 -3
  63. package/types/packages/ui/src/primitives/Toast.d.ts +1 -1
  64. package/types/packages/ui/src/primitives/Tooltip.d.ts +5 -5
  65. package/types/packages/ui/src/primitives/ValueDisplay.d.ts +2 -3
  66. package/types/packages/ui/src/primitives/anchoredPosition.d.ts +1 -2
  67. package/types/packages/ui/src/primitives/datepicker/DatePicker.d.ts +2 -2
  68. package/types/packages/ui/src/primitives/datepicker/DateRangePicker.d.ts +1 -1
  69. package/types/packages/ui/src/primitives/input/Input.d.ts +4 -4
  70. package/types/packages/ui/src/primitives/input/NumberInput.d.ts +2 -2
  71. package/types/packages/ui/src/primitives/input/Textarea.d.ts +1 -1
  72. package/types/packages/whiteboard/src/Board.d.ts +8 -6
  73. package/types/packages/whiteboard/src/{WhiteBoard.d.ts → Whiteboard.d.ts} +6 -6
  74. package/types/packages/whiteboard/src/chrome/index.d.ts +1 -1
  75. package/types/packages/whiteboard/src/components/ArrowConnectPoint/index.d.ts +26 -0
  76. package/types/packages/whiteboard/src/components/ArrowConnectPointGroup/index.d.ts +3 -0
  77. package/types/packages/whiteboard/src/components/DocumentElement/index.d.ts +2 -0
  78. package/types/packages/whiteboard/src/components/ExcerptElement/index.d.ts +13 -0
  79. package/types/packages/whiteboard/src/components/SketchPopover.d.ts +1 -1
  80. package/types/packages/whiteboard/src/constants/arrow.d.ts +0 -2
  81. package/types/packages/whiteboard/src/constants/mind.d.ts +0 -13
  82. package/types/packages/whiteboard/src/constants/text-style.d.ts +1 -1
  83. package/types/packages/whiteboard/src/extensions/authorApi.d.ts +0 -1
  84. package/types/packages/whiteboard/src/extensions/events.d.ts +0 -1
  85. package/types/packages/whiteboard/src/hooks/useDropArrow.d.ts +1 -1
  86. package/types/packages/whiteboard/src/hooks/useReadonly.d.ts +1 -0
  87. package/types/packages/whiteboard/src/hooks/useSelectState.d.ts +0 -1
  88. package/types/packages/whiteboard/src/index.d.ts +10 -6
  89. package/types/packages/whiteboard/src/plugins/ArrowPlugin.d.ts +1 -1
  90. package/types/packages/whiteboard/src/plugins/ColumnPlugin.d.ts +1 -1
  91. package/types/packages/whiteboard/src/plugins/CommonPlugin.d.ts +10 -10
  92. package/types/packages/whiteboard/src/plugins/DocumentPlugin.d.ts +36 -3
  93. package/types/packages/whiteboard/src/plugins/ExcerptPlugin.d.ts +48 -0
  94. package/types/packages/whiteboard/src/plugins/FramePlugin.d.ts +1 -1
  95. package/types/packages/whiteboard/src/plugins/GeometryPlugin.d.ts +5 -2
  96. package/types/packages/whiteboard/src/plugins/MindPlugin.d.ts +1 -2
  97. package/types/packages/whiteboard/src/plugins/WebviewPlugin.d.ts +1 -1
  98. package/types/packages/whiteboard/src/plugins/{WhiteBoardPlugin.d.ts → WhiteboardPlugin.d.ts} +8 -5
  99. package/types/packages/whiteboard/src/plugins/index.d.ts +2 -1
  100. package/types/packages/whiteboard/src/public.d.ts +23 -1
  101. package/types/packages/whiteboard/src/types/board.d.ts +10 -10
  102. package/types/packages/whiteboard/src/types/element.d.ts +6 -1
  103. package/types/packages/whiteboard/src/types/operation.d.ts +1 -1
  104. package/types/packages/whiteboard/src/types/selection.d.ts +1 -1
  105. package/types/packages/whiteboard/src/types/sketch.d.ts +2 -2
  106. package/types/packages/whiteboard/src/types/viewport.d.ts +1 -1
  107. package/types/packages/whiteboard/src/utils/ArrowStyleUtil.d.ts +0 -1
  108. package/types/packages/whiteboard/src/utils/CanvasUtil.d.ts +0 -1
  109. package/types/packages/whiteboard/src/utils/ClipboardUtil.d.ts +0 -5
  110. package/types/packages/whiteboard/src/utils/HandwriteUtil.d.ts +0 -1
  111. package/types/packages/whiteboard/src/utils/MindUtil.d.ts +0 -3
  112. package/types/packages/whiteboard/src/utils/PathUtil.d.ts +1 -1
  113. package/types/packages/whiteboard/src/utils/PointUtil.d.ts +0 -1
  114. package/types/packages/whiteboard/src/utils/PresentationManager.d.ts +1 -1
  115. package/types/packages/whiteboard/src/utils/TextStyleStore.d.ts +2 -1
  116. package/types/packages/whiteboard/src/utils/index.d.ts +0 -1
  117. package/types/packages/whiteboard/src/utils/sketch/handText.d.ts +1 -1
  118. package/types/packages/whiteboard/src/utils/sketch/index.d.ts +4 -5
  119. package/types/packages/whiteboard/src/utils/sketch/shape.d.ts +1 -2
  120. package/types/packages/whiteboard/src/utils/ViewportUtil.d.ts +0 -10
@@ -0,0 +1,91 @@
1
+ import * as Y from "yjs";
2
+ import { type ContentNode, type SharedContent } from "./protocol";
3
+ import type { ContentContractDictionary } from "../../db-schema/content-contracts";
4
+ export interface DocumentHistoryEntry {
5
+ sequence: number;
6
+ operationId: string;
7
+ actorId: string;
8
+ actorName: string;
9
+ time: number;
10
+ kind: "baseline" | "edit" | "undo" | "restore";
11
+ target?: number;
12
+ source?: string;
13
+ sourceRevision?: string;
14
+ }
15
+ export type DocumentHistoryActor = Pick<DocumentHistoryEntry, "actorId" | "actorName" | "source">;
16
+ export interface DocumentHistoryChange {
17
+ blockId: string;
18
+ kind: "insert" | "delete" | "modify" | "move";
19
+ before?: ContentNode;
20
+ after?: ContentNode;
21
+ }
22
+ export interface DocumentHistoryPreview {
23
+ entry: DocumentHistoryEntry;
24
+ value: SharedContent;
25
+ contracts: ContentContractDictionary;
26
+ changes: DocumentHistoryChange[];
27
+ previousTitle?: string;
28
+ headRevision: string;
29
+ canRestore: boolean;
30
+ canUndo: boolean;
31
+ }
32
+ export interface DocumentHistoryReader {
33
+ entry(id: string, sequence: number): DocumentHistoryEntry;
34
+ replay(id: string, sequence: number): Y.Doc;
35
+ undone(id: string, sequence: number): boolean;
36
+ }
37
+ type SqlValue = string | number | Uint8Array;
38
+ export interface DocumentHistorySql {
39
+ exec(sql: string, ...values: SqlValue[]): void;
40
+ all<Row>(sql: string, ...values: SqlValue[]): Row[];
41
+ }
42
+ interface HistoryRow {
43
+ sequence: number;
44
+ revision: string;
45
+ checkpoint: number;
46
+ byte_count: number;
47
+ metadata: string;
48
+ }
49
+ export interface TransferredDocumentHistoryVersion {
50
+ entry: DocumentHistoryEntry;
51
+ revision: string;
52
+ checkpoint: number;
53
+ storage: string[];
54
+ }
55
+ export interface DocumentHistoryWrite {
56
+ operationId: string;
57
+ actor: DocumentHistoryActor;
58
+ kind?: "edit" | "restore" | "undo";
59
+ target?: number;
60
+ time?: number;
61
+ sourceRevision?: string;
62
+ previousRevision: string;
63
+ revision: string;
64
+ update: Uint8Array;
65
+ before: () => Uint8Array;
66
+ after: () => Uint8Array;
67
+ checkBytes?: (bytes: number) => void;
68
+ }
69
+ export declare const documentHistorySchema = "\nCREATE TABLE IF NOT EXISTS document_history_entries (\n document_id TEXT NOT NULL,\n sequence INTEGER NOT NULL,\n operation_id TEXT NOT NULL,\n revision TEXT NOT NULL,\n checkpoint INTEGER NOT NULL,\n byte_count INTEGER NOT NULL,\n metadata TEXT NOT NULL,\n PRIMARY KEY(document_id,sequence),\n UNIQUE(document_id,operation_id)\n);\nCREATE TABLE IF NOT EXISTS document_history_payloads (\n document_id TEXT NOT NULL,\n sequence INTEGER NOT NULL,\n part INTEGER NOT NULL,\n state BLOB NOT NULL,\n PRIMARY KEY(document_id,sequence,part)\n);\n";
70
+ export declare function assertHistorySequence(sequence: number): void;
71
+ /** 正文提交方持有事务和逐文档写入权,历史随同一提交落盘。 */
72
+ export declare class DocumentHistoryStore {
73
+ private readonly sql;
74
+ constructor(sql: DocumentHistorySql);
75
+ head(id: string): HistoryRow | undefined;
76
+ list(id: string, before?: number): DocumentHistoryEntry[];
77
+ entriesAfter(id: string, sequence: number): DocumentHistoryEntry[];
78
+ entry(id: string, sequence: number): DocumentHistoryEntry;
79
+ operation(id: string, operationId: string): DocumentHistoryEntry | undefined;
80
+ undone(id: string, sequence: number): boolean;
81
+ remove(id: string): void;
82
+ exportVersion(id: string, sequence: number): TransferredDocumentHistoryVersion;
83
+ importVersion(id: string, value: TransferredDocumentHistoryVersion): void;
84
+ append(id: string, write: DocumentHistoryWrite): void;
85
+ private insert;
86
+ replay(id: string, sequence: number): Y.Doc;
87
+ preview(id: string, sequence: number, headRevision: string, actorId: string, owner: boolean, comparison?: Y.Doc): DocumentHistoryPreview;
88
+ }
89
+ export declare function readDocumentHistoryPreview(history: DocumentHistoryReader, id: string, sequence: number, headRevision: string, actorId: string, owner: boolean, comparison?: Y.Doc): DocumentHistoryPreview;
90
+ export declare function documentHistoryChanges(before: ContentNode[], after: ContentNode[]): DocumentHistoryChange[];
91
+ export {};
@@ -20,6 +20,8 @@ export * from "./document-adapter";
20
20
  export * from "./document-operations";
21
21
  export * from "./scoped-content-edit";
22
22
  export * from "./document-sync";
23
+ export * from "./document-history";
24
+ export * from "./document-history-edit";
23
25
  export { exportWhiteboardTransfer, prepareWhiteboardTransfer, whiteboardTransferResources, } from "./whiteboard-transfer";
24
26
  export type { WhiteboardTransfer } from "./whiteboard-types";
25
27
  export { isSafeResource, isVideoResource, imageMimeFromBytes, collaborationAssetMime, } from "./resource-policy";
@@ -19,7 +19,7 @@ export declare function createNodeDocument(identity: NodeDocumentIdentity, conte
19
19
  export declare function validateNodeDocument(doc: Y.Doc, identity?: NodeDocumentIdentity, previous?: Y.Doc, options?: NodeDocumentOptions): Promise<void>;
20
20
  /** 正文与白板富文本根共用候选校验,不依赖任何渲染或插件代码。 */
21
21
  export declare function validateNodeTree(doc: Y.Doc, rootId?: string, previous?: Y.Doc, options?: NodeDocumentOptions): Promise<void>;
22
- export declare function applyNodeDocumentUpdate(current: Y.Doc, update: Uint8Array, identity: NodeDocumentIdentity, options?: NodeDocumentOptions): Promise<Y.Doc>;
22
+ export declare function applyNodeDocumentUpdate(current: Y.Doc, update: Uint8Array, identity: NodeDocumentIdentity, options?: NodeDocumentOptions, onUpdate?: (update: Uint8Array) => void): Promise<Y.Doc>;
23
23
  export declare function readNodeDocument(doc: Y.Doc): SharedContent;
24
24
  /** 保留记录也可能被撤销重新显示;只读取各自契约声明的资源位置。 */
25
25
  export declare function collectNodeDocumentResources(doc: Y.Doc): string[];
@@ -1,4 +1,4 @@
1
- export declare const CONTENT_ENTITY_KINDS: readonly ["whiteboard-content", "data-table", "project-item", "card", "article", "diary-moment", "whiteboard", "content", "video-note"];
1
+ export declare const CONTENT_ENTITY_KINDS: readonly ["whiteboard-content", "data-table", "project-item", "card", "article", "diary-moment", "whiteboard", "content", "video-note", "pdf"];
2
2
  export type ContentEntityKind = (typeof CONTENT_ENTITY_KINDS)[number];
3
3
  export interface ContentEntityReference {
4
4
  sourceId: string;
@@ -1,5 +1,6 @@
1
+ import { type ReactNode, type ReactElement } from "react";
1
2
  import type { Node, Path } from "slate";
2
- import { Descendant, Editor, Range } from "slate";
3
+ import { Descendant, Editor, Range, Element } from "slate";
3
4
  import type { EditorKit } from "./kit/EditorKit";
4
5
  import type { EditorDocument } from "./document/EditorDocument";
5
6
  import type { InlineSuggestionProvider } from "./inlineSuggestion/controller";
@@ -14,6 +15,7 @@ export interface IEditorProps {
14
15
  onChange?: (value: Descendant[], editor: Editor) => void;
15
16
  onSelectionChange?: () => void;
16
17
  readonly?: boolean;
18
+ ariaLabel?: string;
17
19
  /** 本编辑器的组成(扩展 + 服务 + 主题)。不传则继承外层编辑器的 kit */
18
20
  kit?: EditorKit;
19
21
  /**
@@ -35,6 +37,13 @@ export interface IEditorProps {
35
37
  decorate?: (entry: [Node, Path]) => Range[];
36
38
  /** 包装已经应用标记的内容,不接管 Slate attributes。 */
37
39
  leafWrapper?: ComponentType<MarkRenderProps>;
40
+ /** 宿主可延迟挂载顶层块的界面,节点仍属于完整编辑器。 */
41
+ renderTopLevelBlock?: (args: {
42
+ editor: Editor;
43
+ index: number;
44
+ element: Element;
45
+ children: ReactNode;
46
+ }) => ReactElement;
38
47
  /** 当前视图的行内纯文本建议来源。 */
39
48
  inlineSuggestions?: InlineSuggestionProvider;
40
49
  /**
@@ -133,6 +133,5 @@ export interface ElementContractDefinition {
133
133
  resources?: readonly ContentResourceSpec[];
134
134
  }
135
135
  export declare function assertElementVersions(spec: ElementContractDefinition): void;
136
- export declare const isEditorExtension: (value: unknown) => value is EditorExtension;
137
136
  /** 扩展贡献的元素类型 */
138
137
  export declare const elementTypesOf: (extension: EditorExtension) => string[];
@@ -36,9 +36,11 @@ export { default as InlineChromiumBugfix } from "../components/InlineChromiumBug
36
36
  export { default as useIsLastElement } from "../hooks/useIsLastElement";
37
37
  export { registerBlockNavigation, hasBlockNavigation, unregisterBlockNavigation, focusPreviousBlock, focusNextBlock, type BlockNavigationHandler, } from "../utils/blockNavigation";
38
38
  export { isCollapsed, getCurrentTextNode } from "../utils/editor";
39
- export { copyNodeToClipboard, deleteVoidBlock } from "../utils/nodeOperations";
39
+ export { copyNodeToClipboard, deleteVoidBlock, setSlateFragmentData, } from "../utils/nodeOperations";
40
40
  export { CONTENT_FRAGMENT_MIME, readContentFragment, setContentFragmentTransfer, } from "./clipboardFragment";
41
41
  export { getSelectionSnapshot, isSelectionSnapshotUnchanged } from "../utils/selectionSnapshot";
42
+ export { wrapInlineText } from "../utils/wrapInlineText";
43
+ export { withNewUndoStep } from "../utils/undoStep";
42
44
  export { createParagraph, isParagraphElement, type ParagraphElement } from "../model/paragraph";
43
45
  export { insertParagraphAndFocus } from "../utils/editor";
44
46
  export { isAtParagraphStart, isParagraphAndEmpty } from "../utils/editor";
@@ -1,5 +1,6 @@
1
1
  import { Editor, Node, Path } from "slate";
2
2
  import type { EditorFeedback } from "../services/notifier";
3
+ export declare function setSlateFragmentData(editor: Editor, data: DataTransfer, fragment: Node[], plainText: string, richContent?: DocumentFragment): void;
3
4
  /**
4
5
  * 复制节点到剪贴板
5
6
  * 支持两种格式:JSON 和纯文本;传入数组时按数组顺序作为一个 fragment,纯文本以换行连接
@@ -0,0 +1,6 @@
1
+ import type { Editor } from "slate";
2
+ export declare function registerUndoStepSplitter(editor: Editor, split: () => void): void;
3
+ /** `fn` 内的修改单独成一个撤销步,不与之前的输入合并 */
4
+ export declare function withNewUndoStep(editor: Editor, fn: () => void, { isolate }?: {
5
+ isolate?: boolean | undefined;
6
+ }): void;
@@ -0,0 +1,4 @@
1
+ import { Editor, Range } from "slate";
2
+ import type { InlineElement } from "../types/custom-element";
3
+ /** 只包裹同一父节点下连续的选中文字,避免 Slate 把部分选中的行内祖先整体移入。 */
4
+ export declare function wrapInlineText(editor: Editor, create: (range: Range) => InlineElement, at?: import("slate").BaseSelection): boolean;
@@ -1,5 +1,5 @@
1
- import { type FormattedText } from "../../../../../markdown/src/model";
1
+ import type { ParagraphElement } from "../../../../api";
2
2
  export interface KbdElement {
3
3
  type: "kbd";
4
- children: FormattedText[];
4
+ children: ParagraphElement["children"];
5
5
  }
@@ -1,6 +1,6 @@
1
- import { type FormattedText } from "../../../../../markdown/src/model";
1
+ import type { ParagraphElement } from "../../../../api";
2
2
  export interface LinkElement {
3
3
  type: "link";
4
4
  url: string;
5
- children: FormattedText[];
5
+ children: ParagraphElement["children"];
6
6
  }
@@ -1,7 +1,7 @@
1
- import { type FormattedText } from "../../../../../markdown/src/model";
1
+ import type { ParagraphElement } from "../../../../api";
2
2
  import type { EStyledColor } from "./colors";
3
3
  export interface StyledTextElement {
4
4
  type: "styled-text";
5
5
  color: EStyledColor;
6
- children: FormattedText[];
6
+ children: ParagraphElement["children"];
7
7
  }
@@ -1,8 +1,8 @@
1
- import { type FormattedText } from "../../../../../markdown/src/model";
1
+ import type { ParagraphElement } from "../../../../api";
2
2
  export interface UnderlineElement {
3
3
  type: "underline";
4
4
  color: string;
5
5
  lineType: string;
6
6
  colorSelectOpen: boolean;
7
- children: FormattedText[];
7
+ children: ParagraphElement["children"];
8
8
  }
@@ -73,6 +73,7 @@ export interface MarkdownCodec {
73
73
  nextSibling: Descendant | null;
74
74
  /** 按领域声明把块级子元素降级为行内形态,无声明则原样返回。 */
75
75
  demote: (child: Descendant) => Descendant;
76
+ isBlock: (child: Descendant) => boolean;
76
77
  }) => Descendant[] | null;
77
78
  /** 按目标类型贡献规范化,先于该类型自身 normalize;按 codec 顺序首个非 null 替换生效。 */
78
79
  normalizeFor?: Readonly<Record<string, NonNullable<MarkdownCodec["normalize"]>>>;
@@ -80,9 +81,12 @@ export interface MarkdownCodec {
80
81
  inlineForm?: (element: any) => Descendant;
81
82
  /**
82
83
  * 导入:从 code 节点(围栏或缩进代码块)认领的 void 元素,把源码区间记为
83
- * 该属性的属性级位置映射(如 code-block 的 "code");缺省只有元素级映射
84
+ * 该属性的位置映射;正文位于子节点时声明相对路径。缺省只有元素级映射。
84
85
  */
85
- fenceSourceProperty?: string;
86
+ fenceSourceProperty?: string | {
87
+ property: string;
88
+ path: readonly number[];
89
+ };
86
90
  /** 导出:子块级元素之间的接续符,默认 "\n\n";列表与表格声明 "\n" */
87
91
  childSeparator?: "\n" | "\n\n";
88
92
  }
@@ -15,6 +15,7 @@ export interface ImportConfig {
15
15
  textRegistry: MarkdownTextRegistry;
16
16
  directives: Record<string, CustomDirectiveHandler>;
17
17
  voidTypes: ReadonlySet<string>;
18
+ blockTypes: ReadonlySet<string>;
18
19
  inlineWrapperDirectives: ReadonlySet<string>;
19
20
  inlineHtmlWrappers?: ReadonlyMap<string, NonNullable<MarkdownCodec["inlineHtmlWrapper"]>>;
20
21
  fenceByLanguage: ReadonlyMap<string, {
@@ -22,7 +23,7 @@ export interface ImportConfig {
22
23
  property: string;
23
24
  }>;
24
25
  importNodes?: readonly NonNullable<MarkdownCodec["importNode"]>[];
25
- fenceSourceProperties?: ReadonlyMap<string, string>;
26
+ fenceSourceProperties?: ReadonlyMap<string, NonNullable<MarkdownCodec["fenceSourceProperty"]>>;
26
27
  normalizeHooks?: ReadonlyMap<string, NonNullable<MarkdownCodec["normalize"]>>;
27
28
  inlineForms?: ReadonlyMap<string, NonNullable<MarkdownCodec["inlineForm"]>>;
28
29
  }
@@ -27,6 +27,11 @@ export interface TextMapping {
27
27
  prefixLength: number;
28
28
  suffixLength: number;
29
29
  sourceOffsets?: readonly number[];
30
+ /** 多行导入时,正文各行在源码中的起点与文本偏移。 */
31
+ sourceLines?: readonly (MarkdownPosition & {
32
+ offset: number;
33
+ length: number;
34
+ })[];
30
35
  /** 手工改写的载体无法证明字符对应时,只提供首尾边界。 */
31
36
  opaque?: boolean;
32
37
  mdEnd?: MarkdownPosition;
@@ -39,7 +44,7 @@ export interface ElementMapping {
39
44
  type: "element";
40
45
  slateElementPath: number[];
41
46
  elementType: string;
42
- isVoid: true;
47
+ isVoid: boolean;
43
48
  mdStartLine: number;
44
49
  mdStartCh: number;
45
50
  mdEndLine: number;
@@ -50,6 +55,7 @@ export interface ElementMapping {
50
55
  mdStartCh: number;
51
56
  mdEndLine: number;
52
57
  mdEndCh: number;
58
+ mdLineColumns?: readonly number[];
53
59
  };
54
60
  };
55
61
  }
@@ -130,6 +130,8 @@ export interface PluginAppActionResults {
130
130
  export type PluginAppAction = keyof PluginAppActions;
131
131
  export declare const PLUGIN_APP_ACTIONS: readonly PluginAppAction[];
132
132
  export interface PluginApp {
133
+ /** 用户操作后在桌面主窗口的右栏查看 HTTP(S) 网页。 */
134
+ openWeb(url: string): Promise<void>;
133
135
  /**
134
136
  * 打开 Tau 的搜索选择弹窗,返回用户选中的内容;用户取消时返回空数组。
135
137
  * 用户亲手挑选即视为同意插件引用这些内容,不需要读取权限。只能在用户操作(点击、按键)后调用。
@@ -57,7 +57,7 @@ export { usePluginServices } from "./service-access";
57
57
  export type { PluginMCP, PluginMCPDefinition, PluginMCPTool, PluginMCPTransport } from "./mcp";
58
58
  export type { PluginMCPToolResult } from "./mcp";
59
59
  export type { PluginChat, PluginToolRendererDefinition, PluginToolRendererProps, ToolCallExecutionState, } from "./chat";
60
- export type { PluginPageContext, PluginPageDefinition, PluginPageHandle, PluginPageParams, PluginPageProps, PluginPages, } from "./pages";
60
+ export type { PluginPageContext, PluginPageDefinition, PluginPageHandle, PluginPageParams, PluginPageProps, PluginPagePlacement, PluginPages, } from "./pages";
61
61
  export declare function definePlugin(definition: Omit<PluginDefinition, "apiVersion" | "create"> & Partial<Pick<PluginDefinition, "create">>): PluginDefinition;
62
62
  export type { PluginAI, PluginAIFeature, PluginAIRequest, PluginAIResult, PluginAIEvent, PluginAIFeatures, PluginAICapability, PluginAICapabilityClient, PluginAICapabilityRequest, PluginAIImage, PluginAIMessage, } from "./ai";
63
63
  export { PLUGIN_AI_CAPABILITIES, isPluginAICapability } from "./ai";
@@ -3,6 +3,8 @@ export type PluginNotificationMode = "auto" | "in-app" | "system";
3
3
  export interface PluginNotificationAction {
4
4
  label: string;
5
5
  primary?: boolean;
6
+ /** 查看详情时使用:卡片正文也触发此动作,失焦时先唤起插件所在窗口。 */
7
+ reveal?: boolean;
6
8
  resolvedText?: string;
7
9
  onClick(): void | Promise<void>;
8
10
  }
@@ -6,7 +6,7 @@ export interface PluginPageContext {
6
6
  /** 在组件 effect 中登记当前状态提供器;返回值的形状由插件决定。 */
7
7
  register(provider: () => JsonValue): Disposable;
8
8
  /**
9
- * 本页是否为当前显示的页面(在页面栈顶);页面隐藏、卸载或插件停用后为 false。
9
+ * 此展示位置的页面是否可见(完整页在栈顶,右栏在前台);页面隐藏、卸载或插件停用后为 false。
10
10
  * 页面隐藏时组件的 effect 会被清理、显示时重新执行,订阅与键盘监听放在 effect 里即可随之暂停;
11
11
  * 这里供命令等 effect 之外的回调判断。
12
12
  */
@@ -20,7 +20,9 @@ export interface PluginPageContext {
20
20
  */
21
21
  registerDismiss(dismiss: () => void): Disposable;
22
22
  }
23
+ export type PluginPagePlacement = "page" | "dock";
23
24
  export interface PluginPageProps {
25
+ readonly placement: PluginPagePlacement;
24
26
  readonly context: PluginContext;
25
27
  readonly params: Readonly<PluginPageParams>;
26
28
  readonly pageContext: PluginPageContext;
@@ -29,13 +31,17 @@ export interface PluginPageDefinition {
29
31
  id: string;
30
32
  title: string;
31
33
  component: ComponentType<PluginPageProps>;
34
+ /** 允许在桌面主窗口以 dock 打开。 */
35
+ dockable?: boolean;
32
36
  match?: "single" | "params";
33
37
  /** params 页缺省按完整参数区分实例;提供时只按该身份去重。 */
34
38
  getId?(params: Readonly<PluginPageParams>): string;
35
39
  }
36
40
  export interface PluginPageHandle extends Disposable {
37
41
  readonly id: string;
38
- open(params?: PluginPageParams): Promise<void>;
42
+ open(params?: PluginPageParams, options?: {
43
+ placement?: PluginPagePlacement;
44
+ }): Promise<void>;
39
45
  }
40
46
  export interface PluginPages {
41
47
  register(definition: PluginPageDefinition): PluginPageHandle;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 浏览器扩展 ↔ 桌面的 AI 运行协议 v2(M5)。取代 v1 的 `ai.chat` 请求 + `ai.stream.*` 快照通知。
2
+ * 浏览器扩展 ↔ 桌面的 AI 运行协议 v2。取代 v1 的 `ai.chat` 请求 + `ai.stream.*` 快照通知。
3
3
  *
4
4
  * 一次运行 = 一个 runId:
5
5
  * - `ai.run.start`(请求)立即返回 `{ runId }`,不等回答结束;
@@ -25,7 +25,7 @@ export interface TextContent {
25
25
  type: "text";
26
26
  text: string;
27
27
  mentions?: MentionRef[];
28
- /** 本条消息用 `$` 点名的 Skill(folderName),发送时注入全文(D-060) */
28
+ /** 本条消息用 `$` 点名的 Skill(folderName),发送时注入全文 */
29
29
  skills?: string[];
30
30
  }
31
31
  export interface ImageContent {
@@ -112,6 +112,14 @@ export type ResponseContentBlock = {
112
112
  };
113
113
  /** ContentBlock 为 ResponseContentBlock 的兼容别名(历史导出名) */
114
114
  export type ContentBlock = ResponseContentBlock;
115
+ export interface ChatCompactionUsage {
116
+ tokensBefore: number;
117
+ estimatedTokensAfter: number;
118
+ /** 直到模型回报新的实际用量,圆环使用压缩后的估算。 */
119
+ isCurrent: boolean;
120
+ providerId?: string;
121
+ modelId?: string;
122
+ }
115
123
  export interface ModelUsage {
116
124
  inputTokens: number;
117
125
  outputTokens: number;
@@ -128,12 +136,12 @@ export interface MessageVersions {
128
136
  export interface RequestMessage {
129
137
  clientId?: string;
130
138
  /**
131
- * 对应的 pi 会话 entry id(M4:从 JSONL 投影出来的消息才有)。改历史操作(删除/编辑重发/
139
+ * 对应的 pi 会话 entry id(从 JSONL 投影出来的消息才有)。改历史操作(删除/编辑重发/
132
140
  * 重新生成)按它定位,不能靠 clientId——迁移数据的 clientId 是旧值。
133
141
  */
134
142
  piEntryIds?: string[];
135
143
  /**
136
- * 会话树上同一位置的全部版本(M4-d:编辑重发/重新生成/从这里建分支产生的兄弟)。
144
+ * 会话树上同一位置的全部版本(编辑重发/重新生成/从这里建分支产生的兄弟)。
137
145
  * ids 为各版本用户消息的 entry id(写入顺序),index 是本条是第几个;只有一个版本时不带。
138
146
  */
139
147
  piVersions?: MessageVersions;
@@ -159,7 +167,7 @@ export interface ResponseMessage {
159
167
  }
160
168
  export type ChatSessionMessage = RequestMessage | ResponseMessage;
161
169
  /**
162
- * 一个已打开的对话(M4:会话目录行 + pi JSONL 投影出的消息)。注意与 ChatComponents 的
170
+ * 一个已打开的对话(会话目录行 + pi JSONL 投影出的消息)。注意与 ChatComponents 的
163
171
  * ChatMessage(单条消息)区分,桌面历史代码以 `ChatMessage` 名字消费本类型。
164
172
  *
165
173
  * id 即 pi 会话 id(字符串):新对话在渲染端生成 id,目录表里查不到就是草稿,
@@ -172,6 +180,7 @@ export interface ChatSessionRecord {
172
180
  createTime: number;
173
181
  updateTime: number;
174
182
  messages: ChatSessionMessage[];
183
+ compaction?: ChatCompactionUsage;
175
184
  title: string;
176
185
  titleDirty?: boolean;
177
186
  groupId?: number | null;
@@ -7,5 +7,4 @@
7
7
  *
8
8
  * 对比度按 02 规范 §2.5,深浅两套均由 theme-parity.test.ts 校验。
9
9
  */
10
- declare const _default: import("../defineTheme").ThemeDefinition;
11
- export default _default;
10
+ export {};
@@ -7,5 +7,4 @@
7
7
  *
8
8
  * 对比度按 02 规范 §2.5,深浅两套均由 theme-parity.test.ts 校验。
9
9
  */
10
- declare const _default: import("../defineTheme").ThemeDefinition;
11
- export default _default;
10
+ export {};
@@ -8,5 +8,4 @@
8
8
  * 层级与浅色对称翻转(同暖纸 · 夜的口径):surface 最亮、sunken 最暗;交互态改盐白墨低透明
9
9
  * 叠层;阴影加深至黑系。
10
10
  */
11
- declare const _default: import("../defineTheme").ThemeDefinition;
12
- export default _default;
11
+ export {};
@@ -12,5 +12,4 @@
12
12
  * 对比度按 02 规范 §2.5:ink-1 对 page/surface ≥ 7:1、ink-2 与 accent 文字 ≥ 4.5:1
13
13
  * (由 theme-parity.test.ts 的对比度断言守护,深浅两套都校验)。
14
14
  */
15
- declare const _default: import("../defineTheme").ThemeDefinition;
16
- export default _default;
15
+ export {};
@@ -7,5 +7,4 @@
7
7
  *
8
8
  * 对比度按 02 规范 §2.5,深浅两套均由 theme-parity.test.ts 校验。
9
9
  */
10
- declare const _default: import("../defineTheme").ThemeDefinition;
11
- export default _default;
10
+ export {};
@@ -6,5 +6,4 @@
6
6
  *
7
7
  * 对比度按 02 规范 §2.5,深浅两套均由 theme-parity.test.ts 校验。
8
8
  */
9
- declare const _default: import("../defineTheme").ThemeDefinition;
10
- export default _default;
9
+ export {};
@@ -18,6 +18,6 @@ export declare const SCALE_WORDS: {
18
18
  readonly radius: readonly ["tau-sm", "tau-md", "tau-lg"];
19
19
  readonly shadow: readonly ["card", "lift", "float", "paper"];
20
20
  readonly ease: readonly ["tau-out"];
21
- readonly animate: readonly ["hm-pulse"];
21
+ readonly animate: readonly ["hm-pulse", "aurora-1", "aurora-2", "aurora-3"];
22
22
  };
23
23
  export declare const cn: (...inputs: ClassValue[]) => string;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * AnchoredPanel 基础件 —— 锚定面板:浮层家族的定位基座(Radix Popper 同构层)。
3
3
  *
4
- * 与 Popover 的分工:AnchoredPanel 只管锚定定位(D-004 引擎)、卡片视觉、portal
4
+ * 与 Popover 的分工:AnchoredPanel 只管锚定定位、卡片视觉、portal
5
5
  * 与显隐过渡——无开合状态(默认锚点在即显示,open 可由宿主驱动)、不监听外点、
6
6
  * 不消费 Esc/Tab、不抢焦点,键盘与焦点事件原样冒泡给宿主仲裁。Popover 组合它并
7
7
  * 叠加交互层(trigger 注入、外点/Esc/Tab 仲裁、焦点契约、dialog 语义);卡片与
@@ -39,8 +39,8 @@ export interface AnchoredPanelBodyProps {
39
39
  children: ReactNode;
40
40
  className?: string;
41
41
  }
42
- /** 正文:独立滚动(上限 min(60vh, 420px))+ 边缘渐隐 + 透明右边框挤位(D-012 手法,
43
- * 浮层滚动区通用口径);顶部间距按有无头行分流:无头行自足 14px,有头行收敛 10px。
42
+ /** 正文:独立滚动(上限 min(60vh, 420px))+ 边缘渐隐 + 透明右边框挤位
43
+ * (浮层滚动区通用手法);顶部间距按有无头行分流:无头行自足 14px,有头行收敛 10px。
44
44
  * 滚动轨道上下让位(track margin;track 透明边框不缩短 thumb 活动区):贴浮层边缘的一端
45
45
  * 让出圆角半径,免得 thumb 画进 rounded-tau-lg 的圆角外;头行下方只留 4px */
46
46
  declare function AnchoredPanelBody({ children, className }: AnchoredPanelBodyProps): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Button —— 文字按钮基础件(方案 B「现代产品」形制,mockups/button/,D-013)。
2
+ * Button —— 文字按钮基础件(「现代产品」形制)。
3
3
  *
4
- * 变体六档是一个动作的全部音量,层级纪律靠评审不进 API:
4
+ * 变体六档是一个动作的全部音量,层级纪律不进 API:
5
5
  * - primary:accent 实心 + 微投影,每屏至多一枚;Dialog 应答区主按钮位
6
- * - secondary:surface 亮底 + line-1 描边(D-007/D-009「浮起物」口径),应答与取消的默认档
6
+ * - secondary:surface 亮底 + line-1 描边(「浮起物」口径),应答与取消的默认档
7
7
  * - soft:accent-soft 平底,工具栏高频次级强调(比 secondary 轻、比 ghost 重)
8
8
  * - ghost:无底 hover 淡墨,与 IconButton 同反馈语言
9
- * - danger / danger-soft:对齐 D-011 危险分级——实心红只给确认位,列表/工具栏一律 soft
9
+ * - danger / danger-soft:危险分级——实心红只给确认位,列表/工具栏一律 soft
10
10
  *
11
11
  * 行为契约:loading = aria-busy + spinner + 文案切换 + 一并 disabled(指针封锁与
12
12
  * Tab 队列退出由原生 disabled 承担);disabled 同理走原生属性;focus-visible 才显
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Checkbox —— 勾选基础件(Input 方案 A「经典描边」语言,mockups/checkbox/,2026-09-19 定稿)。
2
+ * Checkbox —— 勾选基础件(Input 的「经典描边」语言)。
3
3
  *
4
4
  * 原生 input[type=checkbox] 承载语义(appearance-none 自绘皮):label 点击切换、
5
5
  * Space 原生支持、读屏语义白送。「浮起物」:16×16 视觉格 surface + line-1,
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * 结构铁律:input / 格子 / 勾图标必须在同一层互为兄弟——Tailwind 的 peer-* 变体
9
9
  * 只匹配 peer 的后续兄弟(`~ *`),挂在深层后代上会静默失效(勾选后无任何视觉)。
10
- * 状态语义(与 Input 裁决同源):
10
+ * 状态语义(与 Input 同源):
11
11
  * - 命中 24×24(input 绝对定位撑满锚格,宪法下限);focus-visible 才显 ring
12
12
  * (锚格经 has- 变体响应,因锚是 input 的父级而非兄弟)
13
13
  * - hover 描边加深半档(未选中 ink-3/50 / 选中 accent-hover),聚焦时让位
@@ -1,15 +1,15 @@
1
1
  /**
2
- * ConfirmDialog —— Dialog 的最薄语义预设:确认类对话一句话接线(D-011)。
2
+ * ConfirmDialog —— Dialog 的最薄语义预设:确认类对话一句话接线。
3
3
  *
4
4
  * 信息一处一责:标题讲动作、context 徽标记对象、description 讲事实、impact 念
5
- * 后果、按钮文案不带数量。danger 两档(D-011 用户裁决):
5
+ * 后果、按钮文案不带数量。danger 两档:
6
6
  * - 轻 danger:实心红主按钮 + 初始焦点落取消(回车不误触),一步确认
7
7
  * - 真·不可逆:typeToConfirm 传对象名,输入匹配才解锁确认按钮(每次打开重置)
8
8
  *
9
9
  * 异步确认两种接法:
10
10
  * - 推荐:onConfirm 返回 Promise(async 函数天然满足)——自动进入 loading,
11
11
  * resolve 后自动关闭、reject 保持打开(错误留在原地处理);loading 态封锁
12
- * 一切关闭路径,回执交 Toast(D-003 家族分工)
12
+ * 一切关闭路径,回执交 Toast
13
13
  * - 受控:loading prop 由调用方管理(多步进度等),完成后自行把 open 置 false。
14
14
  * 注意不能在 onConfirm 里才 set loading——props 是渲染快照,同步路径会先按
15
15
  * false 立即关闭(样板间首版即踩此竞态,故内建 Promise 感知)
@@ -1,16 +1,16 @@
1
1
  /**
2
- * Dialog 基础件 —— 模态决策容器 + ConfirmDialog 语义预设(形制与行为裁决见 D-011)。
2
+ * Dialog 基础件 —— 模态决策容器 + ConfirmDialog 语义预设。
3
3
  *
4
4
  * 形制:体内大标题 + 上下文徽标(context)+ hairline 应答区(主按钮最右,按钮序列
5
5
  * 由 footer 提供)+ blur 遮罩;长内容滚动区接 edge fade(对齐壳层 useEdgeFade
6
- * 协议)。阻断通知不带 icon,文字头部与其它对话同构(D-011)。
6
+ * 协议)。阻断通知不带 icon,文字头部与其它对话同构。
7
7
  *
8
8
  * 行为内建(不做成 props):
9
9
  * - 开合动效:遮罩淡入 + 卡片 scale(0.97)+translateY(8px),退场等长后卸载;根上带
10
10
  * data-morph(视图转场进行中)时一步到位到终态——转场更新期间 rAF 不触发,入场
11
11
  * 动效跑不起来,浏览器要截的是终态。卡片 data-state=open|closed 供形变定位就绪
12
12
  * - Esc:仅 open 态在卡片 DOM 消费(stopPropagation)——焦点圈闭保证 Esc 必落
13
- * 卡片,焦点链即 LIFO,不进 D-003 注册表(同 D-007/D-010 口径,ui 不反向依赖
13
+ * 卡片,焦点链即 LIFO,不进全局注册表(ui 不反向依赖
14
14
  * page/);critical 抖动拒绝
15
15
  * - 关闭矩阵:dismissible = × + Esc + 遮罩点击;critical = 无 ×、遮罩点击抖动;
16
16
  * locked(异步 loading)= 全失效
@@ -28,7 +28,7 @@
28
28
  * 自定义头部:`header` 整体替换内建标题行与 ×(工作台型弹窗自带导航头时用),
29
29
  * 关闭入口由 header 自行提供;`title` 仍是对话框的无障碍名称。
30
30
  *
31
- * 尺寸档是预设不是牢笼(D-011):sm 380 / md 440(默认)/ lg 560,width 任意值覆盖;
31
+ * 尺寸档是预设不是牢笼:sm 380 / md 440(默认)/ lg 560,width 任意值覆盖;
32
32
  * 高度默认随内容(上限 78vh),height 定高(仍不超 82vh)。
33
33
  * 层级:遮罩容器 z-[340](Select/Menu 250 < Tooltip 300 之上,Toast 360 之下——弹窗里的操作反馈须可见)。
34
34
  */
@@ -2,7 +2,7 @@
2
2
  * 加载态 —— Spinner 圆环 + 页面级居中版式(02 §5.1 词表的 Spinner 归位)。
3
3
  * Spinner 可单独行内使用;Loading 铺满父容器居中。
4
4
  *
5
- * 兜底高度走 prop(inline style)而非 Tailwind 类(2026-09-17 修正):原实现把
5
+ * 兜底高度走 prop(inline style)而非 Tailwind 类:原实现把
6
6
  * `min-h-[45vh]` 写死在基础类里,调用方传 `className="min-h-0"` 会被它压掉——
7
7
  * 同名 utility 的胜负由 Tailwind 生成顺序决定,**不由 class 书写顺序决定**,所以
8
8
  * 那个覆盖一直是静默失效的(样板间把 Loading 放进 168px 演示框时内容被裁空,
@@ -3,7 +3,7 @@
3
3
  * 键盘导航、焦点回收、外点关闭和菜单树互斥由组件内建。
4
4
  */
5
5
  import { type ReactElement, type ReactNode } from "react";
6
- /** 根级:命令项触发后的整树关闭(外点/互斥由 dismiss 层逐层登记承担,D-014) */
6
+ /** 根级:命令项触发后的整树关闭(外点/互斥由 dismiss 层逐层登记承担) */
7
7
  export interface MenuRootContextValue {
8
8
  closeMenu: () => void;
9
9
  }