@agenticmail/enterprise 0.5.110 → 0.5.111
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-2AMNVQIQ.js +1880 -0
- package/dist/chunk-SAJR7T37.js +2194 -0
- package/dist/chunk-WJZ42G5N.js +898 -0
- package/dist/chunk-YRRKUCNF.js +16106 -0
- package/dist/cli-agent-FSHCUSU5.js +291 -0
- package/dist/cli-serve-25MJKRJM.js +34 -0
- package/dist/cli.js +3 -3
- package/dist/index.js +4 -4
- package/dist/lifecycle-RHPPFTH7.js +10 -0
- package/dist/routes-J3R5W2U6.js +6958 -0
- package/dist/runtime-GBC7BO3X.js +49 -0
- package/dist/server-4AXTAAPN.js +12 -0
- package/dist/setup-BRLWAAZT.js +20 -0
- package/package.json +1 -1
- package/src/engine/deployer.ts +17 -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-YRRKUCNF.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-SAJR7T37.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-WJZ42G5N.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
package/src/engine/deployer.ts
CHANGED
|
@@ -399,7 +399,8 @@ export class DeploymentEngine {
|
|
|
399
399
|
const apiToken = cloud.apiToken;
|
|
400
400
|
if (!apiToken) throw new Error('Fly.io API token is required');
|
|
401
401
|
|
|
402
|
-
|
|
402
|
+
// Reuse previously stored app/machine IDs for redeploy
|
|
403
|
+
const appName = cloud.appName || (config.deployment.config as any).flyAppName || `am-agent-${config.name.toLowerCase().replace(/[^a-z0-9-]/g, '-').slice(0, 30)}`;
|
|
403
404
|
const region = cloud.region || 'iad';
|
|
404
405
|
const size = cloud.size || 'shared-cpu-1x';
|
|
405
406
|
const FLY_API = 'https://api.machines.dev/v1';
|
|
@@ -493,15 +494,24 @@ export class DeploymentEngine {
|
|
|
493
494
|
};
|
|
494
495
|
|
|
495
496
|
let machineId: string;
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
497
|
+
// Filter to only non-destroyed machines
|
|
498
|
+
const liveMachines = (existingMachines || []).filter((m: any) => m.state !== 'destroyed');
|
|
499
|
+
if (liveMachines.length > 0) {
|
|
500
|
+
// Reuse existing machine — stop it first if running, then update
|
|
501
|
+
const existing = liveMachines[0];
|
|
499
502
|
machineId = existing.id;
|
|
503
|
+
emit('install', 'started', `Reusing existing machine ${machineId} (state: ${existing.state})...`);
|
|
504
|
+
if (existing.state === 'started' || existing.state === 'running') {
|
|
505
|
+
try {
|
|
506
|
+
await flyFetch(`/apps/${appName}/machines/${machineId}/stop`, 'POST');
|
|
507
|
+
await flyFetch(`/apps/${appName}/machines/${machineId}/wait?state=stopped&timeout=30`);
|
|
508
|
+
} catch { /* may already be stopped */ }
|
|
509
|
+
}
|
|
500
510
|
await flyFetch(`/apps/${appName}/machines/${machineId}`, 'POST', {
|
|
501
511
|
config: machineConfig,
|
|
502
512
|
region,
|
|
503
513
|
});
|
|
504
|
-
emit('install', 'completed', `Machine ${machineId} updated`);
|
|
514
|
+
emit('install', 'completed', `Machine ${machineId} updated and restarting`);
|
|
505
515
|
} else {
|
|
506
516
|
// Create new machine
|
|
507
517
|
const machine = await flyFetch(`/apps/${appName}/machines`, 'POST', {
|
|
@@ -522,7 +532,7 @@ export class DeploymentEngine {
|
|
|
522
532
|
emit('start', 'completed', 'Machine starting (health check pending)');
|
|
523
533
|
}
|
|
524
534
|
|
|
525
|
-
// Store deployment metadata
|
|
535
|
+
// Store deployment metadata — persists app/machine IDs for redeployment
|
|
526
536
|
config.deployment.config.cloud = {
|
|
527
537
|
...cloud,
|
|
528
538
|
provider: 'fly',
|
|
@@ -530,6 +540,7 @@ export class DeploymentEngine {
|
|
|
530
540
|
region,
|
|
531
541
|
size,
|
|
532
542
|
};
|
|
543
|
+
(config.deployment.config as any).flyAppName = appName;
|
|
533
544
|
(config.deployment.config as any).flyMachineId = machineId;
|
|
534
545
|
(config.deployment.config as any).deployedAt = new Date().toISOString();
|
|
535
546
|
|