@agenticmail/enterprise 0.5.134 → 0.5.136
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/chunk-6SP2YIDD.js +898 -0
- package/dist/chunk-A6VPPBF6.js +1910 -0
- package/dist/chunk-AALG4XI4.js +16412 -0
- package/dist/chunk-KKRF3VDD.js +2195 -0
- package/dist/chunk-PE3BOJL4.js +16412 -0
- package/dist/chunk-ZAYPAHTP.js +2195 -0
- package/dist/chunk-ZKCDXIHF.js +898 -0
- package/dist/cli-agent-BRFKPR3X.js +631 -0
- package/dist/cli-agent-DIXEAOHB.js +631 -0
- package/dist/cli-serve-2FNQYQAP.js +34 -0
- package/dist/cli-serve-LJTD2ZIG.js +34 -0
- package/dist/cli.js +3 -3
- package/dist/dashboard/pages/agent-detail.js +13 -11
- package/dist/index.js +4 -4
- package/dist/lifecycle-JVO47LOR.js +10 -0
- package/dist/routes-MATAKKVZ.js +6960 -0
- package/dist/routes-S2BJPVV4.js +6960 -0
- package/dist/runtime-EQRE6SBJ.js +49 -0
- package/dist/runtime-UJEYESIY.js +49 -0
- package/dist/server-FJHIX7DF.js +12 -0
- package/dist/server-JFNMQQAB.js +12 -0
- package/dist/setup-C6KX3OVN.js +20 -0
- package/dist/setup-M7KTHR5S.js +20 -0
- package/package.json +1 -1
- package/src/dashboard/pages/agent-detail.js +13 -11
- package/src/engine/agent-routes.ts +1 -0
- package/src/engine/lifecycle.ts +37 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AgentRuntime,
|
|
3
|
+
EmailChannel,
|
|
4
|
+
FollowUpScheduler,
|
|
5
|
+
SessionManager,
|
|
6
|
+
SubAgentManager,
|
|
7
|
+
ToolRegistry,
|
|
8
|
+
callLLM,
|
|
9
|
+
createAgentRuntime,
|
|
10
|
+
createNoopHooks,
|
|
11
|
+
createRuntimeHooks,
|
|
12
|
+
estimateMessageTokens,
|
|
13
|
+
estimateTokens,
|
|
14
|
+
executeTool,
|
|
15
|
+
runAgentLoop,
|
|
16
|
+
toolsToDefinitions
|
|
17
|
+
} from "./chunk-AALG4XI4.js";
|
|
18
|
+
import "./chunk-TYW5XTOW.js";
|
|
19
|
+
import "./chunk-AQH4DFYV.js";
|
|
20
|
+
import {
|
|
21
|
+
PROVIDER_REGISTRY,
|
|
22
|
+
listAllProviders,
|
|
23
|
+
resolveApiKeyForProvider,
|
|
24
|
+
resolveProvider
|
|
25
|
+
} from "./chunk-67KZYSLU.js";
|
|
26
|
+
import "./chunk-JLSQOQ5L.js";
|
|
27
|
+
import "./chunk-NRF3YRF7.js";
|
|
28
|
+
import "./chunk-KFQGP6VL.js";
|
|
29
|
+
export {
|
|
30
|
+
AgentRuntime,
|
|
31
|
+
EmailChannel,
|
|
32
|
+
FollowUpScheduler,
|
|
33
|
+
PROVIDER_REGISTRY,
|
|
34
|
+
SessionManager,
|
|
35
|
+
SubAgentManager,
|
|
36
|
+
ToolRegistry,
|
|
37
|
+
callLLM,
|
|
38
|
+
createAgentRuntime,
|
|
39
|
+
createNoopHooks,
|
|
40
|
+
createRuntimeHooks,
|
|
41
|
+
estimateMessageTokens,
|
|
42
|
+
estimateTokens,
|
|
43
|
+
executeTool,
|
|
44
|
+
listAllProviders,
|
|
45
|
+
resolveApiKeyForProvider,
|
|
46
|
+
resolveProvider,
|
|
47
|
+
runAgentLoop,
|
|
48
|
+
toolsToDefinitions
|
|
49
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AgentRuntime,
|
|
3
|
+
EmailChannel,
|
|
4
|
+
FollowUpScheduler,
|
|
5
|
+
SessionManager,
|
|
6
|
+
SubAgentManager,
|
|
7
|
+
ToolRegistry,
|
|
8
|
+
callLLM,
|
|
9
|
+
createAgentRuntime,
|
|
10
|
+
createNoopHooks,
|
|
11
|
+
createRuntimeHooks,
|
|
12
|
+
estimateMessageTokens,
|
|
13
|
+
estimateTokens,
|
|
14
|
+
executeTool,
|
|
15
|
+
runAgentLoop,
|
|
16
|
+
toolsToDefinitions
|
|
17
|
+
} from "./chunk-PE3BOJL4.js";
|
|
18
|
+
import "./chunk-TYW5XTOW.js";
|
|
19
|
+
import "./chunk-AQH4DFYV.js";
|
|
20
|
+
import {
|
|
21
|
+
PROVIDER_REGISTRY,
|
|
22
|
+
listAllProviders,
|
|
23
|
+
resolveApiKeyForProvider,
|
|
24
|
+
resolveProvider
|
|
25
|
+
} from "./chunk-67KZYSLU.js";
|
|
26
|
+
import "./chunk-JLSQOQ5L.js";
|
|
27
|
+
import "./chunk-NRF3YRF7.js";
|
|
28
|
+
import "./chunk-KFQGP6VL.js";
|
|
29
|
+
export {
|
|
30
|
+
AgentRuntime,
|
|
31
|
+
EmailChannel,
|
|
32
|
+
FollowUpScheduler,
|
|
33
|
+
PROVIDER_REGISTRY,
|
|
34
|
+
SessionManager,
|
|
35
|
+
SubAgentManager,
|
|
36
|
+
ToolRegistry,
|
|
37
|
+
callLLM,
|
|
38
|
+
createAgentRuntime,
|
|
39
|
+
createNoopHooks,
|
|
40
|
+
createRuntimeHooks,
|
|
41
|
+
estimateMessageTokens,
|
|
42
|
+
estimateTokens,
|
|
43
|
+
executeTool,
|
|
44
|
+
listAllProviders,
|
|
45
|
+
resolveApiKeyForProvider,
|
|
46
|
+
resolveProvider,
|
|
47
|
+
runAgentLoop,
|
|
48
|
+
toolsToDefinitions
|
|
49
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createServer
|
|
3
|
+
} from "./chunk-KKRF3VDD.js";
|
|
4
|
+
import "./chunk-3SMTCIR4.js";
|
|
5
|
+
import "./chunk-RO537U6H.js";
|
|
6
|
+
import "./chunk-DRXMYYKN.js";
|
|
7
|
+
import "./chunk-67KZYSLU.js";
|
|
8
|
+
import "./chunk-JLSQOQ5L.js";
|
|
9
|
+
import "./chunk-KFQGP6VL.js";
|
|
10
|
+
export {
|
|
11
|
+
createServer
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createServer
|
|
3
|
+
} from "./chunk-ZAYPAHTP.js";
|
|
4
|
+
import "./chunk-3SMTCIR4.js";
|
|
5
|
+
import "./chunk-RO537U6H.js";
|
|
6
|
+
import "./chunk-DRXMYYKN.js";
|
|
7
|
+
import "./chunk-67KZYSLU.js";
|
|
8
|
+
import "./chunk-JLSQOQ5L.js";
|
|
9
|
+
import "./chunk-KFQGP6VL.js";
|
|
10
|
+
export {
|
|
11
|
+
createServer
|
|
12
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
promptCompanyInfo,
|
|
3
|
+
promptDatabase,
|
|
4
|
+
promptDeployment,
|
|
5
|
+
promptDomain,
|
|
6
|
+
promptRegistration,
|
|
7
|
+
provision,
|
|
8
|
+
runSetupWizard
|
|
9
|
+
} from "./chunk-6SP2YIDD.js";
|
|
10
|
+
import "./chunk-MHIFVS5L.js";
|
|
11
|
+
import "./chunk-KFQGP6VL.js";
|
|
12
|
+
export {
|
|
13
|
+
promptCompanyInfo,
|
|
14
|
+
promptDatabase,
|
|
15
|
+
promptDeployment,
|
|
16
|
+
promptDomain,
|
|
17
|
+
promptRegistration,
|
|
18
|
+
provision,
|
|
19
|
+
runSetupWizard
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
promptCompanyInfo,
|
|
3
|
+
promptDatabase,
|
|
4
|
+
promptDeployment,
|
|
5
|
+
promptDomain,
|
|
6
|
+
promptRegistration,
|
|
7
|
+
provision,
|
|
8
|
+
runSetupWizard
|
|
9
|
+
} from "./chunk-ZKCDXIHF.js";
|
|
10
|
+
import "./chunk-MHIFVS5L.js";
|
|
11
|
+
import "./chunk-KFQGP6VL.js";
|
|
12
|
+
export {
|
|
13
|
+
promptCompanyInfo,
|
|
14
|
+
promptDatabase,
|
|
15
|
+
promptDeployment,
|
|
16
|
+
promptDomain,
|
|
17
|
+
promptRegistration,
|
|
18
|
+
provision,
|
|
19
|
+
runSetupWizard
|
|
20
|
+
};
|
package/package.json
CHANGED
|
@@ -228,11 +228,12 @@ function OverviewSection(props) {
|
|
|
228
228
|
var rawTraits = identity.personality_traits || identity.traits || config.personality_traits || {};
|
|
229
229
|
var traitList = Array.isArray(rawTraits) ? rawTraits : Object.values(rawTraits);
|
|
230
230
|
|
|
231
|
-
var
|
|
232
|
-
var
|
|
233
|
-
var
|
|
234
|
-
var
|
|
235
|
-
var
|
|
231
|
+
var uu = usageData?.usage || usageData || {};
|
|
232
|
+
var tokensToday = uu.tokensToday || uu.today?.tokens || 0;
|
|
233
|
+
var costToday = uu.costToday || uu.today?.cost || 0;
|
|
234
|
+
var uptime = uu.uptime || uu.uptimeSeconds || usageData?.uptime || 0;
|
|
235
|
+
var errorRate = uu.errorRate || uu.today?.errorRate || 0;
|
|
236
|
+
var activeSessions = uu.activeSessionCount || uu.activeSessions || uu.sessions?.active || 0;
|
|
236
237
|
|
|
237
238
|
if (loading) {
|
|
238
239
|
return h('div', { style: { padding: 40, textAlign: 'center', color: 'var(--text-muted)' } }, 'Loading overview...');
|
|
@@ -1336,12 +1337,13 @@ function BudgetSection(props) {
|
|
|
1336
1337
|
|
|
1337
1338
|
// ─── Derived Usage Values ───────────────────────────────
|
|
1338
1339
|
|
|
1339
|
-
var
|
|
1340
|
-
var
|
|
1341
|
-
var
|
|
1342
|
-
var
|
|
1343
|
-
var
|
|
1344
|
-
var
|
|
1340
|
+
var bu = usageData?.usage || usageData || {};
|
|
1341
|
+
var tokensToday = bu.tokensToday || bu.today?.tokens || 0;
|
|
1342
|
+
var tokensMonth = bu.tokensThisMonth || bu.tokensMonth || bu.month?.tokens || 0;
|
|
1343
|
+
var costToday = bu.costToday || bu.today?.cost || 0;
|
|
1344
|
+
var costMonth = bu.costThisMonth || bu.costMonth || bu.month?.cost || 0;
|
|
1345
|
+
var sessionsToday = bu.sessionsToday || bu.today?.sessions || 0;
|
|
1346
|
+
var errorsToday = bu.errorsToday || bu.today?.errors || 0;
|
|
1345
1347
|
|
|
1346
1348
|
// ─── Budget Limits ──────────────────────────────────────
|
|
1347
1349
|
|
|
@@ -588,6 +588,7 @@ export function createAgentRoutes(opts: {
|
|
|
588
588
|
emailConfig.oauthScopes = [
|
|
589
589
|
'https://www.googleapis.com/auth/gmail.modify',
|
|
590
590
|
'https://www.googleapis.com/auth/gmail.send',
|
|
591
|
+
'https://www.googleapis.com/auth/gmail.settings.basic',
|
|
591
592
|
'https://www.googleapis.com/auth/calendar',
|
|
592
593
|
'https://www.googleapis.com/auth/drive',
|
|
593
594
|
'https://www.googleapis.com/auth/spreadsheets',
|
package/src/engine/lifecycle.ts
CHANGED
|
@@ -467,6 +467,43 @@ export class AgentLifecycleManager {
|
|
|
467
467
|
|
|
468
468
|
// ─── Monitoring ─────────────────────────────────────
|
|
469
469
|
|
|
470
|
+
/**
|
|
471
|
+
* Record LLM usage (tokens + cost) from an agent session turn.
|
|
472
|
+
*/
|
|
473
|
+
recordLLMUsage(agentId: string, opts: {
|
|
474
|
+
inputTokens?: number;
|
|
475
|
+
outputTokens?: number;
|
|
476
|
+
costUsd?: number;
|
|
477
|
+
}) {
|
|
478
|
+
const agent = this.agents.get(agentId);
|
|
479
|
+
if (!agent) return;
|
|
480
|
+
|
|
481
|
+
const totalTokens = (opts.inputTokens || 0) + (opts.outputTokens || 0);
|
|
482
|
+
const usage = agent.usage;
|
|
483
|
+
if (totalTokens > 0) {
|
|
484
|
+
usage.tokensToday += totalTokens;
|
|
485
|
+
usage.tokensThisWeek += totalTokens;
|
|
486
|
+
usage.tokensThisMonth += totalTokens;
|
|
487
|
+
usage.tokensThisYear += totalTokens;
|
|
488
|
+
}
|
|
489
|
+
if (opts.costUsd) {
|
|
490
|
+
usage.costToday += opts.costUsd;
|
|
491
|
+
usage.costThisWeek += opts.costUsd;
|
|
492
|
+
usage.costThisMonth += opts.costUsd;
|
|
493
|
+
usage.costThisYear += opts.costUsd;
|
|
494
|
+
}
|
|
495
|
+
usage.lastUpdated = new Date().toISOString();
|
|
496
|
+
|
|
497
|
+
// Check budget caps
|
|
498
|
+
const budget = agent.budgetConfig;
|
|
499
|
+
if (budget) {
|
|
500
|
+
if (budget.dailyCostCap > 0 && usage.costToday >= budget.dailyCostCap) {
|
|
501
|
+
this.fireBudgetAlert(agent, 'daily_exceeded', 'cost', usage.costToday, budget.dailyCostCap);
|
|
502
|
+
this.stop(agentId, 'system', 'Daily cost budget exceeded').catch(() => {});
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
|
|
470
507
|
/**
|
|
471
508
|
* Record a tool call for usage tracking with per-agent budget controls
|
|
472
509
|
*/
|