@dexto/agent-management 1.17.0 → 1.18.0
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 +345 -0
- package/dist/auth/dexto-sign-in.d.ts +86 -0
- package/dist/auth/dexto-sign-in.d.ts.map +1 -0
- package/dist/auth/dexto-sign-in.js +314 -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/config/errors.cjs +6 -6
- package/dist/config/errors.js +6 -6
- package/dist/images/image-store.cjs +2 -4
- package/dist/images/image-store.d.ts.map +1 -1
- package/dist/images/image-store.js +2 -4
- package/dist/index.cjs +40 -29
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -6
- package/dist/installation.cjs +2 -2
- package/dist/installation.js +2 -2
- package/dist/plugins/discover-skills.cjs +5 -2
- package/dist/plugins/discover-skills.d.ts +6 -2
- package/dist/plugins/discover-skills.d.ts.map +1 -1
- package/dist/plugins/discover-skills.js +5 -2
- package/dist/plugins/errors.cjs +2 -2
- package/dist/plugins/errors.js +2 -2
- package/dist/plugins/marketplace/errors.cjs +4 -4
- package/dist/plugins/marketplace/errors.js +4 -4
- package/dist/preferences/errors.cjs +1 -1
- package/dist/preferences/errors.js +1 -1
- package/dist/registry/registry.cjs +3 -3
- package/dist/registry/registry.js +3 -3
- package/dist/resolver.cjs +1 -1
- package/dist/resolver.js +1 -1
- 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
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { SignedInAsSchema } from "./dexto-accounts.js";
|
|
4
|
+
const DEXTO_CLI_CLIENT_ID = "dexto-cli";
|
|
5
|
+
const BASE_CLOUD_SCOPES = ["cloud:read"];
|
|
6
|
+
const DEVICE_CODE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
|
|
7
|
+
const LOGIN_TIMEOUT_MS = 5 * 6e4;
|
|
8
|
+
const END_SIGN_IN_TIMEOUT_MS = 1e4;
|
|
9
|
+
function signInPromptText(prompt) {
|
|
10
|
+
if (prompt.kind === "browser")
|
|
11
|
+
return `Sign in to Dexto in your browser. If it doesn't open, visit:
|
|
12
|
+
${prompt.authorizeUrl}`;
|
|
13
|
+
return [
|
|
14
|
+
prompt.verificationUriComplete === null ? `To sign in, open this link on any device and enter ${prompt.userCode}:
|
|
15
|
+
${prompt.verificationUri}` : `To sign in, open this link on any device and check it shows ${prompt.userCode}:
|
|
16
|
+
${prompt.verificationUriComplete}`,
|
|
17
|
+
"Only approve this if you just ran dexto login."
|
|
18
|
+
].join("\n");
|
|
19
|
+
}
|
|
20
|
+
class SignInEnded extends Error {
|
|
21
|
+
constructor(reason, message) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.reason = reason;
|
|
24
|
+
this.name = "SignInEnded";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const ProtectedResourceSchema = z.object({
|
|
28
|
+
authorization_servers: z.array(z.string().url()).min(1),
|
|
29
|
+
resource: z.string().url(),
|
|
30
|
+
scopes_supported: z.array(z.string())
|
|
31
|
+
});
|
|
32
|
+
const AuthorizationServerSchema = z.object({
|
|
33
|
+
authorization_endpoint: z.string().url(),
|
|
34
|
+
device_authorization_endpoint: z.string().url(),
|
|
35
|
+
revocation_endpoint: z.string().url(),
|
|
36
|
+
token_endpoint: z.string().url()
|
|
37
|
+
});
|
|
38
|
+
const TokenResponseSchema = z.object({
|
|
39
|
+
access_token: z.string().min(1),
|
|
40
|
+
refresh_token: z.string().min(1),
|
|
41
|
+
expires_in: z.number().int().positive(),
|
|
42
|
+
scope: z.string(),
|
|
43
|
+
/** Who the tokens act as. */
|
|
44
|
+
dexto_account: SignedInAsSchema.shape.account.optional(),
|
|
45
|
+
dexto_organization: SignedInAsSchema.shape.organization.optional()
|
|
46
|
+
});
|
|
47
|
+
const DeviceAuthorizationSchema = z.object({
|
|
48
|
+
device_code: z.string().min(1),
|
|
49
|
+
user_code: z.string().min(1),
|
|
50
|
+
expires_in: z.number().int().positive(),
|
|
51
|
+
interval: z.number().int().positive().optional(),
|
|
52
|
+
verification_uri: z.string().url(),
|
|
53
|
+
verification_uri_complete: z.string().url().optional()
|
|
54
|
+
});
|
|
55
|
+
async function readMetadata(runtime, appUrl) {
|
|
56
|
+
const resource = ProtectedResourceSchema.parse(
|
|
57
|
+
await getJson(runtime, `${appUrl}/.well-known/oauth-protected-resource/mcp`)
|
|
58
|
+
);
|
|
59
|
+
const issuer = (resource.authorization_servers[0] ?? appUrl).replace(/\/+$/u, "");
|
|
60
|
+
const server = AuthorizationServerSchema.parse(
|
|
61
|
+
await getJson(runtime, `${issuer}/.well-known/oauth-authorization-server`)
|
|
62
|
+
);
|
|
63
|
+
return { resource, server };
|
|
64
|
+
}
|
|
65
|
+
async function discover(runtime, input) {
|
|
66
|
+
const appUrl = input.appUrl.replace(/\/+$/u, "");
|
|
67
|
+
const { resource, server } = await readMetadata(runtime, appUrl);
|
|
68
|
+
const reading = resource.scopes_supported.filter((scope) => scope.endsWith(":read"));
|
|
69
|
+
const scopes = [.../* @__PURE__ */ new Set([...reading, ...BASE_CLOUD_SCOPES, ...input.extraScopes])];
|
|
70
|
+
return { appUrl, resource: resource.resource, scopes, server };
|
|
71
|
+
}
|
|
72
|
+
async function signInWithBrowser(runtime, input) {
|
|
73
|
+
const { appUrl, resource, scopes, server } = await discover(runtime, input);
|
|
74
|
+
const redirect = await runtime.listenForRedirect(appUrl);
|
|
75
|
+
try {
|
|
76
|
+
const verifier = randomBytes(32).toString("base64url");
|
|
77
|
+
const state = randomBytes(16).toString("base64url");
|
|
78
|
+
const authorizeUrl = new URL(server.authorization_endpoint);
|
|
79
|
+
for (const [name, value] of Object.entries({
|
|
80
|
+
client_id: DEXTO_CLI_CLIENT_ID,
|
|
81
|
+
code_challenge: createHash("sha256").update(verifier).digest("base64url"),
|
|
82
|
+
code_challenge_method: "S256",
|
|
83
|
+
redirect_uri: redirect.redirectUri,
|
|
84
|
+
resource,
|
|
85
|
+
response_type: "code",
|
|
86
|
+
scope: scopes.join(" "),
|
|
87
|
+
state,
|
|
88
|
+
...input.organization === null ? {} : { organization: input.organization }
|
|
89
|
+
}))
|
|
90
|
+
authorizeUrl.searchParams.set(name, value);
|
|
91
|
+
runtime.prompt({ kind: "browser", authorizeUrl: authorizeUrl.toString() });
|
|
92
|
+
if (input.openBrowser) await runtime.openBrowser(authorizeUrl.toString());
|
|
93
|
+
const params = await withTimeout(redirect.result, LOGIN_TIMEOUT_MS, runtime.signal);
|
|
94
|
+
if (params.get("state") !== state)
|
|
95
|
+
throw new Error("The sign-in reply didn't match this login.");
|
|
96
|
+
const error = params.get("error");
|
|
97
|
+
if (error !== null)
|
|
98
|
+
throw error === "access_denied" ? new SignInEnded("declined", "Sign-in was declined.") : new Error(`Sign-in failed: ${params.get("error_description") ?? error}.`);
|
|
99
|
+
const code = params.get("code");
|
|
100
|
+
if (code === null) throw new Error("The sign-in reply had no code.");
|
|
101
|
+
const tokens = TokenResponseSchema.parse(
|
|
102
|
+
await postForm(runtime, server.token_endpoint, {
|
|
103
|
+
client_id: DEXTO_CLI_CLIENT_ID,
|
|
104
|
+
code,
|
|
105
|
+
code_verifier: verifier,
|
|
106
|
+
grant_type: "authorization_code",
|
|
107
|
+
redirect_uri: redirect.redirectUri,
|
|
108
|
+
resource
|
|
109
|
+
})
|
|
110
|
+
);
|
|
111
|
+
return toLogin(tokens, {
|
|
112
|
+
apiBaseUrl: input.apiBaseUrl,
|
|
113
|
+
appUrl,
|
|
114
|
+
resource,
|
|
115
|
+
tokenEndpoint: server.token_endpoint
|
|
116
|
+
});
|
|
117
|
+
} finally {
|
|
118
|
+
redirect.close();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
async function signInWithDevice(runtime, input) {
|
|
122
|
+
const { appUrl, resource, scopes, server } = await discover(runtime, input);
|
|
123
|
+
const device = DeviceAuthorizationSchema.parse(
|
|
124
|
+
await postForm(runtime, server.device_authorization_endpoint, {
|
|
125
|
+
client_id: DEXTO_CLI_CLIENT_ID,
|
|
126
|
+
resource,
|
|
127
|
+
scope: scopes.join(" "),
|
|
128
|
+
...input.organization === null ? {} : { organization: input.organization }
|
|
129
|
+
})
|
|
130
|
+
);
|
|
131
|
+
runtime.prompt({
|
|
132
|
+
kind: "device",
|
|
133
|
+
userCode: device.user_code,
|
|
134
|
+
verificationUri: device.verification_uri,
|
|
135
|
+
verificationUriComplete: device.verification_uri_complete ?? null,
|
|
136
|
+
expiresInSeconds: device.expires_in
|
|
137
|
+
});
|
|
138
|
+
const deadline = Date.now() + device.expires_in * 1e3;
|
|
139
|
+
let intervalSeconds = device.interval ?? 5;
|
|
140
|
+
while (Date.now() < deadline) {
|
|
141
|
+
await runtime.sleep(intervalSeconds * 1e3);
|
|
142
|
+
try {
|
|
143
|
+
const tokens = TokenResponseSchema.parse(
|
|
144
|
+
await postForm(runtime, server.token_endpoint, {
|
|
145
|
+
client_id: DEXTO_CLI_CLIENT_ID,
|
|
146
|
+
device_code: device.device_code,
|
|
147
|
+
grant_type: DEVICE_CODE_GRANT_TYPE,
|
|
148
|
+
resource
|
|
149
|
+
})
|
|
150
|
+
);
|
|
151
|
+
return toLogin(tokens, {
|
|
152
|
+
apiBaseUrl: input.apiBaseUrl,
|
|
153
|
+
appUrl,
|
|
154
|
+
resource,
|
|
155
|
+
tokenEndpoint: server.token_endpoint
|
|
156
|
+
});
|
|
157
|
+
} catch (error) {
|
|
158
|
+
if (error instanceof TypeError) continue;
|
|
159
|
+
if (!(error instanceof OAuthHttpError)) throw error;
|
|
160
|
+
if (error.status >= 500 || error.code === "authorization_pending") continue;
|
|
161
|
+
if (error.code === "slow_down") {
|
|
162
|
+
intervalSeconds += 5;
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
if (error.code === "access_denied")
|
|
166
|
+
throw new SignInEnded("declined", "Sign-in was declined.");
|
|
167
|
+
if (error.code !== "expired_token") throw error;
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
throw new SignInEnded("expired", "The sign-in code expired. Run dexto login --device again.");
|
|
172
|
+
}
|
|
173
|
+
function toLogin(tokens, client) {
|
|
174
|
+
return {
|
|
175
|
+
kind: "oauth",
|
|
176
|
+
...client,
|
|
177
|
+
clientId: DEXTO_CLI_CLIENT_ID,
|
|
178
|
+
accessToken: tokens.access_token,
|
|
179
|
+
refreshToken: tokens.refresh_token,
|
|
180
|
+
expiresAt: expiresAt(tokens.expires_in),
|
|
181
|
+
scopes: splitScopes(tokens.scope),
|
|
182
|
+
savedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
183
|
+
signedInAs: signedInAsFrom(tokens),
|
|
184
|
+
cloudProject: null
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
function signedInAsFrom(tokens) {
|
|
188
|
+
return tokens.dexto_account === void 0 || tokens.dexto_organization === void 0 ? null : { account: tokens.dexto_account, organization: tokens.dexto_organization };
|
|
189
|
+
}
|
|
190
|
+
async function refreshSignIn(runtime, login) {
|
|
191
|
+
let body;
|
|
192
|
+
try {
|
|
193
|
+
body = await postForm(runtime, login.tokenEndpoint, {
|
|
194
|
+
client_id: login.clientId,
|
|
195
|
+
grant_type: "refresh_token",
|
|
196
|
+
refresh_token: login.refreshToken,
|
|
197
|
+
resource: login.resource
|
|
198
|
+
});
|
|
199
|
+
} catch (error) {
|
|
200
|
+
if (error instanceof OAuthHttpError && error.status === 400)
|
|
201
|
+
throw new Error("Your Dexto sign-in has expired. Run dexto login again.");
|
|
202
|
+
throw error;
|
|
203
|
+
}
|
|
204
|
+
const tokens = TokenResponseSchema.parse(body);
|
|
205
|
+
return {
|
|
206
|
+
...login,
|
|
207
|
+
accessToken: tokens.access_token,
|
|
208
|
+
refreshToken: tokens.refresh_token,
|
|
209
|
+
expiresAt: expiresAt(tokens.expires_in),
|
|
210
|
+
scopes: splitScopes(tokens.scope),
|
|
211
|
+
signedInAs: signedInAsFrom(tokens) ?? login.signedInAs
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
async function endSignIn(runtime, login) {
|
|
215
|
+
const bounded = {
|
|
216
|
+
...runtime,
|
|
217
|
+
signal: AbortSignal.any([runtime.signal, AbortSignal.timeout(END_SIGN_IN_TIMEOUT_MS)])
|
|
218
|
+
};
|
|
219
|
+
try {
|
|
220
|
+
const { server } = await readMetadata(bounded, login.appUrl.replace(/\/+$/u, ""));
|
|
221
|
+
await postForm(bounded, server.revocation_endpoint, {
|
|
222
|
+
client_id: login.clientId,
|
|
223
|
+
token: login.refreshToken,
|
|
224
|
+
token_type_hint: "refresh_token"
|
|
225
|
+
});
|
|
226
|
+
return { status: "ended" };
|
|
227
|
+
} catch (error) {
|
|
228
|
+
return { status: "failed", reason: error instanceof Error ? error.message : String(error) };
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
class OAuthHttpError extends Error {
|
|
232
|
+
/** The OAuth `error` code, such as `authorization_pending`; null when the reply had none. */
|
|
233
|
+
code;
|
|
234
|
+
status;
|
|
235
|
+
constructor(status, code, message) {
|
|
236
|
+
super(message);
|
|
237
|
+
this.name = "OAuthHttpError";
|
|
238
|
+
this.code = code;
|
|
239
|
+
this.status = status;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
async function getJson(runtime, url) {
|
|
243
|
+
return await readJson(
|
|
244
|
+
await runtime.fetch(url, {
|
|
245
|
+
headers: { accept: "application/json" },
|
|
246
|
+
signal: runtime.signal
|
|
247
|
+
}),
|
|
248
|
+
url
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
async function postForm(runtime, url, fields) {
|
|
252
|
+
return await readJson(
|
|
253
|
+
await runtime.fetch(url, {
|
|
254
|
+
body: new URLSearchParams(fields),
|
|
255
|
+
headers: { accept: "application/json" },
|
|
256
|
+
method: "POST",
|
|
257
|
+
signal: runtime.signal
|
|
258
|
+
}),
|
|
259
|
+
url
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
const OAuthErrorSchema = z.object({
|
|
263
|
+
error: z.string().optional(),
|
|
264
|
+
error_description: z.string().optional()
|
|
265
|
+
});
|
|
266
|
+
async function readJson(response, url) {
|
|
267
|
+
const text = await response.text();
|
|
268
|
+
if (response.ok) return text.length === 0 ? null : JSON.parse(text);
|
|
269
|
+
const reply = OAuthErrorSchema.safeParse(parseOrNull(text));
|
|
270
|
+
const code = reply.success ? reply.data.error ?? null : null;
|
|
271
|
+
const description = (reply.success ? reply.data.error_description : void 0) ?? code ?? `HTTP ${response.status}`;
|
|
272
|
+
throw new OAuthHttpError(response.status, code, `${new URL(url).pathname}: ${description}`);
|
|
273
|
+
}
|
|
274
|
+
function parseOrNull(text) {
|
|
275
|
+
try {
|
|
276
|
+
return JSON.parse(text);
|
|
277
|
+
} catch {
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
async function withTimeout(promise, ms, signal) {
|
|
282
|
+
let timer;
|
|
283
|
+
const stop = new Promise((_, reject) => {
|
|
284
|
+
timer = setTimeout(() => reject(new SignInEnded("timed_out", "Sign-in timed out.")), ms);
|
|
285
|
+
signal.addEventListener(
|
|
286
|
+
"abort",
|
|
287
|
+
() => reject(new SignInEnded("cancelled", "Sign-in was cancelled.")),
|
|
288
|
+
{
|
|
289
|
+
once: true
|
|
290
|
+
}
|
|
291
|
+
);
|
|
292
|
+
});
|
|
293
|
+
try {
|
|
294
|
+
return await Promise.race([promise, stop]);
|
|
295
|
+
} finally {
|
|
296
|
+
clearTimeout(timer);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
function splitScopes(scope) {
|
|
300
|
+
return scope.split(" ").filter((each) => each.length > 0);
|
|
301
|
+
}
|
|
302
|
+
function expiresAt(expiresInSeconds) {
|
|
303
|
+
return new Date(Date.now() + expiresInSeconds * 1e3).toISOString();
|
|
304
|
+
}
|
|
305
|
+
export {
|
|
306
|
+
DEXTO_CLI_CLIENT_ID,
|
|
307
|
+
OAuthHttpError,
|
|
308
|
+
SignInEnded,
|
|
309
|
+
endSignIn,
|
|
310
|
+
refreshSignIn,
|
|
311
|
+
signInPromptText,
|
|
312
|
+
signInWithBrowser,
|
|
313
|
+
signInWithDevice
|
|
314
|
+
};
|
package/dist/auth/index.cjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
var auth_exports = {};
|
|
20
30
|
__export(auth_exports, {
|
|
@@ -25,6 +35,11 @@ __export(auth_exports, {
|
|
|
25
35
|
createChatGPTRuntimeAuth: () => import_chatgpt_oauth.createChatGPTRuntimeAuth,
|
|
26
36
|
createModelAuthResolver: () => import_model_auth_handlers.createModelAuthResolver,
|
|
27
37
|
deleteModelAuthProfile: () => import_model_auth_profiles.deleteModelAuthProfile,
|
|
38
|
+
dextoAccounts: () => dextoAccounts,
|
|
39
|
+
dextoCloud: () => dextoCloud,
|
|
40
|
+
dextoGateway: () => dextoGateway,
|
|
41
|
+
dextoMcp: () => dextoMcp,
|
|
42
|
+
dextoSignIn: () => dextoSignIn,
|
|
28
43
|
getAuthMethodDefinition: () => import_provider_auth_definitions.getAuthMethodDefinition,
|
|
29
44
|
getDefaultModelAuthProfile: () => import_model_auth_profiles.getDefaultModelAuthProfile,
|
|
30
45
|
getDefaultModelAuthProfileIdForProvider: () => import_model_auth_profiles.getDefaultModelAuthProfileIdForProvider,
|
|
@@ -51,6 +66,11 @@ var import_provider_auth_definitions = require("./provider-auth-definitions.js")
|
|
|
51
66
|
var import_model_auth_handlers = require("./model-auth-handlers.js");
|
|
52
67
|
var import_model_auth_profiles = require("./model-auth-profiles.js");
|
|
53
68
|
var import_chatgpt_oauth = require("./chatgpt-oauth.js");
|
|
69
|
+
var dextoAccounts = __toESM(require("./dexto-accounts.js"), 1);
|
|
70
|
+
var dextoSignIn = __toESM(require("./dexto-sign-in.js"), 1);
|
|
71
|
+
var dextoCloud = __toESM(require("./dexto-cloud.js"), 1);
|
|
72
|
+
var dextoGateway = __toESM(require("./dexto-gateway.js"), 1);
|
|
73
|
+
var dextoMcp = __toESM(require("./dexto-mcp.js"), 1);
|
|
54
74
|
// Annotate the CommonJS export names for ESM import in node:
|
|
55
75
|
0 && (module.exports = {
|
|
56
76
|
AUTH_METHOD_KINDS,
|
|
@@ -60,6 +80,11 @@ var import_chatgpt_oauth = require("./chatgpt-oauth.js");
|
|
|
60
80
|
createChatGPTRuntimeAuth,
|
|
61
81
|
createModelAuthResolver,
|
|
62
82
|
deleteModelAuthProfile,
|
|
83
|
+
dextoAccounts,
|
|
84
|
+
dextoCloud,
|
|
85
|
+
dextoGateway,
|
|
86
|
+
dextoMcp,
|
|
87
|
+
dextoSignIn,
|
|
63
88
|
getAuthMethodDefinition,
|
|
64
89
|
getDefaultModelAuthProfile,
|
|
65
90
|
getDefaultModelAuthProfileIdForProvider,
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -2,4 +2,10 @@ export { AUTH_METHOD_KINDS, OPENAI_API_KEY_AUTH_METHOD, OPENAI_CHATGPT_LOGIN_AUT
|
|
|
2
2
|
export { createModelAuthResolver, markModelAuthProviderConnected, saveChatGPTLoginModelAuthProfile, startModelAuthBrowserLogin, type PendingModelAuthBrowserLogin, } from './model-auth-handlers.js';
|
|
3
3
|
export { deleteModelAuthProfile, getDefaultModelAuthProfile, getDefaultModelAuthProfileIdForProvider, getModelAuthProfileId, getModelAuthProfilesPath, listModelAuthProfiles, listSavedModelAuthProfiles, loadModelAuthProfiles, loadModelAuthProfilesSync, saveApiKeyModelAuthProfile, setDefaultModelAuthProfile, upsertModelAuthProfile, type ApiKeyEnvModelAuthCredential, type ModelAuthCredential, type ModelAuthProfile, type ModelAuthProfilesFile, type OAuthModelAuthCredential, } from './model-auth-profiles.js';
|
|
4
4
|
export { createChatGPTRuntimeAuth, refreshChatGPTOAuthCredential, startChatGPTBrowserLogin, type ChatGPTOAuthCredential, type ChatGPTRuntimeAuth, type PendingChatGPTLogin, } from './chatgpt-oauth.js';
|
|
5
|
+
/** Signing in to Dexto as the `dexto-cli` client: saved profiles, OAuth and the Cloud reads it needs. */
|
|
6
|
+
export * as dextoAccounts from './dexto-accounts.js';
|
|
7
|
+
export * as dextoSignIn from './dexto-sign-in.js';
|
|
8
|
+
export * as dextoCloud from './dexto-cloud.js';
|
|
9
|
+
export * as dextoGateway from './dexto-gateway.js';
|
|
10
|
+
export * as dextoMcp from './dexto-mcp.js';
|
|
5
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/auth/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACjB,0BAA0B,EAC1B,gCAAgC,EAChC,yBAAyB,EACzB,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,iBAAiB,EACjB,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,GAC9B,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACH,uBAAuB,EACvB,8BAA8B,EAC9B,gCAAgC,EAChC,0BAA0B,EAC1B,KAAK,4BAA4B,GACpC,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACH,sBAAsB,EACtB,0BAA0B,EAC1B,uCAAuC,EACvC,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,sBAAsB,EACtB,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,GAChC,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACH,wBAAwB,EACxB,6BAA6B,EAC7B,wBAAwB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GAC3B,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACjB,0BAA0B,EAC1B,gCAAgC,EAChC,yBAAyB,EACzB,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,iBAAiB,EACjB,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,GAC9B,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACH,uBAAuB,EACvB,8BAA8B,EAC9B,gCAAgC,EAChC,0BAA0B,EAC1B,KAAK,4BAA4B,GACpC,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACH,sBAAsB,EACtB,0BAA0B,EAC1B,uCAAuC,EACvC,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,sBAAsB,EACtB,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,GAChC,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACH,wBAAwB,EACxB,6BAA6B,EAC7B,wBAAwB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GAC3B,MAAM,oBAAoB,CAAC;AAE5B,yGAAyG;AACzG,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC"}
|
package/dist/auth/index.js
CHANGED
|
@@ -33,6 +33,11 @@ import {
|
|
|
33
33
|
refreshChatGPTOAuthCredential,
|
|
34
34
|
startChatGPTBrowserLogin
|
|
35
35
|
} from "./chatgpt-oauth.js";
|
|
36
|
+
import * as dextoAccounts from "./dexto-accounts.js";
|
|
37
|
+
import * as dextoSignIn from "./dexto-sign-in.js";
|
|
38
|
+
import * as dextoCloud from "./dexto-cloud.js";
|
|
39
|
+
import * as dextoGateway from "./dexto-gateway.js";
|
|
40
|
+
import * as dextoMcp from "./dexto-mcp.js";
|
|
36
41
|
export {
|
|
37
42
|
AUTH_METHOD_KINDS,
|
|
38
43
|
OPENAI_API_KEY_AUTH_METHOD,
|
|
@@ -41,6 +46,11 @@ export {
|
|
|
41
46
|
createChatGPTRuntimeAuth,
|
|
42
47
|
createModelAuthResolver,
|
|
43
48
|
deleteModelAuthProfile,
|
|
49
|
+
dextoAccounts,
|
|
50
|
+
dextoCloud,
|
|
51
|
+
dextoGateway,
|
|
52
|
+
dextoMcp,
|
|
53
|
+
dextoSignIn,
|
|
44
54
|
getAuthMethodDefinition,
|
|
45
55
|
getDefaultModelAuthProfile,
|
|
46
56
|
getDefaultModelAuthProfileIdForProvider,
|
|
@@ -24,6 +24,7 @@ __export(model_auth_handlers_exports, {
|
|
|
24
24
|
startModelAuthBrowserLogin: () => startModelAuthBrowserLogin
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(model_auth_handlers_exports);
|
|
27
|
+
var import_dexto_gateway = require("./dexto-gateway.js");
|
|
27
28
|
var import_chatgpt_oauth = require("./chatgpt-oauth.js");
|
|
28
29
|
var import_model_auth_profiles = require("./model-auth-profiles.js");
|
|
29
30
|
var import_preferences = require("../preferences/index.js");
|
|
@@ -124,9 +125,10 @@ function resolveRuntimeAuthFromProfile(profile) {
|
|
|
124
125
|
) ?? null;
|
|
125
126
|
return runtimeAuth ? { ...runtimeAuth, auth } : null;
|
|
126
127
|
}
|
|
127
|
-
function createModelAuthResolver() {
|
|
128
|
+
function createModelAuthResolver(dexto = (0, import_dexto_gateway.defaultDextoGatewayOptions)()) {
|
|
128
129
|
return {
|
|
129
130
|
resolveRuntimeAuth(input) {
|
|
131
|
+
if (input.provider === "dexto-nova") return (0, import_dexto_gateway.dextoGatewayRuntimeAuth)(dexto);
|
|
130
132
|
const profile = (0, import_model_auth_profiles.getDefaultModelAuthProfile)((0, import_model_auth_profiles.loadModelAuthProfilesSync)(), input.provider);
|
|
131
133
|
return profile ? resolveRuntimeAuthFromProfile(profile) : null;
|
|
132
134
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LlmAuthResolver } from '@dexto/core';
|
|
2
|
+
import { type DextoGatewayOptions } from './dexto-gateway.js';
|
|
2
3
|
import { type ChatGPTOAuthCredential } from './chatgpt-oauth.js';
|
|
3
4
|
import { type ModelAuthProfile } from './model-auth-profiles.js';
|
|
4
5
|
export type PendingModelAuthBrowserLogin = {
|
|
@@ -13,5 +14,9 @@ export declare function startModelAuthBrowserLogin(input: {
|
|
|
13
14
|
methodId: string;
|
|
14
15
|
}): Promise<PendingModelAuthBrowserLogin>;
|
|
15
16
|
export declare function markModelAuthProviderConnected(providerId: string): Promise<void>;
|
|
16
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Model auth for local agents: Dexto models (`dexto-nova`) on the Dexto sign-in, and every other
|
|
19
|
+
* provider on its saved model auth profile.
|
|
20
|
+
*/
|
|
21
|
+
export declare function createModelAuthResolver(dexto?: DextoGatewayOptions): LlmAuthResolver;
|
|
17
22
|
//# sourceMappingURL=model-auth-handlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-auth-handlers.d.ts","sourceRoot":"","sources":["../../src/auth/model-auth-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAGH,KAAK,sBAAsB,EAE9B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAKH,KAAK,gBAAgB,EAExB,MAAM,0BAA0B,CAAC;AAOlC,MAAM,MAAM,4BAA4B,GAAG;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC5C,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B,CAAC;AAiCF,wBAAsB,gCAAgC,CAClD,UAAU,EAAE,sBAAsB,GACnC,OAAO,CAAC,gBAAgB,CAAC,CAQ3B;AA2CD,wBAAsB,0BAA0B,CAAC,KAAK,EAAE;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,4BAA4B,CAAC,CASxC;AAED,wBAAsB,8BAA8B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAetF;AAyBD,wBAAgB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"model-auth-handlers.d.ts","sourceRoot":"","sources":["../../src/auth/model-auth-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACH,KAAK,mBAAmB,EAG3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGH,KAAK,sBAAsB,EAE9B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAKH,KAAK,gBAAgB,EAExB,MAAM,0BAA0B,CAAC;AAOlC,MAAM,MAAM,4BAA4B,GAAG;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC5C,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B,CAAC;AAiCF,wBAAsB,gCAAgC,CAClD,UAAU,EAAE,sBAAsB,GACnC,OAAO,CAAC,gBAAgB,CAAC,CAQ3B;AA2CD,wBAAsB,0BAA0B,CAAC,KAAK,EAAE;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,4BAA4B,CAAC,CASxC;AAED,wBAAsB,8BAA8B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAetF;AAyBD;;;GAGG;AACH,wBAAgB,uBAAuB,CACnC,KAAK,GAAE,mBAAkD,GAC1D,eAAe,CAQjB"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defaultDextoGatewayOptions,
|
|
3
|
+
dextoGatewayRuntimeAuth
|
|
4
|
+
} from "./dexto-gateway.js";
|
|
1
5
|
import {
|
|
2
6
|
createChatGPTRuntimeAuth,
|
|
3
7
|
startChatGPTBrowserLogin
|
|
@@ -110,9 +114,10 @@ function resolveRuntimeAuthFromProfile(profile) {
|
|
|
110
114
|
) ?? null;
|
|
111
115
|
return runtimeAuth ? { ...runtimeAuth, auth } : null;
|
|
112
116
|
}
|
|
113
|
-
function createModelAuthResolver() {
|
|
117
|
+
function createModelAuthResolver(dexto = defaultDextoGatewayOptions()) {
|
|
114
118
|
return {
|
|
115
119
|
resolveRuntimeAuth(input) {
|
|
120
|
+
if (input.provider === "dexto-nova") return dextoGatewayRuntimeAuth(dexto);
|
|
116
121
|
const profile = getDefaultModelAuthProfile(loadModelAuthProfilesSync(), input.provider);
|
|
117
122
|
return profile ? resolveRuntimeAuthFromProfile(profile) : null;
|
|
118
123
|
}
|
package/dist/config/errors.cjs
CHANGED
|
@@ -73,9 +73,9 @@ class ConfigError {
|
|
|
73
73
|
import_core.ErrorScope.CONFIG,
|
|
74
74
|
import_core.ErrorType.USER,
|
|
75
75
|
`No project agent found and no global preferences configured.
|
|
76
|
-
Set a primaryAgent in a workspace registry under agents/, create a single workspace agent under agents/, or
|
|
76
|
+
Set a primaryAgent in a workspace registry under agents/, create a single workspace agent under agents/, or pass one with \`dexto -a <path>\`.`,
|
|
77
77
|
{ projectPath },
|
|
78
|
-
"
|
|
78
|
+
"Pass an agent with `dexto -a <path>` or create a project-specific agent config"
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
static invalidProjectPrimary(registryPath, primaryAgent, reason) {
|
|
@@ -93,9 +93,9 @@ Set a primaryAgent in a workspace registry under agents/, create a single worksp
|
|
|
93
93
|
import_error_codes.ConfigErrorCode.NO_GLOBAL_PREFERENCES,
|
|
94
94
|
import_core.ErrorScope.CONFIG,
|
|
95
95
|
import_core.ErrorType.USER,
|
|
96
|
-
`No global preferences found. Run \`dexto
|
|
96
|
+
`No global preferences found. Run \`dexto login\` or set a provider key to get started.`,
|
|
97
97
|
{},
|
|
98
|
-
"Run `dexto
|
|
98
|
+
"Run `dexto login` or set a provider key"
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
101
|
static setupIncomplete() {
|
|
@@ -103,9 +103,9 @@ Set a primaryAgent in a workspace registry under agents/, create a single worksp
|
|
|
103
103
|
import_error_codes.ConfigErrorCode.SETUP_INCOMPLETE,
|
|
104
104
|
import_core.ErrorScope.CONFIG,
|
|
105
105
|
import_core.ErrorType.USER,
|
|
106
|
-
`Global preferences setup is incomplete. Run \`dexto
|
|
106
|
+
`Global preferences setup is incomplete. Run \`dexto login\` or set a provider key.`,
|
|
107
107
|
{},
|
|
108
|
-
"Run `dexto
|
|
108
|
+
"Run `dexto login` or set a provider key"
|
|
109
109
|
);
|
|
110
110
|
}
|
|
111
111
|
static bundledNotFound(bundledPath) {
|
package/dist/config/errors.js
CHANGED
|
@@ -50,9 +50,9 @@ class ConfigError {
|
|
|
50
50
|
ErrorScope.CONFIG,
|
|
51
51
|
ErrorType.USER,
|
|
52
52
|
`No project agent found and no global preferences configured.
|
|
53
|
-
Set a primaryAgent in a workspace registry under agents/, create a single workspace agent under agents/, or
|
|
53
|
+
Set a primaryAgent in a workspace registry under agents/, create a single workspace agent under agents/, or pass one with \`dexto -a <path>\`.`,
|
|
54
54
|
{ projectPath },
|
|
55
|
-
"
|
|
55
|
+
"Pass an agent with `dexto -a <path>` or create a project-specific agent config"
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
58
|
static invalidProjectPrimary(registryPath, primaryAgent, reason) {
|
|
@@ -70,9 +70,9 @@ Set a primaryAgent in a workspace registry under agents/, create a single worksp
|
|
|
70
70
|
ConfigErrorCode.NO_GLOBAL_PREFERENCES,
|
|
71
71
|
ErrorScope.CONFIG,
|
|
72
72
|
ErrorType.USER,
|
|
73
|
-
`No global preferences found. Run \`dexto
|
|
73
|
+
`No global preferences found. Run \`dexto login\` or set a provider key to get started.`,
|
|
74
74
|
{},
|
|
75
|
-
"Run `dexto
|
|
75
|
+
"Run `dexto login` or set a provider key"
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
78
|
static setupIncomplete() {
|
|
@@ -80,9 +80,9 @@ Set a primaryAgent in a workspace registry under agents/, create a single worksp
|
|
|
80
80
|
ConfigErrorCode.SETUP_INCOMPLETE,
|
|
81
81
|
ErrorScope.CONFIG,
|
|
82
82
|
ErrorType.USER,
|
|
83
|
-
`Global preferences setup is incomplete. Run \`dexto
|
|
83
|
+
`Global preferences setup is incomplete. Run \`dexto login\` or set a provider key.`,
|
|
84
84
|
{},
|
|
85
|
-
"Run `dexto
|
|
85
|
+
"Run `dexto login` or set a provider key"
|
|
86
86
|
);
|
|
87
87
|
}
|
|
88
88
|
static bundledNotFound(bundledPath) {
|
|
@@ -190,14 +190,12 @@ async function resolveImageEntryFileFromStore(specifier, storeDir = getDefaultIm
|
|
|
190
190
|
return entry.installed[installedVersions[0] ?? ""]?.entryFile ?? null;
|
|
191
191
|
}
|
|
192
192
|
throw new Error(
|
|
193
|
-
`Image '${specifier.id}' has multiple installed versions but no active version set
|
|
193
|
+
`Image '${specifier.id}' has multiple installed versions but no active version set.`
|
|
194
194
|
);
|
|
195
195
|
}
|
|
196
196
|
const resolved = entry.installed[resolvedVersion];
|
|
197
197
|
if (!resolved) {
|
|
198
|
-
throw new Error(
|
|
199
|
-
`Image '${specifier.id}@${resolvedVersion}' is not installed. Run: dexto image install ${specifier.id}@${resolvedVersion}`
|
|
200
|
-
);
|
|
198
|
+
throw new Error(`Image '${specifier.id}@${resolvedVersion}' is not installed.`);
|
|
201
199
|
}
|
|
202
200
|
return resolved.entryFile;
|
|
203
201
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-store.d.ts","sourceRoot":"","sources":["../../src/images/image-store.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,QAAA,MAAM,uBAAuB;;;;;;;;;kBAqBhB,CAAC;AAEd,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzE,MAAM,WAAW,mBAAmB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,uBAAuB,IAAI,MAAM,CAMhD;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,GAAE,MAAkC,GAAG,MAAM,CAEzF;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,GAAE,MAAkC,GAAG,MAAM,CAExF;AAED,wBAAgB,yBAAyB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,MAAkC,GAC7C,MAAM,CAIR;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,GAAE,MAAkC,GAAG,iBAAiB,CAgBjG;AAED,wBAAsB,iBAAiB,CACnC,IAAI,EAAE,iBAAiB,EACvB,QAAQ,GAAE,MAAkC,GAC7C,OAAO,CAAC,IAAI,CAAC,CAef;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,mBAAmB,CAkC1E;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAQnE;AAED,wBAAgB,mCAAmC,CAC/C,SAAS,EAAE,MAAM,EACjB,GAAG,GAAE,MAAsB,GAC5B,MAAM,CAcR;AAED,wBAAgB,sCAAsC,CAClD,SAAS,EAAE,MAAM,EACjB,GAAG,GAAE,MAAsB,GAC5B,MAAM,CAOR;AAED,wBAAsB,8BAA8B,CAChD,SAAS,EAAE,mBAAmB,EAC9B,QAAQ,GAAE,MAAkC,GAC7C,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"image-store.d.ts","sourceRoot":"","sources":["../../src/images/image-store.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,QAAA,MAAM,uBAAuB;;;;;;;;;kBAqBhB,CAAC;AAEd,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzE,MAAM,WAAW,mBAAmB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,uBAAuB,IAAI,MAAM,CAMhD;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,GAAE,MAAkC,GAAG,MAAM,CAEzF;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,GAAE,MAAkC,GAAG,MAAM,CAExF;AAED,wBAAgB,yBAAyB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,MAAkC,GAC7C,MAAM,CAIR;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,GAAE,MAAkC,GAAG,iBAAiB,CAgBjG;AAED,wBAAsB,iBAAiB,CACnC,IAAI,EAAE,iBAAiB,EACvB,QAAQ,GAAE,MAAkC,GAC7C,OAAO,CAAC,IAAI,CAAC,CAef;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,mBAAmB,CAkC1E;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAQnE;AAED,wBAAgB,mCAAmC,CAC/C,SAAS,EAAE,MAAM,EACjB,GAAG,GAAE,MAAsB,GAC5B,MAAM,CAcR;AAED,wBAAgB,sCAAsC,CAClD,SAAS,EAAE,MAAM,EACjB,GAAG,GAAE,MAAsB,GAC5B,MAAM,CAOR;AAED,wBAAsB,8BAA8B,CAChD,SAAS,EAAE,mBAAmB,EAC9B,QAAQ,GAAE,MAAkC,GAC7C,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA4BxB;AAED,wBAAsB,qBAAqB,CACvC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,MAAkC,GAC7C,OAAO,CAAC,IAAI,CAAC,CASf;AAED,wBAAsB,oBAAoB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GACtD,OAAO,CAAC,IAAI,CAAC,CA+Bf"}
|
|
@@ -145,14 +145,12 @@ async function resolveImageEntryFileFromStore(specifier, storeDir = getDefaultIm
|
|
|
145
145
|
return entry.installed[installedVersions[0] ?? ""]?.entryFile ?? null;
|
|
146
146
|
}
|
|
147
147
|
throw new Error(
|
|
148
|
-
`Image '${specifier.id}' has multiple installed versions but no active version set
|
|
148
|
+
`Image '${specifier.id}' has multiple installed versions but no active version set.`
|
|
149
149
|
);
|
|
150
150
|
}
|
|
151
151
|
const resolved = entry.installed[resolvedVersion];
|
|
152
152
|
if (!resolved) {
|
|
153
|
-
throw new Error(
|
|
154
|
-
`Image '${specifier.id}@${resolvedVersion}' is not installed. Run: dexto image install ${specifier.id}@${resolvedVersion}`
|
|
155
|
-
);
|
|
153
|
+
throw new Error(`Image '${specifier.id}@${resolvedVersion}' is not installed.`);
|
|
156
154
|
}
|
|
157
155
|
return resolved.entryFile;
|
|
158
156
|
}
|