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.
- package/README.md +409 -0
- package/bin/agentxl.js +377 -0
- package/dist/agent/auth.d.ts +2 -0
- package/dist/agent/auth.d.ts.map +1 -0
- package/dist/agent/auth.js +2 -0
- package/dist/agent/auth.js.map +1 -0
- package/dist/agent/models.d.ts +21 -0
- package/dist/agent/models.d.ts.map +1 -0
- package/dist/agent/models.js +46 -0
- package/dist/agent/models.js.map +1 -0
- package/dist/agent/provider/azure-provider.d.ts +2 -0
- package/dist/agent/provider/azure-provider.d.ts.map +1 -0
- package/dist/agent/provider/azure-provider.js +2 -0
- package/dist/agent/provider/azure-provider.js.map +1 -0
- package/dist/agent/session.d.ts +43 -0
- package/dist/agent/session.d.ts.map +1 -0
- package/dist/agent/session.js +145 -0
- package/dist/agent/session.js.map +1 -0
- package/dist/agent/tools/excel-tools.d.ts +2 -0
- package/dist/agent/tools/excel-tools.d.ts.map +1 -0
- package/dist/agent/tools/excel-tools.js +2 -0
- package/dist/agent/tools/excel-tools.js.map +1 -0
- package/dist/server/certs.d.ts +17 -0
- package/dist/server/certs.d.ts.map +1 -0
- package/dist/server/certs.js +38 -0
- package/dist/server/certs.js.map +1 -0
- package/dist/server/index.d.ts +15 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +376 -0
- package/dist/server/index.js.map +1 -0
- package/manifest/.gitkeep +0 -0
- package/manifest/manifest.xml +99 -0
- package/package.json +82 -0
- package/taskpane/dist/assets/icon-16.png +0 -0
- package/taskpane/dist/assets/icon-32.png +0 -0
- package/taskpane/dist/assets/icon-64.png +0 -0
- package/taskpane/dist/assets/icon-80.png +0 -0
- package/taskpane/dist/assets/index-6sMpIYxE.css +1 -0
- package/taskpane/dist/assets/index-DyLrQ3Aa.js +164 -0
- package/taskpane/dist/index.html +15 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.js","sour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CAAC,MAAM,GAAG,CAAC,CAAC;AAC9B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe;IAC7B,kDAAkD;IAClD,IAAI,gBAAgB;QAAE,OAAO,gBAAgB,CAAC;IAE9C,6DAA6D;IAC7D,aAAa,CAAC,OAAO,EAAE,CAAC;IACxB,MAAM,KAAK,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC;IAC7C,OAAO,KAAK,EAAE,QAAQ,IAAI,IAAI,CAAC;AACjC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY;IAC1B,IAAI,cAAc,EAAE,CAAC;QACnB,cAAc,CAAC,OAAO,EAAE,CAAC;QACzB,cAAc,GAAG,IAAI,CAAC;IACxB,CAAC;IACD,WAAW,EAAE,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI,cAAc,EAAE,CAAC;QACnB,IAAI,CAAC;YACH,MAAM,cAAc,CAAC,KAAK,EAAE,CAAC;QAC/B,CAAC;QAAC,MAAM,CAAC;YACP,2DAA2D;QAC7D,CAAC;IACH,CAAC;AACH,CAAC;AAED,sBAAsB;AACtB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excel-tools.d.ts","sourceRoot":"","sources":["../../../src/agent/tools/excel-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excel-tools.js","sourceRoot":"","sources":["../../../src/agent/tools/excel-tools.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface CertPair {
|
|
2
|
+
key: string;
|
|
3
|
+
cert: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Ensure trusted HTTPS certificates exist for localhost.
|
|
7
|
+
*
|
|
8
|
+
* Uses Microsoft's `office-addin-dev-certs` package which:
|
|
9
|
+
* 1. Generates a localhost CA + server certificate
|
|
10
|
+
* 2. Installs the CA into the OS trust store (Windows + Mac)
|
|
11
|
+
* 3. Chrome, Edge, Excel all trust it — no manual steps
|
|
12
|
+
*
|
|
13
|
+
* On first run, the user may see an OS prompt to trust the certificate.
|
|
14
|
+
* Subsequent runs reuse the existing trusted certs.
|
|
15
|
+
*/
|
|
16
|
+
export declare function ensureCerts(): Promise<CertPair>;
|
|
17
|
+
//# sourceMappingURL=certs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"certs.d.ts","sourceRoot":"","sources":["../../src/server/certs.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,QAAQ,CAAC,CA+BrD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { readFileSync } from "fs";
|
|
2
|
+
/**
|
|
3
|
+
* Ensure trusted HTTPS certificates exist for localhost.
|
|
4
|
+
*
|
|
5
|
+
* Uses Microsoft's `office-addin-dev-certs` package which:
|
|
6
|
+
* 1. Generates a localhost CA + server certificate
|
|
7
|
+
* 2. Installs the CA into the OS trust store (Windows + Mac)
|
|
8
|
+
* 3. Chrome, Edge, Excel all trust it — no manual steps
|
|
9
|
+
*
|
|
10
|
+
* On first run, the user may see an OS prompt to trust the certificate.
|
|
11
|
+
* Subsequent runs reuse the existing trusted certs.
|
|
12
|
+
*/
|
|
13
|
+
export async function ensureCerts() {
|
|
14
|
+
try {
|
|
15
|
+
// Dynamic require — office-addin-dev-certs is CJS
|
|
16
|
+
const devCerts = await import("office-addin-dev-certs");
|
|
17
|
+
// This generates certs if needed AND installs the CA into the OS trust store.
|
|
18
|
+
// Returns { key: string, cert: string } paths or buffer.
|
|
19
|
+
const httpsOptions = await devCerts.getHttpsServerOptions();
|
|
20
|
+
const key = typeof httpsOptions.key === "string"
|
|
21
|
+
? httpsOptions.key
|
|
22
|
+
: Buffer.isBuffer(httpsOptions.key)
|
|
23
|
+
? httpsOptions.key.toString("utf-8")
|
|
24
|
+
: readFileSync(httpsOptions.key, "utf-8");
|
|
25
|
+
const cert = typeof httpsOptions.cert === "string"
|
|
26
|
+
? httpsOptions.cert
|
|
27
|
+
: Buffer.isBuffer(httpsOptions.cert)
|
|
28
|
+
? httpsOptions.cert.toString("utf-8")
|
|
29
|
+
: readFileSync(httpsOptions.cert, "utf-8");
|
|
30
|
+
return { key, cert };
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
34
|
+
throw new Error(`Failed to generate HTTPS certificates: ${message}\n` +
|
|
35
|
+
` Try running: npx office-addin-dev-certs install`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=certs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"certs.js","sourceRoot":"","sources":["../../src/server/certs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAOlC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,IAAI,CAAC;QACH,kDAAkD;QAClD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAC;QAExD,8EAA8E;QAC9E,yDAAyD;QACzD,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,qBAAqB,EAAE,CAAC;QAE5D,MAAM,GAAG,GACP,OAAO,YAAY,CAAC,GAAG,KAAK,QAAQ;YAClC,CAAC,CAAC,YAAY,CAAC,GAAG;YAClB,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC;gBACjC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC;gBACpC,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,GAAU,EAAE,OAAO,CAAC,CAAC;QAEvD,MAAM,IAAI,GACR,OAAO,YAAY,CAAC,IAAI,KAAK,QAAQ;YACnC,CAAC,CAAC,YAAY,CAAC,IAAI;YACnB,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC;gBAClC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;gBACrC,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,IAAW,EAAE,OAAO,CAAC,CAAC;QAExD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,MAAM,IAAI,KAAK,CACb,0CAA0C,OAAO,IAAI;YACnD,oDAAoD,CACvD,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type CertPair } from "./certs.js";
|
|
2
|
+
/** Enable or disable request logging. */
|
|
3
|
+
export declare function setVerbose(enabled: boolean): void;
|
|
4
|
+
/**
|
|
5
|
+
* Start the HTTPS server.
|
|
6
|
+
*
|
|
7
|
+
* @param port - Port to listen on (default: 3001)
|
|
8
|
+
* @param certs - Optional pre-loaded certificates. If not provided, will call ensureCerts().
|
|
9
|
+
*/
|
|
10
|
+
export declare function startServer(port?: number, certs?: CertPair): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Stop the HTTPS server gracefully.
|
|
13
|
+
*/
|
|
14
|
+
export declare function stopServer(): Promise<void>;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAsYxD,yCAAyC;AACzC,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAEjD;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,IAAI,GAAE,MAAa,EACnB,KAAK,CAAC,EAAE,QAAQ,GACf,OAAO,CAAC,IAAI,CAAC,CA0Cf;AAED;;GAEG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAWhD"}
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import { createServer } from "https";
|
|
2
|
+
import { readFileSync, existsSync } from "fs";
|
|
3
|
+
import { join, extname, dirname } from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
import { ensureCerts } from "./certs.js";
|
|
6
|
+
import { isAuthenticated, getAuthProvider, getSession, abortSession, } from "../agent/session.js";
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = dirname(__filename);
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
// MIME types for static file serving
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
const MIME_TYPES = {
|
|
13
|
+
".html": "text/html; charset=utf-8",
|
|
14
|
+
".js": "application/javascript; charset=utf-8",
|
|
15
|
+
".mjs": "application/javascript; charset=utf-8",
|
|
16
|
+
".css": "text/css; charset=utf-8",
|
|
17
|
+
".json": "application/json; charset=utf-8",
|
|
18
|
+
".png": "image/png",
|
|
19
|
+
".svg": "image/svg+xml",
|
|
20
|
+
".ico": "image/x-icon",
|
|
21
|
+
".webp": "image/webp",
|
|
22
|
+
".woff": "font/woff",
|
|
23
|
+
".woff2": "font/woff2",
|
|
24
|
+
".map": "application/json",
|
|
25
|
+
};
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
// Helpers
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
/** Read the full request body as a string. */
|
|
30
|
+
function readBody(req) {
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
const chunks = [];
|
|
33
|
+
req.on("data", (chunk) => chunks.push(chunk));
|
|
34
|
+
req.on("end", () => resolve(Buffer.concat(chunks).toString("utf-8")));
|
|
35
|
+
req.on("error", reject);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** Parse JSON body, returning null on failure. */
|
|
39
|
+
async function parseJsonBody(req) {
|
|
40
|
+
try {
|
|
41
|
+
const raw = await readBody(req);
|
|
42
|
+
return raw.length > 0 ? JSON.parse(raw) : null;
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/** Send a JSON response. */
|
|
49
|
+
function sendJson(res, status, body) {
|
|
50
|
+
const payload = JSON.stringify(body);
|
|
51
|
+
res.writeHead(status, {
|
|
52
|
+
"Content-Type": "application/json; charset=utf-8",
|
|
53
|
+
"Access-Control-Allow-Origin": "*",
|
|
54
|
+
"Access-Control-Allow-Methods": "GET, POST, OPTIONS",
|
|
55
|
+
"Access-Control-Allow-Headers": "Content-Type",
|
|
56
|
+
"Content-Length": Buffer.byteLength(payload),
|
|
57
|
+
});
|
|
58
|
+
res.end(payload);
|
|
59
|
+
}
|
|
60
|
+
/** Send a plain-text error. */
|
|
61
|
+
function sendError(res, status, message) {
|
|
62
|
+
sendJson(res, status, { error: message });
|
|
63
|
+
}
|
|
64
|
+
/** Get package version from package.json. */
|
|
65
|
+
function getVersion() {
|
|
66
|
+
try {
|
|
67
|
+
// Walk up from dist/server/ or src/server/ to find package.json
|
|
68
|
+
const candidates = [
|
|
69
|
+
join(__dirname, "..", "..", "package.json"), // dist/server -> root
|
|
70
|
+
join(__dirname, "..", "..", "..", "package.json"),
|
|
71
|
+
];
|
|
72
|
+
for (const p of candidates) {
|
|
73
|
+
if (existsSync(p)) {
|
|
74
|
+
const pkg = JSON.parse(readFileSync(p, "utf-8"));
|
|
75
|
+
return pkg.version ?? "0.0.0";
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return "0.0.0";
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
return "0.0.0";
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
// Route: GET /taskpane/* — static file serving
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
function resolveTaskpaneRoot() {
|
|
88
|
+
// From dist/server/ → ../../taskpane/dist
|
|
89
|
+
const candidates = [
|
|
90
|
+
join(__dirname, "..", "..", "taskpane", "dist"),
|
|
91
|
+
join(__dirname, "..", "..", "..", "taskpane", "dist"),
|
|
92
|
+
];
|
|
93
|
+
for (const c of candidates) {
|
|
94
|
+
if (existsSync(c))
|
|
95
|
+
return c;
|
|
96
|
+
}
|
|
97
|
+
// Fallback — may not exist yet
|
|
98
|
+
return join(__dirname, "..", "..", "taskpane", "dist");
|
|
99
|
+
}
|
|
100
|
+
function handleTaskpane(req, res, taskpaneRoot) {
|
|
101
|
+
const url = req.url ?? "/";
|
|
102
|
+
// Strip /taskpane prefix to get relative path
|
|
103
|
+
let relativePath = url.replace(/^\/taskpane\/?/, "");
|
|
104
|
+
// Remove query string
|
|
105
|
+
relativePath = relativePath.split("?")[0];
|
|
106
|
+
// Default to index.html
|
|
107
|
+
if (relativePath === "" || relativePath === "/") {
|
|
108
|
+
relativePath = "index.html";
|
|
109
|
+
}
|
|
110
|
+
const filePath = join(taskpaneRoot, relativePath);
|
|
111
|
+
// Security: ensure resolved path is within taskpaneRoot
|
|
112
|
+
if (!filePath.startsWith(taskpaneRoot)) {
|
|
113
|
+
sendError(res, 403, "Forbidden");
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (!existsSync(filePath)) {
|
|
117
|
+
// SPA fallback: serve index.html for non-file paths
|
|
118
|
+
const indexPath = join(taskpaneRoot, "index.html");
|
|
119
|
+
if (existsSync(indexPath) && !extname(relativePath)) {
|
|
120
|
+
const content = readFileSync(indexPath);
|
|
121
|
+
res.writeHead(200, {
|
|
122
|
+
"Content-Type": "text/html; charset=utf-8",
|
|
123
|
+
"Content-Length": content.length,
|
|
124
|
+
"Access-Control-Allow-Origin": "*",
|
|
125
|
+
});
|
|
126
|
+
res.end(content);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
sendError(res, 404, "Not found");
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const ext = extname(filePath).toLowerCase();
|
|
133
|
+
const contentType = MIME_TYPES[ext] ?? "application/octet-stream";
|
|
134
|
+
const content = readFileSync(filePath);
|
|
135
|
+
res.writeHead(200, {
|
|
136
|
+
"Content-Type": contentType,
|
|
137
|
+
"Content-Length": content.length,
|
|
138
|
+
"Access-Control-Allow-Origin": "*",
|
|
139
|
+
"Cache-Control": ext === ".html" ? "no-cache" : "public, max-age=31536000",
|
|
140
|
+
});
|
|
141
|
+
res.end(content);
|
|
142
|
+
}
|
|
143
|
+
// ---------------------------------------------------------------------------
|
|
144
|
+
// Route: GET /api/version
|
|
145
|
+
// ---------------------------------------------------------------------------
|
|
146
|
+
function handleVersion(_req, res) {
|
|
147
|
+
sendJson(res, 200, { version: getVersion() });
|
|
148
|
+
}
|
|
149
|
+
// ---------------------------------------------------------------------------
|
|
150
|
+
// Route: POST /api/agent — SSE streaming via Pi SDK session
|
|
151
|
+
// ---------------------------------------------------------------------------
|
|
152
|
+
async function handleAgent(req, res) {
|
|
153
|
+
const body = await parseJsonBody(req);
|
|
154
|
+
// Strict validation: message must be a non-empty string
|
|
155
|
+
if (!body ||
|
|
156
|
+
typeof body.message !== "string" ||
|
|
157
|
+
body.message.trim().length === 0) {
|
|
158
|
+
sendError(res, 400, "Missing 'message' in request body");
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
// Auth check
|
|
162
|
+
if (!isAuthenticated()) {
|
|
163
|
+
sendError(res, 401, "Not authenticated. Run 'agentxl login' to set up credentials.");
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
// Build message with optional Excel context
|
|
167
|
+
const context = body.context;
|
|
168
|
+
const message = body.message.trim();
|
|
169
|
+
let fullMessage = message;
|
|
170
|
+
if (context && (context.activeSheet || context.selectedRange)) {
|
|
171
|
+
const parts = [];
|
|
172
|
+
if (context.activeSheet)
|
|
173
|
+
parts.push(`Active sheet: ${context.activeSheet}`);
|
|
174
|
+
if (context.selectedRange)
|
|
175
|
+
parts.push(`Selected range: ${context.selectedRange}`);
|
|
176
|
+
fullMessage = `[Context: ${parts.join(", ")}]\n\n${message}`;
|
|
177
|
+
}
|
|
178
|
+
// SSE headers
|
|
179
|
+
res.writeHead(200, {
|
|
180
|
+
"Content-Type": "text/event-stream; charset=utf-8",
|
|
181
|
+
"Cache-Control": "no-cache",
|
|
182
|
+
Connection: "keep-alive",
|
|
183
|
+
"Access-Control-Allow-Origin": "*",
|
|
184
|
+
});
|
|
185
|
+
/** Write an SSE event to the response stream. */
|
|
186
|
+
const sendSSE = (data) => {
|
|
187
|
+
if (!res.writableEnded) {
|
|
188
|
+
res.write(`data: ${JSON.stringify(data)}\n\n`);
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
let unsubscribe = null;
|
|
192
|
+
let completed = false;
|
|
193
|
+
/** Clean up subscription. */
|
|
194
|
+
const cleanup = () => {
|
|
195
|
+
if (unsubscribe) {
|
|
196
|
+
unsubscribe();
|
|
197
|
+
unsubscribe = null;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
try {
|
|
201
|
+
const session = await getSession();
|
|
202
|
+
// Subscribe to session events and stream them as SSE
|
|
203
|
+
unsubscribe = session.subscribe((event) => {
|
|
204
|
+
// Forward all events to the client
|
|
205
|
+
sendSSE(event);
|
|
206
|
+
// Close the stream when the agent finishes
|
|
207
|
+
if (event.type === "agent_end") {
|
|
208
|
+
completed = true;
|
|
209
|
+
cleanup();
|
|
210
|
+
if (!res.writableEnded) {
|
|
211
|
+
res.end();
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
// Handle client disconnect mid-stream.
|
|
216
|
+
// `close` fires on any request lifecycle end — only abort if the
|
|
217
|
+
// prompt hasn't completed normally yet.
|
|
218
|
+
req.on("close", () => {
|
|
219
|
+
if (!completed) {
|
|
220
|
+
cleanup();
|
|
221
|
+
// Abort the in-flight LLM call to stop wasting tokens
|
|
222
|
+
abortSession();
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
// Send the prompt
|
|
226
|
+
await session.prompt(fullMessage);
|
|
227
|
+
}
|
|
228
|
+
catch (err) {
|
|
229
|
+
completed = true;
|
|
230
|
+
cleanup();
|
|
231
|
+
const errMessage = err instanceof Error ? err.message : String(err);
|
|
232
|
+
sendSSE({ type: "error", error: errMessage });
|
|
233
|
+
if (!res.writableEnded) {
|
|
234
|
+
res.end();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
// ---------------------------------------------------------------------------
|
|
239
|
+
// Route: GET /api/config/status
|
|
240
|
+
// ---------------------------------------------------------------------------
|
|
241
|
+
function handleConfigStatus(_req, res) {
|
|
242
|
+
sendJson(res, 200, {
|
|
243
|
+
authenticated: isAuthenticated(),
|
|
244
|
+
provider: getAuthProvider(),
|
|
245
|
+
version: getVersion(),
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
// ---------------------------------------------------------------------------
|
|
249
|
+
// Known API routes (for 405 detection)
|
|
250
|
+
// ---------------------------------------------------------------------------
|
|
251
|
+
const API_ROUTES = {
|
|
252
|
+
"/api/version": "GET",
|
|
253
|
+
"/api/agent": "POST",
|
|
254
|
+
"/api/config/status": "GET",
|
|
255
|
+
};
|
|
256
|
+
// ---------------------------------------------------------------------------
|
|
257
|
+
// Request router
|
|
258
|
+
// ---------------------------------------------------------------------------
|
|
259
|
+
async function handleRequest(req, res, taskpaneRoot) {
|
|
260
|
+
const method = req.method ?? "GET";
|
|
261
|
+
const rawUrl = req.url ?? "/";
|
|
262
|
+
// Strip query string for route matching
|
|
263
|
+
const url = rawUrl.split("?")[0];
|
|
264
|
+
// Handle CORS preflight
|
|
265
|
+
if (method === "OPTIONS") {
|
|
266
|
+
res.writeHead(204, {
|
|
267
|
+
"Access-Control-Allow-Origin": "*",
|
|
268
|
+
"Access-Control-Allow-Methods": "GET, POST, OPTIONS",
|
|
269
|
+
"Access-Control-Allow-Headers": "Content-Type",
|
|
270
|
+
"Access-Control-Max-Age": "86400",
|
|
271
|
+
});
|
|
272
|
+
res.end();
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
// Route matching
|
|
276
|
+
if (url.startsWith("/taskpane")) {
|
|
277
|
+
handleTaskpane(req, res, taskpaneRoot);
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
if (url === "/api/version" && method === "GET") {
|
|
281
|
+
handleVersion(req, res);
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
if (url === "/api/agent" && method === "POST") {
|
|
285
|
+
await handleAgent(req, res);
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
if (url === "/api/config/status" && method === "GET") {
|
|
289
|
+
handleConfigStatus(req, res);
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
// 405 Method Not Allowed for known routes with wrong method
|
|
293
|
+
if (url in API_ROUTES) {
|
|
294
|
+
res.writeHead(405, {
|
|
295
|
+
"Content-Type": "application/json; charset=utf-8",
|
|
296
|
+
"Access-Control-Allow-Origin": "*",
|
|
297
|
+
Allow: API_ROUTES[url],
|
|
298
|
+
});
|
|
299
|
+
res.end(JSON.stringify({ error: `Method ${method} not allowed. Use ${API_ROUTES[url]}.` }));
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
// Root redirect to taskpane
|
|
303
|
+
if (url === "/" || url === "") {
|
|
304
|
+
res.writeHead(302, { Location: "/taskpane/" });
|
|
305
|
+
res.end();
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
sendError(res, 404, "Not found");
|
|
309
|
+
}
|
|
310
|
+
// ---------------------------------------------------------------------------
|
|
311
|
+
// Server lifecycle
|
|
312
|
+
// ---------------------------------------------------------------------------
|
|
313
|
+
let serverInstance = null;
|
|
314
|
+
let verbose = false;
|
|
315
|
+
/** Enable or disable request logging. */
|
|
316
|
+
export function setVerbose(enabled) {
|
|
317
|
+
verbose = enabled;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Start the HTTPS server.
|
|
321
|
+
*
|
|
322
|
+
* @param port - Port to listen on (default: 3001)
|
|
323
|
+
* @param certs - Optional pre-loaded certificates. If not provided, will call ensureCerts().
|
|
324
|
+
*/
|
|
325
|
+
export async function startServer(port = 3001, certs) {
|
|
326
|
+
const { key, cert } = certs ?? (await ensureCerts());
|
|
327
|
+
const taskpaneRoot = resolveTaskpaneRoot();
|
|
328
|
+
const server = createServer({ key, cert }, (req, res) => {
|
|
329
|
+
const start = Date.now();
|
|
330
|
+
handleRequest(req, res, taskpaneRoot)
|
|
331
|
+
.then(() => {
|
|
332
|
+
if (verbose) {
|
|
333
|
+
const ms = Date.now() - start;
|
|
334
|
+
console.log(`${req.method} ${req.url} → ${res.statusCode} (${ms}ms)`);
|
|
335
|
+
}
|
|
336
|
+
})
|
|
337
|
+
.catch((err) => {
|
|
338
|
+
console.error("Unhandled request error:", err);
|
|
339
|
+
if (!res.headersSent) {
|
|
340
|
+
sendError(res, 500, "Internal server error");
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
});
|
|
344
|
+
serverInstance = server;
|
|
345
|
+
return new Promise((resolve, reject) => {
|
|
346
|
+
server.on("error", (err) => {
|
|
347
|
+
if (err.code === "EADDRINUSE") {
|
|
348
|
+
reject(new Error(`Port ${port} is already in use. ` +
|
|
349
|
+
`Is another instance of AgentXL running?\n` +
|
|
350
|
+
` Try: agentxl start --port ${port + 1}`));
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
reject(err);
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
server.listen(port, "127.0.0.1", () => {
|
|
357
|
+
resolve();
|
|
358
|
+
});
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Stop the HTTPS server gracefully.
|
|
363
|
+
*/
|
|
364
|
+
export async function stopServer() {
|
|
365
|
+
return new Promise((resolve) => {
|
|
366
|
+
if (!serverInstance) {
|
|
367
|
+
resolve();
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
serverInstance.close(() => {
|
|
371
|
+
serverInstance = null;
|
|
372
|
+
resolve();
|
|
373
|
+
});
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,WAAW,EAAiB,MAAM,YAAY,CAAC;AACxD,OAAO,EACL,eAAe,EACf,eAAe,EACf,UAAU,EACV,YAAY,GACb,MAAM,qBAAqB,CAAC;AAE7B,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,8EAA8E;AAC9E,qCAAqC;AACrC,8EAA8E;AAE9E,MAAM,UAAU,GAA2B;IACzC,OAAO,EAAE,0BAA0B;IACnC,KAAK,EAAE,uCAAuC;IAC9C,MAAM,EAAE,uCAAuC;IAC/C,M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
|
+
xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
|
|
4
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
5
|
+
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
|
|
6
|
+
xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
|
|
7
|
+
xsi:type="TaskPaneApp">
|
|
8
|
+
|
|
9
|
+
<!-- Unique add-in ID -->
|
|
10
|
+
<Id>a1b2c3d4-e5f6-7890-abcd-ef1234567890</Id>
|
|
11
|
+
<Version>1.0.0</Version>
|
|
12
|
+
<ProviderName>DeltaXY</ProviderName>
|
|
13
|
+
<DefaultLocale>en-US</DefaultLocale>
|
|
14
|
+
<DisplayName DefaultValue="AgentXL" />
|
|
15
|
+
<Description DefaultValue="AI-powered Excel assistant. Chat with AI to read data, write formulas, create charts, and more." />
|
|
16
|
+
<SupportUrl DefaultValue="https://github.com/deltaxy-ai/agentxl" />
|
|
17
|
+
|
|
18
|
+
<!-- Icon -->
|
|
19
|
+
<IconUrl DefaultValue="https://localhost:3001/taskpane/assets/icon-32.png" />
|
|
20
|
+
<HighResolutionIconUrl DefaultValue="https://localhost:3001/taskpane/assets/icon-64.png" />
|
|
21
|
+
|
|
22
|
+
<!-- Excel only -->
|
|
23
|
+
<Hosts>
|
|
24
|
+
<Host Name="Workbook" />
|
|
25
|
+
</Hosts>
|
|
26
|
+
|
|
27
|
+
<!-- Permissions -->
|
|
28
|
+
<DefaultSettings>
|
|
29
|
+
<SourceLocation DefaultValue="https://localhost:3001/taskpane/" />
|
|
30
|
+
</DefaultSettings>
|
|
31
|
+
<Permissions>ReadWriteDocument</Permissions>
|
|
32
|
+
|
|
33
|
+
<!-- Ribbon button -->
|
|
34
|
+
<VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
|
|
35
|
+
<Hosts>
|
|
36
|
+
<Host xsi:type="Workbook">
|
|
37
|
+
<DesktopFormFactor>
|
|
38
|
+
<GetStarted>
|
|
39
|
+
<Title resid="getStartedTitle" />
|
|
40
|
+
<Description resid="getStartedDescription" />
|
|
41
|
+
<LearnMoreUrl resid="learnMoreUrl" />
|
|
42
|
+
</GetStarted>
|
|
43
|
+
|
|
44
|
+
<!-- Ribbon extension -->
|
|
45
|
+
<ExtensionPoint xsi:type="PrimaryCommandSurface">
|
|
46
|
+
<OfficeTab id="TabHome">
|
|
47
|
+
<Group id="AgentXLGroup">
|
|
48
|
+
<Label resid="groupLabel" />
|
|
49
|
+
<Icon>
|
|
50
|
+
<bt:Image size="16" resid="icon16" />
|
|
51
|
+
<bt:Image size="32" resid="icon32" />
|
|
52
|
+
<bt:Image size="80" resid="icon80" />
|
|
53
|
+
</Icon>
|
|
54
|
+
<Control xsi:type="Button" id="AgentXLButton">
|
|
55
|
+
<Label resid="buttonLabel" />
|
|
56
|
+
<Supertip>
|
|
57
|
+
<Title resid="buttonLabel" />
|
|
58
|
+
<Description resid="buttonTooltip" />
|
|
59
|
+
</Supertip>
|
|
60
|
+
<Icon>
|
|
61
|
+
<bt:Image size="16" resid="icon16" />
|
|
62
|
+
<bt:Image size="32" resid="icon32" />
|
|
63
|
+
<bt:Image size="80" resid="icon80" />
|
|
64
|
+
</Icon>
|
|
65
|
+
<Action xsi:type="ShowTaskpane">
|
|
66
|
+
<TaskpaneId>AgentXLPane</TaskpaneId>
|
|
67
|
+
<SourceLocation resid="taskpaneUrl" />
|
|
68
|
+
</Action>
|
|
69
|
+
</Control>
|
|
70
|
+
</Group>
|
|
71
|
+
</OfficeTab>
|
|
72
|
+
</ExtensionPoint>
|
|
73
|
+
</DesktopFormFactor>
|
|
74
|
+
</Host>
|
|
75
|
+
</Hosts>
|
|
76
|
+
|
|
77
|
+
<!-- Resources -->
|
|
78
|
+
<Resources>
|
|
79
|
+
<bt:Images>
|
|
80
|
+
<bt:Image id="icon16" DefaultValue="https://localhost:3001/taskpane/assets/icon-16.png" />
|
|
81
|
+
<bt:Image id="icon32" DefaultValue="https://localhost:3001/taskpane/assets/icon-32.png" />
|
|
82
|
+
<bt:Image id="icon80" DefaultValue="https://localhost:3001/taskpane/assets/icon-80.png" />
|
|
83
|
+
</bt:Images>
|
|
84
|
+
<bt:Urls>
|
|
85
|
+
<bt:Url id="taskpaneUrl" DefaultValue="https://localhost:3001/taskpane/" />
|
|
86
|
+
<bt:Url id="learnMoreUrl" DefaultValue="https://github.com/deltaxy-ai/agentxl" />
|
|
87
|
+
</bt:Urls>
|
|
88
|
+
<bt:ShortStrings>
|
|
89
|
+
<bt:String id="groupLabel" DefaultValue="AgentXL" />
|
|
90
|
+
<bt:String id="buttonLabel" DefaultValue="AgentXL" />
|
|
91
|
+
<bt:String id="getStartedTitle" DefaultValue="AgentXL is ready!" />
|
|
92
|
+
</bt:ShortStrings>
|
|
93
|
+
<bt:LongStrings>
|
|
94
|
+
<bt:String id="buttonTooltip" DefaultValue="Open the AgentXL AI assistant panel" />
|
|
95
|
+
<bt:String id="getStartedDescription" DefaultValue="Click the AgentXL button on the Home tab to start chatting with your AI assistant." />
|
|
96
|
+
</bt:LongStrings>
|
|
97
|
+
</Resources>
|
|
98
|
+
</VersionOverrides>
|
|
99
|
+
</OfficeApp>
|