@agenticmail/enterprise 0.5.475 → 0.5.477

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 (56) hide show
  1. package/dist/agent-tools-RJB2SV42.js +14677 -0
  2. package/dist/browser-tool-R7WDY3TI.js +1434 -0
  3. package/dist/chunk-4U77GQRU.js +5555 -0
  4. package/dist/chunk-67TC5JOS.js +7669 -0
  5. package/dist/chunk-6MLEOPNF.js +5670 -0
  6. package/dist/chunk-722P53KA.js +398 -0
  7. package/dist/chunk-CTF2NLZK.js +1657 -0
  8. package/dist/chunk-J7UP2OA5.js +1728 -0
  9. package/dist/chunk-MXYW4RQ7.js +5562 -0
  10. package/dist/chunk-NP4PBHMG.js +615 -0
  11. package/dist/chunk-PENTSXYU.js +242 -0
  12. package/dist/chunk-PLIE3LOT.js +208 -0
  13. package/dist/chunk-POKAN44M.js +1728 -0
  14. package/dist/chunk-PP37VRLO.js +1728 -0
  15. package/dist/chunk-QBEYCUNN.js +359 -0
  16. package/dist/chunk-QM4H2GJM.js +7669 -0
  17. package/dist/chunk-TMCTJWUB.js +2282 -0
  18. package/dist/chunk-TZDUALWO.js +7669 -0
  19. package/dist/chunk-UM3UOOPY.js +2583 -0
  20. package/dist/chunk-XBFT7H32.js +1950 -0
  21. package/dist/chunk-XZIERFHK.js +5562 -0
  22. package/dist/chunk-YWK66HN4.js +2641 -0
  23. package/dist/chunk-ZDJ254GY.js +2245 -0
  24. package/dist/cli-agent-M7REF5OE.js +2804 -0
  25. package/dist/cli-agent-P2U4ZUD3.js +2804 -0
  26. package/dist/cli-agent-USML6W7I.js +2804 -0
  27. package/dist/cli-serve-HDZAJG2F.js +322 -0
  28. package/dist/cli-serve-ODFHW3S2.js +322 -0
  29. package/dist/cli-serve-ZSDGJTHH.js +322 -0
  30. package/dist/cli.js +3 -3
  31. package/dist/dashboard/pages/settings.js +89 -4
  32. package/dist/index.js +9 -9
  33. package/dist/integrations-Z4OZ273A.js +43830 -0
  34. package/dist/mcp-server-tools-ZKDEIXHX.js +61 -0
  35. package/dist/meetings-4GFVH2GP.js +12 -0
  36. package/dist/microsoft-RDBD62YR.js +4159 -0
  37. package/dist/pipeline-SM62YB6A.js +15 -0
  38. package/dist/polymarket-IABF2P2W.js +17 -0
  39. package/dist/polymarket-runtime-LTSW26FX.js +108 -0
  40. package/dist/polymarket-watcher-Z37AND7B.js +23 -0
  41. package/dist/pw-ai-N5BXPQCC.js +2325 -0
  42. package/dist/routes-LYYVXQAF.js +10 -0
  43. package/dist/runtime-5AITYSX3.js +50 -0
  44. package/dist/runtime-HQYHUPJR.js +50 -0
  45. package/dist/runtime-PNFAVDWW.js +50 -0
  46. package/dist/screener-TATCEETD.js +26 -0
  47. package/dist/server-EXSJY5UT.js +36 -0
  48. package/dist/server-QEZAMZEU.js +36 -0
  49. package/dist/server-ZYEGUITS.js +36 -0
  50. package/dist/server-context-Y7TAVBIC.js +12 -0
  51. package/dist/server-middleware-H5UE6XVF.js +153 -0
  52. package/dist/setup-2VCHQGNM.js +20 -0
  53. package/dist/setup-AT3INBWV.js +20 -0
  54. package/dist/setup-XWWT4X3T.js +20 -0
  55. package/logs/cloudflared-error.log +22 -0
  56. package/package.json +1 -1
@@ -0,0 +1,322 @@
1
+ import "./chunk-KFQGP6VL.js";
2
+
3
+ // src/cli-serve.ts
4
+ import { existsSync, readFileSync } from "fs";
5
+ import { join } from "path";
6
+ import { homedir } from "os";
7
+ function loadEnvFile() {
8
+ const candidates = [
9
+ join(process.cwd(), ".env"),
10
+ join(homedir(), ".agenticmail", ".env")
11
+ ];
12
+ for (const envPath of candidates) {
13
+ if (!existsSync(envPath)) continue;
14
+ try {
15
+ const content = readFileSync(envPath, "utf8");
16
+ for (const line of content.split("\n")) {
17
+ const trimmed = line.trim();
18
+ if (!trimmed || trimmed.startsWith("#")) continue;
19
+ const eq = trimmed.indexOf("=");
20
+ if (eq < 0) continue;
21
+ const key = trimmed.slice(0, eq).trim();
22
+ let val = trimmed.slice(eq + 1).trim();
23
+ if (val.startsWith('"') && val.endsWith('"') || val.startsWith("'") && val.endsWith("'")) {
24
+ val = val.slice(1, -1);
25
+ }
26
+ if (!process.env[key]) process.env[key] = val;
27
+ }
28
+ console.log(`Loaded config from ${envPath}`);
29
+ return;
30
+ } catch {
31
+ }
32
+ }
33
+ }
34
+ async function ensureSecrets() {
35
+ const { randomUUID } = await import("crypto");
36
+ const envDir = join(homedir(), ".agenticmail");
37
+ const envPath = join(envDir, ".env");
38
+ let dirty = false;
39
+ if (!process.env.JWT_SECRET) {
40
+ process.env.JWT_SECRET = randomUUID() + randomUUID();
41
+ dirty = true;
42
+ console.log("[startup] Generated new JWT_SECRET (existing sessions will need to re-login)");
43
+ }
44
+ if (!process.env.AGENTICMAIL_VAULT_KEY) {
45
+ process.env.AGENTICMAIL_VAULT_KEY = randomUUID() + randomUUID();
46
+ dirty = true;
47
+ console.log("[startup] Generated new AGENTICMAIL_VAULT_KEY");
48
+ console.log("[startup] \u26A0\uFE0F Previously encrypted credentials will need to be re-entered in the dashboard");
49
+ }
50
+ if (dirty) {
51
+ try {
52
+ if (!existsSync(envDir)) {
53
+ const { mkdirSync } = await import("fs");
54
+ mkdirSync(envDir, { recursive: true });
55
+ }
56
+ const { appendFileSync } = await import("fs");
57
+ const lines = [];
58
+ let existing = "";
59
+ if (existsSync(envPath)) {
60
+ existing = readFileSync(envPath, "utf8");
61
+ }
62
+ if (!existing.includes("JWT_SECRET=")) {
63
+ lines.push(`JWT_SECRET=${process.env.JWT_SECRET}`);
64
+ }
65
+ if (!existing.includes("AGENTICMAIL_VAULT_KEY=")) {
66
+ lines.push(`AGENTICMAIL_VAULT_KEY=${process.env.AGENTICMAIL_VAULT_KEY}`);
67
+ }
68
+ if (lines.length) {
69
+ appendFileSync(envPath, "\n" + lines.join("\n") + "\n", { mode: 384 });
70
+ console.log(`[startup] Saved secrets to ${envPath}`);
71
+ }
72
+ } catch (e) {
73
+ console.warn(`[startup] Could not save secrets to ${envPath}: ${e.message}`);
74
+ }
75
+ }
76
+ }
77
+ async function runServe(_args) {
78
+ loadEnvFile();
79
+ const DATABASE_URL = process.env.DATABASE_URL;
80
+ const PORT = parseInt(process.env.PORT || "8080", 10);
81
+ await ensureSecrets();
82
+ const JWT_SECRET = process.env.JWT_SECRET;
83
+ const _VAULT_KEY = process.env.AGENTICMAIL_VAULT_KEY;
84
+ if (!DATABASE_URL) {
85
+ console.error("ERROR: DATABASE_URL is required.");
86
+ console.error("");
87
+ console.error("Set it via environment variable or .env file:");
88
+ console.error(" DATABASE_URL=postgresql://user:pass@host:5432/db npx @agenticmail/enterprise start");
89
+ console.error("");
90
+ console.error("Or create a .env file (in cwd or ~/.agenticmail/.env):");
91
+ console.error(" DATABASE_URL=postgresql://user:pass@host:5432/db");
92
+ console.error(" JWT_SECRET=your-secret-here");
93
+ console.error(" PORT=3200");
94
+ process.exit(1);
95
+ }
96
+ const { createAdapter, smartDbConfig } = await import("./factory-R6MMSC2X.js");
97
+ const { createServer } = await import("./server-QEZAMZEU.js");
98
+ const db = await createAdapter(smartDbConfig(DATABASE_URL));
99
+ await db.migrate();
100
+ const server = createServer({
101
+ port: PORT,
102
+ db,
103
+ jwtSecret: JWT_SECRET,
104
+ corsOrigins: ["*"]
105
+ });
106
+ await server.start();
107
+ console.log(`AgenticMail Enterprise server running on :${PORT}`);
108
+ try {
109
+ const { startWatcherEngine, initWatcherTables, setWatcherRuntime } = await import("./polymarket-watcher-4H6Z37OA.js");
110
+ const edb = db.getEngineDB?.();
111
+ if (edb) {
112
+ await initWatcherTables(edb);
113
+ startWatcherEngine(db, {
114
+ log: (...args) => console.log(...args),
115
+ onEvent: (agentId, event) => {
116
+ if (event.severity === "critical") {
117
+ console.log(`[poly-watcher] CRITICAL signal for agent ${agentId}: ${event.title}`);
118
+ }
119
+ }
120
+ });
121
+ setTimeout(async () => {
122
+ try {
123
+ const routes = await import("./routes-ZIQX65BT.js");
124
+ setWatcherRuntime(
125
+ () => routes.getRuntime?.() || null
126
+ );
127
+ } catch (e) {
128
+ console.warn("[poly-watcher] Could not inject runtime:", e.message);
129
+ }
130
+ }, 5e3);
131
+ console.log("[startup] Polymarket watcher engine started");
132
+ }
133
+ setTimeout(async () => {
134
+ try {
135
+ const { autoConnectProxy } = await import("./polymarket-runtime-NH3NSZ5Y.js");
136
+ const pdb = db.getEngineDB?.();
137
+ if (pdb) await autoConnectProxy(pdb);
138
+ } catch {
139
+ }
140
+ }, 8e3);
141
+ } catch (e) {
142
+ console.warn("[startup] Polymarket watcher engine skipped:", e.message);
143
+ }
144
+ try {
145
+ const { startBackgroundUpdateCheck } = await import("./cli-update-SX7GACL3.js");
146
+ startBackgroundUpdateCheck();
147
+ } catch {
148
+ }
149
+ try {
150
+ const { startPreventSleep } = await import("./screen-unlock-4RPZBHOI.js");
151
+ const adminDb = server.getAdminDb?.() || server.adminDb;
152
+ if (adminDb) {
153
+ const settings = await adminDb.getSettings?.().catch(() => null);
154
+ const screenAccess = settings?.securityConfig?.screenAccess;
155
+ if (screenAccess?.enabled && screenAccess?.preventSleep) {
156
+ startPreventSleep();
157
+ console.log("[startup] Prevent-sleep enabled \u2014 system will stay awake while agents are active");
158
+ }
159
+ }
160
+ } catch {
161
+ }
162
+ try {
163
+ await setupSystemPersistence();
164
+ } catch (e) {
165
+ console.warn("[startup] System persistence setup skipped: " + e.message);
166
+ }
167
+ const tunnelToken = process.env.CLOUDFLARED_TOKEN;
168
+ if (tunnelToken) {
169
+ try {
170
+ const { execSync, spawn } = await import("child_process");
171
+ try {
172
+ execSync(process.platform === "win32" ? "where cloudflared" : "which cloudflared", { timeout: 3e3 });
173
+ } catch {
174
+ console.log("[startup] cloudflared not found \u2014 skipping tunnel auto-start");
175
+ console.log("[startup] Install cloudflared to enable tunnel: https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/");
176
+ return;
177
+ }
178
+ try {
179
+ if (process.platform === "win32") {
180
+ const tasklist = execSync('tasklist /FI "IMAGENAME eq cloudflared.exe" /NH', { encoding: "utf8", timeout: 5e3 });
181
+ if (tasklist.includes("cloudflared.exe")) {
182
+ console.log("[startup] cloudflared tunnel already running");
183
+ return;
184
+ }
185
+ } else {
186
+ execSync('pgrep -f "cloudflared.*tunnel.*run"', { timeout: 3e3 });
187
+ console.log("[startup] cloudflared tunnel already running");
188
+ return;
189
+ }
190
+ } catch {
191
+ }
192
+ const subdomain = process.env.AGENTICMAIL_SUBDOMAIN || process.env.AGENTICMAIL_DOMAIN || "";
193
+ console.log(`[startup] Starting cloudflared tunnel${subdomain ? ` for ${subdomain}.agenticmail.io` : ""}...`);
194
+ let cfBin = "cloudflared";
195
+ if (process.platform === "win32") {
196
+ try {
197
+ cfBin = execSync("where cloudflared", { encoding: "utf8", timeout: 3e3 }).trim().split("\n")[0].trim();
198
+ } catch {
199
+ const candidate = `${process.env.LOCALAPPDATA || ""}\\cloudflared\\cloudflared.exe`;
200
+ try {
201
+ (await import("fs")).statSync(candidate);
202
+ cfBin = candidate;
203
+ } catch {
204
+ }
205
+ }
206
+ }
207
+ const child = spawn(cfBin, ["tunnel", "--no-autoupdate", "run", "--token", tunnelToken], {
208
+ detached: true,
209
+ stdio: "ignore"
210
+ });
211
+ child.unref();
212
+ console.log("[startup] cloudflared tunnel started (pid " + child.pid + ")");
213
+ } catch (e) {
214
+ console.warn("[startup] Could not auto-start cloudflared: " + e.message);
215
+ }
216
+ }
217
+ }
218
+ async function setupSystemPersistence() {
219
+ const { execSync, spawnSync } = await import("child_process");
220
+ const { existsSync: exists, writeFileSync, mkdirSync } = await import("fs");
221
+ const { join: pathJoin } = await import("path");
222
+ const platform = process.platform;
223
+ if (!process.env.PM2_HOME && !process.env.pm_id) {
224
+ return;
225
+ }
226
+ const markerDir = pathJoin(homedir(), ".agenticmail");
227
+ const markerFile = pathJoin(markerDir, ".persistence-configured");
228
+ if (exists(markerFile)) {
229
+ try {
230
+ execSync("pm2 save --silent", { timeout: 1e4, stdio: "ignore" });
231
+ } catch {
232
+ }
233
+ return;
234
+ }
235
+ console.log("[startup] Configuring system persistence (one-time setup)...");
236
+ try {
237
+ if (platform === "darwin") {
238
+ const result = spawnSync("pm2", ["startup", "launchd", "--silent"], {
239
+ timeout: 15e3,
240
+ stdio: "pipe",
241
+ encoding: "utf-8"
242
+ });
243
+ const output = (result.stdout || "") + (result.stderr || "");
244
+ const sudoMatch = output.match(/sudo\s+env\s+.*pm2\s+startup.*/);
245
+ if (sudoMatch) {
246
+ console.log("[startup] PM2 startup requires sudo. Run this once:");
247
+ console.log(" " + sudoMatch[0]);
248
+ } else {
249
+ console.log("[startup] PM2 startup configured (launchd)");
250
+ }
251
+ const plistPath = pathJoin(homedir(), "Library", "LaunchAgents", `pm2.${process.env.USER || "user"}.plist`);
252
+ if (exists(plistPath)) {
253
+ try {
254
+ execSync(`launchctl load -w "${plistPath}"`, { timeout: 5e3, stdio: "ignore" });
255
+ } catch {
256
+ }
257
+ }
258
+ } else if (platform === "linux") {
259
+ const result = spawnSync("pm2", ["startup", "systemd", "--silent"], {
260
+ timeout: 15e3,
261
+ stdio: "pipe",
262
+ encoding: "utf-8"
263
+ });
264
+ const output = (result.stdout || "") + (result.stderr || "");
265
+ const sudoMatch = output.match(/sudo\s+env\s+.*pm2\s+startup.*/);
266
+ if (sudoMatch) {
267
+ try {
268
+ execSync(sudoMatch[0], { timeout: 15e3, stdio: "ignore" });
269
+ console.log("[startup] PM2 startup configured (systemd)");
270
+ } catch {
271
+ console.log("[startup] PM2 startup requires root. Run this once:");
272
+ console.log(" " + sudoMatch[0]);
273
+ }
274
+ } else {
275
+ console.log("[startup] PM2 startup configured (systemd)");
276
+ }
277
+ } else if (platform === "win32") {
278
+ try {
279
+ execSync("npm list -g pm2-windows-startup", { timeout: 1e4, stdio: "ignore" });
280
+ } catch {
281
+ console.log("[startup] Installing pm2-windows-startup...");
282
+ try {
283
+ execSync("npm install -g pm2-windows-startup", { timeout: 6e4, stdio: "ignore" });
284
+ execSync("pm2-startup install", { timeout: 15e3, stdio: "ignore" });
285
+ console.log("[startup] PM2 startup configured (Windows Service)");
286
+ } catch (e) {
287
+ console.warn("[startup] Could not install pm2-windows-startup: " + e.message);
288
+ }
289
+ }
290
+ }
291
+ } catch (e) {
292
+ console.warn("[startup] PM2 startup setup: " + e.message);
293
+ }
294
+ try {
295
+ const moduleList = execSync("pm2 ls --silent 2>/dev/null || true", { timeout: 1e4, encoding: "utf-8" });
296
+ if (!moduleList.includes("pm2-logrotate")) {
297
+ console.log("[startup] Installing pm2-logrotate...");
298
+ execSync("pm2 install pm2-logrotate --silent", { timeout: 6e4, stdio: "ignore" });
299
+ execSync("pm2 set pm2-logrotate:max_size 10M --silent", { timeout: 5e3, stdio: "ignore" });
300
+ execSync("pm2 set pm2-logrotate:retain 5 --silent", { timeout: 5e3, stdio: "ignore" });
301
+ execSync("pm2 set pm2-logrotate:compress true --silent", { timeout: 5e3, stdio: "ignore" });
302
+ console.log("[startup] Log rotation configured (10MB, 5 files)");
303
+ }
304
+ } catch {
305
+ }
306
+ try {
307
+ execSync("pm2 save --silent", { timeout: 1e4, stdio: "ignore" });
308
+ console.log("[startup] Process list saved");
309
+ } catch {
310
+ }
311
+ try {
312
+ if (!exists(markerDir)) mkdirSync(markerDir, { recursive: true });
313
+ writeFileSync(markerFile, (/* @__PURE__ */ new Date()).toISOString() + `
314
+ platform=${platform}
315
+ `, { mode: 384 });
316
+ console.log("[startup] System persistence configured successfully");
317
+ } catch {
318
+ }
319
+ }
320
+ export {
321
+ runServe
322
+ };
package/dist/cli.js CHANGED
@@ -65,14 +65,14 @@ Skill Development:
65
65
  break;
66
66
  case "serve":
67
67
  case "start":
68
- import("./cli-serve-V4Z4RCMT.js").then((m) => m.runServe(args.slice(1))).catch(fatal);
68
+ import("./cli-serve-HDZAJG2F.js").then((m) => m.runServe(args.slice(1))).catch(fatal);
69
69
  break;
70
70
  case "agent":
71
- import("./cli-agent-YUG7TRUU.js").then((m) => m.runAgent(args.slice(1))).catch(fatal);
71
+ import("./cli-agent-P2U4ZUD3.js").then((m) => m.runAgent(args.slice(1))).catch(fatal);
72
72
  break;
73
73
  case "setup":
74
74
  default:
75
- import("./setup-FHFQQ4LK.js").then((m) => m.runSetupWizard()).catch(fatal);
75
+ import("./setup-2VCHQGNM.js").then((m) => m.runSetupWizard()).catch(fatal);
76
76
  break;
77
77
  }
78
78
  function fatal(err) {
@@ -138,7 +138,8 @@ export function SettingsPage() {
138
138
  var cfg = d.toolSecurityConfig || {};
139
139
  setToolSec({
140
140
  security: cfg.security || { pathSandbox: { enabled: true, allowedDirs: [], blockedPatterns: [] }, ssrf: { enabled: true, allowedHosts: [], blockedCidrs: [] }, commandSanitizer: { enabled: true, mode: 'blocklist', allowedCommands: [], blockedPatterns: [] } },
141
- middleware: cfg.middleware || { audit: { enabled: true, redactKeys: [] }, rateLimit: { enabled: true, overrides: {} }, circuitBreaker: { enabled: true }, telemetry: { enabled: true } }
141
+ middleware: cfg.middleware || { audit: { enabled: true, redactKeys: [] }, rateLimit: { enabled: true, overrides: {} }, circuitBreaker: { enabled: true }, telemetry: { enabled: true } },
142
+ toolConfig: cfg.toolConfig || {}
142
143
  });
143
144
  }).catch(() => {});
144
145
  apiCall('/settings/firewall').then(function(d) {
@@ -1014,7 +1015,7 @@ export function SettingsPage() {
1014
1015
  tab === 'tool-security' && h(ToolSecurityTab, { toolSec: toolSec, setToolSec: function(v) { setToolSec(v); setToolSecDirty(true); }, saving: toolSecSaving, dirty: toolSecDirty, onSave: function() {
1015
1016
  setToolSecSaving(true);
1016
1017
  apiCall('/settings/tool-security', { method: 'PUT', body: JSON.stringify(toolSec) })
1017
- .then(function(d) { setToolSec({ security: (d.toolSecurityConfig || {}).security || toolSec.security, middleware: (d.toolSecurityConfig || {}).middleware || toolSec.middleware }); setToolSecDirty(false); toast('Tool security settings saved', 'success'); })
1018
+ .then(function(d) { var c = d.toolSecurityConfig || {}; setToolSec({ security: c.security || toolSec.security, middleware: c.middleware || toolSec.middleware, toolConfig: c.toolConfig || toolSec.toolConfig }); setToolSecDirty(false); toast('Tool security settings saved', 'success'); })
1018
1019
  .catch(function(e) { toast(e.message, 'error'); })
1019
1020
  .finally(function() { setToolSecSaving(false); });
1020
1021
  } }),
@@ -1347,17 +1348,29 @@ function ToolSecurityTab(props) {
1347
1348
 
1348
1349
  var sec = toolSec.security || {};
1349
1350
  var mw = toolSec.middleware || {};
1351
+ var tc = toolSec.toolConfig || {};
1352
+ var ws = (tc.web && tc.web.search) || {};
1350
1353
 
1351
1354
  var setSec = function(key, value) {
1352
1355
  var next = Object.assign({}, sec);
1353
1356
  next[key] = value;
1354
- setToolSec({ security: next, middleware: mw });
1357
+ setToolSec({ security: next, middleware: mw, toolConfig: tc });
1355
1358
  };
1356
1359
 
1357
1360
  var setMw = function(key, value) {
1358
1361
  var next = Object.assign({}, mw);
1359
1362
  next[key] = value;
1360
- setToolSec({ security: sec, middleware: next });
1363
+ setToolSec({ security: sec, middleware: next, toolConfig: tc });
1364
+ };
1365
+
1366
+ var setWebSearch = function(field, value) {
1367
+ var nextWs = Object.assign({}, ws);
1368
+ nextWs[field] = value;
1369
+ var nextWeb = Object.assign({}, tc.web || {});
1370
+ nextWeb.search = nextWs;
1371
+ var nextTc = Object.assign({}, tc);
1372
+ nextTc.web = nextWeb;
1373
+ setToolSec({ security: sec, middleware: mw, toolConfig: nextTc });
1361
1374
  };
1362
1375
 
1363
1376
  var patchSec = function(section, field, value) {
@@ -1399,6 +1412,78 @@ function ToolSecurityTab(props) {
1399
1412
  }, saving ? 'Saving...' : 'Save Settings')
1400
1413
  ),
1401
1414
 
1415
+ // ── WEB SEARCH CONFIG ──
1416
+ h('div', { style: _sectionTitleStyle }, 'Web Search'),
1417
+ h('div', { style: _gridStyle },
1418
+ h('div', { style: Object.assign({}, _cardStyle, { gridColumn: '1 / -1' }) },
1419
+ h('div', { style: _cardTitleStyle }, I.globe(), ' Web Search API Keys'),
1420
+ h('div', { style: _cardDescStyle }, 'Configure API keys for agent web search. Without a key, agents fall back to DuckDuckGo (free but limited). Brave is recommended for best results.'),
1421
+ h('div', { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 16, marginTop: 12 } },
1422
+ h('div', null,
1423
+ h('label', { style: { fontSize: 13, fontWeight: 500 } }, 'Search Provider'),
1424
+ h('select', {
1425
+ style: { width: '100%', padding: '8px 12px', borderRadius: 8, border: '1px solid var(--border)', background: 'var(--bg-secondary)', color: 'var(--text-primary)', marginTop: 4 },
1426
+ value: ws.provider || 'brave',
1427
+ onChange: function(e) { setWebSearch('provider', e.target.value); }
1428
+ },
1429
+ h('option', { value: 'brave' }, 'Brave Search (recommended)'),
1430
+ h('option', { value: 'perplexity' }, 'Perplexity Sonar'),
1431
+ h('option', { value: 'grok' }, 'xAI Grok')
1432
+ )
1433
+ ),
1434
+ h('div', null,
1435
+ h('label', { style: { fontSize: 13, fontWeight: 500 } }, 'Max Results'),
1436
+ h('input', {
1437
+ type: 'number', min: 1, max: 10,
1438
+ style: { width: '100%', padding: '8px 12px', borderRadius: 8, border: '1px solid var(--border)', background: 'var(--bg-secondary)', color: 'var(--text-primary)', marginTop: 4 },
1439
+ value: ws.maxResults || 5,
1440
+ onChange: function(e) { setWebSearch('maxResults', parseInt(e.target.value) || 5); }
1441
+ })
1442
+ )
1443
+ ),
1444
+ h('div', { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 16, marginTop: 16 } },
1445
+ h('div', null,
1446
+ h('label', { style: { fontSize: 13, fontWeight: 500 } }, 'Brave API Key'),
1447
+ h('input', {
1448
+ type: 'password', placeholder: 'BSA...',
1449
+ style: { width: '100%', padding: '8px 12px', borderRadius: 8, border: '1px solid var(--border)', background: 'var(--bg-secondary)', color: 'var(--text-primary)', marginTop: 4 },
1450
+ value: ws.apiKey || '',
1451
+ onChange: function(e) { setWebSearch('apiKey', e.target.value); }
1452
+ }),
1453
+ h('div', { style: { fontSize: 11, color: 'var(--text-muted)', marginTop: 4 } }, 'Get key at api.search.brave.com')
1454
+ ),
1455
+ h('div', null,
1456
+ h('label', { style: { fontSize: 13, fontWeight: 500 } }, 'Perplexity API Key'),
1457
+ h('input', {
1458
+ type: 'password', placeholder: 'pplx-...',
1459
+ style: { width: '100%', padding: '8px 12px', borderRadius: 8, border: '1px solid var(--border)', background: 'var(--bg-secondary)', color: 'var(--text-primary)', marginTop: 4 },
1460
+ value: (ws.perplexity && ws.perplexity.apiKey) || '',
1461
+ onChange: function(e) {
1462
+ var nextP = Object.assign({}, ws.perplexity || {});
1463
+ nextP.apiKey = e.target.value;
1464
+ setWebSearch('perplexity', nextP);
1465
+ }
1466
+ }),
1467
+ h('div', { style: { fontSize: 11, color: 'var(--text-muted)', marginTop: 4 } }, 'Get key at perplexity.ai')
1468
+ ),
1469
+ h('div', null,
1470
+ h('label', { style: { fontSize: 13, fontWeight: 500 } }, 'xAI / Grok API Key'),
1471
+ h('input', {
1472
+ type: 'password', placeholder: 'xai-...',
1473
+ style: { width: '100%', padding: '8px 12px', borderRadius: 8, border: '1px solid var(--border)', background: 'var(--bg-secondary)', color: 'var(--text-primary)', marginTop: 4 },
1474
+ value: (ws.grok && ws.grok.apiKey) || '',
1475
+ onChange: function(e) {
1476
+ var nextG = Object.assign({}, ws.grok || {});
1477
+ nextG.apiKey = e.target.value;
1478
+ setWebSearch('grok', nextG);
1479
+ }
1480
+ }),
1481
+ h('div', { style: { fontSize: 11, color: 'var(--text-muted)', marginTop: 4 } }, 'Get key at console.x.ai')
1482
+ )
1483
+ )
1484
+ )
1485
+ ),
1486
+
1402
1487
  // ── SECURITY SECTION ──
1403
1488
  h('div', { style: _sectionTitleStyle }, 'Security Sandboxes'),
1404
1489
  h('div', { style: _gridStyle },
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  provision,
9
9
  runSetupWizard
10
- } from "./chunk-EUXDCTOG.js";
10
+ } from "./chunk-PP37VRLO.js";
11
11
  import {
12
12
  AgenticMailManager,
13
13
  GoogleEmailProvider,
@@ -28,7 +28,7 @@ import {
28
28
  executeTool,
29
29
  runAgentLoop,
30
30
  toolsToDefinitions
31
- } from "./chunk-3S6BEAWO.js";
31
+ } from "./chunk-XZIERFHK.js";
32
32
  import "./chunk-CFR5OSMI.js";
33
33
  import {
34
34
  ValidationError,
@@ -43,7 +43,7 @@ import {
43
43
  requireRole,
44
44
  securityHeaders,
45
45
  validate
46
- } from "./chunk-JDZHIZHW.js";
46
+ } from "./chunk-67TC5JOS.js";
47
47
  import "./chunk-DJBCRQTD.js";
48
48
  import {
49
49
  PROVIDER_REGISTRY,
@@ -117,18 +117,18 @@ import {
117
117
  init_agent_config,
118
118
  init_deployer
119
119
  } from "./chunk-PSZU6FMQ.js";
120
- import "./chunk-XFM5P2LE.js";
121
- import "./chunk-ZB3VC2MR.js";
120
+ import "./chunk-6MLEOPNF.js";
121
+ import "./chunk-PLIE3LOT.js";
122
122
  import "./chunk-I5IGHBXW.js";
123
- import "./chunk-FWA7OIDL.js";
123
+ import "./chunk-CTF2NLZK.js";
124
124
  import {
125
125
  SecureVault,
126
126
  init_vault
127
127
  } from "./chunk-WUAWWKTN.js";
128
- import "./chunk-SDETR7MX.js";
129
- import "./chunk-SP6ZE3MA.js";
128
+ import "./chunk-YWK66HN4.js";
129
+ import "./chunk-722P53KA.js";
130
130
  import "./chunk-CVFIM72Q.js";
131
- import "./chunk-7JDCMIZM.js";
131
+ import "./chunk-TMCTJWUB.js";
132
132
  import {
133
133
  CircuitBreaker,
134
134
  CircuitOpenError,