local-cli-agent 5.0.4 → 5.0.6
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/agents/browser/browser-sub-agent.d.ts.map +1 -1
- package/dist/agents/browser/browser-sub-agent.js +3 -0
- package/dist/agents/browser/browser-sub-agent.js.map +1 -1
- package/dist/constants.d.ts +1 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -2
- package/dist/constants.js.map +1 -1
- package/dist/core/llm/llm-client.d.ts +1 -0
- package/dist/core/llm/llm-client.d.ts.map +1 -1
- package/dist/core/llm/llm-client.js +17 -4
- package/dist/core/llm/llm-client.js.map +1 -1
- package/dist/core/llm/providers.d.ts +12 -0
- package/dist/core/llm/providers.d.ts.map +1 -0
- package/dist/core/llm/providers.js +80 -0
- package/dist/core/llm/providers.js.map +1 -0
- package/dist/prompts/system/plan-execute.d.ts.map +1 -1
- package/dist/prompts/system/plan-execute.js +40 -4
- package/dist/prompts/system/plan-execute.js.map +1 -1
- package/dist/tools/browser/browser-client.d.ts +13 -1
- package/dist/tools/browser/browser-client.d.ts.map +1 -1
- package/dist/tools/browser/browser-client.js +137 -9
- package/dist/tools/browser/browser-client.js.map +1 -1
- package/dist/tools/browser/browser-tools.d.ts +8 -2
- package/dist/tools/browser/browser-tools.d.ts.map +1 -1
- package/dist/tools/browser/browser-tools.js +428 -49
- package/dist/tools/browser/browser-tools.js.map +1 -1
- package/dist/tools/browser/index.d.ts +1 -1
- package/dist/tools/browser/index.d.ts.map +1 -1
- package/dist/tools/browser/index.js +1 -1
- package/dist/tools/browser/index.js.map +1 -1
- package/dist/tools/llm/simple/planning-tools.d.ts +1 -0
- package/dist/tools/llm/simple/planning-tools.d.ts.map +1 -1
- package/dist/tools/llm/simple/planning-tools.js +80 -26
- package/dist/tools/llm/simple/planning-tools.js.map +1 -1
- package/dist/tools/llm/simple/read-image-tool.d.ts.map +1 -1
- package/dist/tools/llm/simple/read-image-tool.js +0 -2
- package/dist/tools/llm/simple/read-image-tool.js.map +1 -1
- package/dist/tools/office/excel-tools/advanced.d.ts +13 -0
- package/dist/tools/office/excel-tools/advanced.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/advanced.js +364 -0
- package/dist/tools/office/excel-tools/advanced.js.map +1 -0
- package/dist/tools/office/excel-tools/cells.js +1 -1
- package/dist/tools/office/excel-tools/cells.js.map +1 -1
- package/dist/tools/office/excel-tools/charts.d.ts +6 -0
- package/dist/tools/office/excel-tools/charts.d.ts.map +1 -1
- package/dist/tools/office/excel-tools/charts.js +250 -1
- package/dist/tools/office/excel-tools/charts.js.map +1 -1
- package/dist/tools/office/excel-tools/comments.d.ts +1 -0
- package/dist/tools/office/excel-tools/comments.d.ts.map +1 -1
- package/dist/tools/office/excel-tools/comments.js +36 -0
- package/dist/tools/office/excel-tools/comments.js.map +1 -1
- package/dist/tools/office/excel-tools/data-ops.d.ts +4 -0
- package/dist/tools/office/excel-tools/data-ops.d.ts.map +1 -1
- package/dist/tools/office/excel-tools/data-ops.js +155 -1
- package/dist/tools/office/excel-tools/data-ops.js.map +1 -1
- package/dist/tools/office/excel-tools/export.d.ts +3 -0
- package/dist/tools/office/excel-tools/export.d.ts.map +1 -1
- package/dist/tools/office/excel-tools/export.js +117 -1
- package/dist/tools/office/excel-tools/export.js.map +1 -1
- package/dist/tools/office/excel-tools/formatting.d.ts +2 -0
- package/dist/tools/office/excel-tools/formatting.d.ts.map +1 -1
- package/dist/tools/office/excel-tools/formatting.js +74 -0
- package/dist/tools/office/excel-tools/formatting.js.map +1 -1
- package/dist/tools/office/excel-tools/formulas.d.ts +11 -0
- package/dist/tools/office/excel-tools/formulas.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/formulas.js +313 -0
- package/dist/tools/office/excel-tools/formulas.js.map +1 -0
- package/dist/tools/office/excel-tools/index.d.ts +5 -0
- package/dist/tools/office/excel-tools/index.d.ts.map +1 -1
- package/dist/tools/office/excel-tools/index.js +15 -0
- package/dist/tools/office/excel-tools/index.js.map +1 -1
- package/dist/tools/office/excel-tools/launch.d.ts +0 -1
- package/dist/tools/office/excel-tools/launch.d.ts.map +1 -1
- package/dist/tools/office/excel-tools/launch.js +33 -36
- package/dist/tools/office/excel-tools/launch.js.map +1 -1
- package/dist/tools/office/excel-tools/media.d.ts +5 -0
- package/dist/tools/office/excel-tools/media.d.ts.map +1 -1
- package/dist/tools/office/excel-tools/media.js +176 -0
- package/dist/tools/office/excel-tools/media.js.map +1 -1
- package/dist/tools/office/excel-tools/page-setup.d.ts +6 -0
- package/dist/tools/office/excel-tools/page-setup.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/page-setup.js +144 -0
- package/dist/tools/office/excel-tools/page-setup.js.map +1 -0
- package/dist/tools/office/excel-tools/pivot-table.d.ts +7 -0
- package/dist/tools/office/excel-tools/pivot-table.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/pivot-table.js +151 -0
- package/dist/tools/office/excel-tools/pivot-table.js.map +1 -0
- package/dist/tools/office/excel-tools/rows-columns.d.ts +4 -0
- package/dist/tools/office/excel-tools/rows-columns.d.ts.map +1 -1
- package/dist/tools/office/excel-tools/rows-columns.js +149 -2
- package/dist/tools/office/excel-tools/rows-columns.js.map +1 -1
- package/dist/tools/office/excel-tools/sheets.d.ts +8 -0
- package/dist/tools/office/excel-tools/sheets.d.ts.map +1 -1
- package/dist/tools/office/excel-tools/sheets.js +288 -0
- package/dist/tools/office/excel-tools/sheets.js.map +1 -1
- package/dist/tools/office/excel-tools/tables.d.ts +7 -0
- package/dist/tools/office/excel-tools/tables.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/tables.js +156 -0
- package/dist/tools/office/excel-tools/tables.js.map +1 -0
- package/dist/tools/office/index.d.ts +3 -3
- package/dist/tools/office/index.d.ts.map +1 -1
- package/dist/tools/office/index.js +3 -3
- package/dist/tools/office/index.js.map +1 -1
- package/dist/tools/office/powerpoint-client.d.ts +20 -0
- package/dist/tools/office/powerpoint-client.d.ts.map +1 -1
- package/dist/tools/office/powerpoint-client.js +223 -0
- package/dist/tools/office/powerpoint-client.js.map +1 -1
- package/dist/tools/office/powerpoint-tools/effects.d.ts.map +1 -1
- package/dist/tools/office/powerpoint-tools/effects.js +55 -42
- package/dist/tools/office/powerpoint-tools/effects.js.map +1 -1
- package/dist/tools/office/powerpoint-tools/export.d.ts +1 -0
- package/dist/tools/office/powerpoint-tools/export.d.ts.map +1 -1
- package/dist/tools/office/powerpoint-tools/export.js +44 -1
- package/dist/tools/office/powerpoint-tools/export.js.map +1 -1
- package/dist/tools/office/powerpoint-tools/launch.d.ts +0 -1
- package/dist/tools/office/powerpoint-tools/launch.d.ts.map +1 -1
- package/dist/tools/office/powerpoint-tools/launch.js +28 -36
- package/dist/tools/office/powerpoint-tools/launch.js.map +1 -1
- package/dist/tools/office/powerpoint-tools/media.d.ts.map +1 -1
- package/dist/tools/office/powerpoint-tools/media.js +25 -15
- package/dist/tools/office/powerpoint-tools/media.js.map +1 -1
- package/dist/tools/office/powerpoint-tools/notes.d.ts.map +1 -1
- package/dist/tools/office/powerpoint-tools/notes.js +20 -10
- package/dist/tools/office/powerpoint-tools/notes.js.map +1 -1
- package/dist/tools/office/powerpoint-tools/sections.d.ts.map +1 -1
- package/dist/tools/office/powerpoint-tools/sections.js +13 -6
- package/dist/tools/office/powerpoint-tools/sections.js.map +1 -1
- package/dist/tools/office/powerpoint-tools/shapes.d.ts +2 -0
- package/dist/tools/office/powerpoint-tools/shapes.d.ts.map +1 -1
- package/dist/tools/office/powerpoint-tools/shapes.js +181 -45
- package/dist/tools/office/powerpoint-tools/shapes.js.map +1 -1
- package/dist/tools/office/powerpoint-tools/slides.d.ts +4 -0
- package/dist/tools/office/powerpoint-tools/slides.d.ts.map +1 -1
- package/dist/tools/office/powerpoint-tools/slides.js +179 -15
- package/dist/tools/office/powerpoint-tools/slides.js.map +1 -1
- package/dist/tools/office/powerpoint-tools/tables.d.ts +6 -0
- package/dist/tools/office/powerpoint-tools/tables.d.ts.map +1 -1
- package/dist/tools/office/powerpoint-tools/tables.js +239 -9
- package/dist/tools/office/powerpoint-tools/tables.js.map +1 -1
- package/dist/tools/office/powerpoint-tools/text.d.ts +1 -0
- package/dist/tools/office/powerpoint-tools/text.d.ts.map +1 -1
- package/dist/tools/office/powerpoint-tools/text.js +96 -34
- package/dist/tools/office/powerpoint-tools/text.js.map +1 -1
- package/dist/tools/office/word-tools/find.d.ts +5 -0
- package/dist/tools/office/word-tools/find.d.ts.map +1 -0
- package/dist/tools/office/word-tools/find.js +106 -0
- package/dist/tools/office/word-tools/find.js.map +1 -0
- package/dist/tools/office/word-tools/footnotes.d.ts +9 -0
- package/dist/tools/office/word-tools/footnotes.d.ts.map +1 -0
- package/dist/tools/office/word-tools/footnotes.js +227 -0
- package/dist/tools/office/word-tools/footnotes.js.map +1 -0
- package/dist/tools/office/word-tools/index.d.ts +6 -0
- package/dist/tools/office/word-tools/index.d.ts.map +1 -1
- package/dist/tools/office/word-tools/index.js +18 -0
- package/dist/tools/office/word-tools/index.js.map +1 -1
- package/dist/tools/office/word-tools/launch.d.ts +0 -1
- package/dist/tools/office/word-tools/launch.d.ts.map +1 -1
- package/dist/tools/office/word-tools/launch.js +33 -36
- package/dist/tools/office/word-tools/launch.js.map +1 -1
- package/dist/tools/office/word-tools/selection.d.ts +8 -0
- package/dist/tools/office/word-tools/selection.d.ts.map +1 -0
- package/dist/tools/office/word-tools/selection.js +193 -0
- package/dist/tools/office/word-tools/selection.js.map +1 -0
- package/dist/tools/office/word-tools/tables-advanced.d.ts +8 -0
- package/dist/tools/office/word-tools/tables-advanced.d.ts.map +1 -0
- package/dist/tools/office/word-tools/tables-advanced.js +190 -0
- package/dist/tools/office/word-tools/tables-advanced.js.map +1 -0
- package/dist/tools/office/word-tools/toc.d.ts +6 -0
- package/dist/tools/office/word-tools/toc.d.ts.map +1 -0
- package/dist/tools/office/word-tools/toc.js +114 -0
- package/dist/tools/office/word-tools/toc.js.map +1 -0
- package/dist/tools/office/word-tools/track-changes.d.ts +8 -0
- package/dist/tools/office/word-tools/track-changes.d.ts.map +1 -0
- package/dist/tools/office/word-tools/track-changes.js +195 -0
- package/dist/tools/office/word-tools/track-changes.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/ui/components/Logo.d.ts.map +1 -1
- package/dist/ui/components/Logo.js +2 -4
- package/dist/ui/components/Logo.js.map +1 -1
- package/dist/ui/components/PlanExecuteApp.d.ts.map +1 -1
- package/dist/ui/components/PlanExecuteApp.js +3 -5
- package/dist/ui/components/PlanExecuteApp.js.map +1 -1
- package/dist/ui/components/dialogs/SettingsDialog.d.ts.map +1 -1
- package/dist/ui/components/dialogs/SettingsDialog.js +50 -5
- package/dist/ui/components/dialogs/SettingsDialog.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import { excelClient } from '../excel-client.js';
|
|
2
|
+
import { OFFICE_CATEGORIES } from '../common/index.js';
|
|
3
|
+
const EXCEL_VLOOKUP_DEFINITION = {
|
|
4
|
+
type: 'function',
|
|
5
|
+
function: {
|
|
6
|
+
name: 'excel_vlookup',
|
|
7
|
+
description: `Insert a VLOOKUP formula to look up a value in the first column of a table and return a value in the same row from another column.`,
|
|
8
|
+
parameters: {
|
|
9
|
+
type: 'object',
|
|
10
|
+
properties: {
|
|
11
|
+
reason: { type: 'string', description: 'Why you are inserting VLOOKUP' },
|
|
12
|
+
cell: { type: 'string', description: 'Cell to insert the formula (e.g., "E2")' },
|
|
13
|
+
lookup_value: { type: 'string', description: 'Value to look for (cell reference or value, e.g., "A2" or "\\"Product1\\"")' },
|
|
14
|
+
table_range: { type: 'string', description: 'Table range to search (e.g., "Sheet2!A:D")' },
|
|
15
|
+
col_index: { type: 'number', description: 'Column index to return (1-based, e.g., 3 for third column)' },
|
|
16
|
+
exact_match: { type: 'boolean', description: 'True for exact match (default), false for approximate match' },
|
|
17
|
+
sheet: { type: 'string', description: 'Sheet name (optional)' },
|
|
18
|
+
},
|
|
19
|
+
required: ['reason', 'cell', 'lookup_value', 'table_range', 'col_index'],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
async function executeExcelVlookup(args) {
|
|
24
|
+
try {
|
|
25
|
+
const response = await excelClient.excelInsertVlookup(args['cell'], args['lookup_value'], args['table_range'], args['col_index'], args['exact_match'] !== false, args['sheet']);
|
|
26
|
+
if (response.success) {
|
|
27
|
+
return { success: true, result: response.message || `VLOOKUP formula inserted in ${args['cell']}` };
|
|
28
|
+
}
|
|
29
|
+
return { success: false, error: response.error || 'Failed to insert VLOOKUP formula' };
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
return { success: false, error: `Failed to insert VLOOKUP: ${error instanceof Error ? error.message : String(error)}` };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export const excelVlookupTool = {
|
|
36
|
+
definition: EXCEL_VLOOKUP_DEFINITION,
|
|
37
|
+
execute: executeExcelVlookup,
|
|
38
|
+
categories: OFFICE_CATEGORIES,
|
|
39
|
+
description: 'Insert Excel VLOOKUP formula',
|
|
40
|
+
};
|
|
41
|
+
const EXCEL_SUMIF_DEFINITION = {
|
|
42
|
+
type: 'function',
|
|
43
|
+
function: {
|
|
44
|
+
name: 'excel_sumif',
|
|
45
|
+
description: `Insert a SUMIF formula to sum values that meet a specific condition.`,
|
|
46
|
+
parameters: {
|
|
47
|
+
type: 'object',
|
|
48
|
+
properties: {
|
|
49
|
+
reason: { type: 'string', description: 'Why you are inserting SUMIF' },
|
|
50
|
+
cell: { type: 'string', description: 'Cell to insert the formula (e.g., "E2")' },
|
|
51
|
+
range: { type: 'string', description: 'Range to evaluate against criteria (e.g., "A:A")' },
|
|
52
|
+
criteria: { type: 'string', description: 'Condition to match. Simple: ">100", "Apple". Cell reference: ">="&A1 (uses value from A1). Already quoted criteria like "text" passed as-is.' },
|
|
53
|
+
sum_range: { type: 'string', description: 'Range to sum (optional, if different from range)' },
|
|
54
|
+
sheet: { type: 'string', description: 'Sheet name (optional)' },
|
|
55
|
+
},
|
|
56
|
+
required: ['reason', 'cell', 'range', 'criteria'],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
async function executeExcelSumif(args) {
|
|
61
|
+
try {
|
|
62
|
+
const response = await excelClient.excelInsertSumif(args['cell'], args['range'], args['criteria'], args['sum_range'], args['sheet']);
|
|
63
|
+
if (response.success) {
|
|
64
|
+
return { success: true, result: response.message || `SUMIF formula inserted in ${args['cell']}` };
|
|
65
|
+
}
|
|
66
|
+
return { success: false, error: response.error || 'Failed to insert SUMIF formula' };
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
return { success: false, error: `Failed to insert SUMIF: ${error instanceof Error ? error.message : String(error)}` };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export const excelSumifTool = {
|
|
73
|
+
definition: EXCEL_SUMIF_DEFINITION,
|
|
74
|
+
execute: executeExcelSumif,
|
|
75
|
+
categories: OFFICE_CATEGORIES,
|
|
76
|
+
description: 'Insert Excel SUMIF formula',
|
|
77
|
+
};
|
|
78
|
+
const EXCEL_COUNTIF_DEFINITION = {
|
|
79
|
+
type: 'function',
|
|
80
|
+
function: {
|
|
81
|
+
name: 'excel_countif',
|
|
82
|
+
description: `Insert a COUNTIF formula to count cells that meet a specific condition.`,
|
|
83
|
+
parameters: {
|
|
84
|
+
type: 'object',
|
|
85
|
+
properties: {
|
|
86
|
+
reason: { type: 'string', description: 'Why you are inserting COUNTIF' },
|
|
87
|
+
cell: { type: 'string', description: 'Cell to insert the formula (e.g., "E2")' },
|
|
88
|
+
range: { type: 'string', description: 'Range to count (e.g., "A:A")' },
|
|
89
|
+
criteria: { type: 'string', description: 'Condition to match. Simple: ">100", "Apple". Cell reference: ">="&A1 (uses value from A1). Already quoted criteria like "text" passed as-is.' },
|
|
90
|
+
sheet: { type: 'string', description: 'Sheet name (optional)' },
|
|
91
|
+
},
|
|
92
|
+
required: ['reason', 'cell', 'range', 'criteria'],
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
async function executeExcelCountif(args) {
|
|
97
|
+
try {
|
|
98
|
+
const response = await excelClient.excelInsertCountif(args['cell'], args['range'], args['criteria'], args['sheet']);
|
|
99
|
+
if (response.success) {
|
|
100
|
+
return { success: true, result: response.message || `COUNTIF formula inserted in ${args['cell']}` };
|
|
101
|
+
}
|
|
102
|
+
return { success: false, error: response.error || 'Failed to insert COUNTIF formula' };
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
return { success: false, error: `Failed to insert COUNTIF: ${error instanceof Error ? error.message : String(error)}` };
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
export const excelCountifTool = {
|
|
109
|
+
definition: EXCEL_COUNTIF_DEFINITION,
|
|
110
|
+
execute: executeExcelCountif,
|
|
111
|
+
categories: OFFICE_CATEGORIES,
|
|
112
|
+
description: 'Insert Excel COUNTIF formula',
|
|
113
|
+
};
|
|
114
|
+
const EXCEL_INDEX_MATCH_DEFINITION = {
|
|
115
|
+
type: 'function',
|
|
116
|
+
function: {
|
|
117
|
+
name: 'excel_index_match',
|
|
118
|
+
description: `Insert an INDEX-MATCH formula combination (more flexible alternative to VLOOKUP).`,
|
|
119
|
+
parameters: {
|
|
120
|
+
type: 'object',
|
|
121
|
+
properties: {
|
|
122
|
+
reason: { type: 'string', description: 'Why you are inserting INDEX-MATCH' },
|
|
123
|
+
cell: { type: 'string', description: 'Cell to insert the formula (e.g., "E2")' },
|
|
124
|
+
return_range: { type: 'string', description: 'Column/range to return values from (e.g., "C:C")' },
|
|
125
|
+
lookup_range: { type: 'string', description: 'Column/range to search in (e.g., "A:A")' },
|
|
126
|
+
lookup_value: { type: 'string', description: 'Value to look for (cell reference or value, e.g., "D2" or "\\"Product1\\"")' },
|
|
127
|
+
sheet: { type: 'string', description: 'Sheet name (optional)' },
|
|
128
|
+
},
|
|
129
|
+
required: ['reason', 'cell', 'return_range', 'lookup_range', 'lookup_value'],
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
async function executeExcelIndexMatch(args) {
|
|
134
|
+
try {
|
|
135
|
+
const response = await excelClient.excelInsertIndexMatch(args['cell'], args['return_range'], args['lookup_range'], args['lookup_value'], args['sheet']);
|
|
136
|
+
if (response.success) {
|
|
137
|
+
return { success: true, result: response.message || `INDEX-MATCH formula inserted in ${args['cell']}` };
|
|
138
|
+
}
|
|
139
|
+
return { success: false, error: response.error || 'Failed to insert INDEX-MATCH formula' };
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
return { success: false, error: `Failed to insert INDEX-MATCH: ${error instanceof Error ? error.message : String(error)}` };
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
export const excelIndexMatchTool = {
|
|
146
|
+
definition: EXCEL_INDEX_MATCH_DEFINITION,
|
|
147
|
+
execute: executeExcelIndexMatch,
|
|
148
|
+
categories: OFFICE_CATEGORIES,
|
|
149
|
+
description: 'Insert Excel INDEX-MATCH formula',
|
|
150
|
+
};
|
|
151
|
+
const EXCEL_AVERAGEIF_DEFINITION = {
|
|
152
|
+
type: 'function',
|
|
153
|
+
function: {
|
|
154
|
+
name: 'excel_averageif',
|
|
155
|
+
description: `Insert an AVERAGEIF formula to average values that meet a specific condition.`,
|
|
156
|
+
parameters: {
|
|
157
|
+
type: 'object',
|
|
158
|
+
properties: {
|
|
159
|
+
reason: { type: 'string', description: 'Why you are inserting AVERAGEIF' },
|
|
160
|
+
cell: { type: 'string', description: 'Cell to insert the formula (e.g., "E2")' },
|
|
161
|
+
range: { type: 'string', description: 'Range to evaluate against criteria (e.g., "A:A")' },
|
|
162
|
+
criteria: { type: 'string', description: 'Condition to match. Simple: ">100", "Apple". Cell reference: ">="&A1 (uses value from A1). Already quoted criteria like "text" passed as-is.' },
|
|
163
|
+
avg_range: { type: 'string', description: 'Range to average (optional, if different from range)' },
|
|
164
|
+
sheet: { type: 'string', description: 'Sheet name (optional)' },
|
|
165
|
+
},
|
|
166
|
+
required: ['reason', 'cell', 'range', 'criteria'],
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
async function executeExcelAverageif(args) {
|
|
171
|
+
try {
|
|
172
|
+
const response = await excelClient.excelInsertAverageif(args['cell'], args['range'], args['criteria'], args['avg_range'], args['sheet']);
|
|
173
|
+
if (response.success) {
|
|
174
|
+
return { success: true, result: response.message || `AVERAGEIF formula inserted in ${args['cell']}` };
|
|
175
|
+
}
|
|
176
|
+
return { success: false, error: response.error || 'Failed to insert AVERAGEIF formula' };
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
return { success: false, error: `Failed to insert AVERAGEIF: ${error instanceof Error ? error.message : String(error)}` };
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
export const excelAverageifTool = {
|
|
183
|
+
definition: EXCEL_AVERAGEIF_DEFINITION,
|
|
184
|
+
execute: executeExcelAverageif,
|
|
185
|
+
categories: OFFICE_CATEGORIES,
|
|
186
|
+
description: 'Insert Excel AVERAGEIF formula',
|
|
187
|
+
};
|
|
188
|
+
const EXCEL_SUMIFS_DEFINITION = {
|
|
189
|
+
type: 'function',
|
|
190
|
+
function: {
|
|
191
|
+
name: 'excel_sumifs',
|
|
192
|
+
description: `Insert a SUMIFS formula to sum values with multiple conditions.
|
|
193
|
+
Unlike SUMIF, SUMIFS supports multiple criteria ranges and conditions.`,
|
|
194
|
+
parameters: {
|
|
195
|
+
type: 'object',
|
|
196
|
+
properties: {
|
|
197
|
+
reason: { type: 'string', description: 'Why you are inserting SUMIFS' },
|
|
198
|
+
cell: { type: 'string', description: 'Cell to insert the formula (e.g., "E2")' },
|
|
199
|
+
sum_range: { type: 'string', description: 'Range to sum (e.g., "C:C")' },
|
|
200
|
+
criteria_ranges: { type: 'array', items: { type: 'string' }, description: 'Array of ranges to evaluate (e.g., ["A:A", "B:B"])' },
|
|
201
|
+
criteria: { type: 'array', items: { type: 'string' }, description: 'Array of conditions. Simple: "Product1", ">100". Cell reference: ">="&A1 (uses value from cell). Must match criteria_ranges order.' },
|
|
202
|
+
sheet: { type: 'string', description: 'Sheet name (optional)' },
|
|
203
|
+
},
|
|
204
|
+
required: ['reason', 'cell', 'sum_range', 'criteria_ranges', 'criteria'],
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
async function executeExcelSumifs(args) {
|
|
209
|
+
try {
|
|
210
|
+
const response = await excelClient.excelInsertSumifs(args['cell'], args['sum_range'], args['criteria_ranges'], args['criteria'], args['sheet']);
|
|
211
|
+
if (response.success) {
|
|
212
|
+
return { success: true, result: response.message || `SUMIFS formula inserted in ${args['cell']}` };
|
|
213
|
+
}
|
|
214
|
+
return { success: false, error: response.error || 'Failed to insert SUMIFS formula' };
|
|
215
|
+
}
|
|
216
|
+
catch (error) {
|
|
217
|
+
return { success: false, error: `Failed to insert SUMIFS: ${error instanceof Error ? error.message : String(error)}` };
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
export const excelSumifsTool = {
|
|
221
|
+
definition: EXCEL_SUMIFS_DEFINITION,
|
|
222
|
+
execute: executeExcelSumifs,
|
|
223
|
+
categories: OFFICE_CATEGORIES,
|
|
224
|
+
description: 'Insert Excel SUMIFS formula (multi-criteria)',
|
|
225
|
+
};
|
|
226
|
+
const EXCEL_COUNTIFS_DEFINITION = {
|
|
227
|
+
type: 'function',
|
|
228
|
+
function: {
|
|
229
|
+
name: 'excel_countifs',
|
|
230
|
+
description: `Insert a COUNTIFS formula to count cells with multiple conditions.
|
|
231
|
+
Unlike COUNTIF, COUNTIFS supports multiple criteria ranges and conditions.`,
|
|
232
|
+
parameters: {
|
|
233
|
+
type: 'object',
|
|
234
|
+
properties: {
|
|
235
|
+
reason: { type: 'string', description: 'Why you are inserting COUNTIFS' },
|
|
236
|
+
cell: { type: 'string', description: 'Cell to insert the formula (e.g., "E2")' },
|
|
237
|
+
criteria_ranges: { type: 'array', items: { type: 'string' }, description: 'Array of ranges to evaluate (e.g., ["A:A", "B:B"])' },
|
|
238
|
+
criteria: { type: 'array', items: { type: 'string' }, description: 'Array of conditions. Simple: "Product1", ">100". Cell reference: ">="&A1 (uses value from cell). Must match criteria_ranges order.' },
|
|
239
|
+
sheet: { type: 'string', description: 'Sheet name (optional)' },
|
|
240
|
+
},
|
|
241
|
+
required: ['reason', 'cell', 'criteria_ranges', 'criteria'],
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
async function executeExcelCountifs(args) {
|
|
246
|
+
try {
|
|
247
|
+
const response = await excelClient.excelInsertCountifs(args['cell'], args['criteria_ranges'], args['criteria'], args['sheet']);
|
|
248
|
+
if (response.success) {
|
|
249
|
+
return { success: true, result: response.message || `COUNTIFS formula inserted in ${args['cell']}` };
|
|
250
|
+
}
|
|
251
|
+
return { success: false, error: response.error || 'Failed to insert COUNTIFS formula' };
|
|
252
|
+
}
|
|
253
|
+
catch (error) {
|
|
254
|
+
return { success: false, error: `Failed to insert COUNTIFS: ${error instanceof Error ? error.message : String(error)}` };
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
export const excelCountifsTool = {
|
|
258
|
+
definition: EXCEL_COUNTIFS_DEFINITION,
|
|
259
|
+
execute: executeExcelCountifs,
|
|
260
|
+
categories: OFFICE_CATEGORIES,
|
|
261
|
+
description: 'Insert Excel COUNTIFS formula (multi-criteria)',
|
|
262
|
+
};
|
|
263
|
+
const EXCEL_XLOOKUP_DEFINITION = {
|
|
264
|
+
type: 'function',
|
|
265
|
+
function: {
|
|
266
|
+
name: 'excel_xlookup',
|
|
267
|
+
description: `Insert an XLOOKUP formula (modern replacement for VLOOKUP/HLOOKUP).
|
|
268
|
+
Requires Excel 365 or Excel 2021+. More flexible than VLOOKUP - can search in any direction.`,
|
|
269
|
+
parameters: {
|
|
270
|
+
type: 'object',
|
|
271
|
+
properties: {
|
|
272
|
+
reason: { type: 'string', description: 'Why you are inserting XLOOKUP' },
|
|
273
|
+
cell: { type: 'string', description: 'Cell to insert the formula (e.g., "E2")' },
|
|
274
|
+
lookup_value: { type: 'string', description: 'Value to look for (cell reference or value, e.g., "A2")' },
|
|
275
|
+
lookup_range: { type: 'string', description: 'Range to search in (e.g., "B:B")' },
|
|
276
|
+
return_range: { type: 'string', description: 'Range to return values from (e.g., "C:C")' },
|
|
277
|
+
not_found_value: { type: 'string', description: 'Value to return if not found (optional)' },
|
|
278
|
+
match_mode: { type: 'string', enum: ['exact', 'exactOrNext', 'exactOrPrev', 'wildcard'], description: 'Match mode: exact (default), exactOrNext, exactOrPrev, wildcard' },
|
|
279
|
+
sheet: { type: 'string', description: 'Sheet name (optional)' },
|
|
280
|
+
},
|
|
281
|
+
required: ['reason', 'cell', 'lookup_value', 'lookup_range', 'return_range'],
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
};
|
|
285
|
+
async function executeExcelXlookup(args) {
|
|
286
|
+
try {
|
|
287
|
+
const response = await excelClient.excelInsertXlookup(args['cell'], args['lookup_value'], args['lookup_range'], args['return_range'], args['not_found_value'], args['match_mode'], args['sheet']);
|
|
288
|
+
if (response.success) {
|
|
289
|
+
return { success: true, result: response.message || `XLOOKUP formula inserted in ${args['cell']}` };
|
|
290
|
+
}
|
|
291
|
+
return { success: false, error: response.error || 'Failed to insert XLOOKUP formula' };
|
|
292
|
+
}
|
|
293
|
+
catch (error) {
|
|
294
|
+
return { success: false, error: `Failed to insert XLOOKUP: ${error instanceof Error ? error.message : String(error)}` };
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
export const excelXlookupTool = {
|
|
298
|
+
definition: EXCEL_XLOOKUP_DEFINITION,
|
|
299
|
+
execute: executeExcelXlookup,
|
|
300
|
+
categories: OFFICE_CATEGORIES,
|
|
301
|
+
description: 'Insert Excel XLOOKUP formula',
|
|
302
|
+
};
|
|
303
|
+
export const formulasTools = [
|
|
304
|
+
excelVlookupTool,
|
|
305
|
+
excelSumifTool,
|
|
306
|
+
excelCountifTool,
|
|
307
|
+
excelIndexMatchTool,
|
|
308
|
+
excelAverageifTool,
|
|
309
|
+
excelSumifsTool,
|
|
310
|
+
excelCountifsTool,
|
|
311
|
+
excelXlookupTool,
|
|
312
|
+
];
|
|
313
|
+
//# sourceMappingURL=formulas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formulas.js","sourceRoot":"","sources":["../../../../src/tools/office/excel-tools/formulas.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAMvD,MAAM,wBAAwB,GAAmB;IAC/C,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE;QACR,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,oIAAoI;QACjJ,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+BAA+B,EAAE;gBACxE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yCAAyC,EAAE;gBAChF,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6EAA6E,EAAE;gBAC5H,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4CAA4C,EAAE;gBAC1F,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4DAA4D,EAAE;gBACxG,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,6DAA6D,EAAE;gBAC5G,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE;aAChE;YACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,aAAa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
|
14
14
|
export * from './export.js';
|
|
15
|
+
export * from './pivot-table.js';
|
|
16
|
+
export * from './formulas.js';
|
|
17
|
+
export * from './tables.js';
|
|
18
|
+
export * from './page-setup.js';
|
|
19
|
+
export * from './advanced.js';
|
|
15
20
|
import type { LLMSimpleTool } from '../../types.js';
|
|
16
21
|
export declare const EXCEL_TOOLS: LLMSimpleTool[];
|
|
17
22
|
export declare const EXCEL_CREATE_TOOLS: LLMSimpleTool[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tools/office/excel-tools/index.ts"],"names":[],"mappings":"AAMA,cAAc,qBAAqB,CAAC;AAGpC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tools/office/excel-tools/index.ts"],"names":[],"mappings":"AAMA,cAAc,qBAAqB,CAAC;AAGpC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AA0B9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKpD,eAAO,MAAM,WAAW,EAAE,aAAa,EAmBtC,CAAC;AAMF,eAAO,MAAM,kBAAkB,EAAE,aAAa,EAO7C,CAAC"}
|
|
@@ -12,6 +12,11 @@ export * from './comments.js';
|
|
|
12
12
|
export * from './protection.js';
|
|
13
13
|
export * from './media.js';
|
|
14
14
|
export * from './export.js';
|
|
15
|
+
export * from './pivot-table.js';
|
|
16
|
+
export * from './formulas.js';
|
|
17
|
+
export * from './tables.js';
|
|
18
|
+
export * from './page-setup.js';
|
|
19
|
+
export * from './advanced.js';
|
|
15
20
|
import { launchTools } from './launch.js';
|
|
16
21
|
import { cellsTools } from './cells.js';
|
|
17
22
|
import { formattingTools } from './formatting.js';
|
|
@@ -25,6 +30,11 @@ import { commentsTools } from './comments.js';
|
|
|
25
30
|
import { protectionTools } from './protection.js';
|
|
26
31
|
import { mediaTools } from './media.js';
|
|
27
32
|
import { exportTools } from './export.js';
|
|
33
|
+
import { pivotTableTools } from './pivot-table.js';
|
|
34
|
+
import { formulasTools } from './formulas.js';
|
|
35
|
+
import { tablesTools } from './tables.js';
|
|
36
|
+
import { pageSetupTools } from './page-setup.js';
|
|
37
|
+
import { advancedTools } from './advanced.js';
|
|
28
38
|
import { sheetBuilderTools, excelValidatedSaveTool } from './sheet-builders.js';
|
|
29
39
|
import { excelCreateTool, excelScreenshotTool } from './launch.js';
|
|
30
40
|
import { excelAddSheetTool, excelRenameSheetTool } from './sheets.js';
|
|
@@ -42,6 +52,11 @@ export const EXCEL_TOOLS = [
|
|
|
42
52
|
...protectionTools,
|
|
43
53
|
...mediaTools,
|
|
44
54
|
...exportTools,
|
|
55
|
+
...pivotTableTools,
|
|
56
|
+
...formulasTools,
|
|
57
|
+
...tablesTools,
|
|
58
|
+
...pageSetupTools,
|
|
59
|
+
...advancedTools,
|
|
45
60
|
];
|
|
46
61
|
export const EXCEL_CREATE_TOOLS = [
|
|
47
62
|
excelCreateTool,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tools/office/excel-tools/index.ts"],"names":[],"mappings":"AAMA,cAAc,qBAAqB,CAAC;AAGpC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tools/office/excel-tools/index.ts"],"names":[],"mappings":"AAMA,cAAc,qBAAqB,CAAC;AAGpC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAG9B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,E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IACnB,GAAG,aAAa;IAChB,GAAG,eAAe;IAClB,GAAG,UAAU;IACb,GAAG,WAAW;IACd,GAAG,eAAe;IAClB,GAAG,aAAa;IAChB,GAAG,WAAW;IACd,GAAG,cAAc;IACjB,GAAG,aAAa;CACjB,CAAC;AAMF,MAAM,CAAC,MAAM,kBAAkB,GAAoB;IACjD,eAAe;IACf,sBAAsB;IACtB,mBAAmB;IACnB,iBAAiB;IACjB,oBAAoB;IACpB,GAAG,iBAAiB;CACrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../../../../src/tools/office/excel-tools/launch.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAc,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../../../../src/tools/office/excel-tools/launch.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAc,MAAM,gBAAgB,CAAC;AA6C3D,eAAO,MAAM,eAAe,EAAE,aAK7B,CAAC;AAyCF,eAAO,MAAM,aAAa,EAAE,aAK3B,CAAC;AAuCF,eAAO,MAAM,aAAa,EAAE,aAK3B,CAAC;AA2CF,eAAO,MAAM,mBAAmB,EAAE,aAKjC,CAAC;AAuCF,eAAO,MAAM,cAAc,EAAE,aAK5B,CAAC;AAuCF,eAAO,MAAM,aAAa,EAAE,aAK3B,CAAC;AAMF,eAAO,MAAM,WAAW,EAAE,aAAa,EAOtC,CAAC"}
|
|
@@ -1,45 +1,13 @@
|
|
|
1
1
|
import { excelClient } from '../excel-client.js';
|
|
2
2
|
import { saveScreenshot, delay, APP_LAUNCH_DELAY_MS } from '../common/utils.js';
|
|
3
3
|
import { OFFICE_CATEGORIES } from '../common/constants.js';
|
|
4
|
-
|
|
5
|
-
type: 'function',
|
|
6
|
-
function: {
|
|
7
|
-
name: 'excel_launch',
|
|
8
|
-
description: `Launch Microsoft Excel for spreadsheet editing.
|
|
9
|
-
Use this tool to start Excel before working with spreadsheets.
|
|
10
|
-
The Excel window will be visible so you can see the changes in real-time.`,
|
|
11
|
-
parameters: {
|
|
12
|
-
type: 'object',
|
|
13
|
-
properties: {
|
|
14
|
-
reason: { type: 'string', description: 'Explanation of why you are launching Excel' },
|
|
15
|
-
},
|
|
16
|
-
required: ['reason'],
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
async function executeExcelLaunch(_args) {
|
|
21
|
-
try {
|
|
22
|
-
const response = await excelClient.excelLaunch();
|
|
23
|
-
if (response.success) {
|
|
24
|
-
return { success: true, result: response.message || 'Excel launched successfully' };
|
|
25
|
-
}
|
|
26
|
-
return { success: false, error: response.error || 'Failed to launch Excel' };
|
|
27
|
-
}
|
|
28
|
-
catch (error) {
|
|
29
|
-
return { success: false, error: `Failed to launch Excel: ${error instanceof Error ? error.message : String(error)}` };
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export const excelLaunchTool = {
|
|
33
|
-
definition: EXCEL_LAUNCH_DEFINITION,
|
|
34
|
-
execute: executeExcelLaunch,
|
|
35
|
-
categories: OFFICE_CATEGORIES,
|
|
36
|
-
description: 'Launch Microsoft Excel',
|
|
37
|
-
};
|
|
4
|
+
import { logger } from '../../../utils/logger.js';
|
|
38
5
|
const EXCEL_CREATE_DEFINITION = {
|
|
39
6
|
type: 'function',
|
|
40
7
|
function: {
|
|
41
8
|
name: 'excel_create',
|
|
42
|
-
description: `Create a new Excel workbook
|
|
9
|
+
description: `Create a new Excel workbook. Automatically launches Excel if it is not already running.
|
|
10
|
+
Use this tool to start working with a new spreadsheet.`,
|
|
43
11
|
parameters: {
|
|
44
12
|
type: 'object',
|
|
45
13
|
properties: {
|
|
@@ -50,15 +18,20 @@ const EXCEL_CREATE_DEFINITION = {
|
|
|
50
18
|
},
|
|
51
19
|
};
|
|
52
20
|
async function executeExcelCreate(_args) {
|
|
21
|
+
const startTime = Date.now();
|
|
22
|
+
logger.toolStart('excel_create', _args);
|
|
53
23
|
try {
|
|
54
24
|
const response = await excelClient.excelCreate();
|
|
55
25
|
if (response.success) {
|
|
56
26
|
await delay(APP_LAUNCH_DELAY_MS);
|
|
27
|
+
logger.toolSuccess('excel_create', _args, { message: response.message }, Date.now() - startTime);
|
|
57
28
|
return { success: true, result: response.message || 'New workbook created' };
|
|
58
29
|
}
|
|
30
|
+
logger.toolError('excel_create', _args, new Error(response.error || 'Failed to create workbook'), Date.now() - startTime);
|
|
59
31
|
return { success: false, error: response.error || 'Failed to create workbook' };
|
|
60
32
|
}
|
|
61
33
|
catch (error) {
|
|
34
|
+
logger.toolError('excel_create', _args, error instanceof Error ? error : new Error(String(error)), Date.now() - startTime);
|
|
62
35
|
return { success: false, error: `Failed to create workbook: ${error instanceof Error ? error.message : String(error)}` };
|
|
63
36
|
}
|
|
64
37
|
}
|
|
@@ -84,15 +57,20 @@ const EXCEL_OPEN_DEFINITION = {
|
|
|
84
57
|
},
|
|
85
58
|
};
|
|
86
59
|
async function executeExcelOpen(args) {
|
|
60
|
+
const startTime = Date.now();
|
|
61
|
+
logger.toolStart('excel_open', args);
|
|
87
62
|
try {
|
|
88
63
|
const response = await excelClient.excelOpen(args['path']);
|
|
89
64
|
if (response.success) {
|
|
90
65
|
await delay(APP_LAUNCH_DELAY_MS);
|
|
66
|
+
logger.toolSuccess('excel_open', args, { workbookName: response['workbook_name'], path: args['path'] }, Date.now() - startTime);
|
|
91
67
|
return { success: true, result: `Workbook opened: ${response['workbook_name'] || args['path']}` };
|
|
92
68
|
}
|
|
69
|
+
logger.toolError('excel_open', args, new Error(response.error || 'Failed to open workbook'), Date.now() - startTime);
|
|
93
70
|
return { success: false, error: response.error || 'Failed to open workbook' };
|
|
94
71
|
}
|
|
95
72
|
catch (error) {
|
|
73
|
+
logger.toolError('excel_open', args, error instanceof Error ? error : new Error(String(error)), Date.now() - startTime);
|
|
96
74
|
return { success: false, error: `Failed to open workbook: ${error instanceof Error ? error.message : String(error)}` };
|
|
97
75
|
}
|
|
98
76
|
}
|
|
@@ -118,14 +96,19 @@ const EXCEL_SAVE_DEFINITION = {
|
|
|
118
96
|
},
|
|
119
97
|
};
|
|
120
98
|
async function executeExcelSave(args) {
|
|
99
|
+
const startTime = Date.now();
|
|
100
|
+
logger.toolStart('excel_save', args);
|
|
121
101
|
try {
|
|
122
102
|
const response = await excelClient.excelSave(args['path']);
|
|
123
103
|
if (response.success) {
|
|
104
|
+
logger.toolSuccess('excel_save', args, { path: response['path'] }, Date.now() - startTime);
|
|
124
105
|
return { success: true, result: `Workbook saved: ${response['path'] || 'current location'}` };
|
|
125
106
|
}
|
|
107
|
+
logger.toolError('excel_save', args, new Error(response.error || 'Failed to save workbook'), Date.now() - startTime);
|
|
126
108
|
return { success: false, error: response.error || 'Failed to save workbook' };
|
|
127
109
|
}
|
|
128
110
|
catch (error) {
|
|
111
|
+
logger.toolError('excel_save', args, error instanceof Error ? error : new Error(String(error)), Date.now() - startTime);
|
|
129
112
|
return { success: false, error: `Failed to save workbook: ${error instanceof Error ? error.message : String(error)}` };
|
|
130
113
|
}
|
|
131
114
|
}
|
|
@@ -151,18 +134,23 @@ Captures the used range and saves to the current working directory.`,
|
|
|
151
134
|
},
|
|
152
135
|
};
|
|
153
136
|
async function executeExcelScreenshot(_args) {
|
|
137
|
+
const startTime = Date.now();
|
|
138
|
+
logger.toolStart('excel_screenshot', _args);
|
|
154
139
|
try {
|
|
155
140
|
const response = await excelClient.excelScreenshot();
|
|
156
141
|
if (response.success && response.image) {
|
|
157
142
|
const filePath = await saveScreenshot(response.image, 'excel');
|
|
143
|
+
logger.toolSuccess('excel_screenshot', _args, { filePath }, Date.now() - startTime);
|
|
158
144
|
return {
|
|
159
145
|
success: true,
|
|
160
146
|
result: `Excel screenshot saved to: ${filePath}\n\nTo verify this screenshot, call read_image with file_path="${filePath}"`,
|
|
161
147
|
};
|
|
162
148
|
}
|
|
149
|
+
logger.toolError('excel_screenshot', _args, new Error(response.error || 'Failed to capture screenshot'), Date.now() - startTime);
|
|
163
150
|
return { success: false, error: response.error || 'Failed to capture screenshot' };
|
|
164
151
|
}
|
|
165
152
|
catch (error) {
|
|
153
|
+
logger.toolError('excel_screenshot', _args, error instanceof Error ? error : new Error(String(error)), Date.now() - startTime);
|
|
166
154
|
return { success: false, error: `Failed to capture screenshot: ${error instanceof Error ? error.message : String(error)}` };
|
|
167
155
|
}
|
|
168
156
|
}
|
|
@@ -188,14 +176,19 @@ const EXCEL_CLOSE_DEFINITION = {
|
|
|
188
176
|
},
|
|
189
177
|
};
|
|
190
178
|
async function executeExcelClose(args) {
|
|
179
|
+
const startTime = Date.now();
|
|
180
|
+
logger.toolStart('excel_close', args);
|
|
191
181
|
try {
|
|
192
182
|
const response = await excelClient.excelClose(args['save'] === true);
|
|
193
183
|
if (response.success) {
|
|
184
|
+
logger.toolSuccess('excel_close', args, { saved: args['save'] === true }, Date.now() - startTime);
|
|
194
185
|
return { success: true, result: `Workbook closed${args['save'] ? ' (saved)' : ''}` };
|
|
195
186
|
}
|
|
187
|
+
logger.toolError('excel_close', args, new Error(response.error || 'Failed to close workbook'), Date.now() - startTime);
|
|
196
188
|
return { success: false, error: response.error || 'Failed to close workbook' };
|
|
197
189
|
}
|
|
198
190
|
catch (error) {
|
|
191
|
+
logger.toolError('excel_close', args, error instanceof Error ? error : new Error(String(error)), Date.now() - startTime);
|
|
199
192
|
return { success: false, error: `Failed to close workbook: ${error instanceof Error ? error.message : String(error)}` };
|
|
200
193
|
}
|
|
201
194
|
}
|
|
@@ -221,14 +214,19 @@ const EXCEL_QUIT_DEFINITION = {
|
|
|
221
214
|
},
|
|
222
215
|
};
|
|
223
216
|
async function executeExcelQuit(args) {
|
|
217
|
+
const startTime = Date.now();
|
|
218
|
+
logger.toolStart('excel_quit', args);
|
|
224
219
|
try {
|
|
225
220
|
const response = await excelClient.excelQuit(args['save'] === true);
|
|
226
221
|
if (response.success) {
|
|
222
|
+
logger.toolSuccess('excel_quit', args, { saved: args['save'] === true }, Date.now() - startTime);
|
|
227
223
|
return { success: true, result: `Excel closed${args['save'] ? ' (all workbooks saved)' : ''}` };
|
|
228
224
|
}
|
|
225
|
+
logger.toolError('excel_quit', args, new Error(response.error || 'Failed to quit Excel'), Date.now() - startTime);
|
|
229
226
|
return { success: false, error: response.error || 'Failed to quit Excel' };
|
|
230
227
|
}
|
|
231
228
|
catch (error) {
|
|
229
|
+
logger.toolError('excel_quit', args, error instanceof Error ? error : new Error(String(error)), Date.now() - startTime);
|
|
232
230
|
return { success: false, error: `Failed to quit Excel: ${error instanceof Error ? error.message : String(error)}` };
|
|
233
231
|
}
|
|
234
232
|
}
|
|
@@ -239,7 +237,6 @@ export const excelQuitTool = {
|
|
|
239
237
|
description: 'Quit Microsoft Excel',
|
|
240
238
|
};
|
|
241
239
|
export const launchTools = [
|
|
242
|
-
excelLaunchTool,
|
|
243
240
|
excelCreateTool,
|
|
244
241
|
excelOpenTool,
|
|
245
242
|
excelSaveTool,
|