agentxl 1.1.2 → 1.1.4

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.
@@ -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