@agenticmail/enterprise 0.5.139 → 0.5.140
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-JNJ7N4O5.js +898 -0
- package/dist/chunk-O2HKABQE.js +16421 -0
- package/dist/chunk-QFBQRSR4.js +2195 -0
- package/dist/cli-agent-DPF3NPJG.js +631 -0
- package/dist/cli-serve-FCAZSZ77.js +34 -0
- package/dist/cli.js +3 -3
- package/dist/index.js +3 -3
- package/dist/runtime-MBARNXBW.js +49 -0
- package/dist/server-SP7OCGWP.js +12 -0
- package/dist/setup-6TACMCOW.js +20 -0
- package/package.json +1 -1
- package/src/runtime/agent-loop.ts +11 -5
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-JNJ7N4O5.js";
|
|
17
17
|
import {
|
|
18
18
|
ActionJournal,
|
|
19
19
|
ActivityTracker,
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
executeTool,
|
|
61
61
|
runAgentLoop,
|
|
62
62
|
toolsToDefinitions
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-O2HKABQE.js";
|
|
64
64
|
import "./chunk-TYW5XTOW.js";
|
|
65
65
|
import "./chunk-AQH4DFYV.js";
|
|
66
66
|
import {
|
|
@@ -76,7 +76,7 @@ import {
|
|
|
76
76
|
requireRole,
|
|
77
77
|
securityHeaders,
|
|
78
78
|
validate
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-QFBQRSR4.js";
|
|
80
80
|
import "./chunk-3SMTCIR4.js";
|
|
81
81
|
import "./chunk-RO537U6H.js";
|
|
82
82
|
import "./chunk-DRXMYYKN.js";
|
|
@@ -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-O2HKABQE.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-QFBQRSR4.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-JNJ7N4O5.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
|
@@ -160,13 +160,19 @@ export async function runAgentLoop(
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
// Record LLM usage for budget tracking
|
|
163
|
-
|
|
164
|
-
if (hooks.recordLLMUsage && llmResponse.usage) {
|
|
163
|
+
if (hooks.recordLLMUsage) {
|
|
165
164
|
try {
|
|
166
|
-
var
|
|
165
|
+
var usageInput = llmResponse.usage?.inputTokens || 0;
|
|
166
|
+
var usageOutput = llmResponse.usage?.outputTokens || 0;
|
|
167
|
+
// Fallback: estimate tokens if provider didn't return usage (common with streaming)
|
|
168
|
+
if (usageInput === 0 && usageOutput === 0) {
|
|
169
|
+
usageInput = Math.ceil(estimateMessageTokens(messages) * 0.9);
|
|
170
|
+
usageOutput = Math.ceil((llmResponse.textContent?.length || 100) / 4);
|
|
171
|
+
}
|
|
172
|
+
var costUsd = await estimateCostAsync(hooks, config.model, usageInput, usageOutput);
|
|
167
173
|
await hooks.recordLLMUsage(config.agentId, config.orgId, {
|
|
168
|
-
inputTokens:
|
|
169
|
-
outputTokens:
|
|
174
|
+
inputTokens: usageInput,
|
|
175
|
+
outputTokens: usageOutput,
|
|
170
176
|
costUsd,
|
|
171
177
|
});
|
|
172
178
|
} catch {}
|