@kedataindo/docflow-core 0.0.87 → 0.0.89

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.
@@ -1 +1 @@
1
- export { b as AIAction, c as AIActionRequest, d as AICompleteRequest, e as AIConfig, f as AIDraftCitation, g as AIDraftEvent, a as AIDraftFn, h as AIProvider, A as AIStreamFn, j as Auth, k as CONTEXT_CHAR_CAP, l as ClaudeConfig, 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 claudeProvider, s as httpKeyStorage, t as localStorageKeyStorage, u as memoryKeyStorage, v as openaiCompatibleProvider, w as toAIStreamFn, x as trimContextAfter, y as trimContextBefore } from '../index-3B5ckTRa.cjs';
1
+ export { b as AIAction, c as AIActionRequest, d as AICompleteRequest, e as AIConfig, f as AIDraftCitation, g as AIDraftEvent, a as AIDraftFn, h as AIProvider, A as AIStreamFn, j as Auth, k as CONTEXT_CHAR_CAP, l as ClaudeConfig, 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 claudeProvider, s as httpKeyStorage, t as localStorageKeyStorage, u as memoryKeyStorage, v as openaiCompatibleProvider, w as toAIStreamFn, x as trimContextAfter, y as trimContextBefore } from '../index-DtcV-JK5.cjs';
@@ -1 +1 @@
1
- export { b as AIAction, c as AIActionRequest, d as AICompleteRequest, e as AIConfig, f as AIDraftCitation, g as AIDraftEvent, a as AIDraftFn, h as AIProvider, A as AIStreamFn, j as Auth, k as CONTEXT_CHAR_CAP, l as ClaudeConfig, 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 claudeProvider, s as httpKeyStorage, t as localStorageKeyStorage, u as memoryKeyStorage, v as openaiCompatibleProvider, w as toAIStreamFn, x as trimContextAfter, y as trimContextBefore } from '../index-3B5ckTRa.js';
1
+ export { b as AIAction, c as AIActionRequest, d as AICompleteRequest, e as AIConfig, f as AIDraftCitation, g as AIDraftEvent, a as AIDraftFn, h as AIProvider, A as AIStreamFn, j as Auth, k as CONTEXT_CHAR_CAP, l as ClaudeConfig, 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 claudeProvider, s as httpKeyStorage, t as localStorageKeyStorage, u as memoryKeyStorage, v as openaiCompatibleProvider, w as toAIStreamFn, x as trimContextAfter, y as trimContextBefore } from '../index-DtcV-JK5.js';
@@ -230,9 +230,17 @@ declare function buildAIPrompt(req: AIActionRequest): {
230
230
  *
231
231
  * The URL and the key are a pair and travel together. The library ships three
232
232
  * reference implementations; hosts may write their own (e.g. keyed per-tenant
233
- * in their own backend). No URL is hardcoded anywhere — `httpKeyStorage`
234
- * receives its endpoints from the host, keeping the library backend-agnostic
235
- * (docs/LIBRARY_CONTRACT.md rule 3).
233
+ * in their own backend). No *endpoint* is hardcoded on the storage path —
234
+ * `httpKeyStorage` receives its endpoints from the host, keeping the library
235
+ * backend-agnostic (docs/LIBRARY_CONTRACT.md rule 3). The only hardcoded host
236
+ * is the overridable `DEFAULT_BASE_URL` default in `claudeProvider.ts`
237
+ * (contract rule 4 exception; see §5 of docs/LIBRARY_CONTRACT.md).
238
+ *
239
+ * ⚠️ Secrets note: `localStorageKeyStorage` keeps an API key in
240
+ * `localStorage` in plaintext — any script running on the same origin can read
241
+ * it. Prefer a non-persistent storage (or `httpKeyStorage`, which keeps the key
242
+ * on the host backend) when the embedding app is not fully trusted
243
+ * (issue #179).
236
244
  */
237
245
  type Auth = {
238
246
  type: 'bearer';
@@ -230,9 +230,17 @@ declare function buildAIPrompt(req: AIActionRequest): {
230
230
  *
231
231
  * The URL and the key are a pair and travel together. The library ships three
232
232
  * reference implementations; hosts may write their own (e.g. keyed per-tenant
233
- * in their own backend). No URL is hardcoded anywhere — `httpKeyStorage`
234
- * receives its endpoints from the host, keeping the library backend-agnostic
235
- * (docs/LIBRARY_CONTRACT.md rule 3).
233
+ * in their own backend). No *endpoint* is hardcoded on the storage path —
234
+ * `httpKeyStorage` receives its endpoints from the host, keeping the library
235
+ * backend-agnostic (docs/LIBRARY_CONTRACT.md rule 3). The only hardcoded host
236
+ * is the overridable `DEFAULT_BASE_URL` default in `claudeProvider.ts`
237
+ * (contract rule 4 exception; see §5 of docs/LIBRARY_CONTRACT.md).
238
+ *
239
+ * ⚠️ Secrets note: `localStorageKeyStorage` keeps an API key in
240
+ * `localStorage` in plaintext — any script running on the same origin can read
241
+ * it. Prefer a non-persistent storage (or `httpKeyStorage`, which keeps the key
242
+ * on the host backend) when the embedding app is not fully trusted
243
+ * (issue #179).
236
244
  */
237
245
  type Auth = {
238
246
  type: 'bearer';
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-3B5ckTRa.cjs';
8
- export { b as AIAction, c as AIActionRequest, d as AICompleteRequest, e as AIConfig, f as AIDraftCitation, g as AIDraftEvent, h as AIProvider, i as AIProviderFactory, j as Auth, k as CONTEXT_CHAR_CAP, l as ClaudeConfig, 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 claudeProvider, s as httpKeyStorage, t as localStorageKeyStorage, u as memoryKeyStorage, v as openaiCompatibleProvider, w as toAIStreamFn, x as trimContextAfter, y as trimContextBefore } from './index-3B5ckTRa.cjs';
7
+ import { I as ImageUploadHandler, C as CitationPort, A as AIStreamFn, a as AIDraftFn } from './index-DtcV-JK5.cjs';
8
+ export { b as AIAction, c as AIActionRequest, d as AICompleteRequest, e as AIConfig, f as AIDraftCitation, g as AIDraftEvent, h as AIProvider, i as AIProviderFactory, j as Auth, k as CONTEXT_CHAR_CAP, l as ClaudeConfig, 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 claudeProvider, s as httpKeyStorage, t as localStorageKeyStorage, u as memoryKeyStorage, v as openaiCompatibleProvider, w as toAIStreamFn, x as trimContextAfter, y as trimContextBefore } from './index-DtcV-JK5.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-3B5ckTRa.js';
8
- export { b as AIAction, c as AIActionRequest, d as AICompleteRequest, e as AIConfig, f as AIDraftCitation, g as AIDraftEvent, h as AIProvider, i as AIProviderFactory, j as Auth, k as CONTEXT_CHAR_CAP, l as ClaudeConfig, 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 claudeProvider, s as httpKeyStorage, t as localStorageKeyStorage, u as memoryKeyStorage, v as openaiCompatibleProvider, w as toAIStreamFn, x as trimContextAfter, y as trimContextBefore } from './index-3B5ckTRa.js';
7
+ import { I as ImageUploadHandler, C as CitationPort, A as AIStreamFn, a as AIDraftFn } from './index-DtcV-JK5.js';
8
+ export { b as AIAction, c as AIActionRequest, d as AICompleteRequest, e as AIConfig, f as AIDraftCitation, g as AIDraftEvent, h as AIProvider, i as AIProviderFactory, j as Auth, k as CONTEXT_CHAR_CAP, l as ClaudeConfig, 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 claudeProvider, s as httpKeyStorage, t as localStorageKeyStorage, u as memoryKeyStorage, v as openaiCompatibleProvider, w as toAIStreamFn, x as trimContextAfter, y as trimContextBefore } from './index-DtcV-JK5.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';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kedataindo/docflow-core",
3
3
  "license": "Apache-2.0",
4
- "version": "0.0.87",
4
+ "version": "0.0.89",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -25,6 +25,7 @@
25
25
  "files": [
26
26
  "dist"
27
27
  ],
28
+ "sideEffects": false,
28
29
  "dependencies": {
29
30
  "@tiptap/core": "^2.11.0",
30
31
  "@tiptap/extension-collaboration": "^2.27.2",
@@ -70,6 +71,9 @@
70
71
  "typescript": "^5.6.3",
71
72
  "vitest": "^2.1.3"
72
73
  },
74
+ "engines": {
75
+ "node": ">=20"
76
+ },
73
77
  "scripts": {
74
78
  "build": "tsup",
75
79
  "typecheck": "tsc --noEmit",