@treasuredata/tdx 2026.7.1 → 2026.7.2

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 (280) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.d.ts +20 -0
  13. package/dist/commands/cas-command.d.ts.map +1 -1
  14. package/dist/commands/cas-command.js +1 -1
  15. package/dist/commands/cas-command.js.map +1 -1
  16. package/dist/commands/cas-segment-command.d.ts +24 -0
  17. package/dist/commands/cas-segment-command.d.ts.map +1 -1
  18. package/dist/commands/cas-segment-command.js +1 -1
  19. package/dist/commands/cas-segment-command.js.map +1 -1
  20. package/dist/commands/chat-command.js +1 -1
  21. package/dist/commands/claude-command.js +1 -1
  22. package/dist/commands/claude-statusline-command.js +1 -1
  23. package/dist/commands/claude-usage-command.js +1 -1
  24. package/dist/commands/command.js +1 -1
  25. package/dist/commands/connection-command.js +1 -1
  26. package/dist/commands/databases.js +1 -1
  27. package/dist/commands/delivery-command.js +1 -1
  28. package/dist/commands/describe.js +1 -1
  29. package/dist/commands/engage-campaign-pull-command.js +1 -1
  30. package/dist/commands/engage-campaign-push-command.js +1 -1
  31. package/dist/commands/engage-campaign-validate-command.js +1 -1
  32. package/dist/commands/engage-command.js +1 -1
  33. package/dist/commands/engage-template-pull-command.js +1 -1
  34. package/dist/commands/engage-template-push-command.js +1 -1
  35. package/dist/commands/engage-template-validate-command.js +1 -1
  36. package/dist/commands/job-command.js +1 -1
  37. package/dist/commands/journey-command.js +1 -1
  38. package/dist/commands/journey-validate-command.js +1 -1
  39. package/dist/commands/llm-command.js +1 -1
  40. package/dist/commands/mcp-command.js +1 -1
  41. package/dist/commands/parent-segment-command.js +1 -1
  42. package/dist/commands/policy-command.js +1 -1
  43. package/dist/commands/profile-command.js +1 -1
  44. package/dist/commands/profiles-command.js +1 -1
  45. package/dist/commands/query-command.js +1 -1
  46. package/dist/commands/schedule-command.js +1 -1
  47. package/dist/commands/segment-command.js +1 -1
  48. package/dist/commands/segment-create-command.js +1 -1
  49. package/dist/commands/segment-fields-command.js +1 -1
  50. package/dist/commands/segment-move-command.js +1 -1
  51. package/dist/commands/segment-pull-command.js +1 -1
  52. package/dist/commands/segment-push-command.js +1 -1
  53. package/dist/commands/segment-update-command.js +1 -1
  54. package/dist/commands/segment-use-command.js +1 -1
  55. package/dist/commands/segment-validate-command.js +1 -1
  56. package/dist/commands/segments.js +1 -1
  57. package/dist/commands/show.js +1 -1
  58. package/dist/commands/status-command.js +1 -1
  59. package/dist/commands/table-deleted.js +1 -1
  60. package/dist/commands/tables.js +1 -1
  61. package/dist/commands/unset-command.js +1 -1
  62. package/dist/commands/upgrade-command.js +1 -1
  63. package/dist/commands/use-command.js +1 -1
  64. package/dist/commands/user-command.js +1 -1
  65. package/dist/commands/work-command.js +1 -1
  66. package/dist/commands/workflow-command.js +1 -1
  67. package/dist/core/auth.js +1 -1
  68. package/dist/core/command-output.js +1 -1
  69. package/dist/core/config.js +1 -1
  70. package/dist/core/connection-cache.js +1 -1
  71. package/dist/core/constants.js +1 -1
  72. package/dist/core/credential-cache.js +1 -1
  73. package/dist/core/global-context.js +1 -1
  74. package/dist/core/keychain.js +1 -1
  75. package/dist/core/oauth-keychain.js +1 -1
  76. package/dist/core/oauth.js +1 -1
  77. package/dist/core/profile.js +1 -1
  78. package/dist/core/project-config.js +1 -1
  79. package/dist/core/session.js +1 -1
  80. package/dist/core/user-cache.js +1 -1
  81. package/dist/core/version.js +1 -1
  82. package/dist/index.js +1 -1
  83. package/dist/mcp/server.js +1 -1
  84. package/dist/mcp/tools/index.js +1 -1
  85. package/dist/mcp/tools/tdx-run.js +1 -1
  86. package/dist/mcp/tools/tdx-search.js +1 -1
  87. package/dist/mcp/tools/work-create-item.js +1 -1
  88. package/dist/mcp/utils.js +1 -1
  89. package/dist/proxy/claude-usage-tracker.js +1 -1
  90. package/dist/proxy/passthrough-server.js +1 -1
  91. package/dist/proxy/sse-usage-parser.js +1 -1
  92. package/dist/sdk/agent/agent-config.js +1 -1
  93. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  94. package/dist/sdk/agent/agent-yaml.js +1 -1
  95. package/dist/sdk/agent/test/evaluator.js +1 -1
  96. package/dist/sdk/agent/test/executor.js +1 -1
  97. package/dist/sdk/agent/test/index.js +1 -1
  98. package/dist/sdk/agent/test/output.js +1 -1
  99. package/dist/sdk/agent/test/parser.js +1 -1
  100. package/dist/sdk/agent/tool-target-registry.js +1 -1
  101. package/dist/sdk/api.js +1 -1
  102. package/dist/sdk/cas/cas-api-client.d.ts +83 -3
  103. package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
  104. package/dist/sdk/cas/cas-api-client.js +1 -1
  105. package/dist/sdk/cas/cas-api-client.js.map +1 -1
  106. package/dist/sdk/cas/cas-audience-schema.d.ts +149 -0
  107. package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -0
  108. package/dist/sdk/cas/cas-audience-schema.js +1 -0
  109. package/dist/sdk/cas/cas-audience-schema.js.map +1 -0
  110. package/dist/sdk/cas/cas-audience-validator.d.ts +57 -0
  111. package/dist/sdk/cas/cas-audience-validator.d.ts.map +1 -0
  112. package/dist/sdk/cas/cas-audience-validator.js +1 -0
  113. package/dist/sdk/cas/cas-audience-validator.js.map +1 -0
  114. package/dist/sdk/cas/cas-audience-yaml.d.ts +32 -1
  115. package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
  116. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  117. package/dist/sdk/cas/cas-audience-yaml.js.map +1 -1
  118. package/dist/sdk/cas/cas-segment-yaml.d.ts +30 -2
  119. package/dist/sdk/cas/cas-segment-yaml.d.ts.map +1 -1
  120. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  121. package/dist/sdk/cas/cas-segment-yaml.js.map +1 -1
  122. package/dist/sdk/cas/index.d.ts +21 -0
  123. package/dist/sdk/cas/index.d.ts.map +1 -1
  124. package/dist/sdk/cas/index.js +1 -1
  125. package/dist/sdk/cas/index.js.map +1 -1
  126. package/dist/sdk/cas/pull-workflow.js +1 -1
  127. package/dist/sdk/cas/push-workflow.d.ts +131 -0
  128. package/dist/sdk/cas/push-workflow.d.ts.map +1 -1
  129. package/dist/sdk/cas/push-workflow.js +1 -1
  130. package/dist/sdk/cas/push-workflow.js.map +1 -1
  131. package/dist/sdk/cas/types.d.ts +33 -4
  132. package/dist/sdk/cas/types.d.ts.map +1 -1
  133. package/dist/sdk/cas/validate-files.d.ts +64 -0
  134. package/dist/sdk/cas/validate-files.d.ts.map +1 -0
  135. package/dist/sdk/cas/validate-files.js +1 -0
  136. package/dist/sdk/cas/validate-files.js.map +1 -0
  137. package/dist/sdk/client/cdp-api-client.js +1 -1
  138. package/dist/sdk/client/delivery-api-client.js +1 -1
  139. package/dist/sdk/client/endpoints.d.ts +11 -1
  140. package/dist/sdk/client/endpoints.d.ts.map +1 -1
  141. package/dist/sdk/client/endpoints.js +1 -1
  142. package/dist/sdk/client/endpoints.js.map +1 -1
  143. package/dist/sdk/client/engage-api-client.js +1 -1
  144. package/dist/sdk/client/http-client.js +1 -1
  145. package/dist/sdk/client/llm-api-client.js +1 -1
  146. package/dist/sdk/client/oauth-refresh.js +1 -1
  147. package/dist/sdk/client/rate-limiter.js +1 -1
  148. package/dist/sdk/client/td-api-client.js +1 -1
  149. package/dist/sdk/client/trino-api-client.js +1 -1
  150. package/dist/sdk/client/workflow-client.js +1 -1
  151. package/dist/sdk/connection-validator.js +1 -1
  152. package/dist/sdk/connection.js +1 -1
  153. package/dist/sdk/delivery.js +1 -1
  154. package/dist/sdk/engage/campaign-pull.js +1 -1
  155. package/dist/sdk/engage/campaign-push.js +1 -1
  156. package/dist/sdk/engage/campaign-validator.js +1 -1
  157. package/dist/sdk/engage/campaign-yaml.js +1 -1
  158. package/dist/sdk/engage/template-pull.js +1 -1
  159. package/dist/sdk/engage/template-push.js +1 -1
  160. package/dist/sdk/engage/template-validator.js +1 -1
  161. package/dist/sdk/engage/template-yaml.js +1 -1
  162. package/dist/sdk/engage/types/campaign-def.js +1 -1
  163. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  164. package/dist/sdk/engage/types/template-schema.js +1 -1
  165. package/dist/sdk/engage.js +1 -1
  166. package/dist/sdk/errors.d.ts +20 -0
  167. package/dist/sdk/errors.d.ts.map +1 -1
  168. package/dist/sdk/errors.js +1 -1
  169. package/dist/sdk/errors.js.map +1 -1
  170. package/dist/sdk/index.js +1 -1
  171. package/dist/sdk/io/index.js +1 -1
  172. package/dist/sdk/io/node-filesystem.js +1 -1
  173. package/dist/sdk/job.js +1 -1
  174. package/dist/sdk/journey.js +1 -1
  175. package/dist/sdk/llm/chat-cache.js +1 -1
  176. package/dist/sdk/llm/index.js +1 -1
  177. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  178. package/dist/sdk/llm/model-factors.js +1 -1
  179. package/dist/sdk/llm/user-settings.js +1 -1
  180. package/dist/sdk/personalization.js +1 -1
  181. package/dist/sdk/policy.js +1 -1
  182. package/dist/sdk/query/deleted-table-validation.js +1 -1
  183. package/dist/sdk/query/index.js +1 -1
  184. package/dist/sdk/query/sql-parser.js +1 -1
  185. package/dist/sdk/realtime.js +1 -1
  186. package/dist/sdk/schedule.js +1 -1
  187. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  188. package/dist/sdk/segment/fields-display.js +1 -1
  189. package/dist/sdk/segment/file-discovery.js +1 -1
  190. package/dist/sdk/segment/journey-utils.js +1 -1
  191. package/dist/sdk/segment/journey-validator.js +1 -1
  192. package/dist/sdk/segment/journey-yaml.js +1 -1
  193. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  194. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  195. package/dist/sdk/segment/pull-workflow.js +1 -1
  196. package/dist/sdk/segment/push-recovery.js +1 -1
  197. package/dist/sdk/segment/push-workflow.js +1 -1
  198. package/dist/sdk/segment/resolution-context.d.ts +16 -7
  199. package/dist/sdk/segment/resolution-context.d.ts.map +1 -1
  200. package/dist/sdk/segment/resolution-context.js +1 -1
  201. package/dist/sdk/segment/resolution-context.js.map +1 -1
  202. package/dist/sdk/segment/segment-path-parser.js +1 -1
  203. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  204. package/dist/sdk/segment/segment-validator.js +1 -1
  205. package/dist/sdk/segment/target-resolution.js +1 -1
  206. package/dist/sdk/segment/tdx-config.js +1 -1
  207. package/dist/sdk/segment/types/activation-schema.js +1 -1
  208. package/dist/sdk/segment/types/journey-def.js +1 -1
  209. package/dist/sdk/segment/types/journey-schema.js +1 -1
  210. package/dist/sdk/segment/types/segment-def.js +1 -1
  211. package/dist/sdk/segment/types/segment-schema.js +1 -1
  212. package/dist/sdk/segment/validate-files.js +1 -1
  213. package/dist/sdk/segment/yaml-validator.d.ts +1 -1
  214. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  215. package/dist/sdk/segment/yaml-validator.js +1 -1
  216. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  217. package/dist/sdk/segment.js +1 -1
  218. package/dist/sdk/types/cas.d.ts +99 -26
  219. package/dist/sdk/types/cas.d.ts.map +1 -1
  220. package/dist/sdk/types/index.d.ts +1 -1
  221. package/dist/sdk/types/index.d.ts.map +1 -1
  222. package/dist/sdk/types/index.js +1 -1
  223. package/dist/sdk/types/index.js.map +1 -1
  224. package/dist/sdk/types/progress.js +1 -1
  225. package/dist/sdk/types/workspace.js +1 -1
  226. package/dist/sdk/user.js +1 -1
  227. package/dist/sdk/util/format-detector.js +1 -1
  228. package/dist/sdk/util/formatters.js +1 -1
  229. package/dist/sdk/util/index.js +1 -1
  230. package/dist/sdk/util/paginate.js +1 -1
  231. package/dist/sdk/util/tree-formatter.js +1 -1
  232. package/dist/sdk/util/tree-search.js +1 -1
  233. package/dist/sdk/workflow/archive-validation.js +1 -1
  234. package/dist/sdk/workflow/clone-workflow.js +1 -1
  235. package/dist/sdk/workflow/index.js +1 -1
  236. package/dist/sdk/workflow/pull-workflow.js +1 -1
  237. package/dist/sdk/workflow/push-workflow.js +1 -1
  238. package/dist/sdk/workflow/task-graph.js +1 -1
  239. package/dist/sdk/workflow/tdx-config.js +1 -1
  240. package/dist/sdk/workflow/workflow-utils.js +1 -1
  241. package/dist/sdk/workspace/access-tracker.js +1 -1
  242. package/dist/sdk/workspace/frontmatter.js +1 -1
  243. package/dist/sdk/workspace/git.js +1 -1
  244. package/dist/sdk/workspace/index.js +1 -1
  245. package/dist/sdk/workspace/templates.js +1 -1
  246. package/dist/sdk/workspace/weekly.js +1 -1
  247. package/dist/sdk/workspace/wikilinks.js +1 -1
  248. package/dist/test-utils/command-runner.js +1 -1
  249. package/dist/test-utils/factories.js +1 -1
  250. package/dist/test-utils/fixtures.js +1 -1
  251. package/dist/test-utils/http-mock.js +1 -1
  252. package/dist/test-utils/index.js +1 -1
  253. package/dist/utils/async.js +1 -1
  254. package/dist/utils/colors.js +1 -1
  255. package/dist/utils/diff.js +1 -1
  256. package/dist/utils/file-permissions.js +1 -1
  257. package/dist/utils/file-reader.js +1 -1
  258. package/dist/utils/github-releases.js +1 -1
  259. package/dist/utils/global-cache.js +1 -1
  260. package/dist/utils/json-loader.js +1 -1
  261. package/dist/utils/local-cache.js +1 -1
  262. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  263. package/dist/utils/logger/formatters/index.js +1 -1
  264. package/dist/utils/logger/handlers/console-handler.js +1 -1
  265. package/dist/utils/logger/handlers/file-handler.js +1 -1
  266. package/dist/utils/logger/handlers/index.js +1 -1
  267. package/dist/utils/logger/handlers/null-handler.js +1 -1
  268. package/dist/utils/logger/index.js +1 -1
  269. package/dist/utils/logger/logger.js +1 -1
  270. package/dist/utils/logger/types.js +1 -1
  271. package/dist/utils/option-validation.js +1 -1
  272. package/dist/utils/process.js +1 -1
  273. package/dist/utils/prompt.js +1 -1
  274. package/dist/utils/spinner.js +1 -1
  275. package/dist/utils/sse-parser.js +1 -1
  276. package/dist/utils/string-utils.js +1 -1
  277. package/dist/utils/table-ref-parser.js +1 -1
  278. package/dist/utils/tdx-logger.js +1 -1
  279. package/dist/utils/version-check.js +1 -1
  280. package/package.json +1 -1
@@ -1 +1 @@
1
- const a56_0x28b4c4=a56_0x3ea7;(function(_0x6ef945,_0x2dfb02){const _0x522669=a56_0x3ea7,_0x11f443=_0x6ef945();while(!![]){try{const _0x34b9c1=-parseInt(_0x522669(0x324))/0x1+parseInt(_0x522669(0x29c))/0x2+-parseInt(_0x522669(0x216))/0x3*(-parseInt(_0x522669(0x2d5))/0x4)+parseInt(_0x522669(0x180))/0x5+-parseInt(_0x522669(0x309))/0x6+parseInt(_0x522669(0x2ff))/0x7+-parseInt(_0x522669(0x207))/0x8;if(_0x34b9c1===_0x2dfb02)break;else _0x11f443['push'](_0x11f443['shift']());}catch(_0x1d84eb){_0x11f443['push'](_0x11f443['shift']());}}}(a56_0x4620,0xe1563));import a56_0x3ae1dc from'chalk';import{existsSync}from'fs';import a56_0x49ff99 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import{parseTaskGraph,formatTaskGraph,summarizeTaskGraph,formatWarningSummary}from'../sdk/workflow/task-graph.js';import a56_0x4687fd from'prompts';function getAttemptStatusDisplay(_0x22105e){const _0x50b5d6=a56_0x3ea7;if(!_0x22105e)return{'icon':'⏳','text':''};const {done:_0x3c6630,success:_0x4aaa40,cancelRequested:_0x4834eb}=_0x22105e;if(!_0x3c6630)return _0x4834eb?{'icon':'🛑','text':a56_0x3ae1dc[_0x50b5d6(0x2df)](_0x50b5d6(0x1e7))}:{'icon':'🔄','text':a56_0x3ae1dc['blue']('running')};if(_0x4aaa40)return{'icon':'✅','text':a56_0x3ae1dc[_0x50b5d6(0x258)](_0x50b5d6(0x244))};return{'icon':'❌','text':a56_0x3ae1dc['red'](_0x50b5d6(0x174))};}export class WorkflowBaseCommand extends BaseCommand{[a56_0x28b4c4(0x222)](_0x3989f3,_0xe1b117,_0x4bf7ad=0x0){const _0x26c5d9=a56_0x28b4c4;return _0x3989f3[_0x4bf7ad]||_0xe1b117[_0x26c5d9(0x280)];}['requireProject'](_0x41e962,_0x3d49df,_0x8d86dd=0x0){const _0x23dc61=a56_0x28b4c4,_0x31e776=this[_0x23dc61(0x222)](_0x41e962,_0x3d49df,_0x8d86dd);if(!_0x31e776)return console['error'](a56_0x3ae1dc[_0x23dc61(0x31c)](_0x23dc61(0x31e)),_0x23dc61(0x215)),console[_0x23dc61(0x174)](a56_0x3ae1dc[_0x23dc61(0x18b)](_0x23dc61(0x2a8))),null;return _0x31e776;}[a56_0x28b4c4(0x1c1)](_0x4a7b58,_0x3a4370){const _0x4c9d87=a56_0x28b4c4;if(_0x4a7b58[0x0]){const _0x58bfb8=_0x4a7b58[0x0][_0x4c9d87(0x2a3)]('.');if(_0x58bfb8[_0x4c9d87(0x24f)]===0x1)return{'projectName':_0x58bfb8[0x0],'workflowName':undefined};else return _0x58bfb8[_0x4c9d87(0x24f)]===0x2?{'projectName':_0x58bfb8[0x0],'workflowName':_0x58bfb8[0x1]}:(console['error'](a56_0x3ae1dc[_0x4c9d87(0x31c)](_0x4c9d87(0x31e)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x3a4370['workflowProject'],'workflowName':undefined};}[a56_0x28b4c4(0x2f3)](_0x3fd394,_0x98a0bd,_0x3371c3=0x0){const _0x2758c6=a56_0x28b4c4;if(_0x3fd394[_0x3371c3])return _0x3fd394[_0x3371c3];if(_0x98a0bd['workflowProject']){const _0x5078ae=a56_0x49ff99[_0x2758c6(0x272)](process[_0x2758c6(0x278)](),_0x2758c6(0x315),_0x98a0bd['workflowProject']);if(existsSync(a56_0x49ff99[_0x2758c6(0x272)](_0x5078ae,_0x2758c6(0x270))))return _0x5078ae;}return undefined;}async['showWorkflowConsoleUrl'](_0x2f781f,_0x3efd04,_0x10c171){const _0x2ea678=a56_0x28b4c4;try{const _0x1aef81=await _0x2f781f['workflow']['workflows'](_0x3efd04,{'limit':0x1});if(_0x1aef81['length']>0x0){const _0x1c90c7=_0x1aef81[0x0]['id'],_0x1fa1fc=getWorkflowUrl(_0x10c171,_0x1c90c7);console['error'](_0x2ea678(0x2c6)+a56_0x3ae1dc[_0x2ea678(0x218)](_0x1fa1fc));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a56_0x28b4c4(0x22a)]='workflow:use';[a56_0x28b4c4(0x1ea)]=a56_0x28b4c4(0x279);async[a56_0x28b4c4(0x195)](_0x5e04a9){const _0x383eee=a56_0x28b4c4,{options:_0x1de8a1,args:_0x18d083,tdx:_0x11d2f4}=_0x5e04a9,_0x15bf12=_0x18d083[0x0],_0x1381f0=_0x1de8a1[_0x383eee(0x236)];if(_0x1381f0)return saveSessionContext({'workflow_project':undefined},_0x1de8a1[_0x383eee(0x295)]),console[_0x383eee(0x2b0)](a56_0x3ae1dc[_0x383eee(0x258)](_0x383eee(0x17a))),0x0;if(!_0x15bf12)return console[_0x383eee(0x174)](a56_0x3ae1dc['red']('Error:'),'Project\x20name\x20is\x20required'),console['error'](a56_0x3ae1dc[_0x383eee(0x18b)](_0x383eee(0x2dd))),console[_0x383eee(0x174)](a56_0x3ae1dc[_0x383eee(0x18b)](_0x383eee(0x211))),0x1;const _0xff3186=await withSpinner(_0x383eee(0x1fe)+_0x15bf12+'\x27...',()=>_0x11d2f4['workflow'][_0x383eee(0x2f6)](_0x15bf12),{'verbose':_0x1de8a1['verbose']}),{name:_0x165902}=_0xff3186[_0x383eee(0x2c5)];return saveSessionContext({'workflow_project':_0x165902},_0x1de8a1[_0x383eee(0x295)]),console[_0x383eee(0x2b0)](a56_0x3ae1dc[_0x383eee(0x258)](_0x383eee(0x26e)+a56_0x3ae1dc[_0x383eee(0x218)](_0x165902))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a56_0x28b4c4(0x22a)]=a56_0x28b4c4(0x2a9);[a56_0x28b4c4(0x1ea)]=a56_0x28b4c4(0x23b);async[a56_0x28b4c4(0x195)](_0x367c9c){const _0x48d8c7=a56_0x28b4c4,{options:_0x4119aa,args:_0x5a9017,tdx:_0x1b1dad}=_0x367c9c,_0x1592d3=_0x5a9017[0x0];_0x4119aa[_0x48d8c7(0x28c)]&&_0x1592d3&&console[_0x48d8c7(0x174)](_0x48d8c7(0x2e6)+_0x1592d3);const _0x9b1313=await withSpinner(_0x48d8c7(0x2e0),()=>_0x1b1dad[_0x48d8c7(0x2b9)][_0x48d8c7(0x1a4)](_0x1592d3,{'limit':_0x4119aa[_0x48d8c7(0x1b3)]}),{'verbose':_0x4119aa['verbose']});let _0x4d5385=_0x9b1313[_0x48d8c7(0x2c5)];_0x4d5385[_0x48d8c7(0x1ed)]((_0x17b620,_0x52d80e)=>_0x17b620[_0x48d8c7(0x22a)]['localeCompare'](_0x52d80e[_0x48d8c7(0x22a)]));const _0x9e9581=_0x4119aa[_0x48d8c7(0x1b3)]&&_0x4d5385[_0x48d8c7(0x24f)]>=_0x4119aa[_0x48d8c7(0x1b3)]?a56_0x3ae1dc['dim'](_0x48d8c7(0x2cd)):'';console[_0x48d8c7(0x174)](_0x48d8c7(0x209)+_0x4d5385[_0x48d8c7(0x24f)]+_0x48d8c7(0x319)+(_0x4d5385['length']!==0x1?'s':'')+_0x9e9581);if(_0x4119aa[_0x48d8c7(0x213)]===_0x48d8c7(0x25f)||_0x4119aa[_0x48d8c7(0x213)]===_0x48d8c7(0x257)||_0x4119aa[_0x48d8c7(0x213)]===_0x48d8c7(0x1c5))await handleSDKOutput(_0x4d5385,_0x4119aa);else{if(_0x4d5385[_0x48d8c7(0x24f)]===0x0)_0x1592d3?console[_0x48d8c7(0x2b0)](_0x48d8c7(0x1ad)+_0x1592d3):console['log']('No\x20workflow\x20projects\x20found');else{const _0x1e4fd3=_0x4d5385[_0x48d8c7(0x241)](_0x3f777c=>{const _0xd2982d=_0x48d8c7,_0x5ab27d=_0x3f777c[_0xd2982d(0x2b6)]?.[_0xd2982d(0x1e5)](_0xa641a6=>_0xa641a6['key']===_0xd2982d(0x202)),_0x5bee12=_0x5ab27d?a56_0x3ae1dc['dim'](_0xd2982d(0x188)):'';return _0xd2982d(0x2c4)+_0x3f777c['name']+_0x5bee12;});await writeOutput(_0x1e4fd3[_0x48d8c7(0x272)]('\x0a'),_0x4119aa[_0x48d8c7(0x21b)],_0x48d8c7(0x1b7));}}return 0x0;}}function a56_0x4620(){const _0xe5e6e6=['Listing\x20workflow\x20projects...','Workflow:\x20','\x20disabled\x20(','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Listing\x20workflow\x20sessions...','Session\x20not\x20found:\x20','Pattern:\x20','toLowerCase','max','Using\x20attempt\x20','workflow:kill','\x22\x20already\x20exists\x20(ID:\x20','round','Analyzing\x20changes...','\x20deleted','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','projectId','MAX_TIMELINE_WIDTH','padStart','resolveProjectDir','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','workflow:schedules','resolveProjectId','get','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','total','toLocaleString','parse','has','attempt:','showWorkflowConsoleUrl','8363061doTXYE','Source\x20directory:\x20','durationMs','Parameters:\x20','workflow:clone','now','(unknown)','From\x20task:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','4439688CjPCnE','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','renderTimeline','rows','dryRun','Status:\x20','deleted','type','\x20\x20Next\x20run:\x20','---\x20','Enable\x20a\x20workflow\x20schedule','POLL_INTERVAL_MS','workflows','workflow:push','delete','new','\x20project','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Schedule:\x20backfill\x20runs\x20enabled\x20(--backfill)','red','\x20workflow','Error:','Filter:\x20','\x20secrets\x20set\x20for\x20project\x20\x27','Show\x20tasks\x20for\x20an\x20attempt','session_id','Filter:\x20project=','1682088REPffp','Tip:\x20cd\x20to\x20workflows/','\x20has\x20no\x20attempts','floor','💡\x20Tip:\x20Use\x20','List\x20workflows','set','\x0aDry\x20run\x20-\x20no\x20project\x20created','attempt','Schedule\x20ID\x20is\x20required','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Project\x20filter:\x20','Pushing\x20project...','getTime','group_error','workflow:run','Cancelled','Workflow:','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Updating\x20','prepareCloneProject','blue','--schedule-id\x20cannot\x20be\x20combined\x20with\x20a\x20project.workflow\x20filter','setSecrets','Setting\x20','splice','fromTask','disableSchedule','cancelRequested','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Secrets\x20to\x20set:\x20','isArray','revision','→\x20Project:\x20','🔄\x20','getHours','sourceDir','running','reason','Total:\x20','error','unknown','resumeFrom','Deleting\x20project\x20','workflow:timeline','window','✔\x20Workflow\x20project\x20context\x20cleared.','✔\x20Schedule\x20#','run','\x20\x20Location:\x20','startTime','Error:\x20Secret\x20key\x20is\x20required','6352205ziWodU','path','List\x20workflow\x20attempts','revision:\x20','includeRetried','Task\x20graph:','taskName','\x20\x20tdx\x20wf\x20use\x20<project>','\x20(system)','status','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','dim','config','\x20schedule','Downloading\x20logs...','columns','workflow:schedule:enable','Reason:\x20','start','\x20from\x20session\x20','GUTTER','execute','Error:\x20','startsWith','match','\x20\x20Project:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20AI','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x20\x20Workflow:\x20','Analyzing\x20project...','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','replace','\x0aClone\x20\x22','end','Pull\x20workflow\x20project\x20to\x20local\x20folder','projects','Target:\x20','listProjectSchedules','updatedAt','download','fileSize','MAX_LABEL_COUNT','getDate','relative','No\x20projects\x20match\x20pattern:\x20','newProjectId','\x20(use\x20a\x20larger\x20--limit\x20to\x20show\x20more)','changes','✔\x20Schedule\x20found','Source\x20project:\x20','limit','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','\x20-\x20','disabledAt','list','stdout','-\x20no\x20files\x20written','project',',\x20Workflow:\x20','Upload\x20workflow\x20project\x20to\x20Treasure\x20AI\x20(digdag-style)','\x0aError:','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20AI','retryAttempt','parseProjectWorkflowPattern','startedAt','\x20next:\x20','finishedAt','table','getMinutes','(use\x20--limit\x20to\x20see\x20more)','done','No\x20sessions\x20found','Setting\x20secret...','title','applyPullProject','bold','Retrying\x20attempt...','\x22\x20to\x20new\x20project\x20\x22','workflowName','\x20secrets...','listSchedules','\x20\x20Source:\x20','\x20\x20Session\x20context\x20set\x20to:\x20','...','select','MAX_TASKS_DISPLAY','filter','trimEnd','✔\x20Showing\x20','/sessions/','toISOString','lastAttempt','renderSingleTimeline','site','Fetching\x20schedule\x20#','Show\x20specific\x20attempt\x20details','No\x20sessions\x20with\x20timing\x20information','filesExtracted','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','some','Dry\x20run:\x20yes','canceling','\x27\x20from\x20project\x20\x27','executePushProject','description','sessionTime','renderSessionsTimeline','sort','Start\x20a\x20workflow\x20run','localeCompare','workflow:attempts','pending','Listing\x20schedules\x20for\x20','Disabling\x20schedule\x20#','No\x20matching\x20sessions\x20found','\x0aApply\x20these\x20changes?','min','getMonth','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','fill','basename','Error:\x20Attempt\x20ID\x20is\x20required','workflow:delete','Resolving\x20project\x20\x27','state','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','indexOf','sys','utf-8','follow','includeSubtasks','readFile','6767576SwZxpW','Usage:\x20workflow:delete\x20<project-name-or-id>','✔\x20Found\x20','autocomplete','kill','workflow:sessions','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','existingProjectId','nextTime','tasks','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','format','\x20\x20Attempt\x20ID:\x20','Project\x20name\x20is\x20required','3958887REbSox','Retry\x20a\x20session\x20or\x20attempt','cyan','fs/promises','write','output','workflow:attempt','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','duration','workflow:schedule:disable','push','navigateSessionsInteractive','resolveProject','Parameters:','No\x20attempts\x20found\x20for:\x20','Attempt\x20ID:\x20','Cloning\x20to\x20','Retrying\x20session...','Validation:\x20skipped','Listing\x20workflows...','name','generateSessionTimelineRows','resolve','logs','\x20modified','Fetching\x20log\x20files...','summary','size','force','/app/workflows/','New\x20project\x20name:\x20','Project\x20directory:\x20','clear','\x0aDry\x20run\x20-\x20nothing\x20pushed','Source:\x20','context','from','List\x20all\x20workflow\x20projects','Including\x20subtasks:\x20yes','\x0aFailed\x20to\x20fetch\x20attempt\x20data','\x22\x20with\x20new\x20revision?','✔\x20Clone\x20complete','\x0aUpdate\x20existing\x20project\x20\x22','map','sessions','stat','success','skipValidation','param','all','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','attemptId','Source\x20directory\x20is\x20required','substring','isTTY','Show\x20logs\x20for\x20a\x20workflow\x20attempt','sourceProjectName','length','✔\x20Project:\x20','Enabling\x20schedule\x20#','\x20task','params','\x20new','Task\x20name:\x20','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','jsonl','green','\x0a✔\x20No\x20changes\x20to\x20push','buildTimelineData','✔\x20Secret\x20\x27','MIN_TIMELINE_WIDTH','targetDir','Fetching\x20workflow\x20','json','.\x20Expected\x20format:\x20KEY=VALUE','attempts','LABEL_MIN_SPACING','keys','\x20attempt','Params:\x20','logFiles','Select\x20a\x20session\x20to\x20view\x20timeline:','\x1b[1A\x1b[2K','newProjectName','unchanged','workflow:upload','Loading\x20workflows...','getFullYear','✔\x20Workflow\x20project\x20set\x20to:\x20','\x20\x20Project\x20ID:\x20','tdx.json','executeDryRun','join','repeat','Error:\x20Project\x20name\x20is\x20required','Project:\x20','planned','Key\x20cannot\x20be\x20empty','cwd','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','fileCount','key','\x0a✔\x20Already\x20up\x20to\x20date','Invalid\x20format:\x20','message','Resume\x20from:\x20','workflowProject','workflow:secrets:list','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','every','Include\x20retried:\x20yes','Loading\x20sessions...','Listing\x20secrets...','task','Usage:\x20tdx\x20wf\x20schedule\x20list\x20[project[.workflow]]\x20|\x20--schedule-id\x20<id>','\x20\x20Session\x20ID:\x20','No\x20attempts\x20found\x20in\x20project:\x20','Loading\x20session...','verbose','listSecrets','No\x20workflow\x20sessions\x20found','isNewProject','Pushing\x20workflow\x20project...','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Listing\x20schedules...','\x20logs','No\x20attempts\x20found','session','✔\x20Project\x20updated','ICON_WIDTH','Pulling\x20project\x20','modified','targetExists','No\x20workflows\x20found','812338ILecfQ','No\x20log\x20files\x20found\x20for\x20this\x20attempt','⚠\x20Showing\x20first\x20','fullName','Getting\x20attempt\x20details...','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','executeCloneProject','split','sessionId','📋\x20','\x20secret','Revision:\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','workflow:projects','tdx\x20wf\x20attempt\x20','→\x20New\x20project:\x20','\x20\x20Revision:\x20','Disable\x20a\x20workflow\x20schedule','yes','\x20(disabled)','log','Starting\x20workflow\x20run...','Error:\x20Invalid\x20parameter\x20format:\x20','workflow:secrets:set','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Select\x20a\x20task\x20to\x20view\x20logs:','metadata','includes','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','workflow','Key:\x20','createdAt','workflow:pull','Delete\x20workflow\x20project\x20from\x20Treasure\x20AI','retryAttemptName','Downloading\x20project\x20','Force:\x20yes','pollTimeline','projectName','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','📁\x20','data','\x20\x20Console:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','slice','No\x20sessions\x20found\x20for:\x20','workflow:workflows','skipSchedule','Getting\x20attempt\x20tasks...','\x20(use\x20--limit\x20to\x20show\x20more)','\x0aPush\x20these\x20changes?','Files\x20to\x20upload:\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','find','Target\x20directory:\x20','nextRunTime','values','4tLPEqn','icon','index','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','hasChanges','-\x20nothing\x20pushed','✔\x20Pushed\x20','diff','Usage:\x20tdx\x20wf\x20use\x20<project>','No\x20sessions\x20found\x20in\x20project:\x20','yellow'];a56_0x4620=function(){return _0xe5e6e6;};return a56_0x4620();}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a56_0x28b4c4(0x2ca);[a56_0x28b4c4(0x1ea)]=a56_0x28b4c4(0x329);async[a56_0x28b4c4(0x195)](_0xbf2503){const _0x1972ad=a56_0x28b4c4,{options:_0x210a2f,args:_0x200efa,tdx:_0x70de96}=_0xbf2503,_0x16e850=this['resolveProject'](_0x200efa,_0x210a2f);_0x210a2f['verbose']&&_0x16e850&&console['error'](_0x1972ad(0x32f)+_0x16e850);const _0x10e6a4=await withSpinner(_0x1972ad(0x229),()=>_0x70de96[_0x1972ad(0x2b9)][_0x1972ad(0x315)](_0x16e850,{'limit':_0x210a2f[_0x1972ad(0x1b3)]}),{'verbose':_0x210a2f[_0x1972ad(0x28c)]});let _0x3ee07f=_0x10e6a4['data'];_0x3ee07f['sort']((_0x11ebfa,_0x247ca8)=>{const _0x5c2005=_0x1972ad,_0x130df1=_0x11ebfa[_0x5c2005(0x22a)][_0x5c2005(0x1ef)](_0x247ca8[_0x5c2005(0x22a)]);if(_0x130df1!==0x0)return _0x130df1;return(_0x11ebfa['project']?.[_0x5c2005(0x22a)]||'')['localeCompare'](_0x247ca8[_0x5c2005(0x1ba)]?.[_0x5c2005(0x22a)]||'');});const _0x4ae78f=_0x210a2f['limit']&&_0x3ee07f[_0x1972ad(0x24f)]>=_0x210a2f[_0x1972ad(0x1b3)]?a56_0x3ae1dc[_0x1972ad(0x18b)](_0x1972ad(0x2cd)):'';console[_0x1972ad(0x174)]('✔\x20Found\x20'+_0x3ee07f[_0x1972ad(0x24f)]+_0x1972ad(0x31d)+(_0x3ee07f[_0x1972ad(0x24f)]!==0x1?'s':'')+_0x4ae78f);if(_0x210a2f['format']==='json'||_0x210a2f[_0x1972ad(0x213)]==='jsonl'||_0x210a2f[_0x1972ad(0x213)]===_0x1972ad(0x1c5))await handleSDKOutput(_0x3ee07f,_0x210a2f);else{if(_0x3ee07f[_0x1972ad(0x24f)]===0x0)_0x16e850?console[_0x1972ad(0x2b0)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x16e850):console['log'](_0x1972ad(0x29b));else{const _0x4bfa5a=_0x210a2f['site'],_0x262479=_0x3ee07f[_0x1972ad(0x241)](_0x94939=>{const _0x206757=_0x1972ad,_0xc21197=a56_0x3ae1dc['dim']('#'+_0x94939['id']),_0x3033aa=hyperlink(_0xc21197,getWorkflowUrl(_0x4bfa5a,_0x94939['id'])),_0x170fa8=_0x94939[_0x206757(0x1ba)]?.['name']?a56_0x3ae1dc['dim']('\x20('+_0x94939[_0x206757(0x1ba)][_0x206757(0x22a)]+')'):'';return _0x206757(0x2a5)+_0x3033aa+'\x20'+_0x94939[_0x206757(0x22a)]+_0x170fa8;});await writeOutput(_0x262479[_0x1972ad(0x272)]('\x0a'),_0x210a2f['output'],_0x1972ad(0x1b7));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a56_0x28b4c4(0x20c);[a56_0x28b4c4(0x1ea)]='List\x20workflow\x20execution\x20sessions';async['execute'](_0x22ad78){const _0x109801=a56_0x28b4c4,{options:_0x207147,args:_0x45d732,tdx:_0x345d75}=_0x22ad78,_0x572971=this[_0x109801(0x1c1)](_0x45d732,_0x207147);if(!_0x572971)return 0x1;const {projectName:_0x20adeb,workflowName:_0x36af1b}=_0x572971;if(_0x207147[_0x109801(0x28c)]){if(_0x20adeb&&_0x36af1b)console['error']('Filter:\x20'+_0x20adeb+'.'+_0x36af1b);else _0x20adeb&&console['error'](_0x109801(0x323)+_0x20adeb);const _0x1540e7=_0x207147[_0x109801(0x189)];_0x1540e7&&console['error'](_0x109801(0x30e)+_0x1540e7);}let _0x410a55=0x28;if(process[_0x109801(0x1b8)][_0x109801(0x24c)]&&!_0x207147[_0x109801(0x21b)]&&!_0x207147[_0x109801(0x213)]){const _0x1eb0ae=process['stdout'][_0x109801(0x30c)]||0x28;_0x410a55=Math[_0x109801(0x2e8)](0x14,Math['floor'](_0x1eb0ae*0x2/0x3));}const _0x34d0a5=_0x207147[_0x109801(0x1b3)]||_0x410a55,_0x489161=await withSpinner(_0x109801(0x2e4),()=>_0x345d75['workflow'][_0x109801(0x242)]({'projectName':_0x20adeb,'workflowName':_0x36af1b,'status':_0x207147[_0x109801(0x189)],'fromTime':_0x207147[_0x109801(0x23a)],'toTime':_0x207147['to'],'limit':_0x34d0a5}),{'verbose':_0x207147[_0x109801(0x28c)]}),_0x1979f9=_0x489161[_0x109801(0x2c5)];_0x1979f9['sort']((_0x21511d,_0x2610d6)=>{const _0x574675=_0x109801,_0x2b5e75=_0x21511d[_0x574675(0x1eb)]||'',_0x37eb86=_0x2610d6[_0x574675(0x1eb)]||'';return _0x37eb86[_0x574675(0x1ef)](_0x2b5e75);});_0x1979f9[_0x109801(0x24f)]>=_0x34d0a5?console[_0x109801(0x174)](_0x109801(0x1da)+_0x1979f9['length']+'\x20sessions\x20'+a56_0x3ae1dc['dim'](_0x109801(0x1c7))):console[_0x109801(0x174)](_0x109801(0x209)+_0x1979f9['length']+'\x20session'+(_0x1979f9[_0x109801(0x24f)]!==0x1?'s':''));if(_0x207147[_0x109801(0x213)]==='json'||_0x207147[_0x109801(0x213)]===_0x109801(0x257)||_0x207147['format']==='table')await handleSDKOutput(_0x1979f9,_0x207147);else{if(!process[_0x109801(0x1b8)]['isTTY']||_0x207147[_0x109801(0x21b)]){if(_0x1979f9[_0x109801(0x24f)]===0x0){if(_0x20adeb&&_0x36af1b)console[_0x109801(0x2b0)](_0x109801(0x2c9)+_0x20adeb+'.'+_0x36af1b);else _0x20adeb?console[_0x109801(0x2b0)](_0x109801(0x2de)+_0x20adeb):console[_0x109801(0x2b0)](_0x109801(0x1c9));}else{const _0x3f14d7=_0x207147[_0x109801(0x1df)],_0x874a8=this[_0x109801(0x1ec)](_0x1979f9,_0x3f14d7);_0x207147[_0x109801(0x21b)]?await writeOutput(_0x874a8,_0x207147['output'],'list'):console[_0x109801(0x2b0)](_0x874a8);}!_0x20adeb&&(console['error'](''),console[_0x109801(0x174)](a56_0x3ae1dc['dim']('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console['error'](a56_0x3ae1dc['dim'](_0x109801(0x1be))+'or'+a56_0x3ae1dc[_0x109801(0x18b)](_0x109801(0x187))));}else{if(_0x1979f9[_0x109801(0x24f)]===0x0){if(_0x20adeb&&_0x36af1b)console[_0x109801(0x2b0)](_0x109801(0x2c9)+_0x20adeb+'.'+_0x36af1b);else _0x20adeb?console[_0x109801(0x2b0)](_0x109801(0x2de)+_0x20adeb):console[_0x109801(0x2b0)](_0x109801(0x1c9));}else await this['navigateSessionsInteractive'](_0x1979f9,_0x22ad78,_0x20adeb);}}return 0x0;}['renderSessionsTimeline'](_0x927df0,_0xe2a9fa){const _0x539dcc=a56_0x28b4c4,_0x67ecd=[],_0x2f6ba7=new Map();let _0x2bfab2=Infinity,_0x26a357=-Infinity;for(const _0x139d6a of _0x927df0){if(_0x139d6a[_0x539dcc(0x1dd)]?.[_0x539dcc(0x2bb)]){const _0x38b942=new Date(_0x139d6a[_0x539dcc(0x1dd)][_0x539dcc(0x2bb)])['getTime'](),_0x3a468a=_0x139d6a[_0x539dcc(0x1dd)]['finishedAt']?new Date(_0x139d6a[_0x539dcc(0x1dd)][_0x539dcc(0x1c4)])[_0x539dcc(0x331)]():Date[_0x539dcc(0x304)](),_0x44cc76=_0x139d6a[_0x539dcc(0x1ba)]?.[_0x539dcc(0x22a)]||'(unknown)';!_0x2f6ba7[_0x539dcc(0x2fc)](_0x44cc76)&&_0x2f6ba7['set'](_0x44cc76,[]),_0x2f6ba7[_0x539dcc(0x2f7)](_0x44cc76)[_0x539dcc(0x220)]({'session':_0x139d6a,'startTime':_0x38b942,'endTime':_0x3a468a,'duration':_0x3a468a-_0x38b942}),_0x2bfab2=Math[_0x539dcc(0x1f6)](_0x2bfab2,_0x38b942),_0x26a357=Math['max'](_0x26a357,_0x3a468a);}}if(_0x2f6ba7[_0x539dcc(0x231)]===0x0)return _0x539dcc(0x1e2);const _0x49235f=process[_0x539dcc(0x1b8)][_0x539dcc(0x18f)]||0x78,_0x1f43ec=0x1e,_0x36b050=0x32,_0x474efc=0x4,_0x36a169=Math[_0x539dcc(0x1f6)](_0x36b050,Math[_0x539dcc(0x2e8)](_0x1f43ec,Math['floor'](_0x49235f*0.3))),_0x42d77a=_0x49235f-_0x36a169-TIMELINE_CONFIG[_0x539dcc(0x194)]-0x3-_0x474efc,_0x5e0e1f=_0x26a357-_0x2bfab2,_0x1fe7a8=_0x5e0e1f/_0x36a169,_0x44385c=renderTimeAxis({'startTime':_0x2bfab2,'endTime':_0x26a357,'durationMs':_0x5e0e1f,'msPerChar':_0x1fe7a8},_0x36a169),_0x3eeac0=[];for(const _0x3d86a7 of _0x2f6ba7[_0x539dcc(0x2d4)]()){_0x3eeac0[_0x539dcc(0x220)](..._0x3d86a7);}_0x3eeac0[_0x539dcc(0x1ed)]((_0x4121d2,_0x345929)=>_0x345929[_0x539dcc(0x17e)]-_0x4121d2[_0x539dcc(0x17e)]);const _0x542795=new Date(_0x2bfab2),_0x38592d=formatDate(_0x542795),_0x4112df=_0x474efc+TIMELINE_CONFIG[_0x539dcc(0x297)]+TIMELINE_CONFIG['ICON_SPACING']+_0x42d77a,_0x27d0a1='\x20'[_0x539dcc(0x273)](_0x4112df-_0x38592d[_0x539dcc(0x24f)]),_0x349743=_0x27d0a1+a56_0x3ae1dc[_0x539dcc(0x18b)](_0x38592d)+'\x20'+_0x44385c;_0x67ecd[_0x539dcc(0x220)](_0x349743);const _0x398935=0x16;let _0x872e4f=0x0;for(const _0x22c0cb of _0x3eeac0){const _0x1ba1e5=_0x22c0cb[_0x539dcc(0x295)][_0x539dcc(0x1ba)]?.[_0x539dcc(0x22a)]||'?',_0x105d52=Math['min'](stringWidth(_0x1ba1e5),_0x398935);_0x872e4f=Math[_0x539dcc(0x2e8)](_0x872e4f,_0x105d52);}for(const _0x582209 of _0x3eeac0){const {session:_0x4f46c9,startTime:_0x30192b,endTime:_0x371a49,duration:_0x1042d1}=_0x582209,_0x536990=_0x4f46c9[_0x539dcc(0x1ba)]?.['id'],_0x13bc8f=_0x4f46c9['id'],_0x3d0c16=_0x4f46c9[_0x539dcc(0x1ba)]?.[_0x539dcc(0x22a)]||'?',_0x5c9a55=_0x4f46c9[_0x539dcc(0x2b9)]?.[_0x539dcc(0x22a)]||'?';let _0x11b0d1,_0xef9499;if(_0x4f46c9[_0x539dcc(0x1dd)]){const _0xcbb05d=_0x4f46c9[_0x539dcc(0x1dd)];!_0xcbb05d['done']?(_0x11b0d1=_0xcbb05d[_0x539dcc(0x340)]?'🛑':'🔄',_0xef9499=_0xcbb05d[_0x539dcc(0x340)]?a56_0x3ae1dc[_0x539dcc(0x2df)]:a56_0x3ae1dc['blue']):(_0x11b0d1=_0xcbb05d['success']?'✅':'❌',_0xef9499=_0xcbb05d[_0x539dcc(0x244)]?a56_0x3ae1dc[_0x539dcc(0x258)]:a56_0x3ae1dc['red']);}else _0x11b0d1='⏳',_0xef9499=a56_0x3ae1dc[_0x539dcc(0x18b)];const _0x4fa45c='#'+_0x13bc8f,_0x55fbe1=_0x536990?hyperlink(_0x4fa45c,getWorkflowSessionUrl(_0xe2a9fa,_0x536990,_0x13bc8f)):_0x4fa45c;let _0x379d4f=_0x3d0c16;stringWidth(_0x3d0c16)>_0x398935&&(_0x379d4f=_0x3d0c16['slice'](0x0,_0x398935-0x1)+'…');const _0x6af0ab=a56_0x3ae1dc[_0x539dcc(0x18b)](_0x379d4f),_0x2f42b5=stringWidth(_0x379d4f),_0x499bb0='\x20'[_0x539dcc(0x273)](_0x872e4f-stringWidth(_0x379d4f)+0x2),_0x3eaa48='('+formatElapsed(_0x1042d1)+')',_0x188e9e=stringWidth(_0x3eaa48),_0x1e3665=stringWidth(_0x4fa45c),_0xa9e98a=_0x1e3665+0x1+_0x2f42b5+_0x499bb0[_0x539dcc(0x24f)],_0x342907=_0x42d77a-_0xa9e98a-_0x188e9e-0x1-0x8;let _0x584f7d=_0x5c9a55;stringWidth(_0x584f7d)>_0x342907&&(_0x584f7d=_0x584f7d['slice'](0x0,_0x342907-0x1)+'…');const _0x4f8029=_0x55fbe1+'\x20'+_0x6af0ab+_0x499bb0+_0x584f7d,_0x5e9ee5=stringWidth(_0x4f8029),_0x4c559c=_0x42d77a-_0x5e9ee5-_0x188e9e,_0x1c9196=_0x4f8029+'\x20'[_0x539dcc(0x273)](Math[_0x539dcc(0x2e8)](0x1,_0x4c559c))+a56_0x3ae1dc[_0x539dcc(0x18b)](_0x3eaa48),_0x57cacf=Math[_0x539dcc(0x327)]((_0x30192b-_0x2bfab2)/_0x1fe7a8),_0x4bc0da=Math[_0x539dcc(0x327)]((_0x371a49-_0x2bfab2)/_0x1fe7a8),_0x55dff9=Math[_0x539dcc(0x2e8)](_0x57cacf+0x1,_0x4bc0da),_0x26fd20=new Array(_0x36a169)['fill']('\x20');for(let _0x3b8c91=_0x57cacf;_0x3b8c91<Math[_0x539dcc(0x1f6)](_0x55dff9,_0x36a169);_0x3b8c91++){_0x26fd20[_0x3b8c91]='─';}const _0x446e18=_0x26fd20[_0x539dcc(0x241)](_0x3e140c=>_0x3e140c==='\x20'?'\x20':_0xef9499(_0x3e140c))[_0x539dcc(0x272)]('');_0x67ecd['push'](_0x11b0d1+'\x20'+_0x1c9196+'│'+_0x446e18+'│');}return _0x67ecd[_0x539dcc(0x272)]('\x0a');}async[a56_0x28b4c4(0x221)](_0x2e43f9,_0x285f15,_0x31dccd){const _0x18720b=a56_0x28b4c4,{options:_0x30607a,tdx:_0x2ee6a4}=_0x285f15,_0x4cad7e=_0x30607a[_0x18720b(0x1df)],{timelineRows:_0x112a22,timeAxisHeader:_0xd8b6ad}=this['generateSessionTimelineRows'](_0x2e43f9,_0x4cad7e),_0x56b740=_0x112a22[_0x18720b(0x1d8)](_0x599135=>_0x599135[_0x18720b(0x249)]);if(_0x56b740[_0x18720b(0x24f)]===0x0){const _0x4794a8=this[_0x18720b(0x1ec)](_0x2e43f9,_0x4cad7e);console[_0x18720b(0x2b0)](_0x4794a8);!_0x31dccd&&(console['error'](''),console['error'](a56_0x3ae1dc['dim'](_0x18720b(0x1e4))),console[_0x18720b(0x174)](a56_0x3ae1dc[_0x18720b(0x18b)](_0x18720b(0x1be))+'or'+a56_0x3ae1dc[_0x18720b(0x18b)](_0x18720b(0x187))));return;}_0xd8b6ad&&console[_0x18720b(0x2b0)](_0xd8b6ad);const _0x7c0997=_0x112a22[_0x18720b(0x1d8)](_0x3fa673=>_0x3fa673[_0x18720b(0x249)])['map'](_0x519455=>({'title':_0x519455['displayLine'],'value':_0x519455[_0x18720b(0x249)]})),_0x4cf904=process[_0x18720b(0x1b8)][_0x18720b(0x30c)]||0x3c,_0x166b5a=Math[_0x18720b(0x2e8)](0x28,Math[_0x18720b(0x327)](_0x4cf904*0x2/0x3)),_0x2a09f8=await a56_0x4687fd({'type':_0x18720b(0x20a),'name':_0x18720b(0x249),'message':_0x18720b(0x32e),'choices':_0x7c0997,'initial':-0x1,'limit':_0x166b5a,'clearFirst':!![],'fallback':{'title':_0x18720b(0x1f4),'value':null},'suggest':(_0x1b5c55,_0x1a5635)=>{const _0x464ecd=_0x18720b;if(!_0x1b5c55)return Promise['resolve'](_0x1a5635);const _0x46f605=_0x1a5635[_0x464ecd(0x1d8)](_0x28f01a=>{const _0xe0a047=_0x464ecd,_0x1d13af=_0x28f01a;return _0x1d13af[_0xe0a047(0x1cb)][_0xe0a047(0x2e7)]()[_0xe0a047(0x2b7)](_0x1b5c55[_0xe0a047(0x2e7)]());});return Promise[_0x464ecd(0x22c)](_0x46f605);}}),_0x452d35=()=>{const _0x380a93=_0x18720b;process[_0x380a93(0x1b8)]['write'](_0x380a93(0x268)),process[_0x380a93(0x1b8)][_0x380a93(0x21a)](_0x380a93(0x268)),process['stdout'][_0x380a93(0x21a)](_0x380a93(0x268));},_0x17fd07=_0x2a09f8&&_0x2a09f8[_0x18720b(0x249)]&&_0x2a09f8['attemptId']!==null&&_0x2a09f8['attemptId']['trim']()!=='';if(!_0x17fd07){_0x452d35(),console[_0x18720b(0x2b0)](a56_0x3ae1dc[_0x18720b(0x18b)](_0x18720b(0x334)));return;}_0x452d35();const _0x2ce873=_0x2e43f9['find'](_0x3c22c5=>_0x3c22c5[_0x18720b(0x1dd)]?.['id']===_0x2a09f8['attemptId']);if(_0x2ce873){const _0x5e1491=_0x2ce873[_0x18720b(0x1ba)]?.[_0x18720b(0x22a)]||'?',_0x4cbdb6=_0x2ce873[_0x18720b(0x2b9)]?.[_0x18720b(0x22a)]||'?';console[_0x18720b(0x2b0)](_0x18720b(0x275)+a56_0x3ae1dc[_0x18720b(0x18b)](_0x5e1491)+_0x18720b(0x1bb)+a56_0x3ae1dc['dim'](_0x4cbdb6));}const _0x4c7a0a=new WorkflowTimelineCommand();await _0x4c7a0a[_0x18720b(0x195)]({'args':[],'options':{..._0x30607a,'attemptId':_0x2a09f8['attemptId']},'tdx':_0x2ee6a4});}[a56_0x28b4c4(0x22b)](_0x4212b9,_0x51ed4b){const _0x12cec9=a56_0x28b4c4,_0x44ebe5=new Map();for(const _0x4da498 of _0x4212b9){_0x4da498['id']&&_0x4da498[_0x12cec9(0x1dd)]?.['id']&&_0x44ebe5[_0x12cec9(0x32a)](_0x4da498['id'],_0x4da498[_0x12cec9(0x1dd)]['id']);}const _0x363e20=[];let _0xe1fe51='';const _0x1f50f3=this[_0x12cec9(0x1ec)](_0x4212b9,_0x51ed4b),_0x5c8945=_0x1f50f3[_0x12cec9(0x2a3)]('\x0a');for(const _0x3fd16b of _0x5c8945){if(_0x3fd16b[_0x12cec9(0x197)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x3fd16b[_0x12cec9(0x198)](/^\s+\d{4}-\d{2}-\d{2}/))_0xe1fe51=_0x3fd16b;else{if(_0x3fd16b[_0x12cec9(0x198)](/^[✅❌🔄🛑⏳]/)){const _0x237e0b=_0x3fd16b['match'](/#(\d+)/),_0x4a72c7=_0x237e0b?_0x237e0b[0x1]:null,_0x131a0f=_0x4a72c7?_0x44ebe5[_0x12cec9(0x2f7)](_0x4a72c7)||null:null,_0x1d6026=_0x4212b9[_0x12cec9(0x2d1)](_0x29fead=>_0x29fead['id']===_0x4a72c7),_0xe6e692=_0x1d6026?.['project']?.['name']||'';_0x363e20[_0x12cec9(0x220)]({'displayLine':_0x3fd16b,'attemptId':_0x131a0f,'projectName':_0xe6e692});}}}return{'timelineRows':_0x363e20,'timeAxisHeader':_0xe1fe51};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a56_0x28b4c4(0x1f0);['description']=a56_0x28b4c4(0x182);async[a56_0x28b4c4(0x195)](_0x5b28a5){const _0x2744c2=a56_0x28b4c4,{options:_0x159a4e,args:_0x577246,tdx:_0xfa70d5}=_0x5b28a5,_0x5bf724=this['parseProjectWorkflowPattern'](_0x577246,_0x159a4e);if(!_0x5bf724)return 0x1;const {projectName:_0x21f98b,workflowName:_0x655d73}=_0x5bf724,_0x498f72=_0x159a4e[_0x2744c2(0x184)];if(_0x159a4e[_0x2744c2(0x28c)]){if(_0x21f98b&&_0x655d73)console[_0x2744c2(0x174)](_0x2744c2(0x31f)+_0x21f98b+'.'+_0x655d73);else _0x21f98b&&console['error'](_0x2744c2(0x323)+_0x21f98b);_0x498f72&&console['error'](_0x2744c2(0x284));}const _0x371608=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0xfa70d5[_0x2744c2(0x2b9)][_0x2744c2(0x261)]({'projectName':_0x21f98b,'workflowName':_0x655d73,'includeRetried':_0x498f72,'limit':_0x159a4e['limit']}),{'verbose':_0x159a4e[_0x2744c2(0x28c)]}),_0x221cbb=_0x371608[_0x2744c2(0x2c5)],_0x4b4eff=_0x159a4e['limit']||0x64,_0x261b01=_0x221cbb['length']>=_0x4b4eff?a56_0x3ae1dc[_0x2744c2(0x18b)](_0x2744c2(0x2cd)):'';console[_0x2744c2(0x174)](_0x2744c2(0x209)+_0x221cbb['length']+_0x2744c2(0x264)+(_0x221cbb[_0x2744c2(0x24f)]!==0x1?'s':'')+_0x261b01);if(_0x159a4e[_0x2744c2(0x213)]===_0x2744c2(0x25f)||_0x159a4e[_0x2744c2(0x213)]==='jsonl'||_0x159a4e[_0x2744c2(0x213)]==='table')await handleSDKOutput(_0x221cbb,_0x159a4e);else{if(_0x221cbb[_0x2744c2(0x24f)]===0x0){if(_0x21f98b&&_0x655d73)console['log'](_0x2744c2(0x224)+_0x21f98b+'.'+_0x655d73);else _0x21f98b?console[_0x2744c2(0x2b0)](_0x2744c2(0x28a)+_0x21f98b):console['log'](_0x2744c2(0x294));}else{const _0x5bf587=_0x159a4e[_0x2744c2(0x1df)],_0x30cac0=_0x221cbb['map'](_0x5371ff=>{const _0x657ca4=_0x2744c2,_0x6e5ab9=a56_0x3ae1dc[_0x657ca4(0x18b)]('#'+_0x5371ff['id']),_0x71e4d=_0x5371ff[_0x657ca4(0x1ba)]?.['id'],_0x33684b=_0x5371ff[_0x657ca4(0x322)]||_0x5371ff[_0x657ca4(0x2a4)],_0x3db3ce=_0x71e4d&&_0x33684b?hyperlink(_0x6e5ab9,getWorkflowAttemptUrl(_0x5bf587,_0x71e4d,_0x33684b,_0x5371ff['id'])):_0x6e5ab9,{icon:_0x306564,text:_0x5e55cf}=getAttemptStatusDisplay(_0x5371ff),_0x4d602c=(_0x5371ff[_0x657ca4(0x1ba)]?.[_0x657ca4(0x22a)]||'?')+'.'+(_0x5371ff['workflow']?.[_0x657ca4(0x22a)]||'?'),_0x4653f4=_0x5371ff[_0x657ca4(0x1eb)]?a56_0x3ae1dc[_0x657ca4(0x18b)](_0x5371ff[_0x657ca4(0x1eb)]):'';return(_0x3db3ce+'\x20'+_0x306564+(_0x5e55cf?'\x20'+_0x5e55cf:'')+'\x20'+_0x4d602c+'\x20'+_0x4653f4)[_0x657ca4(0x1d9)]();});await writeOutput(_0x30cac0[_0x2744c2(0x272)]('\x0a'),_0x159a4e['output'],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a56_0x28b4c4(0x22a)]=a56_0x28b4c4(0x21c);[a56_0x28b4c4(0x1ea)]=a56_0x28b4c4(0x1e1);async[a56_0x28b4c4(0x195)](_0x5364c9){const _0x40755f=a56_0x28b4c4,{options:_0x357117,args:_0x39333a,tdx:_0x5cb5ff}=_0x5364c9,_0x5b4c34=_0x39333a[0x0];if(!_0x5b4c34)return console[_0x40755f(0x174)](_0x40755f(0x1fc)),0x1;_0x357117[_0x40755f(0x28c)]&&console[_0x40755f(0x174)]('Attempt\x20ID:\x20'+_0x5b4c34);const _0x468780=await withSpinner(_0x40755f(0x2a0),()=>_0x5cb5ff['workflow']['attempt'](_0x5b4c34),{'verbose':_0x357117['verbose']}),_0x400928=_0x468780['data'];let _0x1159c3;!_0x400928['done']?_0x1159c3=_0x400928[_0x40755f(0x340)]?_0x40755f(0x1e7):_0x40755f(0x349):_0x1159c3=_0x400928[_0x40755f(0x244)]?_0x40755f(0x244):'error';let _0x5b4560;if(_0x400928[_0x40755f(0x2bb)]&&_0x400928[_0x40755f(0x1c4)]){const _0x535a3f=new Date(_0x400928['createdAt'])[_0x40755f(0x331)](),_0xa3f0e7=new Date(_0x400928['finishedAt'])[_0x40755f(0x331)]();_0x5b4560=Math[_0x40755f(0x2ec)]((_0xa3f0e7-_0x535a3f)/0x3e8);}const _0x14f22a={'attempt_id':_0x400928['id'],'status':_0x1159c3,..._0x400928[_0x40755f(0x2d7)]!==undefined&&{'index':_0x400928['index']},..._0x400928[_0x40755f(0x1ba)]&&{'project':_0x400928[_0x40755f(0x1ba)]['name']},..._0x400928[_0x40755f(0x2b9)]&&{'workflow':_0x400928[_0x40755f(0x2b9)]['name']},..._0x400928[_0x40755f(0x2a4)]&&{'session_id':_0x400928[_0x40755f(0x2a4)]},..._0x400928[_0x40755f(0x1eb)]&&{'session_time':_0x400928[_0x40755f(0x1eb)]},..._0x400928[_0x40755f(0x2be)]&&{'retry_attempt':_0x400928[_0x40755f(0x2be)]},..._0x5b4560!==undefined&&{'duration_sec':_0x5b4560},..._0x400928[_0x40755f(0x2bb)]&&{'created_at':_0x400928['createdAt']},..._0x400928[_0x40755f(0x1c4)]&&{'finished_at':_0x400928[_0x40755f(0x1c4)]},...Object['keys'](_0x400928[_0x40755f(0x253)])[_0x40755f(0x24f)]>0x0&&{'params':_0x400928[_0x40755f(0x253)]}};return await handleSingleObjectOutput(_0x14f22a,_0x357117),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a56_0x28b4c4(0x22a)]='workflow:tasks';[a56_0x28b4c4(0x1ea)]=a56_0x28b4c4(0x321);async[a56_0x28b4c4(0x195)](_0x4bc8d3){const _0x1c1e17=a56_0x28b4c4,{options:_0x364ff4,args:_0x595c19,tdx:_0x3bc6d}=_0x4bc8d3,_0x14c76c=_0x595c19[0x0];if(!_0x14c76c)return console[_0x1c1e17(0x174)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x447dad=_0x364ff4[_0x1c1e17(0x205)];_0x364ff4['verbose']&&(console[_0x1c1e17(0x174)](_0x1c1e17(0x225)+_0x14c76c),_0x447dad&&console[_0x1c1e17(0x174)](_0x1c1e17(0x23c)));const _0x19ae84=await withSpinner(_0x1c1e17(0x2cc),()=>_0x3bc6d[_0x1c1e17(0x2b9)][_0x1c1e17(0x210)](_0x14c76c,_0x447dad||![]),{'verbose':_0x364ff4[_0x1c1e17(0x28c)]}),_0x10bf42=_0x19ae84[_0x1c1e17(0x2c5)];return console[_0x1c1e17(0x174)]('✔\x20Found\x20'+_0x10bf42[_0x1c1e17(0x24f)]+_0x1c1e17(0x252)+(_0x10bf42[_0x1c1e17(0x24f)]!==0x1?'s':'')),await handleSDKOutput(_0x10bf42,_0x364ff4),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a56_0x28b4c4(0x22a)]='workflow:logs';[a56_0x28b4c4(0x1ea)]=a56_0x28b4c4(0x24d);async['execute'](_0x2c2cd8){const _0x9dd777=a56_0x28b4c4,{options:_0x357fa4,args:_0x1fee96,tdx:_0x342b96}=_0x2c2cd8,_0x2d3694=_0x1fee96[0x0];let _0x58c4db=_0x1fee96[0x1];if(!_0x2d3694)return console[_0x9dd777(0x174)](_0x9dd777(0x1fc)),0x1;_0x357fa4[_0x9dd777(0x28c)]&&(console[_0x9dd777(0x174)](_0x9dd777(0x225)+_0x2d3694),_0x58c4db&&console[_0x9dd777(0x174)](_0x9dd777(0x255)+_0x58c4db));const _0x447aa6=await withSpinner(_0x9dd777(0x22f),()=>_0x342b96[_0x9dd777(0x2b9)][_0x9dd777(0x266)](_0x2d3694,_0x58c4db),{'verbose':_0x357fa4[_0x9dd777(0x28c)]}),_0x7c7e7d=_0x447aa6[_0x9dd777(0x2c5)];if(_0x7c7e7d[_0x9dd777(0x24f)]===0x0)return console['error'](_0x9dd777(0x29d)),0x0;if(!_0x58c4db&&(_0x357fa4[_0x9dd777(0x25f)]||_0x357fa4[_0x9dd777(0x213)]))return await handleSDKOutput(_0x7c7e7d,_0x357fa4),0x0;if(!_0x58c4db){const _0x56504d=_0x7c7e7d[_0x9dd777(0x241)](_0x55ffeb=>({'title':_0x55ffeb[_0x9dd777(0x186)]+'\x20('+formatBytes(_0x55ffeb[_0x9dd777(0x1a9)])+')','value':_0x55ffeb[_0x9dd777(0x186)]})),_0x4776f3=await a56_0x4687fd({'type':_0x9dd777(0x1d6),'name':'task','message':_0x9dd777(0x2b5),'choices':_0x56504d});if(!_0x4776f3[_0x9dd777(0x287)])return console[_0x9dd777(0x174)](_0x9dd777(0x334)),0x0;_0x58c4db=_0x4776f3[_0x9dd777(0x287)];}const _0x2f42f8=await withSpinner(_0x9dd777(0x18e),()=>_0x342b96['workflow'][_0x9dd777(0x22d)](_0x2d3694,_0x58c4db),{'verbose':_0x357fa4['verbose']}),_0x234e91=_0x2f42f8[_0x9dd777(0x2c5)];return _0x234e91?console['log'](_0x234e91):console[_0x9dd777(0x174)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a56_0x28b4c4(0x22a)]=a56_0x28b4c4(0x2ea);[a56_0x28b4c4(0x1ea)]='Kill\x20a\x20running\x20attempt';async[a56_0x28b4c4(0x195)](_0x25bcfa){const _0x46b925=a56_0x28b4c4,{options:_0x5eb956,args:_0x174713,tdx:_0x4d4791}=_0x25bcfa,_0x2ff5a7=_0x174713[0x0];if(!_0x2ff5a7)return console['error'](_0x46b925(0x1fc)),0x1;const _0x1450e0=_0x5eb956[_0x46b925(0x172)];_0x5eb956[_0x46b925(0x28c)]&&(console[_0x46b925(0x174)](_0x46b925(0x225)+_0x2ff5a7),_0x1450e0&&console[_0x46b925(0x174)](_0x46b925(0x191)+_0x1450e0));if(!_0x5eb956['yes']){if(!isInteractive())return console[_0x46b925(0x174)](a56_0x3ae1dc[_0x46b925(0x31c)](_0x46b925(0x1bd)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x46b925(0x174)](a56_0x3ae1dc['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1a6766=await confirmKey(_0x46b925(0x2c7)+_0x2ff5a7+'?');if(!_0x1a6766)return console[_0x46b925(0x174)](a56_0x3ae1dc[_0x46b925(0x2df)](_0x46b925(0x334))),0x1;}const _0xc37a9b=await withSpinner('Killing\x20attempt...',()=>_0x4d4791['workflow'][_0x46b925(0x20b)](_0x2ff5a7,_0x1450e0),{'verbose':_0x5eb956[_0x46b925(0x28c)]}),_0x427aff=_0xc37a9b[_0x46b925(0x2c5)];return console[_0x46b925(0x174)]('✔\x20'+_0x427aff),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a56_0x28b4c4(0x22a)]='workflow:retry';[a56_0x28b4c4(0x1ea)]=a56_0x28b4c4(0x217);async[a56_0x28b4c4(0x195)](_0x1b94f2){const _0x1e8f85=a56_0x28b4c4,{options:_0x11b936,args:_0x5599b9,tdx:_0x5dcfdc}=_0x1b94f2,_0x1575e5=_0x5599b9[0x0];if(!_0x1575e5)return console[_0x1e8f85(0x174)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x1e8f85(0x174)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x3f28a3=![],_0x48d3d8=_0x1575e5;if(_0x1575e5['startsWith']('session:'))_0x3f28a3=!![],_0x48d3d8=_0x1575e5['substring'](0x8);else{if(_0x1575e5[_0x1e8f85(0x197)](_0x1e8f85(0x2fd)))_0x3f28a3=![],_0x48d3d8=_0x1575e5['substring'](0x8);else return console['error'](_0x1e8f85(0x336)),console['error'](_0x1e8f85(0x1f8)),0x1;}const _0x1f121e=_0x11b936[_0x1e8f85(0x33e)],_0x468c94=_0x11b936[_0x1e8f85(0x176)],_0x3f6677=_0x11b936[_0x1e8f85(0x253)],_0x8c4187=_0x11b936[_0x1e8f85(0x232)];_0x11b936[_0x1e8f85(0x28c)]&&(console[_0x1e8f85(0x174)](_0x1e8f85(0x1a5)+(_0x3f28a3?'session':'attempt')+'\x20'+_0x48d3d8),_0x1f121e&&console[_0x1e8f85(0x174)](_0x1e8f85(0x306)+_0x1f121e),_0x468c94&&console[_0x1e8f85(0x174)](_0x1e8f85(0x27f)+_0x468c94),_0x3f6677&&console[_0x1e8f85(0x174)](_0x1e8f85(0x265)+_0x3f6677),_0x8c4187&&console['error'](_0x1e8f85(0x2c0)));let _0x4aa892;if(_0x3f6677)try{if(_0x3f6677[_0x1e8f85(0x197)]('@')){const _0x30959b=await import(_0x1e8f85(0x219)),_0x27aa96=_0x3f6677[_0x1e8f85(0x24b)](0x1),_0xee191c=await _0x30959b[_0x1e8f85(0x206)](_0x27aa96,_0x1e8f85(0x203));_0x4aa892=JSON[_0x1e8f85(0x2fb)](_0xee191c);}else _0x4aa892=JSON[_0x1e8f85(0x2fb)](_0x3f6677);}catch{return console[_0x1e8f85(0x174)](_0x1e8f85(0x308)),0x1;}if(!_0x11b936[_0x1e8f85(0x2ae)]){if(!isInteractive())return console[_0x1e8f85(0x174)](a56_0x3ae1dc[_0x1e8f85(0x31c)](_0x1e8f85(0x1bd)),_0x1e8f85(0x1f9)),console[_0x1e8f85(0x174)](a56_0x3ae1dc[_0x1e8f85(0x18b)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x59dfb0=await confirmKey(_0x1e8f85(0x307)+(_0x3f28a3?'session':_0x1e8f85(0x32c))+'\x20'+_0x48d3d8+'?');if(!_0x59dfb0)return console[_0x1e8f85(0x174)](a56_0x3ae1dc['yellow'](_0x1e8f85(0x334))),0x1;}let _0x3a54d8;_0x3f28a3?_0x3a54d8=await withSpinner(_0x1e8f85(0x227),()=>_0x5dcfdc[_0x1e8f85(0x2b9)]['retrySession'](_0x48d3d8,{'fromTask':_0x1f121e,'retryParams':_0x4aa892}),{'verbose':_0x11b936[_0x1e8f85(0x28c)]}):_0x3a54d8=await withSpinner(_0x1e8f85(0x1ce),()=>_0x5dcfdc[_0x1e8f85(0x2b9)][_0x1e8f85(0x1c0)](_0x48d3d8,{'resumeFrom':_0x468c94,'retryParams':_0x4aa892,'force':_0x8c4187}),{'verbose':_0x11b936[_0x1e8f85(0x28c)]});const _0x40e379=_0x3a54d8[_0x1e8f85(0x2c5)];return console['error']('✔\x20Retry\x20started'),console[_0x1e8f85(0x174)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x40e379[_0x1e8f85(0x249)]),console[_0x1e8f85(0x174)](_0x1e8f85(0x289)+_0x40e379[_0x1e8f85(0x2a4)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a56_0x28b4c4(0x22a)]=a56_0x28b4c4(0x333);[a56_0x28b4c4(0x1ea)]=a56_0x28b4c4(0x1ee);async[a56_0x28b4c4(0x195)](_0x472b37){const _0x1d7bc4=a56_0x28b4c4,{options:_0x16613d,args:_0x442453,tdx:_0x409181}=_0x472b37;let _0x359bbb=_0x442453[0x0];if(!_0x359bbb){const _0x57e98a=this[_0x1d7bc4(0x222)]([],_0x16613d),_0x1fa309=await withSpinner(_0x1d7bc4(0x26c),()=>_0x409181[_0x1d7bc4(0x2b9)]['workflows'](_0x57e98a,{'limit':_0x16613d[_0x1d7bc4(0x1b3)]}),{'verbose':_0x16613d[_0x1d7bc4(0x28c)]}),_0x3903f4=_0x1fa309[_0x1d7bc4(0x2c5)];if(_0x3903f4[_0x1d7bc4(0x24f)]===0x0)return console[_0x1d7bc4(0x174)](_0x1d7bc4(0x29b)),!_0x57e98a&&console[_0x1d7bc4(0x174)](a56_0x3ae1dc['dim'](_0x1d7bc4(0x2a8))),0x1;const _0x49b203=_0x3903f4[_0x1d7bc4(0x241)](_0x4ff642=>({'title':_0x4ff642[_0x1d7bc4(0x1ba)]?.[_0x1d7bc4(0x22a)]+'.'+_0x4ff642[_0x1d7bc4(0x22a)],'value':_0x4ff642[_0x1d7bc4(0x1ba)]?.['name']+'.'+_0x4ff642[_0x1d7bc4(0x22a)],'description':_0x4ff642['revision']?_0x1d7bc4(0x183)+_0x4ff642[_0x1d7bc4(0x344)]:undefined})),_0x322631=await a56_0x4687fd({'type':_0x1d7bc4(0x1d6),'name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x49b203});if(!_0x322631[_0x1d7bc4(0x2b9)])return 0x1;_0x359bbb=_0x322631[_0x1d7bc4(0x2b9)];}if(!_0x359bbb[_0x1d7bc4(0x2b7)]('.')){const _0x2176a7=this[_0x1d7bc4(0x222)]([],_0x16613d);if(_0x2176a7)_0x359bbb=_0x2176a7+'.'+_0x359bbb;else return console['error'](a56_0x3ae1dc[_0x1d7bc4(0x31c)]('Error:'),_0x1d7bc4(0x291)),console['error'](a56_0x3ae1dc[_0x1d7bc4(0x18b)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x52bc8b=_0x16613d[_0x1d7bc4(0x246)],_0x1335b2=_0x16613d['sessionTime'],_0x1732b8={};if(_0x52bc8b&&Array[_0x1d7bc4(0x343)](_0x52bc8b))for(const _0x2cec60 of _0x52bc8b){const _0x166915=_0x2cec60['indexOf']('=');if(_0x166915===-0x1)return console[_0x1d7bc4(0x174)](_0x1d7bc4(0x2b2)+_0x2cec60),console[_0x1d7bc4(0x174)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x2dfd3e=_0x2cec60[_0x1d7bc4(0x24b)](0x0,_0x166915),_0x202466=_0x2cec60['substring'](_0x166915+0x1);try{_0x1732b8[_0x2dfd3e]=JSON[_0x1d7bc4(0x2fb)](_0x202466);}catch{_0x1732b8[_0x2dfd3e]=_0x202466;}}_0x16613d[_0x1d7bc4(0x28c)]&&(console[_0x1d7bc4(0x174)](_0x1d7bc4(0x2e1)+_0x359bbb),Object[_0x1d7bc4(0x263)](_0x1732b8)[_0x1d7bc4(0x24f)]>0x0&&console[_0x1d7bc4(0x174)](_0x1d7bc4(0x302)+JSON['stringify'](_0x1732b8)),_0x1335b2&&console[_0x1d7bc4(0x174)]('Session\x20time:\x20'+_0x1335b2));if(_0x16613d[_0x1d7bc4(0x30d)])return await this[_0x1d7bc4(0x271)](_0x472b37,_0x359bbb,_0x1732b8,_0x1335b2);const _0x419a21=await withSpinner(_0x1d7bc4(0x2b1),()=>_0x409181[_0x1d7bc4(0x2b9)][_0x1d7bc4(0x17c)](_0x359bbb,_0x1732b8,{'sessionTime':_0x1335b2}),{'verbose':_0x16613d[_0x1d7bc4(0x28c)]}),_0x45e24c=_0x419a21[_0x1d7bc4(0x2c5)];console[_0x1d7bc4(0x174)]('✔\x20Workflow\x20run\x20started'),console[_0x1d7bc4(0x174)](_0x1d7bc4(0x214)+_0x45e24c['id']),console[_0x1d7bc4(0x174)](_0x1d7bc4(0x289)+_0x45e24c[_0x1d7bc4(0x2a4)]),console[_0x1d7bc4(0x174)](_0x1d7bc4(0x199)+_0x45e24c[_0x1d7bc4(0x1ba)]?.[_0x1d7bc4(0x22a)]),console[_0x1d7bc4(0x174)](_0x1d7bc4(0x19d)+_0x45e24c['workflow']?.[_0x1d7bc4(0x22a)]);if(_0x45e24c[_0x1d7bc4(0x1ba)]?.['id']&&_0x45e24c[_0x1d7bc4(0x2a4)]&&_0x45e24c['id']){const _0x27af43=_0x16613d[_0x1d7bc4(0x1df)],_0x23ec53=getConsoleUrl(_0x27af43,_0x1d7bc4(0x233)+_0x45e24c[_0x1d7bc4(0x1ba)]['id']+_0x1d7bc4(0x1db)+_0x45e24c['sessionId']+'/attempt/'+_0x45e24c['id']);console[_0x1d7bc4(0x174)](_0x1d7bc4(0x2c6)+a56_0x3ae1dc['cyan'](_0x23ec53));}return 0x0;}async[a56_0x28b4c4(0x271)](_0x335a25,_0x57e045,_0x36bd6e,_0x3fcd1e){const _0x31e75f=a56_0x28b4c4,{options:_0x30dfca,tdx:_0x540731}=_0x335a25,_0x4a2bfa=await withSpinner(_0x31e75f(0x25e)+_0x57e045+_0x31e75f(0x1d5),()=>_0x540731[_0x31e75f(0x2b9)]['getWorkflow'](_0x57e045),{'verbose':_0x30dfca[_0x31e75f(0x28c)]}),_0x374a01=_0x4a2bfa[_0x31e75f(0x2c5)],_0x5ae571=_0x3fcd1e??new Date()['toISOString']();console[_0x31e75f(0x2b0)](a56_0x3ae1dc[_0x31e75f(0x1cd)](_0x31e75f(0x335)),_0x57e045),console[_0x31e75f(0x2b0)](a56_0x3ae1dc[_0x31e75f(0x1cd)]('Session\x20time:'),_0x5ae571),console['log'](a56_0x3ae1dc['bold'](_0x31e75f(0x223)),JSON['stringify'](_0x36bd6e)),console['log'](''),console[_0x31e75f(0x2b0)](a56_0x3ae1dc['bold'](_0x31e75f(0x185)));const _0x18e883=parseTaskGraph(_0x374a01[_0x31e75f(0x18c)]??null);if(_0x18e883[_0x31e75f(0x24f)]===0x0)console[_0x31e75f(0x2b0)](a56_0x3ae1dc[_0x31e75f(0x18b)]('\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)'));else for(const _0x170d6a of formatTaskGraph(_0x18e883)){console[_0x31e75f(0x2b0)](_0x170d6a);}const _0x663318=summarizeTaskGraph(_0x18e883),_0x1bc672=formatWarningSummary(_0x663318);return _0x1bc672&&(console[_0x31e75f(0x2b0)](''),console[_0x31e75f(0x2b0)](a56_0x3ae1dc[_0x31e75f(0x2df)](_0x1bc672))),console[_0x31e75f(0x2b0)](a56_0x3ae1dc[_0x31e75f(0x2df)]('\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.')),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']='workflow:download';['description']=a56_0x28b4c4(0x1bf);async[a56_0x28b4c4(0x195)](_0x397837){const _0x5c4357=a56_0x28b4c4,{options:_0x2ba471,args:_0x1f43e7,tdx:_0x187701}=_0x397837,_0x279831=_0x1f43e7[0x0],_0x592079=_0x1f43e7[0x1]||'.';if(!_0x279831)return console[_0x5c4357(0x174)](_0x5c4357(0x274)),console[_0x5c4357(0x174)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0xed3d2b=_0x2ba471[_0x5c4357(0x344)];_0x2ba471[_0x5c4357(0x28c)]&&(console[_0x5c4357(0x174)](_0x5c4357(0x275)+_0x279831),console[_0x5c4357(0x174)]('Output\x20directory:\x20'+_0x592079),_0xed3d2b&&console[_0x5c4357(0x174)](_0x5c4357(0x2a7)+_0xed3d2b));const _0x4b2af6=await withSpinner(_0x5c4357(0x2bf)+_0x279831+_0x5c4357(0x1d5),()=>_0x187701[_0x5c4357(0x2b9)][_0x5c4357(0x1a8)](_0x279831,_0x592079,{'revision':_0xed3d2b}),{'verbose':_0x2ba471[_0x5c4357(0x28c)]}),_0x585447=_0x4b2af6[_0x5c4357(0x2c5)];return console[_0x5c4357(0x174)]('✔\x20Downloaded\x20'+_0x585447[_0x5c4357(0x2c2)]),console[_0x5c4357(0x174)]('\x20\x20Revision:\x20'+_0x585447[_0x5c4357(0x344)]),console[_0x5c4357(0x174)]('\x20\x20Files\x20extracted:\x20'+_0x585447[_0x5c4357(0x1e3)]),console[_0x5c4357(0x174)](_0x5c4357(0x17d)+_0x592079+'/'+_0x585447[_0x5c4357(0x2c2)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a56_0x28b4c4(0x22a)]=a56_0x28b4c4(0x26b);[a56_0x28b4c4(0x1ea)]=a56_0x28b4c4(0x1bc);async[a56_0x28b4c4(0x195)](_0x3b4c96){const _0x4db276=a56_0x28b4c4,{options:_0x374177,args:_0x307c89,tdx:_0x8dd8d8}=_0x3b4c96;let _0x1f6429='.',_0x233542=_0x374177[_0x4db276(0x22a)];if(_0x307c89[0x0]){const {promises:_0x3c0117}=await import('fs');try{const _0x39829b=await _0x3c0117[_0x4db276(0x243)](_0x307c89[0x0]);if(_0x39829b['isDirectory']())_0x1f6429=_0x307c89[0x0];else return console[_0x4db276(0x174)](_0x4db276(0x196)+_0x307c89[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x233542=_0x307c89[0x0],_0x1f6429='.';}}const _0x5c0243=_0x374177[_0x4db276(0x344)],_0xff7d6d=_0x374177['skipValidation'];_0x374177[_0x4db276(0x28c)]&&(console[_0x4db276(0x174)](_0x4db276(0x235)+_0x1f6429),_0x233542&&console[_0x4db276(0x174)]('Project\x20name:\x20'+_0x233542),_0x5c0243&&console[_0x4db276(0x174)](_0x4db276(0x2a7)+_0x5c0243),_0xff7d6d&&console['error'](_0x4db276(0x228)));const _0x38acca=await withSpinner(_0x4db276(0x290),()=>_0x8dd8d8[_0x4db276(0x2b9)]['push'](_0x1f6429,{'projectName':_0x233542,'revision':_0x5c0243,'skipValidation':_0xff7d6d}),{'verbose':_0x374177[_0x4db276(0x28c)]}),_0x4309b5=_0x38acca['data'];return console[_0x4db276(0x174)](_0x4db276(0x2db)+_0x4309b5[_0x4db276(0x2c2)]),console[_0x4db276(0x174)]('\x20\x20Project\x20ID:\x20'+_0x4309b5[_0x4db276(0x2f0)]),console[_0x4db276(0x174)](_0x4db276(0x2ac)+_0x4309b5['revision']),await this[_0x4db276(0x2fe)](_0x8dd8d8,_0x4309b5['projectName'],_0x374177[_0x4db276(0x1df)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a56_0x28b4c4(0x22a)]=a56_0x28b4c4(0x2bc);[a56_0x28b4c4(0x1ea)]=a56_0x28b4c4(0x1a3);async['execute'](_0x31c0fc){const _0x1b6c26=a56_0x28b4c4,{options:_0x28853b,args:_0x4ad01e,tdx:_0x39696a}=_0x31c0fc,_0x385d75=_0x4ad01e[0x0],_0x59da65=_0x4ad01e[0x1];if(!_0x385d75)return console['error'](a56_0x3ae1dc[_0x1b6c26(0x31c)](_0x1b6c26(0x31e)),_0x1b6c26(0x215)),console[_0x1b6c26(0x174)](a56_0x3ae1dc[_0x1b6c26(0x18b)](_0x1b6c26(0x2d8))),0x1;const _0x35893c=_0x28853b[_0x1b6c26(0x344)];_0x28853b[_0x1b6c26(0x28c)]&&(console[_0x1b6c26(0x174)]('Project:\x20'+_0x385d75),_0x59da65&&console[_0x1b6c26(0x174)](_0x1b6c26(0x2d2)+_0x59da65),_0x35893c&&console['error'](_0x1b6c26(0x2a7)+_0x35893c),_0x28853b['dryRun']&&console['error'](_0x1b6c26(0x1e6)));const _0x36da3e=await withSpinner(_0x1b6c26(0x298)+_0x385d75+_0x1b6c26(0x1d5),()=>_0x39696a[_0x1b6c26(0x2b9)]['pullProject'](_0x385d75,{'targetDir':_0x59da65,'revision':_0x35893c}),{'verbose':_0x28853b['verbose']}),_0x3ffa9b=_0x36da3e['data'];_0x3ffa9b[_0x1b6c26(0x28f)]?console['error'](_0x1b6c26(0x2ab)+_0x3ffa9b[_0x1b6c26(0x2c2)]):console[_0x1b6c26(0x174)](_0x1b6c26(0x345)+_0x3ffa9b[_0x1b6c26(0x2c2)]);console[_0x1b6c26(0x174)]('\x20\x20Revision:\x20'+_0x3ffa9b[_0x1b6c26(0x344)]),console[_0x1b6c26(0x174)]('\x20\x20Target:\x20'+(a56_0x49ff99[_0x1b6c26(0x1ac)](process[_0x1b6c26(0x278)](),_0x3ffa9b[_0x1b6c26(0x25d)])||'.')),console[_0x1b6c26(0x174)]('\x20\x20Changes:\x20'+a56_0x3ae1dc[_0x1b6c26(0x258)]('+'+_0x3ffa9b[_0x1b6c26(0x230)][_0x1b6c26(0x318)]+_0x1b6c26(0x254))+',\x20'+(a56_0x3ae1dc[_0x1b6c26(0x2df)]('~'+_0x3ffa9b[_0x1b6c26(0x230)]['modified']+_0x1b6c26(0x22e))+',\x20')+(a56_0x3ae1dc['red']('-'+_0x3ffa9b[_0x1b6c26(0x230)][_0x1b6c26(0x30f)]+_0x1b6c26(0x2ee))+',\x20')+(''+a56_0x3ae1dc[_0x1b6c26(0x18b)](_0x3ffa9b[_0x1b6c26(0x230)][_0x1b6c26(0x26a)]+'\x20unchanged')));for(const _0x2e39fb of _0x3ffa9b[_0x1b6c26(0x1b0)]){_0x2e39fb[_0x1b6c26(0x310)]===_0x1b6c26(0x299)&&_0x2e39fb[_0x1b6c26(0x2dc)]&&(console[_0x1b6c26(0x174)]('\x0a'+a56_0x3ae1dc['cyan'](_0x1b6c26(0x312)+_0x2e39fb[_0x1b6c26(0x181)])),console[_0x1b6c26(0x174)](_0x2e39fb[_0x1b6c26(0x2dc)]));}if(!_0x3ffa9b['hasChanges'])return saveSessionContext({'workflow_project':_0x3ffa9b[_0x1b6c26(0x2c2)]},_0x28853b[_0x1b6c26(0x295)]),console[_0x1b6c26(0x174)](a56_0x3ae1dc[_0x1b6c26(0x258)](_0x1b6c26(0x27c))),console['error'](a56_0x3ae1dc['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x3ffa9b['projectName'])),0x0;if(_0x28853b[_0x1b6c26(0x30d)])return console['error'](a56_0x3ae1dc[_0x1b6c26(0x2df)](_0x1b6c26(0x2d0))),0x0;if(!_0x28853b[_0x1b6c26(0x2ae)]){if(!isInteractive())return console[_0x1b6c26(0x174)](a56_0x3ae1dc[_0x1b6c26(0x31c)](_0x1b6c26(0x1bd)),_0x1b6c26(0x1f9)),console['error'](a56_0x3ae1dc[_0x1b6c26(0x18b)](_0x1b6c26(0x2f4))),0x1;const _0x160e53=await confirmKey(_0x1b6c26(0x1f5));if(!_0x160e53)return console[_0x1b6c26(0x174)](a56_0x3ae1dc['yellow']('Cancelled'),_0x1b6c26(0x1b9)),0x1;}await withSpinner('Writing\x20files...',()=>_0x39696a['workflow'][_0x1b6c26(0x1cc)](_0x3ffa9b,{'revision':_0x35893c}),{'verbose':_0x28853b[_0x1b6c26(0x28c)]}),saveSessionContext({'workflow_project':_0x3ffa9b[_0x1b6c26(0x2c2)]},_0x28853b[_0x1b6c26(0x295)]),console[_0x1b6c26(0x174)](a56_0x3ae1dc[_0x1b6c26(0x258)]('✔\x20Pull\x20complete'));const _0x5531e2=a56_0x49ff99[_0x1b6c26(0x1ac)](process[_0x1b6c26(0x278)](),_0x3ffa9b['targetDir'])||'.';return console[_0x1b6c26(0x174)](a56_0x3ae1dc[_0x1b6c26(0x18b)](_0x1b6c26(0x17d)+_0x5531e2)),console[_0x1b6c26(0x174)](a56_0x3ae1dc[_0x1b6c26(0x18b)](_0x1b6c26(0x1d4)+_0x3ffa9b[_0x1b6c26(0x2c2)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a56_0x28b4c4(0x22a)]=a56_0x28b4c4(0x316);[a56_0x28b4c4(0x1ea)]=a56_0x28b4c4(0x19b);async[a56_0x28b4c4(0x195)](_0x35c5d3){const _0x38413e=a56_0x28b4c4,{options:_0x1bda70,args:_0x32eeed,tdx:_0xe244a5}=_0x35c5d3,_0x2f4377=this[_0x38413e(0x2f3)](_0x32eeed,_0x1bda70),_0x31bee1=_0x1bda70,{revision:_0x2eda97,skipValidation:_0x34f414,backfill:_0x54ade9}=_0x31bee1,_0x5659be=_0x54ade9===undefined?undefined:!_0x54ade9;_0x1bda70[_0x38413e(0x28c)]&&(_0x2f4377&&console[_0x38413e(0x174)](_0x38413e(0x300)+_0x2f4377),_0x2eda97&&console[_0x38413e(0x174)]('Revision:\x20'+_0x2eda97),_0x1bda70[_0x38413e(0x30d)]&&console[_0x38413e(0x174)]('Dry\x20run:\x20yes'),_0x34f414&&console['error'](_0x38413e(0x228)),_0x54ade9&&console[_0x38413e(0x174)](_0x38413e(0x31b)));let _0x286fd1;try{_0x286fd1=await withSpinner(_0x38413e(0x2ed),()=>_0xe244a5['workflow']['preparePushProject']({'sourceDir':_0x2f4377,'revision':_0x2eda97,'skipValidation':_0x34f414,'skipSchedule':_0x5659be}),{'verbose':_0x1bda70[_0x38413e(0x28c)]});}catch(_0x58f158){if(_0x58f158 instanceof Error&&_0x58f158[_0x38413e(0x27e)]['includes']('No\x20workflow\x20tdx.json\x20found'))return console[_0x38413e(0x174)](a56_0x3ae1dc[_0x38413e(0x31c)](_0x38413e(0x31e)),_0x38413e(0x212)),_0x1bda70[_0x38413e(0x280)]?console['error'](a56_0x3ae1dc['dim'](_0x38413e(0x325)+_0x1bda70['workflowProject']+_0x38413e(0x248)+_0x1bda70['workflowProject']+'\x27')):console[_0x38413e(0x174)](a56_0x3ae1dc[_0x38413e(0x18b)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x58f158;}const _0x202869=_0x286fd1[_0x38413e(0x2c5)];console[_0x38413e(0x174)](_0x38413e(0x250)+_0x202869[_0x38413e(0x2c2)]),console[_0x38413e(0x174)](_0x38413e(0x1d3)+_0x202869[_0x38413e(0x348)]),console[_0x38413e(0x174)](_0x38413e(0x2ac)+_0x202869['revision']),console[_0x38413e(0x174)]('\x20\x20Changes:\x20'+a56_0x3ae1dc['green']('+'+_0x202869['summary'][_0x38413e(0x318)]+_0x38413e(0x254))+',\x20'+(a56_0x3ae1dc['yellow']('~'+_0x202869[_0x38413e(0x230)][_0x38413e(0x299)]+'\x20modified')+',\x20')+(a56_0x3ae1dc['red']('-'+_0x202869[_0x38413e(0x230)][_0x38413e(0x30f)]+'\x20deleted')+',\x20')+(''+a56_0x3ae1dc[_0x38413e(0x18b)](_0x202869['summary'][_0x38413e(0x26a)]+'\x20unchanged')));for(const _0x2c14a4 of _0x202869[_0x38413e(0x1b0)]){_0x2c14a4[_0x38413e(0x310)]===_0x38413e(0x299)&&_0x2c14a4[_0x38413e(0x2dc)]&&(console[_0x38413e(0x174)]('\x0a'+a56_0x3ae1dc[_0x38413e(0x218)](_0x38413e(0x312)+_0x2c14a4[_0x38413e(0x181)])),console[_0x38413e(0x174)](_0x2c14a4[_0x38413e(0x2dc)]));}if(!_0x202869[_0x38413e(0x2d9)])return console[_0x38413e(0x174)](a56_0x3ae1dc[_0x38413e(0x258)](_0x38413e(0x259))),await this[_0x38413e(0x2fe)](_0xe244a5,_0x202869[_0x38413e(0x2c2)],_0x1bda70[_0x38413e(0x1df)]),0x0;if(_0x1bda70[_0x38413e(0x30d)])return console[_0x38413e(0x174)](a56_0x3ae1dc['yellow'](_0x38413e(0x237))),0x0;if(!_0x1bda70['yes']){if(!isInteractive())return console[_0x38413e(0x174)](a56_0x3ae1dc[_0x38413e(0x31c)](_0x38413e(0x1bd)),_0x38413e(0x1f9)),console['error'](a56_0x3ae1dc[_0x38413e(0x18b)](_0x38413e(0x2f4))),0x1;const _0x1e2337=await confirmKey(_0x38413e(0x2ce));if(!_0x1e2337)return console[_0x38413e(0x174)](a56_0x3ae1dc[_0x38413e(0x2df)](_0x38413e(0x334)),_0x38413e(0x2da)),0x1;}const _0x59628e=await withSpinner(_0x38413e(0x330),()=>_0xe244a5[_0x38413e(0x2b9)][_0x38413e(0x1e9)](_0x202869),{'verbose':_0x1bda70[_0x38413e(0x28c)]}),_0x5148ca=_0x59628e['data'];return console[_0x38413e(0x174)](a56_0x3ae1dc['green']('✔\x20Push\x20complete')),console[_0x38413e(0x174)](_0x38413e(0x26f)+_0x5148ca[_0x38413e(0x2f0)]),console[_0x38413e(0x174)]('\x20\x20Revision:\x20'+_0x5148ca[_0x38413e(0x344)]),await this['showWorkflowConsoleUrl'](_0xe244a5,_0x5148ca[_0x38413e(0x2c2)],_0x1bda70[_0x38413e(0x1df)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a56_0x28b4c4(0x22a)]=a56_0x28b4c4(0x303);['description']=a56_0x28b4c4(0x2ef);async[a56_0x28b4c4(0x195)](_0xe06761){const _0x5ade58=a56_0x28b4c4,{options:_0x20dd5f,args:_0x12a939,tdx:_0x20eb3d}=_0xe06761,_0x360d65=this[_0x5ade58(0x2f3)](_0x12a939,_0x20dd5f),_0x384959=_0x20dd5f['name'],_0x127725=_0x20dd5f[_0x5ade58(0x344)],_0xbc58e5=_0x20dd5f[_0x5ade58(0x245)];if(!_0x360d65)return console[_0x5ade58(0x174)](a56_0x3ae1dc[_0x5ade58(0x31c)](_0x5ade58(0x31e)),_0x5ade58(0x24a)),console[_0x5ade58(0x174)](a56_0x3ae1dc[_0x5ade58(0x18b)](_0x5ade58(0x1b4))),console[_0x5ade58(0x174)](a56_0x3ae1dc[_0x5ade58(0x18b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x384959)return console[_0x5ade58(0x174)](a56_0x3ae1dc[_0x5ade58(0x31c)]('Error:'),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x5ade58(0x174)](a56_0x3ae1dc[_0x5ade58(0x18b)](_0x5ade58(0x1b4))),0x1;_0x20dd5f[_0x5ade58(0x28c)]&&(console[_0x5ade58(0x174)](_0x5ade58(0x300)+_0x360d65),console[_0x5ade58(0x174)](_0x5ade58(0x234)+_0x384959),_0x127725&&console[_0x5ade58(0x174)]('Revision:\x20'+_0x127725),_0x20dd5f[_0x5ade58(0x30d)]&&console['error'](_0x5ade58(0x1e6)),_0xbc58e5&&console[_0x5ade58(0x174)]('Validation:\x20skipped'));const _0x343c34=await withSpinner(_0x5ade58(0x19e),()=>_0x20eb3d[_0x5ade58(0x2b9)][_0x5ade58(0x338)](_0x360d65,_0x384959,{'revision':_0x127725,'skipValidation':_0xbc58e5}),{'verbose':_0x20dd5f[_0x5ade58(0x28c)]}),_0x25e40e=_0x343c34[_0x5ade58(0x2c5)];console[_0x5ade58(0x174)](_0x5ade58(0x238)+_0x25e40e['sourceDir']);_0x25e40e[_0x5ade58(0x24e)]&&console[_0x5ade58(0x174)](_0x5ade58(0x1b2)+_0x25e40e[_0x5ade58(0x24e)]);console[_0x5ade58(0x174)](_0x5ade58(0x234)+_0x25e40e['newProjectName']),console[_0x5ade58(0x174)](_0x5ade58(0x2a7)+_0x25e40e[_0x5ade58(0x344)]),console[_0x5ade58(0x174)](_0x5ade58(0x2cf)+_0x25e40e[_0x5ade58(0x27a)]);_0x25e40e['targetExists']&&(console[_0x5ade58(0x174)](a56_0x3ae1dc[_0x5ade58(0x2df)]('\x0a⚠\x20Project\x20\x22'+_0x25e40e[_0x5ade58(0x269)]+_0x5ade58(0x2eb)+_0x25e40e[_0x5ade58(0x20e)]+')')),console[_0x5ade58(0x174)](a56_0x3ae1dc[_0x5ade58(0x2df)](_0x5ade58(0x200))));if(_0x20dd5f['dryRun'])return console['error'](a56_0x3ae1dc['yellow'](_0x5ade58(0x32b))),0x0;if(!_0x20dd5f['yes']){if(!isInteractive())return console['error'](a56_0x3ae1dc['red']('\x0aError:'),_0x5ade58(0x1f9)),console['error'](a56_0x3ae1dc[_0x5ade58(0x18b)](_0x5ade58(0x2f4))),0x1;const _0x33c921=_0x25e40e['sourceProjectName']||a56_0x49ff99[_0x5ade58(0x1fb)](_0x360d65),_0x1c4cbc=_0x25e40e[_0x5ade58(0x29a)]?_0x5ade58(0x240)+_0x384959+_0x5ade58(0x23e):_0x5ade58(0x1a1)+_0x33c921+_0x5ade58(0x1cf)+_0x384959+'\x22?',_0x4ff0d0=await confirmKey(_0x1c4cbc);if(!_0x4ff0d0)return console[_0x5ade58(0x174)](a56_0x3ae1dc[_0x5ade58(0x2df)](_0x5ade58(0x334))),0x1;}const _0x25f539=await withSpinner(_0x25e40e['targetExists']?_0x5ade58(0x337)+_0x384959+_0x5ade58(0x1d5):_0x5ade58(0x226)+_0x384959+_0x5ade58(0x1d5),()=>_0x20eb3d['workflow'][_0x5ade58(0x2a2)](_0x25e40e),{'verbose':_0x20dd5f[_0x5ade58(0x28c)]}),_0x1afd77=_0x25f539[_0x5ade58(0x2c5)];return console['error'](a56_0x3ae1dc[_0x5ade58(0x258)](_0x25e40e[_0x5ade58(0x29a)]?_0x5ade58(0x296):_0x5ade58(0x23f))),console[_0x5ade58(0x174)]('\x20\x20Project:\x20'+_0x1afd77[_0x5ade58(0x269)]),console[_0x5ade58(0x174)]('\x20\x20Project\x20ID:\x20'+_0x1afd77[_0x5ade58(0x1ae)]),console[_0x5ade58(0x174)](_0x5ade58(0x2ac)+_0x1afd77[_0x5ade58(0x344)]),await this[_0x5ade58(0x2fe)](_0x20eb3d,_0x1afd77[_0x5ade58(0x269)],_0x20dd5f['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a56_0x28b4c4(0x22a)]=a56_0x28b4c4(0x1fd);[a56_0x28b4c4(0x1ea)]=a56_0x28b4c4(0x2bd);async[a56_0x28b4c4(0x195)](_0x32bc9a){const _0x155e53=a56_0x28b4c4,{options:_0xebb031,args:_0x3a3dec,tdx:_0x17651d}=_0x32bc9a,_0x4ef3ea=_0x3a3dec[0x0];if(!_0x4ef3ea)return console['error'](_0x155e53(0x2b4)),console[_0x155e53(0x174)](_0x155e53(0x208)),0x1;_0xebb031[_0x155e53(0x28c)]&&console[_0x155e53(0x174)]('Project:\x20'+_0x4ef3ea);if(!_0xebb031[_0x155e53(0x2ae)]){if(!isInteractive())return console['error'](a56_0x3ae1dc[_0x155e53(0x31c)](_0x155e53(0x1bd)),_0x155e53(0x1f9)),console['error'](a56_0x3ae1dc[_0x155e53(0x18b)](_0x155e53(0x2f4))),0x1;const _0x3b49a3=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x4ef3ea+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x3b49a3)return console['error'](a56_0x3ae1dc['yellow'](_0x155e53(0x334))),0x1;}const _0x372554=await withSpinner(_0x155e53(0x177)+_0x4ef3ea+_0x155e53(0x1d5),()=>_0x17651d[_0x155e53(0x2b9)][_0x155e53(0x317)](_0x4ef3ea),{'verbose':_0xebb031[_0x155e53(0x28c)]}),_0x2068cd=_0x372554[_0x155e53(0x2c5)];return console['error']('✔\x20Deleted\x20project\x20'+_0x2068cd[_0x155e53(0x2c2)]),console[_0x155e53(0x174)]('\x20\x20Project\x20ID:\x20'+_0x2068cd[_0x155e53(0x2f0)]),0x0;}}export function parseKeyValue(_0x42d57d){const _0x48ace0=a56_0x28b4c4,_0x133b6e=_0x42d57d[_0x48ace0(0x201)]('=');if(_0x133b6e===-0x1)throw new Error(_0x48ace0(0x27d)+_0x42d57d+_0x48ace0(0x260));const _0x35ed01=_0x42d57d[_0x48ace0(0x24b)](0x0,_0x133b6e),_0x1c63e8=_0x42d57d[_0x48ace0(0x24b)](_0x133b6e+0x1);if(!_0x35ed01)throw new Error(_0x48ace0(0x277));return{'key':_0x35ed01,'value':_0x1c63e8};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a56_0x28b4c4(0x22a)]=a56_0x28b4c4(0x281);['description']=a56_0x28b4c4(0x256);async[a56_0x28b4c4(0x195)](_0x385b18){const _0x2043c8=a56_0x28b4c4,{options:_0x333636,args:_0x44dbbd,tdx:_0x4e1877}=_0x385b18,_0x21e375=this['requireProject'](_0x44dbbd,_0x333636);if(!_0x21e375)return 0x1;_0x333636[_0x2043c8(0x28c)]&&console['error'](_0x2043c8(0x275)+_0x21e375);const _0x3cda82=await withSpinner(_0x2043c8(0x286),()=>_0x4e1877['workflow'][_0x2043c8(0x28d)](_0x21e375),{'verbose':_0x333636['verbose']}),{secrets:_0x1af54d}=_0x3cda82[_0x2043c8(0x2c5)];return console['error'](_0x2043c8(0x209)+_0x1af54d[_0x2043c8(0x24f)]+_0x2043c8(0x2a6)+(_0x1af54d[_0x2043c8(0x24f)]!==0x1?'s':'')),await handleSDKOutput(_0x1af54d,_0x333636),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a56_0x28b4c4(0x22a)]=a56_0x28b4c4(0x2b3);[a56_0x28b4c4(0x1ea)]=a56_0x28b4c4(0x19c);async['execute'](_0x3e4913){const _0x5f305a=a56_0x28b4c4,{options:_0x4394d7,args:_0x25e541,tdx:_0x3c1f34}=_0x3e4913;let _0x7a6323,_0x8184cb;if(_0x25e541[_0x5f305a(0x24f)]>=0x1&&!_0x25e541[0x0][_0x5f305a(0x2b7)]('='))_0x7a6323=_0x25e541[0x0],_0x8184cb=_0x25e541[_0x5f305a(0x2c8)](0x1);else{if(_0x25e541[_0x5f305a(0x24f)]>=0x1&&_0x4394d7[_0x5f305a(0x280)])_0x7a6323=_0x4394d7[_0x5f305a(0x280)],_0x8184cb=_0x25e541;else return _0x25e541[_0x5f305a(0x24f)]>=0x1?(console[_0x5f305a(0x174)](_0x5f305a(0x274)),console[_0x5f305a(0x174)](_0x5f305a(0x2a8)),0x1):(console[_0x5f305a(0x174)](_0x5f305a(0x2f8)),console[_0x5f305a(0x174)](_0x5f305a(0x282)),0x1);}if(_0x8184cb[_0x5f305a(0x24f)]===0x0)return console[_0x5f305a(0x174)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x5f305a(0x174)](_0x5f305a(0x282)),0x1;const _0x1c56a7={};try{for(const _0x69e27a of _0x8184cb){const {key:_0x107d06,value:_0xd7669f}=parseKeyValue(_0x69e27a);_0x1c56a7[_0x107d06]=_0xd7669f;}}catch(_0x4dfa77){return _0x4dfa77 instanceof Error&&console[_0x5f305a(0x174)](a56_0x3ae1dc['red'](_0x5f305a(0x31e)),_0x4dfa77[_0x5f305a(0x27e)]),0x1;}const _0x2fa493=Object[_0x5f305a(0x263)](_0x1c56a7);_0x4394d7[_0x5f305a(0x28c)]&&(console[_0x5f305a(0x174)](_0x5f305a(0x275)+_0x7a6323),console[_0x5f305a(0x174)](_0x5f305a(0x342)+_0x2fa493['join'](',\x20')));const _0x4b97a3=await withSpinner(_0x2fa493[_0x5f305a(0x24f)]===0x1?_0x5f305a(0x1ca):_0x5f305a(0x33c)+_0x2fa493['length']+_0x5f305a(0x1d1),()=>_0x3c1f34[_0x5f305a(0x2b9)][_0x5f305a(0x33b)](_0x7a6323,_0x1c56a7),{'verbose':_0x4394d7[_0x5f305a(0x28c)]}),_0x197213=_0x4b97a3[_0x5f305a(0x2c5)];return console['error'](_0x2fa493[_0x5f305a(0x24f)]===0x1?'✔\x20Secret\x20\x27'+_0x197213[_0x5f305a(0x263)][0x0]+_0x5f305a(0x30a)+_0x197213[_0x5f305a(0x2c2)]+'\x27':'✔\x20'+_0x197213[_0x5f305a(0x263)][_0x5f305a(0x24f)]+_0x5f305a(0x320)+_0x197213['projectName']+'\x27'),(_0x4394d7[_0x5f305a(0x25f)]||_0x4394d7[_0x5f305a(0x257)])&&await handleSingleObjectOutput(_0x197213,_0x4394d7),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a56_0x28b4c4(0x22a)]='workflow:secrets:delete';['description']='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a56_0x28b4c4(0x195)](_0x2e0497){const _0x44e27b=a56_0x28b4c4,{options:_0x5a7fd4,args:_0x36534b,tdx:_0x44b8ba}=_0x2e0497;let _0x11b8b5,_0x30d727;if(_0x36534b[_0x44e27b(0x24f)]>=0x2)_0x11b8b5=_0x36534b[0x0],_0x30d727=_0x36534b[0x1];else{if(_0x36534b['length']===0x1&&_0x5a7fd4[_0x44e27b(0x280)])_0x11b8b5=_0x5a7fd4[_0x44e27b(0x280)],_0x30d727=_0x36534b[0x0];else return _0x36534b[_0x44e27b(0x24f)]===0x1?(console[_0x44e27b(0x174)](_0x44e27b(0x274)),console[_0x44e27b(0x174)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x44e27b(0x174)](_0x44e27b(0x17f)),console['error'](_0x44e27b(0x19a)),0x1);}_0x5a7fd4[_0x44e27b(0x28c)]&&(console['error'](_0x44e27b(0x275)+_0x11b8b5),console[_0x44e27b(0x174)](_0x44e27b(0x2ba)+_0x30d727));if(!_0x5a7fd4[_0x44e27b(0x2ae)]){if(!isInteractive())return console['error'](a56_0x3ae1dc[_0x44e27b(0x31c)]('\x0aError:'),_0x44e27b(0x1f9)),console[_0x44e27b(0x174)](a56_0x3ae1dc[_0x44e27b(0x18b)](_0x44e27b(0x2f4))),0x1;const _0x35ded4=await confirmKey(_0x44e27b(0x341)+_0x30d727+_0x44e27b(0x1e8)+_0x11b8b5+'\x27?');if(!_0x35ded4)return console['error'](a56_0x3ae1dc['yellow']('Cancelled')),0x1;}const _0x170308=await withSpinner('Deleting\x20secret...',()=>_0x44b8ba[_0x44e27b(0x2b9)]['deleteSecret'](_0x11b8b5,_0x30d727),{'verbose':_0x5a7fd4[_0x44e27b(0x28c)]}),_0x3e2add=_0x170308[_0x44e27b(0x2c5)];return console[_0x44e27b(0x174)](_0x44e27b(0x25b)+_0x3e2add[_0x44e27b(0x27b)]+_0x44e27b(0x31a)+_0x3e2add[_0x44e27b(0x2c2)]+'\x27'),(_0x5a7fd4['json']||_0x5a7fd4[_0x44e27b(0x257)])&&await handleSingleObjectOutput(_0x3e2add,_0x5a7fd4),0x0;}}const TIMELINE_CONFIG={'TASK_NAME_WIDTH':0x28,'ICON_WIDTH':0x2,'ICON_SPACING':0x1,'GUTTER':0x5,'MIN_TIMELINE_WIDTH':0x28,'MAX_TIMELINE_WIDTH':0x50,'LABEL_MIN_SPACING':0x2,'POLL_INTERVAL_MS':0x7d0,'MAX_POLL_TIME_MS':0x36ee80,'MAX_POLL_ITERATIONS':0x708,'MAX_TASKS_DISPLAY':0x64,'MIN_LABEL_COUNT':0x3,'MAX_LABEL_COUNT':0x6,'LABEL_WIDTH_DIVISOR':0xf};function formatElapsed(_0x46b361){const _0x169953=a56_0x28b4c4,_0x11a604=Math[_0x169953(0x327)](_0x46b361/0x3e8),_0x420440=Math[_0x169953(0x327)](_0x11a604/0x3c),_0x45ad1a=Math[_0x169953(0x327)](_0x420440/0x3c),_0x3692bb=Math[_0x169953(0x327)](_0x45ad1a/0x18);if(_0x3692bb>0x0){const _0x306660=_0x45ad1a%0x18;return _0x306660>0x0?_0x3692bb+'d\x20'+_0x306660+'h':_0x3692bb+'d';}else{if(_0x45ad1a>0x0){const _0x1eb286=_0x420440%0x3c;return _0x1eb286>0x0?_0x45ad1a+'h\x20'+_0x1eb286+'m':_0x45ad1a+'h';}else{if(_0x420440>0x0){const _0x4f8b3f=_0x11a604%0x3c;return _0x4f8b3f>0x0?_0x420440+'m\x20'+_0x4f8b3f+'s':_0x420440+'m';}else return _0x11a604+'s';}}}function formatTimestamp(_0x31beac,_0xab1abd){const _0x327ef1=a56_0x28b4c4,_0x55a7ed=new Date(_0x31beac),_0x23a28c=String(_0x55a7ed[_0x327ef1(0x347)]())[_0x327ef1(0x2f2)](0x2,'0'),_0x2754fe=String(_0x55a7ed[_0x327ef1(0x1c6)]())[_0x327ef1(0x2f2)](0x2,'0'),_0x160c42=_0x23a28c+':'+_0x2754fe,_0x4e9422=_0x55a7ed[_0x327ef1(0x26d)]()===_0xab1abd[_0x327ef1(0x26d)]()&&_0x55a7ed['getMonth']()===_0xab1abd['getMonth']()&&_0x55a7ed['getDate']()===_0xab1abd[_0x327ef1(0x1ab)]();if(_0x4e9422)return _0x160c42;else{const _0x32e4b2=String(_0x55a7ed['getMonth']()+0x1)['padStart'](0x2,'0'),_0x2da942=String(_0x55a7ed[_0x327ef1(0x1ab)]())[_0x327ef1(0x2f2)](0x2,'0');return _0x32e4b2+'-'+_0x2da942+'\x20'+_0x160c42;}}function formatDate(_0x11047d){const _0x362623=a56_0x28b4c4,_0x35946e=_0x11047d[_0x362623(0x26d)](),_0x4e19d9=String(_0x11047d[_0x362623(0x1f7)]()+0x1)[_0x362623(0x2f2)](0x2,'0'),_0x25310c=String(_0x11047d['getDate']())[_0x362623(0x2f2)](0x2,'0');return _0x35946e+'-'+_0x4e19d9+'-'+_0x25310c;}function getTaskStateIcon(_0x4e0e33){const _0x5b141a={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x5b141a[_0x4e0e33]||'⚪';}function getBarChar(_0x1bbb23){const _0x22e47f=a56_0x28b4c4;return _0x1bbb23===_0x22e47f(0x174)||_0x1bbb23===_0x22e47f(0x332)?'×':'─';}function getBarColor(_0x213e12){const _0x316513=a56_0x28b4c4,_0x14f264={'success':a56_0x3ae1dc[_0x316513(0x258)],'error':a56_0x3ae1dc[_0x316513(0x31c)],'group_error':a56_0x3ae1dc[_0x316513(0x31c)],'running':a56_0x3ae1dc[_0x316513(0x339)],'blocked':a56_0x3ae1dc['yellow'],'planned':a56_0x3ae1dc['dim'],'canceling':a56_0x3ae1dc[_0x316513(0x2df)]};return _0x14f264[_0x213e12]||a56_0x3ae1dc['white'];}function parseTaskName(_0x13b695){const _0x1ac5e3=a56_0x28b4c4;let _0x240b1a=_0x13b695[_0x1ac5e3(0x1a0)](/^\++/,'');const _0x4dc59b=_0x240b1a[_0x1ac5e3(0x2a3)]('+'),_0x514ff7=_0x4dc59b[_0x1ac5e3(0x24f)]>0x1?_0x4dc59b[_0x1ac5e3(0x24f)]-0x2:0x0,_0x4dd9f5=_0x4dc59b[_0x4dc59b[_0x1ac5e3(0x24f)]-0x1]||_0x240b1a;return{'level':_0x514ff7,'name':'+'+_0x4dd9f5};}function truncateTaskName(_0x1653ec,_0x518d39){const _0x3ff8eb=a56_0x28b4c4,_0x3f7ea0=stringWidth(_0x1653ec);if(_0x3f7ea0<=_0x518d39)return _0x1653ec;let _0x4875cd=_0x1653ec;while(stringWidth(_0x4875cd+'…')>_0x518d39&&_0x4875cd[_0x3ff8eb(0x24f)]>0x0){_0x4875cd=_0x4875cd[_0x3ff8eb(0x2c8)](0x0,-0x1);}return _0x4875cd+'…';}function calculateTimeScale(_0x244787,_0x42ce09){const _0x5698db=a56_0x28b4c4;return{'startTime':_0x244787[_0x5698db(0x192)],'endTime':_0x244787[_0x5698db(0x1a2)],'durationMs':_0x244787['duration'],'msPerChar':_0x244787[_0x5698db(0x21e)]/_0x42ce09};}function timeToPosition(_0x5cc693,_0x37afc0,_0x210f84){const _0x2d1f08=a56_0x28b4c4,_0x5330e8=_0x5cc693-_0x37afc0[_0x2d1f08(0x17e)],_0x466b30=Math[_0x2d1f08(0x327)](_0x5330e8/_0x37afc0['msPerChar']);return Math['max'](0x0,Math[_0x2d1f08(0x1f6)](_0x466b30,_0x210f84));}function renderTimeAxis(_0x3466e1,_0x4598d8){const _0x1e2a16=a56_0x28b4c4,_0x37f921=Math[_0x1e2a16(0x1f6)](TIMELINE_CONFIG[_0x1e2a16(0x1aa)],Math[_0x1e2a16(0x2e8)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math['floor'](_0x4598d8/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x39409d=_0x3466e1[_0x1e2a16(0x301)]/(_0x37f921-0x1),_0x434e2f=new Date(_0x3466e1[_0x1e2a16(0x17e)]),_0x1370ec=[];for(let _0x468ba1=0x0;_0x468ba1<_0x37f921;_0x468ba1++){const _0xeab367=_0x3466e1[_0x1e2a16(0x17e)]+_0x468ba1*_0x39409d,_0x722fb8=timeToPosition(_0xeab367,_0x3466e1,_0x4598d8),_0x1c49b6=formatTimestamp(_0xeab367,_0x434e2f);_0x1370ec['push']({'pos':_0x722fb8,'text':_0x1c49b6});}const _0x5a965a=new Array(_0x4598d8)['fill']('\x20');let _0x1fdbc6=-0x1;for(const {pos:_0x70ba60,text:_0x4d8699}of _0x1370ec){let _0x4f9216=Math['max'](0x0,_0x70ba60-Math[_0x1e2a16(0x327)](_0x4d8699[_0x1e2a16(0x24f)]/0x2));_0x4f9216<=_0x1fdbc6+TIMELINE_CONFIG[_0x1e2a16(0x262)]&&(_0x4f9216=_0x1fdbc6+TIMELINE_CONFIG[_0x1e2a16(0x262)]+0x1);_0x4f9216+_0x4d8699[_0x1e2a16(0x24f)]>_0x4598d8&&(_0x4f9216=_0x4598d8-_0x4d8699['length']);if(_0x4f9216>=0x0&&_0x4f9216+_0x4d8699[_0x1e2a16(0x24f)]<=_0x4598d8&&_0x4f9216>_0x1fdbc6){for(let _0x5526b5=0x0;_0x5526b5<_0x4d8699[_0x1e2a16(0x24f)];_0x5526b5++){_0x5a965a[_0x4f9216+_0x5526b5]=_0x4d8699[_0x5526b5];}_0x1fdbc6=_0x4f9216+_0x4d8699[_0x1e2a16(0x24f)]-0x1;}}return _0x5a965a['join']('');}function renderTaskRow(_0x29be81,_0x296220,_0x38cab8,_0x3a7243){const _0x526b53=a56_0x28b4c4,{level:_0x4e8415,name:_0x17bc51}=parseTaskName(_0x29be81[_0x526b53(0x22a)]),_0x2a4944='\x20'[_0x526b53(0x273)](_0x4e8415),_0x25014c=_0x29be81[_0x526b53(0x179)]?'('+formatElapsed(_0x29be81[_0x526b53(0x179)]['duration'])+')':'',_0x405183=stringWidth(_0x25014c),_0x328266=_0x4e8415*0x1,_0x24551b=_0x3a7243-_0x328266-_0x405183-0x1,_0x2644fd=truncateTaskName(_0x17bc51,_0x24551b),_0x5ccc10=_0x2a4944+_0x2644fd,_0x5fad62=stringWidth(_0x5ccc10),_0x424639=_0x3a7243-_0x5fad62-_0x405183,_0x2d3d38=_0x5ccc10+'\x20'[_0x526b53(0x273)](Math[_0x526b53(0x2e8)](0x1,_0x424639))+a56_0x3ae1dc[_0x526b53(0x18b)](_0x25014c),_0x4e55b9=getTaskStateIcon(_0x29be81[_0x526b53(0x1ff)]),_0x3dd5d3=new Array(_0x38cab8)[_0x526b53(0x1fa)]('\x20');if(_0x29be81[_0x526b53(0x179)]){const _0x5206d8=timeToPosition(_0x29be81['window']['start'],_0x296220,_0x38cab8),_0x215401=timeToPosition(_0x29be81['window']['end'],_0x296220,_0x38cab8),_0x21370b=getBarChar(_0x29be81[_0x526b53(0x1ff)]),_0x3bfba0=Math[_0x526b53(0x2e8)](_0x5206d8+0x1,_0x215401);for(let _0x4fe18a=_0x5206d8;_0x4fe18a<Math[_0x526b53(0x1f6)](_0x3bfba0,_0x38cab8);_0x4fe18a++){_0x3dd5d3[_0x4fe18a]=_0x21370b;}}const _0x366f8b=getBarColor(_0x29be81[_0x526b53(0x1ff)]),_0x4b5529=_0x3dd5d3[_0x526b53(0x241)](_0x181b7c=>_0x181b7c==='\x20'?'\x20':_0x366f8b(_0x181b7c))['join']('');return _0x4e55b9+'\x20'+_0x2d3d38+'│'+_0x4b5529+'│';}function calculateStats(_0x4fb3b8){const _0x1b7f0e=a56_0x28b4c4,_0x29010c={'total':_0x4fb3b8[_0x1b7f0e(0x24f)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x35b8bd of _0x4fb3b8){if(_0x35b8bd['state']===_0x1b7f0e(0x244))_0x29010c[_0x1b7f0e(0x244)]++;else{if(_0x35b8bd[_0x1b7f0e(0x1ff)]===_0x1b7f0e(0x174)||_0x35b8bd['state']===_0x1b7f0e(0x332))_0x29010c['error']++;else _0x35b8bd[_0x1b7f0e(0x1ff)]==='running'?_0x29010c[_0x1b7f0e(0x349)]++:_0x29010c[_0x1b7f0e(0x1f1)]++;}}return _0x29010c;}function formatStats(_0x54e3a8){const _0x4e7a8a=a56_0x28b4c4;return[_0x4e7a8a(0x173)+_0x54e3a8[_0x4e7a8a(0x2f9)],'✅\x20'+_0x54e3a8['success'],'❌\x20'+_0x54e3a8[_0x4e7a8a(0x174)],_0x4e7a8a(0x346)+_0x54e3a8['running'],'⏳\x20'+_0x54e3a8[_0x4e7a8a(0x1f1)]][_0x4e7a8a(0x272)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a56_0x28b4c4(0x178);[a56_0x28b4c4(0x1ea)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a56_0x28b4c4(0x195)](_0x18a819){const _0x2b7e47=a56_0x28b4c4,{options:_0x159e81,args:_0x4885b8,tdx:_0x9c971d}=_0x18a819;let _0x3d6a64,_0x3bc71e,_0x6c3fb8=![];if(_0x4885b8[0x0]){if(_0x4885b8[0x0][_0x2b7e47(0x2b7)]('.')){const _0x5f4d92=this[_0x2b7e47(0x1c1)](_0x4885b8,_0x159e81);if(!_0x5f4d92)return 0x1;_0x3d6a64=_0x5f4d92[_0x2b7e47(0x2c2)],_0x3bc71e=_0x5f4d92['workflowName'];}else{_0x3bc71e=_0x4885b8[0x0],_0x3d6a64=_0x159e81[_0x2b7e47(0x280)];if(!_0x3d6a64)return console[_0x2b7e47(0x174)](a56_0x3ae1dc['red'](_0x2b7e47(0x31e)),_0x2b7e47(0x19f)),0x1;_0x6c3fb8=!![];}}else{const _0x1c1c53=this['parseProjectWorkflowPattern'](_0x4885b8,_0x159e81);if(!_0x1c1c53)return 0x1;_0x3d6a64=_0x1c1c53[_0x2b7e47(0x2c2)],_0x3bc71e=_0x1c1c53[_0x2b7e47(0x1d0)];}if(_0x159e81[_0x2b7e47(0x28c)]){if(_0x3d6a64&&_0x3bc71e)console[_0x2b7e47(0x174)](_0x2b7e47(0x31f)+_0x3d6a64+'.'+_0x3bc71e);else _0x3d6a64&&console[_0x2b7e47(0x174)]('Filter:\x20project='+_0x3d6a64);}const _0x3a0c36=_0x159e81[_0x2b7e47(0x249)],_0x9388ed=_0x159e81[_0x2b7e47(0x2a4)];if(_0x3a0c36){_0x9388ed&&console[_0x2b7e47(0x174)](a56_0x3ae1dc[_0x2b7e47(0x2df)]('Warning:'),_0x2b7e47(0x2e3));const _0x5c2769=_0x159e81['follow'];return _0x5c2769?await this[_0x2b7e47(0x2c1)](_0x18a819,_0x3a0c36):await this[_0x2b7e47(0x1de)](_0x18a819,_0x3a0c36,_0x159e81),0x0;}if(_0x9388ed){const _0x223011=await withSpinner(_0x2b7e47(0x28b),()=>_0x9c971d[_0x2b7e47(0x2b9)]['sessions']({'projectName':_0x3d6a64,'workflowName':_0x3bc71e,'limit':0x64}),{'verbose':_0x159e81[_0x2b7e47(0x28c)]}),_0x19d136=_0x223011[_0x2b7e47(0x2c5)][_0x2b7e47(0x2d1)](_0x538d7f=>_0x538d7f['id']===_0x9388ed);if(!_0x19d136)return console[_0x2b7e47(0x174)](a56_0x3ae1dc['red'](_0x2b7e47(0x31e)),_0x2b7e47(0x2e5)+_0x9388ed),0x1;if(!_0x19d136[_0x2b7e47(0x1dd)]?.['id'])return console['error'](a56_0x3ae1dc['red'](_0x2b7e47(0x31e)),'Session\x20'+_0x9388ed+_0x2b7e47(0x326)),0x1;const _0x27c86d=_0x19d136['lastAttempt']['id'];_0x159e81[_0x2b7e47(0x28c)]&&console[_0x2b7e47(0x174)](_0x2b7e47(0x2e9)+_0x27c86d+_0x2b7e47(0x193)+_0x9388ed);const _0x3ecba7=_0x159e81[_0x2b7e47(0x204)];return _0x3ecba7?await this[_0x2b7e47(0x2c1)](_0x18a819,_0x27c86d):await this['renderSingleTimeline'](_0x18a819,_0x27c86d,_0x159e81),0x0;}const _0x4fcb4a=await withSpinner(_0x2b7e47(0x285),()=>_0x9c971d[_0x2b7e47(0x2b9)][_0x2b7e47(0x242)]({'projectName':_0x3d6a64,'workflowName':_0x3bc71e,'limit':_0x159e81[_0x2b7e47(0x1b3)]||0x32}),{'verbose':_0x159e81['verbose']}),_0x281dd6=_0x4fcb4a[_0x2b7e47(0x2c5)];if(_0x281dd6[_0x2b7e47(0x24f)]===0x0){if(_0x3d6a64&&_0x3bc71e)console[_0x2b7e47(0x174)](_0x2b7e47(0x2c9)+_0x3d6a64+'.'+_0x3bc71e);else _0x3d6a64?console[_0x2b7e47(0x174)](_0x2b7e47(0x2de)+_0x3d6a64):(console[_0x2b7e47(0x174)](_0x2b7e47(0x28e)),console[_0x2b7e47(0x174)](a56_0x3ae1dc[_0x2b7e47(0x18b)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x281dd6[_0x2b7e47(0x1ed)]((_0x23d6b2,_0x3c1165)=>{const _0xff067c=_0x2b7e47,_0x5df032=_0x23d6b2[_0xff067c(0x1eb)]||'',_0x2bcb5c=_0x3c1165[_0xff067c(0x1eb)]||'';return _0x2bcb5c[_0xff067c(0x1ef)](_0x5df032);});if(_0x159e81[_0x2b7e47(0x25f)]||_0x159e81[_0x2b7e47(0x257)])return await handleSDKOutput(_0x281dd6,_0x159e81),0x0;let _0x2d5017;if(_0x6c3fb8){const _0xd51065=_0x281dd6[0x0];if(!_0xd51065['lastAttempt']?.['id'])return console[_0x2b7e47(0x174)]('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x2d5017=_0xd51065[_0x2b7e47(0x1dd)]['id'],_0x159e81[_0x2b7e47(0x28c)]&&console['error']('Auto-selected\x20latest\x20session:\x20'+_0xd51065['sessionTime']);}else{const _0x3aed31=_0x281dd6[_0x2b7e47(0x241)](_0x5e7c38=>{const _0x20393f=_0x2b7e47,_0xc27d1f=getAttemptStatusDisplay(_0x5e7c38[_0x20393f(0x1dd)]);return{'title':_0x5e7c38[_0x20393f(0x1ba)]?.[_0x20393f(0x22a)]+'.'+_0x5e7c38['workflow']?.[_0x20393f(0x22a)]+_0x20393f(0x1b5)+_0x5e7c38['sessionTime']+'\x20'+_0xc27d1f[_0x20393f(0x2d6)],'value':_0x5e7c38[_0x20393f(0x1dd)]?.['id']||'','description':_0xc27d1f['text']};}),_0x2fef21=await a56_0x4687fd({'type':_0x2b7e47(0x1d6),'name':_0x2b7e47(0x249),'message':_0x2b7e47(0x267),'choices':_0x3aed31[_0x2b7e47(0x1d8)](_0x5c5bc2=>_0x5c5bc2['value']!=='')});if(!_0x2fef21[_0x2b7e47(0x249)])return 0x0;_0x2d5017=_0x2fef21[_0x2b7e47(0x249)];}const _0x4b40fe=_0x159e81['follow'];return _0x4b40fe?await this[_0x2b7e47(0x2c1)](_0x18a819,_0x2d5017):await this[_0x2b7e47(0x1de)](_0x18a819,_0x2d5017,_0x159e81),0x0;}async[a56_0x28b4c4(0x1de)](_0x16a4ef,_0x48350e,_0x14f823){const _0x49db2d=a56_0x28b4c4,{tdx:_0x5dc79f}=_0x16a4ef;let _0x589cc5,_0x5ebecd;try{[_0x589cc5,_0x5ebecd]=await Promise[_0x49db2d(0x247)]([_0x5dc79f['workflow'][_0x49db2d(0x32c)](_0x48350e),_0x5dc79f[_0x49db2d(0x2b9)][_0x49db2d(0x210)](_0x48350e,![])]);}catch(_0x15d101){console[_0x49db2d(0x174)](a56_0x3ae1dc[_0x49db2d(0x31c)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x14f823['verbose']&&console[_0x49db2d(0x174)](_0x15d101);throw _0x15d101;}if(_0x14f823[_0x49db2d(0x25f)]||_0x14f823[_0x49db2d(0x257)]){const _0x2ba1c8=this[_0x49db2d(0x25a)](_0x589cc5,_0x5ebecd);await handleSDKOutput([_0x2ba1c8],_0x14f823);return;}const _0x3ed443=_0x5dc79f['context'][_0x49db2d(0x1df)],_0x7b4799=this[_0x49db2d(0x30b)](_0x589cc5,_0x5ebecd,_0x3ed443);console['log'](_0x7b4799);}async['pollTimeline'](_0x14bdc1,_0x13b561){const _0x30c976=a56_0x28b4c4,{tdx:_0x30c3fa}=_0x14bdc1,_0x31525f=TIMELINE_CONFIG[_0x30c976(0x314)],_0x13aa9b=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x562ef3=0x0;while(_0x562ef3<_0x13aa9b){process['stdout'][_0x30c976(0x24c)]&&process[_0x30c976(0x1b8)][_0x30c976(0x21a)]('\x1Bc');let _0x3cfc6b,_0x2b372a;try{[_0x3cfc6b,_0x2b372a]=await Promise['all']([_0x30c3fa[_0x30c976(0x2b9)][_0x30c976(0x32c)](_0x13b561),_0x30c3fa[_0x30c976(0x2b9)][_0x30c976(0x210)](_0x13b561,![])]);}catch(_0x58b3d6){console[_0x30c976(0x174)](a56_0x3ae1dc['red'](_0x30c976(0x23d)));_0x562ef3>0x0&&console['error'](a56_0x3ae1dc[_0x30c976(0x18b)](_0x30c976(0x18a)+_0x562ef3));throw _0x58b3d6;}const _0x3bbac9=_0x30c3fa[_0x30c976(0x239)]['site'],_0x3bf08b=this[_0x30c976(0x30b)](_0x3cfc6b,_0x2b372a,_0x3bbac9);console[_0x30c976(0x2b0)](_0x3bf08b);const _0x547961=_0x3cfc6b[_0x30c976(0x1c8)]&&_0x2b372a[_0x30c976(0x283)](_0x447d9c=>_0x447d9c[_0x30c976(0x1ff)]!==_0x30c976(0x349)&&_0x447d9c['state']!==_0x30c976(0x276));if(_0x547961){console['error'](a56_0x3ae1dc[_0x30c976(0x258)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0x30c976(0x174)](a56_0x3ae1dc[_0x30c976(0x18b)]('\x0aPolling...\x20('+_0x562ef3*0x2+_0x30c976(0x21d))),await new Promise(_0x146c5c=>setTimeout(_0x146c5c,_0x31525f)),_0x562ef3++;}_0x562ef3>=_0x13aa9b&&console[_0x30c976(0x174)](a56_0x3ae1dc[_0x30c976(0x2df)](_0x30c976(0x2c3)));}['renderTimeline'](_0x1422ea,_0xb001d5,_0x329746){const _0x42b745=a56_0x28b4c4,_0x4991a7=[],_0x383717=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x3692da=0x5,_0x5c822e=process[_0x42b745(0x1b8)][_0x42b745(0x18f)]||0x78,_0x3cfeb3=_0x5c822e-_0x383717-_0x3692da,_0xbe2a21=Math[_0x42b745(0x2e8)](TIMELINE_CONFIG[_0x42b745(0x25c)],Math[_0x42b745(0x1f6)](_0x3cfeb3,TIMELINE_CONFIG[_0x42b745(0x2f1)])),_0x4ab099=new Date(_0x1422ea[_0x42b745(0x2bb)])[_0x42b745(0x331)](),_0x41114e=_0x1422ea['finishedAt']?new Date(_0x1422ea[_0x42b745(0x1c4)])[_0x42b745(0x331)]():Date[_0x42b745(0x304)](),_0x4eb814={'start':_0x4ab099,'end':_0x41114e,'duration':_0x41114e-_0x4ab099},_0x4c3f1f=new Map(),_0x204b59=[];for(const _0xa0a886 of _0xb001d5){if(_0xa0a886[_0x42b745(0x1c2)]){const _0x3358df=new Date(_0xa0a886[_0x42b745(0x1c2)])[_0x42b745(0x331)](),_0x51e2b8=_0xa0a886[_0x42b745(0x1a7)]?new Date(_0xa0a886[_0x42b745(0x1a7)])['getTime']():Date[_0x42b745(0x304)](),_0x37223a={'start':_0x3358df,'end':_0x51e2b8,'duration':_0x51e2b8-_0x3358df};_0x4c3f1f[_0x42b745(0x32a)](_0xa0a886['id'],_0x37223a),_0x204b59[_0x42b745(0x220)]({'name':_0xa0a886['fullName'],'state':_0xa0a886['state']||'unknown','window':_0x37223a});}else _0x204b59[_0x42b745(0x220)]({'name':_0xa0a886[_0x42b745(0x29f)],'state':_0xa0a886[_0x42b745(0x1ff)]||_0x42b745(0x276),'window':undefined});}_0x204b59[_0x42b745(0x1ed)]((_0x5da616,_0x52dd6a)=>{const _0x4129ad=_0x42b745;if(!_0x5da616[_0x4129ad(0x179)])return 0x1;if(!_0x52dd6a[_0x4129ad(0x179)])return-0x1;return _0x5da616['window'][_0x4129ad(0x192)]-_0x52dd6a[_0x4129ad(0x179)][_0x4129ad(0x192)];});const _0x567378=_0x204b59[_0x42b745(0x24f)],_0x349611=_0x567378>TIMELINE_CONFIG[_0x42b745(0x1d7)];_0x349611&&_0x204b59[_0x42b745(0x33d)](TIMELINE_CONFIG[_0x42b745(0x1d7)]);const _0x52470a=calculateTimeScale(_0x4eb814,_0xbe2a21),_0x26c391=_0x1422ea[_0x42b745(0x1c8)]?_0x1422ea[_0x42b745(0x244)]?a56_0x3ae1dc[_0x42b745(0x258)](_0x42b745(0x244)):a56_0x3ae1dc[_0x42b745(0x31c)](_0x42b745(0x174)):a56_0x3ae1dc[_0x42b745(0x339)](_0x42b745(0x349)),_0x5cc371=_0x1422ea['project']?.['id'],_0x1df3be=_0x1422ea[_0x42b745(0x2a4)];let _0x19719f;if(_0x5cc371&&_0x1df3be){const _0x4596bd=getWorkflowAttemptUrl(_0x329746,_0x5cc371,_0x1df3be,_0x1422ea['id']);_0x19719f=hyperlink(a56_0x3ae1dc[_0x42b745(0x18b)](_0x1422ea['id']),_0x4596bd);}else _0x19719f=a56_0x3ae1dc[_0x42b745(0x18b)](_0x1422ea['id']);_0x4991a7[_0x42b745(0x220)]('Attempt:\x20'+_0x19719f+_0x42b745(0x1b5)+_0x26c391+_0x42b745(0x1b5)+formatElapsed(_0x4eb814[_0x42b745(0x21e)]));if(_0x204b59[_0x42b745(0x24f)]>0x0){const _0x3ee955=renderTimeAxis(_0x52470a,_0xbe2a21),_0x119dce=new Date(_0x4eb814['start']),_0x307f10=formatDate(_0x119dce),_0x3c76cd=TIMELINE_CONFIG[_0x42b745(0x297)]+TIMELINE_CONFIG['ICON_SPACING']+_0x383717,_0x4f45ea=_0x307f10[_0x42b745(0x2f2)](_0x3c76cd),_0x31728b=a56_0x3ae1dc['dim'](_0x4f45ea);_0x4991a7[_0x42b745(0x220)](_0x31728b+'\x20'+_0x3ee955);for(const _0x3da3ba of _0x204b59){_0x4991a7[_0x42b745(0x220)](renderTaskRow(_0x3da3ba,_0x52470a,_0xbe2a21,_0x383717));}const _0x5eb350=calculateStats(_0x204b59);_0x4991a7['push'](formatStats(_0x5eb350)),_0x349611&&_0x4991a7['push'](a56_0x3ae1dc['yellow'](_0x42b745(0x29e)+TIMELINE_CONFIG[_0x42b745(0x1d7)]+'\x20of\x20'+_0x567378+'\x20tasks')),_0x4991a7[_0x42b745(0x220)](''),_0x4991a7[_0x42b745(0x220)](a56_0x3ae1dc[_0x42b745(0x18b)](_0x42b745(0x328))+(_0x42b745(0x2aa)+_0x1422ea['id']+_0x42b745(0x293))+a56_0x3ae1dc['dim']('\x20to\x20see\x20detailed\x20logs'));}else _0x4991a7[_0x42b745(0x220)](_0x42b745(0x20d));return _0x4991a7[_0x42b745(0x272)]('\x0a');}[a56_0x28b4c4(0x25a)](_0x3910c8,_0xa19c29){const _0x43c6aa=a56_0x28b4c4,_0x69c007=new Date(_0x3910c8[_0x43c6aa(0x2bb)])[_0x43c6aa(0x331)](),_0x223ddb=_0x3910c8['finishedAt']?new Date(_0x3910c8[_0x43c6aa(0x1c4)])['getTime']():Date['now'](),_0x1598b1=_0x223ddb-_0x69c007,_0x5e2810=[];for(const _0x529a5d of _0xa19c29){if(_0x529a5d[_0x43c6aa(0x1c2)]){const _0x22adce=new Date(_0x529a5d[_0x43c6aa(0x1c2)])[_0x43c6aa(0x331)](),_0x167d17=_0x529a5d[_0x43c6aa(0x1a7)]?new Date(_0x529a5d['updatedAt'])['getTime']():Date[_0x43c6aa(0x304)]();_0x5e2810[_0x43c6aa(0x220)]({'name':_0x529a5d[_0x43c6aa(0x29f)],'state':_0x529a5d['state']||_0x43c6aa(0x175),'window':{'start':_0x22adce,'end':_0x167d17,'duration':_0x167d17-_0x22adce}});}else _0x5e2810[_0x43c6aa(0x220)]({'name':_0x529a5d[_0x43c6aa(0x29f)],'state':_0x529a5d['state']||'planned','window':undefined});}const _0x2b660b=calculateStats(_0x5e2810);return{'attempt':{'id':_0x3910c8['id'],'status':_0x3910c8['done']?_0x3910c8[_0x43c6aa(0x244)]?'success':_0x43c6aa(0x174):_0x43c6aa(0x349),'createdAt':_0x3910c8[_0x43c6aa(0x2bb)],'finishedAt':_0x3910c8[_0x43c6aa(0x1c4)],'duration_ms':_0x1598b1},'tasks':_0x5e2810[_0x43c6aa(0x241)](_0x5f48e1=>({'name':_0x5f48e1[_0x43c6aa(0x22a)],'state':_0x5f48e1[_0x43c6aa(0x1ff)],'startedAt':_0x5f48e1[_0x43c6aa(0x179)]?new Date(_0x5f48e1[_0x43c6aa(0x179)][_0x43c6aa(0x192)])[_0x43c6aa(0x1dc)]():null,'updatedAt':_0x5f48e1[_0x43c6aa(0x179)]?new Date(_0x5f48e1[_0x43c6aa(0x179)]['end'])['toISOString']():null,'duration_ms':_0x5f48e1[_0x43c6aa(0x179)]?.['duration']||null})),'stats':_0x2b660b};}}function formatScheduleLine(_0x49fdc0){const _0x13ae41=a56_0x28b4c4,_0x35e922=_0x49fdc0[_0x13ae41(0x1b6)]?a56_0x3ae1dc[_0x13ae41(0x2df)](_0x13ae41(0x2af)):'',_0xa3ec0a=_0x49fdc0[_0x13ae41(0x1ba)]?.[_0x13ae41(0x22a)]?a56_0x3ae1dc[_0x13ae41(0x18b)]('\x20['+_0x49fdc0[_0x13ae41(0x1ba)][_0x13ae41(0x22a)]+']'):'',_0x3c1efd=_0x49fdc0[_0x13ae41(0x2d3)]?a56_0x3ae1dc[_0x13ae41(0x18b)](_0x13ae41(0x1c3)+new Date(_0x49fdc0[_0x13ae41(0x2d3)])[_0x13ae41(0x2fa)]()):'';return'📅\x20#'+_0x49fdc0['id']+'\x20'+(_0x49fdc0[_0x13ae41(0x2b9)]?.[_0x13ae41(0x22a)]||_0x13ae41(0x305))+_0xa3ec0a+_0x35e922+_0x3c1efd;}export class WorkflowSchedulesCommand extends WorkflowBaseCommand{[a56_0x28b4c4(0x22a)]=a56_0x28b4c4(0x2f5);[a56_0x28b4c4(0x1ea)]='List\x20workflow\x20schedules';async[a56_0x28b4c4(0x195)](_0x30cf96){const _0x2b1292=a56_0x28b4c4,{options:_0x46ace4,args:_0x1483d6,tdx:_0x56af69}=_0x30cf96,{scheduleId:_0x34b186}=_0x46ace4;if(_0x34b186&&_0x1483d6[0x0])return console['error'](a56_0x3ae1dc[_0x2b1292(0x31c)](_0x2b1292(0x31e)),_0x2b1292(0x33a)),console[_0x2b1292(0x174)](a56_0x3ae1dc[_0x2b1292(0x18b)](_0x2b1292(0x288))),0x1;if(_0x34b186){const _0x200416=await withSpinner(_0x2b1292(0x1e0)+_0x34b186+'...',()=>_0x56af69[_0x2b1292(0x2b9)]['getSchedule'](_0x34b186),{'verbose':_0x46ace4[_0x2b1292(0x28c)]}),_0x2a2bbf=_0x200416['data'];return isStructuredFormat(_0x46ace4)?await handleSingleObjectOutput(_0x2a2bbf,_0x46ace4):(console[_0x2b1292(0x174)](_0x2b1292(0x1b1)),console['log'](formatScheduleLine(_0x2a2bbf))),0x0;}const _0x5a01be=this['parseProjectWorkflowPattern'](_0x1483d6,_0x46ace4);if(!_0x5a01be)return 0x1;const {projectName:_0x4b57ab,workflowName:_0x3fd05b}=_0x5a01be,_0x297d81=_0x4b57ab?'\x27'+_0x4b57ab+(_0x3fd05b?'.'+_0x3fd05b:'')+'\x27':undefined,_0x4f9d86=await withSpinner(_0x297d81?_0x2b1292(0x1f2)+_0x297d81+_0x2b1292(0x1d5):_0x2b1292(0x292),()=>_0x4b57ab?_0x56af69[_0x2b1292(0x2b9)][_0x2b1292(0x1a6)](_0x4b57ab,{'workflow':_0x3fd05b,'limit':_0x46ace4[_0x2b1292(0x1b3)]}):_0x56af69[_0x2b1292(0x2b9)][_0x2b1292(0x1d2)]({'limit':_0x46ace4['limit']}),{'verbose':_0x46ace4[_0x2b1292(0x28c)]}),_0x1558e5=_0x4f9d86[_0x2b1292(0x2c5)],_0x893503=_0x46ace4[_0x2b1292(0x1b3)]&&_0x1558e5[_0x2b1292(0x24f)]>=_0x46ace4[_0x2b1292(0x1b3)]?a56_0x3ae1dc['dim'](_0x2b1292(0x1af)):'';console[_0x2b1292(0x174)](_0x2b1292(0x209)+_0x1558e5[_0x2b1292(0x24f)]+_0x2b1292(0x18d)+(_0x1558e5[_0x2b1292(0x24f)]!==0x1?'s':'')+_0x893503);if(isStructuredFormat(_0x46ace4))await handleSDKOutput(_0x1558e5,_0x46ace4);else{if(_0x1558e5['length']===0x0)console[_0x2b1292(0x2b0)]('No\x20schedules\x20found');else for(const _0x3cd4b9 of _0x1558e5){console[_0x2b1292(0x2b0)](formatScheduleLine(_0x3cd4b9));}}return 0x0;}}function a56_0x3ea7(_0x199d6e,_0x251cf4){_0x199d6e=_0x199d6e-0x172;const _0x46208d=a56_0x4620();let _0x3ea71e=_0x46208d[_0x199d6e];return _0x3ea71e;}export class WorkflowScheduleEnableCommand extends BaseCommand{[a56_0x28b4c4(0x22a)]=a56_0x28b4c4(0x190);[a56_0x28b4c4(0x1ea)]=a56_0x28b4c4(0x313);async[a56_0x28b4c4(0x195)](_0x8d0c38){const _0x151a9c=a56_0x28b4c4,{options:_0x4ae3a,args:_0x2d3640,tdx:_0x8029af}=_0x8d0c38,_0x1d2966=_0x2d3640[0x0];if(!_0x1d2966)return console['error'](a56_0x3ae1dc['red'](_0x151a9c(0x31e)),_0x151a9c(0x32d)),console[_0x151a9c(0x174)](a56_0x3ae1dc[_0x151a9c(0x18b)]('Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>')),console[_0x151a9c(0x174)](a56_0x3ae1dc['dim']('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const {backfill:_0x4c636c,nextTime:_0x346537}=_0x4ae3a,_0x436364={};if(_0x4c636c!==undefined)_0x436364[_0x151a9c(0x2cb)]=!_0x4c636c;if(_0x346537!==undefined)_0x436364[_0x151a9c(0x20f)]=_0x346537;const _0x25f437=await withSpinner(_0x151a9c(0x251)+_0x1d2966+_0x151a9c(0x1d5),()=>_0x8029af[_0x151a9c(0x2b9)]['enableSchedule'](_0x1d2966,_0x436364),{'verbose':_0x4ae3a['verbose']}),_0x8d48ad=_0x25f437[_0x151a9c(0x2c5)];return isStructuredFormat(_0x4ae3a)?await handleSingleObjectOutput(_0x8d48ad,_0x4ae3a):(console[_0x151a9c(0x2b0)](_0x151a9c(0x17b)+_0x1d2966+'\x20enabled\x20('+(_0x8d48ad['workflow']?.[_0x151a9c(0x22a)]||_0x151a9c(0x175))+')'),_0x8d48ad[_0x151a9c(0x2d3)]&&console[_0x151a9c(0x2b0)](a56_0x3ae1dc[_0x151a9c(0x18b)](_0x151a9c(0x311)+new Date(_0x8d48ad[_0x151a9c(0x2d3)])[_0x151a9c(0x2fa)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a56_0x28b4c4(0x22a)]=a56_0x28b4c4(0x21f);[a56_0x28b4c4(0x1ea)]=a56_0x28b4c4(0x2ad);async[a56_0x28b4c4(0x195)](_0x1f64fb){const _0x4ba17d=a56_0x28b4c4,{options:_0x2ed3e9,args:_0x332222,tdx:_0x751c87}=_0x1f64fb,_0x2b9a5c=_0x332222[0x0];if(!_0x2b9a5c)return console['error'](a56_0x3ae1dc[_0x4ba17d(0x31c)](_0x4ba17d(0x31e)),_0x4ba17d(0x32d)),console[_0x4ba17d(0x174)](a56_0x3ae1dc[_0x4ba17d(0x18b)](_0x4ba17d(0x2a1))),console[_0x4ba17d(0x174)](a56_0x3ae1dc[_0x4ba17d(0x18b)](_0x4ba17d(0x2b8))),0x1;const _0x55da4f=await withSpinner(_0x4ba17d(0x1f3)+_0x2b9a5c+_0x4ba17d(0x1d5),()=>_0x751c87[_0x4ba17d(0x2b9)][_0x4ba17d(0x33f)](_0x2b9a5c),{'verbose':_0x2ed3e9[_0x4ba17d(0x28c)]}),_0x2f4025=_0x55da4f[_0x4ba17d(0x2c5)];return isStructuredFormat(_0x2ed3e9)?await handleSingleObjectOutput(_0x2f4025,_0x2ed3e9):console['log'](_0x4ba17d(0x17b)+_0x2b9a5c+_0x4ba17d(0x2e2)+(_0x2f4025[_0x4ba17d(0x2b9)]?.['name']||_0x4ba17d(0x175))+')'),0x0;}}
1
+ const a56_0x5ef62e=a56_0x4ea0;(function(_0x2042ee,_0x3425ce){const _0x577f81=a56_0x4ea0,_0x4139e7=_0x2042ee();while(!![]){try{const _0xeea187=-parseInt(_0x577f81(0x247))/0x1+-parseInt(_0x577f81(0x128))/0x2+-parseInt(_0x577f81(0x243))/0x3*(parseInt(_0x577f81(0x18b))/0x4)+parseInt(_0x577f81(0x195))/0x5*(-parseInt(_0x577f81(0x19a))/0x6)+-parseInt(_0x577f81(0x240))/0x7+parseInt(_0x577f81(0x219))/0x8+parseInt(_0x577f81(0x18c))/0x9*(parseInt(_0x577f81(0x24e))/0xa);if(_0xeea187===_0x3425ce)break;else _0x4139e7['push'](_0x4139e7['shift']());}catch(_0x3d1bd1){_0x4139e7['push'](_0x4139e7['shift']());}}}(a56_0x1196,0x486f1));import a56_0x511120 from'chalk';import{existsSync}from'fs';import a56_0x384ad3 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import{parseTaskGraph,formatTaskGraph,summarizeTaskGraph,formatWarningSummary}from'../sdk/workflow/task-graph.js';import a56_0x3a0ef2 from'prompts';function getAttemptStatusDisplay(_0x3d504a){const _0x44bc9d=a56_0x4ea0;if(!_0x3d504a)return{'icon':'⏳','text':''};const {done:_0x4fd264,success:_0x43344a,cancelRequested:_0x1f9904}=_0x3d504a;if(!_0x4fd264)return _0x1f9904?{'icon':'🛑','text':a56_0x511120[_0x44bc9d(0x29c)](_0x44bc9d(0x133))}:{'icon':'🔄','text':a56_0x511120[_0x44bc9d(0x21d)](_0x44bc9d(0x211))};if(_0x43344a)return{'icon':'✅','text':a56_0x511120[_0x44bc9d(0x131)](_0x44bc9d(0x1a8))};return{'icon':'❌','text':a56_0x511120[_0x44bc9d(0xe7)](_0x44bc9d(0x188))};}export class WorkflowBaseCommand extends BaseCommand{[a56_0x5ef62e(0x234)](_0x13b4f9,_0x9d349d,_0x52eacd=0x0){const _0x1de589=a56_0x5ef62e;return _0x13b4f9[_0x52eacd]||_0x9d349d[_0x1de589(0xf6)];}[a56_0x5ef62e(0x252)](_0x101d05,_0x408b42,_0x187274=0x0){const _0x4ae052=a56_0x5ef62e,_0xe43c77=this[_0x4ae052(0x234)](_0x101d05,_0x408b42,_0x187274);if(!_0xe43c77)return console['error'](a56_0x511120[_0x4ae052(0xe7)]('Error:'),_0x4ae052(0x1c6)),console['error'](a56_0x511120['dim'](_0x4ae052(0x12d))),null;return _0xe43c77;}[a56_0x5ef62e(0xf8)](_0x352215,_0x495615){const _0x1bd174=a56_0x5ef62e;if(_0x352215[0x0]){const _0xf9c639=_0x352215[0x0]['split']('.');if(_0xf9c639[_0x1bd174(0x1d3)]===0x1)return{'projectName':_0xf9c639[0x0],'workflowName':undefined};else return _0xf9c639[_0x1bd174(0x1d3)]===0x2?{'projectName':_0xf9c639[0x0],'workflowName':_0xf9c639[0x1]}:(console[_0x1bd174(0x188)](a56_0x511120[_0x1bd174(0xe7)](_0x1bd174(0x101)),_0x1bd174(0x285)),null);}return{'projectName':_0x495615[_0x1bd174(0xf6)],'workflowName':undefined};}[a56_0x5ef62e(0xec)](_0x33c232,_0x18eaa1,_0x51dd52=0x0){const _0x4decd0=a56_0x5ef62e;if(_0x33c232[_0x51dd52])return _0x33c232[_0x51dd52];if(_0x18eaa1['workflowProject']){const _0x1dc081=a56_0x384ad3[_0x4decd0(0x1e0)](process[_0x4decd0(0x185)](),_0x4decd0(0xf9),_0x18eaa1['workflowProject']);if(existsSync(a56_0x384ad3[_0x4decd0(0x1e0)](_0x1dc081,_0x4decd0(0x150))))return _0x1dc081;}return undefined;}async[a56_0x5ef62e(0x100)](_0xbfd1a9,_0x58a0b1,_0x49787f){const _0x3aaefb=a56_0x5ef62e;try{const _0x8fc2fe=await _0xbfd1a9['workflow'][_0x3aaefb(0xf9)](_0x58a0b1,{'limit':0x1});if(_0x8fc2fe[_0x3aaefb(0x1d3)]>0x0){const _0x109945=_0x8fc2fe[0x0]['id'],_0x4b1fbf=getWorkflowUrl(_0x49787f,_0x109945);console['error']('\x20\x20Console:\x20'+a56_0x511120[_0x3aaefb(0x11e)](_0x4b1fbf));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a56_0x5ef62e(0xfe)]='workflow:use';[a56_0x5ef62e(0x282)]=a56_0x5ef62e(0x24f);async[a56_0x5ef62e(0x217)](_0x565099){const _0x50190d=a56_0x5ef62e,{options:_0x1cdc21,args:_0x3d26b1,tdx:_0x4ae2ec}=_0x565099,_0x44065e=_0x3d26b1[0x0],_0xbce374=_0x1cdc21[_0x50190d(0xe1)];if(_0xbce374)return saveSessionContext({'workflow_project':undefined},_0x1cdc21[_0x50190d(0x296)]),console[_0x50190d(0xe6)](a56_0x511120[_0x50190d(0x131)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x44065e)return console[_0x50190d(0x188)](a56_0x511120[_0x50190d(0xe7)](_0x50190d(0x101)),_0x50190d(0x1c6)),console[_0x50190d(0x188)](a56_0x511120['dim'](_0x50190d(0x1f9))),console['error'](a56_0x511120[_0x50190d(0x149)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x1052eb=await withSpinner(_0x50190d(0x160)+_0x44065e+'\x27...',()=>_0x4ae2ec[_0x50190d(0x155)]['resolveProjectId'](_0x44065e),{'verbose':_0x1cdc21[_0x50190d(0x231)]}),{name:_0x27e2a2}=_0x1052eb[_0x50190d(0x117)];return saveSessionContext({'workflow_project':_0x27e2a2},_0x1cdc21[_0x50190d(0x296)]),console[_0x50190d(0xe6)](a56_0x511120[_0x50190d(0x131)](_0x50190d(0x10c)+a56_0x511120['cyan'](_0x27e2a2))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a56_0x5ef62e(0xfe)]=a56_0x5ef62e(0x12b);[a56_0x5ef62e(0x282)]=a56_0x5ef62e(0xfc);async[a56_0x5ef62e(0x217)](_0x2395b6){const _0x2ff72b=a56_0x5ef62e,{options:_0x5a87d8,args:_0x1f3c32,tdx:_0x2db901}=_0x2395b6,_0x6893d=_0x1f3c32[0x0];_0x5a87d8[_0x2ff72b(0x231)]&&_0x6893d&&console[_0x2ff72b(0x188)](_0x2ff72b(0x165)+_0x6893d);const _0x28c10b=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x2db901[_0x2ff72b(0x155)][_0x2ff72b(0x27c)](_0x6893d,{'limit':_0x5a87d8['limit']}),{'verbose':_0x5a87d8[_0x2ff72b(0x231)]});let _0x1ea4a8=_0x28c10b[_0x2ff72b(0x117)];_0x1ea4a8[_0x2ff72b(0x16d)]((_0x123882,_0x4bb92e)=>_0x123882[_0x2ff72b(0xfe)][_0x2ff72b(0x1d8)](_0x4bb92e[_0x2ff72b(0xfe)]));const _0x52db9e=_0x5a87d8[_0x2ff72b(0x226)]&&_0x1ea4a8['length']>=_0x5a87d8['limit']?a56_0x511120[_0x2ff72b(0x149)](_0x2ff72b(0x232)):'';console[_0x2ff72b(0x188)]('✔\x20Found\x20'+_0x1ea4a8[_0x2ff72b(0x1d3)]+_0x2ff72b(0x1b3)+(_0x1ea4a8[_0x2ff72b(0x1d3)]!==0x1?'s':'')+_0x52db9e);if(_0x5a87d8[_0x2ff72b(0x15c)]==='json'||_0x5a87d8[_0x2ff72b(0x15c)]==='jsonl'||_0x5a87d8[_0x2ff72b(0x15c)]==='table')await handleSDKOutput(_0x1ea4a8,_0x5a87d8);else{if(_0x1ea4a8['length']===0x0)_0x6893d?console['log']('No\x20projects\x20match\x20pattern:\x20'+_0x6893d):console[_0x2ff72b(0xe6)](_0x2ff72b(0x210));else{const _0x2061dd=_0x1ea4a8[_0x2ff72b(0x1f8)](_0x2a99d5=>{const _0x3040d6=_0x2ff72b,_0xb87828=_0x2a99d5[_0x3040d6(0x203)]?.[_0x3040d6(0x254)](_0x26eaeb=>_0x26eaeb[_0x3040d6(0x11a)]===_0x3040d6(0x242)),_0x19d0a5=_0xb87828?a56_0x511120['dim'](_0x3040d6(0x17c)):'';return _0x3040d6(0x168)+_0x2a99d5[_0x3040d6(0xfe)]+_0x19d0a5;});await writeOutput(_0x2061dd[_0x2ff72b(0x1e0)]('\x0a'),_0x5a87d8['output'],_0x2ff72b(0x2a5));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a56_0x5ef62e(0xfe)]=a56_0x5ef62e(0x192);['description']=a56_0x5ef62e(0x1b0);async['execute'](_0x4119af){const _0x2fc469=a56_0x5ef62e,{options:_0x4c153c,args:_0x42a7a6,tdx:_0x47faea}=_0x4119af,_0x44d929=this[_0x2fc469(0x234)](_0x42a7a6,_0x4c153c);_0x4c153c[_0x2fc469(0x231)]&&_0x44d929&&console[_0x2fc469(0x188)](_0x2fc469(0x1b7)+_0x44d929);const _0x4521cb=await withSpinner(_0x2fc469(0xf0),()=>_0x47faea[_0x2fc469(0x155)][_0x2fc469(0xf9)](_0x44d929,{'limit':_0x4c153c['limit']}),{'verbose':_0x4c153c[_0x2fc469(0x231)]});let _0x3ed315=_0x4521cb[_0x2fc469(0x117)];_0x3ed315[_0x2fc469(0x16d)]((_0x102f0e,_0x473edf)=>{const _0x5439ed=_0x2fc469,_0x1c7032=_0x102f0e['name'][_0x5439ed(0x1d8)](_0x473edf[_0x5439ed(0xfe)]);if(_0x1c7032!==0x0)return _0x1c7032;return(_0x102f0e[_0x5439ed(0x274)]?.[_0x5439ed(0xfe)]||'')[_0x5439ed(0x1d8)](_0x473edf[_0x5439ed(0x274)]?.[_0x5439ed(0xfe)]||'');});const _0x2cd01f=_0x4c153c[_0x2fc469(0x226)]&&_0x3ed315[_0x2fc469(0x1d3)]>=_0x4c153c['limit']?a56_0x511120[_0x2fc469(0x149)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x2fc469(0x188)]('✔\x20Found\x20'+_0x3ed315['length']+_0x2fc469(0x138)+(_0x3ed315[_0x2fc469(0x1d3)]!==0x1?'s':'')+_0x2cd01f);if(_0x4c153c['format']===_0x2fc469(0x1cd)||_0x4c153c[_0x2fc469(0x15c)]===_0x2fc469(0x154)||_0x4c153c[_0x2fc469(0x15c)]===_0x2fc469(0x132))await handleSDKOutput(_0x3ed315,_0x4c153c);else{if(_0x3ed315[_0x2fc469(0x1d3)]===0x0)_0x44d929?console['log']('No\x20workflows\x20found\x20in\x20project:\x20'+_0x44d929):console[_0x2fc469(0xe6)](_0x2fc469(0x263));else{const _0x2b3492=_0x4c153c['site'],_0x25b743=_0x3ed315['map'](_0xb8780b=>{const _0x1c4f56=_0x2fc469,_0x47cb1e=a56_0x511120[_0x1c4f56(0x149)]('#'+_0xb8780b['id']),_0x88785e=hyperlink(_0x47cb1e,getWorkflowUrl(_0x2b3492,_0xb8780b['id'])),_0x41d4d4=_0xb8780b[_0x1c4f56(0x274)]?.['name']?a56_0x511120[_0x1c4f56(0x149)]('\x20('+_0xb8780b[_0x1c4f56(0x274)][_0x1c4f56(0xfe)]+')'):'';return _0x1c4f56(0xe9)+_0x88785e+'\x20'+_0xb8780b[_0x1c4f56(0xfe)]+_0x41d4d4;});await writeOutput(_0x25b743['join']('\x0a'),_0x4c153c[_0x2fc469(0xe5)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a56_0x5ef62e(0xfe)]=a56_0x5ef62e(0x273);['description']=a56_0x5ef62e(0x12a);async[a56_0x5ef62e(0x217)](_0x3efa36){const _0x44a314=a56_0x5ef62e,{options:_0x40653c,args:_0x2238b6,tdx:_0x42c15e}=_0x3efa36,_0x2b29fb=this[_0x44a314(0xf8)](_0x2238b6,_0x40653c);if(!_0x2b29fb)return 0x1;const {projectName:_0x1e280f,workflowName:_0x38bc03}=_0x2b29fb;if(_0x40653c[_0x44a314(0x231)]){if(_0x1e280f&&_0x38bc03)console['error']('Filter:\x20'+_0x1e280f+'.'+_0x38bc03);else _0x1e280f&&console[_0x44a314(0x188)]('Filter:\x20project='+_0x1e280f);const _0x10ab48=_0x40653c[_0x44a314(0x196)];_0x10ab48&&console['error'](_0x44a314(0x257)+_0x10ab48);}let _0x32042f=0x28;if(process[_0x44a314(0x26d)]['isTTY']&&!_0x40653c[_0x44a314(0xe5)]&&!_0x40653c[_0x44a314(0x15c)]){const _0x203bdd=process['stdout'][_0x44a314(0x1db)]||0x28;_0x32042f=Math[_0x44a314(0x197)](0x14,Math['floor'](_0x203bdd*0x2/0x3));}const _0x3fdbfd=_0x40653c[_0x44a314(0x226)]||_0x32042f,_0x50ae40=await withSpinner(_0x44a314(0x13e),()=>_0x42c15e['workflow'][_0x44a314(0x262)]({'projectName':_0x1e280f,'workflowName':_0x38bc03,'status':_0x40653c['status'],'fromTime':_0x40653c['from'],'toTime':_0x40653c['to'],'limit':_0x3fdbfd}),{'verbose':_0x40653c[_0x44a314(0x231)]}),_0x35704e=_0x50ae40[_0x44a314(0x117)];_0x35704e[_0x44a314(0x16d)]((_0x23f2d7,_0x10c248)=>{const _0x21bb0f=_0x44a314,_0x45e636=_0x23f2d7[_0x21bb0f(0xe4)]||'',_0x218fd7=_0x10c248['sessionTime']||'';return _0x218fd7[_0x21bb0f(0x1d8)](_0x45e636);});_0x35704e[_0x44a314(0x1d3)]>=_0x3fdbfd?console['error']('✔\x20Showing\x20'+_0x35704e['length']+_0x44a314(0x258)+a56_0x511120[_0x44a314(0x149)](_0x44a314(0x13b))):console[_0x44a314(0x188)](_0x44a314(0x187)+_0x35704e[_0x44a314(0x1d3)]+'\x20session'+(_0x35704e['length']!==0x1?'s':''));if(_0x40653c[_0x44a314(0x15c)]===_0x44a314(0x1cd)||_0x40653c[_0x44a314(0x15c)]===_0x44a314(0x154)||_0x40653c['format']==='table')await handleSDKOutput(_0x35704e,_0x40653c);else{if(!process[_0x44a314(0x26d)][_0x44a314(0x250)]||_0x40653c[_0x44a314(0xe5)]){if(_0x35704e[_0x44a314(0x1d3)]===0x0){if(_0x1e280f&&_0x38bc03)console[_0x44a314(0xe6)](_0x44a314(0x1b1)+_0x1e280f+'.'+_0x38bc03);else _0x1e280f?console[_0x44a314(0xe6)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x1e280f):console[_0x44a314(0xe6)](_0x44a314(0x121));}else{const _0x13afcc=_0x40653c['site'],_0x54dcf6=this['renderSessionsTimeline'](_0x35704e,_0x13afcc);_0x40653c['output']?await writeOutput(_0x54dcf6,_0x40653c[_0x44a314(0xe5)],'list'):console['log'](_0x54dcf6);}!_0x1e280f&&(console['error'](''),console['error'](a56_0x511120[_0x44a314(0x149)](_0x44a314(0x2a1))),console['error'](a56_0x511120[_0x44a314(0x149)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a56_0x511120[_0x44a314(0x149)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x35704e[_0x44a314(0x1d3)]===0x0){if(_0x1e280f&&_0x38bc03)console[_0x44a314(0xe6)](_0x44a314(0x1b1)+_0x1e280f+'.'+_0x38bc03);else _0x1e280f?console[_0x44a314(0xe6)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x1e280f):console[_0x44a314(0xe6)](_0x44a314(0x121));}else await this[_0x44a314(0x1e4)](_0x35704e,_0x3efa36,_0x1e280f);}}return 0x0;}[a56_0x5ef62e(0x200)](_0x1e1560,_0x2700ef){const _0x10c89c=a56_0x5ef62e,_0x23f328=[],_0x208f9b=new Map();let _0x48be3b=Infinity,_0x4373da=-Infinity;for(const _0x3c0c69 of _0x1e1560){if(_0x3c0c69[_0x10c89c(0x224)]?.[_0x10c89c(0x18d)]){const _0x45791b=new Date(_0x3c0c69[_0x10c89c(0x224)][_0x10c89c(0x18d)])[_0x10c89c(0xff)](),_0x3da046=_0x3c0c69[_0x10c89c(0x224)][_0x10c89c(0x1b4)]?new Date(_0x3c0c69[_0x10c89c(0x224)][_0x10c89c(0x1b4)])['getTime']():Date['now'](),_0x3ba2a7=_0x3c0c69[_0x10c89c(0x274)]?.[_0x10c89c(0xfe)]||_0x10c89c(0x1bd);!_0x208f9b['has'](_0x3ba2a7)&&_0x208f9b[_0x10c89c(0x163)](_0x3ba2a7,[]),_0x208f9b['get'](_0x3ba2a7)[_0x10c89c(0x14b)]({'session':_0x3c0c69,'startTime':_0x45791b,'endTime':_0x3da046,'duration':_0x3da046-_0x45791b}),_0x48be3b=Math[_0x10c89c(0x145)](_0x48be3b,_0x45791b),_0x4373da=Math[_0x10c89c(0x197)](_0x4373da,_0x3da046);}}if(_0x208f9b['size']===0x0)return _0x10c89c(0x225);const _0x293792=process[_0x10c89c(0x26d)][_0x10c89c(0x27e)]||0x78,_0x57fa80=0x1e,_0x165d0b=0x32,_0x2dc667=0x4,_0x2c39d1=Math[_0x10c89c(0x145)](_0x165d0b,Math[_0x10c89c(0x197)](_0x57fa80,Math[_0x10c89c(0x1d9)](_0x293792*0.3))),_0x2547d6=_0x293792-_0x2c39d1-TIMELINE_CONFIG[_0x10c89c(0x2a4)]-0x3-_0x2dc667,_0xc267d8=_0x4373da-_0x48be3b,_0x475e62=_0xc267d8/_0x2c39d1,_0x21eaa5=renderTimeAxis({'startTime':_0x48be3b,'endTime':_0x4373da,'durationMs':_0xc267d8,'msPerChar':_0x475e62},_0x2c39d1),_0x1c11d6=[];for(const _0x461337 of _0x208f9b['values']()){_0x1c11d6[_0x10c89c(0x14b)](..._0x461337);}_0x1c11d6[_0x10c89c(0x16d)]((_0x4e60ec,_0x2cae78)=>_0x2cae78[_0x10c89c(0x1ed)]-_0x4e60ec[_0x10c89c(0x1ed)]);const _0x2ebfd0=new Date(_0x48be3b),_0x10be4c=formatDate(_0x2ebfd0),_0x5ecc93=_0x2dc667+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x10c89c(0x19d)]+_0x2547d6,_0x42ca30='\x20'[_0x10c89c(0x113)](_0x5ecc93-_0x10be4c[_0x10c89c(0x1d3)]),_0x1e1911=_0x42ca30+a56_0x511120['dim'](_0x10be4c)+'\x20'+_0x21eaa5;_0x23f328[_0x10c89c(0x14b)](_0x1e1911);const _0x2bdd17=0x16;let _0x374ce7=0x0;for(const _0x4dc098 of _0x1c11d6){const _0x5268c1=_0x4dc098['session'][_0x10c89c(0x274)]?.[_0x10c89c(0xfe)]||'?',_0xf556ae=Math['min'](stringWidth(_0x5268c1),_0x2bdd17);_0x374ce7=Math['max'](_0x374ce7,_0xf556ae);}for(const _0x3ffd7f of _0x1c11d6){const {session:_0xa25469,startTime:_0x1affe2,endTime:_0x1f683e,duration:_0x742204}=_0x3ffd7f,_0x4808c2=_0xa25469['project']?.['id'],_0x56d1f4=_0xa25469['id'],_0x1544b4=_0xa25469[_0x10c89c(0x274)]?.[_0x10c89c(0xfe)]||'?',_0x51761c=_0xa25469[_0x10c89c(0x155)]?.['name']||'?';let _0x54cd9b,_0x4af547;if(_0xa25469[_0x10c89c(0x224)]){const _0x40974c=_0xa25469[_0x10c89c(0x224)];!_0x40974c[_0x10c89c(0x26f)]?(_0x54cd9b=_0x40974c['cancelRequested']?'🛑':'🔄',_0x4af547=_0x40974c['cancelRequested']?a56_0x511120['yellow']:a56_0x511120[_0x10c89c(0x21d)]):(_0x54cd9b=_0x40974c['success']?'✅':'❌',_0x4af547=_0x40974c[_0x10c89c(0x1a8)]?a56_0x511120[_0x10c89c(0x131)]:a56_0x511120[_0x10c89c(0xe7)]);}else _0x54cd9b='⏳',_0x4af547=a56_0x511120['dim'];const _0x34f4bf='#'+_0x56d1f4,_0x4f5d8c=_0x4808c2?hyperlink(_0x34f4bf,getWorkflowSessionUrl(_0x2700ef,_0x4808c2,_0x56d1f4)):_0x34f4bf;let _0x47088c=_0x1544b4;stringWidth(_0x1544b4)>_0x2bdd17&&(_0x47088c=_0x1544b4[_0x10c89c(0x1ca)](0x0,_0x2bdd17-0x1)+'…');const _0x4dd375=a56_0x511120[_0x10c89c(0x149)](_0x47088c),_0x929141=stringWidth(_0x47088c),_0x2d348e='\x20'[_0x10c89c(0x113)](_0x374ce7-stringWidth(_0x47088c)+0x2),_0x5dcd4b='('+formatElapsed(_0x742204)+')',_0x5e8ffc=stringWidth(_0x5dcd4b),_0x1454af=stringWidth(_0x34f4bf),_0x396e8b=_0x1454af+0x1+_0x929141+_0x2d348e[_0x10c89c(0x1d3)],_0x4ee7dc=_0x2547d6-_0x396e8b-_0x5e8ffc-0x1-0x8;let _0x907056=_0x51761c;stringWidth(_0x907056)>_0x4ee7dc&&(_0x907056=_0x907056[_0x10c89c(0x1ca)](0x0,_0x4ee7dc-0x1)+'…');const _0x7a54bc=_0x4f5d8c+'\x20'+_0x4dd375+_0x2d348e+_0x907056,_0x70c15b=stringWidth(_0x7a54bc),_0x2b260b=_0x2547d6-_0x70c15b-_0x5e8ffc,_0x432b01=_0x7a54bc+'\x20'['repeat'](Math[_0x10c89c(0x197)](0x1,_0x2b260b))+a56_0x511120[_0x10c89c(0x149)](_0x5dcd4b),_0x46ac46=Math[_0x10c89c(0x1d9)]((_0x1affe2-_0x48be3b)/_0x475e62),_0x2d5798=Math[_0x10c89c(0x1d9)]((_0x1f683e-_0x48be3b)/_0x475e62),_0x21dfb9=Math[_0x10c89c(0x197)](_0x46ac46+0x1,_0x2d5798),_0x2abb70=new Array(_0x2c39d1)[_0x10c89c(0x271)]('\x20');for(let _0x17a0b3=_0x46ac46;_0x17a0b3<Math[_0x10c89c(0x145)](_0x21dfb9,_0x2c39d1);_0x17a0b3++){_0x2abb70[_0x17a0b3]='─';}const _0x440db3=_0x2abb70[_0x10c89c(0x1f8)](_0x223dd6=>_0x223dd6==='\x20'?'\x20':_0x4af547(_0x223dd6))[_0x10c89c(0x1e0)]('');_0x23f328['push'](_0x54cd9b+'\x20'+_0x432b01+'│'+_0x440db3+'│');}return _0x23f328[_0x10c89c(0x1e0)]('\x0a');}async['navigateSessionsInteractive'](_0x101146,_0xae015,_0x53b425){const _0x35c7e9=a56_0x5ef62e,{options:_0x36498e,tdx:_0x13948c}=_0xae015,_0x6de612=_0x36498e[_0x35c7e9(0x124)],{timelineRows:_0x435e66,timeAxisHeader:_0x8c6135}=this[_0x35c7e9(0x1cc)](_0x101146,_0x6de612),_0x4b6d95=_0x435e66[_0x35c7e9(0x110)](_0x48861b=>_0x48861b[_0x35c7e9(0x23c)]);if(_0x4b6d95['length']===0x0){const _0x332489=this[_0x35c7e9(0x200)](_0x101146,_0x6de612);console[_0x35c7e9(0xe6)](_0x332489);!_0x53b425&&(console['error'](''),console[_0x35c7e9(0x188)](a56_0x511120[_0x35c7e9(0x149)](_0x35c7e9(0x2a1))),console[_0x35c7e9(0x188)](a56_0x511120[_0x35c7e9(0x149)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a56_0x511120[_0x35c7e9(0x149)](_0x35c7e9(0x22b))));return;}_0x8c6135&&console[_0x35c7e9(0xe6)](_0x8c6135);const _0x5e1098=_0x435e66[_0x35c7e9(0x110)](_0x2bbcec=>_0x2bbcec['attemptId'])[_0x35c7e9(0x1f8)](_0x16e564=>({'title':_0x16e564[_0x35c7e9(0x11f)],'value':_0x16e564[_0x35c7e9(0x23c)]})),_0x22311b=process[_0x35c7e9(0x26d)][_0x35c7e9(0x1db)]||0x3c,_0x4daa5f=Math[_0x35c7e9(0x197)](0x28,Math['floor'](_0x22311b*0x2/0x3)),_0x30d1de=await a56_0x3a0ef2({'type':'autocomplete','name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x5e1098,'initial':-0x1,'limit':_0x4daa5f,'clearFirst':!![],'fallback':{'title':_0x35c7e9(0x278),'value':null},'suggest':(_0x5a1c47,_0x9bdf4e)=>{const _0x1c0ded=_0x35c7e9;if(!_0x5a1c47)return Promise['resolve'](_0x9bdf4e);const _0x1e2dde=_0x9bdf4e[_0x1c0ded(0x110)](_0x29b3f9=>{const _0x45339c=_0x1c0ded,_0x35ad9c=_0x29b3f9;return _0x35ad9c[_0x45339c(0x1fa)]['toLowerCase']()[_0x45339c(0x15e)](_0x5a1c47[_0x45339c(0x148)]());});return Promise[_0x1c0ded(0x13a)](_0x1e2dde);}}),_0x4caf81=()=>{const _0x2a9a0f=_0x35c7e9;process[_0x2a9a0f(0x26d)][_0x2a9a0f(0x15d)](_0x2a9a0f(0x221)),process['stdout'][_0x2a9a0f(0x15d)](_0x2a9a0f(0x221)),process[_0x2a9a0f(0x26d)][_0x2a9a0f(0x15d)](_0x2a9a0f(0x221));},_0x4b9ca1=_0x30d1de&&_0x30d1de['attemptId']&&_0x30d1de['attemptId']!==null&&_0x30d1de['attemptId'][_0x35c7e9(0x1b8)]()!=='';if(!_0x4b9ca1){_0x4caf81(),console[_0x35c7e9(0xe6)](a56_0x511120[_0x35c7e9(0x149)](_0x35c7e9(0x181)));return;}_0x4caf81();const _0x558aad=_0x101146[_0x35c7e9(0x21b)](_0x3cbbec=>_0x3cbbec[_0x35c7e9(0x224)]?.['id']===_0x30d1de[_0x35c7e9(0x23c)]);if(_0x558aad){const _0x82048d=_0x558aad[_0x35c7e9(0x274)]?.[_0x35c7e9(0xfe)]||'?',_0x11041b=_0x558aad[_0x35c7e9(0x155)]?.[_0x35c7e9(0xfe)]||'?';console[_0x35c7e9(0xe6)](_0x35c7e9(0x1ad)+a56_0x511120['dim'](_0x82048d)+_0x35c7e9(0x205)+a56_0x511120[_0x35c7e9(0x149)](_0x11041b));}const _0x117223=new WorkflowTimelineCommand();await _0x117223[_0x35c7e9(0x217)]({'args':[],'options':{..._0x36498e,'attemptId':_0x30d1de['attemptId']},'tdx':_0x13948c});}['generateSessionTimelineRows'](_0x4ae38e,_0x322242){const _0xe02bee=a56_0x5ef62e,_0x62987f=new Map();for(const _0x76de46 of _0x4ae38e){_0x76de46['id']&&_0x76de46[_0xe02bee(0x224)]?.['id']&&_0x62987f[_0xe02bee(0x163)](_0x76de46['id'],_0x76de46['lastAttempt']['id']);}const _0x44a292=[];let _0x5c79b9='';const _0x20db6b=this[_0xe02bee(0x200)](_0x4ae38e,_0x322242),_0x4f8469=_0x20db6b['split']('\x0a');for(const _0xa8349c of _0x4f8469){if(_0xa8349c[_0xe02bee(0x244)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0xa8349c[_0xe02bee(0x11c)](/^\s+\d{4}-\d{2}-\d{2}/))_0x5c79b9=_0xa8349c;else{if(_0xa8349c[_0xe02bee(0x11c)](/^[✅❌🔄🛑⏳]/)){const _0x19c0b2=_0xa8349c[_0xe02bee(0x11c)](/#(\d+)/),_0x4941ed=_0x19c0b2?_0x19c0b2[0x1]:null,_0x4963ec=_0x4941ed?_0x62987f[_0xe02bee(0x20a)](_0x4941ed)||null:null,_0x1c7788=_0x4ae38e[_0xe02bee(0x21b)](_0x3747a9=>_0x3747a9['id']===_0x4941ed),_0x5a60ff=_0x1c7788?.[_0xe02bee(0x274)]?.[_0xe02bee(0xfe)]||'';_0x44a292[_0xe02bee(0x14b)]({'displayLine':_0xa8349c,'attemptId':_0x4963ec,'projectName':_0x5a60ff});}}}return{'timelineRows':_0x44a292,'timeAxisHeader':_0x5c79b9};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a56_0x5ef62e(0xfe)]='workflow:attempts';['description']=a56_0x5ef62e(0x175);async[a56_0x5ef62e(0x217)](_0x28ccf8){const _0x18e7b7=a56_0x5ef62e,{options:_0x2a87eb,args:_0x1985a0,tdx:_0x9f823f}=_0x28ccf8,_0x4880d7=this[_0x18e7b7(0xf8)](_0x1985a0,_0x2a87eb);if(!_0x4880d7)return 0x1;const {projectName:_0x5f01eb,workflowName:_0x486e4d}=_0x4880d7,_0x7a7205=_0x2a87eb['includeRetried'];if(_0x2a87eb['verbose']){if(_0x5f01eb&&_0x486e4d)console[_0x18e7b7(0x188)](_0x18e7b7(0x202)+_0x5f01eb+'.'+_0x486e4d);else _0x5f01eb&&console[_0x18e7b7(0x188)](_0x18e7b7(0x1ef)+_0x5f01eb);_0x7a7205&&console[_0x18e7b7(0x188)]('Include\x20retried:\x20yes');}const _0x27fd14=await withSpinner(_0x18e7b7(0x16b),()=>_0x9f823f[_0x18e7b7(0x155)][_0x18e7b7(0x16c)]({'projectName':_0x5f01eb,'workflowName':_0x486e4d,'includeRetried':_0x7a7205,'limit':_0x2a87eb[_0x18e7b7(0x226)]}),{'verbose':_0x2a87eb[_0x18e7b7(0x231)]}),_0x5212d7=_0x27fd14[_0x18e7b7(0x117)],_0x283064=_0x2a87eb[_0x18e7b7(0x226)]||0x64,_0x5f377d=_0x5212d7[_0x18e7b7(0x1d3)]>=_0x283064?a56_0x511120[_0x18e7b7(0x149)](_0x18e7b7(0x232)):'';console[_0x18e7b7(0x188)]('✔\x20Found\x20'+_0x5212d7[_0x18e7b7(0x1d3)]+_0x18e7b7(0x11b)+(_0x5212d7['length']!==0x1?'s':'')+_0x5f377d);if(_0x2a87eb['format']==='json'||_0x2a87eb[_0x18e7b7(0x15c)]===_0x18e7b7(0x154)||_0x2a87eb[_0x18e7b7(0x15c)]===_0x18e7b7(0x132))await handleSDKOutput(_0x5212d7,_0x2a87eb);else{if(_0x5212d7[_0x18e7b7(0x1d3)]===0x0){if(_0x5f01eb&&_0x486e4d)console['log']('No\x20attempts\x20found\x20for:\x20'+_0x5f01eb+'.'+_0x486e4d);else _0x5f01eb?console[_0x18e7b7(0xe6)](_0x18e7b7(0x18f)+_0x5f01eb):console['log'](_0x18e7b7(0x19e));}else{const _0x2acd15=_0x2a87eb[_0x18e7b7(0x124)],_0x4e8039=_0x5212d7[_0x18e7b7(0x1f8)](_0x582be8=>{const _0x4610ae=_0x18e7b7,_0xd83392=a56_0x511120[_0x4610ae(0x149)]('#'+_0x582be8['id']),_0x3a992a=_0x582be8[_0x4610ae(0x274)]?.['id'],_0x3ad9df=_0x582be8['session_id']||_0x582be8[_0x4610ae(0x253)],_0x29f41d=_0x3a992a&&_0x3ad9df?hyperlink(_0xd83392,getWorkflowAttemptUrl(_0x2acd15,_0x3a992a,_0x3ad9df,_0x582be8['id'])):_0xd83392,{icon:_0x55b142,text:_0x14551f}=getAttemptStatusDisplay(_0x582be8),_0x21f07c=(_0x582be8['project']?.[_0x4610ae(0xfe)]||'?')+'.'+(_0x582be8[_0x4610ae(0x155)]?.['name']||'?'),_0x3fb7da=_0x582be8[_0x4610ae(0xe4)]?a56_0x511120[_0x4610ae(0x149)](_0x582be8['sessionTime']):'';return(_0x29f41d+'\x20'+_0x55b142+(_0x14551f?'\x20'+_0x14551f:'')+'\x20'+_0x21f07c+'\x20'+_0x3fb7da)[_0x4610ae(0x1bf)]();});await writeOutput(_0x4e8039[_0x18e7b7(0x1e0)]('\x0a'),_0x2a87eb[_0x18e7b7(0xe5)],_0x18e7b7(0x2a5));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a56_0x5ef62e(0xfe)]=a56_0x5ef62e(0x283);[a56_0x5ef62e(0x282)]=a56_0x5ef62e(0x1ea);async[a56_0x5ef62e(0x217)](_0x2ae018){const _0xd8138c=a56_0x5ef62e,{options:_0x1dd605,args:_0x3db74b,tdx:_0x11723c}=_0x2ae018,_0x4c20ad=_0x3db74b[0x0];if(!_0x4c20ad)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x1dd605[_0xd8138c(0x231)]&&console[_0xd8138c(0x188)](_0xd8138c(0x277)+_0x4c20ad);const _0x1c4119=await withSpinner(_0xd8138c(0x233),()=>_0x11723c[_0xd8138c(0x155)]['attempt'](_0x4c20ad),{'verbose':_0x1dd605['verbose']}),_0x4dc4ee=_0x1c4119[_0xd8138c(0x117)];let _0x45051a;!_0x4dc4ee[_0xd8138c(0x26f)]?_0x45051a=_0x4dc4ee[_0xd8138c(0x29f)]?_0xd8138c(0x133):'running':_0x45051a=_0x4dc4ee['success']?'success':_0xd8138c(0x188);let _0x2fa49a;if(_0x4dc4ee['createdAt']&&_0x4dc4ee[_0xd8138c(0x1b4)]){const _0x4b7955=new Date(_0x4dc4ee[_0xd8138c(0x18d)])['getTime'](),_0x3e39f7=new Date(_0x4dc4ee[_0xd8138c(0x1b4)])[_0xd8138c(0xff)]();_0x2fa49a=Math[_0xd8138c(0x1a3)]((_0x3e39f7-_0x4b7955)/0x3e8);}const _0x37038e={'attempt_id':_0x4dc4ee['id'],'status':_0x45051a,..._0x4dc4ee[_0xd8138c(0xf5)]!==undefined&&{'index':_0x4dc4ee[_0xd8138c(0xf5)]},..._0x4dc4ee[_0xd8138c(0x274)]&&{'project':_0x4dc4ee[_0xd8138c(0x274)]['name']},..._0x4dc4ee[_0xd8138c(0x155)]&&{'workflow':_0x4dc4ee[_0xd8138c(0x155)][_0xd8138c(0xfe)]},..._0x4dc4ee[_0xd8138c(0x253)]&&{'session_id':_0x4dc4ee[_0xd8138c(0x253)]},..._0x4dc4ee[_0xd8138c(0xe4)]&&{'session_time':_0x4dc4ee[_0xd8138c(0xe4)]},..._0x4dc4ee[_0xd8138c(0x2a6)]&&{'retry_attempt':_0x4dc4ee[_0xd8138c(0x2a6)]},..._0x2fa49a!==undefined&&{'duration_sec':_0x2fa49a},..._0x4dc4ee['createdAt']&&{'created_at':_0x4dc4ee[_0xd8138c(0x18d)]},..._0x4dc4ee[_0xd8138c(0x1b4)]&&{'finished_at':_0x4dc4ee['finishedAt']},...Object[_0xd8138c(0xe2)](_0x4dc4ee[_0xd8138c(0x26c)])[_0xd8138c(0x1d3)]>0x0&&{'params':_0x4dc4ee[_0xd8138c(0x26c)]}};return await handleSingleObjectOutput(_0x37038e,_0x1dd605),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a56_0x5ef62e(0xfe)]=a56_0x5ef62e(0x22c);[a56_0x5ef62e(0x282)]='Show\x20tasks\x20for\x20an\x20attempt';async[a56_0x5ef62e(0x217)](_0xbc9648){const _0x183019=a56_0x5ef62e,{options:_0x568b1e,args:_0x25cd95,tdx:_0x414f11}=_0xbc9648,_0x3cb35d=_0x25cd95[0x0];if(!_0x3cb35d)return console[_0x183019(0x188)](_0x183019(0x25c)),0x1;const _0x13e93f=_0x568b1e['includeSubtasks'];_0x568b1e[_0x183019(0x231)]&&(console[_0x183019(0x188)]('Attempt\x20ID:\x20'+_0x3cb35d),_0x13e93f&&console['error'](_0x183019(0x22a)));const _0x1a476a=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x414f11[_0x183019(0x155)][_0x183019(0x10b)](_0x3cb35d,_0x13e93f||![]),{'verbose':_0x568b1e['verbose']}),_0x211c53=_0x1a476a[_0x183019(0x117)];return console['error']('✔\x20Found\x20'+_0x211c53[_0x183019(0x1d3)]+'\x20task'+(_0x211c53[_0x183019(0x1d3)]!==0x1?'s':'')),await handleSDKOutput(_0x211c53,_0x568b1e),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a56_0x5ef62e(0xfe)]=a56_0x5ef62e(0xf2);['description']=a56_0x5ef62e(0x12f);async['execute'](_0x30ac55){const _0x30a4b7=a56_0x5ef62e,{options:_0x2bdd23,args:_0x1751d0,tdx:_0x228aee}=_0x30ac55,_0x441ea6=_0x1751d0[0x0];let _0x24d055=_0x1751d0[0x1];if(!_0x441ea6)return console[_0x30a4b7(0x188)](_0x30a4b7(0x25c)),0x1;_0x2bdd23[_0x30a4b7(0x231)]&&(console['error'](_0x30a4b7(0x277)+_0x441ea6),_0x24d055&&console[_0x30a4b7(0x188)](_0x30a4b7(0x2a9)+_0x24d055));const _0x238ae7=await withSpinner(_0x30a4b7(0x23d),()=>_0x228aee[_0x30a4b7(0x155)][_0x30a4b7(0x261)](_0x441ea6,_0x24d055),{'verbose':_0x2bdd23['verbose']}),_0x26f7cd=_0x238ae7[_0x30a4b7(0x117)];if(_0x26f7cd[_0x30a4b7(0x1d3)]===0x0)return console[_0x30a4b7(0x188)](_0x30a4b7(0x270)),0x0;if(!_0x24d055&&(_0x2bdd23[_0x30a4b7(0x1cd)]||_0x2bdd23[_0x30a4b7(0x15c)]))return await handleSDKOutput(_0x26f7cd,_0x2bdd23),0x0;if(!_0x24d055){const _0x359306=_0x26f7cd['map'](_0xf19024=>({'title':_0xf19024[_0x30a4b7(0x108)]+'\x20('+formatBytes(_0xf19024[_0x30a4b7(0x1ae)])+')','value':_0xf19024['taskName']})),_0x457ea1=await a56_0x3a0ef2({'type':_0x30a4b7(0x162),'name':_0x30a4b7(0x1b2),'message':_0x30a4b7(0x21f),'choices':_0x359306});if(!_0x457ea1[_0x30a4b7(0x1b2)])return console['error'](_0x30a4b7(0x181)),0x0;_0x24d055=_0x457ea1[_0x30a4b7(0x1b2)];}const _0x15daf4=await withSpinner('Downloading\x20logs...',()=>_0x228aee[_0x30a4b7(0x155)][_0x30a4b7(0x204)](_0x441ea6,_0x24d055),{'verbose':_0x2bdd23[_0x30a4b7(0x231)]}),_0x3cf326=_0x15daf4[_0x30a4b7(0x117)];return _0x3cf326?console[_0x30a4b7(0xe6)](_0x3cf326):console[_0x30a4b7(0x188)](_0x30a4b7(0x1fc)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a56_0x5ef62e(0x104);[a56_0x5ef62e(0x282)]=a56_0x5ef62e(0x14f);async['execute'](_0x24c5e3){const _0x1772fa=a56_0x5ef62e,{options:_0x152f72,args:_0x3b01da,tdx:_0x40edf2}=_0x24c5e3,_0x2f2bfd=_0x3b01da[0x0];if(!_0x2f2bfd)return console[_0x1772fa(0x188)](_0x1772fa(0x25c)),0x1;const _0x22ed53=_0x152f72[_0x1772fa(0x236)];_0x152f72[_0x1772fa(0x231)]&&(console[_0x1772fa(0x188)](_0x1772fa(0x277)+_0x2f2bfd),_0x22ed53&&console[_0x1772fa(0x188)](_0x1772fa(0x1e1)+_0x22ed53));if(!_0x152f72['yes']){if(!isInteractive())return console[_0x1772fa(0x188)](a56_0x511120['red']('\x0aError:'),_0x1772fa(0x25f)),console[_0x1772fa(0x188)](a56_0x511120[_0x1772fa(0x149)](_0x1772fa(0x19c))),0x1;const _0x49f352=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x2f2bfd+'?');if(!_0x49f352)return console[_0x1772fa(0x188)](a56_0x511120['yellow'](_0x1772fa(0x181))),0x1;}const _0x3d9541=await withSpinner(_0x1772fa(0x27b),()=>_0x40edf2[_0x1772fa(0x155)][_0x1772fa(0x28e)](_0x2f2bfd,_0x22ed53),{'verbose':_0x152f72['verbose']}),_0x11894c=_0x3d9541[_0x1772fa(0x117)];return console[_0x1772fa(0x188)]('✔\x20'+_0x11894c),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a56_0x5ef62e(0x29d);[a56_0x5ef62e(0x282)]='Retry\x20a\x20session\x20or\x20attempt';async[a56_0x5ef62e(0x217)](_0x167c0e){const _0x36709e=a56_0x5ef62e,{options:_0xc9e20b,args:_0x5964ed,tdx:_0x3db453}=_0x167c0e,_0x2ed0d2=_0x5964ed[0x0];if(!_0x2ed0d2)return console['error'](_0x36709e(0x23a)),console['error'](_0x36709e(0x279)),0x1;let _0x3aebd6=![],_0x372c8b=_0x2ed0d2;if(_0x2ed0d2[_0x36709e(0x244)](_0x36709e(0x17b)))_0x3aebd6=!![],_0x372c8b=_0x2ed0d2[_0x36709e(0x299)](0x8);else{if(_0x2ed0d2[_0x36709e(0x244)](_0x36709e(0x120)))_0x3aebd6=![],_0x372c8b=_0x2ed0d2[_0x36709e(0x299)](0x8);else return console[_0x36709e(0x188)](_0x36709e(0x14d)),console[_0x36709e(0x188)](_0x36709e(0x279)),0x1;}const _0x281200=_0xc9e20b[_0x36709e(0x189)],_0x520119=_0xc9e20b['resumeFrom'],_0x5ad268=_0xc9e20b[_0x36709e(0x26c)],_0x8a7b0f=_0xc9e20b['force'];_0xc9e20b[_0x36709e(0x231)]&&(console[_0x36709e(0x188)](_0x36709e(0x249)+(_0x3aebd6?_0x36709e(0x296):_0x36709e(0x213))+'\x20'+_0x372c8b),_0x281200&&console['error']('From\x20task:\x20'+_0x281200),_0x520119&&console['error'](_0x36709e(0x114)+_0x520119),_0x5ad268&&console[_0x36709e(0x188)](_0x36709e(0x169)+_0x5ad268),_0x8a7b0f&&console[_0x36709e(0x188)](_0x36709e(0x20f)));let _0x4eec02;if(_0x5ad268)try{if(_0x5ad268[_0x36709e(0x244)]('@')){const _0xe9b603=await import(_0x36709e(0x24c)),_0x29abf4=_0x5ad268[_0x36709e(0x299)](0x1),_0x4c7d01=await _0xe9b603[_0x36709e(0x179)](_0x29abf4,_0x36709e(0x275));_0x4eec02=JSON[_0x36709e(0x21a)](_0x4c7d01);}else _0x4eec02=JSON[_0x36709e(0x21a)](_0x5ad268);}catch{return console['error']('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0xc9e20b[_0x36709e(0x20e)]){if(!isInteractive())return console['error'](a56_0x511120[_0x36709e(0xe7)](_0x36709e(0x295)),_0x36709e(0x25f)),console[_0x36709e(0x188)](a56_0x511120[_0x36709e(0x149)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4fe544=await confirmKey(_0x36709e(0x191)+(_0x3aebd6?_0x36709e(0x296):_0x36709e(0x213))+'\x20'+_0x372c8b+'?');if(!_0x4fe544)return console[_0x36709e(0x188)](a56_0x511120[_0x36709e(0x29c)](_0x36709e(0x181))),0x1;}let _0x3f7d37;_0x3aebd6?_0x3f7d37=await withSpinner('Retrying\x20session...',()=>_0x3db453['workflow'][_0x36709e(0x1b5)](_0x372c8b,{'fromTask':_0x281200,'retryParams':_0x4eec02}),{'verbose':_0xc9e20b[_0x36709e(0x231)]}):_0x3f7d37=await withSpinner('Retrying\x20attempt...',()=>_0x3db453[_0x36709e(0x155)]['retryAttempt'](_0x372c8b,{'resumeFrom':_0x520119,'retryParams':_0x4eec02,'force':_0x8a7b0f}),{'verbose':_0xc9e20b['verbose']});const _0x464a83=_0x3f7d37[_0x36709e(0x117)];return console[_0x36709e(0x188)](_0x36709e(0x1e2)),console[_0x36709e(0x188)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x464a83[_0x36709e(0x23c)]),console['error']('\x20\x20Session\x20ID:\x20'+_0x464a83['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a56_0x5ef62e(0xfe)]=a56_0x5ef62e(0x286);[a56_0x5ef62e(0x282)]='Start\x20a\x20workflow\x20run';async[a56_0x5ef62e(0x217)](_0x52969a){const _0x4f1cf7=a56_0x5ef62e,{options:_0x29992f,args:_0x149932,tdx:_0x41a135}=_0x52969a;let _0x156341=_0x149932[0x0];if(!_0x156341){const _0x46b134=this[_0x4f1cf7(0x234)]([],_0x29992f),_0x5247ed=await withSpinner(_0x4f1cf7(0x20b),()=>_0x41a135[_0x4f1cf7(0x155)][_0x4f1cf7(0xf9)](_0x46b134,{'limit':_0x29992f[_0x4f1cf7(0x226)]}),{'verbose':_0x29992f[_0x4f1cf7(0x231)]}),_0x3036d5=_0x5247ed[_0x4f1cf7(0x117)];if(_0x3036d5[_0x4f1cf7(0x1d3)]===0x0)return console['error'](_0x4f1cf7(0x263)),!_0x46b134&&console[_0x4f1cf7(0x188)](a56_0x511120[_0x4f1cf7(0x149)](_0x4f1cf7(0x12d))),0x1;const _0x1f670a=_0x3036d5[_0x4f1cf7(0x1f8)](_0x36e66d=>({'title':_0x36e66d['project']?.[_0x4f1cf7(0xfe)]+'.'+_0x36e66d[_0x4f1cf7(0xfe)],'value':_0x36e66d['project']?.[_0x4f1cf7(0xfe)]+'.'+_0x36e66d['name'],'description':_0x36e66d['revision']?_0x4f1cf7(0x290)+_0x36e66d[_0x4f1cf7(0x22e)]:undefined})),_0x184d53=await a56_0x3a0ef2({'type':_0x4f1cf7(0x162),'name':_0x4f1cf7(0x155),'message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x1f670a});if(!_0x184d53['workflow'])return 0x1;_0x156341=_0x184d53[_0x4f1cf7(0x155)];}if(!_0x156341['includes']('.')){const _0x2aa5e6=this[_0x4f1cf7(0x234)]([],_0x29992f);if(_0x2aa5e6)_0x156341=_0x2aa5e6+'.'+_0x156341;else return console[_0x4f1cf7(0x188)](a56_0x511120['red'](_0x4f1cf7(0x101)),_0x4f1cf7(0x112)),console[_0x4f1cf7(0x188)](a56_0x511120['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x4d75f8=_0x29992f[_0x4f1cf7(0x1fd)],_0x1fa552=_0x29992f['sessionTime'],_0x2da4bb={};if(_0x4d75f8&&Array[_0x4f1cf7(0x28d)](_0x4d75f8))for(const _0x46640d of _0x4d75f8){const _0x430d6f=_0x46640d[_0x4f1cf7(0x1de)]('=');if(_0x430d6f===-0x1)return console[_0x4f1cf7(0x188)](_0x4f1cf7(0xdf)+_0x46640d),console[_0x4f1cf7(0x188)](_0x4f1cf7(0x288)),0x1;const _0x40e427=_0x46640d[_0x4f1cf7(0x299)](0x0,_0x430d6f),_0x55d3cf=_0x46640d[_0x4f1cf7(0x299)](_0x430d6f+0x1);try{_0x2da4bb[_0x40e427]=JSON[_0x4f1cf7(0x21a)](_0x55d3cf);}catch{_0x2da4bb[_0x40e427]=_0x55d3cf;}}_0x29992f['verbose']&&(console[_0x4f1cf7(0x188)](_0x4f1cf7(0x123)+_0x156341),Object[_0x4f1cf7(0xe2)](_0x2da4bb)[_0x4f1cf7(0x1d3)]>0x0&&console[_0x4f1cf7(0x188)](_0x4f1cf7(0xfd)+JSON[_0x4f1cf7(0xfa)](_0x2da4bb)),_0x1fa552&&console[_0x4f1cf7(0x188)](_0x4f1cf7(0x29a)+_0x1fa552));if(_0x29992f['dryRun'])return await this[_0x4f1cf7(0x1da)](_0x52969a,_0x156341,_0x2da4bb,_0x1fa552);const _0x58e2f7=await withSpinner(_0x4f1cf7(0x1e5),()=>_0x41a135[_0x4f1cf7(0x155)]['run'](_0x156341,_0x2da4bb,{'sessionTime':_0x1fa552}),{'verbose':_0x29992f[_0x4f1cf7(0x231)]}),_0x7f0189=_0x58e2f7[_0x4f1cf7(0x117)];console[_0x4f1cf7(0x188)](_0x4f1cf7(0x130)),console[_0x4f1cf7(0x188)]('\x20\x20Attempt\x20ID:\x20'+_0x7f0189['id']),console[_0x4f1cf7(0x188)]('\x20\x20Session\x20ID:\x20'+_0x7f0189['sessionId']),console['error'](_0x4f1cf7(0x1dd)+_0x7f0189['project']?.[_0x4f1cf7(0xfe)]),console[_0x4f1cf7(0x188)](_0x4f1cf7(0x1c4)+_0x7f0189[_0x4f1cf7(0x155)]?.[_0x4f1cf7(0xfe)]);if(_0x7f0189['project']?.['id']&&_0x7f0189[_0x4f1cf7(0x253)]&&_0x7f0189['id']){const _0x4e6373=_0x29992f[_0x4f1cf7(0x124)],_0xa0698=getConsoleUrl(_0x4e6373,_0x4f1cf7(0x25a)+_0x7f0189[_0x4f1cf7(0x274)]['id']+_0x4f1cf7(0x109)+_0x7f0189[_0x4f1cf7(0x253)]+_0x4f1cf7(0x151)+_0x7f0189['id']);console[_0x4f1cf7(0x188)](_0x4f1cf7(0x12e)+a56_0x511120[_0x4f1cf7(0x11e)](_0xa0698));}return 0x0;}async[a56_0x5ef62e(0x1da)](_0x360496,_0x2f2756,_0x242b8a,_0x1250c5){const _0xdc08f0=a56_0x5ef62e,{options:_0x1012eb,tdx:_0x4362a1}=_0x360496,_0x45ea3d=await withSpinner('Fetching\x20workflow\x20'+_0x2f2756+_0xdc08f0(0x214),()=>_0x4362a1[_0xdc08f0(0x155)][_0xdc08f0(0x238)](_0x2f2756),{'verbose':_0x1012eb[_0xdc08f0(0x231)]}),_0x343290=_0x45ea3d['data'],_0x30e2b4=_0x1250c5??new Date()[_0xdc08f0(0x29e)]();console[_0xdc08f0(0xe6)](a56_0x511120['bold'](_0xdc08f0(0x1ff)),_0x2f2756),console[_0xdc08f0(0xe6)](a56_0x511120[_0xdc08f0(0x1f3)](_0xdc08f0(0x10e)),_0x30e2b4),console[_0xdc08f0(0xe6)](a56_0x511120[_0xdc08f0(0x1f3)]('Parameters:'),JSON[_0xdc08f0(0xfa)](_0x242b8a)),console[_0xdc08f0(0xe6)](''),console[_0xdc08f0(0xe6)](a56_0x511120[_0xdc08f0(0x1f3)](_0xdc08f0(0x23e)));const _0x53a011=parseTaskGraph(_0x343290[_0xdc08f0(0x230)]??null);if(_0x53a011[_0xdc08f0(0x1d3)]===0x0)console['log'](a56_0x511120[_0xdc08f0(0x149)]('\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)'));else for(const _0x5cb48c of formatTaskGraph(_0x53a011)){console[_0xdc08f0(0xe6)](_0x5cb48c);}const _0x1d8508=summarizeTaskGraph(_0x53a011),_0x553e22=formatWarningSummary(_0x1d8508);return _0x553e22&&(console['log'](''),console['log'](a56_0x511120[_0xdc08f0(0x29c)](_0x553e22))),console[_0xdc08f0(0xe6)](a56_0x511120[_0xdc08f0(0x29c)]('\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.')),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']='workflow:download';[a56_0x5ef62e(0x282)]=a56_0x5ef62e(0x1fb);async['execute'](_0x4af1be){const _0x49ced0=a56_0x5ef62e,{options:_0x263128,args:_0x557f6d,tdx:_0x220b76}=_0x4af1be,_0x52713a=_0x557f6d[0x0],_0x3599c1=_0x557f6d[0x1]||'.';if(!_0x52713a)return console[_0x49ced0(0x188)](_0x49ced0(0x1d1)),console[_0x49ced0(0x188)](_0x49ced0(0x180)),0x1;const _0x131b2f=_0x263128['revision'];_0x263128[_0x49ced0(0x231)]&&(console['error'](_0x49ced0(0x1ad)+_0x52713a),console[_0x49ced0(0x188)](_0x49ced0(0x111)+_0x3599c1),_0x131b2f&&console['error']('Revision:\x20'+_0x131b2f));const _0x18d886=await withSpinner(_0x49ced0(0x1ba)+_0x52713a+'...',()=>_0x220b76[_0x49ced0(0x155)]['download'](_0x52713a,_0x3599c1,{'revision':_0x131b2f}),{'verbose':_0x263128[_0x49ced0(0x231)]}),_0x16ad11=_0x18d886[_0x49ced0(0x117)];return console[_0x49ced0(0x188)]('✔\x20Downloaded\x20'+_0x16ad11[_0x49ced0(0x25e)]),console['error'](_0x49ced0(0x127)+_0x16ad11[_0x49ced0(0x22e)]),console['error'](_0x49ced0(0x1c0)+_0x16ad11[_0x49ced0(0x298)]),console[_0x49ced0(0x188)](_0x49ced0(0x284)+_0x3599c1+'/'+_0x16ad11[_0x49ced0(0x25e)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a56_0x5ef62e(0xfe)]=a56_0x5ef62e(0x28b);[a56_0x5ef62e(0x282)]=a56_0x5ef62e(0x218);async['execute'](_0x4129e0){const _0x2f2ee3=a56_0x5ef62e,{options:_0x525e90,args:_0x53479a,tdx:_0xafb1b1}=_0x4129e0;let _0x40ca3d='.',_0x123a6e=_0x525e90[_0x2f2ee3(0xfe)];if(_0x53479a[0x0]){const {promises:_0x222673}=await import('fs');try{const _0x542359=await _0x222673[_0x2f2ee3(0x122)](_0x53479a[0x0]);if(_0x542359['isDirectory']())_0x40ca3d=_0x53479a[0x0];else return console[_0x2f2ee3(0x188)](_0x2f2ee3(0x23b)+_0x53479a[0x0]+_0x2f2ee3(0x276)),0x1;}catch{_0x123a6e=_0x53479a[0x0],_0x40ca3d='.';}}const _0x39764b=_0x525e90['revision'],_0x247451=_0x525e90[_0x2f2ee3(0x23f)];_0x525e90['verbose']&&(console[_0x2f2ee3(0x188)]('Project\x20directory:\x20'+_0x40ca3d),_0x123a6e&&console[_0x2f2ee3(0x188)]('Project\x20name:\x20'+_0x123a6e),_0x39764b&&console[_0x2f2ee3(0x188)]('Revision:\x20'+_0x39764b),_0x247451&&console['error'](_0x2f2ee3(0x26b)));const _0x11cd7f=await withSpinner(_0x2f2ee3(0x1df),()=>_0xafb1b1['workflow'][_0x2f2ee3(0x14b)](_0x40ca3d,{'projectName':_0x123a6e,'revision':_0x39764b,'skipValidation':_0x247451}),{'verbose':_0x525e90[_0x2f2ee3(0x231)]}),_0x26b95c=_0x11cd7f[_0x2f2ee3(0x117)];return console[_0x2f2ee3(0x188)](_0x2f2ee3(0x178)+_0x26b95c[_0x2f2ee3(0x25e)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x26b95c['projectId']),console[_0x2f2ee3(0x188)](_0x2f2ee3(0x127)+_0x26b95c[_0x2f2ee3(0x22e)]),await this[_0x2f2ee3(0x100)](_0xafb1b1,_0x26b95c['projectName'],_0x525e90['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a56_0x5ef62e(0xfe)]=a56_0x5ef62e(0x156);['description']=a56_0x5ef62e(0x177);async[a56_0x5ef62e(0x217)](_0x2a3d5b){const _0x4236ae=a56_0x5ef62e,{options:_0x481bd7,args:_0x8c92f9,tdx:_0x42b24c}=_0x2a3d5b,_0x1adb09=_0x8c92f9[0x0],_0x4db72a=_0x8c92f9[0x1];if(!_0x1adb09)return console[_0x4236ae(0x188)](a56_0x511120[_0x4236ae(0xe7)](_0x4236ae(0x101)),'Project\x20name\x20is\x20required'),console[_0x4236ae(0x188)](a56_0x511120[_0x4236ae(0x149)](_0x4236ae(0x220))),0x1;const _0x12d137=_0x481bd7['revision'];_0x481bd7['verbose']&&(console[_0x4236ae(0x188)]('Project:\x20'+_0x1adb09),_0x4db72a&&console[_0x4236ae(0x188)]('Target\x20directory:\x20'+_0x4db72a),_0x12d137&&console[_0x4236ae(0x188)]('Revision:\x20'+_0x12d137),_0x481bd7['dryRun']&&console[_0x4236ae(0x188)](_0x4236ae(0x25d)));const _0x4683d7=await withSpinner(_0x4236ae(0x1a9)+_0x1adb09+_0x4236ae(0x214),()=>_0x42b24c[_0x4236ae(0x155)][_0x4236ae(0x1e9)](_0x1adb09,{'targetDir':_0x4db72a,'revision':_0x12d137}),{'verbose':_0x481bd7['verbose']}),_0x1c9ee3=_0x4683d7['data'];_0x1c9ee3[_0x4236ae(0x1e3)]?console[_0x4236ae(0x188)](_0x4236ae(0x1f4)+_0x1c9ee3['projectName']):console['error'](_0x4236ae(0x190)+_0x1c9ee3[_0x4236ae(0x25e)]);console['error'](_0x4236ae(0x127)+_0x1c9ee3[_0x4236ae(0x22e)]),console[_0x4236ae(0x188)](_0x4236ae(0x1f1)+(a56_0x384ad3['relative'](process[_0x4236ae(0x185)](),_0x1c9ee3[_0x4236ae(0x27a)])||'.')),console[_0x4236ae(0x188)](_0x4236ae(0x2a0)+a56_0x511120[_0x4236ae(0x131)]('+'+_0x1c9ee3[_0x4236ae(0x1a0)]['new']+_0x4236ae(0x1e7))+',\x20'+(a56_0x511120['yellow']('~'+_0x1c9ee3[_0x4236ae(0x1a0)][_0x4236ae(0x183)]+_0x4236ae(0x144))+',\x20')+(a56_0x511120[_0x4236ae(0xe7)]('-'+_0x1c9ee3[_0x4236ae(0x1a0)]['deleted']+'\x20deleted')+',\x20')+(''+a56_0x511120[_0x4236ae(0x149)](_0x1c9ee3[_0x4236ae(0x1a0)][_0x4236ae(0x201)]+_0x4236ae(0x207))));for(const _0x37add5 of _0x1c9ee3['changes']){_0x37add5[_0x4236ae(0x21e)]===_0x4236ae(0x183)&&_0x37add5[_0x4236ae(0x289)]&&(console[_0x4236ae(0x188)]('\x0a'+a56_0x511120['cyan'](_0x4236ae(0x1eb)+_0x37add5[_0x4236ae(0x17d)])),console[_0x4236ae(0x188)](_0x37add5[_0x4236ae(0x289)]));}if(!_0x1c9ee3[_0x4236ae(0x167)])return saveSessionContext({'workflow_project':_0x1c9ee3[_0x4236ae(0x25e)]},_0x481bd7[_0x4236ae(0x296)]),console[_0x4236ae(0x188)](a56_0x511120[_0x4236ae(0x131)](_0x4236ae(0x194))),console[_0x4236ae(0x188)](a56_0x511120['dim'](_0x4236ae(0x134)+_0x1c9ee3['projectName'])),0x0;if(_0x481bd7[_0x4236ae(0x105)])return console['error'](a56_0x511120['yellow'](_0x4236ae(0x29b))),0x0;if(!_0x481bd7[_0x4236ae(0x20e)]){if(!isInteractive())return console[_0x4236ae(0x188)](a56_0x511120['red'](_0x4236ae(0x295)),_0x4236ae(0x25f)),console[_0x4236ae(0x188)](a56_0x511120['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x27ee5e=await confirmKey(_0x4236ae(0x1a1));if(!_0x27ee5e)return console['error'](a56_0x511120['yellow'](_0x4236ae(0x181)),_0x4236ae(0x291)),0x1;}await withSpinner(_0x4236ae(0x255),()=>_0x42b24c[_0x4236ae(0x155)][_0x4236ae(0x193)](_0x1c9ee3,{'revision':_0x12d137}),{'verbose':_0x481bd7[_0x4236ae(0x231)]}),saveSessionContext({'workflow_project':_0x1c9ee3['projectName']},_0x481bd7['session']),console[_0x4236ae(0x188)](a56_0x511120[_0x4236ae(0x131)]('✔\x20Pull\x20complete'));const _0x2e640a=a56_0x384ad3['relative'](process[_0x4236ae(0x185)](),_0x1c9ee3[_0x4236ae(0x27a)])||'.';return console[_0x4236ae(0x188)](a56_0x511120[_0x4236ae(0x149)](_0x4236ae(0x284)+_0x2e640a)),console[_0x4236ae(0x188)](a56_0x511120['dim'](_0x4236ae(0x134)+_0x1c9ee3[_0x4236ae(0x25e)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a56_0x5ef62e(0x16f);['description']=a56_0x5ef62e(0x184);async['execute'](_0x260453){const _0x381c5c=a56_0x5ef62e,{options:_0xbdfd1e,args:_0x583f66,tdx:_0x5aee88}=_0x260453,_0x3d9be4=this[_0x381c5c(0xec)](_0x583f66,_0xbdfd1e),_0x518c53=_0xbdfd1e,{revision:_0x463ee2,skipValidation:_0x4e0cd7,backfill:_0x3e1095}=_0x518c53,_0x38fa66=_0x3e1095===undefined?undefined:!_0x3e1095;_0xbdfd1e['verbose']&&(_0x3d9be4&&console[_0x381c5c(0x188)](_0x381c5c(0x292)+_0x3d9be4),_0x463ee2&&console['error']('Revision:\x20'+_0x463ee2),_0xbdfd1e[_0x381c5c(0x105)]&&console[_0x381c5c(0x188)](_0x381c5c(0x25d)),_0x4e0cd7&&console[_0x381c5c(0x188)](_0x381c5c(0x26b)),_0x3e1095&&console[_0x381c5c(0x188)](_0x381c5c(0x17e)));let _0x59d96c;try{_0x59d96c=await withSpinner(_0x381c5c(0x27f),()=>_0x5aee88[_0x381c5c(0x155)][_0x381c5c(0x10f)]({'sourceDir':_0x3d9be4,'revision':_0x463ee2,'skipValidation':_0x4e0cd7,'skipSchedule':_0x38fa66}),{'verbose':_0xbdfd1e[_0x381c5c(0x231)]});}catch(_0x17e3f3){if(_0x17e3f3 instanceof Error&&_0x17e3f3['message'][_0x381c5c(0x15e)]('No\x20workflow\x20tdx.json\x20found'))return console['error'](a56_0x511120[_0x381c5c(0xe7)](_0x381c5c(0x101)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0xbdfd1e[_0x381c5c(0xf6)]?console[_0x381c5c(0x188)](a56_0x511120[_0x381c5c(0x149)]('Tip:\x20cd\x20to\x20workflows/'+_0xbdfd1e[_0x381c5c(0xf6)]+_0x381c5c(0x26a)+_0xbdfd1e[_0x381c5c(0xf6)]+'\x27')):console[_0x381c5c(0x188)](a56_0x511120['dim']('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x17e3f3;}const _0x1ad973=_0x59d96c[_0x381c5c(0x117)];console[_0x381c5c(0x188)](_0x381c5c(0x107)+_0x1ad973['projectName']),console['error'](_0x381c5c(0x268)+_0x1ad973[_0x381c5c(0x1dc)]),console[_0x381c5c(0x188)]('\x20\x20Revision:\x20'+_0x1ad973[_0x381c5c(0x22e)]),console[_0x381c5c(0x188)](_0x381c5c(0x2a0)+a56_0x511120[_0x381c5c(0x131)]('+'+_0x1ad973[_0x381c5c(0x1a0)]['new']+_0x381c5c(0x1e7))+',\x20'+(a56_0x511120[_0x381c5c(0x29c)]('~'+_0x1ad973[_0x381c5c(0x1a0)][_0x381c5c(0x183)]+_0x381c5c(0x144))+',\x20')+(a56_0x511120[_0x381c5c(0xe7)]('-'+_0x1ad973['summary'][_0x381c5c(0x16a)]+_0x381c5c(0x28a))+',\x20')+(''+a56_0x511120['dim'](_0x1ad973[_0x381c5c(0x1a0)]['unchanged']+_0x381c5c(0x207))));for(const _0x275bfa of _0x1ad973[_0x381c5c(0x1bb)]){_0x275bfa[_0x381c5c(0x21e)]===_0x381c5c(0x183)&&_0x275bfa[_0x381c5c(0x289)]&&(console[_0x381c5c(0x188)]('\x0a'+a56_0x511120[_0x381c5c(0x11e)](_0x381c5c(0x1eb)+_0x275bfa[_0x381c5c(0x17d)])),console[_0x381c5c(0x188)](_0x275bfa[_0x381c5c(0x289)]));}if(!_0x1ad973[_0x381c5c(0x167)])return console[_0x381c5c(0x188)](a56_0x511120[_0x381c5c(0x131)](_0x381c5c(0x172))),await this[_0x381c5c(0x100)](_0x5aee88,_0x1ad973[_0x381c5c(0x25e)],_0xbdfd1e[_0x381c5c(0x124)]),0x0;if(_0xbdfd1e[_0x381c5c(0x105)])return console['error'](a56_0x511120['yellow'](_0x381c5c(0x19b))),0x0;if(!_0xbdfd1e[_0x381c5c(0x20e)]){if(!isInteractive())return console[_0x381c5c(0x188)](a56_0x511120[_0x381c5c(0xe7)](_0x381c5c(0x295)),_0x381c5c(0x25f)),console[_0x381c5c(0x188)](a56_0x511120[_0x381c5c(0x149)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x378d9d=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x378d9d)return console[_0x381c5c(0x188)](a56_0x511120[_0x381c5c(0x29c)](_0x381c5c(0x181)),_0x381c5c(0x1e6)),0x1;}const _0x35d5c6=await withSpinner(_0x381c5c(0x1f5),()=>_0x5aee88[_0x381c5c(0x155)][_0x381c5c(0x10d)](_0x1ad973),{'verbose':_0xbdfd1e[_0x381c5c(0x231)]}),_0x4cca9e=_0x35d5c6[_0x381c5c(0x117)];return console['error'](a56_0x511120['green']('✔\x20Push\x20complete')),console[_0x381c5c(0x188)]('\x20\x20Project\x20ID:\x20'+_0x4cca9e[_0x381c5c(0xe0)]),console['error'](_0x381c5c(0x127)+_0x4cca9e[_0x381c5c(0x22e)]),await this[_0x381c5c(0x100)](_0x5aee88,_0x4cca9e[_0x381c5c(0x25e)],_0xbdfd1e['site']),0x0;}}function a56_0x1196(){const _0x33ce92=['4572VANPVL','\x0aDry\x20run\x20-\x20nothing\x20pushed','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','ICON_SPACING','No\x20attempts\x20found','workflow:schedules','summary','\x0aApply\x20these\x20changes?','No\x20sessions\x20found\x20in\x20project:\x20','round','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','getHours','context','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','success','Pulling\x20project\x20','\x20enabled\x20(','\x27\x20from\x20project\x20\x27','\x20from\x20session\x20','Project:\x20','fileSize','workflow:clone','List\x20workflows','No\x20sessions\x20found\x20for:\x20','task','\x20project','finishedAt','retrySession','📅\x20#','Project\x20filter:\x20','trim','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Downloading\x20project\x20','changes','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','(unknown)','✔\x20Deleted\x20project\x20','trimEnd','\x20\x20Files\x20extracted:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Attempt:\x20','Enabling\x20schedule\x20#','\x20\x20Workflow:\x20','workflow:timeline','Project\x20name\x20is\x20required','basename','msPerChar','existingProjectId','slice','Auto-selected\x20latest\x20session:\x20','generateSessionTimelineRows','json','message','Loading\x20sessions...','pollTimeline','Error:\x20Project\x20name\x20is\x20required','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','length','\x20tasks','Source:\x20','state','Loading\x20session...','localeCompare','floor','executeDryRun','rows','sourceDir','\x20\x20Project:\x20','indexOf','Pushing\x20workflow\x20project...','join','Reason:\x20','✔\x20Retry\x20started','isNewProject','navigateSessionsInteractive','Starting\x20workflow\x20run...','-\x20nothing\x20pushed','\x20new','Disable\x20a\x20workflow\x20schedule','pullProject','Show\x20specific\x20attempt\x20details','---\x20','getMonth','startTime','Revision:\x20','Filter:\x20project=','workflow:schedule:enable','\x20\x20Target:\x20','renderSingleTimeline','bold','→\x20New\x20project:\x20','Pushing\x20project...','Source\x20directory\x20is\x20required','newProjectName','map','Usage:\x20tdx\x20wf\x20use\x20<project>','title','Download\x20workflow\x20project\x20from\x20Treasure\x20AI','No\x20log\x20content\x20found','param','Session\x20','Workflow:','renderSessionsTimeline','unchanged','Filter:\x20','metadata','logs',',\x20Workflow:\x20','nextRunTime','\x20unchanged','executeCloneProject','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','get','Loading\x20workflows...','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','yes','Force:\x20yes','No\x20workflow\x20projects\x20found','running','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','attempt','...','\x0a⚠\x20Project\x20\x22','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','execute','Upload\x20workflow\x20project\x20to\x20Treasure\x20AI\x20(digdag-style)','4035536FVsAqR','parse','find','renderTimeline','blue','type','Select\x20a\x20task\x20to\x20view\x20logs:','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','\x1b[1A\x1b[2K','Session\x20not\x20found:\x20','\x20\x20Project\x20ID:\x20','lastAttempt','No\x20sessions\x20with\x20timing\x20information','limit','Using\x20attempt\x20','Analyzing\x20project...','\x20schedule','Including\x20subtasks:\x20yes','\x20\x20tdx\x20wf\x20use\x20<project>','workflow:tasks','MAX_TASKS_DISPLAY','revision','skipSchedule','config','verbose','\x20(use\x20--limit\x20to\x20show\x20more)','Getting\x20attempt\x20details...','resolveProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','reason','listSchedules','getWorkflow','start','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Error:\x20','attemptId','Fetching\x20log\x20files...','Task\x20graph:','skipValidation','1211602MonmFn','replace','sys','3561EOCudY','startsWith','\x20secret','\x0aPolling...\x20(','282525ZwuoEv','MAX_POLL_ITERATIONS','Target:\x20','.\x20Expected\x20format:\x20KEY=VALUE','tdx\x20wf\x20attempt\x20','fs/promises','disableSchedule','33890EQjVKv','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','isTTY','splice','requireProject','sessionId','some','Writing\x20files...','getFullYear','Status:\x20','\x20sessions\x20','group_error','/app/workflows/','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Error:\x20Attempt\x20ID\x20is\x20required','Dry\x20run:\x20yes','projectName','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','--schedule-id\x20cannot\x20be\x20combined\x20with\x20a\x20project.workflow\x20filter','logFiles','sessions','No\x20workflows\x20found','newProjectId','pending','padStart','\x0aFailed\x20to\x20fetch\x20attempt\x20data','\x20\x20Source:\x20','MIN_TIMELINE_WIDTH','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Validation:\x20skipped','params','stdout','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','done','No\x20log\x20files\x20found\x20for\x20this\x20attempt','fill','✔\x20Secret\x20\x27','workflow:sessions','project','utf-8','\x20is\x20not\x20a\x20directory','Attempt\x20ID:\x20','No\x20matching\x20sessions\x20found','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','targetDir','Killing\x20attempt...','projects','workflowName','columns','Analyzing\x20changes...','✔\x20Schedule\x20#','window','description','workflow:attempt','\x20\x20Location:\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','workflow:run','\x20logs','Expected\x20format:\x20--param\x20key=value','diff','\x20deleted','workflow:upload','\x20secrets...','isArray','kill','workflow:secrets:set','revision:\x20','-\x20no\x20files\x20written','Source\x20directory:\x20','\x20of\x20','💡\x20Tip:\x20Use\x20','\x0aError:','session','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','filesExtracted','substring','Session\x20time:\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','yellow','workflow:retry','toISOString','cancelRequested','\x20\x20Changes:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','startedAt','⚠\x20Showing\x20first\x20','GUTTER','list','retryAttemptName','Select\x20a\x20session\x20to\x20view\x20timeline:','toLocaleString','Task\x20name:\x20','Error:\x20Invalid\x20parameter\x20format:\x20','projectId','clear','keys','✔\x20Project\x20updated','sessionTime','output','log','red','sourceProjectName','📋\x20','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','fullName','resolveProjectDir','all','LABEL_MIN_SPACING','Secrets\x20to\x20set:\x20','Listing\x20workflows...','now','workflow:logs','buildTimelineData','Fetching\x20schedule\x20#','index','workflowProject','Setting\x20','parseProjectWorkflowPattern','workflows','stringify','white','List\x20all\x20workflow\x20projects','Parameters:\x20','name','getTime','showWorkflowConsoleUrl','Error:','\x20(disabled)','icon','workflow:kill','dryRun','total','✔\x20Project:\x20','taskName','/sessions/','Total:\x20','tasks','✔\x20Workflow\x20project\x20set\x20to:\x20','executePushProject','Session\x20time:','preparePushProject','filter','Output\x20directory:\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','repeat','Resume\x20from:\x20','Setting\x20secret...','Schedule\x20ID\x20is\x20required','data','workflow:secrets:list','\x20\x20Next\x20run:\x20','key','\x20attempt','match','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','cyan','displayLine','attempt:','No\x20sessions\x20found','stat','Workflow:\x20','site','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','listProjectSchedules','\x20\x20Revision:\x20','64130CAIWmg','No\x20schedules\x20found','List\x20workflow\x20execution\x20sessions','workflow:projects','Cloning\x20to\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x20\x20Console:\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','✔\x20Workflow\x20run\x20started','green','table','canceling','\x20\x20Session\x20context\x20set\x20to:\x20','end','Updating\x20','Warning:','\x20workflow','Error:\x20Secret\x20key\x20is\x20required','resolve','(use\x20--limit\x20to\x20see\x20more)','POLL_INTERVAL_MS','MAX_TIMELINE_WIDTH','Listing\x20workflow\x20sessions...','New\x20project\x20name:\x20','value','planned','\x0aDry\x20run\x20-\x20no\x20project\x20created','updatedAt','\x20modified','min','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','toLowerCase','dim','workflow:secrets:delete','push','\x20-\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x22?\x20This\x20cannot\x20be\x20undone.','Kill\x20a\x20running\x20attempt','tdx.json','/attempt/','\x20next:\x20','\x20disabled\x20(','jsonl','workflow','workflow:pull','follow','targetExists','\x20to\x20see\x20detailed\x20logs','getDate','Disabling\x20schedule\x20#','format','write','includes','Delete\x20workflow\x20project\x20from\x20Treasure\x20AI','Resolving\x20project\x20\x27','Listing\x20schedules\x20for\x20','select','set','✔\x20Schedule\x20found','Pattern:\x20','setSecrets','hasChanges','📁\x20','Params:\x20','deleted','Listing\x20workflow\x20attempts...','attempts','sort','duration','workflow:push','No\x20workflow\x20sessions\x20found','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','\x0a✔\x20No\x20changes\x20to\x20push','every','ICON_WIDTH','List\x20workflow\x20attempts','Latest\x20session\x20has\x20no\x20attempt','Pull\x20workflow\x20project\x20to\x20local\x20folder','✔\x20Pushed\x20','readFile','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','session:','\x20(system)','path','Schedule:\x20backfill\x20runs\x20enabled\x20(--backfill)','MAX_LABEL_COUNT','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Cancelled','getMinutes','modified','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20AI','cwd','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','✔\x20Found\x20','error','fromTask','unknown','1592zdVctt','2943RjZhRb','createdAt','Deleting\x20project\x20','No\x20attempts\x20found\x20in\x20project:\x20','→\x20Project:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','workflow:workflows','applyPullProject','\x0a✔\x20Already\x20up\x20to\x20date','2335LziKwO','status','max','\x20secrets\x20set\x20for\x20project\x20\x27','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'];a56_0x1196=function(){return _0x33ce92;};return a56_0x1196();}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a56_0x5ef62e(0xfe)]=a56_0x5ef62e(0x1af);['description']='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async['execute'](_0x12ffaf){const _0x5e3f7a=a56_0x5ef62e,{options:_0x45bced,args:_0x3798bc,tdx:_0x28c748}=_0x12ffaf,_0x412d34=this[_0x5e3f7a(0xec)](_0x3798bc,_0x45bced),_0x149c2e=_0x45bced[_0x5e3f7a(0xfe)],_0x36414f=_0x45bced[_0x5e3f7a(0x22e)],_0x416f4b=_0x45bced[_0x5e3f7a(0x23f)];if(!_0x412d34)return console['error'](a56_0x511120[_0x5e3f7a(0xe7)](_0x5e3f7a(0x101)),_0x5e3f7a(0x1f6)),console[_0x5e3f7a(0x188)](a56_0x511120[_0x5e3f7a(0x149)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x5e3f7a(0x188)](a56_0x511120[_0x5e3f7a(0x149)](_0x5e3f7a(0x235))),0x1;if(!_0x149c2e)return console[_0x5e3f7a(0x188)](a56_0x511120[_0x5e3f7a(0xe7)]('Error:'),_0x5e3f7a(0xea)),console[_0x5e3f7a(0x188)](a56_0x511120[_0x5e3f7a(0x149)](_0x5e3f7a(0x186))),0x1;_0x45bced['verbose']&&(console[_0x5e3f7a(0x188)](_0x5e3f7a(0x292)+_0x412d34),console[_0x5e3f7a(0x188)](_0x5e3f7a(0x13f)+_0x149c2e),_0x36414f&&console[_0x5e3f7a(0x188)]('Revision:\x20'+_0x36414f),_0x45bced[_0x5e3f7a(0x105)]&&console['error']('Dry\x20run:\x20yes'),_0x416f4b&&console['error'](_0x5e3f7a(0x26b)));const _0x1ec16f=await withSpinner(_0x5e3f7a(0x228),()=>_0x28c748[_0x5e3f7a(0x155)]['prepareCloneProject'](_0x412d34,_0x149c2e,{'revision':_0x36414f,'skipValidation':_0x416f4b}),{'verbose':_0x45bced[_0x5e3f7a(0x231)]}),_0x195c3e=_0x1ec16f[_0x5e3f7a(0x117)];console[_0x5e3f7a(0x188)](_0x5e3f7a(0x1d5)+_0x195c3e[_0x5e3f7a(0x1dc)]);_0x195c3e['sourceProjectName']&&console['error']('Source\x20project:\x20'+_0x195c3e[_0x5e3f7a(0xe8)]);console['error'](_0x5e3f7a(0x13f)+_0x195c3e[_0x5e3f7a(0x1f7)]),console['error'](_0x5e3f7a(0x1ee)+_0x195c3e['revision']),console[_0x5e3f7a(0x188)]('Files\x20to\x20upload:\x20'+_0x195c3e['fileCount']);_0x195c3e['targetExists']&&(console['error'](a56_0x511120[_0x5e3f7a(0x29c)](_0x5e3f7a(0x215)+_0x195c3e[_0x5e3f7a(0x1f7)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x195c3e[_0x5e3f7a(0x1c9)]+')')),console[_0x5e3f7a(0x188)](a56_0x511120[_0x5e3f7a(0x29c)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x45bced[_0x5e3f7a(0x105)])return console[_0x5e3f7a(0x188)](a56_0x511120['yellow'](_0x5e3f7a(0x142))),0x0;if(!_0x45bced[_0x5e3f7a(0x20e)]){if(!isInteractive())return console[_0x5e3f7a(0x188)](a56_0x511120[_0x5e3f7a(0xe7)](_0x5e3f7a(0x295)),_0x5e3f7a(0x25f)),console['error'](a56_0x511120['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x590524=_0x195c3e[_0x5e3f7a(0xe8)]||a56_0x384ad3[_0x5e3f7a(0x1c7)](_0x412d34),_0x381250=_0x195c3e[_0x5e3f7a(0x158)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x149c2e+'\x22\x20with\x20new\x20revision?':'\x0aClone\x20\x22'+_0x590524+'\x22\x20to\x20new\x20project\x20\x22'+_0x149c2e+'\x22?',_0x49ff7c=await confirmKey(_0x381250);if(!_0x49ff7c)return console[_0x5e3f7a(0x188)](a56_0x511120['yellow'](_0x5e3f7a(0x181))),0x1;}const _0x240ee9=await withSpinner(_0x195c3e[_0x5e3f7a(0x158)]?_0x5e3f7a(0x136)+_0x149c2e+_0x5e3f7a(0x214):_0x5e3f7a(0x12c)+_0x149c2e+_0x5e3f7a(0x214),()=>_0x28c748[_0x5e3f7a(0x155)][_0x5e3f7a(0x208)](_0x195c3e),{'verbose':_0x45bced[_0x5e3f7a(0x231)]}),_0x4a441a=_0x240ee9[_0x5e3f7a(0x117)];return console[_0x5e3f7a(0x188)](a56_0x511120[_0x5e3f7a(0x131)](_0x195c3e['targetExists']?_0x5e3f7a(0xe3):'✔\x20Clone\x20complete')),console[_0x5e3f7a(0x188)]('\x20\x20Project:\x20'+_0x4a441a[_0x5e3f7a(0x1f7)]),console['error'](_0x5e3f7a(0x223)+_0x4a441a[_0x5e3f7a(0x264)]),console[_0x5e3f7a(0x188)](_0x5e3f7a(0x127)+_0x4a441a[_0x5e3f7a(0x22e)]),await this[_0x5e3f7a(0x100)](_0x28c748,_0x4a441a[_0x5e3f7a(0x1f7)],_0x45bced[_0x5e3f7a(0x124)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']='workflow:delete';[a56_0x5ef62e(0x282)]=a56_0x5ef62e(0x15f);async['execute'](_0x19bb08){const _0x29eb0b=a56_0x5ef62e,{options:_0x1afd25,args:_0x373289,tdx:_0x561ce4}=_0x19bb08,_0x248064=_0x373289[0x0];if(!_0x248064)return console[_0x29eb0b(0x188)](_0x29eb0b(0x1d2)),console[_0x29eb0b(0x188)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x1afd25[_0x29eb0b(0x231)]&&console['error'](_0x29eb0b(0x1ad)+_0x248064);if(!_0x1afd25['yes']){if(!isInteractive())return console[_0x29eb0b(0x188)](a56_0x511120['red'](_0x29eb0b(0x295)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x29eb0b(0x188)](a56_0x511120[_0x29eb0b(0x149)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x8b5307=await confirmKey(_0x29eb0b(0x11d)+_0x248064+_0x29eb0b(0x14e));if(!_0x8b5307)return console[_0x29eb0b(0x188)](a56_0x511120[_0x29eb0b(0x29c)](_0x29eb0b(0x181))),0x1;}const _0x28ce73=await withSpinner(_0x29eb0b(0x18e)+_0x248064+'...',()=>_0x561ce4['workflow']['delete'](_0x248064),{'verbose':_0x1afd25[_0x29eb0b(0x231)]}),_0x317d46=_0x28ce73['data'];return console[_0x29eb0b(0x188)](_0x29eb0b(0x1be)+_0x317d46[_0x29eb0b(0x25e)]),console[_0x29eb0b(0x188)](_0x29eb0b(0x223)+_0x317d46[_0x29eb0b(0xe0)]),0x0;}}export function parseKeyValue(_0x4efb40){const _0x2cd855=a56_0x5ef62e,_0x2b13d9=_0x4efb40[_0x2cd855(0x1de)]('=');if(_0x2b13d9===-0x1)throw new Error('Invalid\x20format:\x20'+_0x4efb40+_0x2cd855(0x24a));const _0x1b81f1=_0x4efb40[_0x2cd855(0x299)](0x0,_0x2b13d9),_0x516a3f=_0x4efb40[_0x2cd855(0x299)](_0x2b13d9+0x1);if(!_0x1b81f1)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x1b81f1,'value':_0x516a3f};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a56_0x5ef62e(0xfe)]=a56_0x5ef62e(0x118);[a56_0x5ef62e(0x282)]=a56_0x5ef62e(0x146);async['execute'](_0x8b17fa){const _0x4158de=a56_0x5ef62e,{options:_0x303639,args:_0x577019,tdx:_0x3e2cc6}=_0x8b17fa,_0x5253dd=this[_0x4158de(0x252)](_0x577019,_0x303639);if(!_0x5253dd)return 0x1;_0x303639['verbose']&&console['error']('Project:\x20'+_0x5253dd);const _0x4607c6=await withSpinner('Listing\x20secrets...',()=>_0x3e2cc6[_0x4158de(0x155)]['listSecrets'](_0x5253dd),{'verbose':_0x303639[_0x4158de(0x231)]}),{secrets:_0x58df2d}=_0x4607c6[_0x4158de(0x117)];return console[_0x4158de(0x188)](_0x4158de(0x187)+_0x58df2d[_0x4158de(0x1d3)]+_0x4158de(0x245)+(_0x58df2d[_0x4158de(0x1d3)]!==0x1?'s':'')),await handleSDKOutput(_0x58df2d,_0x303639),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a56_0x5ef62e(0xfe)]=a56_0x5ef62e(0x28f);[a56_0x5ef62e(0x282)]=a56_0x5ef62e(0x1a4);async['execute'](_0xefc496){const _0x56b66f=a56_0x5ef62e,{options:_0x5b0397,args:_0x458c34,tdx:_0x4c471f}=_0xefc496;let _0x50c7ca,_0x2db478;if(_0x458c34[_0x56b66f(0x1d3)]>=0x1&&!_0x458c34[0x0]['includes']('='))_0x50c7ca=_0x458c34[0x0],_0x2db478=_0x458c34['slice'](0x1);else{if(_0x458c34[_0x56b66f(0x1d3)]>=0x1&&_0x5b0397[_0x56b66f(0xf6)])_0x50c7ca=_0x5b0397[_0x56b66f(0xf6)],_0x2db478=_0x458c34;else return _0x458c34[_0x56b66f(0x1d3)]>=0x1?(console[_0x56b66f(0x188)](_0x56b66f(0x1d1)),console[_0x56b66f(0x188)](_0x56b66f(0x12d)),0x1):(console['error'](_0x56b66f(0x25b)),console['error'](_0x56b66f(0x199)),0x1);}if(_0x2db478['length']===0x0)return console['error']('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x56b66f(0x188)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1;const _0x1810e9={};try{for(const _0x503e72 of _0x2db478){const {key:_0x51c482,value:_0x4e6638}=parseKeyValue(_0x503e72);_0x1810e9[_0x51c482]=_0x4e6638;}}catch(_0x111fd8){return _0x111fd8 instanceof Error&&console[_0x56b66f(0x188)](a56_0x511120['red']('Error:'),_0x111fd8[_0x56b66f(0x1ce)]),0x1;}const _0x300034=Object[_0x56b66f(0xe2)](_0x1810e9);_0x5b0397[_0x56b66f(0x231)]&&(console[_0x56b66f(0x188)]('Project:\x20'+_0x50c7ca),console[_0x56b66f(0x188)](_0x56b66f(0xef)+_0x300034[_0x56b66f(0x1e0)](',\x20')));const _0xa4431f=await withSpinner(_0x300034[_0x56b66f(0x1d3)]===0x1?_0x56b66f(0x115):_0x56b66f(0xf7)+_0x300034[_0x56b66f(0x1d3)]+_0x56b66f(0x28c),()=>_0x4c471f[_0x56b66f(0x155)][_0x56b66f(0x166)](_0x50c7ca,_0x1810e9),{'verbose':_0x5b0397[_0x56b66f(0x231)]}),_0x3fbede=_0xa4431f[_0x56b66f(0x117)];return console[_0x56b66f(0x188)](_0x300034[_0x56b66f(0x1d3)]===0x1?'✔\x20Secret\x20\x27'+_0x3fbede[_0x56b66f(0xe2)][0x0]+_0x56b66f(0x1b9)+_0x3fbede[_0x56b66f(0x25e)]+'\x27':'✔\x20'+_0x3fbede[_0x56b66f(0xe2)][_0x56b66f(0x1d3)]+_0x56b66f(0x198)+_0x3fbede[_0x56b66f(0x25e)]+'\x27'),(_0x5b0397['json']||_0x5b0397[_0x56b66f(0x154)])&&await handleSingleObjectOutput(_0x3fbede,_0x5b0397),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a56_0x5ef62e(0x14a);[a56_0x5ef62e(0x282)]=a56_0x5ef62e(0x1c1);async[a56_0x5ef62e(0x217)](_0x22899b){const _0x30d2ab=a56_0x5ef62e,{options:_0x222cc4,args:_0x2d2d2c,tdx:_0x2131ee}=_0x22899b;let _0x2e8cf9,_0x5c59c8;if(_0x2d2d2c[_0x30d2ab(0x1d3)]>=0x2)_0x2e8cf9=_0x2d2d2c[0x0],_0x5c59c8=_0x2d2d2c[0x1];else{if(_0x2d2d2c[_0x30d2ab(0x1d3)]===0x1&&_0x222cc4[_0x30d2ab(0xf6)])_0x2e8cf9=_0x222cc4[_0x30d2ab(0xf6)],_0x5c59c8=_0x2d2d2c[0x0];else return _0x2d2d2c[_0x30d2ab(0x1d3)]===0x1?(console[_0x30d2ab(0x188)](_0x30d2ab(0x1d1)),console[_0x30d2ab(0x188)](_0x30d2ab(0x12d)),0x1):(console['error'](_0x30d2ab(0x139)),console[_0x30d2ab(0x188)](_0x30d2ab(0x20d)),0x1);}_0x222cc4['verbose']&&(console['error'](_0x30d2ab(0x1ad)+_0x2e8cf9),console['error']('Key:\x20'+_0x5c59c8));if(!_0x222cc4[_0x30d2ab(0x20e)]){if(!isInteractive())return console[_0x30d2ab(0x188)](a56_0x511120[_0x30d2ab(0xe7)](_0x30d2ab(0x295)),_0x30d2ab(0x25f)),console[_0x30d2ab(0x188)](a56_0x511120[_0x30d2ab(0x149)](_0x30d2ab(0x19c))),0x1;const _0x523aa1=await confirmKey(_0x30d2ab(0x125)+_0x5c59c8+_0x30d2ab(0x1ab)+_0x2e8cf9+'\x27?');if(!_0x523aa1)return console[_0x30d2ab(0x188)](a56_0x511120[_0x30d2ab(0x29c)](_0x30d2ab(0x181))),0x1;}const _0x2877e8=await withSpinner('Deleting\x20secret...',()=>_0x2131ee[_0x30d2ab(0x155)]['deleteSecret'](_0x2e8cf9,_0x5c59c8),{'verbose':_0x222cc4[_0x30d2ab(0x231)]}),_0x4b183c=_0x2877e8['data'];return console[_0x30d2ab(0x188)](_0x30d2ab(0x272)+_0x4b183c[_0x30d2ab(0x11a)]+_0x30d2ab(0x212)+_0x4b183c[_0x30d2ab(0x25e)]+'\x27'),(_0x222cc4[_0x30d2ab(0x1cd)]||_0x222cc4[_0x30d2ab(0x154)])&&await handleSingleObjectOutput(_0x4b183c,_0x222cc4),0x0;}}const TIMELINE_CONFIG={'TASK_NAME_WIDTH':0x28,'ICON_WIDTH':0x2,'ICON_SPACING':0x1,'GUTTER':0x5,'MIN_TIMELINE_WIDTH':0x28,'MAX_TIMELINE_WIDTH':0x50,'LABEL_MIN_SPACING':0x2,'POLL_INTERVAL_MS':0x7d0,'MAX_POLL_TIME_MS':0x36ee80,'MAX_POLL_ITERATIONS':0x708,'MAX_TASKS_DISPLAY':0x64,'MIN_LABEL_COUNT':0x3,'MAX_LABEL_COUNT':0x6,'LABEL_WIDTH_DIVISOR':0xf};function formatElapsed(_0x459895){const _0x1d0377=a56_0x5ef62e,_0x149b88=Math['floor'](_0x459895/0x3e8),_0x26c831=Math['floor'](_0x149b88/0x3c),_0x451ae9=Math[_0x1d0377(0x1d9)](_0x26c831/0x3c),_0xf8fd95=Math[_0x1d0377(0x1d9)](_0x451ae9/0x18);if(_0xf8fd95>0x0){const _0x4630a8=_0x451ae9%0x18;return _0x4630a8>0x0?_0xf8fd95+'d\x20'+_0x4630a8+'h':_0xf8fd95+'d';}else{if(_0x451ae9>0x0){const _0x30c7cf=_0x26c831%0x3c;return _0x30c7cf>0x0?_0x451ae9+'h\x20'+_0x30c7cf+'m':_0x451ae9+'h';}else{if(_0x26c831>0x0){const _0x2beaae=_0x149b88%0x3c;return _0x2beaae>0x0?_0x26c831+'m\x20'+_0x2beaae+'s':_0x26c831+'m';}else return _0x149b88+'s';}}}function formatTimestamp(_0x3a5d7b,_0x435a4e){const _0x6041d5=a56_0x5ef62e,_0x1e7c5e=new Date(_0x3a5d7b),_0x35743f=String(_0x1e7c5e[_0x6041d5(0x1a5)]())[_0x6041d5(0x266)](0x2,'0'),_0x452c10=String(_0x1e7c5e[_0x6041d5(0x182)]())[_0x6041d5(0x266)](0x2,'0'),_0x20e99f=_0x35743f+':'+_0x452c10,_0x1dfb02=_0x1e7c5e['getFullYear']()===_0x435a4e['getFullYear']()&&_0x1e7c5e[_0x6041d5(0x1ec)]()===_0x435a4e[_0x6041d5(0x1ec)]()&&_0x1e7c5e['getDate']()===_0x435a4e[_0x6041d5(0x15a)]();if(_0x1dfb02)return _0x20e99f;else{const _0xfc0c53=String(_0x1e7c5e[_0x6041d5(0x1ec)]()+0x1)['padStart'](0x2,'0'),_0x7422a8=String(_0x1e7c5e[_0x6041d5(0x15a)]())[_0x6041d5(0x266)](0x2,'0');return _0xfc0c53+'-'+_0x7422a8+'\x20'+_0x20e99f;}}function formatDate(_0x448bbe){const _0x1af9f7=a56_0x5ef62e,_0x38d88b=_0x448bbe[_0x1af9f7(0x256)](),_0x2fc676=String(_0x448bbe[_0x1af9f7(0x1ec)]()+0x1)['padStart'](0x2,'0'),_0x4a1e80=String(_0x448bbe[_0x1af9f7(0x15a)]())[_0x1af9f7(0x266)](0x2,'0');return _0x38d88b+'-'+_0x2fc676+'-'+_0x4a1e80;}function getTaskStateIcon(_0x240bb7){const _0x2b2752={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x2b2752[_0x240bb7]||'⚪';}function getBarChar(_0x3bc3f9){const _0x3dd4cf=a56_0x5ef62e;return _0x3bc3f9==='error'||_0x3bc3f9===_0x3dd4cf(0x259)?'×':'─';}function getBarColor(_0x128b37){const _0x51a1e5=a56_0x5ef62e,_0x5d7ee9={'success':a56_0x511120[_0x51a1e5(0x131)],'error':a56_0x511120['red'],'group_error':a56_0x511120['red'],'running':a56_0x511120[_0x51a1e5(0x21d)],'blocked':a56_0x511120[_0x51a1e5(0x29c)],'planned':a56_0x511120['dim'],'canceling':a56_0x511120[_0x51a1e5(0x29c)]};return _0x5d7ee9[_0x128b37]||a56_0x511120[_0x51a1e5(0xfb)];}function parseTaskName(_0x341cec){const _0xf8c1b0=a56_0x5ef62e;let _0x18ef15=_0x341cec[_0xf8c1b0(0x241)](/^\++/,'');const _0x572ef5=_0x18ef15['split']('+'),_0xc4b39a=_0x572ef5[_0xf8c1b0(0x1d3)]>0x1?_0x572ef5[_0xf8c1b0(0x1d3)]-0x2:0x0,_0x40f51e=_0x572ef5[_0x572ef5['length']-0x1]||_0x18ef15;return{'level':_0xc4b39a,'name':'+'+_0x40f51e};}function truncateTaskName(_0x4ad33c,_0x3fe186){const _0x23e531=a56_0x5ef62e,_0x2dd009=stringWidth(_0x4ad33c);if(_0x2dd009<=_0x3fe186)return _0x4ad33c;let _0x2f5483=_0x4ad33c;while(stringWidth(_0x2f5483+'…')>_0x3fe186&&_0x2f5483[_0x23e531(0x1d3)]>0x0){_0x2f5483=_0x2f5483[_0x23e531(0x1ca)](0x0,-0x1);}return _0x2f5483+'…';}function calculateTimeScale(_0x3f6aa8,_0x4f34d5){const _0x2334bc=a56_0x5ef62e;return{'startTime':_0x3f6aa8['start'],'endTime':_0x3f6aa8[_0x2334bc(0x135)],'durationMs':_0x3f6aa8['duration'],'msPerChar':_0x3f6aa8['duration']/_0x4f34d5};}function timeToPosition(_0x3358f1,_0x445070,_0x21f00a){const _0x54cd6a=a56_0x5ef62e,_0x5e0339=_0x3358f1-_0x445070[_0x54cd6a(0x1ed)],_0xe3fac0=Math[_0x54cd6a(0x1d9)](_0x5e0339/_0x445070[_0x54cd6a(0x1c8)]);return Math[_0x54cd6a(0x197)](0x0,Math[_0x54cd6a(0x145)](_0xe3fac0,_0x21f00a));}function renderTimeAxis(_0x3a8cca,_0x5e3f9b){const _0x3f9746=a56_0x5ef62e,_0x1b4e45=Math['min'](TIMELINE_CONFIG[_0x3f9746(0x17f)],Math['max'](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x3f9746(0x1d9)](_0x5e3f9b/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x3f2198=_0x3a8cca['durationMs']/(_0x1b4e45-0x1),_0x3a774b=new Date(_0x3a8cca[_0x3f9746(0x1ed)]),_0x1a8e9a=[];for(let _0x5530ab=0x0;_0x5530ab<_0x1b4e45;_0x5530ab++){const _0x250fba=_0x3a8cca[_0x3f9746(0x1ed)]+_0x5530ab*_0x3f2198,_0x5c572e=timeToPosition(_0x250fba,_0x3a8cca,_0x5e3f9b),_0x44b485=formatTimestamp(_0x250fba,_0x3a774b);_0x1a8e9a[_0x3f9746(0x14b)]({'pos':_0x5c572e,'text':_0x44b485});}const _0x3cd8ba=new Array(_0x5e3f9b)[_0x3f9746(0x271)]('\x20');let _0x329cb7=-0x1;for(const {pos:_0x40c3c3,text:_0x5f0b10}of _0x1a8e9a){let _0x1d778c=Math[_0x3f9746(0x197)](0x0,_0x40c3c3-Math[_0x3f9746(0x1d9)](_0x5f0b10[_0x3f9746(0x1d3)]/0x2));_0x1d778c<=_0x329cb7+TIMELINE_CONFIG[_0x3f9746(0xee)]&&(_0x1d778c=_0x329cb7+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x1d778c+_0x5f0b10[_0x3f9746(0x1d3)]>_0x5e3f9b&&(_0x1d778c=_0x5e3f9b-_0x5f0b10[_0x3f9746(0x1d3)]);if(_0x1d778c>=0x0&&_0x1d778c+_0x5f0b10['length']<=_0x5e3f9b&&_0x1d778c>_0x329cb7){for(let _0x3e5b72=0x0;_0x3e5b72<_0x5f0b10[_0x3f9746(0x1d3)];_0x3e5b72++){_0x3cd8ba[_0x1d778c+_0x3e5b72]=_0x5f0b10[_0x3e5b72];}_0x329cb7=_0x1d778c+_0x5f0b10['length']-0x1;}}return _0x3cd8ba['join']('');}function a56_0x4ea0(_0x513bcb,_0x27b380){_0x513bcb=_0x513bcb-0xdf;const _0x11961f=a56_0x1196();let _0x4ea058=_0x11961f[_0x513bcb];return _0x4ea058;}function renderTaskRow(_0x387f42,_0x464004,_0x27ecd,_0x492a12){const _0x2de805=a56_0x5ef62e,{level:_0x27af9a,name:_0xa75139}=parseTaskName(_0x387f42[_0x2de805(0xfe)]),_0x155d29='\x20'['repeat'](_0x27af9a),_0x5cec2e=_0x387f42[_0x2de805(0x281)]?'('+formatElapsed(_0x387f42[_0x2de805(0x281)]['duration'])+')':'',_0x4e596a=stringWidth(_0x5cec2e),_0x365cc1=_0x27af9a*0x1,_0x529014=_0x492a12-_0x365cc1-_0x4e596a-0x1,_0x1a438f=truncateTaskName(_0xa75139,_0x529014),_0x1c5c86=_0x155d29+_0x1a438f,_0x210d68=stringWidth(_0x1c5c86),_0x224d67=_0x492a12-_0x210d68-_0x4e596a,_0x30080d=_0x1c5c86+'\x20'[_0x2de805(0x113)](Math[_0x2de805(0x197)](0x1,_0x224d67))+a56_0x511120[_0x2de805(0x149)](_0x5cec2e),_0x35c2e0=getTaskStateIcon(_0x387f42[_0x2de805(0x1d6)]),_0x5dbf25=new Array(_0x27ecd)[_0x2de805(0x271)]('\x20');if(_0x387f42[_0x2de805(0x281)]){const _0x2f9c29=timeToPosition(_0x387f42[_0x2de805(0x281)][_0x2de805(0x239)],_0x464004,_0x27ecd),_0x3eb959=timeToPosition(_0x387f42[_0x2de805(0x281)][_0x2de805(0x135)],_0x464004,_0x27ecd),_0x6a848d=getBarChar(_0x387f42[_0x2de805(0x1d6)]),_0x376957=Math[_0x2de805(0x197)](_0x2f9c29+0x1,_0x3eb959);for(let _0x74444c=_0x2f9c29;_0x74444c<Math[_0x2de805(0x145)](_0x376957,_0x27ecd);_0x74444c++){_0x5dbf25[_0x74444c]=_0x6a848d;}}const _0x5bb62f=getBarColor(_0x387f42[_0x2de805(0x1d6)]),_0x3b689e=_0x5dbf25[_0x2de805(0x1f8)](_0x4aa7d6=>_0x4aa7d6==='\x20'?'\x20':_0x5bb62f(_0x4aa7d6))[_0x2de805(0x1e0)]('');return _0x35c2e0+'\x20'+_0x30080d+'│'+_0x3b689e+'│';}function calculateStats(_0x300e40){const _0x495cf5=a56_0x5ef62e,_0x474686={'total':_0x300e40[_0x495cf5(0x1d3)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x17515a of _0x300e40){if(_0x17515a['state']===_0x495cf5(0x1a8))_0x474686[_0x495cf5(0x1a8)]++;else{if(_0x17515a[_0x495cf5(0x1d6)]===_0x495cf5(0x188)||_0x17515a[_0x495cf5(0x1d6)]===_0x495cf5(0x259))_0x474686[_0x495cf5(0x188)]++;else _0x17515a[_0x495cf5(0x1d6)]==='running'?_0x474686[_0x495cf5(0x211)]++:_0x474686[_0x495cf5(0x265)]++;}}return _0x474686;}function formatStats(_0x414817){const _0x4af26=a56_0x5ef62e;return[_0x4af26(0x10a)+_0x414817[_0x4af26(0x106)],'✅\x20'+_0x414817[_0x4af26(0x1a8)],'❌\x20'+_0x414817[_0x4af26(0x188)],'🔄\x20'+_0x414817[_0x4af26(0x211)],'⏳\x20'+_0x414817[_0x4af26(0x265)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a56_0x5ef62e(0xfe)]=a56_0x5ef62e(0x1c5);[a56_0x5ef62e(0x282)]=a56_0x5ef62e(0x1a7);async[a56_0x5ef62e(0x217)](_0x502a1e){const _0x526013=a56_0x5ef62e,{options:_0x257f65,args:_0x37e2a8,tdx:_0x4c49c0}=_0x502a1e;let _0x198450,_0x17f2ee,_0x2a072a=![];if(_0x37e2a8[0x0]){if(_0x37e2a8[0x0]['includes']('.')){const _0x51c42f=this[_0x526013(0xf8)](_0x37e2a8,_0x257f65);if(!_0x51c42f)return 0x1;_0x198450=_0x51c42f[_0x526013(0x25e)],_0x17f2ee=_0x51c42f[_0x526013(0x27d)];}else{_0x17f2ee=_0x37e2a8[0x0],_0x198450=_0x257f65[_0x526013(0xf6)];if(!_0x198450)return console[_0x526013(0x188)](a56_0x511120[_0x526013(0xe7)](_0x526013(0x101)),_0x526013(0x209)),0x1;_0x2a072a=!![];}}else{const _0x2d2194=this[_0x526013(0xf8)](_0x37e2a8,_0x257f65);if(!_0x2d2194)return 0x1;_0x198450=_0x2d2194[_0x526013(0x25e)],_0x17f2ee=_0x2d2194[_0x526013(0x27d)];}if(_0x257f65[_0x526013(0x231)]){if(_0x198450&&_0x17f2ee)console[_0x526013(0x188)](_0x526013(0x202)+_0x198450+'.'+_0x17f2ee);else _0x198450&&console['error'](_0x526013(0x1ef)+_0x198450);}const _0x9b1be7=_0x257f65['attemptId'],_0x3cd3f1=_0x257f65[_0x526013(0x253)];if(_0x9b1be7){_0x3cd3f1&&console[_0x526013(0x188)](a56_0x511120[_0x526013(0x29c)](_0x526013(0x137)),_0x526013(0x147));const _0x267239=_0x257f65[_0x526013(0x157)];return _0x267239?await this[_0x526013(0x1d0)](_0x502a1e,_0x9b1be7):await this['renderSingleTimeline'](_0x502a1e,_0x9b1be7,_0x257f65),0x0;}if(_0x3cd3f1){const _0x2b3e57=await withSpinner(_0x526013(0x1d7),()=>_0x4c49c0['workflow'][_0x526013(0x262)]({'projectName':_0x198450,'workflowName':_0x17f2ee,'limit':0x64}),{'verbose':_0x257f65['verbose']}),_0x5abf9f=_0x2b3e57[_0x526013(0x117)]['find'](_0xd6b7dc=>_0xd6b7dc['id']===_0x3cd3f1);if(!_0x5abf9f)return console['error'](a56_0x511120[_0x526013(0xe7)](_0x526013(0x101)),_0x526013(0x222)+_0x3cd3f1),0x1;if(!_0x5abf9f[_0x526013(0x224)]?.['id'])return console[_0x526013(0x188)](a56_0x511120[_0x526013(0xe7)](_0x526013(0x101)),_0x526013(0x1fe)+_0x3cd3f1+'\x20has\x20no\x20attempts'),0x1;const _0x4b2c55=_0x5abf9f[_0x526013(0x224)]['id'];_0x257f65['verbose']&&console['error'](_0x526013(0x227)+_0x4b2c55+_0x526013(0x1ac)+_0x3cd3f1);const _0xfaa58d=_0x257f65[_0x526013(0x157)];return _0xfaa58d?await this[_0x526013(0x1d0)](_0x502a1e,_0x4b2c55):await this['renderSingleTimeline'](_0x502a1e,_0x4b2c55,_0x257f65),0x0;}const _0x3c2da2=await withSpinner(_0x526013(0x1cf),()=>_0x4c49c0[_0x526013(0x155)][_0x526013(0x262)]({'projectName':_0x198450,'workflowName':_0x17f2ee,'limit':_0x257f65[_0x526013(0x226)]||0x32}),{'verbose':_0x257f65['verbose']}),_0x353979=_0x3c2da2[_0x526013(0x117)];if(_0x353979[_0x526013(0x1d3)]===0x0){if(_0x198450&&_0x17f2ee)console[_0x526013(0x188)](_0x526013(0x1b1)+_0x198450+'.'+_0x17f2ee);else _0x198450?console[_0x526013(0x188)](_0x526013(0x1a2)+_0x198450):(console['error'](_0x526013(0x170)),console[_0x526013(0x188)](a56_0x511120['dim'](_0x526013(0x216))));return 0x0;}_0x353979[_0x526013(0x16d)]((_0x3858b5,_0x15a641)=>{const _0x467840=_0x526013,_0x3a1bdb=_0x3858b5[_0x467840(0xe4)]||'',_0x11edae=_0x15a641[_0x467840(0xe4)]||'';return _0x11edae[_0x467840(0x1d8)](_0x3a1bdb);});if(_0x257f65['json']||_0x257f65['jsonl'])return await handleSDKOutput(_0x353979,_0x257f65),0x0;let _0x40b7c5;if(_0x2a072a){const _0x335a2c=_0x353979[0x0];if(!_0x335a2c[_0x526013(0x224)]?.['id'])return console[_0x526013(0x188)](_0x526013(0x176)),0x0;_0x40b7c5=_0x335a2c['lastAttempt']['id'],_0x257f65[_0x526013(0x231)]&&console[_0x526013(0x188)](_0x526013(0x1cb)+_0x335a2c['sessionTime']);}else{const _0x3185a2=_0x353979[_0x526013(0x1f8)](_0x231a00=>{const _0xf75cb0=_0x526013,_0x872826=getAttemptStatusDisplay(_0x231a00[_0xf75cb0(0x224)]);return{'title':_0x231a00[_0xf75cb0(0x274)]?.['name']+'.'+_0x231a00[_0xf75cb0(0x155)]?.['name']+'\x20-\x20'+_0x231a00[_0xf75cb0(0xe4)]+'\x20'+_0x872826[_0xf75cb0(0x103)],'value':_0x231a00[_0xf75cb0(0x224)]?.['id']||'','description':_0x872826['text']};}),_0x96cd93=await a56_0x3a0ef2({'type':_0x526013(0x162),'name':_0x526013(0x23c),'message':_0x526013(0x2a7),'choices':_0x3185a2[_0x526013(0x110)](_0x4fda13=>_0x4fda13[_0x526013(0x140)]!=='')});if(!_0x96cd93[_0x526013(0x23c)])return 0x0;_0x40b7c5=_0x96cd93[_0x526013(0x23c)];}const _0x221380=_0x257f65[_0x526013(0x157)];return _0x221380?await this['pollTimeline'](_0x502a1e,_0x40b7c5):await this[_0x526013(0x1f2)](_0x502a1e,_0x40b7c5,_0x257f65),0x0;}async['renderSingleTimeline'](_0x132926,_0x2c6f69,_0x21b2be){const _0x8cf8=a56_0x5ef62e,{tdx:_0x3d35ea}=_0x132926;let _0x1fd7bd,_0x126159;try{[_0x1fd7bd,_0x126159]=await Promise[_0x8cf8(0xed)]([_0x3d35ea[_0x8cf8(0x155)][_0x8cf8(0x213)](_0x2c6f69),_0x3d35ea[_0x8cf8(0x155)][_0x8cf8(0x10b)](_0x2c6f69,![])]);}catch(_0x45fdbd){console[_0x8cf8(0x188)](a56_0x511120[_0x8cf8(0xe7)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x21b2be['verbose']&&console[_0x8cf8(0x188)](_0x45fdbd);throw _0x45fdbd;}if(_0x21b2be['json']||_0x21b2be['jsonl']){const _0x33d052=this[_0x8cf8(0xf3)](_0x1fd7bd,_0x126159);await handleSDKOutput([_0x33d052],_0x21b2be);return;}const _0x1f3ebd=_0x3d35ea[_0x8cf8(0x1a6)][_0x8cf8(0x124)],_0x2263a5=this['renderTimeline'](_0x1fd7bd,_0x126159,_0x1f3ebd);console[_0x8cf8(0xe6)](_0x2263a5);}async['pollTimeline'](_0x2ce4fd,_0x4c6d8d){const _0x435840=a56_0x5ef62e,{tdx:_0xe7020}=_0x2ce4fd,_0x475d3b=TIMELINE_CONFIG[_0x435840(0x13c)],_0x577d12=TIMELINE_CONFIG[_0x435840(0x248)];let _0x3c6b46=0x0;while(_0x3c6b46<_0x577d12){process['stdout'][_0x435840(0x250)]&&process[_0x435840(0x26d)][_0x435840(0x15d)]('\x1Bc');let _0x57fb68,_0xc8f176;try{[_0x57fb68,_0xc8f176]=await Promise[_0x435840(0xed)]([_0xe7020[_0x435840(0x155)][_0x435840(0x213)](_0x4c6d8d),_0xe7020['workflow'][_0x435840(0x10b)](_0x4c6d8d,![])]);}catch(_0x371f5b){console[_0x435840(0x188)](a56_0x511120['red'](_0x435840(0x267)));_0x3c6b46>0x0&&console[_0x435840(0x188)](a56_0x511120[_0x435840(0x149)](_0x435840(0x20c)+_0x3c6b46));throw _0x371f5b;}const _0x117396=_0xe7020[_0x435840(0x1a6)][_0x435840(0x124)],_0x45ad84=this[_0x435840(0x21c)](_0x57fb68,_0xc8f176,_0x117396);console[_0x435840(0xe6)](_0x45ad84);const _0x1e6472=_0x57fb68[_0x435840(0x26f)]&&_0xc8f176[_0x435840(0x173)](_0x9d9ddd=>_0x9d9ddd['state']!==_0x435840(0x211)&&_0x9d9ddd[_0x435840(0x1d6)]!=='planned');if(_0x1e6472){console[_0x435840(0x188)](a56_0x511120[_0x435840(0x131)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0x435840(0x188)](a56_0x511120[_0x435840(0x149)](_0x435840(0x246)+_0x3c6b46*0x2+_0x435840(0x297))),await new Promise(_0x1ec7c2=>setTimeout(_0x1ec7c2,_0x475d3b)),_0x3c6b46++;}_0x3c6b46>=_0x577d12&&console[_0x435840(0x188)](a56_0x511120[_0x435840(0x29c)](_0x435840(0x17a)));}[a56_0x5ef62e(0x21c)](_0x58637b,_0x181d42,_0x5f59ac){const _0x45eb2b=a56_0x5ef62e,_0x162aae=[],_0x40f6a1=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0xef0ebd=0x5,_0x2b65ca=process[_0x45eb2b(0x26d)]['columns']||0x78,_0x310abf=_0x2b65ca-_0x40f6a1-_0xef0ebd,_0x3746f9=Math['max'](TIMELINE_CONFIG[_0x45eb2b(0x269)],Math[_0x45eb2b(0x145)](_0x310abf,TIMELINE_CONFIG[_0x45eb2b(0x13d)])),_0x596c33=new Date(_0x58637b['createdAt'])[_0x45eb2b(0xff)](),_0x236474=_0x58637b[_0x45eb2b(0x1b4)]?new Date(_0x58637b[_0x45eb2b(0x1b4)])[_0x45eb2b(0xff)]():Date['now'](),_0x1a1e3f={'start':_0x596c33,'end':_0x236474,'duration':_0x236474-_0x596c33},_0x144cb3=new Map(),_0x61ce3b=[];for(const _0x34a89e of _0x181d42){if(_0x34a89e['startedAt']){const _0x2b2379=new Date(_0x34a89e[_0x45eb2b(0x2a2)])[_0x45eb2b(0xff)](),_0x218cad=_0x34a89e[_0x45eb2b(0x143)]?new Date(_0x34a89e['updatedAt'])[_0x45eb2b(0xff)]():Date[_0x45eb2b(0xf1)](),_0x178649={'start':_0x2b2379,'end':_0x218cad,'duration':_0x218cad-_0x2b2379};_0x144cb3['set'](_0x34a89e['id'],_0x178649),_0x61ce3b[_0x45eb2b(0x14b)]({'name':_0x34a89e['fullName'],'state':_0x34a89e[_0x45eb2b(0x1d6)]||_0x45eb2b(0x18a),'window':_0x178649});}else _0x61ce3b[_0x45eb2b(0x14b)]({'name':_0x34a89e[_0x45eb2b(0xeb)],'state':_0x34a89e[_0x45eb2b(0x1d6)]||'planned','window':undefined});}_0x61ce3b[_0x45eb2b(0x16d)]((_0x8eefd2,_0x3a2ab4)=>{const _0x255214=_0x45eb2b;if(!_0x8eefd2[_0x255214(0x281)])return 0x1;if(!_0x3a2ab4[_0x255214(0x281)])return-0x1;return _0x8eefd2['window'][_0x255214(0x239)]-_0x3a2ab4[_0x255214(0x281)]['start'];});const _0x146847=_0x61ce3b[_0x45eb2b(0x1d3)],_0x4b13e5=_0x146847>TIMELINE_CONFIG[_0x45eb2b(0x22d)];_0x4b13e5&&_0x61ce3b[_0x45eb2b(0x251)](TIMELINE_CONFIG[_0x45eb2b(0x22d)]);const _0x2b5e81=calculateTimeScale(_0x1a1e3f,_0x3746f9),_0x35920a=_0x58637b['done']?_0x58637b[_0x45eb2b(0x1a8)]?a56_0x511120['green'](_0x45eb2b(0x1a8)):a56_0x511120[_0x45eb2b(0xe7)](_0x45eb2b(0x188)):a56_0x511120[_0x45eb2b(0x21d)](_0x45eb2b(0x211)),_0x234c66=_0x58637b[_0x45eb2b(0x274)]?.['id'],_0x195e6e=_0x58637b[_0x45eb2b(0x253)];let _0x4c12cf;if(_0x234c66&&_0x195e6e){const _0x425df3=getWorkflowAttemptUrl(_0x5f59ac,_0x234c66,_0x195e6e,_0x58637b['id']);_0x4c12cf=hyperlink(a56_0x511120['dim'](_0x58637b['id']),_0x425df3);}else _0x4c12cf=a56_0x511120[_0x45eb2b(0x149)](_0x58637b['id']);_0x162aae[_0x45eb2b(0x14b)](_0x45eb2b(0x1c2)+_0x4c12cf+'\x20-\x20'+_0x35920a+_0x45eb2b(0x14c)+formatElapsed(_0x1a1e3f[_0x45eb2b(0x16e)]));if(_0x61ce3b[_0x45eb2b(0x1d3)]>0x0){const _0x475a43=renderTimeAxis(_0x2b5e81,_0x3746f9),_0x5457e8=new Date(_0x1a1e3f[_0x45eb2b(0x239)]),_0x5774e8=formatDate(_0x5457e8),_0x2d4ede=TIMELINE_CONFIG[_0x45eb2b(0x174)]+TIMELINE_CONFIG[_0x45eb2b(0x19d)]+_0x40f6a1,_0x1dbac3=_0x5774e8[_0x45eb2b(0x266)](_0x2d4ede),_0x52b50d=a56_0x511120[_0x45eb2b(0x149)](_0x1dbac3);_0x162aae['push'](_0x52b50d+'\x20'+_0x475a43);for(const _0x2feb3b of _0x61ce3b){_0x162aae['push'](renderTaskRow(_0x2feb3b,_0x2b5e81,_0x3746f9,_0x40f6a1));}const _0x124509=calculateStats(_0x61ce3b);_0x162aae[_0x45eb2b(0x14b)](formatStats(_0x124509)),_0x4b13e5&&_0x162aae[_0x45eb2b(0x14b)](a56_0x511120['yellow'](_0x45eb2b(0x2a3)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x45eb2b(0x293)+_0x146847+_0x45eb2b(0x1d4))),_0x162aae[_0x45eb2b(0x14b)](''),_0x162aae[_0x45eb2b(0x14b)](a56_0x511120[_0x45eb2b(0x149)](_0x45eb2b(0x294))+(_0x45eb2b(0x24b)+_0x58637b['id']+_0x45eb2b(0x287))+a56_0x511120['dim'](_0x45eb2b(0x159)));}else _0x162aae[_0x45eb2b(0x14b)](_0x45eb2b(0x1bc));return _0x162aae['join']('\x0a');}['buildTimelineData'](_0x45adcb,_0xe16c10){const _0x4aab8e=a56_0x5ef62e,_0x4e10c6=new Date(_0x45adcb[_0x4aab8e(0x18d)])[_0x4aab8e(0xff)](),_0x3a783a=_0x45adcb[_0x4aab8e(0x1b4)]?new Date(_0x45adcb[_0x4aab8e(0x1b4)])[_0x4aab8e(0xff)]():Date[_0x4aab8e(0xf1)](),_0x4155f1=_0x3a783a-_0x4e10c6,_0x30c3f4=[];for(const _0x556c20 of _0xe16c10){if(_0x556c20[_0x4aab8e(0x2a2)]){const _0x52f2a5=new Date(_0x556c20[_0x4aab8e(0x2a2)])[_0x4aab8e(0xff)](),_0x2b056c=_0x556c20[_0x4aab8e(0x143)]?new Date(_0x556c20[_0x4aab8e(0x143)])[_0x4aab8e(0xff)]():Date[_0x4aab8e(0xf1)]();_0x30c3f4['push']({'name':_0x556c20['fullName'],'state':_0x556c20['state']||_0x4aab8e(0x18a),'window':{'start':_0x52f2a5,'end':_0x2b056c,'duration':_0x2b056c-_0x52f2a5}});}else _0x30c3f4[_0x4aab8e(0x14b)]({'name':_0x556c20[_0x4aab8e(0xeb)],'state':_0x556c20[_0x4aab8e(0x1d6)]||_0x4aab8e(0x141),'window':undefined});}const _0x1b741b=calculateStats(_0x30c3f4);return{'attempt':{'id':_0x45adcb['id'],'status':_0x45adcb[_0x4aab8e(0x26f)]?_0x45adcb[_0x4aab8e(0x1a8)]?_0x4aab8e(0x1a8):_0x4aab8e(0x188):_0x4aab8e(0x211),'createdAt':_0x45adcb['createdAt'],'finishedAt':_0x45adcb[_0x4aab8e(0x1b4)],'duration_ms':_0x4155f1},'tasks':_0x30c3f4[_0x4aab8e(0x1f8)](_0xc2abb9=>({'name':_0xc2abb9[_0x4aab8e(0xfe)],'state':_0xc2abb9[_0x4aab8e(0x1d6)],'startedAt':_0xc2abb9[_0x4aab8e(0x281)]?new Date(_0xc2abb9['window']['start'])['toISOString']():null,'updatedAt':_0xc2abb9[_0x4aab8e(0x281)]?new Date(_0xc2abb9[_0x4aab8e(0x281)][_0x4aab8e(0x135)])['toISOString']():null,'duration_ms':_0xc2abb9[_0x4aab8e(0x281)]?.[_0x4aab8e(0x16e)]||null})),'stats':_0x1b741b};}}function formatScheduleLine(_0x5e8bdf){const _0x559d09=a56_0x5ef62e,_0x4e84ca=_0x5e8bdf['disabledAt']?a56_0x511120[_0x559d09(0x29c)](_0x559d09(0x102)):'',_0x277f67=_0x5e8bdf[_0x559d09(0x274)]?.[_0x559d09(0xfe)]?a56_0x511120[_0x559d09(0x149)]('\x20['+_0x5e8bdf[_0x559d09(0x274)]['name']+']'):'',_0x11db82=_0x5e8bdf[_0x559d09(0x206)]?a56_0x511120[_0x559d09(0x149)](_0x559d09(0x152)+new Date(_0x5e8bdf[_0x559d09(0x206)])[_0x559d09(0x2a8)]()):'';return _0x559d09(0x1b6)+_0x5e8bdf['id']+'\x20'+(_0x5e8bdf['workflow']?.[_0x559d09(0xfe)]||_0x559d09(0x1bd))+_0x277f67+_0x4e84ca+_0x11db82;}export class WorkflowSchedulesCommand extends WorkflowBaseCommand{[a56_0x5ef62e(0xfe)]=a56_0x5ef62e(0x19f);[a56_0x5ef62e(0x282)]='List\x20workflow\x20schedules';async[a56_0x5ef62e(0x217)](_0x39ccf7){const _0x138a06=a56_0x5ef62e,{options:_0x268e1f,args:_0x5015db,tdx:_0x148b03}=_0x39ccf7,{scheduleId:_0x10d188}=_0x268e1f;if(_0x10d188&&_0x5015db[0x0])return console[_0x138a06(0x188)](a56_0x511120[_0x138a06(0xe7)](_0x138a06(0x101)),_0x138a06(0x260)),console[_0x138a06(0x188)](a56_0x511120[_0x138a06(0x149)]('Usage:\x20tdx\x20wf\x20schedule\x20list\x20[project[.workflow]]\x20|\x20--schedule-id\x20<id>')),0x1;if(_0x10d188){const _0x42add4=await withSpinner(_0x138a06(0xf4)+_0x10d188+_0x138a06(0x214),()=>_0x148b03['workflow']['getSchedule'](_0x10d188),{'verbose':_0x268e1f[_0x138a06(0x231)]}),_0x48e416=_0x42add4[_0x138a06(0x117)];return isStructuredFormat(_0x268e1f)?await handleSingleObjectOutput(_0x48e416,_0x268e1f):(console[_0x138a06(0x188)](_0x138a06(0x164)),console[_0x138a06(0xe6)](formatScheduleLine(_0x48e416))),0x0;}const _0x1c30b1=this[_0x138a06(0xf8)](_0x5015db,_0x268e1f);if(!_0x1c30b1)return 0x1;const {projectName:_0x1420fc,workflowName:_0x2bf745}=_0x1c30b1,_0x46b32e=_0x1420fc?'\x27'+_0x1420fc+(_0x2bf745?'.'+_0x2bf745:'')+'\x27':undefined,_0x1b49b9=await withSpinner(_0x46b32e?_0x138a06(0x161)+_0x46b32e+_0x138a06(0x214):'Listing\x20schedules...',()=>_0x1420fc?_0x148b03[_0x138a06(0x155)][_0x138a06(0x126)](_0x1420fc,{'workflow':_0x2bf745,'limit':_0x268e1f['limit']}):_0x148b03[_0x138a06(0x155)][_0x138a06(0x237)]({'limit':_0x268e1f['limit']}),{'verbose':_0x268e1f[_0x138a06(0x231)]}),_0x391aae=_0x1b49b9[_0x138a06(0x117)],_0x15aae8=_0x268e1f['limit']&&_0x391aae[_0x138a06(0x1d3)]>=_0x268e1f['limit']?a56_0x511120[_0x138a06(0x149)]('\x20(use\x20a\x20larger\x20--limit\x20to\x20show\x20more)'):'';console['error'](_0x138a06(0x187)+_0x391aae[_0x138a06(0x1d3)]+_0x138a06(0x229)+(_0x391aae[_0x138a06(0x1d3)]!==0x1?'s':'')+_0x15aae8);if(isStructuredFormat(_0x268e1f))await handleSDKOutput(_0x391aae,_0x268e1f);else{if(_0x391aae[_0x138a06(0x1d3)]===0x0)console[_0x138a06(0xe6)](_0x138a06(0x129));else for(const _0xe8964e of _0x391aae){console[_0x138a06(0xe6)](formatScheduleLine(_0xe8964e));}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a56_0x5ef62e(0xfe)]=a56_0x5ef62e(0x1f0);[a56_0x5ef62e(0x282)]='Enable\x20a\x20workflow\x20schedule';async['execute'](_0x5011cf){const _0x2c1bfa=a56_0x5ef62e,{options:_0x5ebab8,args:_0x28044c,tdx:_0x191d7f}=_0x5011cf,_0x195457=_0x28044c[0x0];if(!_0x195457)return console[_0x2c1bfa(0x188)](a56_0x511120[_0x2c1bfa(0xe7)](_0x2c1bfa(0x101)),_0x2c1bfa(0x116)),console[_0x2c1bfa(0x188)](a56_0x511120[_0x2c1bfa(0x149)]('Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>')),console[_0x2c1bfa(0x188)](a56_0x511120['dim'](_0x2c1bfa(0x26e))),0x1;const {backfill:_0x4e9979,nextTime:_0x83ac80}=_0x5ebab8,_0x3b88cd={};if(_0x4e9979!==undefined)_0x3b88cd[_0x2c1bfa(0x22f)]=!_0x4e9979;if(_0x83ac80!==undefined)_0x3b88cd['nextTime']=_0x83ac80;const _0x38c1ad=await withSpinner(_0x2c1bfa(0x1c3)+_0x195457+_0x2c1bfa(0x214),()=>_0x191d7f[_0x2c1bfa(0x155)]['enableSchedule'](_0x195457,_0x3b88cd),{'verbose':_0x5ebab8[_0x2c1bfa(0x231)]}),_0x1e1485=_0x38c1ad['data'];return isStructuredFormat(_0x5ebab8)?await handleSingleObjectOutput(_0x1e1485,_0x5ebab8):(console[_0x2c1bfa(0xe6)](_0x2c1bfa(0x280)+_0x195457+_0x2c1bfa(0x1aa)+(_0x1e1485[_0x2c1bfa(0x155)]?.[_0x2c1bfa(0xfe)]||'unknown')+')'),_0x1e1485['nextRunTime']&&console['log'](a56_0x511120[_0x2c1bfa(0x149)](_0x2c1bfa(0x119)+new Date(_0x1e1485['nextRunTime'])[_0x2c1bfa(0x2a8)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a56_0x5ef62e(0xfe)]='workflow:schedule:disable';[a56_0x5ef62e(0x282)]=a56_0x5ef62e(0x1e8);async[a56_0x5ef62e(0x217)](_0x4fefcc){const _0x5f3cbf=a56_0x5ef62e,{options:_0xc8ef9e,args:_0x67a7e7,tdx:_0x395a8d}=_0x4fefcc,_0x21fb65=_0x67a7e7[0x0];if(!_0x21fb65)return console['error'](a56_0x511120[_0x5f3cbf(0xe7)]('Error:'),'Schedule\x20ID\x20is\x20required'),console[_0x5f3cbf(0x188)](a56_0x511120[_0x5f3cbf(0x149)](_0x5f3cbf(0x171))),console['error'](a56_0x511120[_0x5f3cbf(0x149)](_0x5f3cbf(0x26e))),0x1;const _0x4d5e66=await withSpinner(_0x5f3cbf(0x15b)+_0x21fb65+_0x5f3cbf(0x214),()=>_0x395a8d['workflow'][_0x5f3cbf(0x24d)](_0x21fb65),{'verbose':_0xc8ef9e[_0x5f3cbf(0x231)]}),_0x2fb323=_0x4d5e66[_0x5f3cbf(0x117)];return isStructuredFormat(_0xc8ef9e)?await handleSingleObjectOutput(_0x2fb323,_0xc8ef9e):console['log'](_0x5f3cbf(0x280)+_0x21fb65+_0x5f3cbf(0x153)+(_0x2fb323[_0x5f3cbf(0x155)]?.['name']||_0x5f3cbf(0x18a))+')'),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x2cceae,_0x49150d){const _0x4c503a=a57_0x3045,_0x5338a2=_0x2cceae();while(!![]){try{const _0x102ebf=-parseInt(_0x4c503a(0x1c5))/0x1*(-parseInt(_0x4c503a(0x1bf))/0x2)+parseInt(_0x4c503a(0x1be))/0x3+-parseInt(_0x4c503a(0x1c3))/0x4*(parseInt(_0x4c503a(0x1b9))/0x5)+parseInt(_0x4c503a(0x1b8))/0x6+parseInt(_0x4c503a(0x1c4))/0x7+-parseInt(_0x4c503a(0x1bd))/0x8*(parseInt(_0x4c503a(0x1b7))/0x9)+-parseInt(_0x4c503a(0x1c2))/0xa;if(_0x102ebf===_0x49150d)break;else _0x5338a2['push'](_0x5338a2['shift']());}catch(_0x572685){_0x5338a2['push'](_0x5338a2['shift']());}}}(a57_0x52c7,0xdf88c));import{platform}from'os';function a57_0x52c7(){const _0x579969=['TD1\x20','4991830NXDiQc','4rUpTuu','12619600tmWZMw','1McJaOU','X-Trino-User','version','477bdXlLx','6241662cHBbQs','6130585tgndeP','tdx','length','Authorization','264568XxtVWx','2738487gOwIJn','1275506WgPglH','Bearer\x20'];a57_0x52c7=function(){return _0x579969;};return a57_0x52c7();}import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x5dd1a9=a57_0x3045,_0x145a1d=getVersion(),_0x2959e3=platform(),_0x5a1179=process[_0x5dd1a9(0x1b6)]['replace']('v','');return'tdx/'+_0x145a1d+'\x20('+_0x2959e3+';\x20node/'+_0x5a1179+')';}function a57_0x3045(_0x595160,_0x4e18d5){_0x595160=_0x595160-0x1b6;const _0x52c7f9=a57_0x52c7();let _0x30452d=_0x52c7f9[_0x595160];return _0x30452d;}export function getAuthHeaders(_0x4b38e6,_0x180a67,_0x13543b){const _0x333b56=a57_0x3045,_0x123e25=getVersion(),_0x1fdd7a={'User-Agent':getUserAgent(),'X-TD-Client':_0x333b56(0x1ba),'X-TD-Client-Version':_0x123e25};if(_0x13543b)_0x1fdd7a[_0x333b56(0x1bc)]=_0x333b56(0x1c0)+_0x13543b;else _0x180a67&&(_0x1fdd7a[_0x333b56(0x1bc)]=_0x333b56(0x1c1)+_0x180a67);return _0x1fdd7a;}export function toHeaderRecord(_0x1a3fcf){const _0x31e249={};for(const [_0x56e4ec,_0x59d69a]of Object['entries'](_0x1a3fcf)){_0x59d69a!==undefined&&(_0x31e249[_0x56e4ec]=_0x59d69a);}return _0x31e249;}export function getTrinoHeaders(_0x14b721,_0x1f3792,_0x31bee4){const _0x1c0bab=a57_0x3045,_0x13fbc0=getAuthHeaders(_0x14b721),_0x2dc17c=toHeaderRecord(_0x13fbc0);if(_0x31bee4)_0x2dc17c['Authorization']='Bearer\x20'+_0x31bee4;else _0x1f3792&&(_0x2dc17c[_0x1c0bab(0x1c6)]=_0x1f3792);return _0x2dc17c;}export function hasAPIKey(_0x163ba5){const _0x467686=a57_0x3045,_0x1618fd=getAPIKey();return _0x1618fd!==undefined&&_0x1618fd[_0x467686(0x1bb)]>0x0;}
1
+ (function(_0x273622,_0xfe4fef){const _0x1ab274=a57_0x4441,_0x2e8837=_0x273622();while(!![]){try{const _0x3ec3e2=-parseInt(_0x1ab274(0x185))/0x1*(parseInt(_0x1ab274(0x190))/0x2)+-parseInt(_0x1ab274(0x18b))/0x3+-parseInt(_0x1ab274(0x187))/0x4+parseInt(_0x1ab274(0x180))/0x5+parseInt(_0x1ab274(0x188))/0x6*(parseInt(_0x1ab274(0x183))/0x7)+-parseInt(_0x1ab274(0x18f))/0x8+parseInt(_0x1ab274(0x181))/0x9*(parseInt(_0x1ab274(0x18a))/0xa);if(_0x3ec3e2===_0xfe4fef)break;else _0x2e8837['push'](_0x2e8837['shift']());}catch(_0x2ba937){_0x2e8837['push'](_0x2e8837['shift']());}}}(a57_0x3baf,0x7ef69));import{platform}from'os';function a57_0x3baf(){const _0x47dc13=['1976685aziVHU','length','Authorization','X-Trino-User','5530248UogFVt','12NDkXaW','version','TD1\x20','replace','3048735GwUAnk','532458mDLrOG','tdx/','7178108HKMnMa','tdx','6133VVTxkn','entries','2935720UftYNE','6tzXlJz','Bearer\x20','170eLbYAB'];a57_0x3baf=function(){return _0x47dc13;};return a57_0x3baf();}import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x403aed=a57_0x4441,_0x185a0f=getVersion(),_0x32619f=platform(),_0x3a9686=process[_0x403aed(0x191)][_0x403aed(0x17f)]('v','');return _0x403aed(0x182)+_0x185a0f+'\x20('+_0x32619f+';\x20node/'+_0x3a9686+')';}function a57_0x4441(_0x364810,_0x4cac7e){_0x364810=_0x364810-0x17f;const _0x3bafb7=a57_0x3baf();let _0x44417f=_0x3bafb7[_0x364810];return _0x44417f;}export function getAuthHeaders(_0x137933,_0x2c7b90,_0x2da5af){const _0x476144=a57_0x4441,_0x5b5214=getVersion(),_0x57a7e1={'User-Agent':getUserAgent(),'X-TD-Client':_0x476144(0x184),'X-TD-Client-Version':_0x5b5214};if(_0x2da5af)_0x57a7e1[_0x476144(0x18d)]='Bearer\x20'+_0x2da5af;else _0x2c7b90&&(_0x57a7e1[_0x476144(0x18d)]=_0x476144(0x192)+_0x2c7b90);return _0x57a7e1;}export function toHeaderRecord(_0xc46837){const _0x5282fb=a57_0x4441,_0x4286c5={};for(const [_0x5b51a0,_0x584e7b]of Object[_0x5282fb(0x186)](_0xc46837)){_0x584e7b!==undefined&&(_0x4286c5[_0x5b51a0]=_0x584e7b);}return _0x4286c5;}export function getTrinoHeaders(_0x340fb6,_0x5ef4f7,_0xf07d1d){const _0x1e55d4=a57_0x4441,_0x522e76=getAuthHeaders(_0x340fb6),_0x375143=toHeaderRecord(_0x522e76);if(_0xf07d1d)_0x375143[_0x1e55d4(0x18d)]=_0x1e55d4(0x189)+_0xf07d1d;else _0x5ef4f7&&(_0x375143[_0x1e55d4(0x18e)]=_0x5ef4f7);return _0x375143;}export function hasAPIKey(_0x527143){const _0x315463=a57_0x4441,_0xd87835=getAPIKey();return _0xd87835!==undefined&&_0xd87835[_0x315463(0x18c)]>0x0;}