dexto 2.0.0-beta.0 → 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/cloud/command.d.ts +3 -39
- package/dist/cli/cloud/command.d.ts.map +1 -1
- package/dist/cli/cloud/command.js +12 -60
- package/dist/cli/cloud/commands/account.d.ts.map +1 -1
- package/dist/cli/cloud/commands/account.js +2 -1
- package/dist/cli/cloud/commands/agents.d.ts.map +1 -1
- package/dist/cli/cloud/commands/agents.js +3 -1
- 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.map +1 -1
- package/dist/cli/cloud/commands/automations.js +2 -1
- package/dist/cli/cloud/commands/chats.d.ts.map +1 -1
- package/dist/cli/cloud/commands/chats.js +20 -5
- package/dist/cli/cloud/commands/data-deletions.d.ts.map +1 -1
- package/dist/cli/cloud/commands/data-deletions.js +2 -1
- package/dist/cli/cloud/commands/deploys.d.ts.map +1 -1
- package/dist/cli/cloud/commands/deploys.js +3 -1
- package/dist/cli/cloud/commands/drive.d.ts.map +1 -1
- package/dist/cli/cloud/commands/drive.js +2 -1
- package/dist/cli/cloud/commands/files.d.ts.map +1 -1
- package/dist/cli/cloud/commands/files.js +3 -1
- package/dist/cli/cloud/commands/models.d.ts.map +1 -1
- package/dist/cli/cloud/commands/models.js +3 -1
- package/dist/cli/cloud/commands/profile.d.ts.map +1 -1
- package/dist/cli/cloud/commands/profile.js +2 -1
- package/dist/cli/cloud/commands/publish.d.ts.map +1 -1
- package/dist/cli/cloud/commands/publish.js +2 -1
- package/dist/cli/cloud/commands/sandboxes.d.ts.map +1 -1
- package/dist/cli/cloud/commands/sandboxes.js +2 -1
- package/dist/cli/cloud/commands/secrets.d.ts.map +1 -1
- package/dist/cli/cloud/commands/secrets.js +2 -1
- package/dist/cli/cloud/commands/skills.d.ts.map +1 -1
- package/dist/cli/cloud/commands/skills.js +2 -1
- 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/workspace-apps.d.ts.map +1 -1
- package/dist/cli/cloud/commands/workspace-apps.js +2 -1
- package/dist/cli/cloud/commands/workspace.d.ts.map +1 -1
- package/dist/cli/cloud/commands/workspace.js +3 -1
- package/dist/cli/cloud/host.d.ts.map +1 -1
- package/dist/cli/cloud/host.js +4 -0
- package/dist/cli/cloud/output.d.ts.map +1 -1
- package/dist/cli/cloud/output.js +2 -1
- package/dist/cli/cloud/run.d.ts.map +1 -1
- package/dist/cli/cloud/run.js +10 -10
- package/dist/cli/cloud/transfer.d.ts.map +1 -1
- package/dist/cli/cloud/transfer.js +2 -1
- package/dist/cli/cloud/v1.d.ts +2 -1
- package/dist/cli/cloud/v1.d.ts.map +1 -1
- package/dist/cli/cloud/v1.js +2 -1
- package/dist/cli/commands/auth/sign-in-commands.d.ts.map +1 -1
- package/dist/cli/commands/auth/sign-in-commands.js +2 -1
- package/dist/cli/commands/cloud/register.d.ts.map +1 -1
- package/dist/cli/commands/cloud/register.js +2 -0
- package/dist/cli/commands/run/headless.d.ts.map +1 -1
- package/dist/cli/commands/run/headless.js +55 -0
- 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/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.map +1 -1
- package/dist/cli/help-json.js +1 -1
- 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/output.d.ts +9 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/output.js +6 -0
- package/dist/index-main.js +12 -1
- package/package.json +10 -10
- package/dist/cli/cloud/local-chats.d.ts +0 -73
- package/dist/cli/cloud/local-chats.d.ts.map +0 -1
- package/dist/cli/cloud/local-chats.js +0 -441
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// `chat local` and `chat import`: find Claude Code and Codex chats on this machine and import them.
|
|
2
|
+
import { requireConsent } from '../../interaction.js';
|
|
2
3
|
import { z } from 'zod';
|
|
3
|
-
import { flag, MissingScopeFailure,
|
|
4
|
-
import { findLocalChats,
|
|
4
|
+
import { flag, MissingScopeFailure, stringOption, UsageError, YES_OPTION, } from '../command.js';
|
|
5
|
+
import { findLocalChats, } from '../../import/local-chats.js';
|
|
6
|
+
import { toImportInput } from '../../import/redaction.js';
|
|
7
|
+
import { LOCAL_CHAT_SOURCES, } from '../../import/transcript.js';
|
|
5
8
|
import { queryWorkspaceTool } from './workspace.js';
|
|
6
9
|
const FIND_OPTIONS = {
|
|
7
10
|
dir: {
|
|
@@ -55,13 +58,16 @@ const local = {
|
|
|
55
58
|
path: ['chat', 'local'],
|
|
56
59
|
summary: 'List Claude Code or Codex chats on this machine, newest first, to pick some for chat import.',
|
|
57
60
|
async run(context, input) {
|
|
58
|
-
const
|
|
61
|
+
const scan = await findLocalChats(context.runtime, localQuery(input));
|
|
62
|
+
noteScan(context, scan);
|
|
59
63
|
context.output.list({
|
|
60
|
-
data: chats.map((chat) => ({
|
|
64
|
+
data: scan.chats.map((chat) => ({
|
|
61
65
|
cwd: chat.cwd,
|
|
62
66
|
id: chat.id,
|
|
63
67
|
messages: chat.messages.length,
|
|
64
68
|
path: chat.path,
|
|
69
|
+
pullRequests: chat.pullRequests,
|
|
70
|
+
repository: chat.repository,
|
|
65
71
|
source: chat.source,
|
|
66
72
|
startedAt: chat.startedAt,
|
|
67
73
|
title: chat.title,
|
|
@@ -95,7 +101,9 @@ const importChats = {
|
|
|
95
101
|
const all = flag(input, 'all');
|
|
96
102
|
if (ids.length === 0 && !all)
|
|
97
103
|
throw new UsageError('Name the sessions to import, by the ids chat local lists, or pass --all.');
|
|
98
|
-
const
|
|
104
|
+
const scan = await findLocalChats(context.runtime, query);
|
|
105
|
+
noteScan(context, scan);
|
|
106
|
+
const found = scan.chats;
|
|
99
107
|
const planned = (all ? found : ids.map((id) => found.find((chat) => chat.id === id) ?? id)).map((chat) => plan(chat, query.source));
|
|
100
108
|
const sending = planned.filter((each) => each.input !== null);
|
|
101
109
|
if (flag(input, 'dry-run') || sending.length === 0) {
|
|
@@ -155,6 +163,7 @@ function plan(chat, source) {
|
|
|
155
163
|
input: prepared.input,
|
|
156
164
|
result: {
|
|
157
165
|
id: chat.id,
|
|
166
|
+
leftOut: prepared.leftOut,
|
|
158
167
|
messages: prepared.input.messages.length,
|
|
159
168
|
redactions: prepared.redactions,
|
|
160
169
|
status: 'ready',
|
|
@@ -163,6 +172,11 @@ function plan(chat, source) {
|
|
|
163
172
|
},
|
|
164
173
|
};
|
|
165
174
|
}
|
|
175
|
+
/** What the scan found that its chats don't show, such as Codex history it can't read yet. */
|
|
176
|
+
function noteScan(context, scan) {
|
|
177
|
+
for (const notice of scan.notices)
|
|
178
|
+
context.output.note(notice.message);
|
|
179
|
+
}
|
|
166
180
|
function report(context, sessions) {
|
|
167
181
|
context.output.result({ sessions }, sessions
|
|
168
182
|
.map((session) => [
|
|
@@ -182,6 +196,7 @@ function readyLine(session) {
|
|
|
182
196
|
`${session.messages ?? 0} messages`,
|
|
183
197
|
redactions === '' ? 'nothing redacted' : `redacted ${redactions}`,
|
|
184
198
|
session.truncated ? `${session.truncated} cut to size` : '',
|
|
199
|
+
session.leftOut ? `first ${session.leftOut} left out` : '',
|
|
185
200
|
]
|
|
186
201
|
.filter((part) => part !== '')
|
|
187
202
|
.join('; ');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-deletions.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/data-deletions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data-deletions.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/data-deletions.ts"],"names":[],"mappings":"AAKA,OAAO,EAQH,KAAK,OAAO,EACf,MAAM,eAAe,CAAC;AAiFvB,eAAO,MAAM,oBAAoB,EAAE,SAAS,OAAO,EAAwB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// `cloud data-deletions`: delete an end user's or an agent's data in the background.
|
|
2
|
+
import { requireConsent } from '../../interaction.js';
|
|
2
3
|
import { unwrap } from '@dexto/cloud-client';
|
|
3
|
-
import { argument, flag, PAGE_OPTIONS, pageQuery,
|
|
4
|
+
import { argument, flag, PAGE_OPTIONS, pageQuery, stringOption, UsageError, YES_OPTION, } from '../command.js';
|
|
4
5
|
const COLUMNS = [
|
|
5
6
|
{ header: 'id', value: (deletion) => deletion.id },
|
|
6
7
|
{ header: 'status', value: (deletion) => deletion.status },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploys.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/deploys.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deploys.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/deploys.ts"],"names":[],"mappings":"AAWA,OAAO,EAMH,KAAK,OAAO,EACZ,KAAK,cAAc,EAGtB,MAAM,eAAe,CAAC;AAkLvB;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACpC,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,SAAS,MAAM,EAAE,GAC1B,OAAO,CAAC,IAAI,CAAC,CAYf;AAwED,eAAO,MAAM,cAAc,EAAE,SAAS,OAAO,EAM5C,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// `cloud sites` and `cloud functions`: pack a project with its own packer, deploy, list and delete.
|
|
2
|
+
import { CommandFailure } from '../../failure.js';
|
|
3
|
+
import { requireConsent } from '../../interaction.js';
|
|
2
4
|
import { access, mkdtemp, readFile, rm } from 'node:fs/promises';
|
|
3
5
|
import { tmpdir } from 'node:os';
|
|
4
6
|
import path from 'node:path';
|
|
5
7
|
import { z } from 'zod';
|
|
6
|
-
import { argument,
|
|
8
|
+
import { argument, flag, MissingScopeFailure, stringOption, UsageError, YES_OPTION, } from '../command.js';
|
|
7
9
|
import { callV1 } from '../v1.js';
|
|
8
10
|
const PACKER = path.join('.dexto', 'pack.mjs');
|
|
9
11
|
const PROVIDERS = ['cloudflare-workers', 'aws-lambda'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/drive.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/drive.ts"],"names":[],"mappings":"AAWA,OAAO,EAIH,KAAK,OAAO,EACZ,KAAK,cAAc,EACtB,MAAM,eAAe,CAAC;AA4VvB;;;GAGG;AACH,wBAAsB,UAAU,CAC5B,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GACd,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAezD;AAwED,eAAO,MAAM,aAAa,EAAE,SAAS,OAAO,EAAU,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// `drive put`: uploads local files and folder trees to Drive, versioning same-named files.
|
|
2
|
+
import { CommandFailure } from '../../failure.js';
|
|
2
3
|
import { randomUUID } from 'node:crypto';
|
|
3
4
|
import { openAsBlob } from 'node:fs';
|
|
4
5
|
import { lstat, readdir, stat } from 'node:fs/promises';
|
|
5
6
|
import path from 'node:path';
|
|
6
7
|
import { z } from 'zod';
|
|
7
|
-
import {
|
|
8
|
+
import { isJsonObject, stringOption, UsageError, } from '../command.js';
|
|
8
9
|
import { sendBytes } from '../transfer.js';
|
|
9
10
|
import { contentTypeFor, formatBytes, hashFile } from './files.js';
|
|
10
11
|
import { queryWorkspaceTool } from './workspace.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/files.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/files.ts"],"names":[],"mappings":"AAUA,OAAO,EAA4B,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EASH,KAAK,OAAO,EACZ,KAAK,cAAc,EACtB,MAAM,eAAe,CAAC;AAIvB,KAAK,SAAS,GAAG,UAAU,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC;AAgL1D,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CA4DhG;AA2BD,qDAAqD;AACrD,wBAAsB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAIjE;AAwBD,yDAAyD;AACzD,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAUjD;AAED,eAAO,MAAM,YAAY,EAAE,SAAS,OAAO,EAA+C,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
// `cloud files`: upload, download, share and delete the project's files.
|
|
2
|
+
import { CommandFailure } from '../../failure.js';
|
|
3
|
+
import { requireConsent } from '../../interaction.js';
|
|
2
4
|
import { createHash } from 'node:crypto';
|
|
3
5
|
import { createReadStream, createWriteStream, openAsBlob } from 'node:fs';
|
|
4
6
|
import { stat } from 'node:fs/promises';
|
|
5
7
|
import path from 'node:path';
|
|
6
8
|
import { Writable } from 'node:stream';
|
|
7
9
|
import { unwrap } from '@dexto/cloud-client';
|
|
8
|
-
import { argument,
|
|
10
|
+
import { argument, flag, integerOption, PAGE_OPTIONS, pageQuery, stringOption, UsageError, YES_OPTION, } from '../command.js';
|
|
9
11
|
import { sendV1, v1Failure } from '../v1.js';
|
|
10
12
|
/** Larger files go up in parts, through an upload session. */
|
|
11
13
|
const ONE_REQUEST_MAX_BYTES = 80 * 1024 * 1024;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/models.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/models.ts"],"names":[],"mappings":"AAOA,OAAO,EAUH,KAAK,OAAO,EAGf,MAAM,eAAe,CAAC;AA4UvB,eAAO,MAAM,aAAa,EAAE,SAAS,OAAO,EAAmC,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// `cloud models`: every model call, text or media, as a model id and its input.
|
|
2
|
+
import { CommandFailure } from '../../failure.js';
|
|
3
|
+
import { requireConsent } from '../../interaction.js';
|
|
2
4
|
import { randomUUID } from 'node:crypto';
|
|
3
5
|
import { unwrap } from '@dexto/cloud-client';
|
|
4
|
-
import { argument, BODY_OPTIONS,
|
|
6
|
+
import { argument, BODY_OPTIONS, flag, isJsonObject, PAGE_OPTIONS, pageQuery, readJsonBody, stringOption, UsageError, } from '../command.js';
|
|
5
7
|
const KINDS = ['text', 'image', 'video', 'audio', 'file'];
|
|
6
8
|
const MODEL_COLUMNS = [
|
|
7
9
|
{ header: 'id', value: (model) => model.id },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/profile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/profile.ts"],"names":[],"mappings":"AAMA,OAAO,EAA4B,KAAK,OAAO,EAAuB,MAAM,eAAe,CAAC;AAqI5F,eAAO,MAAM,eAAe,EAAE,SAAS,OAAO,EAAkB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// `profile`: read and change your own Dexto profile, as Settings → Profile does.
|
|
2
|
+
import { CommandFailure } from '../../failure.js';
|
|
2
3
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
4
|
+
import { stringOption, UsageError } from '../command.js';
|
|
4
5
|
import { queryWorkspaceTool } from './workspace.js';
|
|
5
6
|
const ProfileSchema = z.object({
|
|
6
7
|
bio: z.string().nullable(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/publish.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/publish.ts"],"names":[],"mappings":"AAUA,OAAO,EAAwD,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAiKnG,eAAO,MAAM,eAAe,EAAE,SAAS,OAAO,EAAc,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// `publish`: puts a page, a document or a folder online as a link anyone with it can open.
|
|
2
|
+
import { CommandFailure } from '../../failure.js';
|
|
2
3
|
import { createHash } from 'node:crypto';
|
|
3
4
|
import { readdir, readFile, stat } from 'node:fs/promises';
|
|
4
5
|
import path from 'node:path';
|
|
5
6
|
import { z } from 'zod';
|
|
6
|
-
import { argument,
|
|
7
|
+
import { argument, stringOption, flag, UsageError, YES_OPTION } from '../command.js';
|
|
7
8
|
import { sendBytes } from '../transfer.js';
|
|
8
9
|
import { zipArchive } from '../zip.js';
|
|
9
10
|
import { requireLoginScopes } from './deploys.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandboxes.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/sandboxes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sandboxes.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/sandboxes.ts"],"names":[],"mappings":"AAQA,OAAO,EASH,KAAK,OAAO,EACf,MAAM,eAAe,CAAC;AAkUvB,eAAO,MAAM,eAAe,EAAE,SAAS,OAAO,EAc7C,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// `cloud sandboxes`: create and control project sandboxes, run commands and move files.
|
|
2
|
+
import { requireConsent } from '../../interaction.js';
|
|
2
3
|
import { randomUUID } from 'node:crypto';
|
|
3
4
|
import { readFile } from 'node:fs/promises';
|
|
4
5
|
import { unwrap } from '@dexto/cloud-client';
|
|
5
|
-
import { argument, flag, integerOption, PAGE_OPTIONS, pageQuery,
|
|
6
|
+
import { argument, flag, integerOption, PAGE_OPTIONS, pageQuery, stringOption, UsageError, YES_OPTION, } from '../command.js';
|
|
6
7
|
import { formatBytes } from './files.js';
|
|
7
8
|
/** A sandbox by id, for the calls under /v1/sandboxes/{sandbox_id}. */
|
|
8
9
|
function sandboxPath(id) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/secrets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/secrets.ts"],"names":[],"mappings":"AAKA,OAAO,EASH,KAAK,OAAO,EAGf,MAAM,eAAe,CAAC;AA8IvB,eAAO,MAAM,cAAc,EAAE,SAAS,OAAO,EAAwC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// `cloud secrets`: credentials the project's agents use without ever seeing them.
|
|
2
|
+
import { requireConsent } from '../../interaction.js';
|
|
2
3
|
import { unwrap } from '@dexto/cloud-client';
|
|
3
|
-
import { argument, flag, listOption, PAGE_OPTIONS, pageQuery, readValue,
|
|
4
|
+
import { argument, flag, listOption, PAGE_OPTIONS, pageQuery, readValue, stringOption, YES_OPTION, } from '../command.js';
|
|
4
5
|
const COLUMNS = [
|
|
5
6
|
{ header: 'id', value: (secret) => secret.id },
|
|
6
7
|
{ header: 'name', value: (secret) => secret.name },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/skills.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/skills.ts"],"names":[],"mappings":"AAUA,OAAO,EAMH,KAAK,OAAO,EAEf,MAAM,eAAe,CAAC;AA0PvB,eAAO,MAAM,aAAa,EAAE,SAAS,OAAO,EAAW,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// `skills push`: packs a local Skill folder and creates or updates it in the person's library.
|
|
2
|
+
import { CommandFailure } from '../../failure.js';
|
|
2
3
|
import { createHash } from 'node:crypto';
|
|
3
4
|
import { readdir, readFile, stat } from 'node:fs/promises';
|
|
4
5
|
import path from 'node:path';
|
|
5
6
|
import { z } from 'zod';
|
|
6
|
-
import { argument,
|
|
7
|
+
import { argument, flag, stringOption, UsageError, YES_OPTION, } from '../command.js';
|
|
7
8
|
import { tarArchive } from '../tar.js';
|
|
8
9
|
import { sendBytes } from '../transfer.js';
|
|
9
10
|
import { formatBytes } from './files.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traces.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/traces.ts"],"names":[],"mappings":"AAIA,OAAO,EAAuD,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAgLlG,eAAO,MAAM,aAAa,EAAE,SAAS,OAAO,EAAqC,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// `trace list|view` and `span list`: a person's run traces, read from /v1/traces.
|
|
2
|
+
import { unwrap } from '@dexto/cloud-client';
|
|
3
|
+
import { argument, choiceOption, integerOption, stringOption } from '../command.js';
|
|
4
|
+
/**
|
|
5
|
+
* Every value the server takes for one query option, and no other: a value added or removed on the
|
|
6
|
+
* server fails to compile here, so the CLI never refuses what the server accepts.
|
|
7
|
+
*/
|
|
8
|
+
function everyValue() {
|
|
9
|
+
return (list) => list;
|
|
10
|
+
}
|
|
11
|
+
const RUN_STATUSES = everyValue()([
|
|
12
|
+
'cancelled',
|
|
13
|
+
'completed',
|
|
14
|
+
'failed',
|
|
15
|
+
'queued',
|
|
16
|
+
'retrying',
|
|
17
|
+
'running',
|
|
18
|
+
'waiting_approval',
|
|
19
|
+
]);
|
|
20
|
+
const SPAN_STATUSES = everyValue()(['completed', 'failed']);
|
|
21
|
+
const SPAN_SORTS = everyValue()(['started_at', 'duration']);
|
|
22
|
+
const TRACE_COLUMNS = [
|
|
23
|
+
{ header: 'run', value: (trace) => trace.run_id },
|
|
24
|
+
{ header: 'status', value: (trace) => trace.status },
|
|
25
|
+
{ header: 'spans', value: (trace) => trace.span_count },
|
|
26
|
+
{ header: 'errors', value: (trace) => trace.error_count },
|
|
27
|
+
{ header: 'duration', value: (trace) => milliseconds(trace.duration_ms) },
|
|
28
|
+
{ header: 'last span', value: (trace) => trace.last_span_started_at },
|
|
29
|
+
{ header: 'session', value: (trace) => trace.session_id },
|
|
30
|
+
{ header: 'span names', value: (trace) => trace.span_names.join(', ') },
|
|
31
|
+
];
|
|
32
|
+
const SPAN_COLUMNS = [
|
|
33
|
+
{ header: 'started', value: (span) => span.started_at },
|
|
34
|
+
{ header: 'status', value: (span) => span.status },
|
|
35
|
+
{ header: 'duration', value: (span) => milliseconds(span.duration_ms) },
|
|
36
|
+
{ header: 'name', value: (span) => span.name },
|
|
37
|
+
{ header: 'span', value: (span) => span.span_id },
|
|
38
|
+
{ header: 'error', value: (span) => span.error_message },
|
|
39
|
+
];
|
|
40
|
+
const traceList = {
|
|
41
|
+
options: {
|
|
42
|
+
limit: { description: 'How many to return (at most 100).', type: 'string', valueName: 'N' },
|
|
43
|
+
period: {
|
|
44
|
+
description: 'Only runs with a span in this recent period, such as 15m, 3h or 7d.',
|
|
45
|
+
type: 'string',
|
|
46
|
+
},
|
|
47
|
+
session: { description: 'Only runs of this chat.', type: 'string', valueName: 'ID' },
|
|
48
|
+
status: {
|
|
49
|
+
description: `Only runs in this status: ${RUN_STATUSES.join(', ')}.`,
|
|
50
|
+
type: 'string',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
path: ['trace', 'list'],
|
|
54
|
+
summary: 'List your recent run traces, newest first. Spans are kept 30 days.',
|
|
55
|
+
async run(context, input) {
|
|
56
|
+
const limit = integerOption(input, 'limit');
|
|
57
|
+
const period = stringOption(input, 'period');
|
|
58
|
+
const session = stringOption(input, 'session');
|
|
59
|
+
const status = choiceOption(input, 'status', RUN_STATUSES);
|
|
60
|
+
const page = await unwrap(await (await context.client()).GET('/v1/traces', {
|
|
61
|
+
params: {
|
|
62
|
+
query: {
|
|
63
|
+
...(limit === undefined ? {} : { limit }),
|
|
64
|
+
...(period === undefined ? {} : { period }),
|
|
65
|
+
...(session === undefined ? {} : { session_id: session }),
|
|
66
|
+
...(status === undefined ? {} : { status }),
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
}));
|
|
70
|
+
context.output.list(page, TRACE_COLUMNS);
|
|
71
|
+
if (page.has_more && !context.output.json)
|
|
72
|
+
context.output.note('More traces match: narrow --period or raise --limit (at most 100).');
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
const traceView = {
|
|
76
|
+
arguments: '<run_id>',
|
|
77
|
+
path: ['trace', 'view'],
|
|
78
|
+
summary: "Show one run's trace: its spans in start order, with any errors.",
|
|
79
|
+
async run(context, input) {
|
|
80
|
+
const runId = argument(input, 0, 'run_id');
|
|
81
|
+
const trace = await unwrap(await (await context.client()).GET('/v1/traces/{run_id}', { params: { path: { run_id: runId } } }));
|
|
82
|
+
context.output.result(trace, formatTrace(trace));
|
|
83
|
+
if (trace.has_more && !context.output.json)
|
|
84
|
+
context.output.note(`This trace stops at ${trace.spans.length} spans. See the rest with dexto span list ${runId} --name or --status.`);
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
const spanList = {
|
|
88
|
+
arguments: '<run_id>',
|
|
89
|
+
options: {
|
|
90
|
+
limit: { description: 'How many to return (at most 500).', type: 'string', valueName: 'N' },
|
|
91
|
+
name: { description: 'Only spans with exactly this name.', type: 'string' },
|
|
92
|
+
sort: {
|
|
93
|
+
description: 'started_at (default), or duration for the longest first.',
|
|
94
|
+
type: 'string',
|
|
95
|
+
},
|
|
96
|
+
status: { description: 'Only spans that completed or failed.', type: 'string' },
|
|
97
|
+
},
|
|
98
|
+
path: ['span', 'list'],
|
|
99
|
+
summary: "List one run's spans.",
|
|
100
|
+
async run(context, input) {
|
|
101
|
+
const runId = argument(input, 0, 'run_id');
|
|
102
|
+
const limit = integerOption(input, 'limit');
|
|
103
|
+
const name = stringOption(input, 'name');
|
|
104
|
+
const sort = choiceOption(input, 'sort', SPAN_SORTS);
|
|
105
|
+
const status = choiceOption(input, 'status', SPAN_STATUSES);
|
|
106
|
+
const page = await unwrap(await (await context.client()).GET('/v1/traces/{run_id}/spans', {
|
|
107
|
+
params: {
|
|
108
|
+
path: { run_id: runId },
|
|
109
|
+
query: {
|
|
110
|
+
...(limit === undefined ? {} : { limit }),
|
|
111
|
+
...(name === undefined ? {} : { name }),
|
|
112
|
+
...(sort === undefined ? {} : { sort }),
|
|
113
|
+
...(status === undefined ? {} : { status }),
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
}));
|
|
117
|
+
context.output.list(page, SPAN_COLUMNS);
|
|
118
|
+
if (page.has_more && !context.output.json)
|
|
119
|
+
context.output.note('More spans match: filter with --name or raise --limit (at most 500).');
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
function milliseconds(value) {
|
|
123
|
+
return `${Math.round(value)}ms`;
|
|
124
|
+
}
|
|
125
|
+
/** 1.x's `dexto trace` view: one line per span, with its error under it. */
|
|
126
|
+
function formatTrace(trace) {
|
|
127
|
+
const lines = [
|
|
128
|
+
`Run trace ${trace.run_id}`,
|
|
129
|
+
`Spans: ${trace.spans.length} Events: ${trace.events.length}`,
|
|
130
|
+
];
|
|
131
|
+
if (trace.spans.length === 0)
|
|
132
|
+
return [...lines, 'No spans found.'].join('\n');
|
|
133
|
+
lines.push('');
|
|
134
|
+
// The API returns spans by start time.
|
|
135
|
+
for (const span of trace.spans) {
|
|
136
|
+
lines.push(`${span.started_at} ${span.status.padEnd(9)} ${milliseconds(span.duration_ms).padStart(8)} ${span.name}`);
|
|
137
|
+
if (span.error_message !== null)
|
|
138
|
+
lines.push(` error: ${span.error_message}`);
|
|
139
|
+
}
|
|
140
|
+
return lines.join('\n');
|
|
141
|
+
}
|
|
142
|
+
export const traceCommands = [traceList, traceView, spanList];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-apps.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/workspace-apps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workspace-apps.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/workspace-apps.ts"],"names":[],"mappings":"AAOA,OAAO,EAAiD,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAGnG,OAAO,EAMH,KAAK,aAAa,EACrB,MAAM,gBAAgB,CAAC;AAExB,sGAAsG;AACtG,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,IAAI,EACP;QAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;QAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GACtD;QACI,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QAC/B,sFAAsF;QACtF,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QACxD,QAAQ,CAAC,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M,CAAC,CA4CjB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// `workspace <app> <operation>`: the workspace's operations grouped by the app that provides them.
|
|
2
|
+
import { shellWord } from '../../interaction.js';
|
|
2
3
|
import { randomUUID } from 'node:crypto';
|
|
3
4
|
import { readFile } from 'node:fs/promises';
|
|
4
|
-
import { isJsonObject, MissingScopeFailure,
|
|
5
|
+
import { isJsonObject, MissingScopeFailure, UsageError } from '../command.js';
|
|
5
6
|
import { readAppScopes } from '../app-scopes.js';
|
|
6
7
|
import { attachFiles, fileFieldOf, isLocalFile } from './app-files.js';
|
|
7
8
|
import { agreeToCall, ASKING_LEVELS, callWorkspaceTool, listWorkspaceTools, readWorkspaceTool, } from './workspace.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/workspace.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloud/commands/workspace.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAWH,KAAK,OAAO,EACZ,KAAK,cAAc,EACtB,MAAM,eAAe,CAAC;AAEvB,QAAA,MAAM,UAAU;;;;;;iBAOd,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;AAIxD,iEAAiE;AACjE,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,MAAM,CAAwC,CAAC;AAEvF,wFAAwF;AACxF,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAOzF;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAC7B,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAClF,GAAG,EAAE,OAAO,GACb,OAAO,CAAC;IAAE,OAAO,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC,CAQ7B;AAgBD,8EAA8E;AAC9E,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAE1F;AAoFD,0FAA0F;AAC1F,wBAAsB,iBAAiB,CACnC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACf,OAAO,CAAC,MAAM,CAAC,CAiBjB;AAyCD,6FAA6F;AAC7F,wBAAsB,kBAAkB,CACpC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACf,OAAO,CAAC,OAAO,CAAC,CAMlB;AAED,6EAA6E;AAC7E,wBAAsB,iBAAiB,CACnC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACf,OAAO,CAAC,OAAO,CAAC,CAalB;AAoHD,eAAO,MAAM,iBAAiB,EAAE,SAAS,OAAO,EAA4B,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// `workspace`: the tools an agent uses in your Dexto workspace over MCP, called as you.
|
|
2
|
+
import { CommandFailure } from '../../failure.js';
|
|
3
|
+
import { requireConsent, rerunWith } from '../../interaction.js';
|
|
2
4
|
import { z } from 'zod';
|
|
3
|
-
import { argument, BODY_OPTIONS,
|
|
5
|
+
import { argument, BODY_OPTIONS, flag, isJsonObject, MissingScopeFailure, readJsonBody, signInCommand, stringOption, UsageError, YES_OPTION, } from '../command.js';
|
|
4
6
|
const ToolSchema = z.object({
|
|
5
7
|
/** `dexto/app`, `dexto/app_kind` and `dexto/level` say which app provides the tool and how it asks. */
|
|
6
8
|
_meta: z.record(z.string(), z.unknown()).optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../src/cli/cloud/host.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../src/cli/cloud/host.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAsBxE,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAIjD,oDAAoD;AACpD,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC,CAgBnE,CAAC;AAEF,qEAAqE;AACrE,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,SAAS,OAAO,EAAE,CAyBhF;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAyC5D"}
|
package/dist/cli/cloud/host.js
CHANGED
|
@@ -4,6 +4,7 @@ import { getDextoGlobalPath } from '@dexto/core';
|
|
|
4
4
|
import { accountCommands } from './commands/account.js';
|
|
5
5
|
import { agentCommands } from './commands/agents.js';
|
|
6
6
|
import { apiCommands } from './commands/api.js';
|
|
7
|
+
import { artifactCommands } from './commands/artifacts.js';
|
|
7
8
|
import { chatCommands } from './commands/chats.js';
|
|
8
9
|
import { automationCommands } from './commands/automations.js';
|
|
9
10
|
import { dataDeletionCommands } from './commands/data-deletions.js';
|
|
@@ -13,6 +14,7 @@ import { findCommands } from './commands/find.js';
|
|
|
13
14
|
import { profileCommands } from './commands/profile.js';
|
|
14
15
|
import { publishCommands } from './commands/publish.js';
|
|
15
16
|
import { skillCommands } from './commands/skills.js';
|
|
17
|
+
import { traceCommands } from './commands/traces.js';
|
|
16
18
|
import { fileCommands } from './commands/files.js';
|
|
17
19
|
import { modelCommands } from './commands/models.js';
|
|
18
20
|
import { projectCommands, projectsUse } from './commands/projects.js';
|
|
@@ -59,10 +61,12 @@ export function cloudCommands(dir, signIn) {
|
|
|
59
61
|
...apiCommands,
|
|
60
62
|
...workspaceCommands,
|
|
61
63
|
...driveCommands,
|
|
64
|
+
...artifactCommands,
|
|
62
65
|
...findCommands,
|
|
63
66
|
...profileCommands,
|
|
64
67
|
...publishCommands,
|
|
65
68
|
...skillCommands,
|
|
69
|
+
...traceCommands,
|
|
66
70
|
...chatCommands,
|
|
67
71
|
];
|
|
68
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/cli/cloud/output.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/cli/cloud/output.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,WAAW,MAAM,CAAC,GAAG;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;CAC9E;AAED,MAAM,WAAW,MAAM;IACnB,+CAA+C;IAC/C,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,mFAAmF;IACnF,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,SAAS,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC;IACtE,8CAA8C;IAC9C,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7B,+DAA+D;IAC/D,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3C,+DAA+D;IAC/D,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,wEAAwE;AACxE,MAAM,MAAM,QAAQ,CAAC,GAAG,IAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,EAAE,CAAA;CAAE,GACjC;IACI,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,EAAE,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CAC/C,CAAC;AAER,0FAA0F;AAC1F,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAErD,wBAAgB,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAiChF"}
|
package/dist/cli/cloud/output.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// Prints API values: JSON for agents (--json, or stdout not a terminal), tables for people.
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
+
import { jsonResult } from '../output.js';
|
|
3
4
|
export function createOutput(runtime, format) {
|
|
4
5
|
const json = format === 'json' || (format === 'auto' && !runtime.stdoutIsTerminal);
|
|
5
6
|
const color = runtime.color;
|
|
6
7
|
const printJson = (value) => {
|
|
7
|
-
runtime.writeOutput(
|
|
8
|
+
runtime.writeOutput(jsonResult(value));
|
|
8
9
|
};
|
|
9
10
|
return {
|
|
10
11
|
json,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/cli/cloud/run.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AI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAExF"}
|
package/dist/cli/cloud/run.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// Runs `dexto cloud …` and the other ported cloud commands: global options, help, the agent
|
|
2
2
|
// contract's JSON output and exit codes, and signing in again for a permission a command lacked.
|
|
3
|
+
import { CommandFailure, EXIT_CODE_MEANINGS, EXIT_CODES } from '../failure.js';
|
|
3
4
|
import { parseArgs } from 'node:util';
|
|
5
|
+
import { jsonError } from '../output.js';
|
|
4
6
|
import { CloudApiError, createCloudClient } from '@dexto/cloud-client';
|
|
5
|
-
import {
|
|
7
|
+
import { MissingScopeFailure, signInCommand, UsageError, } from './command.js';
|
|
6
8
|
import { listWorkspaceApps, runWorkspaceApp, } from './commands/workspace-apps.js';
|
|
7
9
|
import { createOutput } from './output.js';
|
|
8
10
|
export const GLOBAL_OPTIONS = {
|
|
@@ -213,15 +215,13 @@ function reportError(context, json, help, error) {
|
|
|
213
215
|
const { runtime } = context;
|
|
214
216
|
const failure = describeFailure(context, error);
|
|
215
217
|
if (json) {
|
|
216
|
-
runtime.writeError(
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
},
|
|
224
|
-
}, null, 2)}\n`);
|
|
218
|
+
runtime.writeError(jsonError({
|
|
219
|
+
code: failure.code,
|
|
220
|
+
message: failure.message,
|
|
221
|
+
...(failure.fix === null ? {} : { fix: failure.fix }),
|
|
222
|
+
...(failure.apiCode === null ? {} : { api_code: failure.apiCode }),
|
|
223
|
+
...(failure.details === null ? {} : { details: failure.details }),
|
|
224
|
+
}));
|
|
225
225
|
}
|
|
226
226
|
else if (failure.code === 'usage') {
|
|
227
227
|
runtime.writeError(`${failure.message}\n\n${help}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["../../../src/cli/cloud/transfer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["../../../src/cli/cloud/transfer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAEjE,oFAAoF;AACpF,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAsB,SAAS,CAC3B,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,UAAU,CAAC,IAAI,GACtB,OAAO,CAAC,OAAO,CAAC,CAelB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Sends local bytes to a URL the server handed out for them, outside MCP JSON.
|
|
2
|
-
import { CommandFailure
|
|
2
|
+
import { CommandFailure } from '../failure.js';
|
|
3
|
+
import { isJsonObject } from './command.js';
|
|
3
4
|
/**
|
|
4
5
|
* Streams `body` to the target with its length, and returns the JSON reply (null when there is
|
|
5
6
|
* none). A refusal fails with the server's own message.
|
package/dist/cli/cloud/v1.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { CommandFailure
|
|
1
|
+
import { CommandFailure } from '../failure.js';
|
|
2
|
+
import { type CommandContext, type SignInContext } from './command.js';
|
|
2
3
|
/**
|
|
3
4
|
* Sends one request to a `/v1` path with the sign-in's credential and Cloud project. The path is
|
|
4
5
|
* resolved against the API and checked, so no path can send the credential elsewhere.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1.d.ts","sourceRoot":"","sources":["../../../src/cli/cloud/v1.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"v1.d.ts","sourceRoot":"","sources":["../../../src/cli/cloud/v1.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAIH,KAAK,cAAc,EACnB,KAAK,aAAa,EACrB,MAAM,cAAc,CAAC;AAEtB;;;GAGG;AACH,wBAAsB,OAAO,CACzB,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,GAAG,IAAI,GACpB,OAAO,CAAC,QAAQ,CAAC,CAOnB;AAED;;;GAGG;AACH,wBAAsB,MAAM,CACxB,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE;IACL,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACtD,GAAG,IAAI,EACR,MAAM,GAAE,WAAoC,GAC7C,OAAO,CAAC,QAAQ,CAAC,CAsBnB;AAED,sGAAsG;AACtG,wBAAsB,MAAM,CACxB,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,GAAG,IAAI,GACpB,OAAO,CAAC,OAAO,CAAC,CAKlB;AAED,sFAAsF;AACtF,wBAAgB,SAAS,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CA0B9F"}
|
package/dist/cli/cloud/v1.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Calls the public /v1 API as the sign-in, for `cloud api` and what the typed client does not cover.
|
|
2
|
-
import { CommandFailure
|
|
2
|
+
import { CommandFailure } from '../failure.js';
|
|
3
|
+
import { isJsonObject, signInCommand, UsageError, } from './command.js';
|
|
3
4
|
/**
|
|
4
5
|
* Sends one request to a `/v1` path with the sign-in's credential and Cloud project. The path is
|
|
5
6
|
* resolved against the API and checked, so no path can send the credential elsewhere.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sign-in-commands.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/auth/sign-in-commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sign-in-commands.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/auth/sign-in-commands.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3F,KAAK,UAAU,GAAG,aAAa,CAAC,UAAU,CAAC;AAG3C,KAAK,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;AAC5C,KAAK,kBAAkB,GAAG,WAAW,CAAC,kBAAkB,CAAC;AACzD,KAAK,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC;AAC3C,KAAK,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC;AAgB3C,uFAAuF;AACvF,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,iBAAiB,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/E,QAAQ,CAAC,gBAAgB,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACvE,QAAQ,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;IAChE,QAAQ,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACnE,yDAAyD;IACzD,QAAQ,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC,CAAC;IAC/E,4DAA4D;IAC5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