@treasuredata/tdx 2026.8.4 → 2026.8.5

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 (264) 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.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.d.ts.map +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js.map +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-campaign-pull-command.js +1 -1
  27. package/dist/commands/engage-campaign-push-command.js +1 -1
  28. package/dist/commands/engage-campaign-validate-command.js +1 -1
  29. package/dist/commands/engage-command.js +1 -1
  30. package/dist/commands/engage-template-pull-command.js +1 -1
  31. package/dist/commands/engage-template-push-command.js +1 -1
  32. package/dist/commands/engage-template-validate-command.js +1 -1
  33. package/dist/commands/job-command.js +1 -1
  34. package/dist/commands/journey-command.js +1 -1
  35. package/dist/commands/journey-validate-command.js +1 -1
  36. package/dist/commands/llm-command.js +1 -1
  37. package/dist/commands/mcp-command.js +1 -1
  38. package/dist/commands/p13n-command.js +1 -1
  39. package/dist/commands/parent-segment-command.js +1 -1
  40. package/dist/commands/policy-command.js +1 -1
  41. package/dist/commands/profile-command.js +1 -1
  42. package/dist/commands/profiles-command.js +1 -1
  43. package/dist/commands/query-command.js +1 -1
  44. package/dist/commands/schedule-command.js +1 -1
  45. package/dist/commands/segment-command.js +1 -1
  46. package/dist/commands/segment-create-command.js +1 -1
  47. package/dist/commands/segment-fields-command.js +1 -1
  48. package/dist/commands/segment-move-command.js +1 -1
  49. package/dist/commands/segment-pull-command.js +1 -1
  50. package/dist/commands/segment-push-command.js +1 -1
  51. package/dist/commands/segment-update-command.js +1 -1
  52. package/dist/commands/segment-use-command.js +1 -1
  53. package/dist/commands/segment-validate-command.js +1 -1
  54. package/dist/commands/segments.js +1 -1
  55. package/dist/commands/show.js +1 -1
  56. package/dist/commands/status-command.js +1 -1
  57. package/dist/commands/table-deleted.js +1 -1
  58. package/dist/commands/tables.js +1 -1
  59. package/dist/commands/unset-command.js +1 -1
  60. package/dist/commands/upgrade-command.js +1 -1
  61. package/dist/commands/use-command.js +1 -1
  62. package/dist/commands/user-command.js +1 -1
  63. package/dist/commands/work-command.js +1 -1
  64. package/dist/commands/workflow-command.js +1 -1
  65. package/dist/core/auth.js +1 -1
  66. package/dist/core/command-output.js +1 -1
  67. package/dist/core/config.js +1 -1
  68. package/dist/core/connection-cache.js +1 -1
  69. package/dist/core/constants.js +1 -1
  70. package/dist/core/credential-cache.js +1 -1
  71. package/dist/core/global-context.js +1 -1
  72. package/dist/core/keychain.js +1 -1
  73. package/dist/core/oauth-keychain.js +1 -1
  74. package/dist/core/oauth.js +1 -1
  75. package/dist/core/profile.js +1 -1
  76. package/dist/core/project-config.js +1 -1
  77. package/dist/core/session.js +1 -1
  78. package/dist/core/site-mismatch.js +1 -1
  79. package/dist/core/user-cache.js +1 -1
  80. package/dist/core/version.js +1 -1
  81. package/dist/index.js +1 -1
  82. package/dist/mcp/server.js +1 -1
  83. package/dist/mcp/tools/index.js +1 -1
  84. package/dist/mcp/tools/tdx-run.js +1 -1
  85. package/dist/mcp/tools/tdx-search.js +1 -1
  86. package/dist/mcp/tools/work-create-item.js +1 -1
  87. package/dist/mcp/utils.js +1 -1
  88. package/dist/proxy/claude-usage-tracker.js +1 -1
  89. package/dist/proxy/passthrough-server.js +1 -1
  90. package/dist/proxy/sse-usage-parser.js +1 -1
  91. package/dist/sdk/agent/agent-config.js +1 -1
  92. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  93. package/dist/sdk/agent/agent-yaml.js +1 -1
  94. package/dist/sdk/agent/test/evaluator.js +1 -1
  95. package/dist/sdk/agent/test/executor.js +1 -1
  96. package/dist/sdk/agent/test/index.js +1 -1
  97. package/dist/sdk/agent/test/output.js +1 -1
  98. package/dist/sdk/agent/test/parser.js +1 -1
  99. package/dist/sdk/agent/tool-target-registry.js +1 -1
  100. package/dist/sdk/api.js +1 -1
  101. package/dist/sdk/auth-token.js +1 -1
  102. package/dist/sdk/cas/cas-api-client.js +1 -1
  103. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  104. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  105. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  106. package/dist/sdk/cas/cas-segment-schema.d.ts +63 -0
  107. package/dist/sdk/cas/cas-segment-schema.d.ts.map +1 -0
  108. package/dist/sdk/cas/cas-segment-schema.js +1 -0
  109. package/dist/sdk/cas/cas-segment-schema.js.map +1 -0
  110. package/dist/sdk/cas/cas-segment-validator.d.ts +76 -0
  111. package/dist/sdk/cas/cas-segment-validator.d.ts.map +1 -0
  112. package/dist/sdk/cas/cas-segment-validator.js +1 -0
  113. package/dist/sdk/cas/cas-segment-validator.js.map +1 -0
  114. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  115. package/dist/sdk/cas/index.js +1 -1
  116. package/dist/sdk/cas/pull-workflow.js +1 -1
  117. package/dist/sdk/cas/push-workflow.js +1 -1
  118. package/dist/sdk/cas/validate-files.d.ts +23 -6
  119. package/dist/sdk/cas/validate-files.d.ts.map +1 -1
  120. package/dist/sdk/cas/validate-files.js +1 -1
  121. package/dist/sdk/cas/validate-files.js.map +1 -1
  122. package/dist/sdk/client/cdp-api-client.js +1 -1
  123. package/dist/sdk/client/delivery-api-client.js +1 -1
  124. package/dist/sdk/client/endpoints.js +1 -1
  125. package/dist/sdk/client/engage-api-client.js +1 -1
  126. package/dist/sdk/client/http-client.js +1 -1
  127. package/dist/sdk/client/llm-api-client.js +1 -1
  128. package/dist/sdk/client/oauth-refresh.js +1 -1
  129. package/dist/sdk/client/p13n-studio-api-client.js +1 -1
  130. package/dist/sdk/client/rate-limiter.js +1 -1
  131. package/dist/sdk/client/td-api-client.js +1 -1
  132. package/dist/sdk/client/trino-api-client.js +1 -1
  133. package/dist/sdk/client/workflow-client.js +1 -1
  134. package/dist/sdk/connection-validator.js +1 -1
  135. package/dist/sdk/connection.js +1 -1
  136. package/dist/sdk/delivery.js +1 -1
  137. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  138. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  139. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  140. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  141. package/dist/sdk/engage/campaign-pull.js +1 -1
  142. package/dist/sdk/engage/campaign-push.js +1 -1
  143. package/dist/sdk/engage/campaign-validator.js +1 -1
  144. package/dist/sdk/engage/campaign-yaml.js +1 -1
  145. package/dist/sdk/engage/template-pull.js +1 -1
  146. package/dist/sdk/engage/template-push.js +1 -1
  147. package/dist/sdk/engage/template-validator.js +1 -1
  148. package/dist/sdk/engage/template-yaml.js +1 -1
  149. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  150. package/dist/sdk/engage/types/campaign-def.js +1 -1
  151. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  152. package/dist/sdk/engage/types/template-schema.js +1 -1
  153. package/dist/sdk/engage.js +1 -1
  154. package/dist/sdk/errors.js +1 -1
  155. package/dist/sdk/index.js +1 -1
  156. package/dist/sdk/io/index.js +1 -1
  157. package/dist/sdk/io/node-filesystem.js +1 -1
  158. package/dist/sdk/job.js +1 -1
  159. package/dist/sdk/journey.js +1 -1
  160. package/dist/sdk/llm/chat-cache.js +1 -1
  161. package/dist/sdk/llm/index.js +1 -1
  162. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  163. package/dist/sdk/llm/model-factors.js +1 -1
  164. package/dist/sdk/llm/user-settings.js +1 -1
  165. package/dist/sdk/p13n-studio.js +1 -1
  166. package/dist/sdk/personalization.js +1 -1
  167. package/dist/sdk/policy.js +1 -1
  168. package/dist/sdk/query/deleted-table-validation.js +1 -1
  169. package/dist/sdk/query/index.js +1 -1
  170. package/dist/sdk/query/sql-parser.js +1 -1
  171. package/dist/sdk/realtime.js +1 -1
  172. package/dist/sdk/schedule.js +1 -1
  173. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  174. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  175. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  176. package/dist/sdk/segment/fields-display.js +1 -1
  177. package/dist/sdk/segment/file-discovery.js +1 -1
  178. package/dist/sdk/segment/journey-utils.js +1 -1
  179. package/dist/sdk/segment/journey-validator.js +1 -1
  180. package/dist/sdk/segment/journey-yaml.js +1 -1
  181. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  182. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  183. package/dist/sdk/segment/pull-workflow.js +1 -1
  184. package/dist/sdk/segment/push-recovery.js +1 -1
  185. package/dist/sdk/segment/push-workflow.js +1 -1
  186. package/dist/sdk/segment/resolution-context.js +1 -1
  187. package/dist/sdk/segment/segment-path-parser.js +1 -1
  188. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  189. package/dist/sdk/segment/segment-validator.js +1 -1
  190. package/dist/sdk/segment/target-resolution.js +1 -1
  191. package/dist/sdk/segment/tdx-config.js +1 -1
  192. package/dist/sdk/segment/types/activation-schema.js +1 -1
  193. package/dist/sdk/segment/types/journey-def.js +1 -1
  194. package/dist/sdk/segment/types/journey-schema.js +1 -1
  195. package/dist/sdk/segment/types/segment-def.js +1 -1
  196. package/dist/sdk/segment/types/segment-schema.d.ts.map +1 -1
  197. package/dist/sdk/segment/types/segment-schema.js +1 -1
  198. package/dist/sdk/segment/types/segment-schema.js.map +1 -1
  199. package/dist/sdk/segment/validate-files.js +1 -1
  200. package/dist/sdk/segment/yaml-validator.d.ts +1 -1
  201. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  202. package/dist/sdk/segment/yaml-validator.js +1 -1
  203. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  204. package/dist/sdk/segment.js +1 -1
  205. package/dist/sdk/types/index.js +1 -1
  206. package/dist/sdk/types/progress.js +1 -1
  207. package/dist/sdk/types/workspace.js +1 -1
  208. package/dist/sdk/user.js +1 -1
  209. package/dist/sdk/util/format-detector.js +1 -1
  210. package/dist/sdk/util/formatters.js +1 -1
  211. package/dist/sdk/util/index.js +1 -1
  212. package/dist/sdk/util/paginate.js +1 -1
  213. package/dist/sdk/util/tree-formatter.js +1 -1
  214. package/dist/sdk/util/tree-search.js +1 -1
  215. package/dist/sdk/workflow/archive-validation.js +1 -1
  216. package/dist/sdk/workflow/clone-workflow.js +1 -1
  217. package/dist/sdk/workflow/index.js +1 -1
  218. package/dist/sdk/workflow/pull-workflow.js +1 -1
  219. package/dist/sdk/workflow/push-workflow.js +1 -1
  220. package/dist/sdk/workflow/task-graph.js +1 -1
  221. package/dist/sdk/workflow/tdx-config.js +1 -1
  222. package/dist/sdk/workflow/workflow-utils.js +1 -1
  223. package/dist/sdk/workspace/access-tracker.js +1 -1
  224. package/dist/sdk/workspace/frontmatter.js +1 -1
  225. package/dist/sdk/workspace/git.js +1 -1
  226. package/dist/sdk/workspace/index.js +1 -1
  227. package/dist/sdk/workspace/templates.js +1 -1
  228. package/dist/sdk/workspace/weekly.js +1 -1
  229. package/dist/sdk/workspace/wikilinks.js +1 -1
  230. package/dist/test-utils/command-runner.js +1 -1
  231. package/dist/test-utils/factories.js +1 -1
  232. package/dist/test-utils/fixtures.js +1 -1
  233. package/dist/test-utils/http-mock.js +1 -1
  234. package/dist/test-utils/index.js +1 -1
  235. package/dist/utils/async.js +1 -1
  236. package/dist/utils/claude-code-state.js +1 -1
  237. package/dist/utils/colors.js +1 -1
  238. package/dist/utils/diff.js +1 -1
  239. package/dist/utils/file-permissions.js +1 -1
  240. package/dist/utils/file-reader.js +1 -1
  241. package/dist/utils/github-releases.js +1 -1
  242. package/dist/utils/global-cache.js +1 -1
  243. package/dist/utils/json-loader.js +1 -1
  244. package/dist/utils/local-cache.js +1 -1
  245. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  246. package/dist/utils/logger/formatters/index.js +1 -1
  247. package/dist/utils/logger/handlers/console-handler.js +1 -1
  248. package/dist/utils/logger/handlers/file-handler.js +1 -1
  249. package/dist/utils/logger/handlers/index.js +1 -1
  250. package/dist/utils/logger/handlers/null-handler.js +1 -1
  251. package/dist/utils/logger/index.js +1 -1
  252. package/dist/utils/logger/logger.js +1 -1
  253. package/dist/utils/logger/types.js +1 -1
  254. package/dist/utils/option-validation.js +1 -1
  255. package/dist/utils/process.js +1 -1
  256. package/dist/utils/prompt.js +1 -1
  257. package/dist/utils/proxy-fetch.js +1 -1
  258. package/dist/utils/spinner.js +1 -1
  259. package/dist/utils/sse-parser.js +1 -1
  260. package/dist/utils/string-utils.js +1 -1
  261. package/dist/utils/table-ref-parser.js +1 -1
  262. package/dist/utils/tdx-logger.js +1 -1
  263. package/dist/utils/version-check.js +1 -1
  264. package/package.json +1 -1
@@ -1 +1 @@
1
- const a60_0x536582=a60_0x40f9;(function(_0x3ed240,_0x2ca038){const _0x1ab0c8=a60_0x40f9,_0x32c5bd=_0x3ed240();while(!![]){try{const _0x14734f=parseInt(_0x1ab0c8(0x2da))/0x1*(parseInt(_0x1ab0c8(0x33e))/0x2)+parseInt(_0x1ab0c8(0x307))/0x3*(parseInt(_0x1ab0c8(0x1c4))/0x4)+parseInt(_0x1ab0c8(0x2c5))/0x5+parseInt(_0x1ab0c8(0x2ed))/0x6*(-parseInt(_0x1ab0c8(0x241))/0x7)+parseInt(_0x1ab0c8(0x297))/0x8+parseInt(_0x1ab0c8(0x33d))/0x9+-parseInt(_0x1ab0c8(0x1f3))/0xa;if(_0x14734f===_0x2ca038)break;else _0x32c5bd['push'](_0x32c5bd['shift']());}catch(_0xed11b0){_0x32c5bd['push'](_0x32c5bd['shift']());}}}(a60_0x1bb7,0x82c72));import a60_0x529429 from'chalk';import{existsSync}from'fs';import a60_0x7d277e 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 a60_0x4e49d0 from'prompts';function getAttemptStatusDisplay(_0x338568){const _0x5aa63e=a60_0x40f9;if(!_0x338568)return{'icon':'⏳','text':''};const {done:_0x5c5d1c,success:_0x555e23,cancelRequested:_0xe71dc1}=_0x338568;if(!_0x5c5d1c)return _0xe71dc1?{'icon':'🛑','text':a60_0x529429[_0x5aa63e(0x2dc)](_0x5aa63e(0x1b4))}:{'icon':'🔄','text':a60_0x529429[_0x5aa63e(0x31e)](_0x5aa63e(0x1db))};if(_0x555e23)return{'icon':'✅','text':a60_0x529429[_0x5aa63e(0x1c1)](_0x5aa63e(0x219))};return{'icon':'❌','text':a60_0x529429['red']('error')};}export class WorkflowBaseCommand extends BaseCommand{[a60_0x536582(0x243)](_0x478018,_0x2ed64a,_0x2e1211=0x0){const _0x47bcd1=a60_0x536582;return _0x478018[_0x2e1211]||_0x2ed64a[_0x47bcd1(0x22e)];}[a60_0x536582(0x235)](_0x5376f0,_0x4e9514,_0xa4107=0x0){const _0x441ca4=a60_0x536582,_0x526e5f=this[_0x441ca4(0x243)](_0x5376f0,_0x4e9514,_0xa4107);if(!_0x526e5f)return console['error'](a60_0x529429[_0x441ca4(0x30f)](_0x441ca4(0x1f7)),_0x441ca4(0x304)),console[_0x441ca4(0x2f0)](a60_0x529429[_0x441ca4(0x1d7)](_0x441ca4(0x29b))),null;return _0x526e5f;}['parseProjectWorkflowPattern'](_0x3baf0a,_0x2f1e50){const _0x10c7c7=a60_0x536582;if(_0x3baf0a[0x0]){const _0x14b88f=_0x3baf0a[0x0][_0x10c7c7(0x21e)]('.');if(_0x14b88f[_0x10c7c7(0x330)]===0x1)return{'projectName':_0x14b88f[0x0],'workflowName':undefined};else return _0x14b88f[_0x10c7c7(0x330)]===0x2?{'projectName':_0x14b88f[0x0],'workflowName':_0x14b88f[0x1]}:(console['error'](a60_0x529429[_0x10c7c7(0x30f)](_0x10c7c7(0x1f7)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x2f1e50[_0x10c7c7(0x22e)],'workflowName':undefined};}[a60_0x536582(0x1d0)](_0x563604,_0x274521,_0x55c0fe=0x0){const _0x588568=a60_0x536582;if(_0x563604[_0x55c0fe])return _0x563604[_0x55c0fe];if(_0x274521[_0x588568(0x22e)]){const _0x371122=a60_0x7d277e[_0x588568(0x1c7)](process[_0x588568(0x19c)](),_0x588568(0x223),_0x274521[_0x588568(0x22e)]);if(existsSync(a60_0x7d277e[_0x588568(0x1c7)](_0x371122,'tdx.json')))return _0x371122;}return undefined;}async[a60_0x536582(0x317)](_0x2a6283,_0x2b8bd0,_0x59045e){const _0x15fa14=a60_0x536582;try{const _0x5ed136=await _0x2a6283[_0x15fa14(0x27b)][_0x15fa14(0x223)](_0x2b8bd0,{'limit':0x1});if(_0x5ed136['length']>0x0){const _0x8bb711=_0x5ed136[0x0]['id'],_0x585e12=getWorkflowUrl(_0x59045e,_0x8bb711);console[_0x15fa14(0x2f0)]('\x20\x20Console:\x20'+a60_0x529429[_0x15fa14(0x2ae)](_0x585e12));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a60_0x536582(0x1b1)]=a60_0x536582(0x284);[a60_0x536582(0x28b)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async['execute'](_0x300bd6){const _0x521dd4=a60_0x536582,{options:_0x1fcfe6,args:_0x200c73,tdx:_0x17412b}=_0x300bd6,_0x4a73b4=_0x200c73[0x0],_0x135306=_0x1fcfe6[_0x521dd4(0x1d4)];if(_0x135306)return saveSessionContext({'workflow_project':undefined},_0x1fcfe6[_0x521dd4(0x1e7)]),console['log'](a60_0x529429[_0x521dd4(0x1c1)](_0x521dd4(0x247))),0x0;if(!_0x4a73b4)return console[_0x521dd4(0x2f0)](a60_0x529429['red'](_0x521dd4(0x1f7)),'Project\x20name\x20is\x20required'),console[_0x521dd4(0x2f0)](a60_0x529429[_0x521dd4(0x1d7)](_0x521dd4(0x2ac))),console[_0x521dd4(0x2f0)](a60_0x529429['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x22fbb7=await withSpinner(_0x521dd4(0x2d1)+_0x4a73b4+'\x27...',()=>_0x17412b[_0x521dd4(0x27b)][_0x521dd4(0x252)](_0x4a73b4),{'verbose':_0x1fcfe6['verbose']}),{name:_0x4244dd}=_0x22fbb7[_0x521dd4(0x285)];return saveSessionContext({'workflow_project':_0x4244dd},_0x1fcfe6[_0x521dd4(0x1e7)]),console['log'](a60_0x529429['green'](_0x521dd4(0x23f)+a60_0x529429[_0x521dd4(0x2ae)](_0x4244dd))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a60_0x536582(0x1b1)]=a60_0x536582(0x2e9);[a60_0x536582(0x28b)]=a60_0x536582(0x19d);async[a60_0x536582(0x34d)](_0x29a867){const _0xf7b304=a60_0x536582,{options:_0x133bc2,args:_0x3c868f,tdx:_0x518dff}=_0x29a867,_0x532710=_0x3c868f[0x0];_0x133bc2[_0xf7b304(0x319)]&&_0x532710&&console['error'](_0xf7b304(0x279)+_0x532710);const _0x13dc1b=await withSpinner(_0xf7b304(0x2bf),()=>_0x518dff[_0xf7b304(0x27b)][_0xf7b304(0x1f5)](_0x532710,{'limit':_0x133bc2[_0xf7b304(0x199)]}),{'verbose':_0x133bc2[_0xf7b304(0x319)]});let _0x48dd9f=_0x13dc1b[_0xf7b304(0x285)];_0x48dd9f['sort']((_0x367f94,_0x4ed269)=>_0x367f94[_0xf7b304(0x1b1)]['localeCompare'](_0x4ed269[_0xf7b304(0x1b1)]));const _0x31414b=_0x133bc2[_0xf7b304(0x199)]&&_0x48dd9f['length']>=_0x133bc2[_0xf7b304(0x199)]?a60_0x529429[_0xf7b304(0x1d7)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0xf7b304(0x2f0)](_0xf7b304(0x2a6)+_0x48dd9f['length']+_0xf7b304(0x1ed)+(_0x48dd9f[_0xf7b304(0x330)]!==0x1?'s':'')+_0x31414b);if(_0x133bc2['format']===_0xf7b304(0x22d)||_0x133bc2[_0xf7b304(0x186)]===_0xf7b304(0x195)||_0x133bc2['format']===_0xf7b304(0x316))await handleSDKOutput(_0x48dd9f,_0x133bc2);else{if(_0x48dd9f[_0xf7b304(0x330)]===0x0)_0x532710?console['log']('No\x20projects\x20match\x20pattern:\x20'+_0x532710):console[_0xf7b304(0x2d7)](_0xf7b304(0x320));else{const _0x4d6a07=_0x48dd9f[_0xf7b304(0x338)](_0x45e608=>{const _0x9bc93f=_0xf7b304,_0x2058ad=_0x45e608['metadata']?.[_0x9bc93f(0x1b2)](_0x5df9d0=>_0x5df9d0[_0x9bc93f(0x242)]==='sys'),_0x5ea65a=_0x2058ad?a60_0x529429[_0x9bc93f(0x1d7)](_0x9bc93f(0x1ec)):'';return _0x9bc93f(0x26c)+_0x45e608['name']+_0x5ea65a;});await writeOutput(_0x4d6a07['join']('\x0a'),_0x133bc2[_0xf7b304(0x214)],_0xf7b304(0x1d8));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a60_0x536582(0x1b1)]='workflow:workflows';['description']=a60_0x536582(0x1f1);async[a60_0x536582(0x34d)](_0x1810e4){const _0x437825=a60_0x536582,{options:_0x5b9640,args:_0xa3b309,tdx:_0x2b7a7b}=_0x1810e4,_0x58a6a5=this[_0x437825(0x243)](_0xa3b309,_0x5b9640);_0x5b9640[_0x437825(0x319)]&&_0x58a6a5&&console['error'](_0x437825(0x348)+_0x58a6a5);const _0x2f7d56=await withSpinner('Listing\x20workflows...',()=>_0x2b7a7b['workflow'][_0x437825(0x223)](_0x58a6a5,{'limit':_0x5b9640[_0x437825(0x199)]}),{'verbose':_0x5b9640[_0x437825(0x319)]});let _0x4bb3e8=_0x2f7d56[_0x437825(0x285)];_0x4bb3e8['sort']((_0x4854cc,_0x3f684c)=>{const _0x378611=_0x437825,_0x5ee771=_0x4854cc[_0x378611(0x1b1)][_0x378611(0x2a5)](_0x3f684c[_0x378611(0x1b1)]);if(_0x5ee771!==0x0)return _0x5ee771;return(_0x4854cc['project']?.[_0x378611(0x1b1)]||'')[_0x378611(0x2a5)](_0x3f684c[_0x378611(0x32f)]?.[_0x378611(0x1b1)]||'');});const _0x3d368a=_0x5b9640['limit']&&_0x4bb3e8[_0x437825(0x330)]>=_0x5b9640[_0x437825(0x199)]?a60_0x529429['dim'](_0x437825(0x22a)):'';console['error'](_0x437825(0x2a6)+_0x4bb3e8[_0x437825(0x330)]+_0x437825(0x2c9)+(_0x4bb3e8[_0x437825(0x330)]!==0x1?'s':'')+_0x3d368a);if(_0x5b9640['format']===_0x437825(0x22d)||_0x5b9640[_0x437825(0x186)]===_0x437825(0x195)||_0x5b9640[_0x437825(0x186)]===_0x437825(0x316))await handleSDKOutput(_0x4bb3e8,_0x5b9640);else{if(_0x4bb3e8['length']===0x0)_0x58a6a5?console[_0x437825(0x2d7)](_0x437825(0x2c3)+_0x58a6a5):console[_0x437825(0x2d7)](_0x437825(0x327));else{const _0x1ce4e8=_0x5b9640['site'],_0x244f84=_0x4bb3e8[_0x437825(0x338)](_0x41d7c8=>{const _0x53075c=_0x437825,_0x46bcaa=a60_0x529429[_0x53075c(0x1d7)]('#'+_0x41d7c8['id']),_0x2699da=hyperlink(_0x46bcaa,getWorkflowUrl(_0x1ce4e8,_0x41d7c8['id'])),_0x9785c7=_0x41d7c8[_0x53075c(0x32f)]?.['name']?a60_0x529429[_0x53075c(0x1d7)]('\x20('+_0x41d7c8['project'][_0x53075c(0x1b1)]+')'):'';return _0x53075c(0x29f)+_0x2699da+'\x20'+_0x41d7c8['name']+_0x9785c7;});await writeOutput(_0x244f84[_0x437825(0x1c7)]('\x0a'),_0x5b9640[_0x437825(0x214)],_0x437825(0x1d8));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a60_0x536582(0x1b1)]=a60_0x536582(0x293);[a60_0x536582(0x28b)]=a60_0x536582(0x1ce);async[a60_0x536582(0x34d)](_0x5acb8e){const _0x1b914f=a60_0x536582,{options:_0x152282,args:_0x2699d9,tdx:_0x1e56e4}=_0x5acb8e,_0x5cece8=this['parseProjectWorkflowPattern'](_0x2699d9,_0x152282);if(!_0x5cece8)return 0x1;const {projectName:_0x32c834,workflowName:_0x502545}=_0x5cece8;if(_0x152282['verbose']){if(_0x32c834&&_0x502545)console['error'](_0x1b914f(0x24c)+_0x32c834+'.'+_0x502545);else _0x32c834&&console[_0x1b914f(0x2f0)]('Filter:\x20project='+_0x32c834);const _0x31adb6=_0x152282[_0x1b914f(0x305)];_0x31adb6&&console['error']('Status:\x20'+_0x31adb6);}let _0x11bcb5=0x28;if(process['stdout']['isTTY']&&!_0x152282[_0x1b914f(0x214)]&&!_0x152282['format']){const _0x443a02=process[_0x1b914f(0x229)][_0x1b914f(0x30b)]||0x28;_0x11bcb5=Math['max'](0x14,Math[_0x1b914f(0x2ea)](_0x443a02*0x2/0x3));}const _0x54b519=_0x152282[_0x1b914f(0x199)]||_0x11bcb5,_0x1cc49f=await withSpinner(_0x1b914f(0x1c6),()=>_0x1e56e4[_0x1b914f(0x27b)][_0x1b914f(0x27a)]({'projectName':_0x32c834,'workflowName':_0x502545,'status':_0x152282['status'],'fromTime':_0x152282[_0x1b914f(0x2b8)],'toTime':_0x152282['to'],'limit':_0x54b519}),{'verbose':_0x152282['verbose']}),_0x5d4af1=_0x1cc49f[_0x1b914f(0x285)];_0x5d4af1[_0x1b914f(0x259)]((_0xab0720,_0x8dfccb)=>{const _0x3229af=_0x1b914f,_0x146873=_0xab0720['sessionTime']||'',_0x4ef08f=_0x8dfccb[_0x3229af(0x298)]||'';return _0x4ef08f['localeCompare'](_0x146873);});_0x5d4af1[_0x1b914f(0x330)]>=_0x54b519?console[_0x1b914f(0x2f0)]('✔\x20Showing\x20'+_0x5d4af1[_0x1b914f(0x330)]+_0x1b914f(0x1b6)+a60_0x529429[_0x1b914f(0x1d7)]('(use\x20--limit\x20to\x20see\x20more)')):console['error'](_0x1b914f(0x2a6)+_0x5d4af1[_0x1b914f(0x330)]+'\x20session'+(_0x5d4af1[_0x1b914f(0x330)]!==0x1?'s':''));if(_0x152282[_0x1b914f(0x186)]===_0x1b914f(0x22d)||_0x152282[_0x1b914f(0x186)]===_0x1b914f(0x195)||_0x152282[_0x1b914f(0x186)]===_0x1b914f(0x316))await handleSDKOutput(_0x5d4af1,_0x152282);else{if(!process[_0x1b914f(0x229)][_0x1b914f(0x335)]||_0x152282[_0x1b914f(0x214)]){if(_0x5d4af1[_0x1b914f(0x330)]===0x0){if(_0x32c834&&_0x502545)console[_0x1b914f(0x2d7)]('No\x20sessions\x20found\x20for:\x20'+_0x32c834+'.'+_0x502545);else _0x32c834?console['log'](_0x1b914f(0x20a)+_0x32c834):console[_0x1b914f(0x2d7)](_0x1b914f(0x1f0));}else{const _0x53a43a=_0x152282[_0x1b914f(0x1ba)],_0x3cde74=this['renderSessionsTimeline'](_0x5d4af1,_0x53a43a);_0x152282[_0x1b914f(0x214)]?await writeOutput(_0x3cde74,_0x152282[_0x1b914f(0x214)],'list'):console[_0x1b914f(0x2d7)](_0x3cde74);}!_0x32c834&&(console['error'](''),console[_0x1b914f(0x2f0)](a60_0x529429[_0x1b914f(0x1d7)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x1b914f(0x2f0)](a60_0x529429[_0x1b914f(0x1d7)](_0x1b914f(0x21a))+'or'+a60_0x529429[_0x1b914f(0x1d7)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x5d4af1[_0x1b914f(0x330)]===0x0){if(_0x32c834&&_0x502545)console[_0x1b914f(0x2d7)](_0x1b914f(0x192)+_0x32c834+'.'+_0x502545);else _0x32c834?console[_0x1b914f(0x2d7)](_0x1b914f(0x20a)+_0x32c834):console[_0x1b914f(0x2d7)]('No\x20sessions\x20found');}else await this[_0x1b914f(0x2db)](_0x5d4af1,_0x5acb8e,_0x32c834);}}return 0x0;}[a60_0x536582(0x2f4)](_0x5442e8,_0x2aa7e4){const _0x4d5627=a60_0x536582,_0xb871dd=[],_0x2d27f9=new Map();let _0x1249c0=Infinity,_0x13acd3=-Infinity;for(const _0x49fef8 of _0x5442e8){if(_0x49fef8[_0x4d5627(0x2b5)]?.[_0x4d5627(0x1bc)]){const _0x2a5a8f=new Date(_0x49fef8[_0x4d5627(0x2b5)][_0x4d5627(0x1bc)])[_0x4d5627(0x236)](),_0x470c34=_0x49fef8[_0x4d5627(0x2b5)][_0x4d5627(0x2f1)]?new Date(_0x49fef8[_0x4d5627(0x2b5)][_0x4d5627(0x2f1)])[_0x4d5627(0x236)]():Date['now'](),_0x2de10e=_0x49fef8['project']?.['name']||_0x4d5627(0x2bd);!_0x2d27f9[_0x4d5627(0x31f)](_0x2de10e)&&_0x2d27f9['set'](_0x2de10e,[]),_0x2d27f9[_0x4d5627(0x2af)](_0x2de10e)[_0x4d5627(0x18f)]({'session':_0x49fef8,'startTime':_0x2a5a8f,'endTime':_0x470c34,'duration':_0x470c34-_0x2a5a8f}),_0x1249c0=Math['min'](_0x1249c0,_0x2a5a8f),_0x13acd3=Math[_0x4d5627(0x2a8)](_0x13acd3,_0x470c34);}}if(_0x2d27f9[_0x4d5627(0x2bb)]===0x0)return _0x4d5627(0x216);const _0x4b577e=process[_0x4d5627(0x229)][_0x4d5627(0x224)]||0x78,_0x2d9055=0x1e,_0x8f30ab=0x32,_0x5f3536=0x4,_0x4ed299=Math[_0x4d5627(0x2d2)](_0x8f30ab,Math['max'](_0x2d9055,Math['floor'](_0x4b577e*0.3))),_0x3dda5f=_0x4b577e-_0x4ed299-TIMELINE_CONFIG[_0x4d5627(0x300)]-0x3-_0x5f3536,_0x39e762=_0x13acd3-_0x1249c0,_0x39142e=_0x39e762/_0x4ed299,_0x1a36c1=renderTimeAxis({'startTime':_0x1249c0,'endTime':_0x13acd3,'durationMs':_0x39e762,'msPerChar':_0x39142e},_0x4ed299),_0xdc33b5=[];for(const _0x383246 of _0x2d27f9['values']()){_0xdc33b5['push'](..._0x383246);}_0xdc33b5[_0x4d5627(0x259)]((_0x2f0e20,_0x198acb)=>_0x198acb[_0x4d5627(0x202)]-_0x2f0e20['startTime']);const _0x35da47=new Date(_0x1249c0),_0x653424=formatDate(_0x35da47),_0x2a2a61=_0x5f3536+TIMELINE_CONFIG[_0x4d5627(0x28c)]+TIMELINE_CONFIG[_0x4d5627(0x1b9)]+_0x3dda5f,_0x548f0e='\x20'[_0x4d5627(0x1ff)](_0x2a2a61-_0x653424[_0x4d5627(0x330)]),_0x89aed9=_0x548f0e+a60_0x529429[_0x4d5627(0x1d7)](_0x653424)+'\x20'+_0x1a36c1;_0xb871dd[_0x4d5627(0x18f)](_0x89aed9);const _0x360ce5=0x16;let _0x354427=0x0;for(const _0x507041 of _0xdc33b5){const _0x42cd6c=_0x507041['session'][_0x4d5627(0x32f)]?.[_0x4d5627(0x1b1)]||'?',_0x18f7ec=Math[_0x4d5627(0x2d2)](stringWidth(_0x42cd6c),_0x360ce5);_0x354427=Math['max'](_0x354427,_0x18f7ec);}for(const _0x2bfa59 of _0xdc33b5){const {session:_0x1c59f2,startTime:_0x1381bc,endTime:_0x3429cd,duration:_0x209c8a}=_0x2bfa59,_0x74775a=_0x1c59f2['project']?.['id'],_0xadc7a=_0x1c59f2['id'],_0x5d4614=_0x1c59f2[_0x4d5627(0x32f)]?.[_0x4d5627(0x1b1)]||'?',_0x5541cb=_0x1c59f2['workflow']?.[_0x4d5627(0x1b1)]||'?';let _0x29c73f,_0x195d3a;if(_0x1c59f2[_0x4d5627(0x2b5)]){const _0x215f62=_0x1c59f2[_0x4d5627(0x2b5)];!_0x215f62['done']?(_0x29c73f=_0x215f62[_0x4d5627(0x1e4)]?'🛑':'🔄',_0x195d3a=_0x215f62[_0x4d5627(0x1e4)]?a60_0x529429[_0x4d5627(0x2dc)]:a60_0x529429['blue']):(_0x29c73f=_0x215f62[_0x4d5627(0x219)]?'✅':'❌',_0x195d3a=_0x215f62[_0x4d5627(0x219)]?a60_0x529429[_0x4d5627(0x1c1)]:a60_0x529429['red']);}else _0x29c73f='⏳',_0x195d3a=a60_0x529429[_0x4d5627(0x1d7)];const _0x2d0f2c='#'+_0xadc7a,_0x10d133=_0x74775a?hyperlink(_0x2d0f2c,getWorkflowSessionUrl(_0x2aa7e4,_0x74775a,_0xadc7a)):_0x2d0f2c;let _0x2550d8=_0x5d4614;stringWidth(_0x5d4614)>_0x360ce5&&(_0x2550d8=_0x5d4614[_0x4d5627(0x28a)](0x0,_0x360ce5-0x1)+'…');const _0x24d50b=a60_0x529429['dim'](_0x2550d8),_0x26de85=stringWidth(_0x2550d8),_0x5dfbe5='\x20'[_0x4d5627(0x1ff)](_0x354427-stringWidth(_0x2550d8)+0x2),_0x4df8f0='('+formatElapsed(_0x209c8a)+')',_0x4b67a6=stringWidth(_0x4df8f0),_0x132c16=stringWidth(_0x2d0f2c),_0x38f418=_0x132c16+0x1+_0x26de85+_0x5dfbe5[_0x4d5627(0x330)],_0x33cc30=_0x3dda5f-_0x38f418-_0x4b67a6-0x1-0x8;let _0x4671c6=_0x5541cb;stringWidth(_0x4671c6)>_0x33cc30&&(_0x4671c6=_0x4671c6[_0x4d5627(0x28a)](0x0,_0x33cc30-0x1)+'…');const _0x5a9088=_0x10d133+'\x20'+_0x24d50b+_0x5dfbe5+_0x4671c6,_0x3500b8=stringWidth(_0x5a9088),_0x4a4668=_0x3dda5f-_0x3500b8-_0x4b67a6,_0xa84004=_0x5a9088+'\x20'[_0x4d5627(0x1ff)](Math[_0x4d5627(0x2a8)](0x1,_0x4a4668))+a60_0x529429[_0x4d5627(0x1d7)](_0x4df8f0),_0x505906=Math[_0x4d5627(0x2ea)]((_0x1381bc-_0x1249c0)/_0x39142e),_0x579041=Math[_0x4d5627(0x2ea)]((_0x3429cd-_0x1249c0)/_0x39142e),_0x323996=Math[_0x4d5627(0x2a8)](_0x505906+0x1,_0x579041),_0x298919=new Array(_0x4ed299)[_0x4d5627(0x1ef)]('\x20');for(let _0x27bf6b=_0x505906;_0x27bf6b<Math['min'](_0x323996,_0x4ed299);_0x27bf6b++){_0x298919[_0x27bf6b]='─';}const _0x1fd464=_0x298919[_0x4d5627(0x338)](_0x409b31=>_0x409b31==='\x20'?'\x20':_0x195d3a(_0x409b31))[_0x4d5627(0x1c7)]('');_0xb871dd[_0x4d5627(0x18f)](_0x29c73f+'\x20'+_0xa84004+'│'+_0x1fd464+'│');}return _0xb871dd[_0x4d5627(0x1c7)]('\x0a');}async['navigateSessionsInteractive'](_0x2b400d,_0x34d8ba,_0x38eb6c){const _0x3b93d4=a60_0x536582,{options:_0x1f99c5,tdx:_0x26fd46}=_0x34d8ba,_0x3f26ba=_0x1f99c5['site'],{timelineRows:_0x730def,timeAxisHeader:_0x156fc4}=this[_0x3b93d4(0x1f9)](_0x2b400d,_0x3f26ba),_0x205066=_0x730def[_0x3b93d4(0x23a)](_0x266783=>_0x266783[_0x3b93d4(0x24f)]);if(_0x205066[_0x3b93d4(0x330)]===0x0){const _0x16c2ea=this[_0x3b93d4(0x2f4)](_0x2b400d,_0x3f26ba);console[_0x3b93d4(0x2d7)](_0x16c2ea);!_0x38eb6c&&(console[_0x3b93d4(0x2f0)](''),console['error'](a60_0x529429['dim'](_0x3b93d4(0x294))),console['error'](a60_0x529429[_0x3b93d4(0x1d7)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a60_0x529429[_0x3b93d4(0x1d7)](_0x3b93d4(0x191))));return;}_0x156fc4&&console[_0x3b93d4(0x2d7)](_0x156fc4);const _0x43d591=_0x730def[_0x3b93d4(0x23a)](_0x50dfc1=>_0x50dfc1[_0x3b93d4(0x24f)])[_0x3b93d4(0x338)](_0x479456=>({'title':_0x479456[_0x3b93d4(0x25b)],'value':_0x479456[_0x3b93d4(0x24f)]})),_0x55b5f8=process['stdout'][_0x3b93d4(0x30b)]||0x3c,_0x2b575e=Math[_0x3b93d4(0x2a8)](0x28,Math[_0x3b93d4(0x2ea)](_0x55b5f8*0x2/0x3)),_0x51d7ff=await a60_0x4e49d0({'type':_0x3b93d4(0x19e),'name':_0x3b93d4(0x24f),'message':_0x3b93d4(0x33c),'choices':_0x43d591,'initial':-0x1,'limit':_0x2b575e,'clearFirst':!![],'fallback':{'title':_0x3b93d4(0x315),'value':null},'suggest':(_0x8b017a,_0x1eb917)=>{const _0x428912=_0x3b93d4;if(!_0x8b017a)return Promise[_0x428912(0x1d9)](_0x1eb917);const _0x2ff67b=_0x1eb917[_0x428912(0x23a)](_0x22d27b=>{const _0x51a054=_0x428912,_0x29f36d=_0x22d27b;return _0x29f36d[_0x51a054(0x296)][_0x51a054(0x26f)]()[_0x51a054(0x1a3)](_0x8b017a[_0x51a054(0x26f)]());});return Promise[_0x428912(0x1d9)](_0x2ff67b);}}),_0x1c34f8=()=>{const _0x37b39f=_0x3b93d4;process['stdout'][_0x37b39f(0x2a0)]('\x1b[1A\x1b[2K'),process[_0x37b39f(0x229)]['write'](_0x37b39f(0x2a3)),process[_0x37b39f(0x229)][_0x37b39f(0x2a0)](_0x37b39f(0x2a3));},_0x2e4a74=_0x51d7ff&&_0x51d7ff[_0x3b93d4(0x24f)]&&_0x51d7ff['attemptId']!==null&&_0x51d7ff[_0x3b93d4(0x24f)]['trim']()!=='';if(!_0x2e4a74){_0x1c34f8(),console['log'](a60_0x529429[_0x3b93d4(0x1d7)](_0x3b93d4(0x274)));return;}_0x1c34f8();const _0x489a0a=_0x2b400d[_0x3b93d4(0x323)](_0x419dd5=>_0x419dd5[_0x3b93d4(0x2b5)]?.['id']===_0x51d7ff[_0x3b93d4(0x24f)]);if(_0x489a0a){const _0x128130=_0x489a0a[_0x3b93d4(0x32f)]?.[_0x3b93d4(0x1b1)]||'?',_0x3c9b62=_0x489a0a[_0x3b93d4(0x27b)]?.['name']||'?';console[_0x3b93d4(0x2d7)](_0x3b93d4(0x30a)+a60_0x529429[_0x3b93d4(0x1d7)](_0x128130)+_0x3b93d4(0x260)+a60_0x529429[_0x3b93d4(0x1d7)](_0x3c9b62));}const _0x3896f3=new WorkflowTimelineCommand();await _0x3896f3['execute']({'args':[],'options':{..._0x1f99c5,'attemptId':_0x51d7ff[_0x3b93d4(0x24f)]},'tdx':_0x26fd46});}['generateSessionTimelineRows'](_0x41af83,_0x22b224){const _0x111a01=a60_0x536582,_0x33094b=new Map();for(const _0x1c9c0f of _0x41af83){_0x1c9c0f['id']&&_0x1c9c0f['lastAttempt']?.['id']&&_0x33094b[_0x111a01(0x203)](_0x1c9c0f['id'],_0x1c9c0f['lastAttempt']['id']);}const _0x90919b=[];let _0x1efe3c='';const _0x5f45cf=this[_0x111a01(0x2f4)](_0x41af83,_0x22b224),_0x5d30d4=_0x5f45cf[_0x111a01(0x21e)]('\x0a');for(const _0x402334 of _0x5d30d4){if(_0x402334[_0x111a01(0x271)](_0x111a01(0x27e))||_0x402334[_0x111a01(0x1cc)](/^\s+\d{4}-\d{2}-\d{2}/))_0x1efe3c=_0x402334;else{if(_0x402334['match'](/^[✅❌🔄🛑⏳]/)){const _0x565efa=_0x402334[_0x111a01(0x1cc)](/#(\d+)/),_0x279c94=_0x565efa?_0x565efa[0x1]:null,_0x466481=_0x279c94?_0x33094b[_0x111a01(0x2af)](_0x279c94)||null:null,_0x5c0d11=_0x41af83[_0x111a01(0x323)](_0x4c018e=>_0x4c018e['id']===_0x279c94),_0x58126b=_0x5c0d11?.['project']?.[_0x111a01(0x1b1)]||'';_0x90919b['push']({'displayLine':_0x402334,'attemptId':_0x466481,'projectName':_0x58126b});}}}return{'timelineRows':_0x90919b,'timeAxisHeader':_0x1efe3c};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a60_0x536582(0x1b1)]=a60_0x536582(0x1e9);[a60_0x536582(0x28b)]=a60_0x536582(0x21f);async[a60_0x536582(0x34d)](_0xa63084){const _0x3b11ba=a60_0x536582,{options:_0x5561e7,args:_0x5e5822,tdx:_0x1580d9}=_0xa63084,_0x2bdefa=this[_0x3b11ba(0x2d4)](_0x5e5822,_0x5561e7);if(!_0x2bdefa)return 0x1;const {projectName:_0x3632a4,workflowName:_0x9fe4b9}=_0x2bdefa,_0x279a85=_0x5561e7[_0x3b11ba(0x206)];if(_0x5561e7[_0x3b11ba(0x319)]){if(_0x3632a4&&_0x9fe4b9)console[_0x3b11ba(0x2f0)](_0x3b11ba(0x24c)+_0x3632a4+'.'+_0x9fe4b9);else _0x3632a4&&console[_0x3b11ba(0x2f0)](_0x3b11ba(0x267)+_0x3632a4);_0x279a85&&console[_0x3b11ba(0x2f0)](_0x3b11ba(0x18d));}const _0x59dea6=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x1580d9[_0x3b11ba(0x27b)]['attempts']({'projectName':_0x3632a4,'workflowName':_0x9fe4b9,'includeRetried':_0x279a85,'limit':_0x5561e7[_0x3b11ba(0x199)]}),{'verbose':_0x5561e7['verbose']}),_0x38f329=_0x59dea6['data'],_0x3e965a=_0x5561e7[_0x3b11ba(0x199)]||0x64,_0x4d533e=_0x38f329['length']>=_0x3e965a?a60_0x529429[_0x3b11ba(0x1d7)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x3b11ba(0x2f0)](_0x3b11ba(0x2a6)+_0x38f329['length']+_0x3b11ba(0x246)+(_0x38f329[_0x3b11ba(0x330)]!==0x1?'s':'')+_0x4d533e);if(_0x5561e7[_0x3b11ba(0x186)]===_0x3b11ba(0x22d)||_0x5561e7[_0x3b11ba(0x186)]===_0x3b11ba(0x195)||_0x5561e7[_0x3b11ba(0x186)]==='table')await handleSDKOutput(_0x38f329,_0x5561e7);else{if(_0x38f329['length']===0x0){if(_0x3632a4&&_0x9fe4b9)console[_0x3b11ba(0x2d7)](_0x3b11ba(0x1d6)+_0x3632a4+'.'+_0x9fe4b9);else _0x3632a4?console[_0x3b11ba(0x2d7)](_0x3b11ba(0x255)+_0x3632a4):console['log']('No\x20attempts\x20found');}else{const _0x18d426=_0x5561e7['site'],_0x28cab4=_0x38f329['map'](_0x2861fe=>{const _0xffbbef=_0x3b11ba,_0x3d3172=a60_0x529429[_0xffbbef(0x1d7)]('#'+_0x2861fe['id']),_0x509867=_0x2861fe[_0xffbbef(0x32f)]?.['id'],_0x1cd0a5=_0x2861fe['session_id']||_0x2861fe[_0xffbbef(0x26e)],_0x1e4192=_0x509867&&_0x1cd0a5?hyperlink(_0x3d3172,getWorkflowAttemptUrl(_0x18d426,_0x509867,_0x1cd0a5,_0x2861fe['id'])):_0x3d3172,{icon:_0x35452a,text:_0x52122c}=getAttemptStatusDisplay(_0x2861fe),_0x46b1fa=(_0x2861fe[_0xffbbef(0x32f)]?.['name']||'?')+'.'+(_0x2861fe[_0xffbbef(0x27b)]?.[_0xffbbef(0x1b1)]||'?'),_0x115dc1=_0x2861fe[_0xffbbef(0x298)]?a60_0x529429[_0xffbbef(0x1d7)](_0x2861fe[_0xffbbef(0x298)]):'';return(_0x1e4192+'\x20'+_0x35452a+(_0x52122c?'\x20'+_0x52122c:'')+'\x20'+_0x46b1fa+'\x20'+_0x115dc1)[_0xffbbef(0x20f)]();});await writeOutput(_0x28cab4[_0x3b11ba(0x1c7)]('\x0a'),_0x5561e7[_0x3b11ba(0x214)],_0x3b11ba(0x1d8));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a60_0x536582(0x1b1)]='workflow:attempt';['description']='Show\x20specific\x20attempt\x20details';async[a60_0x536582(0x34d)](_0x4af394){const _0x25bb87=a60_0x536582,{options:_0x330f22,args:_0x30edc0,tdx:_0x335039}=_0x4af394,_0xc02220=_0x30edc0[0x0];if(!_0xc02220)return console[_0x25bb87(0x2f0)](_0x25bb87(0x2ef)),0x1;_0x330f22[_0x25bb87(0x319)]&&console[_0x25bb87(0x2f0)](_0x25bb87(0x32a)+_0xc02220);const _0x13ff39=await withSpinner(_0x25bb87(0x2e1),()=>_0x335039[_0x25bb87(0x27b)][_0x25bb87(0x34e)](_0xc02220),{'verbose':_0x330f22['verbose']}),_0x325928=_0x13ff39[_0x25bb87(0x285)];let _0x43afe3;!_0x325928[_0x25bb87(0x1d2)]?_0x43afe3=_0x325928[_0x25bb87(0x1e4)]?_0x25bb87(0x1b4):'running':_0x43afe3=_0x325928['success']?_0x25bb87(0x219):'error';let _0xee63d0;if(_0x325928[_0x25bb87(0x1bc)]&&_0x325928['finishedAt']){const _0x5669c1=new Date(_0x325928[_0x25bb87(0x1bc)])[_0x25bb87(0x236)](),_0x32d7c6=new Date(_0x325928[_0x25bb87(0x2f1)])['getTime']();_0xee63d0=Math['round']((_0x32d7c6-_0x5669c1)/0x3e8);}const _0x22fef3={'attempt_id':_0x325928['id'],'status':_0x43afe3,..._0x325928['index']!==undefined&&{'index':_0x325928[_0x25bb87(0x2fc)]},..._0x325928['project']&&{'project':_0x325928['project'][_0x25bb87(0x1b1)]},..._0x325928[_0x25bb87(0x27b)]&&{'workflow':_0x325928[_0x25bb87(0x27b)][_0x25bb87(0x1b1)]},..._0x325928[_0x25bb87(0x26e)]&&{'session_id':_0x325928['sessionId']},..._0x325928['sessionTime']&&{'session_time':_0x325928[_0x25bb87(0x298)]},..._0x325928['retryAttemptName']&&{'retry_attempt':_0x325928[_0x25bb87(0x287)]},..._0xee63d0!==undefined&&{'duration_sec':_0xee63d0},..._0x325928[_0x25bb87(0x1bc)]&&{'created_at':_0x325928['createdAt']},..._0x325928[_0x25bb87(0x2f1)]&&{'finished_at':_0x325928[_0x25bb87(0x2f1)]},...Object[_0x25bb87(0x2e6)](_0x325928[_0x25bb87(0x2c0)])[_0x25bb87(0x330)]>0x0&&{'params':_0x325928['params']}};return await handleSingleObjectOutput(_0x22fef3,_0x330f22),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a60_0x536582(0x1b1)]=a60_0x536582(0x295);[a60_0x536582(0x28b)]='Show\x20tasks\x20for\x20an\x20attempt';async['execute'](_0x25c3fa){const _0x52abcd=a60_0x536582,{options:_0x520830,args:_0x54d330,tdx:_0x2c2c96}=_0x25c3fa,_0x4093f8=_0x54d330[0x0];if(!_0x4093f8)return console[_0x52abcd(0x2f0)](_0x52abcd(0x2ef)),0x1;const _0xb30e1=_0x520830[_0x52abcd(0x2ff)];_0x520830[_0x52abcd(0x319)]&&(console[_0x52abcd(0x2f0)](_0x52abcd(0x32a)+_0x4093f8),_0xb30e1&&console[_0x52abcd(0x2f0)](_0x52abcd(0x2b4)));const _0x348089=await withSpinner(_0x52abcd(0x1ca),()=>_0x2c2c96[_0x52abcd(0x27b)]['tasks'](_0x4093f8,_0xb30e1||![]),{'verbose':_0x520830[_0x52abcd(0x319)]}),_0x46a69d=_0x348089[_0x52abcd(0x285)];return console[_0x52abcd(0x2f0)](_0x52abcd(0x2a6)+_0x46a69d[_0x52abcd(0x330)]+'\x20task'+(_0x46a69d[_0x52abcd(0x330)]!==0x1?'s':'')),await handleSDKOutput(_0x46a69d,_0x520830),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a60_0x536582(0x249);['description']=a60_0x536582(0x1fc);async[a60_0x536582(0x34d)](_0x5927e2){const _0x54a469=a60_0x536582,{options:_0x3f294c,args:_0x11218a,tdx:_0x4ddedc}=_0x5927e2,_0xb078a4=_0x11218a[0x0];let _0x405ea0=_0x11218a[0x1];if(!_0xb078a4)return console[_0x54a469(0x2f0)](_0x54a469(0x2ef)),0x1;_0x3f294c[_0x54a469(0x319)]&&(console[_0x54a469(0x2f0)](_0x54a469(0x32a)+_0xb078a4),_0x405ea0&&console[_0x54a469(0x2f0)](_0x54a469(0x25a)+_0x405ea0));const _0x23fa79=await withSpinner(_0x54a469(0x32e),()=>_0x4ddedc['workflow'][_0x54a469(0x34c)](_0xb078a4,_0x405ea0),{'verbose':_0x3f294c[_0x54a469(0x319)]}),_0x540534=_0x23fa79[_0x54a469(0x285)];if(_0x540534[_0x54a469(0x330)]===0x0)return console[_0x54a469(0x2f0)](_0x54a469(0x2e7)),0x0;if(!_0x405ea0&&(_0x3f294c[_0x54a469(0x22d)]||_0x3f294c[_0x54a469(0x186)]))return await handleSDKOutput(_0x540534,_0x3f294c),0x0;if(!_0x405ea0){const _0x59919b=_0x540534['map'](_0x3db82e=>({'title':_0x3db82e[_0x54a469(0x25e)]+'\x20('+formatBytes(_0x3db82e[_0x54a469(0x2cc)])+')','value':_0x3db82e[_0x54a469(0x25e)]})),_0x54f589=await a60_0x4e49d0({'type':_0x54a469(0x1b0),'name':_0x54a469(0x31d),'message':_0x54a469(0x1bb),'choices':_0x59919b});if(!_0x54f589['task'])return console['error'](_0x54a469(0x274)),0x0;_0x405ea0=_0x54f589['task'];}const _0x38d438=await withSpinner(_0x54a469(0x344),()=>_0x4ddedc[_0x54a469(0x27b)][_0x54a469(0x2b9)](_0xb078a4,_0x405ea0),{'verbose':_0x3f294c[_0x54a469(0x319)]}),_0xcfb4d3=_0x38d438[_0x54a469(0x285)];return _0xcfb4d3?console[_0x54a469(0x2d7)](_0xcfb4d3):console[_0x54a469(0x2f0)](_0x54a469(0x32b)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']='workflow:kill';[a60_0x536582(0x28b)]=a60_0x536582(0x28e);async[a60_0x536582(0x34d)](_0x2b0c53){const _0x67563d=a60_0x536582,{options:_0x59dcdf,args:_0xfd2daa,tdx:_0xb8619}=_0x2b0c53,_0x36e840=_0xfd2daa[0x0];if(!_0x36e840)return console[_0x67563d(0x2f0)](_0x67563d(0x2ef)),0x1;const _0x498a98=_0x59dcdf[_0x67563d(0x349)];_0x59dcdf[_0x67563d(0x319)]&&(console[_0x67563d(0x2f0)]('Attempt\x20ID:\x20'+_0x36e840),_0x498a98&&console['error'](_0x67563d(0x28d)+_0x498a98));if(!_0x59dcdf[_0x67563d(0x254)]){if(!isInteractive())return console['error'](a60_0x529429[_0x67563d(0x30f)]('\x0aError:'),_0x67563d(0x339)),console[_0x67563d(0x2f0)](a60_0x529429['dim'](_0x67563d(0x238))),0x1;const _0x54cf1f=await confirmKey(_0x67563d(0x1dc)+_0x36e840+'?');if(!_0x54cf1f)return console[_0x67563d(0x2f0)](a60_0x529429[_0x67563d(0x2dc)]('Cancelled')),0x1;}const _0x57ec96=await withSpinner(_0x67563d(0x334),()=>_0xb8619[_0x67563d(0x27b)][_0x67563d(0x2fd)](_0x36e840,_0x498a98),{'verbose':_0x59dcdf['verbose']}),_0xc68fa8=_0x57ec96[_0x67563d(0x285)];return console[_0x67563d(0x2f0)]('✔\x20'+_0xc68fa8),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a60_0x536582(0x1b1)]=a60_0x536582(0x2fe);[a60_0x536582(0x28b)]='Retry\x20a\x20session\x20or\x20attempt';async['execute'](_0x1f3cec){const _0x193645=a60_0x536582,{options:_0x21316e,args:_0x4b1cd7,tdx:_0x3cb090}=_0x1f3cec,_0x597d9c=_0x4b1cd7[0x0];if(!_0x597d9c)return console[_0x193645(0x2f0)](_0x193645(0x19f)),console[_0x193645(0x2f0)](_0x193645(0x220)),0x1;let _0x1a44fb=![],_0x3baa54=_0x597d9c;if(_0x597d9c[_0x193645(0x271)](_0x193645(0x1ab)))_0x1a44fb=!![],_0x3baa54=_0x597d9c[_0x193645(0x22c)](0x8);else{if(_0x597d9c[_0x193645(0x271)]('attempt:'))_0x1a44fb=![],_0x3baa54=_0x597d9c[_0x193645(0x22c)](0x8);else return console['error'](_0x193645(0x183)),console[_0x193645(0x2f0)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x27a5c4=_0x21316e[_0x193645(0x29a)],_0x5bb0fe=_0x21316e[_0x193645(0x1b7)],_0x22ae11=_0x21316e['params'],_0xefe867=_0x21316e[_0x193645(0x207)];_0x21316e[_0x193645(0x319)]&&(console[_0x193645(0x2f0)]('Target:\x20'+(_0x1a44fb?_0x193645(0x1e7):_0x193645(0x34e))+'\x20'+_0x3baa54),_0x27a5c4&&console[_0x193645(0x2f0)](_0x193645(0x27f)+_0x27a5c4),_0x5bb0fe&&console[_0x193645(0x2f0)](_0x193645(0x210)+_0x5bb0fe),_0x22ae11&&console[_0x193645(0x2f0)](_0x193645(0x33f)+_0x22ae11),_0xefe867&&console[_0x193645(0x2f0)](_0x193645(0x26d)));let _0x26c83d;if(_0x22ae11)try{if(_0x22ae11[_0x193645(0x271)]('@')){const _0xd33884=await import(_0x193645(0x1e8)),_0x2b0a2d=_0x22ae11[_0x193645(0x22c)](0x1),_0x5de2df=await _0xd33884[_0x193645(0x329)](_0x2b0a2d,_0x193645(0x221));_0x26c83d=JSON[_0x193645(0x196)](_0x5de2df);}else _0x26c83d=JSON[_0x193645(0x196)](_0x22ae11);}catch{return console['error'](_0x193645(0x1da)),0x1;}if(!_0x21316e[_0x193645(0x254)]){if(!isInteractive())return console[_0x193645(0x2f0)](a60_0x529429[_0x193645(0x30f)](_0x193645(0x2b7)),_0x193645(0x339)),console[_0x193645(0x2f0)](a60_0x529429['dim'](_0x193645(0x238))),0x1;const _0x4b3b06=await confirmKey(_0x193645(0x2df)+(_0x1a44fb?_0x193645(0x1e7):'attempt')+'\x20'+_0x3baa54+'?');if(!_0x4b3b06)return console[_0x193645(0x2f0)](a60_0x529429[_0x193645(0x2dc)](_0x193645(0x274))),0x1;}let _0x991831;_0x1a44fb?_0x991831=await withSpinner(_0x193645(0x306),()=>_0x3cb090[_0x193645(0x27b)]['retrySession'](_0x3baa54,{'fromTask':_0x27a5c4,'retryParams':_0x26c83d}),{'verbose':_0x21316e[_0x193645(0x319)]}):_0x991831=await withSpinner(_0x193645(0x25c),()=>_0x3cb090[_0x193645(0x27b)][_0x193645(0x225)](_0x3baa54,{'resumeFrom':_0x5bb0fe,'retryParams':_0x26c83d,'force':_0xefe867}),{'verbose':_0x21316e['verbose']});const _0xacfcd2=_0x991831[_0x193645(0x285)];return console['error'](_0x193645(0x20c)),console[_0x193645(0x2f0)](_0x193645(0x288)+_0xacfcd2[_0x193645(0x24f)]),console['error'](_0x193645(0x182)+_0xacfcd2['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a60_0x536582(0x1b1)]='workflow:run';['description']=a60_0x536582(0x2b6);async['execute'](_0x3b93d7){const _0x1d6f9e=a60_0x536582,{options:_0x2ff13a,args:_0x4e4507,tdx:_0x67e642}=_0x3b93d7;let _0x316d6b=_0x4e4507[0x0];if(!_0x316d6b){const _0x569f4e=this[_0x1d6f9e(0x243)]([],_0x2ff13a),_0x2f4a27=await withSpinner(_0x1d6f9e(0x266),()=>_0x67e642[_0x1d6f9e(0x27b)][_0x1d6f9e(0x223)](_0x569f4e,{'limit':_0x2ff13a[_0x1d6f9e(0x199)]}),{'verbose':_0x2ff13a[_0x1d6f9e(0x319)]}),_0x17b647=_0x2f4a27[_0x1d6f9e(0x285)];if(_0x17b647[_0x1d6f9e(0x330)]===0x0)return console[_0x1d6f9e(0x2f0)](_0x1d6f9e(0x327)),!_0x569f4e&&console['error'](a60_0x529429[_0x1d6f9e(0x1d7)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x2c23a9=_0x17b647[_0x1d6f9e(0x338)](_0x228286=>({'title':_0x228286[_0x1d6f9e(0x32f)]?.[_0x1d6f9e(0x1b1)]+'.'+_0x228286[_0x1d6f9e(0x1b1)],'value':_0x228286[_0x1d6f9e(0x32f)]?.[_0x1d6f9e(0x1b1)]+'.'+_0x228286[_0x1d6f9e(0x1b1)],'description':_0x228286[_0x1d6f9e(0x231)]?_0x1d6f9e(0x1a6)+_0x228286[_0x1d6f9e(0x231)]:undefined})),_0x22cc32=await a60_0x4e49d0({'type':'select','name':_0x1d6f9e(0x27b),'message':_0x1d6f9e(0x1ae),'choices':_0x2c23a9});if(!_0x22cc32[_0x1d6f9e(0x27b)])return 0x1;_0x316d6b=_0x22cc32[_0x1d6f9e(0x27b)];}if(!_0x316d6b['includes']('.')){const _0x4ad851=this[_0x1d6f9e(0x243)]([],_0x2ff13a);if(_0x4ad851)_0x316d6b=_0x4ad851+'.'+_0x316d6b;else return console[_0x1d6f9e(0x2f0)](a60_0x529429['red'](_0x1d6f9e(0x1f7)),_0x1d6f9e(0x1fa)),console[_0x1d6f9e(0x2f0)](a60_0x529429[_0x1d6f9e(0x1d7)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x35f617=_0x2ff13a[_0x1d6f9e(0x2fa)],_0x540def=_0x2ff13a[_0x1d6f9e(0x298)],_0x4e44e0={};if(_0x35f617&&Array[_0x1d6f9e(0x326)](_0x35f617))for(const _0x251b9b of _0x35f617){const _0x3fe4c3=_0x251b9b[_0x1d6f9e(0x2a2)]('=');if(_0x3fe4c3===-0x1)return console[_0x1d6f9e(0x2f0)](_0x1d6f9e(0x1bd)+_0x251b9b),console[_0x1d6f9e(0x2f0)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x44b4e1=_0x251b9b[_0x1d6f9e(0x22c)](0x0,_0x3fe4c3),_0x4ba52e=_0x251b9b[_0x1d6f9e(0x22c)](_0x3fe4c3+0x1);try{_0x4e44e0[_0x44b4e1]=JSON[_0x1d6f9e(0x196)](_0x4ba52e);}catch{_0x4e44e0[_0x44b4e1]=_0x4ba52e;}}_0x2ff13a[_0x1d6f9e(0x319)]&&(console['error']('Workflow:\x20'+_0x316d6b),Object[_0x1d6f9e(0x2e6)](_0x4e44e0)[_0x1d6f9e(0x330)]>0x0&&console[_0x1d6f9e(0x2f0)](_0x1d6f9e(0x2c4)+JSON[_0x1d6f9e(0x1e5)](_0x4e44e0)),_0x540def&&console[_0x1d6f9e(0x2f0)](_0x1d6f9e(0x2ce)+_0x540def));if(_0x2ff13a[_0x1d6f9e(0x2d9)])return await this['executeDryRun'](_0x3b93d7,_0x316d6b,_0x4e44e0,_0x540def);const _0x875576=await withSpinner('Starting\x20workflow\x20run...',()=>_0x67e642[_0x1d6f9e(0x27b)][_0x1d6f9e(0x1fd)](_0x316d6b,_0x4e44e0,{'sessionTime':_0x540def}),{'verbose':_0x2ff13a['verbose']}),_0x2a6505=_0x875576['data'];console[_0x1d6f9e(0x2f0)](_0x1d6f9e(0x302)),console[_0x1d6f9e(0x2f0)]('\x20\x20Attempt\x20ID:\x20'+_0x2a6505['id']),console[_0x1d6f9e(0x2f0)]('\x20\x20Session\x20ID:\x20'+_0x2a6505[_0x1d6f9e(0x26e)]),console[_0x1d6f9e(0x2f0)](_0x1d6f9e(0x1fb)+_0x2a6505['project']?.[_0x1d6f9e(0x1b1)]),console[_0x1d6f9e(0x2f0)]('\x20\x20Workflow:\x20'+_0x2a6505[_0x1d6f9e(0x27b)]?.[_0x1d6f9e(0x1b1)]);if(_0x2a6505[_0x1d6f9e(0x32f)]?.['id']&&_0x2a6505[_0x1d6f9e(0x26e)]&&_0x2a6505['id']){const _0x3d656b=_0x2ff13a[_0x1d6f9e(0x1ba)],_0x2963e7=getConsoleUrl(_0x3d656b,_0x1d6f9e(0x257)+_0x2a6505['project']['id']+_0x1d6f9e(0x2b1)+_0x2a6505['sessionId']+_0x1d6f9e(0x26b)+_0x2a6505['id']);console[_0x1d6f9e(0x2f0)](_0x1d6f9e(0x1af)+a60_0x529429[_0x1d6f9e(0x2ae)](_0x2963e7));}return 0x0;}async[a60_0x536582(0x272)](_0x1d618d,_0x1b235b,_0x345f5c,_0x4a8bd2){const _0x2322d5=a60_0x536582,{options:_0x161754,tdx:_0x4edbab}=_0x1d618d,_0x4f8b8e=await withSpinner(_0x2322d5(0x1c0)+_0x1b235b+_0x2322d5(0x2eb),()=>_0x4edbab[_0x2322d5(0x27b)]['getWorkflow'](_0x1b235b),{'verbose':_0x161754['verbose']}),_0x3669eb=_0x4f8b8e[_0x2322d5(0x285)],_0x2cd28a=_0x4a8bd2??new Date()[_0x2322d5(0x1d1)]();console[_0x2322d5(0x2d7)](a60_0x529429['bold'](_0x2322d5(0x23e)),_0x1b235b),console[_0x2322d5(0x2d7)](a60_0x529429[_0x2322d5(0x1cd)](_0x2322d5(0x347)),_0x2cd28a),console[_0x2322d5(0x2d7)](a60_0x529429[_0x2322d5(0x1cd)](_0x2322d5(0x281)),JSON[_0x2322d5(0x1e5)](_0x345f5c)),console[_0x2322d5(0x2d7)](''),console[_0x2322d5(0x2d7)](a60_0x529429[_0x2322d5(0x1cd)](_0x2322d5(0x2d5)));const _0x113137=parseTaskGraph(_0x3669eb['config']??null);if(_0x113137['length']===0x0)console[_0x2322d5(0x2d7)](a60_0x529429[_0x2322d5(0x1d7)](_0x2322d5(0x215)));else for(const _0x65f269 of formatTaskGraph(_0x113137)){console[_0x2322d5(0x2d7)](_0x65f269);}const _0x588cec=summarizeTaskGraph(_0x113137),_0x43386f=formatWarningSummary(_0x588cec);return _0x43386f&&(console['log'](''),console[_0x2322d5(0x2d7)](a60_0x529429[_0x2322d5(0x2dc)](_0x43386f))),console[_0x2322d5(0x2d7)](a60_0x529429[_0x2322d5(0x2dc)](_0x2322d5(0x2b3))),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a60_0x536582(0x1b1)]=a60_0x536582(0x2e8);[a60_0x536582(0x28b)]=a60_0x536582(0x29e);async[a60_0x536582(0x34d)](_0x51e09b){const _0x4efe8c=a60_0x536582,{options:_0x522bb6,args:_0x5a2d36,tdx:_0x210707}=_0x51e09b,_0x4cb437=_0x5a2d36[0x0],_0x2bd96e=_0x5a2d36[0x1]||'.';if(!_0x4cb437)return console['error'](_0x4efe8c(0x262)),console[_0x4efe8c(0x2f0)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x1bb89e=_0x522bb6[_0x4efe8c(0x231)];_0x522bb6['verbose']&&(console[_0x4efe8c(0x2f0)]('Project:\x20'+_0x4cb437),console[_0x4efe8c(0x2f0)](_0x4efe8c(0x2f2)+_0x2bd96e),_0x1bb89e&&console[_0x4efe8c(0x2f0)](_0x4efe8c(0x248)+_0x1bb89e));const _0x461119=await withSpinner(_0x4efe8c(0x314)+_0x4cb437+'...',()=>_0x210707[_0x4efe8c(0x27b)][_0x4efe8c(0x2e5)](_0x4cb437,_0x2bd96e,{'revision':_0x1bb89e}),{'verbose':_0x522bb6['verbose']}),_0x38ccc3=_0x461119['data'];return console['error'](_0x4efe8c(0x2b0)+_0x38ccc3[_0x4efe8c(0x194)]),console[_0x4efe8c(0x2f0)]('\x20\x20Revision:\x20'+_0x38ccc3[_0x4efe8c(0x231)]),console[_0x4efe8c(0x2f0)](_0x4efe8c(0x2a7)+_0x38ccc3[_0x4efe8c(0x2c6)]),console[_0x4efe8c(0x2f0)](_0x4efe8c(0x333)+_0x2bd96e+'/'+_0x38ccc3['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a60_0x536582(0x1b1)]=a60_0x536582(0x1a1);[a60_0x536582(0x28b)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20AI\x20(digdag-style)';async['execute'](_0x19434d){const _0x2a3339=a60_0x536582,{options:_0x18bb88,args:_0x5635bb,tdx:_0x67a9c4}=_0x19434d;let _0x4908dd='.',_0x414e78=_0x18bb88[_0x2a3339(0x1b1)];if(_0x5635bb[0x0]){const {promises:_0x40a676}=await import('fs');try{const _0x207583=await _0x40a676[_0x2a3339(0x244)](_0x5635bb[0x0]);if(_0x207583[_0x2a3339(0x2d0)]())_0x4908dd=_0x5635bb[0x0];else return console[_0x2a3339(0x2f0)](_0x2a3339(0x2ee)+_0x5635bb[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x414e78=_0x5635bb[0x0],_0x4908dd='.';}}const _0x3f1db1=_0x18bb88[_0x2a3339(0x231)],_0x3b2c66=_0x18bb88[_0x2a3339(0x1a7)];_0x18bb88[_0x2a3339(0x319)]&&(console[_0x2a3339(0x2f0)](_0x2a3339(0x234)+_0x4908dd),_0x414e78&&console[_0x2a3339(0x2f0)](_0x2a3339(0x282)+_0x414e78),_0x3f1db1&&console['error'](_0x2a3339(0x248)+_0x3f1db1),_0x3b2c66&&console[_0x2a3339(0x2f0)](_0x2a3339(0x1b8)));const _0x418863=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x67a9c4[_0x2a3339(0x27b)][_0x2a3339(0x18f)](_0x4908dd,{'projectName':_0x414e78,'revision':_0x3f1db1,'skipValidation':_0x3b2c66}),{'verbose':_0x18bb88[_0x2a3339(0x319)]}),_0x4204e6=_0x418863[_0x2a3339(0x285)];return console[_0x2a3339(0x2f0)](_0x2a3339(0x2cf)+_0x4204e6['projectName']),console[_0x2a3339(0x2f0)](_0x2a3339(0x19a)+_0x4204e6[_0x2a3339(0x23b)]),console[_0x2a3339(0x2f0)](_0x2a3339(0x264)+_0x4204e6['revision']),await this['showWorkflowConsoleUrl'](_0x67a9c4,_0x4204e6[_0x2a3339(0x194)],_0x18bb88[_0x2a3339(0x1ba)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a60_0x536582(0x1b1)]=a60_0x536582(0x211);[a60_0x536582(0x28b)]=a60_0x536582(0x30c);async['execute'](_0x4bf678){const _0x2e707c=a60_0x536582,{options:_0x540b84,args:_0x39b1a4,tdx:_0x5a57ad}=_0x4bf678,_0x53d275=_0x39b1a4[0x0],_0x5686dc=_0x39b1a4[0x1];if(!_0x53d275)return console['error'](a60_0x529429['red'](_0x2e707c(0x1f7)),_0x2e707c(0x304)),console[_0x2e707c(0x2f0)](a60_0x529429[_0x2e707c(0x1d7)](_0x2e707c(0x2e0))),0x1;const _0x502e76=_0x540b84[_0x2e707c(0x231)];_0x540b84[_0x2e707c(0x319)]&&(console[_0x2e707c(0x2f0)](_0x2e707c(0x30a)+_0x53d275),_0x5686dc&&console[_0x2e707c(0x2f0)](_0x2e707c(0x2dd)+_0x5686dc),_0x502e76&&console[_0x2e707c(0x2f0)](_0x2e707c(0x248)+_0x502e76),_0x540b84['dryRun']&&console[_0x2e707c(0x2f0)](_0x2e707c(0x233)));const _0x1a9808=await withSpinner('Pulling\x20project\x20'+_0x53d275+'...',()=>_0x5a57ad[_0x2e707c(0x27b)][_0x2e707c(0x292)](_0x53d275,{'targetDir':_0x5686dc,'revision':_0x502e76}),{'verbose':_0x540b84['verbose']}),_0x1df73c=_0x1a9808[_0x2e707c(0x285)];_0x1df73c[_0x2e707c(0x1b5)]?console[_0x2e707c(0x2f0)]('→\x20New\x20project:\x20'+_0x1df73c[_0x2e707c(0x194)]):console['error'](_0x2e707c(0x31c)+_0x1df73c[_0x2e707c(0x194)]);console[_0x2e707c(0x2f0)]('\x20\x20Revision:\x20'+_0x1df73c[_0x2e707c(0x231)]),console[_0x2e707c(0x2f0)]('\x20\x20Target:\x20'+(a60_0x7d277e[_0x2e707c(0x1e0)](process[_0x2e707c(0x19c)](),_0x1df73c[_0x2e707c(0x303)])||'.')),console[_0x2e707c(0x2f0)](_0x2e707c(0x309)+a60_0x529429[_0x2e707c(0x1c1)]('+'+_0x1df73c['summary'][_0x2e707c(0x258)]+_0x2e707c(0x2cd))+',\x20'+(a60_0x529429[_0x2e707c(0x2dc)]('~'+_0x1df73c[_0x2e707c(0x240)]['modified']+_0x2e707c(0x245))+',\x20')+(a60_0x529429[_0x2e707c(0x30f)]('-'+_0x1df73c[_0x2e707c(0x240)][_0x2e707c(0x340)]+_0x2e707c(0x2b2))+',\x20')+(''+a60_0x529429[_0x2e707c(0x1d7)](_0x1df73c['summary'][_0x2e707c(0x34a)]+_0x2e707c(0x1bf))));for(const _0x15704b of _0x1df73c[_0x2e707c(0x232)]){_0x15704b[_0x2e707c(0x24d)]===_0x2e707c(0x2f9)&&_0x15704b['diff']&&(console[_0x2e707c(0x2f0)]('\x0a'+a60_0x529429[_0x2e707c(0x2ae)](_0x2e707c(0x29d)+_0x15704b['path'])),console[_0x2e707c(0x2f0)](_0x15704b[_0x2e707c(0x1f4)]));}if(!_0x1df73c[_0x2e707c(0x251)])return saveSessionContext({'workflow_project':_0x1df73c[_0x2e707c(0x194)]},_0x540b84[_0x2e707c(0x1e7)]),console[_0x2e707c(0x2f0)](a60_0x529429[_0x2e707c(0x1c1)](_0x2e707c(0x18c))),console[_0x2e707c(0x2f0)](a60_0x529429[_0x2e707c(0x1d7)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x1df73c[_0x2e707c(0x194)])),0x0;if(_0x540b84[_0x2e707c(0x2d9)])return console[_0x2e707c(0x2f0)](a60_0x529429[_0x2e707c(0x2dc)](_0x2e707c(0x1fe))),0x0;if(!_0x540b84[_0x2e707c(0x254)]){if(!isInteractive())return console[_0x2e707c(0x2f0)](a60_0x529429[_0x2e707c(0x30f)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2e707c(0x2f0)](a60_0x529429['dim'](_0x2e707c(0x238))),0x1;const _0x25d266=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x25d266)return console['error'](a60_0x529429['yellow'](_0x2e707c(0x274)),'-\x20no\x20files\x20written'),0x1;}await withSpinner('Writing\x20files...',()=>_0x5a57ad[_0x2e707c(0x27b)]['applyPullProject'](_0x1df73c,{'revision':_0x502e76}),{'verbose':_0x540b84[_0x2e707c(0x319)]}),saveSessionContext({'workflow_project':_0x1df73c[_0x2e707c(0x194)]},_0x540b84[_0x2e707c(0x1e7)]),console[_0x2e707c(0x2f0)](a60_0x529429[_0x2e707c(0x1c1)](_0x2e707c(0x2e4)));const _0x46a4eb=a60_0x7d277e[_0x2e707c(0x1e0)](process[_0x2e707c(0x19c)](),_0x1df73c[_0x2e707c(0x303)])||'.';return console['error'](a60_0x529429[_0x2e707c(0x1d7)](_0x2e707c(0x333)+_0x46a4eb)),console[_0x2e707c(0x2f0)](a60_0x529429[_0x2e707c(0x1d7)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x1df73c['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a60_0x536582(0x1b1)]=a60_0x536582(0x321);[a60_0x536582(0x28b)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20AI';async[a60_0x536582(0x34d)](_0x55223b){const _0x383272=a60_0x536582,{options:_0x5b4c99,args:_0x24c627,tdx:_0x5debde}=_0x55223b,_0x11b5d6=this[_0x383272(0x1d0)](_0x24c627,_0x5b4c99),_0x5af9e4=_0x5b4c99,{revision:_0x19a4f1,skipValidation:_0x246f14,backfill:_0x514374}=_0x5af9e4,_0x3cdebb=_0x514374===undefined?undefined:!_0x514374;_0x5b4c99['verbose']&&(_0x11b5d6&&console[_0x383272(0x2f0)](_0x383272(0x18b)+_0x11b5d6),_0x19a4f1&&console[_0x383272(0x2f0)](_0x383272(0x248)+_0x19a4f1),_0x5b4c99[_0x383272(0x2d9)]&&console[_0x383272(0x2f0)](_0x383272(0x233)),_0x246f14&&console['error']('Validation:\x20skipped'),_0x514374&&console[_0x383272(0x2f0)]('Schedule:\x20backfill\x20runs\x20enabled\x20(--backfill)'));let _0x2857c2;try{_0x2857c2=await withSpinner(_0x383272(0x313),()=>_0x5debde[_0x383272(0x27b)][_0x383272(0x2f8)]({'sourceDir':_0x11b5d6,'revision':_0x19a4f1,'skipValidation':_0x246f14,'skipSchedule':_0x3cdebb}),{'verbose':_0x5b4c99['verbose']});}catch(_0x24b660){if(_0x24b660 instanceof Error&&_0x24b660[_0x383272(0x1a4)]['includes'](_0x383272(0x2cb)))return console[_0x383272(0x2f0)](a60_0x529429[_0x383272(0x30f)](_0x383272(0x1f7)),_0x383272(0x25d)),_0x5b4c99[_0x383272(0x22e)]?console['error'](a60_0x529429[_0x383272(0x1d7)]('Tip:\x20cd\x20to\x20workflows/'+_0x5b4c99[_0x383272(0x22e)]+_0x383272(0x270)+_0x5b4c99[_0x383272(0x22e)]+'\x27')):console[_0x383272(0x2f0)](a60_0x529429[_0x383272(0x1d7)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x24b660;}const _0x38bb9b=_0x2857c2[_0x383272(0x285)];console[_0x383272(0x2f0)](_0x383272(0x1aa)+_0x38bb9b[_0x383272(0x194)]),console[_0x383272(0x2f0)]('\x20\x20Source:\x20'+_0x38bb9b[_0x383272(0x328)]),console['error'](_0x383272(0x264)+_0x38bb9b[_0x383272(0x231)]),console[_0x383272(0x2f0)](_0x383272(0x309)+a60_0x529429[_0x383272(0x1c1)]('+'+_0x38bb9b[_0x383272(0x240)][_0x383272(0x258)]+_0x383272(0x2cd))+',\x20'+(a60_0x529429[_0x383272(0x2dc)]('~'+_0x38bb9b[_0x383272(0x240)][_0x383272(0x2f9)]+_0x383272(0x245))+',\x20')+(a60_0x529429[_0x383272(0x30f)]('-'+_0x38bb9b[_0x383272(0x240)][_0x383272(0x340)]+_0x383272(0x2b2))+',\x20')+(''+a60_0x529429[_0x383272(0x1d7)](_0x38bb9b[_0x383272(0x240)][_0x383272(0x34a)]+_0x383272(0x1bf))));for(const _0x35e432 of _0x38bb9b[_0x383272(0x232)]){_0x35e432['type']===_0x383272(0x2f9)&&_0x35e432[_0x383272(0x1f4)]&&(console[_0x383272(0x2f0)]('\x0a'+a60_0x529429[_0x383272(0x2ae)](_0x383272(0x29d)+_0x35e432['path'])),console['error'](_0x35e432[_0x383272(0x1f4)]));}if(!_0x38bb9b[_0x383272(0x251)])return console[_0x383272(0x2f0)](a60_0x529429[_0x383272(0x1c1)](_0x383272(0x23d))),await this[_0x383272(0x317)](_0x5debde,_0x38bb9b['projectName'],_0x5b4c99[_0x383272(0x1ba)]),0x0;if(_0x5b4c99[_0x383272(0x2d9)])return console[_0x383272(0x2f0)](a60_0x529429[_0x383272(0x2dc)](_0x383272(0x289))),0x0;if(!_0x5b4c99[_0x383272(0x254)]){if(!isInteractive())return console['error'](a60_0x529429[_0x383272(0x30f)](_0x383272(0x2b7)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x383272(0x2f0)](a60_0x529429[_0x383272(0x1d7)](_0x383272(0x238))),0x1;const _0x473bd3=await confirmKey(_0x383272(0x2e2));if(!_0x473bd3)return console[_0x383272(0x2f0)](a60_0x529429['yellow'](_0x383272(0x274)),_0x383272(0x2f7)),0x1;}const _0x21fec5=await withSpinner('Pushing\x20project...',()=>_0x5debde[_0x383272(0x27b)][_0x383272(0x189)](_0x38bb9b),{'verbose':_0x5b4c99[_0x383272(0x319)]}),_0x55d00f=_0x21fec5[_0x383272(0x285)];return console[_0x383272(0x2f0)](a60_0x529429['green'](_0x383272(0x250))),console[_0x383272(0x2f0)]('\x20\x20Project\x20ID:\x20'+_0x55d00f[_0x383272(0x23b)]),console['error'](_0x383272(0x264)+_0x55d00f[_0x383272(0x231)]),await this[_0x383272(0x317)](_0x5debde,_0x55d00f[_0x383272(0x194)],_0x5b4c99['site']),0x0;}}function a60_0x1bb7(){const _0xb20de4=['1754242QJXVHJ','key','resolveProject','stat','\x20modified','\x20attempt','✔\x20Workflow\x20project\x20context\x20cleared.','Revision:\x20','workflow:logs','startedAt','Total:\x20','Filter:\x20','type','renderTimeline','attemptId','✔\x20Push\x20complete','hasChanges','resolveProjectId','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','yes','No\x20attempts\x20found\x20in\x20project:\x20','delete','/app/workflows/','new','sort','Task\x20name:\x20','displayLine','Retrying\x20attempt...','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','taskName','\x20tasks',',\x20Workflow:\x20','pollTimeline','Error:\x20Project\x20name\x20is\x20required','workflow:timeline','\x20\x20Revision:\x20','\x20-\x20','Loading\x20workflows...','Filter:\x20project=','Usage:\x20tdx\x20wf\x20schedule\x20list\x20[project[.workflow]]\x20|\x20--schedule-id\x20<id>','basename','Cloning\x20to\x20','/attempt/','📁\x20','Force:\x20yes','sessionId','toLowerCase','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','startsWith','executeDryRun','getSchedule','Cancelled','workflow:delete','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','.\x20Expected\x20format:\x20KEY=VALUE','toLocaleString','Pattern:\x20','sessions','workflow','group_error','MAX_TIMELINE_WIDTH','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','From\x20task:\x20','✔\x20Schedule\x20found','Parameters:','Project\x20name:\x20','🔄\x20','workflow:use','data','context','retryAttemptName','\x20\x20New\x20attempt\x20ID:\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','slice','description','ICON_WIDTH','Reason:\x20','Kill\x20a\x20running\x20attempt','Delete\x20workflow\x20project\x20from\x20Treasure\x20AI','Listing\x20schedules...','TASK_NAME_WIDTH','pullProject','workflow:sessions','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','workflow:tasks','title','8042880qzUrwm','sessionTime','every','fromTask','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x22\x20to\x20new\x20project\x20\x22','---\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20AI','📋\x20','write','Failed\x20to\x20fetch\x20attempt\x20data','indexOf','\x1b[1A\x1b[2K','unknown','localeCompare','✔\x20Found\x20','\x20\x20Files\x20extracted:\x20','max','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Source\x20directory\x20is\x20required','Session\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','newProjectId','cyan','get','✔\x20Downloaded\x20','/sessions/','\x20deleted','\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.','Including\x20subtasks:\x20yes','lastAttempt','Start\x20a\x20workflow\x20run','\x0aError:','from','logs','No\x20schedules\x20found','size','No\x20workflow\x20sessions\x20found','(unknown)','Error:\x20Secret\x20key\x20is\x20required','Listing\x20workflow\x20projects...','params','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','No\x20workflows\x20found\x20in\x20project:\x20','Parameters:\x20','2576435lWevNL','filesExtracted','all','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x20workflow','Attempt:\x20','No\x20workflow\x20tdx.json\x20found','fileSize','\x20new','Session\x20time:\x20','✔\x20Pushed\x20','isDirectory','Resolving\x20project\x20\x27','min','⚠\x20Showing\x20first\x20','parseProjectWorkflowPattern','Task\x20graph:','prepareCloneProject','log','Select\x20a\x20session\x20to\x20view\x20timeline:','dryRun','7bSBxol','navigateSessionsInteractive','yellow','Target\x20directory:\x20','padStart','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Getting\x20attempt\x20details...','\x0aPush\x20these\x20changes?','Files\x20to\x20upload:\x20','✔\x20Pull\x20complete','download','keys','No\x20log\x20files\x20found\x20for\x20this\x20attempt','workflow:download','workflow:projects','floor','...','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','12fvnXxo','Error:\x20','Error:\x20Attempt\x20ID\x20is\x20required','error','finishedAt','Output\x20directory:\x20','\x22\x20already\x20exists\x20(ID:\x20','renderSessionsTimeline','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','state','-\x20nothing\x20pushed','preparePushProject','modified','param','nextRunTime','index','kill','workflow:retry','includeSubtasks','GUTTER','Loading\x20session...','✔\x20Workflow\x20run\x20started','targetDir','Project\x20name\x20is\x20required','status','Retrying\x20session...','1510761JcjHHO','LABEL_MIN_SPACING','\x20\x20Changes:\x20','Project:\x20','rows','Pull\x20workflow\x20project\x20to\x20local\x20folder','POLL_INTERVAL_MS','Listing\x20secrets...','red','\x20next:\x20','💡\x20Tip:\x20Use\x20','Key:\x20','Analyzing\x20changes...','Downloading\x20project\x20','No\x20matching\x20sessions\x20found','table','showWorkflowConsoleUrl','\x20secrets\x20set\x20for\x20project\x20\x27','verbose','end','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','→\x20Project:\x20','task','blue','has','No\x20workflow\x20projects\x20found','workflow:push','\x22\x20with\x20new\x20revision?','find','setSecrets','skipSchedule','isArray','No\x20workflows\x20found','sourceDir','readFile','Attempt\x20ID:\x20','No\x20log\x20content\x20found','Secrets\x20to\x20set:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Fetching\x20log\x20files...','project','length','tdx\x20wf\x20attempt\x20','📅\x20#','\x20\x20Location:\x20','Killing\x20attempt...','isTTY','enableSchedule','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','map','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','✔\x20Project\x20updated','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','7272243WWJsrY','140974GZGXFE','Params:\x20','deleted','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Schedule\x20ID\x20is\x20required','workflow:schedules','Downloading\x20logs...','\x0a⚠\x20Project\x20\x22','\x20logs','Session\x20time:','Project\x20filter:\x20','reason','unchanged','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','logFiles','execute','attempt','fileCount','\x20\x20Session\x20ID:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','existingProjectId','Loading\x20sessions...','format','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','disabledAt','executePushProject','pending','Source\x20directory:\x20','\x0a✔\x20Already\x20up\x20to\x20date','Include\x20retried:\x20yes','Usage:\x20workflow:delete\x20<project-name-or-id>','push','getHours','\x20\x20tdx\x20wf\x20use\x20<project>','No\x20sessions\x20found\x20for:\x20','\x0aFailed\x20to\x20fetch\x20attempt\x20data','projectName','jsonl','parse','start','duration','limit','\x20\x20Project\x20ID:\x20','now','cwd','List\x20all\x20workflow\x20projects','autocomplete','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','workflow:upload','New\x20project\x20name:\x20','includes','message','follow','revision:\x20','skipValidation','\x20disabled\x20(','MIN_TIMELINE_WIDTH','✔\x20Project:\x20','session:','updatedAt','\x20\x20Next\x20run:\x20','Select\x20a\x20workflow\x20to\x20run','\x20\x20Console:\x20','select','name','some','MAX_TASKS_DISPLAY','canceling','isNewProject','\x20sessions\x20','resumeFrom','Validation:\x20skipped','ICON_SPACING','site','Select\x20a\x20task\x20to\x20view\x20logs:','createdAt','Error:\x20Invalid\x20parameter\x20format:\x20','icon','\x20unchanged','Fetching\x20workflow\x20','green','Disabling\x20schedule\x20#','planned','4MrFhXT','\x20secrets...','Listing\x20workflow\x20sessions...','join','Session\x20not\x20found:\x20','workflow:secrets:delete','Getting\x20attempt\x20tasks...','getMonth','match','bold','List\x20workflow\x20execution\x20sessions','Deleting\x20secret...','resolveProjectDir','toISOString','done','✔\x20Secret\x20\x27','clear','\x20(use\x20a\x20larger\x20--limit\x20to\x20show\x20more)','No\x20attempts\x20found\x20for:\x20','dim','list','resolve','Error:\x20Invalid\x20JSON\x20in\x20--params','running','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','LABEL_WIDTH_DIVISOR','getDate','MAX_LABEL_COUNT','relative','MIN_LABEL_COUNT','Enable\x20a\x20workflow\x20schedule','✔\x20Deleted\x20project\x20','cancelRequested','stringify','workflow:schedule:enable','session','fs/promises','workflow:attempts','renderSingleTimeline','\x20from\x20session\x20','\x20(system)','\x20project','window','fill','No\x20sessions\x20found','List\x20workflows','value','22887920nyyElI','diff','projects','✔\x20Schedule\x20#','Error:','Disable\x20a\x20workflow\x20schedule','generateSessionTimelineRows','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','\x20\x20Project:\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','run','\x0aDry\x20run\x20-\x20no\x20files\x20written','repeat','\x20of\x20','\x20(disabled)','startTime','set','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','List\x20workflow\x20schedules','includeRetried','force','newProjectName','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','No\x20sessions\x20found\x20in\x20project:\x20','fullName','✔\x20Retry\x20started','\x20to\x20see\x20detailed\x20logs','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','trimEnd','Resume\x20from:\x20','workflow:pull','\x0aClone\x20\x22','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','output','\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)','No\x20sessions\x20with\x20timing\x20information','--schedule-id\x20cannot\x20be\x20combined\x20with\x20a\x20project.workflow\x20filter','sourceProjectName','success','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','getMinutes','workflow:secrets:list','split','List\x20workflow\x20attempts','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','utf-8','MAX_POLL_ITERATIONS','workflows','columns','retryAttempt','\x20secret','targetExists','tasks','stdout','\x20(use\x20--limit\x20to\x20show\x20more)','white','substring','json','workflowProject','\x22?\x20This\x20cannot\x20be\x20undone.','\x0aUpdate\x20existing\x20project\x20\x22','revision','changes','Dry\x20run:\x20yes','Project\x20directory:\x20','requireProject','getTime','workflow:secrets:set','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Source\x20project:\x20','filter','projectId','getFullYear','\x0a✔\x20No\x20changes\x20to\x20push','Workflow:','✔\x20Workflow\x20project\x20set\x20to:\x20','summary'];a60_0x1bb7=function(){return _0xb20de4;};return a60_0x1bb7();}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a60_0x536582(0x1b1)]='workflow:clone';[a60_0x536582(0x28b)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a60_0x536582(0x34d)](_0x4cd68a){const _0x872ba9=a60_0x536582,{options:_0x38e1a0,args:_0x5c7979,tdx:_0x4e8e77}=_0x4cd68a,_0x45ec54=this[_0x872ba9(0x1d0)](_0x5c7979,_0x38e1a0),_0x5c5f3d=_0x38e1a0[_0x872ba9(0x1b1)],_0x1b26d5=_0x38e1a0['revision'],_0x8592c9=_0x38e1a0[_0x872ba9(0x1a7)];if(!_0x45ec54)return console[_0x872ba9(0x2f0)](a60_0x529429[_0x872ba9(0x30f)](_0x872ba9(0x1f7)),_0x872ba9(0x2aa)),console['error'](a60_0x529429[_0x872ba9(0x1d7)](_0x872ba9(0x337))),console['error'](a60_0x529429[_0x872ba9(0x1d7)](_0x872ba9(0x31b))),0x1;if(!_0x5c5f3d)return console[_0x872ba9(0x2f0)](a60_0x529429['red'](_0x872ba9(0x1f7)),_0x872ba9(0x20e)),console['error'](a60_0x529429[_0x872ba9(0x1d7)](_0x872ba9(0x337))),0x1;_0x38e1a0[_0x872ba9(0x319)]&&(console[_0x872ba9(0x2f0)](_0x872ba9(0x18b)+_0x45ec54),console[_0x872ba9(0x2f0)](_0x872ba9(0x1a2)+_0x5c5f3d),_0x1b26d5&&console[_0x872ba9(0x2f0)]('Revision:\x20'+_0x1b26d5),_0x38e1a0[_0x872ba9(0x2d9)]&&console['error'](_0x872ba9(0x233)),_0x8592c9&&console[_0x872ba9(0x2f0)](_0x872ba9(0x1b8)));const _0xcb1409=await withSpinner('Analyzing\x20project...',()=>_0x4e8e77[_0x872ba9(0x27b)][_0x872ba9(0x2d6)](_0x45ec54,_0x5c5f3d,{'revision':_0x1b26d5,'skipValidation':_0x8592c9}),{'verbose':_0x38e1a0[_0x872ba9(0x319)]}),_0x5b0a31=_0xcb1409[_0x872ba9(0x285)];console['error']('Source:\x20'+_0x5b0a31[_0x872ba9(0x328)]);_0x5b0a31[_0x872ba9(0x218)]&&console['error'](_0x872ba9(0x239)+_0x5b0a31[_0x872ba9(0x218)]);console[_0x872ba9(0x2f0)](_0x872ba9(0x1a2)+_0x5b0a31[_0x872ba9(0x208)]),console[_0x872ba9(0x2f0)](_0x872ba9(0x248)+_0x5b0a31['revision']),console[_0x872ba9(0x2f0)](_0x872ba9(0x2e3)+_0x5b0a31[_0x872ba9(0x181)]);_0x5b0a31['targetExists']&&(console['error'](a60_0x529429[_0x872ba9(0x2dc)](_0x872ba9(0x345)+_0x5b0a31['newProjectName']+_0x872ba9(0x2f3)+_0x5b0a31[_0x872ba9(0x184)]+')')),console[_0x872ba9(0x2f0)](a60_0x529429['yellow'](_0x872ba9(0x2ec))));if(_0x38e1a0['dryRun'])return console[_0x872ba9(0x2f0)](a60_0x529429[_0x872ba9(0x2dc)](_0x872ba9(0x2c8))),0x0;if(!_0x38e1a0[_0x872ba9(0x254)]){if(!isInteractive())return console[_0x872ba9(0x2f0)](a60_0x529429['red'](_0x872ba9(0x2b7)),_0x872ba9(0x339)),console[_0x872ba9(0x2f0)](a60_0x529429[_0x872ba9(0x1d7)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xab3188=_0x5b0a31[_0x872ba9(0x218)]||a60_0x7d277e[_0x872ba9(0x269)](_0x45ec54),_0x3d6178=_0x5b0a31[_0x872ba9(0x227)]?_0x872ba9(0x230)+_0x5c5f3d+_0x872ba9(0x322):_0x872ba9(0x212)+_0xab3188+_0x872ba9(0x29c)+_0x5c5f3d+'\x22?',_0x266841=await confirmKey(_0x3d6178);if(!_0x266841)return console[_0x872ba9(0x2f0)](a60_0x529429['yellow'](_0x872ba9(0x274))),0x1;}const _0x3f0a01=await withSpinner(_0x5b0a31[_0x872ba9(0x227)]?'Updating\x20'+_0x5c5f3d+_0x872ba9(0x2eb):_0x872ba9(0x26a)+_0x5c5f3d+_0x872ba9(0x2eb),()=>_0x4e8e77[_0x872ba9(0x27b)]['executeCloneProject'](_0x5b0a31),{'verbose':_0x38e1a0[_0x872ba9(0x319)]}),_0x520f5c=_0x3f0a01[_0x872ba9(0x285)];return console[_0x872ba9(0x2f0)](a60_0x529429['green'](_0x5b0a31[_0x872ba9(0x227)]?_0x872ba9(0x33b):'✔\x20Clone\x20complete')),console[_0x872ba9(0x2f0)](_0x872ba9(0x1fb)+_0x520f5c[_0x872ba9(0x208)]),console[_0x872ba9(0x2f0)](_0x872ba9(0x19a)+_0x520f5c[_0x872ba9(0x2ad)]),console[_0x872ba9(0x2f0)](_0x872ba9(0x264)+_0x520f5c['revision']),await this[_0x872ba9(0x317)](_0x4e8e77,_0x520f5c[_0x872ba9(0x208)],_0x38e1a0[_0x872ba9(0x1ba)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a60_0x536582(0x1b1)]=a60_0x536582(0x275);[a60_0x536582(0x28b)]=a60_0x536582(0x28f);async[a60_0x536582(0x34d)](_0x3d03f3){const _0x24513f=a60_0x536582,{options:_0x20b27a,args:_0x1f8e9c,tdx:_0x36abe8}=_0x3d03f3,_0x8223fb=_0x1f8e9c[0x0];if(!_0x8223fb)return console[_0x24513f(0x2f0)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x24513f(0x2f0)](_0x24513f(0x18e)),0x1;_0x20b27a[_0x24513f(0x319)]&&console[_0x24513f(0x2f0)](_0x24513f(0x30a)+_0x8223fb);if(!_0x20b27a[_0x24513f(0x254)]){if(!isInteractive())return console['error'](a60_0x529429[_0x24513f(0x30f)](_0x24513f(0x2b7)),_0x24513f(0x339)),console[_0x24513f(0x2f0)](a60_0x529429['dim'](_0x24513f(0x238))),0x1;const _0x36ca1d=await confirmKey(_0x24513f(0x32d)+_0x8223fb+_0x24513f(0x22f));if(!_0x36ca1d)return console['error'](a60_0x529429[_0x24513f(0x2dc)](_0x24513f(0x274))),0x1;}const _0x4d3862=await withSpinner('Deleting\x20project\x20'+_0x8223fb+_0x24513f(0x2eb),()=>_0x36abe8[_0x24513f(0x27b)][_0x24513f(0x256)](_0x8223fb),{'verbose':_0x20b27a[_0x24513f(0x319)]}),_0xef22d3=_0x4d3862['data'];return console[_0x24513f(0x2f0)](_0x24513f(0x1e3)+_0xef22d3[_0x24513f(0x194)]),console[_0x24513f(0x2f0)](_0x24513f(0x19a)+_0xef22d3['projectId']),0x0;}}export function parseKeyValue(_0x44a953){const _0x26f8fc=a60_0x536582,_0x2df444=_0x44a953[_0x26f8fc(0x2a2)]('=');if(_0x2df444===-0x1)throw new Error('Invalid\x20format:\x20'+_0x44a953+_0x26f8fc(0x277));const _0xd22823=_0x44a953[_0x26f8fc(0x22c)](0x0,_0x2df444),_0x54e4c2=_0x44a953[_0x26f8fc(0x22c)](_0x2df444+0x1);if(!_0xd22823)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0xd22823,'value':_0x54e4c2};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a60_0x536582(0x21d);[a60_0x536582(0x28b)]=a60_0x536582(0x2a9);async[a60_0x536582(0x34d)](_0x31f0dd){const _0x21570b=a60_0x536582,{options:_0x251b0a,args:_0x3bd52e,tdx:_0x470e56}=_0x31f0dd,_0x2941ee=this[_0x21570b(0x235)](_0x3bd52e,_0x251b0a);if(!_0x2941ee)return 0x1;_0x251b0a[_0x21570b(0x319)]&&console[_0x21570b(0x2f0)](_0x21570b(0x30a)+_0x2941ee);const _0x46f256=await withSpinner(_0x21570b(0x30e),()=>_0x470e56['workflow']['listSecrets'](_0x2941ee),{'verbose':_0x251b0a[_0x21570b(0x319)]}),{secrets:_0x245b90}=_0x46f256['data'];return console[_0x21570b(0x2f0)](_0x21570b(0x2a6)+_0x245b90['length']+_0x21570b(0x226)+(_0x245b90[_0x21570b(0x330)]!==0x1?'s':'')),await handleSDKOutput(_0x245b90,_0x251b0a),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a60_0x536582(0x1b1)]=a60_0x536582(0x237);['description']=a60_0x536582(0x204);async['execute'](_0x5136ec){const _0x5bd791=a60_0x536582,{options:_0x47880b,args:_0x202780,tdx:_0x42f3e6}=_0x5136ec;let _0x3b419c,_0x405ae2;if(_0x202780[_0x5bd791(0x330)]>=0x1&&!_0x202780[0x0][_0x5bd791(0x1a3)]('='))_0x3b419c=_0x202780[0x0],_0x405ae2=_0x202780[_0x5bd791(0x28a)](0x1);else{if(_0x202780[_0x5bd791(0x330)]>=0x1&&_0x47880b['workflowProject'])_0x3b419c=_0x47880b['workflowProject'],_0x405ae2=_0x202780;else return _0x202780['length']>=0x1?(console[_0x5bd791(0x2f0)](_0x5bd791(0x262)),console[_0x5bd791(0x2f0)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x5bd791(0x2f0)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x5bd791(0x2f0)](_0x5bd791(0x276)),0x1);}if(_0x405ae2[_0x5bd791(0x330)]===0x0)return console['error'](_0x5bd791(0x34b)),console[_0x5bd791(0x2f0)](_0x5bd791(0x276)),0x1;const _0x3a4223={};try{for(const _0x3b85e8 of _0x405ae2){const {key:_0x5e36dd,value:_0x57f891}=parseKeyValue(_0x3b85e8);_0x3a4223[_0x5e36dd]=_0x57f891;}}catch(_0xb00af1){return _0xb00af1 instanceof Error&&console['error'](a60_0x529429[_0x5bd791(0x30f)](_0x5bd791(0x1f7)),_0xb00af1[_0x5bd791(0x1a4)]),0x1;}const _0x22bd3e=Object[_0x5bd791(0x2e6)](_0x3a4223);_0x47880b[_0x5bd791(0x319)]&&(console['error'](_0x5bd791(0x30a)+_0x3b419c),console['error'](_0x5bd791(0x32c)+_0x22bd3e[_0x5bd791(0x1c7)](',\x20')));const _0x4c3c4d=await withSpinner(_0x22bd3e[_0x5bd791(0x330)]===0x1?'Setting\x20secret...':'Setting\x20'+_0x22bd3e['length']+_0x5bd791(0x1c5),()=>_0x42f3e6[_0x5bd791(0x27b)][_0x5bd791(0x324)](_0x3b419c,_0x3a4223),{'verbose':_0x47880b[_0x5bd791(0x319)]}),_0x322726=_0x4c3c4d[_0x5bd791(0x285)];return console[_0x5bd791(0x2f0)](_0x22bd3e[_0x5bd791(0x330)]===0x1?_0x5bd791(0x1d3)+_0x322726[_0x5bd791(0x2e6)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x322726['projectName']+'\x27':'✔\x20'+_0x322726['keys'][_0x5bd791(0x330)]+_0x5bd791(0x318)+_0x322726['projectName']+'\x27'),(_0x47880b[_0x5bd791(0x22d)]||_0x47880b['jsonl'])&&await handleSingleObjectOutput(_0x322726,_0x47880b),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a60_0x536582(0x1c9);[a60_0x536582(0x28b)]=a60_0x536582(0x2c1);async['execute'](_0x466304){const _0x559674=a60_0x536582,{options:_0x375ea6,args:_0x3792ec,tdx:_0x530a85}=_0x466304;let _0x5a3b4d,_0x2af05e;if(_0x3792ec[_0x559674(0x330)]>=0x2)_0x5a3b4d=_0x3792ec[0x0],_0x2af05e=_0x3792ec[0x1];else{if(_0x3792ec[_0x559674(0x330)]===0x1&&_0x375ea6['workflowProject'])_0x5a3b4d=_0x375ea6[_0x559674(0x22e)],_0x2af05e=_0x3792ec[0x0];else return _0x3792ec[_0x559674(0x330)]===0x1?(console[_0x559674(0x2f0)](_0x559674(0x262)),console[_0x559674(0x2f0)](_0x559674(0x29b)),0x1):(console[_0x559674(0x2f0)](_0x559674(0x2be)),console['error'](_0x559674(0x209)),0x1);}_0x375ea6[_0x559674(0x319)]&&(console[_0x559674(0x2f0)](_0x559674(0x30a)+_0x5a3b4d),console[_0x559674(0x2f0)](_0x559674(0x312)+_0x2af05e));if(!_0x375ea6[_0x559674(0x254)]){if(!isInteractive())return console[_0x559674(0x2f0)](a60_0x529429[_0x559674(0x30f)](_0x559674(0x2b7)),_0x559674(0x339)),console['error'](a60_0x529429[_0x559674(0x1d7)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4e40d3=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x2af05e+'\x27\x20from\x20project\x20\x27'+_0x5a3b4d+'\x27?');if(!_0x4e40d3)return console[_0x559674(0x2f0)](a60_0x529429['yellow']('Cancelled')),0x1;}const _0x524aa8=await withSpinner(_0x559674(0x1cf),()=>_0x530a85['workflow']['deleteSecret'](_0x5a3b4d,_0x2af05e),{'verbose':_0x375ea6[_0x559674(0x319)]}),_0xe275b1=_0x524aa8['data'];return console[_0x559674(0x2f0)](_0x559674(0x1d3)+_0xe275b1[_0x559674(0x242)]+_0x559674(0x213)+_0xe275b1[_0x559674(0x194)]+'\x27'),(_0x375ea6['json']||_0x375ea6[_0x559674(0x195)])&&await handleSingleObjectOutput(_0xe275b1,_0x375ea6),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(_0x19945c){const _0x4ba94f=a60_0x536582,_0x7f9c0d=Math[_0x4ba94f(0x2ea)](_0x19945c/0x3e8),_0x1827e2=Math[_0x4ba94f(0x2ea)](_0x7f9c0d/0x3c),_0x6875ac=Math[_0x4ba94f(0x2ea)](_0x1827e2/0x3c),_0x2289a7=Math[_0x4ba94f(0x2ea)](_0x6875ac/0x18);if(_0x2289a7>0x0){const _0x504eaf=_0x6875ac%0x18;return _0x504eaf>0x0?_0x2289a7+'d\x20'+_0x504eaf+'h':_0x2289a7+'d';}else{if(_0x6875ac>0x0){const _0x28cafa=_0x1827e2%0x3c;return _0x28cafa>0x0?_0x6875ac+'h\x20'+_0x28cafa+'m':_0x6875ac+'h';}else{if(_0x1827e2>0x0){const _0x32dc4e=_0x7f9c0d%0x3c;return _0x32dc4e>0x0?_0x1827e2+'m\x20'+_0x32dc4e+'s':_0x1827e2+'m';}else return _0x7f9c0d+'s';}}}function formatTimestamp(_0x477ff9,_0x32b025){const _0x3c7977=a60_0x536582,_0x3a1f0c=new Date(_0x477ff9),_0x51280e=String(_0x3a1f0c[_0x3c7977(0x190)]())[_0x3c7977(0x2de)](0x2,'0'),_0x157c21=String(_0x3a1f0c[_0x3c7977(0x21c)]())[_0x3c7977(0x2de)](0x2,'0'),_0x26c8b1=_0x51280e+':'+_0x157c21,_0x5463ae=_0x3a1f0c[_0x3c7977(0x23c)]()===_0x32b025[_0x3c7977(0x23c)]()&&_0x3a1f0c[_0x3c7977(0x1cb)]()===_0x32b025[_0x3c7977(0x1cb)]()&&_0x3a1f0c['getDate']()===_0x32b025[_0x3c7977(0x1de)]();if(_0x5463ae)return _0x26c8b1;else{const _0x4684b3=String(_0x3a1f0c[_0x3c7977(0x1cb)]()+0x1)[_0x3c7977(0x2de)](0x2,'0'),_0x534e83=String(_0x3a1f0c[_0x3c7977(0x1de)]())[_0x3c7977(0x2de)](0x2,'0');return _0x4684b3+'-'+_0x534e83+'\x20'+_0x26c8b1;}}function formatDate(_0xccfe16){const _0x216006=a60_0x536582,_0x248081=_0xccfe16[_0x216006(0x23c)](),_0x584b75=String(_0xccfe16[_0x216006(0x1cb)]()+0x1)[_0x216006(0x2de)](0x2,'0'),_0x67d0d1=String(_0xccfe16[_0x216006(0x1de)]())[_0x216006(0x2de)](0x2,'0');return _0x248081+'-'+_0x584b75+'-'+_0x67d0d1;}function getTaskStateIcon(_0x3d73a9){const _0x7df592={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x7df592[_0x3d73a9]||'⚪';}function getBarChar(_0x4111ba){const _0x3a9129=a60_0x536582;return _0x4111ba===_0x3a9129(0x2f0)||_0x4111ba===_0x3a9129(0x27c)?'×':'─';}function getBarColor(_0x1bcd92){const _0x31d43f=a60_0x536582,_0x389926={'success':a60_0x529429[_0x31d43f(0x1c1)],'error':a60_0x529429[_0x31d43f(0x30f)],'group_error':a60_0x529429[_0x31d43f(0x30f)],'running':a60_0x529429['blue'],'blocked':a60_0x529429[_0x31d43f(0x2dc)],'planned':a60_0x529429[_0x31d43f(0x1d7)],'canceling':a60_0x529429[_0x31d43f(0x2dc)]};return _0x389926[_0x1bcd92]||a60_0x529429[_0x31d43f(0x22b)];}function parseTaskName(_0x167f9c){const _0x5bdc2b=a60_0x536582;let _0x5bf789=_0x167f9c['replace'](/^\++/,'');const _0x52892a=_0x5bf789[_0x5bdc2b(0x21e)]('+'),_0x359927=_0x52892a[_0x5bdc2b(0x330)]>0x1?_0x52892a['length']-0x2:0x0,_0x31f7cf=_0x52892a[_0x52892a['length']-0x1]||_0x5bf789;return{'level':_0x359927,'name':'+'+_0x31f7cf};}function truncateTaskName(_0x2314f8,_0x1635cd){const _0x2b3e93=a60_0x536582,_0x1f2d86=stringWidth(_0x2314f8);if(_0x1f2d86<=_0x1635cd)return _0x2314f8;let _0x209909=_0x2314f8;while(stringWidth(_0x209909+'…')>_0x1635cd&&_0x209909[_0x2b3e93(0x330)]>0x0){_0x209909=_0x209909[_0x2b3e93(0x28a)](0x0,-0x1);}return _0x209909+'…';}function calculateTimeScale(_0x1cd58a,_0xe67b4e){const _0x2a2bc9=a60_0x536582;return{'startTime':_0x1cd58a[_0x2a2bc9(0x197)],'endTime':_0x1cd58a[_0x2a2bc9(0x31a)],'durationMs':_0x1cd58a[_0x2a2bc9(0x198)],'msPerChar':_0x1cd58a[_0x2a2bc9(0x198)]/_0xe67b4e};}function timeToPosition(_0x1d5148,_0x55710e,_0x1060ad){const _0xceedd9=a60_0x536582,_0x1d2e3a=_0x1d5148-_0x55710e[_0xceedd9(0x202)],_0x145afd=Math[_0xceedd9(0x2ea)](_0x1d2e3a/_0x55710e['msPerChar']);return Math['max'](0x0,Math[_0xceedd9(0x2d2)](_0x145afd,_0x1060ad));}function renderTimeAxis(_0x25e067,_0x378fef){const _0x4dbb90=a60_0x536582,_0x2ce71f=Math[_0x4dbb90(0x2d2)](TIMELINE_CONFIG[_0x4dbb90(0x1df)],Math[_0x4dbb90(0x2a8)](TIMELINE_CONFIG[_0x4dbb90(0x1e1)],Math[_0x4dbb90(0x2ea)](_0x378fef/TIMELINE_CONFIG[_0x4dbb90(0x1dd)]))),_0x3bbfaa=_0x25e067['durationMs']/(_0x2ce71f-0x1),_0x3939cf=new Date(_0x25e067[_0x4dbb90(0x202)]),_0x2b5d07=[];for(let _0xb3455d=0x0;_0xb3455d<_0x2ce71f;_0xb3455d++){const _0x51c649=_0x25e067['startTime']+_0xb3455d*_0x3bbfaa,_0x1e781a=timeToPosition(_0x51c649,_0x25e067,_0x378fef),_0x244650=formatTimestamp(_0x51c649,_0x3939cf);_0x2b5d07[_0x4dbb90(0x18f)]({'pos':_0x1e781a,'text':_0x244650});}const _0x299f84=new Array(_0x378fef)[_0x4dbb90(0x1ef)]('\x20');let _0xa15b92=-0x1;for(const {pos:_0x1f6191,text:_0x50b3d1}of _0x2b5d07){let _0x210381=Math[_0x4dbb90(0x2a8)](0x0,_0x1f6191-Math[_0x4dbb90(0x2ea)](_0x50b3d1[_0x4dbb90(0x330)]/0x2));_0x210381<=_0xa15b92+TIMELINE_CONFIG[_0x4dbb90(0x308)]&&(_0x210381=_0xa15b92+TIMELINE_CONFIG[_0x4dbb90(0x308)]+0x1);_0x210381+_0x50b3d1['length']>_0x378fef&&(_0x210381=_0x378fef-_0x50b3d1['length']);if(_0x210381>=0x0&&_0x210381+_0x50b3d1[_0x4dbb90(0x330)]<=_0x378fef&&_0x210381>_0xa15b92){for(let _0x2573fe=0x0;_0x2573fe<_0x50b3d1['length'];_0x2573fe++){_0x299f84[_0x210381+_0x2573fe]=_0x50b3d1[_0x2573fe];}_0xa15b92=_0x210381+_0x50b3d1['length']-0x1;}}return _0x299f84[_0x4dbb90(0x1c7)]('');}function renderTaskRow(_0x36ec9d,_0x4a1641,_0x4f418b,_0x3f7afa){const _0x275109=a60_0x536582,{level:_0x38718e,name:_0x321dad}=parseTaskName(_0x36ec9d[_0x275109(0x1b1)]),_0x1a38e4='\x20'[_0x275109(0x1ff)](_0x38718e),_0x48f24c=_0x36ec9d['window']?'('+formatElapsed(_0x36ec9d[_0x275109(0x1ee)][_0x275109(0x198)])+')':'',_0x1ee595=stringWidth(_0x48f24c),_0x23d09d=_0x38718e*0x1,_0x483bb7=_0x3f7afa-_0x23d09d-_0x1ee595-0x1,_0x5b4afb=truncateTaskName(_0x321dad,_0x483bb7),_0x30975f=_0x1a38e4+_0x5b4afb,_0x12ade8=stringWidth(_0x30975f),_0x3221ad=_0x3f7afa-_0x12ade8-_0x1ee595,_0x15c8ea=_0x30975f+'\x20'[_0x275109(0x1ff)](Math[_0x275109(0x2a8)](0x1,_0x3221ad))+a60_0x529429['dim'](_0x48f24c),_0x2df4e9=getTaskStateIcon(_0x36ec9d['state']),_0x12b0b0=new Array(_0x4f418b)['fill']('\x20');if(_0x36ec9d[_0x275109(0x1ee)]){const _0x3e5d19=timeToPosition(_0x36ec9d[_0x275109(0x1ee)][_0x275109(0x197)],_0x4a1641,_0x4f418b),_0x2a942c=timeToPosition(_0x36ec9d[_0x275109(0x1ee)][_0x275109(0x31a)],_0x4a1641,_0x4f418b),_0x4e3042=getBarChar(_0x36ec9d[_0x275109(0x2f6)]),_0x4f270a=Math[_0x275109(0x2a8)](_0x3e5d19+0x1,_0x2a942c);for(let _0x4acff3=_0x3e5d19;_0x4acff3<Math[_0x275109(0x2d2)](_0x4f270a,_0x4f418b);_0x4acff3++){_0x12b0b0[_0x4acff3]=_0x4e3042;}}const _0x18e142=getBarColor(_0x36ec9d['state']),_0x25d976=_0x12b0b0[_0x275109(0x338)](_0x57f431=>_0x57f431==='\x20'?'\x20':_0x18e142(_0x57f431))[_0x275109(0x1c7)]('');return _0x2df4e9+'\x20'+_0x15c8ea+'│'+_0x25d976+'│';}function calculateStats(_0x3de54e){const _0x9ea5b0=a60_0x536582,_0x46d04a={'total':_0x3de54e[_0x9ea5b0(0x330)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x34e461 of _0x3de54e){if(_0x34e461['state']===_0x9ea5b0(0x219))_0x46d04a['success']++;else{if(_0x34e461[_0x9ea5b0(0x2f6)]==='error'||_0x34e461['state']===_0x9ea5b0(0x27c))_0x46d04a['error']++;else _0x34e461[_0x9ea5b0(0x2f6)]===_0x9ea5b0(0x1db)?_0x46d04a['running']++:_0x46d04a[_0x9ea5b0(0x18a)]++;}}return _0x46d04a;}function formatStats(_0x5dc761){const _0x4edeee=a60_0x536582;return[_0x4edeee(0x24b)+_0x5dc761['total'],'✅\x20'+_0x5dc761[_0x4edeee(0x219)],'❌\x20'+_0x5dc761[_0x4edeee(0x2f0)],_0x4edeee(0x283)+_0x5dc761[_0x4edeee(0x1db)],'⏳\x20'+_0x5dc761['pending']][_0x4edeee(0x1c7)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a60_0x536582(0x263);[a60_0x536582(0x28b)]=a60_0x536582(0x1a0);async['execute'](_0x178ba1){const _0x5c2ffd=a60_0x536582,{options:_0x573029,args:_0x17ce4f,tdx:_0xe768e4}=_0x178ba1;let _0x10e2cd,_0x452708,_0x339345=![];if(_0x17ce4f[0x0]){if(_0x17ce4f[0x0][_0x5c2ffd(0x1a3)]('.')){const _0x37f1a5=this[_0x5c2ffd(0x2d4)](_0x17ce4f,_0x573029);if(!_0x37f1a5)return 0x1;_0x10e2cd=_0x37f1a5[_0x5c2ffd(0x194)],_0x452708=_0x37f1a5['workflowName'];}else{_0x452708=_0x17ce4f[0x0],_0x10e2cd=_0x573029[_0x5c2ffd(0x22e)];if(!_0x10e2cd)return console[_0x5c2ffd(0x2f0)](a60_0x529429[_0x5c2ffd(0x30f)](_0x5c2ffd(0x1f7)),_0x5c2ffd(0x2f5)),0x1;_0x339345=!![];}}else{const _0x5337e1=this[_0x5c2ffd(0x2d4)](_0x17ce4f,_0x573029);if(!_0x5337e1)return 0x1;_0x10e2cd=_0x5337e1[_0x5c2ffd(0x194)],_0x452708=_0x5337e1['workflowName'];}if(_0x573029[_0x5c2ffd(0x319)]){if(_0x10e2cd&&_0x452708)console[_0x5c2ffd(0x2f0)](_0x5c2ffd(0x24c)+_0x10e2cd+'.'+_0x452708);else _0x10e2cd&&console[_0x5c2ffd(0x2f0)](_0x5c2ffd(0x267)+_0x10e2cd);}const _0x436186=_0x573029['attemptId'],_0x520d40=_0x573029[_0x5c2ffd(0x26e)];if(_0x436186){_0x520d40&&console['error'](a60_0x529429['yellow']('Warning:'),_0x5c2ffd(0x253));const _0xd0ce0d=_0x573029['follow'];return _0xd0ce0d?await this[_0x5c2ffd(0x261)](_0x178ba1,_0x436186):await this[_0x5c2ffd(0x1ea)](_0x178ba1,_0x436186,_0x573029),0x0;}if(_0x520d40){const _0x453685=await withSpinner(_0x5c2ffd(0x301),()=>_0xe768e4[_0x5c2ffd(0x27b)][_0x5c2ffd(0x27a)]({'projectName':_0x10e2cd,'workflowName':_0x452708,'limit':0x64}),{'verbose':_0x573029[_0x5c2ffd(0x319)]}),_0xecee52=_0x453685['data'][_0x5c2ffd(0x323)](_0x2e9367=>_0x2e9367['id']===_0x520d40);if(!_0xecee52)return console['error'](a60_0x529429[_0x5c2ffd(0x30f)](_0x5c2ffd(0x1f7)),_0x5c2ffd(0x1c8)+_0x520d40),0x1;if(!_0xecee52[_0x5c2ffd(0x2b5)]?.['id'])return console['error'](a60_0x529429['red']('Error:'),_0x5c2ffd(0x2ab)+_0x520d40+'\x20has\x20no\x20attempts'),0x1;const _0x142dec=_0xecee52[_0x5c2ffd(0x2b5)]['id'];_0x573029[_0x5c2ffd(0x319)]&&console[_0x5c2ffd(0x2f0)]('Using\x20attempt\x20'+_0x142dec+_0x5c2ffd(0x1eb)+_0x520d40);const _0x5bb64f=_0x573029['follow'];return _0x5bb64f?await this['pollTimeline'](_0x178ba1,_0x142dec):await this[_0x5c2ffd(0x1ea)](_0x178ba1,_0x142dec,_0x573029),0x0;}const _0x1a59aa=await withSpinner(_0x5c2ffd(0x185),()=>_0xe768e4['workflow'][_0x5c2ffd(0x27a)]({'projectName':_0x10e2cd,'workflowName':_0x452708,'limit':_0x573029[_0x5c2ffd(0x199)]||0x32}),{'verbose':_0x573029[_0x5c2ffd(0x319)]}),_0x299967=_0x1a59aa['data'];if(_0x299967['length']===0x0){if(_0x10e2cd&&_0x452708)console['error'](_0x5c2ffd(0x192)+_0x10e2cd+'.'+_0x452708);else _0x10e2cd?console['error'](_0x5c2ffd(0x20a)+_0x10e2cd):(console[_0x5c2ffd(0x2f0)](_0x5c2ffd(0x2bc)),console['error'](a60_0x529429['dim'](_0x5c2ffd(0x21b))));return 0x0;}_0x299967[_0x5c2ffd(0x259)]((_0x499e20,_0x2da7cb)=>{const _0x18d964=_0x5c2ffd,_0x44e143=_0x499e20[_0x18d964(0x298)]||'',_0x537ad4=_0x2da7cb['sessionTime']||'';return _0x537ad4['localeCompare'](_0x44e143);});if(_0x573029[_0x5c2ffd(0x22d)]||_0x573029['jsonl'])return await handleSDKOutput(_0x299967,_0x573029),0x0;let _0x39b2c8;if(_0x339345){const _0x231c62=_0x299967[0x0];if(!_0x231c62[_0x5c2ffd(0x2b5)]?.['id'])return console[_0x5c2ffd(0x2f0)]('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x39b2c8=_0x231c62[_0x5c2ffd(0x2b5)]['id'],_0x573029['verbose']&&console[_0x5c2ffd(0x2f0)]('Auto-selected\x20latest\x20session:\x20'+_0x231c62[_0x5c2ffd(0x298)]);}else{const _0x20bd87=_0x299967[_0x5c2ffd(0x338)](_0xba66cf=>{const _0x2eab6a=_0x5c2ffd,_0x193da1=getAttemptStatusDisplay(_0xba66cf[_0x2eab6a(0x2b5)]);return{'title':_0xba66cf['project']?.[_0x2eab6a(0x1b1)]+'.'+_0xba66cf[_0x2eab6a(0x27b)]?.[_0x2eab6a(0x1b1)]+'\x20-\x20'+_0xba66cf['sessionTime']+'\x20'+_0x193da1[_0x2eab6a(0x1be)],'value':_0xba66cf['lastAttempt']?.['id']||'','description':_0x193da1['text']};}),_0x42aa0f=await a60_0x4e49d0({'type':_0x5c2ffd(0x1b0),'name':_0x5c2ffd(0x24f),'message':_0x5c2ffd(0x2d8),'choices':_0x20bd87[_0x5c2ffd(0x23a)](_0x45f8a5=>_0x45f8a5[_0x5c2ffd(0x1f2)]!=='')});if(!_0x42aa0f[_0x5c2ffd(0x24f)])return 0x0;_0x39b2c8=_0x42aa0f[_0x5c2ffd(0x24f)];}const _0xd49150=_0x573029[_0x5c2ffd(0x1a5)];return _0xd49150?await this[_0x5c2ffd(0x261)](_0x178ba1,_0x39b2c8):await this[_0x5c2ffd(0x1ea)](_0x178ba1,_0x39b2c8,_0x573029),0x0;}async[a60_0x536582(0x1ea)](_0x41743d,_0x467553,_0x3ada92){const _0x3fe894=a60_0x536582,{tdx:_0xbf5997}=_0x41743d;let _0x3b5cbf,_0x726dcf;try{[_0x3b5cbf,_0x726dcf]=await Promise[_0x3fe894(0x2c7)]([_0xbf5997[_0x3fe894(0x27b)][_0x3fe894(0x34e)](_0x467553),_0xbf5997['workflow'][_0x3fe894(0x228)](_0x467553,![])]);}catch(_0x4747ac){console[_0x3fe894(0x2f0)](a60_0x529429[_0x3fe894(0x30f)](_0x3fe894(0x2a1)));_0x3ada92['verbose']&&console[_0x3fe894(0x2f0)](_0x4747ac);throw _0x4747ac;}if(_0x3ada92[_0x3fe894(0x22d)]||_0x3ada92[_0x3fe894(0x195)]){const _0x4e9d3b=this['buildTimelineData'](_0x3b5cbf,_0x726dcf);await handleSDKOutput([_0x4e9d3b],_0x3ada92);return;}const _0x1c9fbe=_0xbf5997[_0x3fe894(0x286)][_0x3fe894(0x1ba)],_0xa88ed9=this[_0x3fe894(0x24e)](_0x3b5cbf,_0x726dcf,_0x1c9fbe);console['log'](_0xa88ed9);}async[a60_0x536582(0x261)](_0x6d5b15,_0x1e5d6e){const _0x1d2ec0=a60_0x536582,{tdx:_0x580062}=_0x6d5b15,_0x53a3bc=TIMELINE_CONFIG[_0x1d2ec0(0x30d)],_0x157fa0=TIMELINE_CONFIG[_0x1d2ec0(0x222)];let _0x818827=0x0;while(_0x818827<_0x157fa0){process[_0x1d2ec0(0x229)][_0x1d2ec0(0x335)]&&process[_0x1d2ec0(0x229)][_0x1d2ec0(0x2a0)]('\x1Bc');let _0x47e1e5,_0x1ec978;try{[_0x47e1e5,_0x1ec978]=await Promise['all']([_0x580062[_0x1d2ec0(0x27b)][_0x1d2ec0(0x34e)](_0x1e5d6e),_0x580062[_0x1d2ec0(0x27b)][_0x1d2ec0(0x228)](_0x1e5d6e,![])]);}catch(_0x679e78){console[_0x1d2ec0(0x2f0)](a60_0x529429[_0x1d2ec0(0x30f)](_0x1d2ec0(0x193)));_0x818827>0x0&&console[_0x1d2ec0(0x2f0)](a60_0x529429[_0x1d2ec0(0x1d7)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x818827));throw _0x679e78;}const _0x21ad52=_0x580062[_0x1d2ec0(0x286)][_0x1d2ec0(0x1ba)],_0x114568=this[_0x1d2ec0(0x24e)](_0x47e1e5,_0x1ec978,_0x21ad52);console['log'](_0x114568);const _0x3ccdf9=_0x47e1e5['done']&&_0x1ec978[_0x1d2ec0(0x299)](_0x4bdff3=>_0x4bdff3[_0x1d2ec0(0x2f6)]!==_0x1d2ec0(0x1db)&&_0x4bdff3[_0x1d2ec0(0x2f6)]!==_0x1d2ec0(0x1c3));if(_0x3ccdf9){console[_0x1d2ec0(0x2f0)](a60_0x529429[_0x1d2ec0(0x1c1)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0x1d2ec0(0x2f0)](a60_0x529429[_0x1d2ec0(0x1d7)]('\x0aPolling...\x20('+_0x818827*0x2+_0x1d2ec0(0x341))),await new Promise(_0x4cbcec=>setTimeout(_0x4cbcec,_0x53a3bc)),_0x818827++;}_0x818827>=_0x157fa0&&console[_0x1d2ec0(0x2f0)](a60_0x529429[_0x1d2ec0(0x2dc)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}['renderTimeline'](_0x5a53fb,_0xc999a5,_0x58f0bb){const _0x4a4394=a60_0x536582,_0x59c225=[],_0x45cb10=TIMELINE_CONFIG[_0x4a4394(0x291)],_0x6e74d6=0x5,_0x3d7ca8=process[_0x4a4394(0x229)]['columns']||0x78,_0x2f6e19=_0x3d7ca8-_0x45cb10-_0x6e74d6,_0x5be50f=Math[_0x4a4394(0x2a8)](TIMELINE_CONFIG[_0x4a4394(0x1a9)],Math[_0x4a4394(0x2d2)](_0x2f6e19,TIMELINE_CONFIG[_0x4a4394(0x27d)])),_0x4c36d5=new Date(_0x5a53fb[_0x4a4394(0x1bc)])[_0x4a4394(0x236)](),_0x4cf8b2=_0x5a53fb[_0x4a4394(0x2f1)]?new Date(_0x5a53fb['finishedAt'])[_0x4a4394(0x236)]():Date[_0x4a4394(0x19b)](),_0x20bc13={'start':_0x4c36d5,'end':_0x4cf8b2,'duration':_0x4cf8b2-_0x4c36d5},_0x346d60=new Map(),_0x30ffef=[];for(const _0x4c3db5 of _0xc999a5){if(_0x4c3db5[_0x4a4394(0x24a)]){const _0x336d73=new Date(_0x4c3db5['startedAt'])[_0x4a4394(0x236)](),_0x3d5075=_0x4c3db5[_0x4a4394(0x1ac)]?new Date(_0x4c3db5['updatedAt'])[_0x4a4394(0x236)]():Date[_0x4a4394(0x19b)](),_0xa7dd1b={'start':_0x336d73,'end':_0x3d5075,'duration':_0x3d5075-_0x336d73};_0x346d60['set'](_0x4c3db5['id'],_0xa7dd1b),_0x30ffef[_0x4a4394(0x18f)]({'name':_0x4c3db5[_0x4a4394(0x20b)],'state':_0x4c3db5[_0x4a4394(0x2f6)]||_0x4a4394(0x2a4),'window':_0xa7dd1b});}else _0x30ffef[_0x4a4394(0x18f)]({'name':_0x4c3db5['fullName'],'state':_0x4c3db5['state']||_0x4a4394(0x1c3),'window':undefined});}_0x30ffef[_0x4a4394(0x259)]((_0x10eb9a,_0x3b4aa2)=>{const _0x376f0f=_0x4a4394;if(!_0x10eb9a['window'])return 0x1;if(!_0x3b4aa2[_0x376f0f(0x1ee)])return-0x1;return _0x10eb9a['window']['start']-_0x3b4aa2['window'][_0x376f0f(0x197)];});const _0x1fa38e=_0x30ffef[_0x4a4394(0x330)],_0x47f9d0=_0x1fa38e>TIMELINE_CONFIG[_0x4a4394(0x1b3)];_0x47f9d0&&_0x30ffef['splice'](TIMELINE_CONFIG[_0x4a4394(0x1b3)]);const _0x38f371=calculateTimeScale(_0x20bc13,_0x5be50f),_0x7230a0=_0x5a53fb[_0x4a4394(0x1d2)]?_0x5a53fb[_0x4a4394(0x219)]?a60_0x529429['green']('success'):a60_0x529429[_0x4a4394(0x30f)](_0x4a4394(0x2f0)):a60_0x529429['blue'](_0x4a4394(0x1db)),_0x295144=_0x5a53fb['project']?.['id'],_0x86b5cf=_0x5a53fb[_0x4a4394(0x26e)];let _0x200264;if(_0x295144&&_0x86b5cf){const _0x4682ea=getWorkflowAttemptUrl(_0x58f0bb,_0x295144,_0x86b5cf,_0x5a53fb['id']);_0x200264=hyperlink(a60_0x529429[_0x4a4394(0x1d7)](_0x5a53fb['id']),_0x4682ea);}else _0x200264=a60_0x529429[_0x4a4394(0x1d7)](_0x5a53fb['id']);_0x59c225['push'](_0x4a4394(0x2ca)+_0x200264+_0x4a4394(0x265)+_0x7230a0+_0x4a4394(0x265)+formatElapsed(_0x20bc13['duration']));if(_0x30ffef[_0x4a4394(0x330)]>0x0){const _0x19744b=renderTimeAxis(_0x38f371,_0x5be50f),_0x47a5b5=new Date(_0x20bc13['start']),_0x2998b0=formatDate(_0x47a5b5),_0x170d01=TIMELINE_CONFIG[_0x4a4394(0x28c)]+TIMELINE_CONFIG[_0x4a4394(0x1b9)]+_0x45cb10,_0x12ecc3=_0x2998b0[_0x4a4394(0x2de)](_0x170d01),_0x5b4371=a60_0x529429[_0x4a4394(0x1d7)](_0x12ecc3);_0x59c225['push'](_0x5b4371+'\x20'+_0x19744b);for(const _0x2b327d of _0x30ffef){_0x59c225[_0x4a4394(0x18f)](renderTaskRow(_0x2b327d,_0x38f371,_0x5be50f,_0x45cb10));}const _0x23de06=calculateStats(_0x30ffef);_0x59c225[_0x4a4394(0x18f)](formatStats(_0x23de06)),_0x47f9d0&&_0x59c225[_0x4a4394(0x18f)](a60_0x529429[_0x4a4394(0x2dc)](_0x4a4394(0x2d3)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x4a4394(0x200)+_0x1fa38e+_0x4a4394(0x25f))),_0x59c225[_0x4a4394(0x18f)](''),_0x59c225[_0x4a4394(0x18f)](a60_0x529429['dim'](_0x4a4394(0x311))+(_0x4a4394(0x331)+_0x5a53fb['id']+_0x4a4394(0x346))+a60_0x529429[_0x4a4394(0x1d7)](_0x4a4394(0x20d)));}else _0x59c225['push'](_0x4a4394(0x33a));return _0x59c225[_0x4a4394(0x1c7)]('\x0a');}['buildTimelineData'](_0x40c554,_0x31d380){const _0x118272=a60_0x536582,_0x269c2b=new Date(_0x40c554[_0x118272(0x1bc)])[_0x118272(0x236)](),_0x433894=_0x40c554[_0x118272(0x2f1)]?new Date(_0x40c554[_0x118272(0x2f1)])[_0x118272(0x236)]():Date['now'](),_0x18736e=_0x433894-_0x269c2b,_0x4a11b8=[];for(const _0x9b6925 of _0x31d380){if(_0x9b6925[_0x118272(0x24a)]){const _0x1c0a8f=new Date(_0x9b6925[_0x118272(0x24a)])[_0x118272(0x236)](),_0x3cb554=_0x9b6925['updatedAt']?new Date(_0x9b6925[_0x118272(0x1ac)])[_0x118272(0x236)]():Date[_0x118272(0x19b)]();_0x4a11b8[_0x118272(0x18f)]({'name':_0x9b6925[_0x118272(0x20b)],'state':_0x9b6925['state']||_0x118272(0x2a4),'window':{'start':_0x1c0a8f,'end':_0x3cb554,'duration':_0x3cb554-_0x1c0a8f}});}else _0x4a11b8[_0x118272(0x18f)]({'name':_0x9b6925[_0x118272(0x20b)],'state':_0x9b6925[_0x118272(0x2f6)]||_0x118272(0x1c3),'window':undefined});}const _0x21a47a=calculateStats(_0x4a11b8);return{'attempt':{'id':_0x40c554['id'],'status':_0x40c554[_0x118272(0x1d2)]?_0x40c554[_0x118272(0x219)]?_0x118272(0x219):_0x118272(0x2f0):_0x118272(0x1db),'createdAt':_0x40c554['createdAt'],'finishedAt':_0x40c554[_0x118272(0x2f1)],'duration_ms':_0x18736e},'tasks':_0x4a11b8[_0x118272(0x338)](_0x327799=>({'name':_0x327799[_0x118272(0x1b1)],'state':_0x327799[_0x118272(0x2f6)],'startedAt':_0x327799[_0x118272(0x1ee)]?new Date(_0x327799['window'][_0x118272(0x197)])[_0x118272(0x1d1)]():null,'updatedAt':_0x327799[_0x118272(0x1ee)]?new Date(_0x327799[_0x118272(0x1ee)][_0x118272(0x31a)])[_0x118272(0x1d1)]():null,'duration_ms':_0x327799['window']?.['duration']||null})),'stats':_0x21a47a};}}function formatScheduleLine(_0x115c6e){const _0x243457=a60_0x536582,_0x3f2dae=_0x115c6e[_0x243457(0x188)]?a60_0x529429[_0x243457(0x2dc)](_0x243457(0x201)):'',_0x38b5bc=_0x115c6e[_0x243457(0x32f)]?.[_0x243457(0x1b1)]?a60_0x529429['dim']('\x20['+_0x115c6e[_0x243457(0x32f)][_0x243457(0x1b1)]+']'):'',_0x1e53af=_0x115c6e['nextRunTime']?a60_0x529429[_0x243457(0x1d7)](_0x243457(0x310)+new Date(_0x115c6e['nextRunTime'])[_0x243457(0x278)]()):'';return _0x243457(0x332)+_0x115c6e['id']+'\x20'+(_0x115c6e[_0x243457(0x27b)]?.[_0x243457(0x1b1)]||_0x243457(0x2bd))+_0x38b5bc+_0x3f2dae+_0x1e53af;}function a60_0x40f9(_0x48a898,_0x16f852){_0x48a898=_0x48a898-0x181;const _0x1bb78a=a60_0x1bb7();let _0x40f949=_0x1bb78a[_0x48a898];return _0x40f949;}export class WorkflowSchedulesCommand extends WorkflowBaseCommand{['name']=a60_0x536582(0x343);['description']=a60_0x536582(0x205);async[a60_0x536582(0x34d)](_0x3b7ae7){const _0x31af7b=a60_0x536582,{options:_0x1f5bf2,args:_0x33e25f,tdx:_0x4da926}=_0x3b7ae7,{scheduleId:_0x19dfcd}=_0x1f5bf2;if(_0x19dfcd&&_0x33e25f[0x0])return console[_0x31af7b(0x2f0)](a60_0x529429['red']('Error:'),_0x31af7b(0x217)),console['error'](a60_0x529429[_0x31af7b(0x1d7)](_0x31af7b(0x268))),0x1;if(_0x19dfcd){const _0x4b8b61=await withSpinner('Fetching\x20schedule\x20#'+_0x19dfcd+_0x31af7b(0x2eb),()=>_0x4da926['workflow'][_0x31af7b(0x273)](_0x19dfcd),{'verbose':_0x1f5bf2[_0x31af7b(0x319)]}),_0x4176e3=_0x4b8b61[_0x31af7b(0x285)];return isStructuredFormat(_0x1f5bf2)?await handleSingleObjectOutput(_0x4176e3,_0x1f5bf2):(console[_0x31af7b(0x2f0)](_0x31af7b(0x280)),console[_0x31af7b(0x2d7)](formatScheduleLine(_0x4176e3))),0x0;}const _0x282d93=this[_0x31af7b(0x2d4)](_0x33e25f,_0x1f5bf2);if(!_0x282d93)return 0x1;const {projectName:_0x3d705a,workflowName:_0x37c748}=_0x282d93,_0x316084=_0x3d705a?'\x27'+_0x3d705a+(_0x37c748?'.'+_0x37c748:'')+'\x27':undefined,_0x35a715=await withSpinner(_0x316084?'Listing\x20schedules\x20for\x20'+_0x316084+_0x31af7b(0x2eb):_0x31af7b(0x290),()=>_0x3d705a?_0x4da926[_0x31af7b(0x27b)]['listProjectSchedules'](_0x3d705a,{'workflow':_0x37c748,'limit':_0x1f5bf2[_0x31af7b(0x199)]}):_0x4da926[_0x31af7b(0x27b)]['listSchedules']({'limit':_0x1f5bf2['limit']}),{'verbose':_0x1f5bf2[_0x31af7b(0x319)]}),_0x50daae=_0x35a715[_0x31af7b(0x285)],_0x3d25f6=_0x1f5bf2['limit']&&_0x50daae[_0x31af7b(0x330)]>=_0x1f5bf2[_0x31af7b(0x199)]?a60_0x529429[_0x31af7b(0x1d7)](_0x31af7b(0x1d5)):'';console[_0x31af7b(0x2f0)](_0x31af7b(0x2a6)+_0x50daae[_0x31af7b(0x330)]+'\x20schedule'+(_0x50daae[_0x31af7b(0x330)]!==0x1?'s':'')+_0x3d25f6);if(isStructuredFormat(_0x1f5bf2))await handleSDKOutput(_0x50daae,_0x1f5bf2);else{if(_0x50daae[_0x31af7b(0x330)]===0x0)console[_0x31af7b(0x2d7)](_0x31af7b(0x2ba));else for(const _0x4af37d of _0x50daae){console[_0x31af7b(0x2d7)](formatScheduleLine(_0x4af37d));}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{['name']=a60_0x536582(0x1e6);[a60_0x536582(0x28b)]=a60_0x536582(0x1e2);async[a60_0x536582(0x34d)](_0x411c91){const _0x50a2c8=a60_0x536582,{options:_0x508ed8,args:_0x31ba86,tdx:_0x5e6ca6}=_0x411c91,_0x1d3d39=_0x31ba86[0x0];if(!_0x1d3d39)return console[_0x50a2c8(0x2f0)](a60_0x529429[_0x50a2c8(0x30f)]('Error:'),'Schedule\x20ID\x20is\x20required'),console[_0x50a2c8(0x2f0)](a60_0x529429[_0x50a2c8(0x1d7)]('Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>')),console[_0x50a2c8(0x2f0)](a60_0x529429[_0x50a2c8(0x1d7)](_0x50a2c8(0x2c2))),0x1;const {backfill:_0x3d2e4f,nextTime:_0x4da210}=_0x508ed8,_0x30e92a={};if(_0x3d2e4f!==undefined)_0x30e92a[_0x50a2c8(0x325)]=!_0x3d2e4f;if(_0x4da210!==undefined)_0x30e92a['nextTime']=_0x4da210;const _0x2e43dc=await withSpinner('Enabling\x20schedule\x20#'+_0x1d3d39+'...',()=>_0x5e6ca6[_0x50a2c8(0x27b)][_0x50a2c8(0x336)](_0x1d3d39,_0x30e92a),{'verbose':_0x508ed8[_0x50a2c8(0x319)]}),_0x548b5e=_0x2e43dc[_0x50a2c8(0x285)];return isStructuredFormat(_0x508ed8)?await handleSingleObjectOutput(_0x548b5e,_0x508ed8):(console[_0x50a2c8(0x2d7)](_0x50a2c8(0x1f6)+_0x1d3d39+'\x20enabled\x20('+(_0x548b5e[_0x50a2c8(0x27b)]?.[_0x50a2c8(0x1b1)]||_0x50a2c8(0x2a4))+')'),_0x548b5e['nextRunTime']&&console[_0x50a2c8(0x2d7)](a60_0x529429[_0x50a2c8(0x1d7)](_0x50a2c8(0x1ad)+new Date(_0x548b5e[_0x50a2c8(0x2fb)])[_0x50a2c8(0x278)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{['name']='workflow:schedule:disable';['description']=a60_0x536582(0x1f8);async[a60_0x536582(0x34d)](_0x53c856){const _0x482c5d=a60_0x536582,{options:_0x323d82,args:_0x17b4ed,tdx:_0x2649b2}=_0x53c856,_0x16dbcf=_0x17b4ed[0x0];if(!_0x16dbcf)return console[_0x482c5d(0x2f0)](a60_0x529429[_0x482c5d(0x30f)](_0x482c5d(0x1f7)),_0x482c5d(0x342)),console[_0x482c5d(0x2f0)](a60_0x529429['dim'](_0x482c5d(0x187))),console['error'](a60_0x529429[_0x482c5d(0x1d7)](_0x482c5d(0x2c2))),0x1;const _0x3a0567=await withSpinner(_0x482c5d(0x1c2)+_0x16dbcf+_0x482c5d(0x2eb),()=>_0x2649b2[_0x482c5d(0x27b)]['disableSchedule'](_0x16dbcf),{'verbose':_0x323d82[_0x482c5d(0x319)]}),_0x4bba54=_0x3a0567[_0x482c5d(0x285)];return isStructuredFormat(_0x323d82)?await handleSingleObjectOutput(_0x4bba54,_0x323d82):console[_0x482c5d(0x2d7)](_0x482c5d(0x1f6)+_0x16dbcf+_0x482c5d(0x1a8)+(_0x4bba54['workflow']?.[_0x482c5d(0x1b1)]||_0x482c5d(0x2a4))+')'),0x0;}}
1
+ const a60_0x15a404=a60_0x540e;(function(_0x2a89a5,_0x2c9f66){const _0x158090=a60_0x540e,_0x49f61a=_0x2a89a5();while(!![]){try{const _0x450a67=-parseInt(_0x158090(0x12a))/0x1*(-parseInt(_0x158090(0x1eb))/0x2)+parseInt(_0x158090(0x1b7))/0x3*(parseInt(_0x158090(0xd0))/0x4)+-parseInt(_0x158090(0x135))/0x5*(-parseInt(_0x158090(0xec))/0x6)+-parseInt(_0x158090(0x132))/0x7*(-parseInt(_0x158090(0x1d5))/0x8)+parseInt(_0x158090(0x21b))/0x9+-parseInt(_0x158090(0x184))/0xa*(-parseInt(_0x158090(0x271))/0xb)+parseInt(_0x158090(0x226))/0xc*(-parseInt(_0x158090(0x19e))/0xd);if(_0x450a67===_0x2c9f66)break;else _0x49f61a['push'](_0x49f61a['shift']());}catch(_0x4c838a){_0x49f61a['push'](_0x49f61a['shift']());}}}(a60_0x740d,0xbbf1c));function a60_0x540e(_0x2c07ec,_0x47e3f4){_0x2c07ec=_0x2c07ec-0xcf;const _0x740d08=a60_0x740d();let _0x540ebb=_0x740d08[_0x2c07ec];return _0x540ebb;}import a60_0x174743 from'chalk';import{existsSync}from'fs';import a60_0x45f48e 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 a60_0x50c7d3 from'prompts';function getAttemptStatusDisplay(_0x2ed844){const _0x3f1067=a60_0x540e;if(!_0x2ed844)return{'icon':'⏳','text':''};const {done:_0x3a17ad,success:_0x2a52e6,cancelRequested:_0x191601}=_0x2ed844;if(!_0x3a17ad)return _0x191601?{'icon':'🛑','text':a60_0x174743[_0x3f1067(0xf1)](_0x3f1067(0x1a4))}:{'icon':'🔄','text':a60_0x174743[_0x3f1067(0x21c)](_0x3f1067(0x248))};if(_0x2a52e6)return{'icon':'✅','text':a60_0x174743[_0x3f1067(0x234)]('success')};return{'icon':'❌','text':a60_0x174743[_0x3f1067(0x156)](_0x3f1067(0x25d))};}export class WorkflowBaseCommand extends BaseCommand{[a60_0x15a404(0x213)](_0x38f4b8,_0x225d5c,_0x3e87a9=0x0){const _0x15dbfe=a60_0x15a404;return _0x38f4b8[_0x3e87a9]||_0x225d5c[_0x15dbfe(0x110)];}[a60_0x15a404(0x282)](_0x4598ef,_0x3e8233,_0x57ab16=0x0){const _0x4d3ad4=a60_0x15a404,_0xb67570=this[_0x4d3ad4(0x213)](_0x4598ef,_0x3e8233,_0x57ab16);if(!_0xb67570)return console[_0x4d3ad4(0x25d)](a60_0x174743[_0x4d3ad4(0x156)](_0x4d3ad4(0x149)),_0x4d3ad4(0x150)),console['error'](a60_0x174743['dim'](_0x4d3ad4(0x241))),null;return _0xb67570;}[a60_0x15a404(0x26b)](_0x44b69c,_0x537c71){const _0x5e1c06=a60_0x15a404;if(_0x44b69c[0x0]){const _0x5e3596=_0x44b69c[0x0][_0x5e1c06(0x214)]('.');if(_0x5e3596[_0x5e1c06(0x1c9)]===0x1)return{'projectName':_0x5e3596[0x0],'workflowName':undefined};else return _0x5e3596[_0x5e1c06(0x1c9)]===0x2?{'projectName':_0x5e3596[0x0],'workflowName':_0x5e3596[0x1]}:(console['error'](a60_0x174743['red'](_0x5e1c06(0x149)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x537c71[_0x5e1c06(0x110)],'workflowName':undefined};}['resolveProjectDir'](_0x8a0715,_0x2875b8,_0x3f048=0x0){const _0x37b433=a60_0x15a404;if(_0x8a0715[_0x3f048])return _0x8a0715[_0x3f048];if(_0x2875b8['workflowProject']){const _0x10fa3a=a60_0x45f48e[_0x37b433(0xd7)](process[_0x37b433(0x17f)](),'workflows',_0x2875b8[_0x37b433(0x110)]);if(existsSync(a60_0x45f48e['join'](_0x10fa3a,_0x37b433(0xdd))))return _0x10fa3a;}return undefined;}async['showWorkflowConsoleUrl'](_0x2b63dc,_0x3ca461,_0x58e37c){const _0x2084a2=a60_0x15a404;try{const _0x40c0ca=await _0x2b63dc['workflow'][_0x2084a2(0x204)](_0x3ca461,{'limit':0x1});if(_0x40c0ca[_0x2084a2(0x1c9)]>0x0){const _0x415271=_0x40c0ca[0x0]['id'],_0x45057d=getWorkflowUrl(_0x58e37c,_0x415271);console[_0x2084a2(0x25d)]('\x20\x20Console:\x20'+a60_0x174743[_0x2084a2(0x22d)](_0x45057d));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a60_0x15a404(0x27b);[a60_0x15a404(0x1e2)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async['execute'](_0x520839){const _0x1dfb68=a60_0x15a404,{options:_0x2a7fc8,args:_0x42becd,tdx:_0x442b55}=_0x520839,_0x91e8c=_0x42becd[0x0],_0x33acf4=_0x2a7fc8[_0x1dfb68(0x11a)];if(_0x33acf4)return saveSessionContext({'workflow_project':undefined},_0x2a7fc8[_0x1dfb68(0x275)]),console['log'](a60_0x174743[_0x1dfb68(0x234)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x91e8c)return console[_0x1dfb68(0x25d)](a60_0x174743[_0x1dfb68(0x156)]('Error:'),_0x1dfb68(0x150)),console[_0x1dfb68(0x25d)](a60_0x174743['dim']('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x1dfb68(0x25d)](a60_0x174743[_0x1dfb68(0x1a9)](_0x1dfb68(0x15f))),0x1;const _0x559644=await withSpinner('Resolving\x20project\x20\x27'+_0x91e8c+_0x1dfb68(0x193),()=>_0x442b55['workflow'][_0x1dfb68(0x295)](_0x91e8c),{'verbose':_0x2a7fc8[_0x1dfb68(0x1b0)]}),{name:_0x2f92bb}=_0x559644[_0x1dfb68(0x12d)];return saveSessionContext({'workflow_project':_0x2f92bb},_0x2a7fc8[_0x1dfb68(0x275)]),console[_0x1dfb68(0x172)](a60_0x174743[_0x1dfb68(0x234)](_0x1dfb68(0x261)+a60_0x174743['cyan'](_0x2f92bb))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a60_0x15a404(0x18d)]=a60_0x15a404(0xfc);[a60_0x15a404(0x1e2)]=a60_0x15a404(0x147);async[a60_0x15a404(0x1f0)](_0x4d480f){const _0x4d33a2=a60_0x15a404,{options:_0x3fc07d,args:_0x70d28f,tdx:_0x1ea3a4}=_0x4d480f,_0x448ab1=_0x70d28f[0x0];_0x3fc07d[_0x4d33a2(0x1b0)]&&_0x448ab1&&console[_0x4d33a2(0x25d)](_0x4d33a2(0x161)+_0x448ab1);const _0x73a81c=await withSpinner(_0x4d33a2(0x160),()=>_0x1ea3a4['workflow']['projects'](_0x448ab1,{'limit':_0x3fc07d['limit']}),{'verbose':_0x3fc07d[_0x4d33a2(0x1b0)]});let _0x40cf0d=_0x73a81c[_0x4d33a2(0x12d)];_0x40cf0d['sort']((_0x9c46bf,_0x57b8a7)=>_0x9c46bf['name']['localeCompare'](_0x57b8a7[_0x4d33a2(0x18d)]));const _0x1e0e3c=_0x3fc07d['limit']&&_0x40cf0d['length']>=_0x3fc07d['limit']?a60_0x174743[_0x4d33a2(0x1a9)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x4d33a2(0x25d)](_0x4d33a2(0x134)+_0x40cf0d[_0x4d33a2(0x1c9)]+'\x20project'+(_0x40cf0d[_0x4d33a2(0x1c9)]!==0x1?'s':'')+_0x1e0e3c);if(_0x3fc07d[_0x4d33a2(0x217)]==='json'||_0x3fc07d[_0x4d33a2(0x217)]===_0x4d33a2(0xeb)||_0x3fc07d[_0x4d33a2(0x217)]===_0x4d33a2(0x255))await handleSDKOutput(_0x40cf0d,_0x3fc07d);else{if(_0x40cf0d[_0x4d33a2(0x1c9)]===0x0)_0x448ab1?console[_0x4d33a2(0x172)](_0x4d33a2(0x11c)+_0x448ab1):console['log'](_0x4d33a2(0x10a));else{const _0x501727=_0x40cf0d[_0x4d33a2(0xed)](_0xc9e56=>{const _0x28575d=_0x4d33a2,_0x4ef9c7=_0xc9e56[_0x28575d(0x136)]?.['some'](_0x4b4753=>_0x4b4753[_0x28575d(0xe0)]===_0x28575d(0x1c3)),_0x5101a9=_0x4ef9c7?a60_0x174743[_0x28575d(0x1a9)]('\x20(system)'):'';return'📁\x20'+_0xc9e56['name']+_0x5101a9;});await writeOutput(_0x501727[_0x4d33a2(0xd7)]('\x0a'),_0x3fc07d['output'],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a60_0x15a404(0x18d)]='workflow:workflows';['description']=a60_0x15a404(0x290);async[a60_0x15a404(0x1f0)](_0x422dbe){const _0x4c0539=a60_0x15a404,{options:_0x855fac,args:_0x5b39fa,tdx:_0x4de794}=_0x422dbe,_0xc0e7c9=this[_0x4c0539(0x213)](_0x5b39fa,_0x855fac);_0x855fac['verbose']&&_0xc0e7c9&&console[_0x4c0539(0x25d)]('Project\x20filter:\x20'+_0xc0e7c9);const _0x26883b=await withSpinner(_0x4c0539(0x1cd),()=>_0x4de794['workflow'][_0x4c0539(0x204)](_0xc0e7c9,{'limit':_0x855fac[_0x4c0539(0x189)]}),{'verbose':_0x855fac[_0x4c0539(0x1b0)]});let _0x413511=_0x26883b[_0x4c0539(0x12d)];_0x413511[_0x4c0539(0x175)]((_0x5c5193,_0x1cde52)=>{const _0x400d3a=_0x4c0539,_0xc6d6d0=_0x5c5193[_0x400d3a(0x18d)]['localeCompare'](_0x1cde52[_0x400d3a(0x18d)]);if(_0xc6d6d0!==0x0)return _0xc6d6d0;return(_0x5c5193[_0x400d3a(0x148)]?.[_0x400d3a(0x18d)]||'')[_0x400d3a(0x1ea)](_0x1cde52[_0x400d3a(0x148)]?.[_0x400d3a(0x18d)]||'');});const _0x46a935=_0x855fac[_0x4c0539(0x189)]&&_0x413511[_0x4c0539(0x1c9)]>=_0x855fac[_0x4c0539(0x189)]?a60_0x174743[_0x4c0539(0x1a9)](_0x4c0539(0x13c)):'';console[_0x4c0539(0x25d)](_0x4c0539(0x134)+_0x413511['length']+'\x20workflow'+(_0x413511[_0x4c0539(0x1c9)]!==0x1?'s':'')+_0x46a935);if(_0x855fac['format']===_0x4c0539(0x176)||_0x855fac['format']==='jsonl'||_0x855fac[_0x4c0539(0x217)]===_0x4c0539(0x255))await handleSDKOutput(_0x413511,_0x855fac);else{if(_0x413511['length']===0x0)_0xc0e7c9?console[_0x4c0539(0x172)](_0x4c0539(0x10d)+_0xc0e7c9):console[_0x4c0539(0x172)]('No\x20workflows\x20found');else{const _0x4b67dc=_0x855fac[_0x4c0539(0x18e)],_0x3643cf=_0x413511[_0x4c0539(0xed)](_0x51f467=>{const _0x21ae5c=_0x4c0539,_0x1fc11e=a60_0x174743[_0x21ae5c(0x1a9)]('#'+_0x51f467['id']),_0x54c385=hyperlink(_0x1fc11e,getWorkflowUrl(_0x4b67dc,_0x51f467['id'])),_0x50f49=_0x51f467['project']?.['name']?a60_0x174743[_0x21ae5c(0x1a9)]('\x20('+_0x51f467['project']['name']+')'):'';return _0x21ae5c(0x12f)+_0x54c385+'\x20'+_0x51f467['name']+_0x50f49;});await writeOutput(_0x3643cf[_0x4c0539(0xd7)]('\x0a'),_0x855fac['output'],_0x4c0539(0x1fc));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a60_0x15a404(0x18d)]=a60_0x15a404(0x1ad);[a60_0x15a404(0x1e2)]=a60_0x15a404(0x299);async[a60_0x15a404(0x1f0)](_0x44a6f8){const _0x5431f1=a60_0x15a404,{options:_0x5632bd,args:_0x4940df,tdx:_0x27ea1e}=_0x44a6f8,_0x46bee2=this[_0x5431f1(0x26b)](_0x4940df,_0x5632bd);if(!_0x46bee2)return 0x1;const {projectName:_0xe1cc24,workflowName:_0x3f033f}=_0x46bee2;if(_0x5632bd[_0x5431f1(0x1b0)]){if(_0xe1cc24&&_0x3f033f)console[_0x5431f1(0x25d)](_0x5431f1(0x13b)+_0xe1cc24+'.'+_0x3f033f);else _0xe1cc24&&console[_0x5431f1(0x25d)]('Filter:\x20project='+_0xe1cc24);const _0x2c37e3=_0x5632bd[_0x5431f1(0x203)];_0x2c37e3&&console[_0x5431f1(0x25d)]('Status:\x20'+_0x2c37e3);}let _0x4799e0=0x28;if(process[_0x5431f1(0x218)]['isTTY']&&!_0x5632bd[_0x5431f1(0x1d4)]&&!_0x5632bd['format']){const _0x47daee=process['stdout']['rows']||0x28;_0x4799e0=Math[_0x5431f1(0x130)](0x14,Math[_0x5431f1(0x111)](_0x47daee*0x2/0x3));}const _0x5910f3=_0x5632bd[_0x5431f1(0x189)]||_0x4799e0,_0x21a99e=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x27ea1e[_0x5431f1(0x140)]['sessions']({'projectName':_0xe1cc24,'workflowName':_0x3f033f,'status':_0x5632bd[_0x5431f1(0x203)],'fromTime':_0x5632bd['from'],'toTime':_0x5632bd['to'],'limit':_0x5910f3}),{'verbose':_0x5632bd[_0x5431f1(0x1b0)]}),_0x3ec106=_0x21a99e[_0x5431f1(0x12d)];_0x3ec106[_0x5431f1(0x175)]((_0x19dbd2,_0x370592)=>{const _0x3c6c2a=_0x5431f1,_0x48e08e=_0x19dbd2[_0x3c6c2a(0x1cf)]||'',_0x524039=_0x370592['sessionTime']||'';return _0x524039[_0x3c6c2a(0x1ea)](_0x48e08e);});_0x3ec106[_0x5431f1(0x1c9)]>=_0x5910f3?console[_0x5431f1(0x25d)]('✔\x20Showing\x20'+_0x3ec106[_0x5431f1(0x1c9)]+'\x20sessions\x20'+a60_0x174743[_0x5431f1(0x1a9)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x5431f1(0x25d)](_0x5431f1(0x134)+_0x3ec106['length']+_0x5431f1(0x152)+(_0x3ec106[_0x5431f1(0x1c9)]!==0x1?'s':''));if(_0x5632bd['format']===_0x5431f1(0x176)||_0x5632bd['format']===_0x5431f1(0xeb)||_0x5632bd[_0x5431f1(0x217)]===_0x5431f1(0x255))await handleSDKOutput(_0x3ec106,_0x5632bd);else{if(!process[_0x5431f1(0x218)][_0x5431f1(0x165)]||_0x5632bd[_0x5431f1(0x1d4)]){if(_0x3ec106['length']===0x0){if(_0xe1cc24&&_0x3f033f)console['log'](_0x5431f1(0xcf)+_0xe1cc24+'.'+_0x3f033f);else _0xe1cc24?console['log'](_0x5431f1(0xde)+_0xe1cc24):console[_0x5431f1(0x172)]('No\x20sessions\x20found');}else{const _0xfce4d7=_0x5632bd[_0x5431f1(0x18e)],_0x48c809=this[_0x5431f1(0x1be)](_0x3ec106,_0xfce4d7);_0x5632bd[_0x5431f1(0x1d4)]?await writeOutput(_0x48c809,_0x5632bd[_0x5431f1(0x1d4)],_0x5431f1(0x1fc)):console[_0x5431f1(0x172)](_0x48c809);}!_0xe1cc24&&(console[_0x5431f1(0x25d)](''),console['error'](a60_0x174743[_0x5431f1(0x1a9)](_0x5431f1(0x100))),console[_0x5431f1(0x25d)](a60_0x174743['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a60_0x174743['dim'](_0x5431f1(0xd4))));}else{if(_0x3ec106[_0x5431f1(0x1c9)]===0x0){if(_0xe1cc24&&_0x3f033f)console['log']('No\x20sessions\x20found\x20for:\x20'+_0xe1cc24+'.'+_0x3f033f);else _0xe1cc24?console[_0x5431f1(0x172)](_0x5431f1(0xde)+_0xe1cc24):console[_0x5431f1(0x172)](_0x5431f1(0x1fa));}else await this[_0x5431f1(0x12c)](_0x3ec106,_0x44a6f8,_0xe1cc24);}}return 0x0;}[a60_0x15a404(0x1be)](_0xa9f3c8,_0x3ef85f){const _0x429b01=a60_0x15a404,_0x33f8e5=[],_0xf5eba8=new Map();let _0x38d9cb=Infinity,_0x114ce7=-Infinity;for(const _0x354404 of _0xa9f3c8){if(_0x354404[_0x429b01(0x16f)]?.[_0x429b01(0x1b1)]){const _0x41571e=new Date(_0x354404[_0x429b01(0x16f)]['createdAt'])[_0x429b01(0x1de)](),_0x5368a0=_0x354404[_0x429b01(0x16f)][_0x429b01(0x20d)]?new Date(_0x354404['lastAttempt'][_0x429b01(0x20d)])['getTime']():Date[_0x429b01(0x1e9)](),_0x100842=_0x354404[_0x429b01(0x148)]?.[_0x429b01(0x18d)]||_0x429b01(0x131);!_0xf5eba8[_0x429b01(0xe8)](_0x100842)&&_0xf5eba8['set'](_0x100842,[]),_0xf5eba8['get'](_0x100842)['push']({'session':_0x354404,'startTime':_0x41571e,'endTime':_0x5368a0,'duration':_0x5368a0-_0x41571e}),_0x38d9cb=Math[_0x429b01(0x19f)](_0x38d9cb,_0x41571e),_0x114ce7=Math[_0x429b01(0x130)](_0x114ce7,_0x5368a0);}}if(_0xf5eba8[_0x429b01(0x164)]===0x0)return _0x429b01(0x13e);const _0x437922=process['stdout'][_0x429b01(0x24b)]||0x78,_0x8c21f9=0x1e,_0xa715c=0x32,_0x4fa37f=0x4,_0x1f7dba=Math['min'](_0xa715c,Math['max'](_0x8c21f9,Math[_0x429b01(0x111)](_0x437922*0.3))),_0x3afee8=_0x437922-_0x1f7dba-TIMELINE_CONFIG[_0x429b01(0x250)]-0x3-_0x4fa37f,_0x55f05b=_0x114ce7-_0x38d9cb,_0x1d4b27=_0x55f05b/_0x1f7dba,_0x2c3f64=renderTimeAxis({'startTime':_0x38d9cb,'endTime':_0x114ce7,'durationMs':_0x55f05b,'msPerChar':_0x1d4b27},_0x1f7dba),_0x2168b2=[];for(const _0x1b072a of _0xf5eba8[_0x429b01(0x117)]()){_0x2168b2[_0x429b01(0x23d)](..._0x1b072a);}_0x2168b2[_0x429b01(0x175)]((_0x355074,_0x4c2def)=>_0x4c2def[_0x429b01(0x22e)]-_0x355074[_0x429b01(0x22e)]);const _0x3c8a2d=new Date(_0x38d9cb),_0x22a9ba=formatDate(_0x3c8a2d),_0x240f54=_0x4fa37f+TIMELINE_CONFIG[_0x429b01(0x240)]+TIMELINE_CONFIG[_0x429b01(0x154)]+_0x3afee8,_0x44da87='\x20'['repeat'](_0x240f54-_0x22a9ba[_0x429b01(0x1c9)]),_0x21ea18=_0x44da87+a60_0x174743[_0x429b01(0x1a9)](_0x22a9ba)+'\x20'+_0x2c3f64;_0x33f8e5[_0x429b01(0x23d)](_0x21ea18);const _0x1aca2c=0x16;let _0x35d803=0x0;for(const _0x259312 of _0x2168b2){const _0x54b7ed=_0x259312['session'][_0x429b01(0x148)]?.[_0x429b01(0x18d)]||'?',_0x10fc2c=Math[_0x429b01(0x19f)](stringWidth(_0x54b7ed),_0x1aca2c);_0x35d803=Math[_0x429b01(0x130)](_0x35d803,_0x10fc2c);}for(const _0x8ff836 of _0x2168b2){const {session:_0xdbe76a,startTime:_0x14ead2,endTime:_0x564a74,duration:_0x2c231f}=_0x8ff836,_0x1f90a7=_0xdbe76a[_0x429b01(0x148)]?.['id'],_0x390796=_0xdbe76a['id'],_0xcf4008=_0xdbe76a[_0x429b01(0x148)]?.[_0x429b01(0x18d)]||'?',_0x38f75d=_0xdbe76a['workflow']?.[_0x429b01(0x18d)]||'?';let _0x431339,_0x3a42c9;if(_0xdbe76a['lastAttempt']){const _0x3502f9=_0xdbe76a[_0x429b01(0x16f)];!_0x3502f9[_0x429b01(0x1f7)]?(_0x431339=_0x3502f9[_0x429b01(0x13a)]?'🛑':'🔄',_0x3a42c9=_0x3502f9[_0x429b01(0x13a)]?a60_0x174743[_0x429b01(0xf1)]:a60_0x174743[_0x429b01(0x21c)]):(_0x431339=_0x3502f9[_0x429b01(0x24a)]?'✅':'❌',_0x3a42c9=_0x3502f9[_0x429b01(0x24a)]?a60_0x174743[_0x429b01(0x234)]:a60_0x174743['red']);}else _0x431339='⏳',_0x3a42c9=a60_0x174743[_0x429b01(0x1a9)];const _0xf066c8='#'+_0x390796,_0x468127=_0x1f90a7?hyperlink(_0xf066c8,getWorkflowSessionUrl(_0x3ef85f,_0x1f90a7,_0x390796)):_0xf066c8;let _0x1559b1=_0xcf4008;stringWidth(_0xcf4008)>_0x1aca2c&&(_0x1559b1=_0xcf4008[_0x429b01(0x21a)](0x0,_0x1aca2c-0x1)+'…');const _0xa4475d=a60_0x174743[_0x429b01(0x1a9)](_0x1559b1),_0x2fca43=stringWidth(_0x1559b1),_0x41d139='\x20'['repeat'](_0x35d803-stringWidth(_0x1559b1)+0x2),_0x107548='('+formatElapsed(_0x2c231f)+')',_0x32ae4f=stringWidth(_0x107548),_0x574e22=stringWidth(_0xf066c8),_0x1cf2b8=_0x574e22+0x1+_0x2fca43+_0x41d139[_0x429b01(0x1c9)],_0x47dd49=_0x3afee8-_0x1cf2b8-_0x32ae4f-0x1-0x8;let _0x2efe4d=_0x38f75d;stringWidth(_0x2efe4d)>_0x47dd49&&(_0x2efe4d=_0x2efe4d['slice'](0x0,_0x47dd49-0x1)+'…');const _0x3c4a10=_0x468127+'\x20'+_0xa4475d+_0x41d139+_0x2efe4d,_0xde5761=stringWidth(_0x3c4a10),_0x548642=_0x3afee8-_0xde5761-_0x32ae4f,_0x3faec2=_0x3c4a10+'\x20'['repeat'](Math[_0x429b01(0x130)](0x1,_0x548642))+a60_0x174743['dim'](_0x107548),_0x2d8b60=Math[_0x429b01(0x111)]((_0x14ead2-_0x38d9cb)/_0x1d4b27),_0x4b6c2=Math[_0x429b01(0x111)]((_0x564a74-_0x38d9cb)/_0x1d4b27),_0xb6bb07=Math[_0x429b01(0x130)](_0x2d8b60+0x1,_0x4b6c2),_0x2ddd50=new Array(_0x1f7dba)['fill']('\x20');for(let _0x3a55a7=_0x2d8b60;_0x3a55a7<Math['min'](_0xb6bb07,_0x1f7dba);_0x3a55a7++){_0x2ddd50[_0x3a55a7]='─';}const _0x527208=_0x2ddd50[_0x429b01(0xed)](_0x5ca71c=>_0x5ca71c==='\x20'?'\x20':_0x3a42c9(_0x5ca71c))[_0x429b01(0xd7)]('');_0x33f8e5[_0x429b01(0x23d)](_0x431339+'\x20'+_0x3faec2+'│'+_0x527208+'│');}return _0x33f8e5['join']('\x0a');}async[a60_0x15a404(0x12c)](_0x7ea97e,_0x440190,_0x4e6143){const _0x5ad0be=a60_0x15a404,{options:_0x15c29e,tdx:_0x1d1a02}=_0x440190,_0x15a281=_0x15c29e['site'],{timelineRows:_0x42acf9,timeAxisHeader:_0x4f2335}=this['generateSessionTimelineRows'](_0x7ea97e,_0x15a281),_0x2c2831=_0x42acf9['filter'](_0x4ec2bf=>_0x4ec2bf['attemptId']);if(_0x2c2831[_0x5ad0be(0x1c9)]===0x0){const _0x3590fe=this['renderSessionsTimeline'](_0x7ea97e,_0x15a281);console[_0x5ad0be(0x172)](_0x3590fe);!_0x4e6143&&(console[_0x5ad0be(0x25d)](''),console[_0x5ad0be(0x25d)](a60_0x174743['dim'](_0x5ad0be(0x100))),console[_0x5ad0be(0x25d)](a60_0x174743[_0x5ad0be(0x1a9)](_0x5ad0be(0x1a3))+'or'+a60_0x174743[_0x5ad0be(0x1a9)](_0x5ad0be(0xd4))));return;}_0x4f2335&&console[_0x5ad0be(0x172)](_0x4f2335);const _0x490ef1=_0x42acf9[_0x5ad0be(0x23a)](_0x43c6f0=>_0x43c6f0['attemptId'])[_0x5ad0be(0xed)](_0x286c82=>({'title':_0x286c82[_0x5ad0be(0x197)],'value':_0x286c82[_0x5ad0be(0x181)]})),_0x2156c7=process[_0x5ad0be(0x218)][_0x5ad0be(0x18a)]||0x3c,_0x513680=Math['max'](0x28,Math[_0x5ad0be(0x111)](_0x2156c7*0x2/0x3)),_0x99fbb5=await a60_0x50c7d3({'type':'autocomplete','name':_0x5ad0be(0x181),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x490ef1,'initial':-0x1,'limit':_0x513680,'clearFirst':!![],'fallback':{'title':_0x5ad0be(0x1c2),'value':null},'suggest':(_0x5abee1,_0x3deef5)=>{const _0x4271f2=_0x5ad0be;if(!_0x5abee1)return Promise[_0x4271f2(0x210)](_0x3deef5);const _0x5596ef=_0x3deef5['filter'](_0x332a99=>{const _0x6ff698=_0x4271f2,_0x161831=_0x332a99;return _0x161831['title'][_0x6ff698(0x192)]()[_0x6ff698(0x109)](_0x5abee1[_0x6ff698(0x192)]());});return Promise['resolve'](_0x5596ef);}}),_0x12bef5=()=>{const _0x2d9358=_0x5ad0be;process['stdout'][_0x2d9358(0x200)](_0x2d9358(0x263)),process[_0x2d9358(0x218)][_0x2d9358(0x200)](_0x2d9358(0x263)),process[_0x2d9358(0x218)][_0x2d9358(0x200)](_0x2d9358(0x263));},_0x139961=_0x99fbb5&&_0x99fbb5[_0x5ad0be(0x181)]&&_0x99fbb5[_0x5ad0be(0x181)]!==null&&_0x99fbb5[_0x5ad0be(0x181)][_0x5ad0be(0xf2)]()!=='';if(!_0x139961){_0x12bef5(),console[_0x5ad0be(0x172)](a60_0x174743[_0x5ad0be(0x1a9)](_0x5ad0be(0x107)));return;}_0x12bef5();const _0x3fe4c6=_0x7ea97e[_0x5ad0be(0x233)](_0x218f35=>_0x218f35[_0x5ad0be(0x16f)]?.['id']===_0x99fbb5[_0x5ad0be(0x181)]);if(_0x3fe4c6){const _0x1ed784=_0x3fe4c6[_0x5ad0be(0x148)]?.[_0x5ad0be(0x18d)]||'?',_0x5948b5=_0x3fe4c6[_0x5ad0be(0x140)]?.[_0x5ad0be(0x18d)]||'?';console[_0x5ad0be(0x172)](_0x5ad0be(0x276)+a60_0x174743[_0x5ad0be(0x1a9)](_0x1ed784)+_0x5ad0be(0x256)+a60_0x174743[_0x5ad0be(0x1a9)](_0x5948b5));}const _0x5e9851=new WorkflowTimelineCommand();await _0x5e9851['execute']({'args':[],'options':{..._0x15c29e,'attemptId':_0x99fbb5['attemptId']},'tdx':_0x1d1a02});}[a60_0x15a404(0x141)](_0xc810b8,_0x40af8e){const _0x257fc0=a60_0x15a404,_0x42b525=new Map();for(const _0x4dd122 of _0xc810b8){_0x4dd122['id']&&_0x4dd122['lastAttempt']?.['id']&&_0x42b525[_0x257fc0(0x125)](_0x4dd122['id'],_0x4dd122[_0x257fc0(0x16f)]['id']);}const _0x434eac=[];let _0xcd71e9='';const _0x3f4c03=this[_0x257fc0(0x1be)](_0xc810b8,_0x40af8e),_0x364691=_0x3f4c03[_0x257fc0(0x214)]('\x0a');for(const _0x41ceff of _0x364691){if(_0x41ceff[_0x257fc0(0xf0)](_0x257fc0(0x16e))||_0x41ceff['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0xcd71e9=_0x41ceff;else{if(_0x41ceff[_0x257fc0(0x25f)](/^[✅❌🔄🛑⏳]/)){const _0x48a86a=_0x41ceff[_0x257fc0(0x25f)](/#(\d+)/),_0x485e5e=_0x48a86a?_0x48a86a[0x1]:null,_0x4a8ec5=_0x485e5e?_0x42b525[_0x257fc0(0xe4)](_0x485e5e)||null:null,_0x25508c=_0xc810b8[_0x257fc0(0x233)](_0x422055=>_0x422055['id']===_0x485e5e),_0x3ba055=_0x25508c?.[_0x257fc0(0x148)]?.[_0x257fc0(0x18d)]||'';_0x434eac[_0x257fc0(0x23d)]({'displayLine':_0x41ceff,'attemptId':_0x4a8ec5,'projectName':_0x3ba055});}}}return{'timelineRows':_0x434eac,'timeAxisHeader':_0xcd71e9};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a60_0x15a404(0x18d)]=a60_0x15a404(0x1d0);[a60_0x15a404(0x1e2)]=a60_0x15a404(0x1f9);async[a60_0x15a404(0x1f0)](_0x36ecca){const _0x172999=a60_0x15a404,{options:_0x392422,args:_0xdcc25,tdx:_0x52350b}=_0x36ecca,_0x38d388=this[_0x172999(0x26b)](_0xdcc25,_0x392422);if(!_0x38d388)return 0x1;const {projectName:_0x4187b5,workflowName:_0x238b72}=_0x38d388,_0x4b9f8b=_0x392422['includeRetried'];if(_0x392422[_0x172999(0x1b0)]){if(_0x4187b5&&_0x238b72)console[_0x172999(0x25d)](_0x172999(0x13b)+_0x4187b5+'.'+_0x238b72);else _0x4187b5&&console[_0x172999(0x25d)](_0x172999(0x105)+_0x4187b5);_0x4b9f8b&&console[_0x172999(0x25d)](_0x172999(0x28b));}const _0x5d71f9=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x52350b[_0x172999(0x140)][_0x172999(0x1c0)]({'projectName':_0x4187b5,'workflowName':_0x238b72,'includeRetried':_0x4b9f8b,'limit':_0x392422[_0x172999(0x189)]}),{'verbose':_0x392422['verbose']}),_0x2dbcd9=_0x5d71f9['data'],_0x36ef88=_0x392422[_0x172999(0x189)]||0x64,_0x28176d=_0x2dbcd9['length']>=_0x36ef88?a60_0x174743['dim'](_0x172999(0x13c)):'';console[_0x172999(0x25d)]('✔\x20Found\x20'+_0x2dbcd9[_0x172999(0x1c9)]+_0x172999(0x1f5)+(_0x2dbcd9[_0x172999(0x1c9)]!==0x1?'s':'')+_0x28176d);if(_0x392422[_0x172999(0x217)]==='json'||_0x392422[_0x172999(0x217)]===_0x172999(0xeb)||_0x392422[_0x172999(0x217)]===_0x172999(0x255))await handleSDKOutput(_0x2dbcd9,_0x392422);else{if(_0x2dbcd9['length']===0x0){if(_0x4187b5&&_0x238b72)console[_0x172999(0x172)](_0x172999(0x254)+_0x4187b5+'.'+_0x238b72);else _0x4187b5?console[_0x172999(0x172)](_0x172999(0x118)+_0x4187b5):console['log'](_0x172999(0x1e6));}else{const _0x3b0a3b=_0x392422[_0x172999(0x18e)],_0x1a6219=_0x2dbcd9[_0x172999(0xed)](_0x19d4b7=>{const _0x28d00d=_0x172999,_0x586dd3=a60_0x174743[_0x28d00d(0x1a9)]('#'+_0x19d4b7['id']),_0x5d7499=_0x19d4b7[_0x28d00d(0x148)]?.['id'],_0x42ff18=_0x19d4b7[_0x28d00d(0x26c)]||_0x19d4b7[_0x28d00d(0x1d2)],_0x22ae2b=_0x5d7499&&_0x42ff18?hyperlink(_0x586dd3,getWorkflowAttemptUrl(_0x3b0a3b,_0x5d7499,_0x42ff18,_0x19d4b7['id'])):_0x586dd3,{icon:_0x4e5471,text:_0x1d74b5}=getAttemptStatusDisplay(_0x19d4b7),_0xe1e16d=(_0x19d4b7[_0x28d00d(0x148)]?.[_0x28d00d(0x18d)]||'?')+'.'+(_0x19d4b7[_0x28d00d(0x140)]?.[_0x28d00d(0x18d)]||'?'),_0x2bfd6b=_0x19d4b7[_0x28d00d(0x1cf)]?a60_0x174743[_0x28d00d(0x1a9)](_0x19d4b7['sessionTime']):'';return(_0x22ae2b+'\x20'+_0x4e5471+(_0x1d74b5?'\x20'+_0x1d74b5:'')+'\x20'+_0xe1e16d+'\x20'+_0x2bfd6b)['trimEnd']();});await writeOutput(_0x1a6219[_0x172999(0xd7)]('\x0a'),_0x392422[_0x172999(0x1d4)],_0x172999(0x1fc));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a60_0x15a404(0x18d)]=a60_0x15a404(0x1e5);['description']=a60_0x15a404(0x179);async['execute'](_0x3d65c4){const _0x3eff69=a60_0x15a404,{options:_0x3d5884,args:_0x3fcd46,tdx:_0x4f4227}=_0x3d65c4,_0x1ea104=_0x3fcd46[0x0];if(!_0x1ea104)return console[_0x3eff69(0x25d)](_0x3eff69(0x1dd)),0x1;_0x3d5884[_0x3eff69(0x1b0)]&&console[_0x3eff69(0x25d)](_0x3eff69(0x104)+_0x1ea104);const _0xa8e648=await withSpinner('Getting\x20attempt\x20details...',()=>_0x4f4227[_0x3eff69(0x140)]['attempt'](_0x1ea104),{'verbose':_0x3d5884[_0x3eff69(0x1b0)]}),_0x368d02=_0xa8e648[_0x3eff69(0x12d)];let _0x44a928;!_0x368d02[_0x3eff69(0x1f7)]?_0x44a928=_0x368d02[_0x3eff69(0x13a)]?_0x3eff69(0x1a4):_0x3eff69(0x248):_0x44a928=_0x368d02['success']?_0x3eff69(0x24a):_0x3eff69(0x25d);let _0x17776e;if(_0x368d02[_0x3eff69(0x1b1)]&&_0x368d02[_0x3eff69(0x20d)]){const _0x597f07=new Date(_0x368d02[_0x3eff69(0x1b1)])['getTime'](),_0x4fb13d=new Date(_0x368d02['finishedAt'])[_0x3eff69(0x1de)]();_0x17776e=Math[_0x3eff69(0xd1)]((_0x4fb13d-_0x597f07)/0x3e8);}const _0x1c8304={'attempt_id':_0x368d02['id'],'status':_0x44a928,..._0x368d02['index']!==undefined&&{'index':_0x368d02[_0x3eff69(0x112)]},..._0x368d02[_0x3eff69(0x148)]&&{'project':_0x368d02[_0x3eff69(0x148)][_0x3eff69(0x18d)]},..._0x368d02[_0x3eff69(0x140)]&&{'workflow':_0x368d02['workflow'][_0x3eff69(0x18d)]},..._0x368d02['sessionId']&&{'session_id':_0x368d02[_0x3eff69(0x1d2)]},..._0x368d02[_0x3eff69(0x1cf)]&&{'session_time':_0x368d02[_0x3eff69(0x1cf)]},..._0x368d02['retryAttemptName']&&{'retry_attempt':_0x368d02[_0x3eff69(0x122)]},..._0x17776e!==undefined&&{'duration_sec':_0x17776e},..._0x368d02['createdAt']&&{'created_at':_0x368d02[_0x3eff69(0x1b1)]},..._0x368d02['finishedAt']&&{'finished_at':_0x368d02[_0x3eff69(0x20d)]},...Object['keys'](_0x368d02[_0x3eff69(0x1ff)])[_0x3eff69(0x1c9)]>0x0&&{'params':_0x368d02['params']}};return await handleSingleObjectOutput(_0x1c8304,_0x3d5884),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a60_0x15a404(0x126);['description']=a60_0x15a404(0x1d1);async['execute'](_0x5a2217){const _0x40dfd3=a60_0x15a404,{options:_0x214b81,args:_0x2d920e,tdx:_0x3d1b52}=_0x5a2217,_0x44a65f=_0x2d920e[0x0];if(!_0x44a65f)return console['error'](_0x40dfd3(0x1dd)),0x1;const _0x3d708a=_0x214b81[_0x40dfd3(0xe7)];_0x214b81['verbose']&&(console['error'](_0x40dfd3(0x104)+_0x44a65f),_0x3d708a&&console[_0x40dfd3(0x25d)](_0x40dfd3(0x121)));const _0x1f063d=await withSpinner(_0x40dfd3(0x298),()=>_0x3d1b52[_0x40dfd3(0x140)][_0x40dfd3(0xe3)](_0x44a65f,_0x3d708a||![]),{'verbose':_0x214b81[_0x40dfd3(0x1b0)]}),_0x227e29=_0x1f063d['data'];return console['error'](_0x40dfd3(0x134)+_0x227e29['length']+_0x40dfd3(0x1ac)+(_0x227e29[_0x40dfd3(0x1c9)]!==0x1?'s':'')),await handleSDKOutput(_0x227e29,_0x214b81),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']='workflow:logs';[a60_0x15a404(0x1e2)]=a60_0x15a404(0xff);async[a60_0x15a404(0x1f0)](_0x5924cc){const _0x411a45=a60_0x15a404,{options:_0x14b5d0,args:_0x3e7a06,tdx:_0x315dbc}=_0x5924cc,_0x108f3d=_0x3e7a06[0x0];let _0x2a6b54=_0x3e7a06[0x1];if(!_0x108f3d)return console[_0x411a45(0x25d)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x14b5d0[_0x411a45(0x1b0)]&&(console['error']('Attempt\x20ID:\x20'+_0x108f3d),_0x2a6b54&&console['error'](_0x411a45(0x292)+_0x2a6b54));const _0x194222=await withSpinner(_0x411a45(0x1bd),()=>_0x315dbc[_0x411a45(0x140)][_0x411a45(0xee)](_0x108f3d,_0x2a6b54),{'verbose':_0x14b5d0['verbose']}),_0x1054e0=_0x194222[_0x411a45(0x12d)];if(_0x1054e0[_0x411a45(0x1c9)]===0x0)return console[_0x411a45(0x25d)](_0x411a45(0x29d)),0x0;if(!_0x2a6b54&&(_0x14b5d0[_0x411a45(0x176)]||_0x14b5d0[_0x411a45(0x217)]))return await handleSDKOutput(_0x1054e0,_0x14b5d0),0x0;if(!_0x2a6b54){const _0x2d3695=_0x1054e0[_0x411a45(0xed)](_0x3b1d5d=>({'title':_0x3b1d5d['taskName']+'\x20('+formatBytes(_0x3b1d5d[_0x411a45(0x249)])+')','value':_0x3b1d5d[_0x411a45(0x151)]})),_0x321d68=await a60_0x50c7d3({'type':'select','name':_0x411a45(0x13f),'message':_0x411a45(0x1f6),'choices':_0x2d3695});if(!_0x321d68[_0x411a45(0x13f)])return console[_0x411a45(0x25d)]('Cancelled'),0x0;_0x2a6b54=_0x321d68[_0x411a45(0x13f)];}const _0x1ab982=await withSpinner(_0x411a45(0x114),()=>_0x315dbc[_0x411a45(0x140)]['logs'](_0x108f3d,_0x2a6b54),{'verbose':_0x14b5d0[_0x411a45(0x1b0)]}),_0x5e2c94=_0x1ab982[_0x411a45(0x12d)];return _0x5e2c94?console['log'](_0x5e2c94):console['error'](_0x411a45(0x24c)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a60_0x15a404(0x18d)]=a60_0x15a404(0xf7);[a60_0x15a404(0x1e2)]=a60_0x15a404(0x143);async[a60_0x15a404(0x1f0)](_0x145eb0){const _0xaf99ba=a60_0x15a404,{options:_0x4ecd1b,args:_0x105bf3,tdx:_0x5828b5}=_0x145eb0,_0x3b7524=_0x105bf3[0x0];if(!_0x3b7524)return console[_0xaf99ba(0x25d)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x516c3e=_0x4ecd1b[_0xaf99ba(0x190)];_0x4ecd1b[_0xaf99ba(0x1b0)]&&(console['error'](_0xaf99ba(0x104)+_0x3b7524),_0x516c3e&&console[_0xaf99ba(0x25d)](_0xaf99ba(0x245)+_0x516c3e));if(!_0x4ecd1b['yes']){if(!isInteractive())return console[_0xaf99ba(0x25d)](a60_0x174743['red'](_0xaf99ba(0x16d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xaf99ba(0x25d)](a60_0x174743['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1f30ce=await confirmKey(_0xaf99ba(0x119)+_0x3b7524+'?');if(!_0x1f30ce)return console[_0xaf99ba(0x25d)](a60_0x174743[_0xaf99ba(0xf1)](_0xaf99ba(0x107))),0x1;}const _0x5868f7=await withSpinner(_0xaf99ba(0xe6),()=>_0x5828b5[_0xaf99ba(0x140)]['kill'](_0x3b7524,_0x516c3e),{'verbose':_0x4ecd1b[_0xaf99ba(0x1b0)]}),_0x4c00d0=_0x5868f7[_0xaf99ba(0x12d)];return console[_0xaf99ba(0x25d)]('✔\x20'+_0x4c00d0),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a60_0x15a404(0x133);[a60_0x15a404(0x1e2)]='Retry\x20a\x20session\x20or\x20attempt';async[a60_0x15a404(0x1f0)](_0x2f8835){const _0x242c1e=a60_0x15a404,{options:_0x565b58,args:_0x188ab3,tdx:_0x32d3f5}=_0x2f8835,_0x422863=_0x188ab3[0x0];if(!_0x422863)return console[_0x242c1e(0x25d)](_0x242c1e(0x23c)),console[_0x242c1e(0x25d)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x307fbb=![],_0x286d11=_0x422863;if(_0x422863[_0x242c1e(0xf0)](_0x242c1e(0x1e4)))_0x307fbb=!![],_0x286d11=_0x422863[_0x242c1e(0x1ec)](0x8);else{if(_0x422863[_0x242c1e(0xf0)](_0x242c1e(0x1da)))_0x307fbb=![],_0x286d11=_0x422863['substring'](0x8);else return console['error']('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x4e3eab=_0x565b58[_0x242c1e(0xe5)],_0x2c0230=_0x565b58[_0x242c1e(0x1b9)],_0xa17dd7=_0x565b58[_0x242c1e(0x1ff)],_0x19c4a5=_0x565b58[_0x242c1e(0x29b)];_0x565b58['verbose']&&(console[_0x242c1e(0x25d)](_0x242c1e(0x28d)+(_0x307fbb?_0x242c1e(0x275):_0x242c1e(0x128))+'\x20'+_0x286d11),_0x4e3eab&&console['error'](_0x242c1e(0x21e)+_0x4e3eab),_0x2c0230&&console[_0x242c1e(0x25d)]('Resume\x20from:\x20'+_0x2c0230),_0xa17dd7&&console['error'](_0x242c1e(0x1d8)+_0xa17dd7),_0x19c4a5&&console[_0x242c1e(0x25d)](_0x242c1e(0x286)));let _0x46dd7d;if(_0xa17dd7)try{if(_0xa17dd7[_0x242c1e(0xf0)]('@')){const _0xcf56ef=await import('fs/promises'),_0x3c12fe=_0xa17dd7['substring'](0x1),_0x2e8434=await _0xcf56ef[_0x242c1e(0x268)](_0x3c12fe,_0x242c1e(0x224));_0x46dd7d=JSON['parse'](_0x2e8434);}else _0x46dd7d=JSON[_0x242c1e(0x194)](_0xa17dd7);}catch{return console[_0x242c1e(0x25d)](_0x242c1e(0x10c)),0x1;}if(!_0x565b58['yes']){if(!isInteractive())return console['error'](a60_0x174743[_0x242c1e(0x156)](_0x242c1e(0x16d)),_0x242c1e(0x287)),console['error'](a60_0x174743[_0x242c1e(0x1a9)](_0x242c1e(0x1cc))),0x1;const _0x46256a=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x307fbb?_0x242c1e(0x275):_0x242c1e(0x128))+'\x20'+_0x286d11+'?');if(!_0x46256a)return console[_0x242c1e(0x25d)](a60_0x174743['yellow'](_0x242c1e(0x107))),0x1;}let _0x37e895;_0x307fbb?_0x37e895=await withSpinner('Retrying\x20session...',()=>_0x32d3f5['workflow'][_0x242c1e(0x223)](_0x286d11,{'fromTask':_0x4e3eab,'retryParams':_0x46dd7d}),{'verbose':_0x565b58[_0x242c1e(0x1b0)]}):_0x37e895=await withSpinner(_0x242c1e(0x17c),()=>_0x32d3f5[_0x242c1e(0x140)]['retryAttempt'](_0x286d11,{'resumeFrom':_0x2c0230,'retryParams':_0x46dd7d,'force':_0x19c4a5}),{'verbose':_0x565b58[_0x242c1e(0x1b0)]});const _0x3d1573=_0x37e895[_0x242c1e(0x12d)];return console[_0x242c1e(0x25d)](_0x242c1e(0xda)),console[_0x242c1e(0x25d)](_0x242c1e(0xd2)+_0x3d1573['attemptId']),console[_0x242c1e(0x25d)](_0x242c1e(0x173)+_0x3d1573[_0x242c1e(0x1d2)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a60_0x15a404(0x22f);[a60_0x15a404(0x1e2)]='Start\x20a\x20workflow\x20run';async[a60_0x15a404(0x1f0)](_0x14d8fc){const _0x44bdb8=a60_0x15a404,{options:_0x203ffe,args:_0x4292ec,tdx:_0x1d6993}=_0x14d8fc;let _0x17ead7=_0x4292ec[0x0];if(!_0x17ead7){const _0x56a29b=this[_0x44bdb8(0x213)]([],_0x203ffe),_0x58f1fd=await withSpinner(_0x44bdb8(0x269),()=>_0x1d6993[_0x44bdb8(0x140)][_0x44bdb8(0x204)](_0x56a29b,{'limit':_0x203ffe[_0x44bdb8(0x189)]}),{'verbose':_0x203ffe[_0x44bdb8(0x1b0)]}),_0x1be777=_0x58f1fd['data'];if(_0x1be777[_0x44bdb8(0x1c9)]===0x0)return console['error'](_0x44bdb8(0x17a)),!_0x56a29b&&console[_0x44bdb8(0x25d)](a60_0x174743[_0x44bdb8(0x1a9)](_0x44bdb8(0x241))),0x1;const _0x2b5ff2=_0x1be777[_0x44bdb8(0xed)](_0x54d519=>({'title':_0x54d519[_0x44bdb8(0x148)]?.[_0x44bdb8(0x18d)]+'.'+_0x54d519[_0x44bdb8(0x18d)],'value':_0x54d519[_0x44bdb8(0x148)]?.[_0x44bdb8(0x18d)]+'.'+_0x54d519[_0x44bdb8(0x18d)],'description':_0x54d519['revision']?'revision:\x20'+_0x54d519['revision']:undefined})),_0x404695=await a60_0x50c7d3({'type':_0x44bdb8(0x296),'name':'workflow','message':_0x44bdb8(0x231),'choices':_0x2b5ff2});if(!_0x404695[_0x44bdb8(0x140)])return 0x1;_0x17ead7=_0x404695[_0x44bdb8(0x140)];}if(!_0x17ead7[_0x44bdb8(0x109)]('.')){const _0x1a0dd6=this[_0x44bdb8(0x213)]([],_0x203ffe);if(_0x1a0dd6)_0x17ead7=_0x1a0dd6+'.'+_0x17ead7;else return console[_0x44bdb8(0x25d)](a60_0x174743[_0x44bdb8(0x156)](_0x44bdb8(0x149)),_0x44bdb8(0x257)),console[_0x44bdb8(0x25d)](a60_0x174743[_0x44bdb8(0x1a9)](_0x44bdb8(0x241))),0x1;}const _0x1fa99b=_0x203ffe[_0x44bdb8(0x264)],_0x126a23=_0x203ffe[_0x44bdb8(0x1cf)],_0x590e65={};if(_0x1fa99b&&Array[_0x44bdb8(0x1d9)](_0x1fa99b))for(const _0x5831e8 of _0x1fa99b){const _0x11e04d=_0x5831e8[_0x44bdb8(0x24f)]('=');if(_0x11e04d===-0x1)return console[_0x44bdb8(0x25d)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x5831e8),console['error'](_0x44bdb8(0x253)),0x1;const _0x18341e=_0x5831e8[_0x44bdb8(0x1ec)](0x0,_0x11e04d),_0x23f4a9=_0x5831e8[_0x44bdb8(0x1ec)](_0x11e04d+0x1);try{_0x590e65[_0x18341e]=JSON[_0x44bdb8(0x194)](_0x23f4a9);}catch{_0x590e65[_0x18341e]=_0x23f4a9;}}_0x203ffe[_0x44bdb8(0x1b0)]&&(console[_0x44bdb8(0x25d)](_0x44bdb8(0x14b)+_0x17ead7),Object['keys'](_0x590e65)[_0x44bdb8(0x1c9)]>0x0&&console[_0x44bdb8(0x25d)](_0x44bdb8(0x21f)+JSON[_0x44bdb8(0x274)](_0x590e65)),_0x126a23&&console[_0x44bdb8(0x25d)](_0x44bdb8(0x14c)+_0x126a23));if(_0x203ffe[_0x44bdb8(0x23e)])return await this[_0x44bdb8(0x26f)](_0x14d8fc,_0x17ead7,_0x590e65,_0x126a23);const _0x474845=await withSpinner('Starting\x20workflow\x20run...',()=>_0x1d6993['workflow'][_0x44bdb8(0x180)](_0x17ead7,_0x590e65,{'sessionTime':_0x126a23}),{'verbose':_0x203ffe[_0x44bdb8(0x1b0)]}),_0x2a59ac=_0x474845['data'];console[_0x44bdb8(0x25d)]('✔\x20Workflow\x20run\x20started'),console[_0x44bdb8(0x25d)](_0x44bdb8(0x186)+_0x2a59ac['id']),console[_0x44bdb8(0x25d)]('\x20\x20Session\x20ID:\x20'+_0x2a59ac[_0x44bdb8(0x1d2)]),console[_0x44bdb8(0x25d)](_0x44bdb8(0x1cb)+_0x2a59ac['project']?.['name']),console[_0x44bdb8(0x25d)](_0x44bdb8(0x101)+_0x2a59ac[_0x44bdb8(0x140)]?.[_0x44bdb8(0x18d)]);if(_0x2a59ac[_0x44bdb8(0x148)]?.['id']&&_0x2a59ac[_0x44bdb8(0x1d2)]&&_0x2a59ac['id']){const _0xe309a0=_0x203ffe[_0x44bdb8(0x18e)],_0x393fd8=getConsoleUrl(_0xe309a0,_0x44bdb8(0x1e0)+_0x2a59ac[_0x44bdb8(0x148)]['id']+_0x44bdb8(0x20c)+_0x2a59ac['sessionId']+_0x44bdb8(0x1c1)+_0x2a59ac['id']);console['error'](_0x44bdb8(0x27a)+a60_0x174743['cyan'](_0x393fd8));}return 0x0;}async[a60_0x15a404(0x26f)](_0xd67ff,_0x567770,_0xb05520,_0x493b1c){const _0x16fb57=a60_0x15a404,{options:_0x4f86df,tdx:_0x58bedc}=_0xd67ff,_0x30a5bf=await withSpinner(_0x16fb57(0x14e)+_0x567770+_0x16fb57(0x215),()=>_0x58bedc[_0x16fb57(0x140)][_0x16fb57(0xdc)](_0x567770),{'verbose':_0x4f86df[_0x16fb57(0x1b0)]}),_0x303f3b=_0x30a5bf[_0x16fb57(0x12d)],_0x57061c=_0x493b1c??new Date()[_0x16fb57(0x230)]();console[_0x16fb57(0x172)](a60_0x174743[_0x16fb57(0x115)](_0x16fb57(0x244)),_0x567770),console[_0x16fb57(0x172)](a60_0x174743['bold'](_0x16fb57(0x297)),_0x57061c),console[_0x16fb57(0x172)](a60_0x174743[_0x16fb57(0x115)](_0x16fb57(0xf6)),JSON[_0x16fb57(0x274)](_0xb05520)),console[_0x16fb57(0x172)](''),console[_0x16fb57(0x172)](a60_0x174743[_0x16fb57(0x115)](_0x16fb57(0x1ed)));const _0x41d60a=parseTaskGraph(_0x303f3b[_0x16fb57(0x1ce)]??null);if(_0x41d60a[_0x16fb57(0x1c9)]===0x0)console['log'](a60_0x174743[_0x16fb57(0x1a9)](_0x16fb57(0x273)));else for(const _0x209b89 of formatTaskGraph(_0x41d60a)){console[_0x16fb57(0x172)](_0x209b89);}const _0x5cc5cd=summarizeTaskGraph(_0x41d60a),_0x2379aa=formatWarningSummary(_0x5cc5cd);return _0x2379aa&&(console[_0x16fb57(0x172)](''),console['log'](a60_0x174743['yellow'](_0x2379aa))),console[_0x16fb57(0x172)](a60_0x174743[_0x16fb57(0xf1)](_0x16fb57(0x1c8))),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a60_0x15a404(0x18d)]=a60_0x15a404(0xf5);[a60_0x15a404(0x1e2)]=a60_0x15a404(0x1dc);async[a60_0x15a404(0x1f0)](_0x15b382){const _0x4b20be=a60_0x15a404,{options:_0x5ef149,args:_0x3be1d4,tdx:_0x3ab878}=_0x15b382,_0x124a80=_0x3be1d4[0x0],_0x4b6b95=_0x3be1d4[0x1]||'.';if(!_0x124a80)return console[_0x4b20be(0x25d)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x4b20be(0x25d)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x4deae6=_0x5ef149[_0x4b20be(0x207)];_0x5ef149[_0x4b20be(0x1b0)]&&(console[_0x4b20be(0x25d)]('Project:\x20'+_0x124a80),console[_0x4b20be(0x25d)](_0x4b20be(0x11b)+_0x4b6b95),_0x4deae6&&console['error']('Revision:\x20'+_0x4deae6));const _0x38267a=await withSpinner('Downloading\x20project\x20'+_0x124a80+_0x4b20be(0x215),()=>_0x3ab878['workflow'][_0x4b20be(0x19d)](_0x124a80,_0x4b6b95,{'revision':_0x4deae6}),{'verbose':_0x5ef149[_0x4b20be(0x1b0)]}),_0x40925b=_0x38267a[_0x4b20be(0x12d)];return console[_0x4b20be(0x25d)](_0x4b20be(0x188)+_0x40925b[_0x4b20be(0x20f)]),console[_0x4b20be(0x25d)]('\x20\x20Revision:\x20'+_0x40925b[_0x4b20be(0x207)]),console[_0x4b20be(0x25d)]('\x20\x20Files\x20extracted:\x20'+_0x40925b['filesExtracted']),console['error'](_0x4b20be(0x137)+_0x4b6b95+'/'+_0x40925b[_0x4b20be(0x20f)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a60_0x15a404(0x18d)]='workflow:upload';[a60_0x15a404(0x1e2)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20AI\x20(digdag-style)';async[a60_0x15a404(0x1f0)](_0xa46190){const _0x1d1117=a60_0x15a404,{options:_0x2780b5,args:_0x205141,tdx:_0x14ca19}=_0xa46190;let _0x3b8776='.',_0x21f276=_0x2780b5[_0x1d1117(0x18d)];if(_0x205141[0x0]){const {promises:_0xbac220}=await import('fs');try{const _0x15ee47=await _0xbac220['stat'](_0x205141[0x0]);if(_0x15ee47[_0x1d1117(0x14d)]())_0x3b8776=_0x205141[0x0];else return console[_0x1d1117(0x25d)](_0x1d1117(0x11e)+_0x205141[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x21f276=_0x205141[0x0],_0x3b8776='.';}}const _0xc91a5f=_0x2780b5[_0x1d1117(0x207)],_0x215818=_0x2780b5[_0x1d1117(0x157)];_0x2780b5[_0x1d1117(0x1b0)]&&(console['error'](_0x1d1117(0x293)+_0x3b8776),_0x21f276&&console[_0x1d1117(0x25d)](_0x1d1117(0x258)+_0x21f276),_0xc91a5f&&console[_0x1d1117(0x25d)]('Revision:\x20'+_0xc91a5f),_0x215818&&console[_0x1d1117(0x25d)]('Validation:\x20skipped'));const _0xa33cfb=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x14ca19['workflow'][_0x1d1117(0x23d)](_0x3b8776,{'projectName':_0x21f276,'revision':_0xc91a5f,'skipValidation':_0x215818}),{'verbose':_0x2780b5[_0x1d1117(0x1b0)]}),_0x276cbc=_0xa33cfb[_0x1d1117(0x12d)];return console[_0x1d1117(0x25d)](_0x1d1117(0x29a)+_0x276cbc[_0x1d1117(0x20f)]),console[_0x1d1117(0x25d)](_0x1d1117(0x123)+_0x276cbc[_0x1d1117(0x21d)]),console[_0x1d1117(0x25d)]('\x20\x20Revision:\x20'+_0x276cbc[_0x1d1117(0x207)]),await this[_0x1d1117(0x1e8)](_0x14ca19,_0x276cbc[_0x1d1117(0x20f)],_0x2780b5[_0x1d1117(0x18e)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a60_0x15a404(0x232);[a60_0x15a404(0x1e2)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a60_0x15a404(0x1f0)](_0x59bc7c){const _0x408d78=a60_0x15a404,{options:_0x2641a6,args:_0x33b476,tdx:_0x1d04ff}=_0x59bc7c,_0x2ea828=_0x33b476[0x0],_0x5d001a=_0x33b476[0x1];if(!_0x2ea828)return console[_0x408d78(0x25d)](a60_0x174743[_0x408d78(0x156)](_0x408d78(0x149)),_0x408d78(0x150)),console[_0x408d78(0x25d)](a60_0x174743['dim']('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x1164a3=_0x2641a6['revision'];_0x2641a6[_0x408d78(0x1b0)]&&(console['error'](_0x408d78(0x276)+_0x2ea828),_0x5d001a&&console[_0x408d78(0x25d)]('Target\x20directory:\x20'+_0x5d001a),_0x1164a3&&console[_0x408d78(0x25d)](_0x408d78(0x158)+_0x1164a3),_0x2641a6[_0x408d78(0x23e)]&&console['error'](_0x408d78(0x1d7)));const _0x5c3135=await withSpinner(_0x408d78(0x146)+_0x2ea828+_0x408d78(0x215),()=>_0x1d04ff[_0x408d78(0x140)]['pullProject'](_0x2ea828,{'targetDir':_0x5d001a,'revision':_0x1164a3}),{'verbose':_0x2641a6[_0x408d78(0x1b0)]}),_0x50a8c5=_0x5c3135['data'];_0x50a8c5[_0x408d78(0x1f1)]?console[_0x408d78(0x25d)]('→\x20New\x20project:\x20'+_0x50a8c5[_0x408d78(0x20f)]):console['error'](_0x408d78(0x1f4)+_0x50a8c5[_0x408d78(0x20f)]);console[_0x408d78(0x25d)](_0x408d78(0x170)+_0x50a8c5['revision']),console[_0x408d78(0x25d)]('\x20\x20Target:\x20'+(a60_0x45f48e['relative'](process[_0x408d78(0x17f)](),_0x50a8c5['targetDir'])||'.')),console[_0x408d78(0x25d)]('\x20\x20Changes:\x20'+a60_0x174743[_0x408d78(0x234)]('+'+_0x50a8c5[_0x408d78(0x18c)][_0x408d78(0xd8)]+_0x408d78(0x1c7))+',\x20'+(a60_0x174743[_0x408d78(0xf1)]('~'+_0x50a8c5[_0x408d78(0x18c)][_0x408d78(0x20a)]+_0x408d78(0xfe))+',\x20')+(a60_0x174743[_0x408d78(0x156)]('-'+_0x50a8c5['summary']['deleted']+_0x408d78(0x23b))+',\x20')+(''+a60_0x174743[_0x408d78(0x1a9)](_0x50a8c5[_0x408d78(0x18c)][_0x408d78(0x153)]+_0x408d78(0x166))));for(const _0x5a904d of _0x50a8c5[_0x408d78(0x270)]){_0x5a904d[_0x408d78(0x142)]===_0x408d78(0x20a)&&_0x5a904d['diff']&&(console[_0x408d78(0x25d)]('\x0a'+a60_0x174743[_0x408d78(0x22d)](_0x408d78(0xf4)+_0x5a904d[_0x408d78(0x1c6)])),console[_0x408d78(0x25d)](_0x5a904d[_0x408d78(0x1c5)]));}if(!_0x50a8c5[_0x408d78(0x163)])return saveSessionContext({'workflow_project':_0x50a8c5[_0x408d78(0x20f)]},_0x2641a6[_0x408d78(0x275)]),console[_0x408d78(0x25d)](a60_0x174743[_0x408d78(0x234)](_0x408d78(0x1c4))),console[_0x408d78(0x25d)](a60_0x174743['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x50a8c5[_0x408d78(0x20f)])),0x0;if(_0x2641a6[_0x408d78(0x23e)])return console['error'](a60_0x174743[_0x408d78(0xf1)](_0x408d78(0x18b))),0x0;if(!_0x2641a6[_0x408d78(0xf3)]){if(!isInteractive())return console[_0x408d78(0x25d)](a60_0x174743['red'](_0x408d78(0x16d)),_0x408d78(0x287)),console['error'](a60_0x174743['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5e4890=await confirmKey(_0x408d78(0x1e3));if(!_0x5e4890)return console[_0x408d78(0x25d)](a60_0x174743[_0x408d78(0xf1)]('Cancelled'),_0x408d78(0x27f)),0x1;}await withSpinner(_0x408d78(0x199),()=>_0x1d04ff['workflow']['applyPullProject'](_0x50a8c5,{'revision':_0x1164a3}),{'verbose':_0x2641a6[_0x408d78(0x1b0)]}),saveSessionContext({'workflow_project':_0x50a8c5['projectName']},_0x2641a6['session']),console[_0x408d78(0x25d)](a60_0x174743[_0x408d78(0x234)]('✔\x20Pull\x20complete'));const _0x493a7f=a60_0x45f48e[_0x408d78(0x171)](process[_0x408d78(0x17f)](),_0x50a8c5[_0x408d78(0x1b8)])||'.';return console['error'](a60_0x174743[_0x408d78(0x1a9)]('\x20\x20Location:\x20'+_0x493a7f)),console[_0x408d78(0x25d)](a60_0x174743[_0x408d78(0x1a9)](_0x408d78(0xea)+_0x50a8c5[_0x408d78(0x20f)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a60_0x15a404(0x18d)]='workflow:push';[a60_0x15a404(0x1e2)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20AI';async['execute'](_0x1dd2f3){const _0x3974d9=a60_0x15a404,{options:_0x44abec,args:_0x1546c6,tdx:_0x5afb3c}=_0x1dd2f3,_0x5c5e54=this[_0x3974d9(0xfd)](_0x1546c6,_0x44abec),_0x2e2314=_0x44abec,{revision:_0x401d15,skipValidation:_0x490025,backfill:_0x200be1}=_0x2e2314,_0x37b32e=_0x200be1===undefined?undefined:!_0x200be1;_0x44abec[_0x3974d9(0x1b0)]&&(_0x5c5e54&&console[_0x3974d9(0x25d)]('Source\x20directory:\x20'+_0x5c5e54),_0x401d15&&console[_0x3974d9(0x25d)](_0x3974d9(0x158)+_0x401d15),_0x44abec[_0x3974d9(0x23e)]&&console['error'](_0x3974d9(0x1d7)),_0x490025&&console['error'](_0x3974d9(0x185)),_0x200be1&&console[_0x3974d9(0x25d)](_0x3974d9(0x19b)));let _0x39b36c;try{_0x39b36c=await withSpinner('Analyzing\x20changes...',()=>_0x5afb3c[_0x3974d9(0x140)]['preparePushProject']({'sourceDir':_0x5c5e54,'revision':_0x401d15,'skipValidation':_0x490025,'skipSchedule':_0x37b32e}),{'verbose':_0x44abec['verbose']});}catch(_0x52b8c9){if(_0x52b8c9 instanceof Error&&_0x52b8c9[_0x3974d9(0x26d)]['includes'](_0x3974d9(0x13d)))return console['error'](a60_0x174743[_0x3974d9(0x156)](_0x3974d9(0x149)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x44abec['workflowProject']?console['error'](a60_0x174743[_0x3974d9(0x1a9)](_0x3974d9(0x159)+_0x44abec[_0x3974d9(0x110)]+_0x3974d9(0x16c)+_0x44abec['workflowProject']+'\x27')):console[_0x3974d9(0x25d)](a60_0x174743['dim'](_0x3974d9(0x23f))),0x1;throw _0x52b8c9;}const _0x93ed22=_0x39b36c[_0x3974d9(0x12d)];console[_0x3974d9(0x25d)](_0x3974d9(0x246)+_0x93ed22[_0x3974d9(0x20f)]),console[_0x3974d9(0x25d)](_0x3974d9(0x225)+_0x93ed22['sourceDir']),console[_0x3974d9(0x25d)](_0x3974d9(0x170)+_0x93ed22[_0x3974d9(0x207)]),console[_0x3974d9(0x25d)]('\x20\x20Changes:\x20'+a60_0x174743[_0x3974d9(0x234)]('+'+_0x93ed22[_0x3974d9(0x18c)]['new']+'\x20new')+',\x20'+(a60_0x174743[_0x3974d9(0xf1)]('~'+_0x93ed22[_0x3974d9(0x18c)][_0x3974d9(0x20a)]+_0x3974d9(0xfe))+',\x20')+(a60_0x174743[_0x3974d9(0x156)]('-'+_0x93ed22[_0x3974d9(0x18c)][_0x3974d9(0xdf)]+'\x20deleted')+',\x20')+(''+a60_0x174743[_0x3974d9(0x1a9)](_0x93ed22[_0x3974d9(0x18c)][_0x3974d9(0x153)]+_0x3974d9(0x166))));for(const _0x272ab4 of _0x93ed22['changes']){_0x272ab4[_0x3974d9(0x142)]===_0x3974d9(0x20a)&&_0x272ab4[_0x3974d9(0x1c5)]&&(console[_0x3974d9(0x25d)]('\x0a'+a60_0x174743[_0x3974d9(0x22d)](_0x3974d9(0xf4)+_0x272ab4['path'])),console['error'](_0x272ab4[_0x3974d9(0x1c5)]));}if(!_0x93ed22[_0x3974d9(0x163)])return console[_0x3974d9(0x25d)](a60_0x174743[_0x3974d9(0x234)](_0x3974d9(0x1a0))),await this['showWorkflowConsoleUrl'](_0x5afb3c,_0x93ed22['projectName'],_0x44abec['site']),0x0;if(_0x44abec[_0x3974d9(0x23e)])return console['error'](a60_0x174743['yellow'](_0x3974d9(0x1ae))),0x0;if(!_0x44abec[_0x3974d9(0xf3)]){if(!isInteractive())return console[_0x3974d9(0x25d)](a60_0x174743[_0x3974d9(0x156)](_0x3974d9(0x16d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3974d9(0x25d)](a60_0x174743[_0x3974d9(0x1a9)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x34544b=await confirmKey(_0x3974d9(0xd6));if(!_0x34544b)return console[_0x3974d9(0x25d)](a60_0x174743[_0x3974d9(0xf1)](_0x3974d9(0x107)),_0x3974d9(0x281)),0x1;}const _0x144566=await withSpinner(_0x3974d9(0x17b),()=>_0x5afb3c['workflow'][_0x3974d9(0x116)](_0x93ed22),{'verbose':_0x44abec[_0x3974d9(0x1b0)]}),_0x2b6325=_0x144566[_0x3974d9(0x12d)];return console['error'](a60_0x174743[_0x3974d9(0x234)](_0x3974d9(0x219))),console['error'](_0x3974d9(0x123)+_0x2b6325['projectId']),console['error'](_0x3974d9(0x170)+_0x2b6325[_0x3974d9(0x207)]),await this[_0x3974d9(0x1e8)](_0x5afb3c,_0x2b6325['projectName'],_0x44abec[_0x3974d9(0x18e)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a60_0x15a404(0x18d)]='workflow:clone';[a60_0x15a404(0x1e2)]=a60_0x15a404(0xfa);async[a60_0x15a404(0x1f0)](_0x56cf62){const _0x5e3566=a60_0x15a404,{options:_0x4c292b,args:_0x41a4bb,tdx:_0xba3d9d}=_0x56cf62,_0x9a504=this[_0x5e3566(0xfd)](_0x41a4bb,_0x4c292b),_0x26babe=_0x4c292b[_0x5e3566(0x18d)],_0x27cba5=_0x4c292b[_0x5e3566(0x207)],_0x5d4d25=_0x4c292b[_0x5e3566(0x157)];if(!_0x9a504)return console[_0x5e3566(0x25d)](a60_0x174743[_0x5e3566(0x156)](_0x5e3566(0x149)),'Source\x20directory\x20is\x20required'),console[_0x5e3566(0x25d)](a60_0x174743[_0x5e3566(0x1a9)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x5e3566(0x25d)](a60_0x174743[_0x5e3566(0x1a9)](_0x5e3566(0x288))),0x1;if(!_0x26babe)return console['error'](a60_0x174743[_0x5e3566(0x156)](_0x5e3566(0x149)),_0x5e3566(0x127)),console['error'](a60_0x174743[_0x5e3566(0x1a9)](_0x5e3566(0x168))),0x1;_0x4c292b[_0x5e3566(0x1b0)]&&(console[_0x5e3566(0x25d)]('Source\x20directory:\x20'+_0x9a504),console['error'](_0x5e3566(0x238)+_0x26babe),_0x27cba5&&console[_0x5e3566(0x25d)](_0x5e3566(0x158)+_0x27cba5),_0x4c292b[_0x5e3566(0x23e)]&&console[_0x5e3566(0x25d)](_0x5e3566(0x1d7)),_0x5d4d25&&console['error'](_0x5e3566(0x185)));const _0x2c7432=await withSpinner(_0x5e3566(0x108),()=>_0xba3d9d[_0x5e3566(0x140)][_0x5e3566(0x1fb)](_0x9a504,_0x26babe,{'revision':_0x27cba5,'skipValidation':_0x5d4d25}),{'verbose':_0x4c292b[_0x5e3566(0x1b0)]}),_0x2268c0=_0x2c7432[_0x5e3566(0x12d)];console[_0x5e3566(0x25d)](_0x5e3566(0x1ca)+_0x2268c0[_0x5e3566(0x227)]);_0x2268c0[_0x5e3566(0x1b2)]&&console[_0x5e3566(0x25d)]('Source\x20project:\x20'+_0x2268c0[_0x5e3566(0x1b2)]);console[_0x5e3566(0x25d)](_0x5e3566(0x238)+_0x2268c0[_0x5e3566(0x26a)]),console[_0x5e3566(0x25d)](_0x5e3566(0x158)+_0x2268c0['revision']),console[_0x5e3566(0x25d)]('Files\x20to\x20upload:\x20'+_0x2268c0[_0x5e3566(0x208)]);_0x2268c0['targetExists']&&(console['error'](a60_0x174743[_0x5e3566(0xf1)](_0x5e3566(0x1fd)+_0x2268c0[_0x5e3566(0x26a)]+_0x5e3566(0x15a)+_0x2268c0[_0x5e3566(0xe9)]+')')),console[_0x5e3566(0x25d)](a60_0x174743[_0x5e3566(0xf1)](_0x5e3566(0x1df))));if(_0x4c292b[_0x5e3566(0x23e)])return console[_0x5e3566(0x25d)](a60_0x174743[_0x5e3566(0xf1)](_0x5e3566(0x277))),0x0;if(!_0x4c292b['yes']){if(!isInteractive())return console[_0x5e3566(0x25d)](a60_0x174743[_0x5e3566(0x156)]('\x0aError:'),_0x5e3566(0x287)),console['error'](a60_0x174743[_0x5e3566(0x1a9)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3c79c3=_0x2268c0[_0x5e3566(0x1b2)]||a60_0x45f48e[_0x5e3566(0x11d)](_0x9a504),_0x5d9700=_0x2268c0['targetExists']?_0x5e3566(0x1f2)+_0x26babe+_0x5e3566(0x198):_0x5e3566(0x124)+_0x3c79c3+_0x5e3566(0x1a6)+_0x26babe+'\x22?',_0x1a9961=await confirmKey(_0x5d9700);if(!_0x1a9961)return console[_0x5e3566(0x25d)](a60_0x174743['yellow'](_0x5e3566(0x107))),0x1;}const _0x5a6f2c=await withSpinner(_0x2268c0[_0x5e3566(0x283)]?_0x5e3566(0x113)+_0x26babe+'...':'Cloning\x20to\x20'+_0x26babe+'...',()=>_0xba3d9d[_0x5e3566(0x140)][_0x5e3566(0xe2)](_0x2268c0),{'verbose':_0x4c292b['verbose']}),_0x39e9c4=_0x5a6f2c[_0x5e3566(0x12d)];return console['error'](a60_0x174743[_0x5e3566(0x234)](_0x2268c0[_0x5e3566(0x283)]?'✔\x20Project\x20updated':'✔\x20Clone\x20complete')),console[_0x5e3566(0x25d)](_0x5e3566(0x1cb)+_0x39e9c4['newProjectName']),console[_0x5e3566(0x25d)](_0x5e3566(0x123)+_0x39e9c4[_0x5e3566(0x1d6)]),console[_0x5e3566(0x25d)](_0x5e3566(0x170)+_0x39e9c4[_0x5e3566(0x207)]),await this['showWorkflowConsoleUrl'](_0xba3d9d,_0x39e9c4[_0x5e3566(0x26a)],_0x4c292b[_0x5e3566(0x18e)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a60_0x15a404(0x18d)]=a60_0x15a404(0x260);[a60_0x15a404(0x1e2)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20AI';async['execute'](_0x26299e){const _0x47ae2b=a60_0x15a404,{options:_0x1e492d,args:_0x1d7b7d,tdx:_0xb9e357}=_0x26299e,_0x386908=_0x1d7b7d[0x0];if(!_0x386908)return console[_0x47ae2b(0x25d)](_0x47ae2b(0x291)),console[_0x47ae2b(0x25d)](_0x47ae2b(0x202)),0x1;_0x1e492d['verbose']&&console[_0x47ae2b(0x25d)](_0x47ae2b(0x276)+_0x386908);if(!_0x1e492d[_0x47ae2b(0xf3)]){if(!isInteractive())return console[_0x47ae2b(0x25d)](a60_0x174743[_0x47ae2b(0x156)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a60_0x174743[_0x47ae2b(0x1a9)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x52abe8=await confirmKey(_0x47ae2b(0x10e)+_0x386908+_0x47ae2b(0x237));if(!_0x52abe8)return console[_0x47ae2b(0x25d)](a60_0x174743[_0x47ae2b(0xf1)](_0x47ae2b(0x107))),0x1;}const _0x11d780=await withSpinner(_0x47ae2b(0xfb)+_0x386908+'...',()=>_0xb9e357[_0x47ae2b(0x140)][_0x47ae2b(0x1e7)](_0x386908),{'verbose':_0x1e492d[_0x47ae2b(0x1b0)]}),_0x59a117=_0x11d780[_0x47ae2b(0x12d)];return console['error'](_0x47ae2b(0x145)+_0x59a117[_0x47ae2b(0x20f)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x59a117[_0x47ae2b(0x21d)]),0x0;}}export function parseKeyValue(_0x1f8e63){const _0x521bb1=a60_0x15a404,_0x377fd9=_0x1f8e63[_0x521bb1(0x24f)]('=');if(_0x377fd9===-0x1)throw new Error(_0x521bb1(0x169)+_0x1f8e63+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x24c643=_0x1f8e63['substring'](0x0,_0x377fd9),_0x224b99=_0x1f8e63[_0x521bb1(0x1ec)](_0x377fd9+0x1);if(!_0x24c643)throw new Error(_0x521bb1(0x1b3));return{'key':_0x24c643,'value':_0x224b99};}function a60_0x740d(){const _0x52bc2a=['retrySession','utf-8','\x20\x20Source:\x20','37446936rGKxdJ','sourceDir','tdx\x20wf\x20attempt\x20','Secrets\x20to\x20set:\x20','workflow:schedule:disable','🔄\x20','getDate','cyan','startTime','workflow:run','toISOString','Select\x20a\x20workflow\x20to\x20run','workflow:pull','find','green','renderTimeline','deleteSecret','\x22?\x20This\x20cannot\x20be\x20undone.','New\x20project\x20name:\x20','renderSingleTimeline','filter','\x20deleted','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','push','dryRun','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','ICON_WIDTH','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','workflow:schedule:enable','Key:\x20','Workflow:','Reason:\x20','✔\x20Project:\x20','MAX_POLL_ITERATIONS','running','fileSize','success','columns','No\x20log\x20content\x20found','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Listing\x20schedules...','indexOf','GUTTER','Disable\x20a\x20workflow\x20schedule','\x20disabled\x20(','Expected\x20format:\x20--param\x20key=value','No\x20attempts\x20found\x20for:\x20','table',',\x20Workflow:\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Project\x20name:\x20','msPerChar','fullName','Enable\x20a\x20workflow\x20schedule','Failed\x20to\x20fetch\x20attempt\x20data','error','getMonth','match','workflow:delete','✔\x20Workflow\x20project\x20set\x20to:\x20','\x20has\x20no\x20attempts','\x1b[1A\x1b[2K','param','workflow:schedules','List\x20workflow\x20schedules','MIN_LABEL_COUNT','readFile','Loading\x20workflows...','newProjectName','parseProjectWorkflowPattern','session_id','message','group_error','executeDryRun','changes','38511ifmXjI','workflowName','\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)','stringify','session','Project:\x20','\x0aDry\x20run\x20-\x20no\x20project\x20created','MAX_TASKS_DISPLAY','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','\x20\x20Console:\x20','workflow:use','start','pollTimeline','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','-\x20no\x20files\x20written','Setting\x20','-\x20nothing\x20pushed','requireProject','targetExists','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Force:\x20yes','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','\x20-\x20','Include\x20retried:\x20yes','Setting\x20secret...','Target:\x20','✔\x20Schedule\x20#','Fetching\x20schedule\x20#','List\x20workflows','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Task\x20name:\x20','Project\x20directory:\x20','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','resolveProjectId','select','Session\x20time:','Getting\x20attempt\x20tasks...','List\x20workflow\x20execution\x20sessions','✔\x20Pushed\x20','force','Error:\x20Project\x20name\x20is\x20required','No\x20log\x20files\x20found\x20for\x20this\x20attempt','No\x20sessions\x20found\x20for:\x20','1332JDGjMF','round','\x20\x20New\x20attempt\x20ID:\x20','text','\x20\x20tdx\x20wf\x20use\x20<project>','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','\x0aPush\x20these\x20changes?','join','new','Using\x20attempt\x20','✔\x20Retry\x20started','toLocaleString','getWorkflow','tdx.json','No\x20sessions\x20found\x20in\x20project:\x20','deleted','key','\x0aPolling...\x20(','executeCloneProject','tasks','get','fromTask','Killing\x20attempt...','includeSubtasks','has','existingProjectId','\x20\x20Session\x20context\x20set\x20to:\x20','jsonl','2028APCriW','map','logFiles','repeat','startsWith','yellow','trim','yes','---\x20','workflow:download','Parameters:','workflow:kill','Error:\x20Secret\x20key\x20is\x20required','LABEL_MIN_SPACING','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Deleting\x20project\x20','workflow:projects','resolveProjectDir','\x20modified','Show\x20logs\x20for\x20a\x20workflow\x20attempt','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x20\x20Workflow:\x20','state','⚠\x20Showing\x20first\x20','Attempt\x20ID:\x20','Filter:\x20project=','workflow:timeline','Cancelled','Analyzing\x20project...','includes','No\x20workflow\x20projects\x20found','fill','Error:\x20Invalid\x20JSON\x20in\x20--params','No\x20workflows\x20found\x20in\x20project:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Session\x20','workflowProject','floor','index','Updating\x20','Downloading\x20logs...','bold','executePushProject','values','No\x20attempts\x20found\x20in\x20project:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','clear','Output\x20directory:\x20','No\x20projects\x20match\x20pattern:\x20','basename','Error:\x20','workflow:secrets:list','padStart','Including\x20subtasks:\x20yes','retryAttemptName','\x20\x20Project\x20ID:\x20','\x0aClone\x20\x22','set','workflow:tasks','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','attempt','getSchedule','11455YoxzOx','keys','navigateSessionsInteractive','data','total','📋\x20','max','(unknown)','7jrfWKN','workflow:retry','✔\x20Found\x20','18710zBDdEW','metadata','\x20\x20Location:\x20','📅\x20#','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','cancelRequested','Filter:\x20','\x20(use\x20--limit\x20to\x20show\x20more)','No\x20workflow\x20tdx.json\x20found','No\x20sessions\x20with\x20timing\x20information','task','workflow','generateSessionTimelineRows','type','Kill\x20a\x20running\x20attempt','sessions','✔\x20Deleted\x20project\x20','Pulling\x20project\x20','List\x20all\x20workflow\x20projects','project','Error:','unknown','Workflow:\x20','Session\x20time:\x20','isDirectory','Fetching\x20workflow\x20','every','Project\x20name\x20is\x20required','taskName','\x20session','unchanged','ICON_SPACING','Listing\x20schedules\x20for\x20','red','skipValidation','Revision:\x20','Tip:\x20cd\x20to\x20workflows/','\x22\x20already\x20exists\x20(ID:\x20','getHours','end','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Total:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Listing\x20workflow\x20projects...','Pattern:\x20','splice','hasChanges','size','isTTY','\x20unchanged','getMinutes','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Invalid\x20format:\x20','\x20to\x20see\x20detailed\x20logs','Auto-selected\x20latest\x20session:\x20','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','\x0aError:','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','lastAttempt','\x20\x20Revision:\x20','relative','log','\x20\x20Session\x20ID:\x20','\x20secrets...','sort','json','buildTimelineData','pending','Show\x20specific\x20attempt\x20details','No\x20workflows\x20found','Pushing\x20project...','Retrying\x20attempt...','\x0aFailed\x20to\x20fetch\x20attempt\x20data','No\x20schedules\x20found','cwd','run','attemptId','workflow:secrets:set','startedAt','1870MdaAuB','Validation:\x20skipped','\x20\x20Attempt\x20ID:\x20','duration','✔\x20Downloaded\x20','limit','rows','\x0aDry\x20run\x20-\x20no\x20files\x20written','summary','name','site','context','reason','Loading\x20sessions...','toLowerCase','\x27...','parse','Warning:','all','displayLine','\x22\x20with\x20new\x20revision?','Writing\x20files...','--schedule-id\x20cannot\x20be\x20combined\x20with\x20a\x20project.workflow\x20filter','Schedule:\x20backfill\x20runs\x20enabled\x20(--backfill)','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','download','13CCbmkR','min','\x0a✔\x20No\x20changes\x20to\x20push','window','Loading\x20session...','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','canceling','Latest\x20session\x20has\x20no\x20attempt','\x22\x20to\x20new\x20project\x20\x22','\x20tasks','follow','dim','\x20(disabled)','icon','\x20task','workflow:sessions','\x0aDry\x20run\x20-\x20nothing\x20pushed','\x20secret','verbose','createdAt','sourceProjectName','Key\x20cannot\x20be\x20empty','Select\x20a\x20session\x20to\x20view\x20timeline:','planned','\x20enabled\x20(','5463mrEbJQ','targetDir','resumeFrom','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','nextRunTime','Fetching\x20log\x20files...','renderSessionsTimeline','durationMs','attempts','/attempt/','No\x20matching\x20sessions\x20found','sys','\x0a✔\x20Already\x20up\x20to\x20date','diff','path','\x20new','\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.','length','Source:\x20','\x20\x20Project:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Listing\x20workflows...','config','sessionTime','workflow:attempts','Show\x20tasks\x20for\x20an\x20attempt','sessionId','listSecrets','output','3107816vuTOSP','newProjectId','Dry\x20run:\x20yes','Params:\x20','isArray','attempt:','getFullYear','Download\x20workflow\x20project\x20from\x20Treasure\x20AI','Error:\x20Attempt\x20ID\x20is\x20required','getTime','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','/app/workflows/','updatedAt','description','\x0aApply\x20these\x20changes?','session:','workflow:attempt','No\x20attempts\x20found','delete','showWorkflowConsoleUrl','now','localeCompare','160ZazYar','substring','Task\x20graph:','✔\x20Secret\x20\x27','disableSchedule','execute','isNewProject','\x0aUpdate\x20existing\x20project\x20\x22','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','→\x20Project:\x20','\x20attempt','Select\x20a\x20task\x20to\x20view\x20logs:','done','Schedule\x20ID\x20is\x20required','List\x20workflow\x20attempts','No\x20sessions\x20found','prepareCloneProject','list','\x0a⚠\x20Project\x20\x22','Enabling\x20schedule\x20#','params','write','💡\x20Tip:\x20Use\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','status','workflows','\x0a✔\x20Attempt\x20complete','LABEL_WIDTH_DIVISOR','revision','fileCount','Deleting\x20secret...','modified','MAX_TIMELINE_WIDTH','/sessions/','finishedAt','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','projectName','resolve','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Listing\x20secrets...','resolveProject','split','...','nextTime','format','stdout','✔\x20Push\x20complete','slice','536805SCpnnU','blue','projectId','From\x20task:\x20','Parameters:\x20','\x20schedule','Disabling\x20schedule\x20#','MIN_TIMELINE_WIDTH'];a60_0x740d=function(){return _0x52bc2a;};return a60_0x740d();}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a60_0x15a404(0x18d)]=a60_0x15a404(0x11f);[a60_0x15a404(0x1e2)]=a60_0x15a404(0x289);async[a60_0x15a404(0x1f0)](_0x12b339){const _0x53a012=a60_0x15a404,{options:_0x37ef29,args:_0x5882c8,tdx:_0x7cd56c}=_0x12b339,_0x4e3e4d=this[_0x53a012(0x282)](_0x5882c8,_0x37ef29);if(!_0x4e3e4d)return 0x1;_0x37ef29[_0x53a012(0x1b0)]&&console['error'](_0x53a012(0x276)+_0x4e3e4d);const _0x1a07dd=await withSpinner(_0x53a012(0x212),()=>_0x7cd56c[_0x53a012(0x140)][_0x53a012(0x1d3)](_0x4e3e4d),{'verbose':_0x37ef29['verbose']}),{secrets:_0x45f356}=_0x1a07dd[_0x53a012(0x12d)];return console[_0x53a012(0x25d)]('✔\x20Found\x20'+_0x45f356[_0x53a012(0x1c9)]+_0x53a012(0x1af)+(_0x45f356['length']!==0x1?'s':'')),await handleSDKOutput(_0x45f356,_0x37ef29),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a60_0x15a404(0x182);[a60_0x15a404(0x1e2)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a60_0x15a404(0x1f0)](_0x43a331){const _0x4740c1=a60_0x15a404,{options:_0x5f1388,args:_0x11684f,tdx:_0x370614}=_0x43a331;let _0x4bd51a,_0x42a406;if(_0x11684f['length']>=0x1&&!_0x11684f[0x0][_0x4740c1(0x109)]('='))_0x4bd51a=_0x11684f[0x0],_0x42a406=_0x11684f['slice'](0x1);else{if(_0x11684f[_0x4740c1(0x1c9)]>=0x1&&_0x5f1388[_0x4740c1(0x110)])_0x4bd51a=_0x5f1388[_0x4740c1(0x110)],_0x42a406=_0x11684f;else return _0x11684f[_0x4740c1(0x1c9)]>=0x1?(console[_0x4740c1(0x25d)](_0x4740c1(0x29c)),console[_0x4740c1(0x25d)](_0x4740c1(0x241)),0x1):(console['error']('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x4740c1(0x25d)](_0x4740c1(0x211)),0x1);}if(_0x42a406[_0x4740c1(0x1c9)]===0x0)return console[_0x4740c1(0x25d)](_0x4740c1(0x139)),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1;const _0x1fbf0a={};try{for(const _0x406435 of _0x42a406){const {key:_0x3aa5e8,value:_0x59ba67}=parseKeyValue(_0x406435);_0x1fbf0a[_0x3aa5e8]=_0x59ba67;}}catch(_0x43631a){return _0x43631a instanceof Error&&console[_0x4740c1(0x25d)](a60_0x174743[_0x4740c1(0x156)](_0x4740c1(0x149)),_0x43631a[_0x4740c1(0x26d)]),0x1;}const _0xa2e721=Object[_0x4740c1(0x12b)](_0x1fbf0a);_0x5f1388['verbose']&&(console['error'](_0x4740c1(0x276)+_0x4bd51a),console[_0x4740c1(0x25d)](_0x4740c1(0x229)+_0xa2e721['join'](',\x20')));const _0x22bdd6=await withSpinner(_0xa2e721[_0x4740c1(0x1c9)]===0x1?_0x4740c1(0x28c):_0x4740c1(0x280)+_0xa2e721[_0x4740c1(0x1c9)]+_0x4740c1(0x174),()=>_0x370614[_0x4740c1(0x140)]['setSecrets'](_0x4bd51a,_0x1fbf0a),{'verbose':_0x5f1388[_0x4740c1(0x1b0)]}),_0x5341c7=_0x22bdd6[_0x4740c1(0x12d)];return console[_0x4740c1(0x25d)](_0xa2e721['length']===0x1?_0x4740c1(0x1ee)+_0x5341c7[_0x4740c1(0x12b)][0x0]+_0x4740c1(0x19c)+_0x5341c7[_0x4740c1(0x20f)]+'\x27':'✔\x20'+_0x5341c7[_0x4740c1(0x12b)][_0x4740c1(0x1c9)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x5341c7[_0x4740c1(0x20f)]+'\x27'),(_0x5f1388[_0x4740c1(0x176)]||_0x5f1388[_0x4740c1(0xeb)])&&await handleSingleObjectOutput(_0x5341c7,_0x5f1388),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a60_0x15a404(0x18d)]='workflow:secrets:delete';['description']=a60_0x15a404(0x1ba);async['execute'](_0x2b2118){const _0x40d503=a60_0x15a404,{options:_0x4fa3d4,args:_0x257f86,tdx:_0x1bce6b}=_0x2b2118;let _0x1c3154,_0x1d058a;if(_0x257f86['length']>=0x2)_0x1c3154=_0x257f86[0x0],_0x1d058a=_0x257f86[0x1];else{if(_0x257f86[_0x40d503(0x1c9)]===0x1&&_0x4fa3d4[_0x40d503(0x110)])_0x1c3154=_0x4fa3d4['workflowProject'],_0x1d058a=_0x257f86[0x0];else return _0x257f86[_0x40d503(0x1c9)]===0x1?(console[_0x40d503(0x25d)](_0x40d503(0x29c)),console[_0x40d503(0x25d)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x40d503(0x25d)](_0x40d503(0xf8)),console['error'](_0x40d503(0x279)),0x1);}_0x4fa3d4[_0x40d503(0x1b0)]&&(console[_0x40d503(0x25d)](_0x40d503(0x276)+_0x1c3154),console['error'](_0x40d503(0x243)+_0x1d058a));if(!_0x4fa3d4[_0x40d503(0xf3)]){if(!isInteractive())return console[_0x40d503(0x25d)](a60_0x174743['red'](_0x40d503(0x16d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x40d503(0x25d)](a60_0x174743[_0x40d503(0x1a9)](_0x40d503(0x1cc))),0x1;const _0x149c4d=await confirmKey(_0x40d503(0x1f3)+_0x1d058a+'\x27\x20from\x20project\x20\x27'+_0x1c3154+'\x27?');if(!_0x149c4d)return console[_0x40d503(0x25d)](a60_0x174743[_0x40d503(0xf1)](_0x40d503(0x107))),0x1;}const _0x65c712=await withSpinner(_0x40d503(0x209),()=>_0x1bce6b[_0x40d503(0x140)][_0x40d503(0x236)](_0x1c3154,_0x1d058a),{'verbose':_0x4fa3d4[_0x40d503(0x1b0)]}),_0x1e791a=_0x65c712['data'];return console[_0x40d503(0x25d)](_0x40d503(0x1ee)+_0x1e791a[_0x40d503(0xe0)]+_0x40d503(0x20e)+_0x1e791a[_0x40d503(0x20f)]+'\x27'),(_0x4fa3d4[_0x40d503(0x176)]||_0x4fa3d4[_0x40d503(0xeb)])&&await handleSingleObjectOutput(_0x1e791a,_0x4fa3d4),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(_0x3404aa){const _0x37fdd9=a60_0x15a404,_0x2a66ba=Math[_0x37fdd9(0x111)](_0x3404aa/0x3e8),_0x1a6f51=Math[_0x37fdd9(0x111)](_0x2a66ba/0x3c),_0xa7762d=Math['floor'](_0x1a6f51/0x3c),_0x16e626=Math['floor'](_0xa7762d/0x18);if(_0x16e626>0x0){const _0x18368a=_0xa7762d%0x18;return _0x18368a>0x0?_0x16e626+'d\x20'+_0x18368a+'h':_0x16e626+'d';}else{if(_0xa7762d>0x0){const _0x4e7865=_0x1a6f51%0x3c;return _0x4e7865>0x0?_0xa7762d+'h\x20'+_0x4e7865+'m':_0xa7762d+'h';}else{if(_0x1a6f51>0x0){const _0x50dec0=_0x2a66ba%0x3c;return _0x50dec0>0x0?_0x1a6f51+'m\x20'+_0x50dec0+'s':_0x1a6f51+'m';}else return _0x2a66ba+'s';}}}function formatTimestamp(_0x4e9599,_0x407544){const _0x57a653=a60_0x15a404,_0xa2cad5=new Date(_0x4e9599),_0x170f26=String(_0xa2cad5[_0x57a653(0x15b)]())['padStart'](0x2,'0'),_0x347c78=String(_0xa2cad5[_0x57a653(0x167)]())[_0x57a653(0x120)](0x2,'0'),_0x529dc7=_0x170f26+':'+_0x347c78,_0x5d1c5d=_0xa2cad5['getFullYear']()===_0x407544[_0x57a653(0x1db)]()&&_0xa2cad5[_0x57a653(0x25e)]()===_0x407544[_0x57a653(0x25e)]()&&_0xa2cad5[_0x57a653(0x22c)]()===_0x407544[_0x57a653(0x22c)]();if(_0x5d1c5d)return _0x529dc7;else{const _0x1176dc=String(_0xa2cad5[_0x57a653(0x25e)]()+0x1)[_0x57a653(0x120)](0x2,'0'),_0x4bd587=String(_0xa2cad5[_0x57a653(0x22c)]())[_0x57a653(0x120)](0x2,'0');return _0x1176dc+'-'+_0x4bd587+'\x20'+_0x529dc7;}}function formatDate(_0x43165f){const _0x27d4f4=a60_0x15a404,_0x3c8e81=_0x43165f['getFullYear'](),_0x197a8c=String(_0x43165f['getMonth']()+0x1)[_0x27d4f4(0x120)](0x2,'0'),_0x4beb98=String(_0x43165f[_0x27d4f4(0x22c)]())[_0x27d4f4(0x120)](0x2,'0');return _0x3c8e81+'-'+_0x197a8c+'-'+_0x4beb98;}function getTaskStateIcon(_0x1dda25){const _0x2c6f20={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x2c6f20[_0x1dda25]||'⚪';}function getBarChar(_0x4d7023){const _0x550868=a60_0x15a404;return _0x4d7023===_0x550868(0x25d)||_0x4d7023==='group_error'?'×':'─';}function getBarColor(_0x378304){const _0xd3bb54=a60_0x15a404,_0x26549f={'success':a60_0x174743['green'],'error':a60_0x174743[_0xd3bb54(0x156)],'group_error':a60_0x174743['red'],'running':a60_0x174743['blue'],'blocked':a60_0x174743[_0xd3bb54(0xf1)],'planned':a60_0x174743['dim'],'canceling':a60_0x174743['yellow']};return _0x26549f[_0x378304]||a60_0x174743['white'];}function parseTaskName(_0x278208){const _0x1e2fc8=a60_0x15a404;let _0x3a6f0c=_0x278208['replace'](/^\++/,'');const _0xcf1ed7=_0x3a6f0c['split']('+'),_0x17f74d=_0xcf1ed7['length']>0x1?_0xcf1ed7[_0x1e2fc8(0x1c9)]-0x2:0x0,_0x2b62f7=_0xcf1ed7[_0xcf1ed7[_0x1e2fc8(0x1c9)]-0x1]||_0x3a6f0c;return{'level':_0x17f74d,'name':'+'+_0x2b62f7};}function truncateTaskName(_0x523e31,_0x2e6b25){const _0xc9f0b2=stringWidth(_0x523e31);if(_0xc9f0b2<=_0x2e6b25)return _0x523e31;let _0x54a969=_0x523e31;while(stringWidth(_0x54a969+'…')>_0x2e6b25&&_0x54a969['length']>0x0){_0x54a969=_0x54a969['slice'](0x0,-0x1);}return _0x54a969+'…';}function calculateTimeScale(_0x53748e,_0x2a99f2){const _0x1627f6=a60_0x15a404;return{'startTime':_0x53748e[_0x1627f6(0x27c)],'endTime':_0x53748e[_0x1627f6(0x15c)],'durationMs':_0x53748e[_0x1627f6(0x187)],'msPerChar':_0x53748e[_0x1627f6(0x187)]/_0x2a99f2};}function timeToPosition(_0x497310,_0x1e5b76,_0x2c02db){const _0x789609=a60_0x15a404,_0x3f1825=_0x497310-_0x1e5b76[_0x789609(0x22e)],_0x58e83c=Math[_0x789609(0x111)](_0x3f1825/_0x1e5b76[_0x789609(0x259)]);return Math['max'](0x0,Math['min'](_0x58e83c,_0x2c02db));}function renderTimeAxis(_0x49714a,_0x20b4e8){const _0x5ea355=a60_0x15a404,_0x1f5ad7=Math[_0x5ea355(0x19f)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x5ea355(0x130)](TIMELINE_CONFIG[_0x5ea355(0x267)],Math[_0x5ea355(0x111)](_0x20b4e8/TIMELINE_CONFIG[_0x5ea355(0x206)]))),_0x2632ea=_0x49714a[_0x5ea355(0x1bf)]/(_0x1f5ad7-0x1),_0x3878fa=new Date(_0x49714a[_0x5ea355(0x22e)]),_0x10ddc2=[];for(let _0x5037ff=0x0;_0x5037ff<_0x1f5ad7;_0x5037ff++){const _0x2bae1c=_0x49714a[_0x5ea355(0x22e)]+_0x5037ff*_0x2632ea,_0xcea338=timeToPosition(_0x2bae1c,_0x49714a,_0x20b4e8),_0x4e26c0=formatTimestamp(_0x2bae1c,_0x3878fa);_0x10ddc2[_0x5ea355(0x23d)]({'pos':_0xcea338,'text':_0x4e26c0});}const _0x5d5a96=new Array(_0x20b4e8)['fill']('\x20');let _0x5a58fd=-0x1;for(const {pos:_0x262241,text:_0x34ec5a}of _0x10ddc2){let _0x46d7ef=Math['max'](0x0,_0x262241-Math['floor'](_0x34ec5a[_0x5ea355(0x1c9)]/0x2));_0x46d7ef<=_0x5a58fd+TIMELINE_CONFIG[_0x5ea355(0xf9)]&&(_0x46d7ef=_0x5a58fd+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x46d7ef+_0x34ec5a['length']>_0x20b4e8&&(_0x46d7ef=_0x20b4e8-_0x34ec5a[_0x5ea355(0x1c9)]);if(_0x46d7ef>=0x0&&_0x46d7ef+_0x34ec5a[_0x5ea355(0x1c9)]<=_0x20b4e8&&_0x46d7ef>_0x5a58fd){for(let _0x37b9ec=0x0;_0x37b9ec<_0x34ec5a['length'];_0x37b9ec++){_0x5d5a96[_0x46d7ef+_0x37b9ec]=_0x34ec5a[_0x37b9ec];}_0x5a58fd=_0x46d7ef+_0x34ec5a[_0x5ea355(0x1c9)]-0x1;}}return _0x5d5a96[_0x5ea355(0xd7)]('');}function renderTaskRow(_0x4fb41d,_0x439f09,_0x4d42cc,_0x10f368){const _0x1fb0c9=a60_0x15a404,{level:_0x4072b8,name:_0x130797}=parseTaskName(_0x4fb41d['name']),_0x3e5c78='\x20'['repeat'](_0x4072b8),_0x4531c5=_0x4fb41d[_0x1fb0c9(0x1a1)]?'('+formatElapsed(_0x4fb41d[_0x1fb0c9(0x1a1)][_0x1fb0c9(0x187)])+')':'',_0x4d13ab=stringWidth(_0x4531c5),_0x127dda=_0x4072b8*0x1,_0x2d0be1=_0x10f368-_0x127dda-_0x4d13ab-0x1,_0x32f280=truncateTaskName(_0x130797,_0x2d0be1),_0x15c828=_0x3e5c78+_0x32f280,_0x1d2fb3=stringWidth(_0x15c828),_0x322477=_0x10f368-_0x1d2fb3-_0x4d13ab,_0x245b3e=_0x15c828+'\x20'[_0x1fb0c9(0xef)](Math[_0x1fb0c9(0x130)](0x1,_0x322477))+a60_0x174743[_0x1fb0c9(0x1a9)](_0x4531c5),_0x42eecd=getTaskStateIcon(_0x4fb41d[_0x1fb0c9(0x102)]),_0x5895db=new Array(_0x4d42cc)[_0x1fb0c9(0x10b)]('\x20');if(_0x4fb41d['window']){const _0x4e5eb9=timeToPosition(_0x4fb41d['window']['start'],_0x439f09,_0x4d42cc),_0xf4f9dc=timeToPosition(_0x4fb41d['window'][_0x1fb0c9(0x15c)],_0x439f09,_0x4d42cc),_0x1650a5=getBarChar(_0x4fb41d['state']),_0x5232f1=Math[_0x1fb0c9(0x130)](_0x4e5eb9+0x1,_0xf4f9dc);for(let _0x1e7fd7=_0x4e5eb9;_0x1e7fd7<Math[_0x1fb0c9(0x19f)](_0x5232f1,_0x4d42cc);_0x1e7fd7++){_0x5895db[_0x1e7fd7]=_0x1650a5;}}const _0x3ea6a8=getBarColor(_0x4fb41d[_0x1fb0c9(0x102)]),_0x31a6e8=_0x5895db['map'](_0x1915a5=>_0x1915a5==='\x20'?'\x20':_0x3ea6a8(_0x1915a5))[_0x1fb0c9(0xd7)]('');return _0x42eecd+'\x20'+_0x245b3e+'│'+_0x31a6e8+'│';}function calculateStats(_0x502e5a){const _0x17630c=a60_0x15a404,_0x4ce57a={'total':_0x502e5a['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x18387a of _0x502e5a){if(_0x18387a[_0x17630c(0x102)]===_0x17630c(0x24a))_0x4ce57a[_0x17630c(0x24a)]++;else{if(_0x18387a[_0x17630c(0x102)]==='error'||_0x18387a['state']===_0x17630c(0x26e))_0x4ce57a[_0x17630c(0x25d)]++;else _0x18387a[_0x17630c(0x102)]===_0x17630c(0x248)?_0x4ce57a[_0x17630c(0x248)]++:_0x4ce57a['pending']++;}}return _0x4ce57a;}function formatStats(_0x19f35d){const _0x3f8ad2=a60_0x15a404;return[_0x3f8ad2(0x15e)+_0x19f35d[_0x3f8ad2(0x12e)],'✅\x20'+_0x19f35d[_0x3f8ad2(0x24a)],'❌\x20'+_0x19f35d[_0x3f8ad2(0x25d)],_0x3f8ad2(0x22b)+_0x19f35d[_0x3f8ad2(0x248)],'⏳\x20'+_0x19f35d[_0x3f8ad2(0x178)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a60_0x15a404(0x18d)]=a60_0x15a404(0x106);[a60_0x15a404(0x1e2)]=a60_0x15a404(0x1bb);async['execute'](_0x55ffbf){const _0x5a48e7=a60_0x15a404,{options:_0x2dd0bf,args:_0x30d838,tdx:_0xbdb086}=_0x55ffbf;let _0x387b27,_0x32f796,_0x2d5203=![];if(_0x30d838[0x0]){if(_0x30d838[0x0]['includes']('.')){const _0x5dcb5e=this[_0x5a48e7(0x26b)](_0x30d838,_0x2dd0bf);if(!_0x5dcb5e)return 0x1;_0x387b27=_0x5dcb5e['projectName'],_0x32f796=_0x5dcb5e[_0x5a48e7(0x272)];}else{_0x32f796=_0x30d838[0x0],_0x387b27=_0x2dd0bf['workflowProject'];if(!_0x387b27)return console[_0x5a48e7(0x25d)](a60_0x174743[_0x5a48e7(0x156)](_0x5a48e7(0x149)),_0x5a48e7(0x285)),0x1;_0x2d5203=!![];}}else{const _0x3bc418=this[_0x5a48e7(0x26b)](_0x30d838,_0x2dd0bf);if(!_0x3bc418)return 0x1;_0x387b27=_0x3bc418[_0x5a48e7(0x20f)],_0x32f796=_0x3bc418[_0x5a48e7(0x272)];}if(_0x2dd0bf[_0x5a48e7(0x1b0)]){if(_0x387b27&&_0x32f796)console['error']('Filter:\x20'+_0x387b27+'.'+_0x32f796);else _0x387b27&&console['error'](_0x5a48e7(0x105)+_0x387b27);}const _0x5dbda0=_0x2dd0bf['attemptId'],_0x4dda50=_0x2dd0bf['sessionId'];if(_0x5dbda0){_0x4dda50&&console['error'](a60_0x174743[_0x5a48e7(0xf1)](_0x5a48e7(0x195)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x12e1cc=_0x2dd0bf[_0x5a48e7(0x1a8)];return _0x12e1cc?await this[_0x5a48e7(0x27d)](_0x55ffbf,_0x5dbda0):await this[_0x5a48e7(0x239)](_0x55ffbf,_0x5dbda0,_0x2dd0bf),0x0;}if(_0x4dda50){const _0x30b859=await withSpinner(_0x5a48e7(0x1a2),()=>_0xbdb086[_0x5a48e7(0x140)][_0x5a48e7(0x144)]({'projectName':_0x387b27,'workflowName':_0x32f796,'limit':0x64}),{'verbose':_0x2dd0bf[_0x5a48e7(0x1b0)]}),_0x4518f3=_0x30b859[_0x5a48e7(0x12d)]['find'](_0x8d5b8b=>_0x8d5b8b['id']===_0x4dda50);if(!_0x4518f3)return console[_0x5a48e7(0x25d)](a60_0x174743['red'](_0x5a48e7(0x149)),'Session\x20not\x20found:\x20'+_0x4dda50),0x1;if(!_0x4518f3[_0x5a48e7(0x16f)]?.['id'])return console[_0x5a48e7(0x25d)](a60_0x174743[_0x5a48e7(0x156)](_0x5a48e7(0x149)),_0x5a48e7(0x10f)+_0x4dda50+_0x5a48e7(0x262)),0x1;const _0x4fbb9f=_0x4518f3[_0x5a48e7(0x16f)]['id'];_0x2dd0bf[_0x5a48e7(0x1b0)]&&console[_0x5a48e7(0x25d)](_0x5a48e7(0xd9)+_0x4fbb9f+'\x20from\x20session\x20'+_0x4dda50);const _0x383a43=_0x2dd0bf['follow'];return _0x383a43?await this[_0x5a48e7(0x27d)](_0x55ffbf,_0x4fbb9f):await this[_0x5a48e7(0x239)](_0x55ffbf,_0x4fbb9f,_0x2dd0bf),0x0;}const _0x494a51=await withSpinner(_0x5a48e7(0x191),()=>_0xbdb086[_0x5a48e7(0x140)]['sessions']({'projectName':_0x387b27,'workflowName':_0x32f796,'limit':_0x2dd0bf[_0x5a48e7(0x189)]||0x32}),{'verbose':_0x2dd0bf[_0x5a48e7(0x1b0)]}),_0x600e50=_0x494a51[_0x5a48e7(0x12d)];if(_0x600e50['length']===0x0){if(_0x387b27&&_0x32f796)console[_0x5a48e7(0x25d)](_0x5a48e7(0xcf)+_0x387b27+'.'+_0x32f796);else _0x387b27?console['error'](_0x5a48e7(0xde)+_0x387b27):(console['error']('No\x20workflow\x20sessions\x20found'),console[_0x5a48e7(0x25d)](a60_0x174743['dim'](_0x5a48e7(0x284))));return 0x0;}_0x600e50['sort']((_0x36da8a,_0x3babf6)=>{const _0x557f84=_0x36da8a['sessionTime']||'',_0x23ee3e=_0x3babf6['sessionTime']||'';return _0x23ee3e['localeCompare'](_0x557f84);});if(_0x2dd0bf[_0x5a48e7(0x176)]||_0x2dd0bf['jsonl'])return await handleSDKOutput(_0x600e50,_0x2dd0bf),0x0;let _0x5b7a6e;if(_0x2d5203){const _0x4ad6d5=_0x600e50[0x0];if(!_0x4ad6d5['lastAttempt']?.['id'])return console[_0x5a48e7(0x25d)](_0x5a48e7(0x1a5)),0x0;_0x5b7a6e=_0x4ad6d5['lastAttempt']['id'],_0x2dd0bf[_0x5a48e7(0x1b0)]&&console[_0x5a48e7(0x25d)](_0x5a48e7(0x16b)+_0x4ad6d5[_0x5a48e7(0x1cf)]);}else{const _0x5cebb8=_0x600e50[_0x5a48e7(0xed)](_0x1fd473=>{const _0x50b82f=_0x5a48e7,_0x2d3076=getAttemptStatusDisplay(_0x1fd473[_0x50b82f(0x16f)]);return{'title':_0x1fd473['project']?.[_0x50b82f(0x18d)]+'.'+_0x1fd473[_0x50b82f(0x140)]?.[_0x50b82f(0x18d)]+_0x50b82f(0x28a)+_0x1fd473[_0x50b82f(0x1cf)]+'\x20'+_0x2d3076[_0x50b82f(0x1ab)],'value':_0x1fd473[_0x50b82f(0x16f)]?.['id']||'','description':_0x2d3076[_0x50b82f(0xd3)]};}),_0x4b815d=await a60_0x50c7d3({'type':_0x5a48e7(0x296),'name':_0x5a48e7(0x181),'message':_0x5a48e7(0x1b4),'choices':_0x5cebb8[_0x5a48e7(0x23a)](_0x42f699=>_0x42f699['value']!=='')});if(!_0x4b815d[_0x5a48e7(0x181)])return 0x0;_0x5b7a6e=_0x4b815d[_0x5a48e7(0x181)];}const _0xb7b93a=_0x2dd0bf[_0x5a48e7(0x1a8)];return _0xb7b93a?await this[_0x5a48e7(0x27d)](_0x55ffbf,_0x5b7a6e):await this[_0x5a48e7(0x239)](_0x55ffbf,_0x5b7a6e,_0x2dd0bf),0x0;}async[a60_0x15a404(0x239)](_0x24a55e,_0x18fdbf,_0x5b3309){const _0x51297a=a60_0x15a404,{tdx:_0x29d9e2}=_0x24a55e;let _0x3317c8,_0x50a0be;try{[_0x3317c8,_0x50a0be]=await Promise[_0x51297a(0x196)]([_0x29d9e2['workflow'][_0x51297a(0x128)](_0x18fdbf),_0x29d9e2['workflow'][_0x51297a(0xe3)](_0x18fdbf,![])]);}catch(_0x33dd26){console[_0x51297a(0x25d)](a60_0x174743[_0x51297a(0x156)](_0x51297a(0x25c)));_0x5b3309['verbose']&&console[_0x51297a(0x25d)](_0x33dd26);throw _0x33dd26;}if(_0x5b3309['json']||_0x5b3309[_0x51297a(0xeb)]){const _0x1e5b4c=this[_0x51297a(0x177)](_0x3317c8,_0x50a0be);await handleSDKOutput([_0x1e5b4c],_0x5b3309);return;}const _0x420326=_0x29d9e2[_0x51297a(0x18f)][_0x51297a(0x18e)],_0x4f298b=this[_0x51297a(0x235)](_0x3317c8,_0x50a0be,_0x420326);console[_0x51297a(0x172)](_0x4f298b);}async[a60_0x15a404(0x27d)](_0x285ff1,_0xb61fb6){const _0x14f14b=a60_0x15a404,{tdx:_0x47afa8}=_0x285ff1,_0x15b651=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x36a4df=TIMELINE_CONFIG[_0x14f14b(0x247)];let _0x39f942=0x0;while(_0x39f942<_0x36a4df){process[_0x14f14b(0x218)][_0x14f14b(0x165)]&&process['stdout']['write']('\x1Bc');let _0xaa3f86,_0x2ebec1;try{[_0xaa3f86,_0x2ebec1]=await Promise[_0x14f14b(0x196)]([_0x47afa8[_0x14f14b(0x140)][_0x14f14b(0x128)](_0xb61fb6),_0x47afa8[_0x14f14b(0x140)]['tasks'](_0xb61fb6,![])]);}catch(_0x456234){console[_0x14f14b(0x25d)](a60_0x174743['red'](_0x14f14b(0x17d)));_0x39f942>0x0&&console[_0x14f14b(0x25d)](a60_0x174743[_0x14f14b(0x1a9)](_0x14f14b(0x15d)+_0x39f942));throw _0x456234;}const _0x3d2ce7=_0x47afa8[_0x14f14b(0x18f)][_0x14f14b(0x18e)],_0x26fff2=this[_0x14f14b(0x235)](_0xaa3f86,_0x2ebec1,_0x3d2ce7);console[_0x14f14b(0x172)](_0x26fff2);const _0xece0cc=_0xaa3f86[_0x14f14b(0x1f7)]&&_0x2ebec1[_0x14f14b(0x14f)](_0x4df2e5=>_0x4df2e5['state']!==_0x14f14b(0x248)&&_0x4df2e5[_0x14f14b(0x102)]!==_0x14f14b(0x1b5));if(_0xece0cc){console[_0x14f14b(0x25d)](a60_0x174743[_0x14f14b(0x234)](_0x14f14b(0x205)));break;}console[_0x14f14b(0x25d)](a60_0x174743[_0x14f14b(0x1a9)](_0x14f14b(0xe1)+_0x39f942*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x4c8c3d=>setTimeout(_0x4c8c3d,_0x15b651)),_0x39f942++;}_0x39f942>=_0x36a4df&&console['error'](a60_0x174743[_0x14f14b(0xf1)](_0x14f14b(0x24d)));}[a60_0x15a404(0x235)](_0x227035,_0x5ad763,_0x2b17b2){const _0x2fe00c=a60_0x15a404,_0x2eed38=[],_0x1d5476=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x5afb2e=0x5,_0x3acbe4=process[_0x2fe00c(0x218)][_0x2fe00c(0x24b)]||0x78,_0x38d42e=_0x3acbe4-_0x1d5476-_0x5afb2e,_0x55d2ec=Math[_0x2fe00c(0x130)](TIMELINE_CONFIG[_0x2fe00c(0x222)],Math[_0x2fe00c(0x19f)](_0x38d42e,TIMELINE_CONFIG[_0x2fe00c(0x20b)])),_0x1ba252=new Date(_0x227035[_0x2fe00c(0x1b1)])[_0x2fe00c(0x1de)](),_0x3b3b3d=_0x227035[_0x2fe00c(0x20d)]?new Date(_0x227035['finishedAt'])['getTime']():Date['now'](),_0x8e3b3a={'start':_0x1ba252,'end':_0x3b3b3d,'duration':_0x3b3b3d-_0x1ba252},_0x539354=new Map(),_0x2e7a76=[];for(const _0xf9b8c5 of _0x5ad763){if(_0xf9b8c5[_0x2fe00c(0x183)]){const _0x138f80=new Date(_0xf9b8c5['startedAt'])[_0x2fe00c(0x1de)](),_0x36fe44=_0xf9b8c5[_0x2fe00c(0x1e1)]?new Date(_0xf9b8c5['updatedAt'])[_0x2fe00c(0x1de)]():Date['now'](),_0x47af4f={'start':_0x138f80,'end':_0x36fe44,'duration':_0x36fe44-_0x138f80};_0x539354[_0x2fe00c(0x125)](_0xf9b8c5['id'],_0x47af4f),_0x2e7a76[_0x2fe00c(0x23d)]({'name':_0xf9b8c5[_0x2fe00c(0x25a)],'state':_0xf9b8c5['state']||_0x2fe00c(0x14a),'window':_0x47af4f});}else _0x2e7a76[_0x2fe00c(0x23d)]({'name':_0xf9b8c5['fullName'],'state':_0xf9b8c5[_0x2fe00c(0x102)]||_0x2fe00c(0x1b5),'window':undefined});}_0x2e7a76[_0x2fe00c(0x175)]((_0x16521b,_0x2bcba3)=>{const _0x3bf186=_0x2fe00c;if(!_0x16521b[_0x3bf186(0x1a1)])return 0x1;if(!_0x2bcba3[_0x3bf186(0x1a1)])return-0x1;return _0x16521b[_0x3bf186(0x1a1)][_0x3bf186(0x27c)]-_0x2bcba3['window'][_0x3bf186(0x27c)];});const _0x15df43=_0x2e7a76['length'],_0x41f019=_0x15df43>TIMELINE_CONFIG[_0x2fe00c(0x278)];_0x41f019&&_0x2e7a76[_0x2fe00c(0x162)](TIMELINE_CONFIG[_0x2fe00c(0x278)]);const _0x53abb7=calculateTimeScale(_0x8e3b3a,_0x55d2ec),_0x620395=_0x227035[_0x2fe00c(0x1f7)]?_0x227035[_0x2fe00c(0x24a)]?a60_0x174743[_0x2fe00c(0x234)]('success'):a60_0x174743[_0x2fe00c(0x156)](_0x2fe00c(0x25d)):a60_0x174743[_0x2fe00c(0x21c)](_0x2fe00c(0x248)),_0x117840=_0x227035[_0x2fe00c(0x148)]?.['id'],_0x5ab83f=_0x227035[_0x2fe00c(0x1d2)];let _0x4698d9;if(_0x117840&&_0x5ab83f){const _0x15ddb3=getWorkflowAttemptUrl(_0x2b17b2,_0x117840,_0x5ab83f,_0x227035['id']);_0x4698d9=hyperlink(a60_0x174743[_0x2fe00c(0x1a9)](_0x227035['id']),_0x15ddb3);}else _0x4698d9=a60_0x174743['dim'](_0x227035['id']);_0x2eed38[_0x2fe00c(0x23d)]('Attempt:\x20'+_0x4698d9+_0x2fe00c(0x28a)+_0x620395+'\x20-\x20'+formatElapsed(_0x8e3b3a[_0x2fe00c(0x187)]));if(_0x2e7a76[_0x2fe00c(0x1c9)]>0x0){const _0x5f0bd6=renderTimeAxis(_0x53abb7,_0x55d2ec),_0x4353be=new Date(_0x8e3b3a[_0x2fe00c(0x27c)]),_0x3bac4a=formatDate(_0x4353be),_0x4c755d=TIMELINE_CONFIG[_0x2fe00c(0x240)]+TIMELINE_CONFIG[_0x2fe00c(0x154)]+_0x1d5476,_0x3675d1=_0x3bac4a[_0x2fe00c(0x120)](_0x4c755d),_0x5c8a7b=a60_0x174743['dim'](_0x3675d1);_0x2eed38[_0x2fe00c(0x23d)](_0x5c8a7b+'\x20'+_0x5f0bd6);for(const _0x3931fe of _0x2e7a76){_0x2eed38[_0x2fe00c(0x23d)](renderTaskRow(_0x3931fe,_0x53abb7,_0x55d2ec,_0x1d5476));}const _0x47ae09=calculateStats(_0x2e7a76);_0x2eed38[_0x2fe00c(0x23d)](formatStats(_0x47ae09)),_0x41f019&&_0x2eed38['push'](a60_0x174743['yellow'](_0x2fe00c(0x103)+TIMELINE_CONFIG[_0x2fe00c(0x278)]+'\x20of\x20'+_0x15df43+_0x2fe00c(0x1a7))),_0x2eed38[_0x2fe00c(0x23d)](''),_0x2eed38[_0x2fe00c(0x23d)](a60_0x174743[_0x2fe00c(0x1a9)](_0x2fe00c(0x201))+(_0x2fe00c(0x228)+_0x227035['id']+'\x20logs')+a60_0x174743[_0x2fe00c(0x1a9)](_0x2fe00c(0x16a)));}else _0x2eed38[_0x2fe00c(0x23d)](_0x2fe00c(0xd5));return _0x2eed38[_0x2fe00c(0xd7)]('\x0a');}[a60_0x15a404(0x177)](_0x2fdf1c,_0x314511){const _0xd974ce=a60_0x15a404,_0x11957e=new Date(_0x2fdf1c['createdAt'])[_0xd974ce(0x1de)](),_0x11a2a9=_0x2fdf1c[_0xd974ce(0x20d)]?new Date(_0x2fdf1c[_0xd974ce(0x20d)])[_0xd974ce(0x1de)]():Date[_0xd974ce(0x1e9)](),_0x4ea03a=_0x11a2a9-_0x11957e,_0x3a97bc=[];for(const _0x5cfd85 of _0x314511){if(_0x5cfd85['startedAt']){const _0x1e104a=new Date(_0x5cfd85[_0xd974ce(0x183)])[_0xd974ce(0x1de)](),_0x546c1d=_0x5cfd85[_0xd974ce(0x1e1)]?new Date(_0x5cfd85[_0xd974ce(0x1e1)])[_0xd974ce(0x1de)]():Date[_0xd974ce(0x1e9)]();_0x3a97bc[_0xd974ce(0x23d)]({'name':_0x5cfd85[_0xd974ce(0x25a)],'state':_0x5cfd85[_0xd974ce(0x102)]||_0xd974ce(0x14a),'window':{'start':_0x1e104a,'end':_0x546c1d,'duration':_0x546c1d-_0x1e104a}});}else _0x3a97bc[_0xd974ce(0x23d)]({'name':_0x5cfd85[_0xd974ce(0x25a)],'state':_0x5cfd85[_0xd974ce(0x102)]||_0xd974ce(0x1b5),'window':undefined});}const _0x1068ed=calculateStats(_0x3a97bc);return{'attempt':{'id':_0x2fdf1c['id'],'status':_0x2fdf1c[_0xd974ce(0x1f7)]?_0x2fdf1c['success']?_0xd974ce(0x24a):_0xd974ce(0x25d):_0xd974ce(0x248),'createdAt':_0x2fdf1c[_0xd974ce(0x1b1)],'finishedAt':_0x2fdf1c['finishedAt'],'duration_ms':_0x4ea03a},'tasks':_0x3a97bc[_0xd974ce(0xed)](_0x9536d2=>({'name':_0x9536d2[_0xd974ce(0x18d)],'state':_0x9536d2[_0xd974ce(0x102)],'startedAt':_0x9536d2['window']?new Date(_0x9536d2['window'][_0xd974ce(0x27c)])[_0xd974ce(0x230)]():null,'updatedAt':_0x9536d2[_0xd974ce(0x1a1)]?new Date(_0x9536d2['window'][_0xd974ce(0x15c)])['toISOString']():null,'duration_ms':_0x9536d2[_0xd974ce(0x1a1)]?.[_0xd974ce(0x187)]||null})),'stats':_0x1068ed};}}function formatScheduleLine(_0x37a0ac){const _0x3fe244=a60_0x15a404,_0x16740=_0x37a0ac['disabledAt']?a60_0x174743['yellow'](_0x3fe244(0x1aa)):'',_0x5c152d=_0x37a0ac['project']?.[_0x3fe244(0x18d)]?a60_0x174743['dim']('\x20['+_0x37a0ac[_0x3fe244(0x148)][_0x3fe244(0x18d)]+']'):'',_0x5a6fa5=_0x37a0ac[_0x3fe244(0x1bc)]?a60_0x174743['dim']('\x20next:\x20'+new Date(_0x37a0ac[_0x3fe244(0x1bc)])[_0x3fe244(0xdb)]()):'';return _0x3fe244(0x138)+_0x37a0ac['id']+'\x20'+(_0x37a0ac[_0x3fe244(0x140)]?.['name']||'(unknown)')+_0x5c152d+_0x16740+_0x5a6fa5;}export class WorkflowSchedulesCommand extends WorkflowBaseCommand{[a60_0x15a404(0x18d)]=a60_0x15a404(0x265);[a60_0x15a404(0x1e2)]=a60_0x15a404(0x266);async[a60_0x15a404(0x1f0)](_0x12f565){const _0x261db8=a60_0x15a404,{options:_0x40bf0c,args:_0x149810,tdx:_0x4d81a2}=_0x12f565,{scheduleId:_0x281be2}=_0x40bf0c;if(_0x281be2&&_0x149810[0x0])return console[_0x261db8(0x25d)](a60_0x174743[_0x261db8(0x156)]('Error:'),_0x261db8(0x19a)),console['error'](a60_0x174743[_0x261db8(0x1a9)]('Usage:\x20tdx\x20wf\x20schedule\x20list\x20[project[.workflow]]\x20|\x20--schedule-id\x20<id>')),0x1;if(_0x281be2){const _0x2f8884=await withSpinner(_0x261db8(0x28f)+_0x281be2+_0x261db8(0x215),()=>_0x4d81a2[_0x261db8(0x140)][_0x261db8(0x129)](_0x281be2),{'verbose':_0x40bf0c[_0x261db8(0x1b0)]}),_0x2ebd55=_0x2f8884[_0x261db8(0x12d)];return isStructuredFormat(_0x40bf0c)?await handleSingleObjectOutput(_0x2ebd55,_0x40bf0c):(console[_0x261db8(0x25d)]('✔\x20Schedule\x20found'),console[_0x261db8(0x172)](formatScheduleLine(_0x2ebd55))),0x0;}const _0x57ff7e=this[_0x261db8(0x26b)](_0x149810,_0x40bf0c);if(!_0x57ff7e)return 0x1;const {projectName:_0x40717a,workflowName:_0x580b7e}=_0x57ff7e,_0x40206d=_0x40717a?'\x27'+_0x40717a+(_0x580b7e?'.'+_0x580b7e:'')+'\x27':undefined,_0x411ea3=await withSpinner(_0x40206d?_0x261db8(0x155)+_0x40206d+_0x261db8(0x215):_0x261db8(0x24e),()=>_0x40717a?_0x4d81a2[_0x261db8(0x140)]['listProjectSchedules'](_0x40717a,{'workflow':_0x580b7e,'limit':_0x40bf0c[_0x261db8(0x189)]}):_0x4d81a2[_0x261db8(0x140)]['listSchedules']({'limit':_0x40bf0c[_0x261db8(0x189)]}),{'verbose':_0x40bf0c[_0x261db8(0x1b0)]}),_0x121b99=_0x411ea3[_0x261db8(0x12d)],_0x2aedac=_0x40bf0c[_0x261db8(0x189)]&&_0x121b99[_0x261db8(0x1c9)]>=_0x40bf0c[_0x261db8(0x189)]?a60_0x174743[_0x261db8(0x1a9)]('\x20(use\x20a\x20larger\x20--limit\x20to\x20show\x20more)'):'';console[_0x261db8(0x25d)]('✔\x20Found\x20'+_0x121b99['length']+_0x261db8(0x220)+(_0x121b99[_0x261db8(0x1c9)]!==0x1?'s':'')+_0x2aedac);if(isStructuredFormat(_0x40bf0c))await handleSDKOutput(_0x121b99,_0x40bf0c);else{if(_0x121b99[_0x261db8(0x1c9)]===0x0)console[_0x261db8(0x172)](_0x261db8(0x17e));else for(const _0x217588 of _0x121b99){console['log'](formatScheduleLine(_0x217588));}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{['name']=a60_0x15a404(0x242);[a60_0x15a404(0x1e2)]=a60_0x15a404(0x25b);async[a60_0x15a404(0x1f0)](_0x4e11d7){const _0x503bed=a60_0x15a404,{options:_0x4394d4,args:_0x514e1a,tdx:_0x50d48e}=_0x4e11d7,_0x1edc36=_0x514e1a[0x0];if(!_0x1edc36)return console['error'](a60_0x174743[_0x503bed(0x156)](_0x503bed(0x149)),_0x503bed(0x1f8)),console[_0x503bed(0x25d)](a60_0x174743[_0x503bed(0x1a9)](_0x503bed(0x294))),console[_0x503bed(0x25d)](a60_0x174743[_0x503bed(0x1a9)](_0x503bed(0x27e))),0x1;const {backfill:_0x32a7b9,nextTime:_0x77f024}=_0x4394d4,_0x35fd2d={};if(_0x32a7b9!==undefined)_0x35fd2d['skipSchedule']=!_0x32a7b9;if(_0x77f024!==undefined)_0x35fd2d[_0x503bed(0x216)]=_0x77f024;const _0x35d587=await withSpinner(_0x503bed(0x1fe)+_0x1edc36+'...',()=>_0x50d48e[_0x503bed(0x140)]['enableSchedule'](_0x1edc36,_0x35fd2d),{'verbose':_0x4394d4[_0x503bed(0x1b0)]}),_0x4dda25=_0x35d587[_0x503bed(0x12d)];return isStructuredFormat(_0x4394d4)?await handleSingleObjectOutput(_0x4dda25,_0x4394d4):(console[_0x503bed(0x172)]('✔\x20Schedule\x20#'+_0x1edc36+_0x503bed(0x1b6)+(_0x4dda25[_0x503bed(0x140)]?.[_0x503bed(0x18d)]||'unknown')+')'),_0x4dda25['nextRunTime']&&console[_0x503bed(0x172)](a60_0x174743[_0x503bed(0x1a9)]('\x20\x20Next\x20run:\x20'+new Date(_0x4dda25[_0x503bed(0x1bc)])['toLocaleString']()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{['name']=a60_0x15a404(0x22a);['description']=a60_0x15a404(0x251);async['execute'](_0x132f86){const _0x5edbc9=a60_0x15a404,{options:_0x196921,args:_0x203f23,tdx:_0x10edb8}=_0x132f86,_0x4f1a2c=_0x203f23[0x0];if(!_0x4f1a2c)return console[_0x5edbc9(0x25d)](a60_0x174743[_0x5edbc9(0x156)](_0x5edbc9(0x149)),_0x5edbc9(0x1f8)),console['error'](a60_0x174743[_0x5edbc9(0x1a9)]('Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>')),console[_0x5edbc9(0x25d)](a60_0x174743[_0x5edbc9(0x1a9)](_0x5edbc9(0x27e))),0x1;const _0x31384a=await withSpinner(_0x5edbc9(0x221)+_0x4f1a2c+_0x5edbc9(0x215),()=>_0x10edb8[_0x5edbc9(0x140)][_0x5edbc9(0x1ef)](_0x4f1a2c),{'verbose':_0x196921[_0x5edbc9(0x1b0)]}),_0x99b35e=_0x31384a[_0x5edbc9(0x12d)];return isStructuredFormat(_0x196921)?await handleSingleObjectOutput(_0x99b35e,_0x196921):console[_0x5edbc9(0x172)](_0x5edbc9(0x28e)+_0x4f1a2c+_0x5edbc9(0x252)+(_0x99b35e['workflow']?.[_0x5edbc9(0x18d)]||'unknown')+')'),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- function a61_0x47b2(){const _0x12dcf3=['6140250UJoVkN','315235eXvZmW','920492UILpiL','4974ygMCxR','tdx/','382rtgGuZ','98CowpIz','TD1\x20','5036904eQtjqb','X-Trino-User',';\x20node/','5NPnPbz','25200520LaudCJ','Authorization','451336iSZVBl','Bearer\x20','replace','entries','tdx'];a61_0x47b2=function(){return _0x12dcf3;};return a61_0x47b2();}(function(_0x13ac9e,_0x1fc44c){const _0x35fb55=a61_0x3a9c,_0x2f5059=_0x13ac9e();while(!![]){try{const _0x37936f=parseInt(_0x35fb55(0x15a))/0x1+parseInt(_0x35fb55(0x15e))/0x2*(parseInt(_0x35fb55(0x15c))/0x3)+parseInt(_0x35fb55(0x15b))/0x4*(-parseInt(_0x35fb55(0x151))/0x5)+-parseInt(_0x35fb55(0x159))/0x6+parseInt(_0x35fb55(0x14c))/0x7*(-parseInt(_0x35fb55(0x154))/0x8)+-parseInt(_0x35fb55(0x14e))/0x9+parseInt(_0x35fb55(0x152))/0xa;if(_0x37936f===_0x1fc44c)break;else _0x2f5059['push'](_0x2f5059['shift']());}catch(_0x11bfff){_0x2f5059['push'](_0x2f5059['shift']());}}}(a61_0x47b2,0x8606d));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';function a61_0x3a9c(_0x22c18a,_0x460ba9){_0x22c18a=_0x22c18a-0x14c;const _0x47b2d9=a61_0x47b2();let _0x3a9c02=_0x47b2d9[_0x22c18a];return _0x3a9c02;}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x45e98d=a61_0x3a9c,_0x1b9e9c=getVersion(),_0x41e7ba=platform(),_0x992984=process['version'][_0x45e98d(0x156)]('v','');return _0x45e98d(0x15d)+_0x1b9e9c+'\x20('+_0x41e7ba+_0x45e98d(0x150)+_0x992984+')';}export function getAuthHeaders(_0x873eff,_0x1e1c74,_0x1875ae){const _0x45c0c4=a61_0x3a9c,_0x4d6b70=getVersion(),_0x59d12c={'User-Agent':getUserAgent(),'X-TD-Client':_0x45c0c4(0x158),'X-TD-Client-Version':_0x4d6b70};if(_0x1875ae)_0x59d12c[_0x45c0c4(0x153)]=_0x45c0c4(0x155)+_0x1875ae;else _0x1e1c74&&(_0x59d12c[_0x45c0c4(0x153)]=_0x45c0c4(0x14d)+_0x1e1c74);return _0x59d12c;}export function toHeaderRecord(_0x5eebde){const _0x34f4c9=a61_0x3a9c,_0x3a928b={};for(const [_0x2ecf9f,_0x1b0c72]of Object[_0x34f4c9(0x157)](_0x5eebde)){_0x1b0c72!==undefined&&(_0x3a928b[_0x2ecf9f]=_0x1b0c72);}return _0x3a928b;}export function getTrinoHeaders(_0xde1b41,_0x2e3943,_0x54f71b){const _0x415fc0=a61_0x3a9c,_0x4db2de=getAuthHeaders(_0xde1b41),_0x20b012=toHeaderRecord(_0x4db2de);if(_0x54f71b)_0x20b012[_0x415fc0(0x153)]=_0x415fc0(0x155)+_0x54f71b;else _0x2e3943&&(_0x20b012[_0x415fc0(0x14f)]=_0x2e3943);return _0x20b012;}export function hasAPIKey(_0x41cc3b){const _0x35568a=getAPIKey();return _0x35568a!==undefined&&_0x35568a['length']>0x0;}
1
+ (function(_0x359f68,_0x4bdccb){const _0x16691a=a61_0x1aa1,_0x1568cd=_0x359f68();while(!![]){try{const _0xbd3c9b=parseInt(_0x16691a(0xe4))/0x1*(-parseInt(_0x16691a(0xdf))/0x2)+parseInt(_0x16691a(0xe1))/0x3+-parseInt(_0x16691a(0xd8))/0x4+-parseInt(_0x16691a(0xdc))/0x5*(-parseInt(_0x16691a(0xde))/0x6)+-parseInt(_0x16691a(0xda))/0x7+-parseInt(_0x16691a(0xd3))/0x8*(-parseInt(_0x16691a(0xdb))/0x9)+parseInt(_0x16691a(0xdd))/0xa*(parseInt(_0x16691a(0xd9))/0xb);if(_0xbd3c9b===_0x4bdccb)break;else _0x1568cd['push'](_0x1568cd['shift']());}catch(_0x19ec43){_0x1568cd['push'](_0x1568cd['shift']());}}}(a61_0x173f,0x7b808));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x30dfd6=a61_0x1aa1,_0x506593=getVersion(),_0x2f8840=platform(),_0x1594db=process[_0x30dfd6(0xd4)][_0x30dfd6(0xd5)]('v','');return _0x30dfd6(0xe0)+_0x506593+'\x20('+_0x2f8840+_0x30dfd6(0xe5)+_0x1594db+')';}export function getAuthHeaders(_0x527e73,_0x518b57,_0x231f87){const _0x3db605=a61_0x1aa1,_0x1e0a8d=getVersion(),_0x1a8679={'User-Agent':getUserAgent(),'X-TD-Client':_0x3db605(0xe3),'X-TD-Client-Version':_0x1e0a8d};if(_0x231f87)_0x1a8679[_0x3db605(0xe2)]='Bearer\x20'+_0x231f87;else _0x518b57&&(_0x1a8679[_0x3db605(0xe2)]=_0x3db605(0xd2)+_0x518b57);return _0x1a8679;}function a61_0x173f(){const _0x55a3b8=['replace','length','Bearer\x20','1762244dVUYns','11TZyfZC','5874638KPwlHy','7353lAyFwr','5DEGwCZ','11837090JdzWAA','193302bEwXpj','9596yhTRLC','tdx/','1680945eicxdV','Authorization','tdx','12jFjETa',';\x20node/','TD1\x20','656USLehl','version'];a61_0x173f=function(){return _0x55a3b8;};return a61_0x173f();}export function toHeaderRecord(_0x5afbc3){const _0x425525={};for(const [_0x4e07da,_0xe4a939]of Object['entries'](_0x5afbc3)){_0xe4a939!==undefined&&(_0x425525[_0x4e07da]=_0xe4a939);}return _0x425525;}export function getTrinoHeaders(_0x58821a,_0x1df33e,_0x22a1a0){const _0x5d1edf=a61_0x1aa1,_0xbcc4fa=getAuthHeaders(_0x58821a),_0x284f9c=toHeaderRecord(_0xbcc4fa);if(_0x22a1a0)_0x284f9c[_0x5d1edf(0xe2)]=_0x5d1edf(0xd7)+_0x22a1a0;else _0x1df33e&&(_0x284f9c['X-Trino-User']=_0x1df33e);return _0x284f9c;}function a61_0x1aa1(_0x521da8,_0x4d1487){_0x521da8=_0x521da8-0xd2;const _0x173f8b=a61_0x173f();let _0x1aa1e3=_0x173f8b[_0x521da8];return _0x1aa1e3;}export function hasAPIKey(_0x4ecb6a){const _0x34762c=a61_0x1aa1,_0xead009=getAPIKey();return _0xead009!==undefined&&_0xead009[_0x34762c(0xd6)]>0x0;}