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/bin/agentxl.js CHANGED
@@ -226,6 +226,7 @@ AgentXL v${VERSION} — AI agent for Microsoft Excel
226
226
 
227
227
  Usage:
228
228
  agentxl start [options] Start the AgentXL server
229
+ agentxl install Register the add-in with Excel (one-time)
229
230
  agentxl login Set up or change API credentials
230
231
  agentxl --version Print version
231
232
  agentxl --help Show this help
@@ -235,7 +236,8 @@ Options:
235
236
  --verbose Log all HTTP requests
236
237
 
237
238
  Examples:
238
- agentxl start
239
+ agentxl install # one-time: register with Excel
240
+ agentxl start # run the server
239
241
  agentxl start --port 3002
240
242
  agentxl login
241
243
  `);
@@ -329,30 +331,51 @@ async function start() {
329
331
  step("ℹ️", `Folder picker: ${pickerLabel}`);
330
332
  }
331
333
 
332
- // ── Post-start guidance ────────────────────────────────────────────────
334
+ // ── Step 7: Auto-register add-in with Excel (first run) ─────────────
333
335
  const manifestPath = resolve(__dirname, "..", "manifest", "manifest.xml");
334
- const manifestExists = existsSync(manifestPath);
335
336
 
337
+ if (existsSync(manifestPath)) {
338
+ let alreadyRegistered = false;
339
+ try {
340
+ const devSettings = await import("office-addin-dev-settings");
341
+ const registered = await devSettings.getRegisteredAddIns();
342
+ alreadyRegistered = registered.some(a => a.manifestPath === manifestPath);
343
+ } catch (_) {}
344
+
345
+ if (!alreadyRegistered) {
346
+ step("⏳", "First run — registering AgentXL with Excel...");
347
+ try {
348
+ const devSettings = await import("office-addin-dev-settings");
349
+ await devSettings.registerAddIn(manifestPath);
350
+ step("✅", "Add-in registered with Excel");
351
+ } catch (err) {
352
+ step("⚠️", `Auto-registration failed: ${err.message}`);
353
+ step(" ", "Run 'agentxl install' manually, or add the manifest folder to Excel Trust Center:");
354
+ step(" ", ` ${dirname(manifestPath)}`);
355
+ }
356
+
357
+ try {
358
+ const devSettings = await import("office-addin-dev-settings");
359
+ await devSettings.ensureLoopbackIsEnabled(manifestPath, false);
360
+ } catch (_) {}
361
+ } else {
362
+ step("✅", "Excel add-in registered");
363
+ }
364
+ }
365
+
366
+ // ── Post-start guidance ────────────────────────────────────────────────
336
367
  console.log(`
337
368
  ─────────────────────────────────────────────────
338
- All systems go. Here's what to do next:
369
+ All systems go!
339
370
  ─────────────────────────────────────────────────
340
371
 
341
- 🌐 Test in browser (confirm everything works):
342
- https://localhost:${port}/taskpane/
372
+ 📎 Open Excel AgentXL is on the Home ribbon
373
+ (If you don't see it: Insert → My Add-ins → SHARED FOLDER → AgentXL)
343
374
 
344
- 📎 Load in Excel (one-time setup):
345
- 1. Excel → File → Options → Trust Center → Trust Center Settings
346
- 2. Trusted Add-in Catalogs → add path: ${manifestExists ? dirname(manifestPath) : "[manifest folder]"}
347
- 3. Check "Show in Menu" → OK → OK
348
- 4. Restart Excel
349
- 5. Insert → My Add-ins → SHARED FOLDER → AgentXL → Add
350
-
351
- After setup, just run 'agentxl start' and click
352
- AgentXL on the Home ribbon. No re-sideloading needed.
375
+ 🌐 Or test in browser first:
376
+ https://localhost:${port}/taskpane/
353
377
 
354
- 💬 Try your first message:
355
- "What can you help me with in this workbook?"
378
+ 💬 Try: "What can you help me with in this workbook?"
356
379
  `);
357
380
 
358
381
  // ── Graceful shutdown ──────────────────────────────────────────────────
@@ -370,6 +393,86 @@ async function start() {
370
393
  process.on("SIGTERM", shutdown);
371
394
  }
372
395
 
396
+ async function install() {
397
+ console.log(`
398
+ ┌──────────────────────────────────────┐
399
+ │ AgentXL Excel Registration │
400
+ └──────────────────────────────────────┘
401
+ `);
402
+
403
+ const manifestPath = resolve(__dirname, "..", "manifest", "manifest.xml");
404
+ if (!existsSync(manifestPath)) {
405
+ step("❌", `Manifest not found: ${manifestPath}`);
406
+ process.exit(1);
407
+ }
408
+
409
+ // ── Step 1: HTTPS certificates ─────────────────────────────────────────
410
+ try {
411
+ step("⏳", "Ensuring HTTPS certificates are trusted...");
412
+ const devCerts = await import("office-addin-dev-certs");
413
+ await devCerts.ensureCertificatesAreInstalled();
414
+ step("✅", "HTTPS certificate trusted");
415
+ } catch (err) {
416
+ step("⚠️", `Certificate setup: ${err.message}`);
417
+ }
418
+
419
+ // ── Step 2: Register add-in ────────────────────────────────────────────
420
+ try {
421
+ step("⏳", "Registering AgentXL with Excel...");
422
+ const devSettings = await import("office-addin-dev-settings");
423
+ await devSettings.registerAddIn(manifestPath);
424
+ step("✅", "Add-in registered with Excel");
425
+ } catch (err) {
426
+ step("❌", `Registration failed: ${err.message}`);
427
+ console.log(`
428
+ Fallback: manually add this folder to Excel's Trusted Add-in Catalogs:
429
+ ${dirname(manifestPath)}
430
+
431
+ Steps:
432
+ 1. Excel → File → Options → Trust Center → Trust Center Settings
433
+ 2. Trusted Add-in Catalogs → paste the path above
434
+ 3. Check "Show in Menu" → OK → OK
435
+ 4. Restart Excel
436
+ 5. Insert → My Add-ins → SHARED FOLDER → AgentXL → Add
437
+ `);
438
+ process.exit(1);
439
+ }
440
+
441
+ // ── Step 3: Enable loopback ────────────────────────────────────────────
442
+ try {
443
+ const devSettings = await import("office-addin-dev-settings");
444
+ await devSettings.ensureLoopbackIsEnabled(manifestPath, false);
445
+ step("✅", "Localhost loopback enabled");
446
+ } catch (err) {
447
+ step("⚠️", `Loopback: ${err.message}`);
448
+ }
449
+
450
+ console.log(`
451
+ ─────────────────────────────────────────────────
452
+ Done! AgentXL is registered with Excel.
453
+ ─────────────────────────────────────────────────
454
+
455
+ Next steps:
456
+ 1. Run: agentxl start
457
+ 2. Open Excel → AgentXL appears on the Home ribbon
458
+
459
+ To open Excel with AgentXL right now:
460
+ agentxl install --open
461
+ `);
462
+
463
+ // Optionally open Excel
464
+ if (hasFlag("open")) {
465
+ try {
466
+ const devSettings = await import("office-addin-dev-settings");
467
+ const manifestLib = await import("office-addin-manifest");
468
+ step("⏳", "Opening Excel with AgentXL...");
469
+ await devSettings.sideloadAddIn(manifestPath, manifestLib.OfficeApp.Excel, false, devSettings.AppType.Desktop);
470
+ } catch (err) {
471
+ step("⚠️", `Could not open Excel: ${err.message}`);
472
+ }
473
+ }
474
+ }
475
+
373
476
  async function login() {
374
477
  console.log("");
375
478
  const authed = await runAuthFlow();
@@ -398,6 +501,11 @@ if (command === "start") {
398
501
  console.error(`\n ❌ ${err.message || err}\n`);
399
502
  process.exit(1);
400
503
  });
504
+ } else if (command === "install") {
505
+ install().catch((err) => {
506
+ console.error(`\n ❌ ${err.message || err}\n`);
507
+ process.exit(1);
508
+ });
401
509
  } else if (command === "login") {
402
510
  login().catch((err) => {
403
511
  console.error(`\n ❌ ${err.message || err}\n`);
@@ -1,14 +1,16 @@
1
1
  /**
2
- * Build the folder context block prepended to every agent message.
2
+ * Build the per-message folder context block.
3
3
  *
4
- * This is the primary mechanism for grounding the agent:
5
- * - Tells the agent what files are available
6
- * - Teaches absolute-path discipline
7
- * - Provides file listing and usage examples
8
- * - Explains document handling strategies (PDF→MD, XLSX/DOCX via code)
4
+ * This block is prepended to every user message and tells the agent:
5
+ * - Which folder is linked
6
+ * - What files are available (with sizes)
7
+ * - Which PDFs have been pre-converted to markdown
8
+ * - How to access XLSX / DOCX files (binary → code)
9
+ * - How to access text / CSV / MD files (read tool)
9
10
  *
10
- * Extracted as its own module because this prompt will be tuned
11
- * frequently as document behavior improves.
11
+ * Behavioral rules (citation format, review-before-write, extraction
12
+ * workflow) live in the system prompt — see ./system-prompt.ts.
13
+ * This module is file-inventory only.
12
14
  */
13
15
  import type { FolderInventory } from "../../server/folder-scanner.js";
14
16
  /** Max supported files to list individually in context. */
@@ -17,8 +19,8 @@ export declare const MAX_FILES_IN_CONTEXT = 50;
17
19
  export declare function formatFileSize(bytes: number): string;
18
20
  /**
19
21
  * Build a folder context block to prepend to the agent message.
20
- * Gives the agent awareness of what files are available and
21
- * how to access them.
22
+ * Contains only the file inventory and access instructions no
23
+ * behavioral rules (those are in the system prompt).
22
24
  */
23
25
  export declare function buildFolderContext(folderPath: string, inventory: FolderInventory): string;
24
26
  //# sourceMappingURL=folder-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"folder-context.d.ts","sourceRoot":"","sources":["../../../src/agent/prompt/folder-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGtE,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,mDAAmD;AACnD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIpD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,eAAe,GACzB,MAAM,CAgSR"}
1
+ {"version":3,"file":"folder-context.d.ts","sourceRoot":"","sources":["../../../src/agent/prompt/folder-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGtE,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,mDAAmD;AACnD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIpD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,eAAe,GACzB,MAAM,CA4GR"}
@@ -1,14 +1,16 @@
1
1
  /**
2
- * Build the folder context block prepended to every agent message.
2
+ * Build the per-message folder context block.
3
3
  *
4
- * This is the primary mechanism for grounding the agent:
5
- * - Tells the agent what files are available
6
- * - Teaches absolute-path discipline
7
- * - Provides file listing and usage examples
8
- * - Explains document handling strategies (PDF→MD, XLSX/DOCX via code)
4
+ * This block is prepended to every user message and tells the agent:
5
+ * - Which folder is linked
6
+ * - What files are available (with sizes)
7
+ * - Which PDFs have been pre-converted to markdown
8
+ * - How to access XLSX / DOCX files (binary → code)
9
+ * - How to access text / CSV / MD files (read tool)
9
10
  *
10
- * Extracted as its own module because this prompt will be tuned
11
- * frequently as document behavior improves.
11
+ * Behavioral rules (citation format, review-before-write, extraction
12
+ * workflow) live in the system prompt — see ./system-prompt.ts.
13
+ * This module is file-inventory only.
12
14
  */
13
15
  import { listConvertedFiles } from "../../server/document-converter.js";
14
16
  /** Max supported files to list individually in context. */
@@ -23,27 +25,23 @@ export function formatFileSize(bytes) {
23
25
  }
24
26
  /**
25
27
  * Build a folder context block to prepend to the agent message.
26
- * Gives the agent awareness of what files are available and
27
- * how to access them.
28
+ * Contains only the file inventory and access instructions no
29
+ * behavioral rules (those are in the system prompt).
28
30
  */
29
31
  export function buildFolderContext(folderPath, inventory) {
30
32
  const lines = [];
31
- lines.push("[AgentXL Context]");
33
+ lines.push("[AgentXL — Linked Folder]");
32
34
  lines.push("");
33
- lines.push("You are AgentXL, a document-to-Excel agent. The user's source documents are in the linked folder below.");
34
- lines.push("Ground every answer in these files. Cite the source file when you reference a value.");
35
- lines.push("If the folder does not contain enough evidence, say so. Do not fabricate data.");
36
- lines.push("");
37
- lines.push("IMPORTANT: All file operations MUST use absolute paths under the linked folder.");
38
- lines.push(`The linked folder is: ${folderPath}`);
39
- lines.push("Do NOT use relative paths. Do NOT read files from the current working directory.");
40
- lines.push(`When the user asks about files, they mean files in: ${folderPath}`);
35
+ lines.push(`Folder: ${folderPath}`);
41
36
  lines.push(`${inventory.supportedFiles} supported file${inventory.supportedFiles !== 1 ? "s" : ""}, ${inventory.totalFiles} total`);
37
+ lines.push("");
38
+ lines.push("IMPORTANT: All file paths MUST be absolute paths under this folder.");
39
+ // ── Supported files ────────────────────────────────────────────────────
42
40
  const supported = inventory.files.filter((f) => f.supported);
43
41
  const unsupported = inventory.files.filter((f) => !f.supported);
44
42
  if (supported.length > 0) {
45
43
  lines.push("");
46
- lines.push("Supported files (you can read these):");
44
+ lines.push("Supported files:");
47
45
  const shown = supported.slice(0, MAX_FILES_IN_CONTEXT);
48
46
  for (const f of shown) {
49
47
  lines.push(`- ${f.relativePath} (${formatFileSize(f.sizeBytes)})`);
@@ -63,222 +61,45 @@ export function buildFolderContext(folderPath, inventory) {
63
61
  : "";
64
62
  lines.push(`Unsupported files (cannot read): ${unsupportedNames}${suffix}`);
65
63
  }
66
- // -----------------------------------------------------------------------
67
- // Document handling instructions
68
- // -----------------------------------------------------------------------
69
- // PDF conversions
64
+ // ── PDF conversions ────────────────────────────────────────────────────
70
65
  const conversions = listConvertedFiles(inventory);
71
66
  if (conversions.length > 0) {
72
67
  lines.push("");
73
68
  lines.push("📄 PDF files (pre-converted to Markdown):");
74
- lines.push("PDFs have been converted to readable Markdown. Read the .md version, NOT the raw PDF.");
69
+ lines.push("Read the .md version, NOT the raw PDF.");
75
70
  for (const c of conversions) {
76
71
  lines.push(`- ${c.source} → READ: "${folderPath}/${c.converted}"`);
77
72
  }
78
73
  }
79
- // XLSX handling
74
+ // ── XLSX handling ──────────────────────────────────────────────────────
80
75
  const xlsxFiles = supported.filter((f) => f.extension === ".xlsx" || f.extension === ".xls");
81
76
  if (xlsxFiles.length > 0) {
82
77
  lines.push("");
83
- lines.push("📊 Excel files (use code to extract):");
84
- lines.push("Do NOT try to read .xlsx/.xls with the read tool — they are binary.");
85
- lines.push("Write a Node.js script via bash that uses the `xlsx` npm package (already installed).");
86
- lines.push("Example:");
78
+ lines.push("📊 Excel files do NOT read with the read tool (binary).");
79
+ lines.push("Use bash + xlsx npm package:");
87
80
  lines.push("```");
88
- lines.push(`bash: node -e "const XLSX = require('xlsx'); const wb = XLSX.readFile('${xlsxFiles[0].absolutePath}'); const ws = wb.Sheets[wb.SheetNames[0]]; console.log(JSON.stringify(XLSX.utils.sheet_to_json(ws), null, 2));"`);
81
+ lines.push(`node -e "const XLSX = require('xlsx'); const wb = XLSX.readFile('${xlsxFiles[0].absolutePath}'); const ws = wb.Sheets[wb.SheetNames[0]]; console.log(JSON.stringify(XLSX.utils.sheet_to_json(ws), null, 2));"`);
89
82
  lines.push("```");
90
83
  }
91
- // DOCX handling
84
+ // ── DOCX handling ──────────────────────────────────────────────────────
92
85
  const docxFiles = supported.filter((f) => f.extension === ".docx" || f.extension === ".doc");
93
86
  if (docxFiles.length > 0) {
94
87
  lines.push("");
95
- lines.push("📝 Word files (use code to extract):");
96
- lines.push("Do NOT try to read .docx/.doc with the read tool — they are binary.");
97
- lines.push("Write a Node.js script via bash that uses the `mammoth` npm package (already installed).");
98
- lines.push("Example:");
88
+ lines.push("📝 Word files do NOT read with the read tool (binary).");
89
+ lines.push("Use bash + mammoth npm package:");
99
90
  lines.push("```");
100
- lines.push(`bash: node -e "const mammoth = require('mammoth'); mammoth.convertToMarkdown({path: '${docxFiles[0].absolutePath}'}).then(r => console.log(r.value));"`);
91
+ lines.push(`node -e "const mammoth = require('mammoth'); mammoth.convertToMarkdown({path: '${docxFiles[0].absolutePath}'}).then(r => console.log(r.value));"`);
101
92
  lines.push("```");
102
93
  }
103
- // -----------------------------------------------------------------------
104
- // EXTRACTION + CITATION WORKFLOW (mandatory)
105
- // -----------------------------------------------------------------------
106
- lines.push("");
107
- lines.push("═══════════════════════════════════════════════════════════════");
108
- lines.push("⚡ EXTRACTION WORKFLOW — WRITE CODE + CITE EVERY VALUE");
109
- lines.push("═══════════════════════════════════════════════════════════════");
110
- lines.push("");
111
- lines.push("When extracting data from documents to write to Excel, you MUST follow");
112
- lines.push("this 3-step workflow. This is NOT optional — every value needs a citation.");
113
- lines.push("");
114
- lines.push("STEP 1: EXTRACT WITH CITATIONS (bash script)");
115
- lines.push("─────────────────────────────────────────────");
116
- lines.push("Write a Node.js script that reads the source files and returns structured");
117
- lines.push("JSON with BOTH the value AND its citation. Do NOT make 10+ individual");
118
- lines.push("read/grep calls — extract everything in one script run.");
119
- lines.push("");
120
- lines.push("The script MUST output JSON in this exact format:");
121
- lines.push("```json");
122
- lines.push("{");
123
- lines.push(' "fieldName": {');
124
- lines.push(' "value": "the extracted value",');
125
- lines.push(' "source": "Original File Name.pdf",');
126
- lines.push(' "page": 14,');
127
- lines.push(' "excerpt": "...surrounding ~150 chars with the extracted value in context..."');
128
- lines.push(" }");
129
- lines.push("}");
130
- lines.push("```");
131
- lines.push("");
132
- lines.push("How to determine page numbers from converted markdown:");
133
- lines.push("- PDF markdown files have `---` page separators");
134
- lines.push("- Count `---` separators before the match to get the page number");
135
- lines.push("- For XLSX: use sheet name + cell reference as 'page'");
136
- lines.push("- For DOCX: use section heading as 'page'");
137
- lines.push("");
138
- lines.push("How to capture excerpts:");
139
- lines.push("- Find the match position in the text");
140
- lines.push("- Take ~75 chars before and ~75 chars after the match");
141
- lines.push("- Trim to word boundaries");
142
- lines.push("- Prefix/suffix with '...' if truncated");
143
- lines.push("");
144
- lines.push("Example extraction script:");
145
- lines.push("```");
146
- lines.push(`bash: node -e "`);
147
- lines.push("const fs = require('fs');");
148
- lines.push("const path = require('path');");
149
- lines.push(`const cacheDir = '${folderPath}/.agentxl-cache';`);
150
- lines.push("const files = fs.readdirSync(cacheDir, {recursive: true}).filter(f => f.toString().endsWith('.md'));");
151
- lines.push("const results = {};");
152
- lines.push("for (const f of files) {");
153
- lines.push(" const text = fs.readFileSync(path.join(cacheDir, f.toString()), 'utf8');");
154
- lines.push(" const sourceFile = f.toString().replace('.md','');");
155
- lines.push(" // Count pages by --- separators");
156
- lines.push(" function getPage(pos) { return (text.slice(0, pos).match(/^---$/gm) || []).length + 1; }");
157
- lines.push(" function getExcerpt(pos, len) {");
158
- lines.push(" const start = Math.max(0, pos - 75);");
159
- lines.push(" const end = Math.min(text.length, pos + len + 75);");
160
- lines.push(" return (start > 0 ? '...' : '') + text.slice(start, end).replace(/\\n/g, ' ').trim() + (end < text.length ? '...' : '');");
161
- lines.push(" }");
162
- lines.push(" const termMatch = text.match(/(?:lease\\s+term|term\\s+of\\s+(?:the\\s+)?lease)[:\\s]+([^.\\n]+)/i);");
163
- lines.push(" if (termMatch) {");
164
- lines.push(" results.leaseTerm = {");
165
- lines.push(" value: termMatch[1].trim(),");
166
- lines.push(" source: sourceFile,");
167
- lines.push(" page: getPage(termMatch.index),");
168
- lines.push(" excerpt: getExcerpt(termMatch.index, termMatch[0].length)");
169
- lines.push(" };");
170
- lines.push(" }");
171
- lines.push(" // ... add more fields with same pattern");
172
- lines.push("}");
173
- lines.push("console.log(JSON.stringify(results, null, 2));");
174
- lines.push('"');
175
- lines.push("```");
176
- lines.push("");
177
- lines.push("If a value is INFERRED (not directly quoted from a source), mark it:");
178
- lines.push(' "source": "INFERRED",');
179
- lines.push(' "page": null,');
180
- lines.push(' "excerpt": "Reasoning: [explain why you inferred this value]"');
181
- lines.push("");
182
- lines.push("STEP 2: WRITE VALUES + COMMENTS TO EXCEL (excel tool)");
183
- lines.push("─────────────────────────────────────────────────────");
184
- lines.push("After extracting data with citations, write to Excel in ONE excel tool call.");
185
- lines.push("For EVERY cell you write, also add an Excel comment with the citation.");
186
- lines.push("IMPORTANT: do NOT use cell.note or range.note — use worksheet.comments.add(cellAddress, content).");
187
- lines.push("");
188
- lines.push("```javascript");
189
- lines.push("// Inside Excel.run(async (context) => { ... }):");
190
- lines.push("const sheet = context.workbook.worksheets.getItem('SheetName');");
191
- lines.push("const address = 'B5';");
94
+ // ── Quick access examples ──────────────────────────────────────────────
192
95
  lines.push("");
193
- lines.push("// Write value");
194
- lines.push("sheet.getRange(address).values = [['12 months']];");
195
- lines.push("");
196
- lines.push("// Add or replace citation comment");
197
- lines.push("try {");
198
- lines.push(" sheet.comments.getItemByCell(address).delete();");
199
- lines.push(" await context.sync();");
200
- lines.push("} catch {}");
201
- lines.push("sheet.comments.add(address, '📄 Source: Operating Lease.pdf\\n📑 Page: 14\\n💬 \"...the lease term shall be twelve (12) months from the Delivery Date...\"\\n🤖 Extracted by AgentXL');");
202
- lines.push("");
203
- lines.push("// For inferred values:");
204
- lines.push("// sheet.comments.add(address, '⚠️ Inferred — no direct source citation\\n💬 Reasoning: Based on aircraft registration VT-YBH (Indian registry)\\n🤖 Extracted by AgentXL');");
205
- lines.push("");
206
- lines.push("await context.sync();");
207
- lines.push("```");
208
- lines.push("");
209
- lines.push("STEP 3: LOG TO _AgentXL_Sources SHEET (excel tool)");
210
- lines.push("──────────────────────────────────────────────────");
211
- lines.push("After writing values, append citation records to a Sources sheet.");
212
- lines.push("Create it if it doesn't exist. This is the audit trail.");
213
- lines.push("");
214
- lines.push("```javascript");
215
- lines.push("// Inside Excel.run(async (context) => { ... }):");
216
- lines.push("let sourcesSheet;");
217
- lines.push("try {");
218
- lines.push(" sourcesSheet = context.workbook.worksheets.getItem('_AgentXL_Sources');");
219
- lines.push("} catch {");
220
- lines.push(" // Create the sheet if it doesn't exist");
221
- lines.push(" sourcesSheet = context.workbook.worksheets.add('_AgentXL_Sources');");
222
- lines.push(" const header = sourcesSheet.getRange('A1:G1');");
223
- lines.push(" header.values = [['Target Sheet', 'Target Cell', 'Value', 'Source File', 'Page', 'Excerpt', 'Timestamp']];");
224
- lines.push(" header.format.font.bold = true;");
225
- lines.push(" header.format.fill.color = '#4472C4';");
226
- lines.push(" header.format.font.color = '#FFFFFF';");
227
- lines.push(" // Set column widths");
228
- lines.push(" sourcesSheet.getRange('A:A').format.columnWidth = 100;");
229
- lines.push(" sourcesSheet.getRange('B:B').format.columnWidth = 70;");
230
- lines.push(" sourcesSheet.getRange('C:C').format.columnWidth = 120;");
231
- lines.push(" sourcesSheet.getRange('D:D').format.columnWidth = 180;");
232
- lines.push(" sourcesSheet.getRange('E:E').format.columnWidth = 50;");
233
- lines.push(" sourcesSheet.getRange('F:F').format.columnWidth = 300;");
234
- lines.push(" sourcesSheet.getRange('G:G').format.columnWidth = 140;");
235
- lines.push("}");
236
- lines.push("");
237
- lines.push("// Find next empty row");
238
- lines.push("const usedRange = sourcesSheet.getUsedRange();");
239
- lines.push("usedRange.load('rowCount');");
240
- lines.push("await context.sync();");
241
- lines.push("const nextRow = usedRange.rowCount + 1;");
242
- lines.push("");
243
- lines.push("// Append citation rows (one per written cell)");
244
- lines.push("const timestamp = new Date().toISOString();");
245
- lines.push("sourcesSheet.getRange(`A${nextRow}:G${nextRow}`).values = [[");
246
- lines.push(" 'Redelivery Details', // target sheet");
247
- lines.push(" 'B5', // target cell");
248
- lines.push(" '12 months', // value written");
249
- lines.push(" 'Operating Lease.pdf', // source file");
250
- lines.push(" 14, // page number");
251
- lines.push(" '...the lease term shall be twelve (12) months...', // excerpt");
252
- lines.push(" timestamp");
253
- lines.push("]];");
254
- lines.push("await context.sync();");
255
- lines.push("```");
256
- lines.push("");
257
- lines.push("IMPORTANT RULES:");
258
- lines.push("- NEVER write a value to Excel without adding a citation comment.");
259
- lines.push("- NEVER skip the _AgentXL_Sources entry.");
260
- lines.push("- If you cannot find a source for a value, mark it as INFERRED with reasoning.");
261
- lines.push("- Combine Steps 2 and 3 into a SINGLE excel tool call when possible.");
262
- lines.push("- The _AgentXL_Sources sheet is APPEND-ONLY — never delete existing rows.");
263
- lines.push("");
264
- lines.push("Use simple read/grep only for:");
265
- lines.push("- Quick single-value lookups");
266
- lines.push("- Checking if a file contains a specific term");
267
- lines.push("- Reading small files in full");
268
- // -----------------------------------------------------------------------
269
- // General file access
270
- // -----------------------------------------------------------------------
271
- lines.push("");
272
- lines.push("How to access files:");
273
- lines.push(`- To list files: ls "${folderPath}"`);
274
- if (supported.length > 0) {
275
- const textExample = supported.find((f) => ![".pdf", ".xlsx", ".xls", ".docx", ".doc"].includes(f.extension));
276
- if (textExample) {
277
- lines.push(`- To read a text file: read "${textExample.absolutePath}"`);
278
- }
96
+ lines.push("File access:");
97
+ lines.push(`- List: ls "${folderPath}"`);
98
+ const textExample = supported.find((f) => ![".pdf", ".xlsx", ".xls", ".docx", ".doc"].includes(f.extension));
99
+ if (textExample) {
100
+ lines.push(`- Read text file: read "${textExample.absolutePath}"`);
279
101
  }
280
- lines.push(`- To search text files: grep with path "${folderPath}"`);
281
- lines.push('Always use the FULL ABSOLUTE PATH shown above. Never use "." or relative paths.');
102
+ lines.push(`- Search: grep with path "${folderPath}"`);
282
103
  return lines.join("\n");
283
104
  }
284
105
  //# sourceMappingURL=folder-context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"folder-context.js","sourceRoot":"","sources":["../../../src/agent/prompt/folder-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,2DAA2D;AAC3D,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEvC,mDAAmD;AACnD,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,IAAI,KAAK,GAAG,IAAI;QAAE,OAAO,GAAG,KAAK,IAAI,CAAC;IACtC,IAAI,KAAK,GAAG,IAAI,GAAG,IAAI;QAAE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IACjE,OAAO,GAAG,CAAC,KAAK,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;AACpD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAChC,UAAkB,EAClB,SAA0B;IAE1B,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAChC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CACR,yGAAyG,CAC1G,CAAC;IACF,KAAK,CAAC,IAAI,CACR,sFAAsF,CACvF,CAAC;IACF,KAAK,CAAC,IAAI,CACR,gFAAgF,CACjF,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CACR,iFAAiF,CAClF,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,yBAAyB,UAAU,EAAE,CAAC,CAAC;IAClD,KAAK,CAAC,IAAI,CACR,kFAAkF,CACnF,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,uDAAuD,UAAU,EAAE,CAAC,CAAC;IACh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AAM,GAAG,CAAC,EAAE,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,0DAA0D,CAAC,CAAC;QACvE,KAAK,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAC9C,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClB,KAAK,CAAC,IAAI,CACR,kFAAkF,SAAS,CAAC,CAAC,CAAC,CAAC,YAAY,uCAAuC,CACnJ,CAAC;QACF,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED,0EAA0E;IAE1E,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,eAAe,UAAU,GAAG,CAAC,CAAC;IAEzC,MAAM,WAAW,GAAG,SAAS,CAAC,IAAI,CAChC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CACzE,CAAC;IACF,IAAI,WAAW,EAAE,CAAC;QAChB,KAAK,CAAC,IAAI,CAAC,2BAA2B,WAAW,CAAC,YAAY,GAAG,CAAC,CAAC;IACrE,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,6BAA6B,UAAU,GAAG,CAAC,CAAC;IAEvD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,21 @@
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
+ export declare const AGENTXL_SYSTEM_PROMPT: string;
21
+ //# sourceMappingURL=system-prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../../src/agent/prompt/system-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,eAAO,MAAM,qBAAqB,QA0G1B,CAAC"}