@treasuredata/tdx 2026.8.1 → 2026.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) 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.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/engage-template-pull-command.js +1 -1
  29. package/dist/commands/engage-template-push-command.js +1 -1
  30. package/dist/commands/engage-template-validate-command.js +1 -1
  31. package/dist/commands/job-command.js +1 -1
  32. package/dist/commands/journey-command.js +1 -1
  33. package/dist/commands/journey-validate-command.js +1 -1
  34. package/dist/commands/llm-command.js +1 -1
  35. package/dist/commands/mcp-command.js +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/policy-command.js +1 -1
  38. package/dist/commands/profile-command.js +1 -1
  39. package/dist/commands/profiles-command.js +1 -1
  40. package/dist/commands/query-command.js +1 -1
  41. package/dist/commands/schedule-command.js +1 -1
  42. package/dist/commands/segment-command.js +1 -1
  43. package/dist/commands/segment-create-command.js +1 -1
  44. package/dist/commands/segment-fields-command.js +1 -1
  45. package/dist/commands/segment-move-command.js +1 -1
  46. package/dist/commands/segment-pull-command.js +1 -1
  47. package/dist/commands/segment-push-command.js +1 -1
  48. package/dist/commands/segment-update-command.js +1 -1
  49. package/dist/commands/segment-use-command.js +1 -1
  50. package/dist/commands/segment-validate-command.js +1 -1
  51. package/dist/commands/segments.js +1 -1
  52. package/dist/commands/show.js +1 -1
  53. package/dist/commands/status-command.js +1 -1
  54. package/dist/commands/table-deleted.js +1 -1
  55. package/dist/commands/tables.js +1 -1
  56. package/dist/commands/unset-command.js +1 -1
  57. package/dist/commands/upgrade-command.js +1 -1
  58. package/dist/commands/use-command.js +1 -1
  59. package/dist/commands/user-command.js +1 -1
  60. package/dist/commands/work-command.js +1 -1
  61. package/dist/commands/workflow-command.js +1 -1
  62. package/dist/core/auth.js +1 -1
  63. package/dist/core/command-output.js +1 -1
  64. package/dist/core/config.js +1 -1
  65. package/dist/core/connection-cache.js +1 -1
  66. package/dist/core/constants.js +1 -1
  67. package/dist/core/credential-cache.js +1 -1
  68. package/dist/core/global-context.js +1 -1
  69. package/dist/core/keychain.js +1 -1
  70. package/dist/core/oauth-keychain.js +1 -1
  71. package/dist/core/oauth.js +1 -1
  72. package/dist/core/profile.js +1 -1
  73. package/dist/core/project-config.js +1 -1
  74. package/dist/core/session.js +1 -1
  75. package/dist/core/site-mismatch.js +1 -1
  76. package/dist/core/user-cache.js +1 -1
  77. package/dist/core/version.js +1 -1
  78. package/dist/index.js +1 -1
  79. package/dist/mcp/server.js +1 -1
  80. package/dist/mcp/tools/index.js +1 -1
  81. package/dist/mcp/tools/tdx-run.js +1 -1
  82. package/dist/mcp/tools/tdx-search.js +1 -1
  83. package/dist/mcp/tools/work-create-item.js +1 -1
  84. package/dist/mcp/utils.js +1 -1
  85. package/dist/proxy/claude-usage-tracker.js +1 -1
  86. package/dist/proxy/passthrough-server.js +1 -1
  87. package/dist/proxy/sse-usage-parser.js +1 -1
  88. package/dist/sdk/agent/agent-config.js +1 -1
  89. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  90. package/dist/sdk/agent/agent-yaml.js +1 -1
  91. package/dist/sdk/agent/test/evaluator.js +1 -1
  92. package/dist/sdk/agent/test/executor.js +1 -1
  93. package/dist/sdk/agent/test/index.js +1 -1
  94. package/dist/sdk/agent/test/output.js +1 -1
  95. package/dist/sdk/agent/test/parser.js +1 -1
  96. package/dist/sdk/agent/tool-target-registry.js +1 -1
  97. package/dist/sdk/api.js +1 -1
  98. package/dist/sdk/auth-token.js +1 -1
  99. package/dist/sdk/cas/cas-api-client.js +1 -1
  100. package/dist/sdk/cas/cas-audience-schema.d.ts +2 -0
  101. package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -1
  102. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  103. package/dist/sdk/cas/cas-audience-schema.js.map +1 -1
  104. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  105. package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
  106. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  107. package/dist/sdk/cas/cas-audience-yaml.js.map +1 -1
  108. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  109. package/dist/sdk/cas/index.js +1 -1
  110. package/dist/sdk/cas/pull-workflow.js +1 -1
  111. package/dist/sdk/cas/push-workflow.d.ts.map +1 -1
  112. package/dist/sdk/cas/push-workflow.js +1 -1
  113. package/dist/sdk/cas/push-workflow.js.map +1 -1
  114. package/dist/sdk/cas/types.d.ts +2 -0
  115. package/dist/sdk/cas/types.d.ts.map +1 -1
  116. package/dist/sdk/cas/validate-files.js +1 -1
  117. package/dist/sdk/client/cdp-api-client.js +1 -1
  118. package/dist/sdk/client/delivery-api-client.js +1 -1
  119. package/dist/sdk/client/endpoints.js +1 -1
  120. package/dist/sdk/client/engage-api-client.js +1 -1
  121. package/dist/sdk/client/http-client.js +1 -1
  122. package/dist/sdk/client/llm-api-client.js +1 -1
  123. package/dist/sdk/client/oauth-refresh.js +1 -1
  124. package/dist/sdk/client/rate-limiter.js +1 -1
  125. package/dist/sdk/client/td-api-client.js +1 -1
  126. package/dist/sdk/client/trino-api-client.js +1 -1
  127. package/dist/sdk/client/workflow-client.js +1 -1
  128. package/dist/sdk/connection-validator.js +1 -1
  129. package/dist/sdk/connection.js +1 -1
  130. package/dist/sdk/delivery.js +1 -1
  131. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  132. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  133. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  134. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  135. package/dist/sdk/engage/campaign-pull.js +1 -1
  136. package/dist/sdk/engage/campaign-push.js +1 -1
  137. package/dist/sdk/engage/campaign-validator.js +1 -1
  138. package/dist/sdk/engage/campaign-yaml.js +1 -1
  139. package/dist/sdk/engage/template-pull.js +1 -1
  140. package/dist/sdk/engage/template-push.js +1 -1
  141. package/dist/sdk/engage/template-validator.js +1 -1
  142. package/dist/sdk/engage/template-yaml.js +1 -1
  143. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  144. package/dist/sdk/engage/types/campaign-def.js +1 -1
  145. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  146. package/dist/sdk/engage/types/template-schema.js +1 -1
  147. package/dist/sdk/engage.js +1 -1
  148. package/dist/sdk/errors.js +1 -1
  149. package/dist/sdk/index.js +1 -1
  150. package/dist/sdk/io/index.js +1 -1
  151. package/dist/sdk/io/node-filesystem.js +1 -1
  152. package/dist/sdk/job.js +1 -1
  153. package/dist/sdk/journey.js +1 -1
  154. package/dist/sdk/llm/chat-cache.js +1 -1
  155. package/dist/sdk/llm/index.js +1 -1
  156. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  157. package/dist/sdk/llm/model-factors.js +1 -1
  158. package/dist/sdk/llm/user-settings.js +1 -1
  159. package/dist/sdk/personalization.js +1 -1
  160. package/dist/sdk/policy.js +1 -1
  161. package/dist/sdk/query/deleted-table-validation.js +1 -1
  162. package/dist/sdk/query/index.js +1 -1
  163. package/dist/sdk/query/sql-parser.js +1 -1
  164. package/dist/sdk/realtime.js +1 -1
  165. package/dist/sdk/schedule.js +1 -1
  166. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  167. package/dist/sdk/segment/fields-display.js +1 -1
  168. package/dist/sdk/segment/file-discovery.js +1 -1
  169. package/dist/sdk/segment/journey-utils.js +1 -1
  170. package/dist/sdk/segment/journey-validator.js +1 -1
  171. package/dist/sdk/segment/journey-yaml.js +1 -1
  172. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  173. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  174. package/dist/sdk/segment/pull-workflow.js +1 -1
  175. package/dist/sdk/segment/push-recovery.js +1 -1
  176. package/dist/sdk/segment/push-workflow.js +1 -1
  177. package/dist/sdk/segment/resolution-context.js +1 -1
  178. package/dist/sdk/segment/segment-path-parser.js +1 -1
  179. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  180. package/dist/sdk/segment/segment-validator.js +1 -1
  181. package/dist/sdk/segment/target-resolution.js +1 -1
  182. package/dist/sdk/segment/tdx-config.js +1 -1
  183. package/dist/sdk/segment/types/activation-schema.js +1 -1
  184. package/dist/sdk/segment/types/journey-def.js +1 -1
  185. package/dist/sdk/segment/types/journey-schema.js +1 -1
  186. package/dist/sdk/segment/types/segment-def.js +1 -1
  187. package/dist/sdk/segment/types/segment-schema.js +1 -1
  188. package/dist/sdk/segment/validate-files.js +1 -1
  189. package/dist/sdk/segment/yaml-validator.js +1 -1
  190. package/dist/sdk/segment.js +1 -1
  191. package/dist/sdk/types/cas.d.ts +4 -0
  192. package/dist/sdk/types/cas.d.ts.map +1 -1
  193. package/dist/sdk/types/index.js +1 -1
  194. package/dist/sdk/types/progress.js +1 -1
  195. package/dist/sdk/types/workspace.js +1 -1
  196. package/dist/sdk/user.js +1 -1
  197. package/dist/sdk/util/format-detector.js +1 -1
  198. package/dist/sdk/util/formatters.js +1 -1
  199. package/dist/sdk/util/index.js +1 -1
  200. package/dist/sdk/util/paginate.js +1 -1
  201. package/dist/sdk/util/tree-formatter.js +1 -1
  202. package/dist/sdk/util/tree-search.js +1 -1
  203. package/dist/sdk/workflow/archive-validation.js +1 -1
  204. package/dist/sdk/workflow/clone-workflow.js +1 -1
  205. package/dist/sdk/workflow/index.js +1 -1
  206. package/dist/sdk/workflow/pull-workflow.js +1 -1
  207. package/dist/sdk/workflow/push-workflow.js +1 -1
  208. package/dist/sdk/workflow/task-graph.js +1 -1
  209. package/dist/sdk/workflow/tdx-config.js +1 -1
  210. package/dist/sdk/workflow/workflow-utils.js +1 -1
  211. package/dist/sdk/workspace/access-tracker.js +1 -1
  212. package/dist/sdk/workspace/frontmatter.js +1 -1
  213. package/dist/sdk/workspace/git.js +1 -1
  214. package/dist/sdk/workspace/index.js +1 -1
  215. package/dist/sdk/workspace/templates.js +1 -1
  216. package/dist/sdk/workspace/weekly.js +1 -1
  217. package/dist/sdk/workspace/wikilinks.js +1 -1
  218. package/dist/test-utils/command-runner.js +1 -1
  219. package/dist/test-utils/factories.js +1 -1
  220. package/dist/test-utils/fixtures.js +1 -1
  221. package/dist/test-utils/http-mock.js +1 -1
  222. package/dist/test-utils/index.js +1 -1
  223. package/dist/utils/async.js +1 -1
  224. package/dist/utils/claude-code-state.js +1 -1
  225. package/dist/utils/colors.js +1 -1
  226. package/dist/utils/diff.js +1 -1
  227. package/dist/utils/file-permissions.js +1 -1
  228. package/dist/utils/file-reader.js +1 -1
  229. package/dist/utils/github-releases.js +1 -1
  230. package/dist/utils/global-cache.js +1 -1
  231. package/dist/utils/json-loader.js +1 -1
  232. package/dist/utils/local-cache.js +1 -1
  233. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  234. package/dist/utils/logger/formatters/index.js +1 -1
  235. package/dist/utils/logger/handlers/console-handler.js +1 -1
  236. package/dist/utils/logger/handlers/file-handler.js +1 -1
  237. package/dist/utils/logger/handlers/index.js +1 -1
  238. package/dist/utils/logger/handlers/null-handler.js +1 -1
  239. package/dist/utils/logger/index.js +1 -1
  240. package/dist/utils/logger/logger.js +1 -1
  241. package/dist/utils/logger/types.js +1 -1
  242. package/dist/utils/option-validation.js +1 -1
  243. package/dist/utils/process.js +1 -1
  244. package/dist/utils/prompt.js +1 -1
  245. package/dist/utils/proxy-fetch.js +1 -1
  246. package/dist/utils/spinner.js +1 -1
  247. package/dist/utils/sse-parser.js +1 -1
  248. package/dist/utils/string-utils.js +1 -1
  249. package/dist/utils/table-ref-parser.js +1 -1
  250. package/dist/utils/tdx-logger.js +1 -1
  251. package/dist/utils/version-check.js +1 -1
  252. package/package.json +1 -1
@@ -1 +1 @@
1
- const a59_0x69291=a59_0x2c40;(function(_0x3104cd,_0x18a381){const _0x416807=a59_0x2c40,_0x244bc0=_0x3104cd();while(!![]){try{const _0x3d9900=-parseInt(_0x416807(0x28c))/0x1+-parseInt(_0x416807(0x14c))/0x2*(parseInt(_0x416807(0x2e8))/0x3)+parseInt(_0x416807(0x22d))/0x4+parseInt(_0x416807(0x252))/0x5*(parseInt(_0x416807(0x1b4))/0x6)+parseInt(_0x416807(0x219))/0x7+parseInt(_0x416807(0x291))/0x8+parseInt(_0x416807(0x17c))/0x9*(-parseInt(_0x416807(0x299))/0xa);if(_0x3d9900===_0x18a381)break;else _0x244bc0['push'](_0x244bc0['shift']());}catch(_0x10cd94){_0x244bc0['push'](_0x244bc0['shift']());}}}(a59_0x5020,0x7a173));import a59_0x34c7bd from'chalk';import{existsSync}from'fs';import a59_0x28ffa6 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 a59_0x3da1fb from'prompts';function getAttemptStatusDisplay(_0x3eb3d8){const _0x1feb40=a59_0x2c40;if(!_0x3eb3d8)return{'icon':'⏳','text':''};const {done:_0x438da3,success:_0x2d8a42,cancelRequested:_0x5a232e}=_0x3eb3d8;if(!_0x438da3)return _0x5a232e?{'icon':'🛑','text':a59_0x34c7bd[_0x1feb40(0x196)](_0x1feb40(0x173))}:{'icon':'🔄','text':a59_0x34c7bd[_0x1feb40(0x269)](_0x1feb40(0x152))};if(_0x2d8a42)return{'icon':'✅','text':a59_0x34c7bd[_0x1feb40(0x2d5)](_0x1feb40(0x210))};return{'icon':'❌','text':a59_0x34c7bd['red'](_0x1feb40(0x274))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x24db61,_0x715640,_0x4218c8=0x0){return _0x24db61[_0x4218c8]||_0x715640['workflowProject'];}[a59_0x69291(0x1ee)](_0x48911c,_0x327868,_0x3e3d55=0x0){const _0x193590=a59_0x69291,_0x3be884=this[_0x193590(0x1f1)](_0x48911c,_0x327868,_0x3e3d55);if(!_0x3be884)return console['error'](a59_0x34c7bd[_0x193590(0x2f8)](_0x193590(0x287)),'Project\x20name\x20is\x20required'),console[_0x193590(0x274)](a59_0x34c7bd[_0x193590(0x27d)](_0x193590(0x298))),null;return _0x3be884;}[a59_0x69291(0x1a5)](_0x4db037,_0x250812){const _0x57f768=a59_0x69291;if(_0x4db037[0x0]){const _0x1814bc=_0x4db037[0x0][_0x57f768(0x1cc)]('.');if(_0x1814bc[_0x57f768(0x204)]===0x1)return{'projectName':_0x1814bc[0x0],'workflowName':undefined};else return _0x1814bc[_0x57f768(0x204)]===0x2?{'projectName':_0x1814bc[0x0],'workflowName':_0x1814bc[0x1]}:(console[_0x57f768(0x274)](a59_0x34c7bd[_0x57f768(0x2f8)](_0x57f768(0x287)),_0x57f768(0x238)),null);}return{'projectName':_0x250812[_0x57f768(0x19c)],'workflowName':undefined};}['resolveProjectDir'](_0x340960,_0x23dc02,_0x1c1123=0x0){const _0x123f77=a59_0x69291;if(_0x340960[_0x1c1123])return _0x340960[_0x1c1123];if(_0x23dc02[_0x123f77(0x19c)]){const _0x43528a=a59_0x28ffa6['join'](process[_0x123f77(0x2e3)](),_0x123f77(0x1cb),_0x23dc02['workflowProject']);if(existsSync(a59_0x28ffa6['join'](_0x43528a,_0x123f77(0x1cd))))return _0x43528a;}return undefined;}async[a59_0x69291(0x264)](_0x365bf0,_0x5ae966,_0x529c66){const _0x1eb6a0=a59_0x69291;try{const _0x2dde83=await _0x365bf0[_0x1eb6a0(0x19a)][_0x1eb6a0(0x1cb)](_0x5ae966,{'limit':0x1});if(_0x2dde83[_0x1eb6a0(0x204)]>0x0){const _0x57ea28=_0x2dde83[0x0]['id'],_0x262a3b=getWorkflowUrl(_0x529c66,_0x57ea28);console['error'](_0x1eb6a0(0x13d)+a59_0x34c7bd[_0x1eb6a0(0x251)](_0x262a3b));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a59_0x69291(0x1c9);[a59_0x69291(0x134)]=a59_0x69291(0x22a);async[a59_0x69291(0x2fa)](_0x5416fd){const _0x1f0993=a59_0x69291,{options:_0x5b346c,args:_0x370638,tdx:_0x53c14b}=_0x5416fd,_0x52ee43=_0x370638[0x0],_0x2f6443=_0x5b346c[_0x1f0993(0x2ba)];if(_0x2f6443)return saveSessionContext({'workflow_project':undefined},_0x5b346c['session']),console[_0x1f0993(0x296)](a59_0x34c7bd[_0x1f0993(0x2d5)](_0x1f0993(0x22c))),0x0;if(!_0x52ee43)return console[_0x1f0993(0x274)](a59_0x34c7bd['red']('Error:'),_0x1f0993(0x2be)),console[_0x1f0993(0x274)](a59_0x34c7bd[_0x1f0993(0x27d)](_0x1f0993(0x14a))),console[_0x1f0993(0x274)](a59_0x34c7bd[_0x1f0993(0x27d)](_0x1f0993(0x16e))),0x1;const _0x3865a1=await withSpinner(_0x1f0993(0x1da)+_0x52ee43+'\x27...',()=>_0x53c14b[_0x1f0993(0x19a)][_0x1f0993(0x1ec)](_0x52ee43),{'verbose':_0x5b346c['verbose']}),{name:_0x448fa8}=_0x3865a1[_0x1f0993(0x162)];return saveSessionContext({'workflow_project':_0x448fa8},_0x5b346c['session']),console[_0x1f0993(0x296)](a59_0x34c7bd[_0x1f0993(0x2d5)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a59_0x34c7bd[_0x1f0993(0x251)](_0x448fa8))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a59_0x69291(0x297);[a59_0x69291(0x134)]='List\x20all\x20workflow\x20projects';async[a59_0x69291(0x2fa)](_0x1f9dcc){const _0x1309c7=a59_0x69291,{options:_0x31a5d4,args:_0x174f5b,tdx:_0x4639bc}=_0x1f9dcc,_0x3bcd8e=_0x174f5b[0x0];_0x31a5d4[_0x1309c7(0x151)]&&_0x3bcd8e&&console[_0x1309c7(0x274)]('Pattern:\x20'+_0x3bcd8e);const _0x28a4a4=await withSpinner(_0x1309c7(0x20d),()=>_0x4639bc[_0x1309c7(0x19a)]['projects'](_0x3bcd8e,{'limit':_0x31a5d4['limit']}),{'verbose':_0x31a5d4[_0x1309c7(0x151)]});let _0x3120a9=_0x28a4a4[_0x1309c7(0x162)];_0x3120a9[_0x1309c7(0x279)]((_0x2687b3,_0x20dc46)=>_0x2687b3[_0x1309c7(0x268)][_0x1309c7(0x286)](_0x20dc46['name']));const _0x1e6c2d=_0x31a5d4[_0x1309c7(0x2db)]&&_0x3120a9[_0x1309c7(0x204)]>=_0x31a5d4[_0x1309c7(0x2db)]?a59_0x34c7bd['dim'](_0x1309c7(0x188)):'';console['error']('✔\x20Found\x20'+_0x3120a9['length']+_0x1309c7(0x24d)+(_0x3120a9[_0x1309c7(0x204)]!==0x1?'s':'')+_0x1e6c2d);if(_0x31a5d4[_0x1309c7(0x2ad)]==='json'||_0x31a5d4['format']===_0x1309c7(0x1d8)||_0x31a5d4[_0x1309c7(0x2ad)]===_0x1309c7(0x1dd))await handleSDKOutput(_0x3120a9,_0x31a5d4);else{if(_0x3120a9[_0x1309c7(0x204)]===0x0)_0x3bcd8e?console['log'](_0x1309c7(0x141)+_0x3bcd8e):console[_0x1309c7(0x296)]('No\x20workflow\x20projects\x20found');else{const _0x5ae2a2=_0x3120a9[_0x1309c7(0x1b8)](_0x2f0d6f=>{const _0x2c517a=_0x1309c7,_0x373cf8=_0x2f0d6f[_0x2c517a(0x1b6)]?.[_0x2c517a(0x2ef)](_0x3d6ecd=>_0x3d6ecd[_0x2c517a(0x243)]===_0x2c517a(0x1d7)),_0x4a39d7=_0x373cf8?a59_0x34c7bd['dim'](_0x2c517a(0x167)):'';return'📁\x20'+_0x2f0d6f[_0x2c517a(0x268)]+_0x4a39d7;});await writeOutput(_0x5ae2a2[_0x1309c7(0x19d)]('\x0a'),_0x31a5d4[_0x1309c7(0x207)],_0x1309c7(0x2e9));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x256);[a59_0x69291(0x134)]=a59_0x69291(0x174);async[a59_0x69291(0x2fa)](_0x30ed41){const _0x56d6d9=a59_0x69291,{options:_0x17b559,args:_0x18b873,tdx:_0x506afe}=_0x30ed41,_0x397af7=this[_0x56d6d9(0x1f1)](_0x18b873,_0x17b559);_0x17b559[_0x56d6d9(0x151)]&&_0x397af7&&console[_0x56d6d9(0x274)]('Project\x20filter:\x20'+_0x397af7);const _0x1eb321=await withSpinner(_0x56d6d9(0x2ea),()=>_0x506afe[_0x56d6d9(0x19a)][_0x56d6d9(0x1cb)](_0x397af7,{'limit':_0x17b559[_0x56d6d9(0x2db)]}),{'verbose':_0x17b559['verbose']});let _0x717b58=_0x1eb321['data'];_0x717b58[_0x56d6d9(0x279)]((_0x3abe2d,_0xed1127)=>{const _0x157c98=_0x56d6d9,_0x4f4952=_0x3abe2d[_0x157c98(0x268)][_0x157c98(0x286)](_0xed1127[_0x157c98(0x268)]);if(_0x4f4952!==0x0)return _0x4f4952;return(_0x3abe2d['project']?.[_0x157c98(0x268)]||'')[_0x157c98(0x286)](_0xed1127['project']?.[_0x157c98(0x268)]||'');});const _0x67d008=_0x17b559['limit']&&_0x717b58['length']>=_0x17b559['limit']?a59_0x34c7bd[_0x56d6d9(0x27d)](_0x56d6d9(0x188)):'';console['error'](_0x56d6d9(0x164)+_0x717b58[_0x56d6d9(0x204)]+_0x56d6d9(0x236)+(_0x717b58[_0x56d6d9(0x204)]!==0x1?'s':'')+_0x67d008);if(_0x17b559[_0x56d6d9(0x2ad)]==='json'||_0x17b559['format']==='jsonl'||_0x17b559[_0x56d6d9(0x2ad)]==='table')await handleSDKOutput(_0x717b58,_0x17b559);else{if(_0x717b58[_0x56d6d9(0x204)]===0x0)_0x397af7?console[_0x56d6d9(0x296)](_0x56d6d9(0x227)+_0x397af7):console['log'](_0x56d6d9(0x282));else{const _0x4f7656=_0x17b559[_0x56d6d9(0x2bf)],_0x37c601=_0x717b58[_0x56d6d9(0x1b8)](_0x14bde4=>{const _0xd216f6=_0x56d6d9,_0x1bd1f3=a59_0x34c7bd[_0xd216f6(0x27d)]('#'+_0x14bde4['id']),_0x2ff341=hyperlink(_0x1bd1f3,getWorkflowUrl(_0x4f7656,_0x14bde4['id'])),_0x51ec44=_0x14bde4['project']?.[_0xd216f6(0x268)]?a59_0x34c7bd[_0xd216f6(0x27d)]('\x20('+_0x14bde4['project']['name']+')'):'';return _0xd216f6(0x224)+_0x2ff341+'\x20'+_0x14bde4[_0xd216f6(0x268)]+_0x51ec44;});await writeOutput(_0x37c601[_0x56d6d9(0x19d)]('\x0a'),_0x17b559[_0x56d6d9(0x207)],_0x56d6d9(0x2e9));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]='workflow:sessions';[a59_0x69291(0x134)]=a59_0x69291(0x1d6);async[a59_0x69291(0x2fa)](_0x120fb7){const _0x4eb721=a59_0x69291,{options:_0x6403d9,args:_0x7591b7,tdx:_0x3282c8}=_0x120fb7,_0xa85f02=this[_0x4eb721(0x1a5)](_0x7591b7,_0x6403d9);if(!_0xa85f02)return 0x1;const {projectName:_0x4270d6,workflowName:_0x18c642}=_0xa85f02;if(_0x6403d9[_0x4eb721(0x151)]){if(_0x4270d6&&_0x18c642)console[_0x4eb721(0x274)](_0x4eb721(0x21a)+_0x4270d6+'.'+_0x18c642);else _0x4270d6&&console[_0x4eb721(0x274)](_0x4eb721(0x161)+_0x4270d6);const _0x3bc565=_0x6403d9[_0x4eb721(0x21f)];_0x3bc565&&console[_0x4eb721(0x274)](_0x4eb721(0x137)+_0x3bc565);}let _0x34b544=0x28;if(process[_0x4eb721(0x2a5)][_0x4eb721(0x206)]&&!_0x6403d9[_0x4eb721(0x207)]&&!_0x6403d9['format']){const _0x28dfe6=process[_0x4eb721(0x2a5)][_0x4eb721(0x2a8)]||0x28;_0x34b544=Math[_0x4eb721(0x14f)](0x14,Math[_0x4eb721(0x2c1)](_0x28dfe6*0x2/0x3));}const _0xa7b779=_0x6403d9['limit']||_0x34b544,_0x247d09=await withSpinner(_0x4eb721(0x17b),()=>_0x3282c8['workflow']['sessions']({'projectName':_0x4270d6,'workflowName':_0x18c642,'status':_0x6403d9[_0x4eb721(0x21f)],'fromTime':_0x6403d9[_0x4eb721(0x2de)],'toTime':_0x6403d9['to'],'limit':_0xa7b779}),{'verbose':_0x6403d9['verbose']}),_0x419f0b=_0x247d09[_0x4eb721(0x162)];_0x419f0b['sort']((_0xa1b5aa,_0x15db41)=>{const _0x1fe3f2=_0x4eb721,_0x31f7d4=_0xa1b5aa[_0x1fe3f2(0x155)]||'',_0x384003=_0x15db41[_0x1fe3f2(0x155)]||'';return _0x384003['localeCompare'](_0x31f7d4);});_0x419f0b['length']>=_0xa7b779?console['error']('✔\x20Showing\x20'+_0x419f0b[_0x4eb721(0x204)]+_0x4eb721(0x2bc)+a59_0x34c7bd[_0x4eb721(0x27d)](_0x4eb721(0x2e1))):console['error'](_0x4eb721(0x164)+_0x419f0b['length']+_0x4eb721(0x21d)+(_0x419f0b[_0x4eb721(0x204)]!==0x1?'s':''));if(_0x6403d9[_0x4eb721(0x2ad)]===_0x4eb721(0x18b)||_0x6403d9[_0x4eb721(0x2ad)]===_0x4eb721(0x1d8)||_0x6403d9['format']==='table')await handleSDKOutput(_0x419f0b,_0x6403d9);else{if(!process['stdout'][_0x4eb721(0x206)]||_0x6403d9[_0x4eb721(0x207)]){if(_0x419f0b[_0x4eb721(0x204)]===0x0){if(_0x4270d6&&_0x18c642)console['log'](_0x4eb721(0x2ce)+_0x4270d6+'.'+_0x18c642);else _0x4270d6?console['log'](_0x4eb721(0x23c)+_0x4270d6):console[_0x4eb721(0x296)](_0x4eb721(0x190));}else{const _0x4dae33=_0x6403d9[_0x4eb721(0x2bf)],_0x556b2c=this['renderSessionsTimeline'](_0x419f0b,_0x4dae33);_0x6403d9['output']?await writeOutput(_0x556b2c,_0x6403d9['output'],_0x4eb721(0x2e9)):console[_0x4eb721(0x296)](_0x556b2c);}!_0x4270d6&&(console['error'](''),console['error'](a59_0x34c7bd[_0x4eb721(0x27d)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x4eb721(0x274)](a59_0x34c7bd[_0x4eb721(0x27d)](_0x4eb721(0x1ac))+'or'+a59_0x34c7bd[_0x4eb721(0x27d)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x419f0b[_0x4eb721(0x204)]===0x0){if(_0x4270d6&&_0x18c642)console[_0x4eb721(0x296)](_0x4eb721(0x2ce)+_0x4270d6+'.'+_0x18c642);else _0x4270d6?console[_0x4eb721(0x296)](_0x4eb721(0x23c)+_0x4270d6):console[_0x4eb721(0x296)](_0x4eb721(0x190));}else await this[_0x4eb721(0x149)](_0x419f0b,_0x120fb7,_0x4270d6);}}return 0x0;}[a59_0x69291(0x1d9)](_0x12ed45,_0x52dbd8){const _0x7c8158=a59_0x69291,_0x5867e0=[],_0x5cab20=new Map();let _0x2a0012=Infinity,_0x531f0e=-Infinity;for(const _0x1333a1 of _0x12ed45){if(_0x1333a1[_0x7c8158(0x29f)]?.[_0x7c8158(0x1f8)]){const _0x22b382=new Date(_0x1333a1['lastAttempt']['createdAt'])['getTime'](),_0x54f409=_0x1333a1[_0x7c8158(0x29f)][_0x7c8158(0x265)]?new Date(_0x1333a1['lastAttempt'][_0x7c8158(0x265)])[_0x7c8158(0x1b3)]():Date[_0x7c8158(0x14d)](),_0x44fb4f=_0x1333a1[_0x7c8158(0x235)]?.[_0x7c8158(0x268)]||_0x7c8158(0x159);!_0x5cab20[_0x7c8158(0x230)](_0x44fb4f)&&_0x5cab20['set'](_0x44fb4f,[]),_0x5cab20[_0x7c8158(0x248)](_0x44fb4f)['push']({'session':_0x1333a1,'startTime':_0x22b382,'endTime':_0x54f409,'duration':_0x54f409-_0x22b382}),_0x2a0012=Math[_0x7c8158(0x1f9)](_0x2a0012,_0x22b382),_0x531f0e=Math[_0x7c8158(0x14f)](_0x531f0e,_0x54f409);}}if(_0x5cab20[_0x7c8158(0x2dd)]===0x0)return _0x7c8158(0x304);const _0x4f6199=process[_0x7c8158(0x2a5)][_0x7c8158(0x1b9)]||0x78,_0x26b7a9=0x1e,_0x4dfe15=0x32,_0x21ed27=0x4,_0x1e7a6b=Math[_0x7c8158(0x1f9)](_0x4dfe15,Math['max'](_0x26b7a9,Math[_0x7c8158(0x2c1)](_0x4f6199*0.3))),_0x2848f5=_0x4f6199-_0x1e7a6b-TIMELINE_CONFIG['GUTTER']-0x3-_0x21ed27,_0x14e8ce=_0x531f0e-_0x2a0012,_0x4234d1=_0x14e8ce/_0x1e7a6b,_0x65de8a=renderTimeAxis({'startTime':_0x2a0012,'endTime':_0x531f0e,'durationMs':_0x14e8ce,'msPerChar':_0x4234d1},_0x1e7a6b),_0x1492fe=[];for(const _0x33b781 of _0x5cab20[_0x7c8158(0x2eb)]()){_0x1492fe[_0x7c8158(0x2ec)](..._0x33b781);}_0x1492fe[_0x7c8158(0x279)]((_0x4523d9,_0x1f6554)=>_0x1f6554[_0x7c8158(0x153)]-_0x4523d9[_0x7c8158(0x153)]);const _0x338460=new Date(_0x2a0012),_0x5161f1=formatDate(_0x338460),_0x3ef842=_0x21ed27+TIMELINE_CONFIG[_0x7c8158(0x2fd)]+TIMELINE_CONFIG['ICON_SPACING']+_0x2848f5,_0x34b763='\x20'['repeat'](_0x3ef842-_0x5161f1[_0x7c8158(0x204)]),_0x2bf568=_0x34b763+a59_0x34c7bd['dim'](_0x5161f1)+'\x20'+_0x65de8a;_0x5867e0[_0x7c8158(0x2ec)](_0x2bf568);const _0x238aed=0x16;let _0x61af2c=0x0;for(const _0x4c4d2b of _0x1492fe){const _0xe9c4e2=_0x4c4d2b[_0x7c8158(0x28a)]['project']?.[_0x7c8158(0x268)]||'?',_0x497d34=Math[_0x7c8158(0x1f9)](stringWidth(_0xe9c4e2),_0x238aed);_0x61af2c=Math['max'](_0x61af2c,_0x497d34);}for(const _0x426fa7 of _0x1492fe){const {session:_0x5ac445,startTime:_0x1e5361,endTime:_0x21afce,duration:_0x3a6b13}=_0x426fa7,_0x5b98a6=_0x5ac445[_0x7c8158(0x235)]?.['id'],_0x23e355=_0x5ac445['id'],_0x22176b=_0x5ac445[_0x7c8158(0x235)]?.['name']||'?',_0x4c4ba0=_0x5ac445[_0x7c8158(0x19a)]?.['name']||'?';let _0x186c2d,_0x3af3ae;if(_0x5ac445[_0x7c8158(0x29f)]){const _0x5256f0=_0x5ac445[_0x7c8158(0x29f)];!_0x5256f0[_0x7c8158(0x28b)]?(_0x186c2d=_0x5256f0[_0x7c8158(0x266)]?'🛑':'🔄',_0x3af3ae=_0x5256f0[_0x7c8158(0x266)]?a59_0x34c7bd[_0x7c8158(0x196)]:a59_0x34c7bd['blue']):(_0x186c2d=_0x5256f0['success']?'✅':'❌',_0x3af3ae=_0x5256f0[_0x7c8158(0x210)]?a59_0x34c7bd[_0x7c8158(0x2d5)]:a59_0x34c7bd['red']);}else _0x186c2d='⏳',_0x3af3ae=a59_0x34c7bd[_0x7c8158(0x27d)];const _0x2ae64b='#'+_0x23e355,_0x2c7599=_0x5b98a6?hyperlink(_0x2ae64b,getWorkflowSessionUrl(_0x52dbd8,_0x5b98a6,_0x23e355)):_0x2ae64b;let _0x5f4bb3=_0x22176b;stringWidth(_0x22176b)>_0x238aed&&(_0x5f4bb3=_0x22176b[_0x7c8158(0x2ee)](0x0,_0x238aed-0x1)+'…');const _0x168494=a59_0x34c7bd[_0x7c8158(0x27d)](_0x5f4bb3),_0x4651cf=stringWidth(_0x5f4bb3),_0x57eb11='\x20'[_0x7c8158(0x181)](_0x61af2c-stringWidth(_0x5f4bb3)+0x2),_0x1171c4='('+formatElapsed(_0x3a6b13)+')',_0x3a1859=stringWidth(_0x1171c4),_0x246512=stringWidth(_0x2ae64b),_0x24f3db=_0x246512+0x1+_0x4651cf+_0x57eb11['length'],_0x2ea2fd=_0x2848f5-_0x24f3db-_0x3a1859-0x1-0x8;let _0x1350e9=_0x4c4ba0;stringWidth(_0x1350e9)>_0x2ea2fd&&(_0x1350e9=_0x1350e9[_0x7c8158(0x2ee)](0x0,_0x2ea2fd-0x1)+'…');const _0x551014=_0x2c7599+'\x20'+_0x168494+_0x57eb11+_0x1350e9,_0x5c1b3b=stringWidth(_0x551014),_0x28751b=_0x2848f5-_0x5c1b3b-_0x3a1859,_0x537ac7=_0x551014+'\x20'[_0x7c8158(0x181)](Math[_0x7c8158(0x14f)](0x1,_0x28751b))+a59_0x34c7bd[_0x7c8158(0x27d)](_0x1171c4),_0x45d8d2=Math[_0x7c8158(0x2c1)]((_0x1e5361-_0x2a0012)/_0x4234d1),_0xea4ea6=Math['floor']((_0x21afce-_0x2a0012)/_0x4234d1),_0x413d04=Math[_0x7c8158(0x14f)](_0x45d8d2+0x1,_0xea4ea6),_0x40f7b1=new Array(_0x1e7a6b)[_0x7c8158(0x1e6)]('\x20');for(let _0x16de9c=_0x45d8d2;_0x16de9c<Math['min'](_0x413d04,_0x1e7a6b);_0x16de9c++){_0x40f7b1[_0x16de9c]='─';}const _0x4658c2=_0x40f7b1[_0x7c8158(0x1b8)](_0x119083=>_0x119083==='\x20'?'\x20':_0x3af3ae(_0x119083))['join']('');_0x5867e0['push'](_0x186c2d+'\x20'+_0x537ac7+'│'+_0x4658c2+'│');}return _0x5867e0[_0x7c8158(0x19d)]('\x0a');}async[a59_0x69291(0x149)](_0x186196,_0x3a17d1,_0xfecb4f){const _0x115946=a59_0x69291,{options:_0x425f2a,tdx:_0x3e3c4c}=_0x3a17d1,_0x4ac038=_0x425f2a[_0x115946(0x2bf)],{timelineRows:_0x561775,timeAxisHeader:_0x2c25c3}=this[_0x115946(0x2f1)](_0x186196,_0x4ac038),_0x36b517=_0x561775[_0x115946(0x1b7)](_0x30d964=>_0x30d964[_0x115946(0x21b)]);if(_0x36b517[_0x115946(0x204)]===0x0){const _0x379473=this[_0x115946(0x1d9)](_0x186196,_0x4ac038);console[_0x115946(0x296)](_0x379473);!_0xfecb4f&&(console[_0x115946(0x274)](''),console['error'](a59_0x34c7bd[_0x115946(0x27d)](_0x115946(0x2c7))),console[_0x115946(0x274)](a59_0x34c7bd[_0x115946(0x27d)](_0x115946(0x1ac))+'or'+a59_0x34c7bd[_0x115946(0x27d)](_0x115946(0x2d9))));return;}_0x2c25c3&&console[_0x115946(0x296)](_0x2c25c3);const _0x54f1bc=_0x561775[_0x115946(0x1b7)](_0x11f85c=>_0x11f85c['attemptId'])[_0x115946(0x1b8)](_0x4cddf0=>({'title':_0x4cddf0[_0x115946(0x240)],'value':_0x4cddf0[_0x115946(0x21b)]})),_0x141118=process[_0x115946(0x2a5)][_0x115946(0x2a8)]||0x3c,_0x182ae0=Math[_0x115946(0x14f)](0x28,Math[_0x115946(0x2c1)](_0x141118*0x2/0x3)),_0x216bc2=await a59_0x3da1fb({'type':_0x115946(0x29a),'name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x54f1bc,'initial':-0x1,'limit':_0x182ae0,'clearFirst':!![],'fallback':{'title':_0x115946(0x26f),'value':null},'suggest':(_0x594b1f,_0x2df09b)=>{const _0x2ddd8f=_0x115946;if(!_0x594b1f)return Promise['resolve'](_0x2df09b);const _0x4ca5f3=_0x2df09b[_0x2ddd8f(0x1b7)](_0x78a9d2=>{const _0x4019d0=_0x2ddd8f,_0x24b646=_0x78a9d2;return _0x24b646[_0x4019d0(0x222)][_0x4019d0(0x231)]()[_0x4019d0(0x302)](_0x594b1f['toLowerCase']());});return Promise['resolve'](_0x4ca5f3);}}),_0x4f310a=()=>{const _0x204ea7=_0x115946;process[_0x204ea7(0x2a5)][_0x204ea7(0x29c)]('\x1b[1A\x1b[2K'),process[_0x204ea7(0x2a5)][_0x204ea7(0x29c)]('\x1b[1A\x1b[2K'),process[_0x204ea7(0x2a5)][_0x204ea7(0x29c)]('\x1b[1A\x1b[2K');},_0xd0db53=_0x216bc2&&_0x216bc2[_0x115946(0x21b)]&&_0x216bc2['attemptId']!==null&&_0x216bc2[_0x115946(0x21b)][_0x115946(0x202)]()!=='';if(!_0xd0db53){_0x4f310a(),console[_0x115946(0x296)](a59_0x34c7bd['dim'](_0x115946(0x292)));return;}_0x4f310a();const _0x4a876a=_0x186196[_0x115946(0x172)](_0x5a05b0=>_0x5a05b0[_0x115946(0x29f)]?.['id']===_0x216bc2[_0x115946(0x21b)]);if(_0x4a876a){const _0x2cb05d=_0x4a876a[_0x115946(0x235)]?.[_0x115946(0x268)]||'?',_0x3c6f0c=_0x4a876a[_0x115946(0x19a)]?.[_0x115946(0x268)]||'?';console['log']('Project:\x20'+a59_0x34c7bd[_0x115946(0x27d)](_0x2cb05d)+_0x115946(0x189)+a59_0x34c7bd['dim'](_0x3c6f0c));}const _0x28c75a=new WorkflowTimelineCommand();await _0x28c75a['execute']({'args':[],'options':{..._0x425f2a,'attemptId':_0x216bc2['attemptId']},'tdx':_0x3e3c4c});}[a59_0x69291(0x2f1)](_0x2469a4,_0x1e6965){const _0x44a4b4=a59_0x69291,_0x2c67cd=new Map();for(const _0x80f831 of _0x2469a4){_0x80f831['id']&&_0x80f831[_0x44a4b4(0x29f)]?.['id']&&_0x2c67cd[_0x44a4b4(0x1d0)](_0x80f831['id'],_0x80f831['lastAttempt']['id']);}const _0x5225be=[];let _0x46b889='';const _0x218815=this[_0x44a4b4(0x1d9)](_0x2469a4,_0x1e6965),_0x5512ae=_0x218815[_0x44a4b4(0x1cc)]('\x0a');for(const _0x420db3 of _0x5512ae){if(_0x420db3[_0x44a4b4(0x22e)](_0x44a4b4(0x1ff))||_0x420db3[_0x44a4b4(0x1f4)](/^\s+\d{4}-\d{2}-\d{2}/))_0x46b889=_0x420db3;else{if(_0x420db3[_0x44a4b4(0x1f4)](/^[✅❌🔄🛑⏳]/)){const _0x2879d1=_0x420db3[_0x44a4b4(0x1f4)](/#(\d+)/),_0xd5d4a0=_0x2879d1?_0x2879d1[0x1]:null,_0x1c4ff5=_0xd5d4a0?_0x2c67cd[_0x44a4b4(0x248)](_0xd5d4a0)||null:null,_0x377a4b=_0x2469a4['find'](_0x23903c=>_0x23903c['id']===_0xd5d4a0),_0x2114f6=_0x377a4b?.[_0x44a4b4(0x235)]?.[_0x44a4b4(0x268)]||'';_0x5225be[_0x44a4b4(0x2ec)]({'displayLine':_0x420db3,'attemptId':_0x1c4ff5,'projectName':_0x2114f6});}}}return{'timelineRows':_0x5225be,'timeAxisHeader':_0x46b889};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x1ad);[a59_0x69291(0x134)]=a59_0x69291(0x2a1);async['execute'](_0x1c603c){const _0x17eb7d=a59_0x69291,{options:_0xda1e62,args:_0x312f06,tdx:_0x5658c1}=_0x1c603c,_0x194e2d=this[_0x17eb7d(0x1a5)](_0x312f06,_0xda1e62);if(!_0x194e2d)return 0x1;const {projectName:_0x46f5ba,workflowName:_0x56ede6}=_0x194e2d,_0x32c2b2=_0xda1e62[_0x17eb7d(0x1e5)];if(_0xda1e62[_0x17eb7d(0x151)]){if(_0x46f5ba&&_0x56ede6)console[_0x17eb7d(0x274)](_0x17eb7d(0x21a)+_0x46f5ba+'.'+_0x56ede6);else _0x46f5ba&&console[_0x17eb7d(0x274)](_0x17eb7d(0x161)+_0x46f5ba);_0x32c2b2&&console[_0x17eb7d(0x274)](_0x17eb7d(0x14e));}const _0x546b5d=await withSpinner(_0x17eb7d(0x1fa),()=>_0x5658c1[_0x17eb7d(0x19a)]['attempts']({'projectName':_0x46f5ba,'workflowName':_0x56ede6,'includeRetried':_0x32c2b2,'limit':_0xda1e62['limit']}),{'verbose':_0xda1e62[_0x17eb7d(0x151)]}),_0x2d7a59=_0x546b5d[_0x17eb7d(0x162)],_0x17aedd=_0xda1e62[_0x17eb7d(0x2db)]||0x64,_0x4caeb8=_0x2d7a59[_0x17eb7d(0x204)]>=_0x17aedd?a59_0x34c7bd[_0x17eb7d(0x27d)](_0x17eb7d(0x188)):'';console[_0x17eb7d(0x274)](_0x17eb7d(0x164)+_0x2d7a59[_0x17eb7d(0x204)]+_0x17eb7d(0x244)+(_0x2d7a59[_0x17eb7d(0x204)]!==0x1?'s':'')+_0x4caeb8);if(_0xda1e62[_0x17eb7d(0x2ad)]===_0x17eb7d(0x18b)||_0xda1e62[_0x17eb7d(0x2ad)]==='jsonl'||_0xda1e62[_0x17eb7d(0x2ad)]===_0x17eb7d(0x1dd))await handleSDKOutput(_0x2d7a59,_0xda1e62);else{if(_0x2d7a59[_0x17eb7d(0x204)]===0x0){if(_0x46f5ba&&_0x56ede6)console['log']('No\x20attempts\x20found\x20for:\x20'+_0x46f5ba+'.'+_0x56ede6);else _0x46f5ba?console[_0x17eb7d(0x296)](_0x17eb7d(0x21c)+_0x46f5ba):console[_0x17eb7d(0x296)](_0x17eb7d(0x170));}else{const _0x40b79a=_0xda1e62[_0x17eb7d(0x2bf)],_0x55ece2=_0x2d7a59[_0x17eb7d(0x1b8)](_0x4c0891=>{const _0x204f0d=_0x17eb7d,_0x39bd00=a59_0x34c7bd['dim']('#'+_0x4c0891['id']),_0x5c7d95=_0x4c0891[_0x204f0d(0x235)]?.['id'],_0x5312ba=_0x4c0891[_0x204f0d(0x2e2)]||_0x4c0891[_0x204f0d(0x220)],_0x3a8fe1=_0x5c7d95&&_0x5312ba?hyperlink(_0x39bd00,getWorkflowAttemptUrl(_0x40b79a,_0x5c7d95,_0x5312ba,_0x4c0891['id'])):_0x39bd00,{icon:_0x1a2f66,text:_0x5e8c3c}=getAttemptStatusDisplay(_0x4c0891),_0x43146f=(_0x4c0891[_0x204f0d(0x235)]?.['name']||'?')+'.'+(_0x4c0891[_0x204f0d(0x19a)]?.['name']||'?'),_0x5c312b=_0x4c0891[_0x204f0d(0x155)]?a59_0x34c7bd['dim'](_0x4c0891[_0x204f0d(0x155)]):'';return(_0x3a8fe1+'\x20'+_0x1a2f66+(_0x5e8c3c?'\x20'+_0x5e8c3c:'')+'\x20'+_0x43146f+'\x20'+_0x5c312b)['trimEnd']();});await writeOutput(_0x55ece2[_0x17eb7d(0x19d)]('\x0a'),_0xda1e62['output'],_0x17eb7d(0x2e9));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a59_0x69291(0x183);[a59_0x69291(0x134)]=a59_0x69291(0x1c6);async[a59_0x69291(0x2fa)](_0x2b47bb){const _0x5c9271=a59_0x69291,{options:_0x3b05e5,args:_0x4850b0,tdx:_0x369a8e}=_0x2b47bb,_0x291cf0=_0x4850b0[0x0];if(!_0x291cf0)return console[_0x5c9271(0x274)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x3b05e5['verbose']&&console[_0x5c9271(0x274)](_0x5c9271(0x270)+_0x291cf0);const _0x4a9c7f=await withSpinner('Getting\x20attempt\x20details...',()=>_0x369a8e[_0x5c9271(0x19a)]['attempt'](_0x291cf0),{'verbose':_0x3b05e5[_0x5c9271(0x151)]}),_0xf3e84d=_0x4a9c7f[_0x5c9271(0x162)];let _0x57bb96;!_0xf3e84d[_0x5c9271(0x28b)]?_0x57bb96=_0xf3e84d['cancelRequested']?_0x5c9271(0x173):_0x5c9271(0x152):_0x57bb96=_0xf3e84d[_0x5c9271(0x210)]?_0x5c9271(0x210):_0x5c9271(0x274);let _0x43e041;if(_0xf3e84d[_0x5c9271(0x1f8)]&&_0xf3e84d[_0x5c9271(0x265)]){const _0x5f1d21=new Date(_0xf3e84d[_0x5c9271(0x1f8)])[_0x5c9271(0x1b3)](),_0x62f98=new Date(_0xf3e84d[_0x5c9271(0x265)])[_0x5c9271(0x1b3)]();_0x43e041=Math[_0x5c9271(0x13a)]((_0x62f98-_0x5f1d21)/0x3e8);}const _0x47849a={'attempt_id':_0xf3e84d['id'],'status':_0x57bb96,..._0xf3e84d[_0x5c9271(0x1f7)]!==undefined&&{'index':_0xf3e84d[_0x5c9271(0x1f7)]},..._0xf3e84d[_0x5c9271(0x235)]&&{'project':_0xf3e84d[_0x5c9271(0x235)][_0x5c9271(0x268)]},..._0xf3e84d[_0x5c9271(0x19a)]&&{'workflow':_0xf3e84d[_0x5c9271(0x19a)]['name']},..._0xf3e84d[_0x5c9271(0x220)]&&{'session_id':_0xf3e84d[_0x5c9271(0x220)]},..._0xf3e84d[_0x5c9271(0x155)]&&{'session_time':_0xf3e84d['sessionTime']},..._0xf3e84d[_0x5c9271(0x1a2)]&&{'retry_attempt':_0xf3e84d[_0x5c9271(0x1a2)]},..._0x43e041!==undefined&&{'duration_sec':_0x43e041},..._0xf3e84d[_0x5c9271(0x1f8)]&&{'created_at':_0xf3e84d['createdAt']},..._0xf3e84d['finishedAt']&&{'finished_at':_0xf3e84d[_0x5c9271(0x265)]},...Object['keys'](_0xf3e84d[_0x5c9271(0x25d)])[_0x5c9271(0x204)]>0x0&&{'params':_0xf3e84d[_0x5c9271(0x25d)]}};return await handleSingleObjectOutput(_0x47849a,_0x3b05e5),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x27e);['description']=a59_0x69291(0x2ae);async['execute'](_0x24081d){const _0x4576f8=a59_0x69291,{options:_0x30be20,args:_0x2b1b0d,tdx:_0x3db675}=_0x24081d,_0x9003da=_0x2b1b0d[0x0];if(!_0x9003da)return console[_0x4576f8(0x274)](_0x4576f8(0x138)),0x1;const _0x97658f=_0x30be20['includeSubtasks'];_0x30be20[_0x4576f8(0x151)]&&(console[_0x4576f8(0x274)](_0x4576f8(0x270)+_0x9003da),_0x97658f&&console['error'](_0x4576f8(0x20b)));const _0x2a574f=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x3db675[_0x4576f8(0x19a)][_0x4576f8(0x184)](_0x9003da,_0x97658f||![]),{'verbose':_0x30be20['verbose']}),_0x3b3f0b=_0x2a574f[_0x4576f8(0x162)];return console[_0x4576f8(0x274)](_0x4576f8(0x164)+_0x3b3f0b['length']+_0x4576f8(0x278)+(_0x3b3f0b[_0x4576f8(0x204)]!==0x1?'s':'')),await handleSDKOutput(_0x3b3f0b,_0x30be20),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x245);[a59_0x69291(0x134)]=a59_0x69291(0x148);async['execute'](_0x203f28){const _0x4f7eaf=a59_0x69291,{options:_0x2a40f2,args:_0x3ce88f,tdx:_0x5c1384}=_0x203f28,_0x5586af=_0x3ce88f[0x0];let _0x405657=_0x3ce88f[0x1];if(!_0x5586af)return console[_0x4f7eaf(0x274)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x2a40f2[_0x4f7eaf(0x151)]&&(console[_0x4f7eaf(0x274)]('Attempt\x20ID:\x20'+_0x5586af),_0x405657&&console[_0x4f7eaf(0x274)](_0x4f7eaf(0x166)+_0x405657));const _0x53e3f7=await withSpinner(_0x4f7eaf(0x185),()=>_0x5c1384[_0x4f7eaf(0x19a)][_0x4f7eaf(0x24a)](_0x5586af,_0x405657),{'verbose':_0x2a40f2[_0x4f7eaf(0x151)]}),_0x1b08bb=_0x53e3f7[_0x4f7eaf(0x162)];if(_0x1b08bb[_0x4f7eaf(0x204)]===0x0)return console[_0x4f7eaf(0x274)](_0x4f7eaf(0x246)),0x0;if(!_0x405657&&(_0x2a40f2['json']||_0x2a40f2[_0x4f7eaf(0x2ad)]))return await handleSDKOutput(_0x1b08bb,_0x2a40f2),0x0;if(!_0x405657){const _0x50abe8=_0x1b08bb[_0x4f7eaf(0x1b8)](_0x16e344=>({'title':_0x16e344['taskName']+'\x20('+formatBytes(_0x16e344[_0x4f7eaf(0x2b1)])+')','value':_0x16e344[_0x4f7eaf(0x2e4)]})),_0x58106d=await a59_0x3da1fb({'type':'select','name':_0x4f7eaf(0x2fb),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x50abe8});if(!_0x58106d['task'])return console[_0x4f7eaf(0x274)](_0x4f7eaf(0x292)),0x0;_0x405657=_0x58106d['task'];}const _0x549137=await withSpinner(_0x4f7eaf(0x194),()=>_0x5c1384[_0x4f7eaf(0x19a)][_0x4f7eaf(0x2cf)](_0x5586af,_0x405657),{'verbose':_0x2a40f2['verbose']}),_0x515d58=_0x549137[_0x4f7eaf(0x162)];return _0x515d58?console[_0x4f7eaf(0x296)](_0x515d58):console[_0x4f7eaf(0x274)](_0x4f7eaf(0x1a4)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x1c2);[a59_0x69291(0x134)]=a59_0x69291(0x1de);async[a59_0x69291(0x2fa)](_0x51fcec){const _0x5a9ae0=a59_0x69291,{options:_0x26d4b6,args:_0x48b612,tdx:_0x5e3f43}=_0x51fcec,_0x33a816=_0x48b612[0x0];if(!_0x33a816)return console[_0x5a9ae0(0x274)](_0x5a9ae0(0x138)),0x1;const _0x224db3=_0x26d4b6['reason'];_0x26d4b6['verbose']&&(console['error'](_0x5a9ae0(0x270)+_0x33a816),_0x224db3&&console['error']('Reason:\x20'+_0x224db3));if(!_0x26d4b6[_0x5a9ae0(0x1ae)]){if(!isInteractive())return console[_0x5a9ae0(0x274)](a59_0x34c7bd[_0x5a9ae0(0x2f8)](_0x5a9ae0(0x2f6)),_0x5a9ae0(0x2d1)),console[_0x5a9ae0(0x274)](a59_0x34c7bd['dim'](_0x5a9ae0(0x275))),0x1;const _0x52414b=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x33a816+'?');if(!_0x52414b)return console[_0x5a9ae0(0x274)](a59_0x34c7bd[_0x5a9ae0(0x196)](_0x5a9ae0(0x292))),0x1;}const _0x332042=await withSpinner(_0x5a9ae0(0x199),()=>_0x5e3f43[_0x5a9ae0(0x19a)][_0x5a9ae0(0x234)](_0x33a816,_0x224db3),{'verbose':_0x26d4b6['verbose']}),_0x58d284=_0x332042[_0x5a9ae0(0x162)];return console[_0x5a9ae0(0x274)]('✔\x20'+_0x58d284),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x1be);[a59_0x69291(0x134)]=a59_0x69291(0x1ea);async[a59_0x69291(0x2fa)](_0xda9ee1){const _0x21f8cf=a59_0x69291,{options:_0x55a961,args:_0x1b64f4,tdx:_0x42dbd7}=_0xda9ee1,_0x140332=_0x1b64f4[0x0];if(!_0x140332)return console[_0x21f8cf(0x274)](_0x21f8cf(0x2a7)),console[_0x21f8cf(0x274)](_0x21f8cf(0x2d0)),0x1;let _0x1f7e81=![],_0x32a09f=_0x140332;if(_0x140332[_0x21f8cf(0x22e)](_0x21f8cf(0x193)))_0x1f7e81=!![],_0x32a09f=_0x140332[_0x21f8cf(0x1a3)](0x8);else{if(_0x140332[_0x21f8cf(0x22e)](_0x21f8cf(0x2df)))_0x1f7e81=![],_0x32a09f=_0x140332[_0x21f8cf(0x1a3)](0x8);else return console[_0x21f8cf(0x274)](_0x21f8cf(0x27f)),console[_0x21f8cf(0x274)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x264557=_0x55a961[_0x21f8cf(0x1b1)],_0x2964eb=_0x55a961[_0x21f8cf(0x175)],_0x49f4a9=_0x55a961[_0x21f8cf(0x25d)],_0x59fd10=_0x55a961[_0x21f8cf(0x180)];_0x55a961[_0x21f8cf(0x151)]&&(console[_0x21f8cf(0x274)](_0x21f8cf(0x1ef)+(_0x1f7e81?_0x21f8cf(0x28a):'attempt')+'\x20'+_0x32a09f),_0x264557&&console[_0x21f8cf(0x274)]('From\x20task:\x20'+_0x264557),_0x2964eb&&console['error'](_0x21f8cf(0x16f)+_0x2964eb),_0x49f4a9&&console[_0x21f8cf(0x274)](_0x21f8cf(0x250)+_0x49f4a9),_0x59fd10&&console[_0x21f8cf(0x274)](_0x21f8cf(0x168)));let _0x2dcc51;if(_0x49f4a9)try{if(_0x49f4a9['startsWith']('@')){const _0x4f230d=await import(_0x21f8cf(0x131)),_0x4664dc=_0x49f4a9[_0x21f8cf(0x1a3)](0x1),_0x39b821=await _0x4f230d[_0x21f8cf(0x285)](_0x4664dc,_0x21f8cf(0x1ca));_0x2dcc51=JSON['parse'](_0x39b821);}else _0x2dcc51=JSON[_0x21f8cf(0x233)](_0x49f4a9);}catch{return console[_0x21f8cf(0x274)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x55a961['yes']){if(!isInteractive())return console[_0x21f8cf(0x274)](a59_0x34c7bd['red'](_0x21f8cf(0x2f6)),_0x21f8cf(0x2d1)),console['error'](a59_0x34c7bd[_0x21f8cf(0x27d)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x517e0c=await confirmKey(_0x21f8cf(0x2a4)+(_0x1f7e81?_0x21f8cf(0x28a):_0x21f8cf(0x217))+'\x20'+_0x32a09f+'?');if(!_0x517e0c)return console[_0x21f8cf(0x274)](a59_0x34c7bd[_0x21f8cf(0x196)](_0x21f8cf(0x292))),0x1;}let _0x523f43;_0x1f7e81?_0x523f43=await withSpinner(_0x21f8cf(0x28e),()=>_0x42dbd7[_0x21f8cf(0x19a)][_0x21f8cf(0x200)](_0x32a09f,{'fromTask':_0x264557,'retryParams':_0x2dcc51}),{'verbose':_0x55a961[_0x21f8cf(0x151)]}):_0x523f43=await withSpinner(_0x21f8cf(0x218),()=>_0x42dbd7['workflow']['retryAttempt'](_0x32a09f,{'resumeFrom':_0x2964eb,'retryParams':_0x2dcc51,'force':_0x59fd10}),{'verbose':_0x55a961[_0x21f8cf(0x151)]});const _0x619a60=_0x523f43[_0x21f8cf(0x162)];return console[_0x21f8cf(0x274)](_0x21f8cf(0x24c)),console[_0x21f8cf(0x274)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x619a60['attemptId']),console['error'](_0x21f8cf(0x191)+_0x619a60['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]='workflow:run';[a59_0x69291(0x134)]='Start\x20a\x20workflow\x20run';async[a59_0x69291(0x2fa)](_0x5b7fa0){const _0x30b8fb=a59_0x69291,{options:_0x3bd086,args:_0x5bf2f9,tdx:_0x490dd2}=_0x5b7fa0;let _0x9f1e32=_0x5bf2f9[0x0];if(!_0x9f1e32){const _0x3e7ea4=this[_0x30b8fb(0x1f1)]([],_0x3bd086),_0x23171e=await withSpinner(_0x30b8fb(0x139),()=>_0x490dd2[_0x30b8fb(0x19a)][_0x30b8fb(0x1cb)](_0x3e7ea4,{'limit':_0x3bd086[_0x30b8fb(0x2db)]}),{'verbose':_0x3bd086[_0x30b8fb(0x151)]}),_0x153303=_0x23171e['data'];if(_0x153303[_0x30b8fb(0x204)]===0x0)return console[_0x30b8fb(0x274)](_0x30b8fb(0x282)),!_0x3e7ea4&&console[_0x30b8fb(0x274)](a59_0x34c7bd[_0x30b8fb(0x27d)](_0x30b8fb(0x298))),0x1;const _0xa30fb1=_0x153303[_0x30b8fb(0x1b8)](_0x5915f0=>({'title':_0x5915f0[_0x30b8fb(0x235)]?.[_0x30b8fb(0x268)]+'.'+_0x5915f0[_0x30b8fb(0x268)],'value':_0x5915f0[_0x30b8fb(0x235)]?.[_0x30b8fb(0x268)]+'.'+_0x5915f0[_0x30b8fb(0x268)],'description':_0x5915f0['revision']?_0x30b8fb(0x187)+_0x5915f0[_0x30b8fb(0x1db)]:undefined})),_0xd57187=await a59_0x3da1fb({'type':'select','name':_0x30b8fb(0x19a),'message':_0x30b8fb(0x228),'choices':_0xa30fb1});if(!_0xd57187[_0x30b8fb(0x19a)])return 0x1;_0x9f1e32=_0xd57187['workflow'];}if(!_0x9f1e32[_0x30b8fb(0x302)]('.')){const _0x48123d=this[_0x30b8fb(0x1f1)]([],_0x3bd086);if(_0x48123d)_0x9f1e32=_0x48123d+'.'+_0x9f1e32;else return console[_0x30b8fb(0x274)](a59_0x34c7bd[_0x30b8fb(0x2f8)](_0x30b8fb(0x287)),_0x30b8fb(0x23f)),console[_0x30b8fb(0x274)](a59_0x34c7bd[_0x30b8fb(0x27d)](_0x30b8fb(0x298))),0x1;}const _0x550940=_0x3bd086[_0x30b8fb(0x1a7)],_0x2046ff=_0x3bd086[_0x30b8fb(0x155)],_0x279fd5={};if(_0x550940&&Array['isArray'](_0x550940))for(const _0x4c0353 of _0x550940){const _0x13074e=_0x4c0353[_0x30b8fb(0x295)]('=');if(_0x13074e===-0x1)return console[_0x30b8fb(0x274)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x4c0353),console[_0x30b8fb(0x274)](_0x30b8fb(0x277)),0x1;const _0x4cd327=_0x4c0353[_0x30b8fb(0x1a3)](0x0,_0x13074e),_0x48ab3b=_0x4c0353[_0x30b8fb(0x1a3)](_0x13074e+0x1);try{_0x279fd5[_0x4cd327]=JSON[_0x30b8fb(0x233)](_0x48ab3b);}catch{_0x279fd5[_0x4cd327]=_0x48ab3b;}}_0x3bd086[_0x30b8fb(0x151)]&&(console[_0x30b8fb(0x274)](_0x30b8fb(0x280)+_0x9f1e32),Object[_0x30b8fb(0x20a)](_0x279fd5)['length']>0x0&&console[_0x30b8fb(0x274)]('Parameters:\x20'+JSON[_0x30b8fb(0x288)](_0x279fd5)),_0x2046ff&&console[_0x30b8fb(0x274)](_0x30b8fb(0x1d5)+_0x2046ff));if(_0x3bd086[_0x30b8fb(0x255)])return await this[_0x30b8fb(0x2b8)](_0x5b7fa0,_0x9f1e32,_0x279fd5,_0x2046ff);const _0x3095e3=await withSpinner(_0x30b8fb(0x242),()=>_0x490dd2[_0x30b8fb(0x19a)][_0x30b8fb(0x2b7)](_0x9f1e32,_0x279fd5,{'sessionTime':_0x2046ff}),{'verbose':_0x3bd086['verbose']}),_0x114109=_0x3095e3[_0x30b8fb(0x162)];console[_0x30b8fb(0x274)]('✔\x20Workflow\x20run\x20started'),console['error'](_0x30b8fb(0x215)+_0x114109['id']),console[_0x30b8fb(0x274)](_0x30b8fb(0x191)+_0x114109[_0x30b8fb(0x220)]),console[_0x30b8fb(0x274)](_0x30b8fb(0x223)+_0x114109[_0x30b8fb(0x235)]?.['name']),console[_0x30b8fb(0x274)](_0x30b8fb(0x2cd)+_0x114109[_0x30b8fb(0x19a)]?.[_0x30b8fb(0x268)]);if(_0x114109[_0x30b8fb(0x235)]?.['id']&&_0x114109['sessionId']&&_0x114109['id']){const _0x57e565=_0x3bd086[_0x30b8fb(0x2bf)],_0x2a4bd0=getConsoleUrl(_0x57e565,'/app/workflows/'+_0x114109[_0x30b8fb(0x235)]['id']+_0x30b8fb(0x146)+_0x114109[_0x30b8fb(0x220)]+'/attempt/'+_0x114109['id']);console[_0x30b8fb(0x274)](_0x30b8fb(0x13d)+a59_0x34c7bd['cyan'](_0x2a4bd0));}return 0x0;}async[a59_0x69291(0x2b8)](_0x14af8c,_0x579615,_0x53a96a,_0xa42084){const _0x1616fd=a59_0x69291,{options:_0xb6ed3c,tdx:_0x3780ed}=_0x14af8c,_0x5602d4=await withSpinner('Fetching\x20workflow\x20'+_0x579615+'...',()=>_0x3780ed[_0x1616fd(0x19a)][_0x1616fd(0x2af)](_0x579615),{'verbose':_0xb6ed3c['verbose']}),_0x1de57e=_0x5602d4[_0x1616fd(0x162)],_0x2a3783=_0xa42084??new Date()[_0x1616fd(0x1bb)]();console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x1d1)](_0x1616fd(0x1df)),_0x579615),console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x1d1)](_0x1616fd(0x1fe)),_0x2a3783),console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x1d1)]('Parameters:'),JSON['stringify'](_0x53a96a)),console['log'](''),console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x1d1)](_0x1616fd(0x2d6)));const _0x2d37d7=parseTaskGraph(_0x1de57e[_0x1616fd(0x176)]??null);if(_0x2d37d7[_0x1616fd(0x204)]===0x0)console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x27d)](_0x1616fd(0x2cc)));else for(const _0x17c5ba of formatTaskGraph(_0x2d37d7)){console[_0x1616fd(0x296)](_0x17c5ba);}const _0x4d7af6=summarizeTaskGraph(_0x2d37d7),_0x49dd78=formatWarningSummary(_0x4d7af6);return _0x49dd78&&(console['log'](''),console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x196)](_0x49dd78))),console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x196)](_0x1616fd(0x212))),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x254);[a59_0x69291(0x134)]=a59_0x69291(0x27b);async['execute'](_0x4403b5){const _0x26be27=a59_0x69291,{options:_0x31aafe,args:_0x55b208,tdx:_0x462c47}=_0x4403b5,_0x1ad2de=_0x55b208[0x0],_0x3b2745=_0x55b208[0x1]||'.';if(!_0x1ad2de)return console['error'](_0x26be27(0x261)),console[_0x26be27(0x274)](_0x26be27(0x22f)),0x1;const _0x486ab4=_0x31aafe[_0x26be27(0x1db)];_0x31aafe[_0x26be27(0x151)]&&(console['error']('Project:\x20'+_0x1ad2de),console[_0x26be27(0x274)](_0x26be27(0x1b2)+_0x3b2745),_0x486ab4&&console[_0x26be27(0x274)]('Revision:\x20'+_0x486ab4));const _0xdb24ea=await withSpinner(_0x26be27(0x165)+_0x1ad2de+_0x26be27(0x1c3),()=>_0x462c47[_0x26be27(0x19a)][_0x26be27(0x177)](_0x1ad2de,_0x3b2745,{'revision':_0x486ab4}),{'verbose':_0x31aafe[_0x26be27(0x151)]}),_0x221eba=_0xdb24ea[_0x26be27(0x162)];return console[_0x26be27(0x274)](_0x26be27(0x1bd)+_0x221eba[_0x26be27(0x26c)]),console[_0x26be27(0x274)]('\x20\x20Revision:\x20'+_0x221eba[_0x26be27(0x1db)]),console['error']('\x20\x20Files\x20extracted:\x20'+_0x221eba['filesExtracted']),console['error'](_0x26be27(0x209)+_0x3b2745+'/'+_0x221eba[_0x26be27(0x26c)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x1a6);[a59_0x69291(0x134)]=a59_0x69291(0x186);async[a59_0x69291(0x2fa)](_0x4b3dad){const _0x178120=a59_0x69291,{options:_0x21268a,args:_0x38fe96,tdx:_0x18acf1}=_0x4b3dad;let _0x1f53dd='.',_0x187c37=_0x21268a[_0x178120(0x268)];if(_0x38fe96[0x0]){const {promises:_0x2ad5d0}=await import('fs');try{const _0x5ec94a=await _0x2ad5d0['stat'](_0x38fe96[0x0]);if(_0x5ec94a['isDirectory']())_0x1f53dd=_0x38fe96[0x0];else return console[_0x178120(0x274)](_0x178120(0x2b4)+_0x38fe96[0x0]+_0x178120(0x2d8)),0x1;}catch{_0x187c37=_0x38fe96[0x0],_0x1f53dd='.';}}const _0x55cb65=_0x21268a[_0x178120(0x1db)],_0xb85ec9=_0x21268a[_0x178120(0x2aa)];_0x21268a[_0x178120(0x151)]&&(console['error'](_0x178120(0x198)+_0x1f53dd),_0x187c37&&console[_0x178120(0x274)](_0x178120(0x23a)+_0x187c37),_0x55cb65&&console[_0x178120(0x274)](_0x178120(0x216)+_0x55cb65),_0xb85ec9&&console[_0x178120(0x274)]('Validation:\x20skipped'));const _0x325f28=await withSpinner(_0x178120(0x24e),()=>_0x18acf1['workflow']['push'](_0x1f53dd,{'projectName':_0x187c37,'revision':_0x55cb65,'skipValidation':_0xb85ec9}),{'verbose':_0x21268a['verbose']}),_0x28e595=_0x325f28['data'];return console['error'](_0x178120(0x2fe)+_0x28e595[_0x178120(0x26c)]),console[_0x178120(0x274)](_0x178120(0x1bc)+_0x28e595[_0x178120(0x2c2)]),console['error'](_0x178120(0x1e4)+_0x28e595[_0x178120(0x1db)]),await this['showWorkflowConsoleUrl'](_0x18acf1,_0x28e595[_0x178120(0x26c)],_0x21268a[_0x178120(0x2bf)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x201);[a59_0x69291(0x134)]=a59_0x69291(0x16b);async[a59_0x69291(0x2fa)](_0x4eeccb){const _0x51416f=a59_0x69291,{options:_0x28637d,args:_0x4179ba,tdx:_0x212ca3}=_0x4eeccb,_0x52e0ae=_0x4179ba[0x0],_0x2cbe84=_0x4179ba[0x1];if(!_0x52e0ae)return console[_0x51416f(0x274)](a59_0x34c7bd[_0x51416f(0x2f8)](_0x51416f(0x287)),_0x51416f(0x2be)),console[_0x51416f(0x274)](a59_0x34c7bd[_0x51416f(0x27d)](_0x51416f(0x15a))),0x1;const _0x585cb9=_0x28637d[_0x51416f(0x1db)];_0x28637d[_0x51416f(0x151)]&&(console[_0x51416f(0x274)](_0x51416f(0x17e)+_0x52e0ae),_0x2cbe84&&console[_0x51416f(0x274)](_0x51416f(0x29b)+_0x2cbe84),_0x585cb9&&console[_0x51416f(0x274)](_0x51416f(0x216)+_0x585cb9),_0x28637d[_0x51416f(0x255)]&&console[_0x51416f(0x274)]('Dry\x20run:\x20yes'));const _0x3095f8=await withSpinner('Pulling\x20project\x20'+_0x52e0ae+_0x51416f(0x1c3),()=>_0x212ca3[_0x51416f(0x19a)][_0x51416f(0x130)](_0x52e0ae,{'targetDir':_0x2cbe84,'revision':_0x585cb9}),{'verbose':_0x28637d['verbose']}),_0x4162c8=_0x3095f8[_0x51416f(0x162)];_0x4162c8[_0x51416f(0x301)]?console[_0x51416f(0x274)](_0x51416f(0x276)+_0x4162c8[_0x51416f(0x26c)]):console[_0x51416f(0x274)]('→\x20Project:\x20'+_0x4162c8['projectName']);console[_0x51416f(0x274)](_0x51416f(0x1e4)+_0x4162c8['revision']),console['error'](_0x51416f(0x25a)+(a59_0x28ffa6['relative'](process[_0x51416f(0x2e3)](),_0x4162c8[_0x51416f(0x1e1)])||'.')),console['error']('\x20\x20Changes:\x20'+a59_0x34c7bd[_0x51416f(0x2d5)]('+'+_0x4162c8['summary'][_0x51416f(0x267)]+_0x51416f(0x17f))+',\x20'+(a59_0x34c7bd['yellow']('~'+_0x4162c8[_0x51416f(0x2c8)]['modified']+_0x51416f(0x12d))+',\x20')+(a59_0x34c7bd[_0x51416f(0x2f8)]('-'+_0x4162c8[_0x51416f(0x2c8)][_0x51416f(0x23b)]+'\x20deleted')+',\x20')+(''+a59_0x34c7bd[_0x51416f(0x27d)](_0x4162c8[_0x51416f(0x2c8)][_0x51416f(0x241)]+'\x20unchanged')));for(const _0x59d491 of _0x4162c8[_0x51416f(0x1e8)]){_0x59d491[_0x51416f(0x29d)]===_0x51416f(0x26b)&&_0x59d491[_0x51416f(0x205)]&&(console[_0x51416f(0x274)]('\x0a'+a59_0x34c7bd[_0x51416f(0x251)](_0x51416f(0x1ba)+_0x59d491['path'])),console['error'](_0x59d491['diff']));}if(!_0x4162c8['hasChanges'])return saveSessionContext({'workflow_project':_0x4162c8[_0x51416f(0x26c)]},_0x28637d['session']),console[_0x51416f(0x274)](a59_0x34c7bd[_0x51416f(0x2d5)](_0x51416f(0x211))),console[_0x51416f(0x274)](a59_0x34c7bd['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x4162c8[_0x51416f(0x26c)])),0x0;if(_0x28637d['dryRun'])return console[_0x51416f(0x274)](a59_0x34c7bd[_0x51416f(0x196)](_0x51416f(0x24f))),0x0;if(!_0x28637d[_0x51416f(0x1ae)]){if(!isInteractive())return console['error'](a59_0x34c7bd[_0x51416f(0x2f8)](_0x51416f(0x2f6)),_0x51416f(0x2d1)),console['error'](a59_0x34c7bd[_0x51416f(0x27d)](_0x51416f(0x275))),0x1;const _0x501d7a=await confirmKey(_0x51416f(0x18e));if(!_0x501d7a)return console['error'](a59_0x34c7bd[_0x51416f(0x196)](_0x51416f(0x292)),_0x51416f(0x2b3)),0x1;}await withSpinner('Writing\x20files...',()=>_0x212ca3[_0x51416f(0x19a)][_0x51416f(0x25b)](_0x4162c8,{'revision':_0x585cb9}),{'verbose':_0x28637d[_0x51416f(0x151)]}),saveSessionContext({'workflow_project':_0x4162c8['projectName']},_0x28637d['session']),console[_0x51416f(0x274)](a59_0x34c7bd[_0x51416f(0x2d5)](_0x51416f(0x2a3)));const _0x4565f5=a59_0x28ffa6[_0x51416f(0x1e0)](process[_0x51416f(0x2e3)](),_0x4162c8['targetDir'])||'.';return console[_0x51416f(0x274)](a59_0x34c7bd[_0x51416f(0x27d)](_0x51416f(0x209)+_0x4565f5)),console[_0x51416f(0x274)](a59_0x34c7bd['dim'](_0x51416f(0x1a0)+_0x4162c8[_0x51416f(0x26c)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x272);['description']=a59_0x69291(0x17a);async['execute'](_0x40e182){const _0x4ac6e3=a59_0x69291,{options:_0x2a3134,args:_0x11f908,tdx:_0x4dece6}=_0x40e182,_0x35b8d3=this[_0x4ac6e3(0x1fd)](_0x11f908,_0x2a3134),_0x5925db=_0x2a3134,{revision:_0x3689e1,skipValidation:_0x2c7c64,backfill:_0x5aa654}=_0x5925db,_0x4692ac=_0x5aa654===undefined?undefined:!_0x5aa654;_0x2a3134[_0x4ac6e3(0x151)]&&(_0x35b8d3&&console[_0x4ac6e3(0x274)](_0x4ac6e3(0x260)+_0x35b8d3),_0x3689e1&&console[_0x4ac6e3(0x274)](_0x4ac6e3(0x216)+_0x3689e1),_0x2a3134[_0x4ac6e3(0x255)]&&console['error']('Dry\x20run:\x20yes'),_0x2c7c64&&console[_0x4ac6e3(0x274)]('Validation:\x20skipped'),_0x5aa654&&console[_0x4ac6e3(0x274)](_0x4ac6e3(0x15c)));let _0x7d3cf4;try{_0x7d3cf4=await withSpinner(_0x4ac6e3(0x1e9),()=>_0x4dece6['workflow'][_0x4ac6e3(0x12f)]({'sourceDir':_0x35b8d3,'revision':_0x3689e1,'skipValidation':_0x2c7c64,'skipSchedule':_0x4692ac}),{'verbose':_0x2a3134[_0x4ac6e3(0x151)]});}catch(_0xa3b52b){if(_0xa3b52b instanceof Error&&_0xa3b52b['message'][_0x4ac6e3(0x302)](_0x4ac6e3(0x2dc)))return console[_0x4ac6e3(0x274)](a59_0x34c7bd[_0x4ac6e3(0x2f8)](_0x4ac6e3(0x287)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x2a3134[_0x4ac6e3(0x19c)]?console['error'](a59_0x34c7bd['dim'](_0x4ac6e3(0x1e7)+_0x2a3134[_0x4ac6e3(0x19c)]+_0x4ac6e3(0x15e)+_0x2a3134[_0x4ac6e3(0x19c)]+'\x27')):console[_0x4ac6e3(0x274)](a59_0x34c7bd[_0x4ac6e3(0x27d)](_0x4ac6e3(0x2c6))),0x1;throw _0xa3b52b;}const _0x4cd3e5=_0x7d3cf4[_0x4ac6e3(0x162)];console[_0x4ac6e3(0x274)](_0x4ac6e3(0x247)+_0x4cd3e5[_0x4ac6e3(0x26c)]),console[_0x4ac6e3(0x274)](_0x4ac6e3(0x221)+_0x4cd3e5[_0x4ac6e3(0x213)]),console[_0x4ac6e3(0x274)]('\x20\x20Revision:\x20'+_0x4cd3e5[_0x4ac6e3(0x1db)]),console[_0x4ac6e3(0x274)]('\x20\x20Changes:\x20'+a59_0x34c7bd['green']('+'+_0x4cd3e5[_0x4ac6e3(0x2c8)][_0x4ac6e3(0x267)]+'\x20new')+',\x20'+(a59_0x34c7bd['yellow']('~'+_0x4cd3e5[_0x4ac6e3(0x2c8)][_0x4ac6e3(0x26b)]+_0x4ac6e3(0x12d))+',\x20')+(a59_0x34c7bd['red']('-'+_0x4cd3e5[_0x4ac6e3(0x2c8)]['deleted']+_0x4ac6e3(0x2bb))+',\x20')+(''+a59_0x34c7bd['dim'](_0x4cd3e5['summary'][_0x4ac6e3(0x241)]+_0x4ac6e3(0x1f0))));for(const _0x57de2f of _0x4cd3e5['changes']){_0x57de2f[_0x4ac6e3(0x29d)]===_0x4ac6e3(0x26b)&&_0x57de2f[_0x4ac6e3(0x205)]&&(console['error']('\x0a'+a59_0x34c7bd[_0x4ac6e3(0x251)](_0x4ac6e3(0x1ba)+_0x57de2f[_0x4ac6e3(0x2f0)])),console[_0x4ac6e3(0x274)](_0x57de2f['diff']));}if(!_0x4cd3e5['hasChanges'])return console[_0x4ac6e3(0x274)](a59_0x34c7bd[_0x4ac6e3(0x2d5)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x4ac6e3(0x264)](_0x4dece6,_0x4cd3e5[_0x4ac6e3(0x26c)],_0x2a3134[_0x4ac6e3(0x2bf)]),0x0;if(_0x2a3134[_0x4ac6e3(0x255)])return console[_0x4ac6e3(0x274)](a59_0x34c7bd['yellow']('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x2a3134['yes']){if(!isInteractive())return console[_0x4ac6e3(0x274)](a59_0x34c7bd['red'](_0x4ac6e3(0x2f6)),_0x4ac6e3(0x2d1)),console['error'](a59_0x34c7bd[_0x4ac6e3(0x27d)](_0x4ac6e3(0x275))),0x1;const _0x2933cc=await confirmKey(_0x4ac6e3(0x1e3));if(!_0x2933cc)return console[_0x4ac6e3(0x274)](a59_0x34c7bd['yellow'](_0x4ac6e3(0x292)),_0x4ac6e3(0x249)),0x1;}const _0x236ea5=await withSpinner(_0x4ac6e3(0x182),()=>_0x4dece6['workflow'][_0x4ac6e3(0x16d)](_0x4cd3e5),{'verbose':_0x2a3134[_0x4ac6e3(0x151)]}),_0x3237a0=_0x236ea5[_0x4ac6e3(0x162)];return console[_0x4ac6e3(0x274)](a59_0x34c7bd[_0x4ac6e3(0x2d5)](_0x4ac6e3(0x273))),console['error'](_0x4ac6e3(0x1bc)+_0x3237a0[_0x4ac6e3(0x2c2)]),console[_0x4ac6e3(0x274)](_0x4ac6e3(0x1e4)+_0x3237a0['revision']),await this['showWorkflowConsoleUrl'](_0x4dece6,_0x3237a0['projectName'],_0x2a3134[_0x4ac6e3(0x2bf)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a59_0x69291(0x2ac);[a59_0x69291(0x134)]=a59_0x69291(0x1c7);async[a59_0x69291(0x2fa)](_0x547fd6){const _0x6a6319=a59_0x69291,{options:_0x53bcd8,args:_0x4fb42a,tdx:_0xce07bd}=_0x547fd6,_0x4768ba=this['resolveProjectDir'](_0x4fb42a,_0x53bcd8),_0x2f96f6=_0x53bcd8['name'],_0x236063=_0x53bcd8[_0x6a6319(0x1db)],_0x566e92=_0x53bcd8[_0x6a6319(0x2aa)];if(!_0x4768ba)return console['error'](a59_0x34c7bd['red'](_0x6a6319(0x287)),'Source\x20directory\x20is\x20required'),console[_0x6a6319(0x274)](a59_0x34c7bd[_0x6a6319(0x27d)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x6a6319(0x274)](a59_0x34c7bd['dim'](_0x6a6319(0x192))),0x1;if(!_0x2f96f6)return console[_0x6a6319(0x274)](a59_0x34c7bd[_0x6a6319(0x2f8)]('Error:'),_0x6a6319(0x2e6)),console['error'](a59_0x34c7bd[_0x6a6319(0x27d)](_0x6a6319(0x1c0))),0x1;_0x53bcd8[_0x6a6319(0x151)]&&(console[_0x6a6319(0x274)](_0x6a6319(0x260)+_0x4768ba),console[_0x6a6319(0x274)](_0x6a6319(0x259)+_0x2f96f6),_0x236063&&console[_0x6a6319(0x274)](_0x6a6319(0x216)+_0x236063),_0x53bcd8[_0x6a6319(0x255)]&&console['error'](_0x6a6319(0x178)),_0x566e92&&console[_0x6a6319(0x274)](_0x6a6319(0x1b0)));const _0x440a9c=await withSpinner('Analyzing\x20project...',()=>_0xce07bd[_0x6a6319(0x19a)]['prepareCloneProject'](_0x4768ba,_0x2f96f6,{'revision':_0x236063,'skipValidation':_0x566e92}),{'verbose':_0x53bcd8['verbose']}),_0x157c86=_0x440a9c['data'];console[_0x6a6319(0x274)]('Source:\x20'+_0x157c86[_0x6a6319(0x213)]);_0x157c86[_0x6a6319(0x27c)]&&console['error'](_0x6a6319(0x15d)+_0x157c86[_0x6a6319(0x27c)]);console['error'](_0x6a6319(0x259)+_0x157c86[_0x6a6319(0x214)]),console[_0x6a6319(0x274)]('Revision:\x20'+_0x157c86[_0x6a6319(0x1db)]),console[_0x6a6319(0x274)](_0x6a6319(0x1c8)+_0x157c86[_0x6a6319(0x18f)]);_0x157c86[_0x6a6319(0x226)]&&(console[_0x6a6319(0x274)](a59_0x34c7bd[_0x6a6319(0x196)](_0x6a6319(0x2c9)+_0x157c86[_0x6a6319(0x214)]+_0x6a6319(0x20e)+_0x157c86[_0x6a6319(0x2f2)]+')')),console['error'](a59_0x34c7bd[_0x6a6319(0x196)](_0x6a6319(0x2cb))));if(_0x53bcd8[_0x6a6319(0x255)])return console[_0x6a6319(0x274)](a59_0x34c7bd[_0x6a6319(0x196)](_0x6a6319(0x2f5))),0x0;if(!_0x53bcd8[_0x6a6319(0x1ae)]){if(!isInteractive())return console['error'](a59_0x34c7bd[_0x6a6319(0x2f8)](_0x6a6319(0x2f6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x6a6319(0x274)](a59_0x34c7bd['dim'](_0x6a6319(0x275))),0x1;const _0x3d80f5=_0x157c86['sourceProjectName']||a59_0x28ffa6['basename'](_0x4768ba),_0x2be6d8=_0x157c86[_0x6a6319(0x226)]?_0x6a6319(0x2d4)+_0x2f96f6+_0x6a6319(0x160):_0x6a6319(0x140)+_0x3d80f5+_0x6a6319(0x2e5)+_0x2f96f6+'\x22?',_0x3751e8=await confirmKey(_0x2be6d8);if(!_0x3751e8)return console[_0x6a6319(0x274)](a59_0x34c7bd[_0x6a6319(0x196)](_0x6a6319(0x292))),0x1;}const _0x58316f=await withSpinner(_0x157c86[_0x6a6319(0x226)]?_0x6a6319(0x1dc)+_0x2f96f6+_0x6a6319(0x1c3):_0x6a6319(0x19e)+_0x2f96f6+_0x6a6319(0x1c3),()=>_0xce07bd['workflow']['executeCloneProject'](_0x157c86),{'verbose':_0x53bcd8[_0x6a6319(0x151)]}),_0x12b9d9=_0x58316f[_0x6a6319(0x162)];return console['error'](a59_0x34c7bd['green'](_0x157c86[_0x6a6319(0x226)]?_0x6a6319(0x283):'✔\x20Clone\x20complete')),console[_0x6a6319(0x274)](_0x6a6319(0x223)+_0x12b9d9[_0x6a6319(0x214)]),console[_0x6a6319(0x274)](_0x6a6319(0x1bc)+_0x12b9d9[_0x6a6319(0x289)]),console[_0x6a6319(0x274)]('\x20\x20Revision:\x20'+_0x12b9d9[_0x6a6319(0x1db)]),await this['showWorkflowConsoleUrl'](_0xce07bd,_0x12b9d9['newProjectName'],_0x53bcd8[_0x6a6319(0x2bf)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a59_0x69291(0x268)]='workflow:delete';[a59_0x69291(0x134)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20AI';async['execute'](_0x414ce5){const _0x56b8f7=a59_0x69291,{options:_0x82744d,args:_0x4af2cb,tdx:_0xb70637}=_0x414ce5,_0x4b91c1=_0x4af2cb[0x0];if(!_0x4b91c1)return console[_0x56b8f7(0x274)](_0x56b8f7(0x294)),console[_0x56b8f7(0x274)](_0x56b8f7(0x197)),0x1;_0x82744d[_0x56b8f7(0x151)]&&console[_0x56b8f7(0x274)]('Project:\x20'+_0x4b91c1);if(!_0x82744d[_0x56b8f7(0x1ae)]){if(!isInteractive())return console[_0x56b8f7(0x274)](a59_0x34c7bd[_0x56b8f7(0x2f8)](_0x56b8f7(0x2f6)),_0x56b8f7(0x2d1)),console[_0x56b8f7(0x274)](a59_0x34c7bd[_0x56b8f7(0x27d)](_0x56b8f7(0x275))),0x1;const _0x10c540=await confirmKey(_0x56b8f7(0x18c)+_0x4b91c1+_0x56b8f7(0x1a9));if(!_0x10c540)return console[_0x56b8f7(0x274)](a59_0x34c7bd['yellow']('Cancelled')),0x1;}const _0x3b85c9=await withSpinner(_0x56b8f7(0x2fc)+_0x4b91c1+_0x56b8f7(0x1c3),()=>_0xb70637[_0x56b8f7(0x19a)][_0x56b8f7(0x290)](_0x4b91c1),{'verbose':_0x82744d[_0x56b8f7(0x151)]}),_0x5cc28b=_0x3b85c9[_0x56b8f7(0x162)];return console[_0x56b8f7(0x274)]('✔\x20Deleted\x20project\x20'+_0x5cc28b[_0x56b8f7(0x26c)]),console[_0x56b8f7(0x274)]('\x20\x20Project\x20ID:\x20'+_0x5cc28b[_0x56b8f7(0x2c2)]),0x0;}}export function parseKeyValue(_0x3eb392){const _0x38b767=a59_0x69291,_0x2bb173=_0x3eb392[_0x38b767(0x295)]('=');if(_0x2bb173===-0x1)throw new Error(_0x38b767(0x19b)+_0x3eb392+_0x38b767(0x2ab));const _0x153d4f=_0x3eb392['substring'](0x0,_0x2bb173),_0x510c02=_0x3eb392[_0x38b767(0x1a3)](_0x2bb173+0x1);if(!_0x153d4f)throw new Error(_0x38b767(0x23e));return{'key':_0x153d4f,'value':_0x510c02};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a59_0x69291(0x20c);[a59_0x69291(0x134)]=a59_0x69291(0x13c);async[a59_0x69291(0x2fa)](_0x5e93ab){const _0x775529=a59_0x69291,{options:_0x3f414d,args:_0x3d2922,tdx:_0x8037bd}=_0x5e93ab,_0x2fa2bd=this[_0x775529(0x1ee)](_0x3d2922,_0x3f414d);if(!_0x2fa2bd)return 0x1;_0x3f414d[_0x775529(0x151)]&&console['error']('Project:\x20'+_0x2fa2bd);const _0x32efc2=await withSpinner('Listing\x20secrets...',()=>_0x8037bd[_0x775529(0x19a)][_0x775529(0x16a)](_0x2fa2bd),{'verbose':_0x3f414d[_0x775529(0x151)]}),{secrets:_0x15f42b}=_0x32efc2[_0x775529(0x162)];return console[_0x775529(0x274)]('✔\x20Found\x20'+_0x15f42b[_0x775529(0x204)]+'\x20secret'+(_0x15f42b['length']!==0x1?'s':'')),await handleSDKOutput(_0x15f42b,_0x3f414d),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x28d);[a59_0x69291(0x134)]=a59_0x69291(0x2b5);async[a59_0x69291(0x2fa)](_0x5880e6){const _0xa1a332=a59_0x69291,{options:_0x4f272e,args:_0x2c81f2,tdx:_0x4beba7}=_0x5880e6;let _0x3c9ab6,_0x387e0e;if(_0x2c81f2[_0xa1a332(0x204)]>=0x1&&!_0x2c81f2[0x0][_0xa1a332(0x302)]('='))_0x3c9ab6=_0x2c81f2[0x0],_0x387e0e=_0x2c81f2['slice'](0x1);else{if(_0x2c81f2[_0xa1a332(0x204)]>=0x1&&_0x4f272e['workflowProject'])_0x3c9ab6=_0x4f272e[_0xa1a332(0x19c)],_0x387e0e=_0x2c81f2;else return _0x2c81f2['length']>=0x1?(console['error'](_0xa1a332(0x261)),console[_0xa1a332(0x274)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0xa1a332(0x274)](_0xa1a332(0x15b)),console[_0xa1a332(0x274)](_0xa1a332(0x1cf)),0x1);}if(_0x387e0e[_0xa1a332(0x204)]===0x0)return console['error'](_0xa1a332(0x15b)),console[_0xa1a332(0x274)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1;const _0x1548e8={};try{for(const _0x3b4ffd of _0x387e0e){const {key:_0x18ad4a,value:_0x31c404}=parseKeyValue(_0x3b4ffd);_0x1548e8[_0x18ad4a]=_0x31c404;}}catch(_0x223ef4){return _0x223ef4 instanceof Error&&console[_0xa1a332(0x274)](a59_0x34c7bd[_0xa1a332(0x2f8)]('Error:'),_0x223ef4['message']),0x1;}const _0x284011=Object[_0xa1a332(0x20a)](_0x1548e8);_0x4f272e[_0xa1a332(0x151)]&&(console[_0xa1a332(0x274)]('Project:\x20'+_0x3c9ab6),console['error']('Secrets\x20to\x20set:\x20'+_0x284011[_0xa1a332(0x19d)](',\x20')));const _0x848f1d=await withSpinner(_0x284011[_0xa1a332(0x204)]===0x1?_0xa1a332(0x13b):'Setting\x20'+_0x284011[_0xa1a332(0x204)]+_0xa1a332(0x18d),()=>_0x4beba7[_0xa1a332(0x19a)][_0xa1a332(0x203)](_0x3c9ab6,_0x1548e8),{'verbose':_0x4f272e[_0xa1a332(0x151)]}),_0x1a69d8=_0x848f1d[_0xa1a332(0x162)];return console[_0xa1a332(0x274)](_0x284011[_0xa1a332(0x204)]===0x1?_0xa1a332(0x26d)+_0x1a69d8[_0xa1a332(0x20a)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x1a69d8[_0xa1a332(0x26c)]+'\x27':'✔\x20'+_0x1a69d8['keys'][_0xa1a332(0x204)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x1a69d8[_0xa1a332(0x26c)]+'\x27'),(_0x4f272e[_0xa1a332(0x18b)]||_0x4f272e['jsonl'])&&await handleSingleObjectOutput(_0x1a69d8,_0x4f272e),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x229);[a59_0x69291(0x134)]=a59_0x69291(0x2c5);async[a59_0x69291(0x2fa)](_0x3208fa){const _0x43304a=a59_0x69291,{options:_0xbfb41a,args:_0x5ef52d,tdx:_0x55fde2}=_0x3208fa;let _0x2d1af2,_0x359fcf;if(_0x5ef52d['length']>=0x2)_0x2d1af2=_0x5ef52d[0x0],_0x359fcf=_0x5ef52d[0x1];else{if(_0x5ef52d['length']===0x1&&_0xbfb41a[_0x43304a(0x19c)])_0x2d1af2=_0xbfb41a[_0x43304a(0x19c)],_0x359fcf=_0x5ef52d[0x0];else return _0x5ef52d[_0x43304a(0x204)]===0x1?(console[_0x43304a(0x274)](_0x43304a(0x261)),console[_0x43304a(0x274)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error']('Error:\x20Secret\x20key\x20is\x20required'),console[_0x43304a(0x274)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0xbfb41a['verbose']&&(console['error']('Project:\x20'+_0x2d1af2),console['error'](_0x43304a(0x2f9)+_0x359fcf));if(!_0xbfb41a[_0x43304a(0x1ae)]){if(!isInteractive())return console[_0x43304a(0x274)](a59_0x34c7bd[_0x43304a(0x2f8)](_0x43304a(0x2f6)),_0x43304a(0x2d1)),console[_0x43304a(0x274)](a59_0x34c7bd[_0x43304a(0x27d)](_0x43304a(0x275))),0x1;const _0x39fd22=await confirmKey(_0x43304a(0x14b)+_0x359fcf+_0x43304a(0x1b5)+_0x2d1af2+'\x27?');if(!_0x39fd22)return console[_0x43304a(0x274)](a59_0x34c7bd[_0x43304a(0x196)]('Cancelled')),0x1;}const _0x50ace8=await withSpinner(_0x43304a(0x163),()=>_0x55fde2[_0x43304a(0x19a)][_0x43304a(0x281)](_0x2d1af2,_0x359fcf),{'verbose':_0xbfb41a[_0x43304a(0x151)]}),_0xaffddc=_0x50ace8[_0x43304a(0x162)];return console[_0x43304a(0x274)](_0x43304a(0x26d)+_0xaffddc[_0x43304a(0x243)]+_0x43304a(0x1d4)+_0xaffddc[_0x43304a(0x26c)]+'\x27'),(_0xbfb41a[_0x43304a(0x18b)]||_0xbfb41a[_0x43304a(0x1d8)])&&await handleSingleObjectOutput(_0xaffddc,_0xbfb41a),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 a59_0x5020(){const _0x13b5f9=['jsonl','renderSessionsTimeline','Resolving\x20project\x20\x27','revision','Updating\x20','table','Kill\x20a\x20running\x20attempt','Workflow:','relative','targetDir','buildTimelineData','\x0aPush\x20these\x20changes?','\x20\x20Revision:\x20','includeRetried','fill','Tip:\x20cd\x20to\x20workflows/','changes','Analyzing\x20changes...','Retry\x20a\x20session\x20or\x20attempt','all','resolveProjectId','\x20enabled\x20(','requireProject','Target:\x20','\x20unchanged','resolveProject','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','Using\x20attempt\x20','match','\x0aPolling...\x20(','LABEL_WIDTH_DIVISOR','index','createdAt','min','Listing\x20workflow\x20attempts...','durationMs','MAX_TASKS_DISPLAY','resolveProjectDir','Session\x20time:','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','retrySession','workflow:pull','trim','setSecrets','length','diff','isTTY','output','skipSchedule','\x20\x20Location:\x20','keys','Including\x20subtasks:\x20yes','workflow:secrets:list','Listing\x20workflow\x20projects...','\x22\x20already\x20exists\x20(ID:\x20','✔\x20Schedule\x20#','success','\x0a✔\x20Already\x20up\x20to\x20date','\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.','sourceDir','newProjectName','\x20\x20Attempt\x20ID:\x20','Revision:\x20','attempt','Retrying\x20attempt...','6312747RpMHaJ','Filter:\x20','attemptId','No\x20attempts\x20found\x20in\x20project:\x20','\x20session','renderSingleTimeline','status','sessionId','\x20\x20Source:\x20','title','\x20\x20Project:\x20','📋\x20','workflow:schedules','targetExists','No\x20workflows\x20found\x20in\x20project:\x20','Select\x20a\x20workflow\x20to\x20run','workflow:secrets:delete','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','MAX_LABEL_COUNT','✔\x20Workflow\x20project\x20context\x20cleared.','3418840EzgxXJ','startsWith','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','has','toLowerCase','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','parse','kill','project','\x20workflow','group_error','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','nextRunTime','Project\x20name:\x20','deleted','No\x20sessions\x20found\x20in\x20project:\x20','Listing\x20schedules...','Key\x20cannot\x20be\x20empty','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','displayLine','unchanged','Starting\x20workflow\x20run...','key','\x20attempt','workflow:logs','No\x20log\x20files\x20found\x20for\x20this\x20attempt','✔\x20Project:\x20','get','-\x20nothing\x20pushed','logFiles','icon','✔\x20Retry\x20started','\x20project','Pushing\x20workflow\x20project...','\x0aDry\x20run\x20-\x20no\x20files\x20written','Params:\x20','cyan','12695rTKvth','unknown','workflow:download','dryRun','workflow:workflows','No\x20schedules\x20found','getHours','New\x20project\x20name:\x20','\x20\x20Target:\x20','applyPullProject','msPerChar','params','padStart','💡\x20Tip:\x20Use\x20','Source\x20directory:\x20','Error:\x20Project\x20name\x20is\x20required','POLL_INTERVAL_MS','\x20(use\x20a\x20larger\x20--limit\x20to\x20show\x20more)','showWorkflowConsoleUrl','finishedAt','cancelRequested','new','name','blue','pending','modified','projectName','✔\x20Secret\x20\x27','startedAt','No\x20matching\x20sessions\x20found','Attempt\x20ID:\x20','⚠\x20Showing\x20first\x20','workflow:push','✔\x20Push\x20complete','error','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','→\x20New\x20project:\x20','Expected\x20format:\x20--param\x20key=value','\x20task','sort','MIN_LABEL_COUNT','Download\x20workflow\x20project\x20from\x20Treasure\x20AI','sourceProjectName','dim','workflow:tasks','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Workflow:\x20','deleteSecret','No\x20workflows\x20found','✔\x20Project\x20updated','pollTimeline','readFile','localeCompare','Error:','stringify','newProjectId','session','done','614453TNuqaK','workflow:secrets:set','Retrying\x20session...','🔄\x20','delete','5908608gBLDyQ','Cancelled','end','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','indexOf','log','workflow:projects','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','1630qxfcFz','autocomplete','Target\x20directory:\x20','write','type','\x20has\x20no\x20attempts','lastAttempt','disableSchedule','List\x20workflow\x20attempts','start','✔\x20Pull\x20complete','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','stdout','Total:\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','rows','getFullYear','skipValidation','.\x20Expected\x20format:\x20KEY=VALUE','workflow:clone','format','Show\x20tasks\x20for\x20an\x20attempt','getWorkflow','context','fileSize','renderTimeline','-\x20no\x20files\x20written','Error:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Usage:\x20tdx\x20wf\x20schedule\x20list\x20[project[.workflow]]\x20|\x20--schedule-id\x20<id>','run','executeDryRun','white','clear','\x20deleted','\x20sessions\x20','\x0a✔\x20Attempt\x20complete','Project\x20name\x20is\x20required','site','\x20disabled\x20(','floor','projectId','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','every','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','summary','\x0a⚠\x20Project\x20\x22','\x20from\x20session\x20','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)','\x20\x20Workflow:\x20','No\x20sessions\x20found\x20for:\x20','logs','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20-\x20','total','\x0aUpdate\x20existing\x20project\x20\x22','green','Task\x20graph:','planned','\x20is\x20not\x20a\x20directory','\x20\x20tdx\x20wf\x20use\x20<project>','getMinutes','limit','No\x20workflow\x20tdx.json\x20found','size','from','attempt:','workflow:timeline','(use\x20--limit\x20to\x20see\x20more)','session_id','cwd','taskName','\x22\x20to\x20new\x20project\x20\x22','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Loading\x20sessions...','93210IQiXrC','list','Listing\x20workflows...','values','push','✔\x20Schedule\x20found','slice','some','path','generateSessionTimelineRows','existingProjectId','getSchedule','List\x20workflow\x20schedules','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x0aError:','getDate','red','Key:\x20','execute','task','Deleting\x20project\x20','ICON_WIDTH','✔\x20Pushed\x20','fullName','window','isNewProject','includes','Disabling\x20schedule\x20#','No\x20sessions\x20with\x20timing\x20information','\x20modified','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','preparePushProject','pullProject','fs/promises','disabledAt','\x20next:\x20','description','Select\x20a\x20session\x20to\x20view\x20timeline:','workflow:schedule:disable','Status:\x20','Error:\x20Attempt\x20ID\x20is\x20required','Loading\x20workflows...','round','Setting\x20secret...','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','\x20\x20Console:\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','follow','\x0aClone\x20\x22','No\x20projects\x20match\x20pattern:\x20','Failed\x20to\x20fetch\x20attempt\x20data','updatedAt','workflow:schedule:enable','sessions','/sessions/','Loading\x20session...','Show\x20logs\x20for\x20a\x20workflow\x20attempt','navigateSessionsInteractive','Usage:\x20tdx\x20wf\x20use\x20<project>','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','22WEqGWO','now','Include\x20retried:\x20yes','max','Auto-selected\x20latest\x20session:\x20','verbose','running','startTime','enableSchedule','sessionTime','Fetching\x20schedule\x20#','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','(unknown)','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Schedule:\x20backfill\x20runs\x20enabled\x20(--backfill)','Source\x20project:\x20','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','\x20\x20Next\x20run:\x20','\x22\x20with\x20new\x20revision?','Filter:\x20project=','data','Deleting\x20secret...','✔\x20Found\x20','Downloading\x20project\x20','Task\x20name:\x20','\x20(system)','Force:\x20yes','getMonth','listSecrets','Pull\x20workflow\x20project\x20to\x20local\x20folder','Attempt:\x20','executePushProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Resume\x20from:\x20','No\x20attempts\x20found','TASK_NAME_WIDTH','find','canceling','List\x20workflows','resumeFrom','config','download','Dry\x20run:\x20yes','MAX_TIMELINE_WIDTH','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20AI','Listing\x20workflow\x20sessions...','110349TBDYjP','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Project:\x20','\x20new','force','repeat','Pushing\x20project...','workflow:attempt','tasks','Fetching\x20log\x20files...','Upload\x20workflow\x20project\x20to\x20Treasure\x20AI\x20(digdag-style)','revision:\x20','\x20(use\x20--limit\x20to\x20show\x20more)',',\x20Workflow:\x20','Session\x20','json','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x20secrets...','\x0aApply\x20these\x20changes?','fileCount','No\x20sessions\x20found','\x20\x20Session\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','session:','Downloading\x20logs...','duration','yellow','Usage:\x20workflow:delete\x20<project-name-or-id>','Project\x20directory:\x20','Killing\x20attempt...','workflow','Invalid\x20format:\x20','workflowProject','join','Cloning\x20to\x20','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x20\x20Session\x20context\x20set\x20to:\x20','replace','retryAttemptName','substring','No\x20log\x20content\x20found','parseProjectWorkflowPattern','workflow:upload','param','Enabling\x20schedule\x20#','\x22?\x20This\x20cannot\x20be\x20undone.','state','workflowName','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','workflow:attempts','yes','listSchedules','Validation:\x20skipped','fromTask','Output\x20directory:\x20','getTime','2268fjSsIu','\x27\x20from\x20project\x20\x27','metadata','filter','map','columns','---\x20','toISOString','\x20\x20Project\x20ID:\x20','✔\x20Downloaded\x20','workflow:retry','LABEL_MIN_SPACING','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','tdx\x20wf\x20attempt\x20','workflow:kill','...','toLocaleString','📅\x20#','Show\x20specific\x20attempt\x20details','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Files\x20to\x20upload:\x20','workflow:use','utf-8','workflows','split','tdx.json','Schedule\x20ID\x20is\x20required','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','set','bold','text','--schedule-id\x20cannot\x20be\x20combined\x20with\x20a\x20project.workflow\x20filter','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Session\x20time:\x20','List\x20workflow\x20execution\x20sessions','sys'];a59_0x5020=function(){return _0x13b5f9;};return a59_0x5020();}function formatElapsed(_0x5ef5d2){const _0x1651cb=a59_0x69291,_0x2b1c72=Math['floor'](_0x5ef5d2/0x3e8),_0x4bb6fd=Math[_0x1651cb(0x2c1)](_0x2b1c72/0x3c),_0xaee7d4=Math['floor'](_0x4bb6fd/0x3c),_0x423d61=Math[_0x1651cb(0x2c1)](_0xaee7d4/0x18);if(_0x423d61>0x0){const _0x4d6b9f=_0xaee7d4%0x18;return _0x4d6b9f>0x0?_0x423d61+'d\x20'+_0x4d6b9f+'h':_0x423d61+'d';}else{if(_0xaee7d4>0x0){const _0x475615=_0x4bb6fd%0x3c;return _0x475615>0x0?_0xaee7d4+'h\x20'+_0x475615+'m':_0xaee7d4+'h';}else{if(_0x4bb6fd>0x0){const _0x3cd501=_0x2b1c72%0x3c;return _0x3cd501>0x0?_0x4bb6fd+'m\x20'+_0x3cd501+'s':_0x4bb6fd+'m';}else return _0x2b1c72+'s';}}}function formatTimestamp(_0x48bfcf,_0x2bd311){const _0x113d22=a59_0x69291,_0x2d577e=new Date(_0x48bfcf),_0x2790c5=String(_0x2d577e[_0x113d22(0x258)]())['padStart'](0x2,'0'),_0x538b10=String(_0x2d577e[_0x113d22(0x2da)]())[_0x113d22(0x25e)](0x2,'0'),_0x174b72=_0x2790c5+':'+_0x538b10,_0x18f580=_0x2d577e[_0x113d22(0x2a9)]()===_0x2bd311[_0x113d22(0x2a9)]()&&_0x2d577e['getMonth']()===_0x2bd311[_0x113d22(0x169)]()&&_0x2d577e[_0x113d22(0x2f7)]()===_0x2bd311[_0x113d22(0x2f7)]();if(_0x18f580)return _0x174b72;else{const _0x43d334=String(_0x2d577e[_0x113d22(0x169)]()+0x1)[_0x113d22(0x25e)](0x2,'0'),_0x386e16=String(_0x2d577e[_0x113d22(0x2f7)]())[_0x113d22(0x25e)](0x2,'0');return _0x43d334+'-'+_0x386e16+'\x20'+_0x174b72;}}function formatDate(_0x9117d7){const _0x231352=a59_0x69291,_0x4651de=_0x9117d7[_0x231352(0x2a9)](),_0x2ae579=String(_0x9117d7[_0x231352(0x169)]()+0x1)[_0x231352(0x25e)](0x2,'0'),_0x5e29bd=String(_0x9117d7['getDate']())[_0x231352(0x25e)](0x2,'0');return _0x4651de+'-'+_0x2ae579+'-'+_0x5e29bd;}function getTaskStateIcon(_0x3464d5){const _0x582665={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x582665[_0x3464d5]||'⚪';}function getBarChar(_0x386942){const _0x39921f=a59_0x69291;return _0x386942===_0x39921f(0x274)||_0x386942===_0x39921f(0x237)?'×':'─';}function getBarColor(_0x4c0c88){const _0x22314d=a59_0x69291,_0x5e7ff1={'success':a59_0x34c7bd['green'],'error':a59_0x34c7bd[_0x22314d(0x2f8)],'group_error':a59_0x34c7bd[_0x22314d(0x2f8)],'running':a59_0x34c7bd[_0x22314d(0x269)],'blocked':a59_0x34c7bd[_0x22314d(0x196)],'planned':a59_0x34c7bd[_0x22314d(0x27d)],'canceling':a59_0x34c7bd[_0x22314d(0x196)]};return _0x5e7ff1[_0x4c0c88]||a59_0x34c7bd[_0x22314d(0x2b9)];}function parseTaskName(_0x495347){const _0x2cf043=a59_0x69291;let _0xea9f4e=_0x495347[_0x2cf043(0x1a1)](/^\++/,'');const _0x42fb74=_0xea9f4e[_0x2cf043(0x1cc)]('+'),_0x4d4071=_0x42fb74[_0x2cf043(0x204)]>0x1?_0x42fb74[_0x2cf043(0x204)]-0x2:0x0,_0x320ae4=_0x42fb74[_0x42fb74[_0x2cf043(0x204)]-0x1]||_0xea9f4e;return{'level':_0x4d4071,'name':'+'+_0x320ae4};}function a59_0x2c40(_0x2bac8e,_0x3d9b57){_0x2bac8e=_0x2bac8e-0x12d;const _0x50204f=a59_0x5020();let _0x2c4051=_0x50204f[_0x2bac8e];return _0x2c4051;}function truncateTaskName(_0xf25174,_0x5560c1){const _0x4c91f9=a59_0x69291,_0x2ee9bf=stringWidth(_0xf25174);if(_0x2ee9bf<=_0x5560c1)return _0xf25174;let _0x5d889e=_0xf25174;while(stringWidth(_0x5d889e+'…')>_0x5560c1&&_0x5d889e[_0x4c91f9(0x204)]>0x0){_0x5d889e=_0x5d889e[_0x4c91f9(0x2ee)](0x0,-0x1);}return _0x5d889e+'…';}function calculateTimeScale(_0x486b4f,_0x48ce43){const _0x3217ce=a59_0x69291;return{'startTime':_0x486b4f[_0x3217ce(0x2a2)],'endTime':_0x486b4f[_0x3217ce(0x293)],'durationMs':_0x486b4f[_0x3217ce(0x195)],'msPerChar':_0x486b4f[_0x3217ce(0x195)]/_0x48ce43};}function timeToPosition(_0x227710,_0x2aea15,_0x4a29eb){const _0xa204bf=a59_0x69291,_0x3cd907=_0x227710-_0x2aea15['startTime'],_0x3a2a86=Math['floor'](_0x3cd907/_0x2aea15[_0xa204bf(0x25c)]);return Math[_0xa204bf(0x14f)](0x0,Math[_0xa204bf(0x1f9)](_0x3a2a86,_0x4a29eb));}function renderTimeAxis(_0x29cd11,_0x5c7c6e){const _0x2129e1=a59_0x69291,_0x5c38d9=Math[_0x2129e1(0x1f9)](TIMELINE_CONFIG[_0x2129e1(0x22b)],Math[_0x2129e1(0x14f)](TIMELINE_CONFIG[_0x2129e1(0x27a)],Math[_0x2129e1(0x2c1)](_0x5c7c6e/TIMELINE_CONFIG[_0x2129e1(0x1f6)]))),_0x253855=_0x29cd11[_0x2129e1(0x1fb)]/(_0x5c38d9-0x1),_0x2e87ed=new Date(_0x29cd11[_0x2129e1(0x153)]),_0x22cc78=[];for(let _0x1e0c4a=0x0;_0x1e0c4a<_0x5c38d9;_0x1e0c4a++){const _0x29a585=_0x29cd11[_0x2129e1(0x153)]+_0x1e0c4a*_0x253855,_0x48a779=timeToPosition(_0x29a585,_0x29cd11,_0x5c7c6e),_0x1d496d=formatTimestamp(_0x29a585,_0x2e87ed);_0x22cc78[_0x2129e1(0x2ec)]({'pos':_0x48a779,'text':_0x1d496d});}const _0x2f8e15=new Array(_0x5c7c6e)[_0x2129e1(0x1e6)]('\x20');let _0x51b30c=-0x1;for(const {pos:_0x5f5bc2,text:_0x354a5}of _0x22cc78){let _0x5abb7e=Math[_0x2129e1(0x14f)](0x0,_0x5f5bc2-Math[_0x2129e1(0x2c1)](_0x354a5[_0x2129e1(0x204)]/0x2));_0x5abb7e<=_0x51b30c+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x5abb7e=_0x51b30c+TIMELINE_CONFIG[_0x2129e1(0x1bf)]+0x1);_0x5abb7e+_0x354a5[_0x2129e1(0x204)]>_0x5c7c6e&&(_0x5abb7e=_0x5c7c6e-_0x354a5[_0x2129e1(0x204)]);if(_0x5abb7e>=0x0&&_0x5abb7e+_0x354a5[_0x2129e1(0x204)]<=_0x5c7c6e&&_0x5abb7e>_0x51b30c){for(let _0x51479e=0x0;_0x51479e<_0x354a5[_0x2129e1(0x204)];_0x51479e++){_0x2f8e15[_0x5abb7e+_0x51479e]=_0x354a5[_0x51479e];}_0x51b30c=_0x5abb7e+_0x354a5[_0x2129e1(0x204)]-0x1;}}return _0x2f8e15[_0x2129e1(0x19d)]('');}function renderTaskRow(_0x5475b5,_0x4375c5,_0x455b9f,_0x2d8fce){const _0x41e62f=a59_0x69291,{level:_0x994f6e,name:_0x545de4}=parseTaskName(_0x5475b5[_0x41e62f(0x268)]),_0x324d05='\x20'[_0x41e62f(0x181)](_0x994f6e),_0x1ccb30=_0x5475b5['window']?'('+formatElapsed(_0x5475b5[_0x41e62f(0x300)][_0x41e62f(0x195)])+')':'',_0x1501d7=stringWidth(_0x1ccb30),_0x313beb=_0x994f6e*0x1,_0x45320e=_0x2d8fce-_0x313beb-_0x1501d7-0x1,_0x2edfeb=truncateTaskName(_0x545de4,_0x45320e),_0x2cc5e2=_0x324d05+_0x2edfeb,_0x75e6fc=stringWidth(_0x2cc5e2),_0x143441=_0x2d8fce-_0x75e6fc-_0x1501d7,_0x1772d1=_0x2cc5e2+'\x20'[_0x41e62f(0x181)](Math[_0x41e62f(0x14f)](0x1,_0x143441))+a59_0x34c7bd[_0x41e62f(0x27d)](_0x1ccb30),_0x291991=getTaskStateIcon(_0x5475b5[_0x41e62f(0x1aa)]),_0x47868a=new Array(_0x455b9f)[_0x41e62f(0x1e6)]('\x20');if(_0x5475b5[_0x41e62f(0x300)]){const _0xb6248b=timeToPosition(_0x5475b5[_0x41e62f(0x300)][_0x41e62f(0x2a2)],_0x4375c5,_0x455b9f),_0x42e72c=timeToPosition(_0x5475b5[_0x41e62f(0x300)][_0x41e62f(0x293)],_0x4375c5,_0x455b9f),_0x5bd1b8=getBarChar(_0x5475b5[_0x41e62f(0x1aa)]),_0x56a2fb=Math[_0x41e62f(0x14f)](_0xb6248b+0x1,_0x42e72c);for(let _0x59a410=_0xb6248b;_0x59a410<Math[_0x41e62f(0x1f9)](_0x56a2fb,_0x455b9f);_0x59a410++){_0x47868a[_0x59a410]=_0x5bd1b8;}}const _0x19cb9a=getBarColor(_0x5475b5[_0x41e62f(0x1aa)]),_0x7eab6a=_0x47868a['map'](_0x24730c=>_0x24730c==='\x20'?'\x20':_0x19cb9a(_0x24730c))[_0x41e62f(0x19d)]('');return _0x291991+'\x20'+_0x1772d1+'│'+_0x7eab6a+'│';}function calculateStats(_0xfdb242){const _0x2f1aaf=a59_0x69291,_0x165184={'total':_0xfdb242[_0x2f1aaf(0x204)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0xe7beb0 of _0xfdb242){if(_0xe7beb0[_0x2f1aaf(0x1aa)]===_0x2f1aaf(0x210))_0x165184['success']++;else{if(_0xe7beb0[_0x2f1aaf(0x1aa)]==='error'||_0xe7beb0[_0x2f1aaf(0x1aa)]===_0x2f1aaf(0x237))_0x165184[_0x2f1aaf(0x274)]++;else _0xe7beb0['state']===_0x2f1aaf(0x152)?_0x165184['running']++:_0x165184[_0x2f1aaf(0x26a)]++;}}return _0x165184;}function formatStats(_0x5b0bea){const _0xa78f45=a59_0x69291;return[_0xa78f45(0x2a6)+_0x5b0bea[_0xa78f45(0x2d3)],'✅\x20'+_0x5b0bea[_0xa78f45(0x210)],'❌\x20'+_0x5b0bea['error'],_0xa78f45(0x28f)+_0x5b0bea[_0xa78f45(0x152)],'⏳\x20'+_0x5b0bea[_0xa78f45(0x26a)]][_0xa78f45(0x19d)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x2e0);[a59_0x69291(0x134)]=a59_0x69291(0x158);async[a59_0x69291(0x2fa)](_0x599ad7){const _0x1b79dc=a59_0x69291,{options:_0x402932,args:_0x497baf,tdx:_0x4db04b}=_0x599ad7;let _0x36188b,_0x503e4c,_0x54b5ba=![];if(_0x497baf[0x0]){if(_0x497baf[0x0][_0x1b79dc(0x302)]('.')){const _0x5d11f8=this[_0x1b79dc(0x1a5)](_0x497baf,_0x402932);if(!_0x5d11f8)return 0x1;_0x36188b=_0x5d11f8[_0x1b79dc(0x26c)],_0x503e4c=_0x5d11f8[_0x1b79dc(0x1ab)];}else{_0x503e4c=_0x497baf[0x0],_0x36188b=_0x402932['workflowProject'];if(!_0x36188b)return console[_0x1b79dc(0x274)](a59_0x34c7bd[_0x1b79dc(0x2f8)](_0x1b79dc(0x287)),_0x1b79dc(0x232)),0x1;_0x54b5ba=!![];}}else{const _0x9e6889=this[_0x1b79dc(0x1a5)](_0x497baf,_0x402932);if(!_0x9e6889)return 0x1;_0x36188b=_0x9e6889[_0x1b79dc(0x26c)],_0x503e4c=_0x9e6889[_0x1b79dc(0x1ab)];}if(_0x402932['verbose']){if(_0x36188b&&_0x503e4c)console['error'](_0x1b79dc(0x21a)+_0x36188b+'.'+_0x503e4c);else _0x36188b&&console[_0x1b79dc(0x274)](_0x1b79dc(0x161)+_0x36188b);}const _0x7aeef0=_0x402932[_0x1b79dc(0x21b)],_0x213a85=_0x402932['sessionId'];if(_0x7aeef0){_0x213a85&&console['error'](a59_0x34c7bd[_0x1b79dc(0x196)]('Warning:'),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x14dcb9=_0x402932[_0x1b79dc(0x13f)];return _0x14dcb9?await this[_0x1b79dc(0x284)](_0x599ad7,_0x7aeef0):await this['renderSingleTimeline'](_0x599ad7,_0x7aeef0,_0x402932),0x0;}if(_0x213a85){const _0x5e0a8a=await withSpinner(_0x1b79dc(0x147),()=>_0x4db04b[_0x1b79dc(0x19a)]['sessions']({'projectName':_0x36188b,'workflowName':_0x503e4c,'limit':0x64}),{'verbose':_0x402932[_0x1b79dc(0x151)]}),_0x1907e1=_0x5e0a8a['data'][_0x1b79dc(0x172)](_0x288ca5=>_0x288ca5['id']===_0x213a85);if(!_0x1907e1)return console['error'](a59_0x34c7bd[_0x1b79dc(0x2f8)](_0x1b79dc(0x287)),'Session\x20not\x20found:\x20'+_0x213a85),0x1;if(!_0x1907e1['lastAttempt']?.['id'])return console[_0x1b79dc(0x274)](a59_0x34c7bd[_0x1b79dc(0x2f8)]('Error:'),_0x1b79dc(0x18a)+_0x213a85+_0x1b79dc(0x29e)),0x1;const _0xb6f395=_0x1907e1['lastAttempt']['id'];_0x402932['verbose']&&console[_0x1b79dc(0x274)](_0x1b79dc(0x1f3)+_0xb6f395+_0x1b79dc(0x2ca)+_0x213a85);const _0x7c4511=_0x402932[_0x1b79dc(0x13f)];return _0x7c4511?await this[_0x1b79dc(0x284)](_0x599ad7,_0xb6f395):await this['renderSingleTimeline'](_0x599ad7,_0xb6f395,_0x402932),0x0;}const _0x6d3c83=await withSpinner(_0x1b79dc(0x2e7),()=>_0x4db04b[_0x1b79dc(0x19a)][_0x1b79dc(0x145)]({'projectName':_0x36188b,'workflowName':_0x503e4c,'limit':_0x402932[_0x1b79dc(0x2db)]||0x32}),{'verbose':_0x402932['verbose']}),_0x1d7cd7=_0x6d3c83['data'];if(_0x1d7cd7[_0x1b79dc(0x204)]===0x0){if(_0x36188b&&_0x503e4c)console[_0x1b79dc(0x274)]('No\x20sessions\x20found\x20for:\x20'+_0x36188b+'.'+_0x503e4c);else _0x36188b?console[_0x1b79dc(0x274)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x36188b):(console['error']('No\x20workflow\x20sessions\x20found'),console[_0x1b79dc(0x274)](a59_0x34c7bd[_0x1b79dc(0x27d)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x1d7cd7[_0x1b79dc(0x279)]((_0x231d52,_0x4dca1c)=>{const _0x137b1c=_0x1b79dc,_0x196fd6=_0x231d52['sessionTime']||'',_0x54740d=_0x4dca1c['sessionTime']||'';return _0x54740d[_0x137b1c(0x286)](_0x196fd6);});if(_0x402932[_0x1b79dc(0x18b)]||_0x402932[_0x1b79dc(0x1d8)])return await handleSDKOutput(_0x1d7cd7,_0x402932),0x0;let _0x19c5f9;if(_0x54b5ba){const _0x480557=_0x1d7cd7[0x0];if(!_0x480557[_0x1b79dc(0x29f)]?.['id'])return console['error']('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x19c5f9=_0x480557[_0x1b79dc(0x29f)]['id'],_0x402932[_0x1b79dc(0x151)]&&console[_0x1b79dc(0x274)](_0x1b79dc(0x150)+_0x480557[_0x1b79dc(0x155)]);}else{const _0x12d6c2=_0x1d7cd7[_0x1b79dc(0x1b8)](_0x1295b7=>{const _0x12989c=_0x1b79dc,_0x3d2af9=getAttemptStatusDisplay(_0x1295b7[_0x12989c(0x29f)]);return{'title':_0x1295b7[_0x12989c(0x235)]?.[_0x12989c(0x268)]+'.'+_0x1295b7[_0x12989c(0x19a)]?.[_0x12989c(0x268)]+'\x20-\x20'+_0x1295b7[_0x12989c(0x155)]+'\x20'+_0x3d2af9[_0x12989c(0x24b)],'value':_0x1295b7[_0x12989c(0x29f)]?.['id']||'','description':_0x3d2af9[_0x12989c(0x1d2)]};}),_0xd2b8a8=await a59_0x3da1fb({'type':'select','name':_0x1b79dc(0x21b),'message':_0x1b79dc(0x135),'choices':_0x12d6c2['filter'](_0x134930=>_0x134930['value']!=='')});if(!_0xd2b8a8[_0x1b79dc(0x21b)])return 0x0;_0x19c5f9=_0xd2b8a8['attemptId'];}const _0x36a6dc=_0x402932[_0x1b79dc(0x13f)];return _0x36a6dc?await this['pollTimeline'](_0x599ad7,_0x19c5f9):await this[_0x1b79dc(0x21e)](_0x599ad7,_0x19c5f9,_0x402932),0x0;}async[a59_0x69291(0x21e)](_0x1b28cd,_0x292d76,_0x25f7ea){const _0x36ad24=a59_0x69291,{tdx:_0x4b00ac}=_0x1b28cd;let _0x512ea9,_0x101041;try{[_0x512ea9,_0x101041]=await Promise[_0x36ad24(0x1eb)]([_0x4b00ac[_0x36ad24(0x19a)][_0x36ad24(0x217)](_0x292d76),_0x4b00ac['workflow'][_0x36ad24(0x184)](_0x292d76,![])]);}catch(_0x4fcd85){console[_0x36ad24(0x274)](a59_0x34c7bd['red'](_0x36ad24(0x142)));_0x25f7ea[_0x36ad24(0x151)]&&console[_0x36ad24(0x274)](_0x4fcd85);throw _0x4fcd85;}if(_0x25f7ea[_0x36ad24(0x18b)]||_0x25f7ea[_0x36ad24(0x1d8)]){const _0x1f66ed=this[_0x36ad24(0x1e2)](_0x512ea9,_0x101041);await handleSDKOutput([_0x1f66ed],_0x25f7ea);return;}const _0x88fcb1=_0x4b00ac[_0x36ad24(0x2b0)][_0x36ad24(0x2bf)],_0x40c53a=this[_0x36ad24(0x2b2)](_0x512ea9,_0x101041,_0x88fcb1);console[_0x36ad24(0x296)](_0x40c53a);}async[a59_0x69291(0x284)](_0x58080a,_0x3844b5){const _0x3eafac=a59_0x69291,{tdx:_0x3d8904}=_0x58080a,_0x3775f6=TIMELINE_CONFIG[_0x3eafac(0x262)],_0x588449=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x308301=0x0;while(_0x308301<_0x588449){process['stdout']['isTTY']&&process[_0x3eafac(0x2a5)]['write']('\x1Bc');let _0x1e8467,_0x1c83d3;try{[_0x1e8467,_0x1c83d3]=await Promise[_0x3eafac(0x1eb)]([_0x3d8904[_0x3eafac(0x19a)][_0x3eafac(0x217)](_0x3844b5),_0x3d8904[_0x3eafac(0x19a)][_0x3eafac(0x184)](_0x3844b5,![])]);}catch(_0x3c6946){console[_0x3eafac(0x274)](a59_0x34c7bd[_0x3eafac(0x2f8)](_0x3eafac(0x157)));_0x308301>0x0&&console[_0x3eafac(0x274)](a59_0x34c7bd[_0x3eafac(0x27d)](_0x3eafac(0x19f)+_0x308301));throw _0x3c6946;}const _0x6bcddd=_0x3d8904[_0x3eafac(0x2b0)]['site'],_0x2e4926=this[_0x3eafac(0x2b2)](_0x1e8467,_0x1c83d3,_0x6bcddd);console[_0x3eafac(0x296)](_0x2e4926);const _0x29df27=_0x1e8467[_0x3eafac(0x28b)]&&_0x1c83d3[_0x3eafac(0x2c4)](_0x54db7c=>_0x54db7c['state']!=='running'&&_0x54db7c[_0x3eafac(0x1aa)]!==_0x3eafac(0x2d7));if(_0x29df27){console['error'](a59_0x34c7bd[_0x3eafac(0x2d5)](_0x3eafac(0x2bd)));break;}console[_0x3eafac(0x274)](a59_0x34c7bd[_0x3eafac(0x27d)](_0x3eafac(0x1f5)+_0x308301*0x2+_0x3eafac(0x13e))),await new Promise(_0x42cd26=>setTimeout(_0x42cd26,_0x3775f6)),_0x308301++;}_0x308301>=_0x588449&&console['error'](a59_0x34c7bd[_0x3eafac(0x196)](_0x3eafac(0x17d)));}[a59_0x69291(0x2b2)](_0x10d42a,_0x3d47e7,_0x5ee4e3){const _0x293ddb=a59_0x69291,_0x11a09d=[],_0x1f47a8=TIMELINE_CONFIG[_0x293ddb(0x171)],_0x414696=0x5,_0x29a79d=process['stdout'][_0x293ddb(0x1b9)]||0x78,_0x3f19b3=_0x29a79d-_0x1f47a8-_0x414696,_0x14ce3c=Math[_0x293ddb(0x14f)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math[_0x293ddb(0x1f9)](_0x3f19b3,TIMELINE_CONFIG[_0x293ddb(0x179)])),_0x147219=new Date(_0x10d42a[_0x293ddb(0x1f8)])['getTime'](),_0x3effe8=_0x10d42a['finishedAt']?new Date(_0x10d42a['finishedAt'])[_0x293ddb(0x1b3)]():Date[_0x293ddb(0x14d)](),_0x1b1d5d={'start':_0x147219,'end':_0x3effe8,'duration':_0x3effe8-_0x147219},_0xf7752e=new Map(),_0x4aaec4=[];for(const _0x530942 of _0x3d47e7){if(_0x530942['startedAt']){const _0x4e05a0=new Date(_0x530942[_0x293ddb(0x26e)])['getTime'](),_0x410d80=_0x530942['updatedAt']?new Date(_0x530942[_0x293ddb(0x143)])['getTime']():Date[_0x293ddb(0x14d)](),_0x2f351d={'start':_0x4e05a0,'end':_0x410d80,'duration':_0x410d80-_0x4e05a0};_0xf7752e[_0x293ddb(0x1d0)](_0x530942['id'],_0x2f351d),_0x4aaec4[_0x293ddb(0x2ec)]({'name':_0x530942['fullName'],'state':_0x530942['state']||'unknown','window':_0x2f351d});}else _0x4aaec4['push']({'name':_0x530942['fullName'],'state':_0x530942[_0x293ddb(0x1aa)]||_0x293ddb(0x2d7),'window':undefined});}_0x4aaec4[_0x293ddb(0x279)]((_0x5890c9,_0x585b8a)=>{const _0x23687d=_0x293ddb;if(!_0x5890c9['window'])return 0x1;if(!_0x585b8a['window'])return-0x1;return _0x5890c9[_0x23687d(0x300)][_0x23687d(0x2a2)]-_0x585b8a[_0x23687d(0x300)][_0x23687d(0x2a2)];});const _0x1907cb=_0x4aaec4[_0x293ddb(0x204)],_0x417db8=_0x1907cb>TIMELINE_CONFIG[_0x293ddb(0x1fc)];_0x417db8&&_0x4aaec4['splice'](TIMELINE_CONFIG[_0x293ddb(0x1fc)]);const _0x24f952=calculateTimeScale(_0x1b1d5d,_0x14ce3c),_0x379f19=_0x10d42a[_0x293ddb(0x28b)]?_0x10d42a[_0x293ddb(0x210)]?a59_0x34c7bd[_0x293ddb(0x2d5)](_0x293ddb(0x210)):a59_0x34c7bd['red'](_0x293ddb(0x274)):a59_0x34c7bd[_0x293ddb(0x269)](_0x293ddb(0x152)),_0x327d97=_0x10d42a['project']?.['id'],_0x276888=_0x10d42a[_0x293ddb(0x220)];let _0x1a8bf6;if(_0x327d97&&_0x276888){const _0x1b1635=getWorkflowAttemptUrl(_0x5ee4e3,_0x327d97,_0x276888,_0x10d42a['id']);_0x1a8bf6=hyperlink(a59_0x34c7bd[_0x293ddb(0x27d)](_0x10d42a['id']),_0x1b1635);}else _0x1a8bf6=a59_0x34c7bd['dim'](_0x10d42a['id']);_0x11a09d[_0x293ddb(0x2ec)](_0x293ddb(0x16c)+_0x1a8bf6+_0x293ddb(0x2d2)+_0x379f19+'\x20-\x20'+formatElapsed(_0x1b1d5d['duration']));if(_0x4aaec4[_0x293ddb(0x204)]>0x0){const _0x497403=renderTimeAxis(_0x24f952,_0x14ce3c),_0x41ccfe=new Date(_0x1b1d5d[_0x293ddb(0x2a2)]),_0x47e2dc=formatDate(_0x41ccfe),_0x132e43=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG['ICON_SPACING']+_0x1f47a8,_0x57c976=_0x47e2dc['padStart'](_0x132e43),_0x5803be=a59_0x34c7bd[_0x293ddb(0x27d)](_0x57c976);_0x11a09d[_0x293ddb(0x2ec)](_0x5803be+'\x20'+_0x497403);for(const _0x18b938 of _0x4aaec4){_0x11a09d[_0x293ddb(0x2ec)](renderTaskRow(_0x18b938,_0x24f952,_0x14ce3c,_0x1f47a8));}const _0x35e4e3=calculateStats(_0x4aaec4);_0x11a09d[_0x293ddb(0x2ec)](formatStats(_0x35e4e3)),_0x417db8&&_0x11a09d[_0x293ddb(0x2ec)](a59_0x34c7bd['yellow'](_0x293ddb(0x271)+TIMELINE_CONFIG[_0x293ddb(0x1fc)]+'\x20of\x20'+_0x1907cb+'\x20tasks')),_0x11a09d[_0x293ddb(0x2ec)](''),_0x11a09d[_0x293ddb(0x2ec)](a59_0x34c7bd[_0x293ddb(0x27d)](_0x293ddb(0x25f))+(_0x293ddb(0x1c1)+_0x10d42a['id']+'\x20logs')+a59_0x34c7bd[_0x293ddb(0x27d)]('\x20to\x20see\x20detailed\x20logs'));}else _0x11a09d['push']('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x11a09d[_0x293ddb(0x19d)]('\x0a');}[a59_0x69291(0x1e2)](_0x3dd9bb,_0x5010d3){const _0x4a0e97=a59_0x69291,_0x1968d1=new Date(_0x3dd9bb[_0x4a0e97(0x1f8)])['getTime'](),_0x4acc90=_0x3dd9bb['finishedAt']?new Date(_0x3dd9bb[_0x4a0e97(0x265)])[_0x4a0e97(0x1b3)]():Date[_0x4a0e97(0x14d)](),_0x20bae9=_0x4acc90-_0x1968d1,_0x5ba3ef=[];for(const _0x258d77 of _0x5010d3){if(_0x258d77[_0x4a0e97(0x26e)]){const _0x1fde96=new Date(_0x258d77[_0x4a0e97(0x26e)])[_0x4a0e97(0x1b3)](),_0x42eb15=_0x258d77[_0x4a0e97(0x143)]?new Date(_0x258d77[_0x4a0e97(0x143)])[_0x4a0e97(0x1b3)]():Date['now']();_0x5ba3ef[_0x4a0e97(0x2ec)]({'name':_0x258d77['fullName'],'state':_0x258d77[_0x4a0e97(0x1aa)]||'unknown','window':{'start':_0x1fde96,'end':_0x42eb15,'duration':_0x42eb15-_0x1fde96}});}else _0x5ba3ef['push']({'name':_0x258d77[_0x4a0e97(0x2ff)],'state':_0x258d77[_0x4a0e97(0x1aa)]||_0x4a0e97(0x2d7),'window':undefined});}const _0x23e821=calculateStats(_0x5ba3ef);return{'attempt':{'id':_0x3dd9bb['id'],'status':_0x3dd9bb['done']?_0x3dd9bb[_0x4a0e97(0x210)]?_0x4a0e97(0x210):_0x4a0e97(0x274):_0x4a0e97(0x152),'createdAt':_0x3dd9bb[_0x4a0e97(0x1f8)],'finishedAt':_0x3dd9bb[_0x4a0e97(0x265)],'duration_ms':_0x20bae9},'tasks':_0x5ba3ef[_0x4a0e97(0x1b8)](_0x5d1c8e=>({'name':_0x5d1c8e['name'],'state':_0x5d1c8e[_0x4a0e97(0x1aa)],'startedAt':_0x5d1c8e[_0x4a0e97(0x300)]?new Date(_0x5d1c8e[_0x4a0e97(0x300)][_0x4a0e97(0x2a2)])['toISOString']():null,'updatedAt':_0x5d1c8e[_0x4a0e97(0x300)]?new Date(_0x5d1c8e[_0x4a0e97(0x300)]['end'])['toISOString']():null,'duration_ms':_0x5d1c8e['window']?.['duration']||null})),'stats':_0x23e821};}}function formatScheduleLine(_0x47f96c){const _0x1fe9fb=a59_0x69291,_0x4195eb=_0x47f96c[_0x1fe9fb(0x132)]?a59_0x34c7bd['yellow']('\x20(disabled)'):'',_0x5cd6df=_0x47f96c['project']?.['name']?a59_0x34c7bd[_0x1fe9fb(0x27d)]('\x20['+_0x47f96c[_0x1fe9fb(0x235)][_0x1fe9fb(0x268)]+']'):'',_0x3d7c93=_0x47f96c[_0x1fe9fb(0x239)]?a59_0x34c7bd[_0x1fe9fb(0x27d)](_0x1fe9fb(0x133)+new Date(_0x47f96c[_0x1fe9fb(0x239)])[_0x1fe9fb(0x1c4)]()):'';return _0x1fe9fb(0x1c5)+_0x47f96c['id']+'\x20'+(_0x47f96c['workflow']?.[_0x1fe9fb(0x268)]||_0x1fe9fb(0x159))+_0x5cd6df+_0x4195eb+_0x3d7c93;}export class WorkflowSchedulesCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x225);[a59_0x69291(0x134)]=a59_0x69291(0x2f4);async[a59_0x69291(0x2fa)](_0x3ce257){const _0x455f5c=a59_0x69291,{options:_0x254bee,args:_0x33d165,tdx:_0x139874}=_0x3ce257,{scheduleId:_0xa021c2}=_0x254bee;if(_0xa021c2&&_0x33d165[0x0])return console[_0x455f5c(0x274)](a59_0x34c7bd[_0x455f5c(0x2f8)](_0x455f5c(0x287)),_0x455f5c(0x1d3)),console[_0x455f5c(0x274)](a59_0x34c7bd[_0x455f5c(0x27d)](_0x455f5c(0x2b6))),0x1;if(_0xa021c2){const _0x4fa854=await withSpinner(_0x455f5c(0x156)+_0xa021c2+'...',()=>_0x139874[_0x455f5c(0x19a)][_0x455f5c(0x2f3)](_0xa021c2),{'verbose':_0x254bee[_0x455f5c(0x151)]}),_0xc446cc=_0x4fa854['data'];return isStructuredFormat(_0x254bee)?await handleSingleObjectOutput(_0xc446cc,_0x254bee):(console[_0x455f5c(0x274)](_0x455f5c(0x2ed)),console[_0x455f5c(0x296)](formatScheduleLine(_0xc446cc))),0x0;}const _0x3291a2=this[_0x455f5c(0x1a5)](_0x33d165,_0x254bee);if(!_0x3291a2)return 0x1;const {projectName:_0x55fb78,workflowName:_0x46f3dc}=_0x3291a2,_0x11adb4=_0x55fb78?'\x27'+_0x55fb78+(_0x46f3dc?'.'+_0x46f3dc:'')+'\x27':undefined,_0x249f38=await withSpinner(_0x11adb4?'Listing\x20schedules\x20for\x20'+_0x11adb4+_0x455f5c(0x1c3):_0x455f5c(0x23d),()=>_0x55fb78?_0x139874['workflow']['listProjectSchedules'](_0x55fb78,{'workflow':_0x46f3dc,'limit':_0x254bee[_0x455f5c(0x2db)]}):_0x139874[_0x455f5c(0x19a)][_0x455f5c(0x1af)]({'limit':_0x254bee[_0x455f5c(0x2db)]}),{'verbose':_0x254bee[_0x455f5c(0x151)]}),_0x45f1d1=_0x249f38['data'],_0x95bccb=_0x254bee[_0x455f5c(0x2db)]&&_0x45f1d1[_0x455f5c(0x204)]>=_0x254bee[_0x455f5c(0x2db)]?a59_0x34c7bd[_0x455f5c(0x27d)](_0x455f5c(0x263)):'';console[_0x455f5c(0x274)](_0x455f5c(0x164)+_0x45f1d1[_0x455f5c(0x204)]+'\x20schedule'+(_0x45f1d1[_0x455f5c(0x204)]!==0x1?'s':'')+_0x95bccb);if(isStructuredFormat(_0x254bee))await handleSDKOutput(_0x45f1d1,_0x254bee);else{if(_0x45f1d1['length']===0x0)console[_0x455f5c(0x296)](_0x455f5c(0x257));else for(const _0x5cf9b1 of _0x45f1d1){console[_0x455f5c(0x296)](formatScheduleLine(_0x5cf9b1));}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x144);[a59_0x69291(0x134)]='Enable\x20a\x20workflow\x20schedule';async[a59_0x69291(0x2fa)](_0x5407c2){const _0x530b5e=a59_0x69291,{options:_0xc3e534,args:_0xd5ddb3,tdx:_0x4091cc}=_0x5407c2,_0x47b98d=_0xd5ddb3[0x0];if(!_0x47b98d)return console[_0x530b5e(0x274)](a59_0x34c7bd['red'](_0x530b5e(0x287)),_0x530b5e(0x1ce)),console[_0x530b5e(0x274)](a59_0x34c7bd['dim'](_0x530b5e(0x12e))),console[_0x530b5e(0x274)](a59_0x34c7bd[_0x530b5e(0x27d)](_0x530b5e(0x1f2))),0x1;const {backfill:_0x555b7c,nextTime:_0x42321e}=_0xc3e534,_0x1f78af={};if(_0x555b7c!==undefined)_0x1f78af[_0x530b5e(0x208)]=!_0x555b7c;if(_0x42321e!==undefined)_0x1f78af['nextTime']=_0x42321e;const _0x21d8ee=await withSpinner(_0x530b5e(0x1a8)+_0x47b98d+_0x530b5e(0x1c3),()=>_0x4091cc[_0x530b5e(0x19a)][_0x530b5e(0x154)](_0x47b98d,_0x1f78af),{'verbose':_0xc3e534[_0x530b5e(0x151)]}),_0x48ae01=_0x21d8ee[_0x530b5e(0x162)];return isStructuredFormat(_0xc3e534)?await handleSingleObjectOutput(_0x48ae01,_0xc3e534):(console[_0x530b5e(0x296)](_0x530b5e(0x20f)+_0x47b98d+_0x530b5e(0x1ed)+(_0x48ae01[_0x530b5e(0x19a)]?.[_0x530b5e(0x268)]||'unknown')+')'),_0x48ae01[_0x530b5e(0x239)]&&console[_0x530b5e(0x296)](a59_0x34c7bd[_0x530b5e(0x27d)](_0x530b5e(0x15f)+new Date(_0x48ae01[_0x530b5e(0x239)])[_0x530b5e(0x1c4)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x136);[a59_0x69291(0x134)]='Disable\x20a\x20workflow\x20schedule';async[a59_0x69291(0x2fa)](_0xb3313a){const _0x2c1892=a59_0x69291,{options:_0x4e33a4,args:_0x46ff91,tdx:_0x1408e6}=_0xb3313a,_0x136442=_0x46ff91[0x0];if(!_0x136442)return console[_0x2c1892(0x274)](a59_0x34c7bd[_0x2c1892(0x2f8)]('Error:'),'Schedule\x20ID\x20is\x20required'),console[_0x2c1892(0x274)](a59_0x34c7bd['dim'](_0x2c1892(0x2c3))),console['error'](a59_0x34c7bd[_0x2c1892(0x27d)](_0x2c1892(0x1f2))),0x1;const _0x4004fa=await withSpinner(_0x2c1892(0x303)+_0x136442+_0x2c1892(0x1c3),()=>_0x1408e6[_0x2c1892(0x19a)][_0x2c1892(0x2a0)](_0x136442),{'verbose':_0x4e33a4[_0x2c1892(0x151)]}),_0x1830ac=_0x4004fa[_0x2c1892(0x162)];return isStructuredFormat(_0x4e33a4)?await handleSingleObjectOutput(_0x1830ac,_0x4e33a4):console[_0x2c1892(0x296)]('✔\x20Schedule\x20#'+_0x136442+_0x2c1892(0x2c0)+(_0x1830ac[_0x2c1892(0x19a)]?.[_0x2c1892(0x268)]||_0x2c1892(0x253))+')'),0x0;}}
1
+ const a59_0x7f9071=a59_0x392d;(function(_0x502a70,_0x19ef9b){const _0x3a8531=a59_0x392d,_0x1e540f=_0x502a70();while(!![]){try{const _0x16678f=-parseInt(_0x3a8531(0x309))/0x1*(parseInt(_0x3a8531(0x1b9))/0x2)+parseInt(_0x3a8531(0x334))/0x3+-parseInt(_0x3a8531(0x2d5))/0x4+parseInt(_0x3a8531(0x285))/0x5*(-parseInt(_0x3a8531(0x323))/0x6)+-parseInt(_0x3a8531(0x2b6))/0x7+-parseInt(_0x3a8531(0x1d8))/0x8+parseInt(_0x3a8531(0x360))/0x9;if(_0x16678f===_0x19ef9b)break;else _0x1e540f['push'](_0x1e540f['shift']());}catch(_0x92eb82){_0x1e540f['push'](_0x1e540f['shift']());}}}(a59_0x1a0d,0x9889e));import a59_0x33ddab from'chalk';import{existsSync}from'fs';import a59_0x1642f5 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';function a59_0x1a0d(){const _0x56b896=['Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','session','Show\x20tasks\x20for\x20an\x20attempt','group_error','Kill\x20a\x20running\x20attempt','verbose','Using\x20attempt\x20','workflow:workflows','success','Listing\x20workflow\x20attempts...','set','Fetching\x20schedule\x20#','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','list','\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)','planned','✔\x20Project:\x20','Auto-selected\x20latest\x20session:\x20','data','dim','MAX_TIMELINE_WIDTH','(use\x20--limit\x20to\x20see\x20more)','cyan','\x20schedule','/app/workflows/','modified','\x20\x20Session\x20context\x20set\x20to:\x20','Select\x20a\x20workflow\x20to\x20run','renderSessionsTimeline','localeCompare','resolveProjectId','params','workflow','basename','Schedule\x20ID\x20is\x20required','sort','values','\x20session','readFile','text','Error:\x20Project\x20name\x20is\x20required','toISOString','(unknown)','index','red','\x22\x20to\x20new\x20project\x20\x22','...','renderTimeline','Error:','💡\x20Tip:\x20Use\x20','--schedule-id\x20cannot\x20be\x20combined\x20with\x20a\x20project.workflow\x20filter','get','Revision:\x20','length','follow','Listing\x20workflows...','indexOf','Pushing\x20workflow\x20project...','resolveProject','Disable\x20a\x20workflow\x20schedule','Error:\x20Secret\x20key\x20is\x20required','newProjectName','\x22\x20with\x20new\x20revision?','workflow:secrets:list','fileSize','\x0aError:','has','Getting\x20attempt\x20tasks...','Attempt\x20ID:\x20','New\x20project\x20name:\x20','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','sessions','✔\x20Pushed\x20','workflow:upload','some','setSecrets','\x20of\x20','Key:\x20','No\x20workflow\x20projects\x20found','✔\x20Secret\x20\x27','workflows','Parameters:\x20','trim','disableSchedule','isTTY','push','\x20secret','output','Filter:\x20project=','splice','\x22\x20already\x20exists\x20(ID:\x20','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','status','workflow:push','workflow:run','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','workflow:attempt','fill','Getting\x20attempt\x20details...','✔\x20Workflow\x20run\x20started','filesExtracted','Latest\x20session\x20has\x20no\x20attempt','---\x20','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Project:\x20','error','nextRunTime','\x20next:\x20','getDate','Deleting\x20project\x20','Task\x20name:\x20','message','\x1b[1A\x1b[2K','\x0aFailed\x20to\x20fetch\x20attempt\x20data','\x20task','workflow:schedule:enable','Usage:\x20workflow:delete\x20<project-name-or-id>','sessionTime','From\x20task:\x20','targetDir','slice','No\x20workflows\x20found\x20in\x20project:\x20','\x20has\x20no\x20attempts','taskName','navigateSessionsInteractive','Target:\x20','⚠\x20Showing\x20first\x20','Project\x20name\x20is\x20required','site','getMonth','Filter:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','isArray','\x20logs','Validation:\x20skipped','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','floor','\x20(use\x20a\x20larger\x20--limit\x20to\x20show\x20more)','Select\x20a\x20task\x20to\x20view\x20logs:','resolveProjectDir','path','Output\x20directory:\x20','Enabling\x20schedule\x20#','\x20unchanged','startsWith','json','workflow:secrets:delete','getHours','createdAt','done','Key\x20cannot\x20be\x20empty','logs','Session\x20','parse','duration','1396465KqNJoA','Expected\x20format:\x20--param\x20key=value','Show\x20specific\x20attempt\x20details','Workflow:','Retry\x20a\x20session\x20or\x20attempt','Session\x20time:\x20','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','limit','metadata','retryAttemptName','cancelRequested','isNewProject','✔\x20Retry\x20started','task','new','startTime','projects','green','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','\x20\x20Project:\x20','No\x20attempts\x20found\x20in\x20project:\x20','\x20-\x20','resolve','Cancelled','yes','\x0a✔\x20Attempt\x20complete','param','session:','revision:\x20','\x20\x20Attempt\x20ID:\x20','type','sourceDir','✔\x20Workflow\x20project\x20context\x20cleared.','write','\x20\x20Changes:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','columns','Reason:\x20','state','size','project','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20AI','pollTimeline','✔\x20Schedule\x20found','Workflow:\x20','startedAt','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Loading\x20session...','5956097DLCdAc','\x20(system)','No\x20sessions\x20with\x20timing\x20information','List\x20workflows','\x20workflow','\x20tasks','Dry\x20run:\x20yes','end','summary','Upload\x20workflow\x20project\x20to\x20Treasure\x20AI\x20(digdag-style)','Total:\x20','Enable\x20a\x20workflow\x20schedule','Analyzing\x20changes...','\x20\x20Location:\x20','workflow:attempts','substring','workflowProject','split','download','-\x20no\x20files\x20written','kill','skipValidation','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','window',',\x20Workflow:\x20','attemptId','tasks','toLowerCase','\x20\x20tdx\x20wf\x20use\x20<project>','Resolving\x20project\x20\x27','workflow:logs','4118748ONFwsS','Select\x20a\x20session\x20to\x20view\x20timeline:','fullName','\x20(use\x20--limit\x20to\x20show\x20more)','\x20is\x20not\x20a\x20directory','\x20secrets\x20set\x20for\x20project\x20\x27','workflow:delete','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','config','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','workflow:use','filter','prepareCloneProject','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','sys','now','Attempt:\x20','parseProjectWorkflowPattern','Pattern:\x20','✔\x20Schedule\x20#','LABEL_MIN_SPACING','msPerChar','Loading\x20workflows...','fileCount','running','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','sessionId','join','Pushing\x20project...','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','sourceProjectName','\x0aApply\x20these\x20changes?','getWorkflow','\x20\x20Console:\x20','from','log','MAX_LABEL_COUNT','Setting\x20secret...','map','hasChanges','✔\x20Clone\x20complete','getFullYear','includeRetried','Schedule:\x20backfill\x20runs\x20enabled\x20(--backfill)','table','padStart','Parameters:','List\x20workflow\x20schedules','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','13BiENAX','select','deleteSecret','\x20\x20Target:\x20','isDirectory','workflow:sessions','pending','blue','workflow:tasks','Error:\x20Attempt\x20ID\x20is\x20required','\x20\x20New\x20attempt\x20ID:\x20','MAX_TASKS_DISPLAY','preparePushProject','No\x20workflow\x20tdx.json\x20found','workflow:timeline','\x0a✔\x20No\x20changes\x20to\x20push','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Session\x20ID:\x20','attempts','updatedAt','changes','Listing\x20schedules\x20for\x20','keys','revision','Retrying\x20session...','find','12PgWrqe','\x20modified','\x20\x20Workflow:\x20','session_id','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x20\x20Revision:\x20','diff','format','bold','projectId','executePushProject','trimEnd','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','generateSessionTimelineRows','Pull\x20workflow\x20project\x20to\x20local\x20folder','listProjectSchedules','\x20project','68856kwhxgG','workflow:schedules','logFiles','workflow:download','Target\x20directory:\x20','Session\x20time:','toLocaleString','newProjectId','requireProject','disabledAt','projectName','all','min','\x0aClone\x20\x22','canceling','🔄\x20','deleted','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x20\x20Project\x20ID:\x20','Fetching\x20log\x20files...','No\x20attempts\x20found\x20for:\x20','\x20disabled\x20(','execute','No\x20workflow\x20sessions\x20found','✔\x20Showing\x20','finishedAt','retrySession','/attempt/','\x20to\x20see\x20detailed\x20logs','yellow','No\x20sessions\x20found\x20in\x20project:\x20','getMinutes','white','description','stdout','executeDryRun','workflow:retry','\x20secrets...','key','Project\x20filter:\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','jsonl','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','✔\x20Project\x20updated','42557562FendAq','Usage:\x20tdx\x20wf\x20schedule\x20list\x20[project[.workflow]]\x20|\x20--schedule-id\x20<id>','Listing\x20secrets...','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Killing\x20attempt...','\x0aPush\x20these\x20changes?','value','includes','Source\x20directory:\x20','Disabling\x20schedule\x20#','name','✔\x20Found\x20','skipSchedule','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','No\x20log\x20content\x20found','Error:\x20Invalid\x20JSON\x20in\x20--params','No\x20sessions\x20found','Status:\x20','replace','\x0a⚠\x20Project\x20\x22','renderSingleTimeline','workflow:projects','existingProjectId','Start\x20a\x20workflow\x20run','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','start','.\x20Expected\x20format:\x20KEY=VALUE','ICON_SPACING','includeSubtasks','force','relative','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','ICON_WIDTH','Params:\x20','\x20from\x20session\x20','fromTask','148854mWoZta','\x20\x20Next\x20run:\x20','showWorkflowConsoleUrl','\x20(disabled)','✔\x20Deleted\x20project\x20','No\x20sessions\x20found\x20for:\x20','delete','\x20attempt','cwd','\x20new','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','getSchedule','total','max','targetExists','stat','Downloading\x20logs...','Starting\x20workflow\x20run...','✔\x20Workflow\x20project\x20set\x20to:\x20','round','→\x20New\x20project:\x20','MIN_TIMELINE_WIDTH','Downloading\x20project\x20','dryRun','Failed\x20to\x20fetch\x20attempt\x20data','\x20deleted','getTime','workflow:pull','match','lastAttempt','repeat','5760616jGyQgo','rows','MIN_LABEL_COUNT','Invalid\x20format:\x20','\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.','unknown','utf-8','List\x20all\x20workflow\x20projects','Pulling\x20project\x20','\x0a✔\x20Already\x20up\x20to\x20date','unchanged','No\x20workflows\x20found','attempt','\x0aDry\x20run\x20-\x20no\x20project\x20created','retryAttempt','Writing\x20files...'];a59_0x1a0d=function(){return _0x56b896;};return a59_0x1a0d();}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 a59_0x30a0c4 from'prompts';function getAttemptStatusDisplay(_0x351efc){const _0x549c86=a59_0x392d;if(!_0x351efc)return{'icon':'⏳','text':''};const {done:_0x5c9b33,success:_0xb981b5,cancelRequested:_0x4ec461}=_0x351efc;if(!_0x5c9b33)return _0x4ec461?{'icon':'🛑','text':a59_0x33ddab[_0x549c86(0x351)](_0x549c86(0x342))}:{'icon':'🔄','text':a59_0x33ddab['blue'](_0x549c86(0x2f0))};if(_0xb981b5)return{'icon':'✅','text':a59_0x33ddab[_0x549c86(0x296)](_0x549c86(0x1f0))};return{'icon':'❌','text':a59_0x33ddab['red'](_0x549c86(0x253))};}export class WorkflowBaseCommand extends BaseCommand{[a59_0x7f9071(0x222)](_0x59cffe,_0x25b8be,_0x191220=0x0){const _0x170b76=a59_0x7f9071;return _0x59cffe[_0x191220]||_0x25b8be[_0x170b76(0x2c6)];}[a59_0x7f9071(0x33c)](_0x461404,_0x5a3768,_0x172de8=0x0){const _0x2df138=a59_0x7f9071,_0x52932d=this[_0x2df138(0x222)](_0x461404,_0x5a3768,_0x172de8);if(!_0x52932d)return console[_0x2df138(0x253)](a59_0x33ddab[_0x2df138(0x214)](_0x2df138(0x218)),_0x2df138(0x269)),console[_0x2df138(0x253)](a59_0x33ddab[_0x2df138(0x1fb)](_0x2df138(0x2ae))),null;return _0x52932d;}[a59_0x7f9071(0x2e9)](_0x50b508,_0x232efd){const _0x55a8c3=a59_0x7f9071;if(_0x50b508[0x0]){const _0x1f99d4=_0x50b508[0x0]['split']('.');if(_0x1f99d4['length']===0x1)return{'projectName':_0x1f99d4[0x0],'workflowName':undefined};else return _0x1f99d4[_0x55a8c3(0x21d)]===0x2?{'projectName':_0x1f99d4[0x0],'workflowName':_0x1f99d4[0x1]}:(console[_0x55a8c3(0x253)](a59_0x33ddab[_0x55a8c3(0x214)]('Error:'),_0x55a8c3(0x35c)),null);}return{'projectName':_0x232efd[_0x55a8c3(0x2c6)],'workflowName':undefined};}[a59_0x7f9071(0x275)](_0x393612,_0x2415e8,_0x2524ca=0x0){const _0x410a22=a59_0x7f9071;if(_0x393612[_0x2524ca])return _0x393612[_0x2524ca];if(_0x2415e8[_0x410a22(0x2c6)]){const _0x5ab348=a59_0x1642f5[_0x410a22(0x2f3)](process[_0x410a22(0x1c1)](),_0x410a22(0x238),_0x2415e8[_0x410a22(0x2c6)]);if(existsSync(a59_0x1642f5[_0x410a22(0x2f3)](_0x5ab348,'tdx.json')))return _0x5ab348;}return undefined;}async[a59_0x7f9071(0x1bb)](_0x4ee634,_0x3e876b,_0x402419){const _0x1a7837=a59_0x7f9071;try{const _0xe02466=await _0x4ee634[_0x1a7837(0x208)][_0x1a7837(0x238)](_0x3e876b,{'limit':0x1});if(_0xe02466[_0x1a7837(0x21d)]>0x0){const _0x13410d=_0xe02466[0x0]['id'],_0x22b2a1=getWorkflowUrl(_0x402419,_0x13410d);console[_0x1a7837(0x253)]('\x20\x20Console:\x20'+a59_0x33ddab[_0x1a7837(0x1fe)](_0x22b2a1));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a59_0x7f9071(0x2e1);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x363);async[a59_0x7f9071(0x34a)](_0x77f9a8){const _0x50a45e=a59_0x7f9071,{options:_0x198f24,args:_0x2a3f22,tdx:_0x323118}=_0x77f9a8,_0x4cf7d0=_0x2a3f22[0x0],_0x1b452d=_0x198f24['clear'];if(_0x1b452d)return saveSessionContext({'workflow_project':undefined},_0x198f24['session']),console[_0x50a45e(0x2fb)](a59_0x33ddab[_0x50a45e(0x296)](_0x50a45e(0x2a5))),0x0;if(!_0x4cf7d0)return console[_0x50a45e(0x253)](a59_0x33ddab[_0x50a45e(0x214)](_0x50a45e(0x218)),_0x50a45e(0x269)),console[_0x50a45e(0x253)](a59_0x33ddab[_0x50a45e(0x1fb)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x50a45e(0x253)](a59_0x33ddab['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x5e8f58=await withSpinner(_0x50a45e(0x2d3)+_0x4cf7d0+'\x27...',()=>_0x323118['workflow'][_0x50a45e(0x206)](_0x4cf7d0),{'verbose':_0x198f24['verbose']}),{name:_0x5e177e}=_0x5e8f58[_0x50a45e(0x1fa)];return saveSessionContext({'workflow_project':_0x5e177e},_0x198f24['session']),console['log'](a59_0x33ddab['green'](_0x50a45e(0x1cb)+a59_0x33ddab[_0x50a45e(0x1fe)](_0x5e177e))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x1aa);['description']=a59_0x7f9071(0x1df);async[a59_0x7f9071(0x34a)](_0x2f473f){const _0x209090=a59_0x7f9071,{options:_0x381e70,args:_0x447b6f,tdx:_0x3cbb68}=_0x2f473f,_0x24d3ef=_0x447b6f[0x0];_0x381e70[_0x209090(0x1ed)]&&_0x24d3ef&&console[_0x209090(0x253)](_0x209090(0x2ea)+_0x24d3ef);const _0xb5c970=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x3cbb68[_0x209090(0x208)][_0x209090(0x295)](_0x24d3ef,{'limit':_0x381e70[_0x209090(0x28c)]}),{'verbose':_0x381e70[_0x209090(0x1ed)]});let _0x5d004d=_0xb5c970[_0x209090(0x1fa)];_0x5d004d[_0x209090(0x20b)]((_0x18c45e,_0x2b41ed)=>_0x18c45e[_0x209090(0x19f)][_0x209090(0x205)](_0x2b41ed['name']));const _0xaaf9e2=_0x381e70[_0x209090(0x28c)]&&_0x5d004d[_0x209090(0x21d)]>=_0x381e70[_0x209090(0x28c)]?a59_0x33ddab[_0x209090(0x1fb)](_0x209090(0x2d8)):'';console[_0x209090(0x253)](_0x209090(0x1a0)+_0x5d004d[_0x209090(0x21d)]+_0x209090(0x333)+(_0x5d004d[_0x209090(0x21d)]!==0x1?'s':'')+_0xaaf9e2);if(_0x381e70[_0x209090(0x32a)]===_0x209090(0x27b)||_0x381e70['format']===_0x209090(0x35d)||_0x381e70[_0x209090(0x32a)]===_0x209090(0x304))await handleSDKOutput(_0x5d004d,_0x381e70);else{if(_0x5d004d['length']===0x0)_0x24d3ef?console['log']('No\x20projects\x20match\x20pattern:\x20'+_0x24d3ef):console[_0x209090(0x2fb)](_0x209090(0x236));else{const _0x120d1b=_0x5d004d[_0x209090(0x2fe)](_0x52a281=>{const _0x4f39bf=_0x209090,_0x270535=_0x52a281[_0x4f39bf(0x28d)]?.[_0x4f39bf(0x232)](_0x21c172=>_0x21c172[_0x4f39bf(0x35a)]===_0x4f39bf(0x2e6)),_0x185be3=_0x270535?a59_0x33ddab[_0x4f39bf(0x1fb)](_0x4f39bf(0x2b7)):'';return'📁\x20'+_0x52a281[_0x4f39bf(0x19f)]+_0x185be3;});await writeOutput(_0x120d1b[_0x209090(0x2f3)]('\x0a'),_0x381e70[_0x209090(0x23f)],_0x209090(0x1f5));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a59_0x7f9071(0x1ef);['description']=a59_0x7f9071(0x2b9);async['execute'](_0x5933a){const _0x5835e8=a59_0x7f9071,{options:_0x5daf3a,args:_0x49cae2,tdx:_0x32a3ee}=_0x5933a,_0x28440b=this['resolveProject'](_0x49cae2,_0x5daf3a);_0x5daf3a['verbose']&&_0x28440b&&console['error'](_0x5835e8(0x35b)+_0x28440b);const _0x1286e5=await withSpinner(_0x5835e8(0x21f),()=>_0x32a3ee[_0x5835e8(0x208)][_0x5835e8(0x238)](_0x28440b,{'limit':_0x5daf3a[_0x5835e8(0x28c)]}),{'verbose':_0x5daf3a['verbose']});let _0x1c8686=_0x1286e5[_0x5835e8(0x1fa)];_0x1c8686[_0x5835e8(0x20b)]((_0x1358ef,_0x23e0e8)=>{const _0xc651db=_0x5835e8,_0x16226a=_0x1358ef[_0xc651db(0x19f)][_0xc651db(0x205)](_0x23e0e8[_0xc651db(0x19f)]);if(_0x16226a!==0x0)return _0x16226a;return(_0x1358ef['project']?.[_0xc651db(0x19f)]||'')[_0xc651db(0x205)](_0x23e0e8[_0xc651db(0x2ad)]?.[_0xc651db(0x19f)]||'');});const _0x4dcf6e=_0x5daf3a[_0x5835e8(0x28c)]&&_0x1c8686[_0x5835e8(0x21d)]>=_0x5daf3a[_0x5835e8(0x28c)]?a59_0x33ddab[_0x5835e8(0x1fb)](_0x5835e8(0x2d8)):'';console[_0x5835e8(0x253)](_0x5835e8(0x1a0)+_0x1c8686['length']+_0x5835e8(0x2ba)+(_0x1c8686[_0x5835e8(0x21d)]!==0x1?'s':'')+_0x4dcf6e);if(_0x5daf3a[_0x5835e8(0x32a)]==='json'||_0x5daf3a[_0x5835e8(0x32a)]===_0x5835e8(0x35d)||_0x5daf3a[_0x5835e8(0x32a)]==='table')await handleSDKOutput(_0x1c8686,_0x5daf3a);else{if(_0x1c8686[_0x5835e8(0x21d)]===0x0)_0x28440b?console['log'](_0x5835e8(0x263)+_0x28440b):console[_0x5835e8(0x2fb)]('No\x20workflows\x20found');else{const _0xb6b062=_0x5daf3a['site'],_0x128906=_0x1c8686[_0x5835e8(0x2fe)](_0x1f5c58=>{const _0x48a4f4=_0x5835e8,_0x14fa63=a59_0x33ddab['dim']('#'+_0x1f5c58['id']),_0x454c26=hyperlink(_0x14fa63,getWorkflowUrl(_0xb6b062,_0x1f5c58['id'])),_0x591dbb=_0x1f5c58[_0x48a4f4(0x2ad)]?.['name']?a59_0x33ddab[_0x48a4f4(0x1fb)]('\x20('+_0x1f5c58[_0x48a4f4(0x2ad)]['name']+')'):'';return'📋\x20'+_0x454c26+'\x20'+_0x1f5c58[_0x48a4f4(0x19f)]+_0x591dbb;});await writeOutput(_0x128906[_0x5835e8(0x2f3)]('\x0a'),_0x5daf3a[_0x5835e8(0x23f)],_0x5835e8(0x1f5));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x30e);[a59_0x7f9071(0x355)]='List\x20workflow\x20execution\x20sessions';async[a59_0x7f9071(0x34a)](_0x14dac4){const _0x379afa=a59_0x7f9071,{options:_0x44ec12,args:_0x46ea4b,tdx:_0x2e08a5}=_0x14dac4,_0x4cf527=this[_0x379afa(0x2e9)](_0x46ea4b,_0x44ec12);if(!_0x4cf527)return 0x1;const {projectName:_0x152424,workflowName:_0x37c2e4}=_0x4cf527;if(_0x44ec12[_0x379afa(0x1ed)]){if(_0x152424&&_0x37c2e4)console[_0x379afa(0x253)](_0x379afa(0x26c)+_0x152424+'.'+_0x37c2e4);else _0x152424&&console['error']('Filter:\x20project='+_0x152424);const _0x1323c8=_0x44ec12['status'];_0x1323c8&&console[_0x379afa(0x253)](_0x379afa(0x1a6)+_0x1323c8);}let _0x40ebba=0x28;if(process['stdout'][_0x379afa(0x23c)]&&!_0x44ec12[_0x379afa(0x23f)]&&!_0x44ec12[_0x379afa(0x32a)]){const _0x386ffd=process[_0x379afa(0x356)]['rows']||0x28;_0x40ebba=Math['max'](0x14,Math[_0x379afa(0x272)](_0x386ffd*0x2/0x3));}const _0x1f21fe=_0x44ec12[_0x379afa(0x28c)]||_0x40ebba,_0x135ddd=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x2e08a5['workflow']['sessions']({'projectName':_0x152424,'workflowName':_0x37c2e4,'status':_0x44ec12[_0x379afa(0x244)],'fromTime':_0x44ec12[_0x379afa(0x2fa)],'toTime':_0x44ec12['to'],'limit':_0x1f21fe}),{'verbose':_0x44ec12[_0x379afa(0x1ed)]}),_0x43e596=_0x135ddd['data'];_0x43e596[_0x379afa(0x20b)]((_0x10f23d,_0x5d4bc6)=>{const _0xf6324e=_0x379afa,_0x50c81e=_0x10f23d['sessionTime']||'',_0x2f8e3a=_0x5d4bc6[_0xf6324e(0x25f)]||'';return _0x2f8e3a['localeCompare'](_0x50c81e);});_0x43e596[_0x379afa(0x21d)]>=_0x1f21fe?console[_0x379afa(0x253)](_0x379afa(0x34c)+_0x43e596[_0x379afa(0x21d)]+'\x20sessions\x20'+a59_0x33ddab[_0x379afa(0x1fb)](_0x379afa(0x1fd))):console['error'](_0x379afa(0x1a0)+_0x43e596[_0x379afa(0x21d)]+_0x379afa(0x20d)+(_0x43e596[_0x379afa(0x21d)]!==0x1?'s':''));if(_0x44ec12['format']==='json'||_0x44ec12[_0x379afa(0x32a)]===_0x379afa(0x35d)||_0x44ec12[_0x379afa(0x32a)]===_0x379afa(0x304))await handleSDKOutput(_0x43e596,_0x44ec12);else{if(!process[_0x379afa(0x356)][_0x379afa(0x23c)]||_0x44ec12[_0x379afa(0x23f)]){if(_0x43e596[_0x379afa(0x21d)]===0x0){if(_0x152424&&_0x37c2e4)console[_0x379afa(0x2fb)](_0x379afa(0x1be)+_0x152424+'.'+_0x37c2e4);else _0x152424?console[_0x379afa(0x2fb)](_0x379afa(0x352)+_0x152424):console[_0x379afa(0x2fb)](_0x379afa(0x1a5));}else{const _0x26fa0e=_0x44ec12[_0x379afa(0x26a)],_0x304841=this['renderSessionsTimeline'](_0x43e596,_0x26fa0e);_0x44ec12[_0x379afa(0x23f)]?await writeOutput(_0x304841,_0x44ec12[_0x379afa(0x23f)],_0x379afa(0x1f5)):console[_0x379afa(0x2fb)](_0x304841);}!_0x152424&&(console[_0x379afa(0x253)](''),console[_0x379afa(0x253)](a59_0x33ddab[_0x379afa(0x1fb)](_0x379afa(0x1c3))),console[_0x379afa(0x253)](a59_0x33ddab[_0x379afa(0x1fb)](_0x379afa(0x2e5))+'or'+a59_0x33ddab[_0x379afa(0x1fb)](_0x379afa(0x2d2))));}else{if(_0x43e596[_0x379afa(0x21d)]===0x0){if(_0x152424&&_0x37c2e4)console[_0x379afa(0x2fb)](_0x379afa(0x1be)+_0x152424+'.'+_0x37c2e4);else _0x152424?console['log'](_0x379afa(0x352)+_0x152424):console[_0x379afa(0x2fb)](_0x379afa(0x1a5));}else await this[_0x379afa(0x266)](_0x43e596,_0x14dac4,_0x152424);}}return 0x0;}[a59_0x7f9071(0x204)](_0x57ad15,_0x21f972){const _0x25ffb4=a59_0x7f9071,_0x17fcae=[],_0x7eda5a=new Map();let _0x19865e=Infinity,_0x4d18fb=-Infinity;for(const _0x53e407 of _0x57ad15){if(_0x53e407[_0x25ffb4(0x1d6)]?.[_0x25ffb4(0x27e)]){const _0x21c33c=new Date(_0x53e407[_0x25ffb4(0x1d6)][_0x25ffb4(0x27e)])[_0x25ffb4(0x1d3)](),_0x1d3fde=_0x53e407[_0x25ffb4(0x1d6)][_0x25ffb4(0x34d)]?new Date(_0x53e407[_0x25ffb4(0x1d6)][_0x25ffb4(0x34d)])[_0x25ffb4(0x1d3)]():Date[_0x25ffb4(0x2e7)](),_0x22d5f4=_0x53e407[_0x25ffb4(0x2ad)]?.[_0x25ffb4(0x19f)]||_0x25ffb4(0x212);!_0x7eda5a[_0x25ffb4(0x22a)](_0x22d5f4)&&_0x7eda5a[_0x25ffb4(0x1f2)](_0x22d5f4,[]),_0x7eda5a[_0x25ffb4(0x21b)](_0x22d5f4)[_0x25ffb4(0x23d)]({'session':_0x53e407,'startTime':_0x21c33c,'endTime':_0x1d3fde,'duration':_0x1d3fde-_0x21c33c}),_0x19865e=Math[_0x25ffb4(0x340)](_0x19865e,_0x21c33c),_0x4d18fb=Math[_0x25ffb4(0x1c6)](_0x4d18fb,_0x1d3fde);}}if(_0x7eda5a[_0x25ffb4(0x2ac)]===0x0)return _0x25ffb4(0x2b8);const _0x16710a=process[_0x25ffb4(0x356)][_0x25ffb4(0x2a9)]||0x78,_0x1119a0=0x1e,_0x1b7ac3=0x32,_0x528423=0x4,_0x29a7ef=Math[_0x25ffb4(0x340)](_0x1b7ac3,Math[_0x25ffb4(0x1c6)](_0x1119a0,Math[_0x25ffb4(0x272)](_0x16710a*0.3))),_0x2f7c72=_0x16710a-_0x29a7ef-TIMELINE_CONFIG['GUTTER']-0x3-_0x528423,_0xf5213d=_0x4d18fb-_0x19865e,_0xd4fd46=_0xf5213d/_0x29a7ef,_0x5e50a7=renderTimeAxis({'startTime':_0x19865e,'endTime':_0x4d18fb,'durationMs':_0xf5213d,'msPerChar':_0xd4fd46},_0x29a7ef),_0x49dbfe=[];for(const _0x3da0dc of _0x7eda5a[_0x25ffb4(0x20c)]()){_0x49dbfe[_0x25ffb4(0x23d)](..._0x3da0dc);}_0x49dbfe[_0x25ffb4(0x20b)]((_0xade70,_0x34a7fe)=>_0x34a7fe['startTime']-_0xade70[_0x25ffb4(0x294)]);const _0x2f53d3=new Date(_0x19865e),_0x1e2672=formatDate(_0x2f53d3),_0x34e226=_0x528423+TIMELINE_CONFIG[_0x25ffb4(0x1b5)]+TIMELINE_CONFIG[_0x25ffb4(0x1b0)]+_0x2f7c72,_0x37c865='\x20'[_0x25ffb4(0x1d7)](_0x34e226-_0x1e2672[_0x25ffb4(0x21d)]),_0x458c26=_0x37c865+a59_0x33ddab[_0x25ffb4(0x1fb)](_0x1e2672)+'\x20'+_0x5e50a7;_0x17fcae[_0x25ffb4(0x23d)](_0x458c26);const _0x1d1c80=0x16;let _0x46b8a6=0x0;for(const _0x5cb636 of _0x49dbfe){const _0x3b83a4=_0x5cb636[_0x25ffb4(0x1e9)][_0x25ffb4(0x2ad)]?.[_0x25ffb4(0x19f)]||'?',_0x25b840=Math[_0x25ffb4(0x340)](stringWidth(_0x3b83a4),_0x1d1c80);_0x46b8a6=Math[_0x25ffb4(0x1c6)](_0x46b8a6,_0x25b840);}for(const _0x1e8056 of _0x49dbfe){const {session:_0x4ebe73,startTime:_0x18ef64,endTime:_0x8e13bd,duration:_0x117106}=_0x1e8056,_0x902b77=_0x4ebe73[_0x25ffb4(0x2ad)]?.['id'],_0x4c1703=_0x4ebe73['id'],_0x2a8d16=_0x4ebe73[_0x25ffb4(0x2ad)]?.[_0x25ffb4(0x19f)]||'?',_0x15760c=_0x4ebe73[_0x25ffb4(0x208)]?.[_0x25ffb4(0x19f)]||'?';let _0x40a3b1,_0x4f90b3;if(_0x4ebe73[_0x25ffb4(0x1d6)]){const _0x451049=_0x4ebe73[_0x25ffb4(0x1d6)];!_0x451049[_0x25ffb4(0x27f)]?(_0x40a3b1=_0x451049[_0x25ffb4(0x28f)]?'🛑':'🔄',_0x4f90b3=_0x451049[_0x25ffb4(0x28f)]?a59_0x33ddab[_0x25ffb4(0x351)]:a59_0x33ddab[_0x25ffb4(0x310)]):(_0x40a3b1=_0x451049['success']?'✅':'❌',_0x4f90b3=_0x451049[_0x25ffb4(0x1f0)]?a59_0x33ddab[_0x25ffb4(0x296)]:a59_0x33ddab[_0x25ffb4(0x214)]);}else _0x40a3b1='⏳',_0x4f90b3=a59_0x33ddab['dim'];const _0x3f684e='#'+_0x4c1703,_0x143e13=_0x902b77?hyperlink(_0x3f684e,getWorkflowSessionUrl(_0x21f972,_0x902b77,_0x4c1703)):_0x3f684e;let _0xef6ec3=_0x2a8d16;stringWidth(_0x2a8d16)>_0x1d1c80&&(_0xef6ec3=_0x2a8d16[_0x25ffb4(0x262)](0x0,_0x1d1c80-0x1)+'…');const _0x3ac70e=a59_0x33ddab[_0x25ffb4(0x1fb)](_0xef6ec3),_0x2d7462=stringWidth(_0xef6ec3),_0x55de40='\x20'[_0x25ffb4(0x1d7)](_0x46b8a6-stringWidth(_0xef6ec3)+0x2),_0x4817b8='('+formatElapsed(_0x117106)+')',_0x2319c3=stringWidth(_0x4817b8),_0x307b4c=stringWidth(_0x3f684e),_0xe56de6=_0x307b4c+0x1+_0x2d7462+_0x55de40[_0x25ffb4(0x21d)],_0x23bef0=_0x2f7c72-_0xe56de6-_0x2319c3-0x1-0x8;let _0x38842b=_0x15760c;stringWidth(_0x38842b)>_0x23bef0&&(_0x38842b=_0x38842b['slice'](0x0,_0x23bef0-0x1)+'…');const _0xd84d23=_0x143e13+'\x20'+_0x3ac70e+_0x55de40+_0x38842b,_0xc3b9de=stringWidth(_0xd84d23),_0xbebfe2=_0x2f7c72-_0xc3b9de-_0x2319c3,_0x41e125=_0xd84d23+'\x20'[_0x25ffb4(0x1d7)](Math['max'](0x1,_0xbebfe2))+a59_0x33ddab[_0x25ffb4(0x1fb)](_0x4817b8),_0x1b7179=Math[_0x25ffb4(0x272)]((_0x18ef64-_0x19865e)/_0xd4fd46),_0x3373cc=Math['floor']((_0x8e13bd-_0x19865e)/_0xd4fd46),_0x3a5111=Math['max'](_0x1b7179+0x1,_0x3373cc),_0x291161=new Array(_0x29a7ef)[_0x25ffb4(0x24b)]('\x20');for(let _0x1107a0=_0x1b7179;_0x1107a0<Math['min'](_0x3a5111,_0x29a7ef);_0x1107a0++){_0x291161[_0x1107a0]='─';}const _0x4b1165=_0x291161[_0x25ffb4(0x2fe)](_0x4b51fc=>_0x4b51fc==='\x20'?'\x20':_0x4f90b3(_0x4b51fc))[_0x25ffb4(0x2f3)]('');_0x17fcae['push'](_0x40a3b1+'\x20'+_0x41e125+'│'+_0x4b1165+'│');}return _0x17fcae[_0x25ffb4(0x2f3)]('\x0a');}async[a59_0x7f9071(0x266)](_0x6cd726,_0x3cbc3,_0x25cc7c){const _0x19cfe7=a59_0x7f9071,{options:_0x1e886f,tdx:_0x698b9f}=_0x3cbc3,_0x3c7e7f=_0x1e886f['site'],{timelineRows:_0x21cdac,timeAxisHeader:_0x3c6cc2}=this['generateSessionTimelineRows'](_0x6cd726,_0x3c7e7f),_0x3cefe2=_0x21cdac[_0x19cfe7(0x2e2)](_0x3e1b9d=>_0x3e1b9d[_0x19cfe7(0x2cf)]);if(_0x3cefe2['length']===0x0){const _0x943f4d=this['renderSessionsTimeline'](_0x6cd726,_0x3c7e7f);console[_0x19cfe7(0x2fb)](_0x943f4d);!_0x25cc7c&&(console[_0x19cfe7(0x253)](''),console['error'](a59_0x33ddab['dim'](_0x19cfe7(0x1c3))),console['error'](a59_0x33ddab['dim'](_0x19cfe7(0x2e5))+'or'+a59_0x33ddab[_0x19cfe7(0x1fb)](_0x19cfe7(0x2d2))));return;}_0x3c6cc2&&console[_0x19cfe7(0x2fb)](_0x3c6cc2);const _0x837ba0=_0x21cdac[_0x19cfe7(0x2e2)](_0x1af568=>_0x1af568[_0x19cfe7(0x2cf)])[_0x19cfe7(0x2fe)](_0x1af0b0=>({'title':_0x1af0b0['displayLine'],'value':_0x1af0b0[_0x19cfe7(0x2cf)]})),_0x466a58=process[_0x19cfe7(0x356)][_0x19cfe7(0x1d9)]||0x3c,_0x2977d7=Math['max'](0x28,Math[_0x19cfe7(0x272)](_0x466a58*0x2/0x3)),_0x1d8486=await a59_0x30a0c4({'type':'autocomplete','name':_0x19cfe7(0x2cf),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x837ba0,'initial':-0x1,'limit':_0x2977d7,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0xe0944d,_0x2609dc)=>{const _0x40f442=_0x19cfe7;if(!_0xe0944d)return Promise[_0x40f442(0x29b)](_0x2609dc);const _0x3719e2=_0x2609dc[_0x40f442(0x2e2)](_0x568301=>{const _0x4535d7=_0x40f442,_0xe69fe2=_0x568301;return _0xe69fe2['title'][_0x4535d7(0x2d1)]()[_0x4535d7(0x367)](_0xe0944d[_0x4535d7(0x2d1)]());});return Promise['resolve'](_0x3719e2);}}),_0x2d2552=()=>{const _0x497293=_0x19cfe7;process[_0x497293(0x356)][_0x497293(0x2a6)](_0x497293(0x25a)),process[_0x497293(0x356)][_0x497293(0x2a6)](_0x497293(0x25a)),process[_0x497293(0x356)][_0x497293(0x2a6)](_0x497293(0x25a));},_0x50b4a7=_0x1d8486&&_0x1d8486[_0x19cfe7(0x2cf)]&&_0x1d8486['attemptId']!==null&&_0x1d8486['attemptId'][_0x19cfe7(0x23a)]()!=='';if(!_0x50b4a7){_0x2d2552(),console[_0x19cfe7(0x2fb)](a59_0x33ddab[_0x19cfe7(0x1fb)](_0x19cfe7(0x29c)));return;}_0x2d2552();const _0x5f244e=_0x6cd726[_0x19cfe7(0x322)](_0x358519=>_0x358519[_0x19cfe7(0x1d6)]?.['id']===_0x1d8486[_0x19cfe7(0x2cf)]);if(_0x5f244e){const _0x47511a=_0x5f244e[_0x19cfe7(0x2ad)]?.[_0x19cfe7(0x19f)]||'?',_0x4b3db6=_0x5f244e[_0x19cfe7(0x208)]?.[_0x19cfe7(0x19f)]||'?';console[_0x19cfe7(0x2fb)](_0x19cfe7(0x252)+a59_0x33ddab[_0x19cfe7(0x1fb)](_0x47511a)+_0x19cfe7(0x2ce)+a59_0x33ddab[_0x19cfe7(0x1fb)](_0x4b3db6));}const _0x3443f7=new WorkflowTimelineCommand();await _0x3443f7['execute']({'args':[],'options':{..._0x1e886f,'attemptId':_0x1d8486[_0x19cfe7(0x2cf)]},'tdx':_0x698b9f});}[a59_0x7f9071(0x330)](_0x199513,_0x3d6c29){const _0x38664e=a59_0x7f9071,_0x295c5c=new Map();for(const _0x4d0e8e of _0x199513){_0x4d0e8e['id']&&_0x4d0e8e[_0x38664e(0x1d6)]?.['id']&&_0x295c5c[_0x38664e(0x1f2)](_0x4d0e8e['id'],_0x4d0e8e['lastAttempt']['id']);}const _0x9116b5=[];let _0x268315='';const _0x93b332=this['renderSessionsTimeline'](_0x199513,_0x3d6c29),_0x32c902=_0x93b332[_0x38664e(0x2c7)]('\x0a');for(const _0x11339b of _0x32c902){if(_0x11339b[_0x38664e(0x27a)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x11339b[_0x38664e(0x1d5)](/^\s+\d{4}-\d{2}-\d{2}/))_0x268315=_0x11339b;else{if(_0x11339b['match'](/^[✅❌🔄🛑⏳]/)){const _0x273232=_0x11339b[_0x38664e(0x1d5)](/#(\d+)/),_0x3d87b6=_0x273232?_0x273232[0x1]:null,_0x28c541=_0x3d87b6?_0x295c5c[_0x38664e(0x21b)](_0x3d87b6)||null:null,_0xa0212b=_0x199513[_0x38664e(0x322)](_0x2b8078=>_0x2b8078['id']===_0x3d87b6),_0x5af510=_0xa0212b?.['project']?.['name']||'';_0x9116b5[_0x38664e(0x23d)]({'displayLine':_0x11339b,'attemptId':_0x28c541,'projectName':_0x5af510});}}}return{'timelineRows':_0x9116b5,'timeAxisHeader':_0x268315};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a59_0x7f9071(0x2c4);['description']='List\x20workflow\x20attempts';async[a59_0x7f9071(0x34a)](_0x2dfddc){const _0xca313d=a59_0x7f9071,{options:_0x45418f,args:_0x307765,tdx:_0x35d4e6}=_0x2dfddc,_0x2d4ab7=this[_0xca313d(0x2e9)](_0x307765,_0x45418f);if(!_0x2d4ab7)return 0x1;const {projectName:_0x32364a,workflowName:_0x118637}=_0x2d4ab7,_0x28a6d0=_0x45418f[_0xca313d(0x302)];if(_0x45418f[_0xca313d(0x1ed)]){if(_0x32364a&&_0x118637)console['error'](_0xca313d(0x26c)+_0x32364a+'.'+_0x118637);else _0x32364a&&console[_0xca313d(0x253)](_0xca313d(0x240)+_0x32364a);_0x28a6d0&&console[_0xca313d(0x253)]('Include\x20retried:\x20yes');}const _0xe7f2cf=await withSpinner(_0xca313d(0x1f1),()=>_0x35d4e6[_0xca313d(0x208)][_0xca313d(0x31b)]({'projectName':_0x32364a,'workflowName':_0x118637,'includeRetried':_0x28a6d0,'limit':_0x45418f[_0xca313d(0x28c)]}),{'verbose':_0x45418f[_0xca313d(0x1ed)]}),_0x3959bb=_0xe7f2cf[_0xca313d(0x1fa)],_0x3a8a86=_0x45418f['limit']||0x64,_0x3dc630=_0x3959bb[_0xca313d(0x21d)]>=_0x3a8a86?a59_0x33ddab[_0xca313d(0x1fb)](_0xca313d(0x2d8)):'';console[_0xca313d(0x253)](_0xca313d(0x1a0)+_0x3959bb[_0xca313d(0x21d)]+_0xca313d(0x1c0)+(_0x3959bb['length']!==0x1?'s':'')+_0x3dc630);if(_0x45418f['format']==='json'||_0x45418f['format']===_0xca313d(0x35d)||_0x45418f['format']==='table')await handleSDKOutput(_0x3959bb,_0x45418f);else{if(_0x3959bb[_0xca313d(0x21d)]===0x0){if(_0x32364a&&_0x118637)console[_0xca313d(0x2fb)](_0xca313d(0x348)+_0x32364a+'.'+_0x118637);else _0x32364a?console[_0xca313d(0x2fb)](_0xca313d(0x299)+_0x32364a):console['log']('No\x20attempts\x20found');}else{const _0x4688ef=_0x45418f[_0xca313d(0x26a)],_0x5d369a=_0x3959bb['map'](_0x3188c3=>{const _0x2b8b6c=_0xca313d,_0x3dbd0d=a59_0x33ddab[_0x2b8b6c(0x1fb)]('#'+_0x3188c3['id']),_0x2d6976=_0x3188c3[_0x2b8b6c(0x2ad)]?.['id'],_0x13c98b=_0x3188c3[_0x2b8b6c(0x326)]||_0x3188c3['sessionId'],_0x5e0264=_0x2d6976&&_0x13c98b?hyperlink(_0x3dbd0d,getWorkflowAttemptUrl(_0x4688ef,_0x2d6976,_0x13c98b,_0x3188c3['id'])):_0x3dbd0d,{icon:_0x33d9bb,text:_0x37f977}=getAttemptStatusDisplay(_0x3188c3),_0x1a6495=(_0x3188c3['project']?.[_0x2b8b6c(0x19f)]||'?')+'.'+(_0x3188c3['workflow']?.[_0x2b8b6c(0x19f)]||'?'),_0x516cd0=_0x3188c3['sessionTime']?a59_0x33ddab[_0x2b8b6c(0x1fb)](_0x3188c3[_0x2b8b6c(0x25f)]):'';return(_0x5e0264+'\x20'+_0x33d9bb+(_0x37f977?'\x20'+_0x37f977:'')+'\x20'+_0x1a6495+'\x20'+_0x516cd0)[_0x2b8b6c(0x32e)]();});await writeOutput(_0x5d369a[_0xca313d(0x2f3)]('\x0a'),_0x45418f[_0xca313d(0x23f)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x24a);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x287);async['execute'](_0x481330){const _0x209e73=a59_0x7f9071,{options:_0x1fb097,args:_0x534bc0,tdx:_0x29356b}=_0x481330,_0x5e9ee6=_0x534bc0[0x0];if(!_0x5e9ee6)return console['error'](_0x209e73(0x312)),0x1;_0x1fb097['verbose']&&console[_0x209e73(0x253)](_0x209e73(0x22c)+_0x5e9ee6);const _0x77da2c=await withSpinner(_0x209e73(0x24c),()=>_0x29356b['workflow'][_0x209e73(0x1e4)](_0x5e9ee6),{'verbose':_0x1fb097['verbose']}),_0x5498d9=_0x77da2c[_0x209e73(0x1fa)];let _0x569dc7;!_0x5498d9[_0x209e73(0x27f)]?_0x569dc7=_0x5498d9['cancelRequested']?_0x209e73(0x342):_0x209e73(0x2f0):_0x569dc7=_0x5498d9[_0x209e73(0x1f0)]?_0x209e73(0x1f0):_0x209e73(0x253);let _0x397338;if(_0x5498d9['createdAt']&&_0x5498d9['finishedAt']){const _0x45b731=new Date(_0x5498d9[_0x209e73(0x27e)])[_0x209e73(0x1d3)](),_0x3de209=new Date(_0x5498d9[_0x209e73(0x34d)])['getTime']();_0x397338=Math[_0x209e73(0x1cc)]((_0x3de209-_0x45b731)/0x3e8);}const _0x50e569={'attempt_id':_0x5498d9['id'],'status':_0x569dc7,..._0x5498d9[_0x209e73(0x213)]!==undefined&&{'index':_0x5498d9[_0x209e73(0x213)]},..._0x5498d9['project']&&{'project':_0x5498d9[_0x209e73(0x2ad)][_0x209e73(0x19f)]},..._0x5498d9['workflow']&&{'workflow':_0x5498d9[_0x209e73(0x208)][_0x209e73(0x19f)]},..._0x5498d9[_0x209e73(0x2f2)]&&{'session_id':_0x5498d9[_0x209e73(0x2f2)]},..._0x5498d9['sessionTime']&&{'session_time':_0x5498d9[_0x209e73(0x25f)]},..._0x5498d9[_0x209e73(0x28e)]&&{'retry_attempt':_0x5498d9['retryAttemptName']},..._0x397338!==undefined&&{'duration_sec':_0x397338},..._0x5498d9[_0x209e73(0x27e)]&&{'created_at':_0x5498d9['createdAt']},..._0x5498d9[_0x209e73(0x34d)]&&{'finished_at':_0x5498d9[_0x209e73(0x34d)]},...Object[_0x209e73(0x31f)](_0x5498d9[_0x209e73(0x207)])[_0x209e73(0x21d)]>0x0&&{'params':_0x5498d9['params']}};return await handleSingleObjectOutput(_0x50e569,_0x1fb097),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a59_0x7f9071(0x311);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x1ea);async[a59_0x7f9071(0x34a)](_0x45a4c4){const _0x5c9aed=a59_0x7f9071,{options:_0x1ade39,args:_0x11f0ef,tdx:_0x4b0707}=_0x45a4c4,_0x2cb051=_0x11f0ef[0x0];if(!_0x2cb051)return console[_0x5c9aed(0x253)](_0x5c9aed(0x312)),0x1;const _0x51c592=_0x1ade39[_0x5c9aed(0x1b1)];_0x1ade39[_0x5c9aed(0x1ed)]&&(console[_0x5c9aed(0x253)](_0x5c9aed(0x22c)+_0x2cb051),_0x51c592&&console[_0x5c9aed(0x253)]('Including\x20subtasks:\x20yes'));const _0x450fee=await withSpinner(_0x5c9aed(0x22b),()=>_0x4b0707[_0x5c9aed(0x208)][_0x5c9aed(0x2d0)](_0x2cb051,_0x51c592||![]),{'verbose':_0x1ade39[_0x5c9aed(0x1ed)]}),_0x515aef=_0x450fee['data'];return console[_0x5c9aed(0x253)](_0x5c9aed(0x1a0)+_0x515aef['length']+_0x5c9aed(0x25c)+(_0x515aef['length']!==0x1?'s':'')),await handleSDKOutput(_0x515aef,_0x1ade39),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x2d4);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x2df);async[a59_0x7f9071(0x34a)](_0x371507){const _0x2eb2e5=a59_0x7f9071,{options:_0x5895aa,args:_0x31aae4,tdx:_0x32129d}=_0x371507,_0x45d8a3=_0x31aae4[0x0];let _0x32575f=_0x31aae4[0x1];if(!_0x45d8a3)return console[_0x2eb2e5(0x253)](_0x2eb2e5(0x312)),0x1;_0x5895aa[_0x2eb2e5(0x1ed)]&&(console[_0x2eb2e5(0x253)](_0x2eb2e5(0x22c)+_0x45d8a3),_0x32575f&&console[_0x2eb2e5(0x253)](_0x2eb2e5(0x258)+_0x32575f));const _0x5ae3a0=await withSpinner(_0x2eb2e5(0x347),()=>_0x32129d[_0x2eb2e5(0x208)][_0x2eb2e5(0x336)](_0x45d8a3,_0x32575f),{'verbose':_0x5895aa['verbose']}),_0x4442bf=_0x5ae3a0['data'];if(_0x4442bf[_0x2eb2e5(0x21d)]===0x0)return console['error'](_0x2eb2e5(0x2a8)),0x0;if(!_0x32575f&&(_0x5895aa[_0x2eb2e5(0x27b)]||_0x5895aa['format']))return await handleSDKOutput(_0x4442bf,_0x5895aa),0x0;if(!_0x32575f){const _0x35fb27=_0x4442bf[_0x2eb2e5(0x2fe)](_0x18e4fe=>({'title':_0x18e4fe[_0x2eb2e5(0x265)]+'\x20('+formatBytes(_0x18e4fe[_0x2eb2e5(0x228)])+')','value':_0x18e4fe['taskName']})),_0x2d1741=await a59_0x30a0c4({'type':_0x2eb2e5(0x30a),'name':'task','message':_0x2eb2e5(0x274),'choices':_0x35fb27});if(!_0x2d1741['task'])return console['error'](_0x2eb2e5(0x29c)),0x0;_0x32575f=_0x2d1741[_0x2eb2e5(0x292)];}const _0x26fb8a=await withSpinner(_0x2eb2e5(0x1c9),()=>_0x32129d[_0x2eb2e5(0x208)][_0x2eb2e5(0x281)](_0x45d8a3,_0x32575f),{'verbose':_0x5895aa[_0x2eb2e5(0x1ed)]}),_0x1fc25f=_0x26fb8a[_0x2eb2e5(0x1fa)];return _0x1fc25f?console[_0x2eb2e5(0x2fb)](_0x1fc25f):console[_0x2eb2e5(0x253)](_0x2eb2e5(0x1a3)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a59_0x7f9071(0x19f)]='workflow:kill';[a59_0x7f9071(0x355)]=a59_0x7f9071(0x1ec);async[a59_0x7f9071(0x34a)](_0x16ab6b){const _0x435e2e=a59_0x7f9071,{options:_0xa27f7,args:_0x42e84f,tdx:_0x3a2bab}=_0x16ab6b,_0x424d4a=_0x42e84f[0x0];if(!_0x424d4a)return console[_0x435e2e(0x253)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x266de0=_0xa27f7['reason'];_0xa27f7[_0x435e2e(0x1ed)]&&(console['error'](_0x435e2e(0x22c)+_0x424d4a),_0x266de0&&console[_0x435e2e(0x253)](_0x435e2e(0x2aa)+_0x266de0));if(!_0xa27f7['yes']){if(!isInteractive())return console[_0x435e2e(0x253)](a59_0x33ddab[_0x435e2e(0x214)](_0x435e2e(0x229)),_0x435e2e(0x2dd)),console[_0x435e2e(0x253)](a59_0x33ddab['dim'](_0x435e2e(0x319))),0x1;const _0xf1f51f=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x424d4a+'?');if(!_0xf1f51f)return console[_0x435e2e(0x253)](a59_0x33ddab[_0x435e2e(0x351)]('Cancelled')),0x1;}const _0x225fe7=await withSpinner(_0x435e2e(0x364),()=>_0x3a2bab[_0x435e2e(0x208)][_0x435e2e(0x2ca)](_0x424d4a,_0x266de0),{'verbose':_0xa27f7[_0x435e2e(0x1ed)]}),_0x209a06=_0x225fe7[_0x435e2e(0x1fa)];return console[_0x435e2e(0x253)]('✔\x20'+_0x209a06),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x358);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x289);async['execute'](_0x2e6d23){const _0x5246d0=a59_0x7f9071,{options:_0x7d04bd,args:_0x2b833d,tdx:_0x8fb737}=_0x2e6d23,_0x2b33d5=_0x2b833d[0x0];if(!_0x2b33d5)return console['error'](_0x5246d0(0x249)),console[_0x5246d0(0x253)](_0x5246d0(0x2e0)),0x1;let _0x5ee5e=![],_0x4386ea=_0x2b33d5;if(_0x2b33d5[_0x5246d0(0x27a)](_0x5246d0(0x2a0)))_0x5ee5e=!![],_0x4386ea=_0x2b33d5[_0x5246d0(0x2c5)](0x8);else{if(_0x2b33d5[_0x5246d0(0x27a)]('attempt:'))_0x5ee5e=![],_0x4386ea=_0x2b33d5[_0x5246d0(0x2c5)](0x8);else return console[_0x5246d0(0x253)](_0x5246d0(0x327)),console[_0x5246d0(0x253)](_0x5246d0(0x2e0)),0x1;}const _0x58ef1c=_0x7d04bd[_0x5246d0(0x1b8)],_0x3f0295=_0x7d04bd['resumeFrom'],_0x1fef3d=_0x7d04bd[_0x5246d0(0x207)],_0x39492d=_0x7d04bd[_0x5246d0(0x1b2)];_0x7d04bd[_0x5246d0(0x1ed)]&&(console['error'](_0x5246d0(0x267)+(_0x5ee5e?_0x5246d0(0x1e9):'attempt')+'\x20'+_0x4386ea),_0x58ef1c&&console[_0x5246d0(0x253)](_0x5246d0(0x260)+_0x58ef1c),_0x3f0295&&console[_0x5246d0(0x253)]('Resume\x20from:\x20'+_0x3f0295),_0x1fef3d&&console['error'](_0x5246d0(0x1b6)+_0x1fef3d),_0x39492d&&console[_0x5246d0(0x253)]('Force:\x20yes'));let _0x525c1c;if(_0x1fef3d)try{if(_0x1fef3d['startsWith']('@')){const _0x319eb1=await import('fs/promises'),_0x1c67a9=_0x1fef3d['substring'](0x1),_0x4e2ba5=await _0x319eb1[_0x5246d0(0x20e)](_0x1c67a9,_0x5246d0(0x1de));_0x525c1c=JSON['parse'](_0x4e2ba5);}else _0x525c1c=JSON[_0x5246d0(0x283)](_0x1fef3d);}catch{return console['error'](_0x5246d0(0x1a4)),0x1;}if(!_0x7d04bd[_0x5246d0(0x29d)]){if(!isInteractive())return console['error'](a59_0x33ddab[_0x5246d0(0x214)](_0x5246d0(0x229)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a59_0x33ddab[_0x5246d0(0x1fb)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3593be=await confirmKey(_0x5246d0(0x1a2)+(_0x5ee5e?_0x5246d0(0x1e9):_0x5246d0(0x1e4))+'\x20'+_0x4386ea+'?');if(!_0x3593be)return console[_0x5246d0(0x253)](a59_0x33ddab[_0x5246d0(0x351)](_0x5246d0(0x29c))),0x1;}let _0x54514b;_0x5ee5e?_0x54514b=await withSpinner(_0x5246d0(0x321),()=>_0x8fb737[_0x5246d0(0x208)][_0x5246d0(0x34e)](_0x4386ea,{'fromTask':_0x58ef1c,'retryParams':_0x525c1c}),{'verbose':_0x7d04bd[_0x5246d0(0x1ed)]}):_0x54514b=await withSpinner('Retrying\x20attempt...',()=>_0x8fb737['workflow'][_0x5246d0(0x1e6)](_0x4386ea,{'resumeFrom':_0x3f0295,'retryParams':_0x525c1c,'force':_0x39492d}),{'verbose':_0x7d04bd[_0x5246d0(0x1ed)]});const _0x8e7f7=_0x54514b[_0x5246d0(0x1fa)];return console[_0x5246d0(0x253)](_0x5246d0(0x291)),console[_0x5246d0(0x253)](_0x5246d0(0x313)+_0x8e7f7[_0x5246d0(0x2cf)]),console[_0x5246d0(0x253)]('\x20\x20Session\x20ID:\x20'+_0x8e7f7[_0x5246d0(0x2f2)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x246);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x1ac);async['execute'](_0x13f876){const _0x1600fb=a59_0x7f9071,{options:_0x160504,args:_0x15ad57,tdx:_0x36a111}=_0x13f876;let _0x2393cd=_0x15ad57[0x0];if(!_0x2393cd){const _0x5bf747=this[_0x1600fb(0x222)]([],_0x160504),_0x428a4b=await withSpinner(_0x1600fb(0x2ee),()=>_0x36a111[_0x1600fb(0x208)]['workflows'](_0x5bf747,{'limit':_0x160504[_0x1600fb(0x28c)]}),{'verbose':_0x160504[_0x1600fb(0x1ed)]}),_0x4e3ecd=_0x428a4b[_0x1600fb(0x1fa)];if(_0x4e3ecd[_0x1600fb(0x21d)]===0x0)return console[_0x1600fb(0x253)](_0x1600fb(0x1e3)),!_0x5bf747&&console[_0x1600fb(0x253)](a59_0x33ddab[_0x1600fb(0x1fb)](_0x1600fb(0x2ae))),0x1;const _0x4ca0bf=_0x4e3ecd['map'](_0x4260e4=>({'title':_0x4260e4[_0x1600fb(0x2ad)]?.[_0x1600fb(0x19f)]+'.'+_0x4260e4[_0x1600fb(0x19f)],'value':_0x4260e4[_0x1600fb(0x2ad)]?.[_0x1600fb(0x19f)]+'.'+_0x4260e4[_0x1600fb(0x19f)],'description':_0x4260e4[_0x1600fb(0x320)]?_0x1600fb(0x2a1)+_0x4260e4[_0x1600fb(0x320)]:undefined})),_0x2fb3e1=await a59_0x30a0c4({'type':_0x1600fb(0x30a),'name':_0x1600fb(0x208),'message':_0x1600fb(0x203),'choices':_0x4ca0bf});if(!_0x2fb3e1[_0x1600fb(0x208)])return 0x1;_0x2393cd=_0x2fb3e1[_0x1600fb(0x208)];}if(!_0x2393cd['includes']('.')){const _0x3cd8e2=this[_0x1600fb(0x222)]([],_0x160504);if(_0x3cd8e2)_0x2393cd=_0x3cd8e2+'.'+_0x2393cd;else return console[_0x1600fb(0x253)](a59_0x33ddab[_0x1600fb(0x214)](_0x1600fb(0x218)),_0x1600fb(0x2cc)),console[_0x1600fb(0x253)](a59_0x33ddab[_0x1600fb(0x1fb)](_0x1600fb(0x2ae))),0x1;}const _0x4dbec6=_0x160504[_0x1600fb(0x29f)],_0x4793b0=_0x160504[_0x1600fb(0x25f)],_0x291da6={};if(_0x4dbec6&&Array[_0x1600fb(0x26e)](_0x4dbec6))for(const _0x4c2027 of _0x4dbec6){const _0x59806d=_0x4c2027[_0x1600fb(0x220)]('=');if(_0x59806d===-0x1)return console[_0x1600fb(0x253)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x4c2027),console['error'](_0x1600fb(0x286)),0x1;const _0x2eb111=_0x4c2027['substring'](0x0,_0x59806d),_0x1e46a3=_0x4c2027['substring'](_0x59806d+0x1);try{_0x291da6[_0x2eb111]=JSON[_0x1600fb(0x283)](_0x1e46a3);}catch{_0x291da6[_0x2eb111]=_0x1e46a3;}}_0x160504['verbose']&&(console[_0x1600fb(0x253)](_0x1600fb(0x2b2)+_0x2393cd),Object[_0x1600fb(0x31f)](_0x291da6)[_0x1600fb(0x21d)]>0x0&&console[_0x1600fb(0x253)](_0x1600fb(0x239)+JSON['stringify'](_0x291da6)),_0x4793b0&&console[_0x1600fb(0x253)](_0x1600fb(0x28a)+_0x4793b0));if(_0x160504['dryRun'])return await this[_0x1600fb(0x357)](_0x13f876,_0x2393cd,_0x291da6,_0x4793b0);const _0x56ade5=await withSpinner(_0x1600fb(0x1ca),()=>_0x36a111['workflow']['run'](_0x2393cd,_0x291da6,{'sessionTime':_0x4793b0}),{'verbose':_0x160504[_0x1600fb(0x1ed)]}),_0xec01e3=_0x56ade5[_0x1600fb(0x1fa)];console[_0x1600fb(0x253)](_0x1600fb(0x24d)),console[_0x1600fb(0x253)](_0x1600fb(0x2a2)+_0xec01e3['id']),console[_0x1600fb(0x253)](_0x1600fb(0x31a)+_0xec01e3[_0x1600fb(0x2f2)]),console['error'](_0x1600fb(0x298)+_0xec01e3[_0x1600fb(0x2ad)]?.[_0x1600fb(0x19f)]),console[_0x1600fb(0x253)](_0x1600fb(0x325)+_0xec01e3[_0x1600fb(0x208)]?.['name']);if(_0xec01e3[_0x1600fb(0x2ad)]?.['id']&&_0xec01e3[_0x1600fb(0x2f2)]&&_0xec01e3['id']){const _0xfcf93c=_0x160504[_0x1600fb(0x26a)],_0x3ebe6b=getConsoleUrl(_0xfcf93c,_0x1600fb(0x200)+_0xec01e3[_0x1600fb(0x2ad)]['id']+'/sessions/'+_0xec01e3[_0x1600fb(0x2f2)]+_0x1600fb(0x34f)+_0xec01e3['id']);console[_0x1600fb(0x253)](_0x1600fb(0x2f9)+a59_0x33ddab[_0x1600fb(0x1fe)](_0x3ebe6b));}return 0x0;}async[a59_0x7f9071(0x357)](_0x440196,_0x2d9057,_0x274404,_0x3c7a9e){const _0x18c4b3=a59_0x7f9071,{options:_0x31e9f5,tdx:_0x1f36d6}=_0x440196,_0x32e8de=await withSpinner('Fetching\x20workflow\x20'+_0x2d9057+_0x18c4b3(0x216),()=>_0x1f36d6[_0x18c4b3(0x208)][_0x18c4b3(0x2f8)](_0x2d9057),{'verbose':_0x31e9f5[_0x18c4b3(0x1ed)]}),_0x37af7b=_0x32e8de[_0x18c4b3(0x1fa)],_0x4ed62e=_0x3c7a9e??new Date()[_0x18c4b3(0x211)]();console['log'](a59_0x33ddab[_0x18c4b3(0x32b)](_0x18c4b3(0x288)),_0x2d9057),console['log'](a59_0x33ddab[_0x18c4b3(0x32b)](_0x18c4b3(0x339)),_0x4ed62e),console[_0x18c4b3(0x2fb)](a59_0x33ddab[_0x18c4b3(0x32b)](_0x18c4b3(0x306)),JSON['stringify'](_0x274404)),console[_0x18c4b3(0x2fb)](''),console[_0x18c4b3(0x2fb)](a59_0x33ddab[_0x18c4b3(0x32b)]('Task\x20graph:'));const _0x3bce84=parseTaskGraph(_0x37af7b[_0x18c4b3(0x2de)]??null);if(_0x3bce84[_0x18c4b3(0x21d)]===0x0)console[_0x18c4b3(0x2fb)](a59_0x33ddab['dim'](_0x18c4b3(0x1f6)));else for(const _0x195446 of formatTaskGraph(_0x3bce84)){console['log'](_0x195446);}const _0x53a323=summarizeTaskGraph(_0x3bce84),_0x391e8a=formatWarningSummary(_0x53a323);return _0x391e8a&&(console['log'](''),console[_0x18c4b3(0x2fb)](a59_0x33ddab[_0x18c4b3(0x351)](_0x391e8a))),console['log'](a59_0x33ddab[_0x18c4b3(0x351)](_0x18c4b3(0x1dc))),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a59_0x7f9071(0x337);[a59_0x7f9071(0x355)]='Download\x20workflow\x20project\x20from\x20Treasure\x20AI';async[a59_0x7f9071(0x34a)](_0x50356b){const _0x3eb25c=a59_0x7f9071,{options:_0x1a6812,args:_0x5b40fa,tdx:_0x295534}=_0x50356b,_0x2d2dfc=_0x5b40fa[0x0],_0x2e9a50=_0x5b40fa[0x1]||'.';if(!_0x2d2dfc)return console[_0x3eb25c(0x253)](_0x3eb25c(0x210)),console['error'](_0x3eb25c(0x345)),0x1;const _0x59bc9b=_0x1a6812[_0x3eb25c(0x320)];_0x1a6812['verbose']&&(console[_0x3eb25c(0x253)](_0x3eb25c(0x252)+_0x2d2dfc),console[_0x3eb25c(0x253)](_0x3eb25c(0x277)+_0x2e9a50),_0x59bc9b&&console['error'](_0x3eb25c(0x21c)+_0x59bc9b));const _0x21a93a=await withSpinner(_0x3eb25c(0x1cf)+_0x2d2dfc+_0x3eb25c(0x216),()=>_0x295534['workflow'][_0x3eb25c(0x2c8)](_0x2d2dfc,_0x2e9a50,{'revision':_0x59bc9b}),{'verbose':_0x1a6812[_0x3eb25c(0x1ed)]}),_0x8ad2f9=_0x21a93a[_0x3eb25c(0x1fa)];return console['error']('✔\x20Downloaded\x20'+_0x8ad2f9[_0x3eb25c(0x33e)]),console[_0x3eb25c(0x253)]('\x20\x20Revision:\x20'+_0x8ad2f9['revision']),console[_0x3eb25c(0x253)]('\x20\x20Files\x20extracted:\x20'+_0x8ad2f9[_0x3eb25c(0x24e)]),console[_0x3eb25c(0x253)](_0x3eb25c(0x2c3)+_0x2e9a50+'/'+_0x8ad2f9[_0x3eb25c(0x33e)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a59_0x7f9071(0x231);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x2bf);async[a59_0x7f9071(0x34a)](_0x2cc88e){const _0x55c463=a59_0x7f9071,{options:_0x2413f7,args:_0x25aa84,tdx:_0x1730ae}=_0x2cc88e;let _0x131f96='.',_0x71a0e=_0x2413f7[_0x55c463(0x19f)];if(_0x25aa84[0x0]){const {promises:_0x4c217a}=await import('fs');try{const _0x40151c=await _0x4c217a[_0x55c463(0x1c8)](_0x25aa84[0x0]);if(_0x40151c[_0x55c463(0x30d)]())_0x131f96=_0x25aa84[0x0];else return console['error']('Error:\x20'+_0x25aa84[0x0]+_0x55c463(0x2d9)),0x1;}catch{_0x71a0e=_0x25aa84[0x0],_0x131f96='.';}}const _0x408dce=_0x2413f7[_0x55c463(0x320)],_0x1c6c4f=_0x2413f7['skipValidation'];_0x2413f7[_0x55c463(0x1ed)]&&(console[_0x55c463(0x253)]('Project\x20directory:\x20'+_0x131f96),_0x71a0e&&console[_0x55c463(0x253)]('Project\x20name:\x20'+_0x71a0e),_0x408dce&&console[_0x55c463(0x253)](_0x55c463(0x21c)+_0x408dce),_0x1c6c4f&&console[_0x55c463(0x253)](_0x55c463(0x270)));const _0x4f3ed9=await withSpinner(_0x55c463(0x221),()=>_0x1730ae[_0x55c463(0x208)][_0x55c463(0x23d)](_0x131f96,{'projectName':_0x71a0e,'revision':_0x408dce,'skipValidation':_0x1c6c4f}),{'verbose':_0x2413f7[_0x55c463(0x1ed)]}),_0x544cc3=_0x4f3ed9[_0x55c463(0x1fa)];return console['error'](_0x55c463(0x230)+_0x544cc3[_0x55c463(0x33e)]),console['error'](_0x55c463(0x346)+_0x544cc3['projectId']),console[_0x55c463(0x253)](_0x55c463(0x328)+_0x544cc3[_0x55c463(0x320)]),await this['showWorkflowConsoleUrl'](_0x1730ae,_0x544cc3[_0x55c463(0x33e)],_0x2413f7['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a59_0x7f9071(0x1d4);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x331);async[a59_0x7f9071(0x34a)](_0xd4f2ca){const _0x57ebf1=a59_0x7f9071,{options:_0x5a2c66,args:_0x3baea1,tdx:_0x137ad6}=_0xd4f2ca,_0x5872ac=_0x3baea1[0x0],_0x4acfe4=_0x3baea1[0x1];if(!_0x5872ac)return console[_0x57ebf1(0x253)](a59_0x33ddab[_0x57ebf1(0x214)](_0x57ebf1(0x218)),_0x57ebf1(0x269)),console[_0x57ebf1(0x253)](a59_0x33ddab[_0x57ebf1(0x1fb)](_0x57ebf1(0x1f4))),0x1;const _0x2b8224=_0x5a2c66['revision'];_0x5a2c66[_0x57ebf1(0x1ed)]&&(console[_0x57ebf1(0x253)](_0x57ebf1(0x252)+_0x5872ac),_0x4acfe4&&console[_0x57ebf1(0x253)](_0x57ebf1(0x338)+_0x4acfe4),_0x2b8224&&console['error'](_0x57ebf1(0x21c)+_0x2b8224),_0x5a2c66[_0x57ebf1(0x1d0)]&&console['error'](_0x57ebf1(0x2bc)));const _0x315f85=await withSpinner(_0x57ebf1(0x1e0)+_0x5872ac+_0x57ebf1(0x216),()=>_0x137ad6[_0x57ebf1(0x208)]['pullProject'](_0x5872ac,{'targetDir':_0x4acfe4,'revision':_0x2b8224}),{'verbose':_0x5a2c66['verbose']}),_0x477e63=_0x315f85[_0x57ebf1(0x1fa)];_0x477e63[_0x57ebf1(0x290)]?console[_0x57ebf1(0x253)](_0x57ebf1(0x1cd)+_0x477e63[_0x57ebf1(0x33e)]):console[_0x57ebf1(0x253)]('→\x20Project:\x20'+_0x477e63['projectName']);console['error'](_0x57ebf1(0x328)+_0x477e63['revision']),console[_0x57ebf1(0x253)](_0x57ebf1(0x30c)+(a59_0x1642f5[_0x57ebf1(0x1b3)](process[_0x57ebf1(0x1c1)](),_0x477e63[_0x57ebf1(0x261)])||'.')),console[_0x57ebf1(0x253)](_0x57ebf1(0x2a7)+a59_0x33ddab[_0x57ebf1(0x296)]('+'+_0x477e63[_0x57ebf1(0x2be)][_0x57ebf1(0x293)]+_0x57ebf1(0x1c2))+',\x20'+(a59_0x33ddab[_0x57ebf1(0x351)]('~'+_0x477e63[_0x57ebf1(0x2be)][_0x57ebf1(0x201)]+_0x57ebf1(0x324))+',\x20')+(a59_0x33ddab[_0x57ebf1(0x214)]('-'+_0x477e63['summary'][_0x57ebf1(0x344)]+_0x57ebf1(0x1d2))+',\x20')+(''+a59_0x33ddab['dim'](_0x477e63[_0x57ebf1(0x2be)]['unchanged']+_0x57ebf1(0x279))));for(const _0x2824a3 of _0x477e63[_0x57ebf1(0x31d)]){_0x2824a3[_0x57ebf1(0x2a3)]===_0x57ebf1(0x201)&&_0x2824a3[_0x57ebf1(0x329)]&&(console[_0x57ebf1(0x253)]('\x0a'+a59_0x33ddab[_0x57ebf1(0x1fe)](_0x57ebf1(0x250)+_0x2824a3[_0x57ebf1(0x276)])),console[_0x57ebf1(0x253)](_0x2824a3[_0x57ebf1(0x329)]));}if(!_0x477e63[_0x57ebf1(0x2ff)])return saveSessionContext({'workflow_project':_0x477e63[_0x57ebf1(0x33e)]},_0x5a2c66[_0x57ebf1(0x1e9)]),console[_0x57ebf1(0x253)](a59_0x33ddab[_0x57ebf1(0x296)](_0x57ebf1(0x1e1))),console[_0x57ebf1(0x253)](a59_0x33ddab[_0x57ebf1(0x1fb)](_0x57ebf1(0x202)+_0x477e63[_0x57ebf1(0x33e)])),0x0;if(_0x5a2c66[_0x57ebf1(0x1d0)])return console[_0x57ebf1(0x253)](a59_0x33ddab['yellow']('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x5a2c66[_0x57ebf1(0x29d)]){if(!isInteractive())return console['error'](a59_0x33ddab['red']('\x0aError:'),_0x57ebf1(0x2dd)),console['error'](a59_0x33ddab[_0x57ebf1(0x1fb)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x982818=await confirmKey(_0x57ebf1(0x2f7));if(!_0x982818)return console[_0x57ebf1(0x253)](a59_0x33ddab[_0x57ebf1(0x351)](_0x57ebf1(0x29c)),_0x57ebf1(0x2c9)),0x1;}await withSpinner(_0x57ebf1(0x1e7),()=>_0x137ad6[_0x57ebf1(0x208)]['applyPullProject'](_0x477e63,{'revision':_0x2b8224}),{'verbose':_0x5a2c66[_0x57ebf1(0x1ed)]}),saveSessionContext({'workflow_project':_0x477e63['projectName']},_0x5a2c66[_0x57ebf1(0x1e9)]),console[_0x57ebf1(0x253)](a59_0x33ddab[_0x57ebf1(0x296)]('✔\x20Pull\x20complete'));const _0x23a4ec=a59_0x1642f5[_0x57ebf1(0x1b3)](process[_0x57ebf1(0x1c1)](),_0x477e63[_0x57ebf1(0x261)])||'.';return console[_0x57ebf1(0x253)](a59_0x33ddab[_0x57ebf1(0x1fb)](_0x57ebf1(0x2c3)+_0x23a4ec)),console['error'](a59_0x33ddab[_0x57ebf1(0x1fb)](_0x57ebf1(0x202)+_0x477e63[_0x57ebf1(0x33e)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a59_0x7f9071(0x245);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x2af);async[a59_0x7f9071(0x34a)](_0x4bb901){const _0x52b5d5=a59_0x7f9071,{options:_0x251a9e,args:_0x3b3df8,tdx:_0x29db89}=_0x4bb901,_0x26824c=this['resolveProjectDir'](_0x3b3df8,_0x251a9e),_0x16dbc0=_0x251a9e,{revision:_0x45ac30,skipValidation:_0x524d13,backfill:_0x4cf11f}=_0x16dbc0,_0x444019=_0x4cf11f===undefined?undefined:!_0x4cf11f;_0x251a9e[_0x52b5d5(0x1ed)]&&(_0x26824c&&console['error'](_0x52b5d5(0x368)+_0x26824c),_0x45ac30&&console['error'](_0x52b5d5(0x21c)+_0x45ac30),_0x251a9e[_0x52b5d5(0x1d0)]&&console[_0x52b5d5(0x253)]('Dry\x20run:\x20yes'),_0x524d13&&console[_0x52b5d5(0x253)](_0x52b5d5(0x270)),_0x4cf11f&&console[_0x52b5d5(0x253)](_0x52b5d5(0x303)));let _0x38d3b6;try{_0x38d3b6=await withSpinner(_0x52b5d5(0x2c2),()=>_0x29db89[_0x52b5d5(0x208)][_0x52b5d5(0x315)]({'sourceDir':_0x26824c,'revision':_0x45ac30,'skipValidation':_0x524d13,'skipSchedule':_0x444019}),{'verbose':_0x251a9e[_0x52b5d5(0x1ed)]});}catch(_0x280f13){if(_0x280f13 instanceof Error&&_0x280f13['message'][_0x52b5d5(0x367)](_0x52b5d5(0x316)))return console[_0x52b5d5(0x253)](a59_0x33ddab[_0x52b5d5(0x214)](_0x52b5d5(0x218)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x251a9e[_0x52b5d5(0x2c6)]?console['error'](a59_0x33ddab[_0x52b5d5(0x1fb)]('Tip:\x20cd\x20to\x20workflows/'+_0x251a9e[_0x52b5d5(0x2c6)]+_0x52b5d5(0x22e)+_0x251a9e['workflowProject']+'\x27')):console[_0x52b5d5(0x253)](a59_0x33ddab['dim'](_0x52b5d5(0x308))),0x1;throw _0x280f13;}const _0x624949=_0x38d3b6['data'];console[_0x52b5d5(0x253)](_0x52b5d5(0x1f8)+_0x624949['projectName']),console[_0x52b5d5(0x253)]('\x20\x20Source:\x20'+_0x624949[_0x52b5d5(0x2a4)]),console[_0x52b5d5(0x253)](_0x52b5d5(0x328)+_0x624949[_0x52b5d5(0x320)]),console['error'](_0x52b5d5(0x2a7)+a59_0x33ddab['green']('+'+_0x624949[_0x52b5d5(0x2be)][_0x52b5d5(0x293)]+_0x52b5d5(0x1c2))+',\x20'+(a59_0x33ddab[_0x52b5d5(0x351)]('~'+_0x624949[_0x52b5d5(0x2be)][_0x52b5d5(0x201)]+_0x52b5d5(0x324))+',\x20')+(a59_0x33ddab[_0x52b5d5(0x214)]('-'+_0x624949[_0x52b5d5(0x2be)]['deleted']+'\x20deleted')+',\x20')+(''+a59_0x33ddab[_0x52b5d5(0x1fb)](_0x624949[_0x52b5d5(0x2be)][_0x52b5d5(0x1e2)]+_0x52b5d5(0x279))));for(const _0x3b8ca7 of _0x624949[_0x52b5d5(0x31d)]){_0x3b8ca7[_0x52b5d5(0x2a3)]==='modified'&&_0x3b8ca7['diff']&&(console[_0x52b5d5(0x253)]('\x0a'+a59_0x33ddab[_0x52b5d5(0x1fe)](_0x52b5d5(0x250)+_0x3b8ca7[_0x52b5d5(0x276)])),console[_0x52b5d5(0x253)](_0x3b8ca7[_0x52b5d5(0x329)]));}if(!_0x624949[_0x52b5d5(0x2ff)])return console[_0x52b5d5(0x253)](a59_0x33ddab['green'](_0x52b5d5(0x318))),await this[_0x52b5d5(0x1bb)](_0x29db89,_0x624949[_0x52b5d5(0x33e)],_0x251a9e[_0x52b5d5(0x26a)]),0x0;if(_0x251a9e[_0x52b5d5(0x1d0)])return console['error'](a59_0x33ddab[_0x52b5d5(0x351)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x251a9e[_0x52b5d5(0x29d)]){if(!isInteractive())return console[_0x52b5d5(0x253)](a59_0x33ddab[_0x52b5d5(0x214)](_0x52b5d5(0x229)),_0x52b5d5(0x2dd)),console[_0x52b5d5(0x253)](a59_0x33ddab[_0x52b5d5(0x1fb)](_0x52b5d5(0x319))),0x1;const _0x5e0973=await confirmKey(_0x52b5d5(0x365));if(!_0x5e0973)return console[_0x52b5d5(0x253)](a59_0x33ddab['yellow'](_0x52b5d5(0x29c)),'-\x20nothing\x20pushed'),0x1;}const _0x100d62=await withSpinner(_0x52b5d5(0x2f4),()=>_0x29db89[_0x52b5d5(0x208)][_0x52b5d5(0x32d)](_0x624949),{'verbose':_0x251a9e[_0x52b5d5(0x1ed)]}),_0x1291bd=_0x100d62[_0x52b5d5(0x1fa)];return console[_0x52b5d5(0x253)](a59_0x33ddab['green']('✔\x20Push\x20complete')),console[_0x52b5d5(0x253)](_0x52b5d5(0x346)+_0x1291bd[_0x52b5d5(0x32c)]),console[_0x52b5d5(0x253)](_0x52b5d5(0x328)+_0x1291bd[_0x52b5d5(0x320)]),await this[_0x52b5d5(0x1bb)](_0x29db89,_0x1291bd[_0x52b5d5(0x33e)],_0x251a9e[_0x52b5d5(0x26a)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a59_0x7f9071(0x19f)]='workflow:clone';['description']=a59_0x7f9071(0x1ad);async[a59_0x7f9071(0x34a)](_0x463217){const _0x43e46f=a59_0x7f9071,{options:_0x3f7856,args:_0x427e32,tdx:_0xb5fd25}=_0x463217,_0xa6e40=this['resolveProjectDir'](_0x427e32,_0x3f7856),_0x246fdc=_0x3f7856[_0x43e46f(0x19f)],_0x3721a1=_0x3f7856['revision'],_0x20a40a=_0x3f7856[_0x43e46f(0x2cb)];if(!_0xa6e40)return console[_0x43e46f(0x253)](a59_0x33ddab[_0x43e46f(0x214)](_0x43e46f(0x218)),'Source\x20directory\x20is\x20required'),console[_0x43e46f(0x253)](a59_0x33ddab[_0x43e46f(0x1fb)](_0x43e46f(0x1b4))),console[_0x43e46f(0x253)](a59_0x33ddab[_0x43e46f(0x1fb)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x246fdc)return console['error'](a59_0x33ddab[_0x43e46f(0x214)](_0x43e46f(0x218)),_0x43e46f(0x297)),console[_0x43e46f(0x253)](a59_0x33ddab[_0x43e46f(0x1fb)](_0x43e46f(0x1b4))),0x1;_0x3f7856[_0x43e46f(0x1ed)]&&(console[_0x43e46f(0x253)]('Source\x20directory:\x20'+_0xa6e40),console[_0x43e46f(0x253)](_0x43e46f(0x22d)+_0x246fdc),_0x3721a1&&console[_0x43e46f(0x253)](_0x43e46f(0x21c)+_0x3721a1),_0x3f7856['dryRun']&&console['error'](_0x43e46f(0x2bc)),_0x20a40a&&console['error'](_0x43e46f(0x270)));const _0x42c8de=await withSpinner('Analyzing\x20project...',()=>_0xb5fd25[_0x43e46f(0x208)][_0x43e46f(0x2e3)](_0xa6e40,_0x246fdc,{'revision':_0x3721a1,'skipValidation':_0x20a40a}),{'verbose':_0x3f7856[_0x43e46f(0x1ed)]}),_0x595bc2=_0x42c8de[_0x43e46f(0x1fa)];console[_0x43e46f(0x253)]('Source:\x20'+_0x595bc2[_0x43e46f(0x2a4)]);_0x595bc2[_0x43e46f(0x2f6)]&&console[_0x43e46f(0x253)]('Source\x20project:\x20'+_0x595bc2[_0x43e46f(0x2f6)]);console[_0x43e46f(0x253)]('New\x20project\x20name:\x20'+_0x595bc2[_0x43e46f(0x225)]),console[_0x43e46f(0x253)](_0x43e46f(0x21c)+_0x595bc2[_0x43e46f(0x320)]),console[_0x43e46f(0x253)]('Files\x20to\x20upload:\x20'+_0x595bc2[_0x43e46f(0x2ef)]);_0x595bc2['targetExists']&&(console[_0x43e46f(0x253)](a59_0x33ddab['yellow'](_0x43e46f(0x1a8)+_0x595bc2[_0x43e46f(0x225)]+_0x43e46f(0x242)+_0x595bc2[_0x43e46f(0x1ab)]+')')),console[_0x43e46f(0x253)](a59_0x33ddab[_0x43e46f(0x351)](_0x43e46f(0x32f))));if(_0x3f7856[_0x43e46f(0x1d0)])return console['error'](a59_0x33ddab[_0x43e46f(0x351)](_0x43e46f(0x1e5))),0x0;if(!_0x3f7856[_0x43e46f(0x29d)]){if(!isInteractive())return console[_0x43e46f(0x253)](a59_0x33ddab[_0x43e46f(0x214)](_0x43e46f(0x229)),_0x43e46f(0x2dd)),console['error'](a59_0x33ddab[_0x43e46f(0x1fb)](_0x43e46f(0x319))),0x1;const _0x49b03e=_0x595bc2[_0x43e46f(0x2f6)]||a59_0x1642f5[_0x43e46f(0x209)](_0xa6e40),_0x2044f3=_0x595bc2['targetExists']?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x246fdc+_0x43e46f(0x226):_0x43e46f(0x341)+_0x49b03e+_0x43e46f(0x215)+_0x246fdc+'\x22?',_0x130803=await confirmKey(_0x2044f3);if(!_0x130803)return console[_0x43e46f(0x253)](a59_0x33ddab['yellow']('Cancelled')),0x1;}const _0x16b531=await withSpinner(_0x595bc2[_0x43e46f(0x1c7)]?'Updating\x20'+_0x246fdc+_0x43e46f(0x216):'Cloning\x20to\x20'+_0x246fdc+'...',()=>_0xb5fd25[_0x43e46f(0x208)]['executeCloneProject'](_0x595bc2),{'verbose':_0x3f7856[_0x43e46f(0x1ed)]}),_0x357979=_0x16b531[_0x43e46f(0x1fa)];return console[_0x43e46f(0x253)](a59_0x33ddab[_0x43e46f(0x296)](_0x595bc2[_0x43e46f(0x1c7)]?_0x43e46f(0x35f):_0x43e46f(0x300))),console[_0x43e46f(0x253)](_0x43e46f(0x298)+_0x357979['newProjectName']),console[_0x43e46f(0x253)](_0x43e46f(0x346)+_0x357979[_0x43e46f(0x33b)]),console[_0x43e46f(0x253)]('\x20\x20Revision:\x20'+_0x357979['revision']),await this[_0x43e46f(0x1bb)](_0xb5fd25,_0x357979[_0x43e46f(0x225)],_0x3f7856['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x2db);[a59_0x7f9071(0x355)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20AI';async['execute'](_0x4195fa){const _0x21685b=a59_0x7f9071,{options:_0x20cca6,args:_0xb83666,tdx:_0xb69ff3}=_0x4195fa,_0x1b40be=_0xb83666[0x0];if(!_0x1b40be)return console[_0x21685b(0x253)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x21685b(0x253)](_0x21685b(0x25e)),0x1;_0x20cca6[_0x21685b(0x1ed)]&&console[_0x21685b(0x253)](_0x21685b(0x252)+_0x1b40be);if(!_0x20cca6[_0x21685b(0x29d)]){if(!isInteractive())return console[_0x21685b(0x253)](a59_0x33ddab[_0x21685b(0x214)]('\x0aError:'),_0x21685b(0x2dd)),console[_0x21685b(0x253)](a59_0x33ddab[_0x21685b(0x1fb)](_0x21685b(0x319))),0x1;const _0x1d6c51=await confirmKey(_0x21685b(0x2dc)+_0x1b40be+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x1d6c51)return console[_0x21685b(0x253)](a59_0x33ddab[_0x21685b(0x351)](_0x21685b(0x29c))),0x1;}const _0x32bcb1=await withSpinner(_0x21685b(0x257)+_0x1b40be+_0x21685b(0x216),()=>_0xb69ff3[_0x21685b(0x208)][_0x21685b(0x1bf)](_0x1b40be),{'verbose':_0x20cca6['verbose']}),_0x5065d5=_0x32bcb1['data'];return console[_0x21685b(0x253)](_0x21685b(0x1bd)+_0x5065d5['projectName']),console[_0x21685b(0x253)]('\x20\x20Project\x20ID:\x20'+_0x5065d5[_0x21685b(0x32c)]),0x0;}}export function parseKeyValue(_0x32b625){const _0x15f767=a59_0x7f9071,_0x406bf7=_0x32b625['indexOf']('=');if(_0x406bf7===-0x1)throw new Error(_0x15f767(0x1db)+_0x32b625+_0x15f767(0x1af));const _0x285943=_0x32b625[_0x15f767(0x2c5)](0x0,_0x406bf7),_0x109611=_0x32b625[_0x15f767(0x2c5)](_0x406bf7+0x1);if(!_0x285943)throw new Error(_0x15f767(0x280));return{'key':_0x285943,'value':_0x109611};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x227);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x251);async[a59_0x7f9071(0x34a)](_0x517db4){const _0x2c429c=a59_0x7f9071,{options:_0x37a9f5,args:_0x3d29e0,tdx:_0x1970a6}=_0x517db4,_0x1d4aa3=this['requireProject'](_0x3d29e0,_0x37a9f5);if(!_0x1d4aa3)return 0x1;_0x37a9f5[_0x2c429c(0x1ed)]&&console[_0x2c429c(0x253)](_0x2c429c(0x252)+_0x1d4aa3);const _0x1a9cb0=await withSpinner(_0x2c429c(0x362),()=>_0x1970a6[_0x2c429c(0x208)]['listSecrets'](_0x1d4aa3),{'verbose':_0x37a9f5[_0x2c429c(0x1ed)]}),{secrets:_0x54779c}=_0x1a9cb0[_0x2c429c(0x1fa)];return console[_0x2c429c(0x253)](_0x2c429c(0x1a0)+_0x54779c[_0x2c429c(0x21d)]+_0x2c429c(0x23e)+(_0x54779c[_0x2c429c(0x21d)]!==0x1?'s':'')),await handleSDKOutput(_0x54779c,_0x37a9f5),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a59_0x7f9071(0x19f)]='workflow:secrets:set';['description']=a59_0x7f9071(0x2f5);async[a59_0x7f9071(0x34a)](_0x4b25d2){const _0x3702b7=a59_0x7f9071,{options:_0x3da97d,args:_0x344486,tdx:_0x2dc0c2}=_0x4b25d2;let _0x15f40d,_0x537a6e;if(_0x344486[_0x3702b7(0x21d)]>=0x1&&!_0x344486[0x0][_0x3702b7(0x367)]('='))_0x15f40d=_0x344486[0x0],_0x537a6e=_0x344486['slice'](0x1);else{if(_0x344486[_0x3702b7(0x21d)]>=0x1&&_0x3da97d[_0x3702b7(0x2c6)])_0x15f40d=_0x3da97d['workflowProject'],_0x537a6e=_0x344486;else return _0x344486['length']>=0x1?(console['error'](_0x3702b7(0x210)),console[_0x3702b7(0x253)](_0x3702b7(0x2ae)),0x1):(console[_0x3702b7(0x253)](_0x3702b7(0x1e8)),console['error'](_0x3702b7(0x28b)),0x1);}if(_0x537a6e[_0x3702b7(0x21d)]===0x0)return console[_0x3702b7(0x253)](_0x3702b7(0x1e8)),console[_0x3702b7(0x253)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1;const _0x153d50={};try{for(const _0x2c3cf9 of _0x537a6e){const {key:_0x5bd47c,value:_0x37887f}=parseKeyValue(_0x2c3cf9);_0x153d50[_0x5bd47c]=_0x37887f;}}catch(_0x4c4f7a){return _0x4c4f7a instanceof Error&&console[_0x3702b7(0x253)](a59_0x33ddab['red'](_0x3702b7(0x218)),_0x4c4f7a[_0x3702b7(0x259)]),0x1;}const _0x5c22f9=Object['keys'](_0x153d50);_0x3da97d[_0x3702b7(0x1ed)]&&(console[_0x3702b7(0x253)]('Project:\x20'+_0x15f40d),console['error']('Secrets\x20to\x20set:\x20'+_0x5c22f9[_0x3702b7(0x2f3)](',\x20')));const _0x5069fb=await withSpinner(_0x5c22f9[_0x3702b7(0x21d)]===0x1?_0x3702b7(0x2fd):'Setting\x20'+_0x5c22f9['length']+_0x3702b7(0x359),()=>_0x2dc0c2[_0x3702b7(0x208)][_0x3702b7(0x233)](_0x15f40d,_0x153d50),{'verbose':_0x3da97d[_0x3702b7(0x1ed)]}),_0x23feb1=_0x5069fb[_0x3702b7(0x1fa)];return console[_0x3702b7(0x253)](_0x5c22f9[_0x3702b7(0x21d)]===0x1?'✔\x20Secret\x20\x27'+_0x23feb1[_0x3702b7(0x31f)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x23feb1[_0x3702b7(0x33e)]+'\x27':'✔\x20'+_0x23feb1[_0x3702b7(0x31f)]['length']+_0x3702b7(0x2da)+_0x23feb1['projectName']+'\x27'),(_0x3da97d['json']||_0x3da97d[_0x3702b7(0x35d)])&&await handleSingleObjectOutput(_0x23feb1,_0x3da97d),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x27c);['description']=a59_0x7f9071(0x26d);async[a59_0x7f9071(0x34a)](_0xc01e22){const _0x2e670e=a59_0x7f9071,{options:_0x4d1765,args:_0x2af1be,tdx:_0x43acfe}=_0xc01e22;let _0x435989,_0x5c942c;if(_0x2af1be[_0x2e670e(0x21d)]>=0x2)_0x435989=_0x2af1be[0x0],_0x5c942c=_0x2af1be[0x1];else{if(_0x2af1be[_0x2e670e(0x21d)]===0x1&&_0x4d1765[_0x2e670e(0x2c6)])_0x435989=_0x4d1765[_0x2e670e(0x2c6)],_0x5c942c=_0x2af1be[0x0];else return _0x2af1be[_0x2e670e(0x21d)]===0x1?(console[_0x2e670e(0x253)](_0x2e670e(0x210)),console[_0x2e670e(0x253)](_0x2e670e(0x2ae)),0x1):(console[_0x2e670e(0x253)](_0x2e670e(0x224)),console[_0x2e670e(0x253)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x4d1765[_0x2e670e(0x1ed)]&&(console[_0x2e670e(0x253)](_0x2e670e(0x252)+_0x435989),console[_0x2e670e(0x253)](_0x2e670e(0x235)+_0x5c942c));if(!_0x4d1765[_0x2e670e(0x29d)]){if(!isInteractive())return console[_0x2e670e(0x253)](a59_0x33ddab[_0x2e670e(0x214)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2e670e(0x253)](a59_0x33ddab['dim'](_0x2e670e(0x319))),0x1;const _0x529cb9=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x5c942c+'\x27\x20from\x20project\x20\x27'+_0x435989+'\x27?');if(!_0x529cb9)return console[_0x2e670e(0x253)](a59_0x33ddab[_0x2e670e(0x351)](_0x2e670e(0x29c))),0x1;}const _0x41e1b3=await withSpinner('Deleting\x20secret...',()=>_0x43acfe['workflow'][_0x2e670e(0x30b)](_0x435989,_0x5c942c),{'verbose':_0x4d1765[_0x2e670e(0x1ed)]}),_0x40687b=_0x41e1b3[_0x2e670e(0x1fa)];return console['error'](_0x2e670e(0x237)+_0x40687b[_0x2e670e(0x35a)]+_0x2e670e(0x2f1)+_0x40687b['projectName']+'\x27'),(_0x4d1765['json']||_0x4d1765[_0x2e670e(0x35d)])&&await handleSingleObjectOutput(_0x40687b,_0x4d1765),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(_0x16b552){const _0x14bb0a=a59_0x7f9071,_0x5bd5f9=Math[_0x14bb0a(0x272)](_0x16b552/0x3e8),_0x39bda7=Math['floor'](_0x5bd5f9/0x3c),_0xbe06a1=Math[_0x14bb0a(0x272)](_0x39bda7/0x3c),_0x1ad141=Math['floor'](_0xbe06a1/0x18);if(_0x1ad141>0x0){const _0x5ce70d=_0xbe06a1%0x18;return _0x5ce70d>0x0?_0x1ad141+'d\x20'+_0x5ce70d+'h':_0x1ad141+'d';}else{if(_0xbe06a1>0x0){const _0x28bb84=_0x39bda7%0x3c;return _0x28bb84>0x0?_0xbe06a1+'h\x20'+_0x28bb84+'m':_0xbe06a1+'h';}else{if(_0x39bda7>0x0){const _0x4f2f25=_0x5bd5f9%0x3c;return _0x4f2f25>0x0?_0x39bda7+'m\x20'+_0x4f2f25+'s':_0x39bda7+'m';}else return _0x5bd5f9+'s';}}}function formatTimestamp(_0x5533b2,_0xdfce43){const _0x22bea9=a59_0x7f9071,_0x2052d5=new Date(_0x5533b2),_0x329db6=String(_0x2052d5[_0x22bea9(0x27d)]())[_0x22bea9(0x305)](0x2,'0'),_0x2707ad=String(_0x2052d5[_0x22bea9(0x353)]())[_0x22bea9(0x305)](0x2,'0'),_0x37a3b7=_0x329db6+':'+_0x2707ad,_0x2f7b39=_0x2052d5[_0x22bea9(0x301)]()===_0xdfce43[_0x22bea9(0x301)]()&&_0x2052d5[_0x22bea9(0x26b)]()===_0xdfce43[_0x22bea9(0x26b)]()&&_0x2052d5[_0x22bea9(0x256)]()===_0xdfce43['getDate']();if(_0x2f7b39)return _0x37a3b7;else{const _0x2209d4=String(_0x2052d5[_0x22bea9(0x26b)]()+0x1)[_0x22bea9(0x305)](0x2,'0'),_0x131639=String(_0x2052d5['getDate']())[_0x22bea9(0x305)](0x2,'0');return _0x2209d4+'-'+_0x131639+'\x20'+_0x37a3b7;}}function formatDate(_0x5347f2){const _0x1b03df=a59_0x7f9071,_0x59e2f9=_0x5347f2['getFullYear'](),_0x56124d=String(_0x5347f2[_0x1b03df(0x26b)]()+0x1)[_0x1b03df(0x305)](0x2,'0'),_0x43e5de=String(_0x5347f2[_0x1b03df(0x256)]())[_0x1b03df(0x305)](0x2,'0');return _0x59e2f9+'-'+_0x56124d+'-'+_0x43e5de;}function getTaskStateIcon(_0x4c0d9d){const _0x2b6bc3={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x2b6bc3[_0x4c0d9d]||'⚪';}function getBarChar(_0x1c1fc8){const _0x43b363=a59_0x7f9071;return _0x1c1fc8===_0x43b363(0x253)||_0x1c1fc8===_0x43b363(0x1eb)?'×':'─';}function getBarColor(_0x1c9b7b){const _0xcbb117=a59_0x7f9071,_0x51aa9d={'success':a59_0x33ddab[_0xcbb117(0x296)],'error':a59_0x33ddab[_0xcbb117(0x214)],'group_error':a59_0x33ddab[_0xcbb117(0x214)],'running':a59_0x33ddab['blue'],'blocked':a59_0x33ddab[_0xcbb117(0x351)],'planned':a59_0x33ddab['dim'],'canceling':a59_0x33ddab[_0xcbb117(0x351)]};return _0x51aa9d[_0x1c9b7b]||a59_0x33ddab[_0xcbb117(0x354)];}function parseTaskName(_0x20a777){const _0x50509f=a59_0x7f9071;let _0x2e5881=_0x20a777[_0x50509f(0x1a7)](/^\++/,'');const _0x46687b=_0x2e5881[_0x50509f(0x2c7)]('+'),_0x45517a=_0x46687b[_0x50509f(0x21d)]>0x1?_0x46687b['length']-0x2:0x0,_0x3e49c2=_0x46687b[_0x46687b[_0x50509f(0x21d)]-0x1]||_0x2e5881;return{'level':_0x45517a,'name':'+'+_0x3e49c2};}function truncateTaskName(_0x4e301d,_0x4fb483){const _0x2c2d86=stringWidth(_0x4e301d);if(_0x2c2d86<=_0x4fb483)return _0x4e301d;let _0x50b62a=_0x4e301d;while(stringWidth(_0x50b62a+'…')>_0x4fb483&&_0x50b62a['length']>0x0){_0x50b62a=_0x50b62a['slice'](0x0,-0x1);}return _0x50b62a+'…';}function calculateTimeScale(_0x13d566,_0x1fd616){const _0x1776dc=a59_0x7f9071;return{'startTime':_0x13d566['start'],'endTime':_0x13d566[_0x1776dc(0x2bd)],'durationMs':_0x13d566[_0x1776dc(0x284)],'msPerChar':_0x13d566[_0x1776dc(0x284)]/_0x1fd616};}function timeToPosition(_0x30997c,_0x15e48c,_0x5e090a){const _0x3d8118=a59_0x7f9071,_0x3b97a4=_0x30997c-_0x15e48c[_0x3d8118(0x294)],_0x44c222=Math['floor'](_0x3b97a4/_0x15e48c[_0x3d8118(0x2ed)]);return Math[_0x3d8118(0x1c6)](0x0,Math['min'](_0x44c222,_0x5e090a));}function a59_0x392d(_0x1391e9,_0x189eb4){_0x1391e9=_0x1391e9-0x19f;const _0x1a0de5=a59_0x1a0d();let _0x392d9f=_0x1a0de5[_0x1391e9];return _0x392d9f;}function renderTimeAxis(_0x21ff12,_0x536630){const _0x3dba73=a59_0x7f9071,_0x23b235=Math[_0x3dba73(0x340)](TIMELINE_CONFIG[_0x3dba73(0x2fc)],Math[_0x3dba73(0x1c6)](TIMELINE_CONFIG[_0x3dba73(0x1da)],Math[_0x3dba73(0x272)](_0x536630/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x1635e0=_0x21ff12['durationMs']/(_0x23b235-0x1),_0x600377=new Date(_0x21ff12[_0x3dba73(0x294)]),_0x4f966f=[];for(let _0x192c54=0x0;_0x192c54<_0x23b235;_0x192c54++){const _0xc1d61c=_0x21ff12[_0x3dba73(0x294)]+_0x192c54*_0x1635e0,_0xe94be1=timeToPosition(_0xc1d61c,_0x21ff12,_0x536630),_0x4ba609=formatTimestamp(_0xc1d61c,_0x600377);_0x4f966f[_0x3dba73(0x23d)]({'pos':_0xe94be1,'text':_0x4ba609});}const _0x4adff3=new Array(_0x536630)['fill']('\x20');let _0x150362=-0x1;for(const {pos:_0x438728,text:_0x363767}of _0x4f966f){let _0xe9eb9b=Math[_0x3dba73(0x1c6)](0x0,_0x438728-Math['floor'](_0x363767[_0x3dba73(0x21d)]/0x2));_0xe9eb9b<=_0x150362+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0xe9eb9b=_0x150362+TIMELINE_CONFIG[_0x3dba73(0x2ec)]+0x1);_0xe9eb9b+_0x363767['length']>_0x536630&&(_0xe9eb9b=_0x536630-_0x363767[_0x3dba73(0x21d)]);if(_0xe9eb9b>=0x0&&_0xe9eb9b+_0x363767[_0x3dba73(0x21d)]<=_0x536630&&_0xe9eb9b>_0x150362){for(let _0x56b1f4=0x0;_0x56b1f4<_0x363767['length'];_0x56b1f4++){_0x4adff3[_0xe9eb9b+_0x56b1f4]=_0x363767[_0x56b1f4];}_0x150362=_0xe9eb9b+_0x363767[_0x3dba73(0x21d)]-0x1;}}return _0x4adff3['join']('');}function renderTaskRow(_0x495508,_0x2a5f92,_0x564326,_0x1f9462){const _0x39674f=a59_0x7f9071,{level:_0x5f5dc6,name:_0x5731ef}=parseTaskName(_0x495508[_0x39674f(0x19f)]),_0x8d48ff='\x20'['repeat'](_0x5f5dc6),_0x2477d0=_0x495508[_0x39674f(0x2cd)]?'('+formatElapsed(_0x495508['window'][_0x39674f(0x284)])+')':'',_0x149330=stringWidth(_0x2477d0),_0x39f5ea=_0x5f5dc6*0x1,_0x416a12=_0x1f9462-_0x39f5ea-_0x149330-0x1,_0x7853ab=truncateTaskName(_0x5731ef,_0x416a12),_0x2d7f44=_0x8d48ff+_0x7853ab,_0x1bcab2=stringWidth(_0x2d7f44),_0x44a69e=_0x1f9462-_0x1bcab2-_0x149330,_0x42f2c2=_0x2d7f44+'\x20'[_0x39674f(0x1d7)](Math['max'](0x1,_0x44a69e))+a59_0x33ddab[_0x39674f(0x1fb)](_0x2477d0),_0x87c8bd=getTaskStateIcon(_0x495508[_0x39674f(0x2ab)]),_0x5ab322=new Array(_0x564326)[_0x39674f(0x24b)]('\x20');if(_0x495508[_0x39674f(0x2cd)]){const _0x594694=timeToPosition(_0x495508['window'][_0x39674f(0x1ae)],_0x2a5f92,_0x564326),_0x40bf89=timeToPosition(_0x495508[_0x39674f(0x2cd)]['end'],_0x2a5f92,_0x564326),_0x56110f=getBarChar(_0x495508['state']),_0x3f23d9=Math['max'](_0x594694+0x1,_0x40bf89);for(let _0x30dbb3=_0x594694;_0x30dbb3<Math[_0x39674f(0x340)](_0x3f23d9,_0x564326);_0x30dbb3++){_0x5ab322[_0x30dbb3]=_0x56110f;}}const _0x32aa1b=getBarColor(_0x495508[_0x39674f(0x2ab)]),_0x3f5676=_0x5ab322[_0x39674f(0x2fe)](_0x3d3e3a=>_0x3d3e3a==='\x20'?'\x20':_0x32aa1b(_0x3d3e3a))[_0x39674f(0x2f3)]('');return _0x87c8bd+'\x20'+_0x42f2c2+'│'+_0x3f5676+'│';}function calculateStats(_0x98c7ac){const _0xa50145=a59_0x7f9071,_0x5f0561={'total':_0x98c7ac['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x568010 of _0x98c7ac){if(_0x568010['state']==='success')_0x5f0561[_0xa50145(0x1f0)]++;else{if(_0x568010['state']===_0xa50145(0x253)||_0x568010[_0xa50145(0x2ab)]==='group_error')_0x5f0561[_0xa50145(0x253)]++;else _0x568010[_0xa50145(0x2ab)]===_0xa50145(0x2f0)?_0x5f0561['running']++:_0x5f0561[_0xa50145(0x30f)]++;}}return _0x5f0561;}function formatStats(_0x723905){const _0x16c2a1=a59_0x7f9071;return[_0x16c2a1(0x2c0)+_0x723905[_0x16c2a1(0x1c5)],'✅\x20'+_0x723905[_0x16c2a1(0x1f0)],'❌\x20'+_0x723905[_0x16c2a1(0x253)],_0x16c2a1(0x343)+_0x723905[_0x16c2a1(0x2f0)],'⏳\x20'+_0x723905[_0x16c2a1(0x30f)]][_0x16c2a1(0x2f3)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a59_0x7f9071(0x317);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x2e4);async['execute'](_0x27a6e0){const _0x1d2f6c=a59_0x7f9071,{options:_0x37cfd6,args:_0x59d18c,tdx:_0x536958}=_0x27a6e0;let _0x2e3d75,_0x556de7,_0x40569b=![];if(_0x59d18c[0x0]){if(_0x59d18c[0x0]['includes']('.')){const _0x1a1f41=this[_0x1d2f6c(0x2e9)](_0x59d18c,_0x37cfd6);if(!_0x1a1f41)return 0x1;_0x2e3d75=_0x1a1f41[_0x1d2f6c(0x33e)],_0x556de7=_0x1a1f41['workflowName'];}else{_0x556de7=_0x59d18c[0x0],_0x2e3d75=_0x37cfd6[_0x1d2f6c(0x2c6)];if(!_0x2e3d75)return console[_0x1d2f6c(0x253)](a59_0x33ddab[_0x1d2f6c(0x214)](_0x1d2f6c(0x218)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x40569b=!![];}}else{const _0x430c07=this['parseProjectWorkflowPattern'](_0x59d18c,_0x37cfd6);if(!_0x430c07)return 0x1;_0x2e3d75=_0x430c07[_0x1d2f6c(0x33e)],_0x556de7=_0x430c07['workflowName'];}if(_0x37cfd6[_0x1d2f6c(0x1ed)]){if(_0x2e3d75&&_0x556de7)console[_0x1d2f6c(0x253)](_0x1d2f6c(0x26c)+_0x2e3d75+'.'+_0x556de7);else _0x2e3d75&&console['error'](_0x1d2f6c(0x240)+_0x2e3d75);}const _0x3d0c02=_0x37cfd6[_0x1d2f6c(0x2cf)],_0x109c67=_0x37cfd6[_0x1d2f6c(0x2f2)];if(_0x3d0c02){_0x109c67&&console[_0x1d2f6c(0x253)](a59_0x33ddab[_0x1d2f6c(0x351)]('Warning:'),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x3fa22d=_0x37cfd6[_0x1d2f6c(0x21e)];return _0x3fa22d?await this[_0x1d2f6c(0x2b0)](_0x27a6e0,_0x3d0c02):await this[_0x1d2f6c(0x1a9)](_0x27a6e0,_0x3d0c02,_0x37cfd6),0x0;}if(_0x109c67){const _0x448c9c=await withSpinner(_0x1d2f6c(0x2b5),()=>_0x536958[_0x1d2f6c(0x208)][_0x1d2f6c(0x22f)]({'projectName':_0x2e3d75,'workflowName':_0x556de7,'limit':0x64}),{'verbose':_0x37cfd6['verbose']}),_0x953578=_0x448c9c[_0x1d2f6c(0x1fa)][_0x1d2f6c(0x322)](_0x493168=>_0x493168['id']===_0x109c67);if(!_0x953578)return console[_0x1d2f6c(0x253)](a59_0x33ddab[_0x1d2f6c(0x214)]('Error:'),'Session\x20not\x20found:\x20'+_0x109c67),0x1;if(!_0x953578['lastAttempt']?.['id'])return console['error'](a59_0x33ddab[_0x1d2f6c(0x214)](_0x1d2f6c(0x218)),_0x1d2f6c(0x282)+_0x109c67+_0x1d2f6c(0x264)),0x1;const _0x548f12=_0x953578['lastAttempt']['id'];_0x37cfd6[_0x1d2f6c(0x1ed)]&&console[_0x1d2f6c(0x253)](_0x1d2f6c(0x1ee)+_0x548f12+_0x1d2f6c(0x1b7)+_0x109c67);const _0x12cfe2=_0x37cfd6[_0x1d2f6c(0x21e)];return _0x12cfe2?await this[_0x1d2f6c(0x2b0)](_0x27a6e0,_0x548f12):await this[_0x1d2f6c(0x1a9)](_0x27a6e0,_0x548f12,_0x37cfd6),0x0;}const _0x1f565c=await withSpinner('Loading\x20sessions...',()=>_0x536958[_0x1d2f6c(0x208)][_0x1d2f6c(0x22f)]({'projectName':_0x2e3d75,'workflowName':_0x556de7,'limit':_0x37cfd6[_0x1d2f6c(0x28c)]||0x32}),{'verbose':_0x37cfd6[_0x1d2f6c(0x1ed)]}),_0x49cba2=_0x1f565c[_0x1d2f6c(0x1fa)];if(_0x49cba2[_0x1d2f6c(0x21d)]===0x0){if(_0x2e3d75&&_0x556de7)console[_0x1d2f6c(0x253)](_0x1d2f6c(0x1be)+_0x2e3d75+'.'+_0x556de7);else _0x2e3d75?console['error'](_0x1d2f6c(0x352)+_0x2e3d75):(console[_0x1d2f6c(0x253)](_0x1d2f6c(0x34b)),console[_0x1d2f6c(0x253)](a59_0x33ddab[_0x1d2f6c(0x1fb)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x49cba2['sort']((_0x40f224,_0x2be9b9)=>{const _0x1268b5=_0x1d2f6c,_0x286607=_0x40f224[_0x1268b5(0x25f)]||'',_0x14c247=_0x2be9b9['sessionTime']||'';return _0x14c247[_0x1268b5(0x205)](_0x286607);});if(_0x37cfd6[_0x1d2f6c(0x27b)]||_0x37cfd6[_0x1d2f6c(0x35d)])return await handleSDKOutput(_0x49cba2,_0x37cfd6),0x0;let _0x29bd02;if(_0x40569b){const _0x4dd159=_0x49cba2[0x0];if(!_0x4dd159[_0x1d2f6c(0x1d6)]?.['id'])return console[_0x1d2f6c(0x253)](_0x1d2f6c(0x24f)),0x0;_0x29bd02=_0x4dd159[_0x1d2f6c(0x1d6)]['id'],_0x37cfd6[_0x1d2f6c(0x1ed)]&&console[_0x1d2f6c(0x253)](_0x1d2f6c(0x1f9)+_0x4dd159[_0x1d2f6c(0x25f)]);}else{const _0x3d0f81=_0x49cba2[_0x1d2f6c(0x2fe)](_0x598b61=>{const _0x255828=_0x1d2f6c,_0x27dc66=getAttemptStatusDisplay(_0x598b61[_0x255828(0x1d6)]);return{'title':_0x598b61[_0x255828(0x2ad)]?.[_0x255828(0x19f)]+'.'+_0x598b61[_0x255828(0x208)]?.['name']+'\x20-\x20'+_0x598b61[_0x255828(0x25f)]+'\x20'+_0x27dc66['icon'],'value':_0x598b61[_0x255828(0x1d6)]?.['id']||'','description':_0x27dc66[_0x255828(0x20f)]};}),_0x1da1d9=await a59_0x30a0c4({'type':_0x1d2f6c(0x30a),'name':_0x1d2f6c(0x2cf),'message':_0x1d2f6c(0x2d6),'choices':_0x3d0f81['filter'](_0x2e6a23=>_0x2e6a23[_0x1d2f6c(0x366)]!=='')});if(!_0x1da1d9[_0x1d2f6c(0x2cf)])return 0x0;_0x29bd02=_0x1da1d9['attemptId'];}const _0x33eb05=_0x37cfd6[_0x1d2f6c(0x21e)];return _0x33eb05?await this[_0x1d2f6c(0x2b0)](_0x27a6e0,_0x29bd02):await this[_0x1d2f6c(0x1a9)](_0x27a6e0,_0x29bd02,_0x37cfd6),0x0;}async[a59_0x7f9071(0x1a9)](_0x306991,_0x1b783a,_0x104d3){const _0x4b37e1=a59_0x7f9071,{tdx:_0xa1def4}=_0x306991;let _0x1320b3,_0x4f581b;try{[_0x1320b3,_0x4f581b]=await Promise['all']([_0xa1def4[_0x4b37e1(0x208)][_0x4b37e1(0x1e4)](_0x1b783a),_0xa1def4['workflow'][_0x4b37e1(0x2d0)](_0x1b783a,![])]);}catch(_0x2d765){console[_0x4b37e1(0x253)](a59_0x33ddab['red'](_0x4b37e1(0x1d1)));_0x104d3[_0x4b37e1(0x1ed)]&&console[_0x4b37e1(0x253)](_0x2d765);throw _0x2d765;}if(_0x104d3[_0x4b37e1(0x27b)]||_0x104d3['jsonl']){const _0x431e23=this['buildTimelineData'](_0x1320b3,_0x4f581b);await handleSDKOutput([_0x431e23],_0x104d3);return;}const _0x38e6c0=_0xa1def4['context'][_0x4b37e1(0x26a)],_0x51bb66=this['renderTimeline'](_0x1320b3,_0x4f581b,_0x38e6c0);console[_0x4b37e1(0x2fb)](_0x51bb66);}async['pollTimeline'](_0x9b7dcc,_0x363113){const _0xbce2f9=a59_0x7f9071,{tdx:_0x14d43a}=_0x9b7dcc,_0x116435=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0xb6abda=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x474ced=0x0;while(_0x474ced<_0xb6abda){process['stdout'][_0xbce2f9(0x23c)]&&process[_0xbce2f9(0x356)]['write']('\x1Bc');let _0x6f0842,_0x1f44a2;try{[_0x6f0842,_0x1f44a2]=await Promise[_0xbce2f9(0x33f)]([_0x14d43a[_0xbce2f9(0x208)][_0xbce2f9(0x1e4)](_0x363113),_0x14d43a[_0xbce2f9(0x208)]['tasks'](_0x363113,![])]);}catch(_0x6a3423){console[_0xbce2f9(0x253)](a59_0x33ddab[_0xbce2f9(0x214)](_0xbce2f9(0x25b)));_0x474ced>0x0&&console[_0xbce2f9(0x253)](a59_0x33ddab['dim'](_0xbce2f9(0x35e)+_0x474ced));throw _0x6a3423;}const _0x42fb6a=_0x14d43a['context']['site'],_0x534a10=this[_0xbce2f9(0x217)](_0x6f0842,_0x1f44a2,_0x42fb6a);console[_0xbce2f9(0x2fb)](_0x534a10);const _0x45ddf6=_0x6f0842['done']&&_0x1f44a2['every'](_0x1a7d12=>_0x1a7d12[_0xbce2f9(0x2ab)]!==_0xbce2f9(0x2f0)&&_0x1a7d12[_0xbce2f9(0x2ab)]!==_0xbce2f9(0x1f7));if(_0x45ddf6){console[_0xbce2f9(0x253)](a59_0x33ddab['green'](_0xbce2f9(0x29e)));break;}console[_0xbce2f9(0x253)](a59_0x33ddab[_0xbce2f9(0x1fb)]('\x0aPolling...\x20('+_0x474ced*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x13e205=>setTimeout(_0x13e205,_0x116435)),_0x474ced++;}_0x474ced>=_0xb6abda&&console[_0xbce2f9(0x253)](a59_0x33ddab['yellow'](_0xbce2f9(0x271)));}[a59_0x7f9071(0x217)](_0x57293c,_0x52eca4,_0x2db3df){const _0x21459b=a59_0x7f9071,_0x2b2ca4=[],_0x5e452f=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x3696c4=0x5,_0xfa164f=process[_0x21459b(0x356)][_0x21459b(0x2a9)]||0x78,_0x486874=_0xfa164f-_0x5e452f-_0x3696c4,_0x16a962=Math[_0x21459b(0x1c6)](TIMELINE_CONFIG[_0x21459b(0x1ce)],Math[_0x21459b(0x340)](_0x486874,TIMELINE_CONFIG[_0x21459b(0x1fc)])),_0x474a67=new Date(_0x57293c[_0x21459b(0x27e)])['getTime'](),_0x5957c0=_0x57293c['finishedAt']?new Date(_0x57293c[_0x21459b(0x34d)])[_0x21459b(0x1d3)]():Date[_0x21459b(0x2e7)](),_0x3e3095={'start':_0x474a67,'end':_0x5957c0,'duration':_0x5957c0-_0x474a67},_0x4a2543=new Map(),_0xed9343=[];for(const _0x1ab537 of _0x52eca4){if(_0x1ab537[_0x21459b(0x2b3)]){const _0x67cb2f=new Date(_0x1ab537['startedAt'])['getTime'](),_0x2a8b92=_0x1ab537['updatedAt']?new Date(_0x1ab537[_0x21459b(0x31c)])[_0x21459b(0x1d3)]():Date[_0x21459b(0x2e7)](),_0x2475c5={'start':_0x67cb2f,'end':_0x2a8b92,'duration':_0x2a8b92-_0x67cb2f};_0x4a2543[_0x21459b(0x1f2)](_0x1ab537['id'],_0x2475c5),_0xed9343[_0x21459b(0x23d)]({'name':_0x1ab537[_0x21459b(0x2d7)],'state':_0x1ab537[_0x21459b(0x2ab)]||'unknown','window':_0x2475c5});}else _0xed9343['push']({'name':_0x1ab537[_0x21459b(0x2d7)],'state':_0x1ab537[_0x21459b(0x2ab)]||_0x21459b(0x1f7),'window':undefined});}_0xed9343['sort']((_0x4989c1,_0x17329f)=>{const _0x55a64b=_0x21459b;if(!_0x4989c1['window'])return 0x1;if(!_0x17329f[_0x55a64b(0x2cd)])return-0x1;return _0x4989c1[_0x55a64b(0x2cd)]['start']-_0x17329f[_0x55a64b(0x2cd)]['start'];});const _0x31a21f=_0xed9343['length'],_0xd2d6a1=_0x31a21f>TIMELINE_CONFIG[_0x21459b(0x314)];_0xd2d6a1&&_0xed9343[_0x21459b(0x241)](TIMELINE_CONFIG[_0x21459b(0x314)]);const _0x3ad254=calculateTimeScale(_0x3e3095,_0x16a962),_0x1bf7d3=_0x57293c[_0x21459b(0x27f)]?_0x57293c[_0x21459b(0x1f0)]?a59_0x33ddab['green'](_0x21459b(0x1f0)):a59_0x33ddab[_0x21459b(0x214)](_0x21459b(0x253)):a59_0x33ddab['blue'](_0x21459b(0x2f0)),_0x542573=_0x57293c[_0x21459b(0x2ad)]?.['id'],_0x49f74f=_0x57293c[_0x21459b(0x2f2)];let _0x24622a;if(_0x542573&&_0x49f74f){const _0x55403d=getWorkflowAttemptUrl(_0x2db3df,_0x542573,_0x49f74f,_0x57293c['id']);_0x24622a=hyperlink(a59_0x33ddab[_0x21459b(0x1fb)](_0x57293c['id']),_0x55403d);}else _0x24622a=a59_0x33ddab[_0x21459b(0x1fb)](_0x57293c['id']);_0x2b2ca4[_0x21459b(0x23d)](_0x21459b(0x2e8)+_0x24622a+_0x21459b(0x29a)+_0x1bf7d3+_0x21459b(0x29a)+formatElapsed(_0x3e3095[_0x21459b(0x284)]));if(_0xed9343['length']>0x0){const _0xa8d306=renderTimeAxis(_0x3ad254,_0x16a962),_0x5b388a=new Date(_0x3e3095[_0x21459b(0x1ae)]),_0x16e7c=formatDate(_0x5b388a),_0x124822=TIMELINE_CONFIG[_0x21459b(0x1b5)]+TIMELINE_CONFIG[_0x21459b(0x1b0)]+_0x5e452f,_0x84e770=_0x16e7c[_0x21459b(0x305)](_0x124822),_0x5cee4b=a59_0x33ddab['dim'](_0x84e770);_0x2b2ca4[_0x21459b(0x23d)](_0x5cee4b+'\x20'+_0xa8d306);for(const _0x463b34 of _0xed9343){_0x2b2ca4[_0x21459b(0x23d)](renderTaskRow(_0x463b34,_0x3ad254,_0x16a962,_0x5e452f));}const _0x564ac4=calculateStats(_0xed9343);_0x2b2ca4[_0x21459b(0x23d)](formatStats(_0x564ac4)),_0xd2d6a1&&_0x2b2ca4[_0x21459b(0x23d)](a59_0x33ddab[_0x21459b(0x351)](_0x21459b(0x268)+TIMELINE_CONFIG[_0x21459b(0x314)]+_0x21459b(0x234)+_0x31a21f+_0x21459b(0x2bb))),_0x2b2ca4['push'](''),_0x2b2ca4['push'](a59_0x33ddab['dim'](_0x21459b(0x219))+('tdx\x20wf\x20attempt\x20'+_0x57293c['id']+_0x21459b(0x26f))+a59_0x33ddab[_0x21459b(0x1fb)](_0x21459b(0x350)));}else _0x2b2ca4[_0x21459b(0x23d)](_0x21459b(0x2b4));return _0x2b2ca4['join']('\x0a');}['buildTimelineData'](_0x3ae920,_0x3b2948){const _0x416dc5=a59_0x7f9071,_0xecebd=new Date(_0x3ae920[_0x416dc5(0x27e)])['getTime'](),_0x40b0f0=_0x3ae920[_0x416dc5(0x34d)]?new Date(_0x3ae920[_0x416dc5(0x34d)])['getTime']():Date[_0x416dc5(0x2e7)](),_0x591fc4=_0x40b0f0-_0xecebd,_0x1db682=[];for(const _0x40e214 of _0x3b2948){if(_0x40e214[_0x416dc5(0x2b3)]){const _0x47cf46=new Date(_0x40e214[_0x416dc5(0x2b3)])[_0x416dc5(0x1d3)](),_0xea090f=_0x40e214[_0x416dc5(0x31c)]?new Date(_0x40e214[_0x416dc5(0x31c)])[_0x416dc5(0x1d3)]():Date[_0x416dc5(0x2e7)]();_0x1db682[_0x416dc5(0x23d)]({'name':_0x40e214['fullName'],'state':_0x40e214['state']||_0x416dc5(0x1dd),'window':{'start':_0x47cf46,'end':_0xea090f,'duration':_0xea090f-_0x47cf46}});}else _0x1db682[_0x416dc5(0x23d)]({'name':_0x40e214[_0x416dc5(0x2d7)],'state':_0x40e214[_0x416dc5(0x2ab)]||_0x416dc5(0x1f7),'window':undefined});}const _0x3c3daf=calculateStats(_0x1db682);return{'attempt':{'id':_0x3ae920['id'],'status':_0x3ae920[_0x416dc5(0x27f)]?_0x3ae920[_0x416dc5(0x1f0)]?_0x416dc5(0x1f0):_0x416dc5(0x253):_0x416dc5(0x2f0),'createdAt':_0x3ae920[_0x416dc5(0x27e)],'finishedAt':_0x3ae920[_0x416dc5(0x34d)],'duration_ms':_0x591fc4},'tasks':_0x1db682[_0x416dc5(0x2fe)](_0x339237=>({'name':_0x339237[_0x416dc5(0x19f)],'state':_0x339237[_0x416dc5(0x2ab)],'startedAt':_0x339237['window']?new Date(_0x339237[_0x416dc5(0x2cd)][_0x416dc5(0x1ae)])[_0x416dc5(0x211)]():null,'updatedAt':_0x339237[_0x416dc5(0x2cd)]?new Date(_0x339237['window'][_0x416dc5(0x2bd)])[_0x416dc5(0x211)]():null,'duration_ms':_0x339237[_0x416dc5(0x2cd)]?.[_0x416dc5(0x284)]||null})),'stats':_0x3c3daf};}}function formatScheduleLine(_0x505a64){const _0x562d71=a59_0x7f9071,_0x23003f=_0x505a64[_0x562d71(0x33d)]?a59_0x33ddab['yellow'](_0x562d71(0x1bc)):'',_0x2ee650=_0x505a64[_0x562d71(0x2ad)]?.[_0x562d71(0x19f)]?a59_0x33ddab[_0x562d71(0x1fb)]('\x20['+_0x505a64['project']['name']+']'):'',_0xb56b64=_0x505a64[_0x562d71(0x254)]?a59_0x33ddab[_0x562d71(0x1fb)](_0x562d71(0x255)+new Date(_0x505a64[_0x562d71(0x254)])[_0x562d71(0x33a)]()):'';return'📅\x20#'+_0x505a64['id']+'\x20'+(_0x505a64[_0x562d71(0x208)]?.[_0x562d71(0x19f)]||_0x562d71(0x212))+_0x2ee650+_0x23003f+_0xb56b64;}export class WorkflowSchedulesCommand extends WorkflowBaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x335);['description']=a59_0x7f9071(0x307);async['execute'](_0x3fa896){const _0x28f852=a59_0x7f9071,{options:_0x4ac181,args:_0x135879,tdx:_0x59fa52}=_0x3fa896,{scheduleId:_0x4ad6bf}=_0x4ac181;if(_0x4ad6bf&&_0x135879[0x0])return console[_0x28f852(0x253)](a59_0x33ddab[_0x28f852(0x214)](_0x28f852(0x218)),_0x28f852(0x21a)),console[_0x28f852(0x253)](a59_0x33ddab[_0x28f852(0x1fb)](_0x28f852(0x361))),0x1;if(_0x4ad6bf){const _0x1d5364=await withSpinner(_0x28f852(0x1f3)+_0x4ad6bf+_0x28f852(0x216),()=>_0x59fa52[_0x28f852(0x208)][_0x28f852(0x1c4)](_0x4ad6bf),{'verbose':_0x4ac181['verbose']}),_0xc9d8a5=_0x1d5364[_0x28f852(0x1fa)];return isStructuredFormat(_0x4ac181)?await handleSingleObjectOutput(_0xc9d8a5,_0x4ac181):(console[_0x28f852(0x253)](_0x28f852(0x2b1)),console[_0x28f852(0x2fb)](formatScheduleLine(_0xc9d8a5))),0x0;}const _0x11b7ad=this[_0x28f852(0x2e9)](_0x135879,_0x4ac181);if(!_0x11b7ad)return 0x1;const {projectName:_0x367132,workflowName:_0x4ec636}=_0x11b7ad,_0x14a67d=_0x367132?'\x27'+_0x367132+(_0x4ec636?'.'+_0x4ec636:'')+'\x27':undefined,_0x1220d8=await withSpinner(_0x14a67d?_0x28f852(0x31e)+_0x14a67d+_0x28f852(0x216):'Listing\x20schedules...',()=>_0x367132?_0x59fa52[_0x28f852(0x208)][_0x28f852(0x332)](_0x367132,{'workflow':_0x4ec636,'limit':_0x4ac181[_0x28f852(0x28c)]}):_0x59fa52[_0x28f852(0x208)]['listSchedules']({'limit':_0x4ac181['limit']}),{'verbose':_0x4ac181['verbose']}),_0x17e4a4=_0x1220d8[_0x28f852(0x1fa)],_0x56b6a6=_0x4ac181[_0x28f852(0x28c)]&&_0x17e4a4[_0x28f852(0x21d)]>=_0x4ac181['limit']?a59_0x33ddab[_0x28f852(0x1fb)](_0x28f852(0x273)):'';console['error'](_0x28f852(0x1a0)+_0x17e4a4[_0x28f852(0x21d)]+_0x28f852(0x1ff)+(_0x17e4a4[_0x28f852(0x21d)]!==0x1?'s':'')+_0x56b6a6);if(isStructuredFormat(_0x4ac181))await handleSDKOutput(_0x17e4a4,_0x4ac181);else{if(_0x17e4a4[_0x28f852(0x21d)]===0x0)console[_0x28f852(0x2fb)]('No\x20schedules\x20found');else for(const _0x5189e5 of _0x17e4a4){console[_0x28f852(0x2fb)](formatScheduleLine(_0x5189e5));}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{['name']=a59_0x7f9071(0x25d);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x2c1);async[a59_0x7f9071(0x34a)](_0x15fcc1){const _0x4aaeb8=a59_0x7f9071,{options:_0x323f13,args:_0x5c1d24,tdx:_0x126126}=_0x15fcc1,_0x252847=_0x5c1d24[0x0];if(!_0x252847)return console[_0x4aaeb8(0x253)](a59_0x33ddab[_0x4aaeb8(0x214)](_0x4aaeb8(0x218)),_0x4aaeb8(0x20a)),console[_0x4aaeb8(0x253)](a59_0x33ddab['dim'](_0x4aaeb8(0x248))),console[_0x4aaeb8(0x253)](a59_0x33ddab['dim'](_0x4aaeb8(0x247))),0x1;const {backfill:_0x32d290,nextTime:_0x3c3cf2}=_0x323f13,_0x1e0ec9={};if(_0x32d290!==undefined)_0x1e0ec9[_0x4aaeb8(0x1a1)]=!_0x32d290;if(_0x3c3cf2!==undefined)_0x1e0ec9['nextTime']=_0x3c3cf2;const _0x44d3de=await withSpinner(_0x4aaeb8(0x278)+_0x252847+_0x4aaeb8(0x216),()=>_0x126126['workflow']['enableSchedule'](_0x252847,_0x1e0ec9),{'verbose':_0x323f13[_0x4aaeb8(0x1ed)]}),_0x8989f5=_0x44d3de[_0x4aaeb8(0x1fa)];return isStructuredFormat(_0x323f13)?await handleSingleObjectOutput(_0x8989f5,_0x323f13):(console[_0x4aaeb8(0x2fb)](_0x4aaeb8(0x2eb)+_0x252847+'\x20enabled\x20('+(_0x8989f5[_0x4aaeb8(0x208)]?.[_0x4aaeb8(0x19f)]||_0x4aaeb8(0x1dd))+')'),_0x8989f5[_0x4aaeb8(0x254)]&&console[_0x4aaeb8(0x2fb)](a59_0x33ddab['dim'](_0x4aaeb8(0x1ba)+new Date(_0x8989f5['nextRunTime'])[_0x4aaeb8(0x33a)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a59_0x7f9071(0x19f)]='workflow:schedule:disable';[a59_0x7f9071(0x355)]=a59_0x7f9071(0x223);async['execute'](_0x4e3bec){const _0x1d0a36=a59_0x7f9071,{options:_0x380127,args:_0x45566a,tdx:_0x185890}=_0x4e3bec,_0x4bbb2d=_0x45566a[0x0];if(!_0x4bbb2d)return console[_0x1d0a36(0x253)](a59_0x33ddab[_0x1d0a36(0x214)](_0x1d0a36(0x218)),_0x1d0a36(0x20a)),console[_0x1d0a36(0x253)](a59_0x33ddab[_0x1d0a36(0x1fb)](_0x1d0a36(0x243))),console['error'](a59_0x33ddab['dim'](_0x1d0a36(0x247))),0x1;const _0xf78a86=await withSpinner(_0x1d0a36(0x369)+_0x4bbb2d+_0x1d0a36(0x216),()=>_0x185890['workflow'][_0x1d0a36(0x23b)](_0x4bbb2d),{'verbose':_0x380127[_0x1d0a36(0x1ed)]}),_0x350a81=_0xf78a86[_0x1d0a36(0x1fa)];return isStructuredFormat(_0x380127)?await handleSingleObjectOutput(_0x350a81,_0x380127):console[_0x1d0a36(0x2fb)](_0x1d0a36(0x2eb)+_0x4bbb2d+_0x1d0a36(0x349)+(_0x350a81[_0x1d0a36(0x208)]?.[_0x1d0a36(0x19f)]||'unknown')+')'),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x1d67c0,_0x4bf81f){const _0x637e4a=a60_0xd125,_0x5487ae=_0x1d67c0();while(!![]){try{const _0xff6d9e=-parseInt(_0x637e4a(0x163))/0x1+-parseInt(_0x637e4a(0x159))/0x2*(-parseInt(_0x637e4a(0x15b))/0x3)+parseInt(_0x637e4a(0x168))/0x4*(-parseInt(_0x637e4a(0x15d))/0x5)+-parseInt(_0x637e4a(0x15f))/0x6*(-parseInt(_0x637e4a(0x15a))/0x7)+-parseInt(_0x637e4a(0x165))/0x8+parseInt(_0x637e4a(0x15e))/0x9*(-parseInt(_0x637e4a(0x158))/0xa)+-parseInt(_0x637e4a(0x161))/0xb*(-parseInt(_0x637e4a(0x16a))/0xc);if(_0xff6d9e===_0x4bf81f)break;else _0x5487ae['push'](_0x5487ae['shift']());}catch(_0x39ff8b){_0x5487ae['push'](_0x5487ae['shift']());}}}(a60_0x3cb4,0xb7a0a));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 _0x5b4e2d=a60_0xd125,_0x47d06f=getVersion(),_0x43fe26=platform(),_0x5bb0f6=process[_0x5b4e2d(0x166)][_0x5b4e2d(0x16b)]('v','');return _0x5b4e2d(0x160)+_0x47d06f+'\x20('+_0x43fe26+_0x5b4e2d(0x167)+_0x5bb0f6+')';}export function getAuthHeaders(_0x55fe59,_0x15007a,_0x1b9620){const _0xbff96d=a60_0xd125,_0x2b9d94=getVersion(),_0x57ef43={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x2b9d94};if(_0x1b9620)_0x57ef43['Authorization']=_0xbff96d(0x169)+_0x1b9620;else _0x15007a&&(_0x57ef43['Authorization']=_0xbff96d(0x157)+_0x15007a);return _0x57ef43;}export function toHeaderRecord(_0xf683a2){const _0x453832=a60_0xd125,_0x5f49db={};for(const [_0x18e477,_0x219230]of Object[_0x453832(0x164)](_0xf683a2)){_0x219230!==undefined&&(_0x5f49db[_0x18e477]=_0x219230);}return _0x5f49db;}export function getTrinoHeaders(_0x4e63ef,_0x2ec458,_0x127bbb){const _0x1f3265=a60_0xd125,_0x508318=getAuthHeaders(_0x4e63ef),_0x56bf1e=toHeaderRecord(_0x508318);if(_0x127bbb)_0x56bf1e[_0x1f3265(0x162)]=_0x1f3265(0x169)+_0x127bbb;else _0x2ec458&&(_0x56bf1e[_0x1f3265(0x15c)]=_0x2ec458);return _0x56bf1e;}function a60_0xd125(_0x19de45,_0x5b847f){_0x19de45=_0x19de45-0x157;const _0x3cb4e3=a60_0x3cb4();let _0xd1250b=_0x3cb4e3[_0x19de45];return _0xd1250b;}export function hasAPIKey(_0x18cfdd){const _0x54c19=a60_0xd125,_0x32d86a=getAPIKey();return _0x32d86a!==undefined&&_0x32d86a[_0x54c19(0x16c)]>0x0;}function a60_0x3cb4(){const _0x330443=['35001696kAjjPP','replace','length','TD1\x20','20qCnNvq','34tijlaZ','7zYscUG','107634cGInWR','X-Trino-User','5DPNlES','6603345UlXrom','2783142yArtxY','tdx/','11XZjzRX','Authorization','736649jMjxYI','entries','5055200MmoaSL','version',';\x20node/','1609976jKmuUS','Bearer\x20'];a60_0x3cb4=function(){return _0x330443;};return a60_0x3cb4();}
1
+ function a60_0x2c9b(){const _0x5c7769=['80510KTcpZf','version',';\x20node/','tdx/','6MRJRkp','tdx','33rcWgsL','TD1\x20','4694200jfQUxX','replace','171dNhogn','15123163waOxDW','534ASzDgZ','188492uyNcxm','Bearer\x20','entries','119544ZOwQKZ','7547450cShngb','Authorization','18385fKcHoo'];a60_0x2c9b=function(){return _0x5c7769;};return a60_0x2c9b();}(function(_0x1efe47,_0x1453b9){const _0x1cdbbe=a60_0x2c0a,_0x374929=_0x1efe47();while(!![]){try{const _0x15f232=-parseInt(_0x1cdbbe(0x1f3))/0x1*(-parseInt(_0x1cdbbe(0x1f7))/0x2)+-parseInt(_0x1cdbbe(0x1e5))/0x3*(parseInt(_0x1cdbbe(0x1ec))/0x4)+-parseInt(_0x1cdbbe(0x1f2))/0x5*(parseInt(_0x1cdbbe(0x1eb))/0x6)+parseInt(_0x1cdbbe(0x1e7))/0x7+parseInt(_0x1cdbbe(0x1ef))/0x8*(-parseInt(_0x1cdbbe(0x1e9))/0x9)+-parseInt(_0x1cdbbe(0x1f0))/0xa+parseInt(_0x1cdbbe(0x1ea))/0xb;if(_0x15f232===_0x1453b9)break;else _0x374929['push'](_0x374929['shift']());}catch(_0x5cc8f2){_0x374929['push'](_0x374929['shift']());}}}(a60_0x2c9b,0x62507));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';function a60_0x2c0a(_0x39bd8f,_0x232260){_0x39bd8f=_0x39bd8f-0x1e5;const _0x2c9b06=a60_0x2c9b();let _0x2c0aa5=_0x2c9b06[_0x39bd8f];return _0x2c0aa5;}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x5ede35=a60_0x2c0a,_0x15d360=getVersion(),_0x7c5b72=platform(),_0x16a5b4=process[_0x5ede35(0x1f4)][_0x5ede35(0x1e8)]('v','');return _0x5ede35(0x1f6)+_0x15d360+'\x20('+_0x7c5b72+_0x5ede35(0x1f5)+_0x16a5b4+')';}export function getAuthHeaders(_0x3bcacc,_0x5163fe,_0x4e6f90){const _0xec7d25=a60_0x2c0a,_0x4cf4f0=getVersion(),_0x9a05a6={'User-Agent':getUserAgent(),'X-TD-Client':_0xec7d25(0x1f8),'X-TD-Client-Version':_0x4cf4f0};if(_0x4e6f90)_0x9a05a6[_0xec7d25(0x1f1)]=_0xec7d25(0x1ed)+_0x4e6f90;else _0x5163fe&&(_0x9a05a6['Authorization']=_0xec7d25(0x1e6)+_0x5163fe);return _0x9a05a6;}export function toHeaderRecord(_0x14482c){const _0x26156c=a60_0x2c0a,_0x3534ea={};for(const [_0x33250e,_0x53be13]of Object[_0x26156c(0x1ee)](_0x14482c)){_0x53be13!==undefined&&(_0x3534ea[_0x33250e]=_0x53be13);}return _0x3534ea;}export function getTrinoHeaders(_0x11ea48,_0x43965b,_0x512e8c){const _0x1861e3=a60_0x2c0a,_0x3c5355=getAuthHeaders(_0x11ea48),_0x254fbe=toHeaderRecord(_0x3c5355);if(_0x512e8c)_0x254fbe[_0x1861e3(0x1f1)]='Bearer\x20'+_0x512e8c;else _0x43965b&&(_0x254fbe['X-Trino-User']=_0x43965b);return _0x254fbe;}export function hasAPIKey(_0x1ba92e){const _0x54089d=getAPIKey();return _0x54089d!==undefined&&_0x54089d['length']>0x0;}