@morphllm/subagents 0.1.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.
@@ -0,0 +1,549 @@
1
+ // src/core/base-client.ts
2
+ var BaseClient = class {
3
+ constructor(options = {}) {
4
+ this.apiUrl = options.apiUrl || this.getDefaultApiUrl();
5
+ this.timeout = options.timeout || 6e4;
6
+ }
7
+ /** Make a GET request */
8
+ async get(path) {
9
+ const response = await fetch(`${this.apiUrl}${path}`, {
10
+ method: "GET",
11
+ signal: AbortSignal.timeout(this.timeout)
12
+ });
13
+ if (!response.ok) {
14
+ throw new Error(`GET ${path} failed: ${response.statusText}`);
15
+ }
16
+ return response.json();
17
+ }
18
+ /** Make a POST request with JSON body */
19
+ async post(path, body) {
20
+ const response = await fetch(`${this.apiUrl}${path}`, {
21
+ method: "POST",
22
+ headers: body ? { "Content-Type": "application/json" } : void 0,
23
+ body: body ? JSON.stringify(body) : void 0,
24
+ signal: AbortSignal.timeout(this.timeout)
25
+ });
26
+ if (!response.ok) {
27
+ throw new Error(`POST ${path} failed: ${response.statusText}`);
28
+ }
29
+ return response.json();
30
+ }
31
+ /** Make a POST request with FormData */
32
+ async postFormData(path, formData) {
33
+ const response = await fetch(`${this.apiUrl}${path}`, {
34
+ method: "POST",
35
+ body: formData,
36
+ signal: AbortSignal.timeout(this.timeout)
37
+ });
38
+ if (!response.ok) {
39
+ throw new Error(`POST ${path} failed: ${response.statusText}`);
40
+ }
41
+ return response.json();
42
+ }
43
+ /** Make a DELETE request */
44
+ async delete(path) {
45
+ const response = await fetch(`${this.apiUrl}${path}`, {
46
+ method: "DELETE",
47
+ signal: AbortSignal.timeout(this.timeout)
48
+ });
49
+ if (!response.ok) {
50
+ throw new Error(`DELETE ${path} failed: ${response.statusText}`);
51
+ }
52
+ }
53
+ /** Download a file as Blob */
54
+ async downloadBlob(path) {
55
+ const response = await fetch(`${this.apiUrl}${path}`, {
56
+ signal: AbortSignal.timeout(this.timeout)
57
+ });
58
+ if (!response.ok) {
59
+ throw new Error(`Download ${path} failed: ${response.statusText}`);
60
+ }
61
+ return response.blob();
62
+ }
63
+ /** Health check */
64
+ async health() {
65
+ return this.get("/health");
66
+ }
67
+ };
68
+
69
+ // src/docx/client.ts
70
+ var DEFAULT_API_URL = "https://docx-api-service-production.up.railway.app";
71
+ var DocxClient = class extends BaseClient {
72
+ constructor(options = {}) {
73
+ super(options);
74
+ }
75
+ getDefaultApiUrl() {
76
+ return process.env.DOCX_API_URL || DEFAULT_API_URL;
77
+ }
78
+ /**
79
+ * Upload a DOCX document.
80
+ */
81
+ async upload(file, filename) {
82
+ const formData = new FormData();
83
+ formData.append("file", file, filename || "document.docx");
84
+ return this.postFormData("/documents/upload", formData);
85
+ }
86
+ /**
87
+ * Download a DOCX document.
88
+ */
89
+ async download(docId) {
90
+ return this.downloadBlob(`/documents/${docId}`);
91
+ }
92
+ /**
93
+ * Read document content as plain text.
94
+ */
95
+ async read(docId) {
96
+ return this.post(`/documents/${docId}/read`);
97
+ }
98
+ /**
99
+ * Execute edit operations on a document.
100
+ */
101
+ async edit(docId, operations) {
102
+ return this.post(`/documents/${docId}/edit`, { operations });
103
+ }
104
+ /**
105
+ * Validate document structure.
106
+ */
107
+ async validate(docId) {
108
+ return this.post(`/documents/${docId}/validate`);
109
+ }
110
+ /**
111
+ * Delete a document from storage.
112
+ */
113
+ async deleteDocument(docId) {
114
+ return this.delete(`/documents/${docId}`);
115
+ }
116
+ };
117
+
118
+ // src/core/base-agent.ts
119
+ var BaseAgent = class {
120
+ constructor(options) {
121
+ this.openai = options.openai;
122
+ this.model = options.model || this.getDefaultModel();
123
+ this.instructions = options.instructions || this.getDefaultInstructions();
124
+ this.client = options.client;
125
+ }
126
+ /** Get the underlying client */
127
+ getClient() {
128
+ return this.client;
129
+ }
130
+ /**
131
+ * Run the agent with a user message.
132
+ * Returns the final response and all tool calls made.
133
+ */
134
+ async run(userMessage, conversationHistory = []) {
135
+ if (!this.openai) {
136
+ throw new Error("OpenAI client is required for agent.run(). Pass it in the constructor options.");
137
+ }
138
+ const messages = [
139
+ { role: "system", content: this.instructions },
140
+ ...conversationHistory,
141
+ { role: "user", content: userMessage }
142
+ ];
143
+ const toolCalls = [];
144
+ let response = "";
145
+ const tools = this.getTools();
146
+ while (true) {
147
+ const completion = await this.openai.chat.completions.create({
148
+ model: this.model,
149
+ messages,
150
+ tools,
151
+ tool_choice: "auto"
152
+ });
153
+ const assistantMessage = completion.choices[0].message;
154
+ if (assistantMessage.tool_calls && assistantMessage.tool_calls.length > 0) {
155
+ messages.push({
156
+ role: "assistant",
157
+ content: assistantMessage.content || ""
158
+ });
159
+ for (const tc of assistantMessage.tool_calls) {
160
+ const fn = tc.function;
161
+ const args = JSON.parse(fn.arguments);
162
+ const toolCall = {
163
+ id: tc.id,
164
+ name: fn.name,
165
+ arguments: args,
166
+ status: "running"
167
+ };
168
+ toolCalls.push(toolCall);
169
+ const result = await this.executeTool(fn.name, args);
170
+ if (result.startsWith("Error:")) {
171
+ toolCall.error = result;
172
+ toolCall.status = "error";
173
+ } else {
174
+ toolCall.result = result;
175
+ toolCall.status = "completed";
176
+ }
177
+ messages.push({
178
+ role: "tool",
179
+ content: result,
180
+ tool_call_id: tc.id
181
+ });
182
+ }
183
+ } else {
184
+ response = assistantMessage.content || "";
185
+ break;
186
+ }
187
+ }
188
+ return { response, toolCalls };
189
+ }
190
+ /**
191
+ * Run the agent with streaming output.
192
+ * Yields events for real-time UI updates.
193
+ */
194
+ async *runStream(userMessage, conversationHistory = []) {
195
+ if (!this.openai) {
196
+ throw new Error("OpenAI client is required for agent.runStream(). Pass it in the constructor options.");
197
+ }
198
+ const messages = [
199
+ { role: "system", content: this.instructions },
200
+ ...conversationHistory,
201
+ { role: "user", content: userMessage }
202
+ ];
203
+ const tools = this.getTools();
204
+ while (true) {
205
+ yield { type: "message_start", message: { role: "assistant" } };
206
+ const stream = await this.openai.chat.completions.create({
207
+ model: this.model,
208
+ messages,
209
+ tools,
210
+ tool_choice: "auto",
211
+ stream: true
212
+ });
213
+ let contentBuffer = "";
214
+ const toolCallBuffers = /* @__PURE__ */ new Map();
215
+ for await (const chunk of stream) {
216
+ const delta = chunk.choices[0]?.delta;
217
+ if (delta?.content) {
218
+ contentBuffer += delta.content;
219
+ yield { type: "content_delta", delta: { text: delta.content } };
220
+ }
221
+ if (delta?.tool_calls) {
222
+ for (const tc of delta.tool_calls) {
223
+ const idx = tc.index;
224
+ if (!toolCallBuffers.has(idx)) {
225
+ toolCallBuffers.set(idx, { id: "", name: "", arguments: "" });
226
+ }
227
+ const buffer = toolCallBuffers.get(idx);
228
+ if (tc.id) buffer.id = tc.id;
229
+ if (tc.function?.name) buffer.name = tc.function.name;
230
+ if (tc.function?.arguments) buffer.arguments += tc.function.arguments;
231
+ }
232
+ }
233
+ }
234
+ if (toolCallBuffers.size > 0) {
235
+ messages.push({
236
+ role: "assistant",
237
+ content: contentBuffer
238
+ });
239
+ for (const [_, buffer] of toolCallBuffers) {
240
+ const args = JSON.parse(buffer.arguments);
241
+ yield {
242
+ type: "tool_start",
243
+ tool: { id: buffer.id, name: buffer.name, arguments: args }
244
+ };
245
+ const result = await this.executeTool(buffer.name, args);
246
+ if (result.startsWith("Error:")) {
247
+ yield { type: "tool_end", tool: { id: buffer.id, error: result } };
248
+ } else {
249
+ yield { type: "tool_end", tool: { id: buffer.id, result } };
250
+ }
251
+ messages.push({
252
+ role: "tool",
253
+ content: result,
254
+ tool_call_id: buffer.id
255
+ });
256
+ }
257
+ } else {
258
+ yield { type: "message_end" };
259
+ break;
260
+ }
261
+ }
262
+ }
263
+ };
264
+
265
+ // src/docx/agent.ts
266
+ var DEFAULT_INSTRUCTIONS = `You are an expert DOCX document editing assistant.
267
+
268
+ When editing documents:
269
+ 1. First read the document to understand its structure
270
+ 2. Use track changes for all modifications
271
+ 3. Add comments to flag issues or request clarification
272
+ 4. Be precise with paragraph text matching - use unique text snippets
273
+
274
+ Available tools:
275
+ - read_document: Read the document content
276
+ - add_comment: Add a comment to a specific paragraph
277
+ - insert_text: Insert text within a paragraph (tracked change)
278
+ - propose_deletion: Mark text for deletion (tracked change)
279
+ - reply_comment: Reply to an existing comment
280
+ - resolve_comment: Mark a comment as resolved
281
+ - delete_comment: Delete a comment
282
+ - insert_paragraph: Insert a new paragraph
283
+ - validate_document: Validate DOCX structure`;
284
+ var TOOLS = [
285
+ {
286
+ type: "function",
287
+ function: {
288
+ name: "read_document",
289
+ description: "Read the document content as plain text",
290
+ parameters: {
291
+ type: "object",
292
+ properties: {
293
+ doc_id: { type: "string", description: "Document ID" }
294
+ },
295
+ required: ["doc_id"]
296
+ }
297
+ }
298
+ },
299
+ {
300
+ type: "function",
301
+ function: {
302
+ name: "add_comment",
303
+ description: "Add a comment to a specific paragraph in the document",
304
+ parameters: {
305
+ type: "object",
306
+ properties: {
307
+ doc_id: { type: "string", description: "Document ID" },
308
+ para_text: { type: "string", description: "Unique text from the target paragraph" },
309
+ comment: { type: "string", description: "Comment text to add" },
310
+ highlight: { type: "string", description: "Optional specific text to highlight" }
311
+ },
312
+ required: ["doc_id", "para_text", "comment"]
313
+ }
314
+ }
315
+ },
316
+ {
317
+ type: "function",
318
+ function: {
319
+ name: "insert_text",
320
+ description: "Insert text within a paragraph (creates a tracked change)",
321
+ parameters: {
322
+ type: "object",
323
+ properties: {
324
+ doc_id: { type: "string", description: "Document ID" },
325
+ para_text: { type: "string", description: "Unique text from the target paragraph" },
326
+ after: { type: "string", description: "Text after which to insert" },
327
+ new_text: { type: "string", description: "Text to insert" }
328
+ },
329
+ required: ["doc_id", "para_text", "after", "new_text"]
330
+ }
331
+ }
332
+ },
333
+ {
334
+ type: "function",
335
+ function: {
336
+ name: "propose_deletion",
337
+ description: "Mark text for deletion (creates a tracked change)",
338
+ parameters: {
339
+ type: "object",
340
+ properties: {
341
+ doc_id: { type: "string", description: "Document ID" },
342
+ para_text: { type: "string", description: "Unique text from the target paragraph" },
343
+ target: { type: "string", description: "Specific text to delete (optional, defaults to whole paragraph)" }
344
+ },
345
+ required: ["doc_id", "para_text"]
346
+ }
347
+ }
348
+ },
349
+ {
350
+ type: "function",
351
+ function: {
352
+ name: "reply_comment",
353
+ description: "Reply to an existing comment",
354
+ parameters: {
355
+ type: "object",
356
+ properties: {
357
+ doc_id: { type: "string", description: "Document ID" },
358
+ comment_id: { type: "string", description: "ID of the comment to reply to" },
359
+ reply: { type: "string", description: "Reply text" }
360
+ },
361
+ required: ["doc_id", "comment_id", "reply"]
362
+ }
363
+ }
364
+ },
365
+ {
366
+ type: "function",
367
+ function: {
368
+ name: "resolve_comment",
369
+ description: "Mark a comment as resolved",
370
+ parameters: {
371
+ type: "object",
372
+ properties: {
373
+ doc_id: { type: "string", description: "Document ID" },
374
+ comment_id: { type: "string", description: "ID of the comment to resolve" }
375
+ },
376
+ required: ["doc_id", "comment_id"]
377
+ }
378
+ }
379
+ },
380
+ {
381
+ type: "function",
382
+ function: {
383
+ name: "delete_comment",
384
+ description: "Delete a comment and its replies",
385
+ parameters: {
386
+ type: "object",
387
+ properties: {
388
+ doc_id: { type: "string", description: "Document ID" },
389
+ comment_id: { type: "string", description: "ID of the comment to delete" }
390
+ },
391
+ required: ["doc_id", "comment_id"]
392
+ }
393
+ }
394
+ },
395
+ {
396
+ type: "function",
397
+ function: {
398
+ name: "insert_paragraph",
399
+ description: "Insert a new paragraph after existing text",
400
+ parameters: {
401
+ type: "object",
402
+ properties: {
403
+ doc_id: { type: "string", description: "Document ID" },
404
+ after_text: { type: "string", description: "Text after which to insert the new paragraph" },
405
+ new_text: { type: "string", description: "Content of the new paragraph" }
406
+ },
407
+ required: ["doc_id", "after_text", "new_text"]
408
+ }
409
+ }
410
+ },
411
+ {
412
+ type: "function",
413
+ function: {
414
+ name: "validate_document",
415
+ description: "Validate the document structure",
416
+ parameters: {
417
+ type: "object",
418
+ properties: {
419
+ doc_id: { type: "string", description: "Document ID" }
420
+ },
421
+ required: ["doc_id"]
422
+ }
423
+ }
424
+ }
425
+ ];
426
+ var DocxAgent = class extends BaseAgent {
427
+ constructor(options = {}) {
428
+ const client = new DocxClient(options);
429
+ super({ ...options, client });
430
+ this.documentId = options.documentId;
431
+ }
432
+ getDefaultModel() {
433
+ return "moonshot-v1-32k";
434
+ }
435
+ getDefaultInstructions() {
436
+ return this.documentId ? `${DEFAULT_INSTRUCTIONS}
437
+
438
+ Current document ID: ${this.documentId}` : DEFAULT_INSTRUCTIONS;
439
+ }
440
+ getTools() {
441
+ return TOOLS;
442
+ }
443
+ /** Set the current document ID */
444
+ setDocument(docId) {
445
+ this.documentId = docId;
446
+ }
447
+ /** Get current document ID */
448
+ getDocumentId() {
449
+ return this.documentId;
450
+ }
451
+ async executeTool(name, args) {
452
+ const docId = args.doc_id || this.documentId;
453
+ if (!docId) {
454
+ return "Error: No document ID provided. Please upload a document first.";
455
+ }
456
+ try {
457
+ switch (name) {
458
+ case "read_document": {
459
+ const result = await this.client.read(docId);
460
+ return `Document content (${result.paragraphs} paragraphs):
461
+
462
+ ${result.content}`;
463
+ }
464
+ case "add_comment": {
465
+ const result = await this.client.edit(docId, [
466
+ {
467
+ type: "add_comment",
468
+ para_text: args.para_text,
469
+ comment: args.comment,
470
+ highlight: args.highlight
471
+ }
472
+ ]);
473
+ return result.results[0];
474
+ }
475
+ case "insert_text": {
476
+ const result = await this.client.edit(docId, [
477
+ {
478
+ type: "insert_text",
479
+ para_text: args.para_text,
480
+ after: args.after,
481
+ new_text: args.new_text
482
+ }
483
+ ]);
484
+ return result.results[0];
485
+ }
486
+ case "propose_deletion": {
487
+ const result = await this.client.edit(docId, [
488
+ {
489
+ type: "propose_deletion",
490
+ para_text: args.para_text,
491
+ target: args.target
492
+ }
493
+ ]);
494
+ return result.results[0];
495
+ }
496
+ case "reply_comment": {
497
+ const result = await this.client.edit(docId, [
498
+ {
499
+ type: "reply_comment",
500
+ comment_id: args.comment_id,
501
+ reply: args.reply
502
+ }
503
+ ]);
504
+ return result.results[0];
505
+ }
506
+ case "resolve_comment": {
507
+ const result = await this.client.edit(docId, [
508
+ {
509
+ type: "resolve_comment",
510
+ comment_id: args.comment_id
511
+ }
512
+ ]);
513
+ return result.results[0];
514
+ }
515
+ case "delete_comment": {
516
+ const result = await this.client.edit(docId, [
517
+ {
518
+ type: "delete_comment",
519
+ comment_id: args.comment_id
520
+ }
521
+ ]);
522
+ return result.results[0];
523
+ }
524
+ case "insert_paragraph": {
525
+ const result = await this.client.edit(docId, [
526
+ {
527
+ type: "insert_paragraph",
528
+ after_text: args.after_text,
529
+ new_text: args.new_text
530
+ }
531
+ ]);
532
+ return result.results[0];
533
+ }
534
+ case "validate_document": {
535
+ const result = await this.client.validate(docId);
536
+ return `${result.result}: ${result.output}`;
537
+ }
538
+ default:
539
+ return `Error: Unknown tool '${name}'`;
540
+ }
541
+ } catch (error) {
542
+ return `Error: ${error instanceof Error ? error.message : String(error)}`;
543
+ }
544
+ }
545
+ };
546
+
547
+ export { DocxAgent, DocxClient };
548
+ //# sourceMappingURL=index.mjs.map
549
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/core/base-client.ts","../../src/docx/client.ts","../../src/core/base-agent.ts","../../src/docx/agent.ts"],"names":[],"mappings":";AAMO,IAAe,aAAf,MAA0B;AAAA,EAI/B,WAAA,CAAY,OAAA,GAA6B,EAAC,EAAG;AAC3C,IAAA,IAAA,CAAK,MAAA,GAAS,OAAA,CAAQ,MAAA,IAAU,IAAA,CAAK,gBAAA,EAAiB;AACtD,IAAA,IAAA,CAAK,OAAA,GAAU,QAAQ,OAAA,IAAW,GAAA;AAAA,EACpC;AAAA;AAAA,EAMA,MAAgB,IAAO,IAAA,EAA0B;AAC/C,IAAA,MAAM,QAAA,GAAW,MAAM,KAAA,CAAM,CAAA,EAAG,KAAK,MAAM,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI;AAAA,MACpD,MAAA,EAAQ,KAAA;AAAA,MACR,MAAA,EAAQ,WAAA,CAAY,OAAA,CAAQ,IAAA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G,MAAA,CAAO,MAAM,CAAA,EAAA,EAAK,OAAO,MAAM,CAAA,CAAA;AAAA,QAC3C;AAAA,QAEA;AACE,UAAA,OAAO,wBAAwB,IAAI,CAAA,CAAA,CAAA;AAAA;AACvC,IACF,SAAS,KAAA,EAAO;AACd,MAAA,OAAO,UAAU,KAAA,YAAiB,KAAA,GAAQ,MAAM,OAAA,GAAU,MAAA,CAAO,KAAK,CAAC,CAAA,CAAA;AAAA,IACzE;AAAA,EACF;AACF","file":"index.mjs","sourcesContent":["/**\n * BaseClient - Abstract HTTP client for subagent APIs\n */\n\nimport type { BaseClientOptions } from './types';\n\nexport abstract class BaseClient {\n protected apiUrl: string;\n protected timeout: number;\n\n constructor(options: BaseClientOptions = {}) {\n this.apiUrl = options.apiUrl || this.getDefaultApiUrl();\n this.timeout = options.timeout || 60000;\n }\n\n /** Override in subclasses to provide default API URL */\n protected abstract getDefaultApiUrl(): string;\n\n /** Make a GET request */\n protected async get<T>(path: string): Promise<T> {\n const response = await fetch(`${this.apiUrl}${path}`, {\n method: 'GET',\n signal: AbortSignal.timeout(this.timeout),\n });\n\n if (!response.ok) {\n throw new Error(`GET ${path} failed: ${response.statusText}`);\n }\n\n return response.json();\n }\n\n /** Make a POST request with JSON body */\n protected async post<T>(path: string, body?: unknown): Promise<T> {\n const response = await fetch(`${this.apiUrl}${path}`, {\n method: 'POST',\n headers: body ? { 'Content-Type': 'application/json' } : undefined,\n body: body ? JSON.stringify(body) : undefined,\n signal: AbortSignal.timeout(this.timeout),\n });\n\n if (!response.ok) {\n throw new Error(`POST ${path} failed: ${response.statusText}`);\n }\n\n return response.json();\n }\n\n /** Make a POST request with FormData */\n protected async postFormData<T>(path: string, formData: FormData): Promise<T> {\n const response = await fetch(`${this.apiUrl}${path}`, {\n method: 'POST',\n body: formData,\n signal: AbortSignal.timeout(this.timeout),\n });\n\n if (!response.ok) {\n throw new Error(`POST ${path} failed: ${response.statusText}`);\n }\n\n return response.json();\n }\n\n /** Make a DELETE request */\n protected async delete(path: string): Promise<void> {\n const response = await fetch(`${this.apiUrl}${path}`, {\n method: 'DELETE',\n signal: AbortSignal.timeout(this.timeout),\n });\n\n if (!response.ok) {\n throw new Error(`DELETE ${path} failed: ${response.statusText}`);\n }\n }\n\n /** Download a file as Blob */\n protected async downloadBlob(path: string): Promise<Blob> {\n const response = await fetch(`${this.apiUrl}${path}`, {\n signal: AbortSignal.timeout(this.timeout),\n });\n\n if (!response.ok) {\n throw new Error(`Download ${path} failed: ${response.statusText}`);\n }\n\n return response.blob();\n }\n\n /** Health check */\n async health(): Promise<{ status: string; service: string }> {\n return this.get('/health');\n }\n}\n","/**\n * DocxClient - HTTP client for DOCX document API\n */\n\nimport { BaseClient } from '../core/base-client';\nimport type {\n DocxClientOptions,\n DocumentInfo,\n ReadResponse,\n EditOperation,\n EditResponse,\n ValidateResponse,\n} from './types';\n\nconst DEFAULT_API_URL = 'https://docx-api-service-production.up.railway.app';\n\nexport class DocxClient extends BaseClient {\n constructor(options: DocxClientOptions = {}) {\n super(options);\n }\n\n protected getDefaultApiUrl(): string {\n return process.env.DOCX_API_URL || DEFAULT_API_URL;\n }\n\n /**\n * Upload a DOCX document.\n */\n async upload(file: File | Blob, filename?: string): Promise<DocumentInfo> {\n const formData = new FormData();\n formData.append('file', file, filename || 'document.docx');\n return this.postFormData('/documents/upload', formData);\n }\n\n /**\n * Download a DOCX document.\n */\n async download(docId: string): Promise<Blob> {\n return this.downloadBlob(`/documents/${docId}`);\n }\n\n /**\n * Read document content as plain text.\n */\n async read(docId: string): Promise<ReadResponse> {\n return this.post(`/documents/${docId}/read`);\n }\n\n /**\n * Execute edit operations on a document.\n */\n async edit(docId: string, operations: EditOperation[]): Promise<EditResponse> {\n return this.post(`/documents/${docId}/edit`, { operations });\n }\n\n /**\n * Validate document structure.\n */\n async validate(docId: string): Promise<ValidateResponse> {\n return this.post(`/documents/${docId}/validate`);\n }\n\n /**\n * Delete a document from storage.\n */\n async deleteDocument(docId: string): Promise<void> {\n return this.delete(`/documents/${docId}`);\n }\n}\n","/**\n * BaseAgent - Abstract base class for AI subagents\n *\n * Provides common functionality for tool-using agents with\n * OpenAI-compatible API support.\n */\n\nimport type {\n Tool,\n ChatMessage,\n ToolCall,\n StreamEvent,\n AgentRunResult,\n BaseAgentOptions,\n} from './types';\n\nexport abstract class BaseAgent<TClient> {\n protected openai: any;\n protected model: string;\n protected instructions: string;\n protected client: TClient;\n\n constructor(options: BaseAgentOptions & { client: TClient }) {\n this.openai = options.openai;\n this.model = options.model || this.getDefaultModel();\n this.instructions = options.instructions || this.getDefaultInstructions();\n this.client = options.client;\n }\n\n /** Get the underlying client */\n getClient(): TClient {\n return this.client;\n }\n\n /** Override to provide default model */\n protected abstract getDefaultModel(): string;\n\n /** Override to provide default instructions */\n protected abstract getDefaultInstructions(): string;\n\n /** Override to provide tool definitions */\n protected abstract getTools(): Tool[];\n\n /** Override to execute a tool call */\n protected abstract executeTool(name: string, args: Record<string, unknown>): Promise<string>;\n\n /**\n * Run the agent with a user message.\n * Returns the final response and all tool calls made.\n */\n async run(\n userMessage: string,\n conversationHistory: ChatMessage[] = []\n ): Promise<AgentRunResult> {\n if (!this.openai) {\n throw new Error('OpenAI client is required for agent.run(). Pass it in the constructor options.');\n }\n\n const messages: ChatMessage[] = [\n { role: 'system', content: this.instructions },\n ...conversationHistory,\n { role: 'user', content: userMessage },\n ];\n\n const toolCalls: ToolCall[] = [];\n let response = '';\n const tools = this.getTools();\n\n // Agent loop - keep running until no more tool calls\n while (true) {\n const completion = await this.openai.chat.completions.create({\n model: this.model,\n messages: messages as any,\n tools: tools as any,\n tool_choice: 'auto',\n });\n\n const assistantMessage = completion.choices[0].message;\n\n // Check if there are tool calls\n if (assistantMessage.tool_calls && assistantMessage.tool_calls.length > 0) {\n // Add assistant message with tool calls\n messages.push({\n role: 'assistant',\n content: assistantMessage.content || '',\n });\n\n // Execute each tool call\n for (const tc of assistantMessage.tool_calls) {\n const fn = (tc as any).function;\n const args = JSON.parse(fn.arguments);\n\n const toolCall: ToolCall = {\n id: tc.id,\n name: fn.name,\n arguments: args,\n status: 'running',\n };\n toolCalls.push(toolCall);\n\n // Execute the tool\n const result = await this.executeTool(fn.name, args);\n\n // Update tool call status\n if (result.startsWith('Error:')) {\n toolCall.error = result;\n toolCall.status = 'error';\n } else {\n toolCall.result = result;\n toolCall.status = 'completed';\n }\n\n // Add tool result to messages\n messages.push({\n role: 'tool',\n content: result,\n tool_call_id: tc.id,\n });\n }\n } else {\n // No more tool calls - return the final response\n response = assistantMessage.content || '';\n break;\n }\n }\n\n return { response, toolCalls };\n }\n\n /**\n * Run the agent with streaming output.\n * Yields events for real-time UI updates.\n */\n async *runStream(\n userMessage: string,\n conversationHistory: ChatMessage[] = []\n ): AsyncGenerator<StreamEvent> {\n if (!this.openai) {\n throw new Error('OpenAI client is required for agent.runStream(). Pass it in the constructor options.');\n }\n\n const messages: ChatMessage[] = [\n { role: 'system', content: this.instructions },\n ...conversationHistory,\n { role: 'user', content: userMessage },\n ];\n\n const tools = this.getTools();\n\n // Agent loop\n while (true) {\n yield { type: 'message_start', message: { role: 'assistant' } };\n\n const stream = await this.openai.chat.completions.create({\n model: this.model,\n messages: messages as any,\n tools: tools as any,\n tool_choice: 'auto',\n stream: true,\n });\n\n let contentBuffer = '';\n const toolCallBuffers: Map<number, { id: string; name: string; arguments: string }> =\n new Map();\n\n for await (const chunk of stream) {\n const delta = chunk.choices[0]?.delta;\n\n // Handle content\n if (delta?.content) {\n contentBuffer += delta.content;\n yield { type: 'content_delta', delta: { text: delta.content } };\n }\n\n // Handle tool calls\n if (delta?.tool_calls) {\n for (const tc of delta.tool_calls) {\n const idx = tc.index;\n if (!toolCallBuffers.has(idx)) {\n toolCallBuffers.set(idx, { id: '', name: '', arguments: '' });\n }\n\n const buffer = toolCallBuffers.get(idx)!;\n if (tc.id) buffer.id = tc.id;\n if (tc.function?.name) buffer.name = tc.function.name;\n if (tc.function?.arguments) buffer.arguments += tc.function.arguments;\n }\n }\n }\n\n // Process tool calls if any\n if (toolCallBuffers.size > 0) {\n // Add assistant message to history\n messages.push({\n role: 'assistant',\n content: contentBuffer,\n });\n\n for (const [_, buffer] of toolCallBuffers) {\n const args = JSON.parse(buffer.arguments);\n\n yield {\n type: 'tool_start',\n tool: { id: buffer.id, name: buffer.name, arguments: args },\n };\n\n // Execute the tool\n const result = await this.executeTool(buffer.name, args);\n\n if (result.startsWith('Error:')) {\n yield { type: 'tool_end', tool: { id: buffer.id, error: result } };\n } else {\n yield { type: 'tool_end', tool: { id: buffer.id, result } };\n }\n\n // Add tool result to messages\n messages.push({\n role: 'tool',\n content: result,\n tool_call_id: buffer.id,\n });\n }\n } else {\n // No more tool calls - done\n yield { type: 'message_end' };\n break;\n }\n }\n }\n}\n","/**\n * DocxAgent - AI agent for DOCX document editing\n *\n * Uses OpenAI-compatible API to process requests and execute\n * document editing operations.\n */\n\nimport { BaseAgent } from '../core/base-agent';\nimport type { Tool } from '../core/types';\nimport { DocxClient } from './client';\nimport type { DocxAgentOptions } from './types';\n\nconst DEFAULT_INSTRUCTIONS = `You are an expert DOCX document editing assistant.\n\nWhen editing documents:\n1. First read the document to understand its structure\n2. Use track changes for all modifications\n3. Add comments to flag issues or request clarification\n4. Be precise with paragraph text matching - use unique text snippets\n\nAvailable tools:\n- read_document: Read the document content\n- add_comment: Add a comment to a specific paragraph\n- insert_text: Insert text within a paragraph (tracked change)\n- propose_deletion: Mark text for deletion (tracked change)\n- reply_comment: Reply to an existing comment\n- resolve_comment: Mark a comment as resolved\n- delete_comment: Delete a comment\n- insert_paragraph: Insert a new paragraph\n- validate_document: Validate DOCX structure`;\n\nconst TOOLS: Tool[] = [\n {\n type: 'function',\n function: {\n name: 'read_document',\n description: 'Read the document content as plain text',\n parameters: {\n type: 'object',\n properties: {\n doc_id: { type: 'string', description: 'Document ID' },\n },\n required: ['doc_id'],\n },\n },\n },\n {\n type: 'function',\n function: {\n name: 'add_comment',\n description: 'Add a comment to a specific paragraph in the document',\n parameters: {\n type: 'object',\n properties: {\n doc_id: { type: 'string', description: 'Document ID' },\n para_text: { type: 'string', description: 'Unique text from the target paragraph' },\n comment: { type: 'string', description: 'Comment text to add' },\n highlight: { type: 'string', description: 'Optional specific text to highlight' },\n },\n required: ['doc_id', 'para_text', 'comment'],\n },\n },\n },\n {\n type: 'function',\n function: {\n name: 'insert_text',\n description: 'Insert text within a paragraph (creates a tracked change)',\n parameters: {\n type: 'object',\n properties: {\n doc_id: { type: 'string', description: 'Document ID' },\n para_text: { type: 'string', description: 'Unique text from the target paragraph' },\n after: { type: 'string', description: 'Text after which to insert' },\n new_text: { type: 'string', description: 'Text to insert' },\n },\n required: ['doc_id', 'para_text', 'after', 'new_text'],\n },\n },\n },\n {\n type: 'function',\n function: {\n name: 'propose_deletion',\n description: 'Mark text for deletion (creates a tracked change)',\n parameters: {\n type: 'object',\n properties: {\n doc_id: { type: 'string', description: 'Document ID' },\n para_text: { type: 'string', description: 'Unique text from the target paragraph' },\n target: { type: 'string', description: 'Specific text to delete (optional, defaults to whole paragraph)' },\n },\n required: ['doc_id', 'para_text'],\n },\n },\n },\n {\n type: 'function',\n function: {\n name: 'reply_comment',\n description: 'Reply to an existing comment',\n parameters: {\n type: 'object',\n properties: {\n doc_id: { type: 'string', description: 'Document ID' },\n comment_id: { type: 'string', description: 'ID of the comment to reply to' },\n reply: { type: 'string', description: 'Reply text' },\n },\n required: ['doc_id', 'comment_id', 'reply'],\n },\n },\n },\n {\n type: 'function',\n function: {\n name: 'resolve_comment',\n description: 'Mark a comment as resolved',\n parameters: {\n type: 'object',\n properties: {\n doc_id: { type: 'string', description: 'Document ID' },\n comment_id: { type: 'string', description: 'ID of the comment to resolve' },\n },\n required: ['doc_id', 'comment_id'],\n },\n },\n },\n {\n type: 'function',\n function: {\n name: 'delete_comment',\n description: 'Delete a comment and its replies',\n parameters: {\n type: 'object',\n properties: {\n doc_id: { type: 'string', description: 'Document ID' },\n comment_id: { type: 'string', description: 'ID of the comment to delete' },\n },\n required: ['doc_id', 'comment_id'],\n },\n },\n },\n {\n type: 'function',\n function: {\n name: 'insert_paragraph',\n description: 'Insert a new paragraph after existing text',\n parameters: {\n type: 'object',\n properties: {\n doc_id: { type: 'string', description: 'Document ID' },\n after_text: { type: 'string', description: 'Text after which to insert the new paragraph' },\n new_text: { type: 'string', description: 'Content of the new paragraph' },\n },\n required: ['doc_id', 'after_text', 'new_text'],\n },\n },\n },\n {\n type: 'function',\n function: {\n name: 'validate_document',\n description: 'Validate the document structure',\n parameters: {\n type: 'object',\n properties: {\n doc_id: { type: 'string', description: 'Document ID' },\n },\n required: ['doc_id'],\n },\n },\n },\n];\n\nexport class DocxAgent extends BaseAgent<DocxClient> {\n private documentId?: string;\n\n constructor(options: DocxAgentOptions = {}) {\n const client = new DocxClient(options);\n super({ ...options, client });\n this.documentId = options.documentId;\n }\n\n protected getDefaultModel(): string {\n return 'moonshot-v1-32k';\n }\n\n protected getDefaultInstructions(): string {\n return this.documentId\n ? `${DEFAULT_INSTRUCTIONS}\\n\\nCurrent document ID: ${this.documentId}`\n : DEFAULT_INSTRUCTIONS;\n }\n\n protected getTools(): Tool[] {\n return TOOLS;\n }\n\n /** Set the current document ID */\n setDocument(docId: string) {\n this.documentId = docId;\n }\n\n /** Get current document ID */\n getDocumentId(): string | undefined {\n return this.documentId;\n }\n\n protected async executeTool(name: string, args: Record<string, unknown>): Promise<string> {\n const docId = (args.doc_id as string) || this.documentId;\n\n if (!docId) {\n return 'Error: No document ID provided. Please upload a document first.';\n }\n\n try {\n switch (name) {\n case 'read_document': {\n const result = await this.client.read(docId);\n return `Document content (${result.paragraphs} paragraphs):\\n\\n${result.content}`;\n }\n\n case 'add_comment': {\n const result = await this.client.edit(docId, [\n {\n type: 'add_comment',\n para_text: args.para_text as string,\n comment: args.comment as string,\n highlight: args.highlight as string | undefined,\n },\n ]);\n return result.results[0];\n }\n\n case 'insert_text': {\n const result = await this.client.edit(docId, [\n {\n type: 'insert_text',\n para_text: args.para_text as string,\n after: args.after as string,\n new_text: args.new_text as string,\n },\n ]);\n return result.results[0];\n }\n\n case 'propose_deletion': {\n const result = await this.client.edit(docId, [\n {\n type: 'propose_deletion',\n para_text: args.para_text as string,\n target: args.target as string | undefined,\n },\n ]);\n return result.results[0];\n }\n\n case 'reply_comment': {\n const result = await this.client.edit(docId, [\n {\n type: 'reply_comment',\n comment_id: args.comment_id as string,\n reply: args.reply as string,\n },\n ]);\n return result.results[0];\n }\n\n case 'resolve_comment': {\n const result = await this.client.edit(docId, [\n {\n type: 'resolve_comment',\n comment_id: args.comment_id as string,\n },\n ]);\n return result.results[0];\n }\n\n case 'delete_comment': {\n const result = await this.client.edit(docId, [\n {\n type: 'delete_comment',\n comment_id: args.comment_id as string,\n },\n ]);\n return result.results[0];\n }\n\n case 'insert_paragraph': {\n const result = await this.client.edit(docId, [\n {\n type: 'insert_paragraph',\n after_text: args.after_text as string,\n new_text: args.new_text as string,\n },\n ]);\n return result.results[0];\n }\n\n case 'validate_document': {\n const result = await this.client.validate(docId);\n return `${result.result}: ${result.output}`;\n }\n\n default:\n return `Error: Unknown tool '${name}'`;\n }\n } catch (error) {\n return `Error: ${error instanceof Error ? error.message : String(error)}`;\n }\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ export { BaseAgent, BaseClient } from './core/index.mjs';
2
+ export { A as AgentRunResult, B as BaseAgentOptions, a as BaseClientOptions, C as ChatMessage, S as StreamEvent, T as Tool, b as ToolCall } from './types-D9rS2MQq.mjs';
3
+ export { DocumentInfo, DocxAgent, DocxAgentOptions, DocxClient, DocxClientOptions, EditOperation, EditOperationType, EditResponse, ReadResponse, ValidateResponse } from './docx/index.mjs';
4
+ export { F as FillOperation, a as FillResponse, b as FormField, P as PdfAgentOptions, c as PdfClientOptions, d as PdfDocumentInfo, R as ReadFieldsResponse } from './types-DBtV_NyH.mjs';
@@ -0,0 +1,4 @@
1
+ export { BaseAgent, BaseClient } from './core/index.js';
2
+ export { A as AgentRunResult, B as BaseAgentOptions, a as BaseClientOptions, C as ChatMessage, S as StreamEvent, T as Tool, b as ToolCall } from './types-D9rS2MQq.js';
3
+ export { DocumentInfo, DocxAgent, DocxAgentOptions, DocxClient, DocxClientOptions, EditOperation, EditOperationType, EditResponse, ReadResponse, ValidateResponse } from './docx/index.js';
4
+ export { F as FillOperation, a as FillResponse, b as FormField, P as PdfAgentOptions, c as PdfClientOptions, d as PdfDocumentInfo, R as ReadFieldsResponse } from './types-BEtL6Wum.js';