dexto 1.14.4 → 2.0.0-beta.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/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 +143 -0
- package/dist/cli/cloud/command.d.ts.map +1 -0
- package/dist/cli/cloud/command.js +202 -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 +128 -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 +524 -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/automations.d.ts +3 -0
- package/dist/cli/cloud/commands/automations.d.ts.map +1 -0
- package/dist/cli/cloud/commands/automations.js +232 -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 +189 -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 +54 -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 +223 -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 +320 -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 +282 -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 +248 -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 +119 -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 +138 -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 +265 -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 +110 -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 +202 -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 +656 -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 +279 -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 +105 -0
- package/dist/cli/cloud/local-chats.d.ts +73 -0
- package/dist/cli/cloud/local-chats.d.ts.map +1 -0
- package/dist/cli/cloud/local-chats.js +441 -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 +76 -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 +35 -0
- package/dist/cli/cloud/v1.d.ts +19 -0
- package/dist/cli/cloud/v1.d.ts.map +1 -0
- package/dist/cli/cloud/v1.js +65 -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 +247 -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 +42 -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.js +2 -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/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/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/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/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 +33 -65
- package/package.json +8 -7
- 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
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
function formatDuration(span) {
|
|
2
|
-
return span.durationMs === null ? 'running' : `${span.durationMs}ms`;
|
|
3
|
-
}
|
|
4
|
-
function formatDurationMs(durationMs) {
|
|
5
|
-
return durationMs === null ? 'running' : `${durationMs}ms`;
|
|
6
|
-
}
|
|
7
|
-
function sortSpans(spans) {
|
|
8
|
-
return [...spans].sort((left, right) => left.startedAt.localeCompare(right.startedAt));
|
|
9
|
-
}
|
|
10
|
-
export function formatTraceSummary(runId, trace) {
|
|
11
|
-
const lines = [
|
|
12
|
-
`Run trace ${runId}`,
|
|
13
|
-
`Spans: ${trace.spans.length} Events: ${trace.events.length}`,
|
|
14
|
-
];
|
|
15
|
-
if (trace.spans.length === 0) {
|
|
16
|
-
lines.push('No spans found.');
|
|
17
|
-
return lines.join('\n');
|
|
18
|
-
}
|
|
19
|
-
lines.push('');
|
|
20
|
-
for (const span of sortSpans(trace.spans)) {
|
|
21
|
-
lines.push(`${span.startedAt} ${span.status.padEnd(9)} ${formatDuration(span).padStart(8)} ${span.name}`);
|
|
22
|
-
if (span.errorMessage) {
|
|
23
|
-
lines.push(` error: ${span.errorMessage}`);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return lines.join('\n');
|
|
27
|
-
}
|
|
28
|
-
export function formatTraceList(traces) {
|
|
29
|
-
if (traces.length === 0) {
|
|
30
|
-
return 'No run traces found.';
|
|
31
|
-
}
|
|
32
|
-
const lines = ['Recent run traces', ''];
|
|
33
|
-
for (const trace of traces) {
|
|
34
|
-
const names = trace.spanNames.slice(0, 5).join(', ');
|
|
35
|
-
lines.push(`${trace.lastSpanStartedAt} ${trace.status.padEnd(16)} spans=${String(trace.spanCount).padStart(2)} errors=${trace.errorCount} duration=${formatDurationMs(trace.durationMs).padStart(8)} ${trace.runId}`);
|
|
36
|
-
lines.push(` session: ${trace.sessionId}`);
|
|
37
|
-
if (names.length > 0) {
|
|
38
|
-
lines.push(` spans: ${names}`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return lines.join('\n');
|
|
42
|
-
}
|
|
43
|
-
export function formatSpanList(runId, spans) {
|
|
44
|
-
const lines = [`Spans for run ${runId}`, `Count: ${spans.length}`];
|
|
45
|
-
if (spans.length === 0) {
|
|
46
|
-
lines.push('No spans found.');
|
|
47
|
-
return lines.join('\n');
|
|
48
|
-
}
|
|
49
|
-
lines.push('');
|
|
50
|
-
for (const span of spans) {
|
|
51
|
-
lines.push(`${span.startedAt} ${span.status.padEnd(9)} ${formatDuration(span).padStart(8)} ${span.name}`);
|
|
52
|
-
lines.push(` span: ${span.spanId} trace: ${span.traceId}`);
|
|
53
|
-
if (span.errorMessage) {
|
|
54
|
-
lines.push(` error: ${span.errorMessage}`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return lines.join('\n');
|
|
58
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface TraceCommandOptions {
|
|
2
|
-
json?: boolean | undefined;
|
|
3
|
-
platformUrl?: string | undefined;
|
|
4
|
-
}
|
|
5
|
-
export interface TraceListCommandOptions extends TraceCommandOptions {
|
|
6
|
-
limit?: string | number | undefined;
|
|
7
|
-
period?: string | undefined;
|
|
8
|
-
session?: string | undefined;
|
|
9
|
-
status?: string | undefined;
|
|
10
|
-
}
|
|
11
|
-
export interface SpanListCommandOptions extends TraceCommandOptions {
|
|
12
|
-
limit?: string | number | undefined;
|
|
13
|
-
name?: string | undefined;
|
|
14
|
-
sort?: 'started_at' | 'duration' | undefined;
|
|
15
|
-
status?: string | undefined;
|
|
16
|
-
}
|
|
17
|
-
export declare function handleTraceCommand(runId: string, options?: TraceCommandOptions): Promise<void>;
|
|
18
|
-
export declare function handleTraceViewCommand(runId: string, options?: TraceCommandOptions): Promise<void>;
|
|
19
|
-
export declare function handleTraceListCommand(options?: TraceListCommandOptions): Promise<void>;
|
|
20
|
-
export declare function handleSpanListCommand(runId: string, options?: SpanListCommandOptions): Promise<void>;
|
|
21
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/trace/index.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,mBAAmB;IAChC,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB;IAChE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IAC/D,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,SAAS,CAAC;IAC7C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAeD,wBAAsB,kBAAkB,CACpC,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,mBAAwB,GAClC,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAsB,sBAAsB,CACxC,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,mBAAwB,GAClC,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAsB,sBAAsB,CAAC,OAAO,GAAE,uBAA4B,GAAG,OAAO,CAAC,IAAI,CAAC,CAcjG;AAED,wBAAsB,qBAAqB,CACvC,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,sBAA2B,GACrC,OAAO,CAAC,IAAI,CAAC,CAiBf"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { createTraceClient } from './client.js';
|
|
2
|
-
import { formatSpanList, formatTraceList, formatTraceSummary } from './format.js';
|
|
3
|
-
function parsePositiveInteger(value, fallback) {
|
|
4
|
-
if (value === undefined) {
|
|
5
|
-
return fallback;
|
|
6
|
-
}
|
|
7
|
-
const parsed = typeof value === 'number' ? value : Number(value);
|
|
8
|
-
if (!Number.isInteger(parsed) || parsed < 1) {
|
|
9
|
-
throw new Error(`Expected a positive integer, received ${String(value)}.`);
|
|
10
|
-
}
|
|
11
|
-
return parsed;
|
|
12
|
-
}
|
|
13
|
-
export async function handleTraceCommand(runId, options = {}) {
|
|
14
|
-
await handleTraceViewCommand(runId, options);
|
|
15
|
-
}
|
|
16
|
-
export async function handleTraceViewCommand(runId, options = {}) {
|
|
17
|
-
const trace = await createTraceClient({ platformUrl: options.platformUrl }).fetchRunTrace(runId);
|
|
18
|
-
if (options.json) {
|
|
19
|
-
console.log(JSON.stringify({ trace }, null, 2));
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
console.log(formatTraceSummary(runId, trace));
|
|
23
|
-
}
|
|
24
|
-
export async function handleTraceListCommand(options = {}) {
|
|
25
|
-
const traces = await createTraceClient({ platformUrl: options.platformUrl }).listRunTraces({
|
|
26
|
-
limit: parsePositiveInteger(options.limit, 20),
|
|
27
|
-
...(options.period === undefined ? {} : { period: options.period }),
|
|
28
|
-
...(options.session === undefined ? {} : { sessionId: options.session }),
|
|
29
|
-
...(options.status === undefined ? {} : { status: options.status }),
|
|
30
|
-
});
|
|
31
|
-
if (options.json) {
|
|
32
|
-
console.log(JSON.stringify({ traces }, null, 2));
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
console.log(formatTraceList(traces));
|
|
36
|
-
}
|
|
37
|
-
export async function handleSpanListCommand(runId, options = {}) {
|
|
38
|
-
const spans = await createTraceClient({ platformUrl: options.platformUrl }).listRunSpans(runId, {
|
|
39
|
-
limit: parsePositiveInteger(options.limit, 100),
|
|
40
|
-
...(options.name === undefined ? {} : { name: options.name }),
|
|
41
|
-
...(options.sort === undefined ? {} : { sort: options.sort }),
|
|
42
|
-
...(options.status === undefined ? {} : { status: options.status }),
|
|
43
|
-
});
|
|
44
|
-
if (options.json) {
|
|
45
|
-
console.log(JSON.stringify({ spans }, null, 2));
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
console.log(formatSpanList(runId, spans));
|
|
49
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/trace/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC,MAAM,WAAW,2BAA2B;IACxC,OAAO,EAAE,OAAO,CAAC;CACpB;AAOD,wBAAgB,oBAAoB,CAAC,EAAE,OAAO,EAAE,EAAE,2BAA2B,GAAG,IAAI,CAuEnF"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { withAnalytics, safeExit, ExitSignal } from '../../../analytics/wrapper.js';
|
|
2
|
-
export function registerTraceCommand({ program }) {
|
|
3
|
-
const trace = program
|
|
4
|
-
.command('trace [runId]')
|
|
5
|
-
.description('Discover and fetch hosted run traces from Dexto Cloud')
|
|
6
|
-
.option('--json', 'Print the raw trace response as JSON')
|
|
7
|
-
.option('--platform-url <url>', 'Use a custom Dexto platform URL')
|
|
8
|
-
.action(withAnalytics('trace', async (runId, options) => {
|
|
9
|
-
try {
|
|
10
|
-
if (!runId) {
|
|
11
|
-
trace.help();
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
const { handleTraceCommand } = await import('./index.js');
|
|
15
|
-
await handleTraceCommand(runId, options);
|
|
16
|
-
safeExit('trace', 0);
|
|
17
|
-
}
|
|
18
|
-
catch (err) {
|
|
19
|
-
if (err instanceof ExitSignal)
|
|
20
|
-
throw err;
|
|
21
|
-
console.error(`❌ dexto trace command failed: ${err}`);
|
|
22
|
-
safeExit('trace', 1, 'error');
|
|
23
|
-
}
|
|
24
|
-
}));
|
|
25
|
-
trace
|
|
26
|
-
.command('list')
|
|
27
|
-
.description('List recent hosted run traces')
|
|
28
|
-
.option('--json', 'Print the raw trace list response as JSON')
|
|
29
|
-
.option('--limit <count>', 'Maximum number of traces to return')
|
|
30
|
-
.option('--period <period>', 'Filter to a recent period such as 15m, 3h, or 7d')
|
|
31
|
-
.option('--platform-url <url>', 'Use a custom Dexto platform URL')
|
|
32
|
-
.option('--session <sessionId>', 'Filter to a session id')
|
|
33
|
-
.option('--status <status>', 'Filter to a run status')
|
|
34
|
-
.action(withAnalytics('trace:list', async (options) => {
|
|
35
|
-
try {
|
|
36
|
-
const { handleTraceListCommand } = await import('./index.js');
|
|
37
|
-
await handleTraceListCommand({
|
|
38
|
-
...trace.opts(),
|
|
39
|
-
...options,
|
|
40
|
-
});
|
|
41
|
-
safeExit('trace:list', 0);
|
|
42
|
-
}
|
|
43
|
-
catch (err) {
|
|
44
|
-
if (err instanceof ExitSignal)
|
|
45
|
-
throw err;
|
|
46
|
-
console.error(`❌ dexto trace list command failed: ${err}`);
|
|
47
|
-
safeExit('trace:list', 1, 'error');
|
|
48
|
-
}
|
|
49
|
-
}));
|
|
50
|
-
trace
|
|
51
|
-
.command('view <runId>')
|
|
52
|
-
.description('Fetch one hosted run trace')
|
|
53
|
-
.option('--json', 'Print the raw trace response as JSON')
|
|
54
|
-
.option('--platform-url <url>', 'Use a custom Dexto platform URL')
|
|
55
|
-
.action(withAnalytics('trace:view', async (runId, options) => {
|
|
56
|
-
try {
|
|
57
|
-
const { handleTraceViewCommand } = await import('./index.js');
|
|
58
|
-
await handleTraceViewCommand(runId, {
|
|
59
|
-
...trace.opts(),
|
|
60
|
-
...options,
|
|
61
|
-
});
|
|
62
|
-
safeExit('trace:view', 0);
|
|
63
|
-
}
|
|
64
|
-
catch (err) {
|
|
65
|
-
if (err instanceof ExitSignal)
|
|
66
|
-
throw err;
|
|
67
|
-
console.error(`❌ dexto trace view command failed: ${err}`);
|
|
68
|
-
safeExit('trace:view', 1, 'error');
|
|
69
|
-
}
|
|
70
|
-
}));
|
|
71
|
-
}
|