agentxl 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +409 -0
  2. package/bin/agentxl.js +377 -0
  3. package/dist/agent/auth.d.ts +2 -0
  4. package/dist/agent/auth.d.ts.map +1 -0
  5. package/dist/agent/auth.js +2 -0
  6. package/dist/agent/auth.js.map +1 -0
  7. package/dist/agent/models.d.ts +21 -0
  8. package/dist/agent/models.d.ts.map +1 -0
  9. package/dist/agent/models.js +46 -0
  10. package/dist/agent/models.js.map +1 -0
  11. package/dist/agent/provider/azure-provider.d.ts +2 -0
  12. package/dist/agent/provider/azure-provider.d.ts.map +1 -0
  13. package/dist/agent/provider/azure-provider.js +2 -0
  14. package/dist/agent/provider/azure-provider.js.map +1 -0
  15. package/dist/agent/session.d.ts +43 -0
  16. package/dist/agent/session.d.ts.map +1 -0
  17. package/dist/agent/session.js +145 -0
  18. package/dist/agent/session.js.map +1 -0
  19. package/dist/agent/tools/excel-tools.d.ts +2 -0
  20. package/dist/agent/tools/excel-tools.d.ts.map +1 -0
  21. package/dist/agent/tools/excel-tools.js +2 -0
  22. package/dist/agent/tools/excel-tools.js.map +1 -0
  23. package/dist/server/certs.d.ts +17 -0
  24. package/dist/server/certs.d.ts.map +1 -0
  25. package/dist/server/certs.js +38 -0
  26. package/dist/server/certs.js.map +1 -0
  27. package/dist/server/index.d.ts +15 -0
  28. package/dist/server/index.d.ts.map +1 -0
  29. package/dist/server/index.js +376 -0
  30. package/dist/server/index.js.map +1 -0
  31. package/manifest/.gitkeep +0 -0
  32. package/manifest/manifest.xml +99 -0
  33. package/package.json +82 -0
  34. package/taskpane/dist/assets/icon-16.png +0 -0
  35. package/taskpane/dist/assets/icon-32.png +0 -0
  36. package/taskpane/dist/assets/icon-64.png +0 -0
  37. package/taskpane/dist/assets/icon-80.png +0 -0
  38. package/taskpane/dist/assets/index-6sMpIYxE.css +1 -0
  39. package/taskpane/dist/assets/index-DyLrQ3Aa.js +164 -0
  40. package/taskpane/dist/index.html +15 -0
package/README.md ADDED
@@ -0,0 +1,409 @@
1
+ <p align="center">
2
+ <img src="https://img.shields.io/badge/Excel-AI_Agent-059669?style=for-the-badge&logo=microsoftexcel&logoColor=white" alt="AgentXL" />
3
+ </p>
4
+
5
+ <h1 align="center">AgentXL</h1>
6
+
7
+ <p align="center">
8
+ <strong>Open-source AI agent that lives inside Microsoft Excel.</strong><br>
9
+ Chat in natural language — read data, write formulas, create charts, format ranges.
10
+ </p>
11
+
12
+ <p align="center">
13
+ <a href="#quick-start">Quick Start</a> •
14
+ <a href="#what-it-does">What It Does</a> •
15
+ <a href="#how-it-works">How It Works</a> •
16
+ <a href="#supported-providers">Providers</a> •
17
+ <a href="#troubleshooting">Troubleshooting</a>
18
+ </p>
19
+
20
+ <p align="center">
21
+ <img src="https://img.shields.io/npm/v/agentxl?color=059669" alt="npm version" />
22
+ <img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT License" />
23
+ <img src="https://img.shields.io/badge/platform-Windows%20%7C%20Mac-lightgrey" alt="Platform" />
24
+ <img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen" alt="Node 20+" />
25
+ </p>
26
+
27
+ ---
28
+
29
+ ## Quick Start
30
+
31
+ 6 steps from install to first message.
32
+
33
+ ### 1. Install
34
+
35
+ ```bash
36
+ npm install -g agentxl
37
+ ```
38
+
39
+ ### 2. Start
40
+
41
+ ```bash
42
+ agentxl start
43
+ ```
44
+
45
+ The CLI walks you through authentication on first run. You'll see:
46
+
47
+ ```
48
+ ✅ Auth ready
49
+ ✅ HTTPS certificate ready (trusted by OS)
50
+ ✅ Server running at https://localhost:3001
51
+ ```
52
+
53
+ ### 3. Choose your AI provider
54
+
55
+ On first run, the CLI asks how to connect. Pick what fits you:
56
+
57
+ | If you have... | Pick |
58
+ |---------------|------|
59
+ | **Claude Pro/Max** ($20/mo subscription) | Option 1 — sign in with browser, no API key |
60
+ | **ChatGPT Plus/Pro** ($20/mo subscription) | Option 2 — sign in with browser, no API key |
61
+ | **GitHub Copilot** subscription | Option 3 — sign in with browser |
62
+ | **An API key** (Anthropic, OpenAI, OpenRouter) | Option 5 — paste your key |
63
+ | **Nothing yet** | Create a free [OpenRouter](https://openrouter.ai) account → get API key → paste it |
64
+
65
+ > **Already use Pi?** AgentXL shares credentials from `~/.pi/agent/auth.json`. No extra login needed.
66
+
67
+ ### 4. Verify in browser
68
+
69
+ Open **https://localhost:3001/taskpane/** in your browser. You should see the AgentXL chat interface. This confirms the server, HTTPS, and UI all work before you touch Excel.
70
+
71
+ ### 5. Add to Excel (one-time setup)
72
+
73
+ This is a one-time setup. After this, just run `agentxl start` and click the ribbon button.
74
+
75
+ 1. **Excel** → **File** → **Options** → **Trust Center** → **Trust Center Settings**
76
+ 2. Click **Trusted Add-in Catalogs**
77
+ 3. Add the catalog path printed in your terminal (the folder containing `manifest.xml`)
78
+ 4. Check **Show in Menu** → **OK** → **OK**
79
+ 5. **Restart Excel**
80
+ 6. Go to **Insert** → **My Add-ins** → **SHARED FOLDER** tab
81
+ 7. Click **AgentXL** → **Add**
82
+
83
+ The AgentXL button appears on the **Home** ribbon tab.
84
+
85
+ ### 6. Send your first message
86
+
87
+ Click **AgentXL** on the ribbon. The taskpane opens. Try:
88
+
89
+ > "What can you help me with in this workbook?"
90
+
91
+ Or use one of the quick actions: **Summarize data**, **Create chart**, **Write formula**.
92
+
93
+ ---
94
+
95
+ ## After Setup
96
+
97
+ Once you've done the one-time Excel setup:
98
+
99
+ ```bash
100
+ agentxl start # Start the server
101
+ # Open Excel → click AgentXL on the ribbon
102
+ # Chat.
103
+ ```
104
+
105
+ Switch providers anytime:
106
+
107
+ ```bash
108
+ agentxl login # Re-authenticate with a different provider
109
+ ```
110
+
111
+ ---
112
+
113
+ ## What It Does
114
+
115
+ AgentXL brings an AI assistant directly into Excel's sidebar. You chat in plain English — the agent understands your spreadsheet and takes action.
116
+
117
+ | You say | Agent does |
118
+ |---------|-----------|
119
+ | "Summarize column B" | Reads your data, gives you a summary |
120
+ | "Add a SUM formula for Sales" | Writes `=SUM(B2:B100)` in the right cell |
121
+ | "Create a bar chart of revenue by month" | Inserts a chart from your data |
122
+ | "Format the header row — bold, dark background" | Applies formatting via Office.js |
123
+ | "Add a new sheet called Q3 Report" | Creates the worksheet |
124
+ | "What formula calculates year-over-year growth?" | Explains and writes the formula |
125
+
126
+ ### Excel Tools
127
+
128
+ | Tool | What It Does |
129
+ |------|-------------|
130
+ | `excel_read_range` | Read data, values, formulas from any range |
131
+ | `excel_write_range` | Write values or formulas to ranges |
132
+ | `excel_create_table` | Convert ranges to structured Excel tables |
133
+ | `excel_create_chart` | Create charts (column, bar, line, pie, scatter, area, doughnut) |
134
+ | `excel_get_workbook_info` | Get workbook metadata — sheets, tables, named ranges |
135
+ | `excel_format_range` | Apply formatting — fonts, colors, borders, number formats |
136
+ | `excel_insert_rows` | Insert rows into worksheets |
137
+ | `excel_delete_rows` | Delete rows from worksheets |
138
+ | `excel_add_worksheet` | Add new worksheets |
139
+ | `excel_run_formula` | Evaluate formulas without writing to cells |
140
+
141
+ ---
142
+
143
+ ## How It Works
144
+
145
+ ```
146
+ agentxl start
147
+ → Local HTTPS server on localhost:3001
148
+ → Serves chat UI at /taskpane
149
+ → Streams AI responses via SSE
150
+
151
+ Excel loads the taskpane
152
+ → You type a message
153
+ → Agent reasons about your spreadsheet
154
+ → Taskpane executes actions via Office.js
155
+ ```
156
+
157
+ ### Architecture
158
+
159
+ ```
160
+ ┌──────────────────────────────────────────────────────────┐
161
+ │ YOUR MACHINE │
162
+ │ │
163
+ │ ┌─────────────────┐ ┌──────────────────────────┐ │
164
+ │ │ Excel │ │ AgentXL Server │ │
165
+ │ │ │ │ (localhost:3001) │ │
166
+ │ │ ┌────────────┐ │ HTTPS │ │ │
167
+ │ │ │ Taskpane │◄─┼──────┤ Chat UI (React) │ │
168
+ │ │ │ (sidebar) │ │ │ Agent session (Pi SDK) │ │
169
+ │ │ │ Office.js │──┼──────► SSE streaming │ │
170
+ │ │ └────────────┘ │ │ │ │
171
+ │ └─────────────────┘ └────────────┬─────────────┘ │
172
+ │ │ │
173
+ └──────────────────────────────────────────┼────────────────┘
174
+ │ API call
175
+
176
+ ┌──────────────────────┐
177
+ │ Anthropic / OpenAI │
178
+ │ OpenRouter / Azure │
179
+ │ Google / Copilot │
180
+ └──────────────────────┘
181
+ ```
182
+
183
+ **Key points:**
184
+
185
+ - **Everything runs locally.** No cloud server. No account with us. No data collection.
186
+ - **Your data stays on your machine.** The only external call is to the LLM provider you choose.
187
+ - **You bring your own AI.** Use your existing subscription (Claude Pro, ChatGPT Plus, Copilot) or any API key.
188
+ - **Single process.** One npm package. One command. `agentxl start`.
189
+
190
+ ---
191
+
192
+ ## Supported Providers
193
+
194
+ ### Subscriptions (sign in with your browser — no API key)
195
+
196
+ | Provider | What You Need | Best for |
197
+ |----------|---------------|----------|
198
+ | **Anthropic** | Claude Pro or Max ($20/mo) | Best quality, recommended |
199
+ | **OpenAI Codex** | ChatGPT Plus or Pro ($20/mo) | If you already pay for ChatGPT |
200
+ | **GitHub Copilot** | Copilot Individual or Business | If you already have Copilot |
201
+ | **Google** | Cloud Code Assist (Gemini CLI) | If you use Google Cloud |
202
+
203
+ ### API Keys (paste your key)
204
+
205
+ | Provider | Models | Best for |
206
+ |----------|--------|----------|
207
+ | **Anthropic** | Claude Sonnet, Opus | Direct API access |
208
+ | **OpenAI** | GPT-4o, GPT-4 Turbo | Direct API access |
209
+ | **OpenRouter** | 100+ models | Cheapest — free models available |
210
+
211
+ > **Cheapest:** [OpenRouter](https://openrouter.ai) has free-tier models. Create an account, get a key, start chatting.
212
+ >
213
+ > **Best quality:** Claude Pro subscription — if you already pay $20/mo, there's no extra cost.
214
+ >
215
+ > **Switch anytime:** Run `agentxl login` to change providers.
216
+
217
+ ---
218
+
219
+ ## Troubleshooting
220
+
221
+ ### Taskpane is blank or won't load in Excel
222
+
223
+ **This is the most common first-run issue.** It usually means Excel doesn't trust the HTTPS certificate.
224
+
225
+ **Check these in order:**
226
+
227
+ 1. **Is the server running?** You should see `✅ Server running` in your terminal.
228
+
229
+ 2. **Does it work in the browser?** Open https://localhost:3001/taskpane/ in Chrome or Edge.
230
+ - ✅ If the chat UI loads → server and cert are fine, the issue is Excel setup.
231
+ - ❌ If the browser warns about the certificate → the cert isn't trusted yet.
232
+
233
+ 3. **Certificate not trusted?** AgentXL uses Microsoft's `office-addin-dev-certs` to generate localhost certificates and install them in your OS trust store. If this didn't work:
234
+
235
+ **Windows:**
236
+ ```bash
237
+ npx office-addin-dev-certs install
238
+ ```
239
+
240
+ **Mac:**
241
+ ```bash
242
+ npx office-addin-dev-certs install
243
+ ```
244
+
245
+ Then restart Excel. The first run may prompt for admin/keychain access — this is expected and only happens once.
246
+
247
+ 4. **Certificate works in browser but not in Excel?** Excel uses the OS trust store, not the browser's. Make sure the certificate authority is installed system-wide (the `install` command above does this).
248
+
249
+ ### Add-in doesn't appear in Excel
250
+
251
+ 1. Is the server running? (`agentxl start`)
252
+ 2. Did you add the catalog path in Trust Center → Trusted Add-in Catalogs?
253
+ 3. Did you check "Show in Menu"?
254
+ 4. Did you restart Excel after adding the catalog?
255
+ 5. Look in Insert → My Add-ins → **SHARED FOLDER** tab (not the store tab)
256
+
257
+ ### "Port 3001 is already in use"
258
+
259
+ Another instance of AgentXL (or another app) is using that port:
260
+
261
+ ```bash
262
+ agentxl start --port 3002
263
+ ```
264
+
265
+ > **Note:** If you change the port, you'll need to update `manifest/manifest.xml` to match.
266
+
267
+ ### "No model available"
268
+
269
+ No authentication configured. Run:
270
+
271
+ ```bash
272
+ agentxl login
273
+ ```
274
+
275
+ ### Taskpane says "Waiting for credentials…"
276
+
277
+ The server is running but no auth is configured. Run `agentxl login` in another terminal. The taskpane will detect the change automatically — no reload needed.
278
+
279
+ ### Taskpane says "Server disconnected — reconnecting…"
280
+
281
+ The server stopped while the taskpane was open. Restart it:
282
+
283
+ ```bash
284
+ agentxl start
285
+ ```
286
+
287
+ The taskpane reconnects automatically when the server comes back.
288
+
289
+ ---
290
+
291
+ ## CLI Reference
292
+
293
+ ```
294
+ agentxl start [--port 3001] [--verbose] Start the server
295
+ agentxl login Set up or change authentication
296
+ agentxl --version Print version
297
+ agentxl --help Show help
298
+ ```
299
+
300
+ | Flag | Default | Description |
301
+ |------|---------|-------------|
302
+ | `--port` | `3001` | Port for the HTTPS server |
303
+ | `--verbose` | off | Log all HTTP requests |
304
+
305
+ ---
306
+
307
+ ## Requirements
308
+
309
+ - **Node.js 20** or later
310
+ - **Microsoft Excel** desktop (Windows or Mac)
311
+ - **An AI provider** — subscription or API key (see [Supported Providers](#supported-providers))
312
+
313
+ > Excel for the web is not supported (Office add-in limitation).
314
+
315
+ ---
316
+
317
+ ## Privacy & Security
318
+
319
+ - **Local-only server.** Binds to `127.0.0.1` — not accessible from your network.
320
+ - **No telemetry.** No analytics. No data collection. No phone-home.
321
+ - **No account required.** No sign-up with us. Ever.
322
+ - **Your API key stays local.** Stored in `~/.pi/agent/auth.json` on your machine.
323
+ - **Open source.** Read every line of code. MIT license.
324
+
325
+ When you ask the agent about your spreadsheet, the relevant data is sent to your chosen LLM provider as part of the prompt. This is the only external communication.
326
+
327
+ ---
328
+
329
+ ## Development
330
+
331
+ ```bash
332
+ git clone https://github.com/deltaxy-ai/agentxl.git
333
+ cd agentxl
334
+ npm install
335
+ npm run build # Compile server + taskpane
336
+ npm test # Run all tests (64 tests)
337
+ node bin/agentxl.js start
338
+ ```
339
+
340
+ ### Project Structure
341
+
342
+ ```
343
+ bin/agentxl.js CLI entry point
344
+ src/server/index.ts HTTPS server
345
+ src/server/certs.ts Certificate generation (office-addin-dev-certs)
346
+ src/agent/session.ts Pi SDK agent session
347
+ src/agent/models.ts Model selection (OAuth > API key)
348
+ taskpane/src/app.tsx Chat UI orchestrator
349
+ taskpane/src/hooks/ useAgentStatus, useChatStream
350
+ taskpane/src/components/ UI components
351
+ taskpane/src/lib/ API client, types, stream handler
352
+ manifest/manifest.xml Office add-in manifest
353
+ tests/ Acceptance + E2E tests
354
+ ```
355
+
356
+ ### npm Scripts
357
+
358
+ | Script | What |
359
+ |--------|------|
360
+ | `npm run build` | Build server (tsc) + taskpane (Vite) |
361
+ | `npm run build:server` | Build server only |
362
+ | `npm run build:taskpane` | Build taskpane only |
363
+ | `npm run dev:taskpane` | Vite dev server for UI development |
364
+ | `npm test` | Run all tests |
365
+ | `npm run test:e2e` | Run Playwright E2E tests |
366
+ | `npm start` | Start the server |
367
+
368
+ ### Tech Stack
369
+
370
+ | Layer | Technology |
371
+ |-------|-----------|
372
+ | Runtime | Node.js |
373
+ | Agent framework | [Pi Coding Agent SDK](https://www.npmjs.com/package/@mariozechner/pi-coding-agent) |
374
+ | LLM | Claude, GPT-4o, or any OpenRouter model |
375
+ | Excel integration | Office.js (Microsoft Office Add-in API) |
376
+ | Taskpane UI | React 19 + Tailwind CSS v4 |
377
+ | Bundler | Vite 6 |
378
+ | HTTPS | office-addin-dev-certs (OS-trusted localhost certs) |
379
+
380
+ ---
381
+
382
+ ## Roadmap
383
+
384
+ | Module | What | Status |
385
+ |--------|------|--------|
386
+ | **Module 1** | Chat with AI inside Excel | ✅ Working |
387
+ | **Module 2** | Read spreadsheet — agent sees your data | 🔜 Next |
388
+ | **Module 3** | Edit spreadsheet — write, format, tables & charts | Planned |
389
+ | **Module 4** | Settings, auto-updates, npm publish | Planned |
390
+
391
+ ---
392
+
393
+ ## Contributing
394
+
395
+ Contributions welcome! MIT license.
396
+
397
+ 1. Fork the repo
398
+ 2. Create a feature branch
399
+ 3. Make your changes
400
+ 4. Run `npm test` — all 64 tests should pass
401
+ 5. Submit a PR
402
+
403
+ ---
404
+
405
+ ## License
406
+
407
+ MIT — [DeltaXY](https://deltaxy.ai)
408
+
409
+ Built with [Pi Coding Agent SDK](https://www.npmjs.com/package/@mariozechner/pi-coding-agent).