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.
Files changed (253) hide show
  1. package/dist/cli/auth/billing.d.ts +0 -6
  2. package/dist/cli/auth/billing.d.ts.map +1 -1
  3. package/dist/cli/auth/billing.js +0 -23
  4. package/dist/cli/auth/constants.d.ts +3 -31
  5. package/dist/cli/auth/constants.d.ts.map +1 -1
  6. package/dist/cli/auth/constants.js +9 -33
  7. package/dist/cli/auth/index.d.ts +2 -9
  8. package/dist/cli/auth/index.d.ts.map +1 -1
  9. package/dist/cli/auth/index.js +2 -7
  10. package/dist/cli/auth/sign-in-runtime.d.ts +12 -0
  11. package/dist/cli/auth/sign-in-runtime.d.ts.map +1 -0
  12. package/dist/cli/auth/sign-in-runtime.js +59 -0
  13. package/dist/cli/cloud/app-scopes.d.ts +4 -0
  14. package/dist/cli/cloud/app-scopes.d.ts.map +1 -0
  15. package/dist/cli/cloud/app-scopes.js +19 -0
  16. package/dist/cli/cloud/command.d.ts +143 -0
  17. package/dist/cli/cloud/command.d.ts.map +1 -0
  18. package/dist/cli/cloud/command.js +202 -0
  19. package/dist/cli/cloud/commands/account.d.ts +11 -0
  20. package/dist/cli/cloud/commands/account.d.ts.map +1 -0
  21. package/dist/cli/cloud/commands/account.js +128 -0
  22. package/dist/cli/cloud/commands/agents.d.ts +3 -0
  23. package/dist/cli/cloud/commands/agents.d.ts.map +1 -0
  24. package/dist/cli/cloud/commands/agents.js +524 -0
  25. package/dist/cli/cloud/commands/api.d.ts +3 -0
  26. package/dist/cli/cloud/commands/api.d.ts.map +1 -0
  27. package/dist/cli/cloud/commands/api.js +26 -0
  28. package/dist/cli/cloud/commands/app-files.d.ts +29 -0
  29. package/dist/cli/cloud/commands/app-files.d.ts.map +1 -0
  30. package/dist/cli/cloud/commands/app-files.js +72 -0
  31. package/dist/cli/cloud/commands/automations.d.ts +3 -0
  32. package/dist/cli/cloud/commands/automations.d.ts.map +1 -0
  33. package/dist/cli/cloud/commands/automations.js +232 -0
  34. package/dist/cli/cloud/commands/chats.d.ts +3 -0
  35. package/dist/cli/cloud/commands/chats.d.ts.map +1 -0
  36. package/dist/cli/cloud/commands/chats.js +189 -0
  37. package/dist/cli/cloud/commands/data-deletions.d.ts +3 -0
  38. package/dist/cli/cloud/commands/data-deletions.d.ts.map +1 -0
  39. package/dist/cli/cloud/commands/data-deletions.js +54 -0
  40. package/dist/cli/cloud/commands/deploys.d.ts +10 -0
  41. package/dist/cli/cloud/commands/deploys.d.ts.map +1 -0
  42. package/dist/cli/cloud/commands/deploys.js +223 -0
  43. package/dist/cli/cloud/commands/drive.d.ts +12 -0
  44. package/dist/cli/cloud/commands/drive.d.ts.map +1 -0
  45. package/dist/cli/cloud/commands/drive.js +320 -0
  46. package/dist/cli/cloud/commands/files.d.ts +24 -0
  47. package/dist/cli/cloud/commands/files.d.ts.map +1 -0
  48. package/dist/cli/cloud/commands/files.js +282 -0
  49. package/dist/cli/cloud/commands/find.d.ts +3 -0
  50. package/dist/cli/cloud/commands/find.d.ts.map +1 -0
  51. package/dist/cli/cloud/commands/find.js +63 -0
  52. package/dist/cli/cloud/commands/models.d.ts +3 -0
  53. package/dist/cli/cloud/commands/models.d.ts.map +1 -0
  54. package/dist/cli/cloud/commands/models.js +248 -0
  55. package/dist/cli/cloud/commands/profile.d.ts +3 -0
  56. package/dist/cli/cloud/commands/profile.d.ts.map +1 -0
  57. package/dist/cli/cloud/commands/profile.js +119 -0
  58. package/dist/cli/cloud/commands/projects.d.ts +5 -0
  59. package/dist/cli/cloud/commands/projects.d.ts.map +1 -0
  60. package/dist/cli/cloud/commands/projects.js +66 -0
  61. package/dist/cli/cloud/commands/publish.d.ts +3 -0
  62. package/dist/cli/cloud/commands/publish.d.ts.map +1 -0
  63. package/dist/cli/cloud/commands/publish.js +138 -0
  64. package/dist/cli/cloud/commands/sandboxes.d.ts +3 -0
  65. package/dist/cli/cloud/commands/sandboxes.d.ts.map +1 -0
  66. package/dist/cli/cloud/commands/sandboxes.js +265 -0
  67. package/dist/cli/cloud/commands/secrets.d.ts +3 -0
  68. package/dist/cli/cloud/commands/secrets.d.ts.map +1 -0
  69. package/dist/cli/cloud/commands/secrets.js +110 -0
  70. package/dist/cli/cloud/commands/skills.d.ts +3 -0
  71. package/dist/cli/cloud/commands/skills.d.ts.map +1 -0
  72. package/dist/cli/cloud/commands/skills.js +202 -0
  73. package/dist/cli/cloud/commands/web.d.ts +3 -0
  74. package/dist/cli/cloud/commands/web.d.ts.map +1 -0
  75. package/dist/cli/cloud/commands/web.js +53 -0
  76. package/dist/cli/cloud/commands/workspace-apps.d.ts +58 -0
  77. package/dist/cli/cloud/commands/workspace-apps.d.ts.map +1 -0
  78. package/dist/cli/cloud/commands/workspace-apps.js +656 -0
  79. package/dist/cli/cloud/commands/workspace.d.ts +36 -0
  80. package/dist/cli/cloud/commands/workspace.d.ts.map +1 -0
  81. package/dist/cli/cloud/commands/workspace.js +279 -0
  82. package/dist/cli/cloud/connection.d.ts +33 -0
  83. package/dist/cli/cloud/connection.d.ts.map +1 -0
  84. package/dist/cli/cloud/connection.js +38 -0
  85. package/dist/cli/cloud/events.d.ts +63 -0
  86. package/dist/cli/cloud/events.d.ts.map +1 -0
  87. package/dist/cli/cloud/events.js +72 -0
  88. package/dist/cli/cloud/host.d.ts +9 -0
  89. package/dist/cli/cloud/host.d.ts.map +1 -0
  90. package/dist/cli/cloud/host.js +105 -0
  91. package/dist/cli/cloud/local-chats.d.ts +73 -0
  92. package/dist/cli/cloud/local-chats.d.ts.map +1 -0
  93. package/dist/cli/cloud/local-chats.js +441 -0
  94. package/dist/cli/cloud/output.d.ts +34 -0
  95. package/dist/cli/cloud/output.d.ts.map +1 -0
  96. package/dist/cli/cloud/output.js +76 -0
  97. package/dist/cli/cloud/run.d.ts +26 -0
  98. package/dist/cli/cloud/run.d.ts.map +1 -0
  99. package/dist/cli/cloud/run.js +444 -0
  100. package/dist/cli/cloud/runtime.d.ts +33 -0
  101. package/dist/cli/cloud/runtime.d.ts.map +1 -0
  102. package/dist/cli/cloud/runtime.js +86 -0
  103. package/dist/cli/cloud/tar.d.ts +9 -0
  104. package/dist/cli/cloud/tar.d.ts.map +1 -0
  105. package/dist/cli/cloud/tar.js +69 -0
  106. package/dist/cli/cloud/transfer.d.ts +13 -0
  107. package/dist/cli/cloud/transfer.d.ts.map +1 -0
  108. package/dist/cli/cloud/transfer.js +35 -0
  109. package/dist/cli/cloud/v1.d.ts +19 -0
  110. package/dist/cli/cloud/v1.d.ts.map +1 -0
  111. package/dist/cli/cloud/v1.js +65 -0
  112. package/dist/cli/cloud/zip.d.ts +8 -0
  113. package/dist/cli/cloud/zip.d.ts.map +1 -0
  114. package/dist/cli/cloud/zip.js +66 -0
  115. package/dist/cli/commands/auth/sign-in-commands.d.ts +62 -0
  116. package/dist/cli/commands/auth/sign-in-commands.d.ts.map +1 -0
  117. package/dist/cli/commands/auth/sign-in-commands.js +247 -0
  118. package/dist/cli/commands/auth/sign-in-context.d.ts +16 -0
  119. package/dist/cli/commands/auth/sign-in-context.d.ts.map +1 -0
  120. package/dist/cli/commands/auth/sign-in-context.js +68 -0
  121. package/dist/cli/commands/cloud/register.d.ts +5 -0
  122. package/dist/cli/commands/cloud/register.d.ts.map +1 -1
  123. package/dist/cli/commands/cloud/register.js +42 -24
  124. package/dist/cli/commands/create-app.js +5 -6
  125. package/dist/cli/commands/create-image.d.ts.map +1 -1
  126. package/dist/cli/commands/create-image.js +9 -10
  127. package/dist/cli/commands/index.d.ts +0 -2
  128. package/dist/cli/commands/index.d.ts.map +1 -1
  129. package/dist/cli/commands/index.js +0 -2
  130. package/dist/cli/commands/init.d.ts +0 -2
  131. package/dist/cli/commands/init.d.ts.map +1 -1
  132. package/dist/cli/commands/init.js +5 -26
  133. package/dist/cli/commands/run/headless.js +2 -2
  134. package/dist/cli/commands/run/output.d.ts +29 -10
  135. package/dist/cli/commands/run/output.d.ts.map +1 -1
  136. package/dist/cli/commands/run/output.js +44 -22
  137. package/dist/cli/commands/run/register.d.ts.map +1 -1
  138. package/dist/cli/commands/run/register.js +21 -9
  139. package/dist/cli/commands/session/register.d.ts.map +1 -1
  140. package/dist/cli/commands/session/register.js +51 -21
  141. package/dist/cli/commands/session-commands.js +1 -1
  142. package/dist/cli/commands/setup.js +17 -14
  143. package/dist/cli/help-json.d.ts +22 -0
  144. package/dist/cli/help-json.d.ts.map +1 -0
  145. package/dist/cli/help-json.js +20 -0
  146. package/dist/cli/modes/cli.d.ts.map +1 -1
  147. package/dist/cli/modes/cli.js +42 -9
  148. package/dist/cli/modes/server.js +8 -8
  149. package/dist/cli/modes/web.js +3 -3
  150. package/dist/cli/utils/dexto-auth-check.d.ts +1 -1
  151. package/dist/cli/utils/dexto-auth-check.d.ts.map +1 -1
  152. package/dist/cli/utils/dexto-auth-check.js +4 -5
  153. package/dist/cli/utils/dexto-setup.d.ts +4 -5
  154. package/dist/cli/utils/dexto-setup.d.ts.map +1 -1
  155. package/dist/cli/utils/dexto-setup.js +17 -14
  156. package/dist/cli/utils/provider-setup.js +1 -1
  157. package/dist/cli/utils/scaffolding-utils.d.ts +9 -3
  158. package/dist/cli/utils/scaffolding-utils.d.ts.map +1 -1
  159. package/dist/cli/utils/scaffolding-utils.js +48 -40
  160. package/dist/cli/utils/version-check.d.ts.map +1 -1
  161. package/dist/cli/utils/version-check.js +2 -1
  162. package/dist/index-main.js +33 -65
  163. package/package.json +8 -7
  164. package/dist/cli/auth/api-client.d.ts +0 -125
  165. package/dist/cli/auth/api-client.d.ts.map +0 -1
  166. package/dist/cli/auth/api-client.js +0 -585
  167. package/dist/cli/auth/device.d.ts +0 -14
  168. package/dist/cli/auth/device.d.ts.map +0 -1
  169. package/dist/cli/auth/device.js +0 -84
  170. package/dist/cli/auth/dexto-api-key.d.ts +0 -34
  171. package/dist/cli/auth/dexto-api-key.d.ts.map +0 -1
  172. package/dist/cli/auth/dexto-api-key.js +0 -160
  173. package/dist/cli/auth/login-persistence.d.ts +0 -15
  174. package/dist/cli/auth/login-persistence.d.ts.map +0 -1
  175. package/dist/cli/auth/login-persistence.js +0 -72
  176. package/dist/cli/auth/oauth.d.ts +0 -39
  177. package/dist/cli/auth/oauth.d.ts.map +0 -1
  178. package/dist/cli/auth/oauth.js +0 -434
  179. package/dist/cli/auth/service.d.ts +0 -24
  180. package/dist/cli/auth/service.d.ts.map +0 -1
  181. package/dist/cli/auth/service.js +0 -161
  182. package/dist/cli/auth/types.d.ts +0 -11
  183. package/dist/cli/auth/types.d.ts.map +0 -1
  184. package/dist/cli/auth/types.js +0 -1
  185. package/dist/cli/cloud-chat.d.ts +0 -18
  186. package/dist/cli/cloud-chat.d.ts.map +0 -1
  187. package/dist/cli/cloud-chat.js +0 -734
  188. package/dist/cli/commands/auth/index.d.ts +0 -4
  189. package/dist/cli/commands/auth/index.d.ts.map +0 -1
  190. package/dist/cli/commands/auth/index.js +0 -4
  191. package/dist/cli/commands/auth/login.d.ts +0 -12
  192. package/dist/cli/commands/auth/login.d.ts.map +0 -1
  193. package/dist/cli/commands/auth/login.js +0 -153
  194. package/dist/cli/commands/auth/logout.d.ts +0 -5
  195. package/dist/cli/commands/auth/logout.d.ts.map +0 -1
  196. package/dist/cli/commands/auth/logout.js +0 -81
  197. package/dist/cli/commands/auth/register.d.ts +0 -3
  198. package/dist/cli/commands/auth/register.d.ts.map +0 -1
  199. package/dist/cli/commands/auth/register.js +0 -96
  200. package/dist/cli/commands/auth/status.d.ts +0 -2
  201. package/dist/cli/commands/auth/status.d.ts.map +0 -1
  202. package/dist/cli/commands/auth/status.js +0 -22
  203. package/dist/cli/commands/billing/index.d.ts +0 -2
  204. package/dist/cli/commands/billing/index.d.ts.map +0 -1
  205. package/dist/cli/commands/billing/index.js +0 -2
  206. package/dist/cli/commands/billing/register.d.ts +0 -3
  207. package/dist/cli/commands/billing/register.d.ts.map +0 -1
  208. package/dist/cli/commands/billing/register.js +0 -20
  209. package/dist/cli/commands/billing/status.d.ts +0 -8
  210. package/dist/cli/commands/billing/status.d.ts.map +0 -1
  211. package/dist/cli/commands/billing/status.js +0 -71
  212. package/dist/cli/commands/cloud/discovery.d.ts +0 -17
  213. package/dist/cli/commands/cloud/discovery.d.ts.map +0 -1
  214. package/dist/cli/commands/cloud/discovery.js +0 -88
  215. package/dist/cli/commands/deploy/client.d.ts +0 -113
  216. package/dist/cli/commands/deploy/client.d.ts.map +0 -1
  217. package/dist/cli/commands/deploy/client.js +0 -519
  218. package/dist/cli/commands/deploy/config.d.ts +0 -37
  219. package/dist/cli/commands/deploy/config.d.ts.map +0 -1
  220. package/dist/cli/commands/deploy/config.js +0 -144
  221. package/dist/cli/commands/deploy/entry-agent.d.ts +0 -3
  222. package/dist/cli/commands/deploy/entry-agent.d.ts.map +0 -1
  223. package/dist/cli/commands/deploy/entry-agent.js +0 -70
  224. package/dist/cli/commands/deploy/index.d.ts +0 -12
  225. package/dist/cli/commands/deploy/index.d.ts.map +0 -1
  226. package/dist/cli/commands/deploy/index.js +0 -370
  227. package/dist/cli/commands/deploy/links.d.ts +0 -3
  228. package/dist/cli/commands/deploy/links.d.ts.map +0 -1
  229. package/dist/cli/commands/deploy/links.js +0 -53
  230. package/dist/cli/commands/deploy/register.d.ts +0 -6
  231. package/dist/cli/commands/deploy/register.d.ts.map +0 -1
  232. package/dist/cli/commands/deploy/register.js +0 -128
  233. package/dist/cli/commands/deploy/snapshot.d.ts +0 -12
  234. package/dist/cli/commands/deploy/snapshot.d.ts.map +0 -1
  235. package/dist/cli/commands/deploy/snapshot.js +0 -76
  236. package/dist/cli/commands/deploy/state.d.ts +0 -13
  237. package/dist/cli/commands/deploy/state.d.ts.map +0 -1
  238. package/dist/cli/commands/deploy/state.js +0 -122
  239. package/dist/cli/commands/span/register.d.ts +0 -6
  240. package/dist/cli/commands/span/register.d.ts.map +0 -1
  241. package/dist/cli/commands/span/register.js +0 -25
  242. package/dist/cli/commands/trace/client.d.ts +0 -98
  243. package/dist/cli/commands/trace/client.d.ts.map +0 -1
  244. package/dist/cli/commands/trace/client.js +0 -150
  245. package/dist/cli/commands/trace/format.d.ts +0 -5
  246. package/dist/cli/commands/trace/format.d.ts.map +0 -1
  247. package/dist/cli/commands/trace/format.js +0 -58
  248. package/dist/cli/commands/trace/index.d.ts +0 -21
  249. package/dist/cli/commands/trace/index.d.ts.map +0 -1
  250. package/dist/cli/commands/trace/index.js +0 -49
  251. package/dist/cli/commands/trace/register.d.ts +0 -6
  252. package/dist/cli/commands/trace/register.d.ts.map +0 -1
  253. 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,6 +0,0 @@
1
- import type { Command } from 'commander';
2
- export interface TraceCommandRegisterContext {
3
- program: Command;
4
- }
5
- export declare function registerTraceCommand({ program }: TraceCommandRegisterContext): void;
6
- //# sourceMappingURL=register.d.ts.map
@@ -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
- }