@eigenpal/docx-editor-agents 1.0.0 → 1.0.2

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
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(s,r){return s.map((e,l)=>{let n="";const o=[];for(const t of e.parts??[])if(t.type==="text")n+=t.text??"";else if(t.type.startsWith("tool-")){const u=t.state==="output-available"?"done":t.state==="output-error"?"error":"running";o.push({id:t.toolCallId??`${e.id}-tc-${o.length}`,name:t.type.slice(5),input:t.input,result:typeof t.output=="string"?t.output:void 0,error:t.errorText,status:u})}const a=l===s.length-1,i=e.role==="assistant"&&a&&(r==="streaming"||r==="submitted");return{id:e.id,role:e.role==="user"?"user":"assistant",text:n,toolCalls:o.length>0?o:void 0,status:i?"streaming":"done"}})}exports.toAgentMessages=p;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e,t){return e.map((n,r)=>{let i=``,a=[];for(let e of n.parts??[])if(e.type===`text`)i+=e.text??``;else if(e.type.startsWith(`tool-`)){let t=e.state===`output-available`?`done`:e.state===`output-error`?`error`:`running`;a.push({id:e.toolCallId??`${n.id}-tc-${a.length}`,name:e.type.slice(5),input:e.input,result:typeof e.output==`string`?e.output:void 0,error:e.errorText,status:t})}let o=r===e.length-1,s=n.role===`assistant`&&o&&(t===`streaming`||t===`submitted`);return{id:n.id,role:n.role===`user`?`user`:`assistant`,text:i,toolCalls:a.length>0?a:void 0,status:s?`streaming`:`done`}})}exports.toAgentMessages=e;
@@ -1,31 +1,28 @@
1
- function p(s, r) {
2
- return s.map((e, l) => {
3
- let n = "";
4
- const o = [];
5
- for (const t of e.parts ?? [])
6
- if (t.type === "text")
7
- n += t.text ?? "";
8
- else if (t.type.startsWith("tool-")) {
9
- const u = t.state === "output-available" ? "done" : t.state === "output-error" ? "error" : "running";
10
- o.push({
11
- id: t.toolCallId ?? `${e.id}-tc-${o.length}`,
12
- name: t.type.slice(5),
13
- input: t.input,
14
- result: typeof t.output == "string" ? t.output : void 0,
15
- error: t.errorText,
16
- status: u
17
- });
18
- }
19
- const a = l === s.length - 1, i = e.role === "assistant" && a && (r === "streaming" || r === "submitted");
20
- return {
21
- id: e.id,
22
- role: e.role === "user" ? "user" : "assistant",
23
- text: n,
24
- toolCalls: o.length > 0 ? o : void 0,
25
- status: i ? "streaming" : "done"
26
- };
27
- });
1
+ //#region src/ai-sdk/shared.ts
2
+ function e(e, t) {
3
+ return e.map((n, r) => {
4
+ let i = "", a = [];
5
+ for (let e of n.parts ?? []) if (e.type === "text") i += e.text ?? "";
6
+ else if (e.type.startsWith("tool-")) {
7
+ let t = e.state === "output-available" ? "done" : e.state === "output-error" ? "error" : "running";
8
+ a.push({
9
+ id: e.toolCallId ?? `${n.id}-tc-${a.length}`,
10
+ name: e.type.slice(5),
11
+ input: e.input,
12
+ result: typeof e.output == "string" ? e.output : void 0,
13
+ error: e.errorText,
14
+ status: t
15
+ });
16
+ }
17
+ let o = r === e.length - 1, s = n.role === "assistant" && o && (t === "streaming" || t === "submitted");
18
+ return {
19
+ id: n.id,
20
+ role: n.role === "user" ? "user" : "assistant",
21
+ text: i,
22
+ toolCalls: a.length > 0 ? a : void 0,
23
+ status: s ? "streaming" : "done"
24
+ };
25
+ });
28
26
  }
29
- export {
30
- p as toAgentMessages
31
- };
27
+ //#endregion
28
+ export { e as toAgentMessages };
package/dist/bridge.js CHANGED
@@ -1 +1 @@
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}});
1
+ 'use strict';var chunkW6AWGFM4_js=require('./chunk-W6AWGFM4.js'),chunk6Z6UJ4RC_js=require('./chunk-6Z6UJ4RC.js'),chunkRI5S75JY_js=require('./chunk-RI5S75JY.js');Object.defineProperty(exports,"createEditorBridge",{enumerable:true,get:function(){return chunkW6AWGFM4_js.a}});Object.defineProperty(exports,"createReviewerBridge",{enumerable:true,get:function(){return chunk6Z6UJ4RC_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{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';
1
+ export{a as createEditorBridge}from'./chunk-J2BSSNNF.mjs';export{m as createReviewerBridge}from'./chunk-EKCQF23W.mjs';export{a as agentTools,b as executeToolCall,d as getToolSchemas}from'./chunk-24MVJKCP.mjs';