@agenticmail/enterprise 0.5.101 → 0.5.103
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-53KJX22O.js +9319 -0
- package/dist/chunk-5T72N6AX.js +16106 -0
- package/dist/chunk-CNJQICZY.js +2194 -0
- package/dist/chunk-IQXQTW65.js +9319 -0
- package/dist/chunk-L6P6VAEA.js +16106 -0
- package/dist/chunk-MM5FIQTB.js +898 -0
- package/dist/chunk-UZFCAQID.js +2194 -0
- package/dist/chunk-WIF5R3HF.js +898 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +4 -4
- package/dist/routes-AJTNQ2RK.js +6954 -0
- package/dist/routes-C2XBUWKY.js +6954 -0
- package/dist/runtime-AZYXY2X6.js +49 -0
- package/dist/runtime-LA27UXAN.js +49 -0
- package/dist/server-6EJ4TRTM.js +12 -0
- package/dist/server-VZDTD2TO.js +12 -0
- package/dist/setup-4P6TKEA2.js +20 -0
- package/dist/setup-6X2QUR5G.js +20 -0
- package/package.json +1 -1
- package/src/engine/agent-config.ts +6 -6
- package/src/engine/deployer.ts +23 -6
|
@@ -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-L6P6VAEA.js";
|
|
18
|
+
import "./chunk-NRF3YRF7.js";
|
|
19
|
+
import "./chunk-TYW5XTOW.js";
|
|
20
|
+
import "./chunk-AQH4DFYV.js";
|
|
21
|
+
import "./chunk-JLSQOQ5L.js";
|
|
22
|
+
import {
|
|
23
|
+
PROVIDER_REGISTRY,
|
|
24
|
+
listAllProviders,
|
|
25
|
+
resolveApiKeyForProvider,
|
|
26
|
+
resolveProvider
|
|
27
|
+
} from "./chunk-67KZYSLU.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-5T72N6AX.js";
|
|
18
|
+
import "./chunk-NRF3YRF7.js";
|
|
19
|
+
import "./chunk-TYW5XTOW.js";
|
|
20
|
+
import "./chunk-AQH4DFYV.js";
|
|
21
|
+
import "./chunk-JLSQOQ5L.js";
|
|
22
|
+
import {
|
|
23
|
+
PROVIDER_REGISTRY,
|
|
24
|
+
listAllProviders,
|
|
25
|
+
resolveApiKeyForProvider,
|
|
26
|
+
resolveProvider
|
|
27
|
+
} from "./chunk-67KZYSLU.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-CNJQICZY.js";
|
|
4
|
+
import "./chunk-3SMTCIR4.js";
|
|
5
|
+
import "./chunk-JLSQOQ5L.js";
|
|
6
|
+
import "./chunk-RO537U6H.js";
|
|
7
|
+
import "./chunk-DRXMYYKN.js";
|
|
8
|
+
import "./chunk-67KZYSLU.js";
|
|
9
|
+
import "./chunk-KFQGP6VL.js";
|
|
10
|
+
export {
|
|
11
|
+
createServer
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createServer
|
|
3
|
+
} from "./chunk-UZFCAQID.js";
|
|
4
|
+
import "./chunk-3SMTCIR4.js";
|
|
5
|
+
import "./chunk-JLSQOQ5L.js";
|
|
6
|
+
import "./chunk-RO537U6H.js";
|
|
7
|
+
import "./chunk-DRXMYYKN.js";
|
|
8
|
+
import "./chunk-67KZYSLU.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-WIF5R3HF.js";
|
|
10
|
+
import "./chunk-QDXUZP7Y.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-MM5FIQTB.js";
|
|
10
|
+
import "./chunk-QDXUZP7Y.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
|
@@ -198,7 +198,7 @@ export class AgentConfigGenerator {
|
|
|
198
198
|
generateGatewayConfig(config: AgentConfig): GatewayConfig {
|
|
199
199
|
const channels: Record<string, any> = {};
|
|
200
200
|
|
|
201
|
-
for (const ch of config.channels
|
|
201
|
+
for (const ch of (config.channels?.enabled || [])) {
|
|
202
202
|
if (!ch.enabled) continue;
|
|
203
203
|
channels[ch.type] = ch.config;
|
|
204
204
|
}
|
|
@@ -209,10 +209,10 @@ export class AgentConfigGenerator {
|
|
|
209
209
|
temperature: config.model.temperature,
|
|
210
210
|
maxTokens: config.model.maxTokens,
|
|
211
211
|
channels,
|
|
212
|
-
heartbeat: config.heartbeat
|
|
212
|
+
heartbeat: config.heartbeat?.enabled ? {
|
|
213
213
|
intervalMinutes: config.heartbeat.intervalMinutes,
|
|
214
214
|
} : undefined,
|
|
215
|
-
workspace: config.workspace
|
|
215
|
+
workspace: config.workspace?.workingDirectory,
|
|
216
216
|
};
|
|
217
217
|
}
|
|
218
218
|
|
|
@@ -227,7 +227,7 @@ export class AgentConfigGenerator {
|
|
|
227
227
|
// Inject standard vars
|
|
228
228
|
env['AGENTICMAIL_MODEL'] = `${config.model.provider}/${config.model.modelId}`;
|
|
229
229
|
env['AGENTICMAIL_THINKING'] = config.model.thinkingLevel;
|
|
230
|
-
if (config.email
|
|
230
|
+
if (config.email?.enabled && config.email.address) {
|
|
231
231
|
env['AGENTICMAIL_EMAIL'] = config.email.address;
|
|
232
232
|
}
|
|
233
233
|
|
|
@@ -559,9 +559,9 @@ ${customInstructions}
|
|
|
559
559
|
}
|
|
560
560
|
|
|
561
561
|
private generateHeartbeat(config: AgentConfig): string {
|
|
562
|
-
if (!config.heartbeat
|
|
562
|
+
if (!config.heartbeat?.enabled) return '# HEARTBEAT.md\n# Heartbeat disabled\n';
|
|
563
563
|
|
|
564
|
-
const checks = config.heartbeat.checks.map(c => `- Check ${c}`).join('\n');
|
|
564
|
+
const checks = (config.heartbeat.checks || []).map(c => `- Check ${c}`).join('\n');
|
|
565
565
|
return `# HEARTBEAT.md
|
|
566
566
|
|
|
567
567
|
## Periodic Checks
|
package/src/engine/deployer.ts
CHANGED
|
@@ -404,11 +404,14 @@ export class DeploymentEngine {
|
|
|
404
404
|
const size = cloud.size || 'shared-cpu-1x';
|
|
405
405
|
const FLY_API = 'https://api.machines.dev/v1';
|
|
406
406
|
|
|
407
|
+
// Fly.io tokens: FlyV1 tokens use their own prefix, others use Bearer
|
|
408
|
+
const authHeader = apiToken.startsWith('FlyV1 ') || apiToken.startsWith('fm2_') ? apiToken.startsWith('FlyV1 ') ? apiToken : `FlyV1 ${apiToken}` : `Bearer ${apiToken}`;
|
|
409
|
+
|
|
407
410
|
const flyFetch = async (path: string, method: string = 'GET', body?: any): Promise<any> => {
|
|
408
411
|
const res = await fetch(`${FLY_API}${path}`, {
|
|
409
412
|
method,
|
|
410
413
|
headers: {
|
|
411
|
-
'Authorization':
|
|
414
|
+
'Authorization': authHeader,
|
|
412
415
|
'Content-Type': 'application/json',
|
|
413
416
|
},
|
|
414
417
|
body: body ? JSON.stringify(body) : undefined,
|
|
@@ -423,8 +426,18 @@ export class DeploymentEngine {
|
|
|
423
426
|
// 1. Create app (ignore "already exists" errors)
|
|
424
427
|
emit('provision', 'started', `Creating Fly.io app "${appName}"...`);
|
|
425
428
|
try {
|
|
426
|
-
// Fly.io org_slug must be a Fly org slug (e.g. 'personal'), not an internal org ID
|
|
427
|
-
|
|
429
|
+
// Fly.io org_slug must be a Fly org slug (e.g. 'personal', 'ope-olatunji'), not an internal org ID
|
|
430
|
+
// If no valid org slug provided, auto-detect from token by listing apps
|
|
431
|
+
let flyOrg = (cloud.org && cloud.org.length < 40 && /^[a-z0-9-]+$/.test(cloud.org)) ? cloud.org : '';
|
|
432
|
+
if (!flyOrg) {
|
|
433
|
+
try {
|
|
434
|
+
const orgsRes = await flyFetch('/apps?org_slug=personal');
|
|
435
|
+
if (orgsRes?.apps?.length > 0 && orgsRes.apps[0].organization?.slug) {
|
|
436
|
+
flyOrg = orgsRes.apps[0].organization.slug;
|
|
437
|
+
}
|
|
438
|
+
} catch {}
|
|
439
|
+
if (!flyOrg) flyOrg = 'personal';
|
|
440
|
+
}
|
|
428
441
|
await flyFetch('/apps', 'POST', {
|
|
429
442
|
app_name: appName,
|
|
430
443
|
org_slug: flyOrg,
|
|
@@ -618,10 +631,12 @@ export class DeploymentEngine {
|
|
|
618
631
|
|
|
619
632
|
const appName = cloud.appName || `am-agent-${config.name.toLowerCase().replace(/[^a-z0-9-]/g, '-').slice(0, 30)}`;
|
|
620
633
|
const FLY_API = 'https://api.machines.dev/v1';
|
|
634
|
+
const t = cloud.apiToken;
|
|
635
|
+
const auth = t.startsWith('FlyV1 ') ? t : t.startsWith('fm2_') ? `FlyV1 ${t}` : `Bearer ${t}`;
|
|
621
636
|
|
|
622
637
|
try {
|
|
623
638
|
const res = await fetch(`${FLY_API}/apps/${appName}/machines`, {
|
|
624
|
-
headers: { 'Authorization':
|
|
639
|
+
headers: { 'Authorization': auth },
|
|
625
640
|
});
|
|
626
641
|
if (!res.ok) return { ...base, status: 'error', healthStatus: 'unhealthy' };
|
|
627
642
|
|
|
@@ -654,10 +669,12 @@ export class DeploymentEngine {
|
|
|
654
669
|
|
|
655
670
|
const appName = cloud.appName || `am-agent-${config.name.toLowerCase().replace(/[^a-z0-9-]/g, '-').slice(0, 30)}`;
|
|
656
671
|
const FLY_API = 'https://api.machines.dev/v1';
|
|
672
|
+
const t = cloud.apiToken;
|
|
673
|
+
const auth = t.startsWith('FlyV1 ') ? t : t.startsWith('fm2_') ? `FlyV1 ${t}` : `Bearer ${t}`;
|
|
657
674
|
|
|
658
675
|
try {
|
|
659
676
|
const res = await fetch(`${FLY_API}/apps/${appName}/machines`, {
|
|
660
|
-
headers: { 'Authorization':
|
|
677
|
+
headers: { 'Authorization': auth },
|
|
661
678
|
});
|
|
662
679
|
if (!res.ok) return { success: false, message: `Failed to list machines: ${res.status}` };
|
|
663
680
|
const machines = await res.json() as any[];
|
|
@@ -666,7 +683,7 @@ export class DeploymentEngine {
|
|
|
666
683
|
const machineId = machines[0].id;
|
|
667
684
|
const actionRes = await fetch(`${FLY_API}/apps/${appName}/machines/${machineId}/${action}`, {
|
|
668
685
|
method: 'POST',
|
|
669
|
-
headers: { 'Authorization':
|
|
686
|
+
headers: { 'Authorization': auth },
|
|
670
687
|
});
|
|
671
688
|
if (!actionRes.ok) {
|
|
672
689
|
const err = await actionRes.text();
|