@agenticmail/enterprise 0.5.356 → 0.5.358
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/dist/{agent-heartbeat-PYHXBAE7.js → agent-heartbeat-VAQTRYST.js} +1 -1
- package/dist/{agent-provisioner-JIT6CRPU.js → agent-provisioner-5KANSYPK.js} +5 -0
- package/dist/{agent-tools-LOVO4CLJ.js → agent-tools-7T6F3LFY.js} +13 -1
- package/dist/{chunk-SZZA4BSH.js → chunk-5OC5AFG2.js} +19 -19
- package/dist/{chunk-TU7FRKZL.js → chunk-7MEE4SHG.js} +14 -14
- package/dist/{chunk-3IEMACO4.js → chunk-FT5MAYTU.js} +1 -1
- package/dist/{chunk-3AFK5YEN.js → chunk-J7DJJVGJ.js} +14 -4
- package/dist/{chunk-SALT6LA7.js → chunk-ZMQ33664.js} +2 -2
- package/dist/{cli-agent-3JLUPKT3.js → cli-agent-OI6MKURJ.js} +6 -6
- package/dist/{cli-serve-XJIH6NU5.js → cli-serve-J7SHRJI6.js} +1 -1
- package/dist/cli.js +3 -3
- package/dist/{deployer-JJYWIRFH.js → deployer-HN7HPTZU.js} +1 -1
- package/dist/index.js +5 -5
- package/dist/{routes-AKBXVVBO.js → routes-L5POMDQZ.js} +2 -2
- package/dist/{runtime-RUUAQLGF.js → runtime-7IHHKSYG.js} +1 -1
- package/dist/{server-ZCR4UDK3.js → server-56DMUKYJ.js} +3 -3
- package/dist/{setup-CIOC7ON7.js → setup-2XFEQCY2.js} +1 -1
- package/dist/{smtp-email-WGUG4M45.js → smtp-email-UZ53LCJ7.js} +6 -2
- package/package.json +1 -1
|
@@ -466,7 +466,7 @@ var AgentHeartbeatManager = class {
|
|
|
466
466
|
return;
|
|
467
467
|
}
|
|
468
468
|
try {
|
|
469
|
-
const { guardrails } = await import("./routes-
|
|
469
|
+
const { guardrails } = await import("./routes-L5POMDQZ.js");
|
|
470
470
|
const status = await guardrails.getStatus(ctx.agentId);
|
|
471
471
|
if (status.paused || status.offDuty) {
|
|
472
472
|
console.log(`[heartbeat] Skipping action dispatch \u2014 agent is ${status.offDuty ? "off duty" : "paused"}`);
|
|
@@ -83,6 +83,11 @@ function provisionAgent(config) {
|
|
|
83
83
|
const m = mainEnvContent.match(new RegExp(`^${key}=(.+)$`, "m"));
|
|
84
84
|
if (m) envLines.push(`${key}=${m[1]}`);
|
|
85
85
|
}
|
|
86
|
+
if (!envLines.some((l) => l.startsWith("ENTERPRISE_URL="))) {
|
|
87
|
+
const portMatch = mainEnvContent.match(/^PORT=(\d+)$/m);
|
|
88
|
+
const serverPort = portMatch ? portMatch[1] : process.env.PORT || "8080";
|
|
89
|
+
envLines.push(`ENTERPRISE_URL=http://localhost:${serverPort}`);
|
|
90
|
+
}
|
|
86
91
|
try {
|
|
87
92
|
writeFileSync(envFile, envLines.join("\n") + "\n");
|
|
88
93
|
} catch (e) {
|
|
@@ -13752,7 +13752,7 @@ async function createAllTools(options) {
|
|
|
13752
13752
|
var smtpEmailTools = [];
|
|
13753
13753
|
if (options?.emailConfig?.smtpHost && !tp) {
|
|
13754
13754
|
try {
|
|
13755
|
-
var { executeSmtpEmailTool, getSmtpEmailTools: getSmtpIds } = await import("./smtp-email-
|
|
13755
|
+
var { executeSmtpEmailTool, getSmtpEmailTools: getSmtpIds } = await import("./smtp-email-UZ53LCJ7.js");
|
|
13756
13756
|
var smtpToolIds = getSmtpIds();
|
|
13757
13757
|
var smtpToolDefs = {
|
|
13758
13758
|
email_send: { desc: "Send an email via SMTP", params: { type: "object", properties: { to: { type: "string", description: "Recipient email" }, cc: { type: "string" }, bcc: { type: "string" }, subject: { type: "string" }, body: { type: "string", description: "Email body text" }, html: { type: "string" }, replyTo: { type: "string" } }, required: ["to", "body"] } },
|
|
@@ -13790,6 +13790,18 @@ async function createAllTools(options) {
|
|
|
13790
13790
|
}
|
|
13791
13791
|
if (smtpEmailTools.length > 0) {
|
|
13792
13792
|
console.log(`[tools] Loaded ${smtpEmailTools.length} SMTP/IMAP email tools for ${emailCfg.email || emailCfg.smtpUser}`);
|
|
13793
|
+
if (options?.permissionEngine) {
|
|
13794
|
+
const smtpDefs = smtpEmailTools.map((t) => ({
|
|
13795
|
+
id: t.name,
|
|
13796
|
+
name: t.name,
|
|
13797
|
+
description: t.description || t.name,
|
|
13798
|
+
category: "communicate",
|
|
13799
|
+
risk: t.name.includes("send") || t.name.includes("reply") || t.name.includes("forward") ? "high" : "low",
|
|
13800
|
+
skillId: "smtp-email",
|
|
13801
|
+
sideEffects: t.name.includes("send") || t.name.includes("reply") || t.name.includes("forward") ? ["sends-email"] : []
|
|
13802
|
+
}));
|
|
13803
|
+
options.permissionEngine.registerDynamicTools("smtp-email", smtpDefs);
|
|
13804
|
+
}
|
|
13793
13805
|
}
|
|
13794
13806
|
} catch (e) {
|
|
13795
13807
|
console.warn(`[tools] SMTP email tools load failed: ${e.message}`);
|
|
@@ -356,7 +356,7 @@ function createRuntimeHooks(deps) {
|
|
|
356
356
|
var injectedMessages = [...messages];
|
|
357
357
|
if (deps.knowledgeBaseEnabled !== false) {
|
|
358
358
|
try {
|
|
359
|
-
var { knowledgeBase } = await import("./routes-
|
|
359
|
+
var { knowledgeBase } = await import("./routes-L5POMDQZ.js");
|
|
360
360
|
var kbs = await knowledgeBase.listForAgent(agentId);
|
|
361
361
|
if (kbs.length > 0) {
|
|
362
362
|
var contextParts = [];
|
|
@@ -389,7 +389,7 @@ ${contextParts.join("\n\n")}`;
|
|
|
389
389
|
}
|
|
390
390
|
if (deps.memoryEnabled !== false) {
|
|
391
391
|
try {
|
|
392
|
-
var { memoryManager } = await import("./routes-
|
|
392
|
+
var { memoryManager } = await import("./routes-L5POMDQZ.js");
|
|
393
393
|
var memories = await memoryManager.queryMemories({
|
|
394
394
|
agentId,
|
|
395
395
|
limit: 10,
|
|
@@ -410,7 +410,7 @@ ${memories.map(function(m) {
|
|
|
410
410
|
}
|
|
411
411
|
if (deps.policyEnabled !== false) {
|
|
412
412
|
try {
|
|
413
|
-
var { policyEngine } = await import("./routes-
|
|
413
|
+
var { policyEngine } = await import("./routes-L5POMDQZ.js");
|
|
414
414
|
var policies = await policyEngine.getAgentPolicies(agentId, deps.orgId);
|
|
415
415
|
if (policies.length > 0) {
|
|
416
416
|
var policyText = policies.map(function(p) {
|
|
@@ -435,7 +435,7 @@ ${policyText}`;
|
|
|
435
435
|
// ─── Budget Check ──────────────────────────────
|
|
436
436
|
async checkBudget(agentId, _orgId, _estimatedTokens) {
|
|
437
437
|
try {
|
|
438
|
-
var { lifecycle } = await import("./routes-
|
|
438
|
+
var { lifecycle } = await import("./routes-L5POMDQZ.js");
|
|
439
439
|
var now = Date.now();
|
|
440
440
|
var cacheKey = `budget_sync_${agentId}`;
|
|
441
441
|
var lastSync = globalThis[cacheKey] || 0;
|
|
@@ -528,7 +528,7 @@ ${policyText}`;
|
|
|
528
528
|
// ─── Record LLM Usage ──────────────────────────
|
|
529
529
|
async recordLLMUsage(agentId, orgId, usage) {
|
|
530
530
|
try {
|
|
531
|
-
var { lifecycle } = await import("./routes-
|
|
531
|
+
var { lifecycle } = await import("./routes-L5POMDQZ.js");
|
|
532
532
|
console.log(`[hooks] recordLLMUsage: agent=${agentId}, input=${usage.inputTokens}, output=${usage.outputTokens}`);
|
|
533
533
|
await lifecycle.recordLLMUsage(agentId, {
|
|
534
534
|
inputTokens: usage.inputTokens,
|
|
@@ -539,7 +539,7 @@ ${policyText}`;
|
|
|
539
539
|
console.log(`[hooks] recordLLMUsage error: ${recordErr.message}`);
|
|
540
540
|
}
|
|
541
541
|
try {
|
|
542
|
-
var { activity } = await import("./routes-
|
|
542
|
+
var { activity } = await import("./routes-L5POMDQZ.js");
|
|
543
543
|
await activity.record({
|
|
544
544
|
agentId,
|
|
545
545
|
orgId,
|
|
@@ -587,7 +587,7 @@ ${policyText}`;
|
|
|
587
587
|
var cacheKey = `${ctx.agentId}:${ctx.toolName}`;
|
|
588
588
|
var cached = getCachedPermission(cacheKey);
|
|
589
589
|
if (cached) return cached;
|
|
590
|
-
var { permissionEngine } = await import("./routes-
|
|
590
|
+
var { permissionEngine } = await import("./routes-L5POMDQZ.js");
|
|
591
591
|
var permResult = await permissionEngine.checkPermission(ctx.agentId, ctx.toolName);
|
|
592
592
|
var result = {
|
|
593
593
|
allowed: permResult.allowed,
|
|
@@ -596,7 +596,7 @@ ${policyText}`;
|
|
|
596
596
|
};
|
|
597
597
|
if (result.allowed && deps.guardrailsEnabled !== false) {
|
|
598
598
|
try {
|
|
599
|
-
var { guardrails } = await import("./routes-
|
|
599
|
+
var { guardrails } = await import("./routes-L5POMDQZ.js");
|
|
600
600
|
var status = await guardrails.getStatus(ctx.agentId);
|
|
601
601
|
if (status.paused || status.offDuty) {
|
|
602
602
|
result.allowed = false;
|
|
@@ -608,7 +608,7 @@ ${policyText}`;
|
|
|
608
608
|
}
|
|
609
609
|
if (result.allowed && deps.dlpEnabled !== false && ctx.parameters) {
|
|
610
610
|
try {
|
|
611
|
-
var { dlp } = await import("./routes-
|
|
611
|
+
var { dlp } = await import("./routes-L5POMDQZ.js");
|
|
612
612
|
var dlpResult = await dlp.scanParameters({
|
|
613
613
|
orgId: ctx.orgId,
|
|
614
614
|
agentId: ctx.agentId,
|
|
@@ -628,7 +628,7 @@ ${policyText}`;
|
|
|
628
628
|
}
|
|
629
629
|
if (result.requiresApproval && result.allowed) {
|
|
630
630
|
try {
|
|
631
|
-
var { approvals } = await import("./routes-
|
|
631
|
+
var { approvals } = await import("./routes-L5POMDQZ.js");
|
|
632
632
|
var approval = await approvals.createAndWait({
|
|
633
633
|
agentId: ctx.agentId,
|
|
634
634
|
orgId: ctx.orgId,
|
|
@@ -658,7 +658,7 @@ ${policyText}`;
|
|
|
658
658
|
// ─── After Tool Call ────────────────────────────
|
|
659
659
|
async afterToolCall(ctx, result) {
|
|
660
660
|
try {
|
|
661
|
-
var { activity } = await import("./routes-
|
|
661
|
+
var { activity } = await import("./routes-L5POMDQZ.js");
|
|
662
662
|
await activity.record({
|
|
663
663
|
agentId: ctx.agentId,
|
|
664
664
|
orgId: ctx.orgId,
|
|
@@ -675,7 +675,7 @@ ${policyText}`;
|
|
|
675
675
|
} catch {
|
|
676
676
|
}
|
|
677
677
|
try {
|
|
678
|
-
var { lifecycle } = await import("./routes-
|
|
678
|
+
var { lifecycle } = await import("./routes-L5POMDQZ.js");
|
|
679
679
|
await lifecycle.recordToolCall(ctx.agentId, {
|
|
680
680
|
toolId: ctx.toolName,
|
|
681
681
|
tokensUsed: 0,
|
|
@@ -687,7 +687,7 @@ ${policyText}`;
|
|
|
687
687
|
}
|
|
688
688
|
if (result.success && EXTERNAL_TOOLS.has(ctx.toolName)) {
|
|
689
689
|
try {
|
|
690
|
-
var { journal } = await import("./routes-
|
|
690
|
+
var { journal } = await import("./routes-L5POMDQZ.js");
|
|
691
691
|
await journal.record({
|
|
692
692
|
orgId: ctx.orgId,
|
|
693
693
|
agentId: ctx.agentId,
|
|
@@ -702,7 +702,7 @@ ${policyText}`;
|
|
|
702
702
|
}
|
|
703
703
|
if (result.success && COMMUNICATION_TOOLS.has(ctx.toolName)) {
|
|
704
704
|
try {
|
|
705
|
-
var { commBus } = await import("./routes-
|
|
705
|
+
var { commBus } = await import("./routes-L5POMDQZ.js");
|
|
706
706
|
await commBus.observeMessage({
|
|
707
707
|
orgId: ctx.orgId,
|
|
708
708
|
agentId: ctx.agentId,
|
|
@@ -716,7 +716,7 @@ ${policyText}`;
|
|
|
716
716
|
// ─── Session Lifecycle ──────────────────────────
|
|
717
717
|
async onSessionStart(sessionId, agentId, orgId) {
|
|
718
718
|
try {
|
|
719
|
-
var { activity } = await import("./routes-
|
|
719
|
+
var { activity } = await import("./routes-L5POMDQZ.js");
|
|
720
720
|
await activity.record({
|
|
721
721
|
agentId,
|
|
722
722
|
orgId,
|
|
@@ -729,7 +729,7 @@ ${policyText}`;
|
|
|
729
729
|
},
|
|
730
730
|
async onSessionEnd(sessionId, agentId, orgId) {
|
|
731
731
|
try {
|
|
732
|
-
var { activity } = await import("./routes-
|
|
732
|
+
var { activity } = await import("./routes-L5POMDQZ.js");
|
|
733
733
|
await activity.record({
|
|
734
734
|
agentId,
|
|
735
735
|
orgId,
|
|
@@ -743,7 +743,7 @@ ${policyText}`;
|
|
|
743
743
|
// ─── Context Compaction ─────────────────────────
|
|
744
744
|
async onContextCompaction(sessionId, agentId, summary) {
|
|
745
745
|
try {
|
|
746
|
-
var { memoryManager } = await import("./routes-
|
|
746
|
+
var { memoryManager } = await import("./routes-L5POMDQZ.js");
|
|
747
747
|
await memoryManager.createMemory({
|
|
748
748
|
agentId,
|
|
749
749
|
orgId: deps.orgId,
|
|
@@ -2518,7 +2518,7 @@ async function runAgentLoop(config, initialMessages, hooks, options) {
|
|
|
2518
2518
|
console.log(`[agent-loop] \u2705 Tool ${toolCall.name} succeeded (${content.length} chars): ${content.slice(0, 300)}`);
|
|
2519
2519
|
}
|
|
2520
2520
|
try {
|
|
2521
|
-
const { activity } = await import("./routes-
|
|
2521
|
+
const { activity } = await import("./routes-L5POMDQZ.js");
|
|
2522
2522
|
activity.recordToolCallCompact({
|
|
2523
2523
|
agentId: config.agentId,
|
|
2524
2524
|
orgId: config.orgId,
|
|
@@ -3385,7 +3385,7 @@ function createRequestToolsTool(allTools, activeSets, _context) {
|
|
|
3385
3385
|
};
|
|
3386
3386
|
}
|
|
3387
3387
|
async function createToolsForContext(options, context, opts) {
|
|
3388
|
-
const { createAllTools } = await import("./agent-tools-
|
|
3388
|
+
const { createAllTools } = await import("./agent-tools-7T6F3LFY.js");
|
|
3389
3389
|
if (context === "full") {
|
|
3390
3390
|
return createAllTools(options);
|
|
3391
3391
|
}
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
init_config_bus,
|
|
12
12
|
init_routes,
|
|
13
13
|
routes_exports
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-J7DJJVGJ.js";
|
|
15
15
|
import {
|
|
16
16
|
CircuitBreaker,
|
|
17
17
|
HealthMonitor,
|
|
@@ -4661,7 +4661,7 @@ function createServer(config) {
|
|
|
4661
4661
|
let engineInitialized = false;
|
|
4662
4662
|
api.all("/engine/*", async (c, _next) => {
|
|
4663
4663
|
try {
|
|
4664
|
-
const { engineRoutes, setEngineDb } = await import("./routes-
|
|
4664
|
+
const { engineRoutes, setEngineDb } = await import("./routes-L5POMDQZ.js");
|
|
4665
4665
|
const { EngineDatabase } = await import("./db-adapter-2T56ORSD.js");
|
|
4666
4666
|
if (!engineInitialized) {
|
|
4667
4667
|
engineInitialized = true;
|
|
@@ -4691,13 +4691,13 @@ function createServer(config) {
|
|
|
4691
4691
|
engineInitialized = true;
|
|
4692
4692
|
if (config.runtime?.enabled) {
|
|
4693
4693
|
try {
|
|
4694
|
-
const { createAgentRuntime } = await import("./runtime-
|
|
4695
|
-
const { mountRuntimeApp, setRuntime } = await import("./routes-
|
|
4694
|
+
const { createAgentRuntime } = await import("./runtime-7IHHKSYG.js");
|
|
4695
|
+
const { mountRuntimeApp, setRuntime } = await import("./routes-L5POMDQZ.js");
|
|
4696
4696
|
let getEmailConfig;
|
|
4697
4697
|
let onTokenRefresh;
|
|
4698
4698
|
let agentMemoryMgr;
|
|
4699
4699
|
try {
|
|
4700
|
-
const { lifecycle: lc, memoryManager: mm } = await import("./routes-
|
|
4700
|
+
const { lifecycle: lc, memoryManager: mm } = await import("./routes-L5POMDQZ.js");
|
|
4701
4701
|
agentMemoryMgr = mm;
|
|
4702
4702
|
if (lc) {
|
|
4703
4703
|
getEmailConfig = (agentId) => {
|
|
@@ -4736,7 +4736,7 @@ function createServer(config) {
|
|
|
4736
4736
|
}
|
|
4737
4737
|
} catch {
|
|
4738
4738
|
}
|
|
4739
|
-
const { vault: vaultRef, permissionEngine: permRef, databaseManager: dbMgr } = await import("./routes-
|
|
4739
|
+
const { vault: vaultRef, permissionEngine: permRef, databaseManager: dbMgr } = await import("./routes-L5POMDQZ.js");
|
|
4740
4740
|
const runtime = createAgentRuntime({
|
|
4741
4741
|
engineDb,
|
|
4742
4742
|
adminDb: config.db,
|
|
@@ -4936,7 +4936,7 @@ function createServer(config) {
|
|
|
4936
4936
|
});
|
|
4937
4937
|
(async () => {
|
|
4938
4938
|
try {
|
|
4939
|
-
const { engineRoutes, setEngineDb } = await import("./routes-
|
|
4939
|
+
const { engineRoutes, setEngineDb } = await import("./routes-L5POMDQZ.js");
|
|
4940
4940
|
const { EngineDatabase } = await import("./db-adapter-2T56ORSD.js");
|
|
4941
4941
|
if (!engineInitialized) {
|
|
4942
4942
|
engineInitialized = true;
|
|
@@ -4960,13 +4960,13 @@ function createServer(config) {
|
|
|
4960
4960
|
await setEngineDb(engineDb, config.db);
|
|
4961
4961
|
if (config.runtime?.enabled) {
|
|
4962
4962
|
try {
|
|
4963
|
-
const { createAgentRuntime } = await import("./runtime-
|
|
4964
|
-
const { mountRuntimeApp, setRuntime } = await import("./routes-
|
|
4963
|
+
const { createAgentRuntime } = await import("./runtime-7IHHKSYG.js");
|
|
4964
|
+
const { mountRuntimeApp, setRuntime } = await import("./routes-L5POMDQZ.js");
|
|
4965
4965
|
let getEmailConfig;
|
|
4966
4966
|
let onTokenRefresh;
|
|
4967
4967
|
let agentMemoryMgr;
|
|
4968
4968
|
try {
|
|
4969
|
-
const { lifecycle: lc, memoryManager: mm } = await import("./routes-
|
|
4969
|
+
const { lifecycle: lc, memoryManager: mm } = await import("./routes-L5POMDQZ.js");
|
|
4970
4970
|
agentMemoryMgr = mm;
|
|
4971
4971
|
if (lc) {
|
|
4972
4972
|
getEmailConfig = (agentId) => {
|
|
@@ -5005,7 +5005,7 @@ function createServer(config) {
|
|
|
5005
5005
|
}
|
|
5006
5006
|
} catch {
|
|
5007
5007
|
}
|
|
5008
|
-
const { vault: vaultRef2, permissionEngine: permRef2, databaseManager: dbMgr2 } = await import("./routes-
|
|
5008
|
+
const { vault: vaultRef2, permissionEngine: permRef2, databaseManager: dbMgr2 } = await import("./routes-L5POMDQZ.js");
|
|
5009
5009
|
const runtime = createAgentRuntime({
|
|
5010
5010
|
engineDb,
|
|
5011
5011
|
adminDb: config.db,
|
|
@@ -5017,7 +5017,7 @@ function createServer(config) {
|
|
|
5017
5017
|
agentMemoryManager: agentMemoryMgr,
|
|
5018
5018
|
vault: vaultRef2,
|
|
5019
5019
|
permissionEngine: permRef2,
|
|
5020
|
-
hierarchyManager: (await import("./routes-
|
|
5020
|
+
hierarchyManager: (await import("./routes-L5POMDQZ.js")).hierarchyManager ?? void 0,
|
|
5021
5021
|
databaseManager: dbMgr2
|
|
5022
5022
|
});
|
|
5023
5023
|
await runtime.start();
|
|
@@ -5031,7 +5031,7 @@ function createServer(config) {
|
|
|
5031
5031
|
}
|
|
5032
5032
|
console.log("[engine] Eagerly initialized");
|
|
5033
5033
|
try {
|
|
5034
|
-
const { lifecycle: lcRef } = await import("./routes-
|
|
5034
|
+
const { lifecycle: lcRef } = await import("./routes-L5POMDQZ.js");
|
|
5035
5035
|
if (lcRef) {
|
|
5036
5036
|
const agents = Array.from(lcRef.agents?.values?.() || []);
|
|
5037
5037
|
const hasLocalPm2 = agents.some((a) => {
|
|
@@ -5040,7 +5040,7 @@ function createServer(config) {
|
|
|
5040
5040
|
return target === "local" && (!pm || pm === "pm2");
|
|
5041
5041
|
});
|
|
5042
5042
|
if (hasLocalPm2) {
|
|
5043
|
-
const { ensurePm2 } = await import("./deployer-
|
|
5043
|
+
const { ensurePm2 } = await import("./deployer-HN7HPTZU.js");
|
|
5044
5044
|
const pm2 = await ensurePm2();
|
|
5045
5045
|
if (pm2.installed) {
|
|
5046
5046
|
console.log(`[startup] PM2 v${pm2.version} available for local deployments`);
|
|
@@ -679,7 +679,7 @@ EOF`);
|
|
|
679
679
|
*/
|
|
680
680
|
async deployLocal(config, emit) {
|
|
681
681
|
emit("provision", "started", "Creating agent configuration files...");
|
|
682
|
-
const { provisionAgent } = await import("./agent-provisioner-
|
|
682
|
+
const { provisionAgent } = await import("./agent-provisioner-5KANSYPK.js");
|
|
683
683
|
const provision = provisionAgent(config);
|
|
684
684
|
if (!provision.success) {
|
|
685
685
|
emit("provision", "failed", `Provisioning failed: ${provision.error}`);
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
DeploymentEngine,
|
|
41
41
|
init_agent_config,
|
|
42
42
|
init_deployer
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-FT5MAYTU.js";
|
|
44
44
|
import {
|
|
45
45
|
init_resilience,
|
|
46
46
|
withRetry
|
|
@@ -6847,7 +6847,7 @@ function createAgentRoutes(opts) {
|
|
|
6847
6847
|
});
|
|
6848
6848
|
router.post("/system/install-pm2", async (c) => {
|
|
6849
6849
|
try {
|
|
6850
|
-
const { ensurePm2 } = await import("./deployer-
|
|
6850
|
+
const { ensurePm2 } = await import("./deployer-HN7HPTZU.js");
|
|
6851
6851
|
const result = await ensurePm2();
|
|
6852
6852
|
if (result.installed) {
|
|
6853
6853
|
return c.json({ success: true, message: `PM2 ${result.version} installed successfully` });
|
|
@@ -7103,7 +7103,7 @@ function createAgentRoutes(opts) {
|
|
|
7103
7103
|
}
|
|
7104
7104
|
const managedAgent = await lifecycle2.createAgent(orgId, config, actor);
|
|
7105
7105
|
try {
|
|
7106
|
-
const { knowledgeBase: kbEngine } = await import("./routes-
|
|
7106
|
+
const { knowledgeBase: kbEngine } = await import("./routes-L5POMDQZ.js");
|
|
7107
7107
|
const allKbs = kbEngine.getAllKnowledgeBases();
|
|
7108
7108
|
const clientOrgId = managedAgent?.clientOrgId || config?.clientOrgId || null;
|
|
7109
7109
|
let kbAssigned = 0;
|
|
@@ -25364,7 +25364,17 @@ var init_routes3 = __esm({
|
|
|
25364
25364
|
engine.post("/agent-status/:agentId", async (c) => {
|
|
25365
25365
|
try {
|
|
25366
25366
|
const body = await c.req.json();
|
|
25367
|
-
|
|
25367
|
+
const agentId = c.req.param("agentId");
|
|
25368
|
+
agentStatus.externalUpdate(agentId, body);
|
|
25369
|
+
if (body.status === "online" || body.status === "idle") {
|
|
25370
|
+
const agent = lifecycle.getAgent(agentId);
|
|
25371
|
+
if (agent && agent.state !== "running" && agent.state !== "active") {
|
|
25372
|
+
agent.state = "running";
|
|
25373
|
+
agent.stateMessage = "Agent online (heartbeat)";
|
|
25374
|
+
lifecycle.saveAgent(agentId).catch(() => {
|
|
25375
|
+
});
|
|
25376
|
+
}
|
|
25377
|
+
}
|
|
25368
25378
|
return c.json({ ok: true });
|
|
25369
25379
|
} catch (err) {
|
|
25370
25380
|
return c.json({ error: err.message }, 400);
|
|
@@ -1234,7 +1234,7 @@ async function deploy(config, db, jwtSecret, vaultKey, spinner, chalk) {
|
|
|
1234
1234
|
const { deployTarget, company, database, domain, tunnel, cloud } = config;
|
|
1235
1235
|
if (deployTarget === "cloudflare-tunnel" && tunnel) {
|
|
1236
1236
|
spinner.start(`Starting local server on port ${tunnel.port}...`);
|
|
1237
|
-
const { createServer: createServer2 } = await import("./server-
|
|
1237
|
+
const { createServer: createServer2 } = await import("./server-56DMUKYJ.js");
|
|
1238
1238
|
const server2 = createServer2({ port: tunnel.port, db, jwtSecret });
|
|
1239
1239
|
const handle2 = await server2.start();
|
|
1240
1240
|
spinner.succeed("Server running");
|
|
@@ -1535,7 +1535,7 @@ async function deploy(config, db, jwtSecret, vaultKey, spinner, chalk) {
|
|
|
1535
1535
|
return {};
|
|
1536
1536
|
}
|
|
1537
1537
|
spinner.start("Starting local server...");
|
|
1538
|
-
const { createServer } = await import("./server-
|
|
1538
|
+
const { createServer } = await import("./server-56DMUKYJ.js");
|
|
1539
1539
|
const server = createServer({ port: 3e3, db, jwtSecret });
|
|
1540
1540
|
const handle = await server.start();
|
|
1541
1541
|
spinner.succeed("Server running");
|
|
@@ -762,7 +762,7 @@ async function runAgent(_args) {
|
|
|
762
762
|
const agent = agentRow[0];
|
|
763
763
|
console.log(` Agent: ${agent.display_name || agent.name}`);
|
|
764
764
|
console.log(` State: ${agent.state}`);
|
|
765
|
-
const routes = await import("./routes-
|
|
765
|
+
const routes = await import("./routes-L5POMDQZ.js");
|
|
766
766
|
await routes.lifecycle.setDb(engineDb);
|
|
767
767
|
await routes.lifecycle.loadFromDb();
|
|
768
768
|
routes.lifecycle.standaloneMode = true;
|
|
@@ -820,10 +820,10 @@ async function runAgent(_args) {
|
|
|
820
820
|
}
|
|
821
821
|
} catch {
|
|
822
822
|
}
|
|
823
|
-
const { createAgentRuntime } = await import("./runtime-
|
|
823
|
+
const { createAgentRuntime } = await import("./runtime-7IHHKSYG.js");
|
|
824
824
|
let orgIntMgr = null;
|
|
825
825
|
try {
|
|
826
|
-
const { orgIntegrations: oi } = await import("./routes-
|
|
826
|
+
const { orgIntegrations: oi } = await import("./routes-L5POMDQZ.js");
|
|
827
827
|
orgIntMgr = oi;
|
|
828
828
|
} catch {
|
|
829
829
|
}
|
|
@@ -1222,7 +1222,7 @@ Please complete this task now.`,
|
|
|
1222
1222
|
}
|
|
1223
1223
|
if (scope === "all" || scope === "permissions") {
|
|
1224
1224
|
try {
|
|
1225
|
-
const { permissionEngine } = await import("./routes-
|
|
1225
|
+
const { permissionEngine } = await import("./routes-L5POMDQZ.js");
|
|
1226
1226
|
await permissionEngine.setDb(engineDb);
|
|
1227
1227
|
reloaded.push("permissions");
|
|
1228
1228
|
} catch {
|
|
@@ -1262,7 +1262,7 @@ Please complete this task now.`,
|
|
|
1262
1262
|
}
|
|
1263
1263
|
if (scope === "all" || scope === "guardrails") {
|
|
1264
1264
|
try {
|
|
1265
|
-
const { guardrails } = await import("./routes-
|
|
1265
|
+
const { guardrails } = await import("./routes-L5POMDQZ.js");
|
|
1266
1266
|
await guardrails.loadFromDb?.();
|
|
1267
1267
|
reloaded.push("guardrails");
|
|
1268
1268
|
} catch {
|
|
@@ -2190,7 +2190,7 @@ Available tools: gmail_send (to, subject, body) or agenticmail_send (to, subject
|
|
|
2190
2190
|
console.log("[guardrails] Disabled via autonomy settings");
|
|
2191
2191
|
}
|
|
2192
2192
|
try {
|
|
2193
|
-
const { AgentHeartbeatManager } = await import("./agent-heartbeat-
|
|
2193
|
+
const { AgentHeartbeatManager } = await import("./agent-heartbeat-VAQTRYST.js");
|
|
2194
2194
|
const hbOrgRows = await engineDb.query(`SELECT org_id FROM managed_agents WHERE id = $1`, [AGENT_ID]);
|
|
2195
2195
|
const hbOrgId = hbOrgRows?.[0]?.org_id || "";
|
|
2196
2196
|
const hbManagerEmail = config.managerEmail || (config.manager?.type === "external" ? config.manager.email : null);
|
|
@@ -94,7 +94,7 @@ async function runServe(_args) {
|
|
|
94
94
|
process.exit(1);
|
|
95
95
|
}
|
|
96
96
|
const { createAdapter, smartDbConfig } = await import("./factory-RTZU2K54.js");
|
|
97
|
-
const { createServer } = await import("./server-
|
|
97
|
+
const { createServer } = await import("./server-56DMUKYJ.js");
|
|
98
98
|
const db = await createAdapter(smartDbConfig(DATABASE_URL));
|
|
99
99
|
await db.migrate();
|
|
100
100
|
const server = createServer({
|
package/dist/cli.js
CHANGED
|
@@ -57,14 +57,14 @@ Skill Development:
|
|
|
57
57
|
break;
|
|
58
58
|
case "serve":
|
|
59
59
|
case "start":
|
|
60
|
-
import("./cli-serve-
|
|
60
|
+
import("./cli-serve-J7SHRJI6.js").then((m) => m.runServe(args.slice(1))).catch(fatal);
|
|
61
61
|
break;
|
|
62
62
|
case "agent":
|
|
63
|
-
import("./cli-agent-
|
|
63
|
+
import("./cli-agent-OI6MKURJ.js").then((m) => m.runAgent(args.slice(1))).catch(fatal);
|
|
64
64
|
break;
|
|
65
65
|
case "setup":
|
|
66
66
|
default:
|
|
67
|
-
import("./setup-
|
|
67
|
+
import("./setup-2XFEQCY2.js").then((m) => m.runSetupWizard()).catch(fatal);
|
|
68
68
|
break;
|
|
69
69
|
}
|
|
70
70
|
function fatal(err) {
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
provision,
|
|
15
15
|
runSetupWizard
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZMQ33664.js";
|
|
17
17
|
import {
|
|
18
18
|
AgentRuntime,
|
|
19
19
|
EmailChannel,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
executeTool,
|
|
29
29
|
runAgentLoop,
|
|
30
30
|
toolsToDefinitions
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-5OC5AFG2.js";
|
|
32
32
|
import {
|
|
33
33
|
ValidationError,
|
|
34
34
|
auditLogger,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
requireRole,
|
|
43
43
|
securityHeaders,
|
|
44
44
|
validate
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-7MEE4SHG.js";
|
|
46
46
|
import "./chunk-DJBCRQTD.js";
|
|
47
47
|
import {
|
|
48
48
|
PROVIDER_REGISTRY,
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
init_storage_manager,
|
|
83
83
|
init_tenant,
|
|
84
84
|
init_workforce
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-J7DJJVGJ.js";
|
|
86
86
|
import "./chunk-3UAFHUEC.js";
|
|
87
87
|
import {
|
|
88
88
|
ENGINE_TABLES,
|
|
@@ -115,7 +115,7 @@ import {
|
|
|
115
115
|
DeploymentEngine,
|
|
116
116
|
init_agent_config,
|
|
117
117
|
init_deployer
|
|
118
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-FT5MAYTU.js";
|
|
119
119
|
import {
|
|
120
120
|
CircuitBreaker,
|
|
121
121
|
CircuitOpenError,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
tenants,
|
|
36
36
|
vault,
|
|
37
37
|
workforce
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-J7DJJVGJ.js";
|
|
39
39
|
import "./chunk-3UAFHUEC.js";
|
|
40
40
|
import "./chunk-Z7NVD3OQ.js";
|
|
41
41
|
import "./chunk-VSBC4SWO.js";
|
|
@@ -45,7 +45,7 @@ import "./chunk-Z6K5FKAB.js";
|
|
|
45
45
|
import "./chunk-C6JP5NR6.js";
|
|
46
46
|
import "./chunk-WYDVMFGJ.js";
|
|
47
47
|
import "./chunk-HIQY73V2.js";
|
|
48
|
-
import "./chunk-
|
|
48
|
+
import "./chunk-FT5MAYTU.js";
|
|
49
49
|
import "./chunk-YDD5TC5Q.js";
|
|
50
50
|
import "./chunk-FLQ5FLHW.js";
|
|
51
51
|
import "./chunk-WUAWWKTN.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7MEE4SHG.js";
|
|
4
4
|
import "./chunk-DJBCRQTD.js";
|
|
5
5
|
import "./chunk-UF3ZJMJO.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-J7DJJVGJ.js";
|
|
7
7
|
import "./chunk-3UAFHUEC.js";
|
|
8
8
|
import "./chunk-Z7NVD3OQ.js";
|
|
9
9
|
import "./chunk-VSBC4SWO.js";
|
|
@@ -13,7 +13,7 @@ import "./chunk-Z6K5FKAB.js";
|
|
|
13
13
|
import "./chunk-C6JP5NR6.js";
|
|
14
14
|
import "./chunk-WYDVMFGJ.js";
|
|
15
15
|
import "./chunk-HIQY73V2.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-FT5MAYTU.js";
|
|
17
17
|
import "./chunk-YDD5TC5Q.js";
|
|
18
18
|
import "./chunk-37ABTUFU.js";
|
|
19
19
|
import "./chunk-NU657BBQ.js";
|
|
@@ -6,11 +6,13 @@ import { ImapFlow } from "imapflow";
|
|
|
6
6
|
function getSmtpConfig(ctx) {
|
|
7
7
|
const ec = ctx.emailConfig;
|
|
8
8
|
if (!ec?.smtpHost) throw new Error("SMTP not configured. Set up email credentials in agent settings.");
|
|
9
|
+
const pass = ec.smtpPass || ec.password;
|
|
10
|
+
if (!pass) throw new Error("No password configured. Set email password in agent email settings.");
|
|
9
11
|
return {
|
|
10
12
|
host: ec.smtpHost,
|
|
11
13
|
port: ec.smtpPort || 587,
|
|
12
14
|
secure: (ec.smtpPort || 587) === 465,
|
|
13
|
-
auth: { user: ec.smtpUser || ec.email, pass
|
|
15
|
+
auth: { user: ec.smtpUser || ec.email, pass }
|
|
14
16
|
};
|
|
15
17
|
}
|
|
16
18
|
function getImapConfig(ctx) {
|
|
@@ -24,11 +26,13 @@ function getImapConfig(ctx) {
|
|
|
24
26
|
else if (smtpHost.includes("smtp.yahoo")) imapHost = "imap.mail.yahoo.com";
|
|
25
27
|
else imapHost = smtpHost.replace("smtp.", "imap.");
|
|
26
28
|
}
|
|
29
|
+
const pass = ec.smtpPass || ec.imapPass || ec.password;
|
|
30
|
+
if (!pass) throw new Error("No password configured. Set email password in agent email settings.");
|
|
27
31
|
return {
|
|
28
32
|
host: imapHost,
|
|
29
33
|
port: ec.imapPort || 993,
|
|
30
34
|
secure: true,
|
|
31
|
-
auth: { user: ec.smtpUser || ec.imapUser || ec.email, pass
|
|
35
|
+
auth: { user: ec.smtpUser || ec.imapUser || ec.email, pass },
|
|
32
36
|
logger: false
|
|
33
37
|
};
|
|
34
38
|
}
|