@agenticmail/enterprise 0.5.176 → 0.5.178
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-2VSCPBC5.js +17693 -0
- package/dist/chunk-4SUPIOEO.js +2195 -0
- package/dist/chunk-F4XOJWAF.js +8876 -0
- package/dist/chunk-G6KSDUL7.js +898 -0
- package/dist/chunk-GAN64NTH.js +898 -0
- package/dist/chunk-PCBOCACL.js +17693 -0
- package/dist/chunk-VPZX6UA6.js +2195 -0
- package/dist/cli-agent-2XLHET5Z.js +1011 -0
- package/dist/cli-agent-KGRXB2A4.js +1012 -0
- package/dist/cli-serve-6UZJMLKN.js +34 -0
- package/dist/cli-serve-RIUNCKUB.js +34 -0
- package/dist/cli.js +3 -3
- package/dist/index.js +4 -4
- package/dist/routes-XVCFULQ3.js +7045 -0
- package/dist/runtime-AKYA4BC2.js +49 -0
- package/dist/runtime-KR6GMZHE.js +49 -0
- package/dist/server-ATRALRWA.js +12 -0
- package/dist/server-KOBAVLWK.js +12 -0
- package/dist/setup-H4AZZPAP.js +20 -0
- package/dist/setup-TOO6H56V.js +20 -0
- package/package.json +1 -1
- package/src/agent-tools/index.ts +4 -1
- package/src/agent-tools/tools/google/index.ts +20 -13
- package/src/cli-agent.ts +5 -0
- package/src/engine/lifecycle.ts +30 -29
- package/src/runtime/index.ts +7 -0
- package/src/runtime/types.ts +2 -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-PCBOCACL.js";
|
|
18
|
+
import "./chunk-AQH4DFYV.js";
|
|
19
|
+
import "./chunk-JLSQOQ5L.js";
|
|
20
|
+
import {
|
|
21
|
+
PROVIDER_REGISTRY,
|
|
22
|
+
listAllProviders,
|
|
23
|
+
resolveApiKeyForProvider,
|
|
24
|
+
resolveProvider
|
|
25
|
+
} from "./chunk-67KZYSLU.js";
|
|
26
|
+
import "./chunk-NRF3YRF7.js";
|
|
27
|
+
import "./chunk-TYW5XTOW.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-2VSCPBC5.js";
|
|
18
|
+
import "./chunk-AQH4DFYV.js";
|
|
19
|
+
import "./chunk-JLSQOQ5L.js";
|
|
20
|
+
import {
|
|
21
|
+
PROVIDER_REGISTRY,
|
|
22
|
+
listAllProviders,
|
|
23
|
+
resolveApiKeyForProvider,
|
|
24
|
+
resolveProvider
|
|
25
|
+
} from "./chunk-67KZYSLU.js";
|
|
26
|
+
import "./chunk-NRF3YRF7.js";
|
|
27
|
+
import "./chunk-TYW5XTOW.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-VPZX6UA6.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-4SUPIOEO.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-G6KSDUL7.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-GAN64NTH.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
package/src/agent-tools/index.ts
CHANGED
|
@@ -225,6 +225,8 @@ export interface AllToolsOptions extends ToolCreationOptions {
|
|
|
225
225
|
};
|
|
226
226
|
/** Use enterprise browser tool (full Playwright) instead of simple browser */
|
|
227
227
|
useEnterpriseBrowser?: boolean;
|
|
228
|
+
/** Which Google services to load (e.g. ['gmail','calendar','drive','tasks','chat','slides','forms']). Default: core set only. */
|
|
229
|
+
enabledGoogleServices?: string[];
|
|
228
230
|
}
|
|
229
231
|
|
|
230
232
|
/**
|
|
@@ -372,7 +374,8 @@ export async function createAllTools(options?: AllToolsOptions): Promise<AnyAgen
|
|
|
372
374
|
if (tp) {
|
|
373
375
|
var provider = tp.getProvider();
|
|
374
376
|
if (provider === 'google') {
|
|
375
|
-
|
|
377
|
+
const googleOpts = options?.enabledGoogleServices ? { ...options, enabledGoogleServices: options.enabledGoogleServices } : options;
|
|
378
|
+
workspaceTools = createAllGoogleTools({ tokenProvider: tp }, googleOpts);
|
|
376
379
|
// Meeting lifecycle tools (work on all deployments — API-based)
|
|
377
380
|
workspaceTools = workspaceTools.concat(createMeetingLifecycleTools({ tokenProvider: tp }, options));
|
|
378
381
|
}
|
|
@@ -44,17 +44,24 @@ export interface GoogleToolsConfig {
|
|
|
44
44
|
* Returns ~45 tools covering Gmail, Calendar, Drive, Sheets, Docs, Contacts, and Meetings.
|
|
45
45
|
*/
|
|
46
46
|
export function createAllGoogleTools(config: GoogleToolsConfig, options?: ToolCreationOptions): AnyAgentTool[] {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
...
|
|
56
|
-
|
|
57
|
-
...
|
|
58
|
-
...
|
|
59
|
-
|
|
47
|
+
// Allow limiting which Google services are loaded via options.enabledGoogleServices
|
|
48
|
+
// If not set, load core services only (gmail, calendar, drive, tasks) to avoid tool count limits on some models
|
|
49
|
+
const enabled = (options as any)?.enabledGoogleServices as string[] | undefined;
|
|
50
|
+
const all = !enabled; // if not specified, use core set
|
|
51
|
+
const has = (s: string) => enabled ? enabled.includes(s) : false;
|
|
52
|
+
const core = !enabled; // default: load core services only
|
|
53
|
+
|
|
54
|
+
const tools: AnyAgentTool[] = [];
|
|
55
|
+
if (all || core || has('gmail')) tools.push(...createGmailTools(config, options));
|
|
56
|
+
if (all || core || has('calendar')) tools.push(...createGoogleCalendarTools(config, options));
|
|
57
|
+
if (all || core || has('drive')) tools.push(...createGoogleDriveTools(config, options));
|
|
58
|
+
if (all || core || has('tasks')) tools.push(...createGoogleTasksTools(config.tokenProvider));
|
|
59
|
+
if (all || has('sheets')) tools.push(...createGoogleSheetsTools(config, options));
|
|
60
|
+
if (all || has('docs')) tools.push(...createGoogleDocsTools(config, options));
|
|
61
|
+
if (all || has('contacts')) tools.push(...createGoogleContactsTools(config, options));
|
|
62
|
+
if (all || has('meetings')) tools.push(...createMeetingTools(config, options));
|
|
63
|
+
if (all || has('chat')) tools.push(...createGoogleChatTools(config, options));
|
|
64
|
+
if (all || has('slides')) tools.push(...createGoogleSlidesTools(config, options));
|
|
65
|
+
if (all || has('forms')) tools.push(...createGoogleFormsTools(config, options));
|
|
66
|
+
return tools;
|
|
60
67
|
}
|
package/src/cli-agent.ts
CHANGED
|
@@ -88,6 +88,7 @@ export async function runAgent(_args: string[]) {
|
|
|
88
88
|
const routes = await import('./engine/routes.js');
|
|
89
89
|
await routes.lifecycle.setDb(engineDb);
|
|
90
90
|
await routes.lifecycle.loadFromDb();
|
|
91
|
+
routes.lifecycle.standaloneMode = true; // Standalone agent machine — reload dashboard fields from DB before each save
|
|
91
92
|
const lifecycle = routes.lifecycle; // Use the singleton everywhere
|
|
92
93
|
|
|
93
94
|
const managed = lifecycle.getAgent(AGENT_ID);
|
|
@@ -161,6 +162,10 @@ export async function runAgent(_args: string[]) {
|
|
|
161
162
|
gatewayEnabled: true,
|
|
162
163
|
getEmailConfig,
|
|
163
164
|
onTokenRefresh,
|
|
165
|
+
getAgentConfig: (agentId: string) => {
|
|
166
|
+
const m = lifecycle.getAgent(agentId);
|
|
167
|
+
return m?.config || null;
|
|
168
|
+
},
|
|
164
169
|
agentMemoryManager: memoryManager,
|
|
165
170
|
resumeOnStartup: true,
|
|
166
171
|
});
|
package/src/engine/lifecycle.ts
CHANGED
|
@@ -171,6 +171,9 @@ export class AgentLifecycleManager {
|
|
|
171
171
|
private agents = new Map<string, ManagedAgent>();
|
|
172
172
|
private healthCheckIntervals = new Map<string, NodeJS.Timeout>();
|
|
173
173
|
private deployer = new DeploymentEngine();
|
|
174
|
+
/** When true, this lifecycle runs on a standalone agent machine (not the enterprise server).
|
|
175
|
+
* In standalone mode, persistAgent reloads dashboard-managed fields from DB before saving. */
|
|
176
|
+
public standaloneMode = false;
|
|
174
177
|
private configGen = new AgentConfigGenerator();
|
|
175
178
|
private permissions: PermissionEngine;
|
|
176
179
|
private engineDb?: EngineDatabase;
|
|
@@ -1070,35 +1073,33 @@ export class AgentLifecycleManager {
|
|
|
1070
1073
|
this.agents.set(agent.id, agent);
|
|
1071
1074
|
if (!this.engineDb) return;
|
|
1072
1075
|
try {
|
|
1073
|
-
//
|
|
1074
|
-
//
|
|
1075
|
-
|
|
1076
|
-
if (
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
if (dbEmail.oauthScopes) memEmail.oauthScopes = dbEmail.oauthScopes;
|
|
1101
|
-
// Runtime tokens stay from memory (they're fresher)
|
|
1076
|
+
// In standalone agent mode, reload dashboard-managed fields from DB before saving
|
|
1077
|
+
// to avoid overwriting changes made via the enterprise dashboard.
|
|
1078
|
+
// The enterprise server itself is the source of truth for config — it should NOT reload.
|
|
1079
|
+
if (this.standaloneMode) {
|
|
1080
|
+
const dbAgent = await this.engineDb.getManagedAgent(agent.id);
|
|
1081
|
+
if (dbAgent) {
|
|
1082
|
+
const dbConfig = dbAgent.config as any;
|
|
1083
|
+
const memConfig = agent.config as any;
|
|
1084
|
+
// Dashboard-managed fields: prefer DB (set by enterprise server)
|
|
1085
|
+
if (dbConfig.model) memConfig.model = dbConfig.model;
|
|
1086
|
+
if (dbConfig.identity) memConfig.identity = dbConfig.identity;
|
|
1087
|
+
if (dbConfig.manager) memConfig.manager = dbConfig.manager;
|
|
1088
|
+
if (dbConfig.catchUp) memConfig.catchUp = dbConfig.catchUp;
|
|
1089
|
+
if (dbConfig.autonomy) memConfig.autonomy = dbConfig.autonomy;
|
|
1090
|
+
if (dbConfig.deployment) memConfig.deployment = dbConfig.deployment;
|
|
1091
|
+
if (dbConfig.schedule) memConfig.schedule = dbConfig.schedule;
|
|
1092
|
+
if (dbConfig.skills) memConfig.skills = dbConfig.skills;
|
|
1093
|
+
if (dbConfig.permissionProfileId) memConfig.permissionProfileId = dbConfig.permissionProfileId;
|
|
1094
|
+
// emailConfig: preserve dashboard fields but keep runtime tokens from memory
|
|
1095
|
+
if (dbConfig.emailConfig && memConfig.emailConfig) {
|
|
1096
|
+
const dbEmail = dbConfig.emailConfig;
|
|
1097
|
+
const memEmail = memConfig.emailConfig;
|
|
1098
|
+
if (dbEmail.oauthClientId) memEmail.oauthClientId = dbEmail.oauthClientId;
|
|
1099
|
+
if (dbEmail.oauthClientSecret) memEmail.oauthClientSecret = dbEmail.oauthClientSecret;
|
|
1100
|
+
if (dbEmail.oauthRedirectUri) memEmail.oauthRedirectUri = dbEmail.oauthRedirectUri;
|
|
1101
|
+
if (dbEmail.oauthScopes) memEmail.oauthScopes = dbEmail.oauthScopes;
|
|
1102
|
+
}
|
|
1102
1103
|
}
|
|
1103
1104
|
}
|
|
1104
1105
|
|
package/src/runtime/index.ts
CHANGED
|
@@ -150,6 +150,13 @@ export class AgentRuntime {
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
+
// Pass enabledGoogleServices from agent config
|
|
154
|
+
if (this.config.getAgentConfig) {
|
|
155
|
+
const agentConfig = this.config.getAgentConfig(agentId);
|
|
156
|
+
if (agentConfig?.enabledGoogleServices) {
|
|
157
|
+
base.enabledGoogleServices = agentConfig.enabledGoogleServices;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
153
160
|
return base;
|
|
154
161
|
}
|
|
155
162
|
|
package/src/runtime/types.ts
CHANGED
|
@@ -124,6 +124,8 @@ export interface RuntimeConfig {
|
|
|
124
124
|
getEmailConfig?: (agentId: string) => any;
|
|
125
125
|
/** Callback to persist refreshed OAuth tokens */
|
|
126
126
|
onTokenRefresh?: (agentId: string, tokens: any) => void;
|
|
127
|
+
/** Get full agent config (for enabledGoogleServices, etc.) */
|
|
128
|
+
getAgentConfig?: (agentId: string) => any;
|
|
127
129
|
/** Resume active sessions on startup (default: true) */
|
|
128
130
|
resumeOnStartup?: boolean;
|
|
129
131
|
/** Heartbeat interval in ms (default: 30000 = 30s) */
|