@fileverse-dev/ddoc 2.2.8-byom-13 → 2.2.8-byom-14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as d, P as r, h as s, u as t } from "./index-CHoroELQ.mjs";
1
+ import { D as d, P as r, h as s, u as t } from "./index-B1IWd71H.mjs";
2
2
  export {
3
3
  d as DdocEditor,
4
4
  r as PreviewDdocEditor,
@@ -9,3 +9,35 @@ export interface ToneOption {
9
9
  * Available tone options for AI text generation
10
10
  */
11
11
  export declare const TONE_OPTIONS: ToneOption[];
12
+ export declare const loadingMessages: string[];
13
+ export interface ModelOption {
14
+ value: string;
15
+ label: string;
16
+ }
17
+ export interface CustomModel {
18
+ modelName: string;
19
+ label: string;
20
+ }
21
+ export interface ModelContextType {
22
+ defaultModels: CustomModel[];
23
+ isLoadingDefaultModels: boolean;
24
+ ollamaError: string | null;
25
+ activeModel?: CustomModel;
26
+ setActiveModel: (model: CustomModel | undefined) => void;
27
+ maxTokens: number;
28
+ setMaxTokens: (maxTokens: number) => void;
29
+ tone: string;
30
+ setTone: (tone: string) => void;
31
+ systemPrompt: string;
32
+ setSystemPrompt: (prompt: string) => void;
33
+ selectedLLM: string | null;
34
+ setSelectedLLM: (llm: string | null) => void;
35
+ }
36
+ export interface ModelService {
37
+ callModel?: (prompt: string, model: string) => Promise<string>;
38
+ streamModel?: (prompt: string, model: string, onChunk: (chunk: string) => void, signal?: AbortSignal) => Promise<void>;
39
+ getAvailableModels?: () => Promise<ModelOption[]>;
40
+ }
41
+ export interface WindowWithModelContext extends Window {
42
+ __MODEL_CONTEXT__?: ModelContextType;
43
+ }
@@ -0,0 +1,5 @@
1
+ import { default as MarkdownIt } from 'markdown-it';
2
+
3
+ export declare const getLoadingMessageInOrder: () => string;
4
+ export declare const getRandomLoadingMessage: () => string;
5
+ export declare const md: MarkdownIt;
@@ -107,6 +107,7 @@ export interface DdocProps extends CommentAccountProps {
107
107
  footerHeight?: string;
108
108
  activeModel?: CustomModel;
109
109
  maxTokens?: number;
110
+ isAIAgentEnabled?: boolean;
110
111
  }
111
112
  export interface IEditorSelectionData {
112
113
  from: number;
@@ -1,7 +1,7 @@
1
1
  import { DdocProps } from './types';
2
2
 
3
3
  import * as Y from 'yjs';
4
- export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, walletAddress, username, onChange, onCollaboratorChange, onCommentInteraction, ensResolutionUrl, onError, setCharacterCount, setWordCount, secureImageUploadUrl, ddocId, enableIndexeddbSync, unFocused, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, proExtensions, metadataProxyUrl, onCopyHeadingLink, activeModel, maxTokens, }: Partial<DdocProps>) => {
4
+ export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, walletAddress, username, onChange, onCollaboratorChange, onCommentInteraction, ensResolutionUrl, onError, setCharacterCount, setWordCount, secureImageUploadUrl, ddocId, enableIndexeddbSync, unFocused, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, proExtensions, metadataProxyUrl, onCopyHeadingLink, activeModel, maxTokens, isAIAgentEnabled, }: Partial<DdocProps>) => {
5
5
  editor: import('@tiptap/core').Editor | null;
6
6
  isContentLoading: boolean;
7
7
  ref: import('react').RefObject<HTMLDivElement>;