@dexto/agent-management 1.14.6 → 1.15.0-beta.1
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/auth/dexto-accounts.cjs +277 -0
- package/dist/auth/dexto-accounts.d.ts +144 -0
- package/dist/auth/dexto-accounts.d.ts.map +1 -0
- package/dist/auth/dexto-accounts.js +230 -0
- package/dist/auth/dexto-cloud.cjs +51 -0
- package/dist/auth/dexto-cloud.d.ts +9 -0
- package/dist/auth/dexto-cloud.d.ts.map +1 -0
- package/dist/auth/dexto-cloud.js +27 -0
- package/dist/auth/dexto-gateway.cjs +162 -0
- package/dist/auth/dexto-gateway.d.ts +55 -0
- package/dist/auth/dexto-gateway.d.ts.map +1 -0
- package/dist/auth/dexto-gateway.js +133 -0
- package/dist/auth/dexto-mcp.cjs +77 -0
- package/dist/auth/dexto-mcp.d.ts +23 -0
- package/dist/auth/dexto-mcp.d.ts.map +1 -0
- package/dist/auth/dexto-mcp.js +49 -0
- package/dist/auth/dexto-sign-in.cjs +324 -0
- package/dist/auth/dexto-sign-in.d.ts +63 -0
- package/dist/auth/dexto-sign-in.d.ts.map +1 -0
- package/dist/auth/dexto-sign-in.js +295 -0
- package/dist/auth/index.cjs +25 -0
- package/dist/auth/index.d.ts +6 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +10 -0
- package/dist/auth/model-auth-handlers.cjs +3 -1
- package/dist/auth/model-auth-handlers.d.ts +6 -1
- package/dist/auth/model-auth-handlers.d.ts.map +1 -1
- package/dist/auth/model-auth-handlers.js +6 -1
- package/dist/index.cjs +38 -29
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -6
- package/dist/tool-factories/agent-spawner/factory.cjs +1 -218
- package/dist/tool-factories/agent-spawner/factory.d.ts.map +1 -1
- package/dist/tool-factories/agent-spawner/factory.js +1 -228
- package/dist/utils/dexto-auth.cjs +3 -58
- package/dist/utils/dexto-auth.d.ts +4 -18
- package/dist/utils/dexto-auth.d.ts.map +1 -1
- package/dist/utils/dexto-auth.js +3 -57
- package/package.json +5 -6
package/dist/utils/dexto-auth.js
CHANGED
|
@@ -1,65 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { getDextoGlobalPath } from "@dexto/core";
|
|
4
|
-
const AUTH_CONFIG_FILE = "auth.json";
|
|
5
|
-
const AuthConfigSchema = z.object({
|
|
6
|
-
token: z.string().min(1).optional(),
|
|
7
|
-
refreshToken: z.string().optional(),
|
|
8
|
-
expiresAt: z.number().optional(),
|
|
9
|
-
createdAt: z.number().optional(),
|
|
10
|
-
dextoApiKey: z.string().optional(),
|
|
11
|
-
dextoKeyId: z.string().optional(),
|
|
12
|
-
dextoApiKeySource: z.enum(["provisioned", "user-supplied"]).optional()
|
|
13
|
-
}).refine((data) => data.token || data.dextoApiKey, {
|
|
14
|
-
message: "Either token or dextoApiKey is required"
|
|
15
|
-
});
|
|
16
|
-
async function loadAuthConfig() {
|
|
17
|
-
const authPath = getDextoGlobalPath("", AUTH_CONFIG_FILE);
|
|
18
|
-
if (!existsSync(authPath)) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
try {
|
|
22
|
-
const content = await fs.readFile(authPath, "utf-8");
|
|
23
|
-
const config = JSON.parse(content);
|
|
24
|
-
const validated = AuthConfigSchema.safeParse(config);
|
|
25
|
-
if (!validated.success) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
const auth = validated.data;
|
|
29
|
-
if (auth.expiresAt && auth.expiresAt < Date.now()) {
|
|
30
|
-
if (!auth.refreshToken && !auth.dextoApiKey) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return auth;
|
|
35
|
-
} catch {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
1
|
+
import { defaultDextoGatewayOptions, dextoModelAccess } from "../auth/dexto-gateway.js";
|
|
39
2
|
async function isDextoAuthenticated() {
|
|
40
|
-
return await
|
|
41
|
-
}
|
|
42
|
-
async function getDextoApiKeyFromAuth() {
|
|
43
|
-
const auth = await loadAuthConfig();
|
|
44
|
-
if (auth?.dextoApiKey?.trim()) {
|
|
45
|
-
const apiKey = auth.dextoApiKey.trim();
|
|
46
|
-
process.env.DEXTO_API_KEY = apiKey;
|
|
47
|
-
return apiKey;
|
|
48
|
-
}
|
|
49
|
-
if (process.env.DEXTO_API_KEY?.trim()) {
|
|
50
|
-
return process.env.DEXTO_API_KEY;
|
|
51
|
-
}
|
|
52
|
-
return null;
|
|
3
|
+
return (await dextoModelAccess(defaultDextoGatewayOptions())).status !== "signed_out";
|
|
53
4
|
}
|
|
54
5
|
async function canUseDextoProvider() {
|
|
55
|
-
|
|
56
|
-
if (!authenticated) return false;
|
|
57
|
-
const apiKey = await getDextoApiKeyFromAuth();
|
|
58
|
-
if (!apiKey) return false;
|
|
59
|
-
return true;
|
|
6
|
+
return (await dextoModelAccess(defaultDextoGatewayOptions())).status === "ready";
|
|
60
7
|
}
|
|
61
8
|
export {
|
|
62
9
|
canUseDextoProvider,
|
|
63
|
-
getDextoApiKeyFromAuth,
|
|
64
10
|
isDextoAuthenticated
|
|
65
11
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dexto/agent-management",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0-beta.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,11 +22,10 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"yaml": "^2.8.3",
|
|
24
24
|
"zod": "^4.3.6",
|
|
25
|
-
"@dexto/agent-config": "1.14.
|
|
26
|
-
"@dexto/core": "1.14.
|
|
27
|
-
"@dexto/llm": "1.14.
|
|
28
|
-
"@dexto/
|
|
29
|
-
"@dexto/tools-builtins": "1.14.6"
|
|
25
|
+
"@dexto/agent-config": "1.14.4",
|
|
26
|
+
"@dexto/core": "1.14.4",
|
|
27
|
+
"@dexto/llm": "1.14.4",
|
|
28
|
+
"@dexto/tools-builtins": "1.14.4"
|
|
30
29
|
},
|
|
31
30
|
"devDependencies": {
|
|
32
31
|
"@types/node": "^22.13.5"
|