@agenticmail/enterprise 0.5.32 → 0.5.33

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.
@@ -0,0 +1,47 @@
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-DR2F2RWV.js";
18
+ import "./chunk-TYW5XTOW.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-KFQGP6VL.js";
27
+ export {
28
+ AgentRuntime,
29
+ EmailChannel,
30
+ FollowUpScheduler,
31
+ PROVIDER_REGISTRY,
32
+ SessionManager,
33
+ SubAgentManager,
34
+ ToolRegistry,
35
+ callLLM,
36
+ createAgentRuntime,
37
+ createNoopHooks,
38
+ createRuntimeHooks,
39
+ estimateMessageTokens,
40
+ estimateTokens,
41
+ executeTool,
42
+ listAllProviders,
43
+ resolveApiKeyForProvider,
44
+ resolveProvider,
45
+ runAgentLoop,
46
+ toolsToDefinitions
47
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ createServer
3
+ } from "./chunk-HN7G4HGB.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-PEGTWAPQ.js";
10
+ import "./chunk-ZMZCLNTY.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/enterprise",
3
- "version": "0.5.32",
3
+ "version": "0.5.33",
4
4
  "description": "AgenticMail Enterprise — cloud-hosted AI agent identity, email, auth & compliance for organizations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -82,14 +82,13 @@ export function createOAuthConnectRoutes(vault: SecureVault) {
82
82
 
83
83
  // Resolve provider
84
84
  const providerKey = SKILL_PROVIDER_MAP[skillId];
85
- if (providerKey === undefined) {
86
- return c.json({ error: `Unknown skill: ${skillId}` }, 404);
87
- }
88
- if (providerKey === null) {
89
- return c.json(
90
- { error: `Skill "${skillId}" does not use OAuth. Configure it with an API key or bot token instead.` },
91
- 400,
92
- );
85
+ if (providerKey === undefined || providerKey === null) {
86
+ // Skill doesn't use OAuth instruct client to use token-based auth (POST /authorize/:skillId)
87
+ return c.json({
88
+ error: `Skill "${skillId}" uses API key authentication, not OAuth. Use the token input to save your API key.`,
89
+ authType: 'token',
90
+ skillId,
91
+ }, 200);
93
92
  }
94
93
 
95
94
  const provider: OAuthProviderDefinition | undefined =
@@ -149,6 +148,34 @@ export function createOAuthConnectRoutes(vault: SecureVault) {
149
148
  }
150
149
  });
151
150
 
151
+ // ─── POST /authorize/:skillId — Save API key/token directly ─────
152
+
153
+ router.post('/authorize/:skillId', async (c) => {
154
+ try {
155
+ const skillId = c.req.param('skillId');
156
+ const orgId = c.req.query('orgId') || 'default';
157
+ const { token } = await c.req.json();
158
+
159
+ if (!token || typeof token !== 'string' || !token.trim()) {
160
+ return c.json({ error: 'A non-empty token value is required' }, 400);
161
+ }
162
+
163
+ // Store as access_token in vault (same format as OAuth tokens)
164
+ await vault.storeSecret(
165
+ orgId,
166
+ `skill:${skillId}:access_token`,
167
+ 'skill_credential',
168
+ token.trim(),
169
+ { provider: 'api_key', manualEntry: true },
170
+ 'dashboard',
171
+ );
172
+
173
+ return c.json({ success: true, skillId, connected: true });
174
+ } catch (e: any) {
175
+ return c.json({ error: e.message }, 500);
176
+ }
177
+ });
178
+
152
179
  // ─── GET /callback — Handle OAuth redirect ───────────
153
180
 
154
181
  router.get('/callback', async (c) => {