dexto 1.14.6 → 2.0.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/agents/coding-agent/coding-agent.yml +0 -2
- package/dist/cli/agent-audit.d.ts +12 -0
- package/dist/cli/agent-audit.d.ts.map +1 -0
- package/dist/cli/agent-audit.js +52 -0
- package/dist/cli/auth/billing.d.ts +0 -6
- package/dist/cli/auth/billing.d.ts.map +1 -1
- package/dist/cli/auth/billing.js +0 -23
- package/dist/cli/auth/constants.d.ts +3 -31
- package/dist/cli/auth/constants.d.ts.map +1 -1
- package/dist/cli/auth/constants.js +9 -33
- package/dist/cli/auth/index.d.ts +2 -9
- package/dist/cli/auth/index.d.ts.map +1 -1
- package/dist/cli/auth/index.js +2 -7
- package/dist/cli/auth/sign-in-runtime.d.ts +12 -0
- package/dist/cli/auth/sign-in-runtime.d.ts.map +1 -0
- package/dist/cli/auth/sign-in-runtime.js +59 -0
- package/dist/cli/cloud/app-scopes.d.ts +4 -0
- package/dist/cli/cloud/app-scopes.d.ts.map +1 -0
- package/dist/cli/cloud/app-scopes.js +19 -0
- package/dist/cli/cloud/command.d.ts +107 -0
- package/dist/cli/cloud/command.d.ts.map +1 -0
- package/dist/cli/cloud/command.js +154 -0
- package/dist/cli/cloud/commands/account.d.ts +11 -0
- package/dist/cli/cloud/commands/account.d.ts.map +1 -0
- package/dist/cli/cloud/commands/account.js +129 -0
- package/dist/cli/cloud/commands/agents.d.ts +3 -0
- package/dist/cli/cloud/commands/agents.d.ts.map +1 -0
- package/dist/cli/cloud/commands/agents.js +526 -0
- package/dist/cli/cloud/commands/api.d.ts +3 -0
- package/dist/cli/cloud/commands/api.d.ts.map +1 -0
- package/dist/cli/cloud/commands/api.js +26 -0
- package/dist/cli/cloud/commands/app-files.d.ts +29 -0
- package/dist/cli/cloud/commands/app-files.d.ts.map +1 -0
- package/dist/cli/cloud/commands/app-files.js +72 -0
- package/dist/cli/cloud/commands/artifacts.d.ts +3 -0
- package/dist/cli/cloud/commands/artifacts.d.ts.map +1 -0
- package/dist/cli/cloud/commands/artifacts.js +267 -0
- package/dist/cli/cloud/commands/automations.d.ts +3 -0
- package/dist/cli/cloud/commands/automations.d.ts.map +1 -0
- package/dist/cli/cloud/commands/automations.js +233 -0
- package/dist/cli/cloud/commands/chats.d.ts +3 -0
- package/dist/cli/cloud/commands/chats.d.ts.map +1 -0
- package/dist/cli/cloud/commands/chats.js +204 -0
- package/dist/cli/cloud/commands/data-deletions.d.ts +3 -0
- package/dist/cli/cloud/commands/data-deletions.d.ts.map +1 -0
- package/dist/cli/cloud/commands/data-deletions.js +55 -0
- package/dist/cli/cloud/commands/deploys.d.ts +10 -0
- package/dist/cli/cloud/commands/deploys.d.ts.map +1 -0
- package/dist/cli/cloud/commands/deploys.js +225 -0
- package/dist/cli/cloud/commands/drive.d.ts +12 -0
- package/dist/cli/cloud/commands/drive.d.ts.map +1 -0
- package/dist/cli/cloud/commands/drive.js +321 -0
- package/dist/cli/cloud/commands/files.d.ts +24 -0
- package/dist/cli/cloud/commands/files.d.ts.map +1 -0
- package/dist/cli/cloud/commands/files.js +284 -0
- package/dist/cli/cloud/commands/find.d.ts +3 -0
- package/dist/cli/cloud/commands/find.d.ts.map +1 -0
- package/dist/cli/cloud/commands/find.js +63 -0
- package/dist/cli/cloud/commands/models.d.ts +3 -0
- package/dist/cli/cloud/commands/models.d.ts.map +1 -0
- package/dist/cli/cloud/commands/models.js +250 -0
- package/dist/cli/cloud/commands/profile.d.ts +3 -0
- package/dist/cli/cloud/commands/profile.d.ts.map +1 -0
- package/dist/cli/cloud/commands/profile.js +120 -0
- package/dist/cli/cloud/commands/projects.d.ts +5 -0
- package/dist/cli/cloud/commands/projects.d.ts.map +1 -0
- package/dist/cli/cloud/commands/projects.js +66 -0
- package/dist/cli/cloud/commands/publish.d.ts +3 -0
- package/dist/cli/cloud/commands/publish.d.ts.map +1 -0
- package/dist/cli/cloud/commands/publish.js +139 -0
- package/dist/cli/cloud/commands/sandboxes.d.ts +3 -0
- package/dist/cli/cloud/commands/sandboxes.d.ts.map +1 -0
- package/dist/cli/cloud/commands/sandboxes.js +266 -0
- package/dist/cli/cloud/commands/secrets.d.ts +3 -0
- package/dist/cli/cloud/commands/secrets.d.ts.map +1 -0
- package/dist/cli/cloud/commands/secrets.js +111 -0
- package/dist/cli/cloud/commands/skills.d.ts +3 -0
- package/dist/cli/cloud/commands/skills.d.ts.map +1 -0
- package/dist/cli/cloud/commands/skills.js +203 -0
- package/dist/cli/cloud/commands/traces.d.ts +3 -0
- package/dist/cli/cloud/commands/traces.d.ts.map +1 -0
- package/dist/cli/cloud/commands/traces.js +142 -0
- package/dist/cli/cloud/commands/web.d.ts +3 -0
- package/dist/cli/cloud/commands/web.d.ts.map +1 -0
- package/dist/cli/cloud/commands/web.js +53 -0
- package/dist/cli/cloud/commands/workspace-apps.d.ts +58 -0
- package/dist/cli/cloud/commands/workspace-apps.d.ts.map +1 -0
- package/dist/cli/cloud/commands/workspace-apps.js +657 -0
- package/dist/cli/cloud/commands/workspace.d.ts +36 -0
- package/dist/cli/cloud/commands/workspace.d.ts.map +1 -0
- package/dist/cli/cloud/commands/workspace.js +281 -0
- package/dist/cli/cloud/connection.d.ts +33 -0
- package/dist/cli/cloud/connection.d.ts.map +1 -0
- package/dist/cli/cloud/connection.js +38 -0
- package/dist/cli/cloud/events.d.ts +63 -0
- package/dist/cli/cloud/events.d.ts.map +1 -0
- package/dist/cli/cloud/events.js +72 -0
- package/dist/cli/cloud/host.d.ts +9 -0
- package/dist/cli/cloud/host.d.ts.map +1 -0
- package/dist/cli/cloud/host.js +109 -0
- package/dist/cli/cloud/output.d.ts +34 -0
- package/dist/cli/cloud/output.d.ts.map +1 -0
- package/dist/cli/cloud/output.js +77 -0
- package/dist/cli/cloud/run.d.ts +26 -0
- package/dist/cli/cloud/run.d.ts.map +1 -0
- package/dist/cli/cloud/run.js +444 -0
- package/dist/cli/cloud/runtime.d.ts +33 -0
- package/dist/cli/cloud/runtime.d.ts.map +1 -0
- package/dist/cli/cloud/runtime.js +86 -0
- package/dist/cli/cloud/tar.d.ts +9 -0
- package/dist/cli/cloud/tar.d.ts.map +1 -0
- package/dist/cli/cloud/tar.js +69 -0
- package/dist/cli/cloud/transfer.d.ts +13 -0
- package/dist/cli/cloud/transfer.d.ts.map +1 -0
- package/dist/cli/cloud/transfer.js +36 -0
- package/dist/cli/cloud/v1.d.ts +20 -0
- package/dist/cli/cloud/v1.d.ts.map +1 -0
- package/dist/cli/cloud/v1.js +66 -0
- package/dist/cli/cloud/zip.d.ts +8 -0
- package/dist/cli/cloud/zip.d.ts.map +1 -0
- package/dist/cli/cloud/zip.js +66 -0
- package/dist/cli/commands/auth/sign-in-commands.d.ts +62 -0
- package/dist/cli/commands/auth/sign-in-commands.d.ts.map +1 -0
- package/dist/cli/commands/auth/sign-in-commands.js +248 -0
- package/dist/cli/commands/auth/sign-in-context.d.ts +16 -0
- package/dist/cli/commands/auth/sign-in-context.d.ts.map +1 -0
- package/dist/cli/commands/auth/sign-in-context.js +68 -0
- package/dist/cli/commands/cloud/register.d.ts +5 -0
- package/dist/cli/commands/cloud/register.d.ts.map +1 -1
- package/dist/cli/commands/cloud/register.js +44 -24
- package/dist/cli/commands/create-app.js +5 -6
- package/dist/cli/commands/create-image.d.ts.map +1 -1
- package/dist/cli/commands/create-image.js +9 -10
- package/dist/cli/commands/index.d.ts +0 -2
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +0 -2
- package/dist/cli/commands/init.d.ts +0 -2
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +5 -26
- package/dist/cli/commands/run/headless.d.ts.map +1 -1
- package/dist/cli/commands/run/headless.js +57 -2
- package/dist/cli/commands/run/output.d.ts +29 -10
- package/dist/cli/commands/run/output.d.ts.map +1 -1
- package/dist/cli/commands/run/output.js +44 -22
- package/dist/cli/commands/run/register.d.ts.map +1 -1
- package/dist/cli/commands/run/register.js +21 -9
- package/dist/cli/commands/run/step-log.d.ts +11 -0
- package/dist/cli/commands/run/step-log.d.ts.map +1 -0
- package/dist/cli/commands/run/step-log.js +42 -0
- package/dist/cli/commands/session/register.d.ts.map +1 -1
- package/dist/cli/commands/session/register.js +51 -21
- package/dist/cli/commands/session-commands.js +1 -1
- package/dist/cli/commands/setup.js +17 -14
- package/dist/cli/failure.d.ts +29 -0
- package/dist/cli/failure.d.ts.map +1 -0
- package/dist/cli/failure.js +31 -0
- package/dist/cli/help-json.d.ts +22 -0
- package/dist/cli/help-json.d.ts.map +1 -0
- package/dist/cli/help-json.js +20 -0
- package/dist/cli/import/claude-code.d.ts +10 -0
- package/dist/cli/import/claude-code.d.ts.map +1 -0
- package/dist/cli/import/claude-code.js +131 -0
- package/dist/cli/import/codex.d.ts +27 -0
- package/dist/cli/import/codex.d.ts.map +1 -0
- package/dist/cli/import/codex.js +148 -0
- package/dist/cli/import/git.d.ts +19 -0
- package/dist/cli/import/git.d.ts.map +1 -0
- package/dist/cli/import/git.js +95 -0
- package/dist/cli/import/local-chats.d.ts +28 -0
- package/dist/cli/import/local-chats.d.ts.map +1 -0
- package/dist/cli/import/local-chats.js +129 -0
- package/dist/cli/import/redaction.d.ts +37 -0
- package/dist/cli/import/redaction.d.ts.map +1 -0
- package/dist/cli/import/redaction.js +148 -0
- package/dist/cli/import/test-utils.d.ts +16 -0
- package/dist/cli/import/test-utils.d.ts.map +1 -0
- package/dist/cli/import/test-utils.js +223 -0
- package/dist/cli/import/transcript.d.ts +75 -0
- package/dist/cli/import/transcript.d.ts.map +1 -0
- package/dist/cli/import/transcript.js +123 -0
- package/dist/cli/interaction.d.ts +18 -0
- package/dist/cli/interaction.d.ts.map +1 -0
- package/dist/cli/interaction.js +30 -0
- package/dist/cli/modes/cli.d.ts.map +1 -1
- package/dist/cli/modes/cli.js +42 -9
- package/dist/cli/modes/server.js +8 -8
- package/dist/cli/modes/web.js +3 -3
- package/dist/cli/output.d.ts +9 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/output.js +6 -0
- package/dist/cli/utils/dexto-auth-check.d.ts +1 -1
- package/dist/cli/utils/dexto-auth-check.d.ts.map +1 -1
- package/dist/cli/utils/dexto-auth-check.js +4 -5
- package/dist/cli/utils/dexto-setup.d.ts +4 -5
- package/dist/cli/utils/dexto-setup.d.ts.map +1 -1
- package/dist/cli/utils/dexto-setup.js +17 -14
- package/dist/cli/utils/provider-setup.js +1 -1
- package/dist/cli/utils/scaffolding-utils.d.ts +9 -3
- package/dist/cli/utils/scaffolding-utils.d.ts.map +1 -1
- package/dist/cli/utils/scaffolding-utils.js +48 -40
- package/dist/cli/utils/version-check.d.ts.map +1 -1
- package/dist/cli/utils/version-check.js +2 -1
- package/dist/index-main.js +44 -65
- package/dist/webui/assets/index-D9xiOs62.js +1649 -0
- package/dist/webui/index.html +1 -1
- package/package.json +15 -14
- package/dist/cli/auth/api-client.d.ts +0 -125
- package/dist/cli/auth/api-client.d.ts.map +0 -1
- package/dist/cli/auth/api-client.js +0 -585
- package/dist/cli/auth/device.d.ts +0 -14
- package/dist/cli/auth/device.d.ts.map +0 -1
- package/dist/cli/auth/device.js +0 -84
- package/dist/cli/auth/dexto-api-key.d.ts +0 -34
- package/dist/cli/auth/dexto-api-key.d.ts.map +0 -1
- package/dist/cli/auth/dexto-api-key.js +0 -160
- package/dist/cli/auth/login-persistence.d.ts +0 -15
- package/dist/cli/auth/login-persistence.d.ts.map +0 -1
- package/dist/cli/auth/login-persistence.js +0 -72
- package/dist/cli/auth/oauth.d.ts +0 -39
- package/dist/cli/auth/oauth.d.ts.map +0 -1
- package/dist/cli/auth/oauth.js +0 -434
- package/dist/cli/auth/service.d.ts +0 -24
- package/dist/cli/auth/service.d.ts.map +0 -1
- package/dist/cli/auth/service.js +0 -161
- package/dist/cli/auth/types.d.ts +0 -11
- package/dist/cli/auth/types.d.ts.map +0 -1
- package/dist/cli/auth/types.js +0 -1
- package/dist/cli/cloud-chat.d.ts +0 -18
- package/dist/cli/cloud-chat.d.ts.map +0 -1
- package/dist/cli/cloud-chat.js +0 -734
- package/dist/cli/commands/auth/index.d.ts +0 -4
- package/dist/cli/commands/auth/index.d.ts.map +0 -1
- package/dist/cli/commands/auth/index.js +0 -4
- package/dist/cli/commands/auth/login.d.ts +0 -12
- package/dist/cli/commands/auth/login.d.ts.map +0 -1
- package/dist/cli/commands/auth/login.js +0 -153
- package/dist/cli/commands/auth/logout.d.ts +0 -5
- package/dist/cli/commands/auth/logout.d.ts.map +0 -1
- package/dist/cli/commands/auth/logout.js +0 -81
- package/dist/cli/commands/auth/register.d.ts +0 -3
- package/dist/cli/commands/auth/register.d.ts.map +0 -1
- package/dist/cli/commands/auth/register.js +0 -96
- package/dist/cli/commands/auth/status.d.ts +0 -2
- package/dist/cli/commands/auth/status.d.ts.map +0 -1
- package/dist/cli/commands/auth/status.js +0 -22
- package/dist/cli/commands/billing/index.d.ts +0 -2
- package/dist/cli/commands/billing/index.d.ts.map +0 -1
- package/dist/cli/commands/billing/index.js +0 -2
- package/dist/cli/commands/billing/register.d.ts +0 -3
- package/dist/cli/commands/billing/register.d.ts.map +0 -1
- package/dist/cli/commands/billing/register.js +0 -20
- package/dist/cli/commands/billing/status.d.ts +0 -8
- package/dist/cli/commands/billing/status.d.ts.map +0 -1
- package/dist/cli/commands/billing/status.js +0 -71
- package/dist/cli/commands/cloud/discovery.d.ts +0 -17
- package/dist/cli/commands/cloud/discovery.d.ts.map +0 -1
- package/dist/cli/commands/cloud/discovery.js +0 -88
- package/dist/cli/commands/deploy/client.d.ts +0 -113
- package/dist/cli/commands/deploy/client.d.ts.map +0 -1
- package/dist/cli/commands/deploy/client.js +0 -519
- package/dist/cli/commands/deploy/config.d.ts +0 -37
- package/dist/cli/commands/deploy/config.d.ts.map +0 -1
- package/dist/cli/commands/deploy/config.js +0 -144
- package/dist/cli/commands/deploy/entry-agent.d.ts +0 -3
- package/dist/cli/commands/deploy/entry-agent.d.ts.map +0 -1
- package/dist/cli/commands/deploy/entry-agent.js +0 -70
- package/dist/cli/commands/deploy/index.d.ts +0 -12
- package/dist/cli/commands/deploy/index.d.ts.map +0 -1
- package/dist/cli/commands/deploy/index.js +0 -370
- package/dist/cli/commands/deploy/links.d.ts +0 -3
- package/dist/cli/commands/deploy/links.d.ts.map +0 -1
- package/dist/cli/commands/deploy/links.js +0 -53
- package/dist/cli/commands/deploy/register.d.ts +0 -6
- package/dist/cli/commands/deploy/register.d.ts.map +0 -1
- package/dist/cli/commands/deploy/register.js +0 -128
- package/dist/cli/commands/deploy/snapshot.d.ts +0 -12
- package/dist/cli/commands/deploy/snapshot.d.ts.map +0 -1
- package/dist/cli/commands/deploy/snapshot.js +0 -76
- package/dist/cli/commands/deploy/state.d.ts +0 -13
- package/dist/cli/commands/deploy/state.d.ts.map +0 -1
- package/dist/cli/commands/deploy/state.js +0 -122
- package/dist/cli/commands/span/register.d.ts +0 -6
- package/dist/cli/commands/span/register.d.ts.map +0 -1
- package/dist/cli/commands/span/register.js +0 -25
- package/dist/cli/commands/trace/client.d.ts +0 -98
- package/dist/cli/commands/trace/client.d.ts.map +0 -1
- package/dist/cli/commands/trace/client.js +0 -150
- package/dist/cli/commands/trace/format.d.ts +0 -5
- package/dist/cli/commands/trace/format.d.ts.map +0 -1
- package/dist/cli/commands/trace/format.js +0 -58
- package/dist/cli/commands/trace/index.d.ts +0 -21
- package/dist/cli/commands/trace/index.d.ts.map +0 -1
- package/dist/cli/commands/trace/index.js +0 -49
- package/dist/cli/commands/trace/register.d.ts +0 -6
- package/dist/cli/commands/trace/register.d.ts.map +0 -1
- package/dist/cli/commands/trace/register.js +0 -71
- package/dist/webui/assets/index-DEfRFmFT.js +0 -1667
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
*/
|
|
26
26
|
import chalk from 'chalk';
|
|
27
27
|
import * as p from '@clack/prompts';
|
|
28
|
-
import {
|
|
28
|
+
import { canUseDextoProvider } from './dexto-setup.js';
|
|
29
29
|
import { getEffectiveLLMConfig } from '../../config/effective-llm.js';
|
|
30
30
|
/**
|
|
31
31
|
* Check if user is configured to use Dexto Nova credits but is not authenticated.
|
|
@@ -43,7 +43,7 @@ import { getEffectiveLLMConfig } from '../../config/effective-llm.js';
|
|
|
43
43
|
* const result = await checkDextoAuthState(true, 'coding-agent');
|
|
44
44
|
* if (!result.shouldContinue) {
|
|
45
45
|
* if (result.action === 'login') {
|
|
46
|
-
* await
|
|
46
|
+
* await signInForDextoModels();
|
|
47
47
|
* } else if (result.action === 'setup') {
|
|
48
48
|
* await handleSetupCommand();
|
|
49
49
|
* }
|
|
@@ -57,9 +57,8 @@ export async function checkDextoAuthState(interactive = true, agentId = 'coding-
|
|
|
57
57
|
if (!effectiveLLM || effectiveLLM.provider !== 'dexto-nova') {
|
|
58
58
|
return { shouldContinue: true };
|
|
59
59
|
}
|
|
60
|
-
// Using dexto-nova provider - check
|
|
61
|
-
|
|
62
|
-
if (authenticated) {
|
|
60
|
+
// Using dexto-nova provider - check the sign-in can run Dexto models
|
|
61
|
+
if (await canUseDextoProvider()) {
|
|
63
62
|
return { shouldContinue: true };
|
|
64
63
|
}
|
|
65
64
|
// User is configured for Dexto Nova credits but not logged in
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
export { canUseDextoProvider } from '@dexto/agent-management';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* 1. User has usable Dexto auth state from `dexto login`
|
|
5
|
-
* 2. Has DEXTO_API_KEY (from auth config or environment)
|
|
3
|
+
* Signs in to Dexto asking to spend credits (`cloud:write`), as choosing Dexto models needs. A
|
|
4
|
+
* sign-in that only reads keeps what it had and gains that.
|
|
6
5
|
*/
|
|
7
|
-
export declare function
|
|
6
|
+
export declare function signInForDextoModels(): Promise<void>;
|
|
8
7
|
//# sourceMappingURL=dexto-setup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dexto-setup.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/dexto-setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dexto-setup.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/dexto-setup.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D;;;GAGG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAa1D"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
1
|
+
// Setting this machine up for Dexto models: whether they can run, and signing in so they can.
|
|
2
|
+
export { canUseDextoProvider } from '@dexto/agent-management';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* 1. User has usable Dexto auth state from `dexto login`
|
|
7
|
-
* 2. Has DEXTO_API_KEY (from auth config or environment)
|
|
4
|
+
* Signs in to Dexto asking to spend credits (`cloud:write`), as choosing Dexto models needs. A
|
|
5
|
+
* sign-in that only reads keeps what it had and gains that.
|
|
8
6
|
*/
|
|
9
|
-
export async function
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
export async function signInForDextoModels() {
|
|
8
|
+
const [{ login }, { nodeSignInContext }] = await Promise.all([
|
|
9
|
+
import('../commands/auth/sign-in-commands.js'),
|
|
10
|
+
import('../commands/auth/sign-in-context.js'),
|
|
11
|
+
]);
|
|
12
|
+
await login(await nodeSignInContext(), {
|
|
13
|
+
profile: null,
|
|
14
|
+
org: null,
|
|
15
|
+
device: false,
|
|
16
|
+
browser: true,
|
|
17
|
+
scopes: ['cloud:write'],
|
|
18
|
+
apiKey: null,
|
|
19
|
+
});
|
|
17
20
|
}
|
|
@@ -260,7 +260,7 @@ export async function selectProvider() {
|
|
|
260
260
|
*/
|
|
261
261
|
export function getProviderDisplayName(provider) {
|
|
262
262
|
if (provider === 'dexto-nova')
|
|
263
|
-
return 'Dexto
|
|
263
|
+
return 'Dexto';
|
|
264
264
|
if (isLLMProvider(provider)) {
|
|
265
265
|
return PROVIDER_REGISTRY[provider]?.label || provider;
|
|
266
266
|
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import * as p from '@clack/prompts';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The range a scaffolded project asks for `packageName` (an `@dexto/*` package): the version the
|
|
4
|
+
* CLI itself runs, since dexto versions apart from them. A package the CLI doesn't install, such as
|
|
5
|
+
* @dexto/image-bundler, takes @dexto/core's, as the @dexto/* packages version together.
|
|
6
|
+
*/
|
|
7
|
+
export declare function dextoPackageRange(packageName: string, cliRoot?: string): string;
|
|
8
|
+
/** The range a scaffolded project asks for a peer of @dexto/core, such as zod: core's own. */
|
|
9
|
+
export declare function dextoPeerRange(peerName: string, cliRoot?: string): string;
|
|
4
10
|
export declare function isLocalDependencySpecifier(specifier: string): boolean;
|
|
5
11
|
export declare function hasVersionInPackageSpecifier(specifier: string): boolean;
|
|
6
|
-
export declare function pinDextoPackageIfUnversioned(specifier: string,
|
|
12
|
+
export declare function pinDextoPackageIfUnversioned(specifier: string, rangeFor: (packageName: string) => string): string;
|
|
7
13
|
/**
|
|
8
14
|
* Validates a project name against the standard regex
|
|
9
15
|
* @param name - The project name to validate
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffolding-utils.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/scaffolding-utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"scaffolding-utils.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/scaffolding-utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AAqCpC;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,MAAyB,GAAG,MAAM,CAMjG;AAED,8FAA8F;AAC9F,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,MAAyB,GAAG,MAAM,CAS3F;AAED,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAOrE;AAED,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAYvE;AAED,wBAAgB,4BAA4B,CACxC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,GAC1C,MAAM,CAKR;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMpE;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACtC,WAAW,GAAE,MAA2B,EACxC,aAAa,GAAE,MAAiD,GACjE,OAAO,CAAC,MAAM,CAAC,CAmBjB;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CACxC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,GACtC,OAAO,CAAC,MAAM,CAAC,CAiBjB;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAErE;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACjC,WAAW,EAAE,MAAM,EACnB,iBAAiB,GAAE,MAAM,EAAO,GACjC,OAAO,CAAC,IAAI,CAAC,CAIf;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACjC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,KAAK,GAAG,OAAO,GAAG,SAAS,GAClC,OAAO,CAAC,IAAI,CAAC,CAiCf;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkB7F;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB/E;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BjF;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACrC,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE;IACF,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B,EACD,cAAc,CAAC,EAAE,MAAM,GACxB,OAAO,CAAC,IAAI,CAAC,CAef;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAClC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,OAAO,CAAC,IAAI,CAAC,CAMf;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpE"}
|
|
@@ -1,55 +1,63 @@
|
|
|
1
1
|
import fs from 'fs-extra';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
3
|
+
import { existsSync, readFileSync, realpathSync } from 'node:fs';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import chalk from 'chalk';
|
|
6
6
|
import { getDextoPackageRoot } from '@dexto/agent-management';
|
|
7
7
|
import { executeWithTimeout } from './execute.js';
|
|
8
8
|
import { textOrExit } from './prompt-helpers.js';
|
|
9
9
|
import { getPackageManager, getPackageManagerInstallCommand } from './package-mgmt.js';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return undefined;
|
|
13
|
-
}
|
|
14
|
-
try {
|
|
15
|
-
const content = readFileSync(packageJsonPath, 'utf-8');
|
|
16
|
-
const pkg = JSON.parse(content);
|
|
17
|
-
if (typeof pkg.version === 'string' && pkg.version.length > 0) {
|
|
18
|
-
return pkg.version;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
// Ignore parse/read errors and fall back.
|
|
23
|
-
}
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
function resolveCliPackageVersion() {
|
|
10
|
+
/** The installed dexto package's folder: the package.json above this module, or the standalone binary's. */
|
|
11
|
+
function cliPackageRoot() {
|
|
27
12
|
const scriptDir = path.dirname(fileURLToPath(import.meta.url));
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return localVersion;
|
|
32
|
-
}
|
|
13
|
+
const local = path.resolve(scriptDir, '../../..');
|
|
14
|
+
if (existsSync(path.join(local, 'package.json')))
|
|
15
|
+
return local;
|
|
33
16
|
const packageRoot = getDextoPackageRoot();
|
|
34
|
-
if (packageRoot)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
17
|
+
if (packageRoot !== undefined && existsSync(path.join(packageRoot, 'package.json')))
|
|
18
|
+
return packageRoot;
|
|
19
|
+
throw new Error("Could not find the dexto CLI's package.json");
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The package.json of the copy of `packageName` the CLI at `cliRoot` loads: the first in the
|
|
23
|
+
* node_modules folders above it, as ES modules resolve (never NODE_PATH or global folders).
|
|
24
|
+
*/
|
|
25
|
+
function installedPackage(packageName, cliRoot) {
|
|
26
|
+
for (let dir = realpathSync(cliRoot);; dir = path.dirname(dir)) {
|
|
27
|
+
const packageJson = path.join(dir, 'node_modules', packageName, 'package.json');
|
|
28
|
+
if (path.basename(dir) !== 'node_modules' && existsSync(packageJson)) {
|
|
29
|
+
const pkg = JSON.parse(readFileSync(packageJson, 'utf-8'));
|
|
30
|
+
if (typeof pkg === 'object' && pkg !== null)
|
|
31
|
+
return { ...pkg };
|
|
39
32
|
}
|
|
33
|
+
if (path.dirname(dir) === dir)
|
|
34
|
+
return null;
|
|
40
35
|
}
|
|
41
|
-
return process.env.DEXTO_CLI_VERSION;
|
|
42
36
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
function installedVersion(packageName, cliRoot) {
|
|
38
|
+
const version = installedPackage(packageName, cliRoot)?.version;
|
|
39
|
+
return typeof version === 'string' && version.length > 0 ? version : null;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The range a scaffolded project asks for `packageName` (an `@dexto/*` package): the version the
|
|
43
|
+
* CLI itself runs, since dexto versions apart from them. A package the CLI doesn't install, such as
|
|
44
|
+
* @dexto/image-bundler, takes @dexto/core's, as the @dexto/* packages version together.
|
|
45
|
+
*/
|
|
46
|
+
export function dextoPackageRange(packageName, cliRoot = cliPackageRoot()) {
|
|
47
|
+
const version = installedVersion(packageName, cliRoot) ?? installedVersion('@dexto/core', cliRoot);
|
|
48
|
+
if (version === null)
|
|
49
|
+
throw new Error(`Could not find the @dexto/core the dexto CLI at ${cliRoot} runs`);
|
|
50
|
+
return `^${version}`;
|
|
50
51
|
}
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
/** The range a scaffolded project asks for a peer of @dexto/core, such as zod: core's own. */
|
|
53
|
+
export function dextoPeerRange(peerName, cliRoot = cliPackageRoot()) {
|
|
54
|
+
const peers = installedPackage('@dexto/core', cliRoot)?.peerDependencies;
|
|
55
|
+
const range = typeof peers === 'object' && peers !== null
|
|
56
|
+
? Object.entries(peers).find(([name]) => name === peerName)?.[1]
|
|
57
|
+
: undefined;
|
|
58
|
+
if (typeof range !== 'string')
|
|
59
|
+
throw new Error(`The @dexto/core the dexto CLI at ${cliRoot} runs has no ${peerName} peer`);
|
|
60
|
+
return range;
|
|
53
61
|
}
|
|
54
62
|
export function isLocalDependencySpecifier(specifier) {
|
|
55
63
|
return (specifier.startsWith('.') ||
|
|
@@ -69,14 +77,14 @@ export function hasVersionInPackageSpecifier(specifier) {
|
|
|
69
77
|
}
|
|
70
78
|
return true;
|
|
71
79
|
}
|
|
72
|
-
export function pinDextoPackageIfUnversioned(specifier,
|
|
80
|
+
export function pinDextoPackageIfUnversioned(specifier, rangeFor) {
|
|
73
81
|
if (isLocalDependencySpecifier(specifier))
|
|
74
82
|
return specifier;
|
|
75
83
|
if (!specifier.startsWith('@dexto/'))
|
|
76
84
|
return specifier;
|
|
77
85
|
if (hasVersionInPackageSpecifier(specifier))
|
|
78
86
|
return specifier;
|
|
79
|
-
return `${specifier}@${
|
|
87
|
+
return `${specifier}@${rangeFor(specifier)}`;
|
|
80
88
|
}
|
|
81
89
|
/**
|
|
82
90
|
* Validates a project name against the standard regex
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-check.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/version-check.ts"],"names":[],"mappings":"AAiBA;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;CACzB;AAkJD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,eAAe,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CA6DxF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"version-check.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/version-check.ts"],"names":[],"mappings":"AAiBA;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;CACzB;AAkJD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,eAAe,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CA6DxF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CActE"}
|
|
@@ -220,7 +220,8 @@ export async function checkForUpdates(currentVersion) {
|
|
|
220
220
|
export function displayUpdateNotification(updateInfo) {
|
|
221
221
|
const message = `Update available: ${chalk.gray(updateInfo.current)} ${chalk.gray('→')} ${chalk.green(updateInfo.latest)}\n` +
|
|
222
222
|
`Run: ${chalk.cyan(updateInfo.updateCommand)}`;
|
|
223
|
-
|
|
223
|
+
// A notice, not a result: stderr, so stdout stays what the command printed.
|
|
224
|
+
console.error(boxen(message, {
|
|
224
225
|
padding: 1,
|
|
225
226
|
margin: { top: 1, bottom: 1, left: 0, right: 0 },
|
|
226
227
|
borderColor: 'yellow',
|
package/dist/index-main.js
CHANGED
|
@@ -47,43 +47,31 @@ process.env.DEXTO_CLI_VERSION = cliVersion;
|
|
|
47
47
|
import { logger, startLlmRegistryAutoUpdate, DextoAgent, isPath } from '@dexto/core';
|
|
48
48
|
import { getAllSupportedModels, getProviderFromModel } from '@dexto/llm';
|
|
49
49
|
import { applyImageDefaults, cleanNullValues, AgentConfigSchema, loadImage, resolveServicesFromConfig, toDextoAgentOptions, } from '@dexto/agent-config';
|
|
50
|
-
import { registerConfiguredSkillPrompts, getDextoPackageRoot, resolveAgentPath, loadAgentConfig, findDextoProjectRoot, globalPreferencesExist, loadGlobalPreferences, resolveBundledScript, enrichAgentConfig, isDextoAuthEnabled, createModelAuthResolver, resolveApiKeyForProvider, getPrimaryApiKeyEnvVar, } from '@dexto/agent-management';
|
|
50
|
+
import { registerConfiguredSkillPrompts, getDextoPackageRoot, resolveAgentPath, loadAgentConfig, findDextoProjectRoot, globalPreferencesExist, loadGlobalPreferences, resolveBundledScript, enrichAgentConfig, isDextoAuthEnabled, createModelAuthResolver, dextoGateway, dextoMcp, resolveApiKeyForProvider, getPrimaryApiKeyEnvVar, } from '@dexto/agent-management';
|
|
51
51
|
import { validateCliOptions, handleCliOptionsError } from './cli/utils/options.js';
|
|
52
52
|
import { validateAgentConfig } from './cli/utils/config-validation.js';
|
|
53
53
|
import { applyCLIOverrides, applyStartupLLMFallback, applyUserPreferences, } from './config/cli-overrides.js';
|
|
54
54
|
import { registerRunCommand } from './cli/commands/run/register.js';
|
|
55
55
|
import { registerSessionCommand } from './cli/commands/session/register.js';
|
|
56
56
|
import { registerSearchCommand } from './cli/commands/search/register.js';
|
|
57
|
-
import { registerAuthCommand } from './cli/commands/auth/register.js';
|
|
58
|
-
import { registerBillingCommand } from './cli/commands/billing/register.js';
|
|
59
57
|
import { registerCloudCommand } from './cli/commands/cloud/register.js';
|
|
58
|
+
import { isRootJsonHelp, rootHelpJson } from './cli/help-json.js';
|
|
60
59
|
import { registerMcpCommand } from './cli/commands/mcp/register.js';
|
|
61
60
|
import { registerImageCommand } from './cli/commands/image/register.js';
|
|
62
61
|
import { registerPluginCommand } from './cli/commands/plugin/register.js';
|
|
63
62
|
import { registerAgentsCommand } from './cli/commands/agents/register.js';
|
|
64
|
-
import { registerDeployCommand } from './cli/commands/deploy/register.js';
|
|
65
|
-
import { registerSpanCommand } from './cli/commands/span/register.js';
|
|
66
|
-
import { registerTraceCommand } from './cli/commands/trace/register.js';
|
|
67
63
|
import { registerInitCommand } from './cli/commands/init.js';
|
|
68
64
|
import { ensureImageImporterConfigured } from './cli/utils/image-importer.js';
|
|
69
65
|
const program = new Command();
|
|
70
|
-
let
|
|
66
|
+
let earlierSignInsCarriedOver = false;
|
|
71
67
|
let versionCheckPromise = null;
|
|
72
68
|
let llmRegistryAutoUpdateStarted = false;
|
|
73
|
-
async function
|
|
74
|
-
if (
|
|
69
|
+
async function ensureDextoSignInsCarriedOver() {
|
|
70
|
+
if (earlierSignInsCarriedOver)
|
|
75
71
|
return;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
const { getDextoApiKey } = await import('./cli/auth/index.js');
|
|
82
|
-
const dextoApiKey = await getDextoApiKey();
|
|
83
|
-
if (dextoApiKey) {
|
|
84
|
-
process.env.DEXTO_API_KEY = dextoApiKey;
|
|
85
|
-
}
|
|
86
|
-
dextoApiKeyBootstrapped = true;
|
|
72
|
+
const { carryOverEarlierSignIns } = await import('./cli/commands/auth/sign-in-context.js');
|
|
73
|
+
await carryOverEarlierSignIns();
|
|
74
|
+
earlierSignInsCarriedOver = true;
|
|
87
75
|
}
|
|
88
76
|
async function getVersionCheckResult() {
|
|
89
77
|
if (!versionCheckPromise) {
|
|
@@ -105,7 +93,6 @@ program
|
|
|
105
93
|
.description('AI-powered CLI and WebUI for interacting with MCP servers.')
|
|
106
94
|
.version(cliVersion, '-v, --version', 'output the current version')
|
|
107
95
|
.option('-a, --agent <id|path>', 'Agent ID or path to agent config file')
|
|
108
|
-
.option('--cloud-agent <id>', 'Connect the interactive CLI to a deployed cloud agent by ID')
|
|
109
96
|
.option('-p, --prompt <text>', 'Start the interactive CLI and immediately run the prompt')
|
|
110
97
|
.option('-s, --strict', 'Require all server connections to succeed')
|
|
111
98
|
.option('--no-verbose', 'Disable verbose output')
|
|
@@ -147,9 +134,6 @@ program
|
|
|
147
134
|
}
|
|
148
135
|
}));
|
|
149
136
|
registerImageCommand({ program });
|
|
150
|
-
registerDeployCommand({ program });
|
|
151
|
-
registerSpanCommand({ program });
|
|
152
|
-
registerTraceCommand({ program });
|
|
153
137
|
registerInitCommand({ program });
|
|
154
138
|
// 4) `init-app` SUB-COMMAND
|
|
155
139
|
program
|
|
@@ -296,7 +280,7 @@ registerPluginCommand({ program });
|
|
|
296
280
|
async function bootstrapAgentFromGlobalOpts(options) {
|
|
297
281
|
const { mode, modelOverride } = options;
|
|
298
282
|
const isHeadlessRun = mode === 'headless-run';
|
|
299
|
-
await
|
|
283
|
+
await ensureDextoSignInsCarriedOver();
|
|
300
284
|
await ensureImageImporterConfigured();
|
|
301
285
|
const globalOpts = program.opts();
|
|
302
286
|
const effectiveModel = modelOverride ?? globalOpts.model;
|
|
@@ -359,6 +343,8 @@ async function bootstrapAgentFromGlobalOpts(options) {
|
|
|
359
343
|
logLevel: isHeadlessRun ? 'error' : 'info',
|
|
360
344
|
workspaceRoot,
|
|
361
345
|
});
|
|
346
|
+
// Signed in: the session gets the Dexto MCP's tools beside the person's own servers.
|
|
347
|
+
enrichedConfig.mcpServers = dextoMcp.withDextoMcpServer(enrichedConfig.mcpServers, await dextoMcp.dextoMcpServer(dextoGateway.defaultDextoGatewayOptions()));
|
|
362
348
|
if (isHeadlessRun) {
|
|
363
349
|
// Force silent transport in headless mode even when agent config defines logger settings.
|
|
364
350
|
// `dexto run` owns stderr formatting and should be the only writer.
|
|
@@ -383,6 +369,7 @@ async function bootstrapAgentFromGlobalOpts(options) {
|
|
|
383
369
|
hostContext: { workspaceRoot },
|
|
384
370
|
overrides: {
|
|
385
371
|
authResolver: createModelAuthResolver(),
|
|
372
|
+
mcpAuthProviderFactory: dextoMcp.withDextoMcpAuth(null, dextoGateway.defaultDextoGatewayOptions()),
|
|
386
373
|
},
|
|
387
374
|
}));
|
|
388
375
|
agent.setApprovalHandler((request) => handleHeadlessApproval(request, agent, undefined));
|
|
@@ -410,8 +397,6 @@ const runtimeCommandContext = {
|
|
|
410
397
|
registerRunCommand(runtimeCommandContext);
|
|
411
398
|
registerSessionCommand(runtimeCommandContext);
|
|
412
399
|
registerSearchCommand(runtimeCommandContext);
|
|
413
|
-
registerAuthCommand(runtimeCommandContext);
|
|
414
|
-
registerBillingCommand(runtimeCommandContext);
|
|
415
400
|
registerCloudCommand(program);
|
|
416
401
|
registerMcpCommand({ program });
|
|
417
402
|
// 13) Main dexto CLI - Interactive (CLI) or run in other modes (--mode web/server/mcp)
|
|
@@ -424,9 +409,9 @@ program
|
|
|
424
409
|
' dexto --prompt "query" Start interactive CLI and run the prompt\n' +
|
|
425
410
|
' dexto run "query" Run one-off headless task\n\n' +
|
|
426
411
|
'Session Management Commands:\n' +
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
' dexto
|
|
412
|
+
" dexto chat list List this machine's chats\n" +
|
|
413
|
+
" dexto chat history [id] Show a chat's messages\n" +
|
|
414
|
+
' dexto chat delete <id> Delete a chat\n' +
|
|
430
415
|
' dexto search <query> Search across sessions\n' +
|
|
431
416
|
' Options: --session <id>, --role <user|assistant>, --limit <n>\n\n' +
|
|
432
417
|
'Agent Selection:\n' +
|
|
@@ -442,7 +427,7 @@ program
|
|
|
442
427
|
' dexto --mode mcp Run as MCP server\n\n' +
|
|
443
428
|
'Docs: https://cli.dexto.ai')
|
|
444
429
|
.action(withAnalytics('main', async () => {
|
|
445
|
-
await
|
|
430
|
+
await ensureDextoSignInsCarriedOver();
|
|
446
431
|
await ensureImageImporterConfigured();
|
|
447
432
|
ensureLlmRegistryAutoUpdateStarted();
|
|
448
433
|
// ——— ENV CHECK (optional) ———
|
|
@@ -483,9 +468,9 @@ program
|
|
|
483
468
|
// the first positional argument as an agent name to avoid ambiguity with prompts.
|
|
484
469
|
// ——— FORCE CLI MODE FOR PROMPT/SESSION FLAGS ———
|
|
485
470
|
// If a prompt or session flag was provided, force CLI mode.
|
|
486
|
-
const modeForcedByChatFlags = Boolean(initialPrompt || opts.continue || opts.resume
|
|
471
|
+
const modeForcedByChatFlags = Boolean(initialPrompt || opts.continue || opts.resume);
|
|
487
472
|
if (modeForcedByChatFlags && opts.mode !== 'cli') {
|
|
488
|
-
console.error(`ℹ️ Forcing CLI mode due to --prompt/--continue/--resume
|
|
473
|
+
console.error(`ℹ️ Forcing CLI mode due to --prompt/--continue/--resume.`);
|
|
489
474
|
console.error(` Original mode: ${opts.mode} → Overridden to: cli`);
|
|
490
475
|
opts.mode = 'cli';
|
|
491
476
|
}
|
|
@@ -495,28 +480,6 @@ program
|
|
|
495
480
|
console.error('💡 For non-interactive runs, use `dexto run "<prompt>"`, or use --mode server for automation.');
|
|
496
481
|
safeExit('main', 1, 'no-tty');
|
|
497
482
|
}
|
|
498
|
-
if (opts.cloudAgent) {
|
|
499
|
-
if (opts.agent) {
|
|
500
|
-
console.error('❌ `--agent` and `--cloud-agent` are mutually exclusive. Use one chat target at a time.');
|
|
501
|
-
safeExit('main', 1, 'cloud-agent-conflict');
|
|
502
|
-
}
|
|
503
|
-
try {
|
|
504
|
-
const { startCloudChatCli } = await import('./cli/cloud-chat.js');
|
|
505
|
-
await startCloudChatCli({
|
|
506
|
-
cloudAgentId: String(opts.cloudAgent),
|
|
507
|
-
...(initialPrompt ? { initialPrompt } : {}),
|
|
508
|
-
...(opts.resume ? { resume: String(opts.resume) } : {}),
|
|
509
|
-
...(opts.continue ? { continueMostRecent: true } : {}),
|
|
510
|
-
});
|
|
511
|
-
safeExit('main', 0);
|
|
512
|
-
}
|
|
513
|
-
catch (err) {
|
|
514
|
-
if (err instanceof ExitSignal)
|
|
515
|
-
throw err;
|
|
516
|
-
console.error(`❌ Cloud chat failed: ${err}`);
|
|
517
|
-
safeExit('main', 1, 'cloud-chat-error');
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
483
|
// ——— Infer provider & API key from model ———
|
|
521
484
|
if (opts.model) {
|
|
522
485
|
if (opts.model.includes('/')) {
|
|
@@ -668,14 +631,11 @@ program
|
|
|
668
631
|
const authCheck = await checkDextoAuthState(opts.interactive !== false, agentId);
|
|
669
632
|
if (!authCheck.shouldContinue) {
|
|
670
633
|
if (authCheck.action === 'login') {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
await handleLoginCommand();
|
|
674
|
-
// Verify key was actually provisioned (provisionKeys silently catches errors)
|
|
675
|
-
const { canUseDextoProvider } = await import('./cli/utils/dexto-setup.js');
|
|
634
|
+
const { canUseDextoProvider, signInForDextoModels } = await import('./cli/utils/dexto-setup.js');
|
|
635
|
+
await signInForDextoModels();
|
|
676
636
|
if (!(await canUseDextoProvider())) {
|
|
677
|
-
console.error(
|
|
678
|
-
safeExit('main', 1, 'dexto-
|
|
637
|
+
console.error("\n❌ Signed in, but Dexto models can't run yet: allow spending credits when asked, or run `dexto setup` to use a different provider.\n");
|
|
638
|
+
safeExit('main', 1, 'dexto-models-not-ready');
|
|
679
639
|
}
|
|
680
640
|
// After login, continue with startup (preferences unchanged, now authenticated)
|
|
681
641
|
}
|
|
@@ -777,6 +737,8 @@ program
|
|
|
777
737
|
logLevel: 'info', // CLI uses info-level logging for visibility
|
|
778
738
|
workspaceRoot,
|
|
779
739
|
});
|
|
740
|
+
// Signed in: the session gets the Dexto MCP's tools beside the person's own servers.
|
|
741
|
+
enrichedConfig.mcpServers = dextoMcp.withDextoMcpServer(enrichedConfig.mcpServers, await dextoMcp.dextoMcpServer(dextoGateway.defaultDextoGatewayOptions()));
|
|
780
742
|
// Validate enriched config + preflight credentials.
|
|
781
743
|
// - Interactive modes (web/cli): warn and continue when credentials are missing
|
|
782
744
|
// - Headless modes (server/mcp): treat missing credentials as errors
|
|
@@ -855,11 +817,13 @@ program
|
|
|
855
817
|
// isInteractiveMode is already defined above for validateAgentConfig
|
|
856
818
|
const { createFileSessionLoggerFactory } = await import('./utils/session-logger-factory.js');
|
|
857
819
|
const sessionLoggerFactory = createFileSessionLoggerFactory();
|
|
858
|
-
|
|
820
|
+
// The Dexto MCP authorizes with the sign-in in every mode; other servers' own
|
|
821
|
+
// OAuth needs the interactive CLI.
|
|
822
|
+
const mcpAuthProviderFactory = dextoMcp.withDextoMcpAuth(opts.mode === 'cli'
|
|
859
823
|
? (await import('./cli/mcp/oauth-factory.js')).createMcpAuthProviderFactory({
|
|
860
824
|
logger,
|
|
861
825
|
})
|
|
862
|
-
: null;
|
|
826
|
+
: null, dextoGateway.defaultDextoGatewayOptions());
|
|
863
827
|
const services = await resolveServicesFromConfig(validatedConfig, image, {
|
|
864
828
|
workspaceRoot,
|
|
865
829
|
});
|
|
@@ -916,4 +880,19 @@ program
|
|
|
916
880
|
});
|
|
917
881
|
}, { timeoutMs: 0 }));
|
|
918
882
|
// 14) PARSE & EXECUTE
|
|
919
|
-
|
|
883
|
+
// `dexto --help --json`: the commands and exit codes as JSON, for agents.
|
|
884
|
+
// Internal inventory entry point for the repository build check.
|
|
885
|
+
if (process.argv.slice(2).length === 1 && process.argv[2] === '--audit-agent-cli') {
|
|
886
|
+
const [{ auditProgram }, { cloudCommands }] = await Promise.all([
|
|
887
|
+
import('./cli/agent-audit.js'),
|
|
888
|
+
import('./cli/cloud/host.js'),
|
|
889
|
+
]);
|
|
890
|
+
const commands = cloudCommands('', async () => {
|
|
891
|
+
throw new Error('Audit cannot sign in');
|
|
892
|
+
});
|
|
893
|
+
process.stdout.write(`${JSON.stringify(auditProgram(program, commands), null, 2)}\n`);
|
|
894
|
+
}
|
|
895
|
+
else if (isRootJsonHelp(process.argv.slice(2)))
|
|
896
|
+
process.stdout.write(`${JSON.stringify(rootHelpJson(program), null, 2)}\n`);
|
|
897
|
+
else
|
|
898
|
+
program.parseAsync(process.argv);
|