@xiongtao.xt/tau-plugins 0.42.0 → 0.44.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.
- package/CHANGELOG.md +12 -0
- package/client/{chunk-XCKDPTLI.js → chunk-M3YEVDN4.js} +1 -0
- package/client/chunk-UTVEXGFI.js +30 -0
- package/client/{chunk-666OM7IO.js → chunk-X6MBLKAL.js} +1 -1
- package/client/{fuse-M2Z6NNAT.js → fuse-KWYBABFA.js} +2 -0
- package/docs/README.md +4 -1
- package/docs/ai.md +3 -0
- package/docs/api-support.md +10 -0
- package/docs/content-metrics.md +45 -0
- package/docs/editor.md +4 -0
- package/docs/getting-started.md +5 -1
- package/docs/plugin-basics.md +1 -0
- package/docs/portability.md +5 -1
- package/docs/providers/README.md +3 -1
- package/docs/providers/asr.md +41 -0
- package/docs/storage-and-network.md +4 -0
- package/docs/websocket.md +39 -0
- package/package.js +2 -1
- package/package.json +1 -1
- package/portable.js +3 -2
- package/publish-artifacts.js +116 -6
- package/publish-client.js +3 -1
- package/types/packages/asr/src/capture.d.ts +11 -0
- package/types/packages/asr/src/errors.d.ts +9 -0
- package/types/packages/asr/src/index.d.ts +8 -0
- package/types/packages/asr/src/input.d.ts +30 -0
- package/types/packages/asr/src/reducer.d.ts +14 -0
- package/types/packages/asr/src/refinement.d.ts +21 -0
- package/types/packages/asr/src/stream.d.ts +12 -0
- package/types/packages/asr/src/task.d.ts +2 -0
- package/types/packages/asr/src/types.d.ts +108 -0
- package/types/packages/db-schema/content-contracts.d.ts +80 -0
- package/types/packages/db-schema/content-metrics.d.ts +30 -0
- package/types/packages/db-schema/content-resources.d.ts +4 -0
- package/types/packages/editor/contracts.d.ts +2 -2
- package/types/packages/editor/source-contracts.d.ts +67 -3
- package/types/packages/editor/src/core/api/elementVersions.d.ts +12 -0
- package/types/packages/editor/src/core/api/extension.d.ts +15 -0
- package/types/packages/editor/src/core/api/index.d.ts +3 -0
- package/types/packages/editor/src/core/api/useTextFieldBinding.d.ts +9 -0
- package/types/packages/editor/src/core/kit/ExtensionAssembly.d.ts +5 -1
- package/types/packages/markdown/src/codec.d.ts +2 -0
- package/types/packages/markdown/src/index.d.ts +1 -0
- package/types/packages/markdown/src/markdown-helper.d.ts +3 -0
- package/types/packages/markdown/src/markdownSerializerRegistry.d.ts +8 -2
- package/types/packages/markdown/src/positionMapper.d.ts +1 -0
- package/types/packages/markdown/src/processor.d.ts +3 -0
- package/types/packages/markdown/src/unknownNode.d.ts +24 -0
- package/types/packages/plugins/src/ai.d.ts +3 -0
- package/types/packages/plugins/src/asr.d.ts +13 -0
- package/types/packages/plugins/src/contract.d.ts +7 -0
- package/types/packages/plugins/src/editor.d.ts +4 -0
- package/types/packages/plugins/src/index.d.ts +4 -2
- package/types/packages/plugins/src/permissions.d.ts +1 -1
- package/types/packages/plugins/src/rendering.d.ts +1 -1
- package/types/packages/plugins/src/settings.d.ts +6 -1
- package/types/packages/plugins/src/source-editor.d.ts +2 -0
- package/types/packages/plugins/src/websocket.d.ts +9 -0
|
@@ -6,11 +6,14 @@ import type { WhiteboardExtension } from "./whiteboard";
|
|
|
6
6
|
import type { PluginServices } from "./services";
|
|
7
7
|
import type { PluginEditor } from "./editor";
|
|
8
8
|
import type { PluginEditorExtension } from "./editor";
|
|
9
|
+
import type { ContentMetricRule } from "../../db-schema/content-metrics";
|
|
9
10
|
import type { MarkdownCodec } from "../../markdown/src/index";
|
|
10
11
|
import type { PluginSettings } from "./settings";
|
|
11
12
|
import type { PluginSync } from "./sync";
|
|
12
13
|
import type { PluginUpload } from "./upload";
|
|
13
14
|
import type { PluginTTS } from "./tts";
|
|
15
|
+
import type { PluginASR } from "./asr";
|
|
16
|
+
import type { PluginWebSocket } from "./websocket";
|
|
14
17
|
import type { PluginImages } from "./images";
|
|
15
18
|
import type { PluginVideo } from "./video";
|
|
16
19
|
import type { PluginPublish } from "./publish";
|
|
@@ -65,6 +68,8 @@ export interface PluginContext {
|
|
|
65
68
|
readonly sync: PluginSync;
|
|
66
69
|
readonly upload: PluginUpload;
|
|
67
70
|
readonly tts: PluginTTS;
|
|
71
|
+
readonly asr: PluginASR;
|
|
72
|
+
readonly websocket: PluginWebSocket;
|
|
68
73
|
readonly images: PluginImages;
|
|
69
74
|
readonly video: PluginVideo;
|
|
70
75
|
readonly publish: PluginPublish;
|
|
@@ -118,6 +123,8 @@ export interface PluginDefinition {
|
|
|
118
123
|
readonly editorExtensions?: readonly PluginEditorExtension[];
|
|
119
124
|
readonly whiteboardExtensions?: readonly WhiteboardExtension[];
|
|
120
125
|
readonly editorCodecs?: readonly MarkdownCodec[];
|
|
126
|
+
/** 可序列化的统计字段,与 Markdown 转换独立;不执行插件回调。 */
|
|
127
|
+
readonly editorMetrics?: readonly ContentMetricRule[];
|
|
121
128
|
readonly ai?: {
|
|
122
129
|
readonly features: readonly PluginAIFeature[];
|
|
123
130
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { ContentMetricRule } from "../../db-schema/content-metrics";
|
|
1
2
|
import type { EditorExtension as InternalExtension } from "../../editor/contracts";
|
|
2
3
|
import type { MarkdownCodec } from "../../markdown/src/index";
|
|
3
4
|
import type { Disposable } from "./index";
|
|
4
5
|
import { type OpenEditorExtensionField } from "./editor-fields";
|
|
5
6
|
export { defineElement as defineEditorElement } from "../../editor/contracts";
|
|
6
7
|
export type { ElementRenderProps as EditorElementRenderProps } from "../../editor/contracts";
|
|
8
|
+
export type { ContentMetricRule as EditorMetricRule } from "../../db-schema/content-metrics";
|
|
7
9
|
export type { MarkdownCodec as EditorMarkdownCodec } from "../../markdown/src/index";
|
|
8
10
|
export type { ContentResourceSpec as EditorResourceSpec, ContentResourceKind as EditorResourceKind, } from "../../db-schema/content-resources";
|
|
9
11
|
/** 作者通过模块增强登记自定义节点,无需引用编辑器内部包。 */
|
|
@@ -34,6 +36,7 @@ export type PluginEditorExtension = Pick<InternalExtension, OpenEditorExtensionF
|
|
|
34
36
|
/** 静态 HTML/EPUB 导出;博客始终使用 elements.render,不经过这里。 */
|
|
35
37
|
htmlSerializers?: readonly {
|
|
36
38
|
type: string;
|
|
39
|
+
dataVersion?: number;
|
|
37
40
|
toHtml(element: Record<string, unknown>): string;
|
|
38
41
|
}[];
|
|
39
42
|
};
|
|
@@ -44,6 +47,7 @@ export interface PluginEditorContribution {
|
|
|
44
47
|
extension: PluginEditorExtension;
|
|
45
48
|
/** 纯函数定义可由主进程独立导入,本次只在开发台装配。 */
|
|
46
49
|
codecs?: readonly MarkdownCodec[];
|
|
50
|
+
metrics?: readonly ContentMetricRule[];
|
|
47
51
|
}
|
|
48
52
|
export interface PluginEditor {
|
|
49
53
|
register(contribution: PluginEditorContribution): Disposable;
|
|
@@ -11,8 +11,8 @@ export type * from "./publish";
|
|
|
11
11
|
export type { JsonValue, Disposable, PluginStorage, PluginCommand, PluginContext, PluginInstance, PluginDefinition, } from "./contract";
|
|
12
12
|
export type { PluginSettings, PluginSettingsDefinition, PluginSettingsProps, PluginSettingsHandle, } from "./settings";
|
|
13
13
|
export * from "./editor";
|
|
14
|
-
export { SourceBlockEditor, useSourceBlock, useReportPreviewError, insertSourceBlock, sourceBlockParagraphBehavior, } from "./source-editor";
|
|
15
|
-
export type { SourceBlockEditorProps, PluginRuntimeStyleCompiler } from "./source-editor";
|
|
14
|
+
export { SourceBlockEditor, useSourceBlock, useTextField, useReportPreviewError, insertSourceBlock, sourceBlockParagraphBehavior, } from "./source-editor";
|
|
15
|
+
export type { SourceBlockEditorProps, PluginRuntimeStyleCompiler, TextFieldEditor } from "./source-editor";
|
|
16
16
|
export { useInlineSource, insertInlineSource, InlineSourceBoundary } from "./inline-source";
|
|
17
17
|
export { ContentEditor, ContentPreview, EntityRef } from "./components";
|
|
18
18
|
export { useElement, useMediaViewer, BlockToolbar, BlockToolbarButton, BlockToolbarGap, } from "./element";
|
|
@@ -55,3 +55,5 @@ export type { PluginPageContext, PluginPageDefinition, PluginPageHandle, PluginP
|
|
|
55
55
|
export declare function definePlugin(definition: Omit<PluginDefinition, "apiVersion" | "create"> & Partial<Pick<PluginDefinition, "create">>): PluginDefinition;
|
|
56
56
|
export type { PluginAI, PluginAIFeature, PluginAIRequest, PluginAIResult, PluginAIEvent, PluginAIFeatures, PluginAICapability, PluginAICapabilityClient, PluginAICapabilityRequest, PluginAIImage, PluginAIMessage, } from "./ai";
|
|
57
57
|
export { PLUGIN_AI_CAPABILITIES, isPluginAICapability } from "./ai";
|
|
58
|
+
export * from "./asr";
|
|
59
|
+
export type * from "./websocket";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const PLUGIN_PERMISSIONS: readonly ["cards:read", "cards:write", "cards:delete", "articles:read", "articles:write", "articles:delete", "documents:read", "documents:write", "documents:delete", "whiteboards:read", "whiteboards:write", "whiteboards:delete", "projects:read", "projects:write", "projects:delete", "todos:read", "todos:write", "todos:delete", "calendar:read", "calendar:write", "calendar:delete", "notebooks:read", "materials:read", "chats:read", "flashcards:read", "flashcards:write", ...("ai:chat" | "ai:titleSummary" | "ai:webClip" | "ai:podcastGeneration" | "ai:flashcardGeneration" | "ai:aiJudgement" | "ai:transcriptionOptimization" | "ai:videoSummary" | "ai:videoEbookRewrite" | "ai:vibeLearningImageDescription" | "ai:contentMetadata" | "ai:contentInsights")[]];
|
|
1
|
+
export declare const PLUGIN_PERMISSIONS: readonly ["cards:read", "cards:write", "cards:delete", "articles:read", "articles:write", "articles:delete", "documents:read", "documents:write", "documents:delete", "whiteboards:read", "whiteboards:write", "whiteboards:delete", "projects:read", "projects:write", "projects:delete", "todos:read", "todos:write", "todos:delete", "calendar:read", "calendar:write", "calendar:delete", "notebooks:read", "materials:read", "chats:read", "flashcards:read", "flashcards:write", ...("ai:chat" | "ai:titleSummary" | "ai:webClip" | "ai:podcastGeneration" | "ai:flashcardGeneration" | "ai:aiJudgement" | "ai:transcriptionOptimization" | "ai:speechInputRefinement" | "ai:videoSummary" | "ai:videoEbookRewrite" | "ai:vibeLearningImageDescription" | "ai:contentMetadata" | "ai:contentInsights")[]];
|
|
2
2
|
export type PluginPermission = (typeof PLUGIN_PERMISSIONS)[number];
|
|
3
3
|
export declare const isPluginPermission: (value: unknown) => value is PluginPermission;
|
|
4
4
|
/** granted:可直接调用;prompt:调用时会询问用户;denied:本次运行已拒绝或已被阻止 */
|
|
@@ -4,7 +4,7 @@ import type { MarkdownCodec } from "../../markdown/src/index";
|
|
|
4
4
|
import { type ReadablePortablePluginManifest, type PortablePluginHost } from "./portable";
|
|
5
5
|
import { type DevelopmentPluginPackage, type PluginManifest } from "./package";
|
|
6
6
|
export type { PublishedPluginRender } from "./render-artifact";
|
|
7
|
-
export declare function assertUniqueEditorCodecs(codecs: readonly MarkdownCodec[]): void;
|
|
7
|
+
export declare function assertUniqueEditorCodecs(codecs: readonly MarkdownCodec[], versions?: ReadonlyMap<string, number | undefined>): void;
|
|
8
8
|
export declare const PLUGIN_RENDER_VERSION = 1;
|
|
9
9
|
/** 发布站只读取静态贡献;清单保持原格式,不启动应用插件生命周期。 */
|
|
10
10
|
export declare function readPublishedPluginManifest(value: unknown): PluginManifest | import("./portable").PortablePluginManifest;
|
|
@@ -13,6 +13,11 @@ export interface PluginSettingsProps {
|
|
|
13
13
|
readonly modelId: string;
|
|
14
14
|
save(value: JsonValue, modelId: string): Promise<void>;
|
|
15
15
|
};
|
|
16
|
+
readonly asrConfig?: {
|
|
17
|
+
readonly value: JsonValue;
|
|
18
|
+
readonly modelId: string;
|
|
19
|
+
save(value: JsonValue, modelId: string): Promise<void>;
|
|
20
|
+
};
|
|
16
21
|
readonly ttsConfig?: {
|
|
17
22
|
readonly instanceId: string;
|
|
18
23
|
readonly value: JsonValue;
|
|
@@ -43,7 +48,7 @@ export interface PluginSettingsDefinition {
|
|
|
43
48
|
title: string;
|
|
44
49
|
description?: string;
|
|
45
50
|
/** 提供方配置表单挂载到对应宿主设置;普通插件设置省略。 */
|
|
46
|
-
target?: "sync" | "upload" | "tts" | "images" | "video" | "publish";
|
|
51
|
+
target?: "sync" | "upload" | "tts" | "asr" | "images" | "video" | "publish";
|
|
47
52
|
component: ComponentType<PluginSettingsProps>;
|
|
48
53
|
}
|
|
49
54
|
export interface PluginSettingsHandle extends Disposable {
|
|
@@ -3,6 +3,8 @@ export type { SourceBlockEditorProps, RuntimeStyleCompiler as PluginRuntimeStyle
|
|
|
3
3
|
export declare function configureSourceEditor(value: SourceEditorRuntime): void;
|
|
4
4
|
export declare const SourceBlockEditor: SourceEditorRuntime["SourceBlockEditor"];
|
|
5
5
|
export declare const useSourceBlock: SourceEditorRuntime["useSourceBlock"];
|
|
6
|
+
export declare const useTextField: SourceEditorRuntime["useTextField"];
|
|
7
|
+
export type { TextFieldEditor } from "../../editor/source-contracts";
|
|
6
8
|
export declare const useReportPreviewError: SourceEditorRuntime["useReportPreviewError"];
|
|
7
9
|
export declare const insertSourceBlock: SourceEditorRuntime["insertSourceBlock"];
|
|
8
10
|
export declare const sourceBlockParagraphBehavior: SourceEditorRuntime["sourceBlockParagraphBehavior"];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** 由宿主创建、符合浏览器 WebSocket 事件和方法契约的连接。 */
|
|
2
|
+
export type PluginSocket = WebSocket;
|
|
3
|
+
export interface PluginSocketOptions {
|
|
4
|
+
headers?: Readonly<Record<string, string>>;
|
|
5
|
+
signal?: AbortSignal;
|
|
6
|
+
}
|
|
7
|
+
export interface PluginWebSocket {
|
|
8
|
+
connect(url: string, protocols?: string | string[], options?: PluginSocketOptions): PluginSocket;
|
|
9
|
+
}
|