@kedataindo/docflow-core 0.0.60 → 0.0.62
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/ai/index.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { b as AIAction, c as AIActionRequest, d as AICompleteRequest, e as AIConfig, f as
|
|
1
|
+
export { b as AIAction, c as AIActionRequest, d as AICompleteRequest, e as AIConfig, f as AIContextLocation, g as AIDraftCitation, h as AIDraftEvent, a as AIDraftFn, i as AIProvider, A as AIStreamFn, k as Auth, l as CONTEXT_CHAR_CAP, m as CslDate, n as CslItemData, o as CslName, H as HttpKeyStorageUrls, K as KeyStorage, L as LOCAL_STORAGE_KEY, O as OpenAICompatibleConfig, S as StreamEvent, q as buildAIPrompt, r as httpKeyStorage, s as localStorageKeyStorage, t as memoryKeyStorage, u as openaiCompatibleProvider, v as toAIStreamFn, w as trimContextAfter, x as trimContextBefore } from '../index-Bl0M4odR.cjs';
|
package/dist/ai/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { b as AIAction, c as AIActionRequest, d as AICompleteRequest, e as AIConfig, f as
|
|
1
|
+
export { b as AIAction, c as AIActionRequest, d as AICompleteRequest, e as AIConfig, f as AIContextLocation, g as AIDraftCitation, h as AIDraftEvent, a as AIDraftFn, i as AIProvider, A as AIStreamFn, k as Auth, l as CONTEXT_CHAR_CAP, m as CslDate, n as CslItemData, o as CslName, H as HttpKeyStorageUrls, K as KeyStorage, L as LOCAL_STORAGE_KEY, O as OpenAICompatibleConfig, S as StreamEvent, q as buildAIPrompt, r as httpKeyStorage, s as localStorageKeyStorage, t as memoryKeyStorage, u as openaiCompatibleProvider, v as toAIStreamFn, w as trimContextAfter, x as trimContextBefore } from '../index-Bl0M4odR.js';
|
|
@@ -45,6 +45,25 @@ type AIProviderFactory = (config: {
|
|
|
45
45
|
signal?: AbortSignal;
|
|
46
46
|
}) => AIProvider;
|
|
47
47
|
type AIAction = 'rewrite' | 'summarize' | 'grammar' | 'tone' | 'translate' | 'expand' | 'shorten' | 'generate' | 'chat' | 'draft';
|
|
48
|
+
/**
|
|
49
|
+
* Location context of the selection/cursor sent alongside the request so the
|
|
50
|
+
* LLM can reason about *where* in the document the user is pointing. All fields
|
|
51
|
+
* optional — hosts that don't fill them keep working unchanged (issue #219).
|
|
52
|
+
*/
|
|
53
|
+
interface AIContextLocation {
|
|
54
|
+
/** 1-based page number containing the selection head (DOM pagination). */
|
|
55
|
+
page?: number;
|
|
56
|
+
/** Total pages in the document (DOM pagination). */
|
|
57
|
+
pageCount?: number;
|
|
58
|
+
/** 1-based paragraph/block index within the document. */
|
|
59
|
+
paragraphIndex?: number;
|
|
60
|
+
/** 1-based line number of the selection head within its block. */
|
|
61
|
+
line?: number;
|
|
62
|
+
/** Node type of the block under the selection, e.g. 'paragraph' | 'heading' | 'bulletList' | 'tableRow'. */
|
|
63
|
+
blockType?: string;
|
|
64
|
+
/** Nearest preceding heading text (BAB/section context), e.g. 'BAB II …'. */
|
|
65
|
+
section?: string;
|
|
66
|
+
}
|
|
48
67
|
interface AIActionRequest {
|
|
49
68
|
action: AIAction;
|
|
50
69
|
/** Selected text (7B). */
|
|
@@ -53,7 +72,7 @@ interface AIActionRequest {
|
|
|
53
72
|
context?: {
|
|
54
73
|
before: string;
|
|
55
74
|
after: string;
|
|
56
|
-
};
|
|
75
|
+
} & AIContextLocation;
|
|
57
76
|
/** User instruction (/ai prompt, chat message, tone target, target language). */
|
|
58
77
|
prompt?: string;
|
|
59
78
|
/** For doc-aware chat / RAG scoping. */
|
|
@@ -99,7 +118,7 @@ type AIDraftFn = (req: {
|
|
|
99
118
|
context?: {
|
|
100
119
|
before: string;
|
|
101
120
|
after: string;
|
|
102
|
-
};
|
|
121
|
+
} & AIContextLocation;
|
|
103
122
|
k?: number;
|
|
104
123
|
}, signal: AbortSignal) => AsyncIterable<AIDraftEvent>;
|
|
105
124
|
|
|
@@ -310,4 +329,4 @@ interface OpenAICompatibleConfig {
|
|
|
310
329
|
}
|
|
311
330
|
declare function openaiCompatibleProvider(config: OpenAICompatibleConfig): AIProvider;
|
|
312
331
|
|
|
313
|
-
export { type AIStreamFn as A, type CitationPort as C, type HttpKeyStorageUrls as H, type ImageUploadHandler as I, type KeyStorage as K, LOCAL_STORAGE_KEY as L, type OpenAICompatibleConfig as O, type StreamEvent as S, type AIDraftFn as a, type AIAction as b, type AIActionRequest as c, type AICompleteRequest as d, type AIConfig as e, type
|
|
332
|
+
export { type AIStreamFn as A, type CitationPort as C, type HttpKeyStorageUrls as H, type ImageUploadHandler as I, type KeyStorage as K, LOCAL_STORAGE_KEY as L, type OpenAICompatibleConfig as O, type StreamEvent as S, type AIDraftFn as a, type AIAction as b, type AIActionRequest as c, type AICompleteRequest as d, type AIConfig as e, type AIContextLocation as f, type AIDraftCitation as g, type AIDraftEvent as h, type AIProvider as i, type AIProviderFactory as j, type Auth as k, CONTEXT_CHAR_CAP as l, type CslDate as m, type CslItemData as n, type CslName as o, type ImageUploadResult as p, buildAIPrompt as q, httpKeyStorage as r, localStorageKeyStorage as s, memoryKeyStorage as t, openaiCompatibleProvider as u, toAIStreamFn as v, trimContextAfter as w, trimContextBefore as x };
|
|
@@ -45,6 +45,25 @@ type AIProviderFactory = (config: {
|
|
|
45
45
|
signal?: AbortSignal;
|
|
46
46
|
}) => AIProvider;
|
|
47
47
|
type AIAction = 'rewrite' | 'summarize' | 'grammar' | 'tone' | 'translate' | 'expand' | 'shorten' | 'generate' | 'chat' | 'draft';
|
|
48
|
+
/**
|
|
49
|
+
* Location context of the selection/cursor sent alongside the request so the
|
|
50
|
+
* LLM can reason about *where* in the document the user is pointing. All fields
|
|
51
|
+
* optional — hosts that don't fill them keep working unchanged (issue #219).
|
|
52
|
+
*/
|
|
53
|
+
interface AIContextLocation {
|
|
54
|
+
/** 1-based page number containing the selection head (DOM pagination). */
|
|
55
|
+
page?: number;
|
|
56
|
+
/** Total pages in the document (DOM pagination). */
|
|
57
|
+
pageCount?: number;
|
|
58
|
+
/** 1-based paragraph/block index within the document. */
|
|
59
|
+
paragraphIndex?: number;
|
|
60
|
+
/** 1-based line number of the selection head within its block. */
|
|
61
|
+
line?: number;
|
|
62
|
+
/** Node type of the block under the selection, e.g. 'paragraph' | 'heading' | 'bulletList' | 'tableRow'. */
|
|
63
|
+
blockType?: string;
|
|
64
|
+
/** Nearest preceding heading text (BAB/section context), e.g. 'BAB II …'. */
|
|
65
|
+
section?: string;
|
|
66
|
+
}
|
|
48
67
|
interface AIActionRequest {
|
|
49
68
|
action: AIAction;
|
|
50
69
|
/** Selected text (7B). */
|
|
@@ -53,7 +72,7 @@ interface AIActionRequest {
|
|
|
53
72
|
context?: {
|
|
54
73
|
before: string;
|
|
55
74
|
after: string;
|
|
56
|
-
};
|
|
75
|
+
} & AIContextLocation;
|
|
57
76
|
/** User instruction (/ai prompt, chat message, tone target, target language). */
|
|
58
77
|
prompt?: string;
|
|
59
78
|
/** For doc-aware chat / RAG scoping. */
|
|
@@ -99,7 +118,7 @@ type AIDraftFn = (req: {
|
|
|
99
118
|
context?: {
|
|
100
119
|
before: string;
|
|
101
120
|
after: string;
|
|
102
|
-
};
|
|
121
|
+
} & AIContextLocation;
|
|
103
122
|
k?: number;
|
|
104
123
|
}, signal: AbortSignal) => AsyncIterable<AIDraftEvent>;
|
|
105
124
|
|
|
@@ -310,4 +329,4 @@ interface OpenAICompatibleConfig {
|
|
|
310
329
|
}
|
|
311
330
|
declare function openaiCompatibleProvider(config: OpenAICompatibleConfig): AIProvider;
|
|
312
331
|
|
|
313
|
-
export { type AIStreamFn as A, type CitationPort as C, type HttpKeyStorageUrls as H, type ImageUploadHandler as I, type KeyStorage as K, LOCAL_STORAGE_KEY as L, type OpenAICompatibleConfig as O, type StreamEvent as S, type AIDraftFn as a, type AIAction as b, type AIActionRequest as c, type AICompleteRequest as d, type AIConfig as e, type
|
|
332
|
+
export { type AIStreamFn as A, type CitationPort as C, type HttpKeyStorageUrls as H, type ImageUploadHandler as I, type KeyStorage as K, LOCAL_STORAGE_KEY as L, type OpenAICompatibleConfig as O, type StreamEvent as S, type AIDraftFn as a, type AIAction as b, type AIActionRequest as c, type AICompleteRequest as d, type AIConfig as e, type AIContextLocation as f, type AIDraftCitation as g, type AIDraftEvent as h, type AIProvider as i, type AIProviderFactory as j, type Auth as k, CONTEXT_CHAR_CAP as l, type CslDate as m, type CslItemData as n, type CslName as o, type ImageUploadResult as p, buildAIPrompt as q, httpKeyStorage as r, localStorageKeyStorage as s, memoryKeyStorage as t, openaiCompatibleProvider as u, toAIStreamFn as v, trimContextAfter as w, trimContextBefore as x };
|
package/dist/index.d.cts
CHANGED
|
@@ -4,8 +4,8 @@ import { IndexeddbPersistence } from 'y-indexeddb';
|
|
|
4
4
|
import { WebrtcProvider } from 'y-webrtc';
|
|
5
5
|
import { WebsocketProvider } from 'y-websocket';
|
|
6
6
|
import * as Y from 'yjs';
|
|
7
|
-
import { I as ImageUploadHandler, C as CitationPort, A as AIStreamFn, a as AIDraftFn } from './index-
|
|
8
|
-
export { b as AIAction, c as AIActionRequest, d as AICompleteRequest, e as AIConfig, f as
|
|
7
|
+
import { I as ImageUploadHandler, C as CitationPort, A as AIStreamFn, a as AIDraftFn } from './index-Bl0M4odR.cjs';
|
|
8
|
+
export { b as AIAction, c as AIActionRequest, d as AICompleteRequest, e as AIConfig, f as AIContextLocation, g as AIDraftCitation, h as AIDraftEvent, i as AIProvider, j as AIProviderFactory, k as Auth, l as CONTEXT_CHAR_CAP, m as CslDate, n as CslItemData, o as CslName, H as HttpKeyStorageUrls, p as ImageUploadResult, K as KeyStorage, L as LOCAL_STORAGE_KEY, O as OpenAICompatibleConfig, S as StreamEvent, q as buildAIPrompt, r as httpKeyStorage, s as localStorageKeyStorage, t as memoryKeyStorage, u as openaiCompatibleProvider, v as toAIStreamFn, w as trimContextAfter, x as trimContextBefore } from './index-Bl0M4odR.cjs';
|
|
9
9
|
import { PaginationPlusOptions } from 'tiptap-pagination-plus';
|
|
10
10
|
export { PAGE_SIZES, PageSize, PaginationPlus, PaginationPlusOptions } from 'tiptap-pagination-plus';
|
|
11
11
|
import { PluginKey } from '@tiptap/pm/state';
|
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { IndexeddbPersistence } from 'y-indexeddb';
|
|
|
4
4
|
import { WebrtcProvider } from 'y-webrtc';
|
|
5
5
|
import { WebsocketProvider } from 'y-websocket';
|
|
6
6
|
import * as Y from 'yjs';
|
|
7
|
-
import { I as ImageUploadHandler, C as CitationPort, A as AIStreamFn, a as AIDraftFn } from './index-
|
|
8
|
-
export { b as AIAction, c as AIActionRequest, d as AICompleteRequest, e as AIConfig, f as
|
|
7
|
+
import { I as ImageUploadHandler, C as CitationPort, A as AIStreamFn, a as AIDraftFn } from './index-Bl0M4odR.js';
|
|
8
|
+
export { b as AIAction, c as AIActionRequest, d as AICompleteRequest, e as AIConfig, f as AIContextLocation, g as AIDraftCitation, h as AIDraftEvent, i as AIProvider, j as AIProviderFactory, k as Auth, l as CONTEXT_CHAR_CAP, m as CslDate, n as CslItemData, o as CslName, H as HttpKeyStorageUrls, p as ImageUploadResult, K as KeyStorage, L as LOCAL_STORAGE_KEY, O as OpenAICompatibleConfig, S as StreamEvent, q as buildAIPrompt, r as httpKeyStorage, s as localStorageKeyStorage, t as memoryKeyStorage, u as openaiCompatibleProvider, v as toAIStreamFn, w as trimContextAfter, x as trimContextBefore } from './index-Bl0M4odR.js';
|
|
9
9
|
import { PaginationPlusOptions } from 'tiptap-pagination-plus';
|
|
10
10
|
export { PAGE_SIZES, PageSize, PaginationPlus, PaginationPlusOptions } from 'tiptap-pagination-plus';
|
|
11
11
|
import { PluginKey } from '@tiptap/pm/state';
|