@eigenpal/docx-editor-agents 0.5.0 → 1.0.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/LICENSE +204 -672
- package/README.md +74 -42
- package/dist/agent-types-C8RvQB7n.d.mts +36 -0
- package/dist/agent-types-C8RvQB7n.d.ts +36 -0
- package/dist/ai-sdk/react.d.mts +29 -39
- package/dist/ai-sdk/react.d.ts +29 -39
- package/dist/ai-sdk/react.js +1 -1
- package/dist/ai-sdk/react.mjs +1 -1
- package/dist/ai-sdk/server.d.mts +42 -4
- package/dist/ai-sdk/server.d.ts +42 -4
- package/dist/ai-sdk/vue.d.ts +32 -0
- package/dist/ai-sdk/vue.js +1 -0
- package/dist/ai-sdk/vue.mjs +31 -0
- package/dist/bridge.d.mts +18 -1
- package/dist/bridge.d.ts +18 -1
- package/dist/bridge.js +1 -1
- package/dist/bridge.mjs +1 -1
- package/dist/chunk-3EQVOH4S.js +2 -0
- package/dist/chunk-7JG2PH72.js +71 -0
- package/dist/chunk-D3TF6WTP.mjs +71 -0
- package/dist/chunk-HWYEQX5Y.mjs +1 -0
- package/dist/chunk-NISW2GF6.js +1 -0
- package/dist/chunk-Q5KDGSCS.js +1 -0
- package/dist/{chunk-LVRKZUG4.js → chunk-RYHTROV6.js} +3 -3
- package/dist/{chunk-CPJV53R6.mjs → chunk-ULRDFDHR.mjs} +1 -1
- package/dist/chunk-X4YGLGUM.mjs +1 -0
- package/dist/chunk-XWXSTZIE.mjs +2 -0
- package/dist/docx-editor-agents.css +1 -0
- package/dist/executor-QBMOTUCJ.js +1 -0
- package/dist/executor-RSQI3VOF.mjs +1 -0
- package/dist/{headless-JRF2KBID.mjs → headless-Q72PHJUD.mjs} +1 -1
- package/dist/headless-U2SAKM5E.js +1 -0
- package/dist/index.d.mts +32 -2
- package/dist/index.d.ts +32 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/mcp.d.mts +20 -1
- package/dist/mcp.d.ts +20 -1
- package/dist/react.d.mts +175 -3
- package/dist/react.d.ts +175 -3
- package/dist/react.js +9 -1
- package/dist/react.mjs +9 -1
- package/dist/{server-DH5eszkm.d.mts → server-B7RHNVSu.d.mts} +970 -753
- package/dist/{server-DH5eszkm.d.ts → server-B7RHNVSu.d.ts} +970 -753
- package/dist/server.d.mts +34 -1
- package/dist/server.d.ts +34 -1
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/dist/vue/components/AIContextMenu.d.ts +33 -0
- package/dist/vue/components/AIResponsePreview.d.ts +40 -0
- package/dist/vue/components/AgentChatLog.d.ts +37 -0
- package/dist/vue/components/AgentComposer.d.ts +30 -0
- package/dist/vue/components/AgentPanel.d.ts +49 -0
- package/dist/vue/components/AgentSuggestionChip.d.ts +10 -0
- package/dist/vue/components/AgentTimeline.d.ts +19 -0
- package/dist/vue/composables/useAgentBridge.d.ts +19 -0
- package/dist/vue/types.d.ts +5 -0
- package/dist/vue.d.ts +72 -0
- package/dist/vue.js +21 -0
- package/dist/vue.mjs +1857 -0
- package/package.json +52 -9
- package/dist/chunk-6NWAUIGY.js +0 -1
- package/dist/chunk-A6ANAWKH.js +0 -1
- package/dist/chunk-BDHS4WRJ.mjs +0 -1
- package/dist/chunk-G46D3GDJ.js +0 -71
- package/dist/chunk-N2TKFYHU.js +0 -2
- package/dist/chunk-QALBLABE.mjs +0 -2
- package/dist/chunk-U7BWZ7DG.mjs +0 -1
- package/dist/chunk-XZHZXQO5.mjs +0 -71
- package/dist/executor-OYRPTNBR.mjs +0 -1
- package/dist/executor-SJAFSXKL.js +0 -1
- package/dist/headless-FE3K7ABO.js +0 -1
package/dist/bridge.d.ts
CHANGED
|
@@ -1 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @eigenpal/docx-editor-agents/bridge
|
|
3
|
+
*
|
|
4
|
+
* Editor bridge that connects agent tools to a live `DocxEditor` instance.
|
|
5
|
+
* Framework-agnostic. The React adapter lives in
|
|
6
|
+
* `@eigenpal/docx-editor-agents/react`.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { createEditorBridge } from '@eigenpal/docx-editor-agents/bridge';
|
|
11
|
+
* const bridge = createEditorBridge(editorRef, 'Assistant');
|
|
12
|
+
* bridge.addComment({ paragraphIndex: 3, text: 'Fix this.' });
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export { j as AgentToolDefinition, k as AgentToolResult, h as ContentChangeEvent, E as EditorBridge, r as EditorRefLike, i as SelectionChangeEvent, n as agentTools, u as createEditorBridge, o as createReviewerBridge, p as executeToolCall, q as getToolSchemas } from './server-B7RHNVSu.js';
|
package/dist/bridge.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk3EQVOH4S_js=require('./chunk-3EQVOH4S.js'),chunkRYHTROV6_js=require('./chunk-RYHTROV6.js'),chunkRI5S75JY_js=require('./chunk-RI5S75JY.js');Object.defineProperty(exports,"createEditorBridge",{enumerable:true,get:function(){return chunk3EQVOH4S_js.a}});Object.defineProperty(exports,"createReviewerBridge",{enumerable:true,get:function(){return chunkRYHTROV6_js.m}});Object.defineProperty(exports,"agentTools",{enumerable:true,get:function(){return chunkRI5S75JY_js.a}});Object.defineProperty(exports,"executeToolCall",{enumerable:true,get:function(){return chunkRI5S75JY_js.b}});Object.defineProperty(exports,"getToolSchemas",{enumerable:true,get:function(){return chunkRI5S75JY_js.d}});
|
package/dist/bridge.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{a as createEditorBridge}from'./chunk-XWXSTZIE.mjs';export{m as createReviewerBridge}from'./chunk-ULRDFDHR.mjs';export{a as agentTools,b as executeToolCall,d as getToolSchemas}from'./chunk-24MVJKCP.mjs';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkRYHTROV6_js=require('./chunk-RYHTROV6.js');function y(n){return !n||n.length===0?"":n.map(i=>{let s=i;return s?.content?s.content.map(e=>e.content?.map(t=>t.text||"").join("")||"").join(""):""}).join(`
|
|
2
|
+
`)}function u(n){let i=n.getEditorRef();if(i){let e=i.getDocument();if(e?.package?.document)return e.package.document}return n.getDocument()?.package?.document??null}function T(n,i="AI"){function s(e){return e??i}return {getContentAsText(e){let t=u(n);return t?chunkRYHTROV6_js.e(chunkRYHTROV6_js.d(t,e)):""},getContent(e){let t=u(n);return t?chunkRYHTROV6_js.d(t,e):[]},getComments(e){let t=u(n);if(!t)return [];let r=chunkRYHTROV6_js.l(t,e);if(r.length>0)return r;let l=n.getComments();if(l.length===0)return [];let a=new Map,g=[];for(let o of l)if(o.parentId){let c=a.get(o.parentId);c?c.push(o):a.set(o.parentId,[o]);}else g.push(o);let m=[];for(let o of g){if(e?.author&&o.author!==e.author||e?.done!==void 0&&(o.done??false)!==e.done)continue;let c=a.get(o.id)??[];m.push({id:o.id,author:o.author,date:o.date??null,text:y(o.content),anchoredText:"",paragraphIndex:-1,replies:c.map(p=>({id:p.id,author:p.author,date:p.date??null,text:y(p.content)})),done:o.done??false});}return m},getChanges(e){let t=u(n);return t?chunkRYHTROV6_js.k(t,e):[]},findText(e,t){return n.findInDocument(e,t)},getSelection(){return n.getSelectionInfo()},addComment(e){return n.addComment({paraId:e.paraId,text:e.text,author:s(e.author),search:e.search})},replyTo(e,t){return n.replyToComment(e,t.text,s(t.author))},resolveComment(e){n.resolveComment(e);},proposeChange(e){return n.proposeChange({paraId:e.paraId,search:e.search,replaceWith:e.replaceWith,author:s(e.author)})},applyFormatting(e){return n.applyFormatting({paraId:e.paraId,search:e.search,marks:e.marks})},setParagraphStyle(e){return n.setParagraphStyle({paraId:e.paraId,styleId:e.styleId})},getPage(e){return n.getPageContent(e)},getPages(e){let t=n.getTotalPages(),r=Math.max(1,Math.min(e.from,t)),l=Math.max(r,Math.min(e.to,t)),a=[];for(let g=r;g<=l;g++){let m=n.getPageContent(g);m&&a.push(m);}return a},getTotalPages(){return n.getTotalPages()},getCurrentPage(){return n.getCurrentPage()},scrollTo(e){return n.scrollToParaId(e)},onContentChange(e){return n.onContentChange(()=>{let t=u(n),r=t?chunkRYHTROV6_js.l(t):[],l=t?chunkRYHTROV6_js.k(t):[];try{e({commentCount:r.length,changeCount:l.length,comments:r,changes:l});}catch(a){console.error("onContentChange listener threw:",a);}})},onSelectionChange(e){return n.onSelectionChange(()=>{try{e(n.getSelectionInfo());}catch(t){console.error("onSelectionChange listener threw:",t);}})}}}exports.a=T;
|