agentxl 1.1.0 → 1.1.3
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/README.md +89 -302
- package/bin/agentxl.js +125 -17
- package/dist/agent/prompt/folder-context.d.ts +12 -10
- package/dist/agent/prompt/folder-context.d.ts.map +1 -1
- package/dist/agent/prompt/folder-context.js +35 -214
- package/dist/agent/prompt/folder-context.js.map +1 -1
- package/dist/agent/prompt/system-prompt.d.ts +21 -0
- package/dist/agent/prompt/system-prompt.d.ts.map +1 -0
- package/dist/agent/prompt/system-prompt.js +130 -0
- package/dist/agent/prompt/system-prompt.js.map +1 -0
- package/dist/agent/session.d.ts.map +1 -1
- package/dist/agent/session.js +19 -4
- package/dist/agent/session.js.map +1 -1
- package/dist/server/routes/folder.d.ts.map +1 -1
- package/dist/server/routes/folder.js +17 -29
- package/dist/server/routes/folder.js.map +1 -1
- package/manifest/manifest-hosted.xml +107 -0
- package/package.json +7 -4
- package/scripts/enable-excel-addin.mjs +59 -0
- package/scripts/setup-and-start.cmd +59 -0
- package/taskpane/dist/assets/index-BnD8psE_.js +224 -0
- package/taskpane/dist/assets/index-BuAcDfRq.css +1 -0
- package/taskpane/dist/index.html +2 -2
- package/taskpane/dist/assets/index-B0xfFlVu.css +0 -1
- package/taskpane/dist/assets/index-BlMJx_9E.js +0 -194
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentXL system prompt — appended on top of Pi's built-in system prompt.
|
|
3
|
+
*
|
|
4
|
+
* This is the behavioral layer that makes the agent act like a
|
|
5
|
+
* document-to-Excel agent with show-your-work traceability.
|
|
6
|
+
*
|
|
7
|
+
* Pi's base prompt handles:
|
|
8
|
+
* - tool descriptions (read, bash, edit, write, custom tools)
|
|
9
|
+
* - tool usage guidelines
|
|
10
|
+
* - skills, context files, AGENTS.md
|
|
11
|
+
* - date/time, cwd
|
|
12
|
+
*
|
|
13
|
+
* This prompt adds:
|
|
14
|
+
* - AgentXL identity and workflow rules
|
|
15
|
+
* - Show-your-work traceability (not a permission gate)
|
|
16
|
+
* - Citation format and traceability rules
|
|
17
|
+
* - Excel comment API guidance (no .note)
|
|
18
|
+
* - _AgentXL_Sources audit sheet spec
|
|
19
|
+
*/
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
// Core identity + behavioral rules (set once per session via appendSystemPrompt)
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
export const AGENTXL_SYSTEM_PROMPT = `
|
|
24
|
+
# AgentXL — Document-to-Excel Agent
|
|
25
|
+
|
|
26
|
+
You are AgentXL, a document-to-Excel agent. You help users turn source
|
|
27
|
+
documents into traceable Excel workpapers. You are NOT a generic
|
|
28
|
+
spreadsheet chatbot.
|
|
29
|
+
|
|
30
|
+
## Core Principle
|
|
31
|
+
|
|
32
|
+
**Documents are the source. Excel is the destination.**
|
|
33
|
+
|
|
34
|
+
Every value you write into Excel must be grounded in evidence from the
|
|
35
|
+
user's linked document folder. If you cannot find evidence, say so.
|
|
36
|
+
Do not fabricate data.
|
|
37
|
+
|
|
38
|
+
## Show Your Work
|
|
39
|
+
|
|
40
|
+
When you write values into Excel, always show the user what you found
|
|
41
|
+
and where it came from — in your response text, not as a separate
|
|
42
|
+
permission step.
|
|
43
|
+
|
|
44
|
+
For every value you write, your response should include:
|
|
45
|
+
- The value
|
|
46
|
+
- Which source file it came from (with page or location)
|
|
47
|
+
- Whether it was directly quoted or inferred
|
|
48
|
+
|
|
49
|
+
Then write the values with citation comments and Sources entries.
|
|
50
|
+
Do NOT ask for permission before writing — just show the traceability
|
|
51
|
+
so the user can verify after the fact. The citations on the cells and
|
|
52
|
+
the _AgentXL_Sources sheet are the review mechanism, not a confirmation
|
|
53
|
+
dialog.
|
|
54
|
+
|
|
55
|
+
## Citation Format
|
|
56
|
+
|
|
57
|
+
Every value written to Excel must have:
|
|
58
|
+
|
|
59
|
+
### A. An Excel comment on the cell
|
|
60
|
+
Use \`worksheet.comments.add(cellAddress, content)\`.
|
|
61
|
+
Do NOT use \`cell.note\`, \`range.note\`, or \`.note =\` — these do not
|
|
62
|
+
work in this Office.js runtime.
|
|
63
|
+
|
|
64
|
+
Comment format:
|
|
65
|
+
\`\`\`
|
|
66
|
+
📄 Source: <filename>
|
|
67
|
+
📑 Page: <page number or location>
|
|
68
|
+
💬 "<~150 char excerpt with the value in context>"
|
|
69
|
+
🤖 Extracted by AgentXL
|
|
70
|
+
\`\`\`
|
|
71
|
+
|
|
72
|
+
For inferred values:
|
|
73
|
+
\`\`\`
|
|
74
|
+
⚠️ Inferred — no direct source citation
|
|
75
|
+
💬 Reasoning: <why you inferred this value>
|
|
76
|
+
🤖 Extracted by AgentXL
|
|
77
|
+
\`\`\`
|
|
78
|
+
|
|
79
|
+
Always delete any existing comment before adding a new one:
|
|
80
|
+
\`\`\`javascript
|
|
81
|
+
try { sheet.comments.getItemByCell(address).delete(); await context.sync(); } catch {}
|
|
82
|
+
sheet.comments.add(address, content);
|
|
83
|
+
\`\`\`
|
|
84
|
+
|
|
85
|
+
### B. A row in the _AgentXL_Sources audit sheet
|
|
86
|
+
After writing values, append citation records to \`_AgentXL_Sources\`.
|
|
87
|
+
Create the sheet if it doesn't exist (headers: Target Sheet, Target Cell,
|
|
88
|
+
Value, Source File, Page, Excerpt, Timestamp).
|
|
89
|
+
This sheet is APPEND-ONLY — never delete existing rows.
|
|
90
|
+
|
|
91
|
+
## Extraction Workflow
|
|
92
|
+
|
|
93
|
+
When extracting data from documents:
|
|
94
|
+
|
|
95
|
+
1. **Read / search the source files** — use read, grep, or bash scripts
|
|
96
|
+
to find the relevant data. For PDFs that have been pre-converted to
|
|
97
|
+
markdown, read the \`.md\` version from \`.agentxl-cache/\`.
|
|
98
|
+
|
|
99
|
+
2. **Structure the findings** — organize extracted values with their
|
|
100
|
+
source citations (file, page, excerpt).
|
|
101
|
+
|
|
102
|
+
3. **Show your work** — in your response, show what you found and where
|
|
103
|
+
each value came from. Clearly distinguish between directly-quoted
|
|
104
|
+
values and inferred values.
|
|
105
|
+
|
|
106
|
+
4. **Write to Excel with citations** — write values + comments + Sources
|
|
107
|
+
entries in a single Excel tool call when possible.
|
|
108
|
+
|
|
109
|
+
## File Access Rules
|
|
110
|
+
|
|
111
|
+
- All file paths MUST be absolute paths under the linked folder.
|
|
112
|
+
- Do NOT use relative paths or ".".
|
|
113
|
+
- For .xlsx/.xls files: use bash with the \`xlsx\` npm package (already installed).
|
|
114
|
+
- For .docx/.doc files: use bash with the \`mammoth\` npm package (already installed).
|
|
115
|
+
- For .pdf files: read the pre-converted markdown from \`.agentxl-cache/\` if available.
|
|
116
|
+
|
|
117
|
+
## Page Number Detection
|
|
118
|
+
|
|
119
|
+
- PDF markdown files use \`---\` as page separators. Count separators before the match.
|
|
120
|
+
- For XLSX: use sheet name + cell reference as the "page".
|
|
121
|
+
- For DOCX: use the nearest section heading as the "page".
|
|
122
|
+
|
|
123
|
+
## Excerpt Capture
|
|
124
|
+
|
|
125
|
+
- Find the match position in the source text.
|
|
126
|
+
- Take ~75 characters before and ~75 characters after.
|
|
127
|
+
- Trim to word boundaries.
|
|
128
|
+
- Prefix/suffix with "..." if truncated.
|
|
129
|
+
`.trim();
|
|
130
|
+
//# sourceMappingURL=system-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../../src/agent/prompt/system-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,8EAA8E;AAC9E,iFAAiF;AACjF,8EAA8E;AAE9E,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0GpC,CAAC,IAAI,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/agent/session.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAIL,WAAW,
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/agent/session.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAIL,WAAW,EAEX,aAAa,EAGb,KAAK,YAAY,EAClB,MAAM,+BAA+B,CAAC;AA6BvC,QAAA,IAAI,WAAW,aAAwC,CAAC;AACxD,QAAA,IAAI,aAAa,eAAiC,CAAC;AA6BnD;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAoDrE;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAcpE;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAIzC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAQ/C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAOnC;AAED;;;GAGG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAQlD;AAGD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/agent/session.js
CHANGED
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
import { join } from "path";
|
|
8
8
|
import { homedir } from "os";
|
|
9
9
|
import { existsSync } from "fs";
|
|
10
|
-
import { createAgentSession, createReadOnlyTools, createBashTool, AuthStorage, ModelRegistry, SessionManager, SettingsManager, } from "@mariozechner/pi-coding-agent";
|
|
10
|
+
import { createAgentSession, createReadOnlyTools, createBashTool, AuthStorage, DefaultResourceLoader, ModelRegistry, SessionManager, SettingsManager, } from "@mariozechner/pi-coding-agent";
|
|
11
11
|
import { getDefaultModel } from "./models.js";
|
|
12
12
|
import { excelTool } from "./tools/excel.js";
|
|
13
|
+
import { AGENTXL_SYSTEM_PROMPT } from "./prompt/system-prompt.js";
|
|
13
14
|
// ---------------------------------------------------------------------------
|
|
14
15
|
// Paths
|
|
15
16
|
// ---------------------------------------------------------------------------
|
|
@@ -76,16 +77,30 @@ export async function initSession(cwd) {
|
|
|
76
77
|
const readOnly = createReadOnlyTools(effectiveCwd);
|
|
77
78
|
const bash = createBashTool(effectiveCwd);
|
|
78
79
|
const tools = [...readOnly, bash];
|
|
80
|
+
const settingsManager = SettingsManager.inMemory({
|
|
81
|
+
compaction: { enabled: true },
|
|
82
|
+
});
|
|
83
|
+
// Build a ResourceLoader that appends AgentXL's behavioral rules
|
|
84
|
+
// on top of Pi's built-in system prompt (tool docs, skills, AGENTS.md).
|
|
85
|
+
const resourceLoader = new DefaultResourceLoader({
|
|
86
|
+
cwd: effectiveCwd,
|
|
87
|
+
settingsManager,
|
|
88
|
+
appendSystemPrompt: AGENTXL_SYSTEM_PROMPT,
|
|
89
|
+
noExtensions: true,
|
|
90
|
+
noSkills: true,
|
|
91
|
+
noPromptTemplates: true,
|
|
92
|
+
noThemes: true,
|
|
93
|
+
});
|
|
94
|
+
await resourceLoader.reload();
|
|
79
95
|
const { session } = await createAgentSession({
|
|
80
96
|
model,
|
|
81
97
|
cwd: effectiveCwd,
|
|
82
98
|
thinkingLevel: "medium",
|
|
83
99
|
tools, // read, grep, find, ls, bash — pointed at linked folder
|
|
84
100
|
customTools: [excelTool], // Single Excel tool — agent writes Office.js code
|
|
101
|
+
resourceLoader, // Pi base prompt + AgentXL append
|
|
85
102
|
sessionManager: SessionManager.inMemory(),
|
|
86
|
-
settingsManager
|
|
87
|
-
compaction: { enabled: true },
|
|
88
|
-
}),
|
|
103
|
+
settingsManager,
|
|
89
104
|
authStorage,
|
|
90
105
|
modelRegistry,
|
|
91
106
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/agent/session.ts"],"names":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+1 @@
|
|
|
1
|
-
{"version":3,"file":"folder.d.ts","sourceRoot":"","sources":["../../../src/server/routes/folder.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAavD,6BAA6B;AAC7B,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,GAClB,IAAI,CA6BN;AAED,4BAA4B;AAC5B,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,IAAI,CAAC,CAoBf;AAED,8BAA8B;AAC9B,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,IAAI,CAAC,CA0Ef;AAED,4BAA4B;AAC5B,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,GAClB,IAAI,CAsCN;AAED,+BAA+B;AAC/B,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"folder.d.ts","sourceRoot":"","sources":["../../../src/server/routes/folder.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAavD,6BAA6B;AAC7B,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,GAClB,IAAI,CA6BN;AAED,4BAA4B;AAC5B,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,IAAI,CAAC,CAoBf;AAED,8BAA8B;AAC9B,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,IAAI,CAAC,CA0Ef;AAED,4BAA4B;AAC5B,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,GAClB,IAAI,CAsCN;AAED,+BAA+B;AAC/B,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,IAAI,CAAC,CAkDf"}
|
|
@@ -81,17 +81,16 @@ export async function handleFolderSelect(req, res) {
|
|
|
81
81
|
host: typeof b.host === "string" ? b.host : null,
|
|
82
82
|
source: typeof b.source === "string" ? b.source : null,
|
|
83
83
|
});
|
|
84
|
-
// Auto-scan the folder on link/update
|
|
84
|
+
// Auto-scan the folder on link/update (fast — just reads directory)
|
|
85
85
|
let inventory = null;
|
|
86
|
-
let conversion = null;
|
|
87
86
|
try {
|
|
88
87
|
inventory = scanAndSaveInventory(workbookId, link.folderPath);
|
|
89
|
-
// Pre-convert PDFs to Markdown (non-blocking for response)
|
|
90
|
-
conversion = await convertDocuments(inventory);
|
|
91
88
|
}
|
|
92
89
|
catch {
|
|
93
|
-
// Scan
|
|
90
|
+
// Scan failure is non-fatal — folder is still linked
|
|
94
91
|
}
|
|
92
|
+
// Respond immediately so the user isn't blocked.
|
|
93
|
+
// PDF conversion runs in the background after the response.
|
|
95
94
|
sendJson(res, 200, {
|
|
96
95
|
workbookId,
|
|
97
96
|
linked: true,
|
|
@@ -103,15 +102,15 @@ export async function handleFolderSelect(req, res) {
|
|
|
103
102
|
supportedFiles: inventory.supportedFiles,
|
|
104
103
|
}
|
|
105
104
|
: {}),
|
|
106
|
-
...(conversion
|
|
107
|
-
? {
|
|
108
|
-
pdfConverted: conversion.converted,
|
|
109
|
-
pdfOcrConverted: conversion.ocrConverted,
|
|
110
|
-
pdfCached: conversion.cached,
|
|
111
|
-
pdfFailed: conversion.failed,
|
|
112
|
-
}
|
|
113
|
-
: {}),
|
|
114
105
|
});
|
|
106
|
+
// Fire-and-forget: convert PDFs to markdown in the background.
|
|
107
|
+
// The agent reads from .agentxl-cache/ at prompt time, so conversions
|
|
108
|
+
// that finish after this response are still picked up.
|
|
109
|
+
if (inventory) {
|
|
110
|
+
convertDocuments(inventory).catch((err) => {
|
|
111
|
+
console.error("[folder] background PDF conversion error:", err);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
115
114
|
}
|
|
116
115
|
catch (error) {
|
|
117
116
|
sendError(res, 400, error instanceof Error ? error.message : "Failed to save folder mapping");
|
|
@@ -165,28 +164,17 @@ export async function handleFolderRefresh(req, res) {
|
|
|
165
164
|
}
|
|
166
165
|
try {
|
|
167
166
|
const inventory = scanAndSaveInventory(workbookId, link.folderPath);
|
|
168
|
-
//
|
|
169
|
-
let conversion = null;
|
|
170
|
-
try {
|
|
171
|
-
conversion = await convertDocuments(inventory);
|
|
172
|
-
}
|
|
173
|
-
catch {
|
|
174
|
-
// Conversion failure is non-fatal
|
|
175
|
-
}
|
|
167
|
+
// Respond immediately with the scan results
|
|
176
168
|
sendJson(res, 200, {
|
|
177
169
|
workbookId,
|
|
178
170
|
folderPath: inventory.folderPath,
|
|
179
171
|
scannedAt: inventory.scannedAt,
|
|
180
172
|
totalFiles: inventory.totalFiles,
|
|
181
173
|
supportedFiles: inventory.supportedFiles,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
pdfCached: conversion.cached,
|
|
187
|
-
pdfFailed: conversion.failed,
|
|
188
|
-
}
|
|
189
|
-
: {}),
|
|
174
|
+
});
|
|
175
|
+
// Fire-and-forget: convert PDFs in the background
|
|
176
|
+
convertDocuments(inventory).catch((err) => {
|
|
177
|
+
console.error("[folder] background PDF conversion error:", err);
|
|
190
178
|
});
|
|
191
179
|
}
|
|
192
180
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"folder.js","sourceRoot":"","sources":["../../../src/server/routes/folder.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,QAAQ,E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
All API calls go to https://localhost:3001 (the local AgentXL server).
|
|
7
|
+
|
|
8
|
+
For local development, use manifest.xml instead (points to localhost:3001).
|
|
9
|
+
-->
|
|
10
|
+
<OfficeApp
|
|
11
|
+
xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
|
|
12
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
13
|
+
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
|
|
14
|
+
xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
|
|
15
|
+
xsi:type="TaskPaneApp">
|
|
16
|
+
|
|
17
|
+
<Id>b2c3d4e5-f6a7-8901-bcde-f12345678901</Id>
|
|
18
|
+
<Version>1.1.2</Version>
|
|
19
|
+
<ProviderName>DeltaXY</ProviderName>
|
|
20
|
+
<DefaultLocale>en-US</DefaultLocale>
|
|
21
|
+
<DisplayName DefaultValue="AgentXL" />
|
|
22
|
+
<Description DefaultValue="Turn source documents into traceable Excel workpapers. Local-first AI agent for audit, diligence, and evidence-heavy workflows." />
|
|
23
|
+
|
|
24
|
+
<!-- Icons MUST come before SupportUrl per XML schema -->
|
|
25
|
+
<IconUrl DefaultValue="https://satish860.github.io/agentxl/assets/icon-32.png" />
|
|
26
|
+
<HighResolutionIconUrl DefaultValue="https://satish860.github.io/agentxl/assets/icon-64.png" />
|
|
27
|
+
|
|
28
|
+
<SupportUrl DefaultValue="https://github.com/satish860/agentxl/issues" />
|
|
29
|
+
|
|
30
|
+
<!-- Allow the taskpane to call the local AgentXL server -->
|
|
31
|
+
<AppDomains>
|
|
32
|
+
<AppDomain>https://satish860.github.io</AppDomain>
|
|
33
|
+
</AppDomains>
|
|
34
|
+
|
|
35
|
+
<Hosts>
|
|
36
|
+
<Host Name="Workbook" />
|
|
37
|
+
</Hosts>
|
|
38
|
+
|
|
39
|
+
<DefaultSettings>
|
|
40
|
+
<SourceLocation DefaultValue="https://satish860.github.io/agentxl/taskpane/" />
|
|
41
|
+
</DefaultSettings>
|
|
42
|
+
<Permissions>ReadWriteDocument</Permissions>
|
|
43
|
+
|
|
44
|
+
<VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
|
|
45
|
+
<Hosts>
|
|
46
|
+
<Host xsi:type="Workbook">
|
|
47
|
+
<DesktopFormFactor>
|
|
48
|
+
<GetStarted>
|
|
49
|
+
<Title resid="getStartedTitle" />
|
|
50
|
+
<Description resid="getStartedDescription" />
|
|
51
|
+
<LearnMoreUrl resid="learnMoreUrl" />
|
|
52
|
+
</GetStarted>
|
|
53
|
+
|
|
54
|
+
<ExtensionPoint xsi:type="PrimaryCommandSurface">
|
|
55
|
+
<OfficeTab id="TabHome">
|
|
56
|
+
<Group id="AgentXLGroup">
|
|
57
|
+
<Label resid="groupLabel" />
|
|
58
|
+
<Icon>
|
|
59
|
+
<bt:Image size="16" resid="icon16" />
|
|
60
|
+
<bt:Image size="32" resid="icon32" />
|
|
61
|
+
<bt:Image size="80" resid="icon80" />
|
|
62
|
+
</Icon>
|
|
63
|
+
<Control xsi:type="Button" id="AgentXLButton">
|
|
64
|
+
<Label resid="buttonLabel" />
|
|
65
|
+
<Supertip>
|
|
66
|
+
<Title resid="buttonLabel" />
|
|
67
|
+
<Description resid="buttonTooltip" />
|
|
68
|
+
</Supertip>
|
|
69
|
+
<Icon>
|
|
70
|
+
<bt:Image size="16" resid="icon16" />
|
|
71
|
+
<bt:Image size="32" resid="icon32" />
|
|
72
|
+
<bt:Image size="80" resid="icon80" />
|
|
73
|
+
</Icon>
|
|
74
|
+
<Action xsi:type="ShowTaskpane">
|
|
75
|
+
<TaskpaneId>AgentXLPane</TaskpaneId>
|
|
76
|
+
<SourceLocation resid="taskpaneUrl" />
|
|
77
|
+
</Action>
|
|
78
|
+
</Control>
|
|
79
|
+
</Group>
|
|
80
|
+
</OfficeTab>
|
|
81
|
+
</ExtensionPoint>
|
|
82
|
+
</DesktopFormFactor>
|
|
83
|
+
</Host>
|
|
84
|
+
</Hosts>
|
|
85
|
+
|
|
86
|
+
<Resources>
|
|
87
|
+
<bt:Images>
|
|
88
|
+
<bt:Image id="icon16" DefaultValue="https://satish860.github.io/agentxl/assets/icon-16.png" />
|
|
89
|
+
<bt:Image id="icon32" DefaultValue="https://satish860.github.io/agentxl/assets/icon-32.png" />
|
|
90
|
+
<bt:Image id="icon80" DefaultValue="https://satish860.github.io/agentxl/assets/icon-80.png" />
|
|
91
|
+
</bt:Images>
|
|
92
|
+
<bt:Urls>
|
|
93
|
+
<bt:Url id="taskpaneUrl" DefaultValue="https://satish860.github.io/agentxl/taskpane/" />
|
|
94
|
+
<bt:Url id="learnMoreUrl" DefaultValue="https://github.com/satish860/agentxl" />
|
|
95
|
+
</bt:Urls>
|
|
96
|
+
<bt:ShortStrings>
|
|
97
|
+
<bt:String id="groupLabel" DefaultValue="AgentXL" />
|
|
98
|
+
<bt:String id="buttonLabel" DefaultValue="AgentXL" />
|
|
99
|
+
<bt:String id="getStartedTitle" DefaultValue="AgentXL is ready!" />
|
|
100
|
+
</bt:ShortStrings>
|
|
101
|
+
<bt:LongStrings>
|
|
102
|
+
<bt:String id="buttonTooltip" DefaultValue="Open AgentXL — AI agent for document-to-Excel workflows" />
|
|
103
|
+
<bt:String id="getStartedDescription" DefaultValue="Click the AgentXL button on the Home tab. Make sure the local AgentXL server is running." />
|
|
104
|
+
</bt:LongStrings>
|
|
105
|
+
</Resources>
|
|
106
|
+
</VersionOverrides>
|
|
107
|
+
</OfficeApp>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentxl",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Local-first document-to-Excel agent for traceable workpapers and evidence-heavy workflows",
|
|
5
5
|
"author": "DeltaXY <hello@deltaxy.ai>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,6 +33,8 @@
|
|
|
33
33
|
"files": [
|
|
34
34
|
"bin/",
|
|
35
35
|
"dist/",
|
|
36
|
+
"scripts/enable-excel-addin.mjs",
|
|
37
|
+
"scripts/setup-and-start.cmd",
|
|
36
38
|
"taskpane/dist/",
|
|
37
39
|
"manifest/",
|
|
38
40
|
"package.json",
|
|
@@ -43,11 +45,10 @@
|
|
|
43
45
|
"build": "tsc && npm run build:taskpane",
|
|
44
46
|
"build:server": "tsc",
|
|
45
47
|
"build:taskpane": "cd taskpane && npx vite build",
|
|
48
|
+
"build:taskpane:hosted": "cd taskpane && cross-env VITE_BASE=/agentxl/taskpane/ npx vite build",
|
|
46
49
|
"build:folder-picker:win": "dotnet publish ./tools/folder-picker-win/agentxl-folder-picker.csproj -c Release -r win-x64 -p:PublishSingleFile=true --self-contained false -o ./bin",
|
|
47
|
-
"prepare:
|
|
48
|
-
"build:installer:win": "powershell -ExecutionPolicy Bypass -File ./scripts/build-installer-win.ps1",
|
|
50
|
+
"prepare:release:win": "npm run build && node ./scripts/prepare-release-win.mjs",
|
|
49
51
|
"release:check": "npm test && npm run build && npm pack",
|
|
50
|
-
"release:check:win": "powershell -ExecutionPolicy Bypass -File ./scripts/release-check-win.ps1",
|
|
51
52
|
"release:publish:npm": "npm publish",
|
|
52
53
|
"dev:taskpane": "cd taskpane && npx vite dev",
|
|
53
54
|
"start": "node bin/agentxl.js start",
|
|
@@ -67,7 +68,9 @@
|
|
|
67
68
|
"dotenv": "^17.3.1",
|
|
68
69
|
"mammoth": "^1.11.0",
|
|
69
70
|
"office-addin-dev-certs": "^2.0.6",
|
|
71
|
+
"office-addin-dev-settings": "^3.0.6",
|
|
70
72
|
"pdf-parse": "^2.4.5",
|
|
73
|
+
"semver": "^7.7.4",
|
|
71
74
|
"xlsx": "^0.18.5"
|
|
72
75
|
},
|
|
73
76
|
"devDependencies": {
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { existsSync } from "fs";
|
|
2
|
+
import { resolve } from "path";
|
|
3
|
+
import * as devCerts from "office-addin-dev-certs";
|
|
4
|
+
import * as devSettings from "office-addin-dev-settings";
|
|
5
|
+
import * as manifestLib from "office-addin-manifest";
|
|
6
|
+
|
|
7
|
+
function log(message) {
|
|
8
|
+
console.log(`[enable-excel-addin] ${message}`);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function fail(message) {
|
|
12
|
+
console.error(`[enable-excel-addin] ${message}`);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const rawManifestPath = process.argv[2];
|
|
17
|
+
if (!rawManifestPath) {
|
|
18
|
+
fail("Missing manifest path argument.");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const manifestPath = resolve(rawManifestPath);
|
|
22
|
+
if (!existsSync(manifestPath)) {
|
|
23
|
+
fail(`Manifest not found: ${manifestPath}`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const openExcel = process.argv.includes("--open-excel");
|
|
27
|
+
const machineCert = process.argv.includes("--machine-cert");
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
log(`Ensuring Office localhost certificate is trusted (${machineCert ? "machine" : "user"} scope)...`);
|
|
31
|
+
await devCerts.ensureCertificatesAreInstalled(undefined, undefined, machineCert);
|
|
32
|
+
} catch (error) {
|
|
33
|
+
log(`Certificate setup warning: ${error instanceof Error ? error.message : String(error)}`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
try {
|
|
37
|
+
log("Registering AgentXL with Office developer settings...");
|
|
38
|
+
await devSettings.registerAddIn(manifestPath);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
fail(`Could not register add-in: ${error instanceof Error ? error.message : String(error)}`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
try {
|
|
44
|
+
log("Ensuring Office loopback access for localhost...");
|
|
45
|
+
await devSettings.ensureLoopbackIsEnabled(manifestPath, false);
|
|
46
|
+
} catch (error) {
|
|
47
|
+
log(`Loopback setup warning: ${error instanceof Error ? error.message : String(error)}`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (openExcel) {
|
|
51
|
+
try {
|
|
52
|
+
log("Opening Excel with AgentXL sideloaded...");
|
|
53
|
+
await devSettings.sideloadAddIn(manifestPath, manifestLib.OfficeApp.Excel, false, devSettings.AppType.Desktop);
|
|
54
|
+
} catch (error) {
|
|
55
|
+
fail(`Could not open Excel with AgentXL: ${error instanceof Error ? error.message : String(error)}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
log("AgentXL is ready for Excel.");
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
title AgentXL Setup
|
|
3
|
+
echo.
|
|
4
|
+
echo ┌──────────────────────────────────────┐
|
|
5
|
+
echo │ AgentXL Quick Setup │
|
|
6
|
+
echo └──────────────────────────────────────┘
|
|
7
|
+
echo.
|
|
8
|
+
|
|
9
|
+
:: ── Step 1: Check Node.js ─────────────────────────────────────────────
|
|
10
|
+
where node >nul 2>nul
|
|
11
|
+
if %ERRORLEVEL% neq 0 (
|
|
12
|
+
echo ❌ Node.js not found. Install Node.js 20+ from https://nodejs.org
|
|
13
|
+
echo.
|
|
14
|
+
pause
|
|
15
|
+
exit /b 1
|
|
16
|
+
)
|
|
17
|
+
for /f "tokens=*" %%i in ('node -v') do set NODE_VER=%%i
|
|
18
|
+
echo ✅ Node.js %NODE_VER%
|
|
19
|
+
|
|
20
|
+
:: ── Step 2: Install AgentXL ───────────────────────────────────────────
|
|
21
|
+
echo.
|
|
22
|
+
echo 📦 Installing AgentXL...
|
|
23
|
+
call npm install -g agentxl
|
|
24
|
+
if %ERRORLEVEL% neq 0 (
|
|
25
|
+
echo ❌ npm install failed
|
|
26
|
+
pause
|
|
27
|
+
exit /b 1
|
|
28
|
+
)
|
|
29
|
+
echo ✅ AgentXL installed
|
|
30
|
+
|
|
31
|
+
:: ── Step 3: Find manifest path ────────────────────────────────────────
|
|
32
|
+
for /f "tokens=*" %%i in ('npm root -g') do set NPM_GLOBAL=%%i
|
|
33
|
+
set MANIFEST=%NPM_GLOBAL%\agentxl\manifest\manifest.xml
|
|
34
|
+
if not exist "%MANIFEST%" (
|
|
35
|
+
echo ❌ Could not find manifest at %MANIFEST%
|
|
36
|
+
pause
|
|
37
|
+
exit /b 1
|
|
38
|
+
)
|
|
39
|
+
echo ✅ Manifest: %MANIFEST%
|
|
40
|
+
|
|
41
|
+
:: ── Step 4: Register add-in with Excel ────────────────────────────────
|
|
42
|
+
echo.
|
|
43
|
+
echo 📎 Registering AgentXL with Excel...
|
|
44
|
+
set ENABLE_SCRIPT=%NPM_GLOBAL%\agentxl\scripts\enable-excel-addin.mjs
|
|
45
|
+
if exist "%ENABLE_SCRIPT%" (
|
|
46
|
+
node "%ENABLE_SCRIPT%" "%MANIFEST%"
|
|
47
|
+
echo ✅ Add-in registered
|
|
48
|
+
) else (
|
|
49
|
+
echo ⚠️ enable-excel-addin.mjs not found, skipping auto-registration
|
|
50
|
+
echo You can manually add the manifest folder to Excel Trust Center:
|
|
51
|
+
echo %NPM_GLOBAL%\agentxl\manifest
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
:: ── Step 5: Start server ──────────────────────────────────────────────
|
|
55
|
+
echo.
|
|
56
|
+
echo 🚀 Starting AgentXL server...
|
|
57
|
+
echo ─────────────────────────────────────────
|
|
58
|
+
echo.
|
|
59
|
+
call agentxl start
|