@treasuredata/tdx 2026.4.10 → 2026.4.12

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 (232) 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-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.d.ts +1 -0
  68. package/dist/core/profile.d.ts.map +1 -1
  69. package/dist/core/profile.js +1 -1
  70. package/dist/core/profile.js.map +1 -1
  71. package/dist/core/project-config.js +1 -1
  72. package/dist/core/session.js +1 -1
  73. package/dist/core/user-cache.js +1 -1
  74. package/dist/core/version.js +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/mcp/server.js +1 -1
  77. package/dist/mcp/tools/index.js +1 -1
  78. package/dist/mcp/tools/tdx-run.js +1 -1
  79. package/dist/mcp/tools/tdx-search.js +1 -1
  80. package/dist/mcp/tools/work-create-item.js +1 -1
  81. package/dist/mcp/utils.js +1 -1
  82. package/dist/proxy/claude-usage-tracker.js +1 -1
  83. package/dist/proxy/passthrough-server.js +1 -1
  84. package/dist/proxy/sse-usage-parser.js +1 -1
  85. package/dist/sdk/agent/agent-config.js +1 -1
  86. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  87. package/dist/sdk/agent/agent-yaml.js +1 -1
  88. package/dist/sdk/agent/test/evaluator.js +1 -1
  89. package/dist/sdk/agent/test/executor.js +1 -1
  90. package/dist/sdk/agent/test/index.js +1 -1
  91. package/dist/sdk/agent/test/output.js +1 -1
  92. package/dist/sdk/agent/test/parser.js +1 -1
  93. package/dist/sdk/agent/tool-target-registry.js +1 -1
  94. package/dist/sdk/api.js +1 -1
  95. package/dist/sdk/cas/cas-api-client.js +1 -1
  96. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  97. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  98. package/dist/sdk/cas/index.js +1 -1
  99. package/dist/sdk/cas/pull-workflow.js +1 -1
  100. package/dist/sdk/cas/push-workflow.js +1 -1
  101. package/dist/sdk/client/cdp-api-client.js +1 -1
  102. package/dist/sdk/client/delivery-api-client.js +1 -1
  103. package/dist/sdk/client/endpoints.js +1 -1
  104. package/dist/sdk/client/engage-api-client.js +1 -1
  105. package/dist/sdk/client/http-client.js +1 -1
  106. package/dist/sdk/client/llm-api-client.js +1 -1
  107. package/dist/sdk/client/oauth-refresh.js +1 -1
  108. package/dist/sdk/client/rate-limiter.js +1 -1
  109. package/dist/sdk/client/td-api-client.js +1 -1
  110. package/dist/sdk/client/trino-api-client.js +1 -1
  111. package/dist/sdk/client/workflow-client.js +1 -1
  112. package/dist/sdk/connection-validator.js +1 -1
  113. package/dist/sdk/connection.js +1 -1
  114. package/dist/sdk/delivery.js +1 -1
  115. package/dist/sdk/engage/campaign-pull.js +1 -1
  116. package/dist/sdk/engage/campaign-push.js +1 -1
  117. package/dist/sdk/engage/campaign-validator.js +1 -1
  118. package/dist/sdk/engage/campaign-yaml.js +1 -1
  119. package/dist/sdk/engage/template-pull.js +1 -1
  120. package/dist/sdk/engage/template-push.js +1 -1
  121. package/dist/sdk/engage/template-validator.js +1 -1
  122. package/dist/sdk/engage/template-yaml.js +1 -1
  123. package/dist/sdk/engage/types/campaign-def.js +1 -1
  124. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  125. package/dist/sdk/engage/types/template-schema.js +1 -1
  126. package/dist/sdk/engage.js +1 -1
  127. package/dist/sdk/errors.js +1 -1
  128. package/dist/sdk/index.js +1 -1
  129. package/dist/sdk/io/index.js +1 -1
  130. package/dist/sdk/io/node-filesystem.js +1 -1
  131. package/dist/sdk/job.js +1 -1
  132. package/dist/sdk/journey.d.ts +6 -0
  133. package/dist/sdk/journey.d.ts.map +1 -1
  134. package/dist/sdk/journey.js +1 -1
  135. package/dist/sdk/journey.js.map +1 -1
  136. package/dist/sdk/llm/chat-cache.js +1 -1
  137. package/dist/sdk/llm/index.js +1 -1
  138. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  139. package/dist/sdk/llm/model-factors.js +1 -1
  140. package/dist/sdk/personalization.js +1 -1
  141. package/dist/sdk/policy.js +1 -1
  142. package/dist/sdk/query/index.js +1 -1
  143. package/dist/sdk/query/sql-parser.js +1 -1
  144. package/dist/sdk/realtime.js +1 -1
  145. package/dist/sdk/schedule.js +1 -1
  146. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  147. package/dist/sdk/segment/fields-display.js +1 -1
  148. package/dist/sdk/segment/file-discovery.js +1 -1
  149. package/dist/sdk/segment/journey-utils.js +1 -1
  150. package/dist/sdk/segment/journey-validator.js +1 -1
  151. package/dist/sdk/segment/journey-yaml.js +1 -1
  152. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  153. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  154. package/dist/sdk/segment/pull-workflow.js +1 -1
  155. package/dist/sdk/segment/push-recovery.js +1 -1
  156. package/dist/sdk/segment/push-workflow.js +1 -1
  157. package/dist/sdk/segment/resolution-context.js +1 -1
  158. package/dist/sdk/segment/segment-path-parser.js +1 -1
  159. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  160. package/dist/sdk/segment/segment-validator.js +1 -1
  161. package/dist/sdk/segment/target-resolution.js +1 -1
  162. package/dist/sdk/segment/tdx-config.js +1 -1
  163. package/dist/sdk/segment/types/activation-schema.js +1 -1
  164. package/dist/sdk/segment/types/journey-def.js +1 -1
  165. package/dist/sdk/segment/types/journey-schema.js +1 -1
  166. package/dist/sdk/segment/types/segment-def.js +1 -1
  167. package/dist/sdk/segment/types/segment-schema.js +1 -1
  168. package/dist/sdk/segment/validate-files.js +1 -1
  169. package/dist/sdk/segment/yaml-validator.js +1 -1
  170. package/dist/sdk/segment.js +1 -1
  171. package/dist/sdk/types/index.js +1 -1
  172. package/dist/sdk/types/progress.js +1 -1
  173. package/dist/sdk/types/workspace.d.ts +2 -0
  174. package/dist/sdk/types/workspace.d.ts.map +1 -1
  175. package/dist/sdk/types/workspace.js +1 -1
  176. package/dist/sdk/user.js +1 -1
  177. package/dist/sdk/util/format-detector.js +1 -1
  178. package/dist/sdk/util/formatters.js +1 -1
  179. package/dist/sdk/util/index.js +1 -1
  180. package/dist/sdk/util/paginate.js +1 -1
  181. package/dist/sdk/util/tree-formatter.js +1 -1
  182. package/dist/sdk/workflow/archive-validation.js +1 -1
  183. package/dist/sdk/workflow/clone-workflow.js +1 -1
  184. package/dist/sdk/workflow/index.js +1 -1
  185. package/dist/sdk/workflow/pull-workflow.js +1 -1
  186. package/dist/sdk/workflow/push-workflow.js +1 -1
  187. package/dist/sdk/workflow/tdx-config.js +1 -1
  188. package/dist/sdk/workflow/workflow-utils.js +1 -1
  189. package/dist/sdk/workspace/access-tracker.js +1 -1
  190. package/dist/sdk/workspace/frontmatter.js +1 -1
  191. package/dist/sdk/workspace/git.js +1 -1
  192. package/dist/sdk/workspace/index.d.ts.map +1 -1
  193. package/dist/sdk/workspace/index.js +1 -1
  194. package/dist/sdk/workspace/index.js.map +1 -1
  195. package/dist/sdk/workspace/templates.d.ts.map +1 -1
  196. package/dist/sdk/workspace/templates.js +1 -1
  197. package/dist/sdk/workspace/templates.js.map +1 -1
  198. package/dist/sdk/workspace/weekly.js +1 -1
  199. package/dist/sdk/workspace/wikilinks.js +1 -1
  200. package/dist/test-utils/command-runner.js +1 -1
  201. package/dist/test-utils/factories.js +1 -1
  202. package/dist/test-utils/fixtures.js +1 -1
  203. package/dist/test-utils/http-mock.js +1 -1
  204. package/dist/test-utils/index.js +1 -1
  205. package/dist/utils/async.js +1 -1
  206. package/dist/utils/colors.js +1 -1
  207. package/dist/utils/diff.js +1 -1
  208. package/dist/utils/file-permissions.js +1 -1
  209. package/dist/utils/file-reader.js +1 -1
  210. package/dist/utils/github-releases.js +1 -1
  211. package/dist/utils/global-cache.js +1 -1
  212. package/dist/utils/json-loader.js +1 -1
  213. package/dist/utils/local-cache.js +1 -1
  214. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  215. package/dist/utils/logger/formatters/index.js +1 -1
  216. package/dist/utils/logger/handlers/console-handler.js +1 -1
  217. package/dist/utils/logger/handlers/file-handler.js +1 -1
  218. package/dist/utils/logger/handlers/index.js +1 -1
  219. package/dist/utils/logger/handlers/null-handler.js +1 -1
  220. package/dist/utils/logger/index.js +1 -1
  221. package/dist/utils/logger/logger.js +1 -1
  222. package/dist/utils/logger/types.js +1 -1
  223. package/dist/utils/option-validation.js +1 -1
  224. package/dist/utils/process.js +1 -1
  225. package/dist/utils/prompt.js +1 -1
  226. package/dist/utils/spinner.js +1 -1
  227. package/dist/utils/sse-parser.js +1 -1
  228. package/dist/utils/string-utils.js +1 -1
  229. package/dist/utils/table-ref-parser.js +1 -1
  230. package/dist/utils/tdx-logger.js +1 -1
  231. package/dist/utils/version-check.js +1 -1
  232. package/package.json +1 -1
@@ -1 +1 @@
1
- const a54_0x2a0943=a54_0x5ebb;(function(_0xf7ee2f,_0x24fdf7){const _0x49e936=a54_0x5ebb,_0x4a5c98=_0xf7ee2f();while(!![]){try{const _0x429980=-parseInt(_0x49e936(0x349))/0x1*(-parseInt(_0x49e936(0x344))/0x2)+-parseInt(_0x49e936(0x324))/0x3*(-parseInt(_0x49e936(0x1f6))/0x4)+-parseInt(_0x49e936(0x2f4))/0x5*(parseInt(_0x49e936(0x2b6))/0x6)+parseInt(_0x49e936(0x302))/0x7+parseInt(_0x49e936(0x2ce))/0x8+-parseInt(_0x49e936(0x28d))/0x9+-parseInt(_0x49e936(0x25f))/0xa;if(_0x429980===_0x24fdf7)break;else _0x4a5c98['push'](_0x4a5c98['shift']());}catch(_0x41ed50){_0x4a5c98['push'](_0x4a5c98['shift']());}}}(a54_0x2768,0x18a8a));import a54_0x13943d from'chalk';import{existsSync}from'fs';import a54_0x4c5432 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 a54_0x1b2330 from'prompts';function getAttemptStatusDisplay(_0x237b08){const _0x2a9055=a54_0x5ebb;if(!_0x237b08)return{'icon':'⏳','text':''};const {done:_0x51bb11,success:_0x3b75a5,cancelRequested:_0x5394ff}=_0x237b08;if(!_0x51bb11)return _0x5394ff?{'icon':'🛑','text':a54_0x13943d[_0x2a9055(0x2f5)](_0x2a9055(0x27c))}:{'icon':'🔄','text':a54_0x13943d[_0x2a9055(0x258)](_0x2a9055(0x2ea))};if(_0x3b75a5)return{'icon':'✅','text':a54_0x13943d['green']('success')};return{'icon':'❌','text':a54_0x13943d[_0x2a9055(0x1fc)](_0x2a9055(0x2ae))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x2a0943(0x1d4)](_0x3c5ae0,_0x443b93,_0x1987f0=0x0){const _0x30ebfd=a54_0x2a0943;return _0x3c5ae0[_0x1987f0]||_0x443b93[_0x30ebfd(0x2fb)];}[a54_0x2a0943(0x240)](_0x160bdf,_0x479379,_0x1354d0=0x0){const _0x5c76bb=a54_0x2a0943,_0x5ee826=this[_0x5c76bb(0x1d4)](_0x160bdf,_0x479379,_0x1354d0);if(!_0x5ee826)return console[_0x5c76bb(0x2ae)](a54_0x13943d[_0x5c76bb(0x1fc)](_0x5c76bb(0x33f)),_0x5c76bb(0x24c)),console['error'](a54_0x13943d[_0x5c76bb(0x31c)](_0x5c76bb(0x362))),null;return _0x5ee826;}[a54_0x2a0943(0x228)](_0x1c7874,_0x989f86){const _0x2450e8=a54_0x2a0943;if(_0x1c7874[0x0]){const _0x1f12af=_0x1c7874[0x0][_0x2450e8(0x2ca)]('.');if(_0x1f12af[_0x2450e8(0x2c2)]===0x1)return{'projectName':_0x1f12af[0x0],'workflowName':undefined};else return _0x1f12af[_0x2450e8(0x2c2)]===0x2?{'projectName':_0x1f12af[0x0],'workflowName':_0x1f12af[0x1]}:(console[_0x2450e8(0x2ae)](a54_0x13943d['red']('Error:'),_0x2450e8(0x2c5)),null);}return{'projectName':_0x989f86['workflowProject'],'workflowName':undefined};}['resolveProjectDir'](_0x53d13f,_0x176f0e,_0x126834=0x0){const _0x7b14df=a54_0x2a0943;if(_0x53d13f[_0x126834])return _0x53d13f[_0x126834];if(_0x176f0e['workflowProject']){const _0x70b7c5=a54_0x4c5432['join'](process['cwd'](),'workflows',_0x176f0e['workflowProject']);if(existsSync(a54_0x4c5432[_0x7b14df(0x219)](_0x70b7c5,'tdx.json')))return _0x70b7c5;}return undefined;}async[a54_0x2a0943(0x388)](_0x5b4900,_0x5a58d2,_0x329422){const _0x104a95=a54_0x2a0943;try{const _0xabac4b=await _0x5b4900['workflow']['workflows'](_0x5a58d2,{'limit':0x1});if(_0xabac4b[_0x104a95(0x2c2)]>0x0){const _0x3044aa=_0xabac4b[0x0]['id'],_0x4f7c9c=getWorkflowUrl(_0x329422,_0x3044aa);console[_0x104a95(0x2ae)](_0x104a95(0x2fd)+a54_0x13943d[_0x104a95(0x38a)](_0x4f7c9c));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x1c0);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x203);async[a54_0x2a0943(0x295)](_0x180536){const _0x2b13f3=a54_0x2a0943,{options:_0x4401af,args:_0x1c36f0,tdx:_0x46e025}=_0x180536,_0x234586=_0x1c36f0[0x0],_0x4c749e=_0x4401af[_0x2b13f3(0x213)];if(_0x4c749e)return saveSessionContext({'workflow_project':undefined},_0x4401af[_0x2b13f3(0x229)]),console[_0x2b13f3(0x31e)](a54_0x13943d[_0x2b13f3(0x211)](_0x2b13f3(0x31b))),0x0;if(!_0x234586)return console[_0x2b13f3(0x2ae)](a54_0x13943d['red'](_0x2b13f3(0x33f)),_0x2b13f3(0x24c)),console[_0x2b13f3(0x2ae)](a54_0x13943d['dim']('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x2b13f3(0x2ae)](a54_0x13943d[_0x2b13f3(0x31c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x3cde08=await withSpinner(_0x2b13f3(0x2ac)+_0x234586+'\x27...',()=>_0x46e025[_0x2b13f3(0x2f9)][_0x2b13f3(0x260)](_0x234586),{'verbose':_0x4401af['verbose']}),{name:_0x48561f}=_0x3cde08[_0x2b13f3(0x2c0)];return saveSessionContext({'workflow_project':_0x48561f},_0x4401af['session']),console['log'](a54_0x13943d[_0x2b13f3(0x211)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a54_0x13943d[_0x2b13f3(0x38a)](_0x48561f))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a54_0x2a0943(0x366);['description']=a54_0x2a0943(0x37b);async[a54_0x2a0943(0x295)](_0x10f5e5){const _0x3e8c90=a54_0x2a0943,{options:_0x53d205,args:_0x4e4fc6,tdx:_0x335114}=_0x10f5e5,_0x58bd13=_0x4e4fc6[0x0];_0x53d205[_0x3e8c90(0x31f)]&&_0x58bd13&&console['error'](_0x3e8c90(0x1f3)+_0x58bd13);const _0x3ca647=await withSpinner(_0x3e8c90(0x387),()=>_0x335114['workflow'][_0x3e8c90(0x2d3)](_0x58bd13,{'limit':_0x53d205[_0x3e8c90(0x34d)]}),{'verbose':_0x53d205[_0x3e8c90(0x31f)]});let _0x5261f5=_0x3ca647['data'];_0x5261f5[_0x3e8c90(0x2ba)]((_0x372a24,_0x201975)=>_0x372a24[_0x3e8c90(0x1c3)][_0x3e8c90(0x351)](_0x201975[_0x3e8c90(0x1c3)]));const _0x1c9233=_0x53d205[_0x3e8c90(0x34d)]||0x64,_0x28492d=_0x5261f5['length']>=_0x1c9233?a54_0x13943d[_0x3e8c90(0x31c)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x3e8c90(0x2ae)]('✔\x20Found\x20'+_0x5261f5[_0x3e8c90(0x2c2)]+_0x3e8c90(0x1ec)+(_0x5261f5[_0x3e8c90(0x2c2)]!==0x1?'s':'')+_0x28492d);if(_0x53d205[_0x3e8c90(0x352)]===_0x3e8c90(0x200)||_0x53d205[_0x3e8c90(0x352)]===_0x3e8c90(0x291)||_0x53d205[_0x3e8c90(0x352)]===_0x3e8c90(0x311))await handleSDKOutput(_0x5261f5,_0x53d205);else{if(_0x5261f5[_0x3e8c90(0x2c2)]===0x0)_0x58bd13?console[_0x3e8c90(0x31e)](_0x3e8c90(0x265)+_0x58bd13):console[_0x3e8c90(0x31e)](_0x3e8c90(0x243));else{const _0x1d7085=_0x5261f5[_0x3e8c90(0x285)](_0x3443c6=>{const _0x4bb3f1=_0x3e8c90,_0x5f54df=_0x3443c6[_0x4bb3f1(0x379)]?.[_0x4bb3f1(0x2f0)](_0x3aced6=>_0x3aced6[_0x4bb3f1(0x1d2)]===_0x4bb3f1(0x244)),_0x18d800=_0x5f54df?a54_0x13943d['dim'](_0x4bb3f1(0x325)):'';return'📁\x20'+_0x3443c6[_0x4bb3f1(0x1c3)]+_0x18d800;});await writeOutput(_0x1d7085[_0x3e8c90(0x219)]('\x0a'),_0x53d205['output'],_0x3e8c90(0x354));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x1ee);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x2bb);async[a54_0x2a0943(0x295)](_0x4f8c99){const _0x500944=a54_0x2a0943,{options:_0x36d714,args:_0x33c6c6,tdx:_0x1ed505}=_0x4f8c99,_0x24f3f6=this[_0x500944(0x1d4)](_0x33c6c6,_0x36d714);_0x36d714[_0x500944(0x31f)]&&_0x24f3f6&&console[_0x500944(0x2ae)](_0x500944(0x23b)+_0x24f3f6);const _0x3c40d2=await withSpinner(_0x500944(0x2b8),()=>_0x1ed505[_0x500944(0x2f9)][_0x500944(0x1d5)](_0x24f3f6,{'limit':_0x36d714[_0x500944(0x34d)]}),{'verbose':_0x36d714[_0x500944(0x31f)]});let _0x4615fa=_0x3c40d2['data'];_0x4615fa[_0x500944(0x2ba)]((_0x77ed16,_0x58c195)=>{const _0x1ffc44=_0x500944,_0x18a598=_0x77ed16[_0x1ffc44(0x1c3)][_0x1ffc44(0x351)](_0x58c195[_0x1ffc44(0x1c3)]);if(_0x18a598!==0x0)return _0x18a598;return(_0x77ed16[_0x1ffc44(0x330)]?.[_0x1ffc44(0x1c3)]||'')[_0x1ffc44(0x351)](_0x58c195['project']?.[_0x1ffc44(0x1c3)]||'');});const _0x3547f5=_0x36d714[_0x500944(0x34d)]||0x64,_0xdb6455=_0x4615fa[_0x500944(0x2c2)]>=_0x3547f5?a54_0x13943d[_0x500944(0x31c)](_0x500944(0x2e5)):'';console[_0x500944(0x2ae)](_0x500944(0x37e)+_0x4615fa[_0x500944(0x2c2)]+_0x500944(0x316)+(_0x4615fa[_0x500944(0x2c2)]!==0x1?'s':'')+_0xdb6455);if(_0x36d714[_0x500944(0x352)]===_0x500944(0x200)||_0x36d714['format']==='jsonl'||_0x36d714[_0x500944(0x352)]===_0x500944(0x311))await handleSDKOutput(_0x4615fa,_0x36d714);else{if(_0x4615fa[_0x500944(0x2c2)]===0x0)_0x24f3f6?console[_0x500944(0x31e)](_0x500944(0x232)+_0x24f3f6):console[_0x500944(0x31e)](_0x500944(0x293));else{const _0x4c6b1b=_0x36d714[_0x500944(0x1e2)],_0x3e995d=_0x4615fa[_0x500944(0x285)](_0x58110f=>{const _0x5edf10=_0x500944,_0x59e75e=a54_0x13943d[_0x5edf10(0x31c)]('#'+_0x58110f['id']),_0x4ff677=hyperlink(_0x59e75e,getWorkflowUrl(_0x4c6b1b,_0x58110f['id'])),_0x20daf6=_0x58110f[_0x5edf10(0x330)]?.[_0x5edf10(0x1c3)]?a54_0x13943d[_0x5edf10(0x31c)]('\x20('+_0x58110f[_0x5edf10(0x330)][_0x5edf10(0x1c3)]+')'):'';return _0x5edf10(0x381)+_0x4ff677+'\x20'+_0x58110f[_0x5edf10(0x1c3)]+_0x20daf6;});await writeOutput(_0x3e995d[_0x500944(0x219)]('\x0a'),_0x36d714[_0x500944(0x1bb)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x2a8);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x375);async[a54_0x2a0943(0x295)](_0x249da0){const _0x25f139=a54_0x2a0943,{options:_0x40dfbf,args:_0x5f0405,tdx:_0x150a8c}=_0x249da0,_0x33b2ef=this[_0x25f139(0x228)](_0x5f0405,_0x40dfbf);if(!_0x33b2ef)return 0x1;const {projectName:_0x13371e,workflowName:_0x56e521}=_0x33b2ef;if(_0x40dfbf['verbose']){if(_0x13371e&&_0x56e521)console['error'](_0x25f139(0x24f)+_0x13371e+'.'+_0x56e521);else _0x13371e&&console[_0x25f139(0x2ae)](_0x25f139(0x2d5)+_0x13371e);const _0x573065=_0x40dfbf[_0x25f139(0x2ec)];_0x573065&&console[_0x25f139(0x2ae)](_0x25f139(0x346)+_0x573065);}let _0x78ff48=0x28;if(process['stdout'][_0x25f139(0x2aa)]&&!_0x40dfbf[_0x25f139(0x1bb)]&&!_0x40dfbf['format']){const _0x2fbcea=process[_0x25f139(0x2fc)][_0x25f139(0x1fd)]||0x28;_0x78ff48=Math[_0x25f139(0x26c)](0x14,Math[_0x25f139(0x2bc)](_0x2fbcea*0x2/0x3));}const _0x253a20=_0x40dfbf[_0x25f139(0x34d)]||_0x78ff48,_0x405813=await withSpinner(_0x25f139(0x2cf),()=>_0x150a8c['workflow'][_0x25f139(0x296)]({'projectName':_0x13371e,'workflowName':_0x56e521,'status':_0x40dfbf[_0x25f139(0x2ec)],'fromTime':_0x40dfbf[_0x25f139(0x365)],'toTime':_0x40dfbf['to'],'limit':_0x253a20}),{'verbose':_0x40dfbf[_0x25f139(0x31f)]}),_0x2105cf=_0x405813[_0x25f139(0x2c0)];_0x2105cf[_0x25f139(0x2ba)]((_0x12ad63,_0x6dbe06)=>{const _0x415684=_0x25f139,_0x510ef1=_0x12ad63['sessionTime']||'',_0x48ccac=_0x6dbe06[_0x415684(0x36a)]||'';return _0x48ccac[_0x415684(0x351)](_0x510ef1);});_0x2105cf[_0x25f139(0x2c2)]>=_0x253a20?console[_0x25f139(0x2ae)](_0x25f139(0x2f1)+_0x2105cf[_0x25f139(0x2c2)]+_0x25f139(0x29d)+a54_0x13943d['dim'](_0x25f139(0x364))):console['error']('✔\x20Found\x20'+_0x2105cf[_0x25f139(0x2c2)]+_0x25f139(0x284)+(_0x2105cf['length']!==0x1?'s':''));if(_0x40dfbf[_0x25f139(0x352)]==='json'||_0x40dfbf[_0x25f139(0x352)]===_0x25f139(0x291)||_0x40dfbf[_0x25f139(0x352)]==='table')await handleSDKOutput(_0x2105cf,_0x40dfbf);else{if(!process[_0x25f139(0x2fc)][_0x25f139(0x2aa)]||_0x40dfbf['output']){if(_0x2105cf[_0x25f139(0x2c2)]===0x0){if(_0x13371e&&_0x56e521)console[_0x25f139(0x31e)](_0x25f139(0x234)+_0x13371e+'.'+_0x56e521);else _0x13371e?console['log']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x13371e):console[_0x25f139(0x31e)](_0x25f139(0x334));}else{const _0x27072e=_0x40dfbf[_0x25f139(0x1e2)],_0x423812=this[_0x25f139(0x227)](_0x2105cf,_0x27072e);_0x40dfbf[_0x25f139(0x1bb)]?await writeOutput(_0x423812,_0x40dfbf['output'],'list'):console[_0x25f139(0x31e)](_0x423812);}!_0x13371e&&(console[_0x25f139(0x2ae)](''),console[_0x25f139(0x2ae)](a54_0x13943d['dim'](_0x25f139(0x34c))),console[_0x25f139(0x2ae)](a54_0x13943d[_0x25f139(0x31c)](_0x25f139(0x2d8))+'or'+a54_0x13943d[_0x25f139(0x31c)](_0x25f139(0x264))));}else{if(_0x2105cf[_0x25f139(0x2c2)]===0x0){if(_0x13371e&&_0x56e521)console[_0x25f139(0x31e)](_0x25f139(0x234)+_0x13371e+'.'+_0x56e521);else _0x13371e?console['log'](_0x25f139(0x372)+_0x13371e):console[_0x25f139(0x31e)](_0x25f139(0x334));}else await this[_0x25f139(0x36c)](_0x2105cf,_0x249da0,_0x13371e);}}return 0x0;}[a54_0x2a0943(0x227)](_0x66f4da,_0x2ffd70){const _0x39407f=a54_0x2a0943,_0x2c6c5f=[],_0x1e155e=new Map();let _0x45787e=Infinity,_0x2e4428=-Infinity;for(const _0x3ee661 of _0x66f4da){if(_0x3ee661[_0x39407f(0x363)]?.['createdAt']){const _0xac8301=new Date(_0x3ee661['lastAttempt'][_0x39407f(0x34e)])[_0x39407f(0x29c)](),_0x24f7fc=_0x3ee661[_0x39407f(0x363)][_0x39407f(0x2e0)]?new Date(_0x3ee661['lastAttempt'][_0x39407f(0x2e0)])[_0x39407f(0x29c)]():Date[_0x39407f(0x22e)](),_0x4277c7=_0x3ee661[_0x39407f(0x330)]?.[_0x39407f(0x1c3)]||_0x39407f(0x1d8);!_0x1e155e[_0x39407f(0x383)](_0x4277c7)&&_0x1e155e[_0x39407f(0x2a7)](_0x4277c7,[]),_0x1e155e[_0x39407f(0x1bf)](_0x4277c7)[_0x39407f(0x377)]({'session':_0x3ee661,'startTime':_0xac8301,'endTime':_0x24f7fc,'duration':_0x24f7fc-_0xac8301}),_0x45787e=Math['min'](_0x45787e,_0xac8301),_0x2e4428=Math['max'](_0x2e4428,_0x24f7fc);}}if(_0x1e155e[_0x39407f(0x1e5)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x29e5d8=process[_0x39407f(0x2fc)][_0x39407f(0x34a)]||0x78,_0x299122=0x1e,_0x17ce2=0x32,_0x467ab6=0x4,_0x15202c=Math[_0x39407f(0x294)](_0x17ce2,Math['max'](_0x299122,Math[_0x39407f(0x2bc)](_0x29e5d8*0.3))),_0x4fddc6=_0x29e5d8-_0x15202c-TIMELINE_CONFIG['GUTTER']-0x3-_0x467ab6,_0xa3994f=_0x2e4428-_0x45787e,_0x509a76=_0xa3994f/_0x15202c,_0x43c7a2=renderTimeAxis({'startTime':_0x45787e,'endTime':_0x2e4428,'durationMs':_0xa3994f,'msPerChar':_0x509a76},_0x15202c),_0x3f98d7=[];for(const _0x1b92de of _0x1e155e[_0x39407f(0x34f)]()){_0x3f98d7[_0x39407f(0x377)](..._0x1b92de);}_0x3f98d7[_0x39407f(0x2ba)]((_0x1006db,_0x2fd758)=>_0x2fd758[_0x39407f(0x2c3)]-_0x1006db[_0x39407f(0x2c3)]);const _0x8e450e=new Date(_0x45787e),_0x26aaac=formatDate(_0x8e450e),_0x221479=_0x467ab6+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG['ICON_SPACING']+_0x4fddc6,_0x4352ab='\x20'[_0x39407f(0x297)](_0x221479-_0x26aaac[_0x39407f(0x2c2)]),_0x144798=_0x4352ab+a54_0x13943d[_0x39407f(0x31c)](_0x26aaac)+'\x20'+_0x43c7a2;_0x2c6c5f[_0x39407f(0x377)](_0x144798);const _0x3339e1=0x16;let _0x52e3b1=0x0;for(const _0x447c7b of _0x3f98d7){const _0x4cfbd7=_0x447c7b['session']['project']?.[_0x39407f(0x1c3)]||'?',_0xe8bf25=Math[_0x39407f(0x294)](stringWidth(_0x4cfbd7),_0x3339e1);_0x52e3b1=Math[_0x39407f(0x26c)](_0x52e3b1,_0xe8bf25);}for(const _0x35460b of _0x3f98d7){const {session:_0x195f02,startTime:_0xd431cc,endTime:_0x8b8e67,duration:_0x370413}=_0x35460b,_0x35ecc9=_0x195f02['project']?.['id'],_0x435ac9=_0x195f02['id'],_0x54318f=_0x195f02[_0x39407f(0x330)]?.[_0x39407f(0x1c3)]||'?',_0x2aea14=_0x195f02[_0x39407f(0x2f9)]?.[_0x39407f(0x1c3)]||'?';let _0x240654,_0x1283df;if(_0x195f02[_0x39407f(0x363)]){const _0x986773=_0x195f02['lastAttempt'];!_0x986773[_0x39407f(0x20a)]?(_0x240654=_0x986773['cancelRequested']?'🛑':'🔄',_0x1283df=_0x986773['cancelRequested']?a54_0x13943d[_0x39407f(0x2f5)]:a54_0x13943d[_0x39407f(0x258)]):(_0x240654=_0x986773[_0x39407f(0x204)]?'✅':'❌',_0x1283df=_0x986773[_0x39407f(0x204)]?a54_0x13943d[_0x39407f(0x211)]:a54_0x13943d[_0x39407f(0x1fc)]);}else _0x240654='⏳',_0x1283df=a54_0x13943d[_0x39407f(0x31c)];const _0x5cff45='#'+_0x435ac9,_0x2e9856=_0x35ecc9?hyperlink(_0x5cff45,getWorkflowSessionUrl(_0x2ffd70,_0x35ecc9,_0x435ac9)):_0x5cff45;let _0x4ff1f3=_0x54318f;stringWidth(_0x54318f)>_0x3339e1&&(_0x4ff1f3=_0x54318f['slice'](0x0,_0x3339e1-0x1)+'…');const _0x55817d=a54_0x13943d[_0x39407f(0x31c)](_0x4ff1f3),_0x5f6ca4=stringWidth(_0x4ff1f3),_0x52d5b6='\x20'[_0x39407f(0x297)](_0x52e3b1-stringWidth(_0x4ff1f3)+0x2),_0x442fef='('+formatElapsed(_0x370413)+')',_0x35ee77=stringWidth(_0x442fef),_0x2ddb15=stringWidth(_0x5cff45),_0x1ddb60=_0x2ddb15+0x1+_0x5f6ca4+_0x52d5b6[_0x39407f(0x2c2)],_0x4214eb=_0x4fddc6-_0x1ddb60-_0x35ee77-0x1-0x8;let _0x28b3be=_0x2aea14;stringWidth(_0x28b3be)>_0x4214eb&&(_0x28b3be=_0x28b3be['slice'](0x0,_0x4214eb-0x1)+'…');const _0x52e7e6=_0x2e9856+'\x20'+_0x55817d+_0x52d5b6+_0x28b3be,_0x176e42=stringWidth(_0x52e7e6),_0x5833fd=_0x4fddc6-_0x176e42-_0x35ee77,_0x2c1b1a=_0x52e7e6+'\x20'[_0x39407f(0x297)](Math[_0x39407f(0x26c)](0x1,_0x5833fd))+a54_0x13943d[_0x39407f(0x31c)](_0x442fef),_0x5900b3=Math[_0x39407f(0x2bc)]((_0xd431cc-_0x45787e)/_0x509a76),_0x4ee2ed=Math[_0x39407f(0x2bc)]((_0x8b8e67-_0x45787e)/_0x509a76),_0x286230=Math[_0x39407f(0x26c)](_0x5900b3+0x1,_0x4ee2ed),_0x1436ce=new Array(_0x15202c)['fill']('\x20');for(let _0x4deb3e=_0x5900b3;_0x4deb3e<Math[_0x39407f(0x294)](_0x286230,_0x15202c);_0x4deb3e++){_0x1436ce[_0x4deb3e]='─';}const _0x556149=_0x1436ce[_0x39407f(0x285)](_0x4fc93d=>_0x4fc93d==='\x20'?'\x20':_0x1283df(_0x4fc93d))[_0x39407f(0x219)]('');_0x2c6c5f[_0x39407f(0x377)](_0x240654+'\x20'+_0x2c1b1a+'│'+_0x556149+'│');}return _0x2c6c5f[_0x39407f(0x219)]('\x0a');}async['navigateSessionsInteractive'](_0x1cb770,_0x4ec489,_0xa6d679){const _0x305c9c=a54_0x2a0943,{options:_0x699f4e,tdx:_0x5ee484}=_0x4ec489,_0x5ad973=_0x699f4e[_0x305c9c(0x1e2)],{timelineRows:_0x47cb95,timeAxisHeader:_0x2db2f9}=this[_0x305c9c(0x389)](_0x1cb770,_0x5ad973),_0x3b188b=_0x47cb95['filter'](_0x26dec7=>_0x26dec7[_0x305c9c(0x20b)]);if(_0x3b188b[_0x305c9c(0x2c2)]===0x0){const _0x3addf3=this[_0x305c9c(0x227)](_0x1cb770,_0x5ad973);console[_0x305c9c(0x31e)](_0x3addf3);!_0xa6d679&&(console[_0x305c9c(0x2ae)](''),console[_0x305c9c(0x2ae)](a54_0x13943d['dim'](_0x305c9c(0x34c))),console['error'](a54_0x13943d[_0x305c9c(0x31c)](_0x305c9c(0x2d8))+'or'+a54_0x13943d['dim'](_0x305c9c(0x264))));return;}_0x2db2f9&&console[_0x305c9c(0x31e)](_0x2db2f9);const _0x16c9d3=_0x47cb95[_0x305c9c(0x2ed)](_0x5496d5=>_0x5496d5[_0x305c9c(0x20b)])[_0x305c9c(0x285)](_0x45c37d=>({'title':_0x45c37d[_0x305c9c(0x2b9)],'value':_0x45c37d['attemptId']})),_0x2397bd=process['stdout'][_0x305c9c(0x1fd)]||0x3c,_0x54ab0e=Math[_0x305c9c(0x26c)](0x28,Math[_0x305c9c(0x2bc)](_0x2397bd*0x2/0x3)),_0x44c8eb=await a54_0x1b2330({'type':_0x305c9c(0x214),'name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x16c9d3,'initial':-0x1,'limit':_0x54ab0e,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x3f551f,_0x13bb16)=>{const _0x26379a=_0x305c9c;if(!_0x3f551f)return Promise[_0x26379a(0x223)](_0x13bb16);const _0x5855dd=_0x13bb16['filter'](_0x8b1d02=>{const _0x2b7e91=_0x26379a,_0x489ffd=_0x8b1d02;return _0x489ffd['title'][_0x2b7e91(0x1ea)]()[_0x2b7e91(0x2c6)](_0x3f551f[_0x2b7e91(0x1ea)]());});return Promise[_0x26379a(0x223)](_0x5855dd);}}),_0x3e54dd=()=>{const _0x4c0835=_0x305c9c;process[_0x4c0835(0x2fc)][_0x4c0835(0x1d6)](_0x4c0835(0x2b2)),process[_0x4c0835(0x2fc)][_0x4c0835(0x1d6)]('\x1b[1A\x1b[2K'),process[_0x4c0835(0x2fc)][_0x4c0835(0x1d6)](_0x4c0835(0x2b2));},_0x196f26=_0x44c8eb&&_0x44c8eb[_0x305c9c(0x20b)]&&_0x44c8eb['attemptId']!==null&&_0x44c8eb[_0x305c9c(0x20b)][_0x305c9c(0x2c9)]()!=='';if(!_0x196f26){_0x3e54dd(),console[_0x305c9c(0x31e)](a54_0x13943d['dim']('Cancelled'));return;}_0x3e54dd();const _0x985979=_0x1cb770['find'](_0x2a5804=>_0x2a5804[_0x305c9c(0x363)]?.['id']===_0x44c8eb[_0x305c9c(0x20b)]);if(_0x985979){const _0x152590=_0x985979['project']?.[_0x305c9c(0x1c3)]||'?',_0x1ea567=_0x985979[_0x305c9c(0x2f9)]?.[_0x305c9c(0x1c3)]||'?';console[_0x305c9c(0x31e)](_0x305c9c(0x30e)+a54_0x13943d[_0x305c9c(0x31c)](_0x152590)+_0x305c9c(0x22a)+a54_0x13943d[_0x305c9c(0x31c)](_0x1ea567));}const _0x4a83f6=new WorkflowTimelineCommand();await _0x4a83f6[_0x305c9c(0x295)]({'args':[],'options':{..._0x699f4e,'attemptId':_0x44c8eb[_0x305c9c(0x20b)]},'tdx':_0x5ee484});}['generateSessionTimelineRows'](_0x3b0bc7,_0x1508fa){const _0x2e91c0=a54_0x2a0943,_0x1d3678=new Map();for(const _0x1f2ed5 of _0x3b0bc7){_0x1f2ed5['id']&&_0x1f2ed5[_0x2e91c0(0x363)]?.['id']&&_0x1d3678['set'](_0x1f2ed5['id'],_0x1f2ed5[_0x2e91c0(0x363)]['id']);}const _0x2b0afa=[];let _0x3eb66d='';const _0x2bc52e=this['renderSessionsTimeline'](_0x3b0bc7,_0x1508fa),_0x31e85e=_0x2bc52e[_0x2e91c0(0x2ca)]('\x0a');for(const _0x1bf963 of _0x31e85e){if(_0x1bf963['startsWith'](_0x2e91c0(0x350))||_0x1bf963[_0x2e91c0(0x2d4)](/^\s+\d{4}-\d{2}-\d{2}/))_0x3eb66d=_0x1bf963;else{if(_0x1bf963['match'](/^[✅❌🔄🛑⏳]/)){const _0x649a6b=_0x1bf963[_0x2e91c0(0x2d4)](/#(\d+)/),_0x77203d=_0x649a6b?_0x649a6b[0x1]:null,_0x56f129=_0x77203d?_0x1d3678[_0x2e91c0(0x1bf)](_0x77203d)||null:null,_0x39f0f8=_0x3b0bc7[_0x2e91c0(0x331)](_0x1824a3=>_0x1824a3['id']===_0x77203d),_0x477ee2=_0x39f0f8?.['project']?.[_0x2e91c0(0x1c3)]||'';_0x2b0afa[_0x2e91c0(0x377)]({'displayLine':_0x1bf963,'attemptId':_0x56f129,'projectName':_0x477ee2});}}}return{'timelineRows':_0x2b0afa,'timeAxisHeader':_0x3eb66d};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a54_0x2a0943(0x2b5);['description']=a54_0x2a0943(0x1d9);async[a54_0x2a0943(0x295)](_0x5a96c5){const _0x5eb72f=a54_0x2a0943,{options:_0x48e602,args:_0x349fc2,tdx:_0x56b2fc}=_0x5a96c5,_0x37ba8d=this['parseProjectWorkflowPattern'](_0x349fc2,_0x48e602);if(!_0x37ba8d)return 0x1;const {projectName:_0x406218,workflowName:_0x1c5053}=_0x37ba8d,_0xf4840b=_0x48e602['includeRetried'];if(_0x48e602[_0x5eb72f(0x31f)]){if(_0x406218&&_0x1c5053)console[_0x5eb72f(0x2ae)](_0x5eb72f(0x24f)+_0x406218+'.'+_0x1c5053);else _0x406218&&console[_0x5eb72f(0x2ae)](_0x5eb72f(0x2d5)+_0x406218);_0xf4840b&&console[_0x5eb72f(0x2ae)](_0x5eb72f(0x2e7));}const _0x1eb104=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x56b2fc[_0x5eb72f(0x2f9)]['attempts']({'projectName':_0x406218,'workflowName':_0x1c5053,'includeRetried':_0xf4840b,'limit':_0x48e602[_0x5eb72f(0x34d)]}),{'verbose':_0x48e602[_0x5eb72f(0x31f)]}),_0x267641=_0x1eb104[_0x5eb72f(0x2c0)],_0x3ed299=_0x48e602[_0x5eb72f(0x34d)]||0x64,_0x26c7f2=_0x267641['length']>=_0x3ed299?a54_0x13943d[_0x5eb72f(0x31c)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x5eb72f(0x2ae)]('✔\x20Found\x20'+_0x267641[_0x5eb72f(0x2c2)]+_0x5eb72f(0x212)+(_0x267641[_0x5eb72f(0x2c2)]!==0x1?'s':'')+_0x26c7f2);if(_0x48e602['format']===_0x5eb72f(0x200)||_0x48e602[_0x5eb72f(0x352)]===_0x5eb72f(0x291)||_0x48e602['format']===_0x5eb72f(0x311))await handleSDKOutput(_0x267641,_0x48e602);else{if(_0x267641[_0x5eb72f(0x2c2)]===0x0){if(_0x406218&&_0x1c5053)console['log'](_0x5eb72f(0x28a)+_0x406218+'.'+_0x1c5053);else _0x406218?console[_0x5eb72f(0x31e)](_0x5eb72f(0x1dd)+_0x406218):console[_0x5eb72f(0x31e)](_0x5eb72f(0x368));}else{const _0x52f395=_0x48e602[_0x5eb72f(0x1e2)],_0x29fde9=_0x267641[_0x5eb72f(0x285)](_0x1a715e=>{const _0x3273ce=_0x5eb72f,_0x5ccce1=a54_0x13943d[_0x3273ce(0x31c)]('#'+_0x1a715e['id']),_0x14fac3=_0x1a715e[_0x3273ce(0x330)]?.['id'],_0xe46731=_0x1a715e[_0x3273ce(0x1f8)]||_0x1a715e['sessionId'],_0x1eb4e0=_0x14fac3&&_0xe46731?hyperlink(_0x5ccce1,getWorkflowAttemptUrl(_0x52f395,_0x14fac3,_0xe46731,_0x1a715e['id'])):_0x5ccce1,{icon:_0x4a42b8,text:_0x3c3abb}=getAttemptStatusDisplay(_0x1a715e),_0x580766=(_0x1a715e[_0x3273ce(0x330)]?.['name']||'?')+'.'+(_0x1a715e[_0x3273ce(0x2f9)]?.[_0x3273ce(0x1c3)]||'?'),_0x3edb0c=_0x1a715e[_0x3273ce(0x36a)]?a54_0x13943d[_0x3273ce(0x31c)](_0x1a715e[_0x3273ce(0x36a)]):'';return(_0x1eb4e0+'\x20'+_0x4a42b8+(_0x3c3abb?'\x20'+_0x3c3abb:'')+'\x20'+_0x580766+'\x20'+_0x3edb0c)['trimEnd']();});await writeOutput(_0x29fde9[_0x5eb72f(0x219)]('\x0a'),_0x48e602['output'],_0x5eb72f(0x354));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x1c2);['description']='Show\x20specific\x20attempt\x20details';async['execute'](_0x3a3a83){const _0x10189d=a54_0x2a0943,{options:_0x5e1a10,args:_0x20c12d,tdx:_0x4b412c}=_0x3a3a83,_0x2c3234=_0x20c12d[0x0];if(!_0x2c3234)return console[_0x10189d(0x2ae)](_0x10189d(0x231)),0x1;_0x5e1a10['verbose']&&console[_0x10189d(0x2ae)](_0x10189d(0x310)+_0x2c3234);const _0x499f81=await withSpinner(_0x10189d(0x2f3),()=>_0x4b412c['workflow'][_0x10189d(0x1ff)](_0x2c3234),{'verbose':_0x5e1a10[_0x10189d(0x31f)]}),_0x1d2b73=_0x499f81[_0x10189d(0x2c0)];let _0x4d70dd;!_0x1d2b73['done']?_0x4d70dd=_0x1d2b73[_0x10189d(0x2a9)]?_0x10189d(0x27c):_0x10189d(0x2ea):_0x4d70dd=_0x1d2b73['success']?_0x10189d(0x204):_0x10189d(0x2ae);let _0x112131;if(_0x1d2b73[_0x10189d(0x34e)]&&_0x1d2b73[_0x10189d(0x2e0)]){const _0x4f9067=new Date(_0x1d2b73['createdAt'])['getTime'](),_0x120122=new Date(_0x1d2b73[_0x10189d(0x2e0)])[_0x10189d(0x29c)]();_0x112131=Math[_0x10189d(0x277)]((_0x120122-_0x4f9067)/0x3e8);}const _0x20712b={'attempt_id':_0x1d2b73['id'],'status':_0x4d70dd,..._0x1d2b73['index']!==undefined&&{'index':_0x1d2b73[_0x10189d(0x2bf)]},..._0x1d2b73[_0x10189d(0x330)]&&{'project':_0x1d2b73[_0x10189d(0x330)]['name']},..._0x1d2b73[_0x10189d(0x2f9)]&&{'workflow':_0x1d2b73[_0x10189d(0x2f9)]['name']},..._0x1d2b73[_0x10189d(0x1fe)]&&{'session_id':_0x1d2b73[_0x10189d(0x1fe)]},..._0x1d2b73[_0x10189d(0x36a)]&&{'session_time':_0x1d2b73[_0x10189d(0x36a)]},..._0x1d2b73[_0x10189d(0x358)]&&{'retry_attempt':_0x1d2b73[_0x10189d(0x358)]},..._0x112131!==undefined&&{'duration_sec':_0x112131},..._0x1d2b73[_0x10189d(0x34e)]&&{'created_at':_0x1d2b73[_0x10189d(0x34e)]},..._0x1d2b73['finishedAt']&&{'finished_at':_0x1d2b73[_0x10189d(0x2e0)]},...Object[_0x10189d(0x1c9)](_0x1d2b73[_0x10189d(0x253)])[_0x10189d(0x2c2)]>0x0&&{'params':_0x1d2b73[_0x10189d(0x253)]}};return await handleSingleObjectOutput(_0x20712b,_0x5e1a10),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a54_0x2a0943(0x23d);[a54_0x2a0943(0x337)]='Show\x20tasks\x20for\x20an\x20attempt';async[a54_0x2a0943(0x295)](_0x5d5f0b){const _0x3b4b8e=a54_0x2a0943,{options:_0x1d8e9d,args:_0x238534,tdx:_0x1fc44c}=_0x5d5f0b,_0x341448=_0x238534[0x0];if(!_0x341448)return console[_0x3b4b8e(0x2ae)](_0x3b4b8e(0x231)),0x1;const _0x40ddff=_0x1d8e9d[_0x3b4b8e(0x209)];_0x1d8e9d[_0x3b4b8e(0x31f)]&&(console[_0x3b4b8e(0x2ae)](_0x3b4b8e(0x310)+_0x341448),_0x40ddff&&console['error'](_0x3b4b8e(0x359)));const _0x2d1053=await withSpinner(_0x3b4b8e(0x371),()=>_0x1fc44c[_0x3b4b8e(0x2f9)]['tasks'](_0x341448,_0x40ddff||![]),{'verbose':_0x1d8e9d[_0x3b4b8e(0x31f)]}),_0x169f81=_0x2d1053['data'];return console[_0x3b4b8e(0x2ae)]('✔\x20Found\x20'+_0x169f81['length']+_0x3b4b8e(0x1de)+(_0x169f81['length']!==0x1?'s':'')),await handleSDKOutput(_0x169f81,_0x1d8e9d),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a54_0x2a0943(0x1c4);['description']=a54_0x2a0943(0x283);async[a54_0x2a0943(0x295)](_0x4483d1){const _0x472c3d=a54_0x2a0943,{options:_0x571506,args:_0xe8eb53,tdx:_0x3bdc4c}=_0x4483d1,_0x22aeae=_0xe8eb53[0x0];let _0x36ff36=_0xe8eb53[0x1];if(!_0x22aeae)return console['error'](_0x472c3d(0x231)),0x1;_0x571506['verbose']&&(console[_0x472c3d(0x2ae)](_0x472c3d(0x310)+_0x22aeae),_0x36ff36&&console[_0x472c3d(0x2ae)](_0x472c3d(0x308)+_0x36ff36));const _0x4a377f=await withSpinner(_0x472c3d(0x30c),()=>_0x3bdc4c['workflow'][_0x472c3d(0x286)](_0x22aeae,_0x36ff36),{'verbose':_0x571506[_0x472c3d(0x31f)]}),_0x47c28c=_0x4a377f[_0x472c3d(0x2c0)];if(_0x47c28c['length']===0x0)return console['error'](_0x472c3d(0x2a0)),0x0;if(!_0x36ff36&&(_0x571506[_0x472c3d(0x200)]||_0x571506['format']))return await handleSDKOutput(_0x47c28c,_0x571506),0x0;if(!_0x36ff36){const _0x114fe9=_0x47c28c['map'](_0x249ec2=>({'title':_0x249ec2[_0x472c3d(0x343)]+'\x20('+formatBytes(_0x249ec2[_0x472c3d(0x369)])+')','value':_0x249ec2[_0x472c3d(0x343)]})),_0x20716e=await a54_0x1b2330({'type':_0x472c3d(0x336),'name':_0x472c3d(0x27e),'message':_0x472c3d(0x236),'choices':_0x114fe9});if(!_0x20716e[_0x472c3d(0x27e)])return console[_0x472c3d(0x2ae)](_0x472c3d(0x22c)),0x0;_0x36ff36=_0x20716e[_0x472c3d(0x27e)];}const _0x21dd97=await withSpinner(_0x472c3d(0x1c5),()=>_0x3bdc4c[_0x472c3d(0x2f9)][_0x472c3d(0x1d1)](_0x22aeae,_0x36ff36),{'verbose':_0x571506[_0x472c3d(0x31f)]}),_0x308e06=_0x21dd97['data'];return _0x308e06?console[_0x472c3d(0x31e)](_0x308e06):console[_0x472c3d(0x2ae)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x386);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x24d);async[a54_0x2a0943(0x295)](_0xc63e18){const _0x1192f2=a54_0x2a0943,{options:_0x2d2927,args:_0x5b5d5a,tdx:_0x292140}=_0xc63e18,_0xd145ee=_0x5b5d5a[0x0];if(!_0xd145ee)return console[_0x1192f2(0x2ae)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x39eff5=_0x2d2927[_0x1192f2(0x254)];_0x2d2927[_0x1192f2(0x31f)]&&(console['error'](_0x1192f2(0x310)+_0xd145ee),_0x39eff5&&console[_0x1192f2(0x2ae)](_0x1192f2(0x2bd)+_0x39eff5));if(!_0x2d2927['yes']){if(!isInteractive())return console[_0x1192f2(0x2ae)](a54_0x13943d['red'](_0x1192f2(0x252)),_0x1192f2(0x2e4)),console[_0x1192f2(0x2ae)](a54_0x13943d[_0x1192f2(0x31c)](_0x1192f2(0x25d))),0x1;const _0x543766=await confirmKey(_0x1192f2(0x29b)+_0xd145ee+'?');if(!_0x543766)return console['error'](a54_0x13943d['yellow'](_0x1192f2(0x22c))),0x1;}const _0x4f132f=await withSpinner('Killing\x20attempt...',()=>_0x292140[_0x1192f2(0x2f9)][_0x1192f2(0x1f5)](_0xd145ee,_0x39eff5),{'verbose':_0x2d2927[_0x1192f2(0x31f)]}),_0x395540=_0x4f132f[_0x1192f2(0x2c0)];return console['error']('✔\x20'+_0x395540),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]='workflow:retry';['description']=a54_0x2a0943(0x255);async[a54_0x2a0943(0x295)](_0x2ec92c){const _0xcfac80=a54_0x2a0943,{options:_0x198308,args:_0x39c043,tdx:_0x306e7e}=_0x2ec92c,_0x31478a=_0x39c043[0x0];if(!_0x31478a)return console[_0xcfac80(0x2ae)](_0xcfac80(0x270)),console[_0xcfac80(0x2ae)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x14d630=![],_0x30a302=_0x31478a;if(_0x31478a[_0xcfac80(0x37d)](_0xcfac80(0x22f)))_0x14d630=!![],_0x30a302=_0x31478a[_0xcfac80(0x259)](0x8);else{if(_0x31478a[_0xcfac80(0x37d)](_0xcfac80(0x241)))_0x14d630=![],_0x30a302=_0x31478a['substring'](0x8);else return console['error'](_0xcfac80(0x342)),console[_0xcfac80(0x2ae)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x5dfb3e=_0x198308['fromTask'],_0x4945d4=_0x198308[_0xcfac80(0x220)],_0x31103b=_0x198308[_0xcfac80(0x253)],_0x2c6504=_0x198308[_0xcfac80(0x328)];_0x198308[_0xcfac80(0x31f)]&&(console[_0xcfac80(0x2ae)]('Target:\x20'+(_0x14d630?'session':_0xcfac80(0x1ff))+'\x20'+_0x30a302),_0x5dfb3e&&console[_0xcfac80(0x2ae)](_0xcfac80(0x35c)+_0x5dfb3e),_0x4945d4&&console[_0xcfac80(0x2ae)]('Resume\x20from:\x20'+_0x4945d4),_0x31103b&&console[_0xcfac80(0x2ae)]('Params:\x20'+_0x31103b),_0x2c6504&&console[_0xcfac80(0x2ae)](_0xcfac80(0x303)));let _0xf981ed;if(_0x31103b)try{if(_0x31103b[_0xcfac80(0x37d)]('@')){const _0x300e5c=await import(_0xcfac80(0x1f1)),_0x56a708=_0x31103b[_0xcfac80(0x259)](0x1),_0x19207c=await _0x300e5c[_0xcfac80(0x2e2)](_0x56a708,'utf-8');_0xf981ed=JSON['parse'](_0x19207c);}else _0xf981ed=JSON[_0xcfac80(0x1bd)](_0x31103b);}catch{return console[_0xcfac80(0x2ae)](_0xcfac80(0x24b)),0x1;}if(!_0x198308[_0xcfac80(0x340)]){if(!isInteractive())return console[_0xcfac80(0x2ae)](a54_0x13943d[_0xcfac80(0x1fc)](_0xcfac80(0x252)),_0xcfac80(0x2e4)),console[_0xcfac80(0x2ae)](a54_0x13943d['dim'](_0xcfac80(0x25d))),0x1;const _0x4f1441=await confirmKey(_0xcfac80(0x35b)+(_0x14d630?_0xcfac80(0x229):_0xcfac80(0x1ff))+'\x20'+_0x30a302+'?');if(!_0x4f1441)return console['error'](a54_0x13943d[_0xcfac80(0x2f5)](_0xcfac80(0x22c))),0x1;}let _0x928dec;_0x14d630?_0x928dec=await withSpinner(_0xcfac80(0x25b),()=>_0x306e7e[_0xcfac80(0x2f9)]['retrySession'](_0x30a302,{'fromTask':_0x5dfb3e,'retryParams':_0xf981ed}),{'verbose':_0x198308['verbose']}):_0x928dec=await withSpinner('Retrying\x20attempt...',()=>_0x306e7e[_0xcfac80(0x2f9)][_0xcfac80(0x281)](_0x30a302,{'resumeFrom':_0x4945d4,'retryParams':_0xf981ed,'force':_0x2c6504}),{'verbose':_0x198308[_0xcfac80(0x31f)]});const _0x597602=_0x928dec[_0xcfac80(0x2c0)];return console[_0xcfac80(0x2ae)](_0xcfac80(0x306)),console[_0xcfac80(0x2ae)](_0xcfac80(0x2d1)+_0x597602['attemptId']),console[_0xcfac80(0x2ae)]('\x20\x20Session\x20ID:\x20'+_0x597602[_0xcfac80(0x1fe)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x333);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x2ad);async[a54_0x2a0943(0x295)](_0x4aee00){const _0x331a3b=a54_0x2a0943,{options:_0x28eac7,args:_0x2679aa,tdx:_0x2dad9a}=_0x4aee00;let _0x44c783=_0x2679aa[0x0];if(!_0x44c783){const _0x3361c1=this[_0x331a3b(0x1d4)]([],_0x28eac7),_0x9a86fb=await withSpinner(_0x331a3b(0x341),()=>_0x2dad9a[_0x331a3b(0x2f9)][_0x331a3b(0x1d5)](_0x3361c1,{'limit':_0x28eac7[_0x331a3b(0x34d)]}),{'verbose':_0x28eac7['verbose']}),_0x96bd32=_0x9a86fb[_0x331a3b(0x2c0)];if(_0x96bd32[_0x331a3b(0x2c2)]===0x0)return console[_0x331a3b(0x2ae)](_0x331a3b(0x293)),!_0x3361c1&&console['error'](a54_0x13943d[_0x331a3b(0x31c)](_0x331a3b(0x362))),0x1;const _0xa1f094=_0x96bd32[_0x331a3b(0x285)](_0x4a8968=>({'title':_0x4a8968['project']?.[_0x331a3b(0x1c3)]+'.'+_0x4a8968[_0x331a3b(0x1c3)],'value':_0x4a8968[_0x331a3b(0x330)]?.[_0x331a3b(0x1c3)]+'.'+_0x4a8968[_0x331a3b(0x1c3)],'description':_0x4a8968['revision']?_0x331a3b(0x26b)+_0x4a8968[_0x331a3b(0x271)]:undefined})),_0x51a273=await a54_0x1b2330({'type':_0x331a3b(0x336),'name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0xa1f094});if(!_0x51a273[_0x331a3b(0x2f9)])return 0x1;_0x44c783=_0x51a273[_0x331a3b(0x2f9)];}if(!_0x44c783[_0x331a3b(0x2c6)]('.')){const _0x58ea46=this[_0x331a3b(0x1d4)]([],_0x28eac7);if(_0x58ea46)_0x44c783=_0x58ea46+'.'+_0x44c783;else return console['error'](a54_0x13943d[_0x331a3b(0x1fc)](_0x331a3b(0x33f)),_0x331a3b(0x376)),console[_0x331a3b(0x2ae)](a54_0x13943d['dim'](_0x331a3b(0x362))),0x1;}const _0xfd6e51=_0x28eac7[_0x331a3b(0x21e)],_0x43ad2a=_0x28eac7[_0x331a3b(0x36a)],_0x401b11={};if(_0xfd6e51&&Array['isArray'](_0xfd6e51))for(const _0x2f60c7 of _0xfd6e51){const _0x2c4698=_0x2f60c7['indexOf']('=');if(_0x2c4698===-0x1)return console[_0x331a3b(0x2ae)](_0x331a3b(0x27f)+_0x2f60c7),console[_0x331a3b(0x2ae)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x1b5193=_0x2f60c7[_0x331a3b(0x259)](0x0,_0x2c4698),_0x30b29f=_0x2f60c7[_0x331a3b(0x259)](_0x2c4698+0x1);try{_0x401b11[_0x1b5193]=JSON[_0x331a3b(0x1bd)](_0x30b29f);}catch{_0x401b11[_0x1b5193]=_0x30b29f;}}_0x28eac7[_0x331a3b(0x31f)]&&(console['error'](_0x331a3b(0x27a)+_0x44c783),Object[_0x331a3b(0x1c9)](_0x401b11)['length']>0x0&&console[_0x331a3b(0x2ae)]('Parameters:\x20'+JSON[_0x331a3b(0x327)](_0x401b11)),_0x43ad2a&&console['error'](_0x331a3b(0x20d)+_0x43ad2a));const _0x151614=await withSpinner(_0x331a3b(0x22b),()=>_0x2dad9a['workflow'][_0x331a3b(0x28b)](_0x44c783,_0x401b11,{'sessionTime':_0x43ad2a}),{'verbose':_0x28eac7[_0x331a3b(0x31f)]}),_0x41c3fa=_0x151614[_0x331a3b(0x2c0)];console['error'](_0x331a3b(0x29e)),console[_0x331a3b(0x2ae)](_0x331a3b(0x2b7)+_0x41c3fa['id']),console['error'](_0x331a3b(0x256)+_0x41c3fa[_0x331a3b(0x1fe)]),console[_0x331a3b(0x2ae)](_0x331a3b(0x33b)+_0x41c3fa['project']?.[_0x331a3b(0x1c3)]),console['error'](_0x331a3b(0x35e)+_0x41c3fa[_0x331a3b(0x2f9)]?.['name']);if(_0x41c3fa[_0x331a3b(0x330)]?.['id']&&_0x41c3fa[_0x331a3b(0x1fe)]&&_0x41c3fa['id']){const _0x5ca5ae=_0x28eac7[_0x331a3b(0x1e2)],_0x4fe8cd=getConsoleUrl(_0x5ca5ae,_0x331a3b(0x33a)+_0x41c3fa[_0x331a3b(0x330)]['id']+_0x331a3b(0x1cd)+_0x41c3fa[_0x331a3b(0x1fe)]+_0x331a3b(0x2d0)+_0x41c3fa['id']);console[_0x331a3b(0x2ae)](_0x331a3b(0x2fd)+a54_0x13943d['cyan'](_0x4fe8cd));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x2be);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x2df);async[a54_0x2a0943(0x295)](_0x248ed9){const _0x453fa1=a54_0x2a0943,{options:_0x4410bf,args:_0x28b482,tdx:_0xa9dc0e}=_0x248ed9,_0x59629d=_0x28b482[0x0],_0x5a42d8=_0x28b482[0x1]||'.';if(!_0x59629d)return console[_0x453fa1(0x2ae)](_0x453fa1(0x21c)),console['error'](_0x453fa1(0x24a)),0x1;const _0x54d193=_0x4410bf[_0x453fa1(0x271)];_0x4410bf['verbose']&&(console['error']('Project:\x20'+_0x59629d),console[_0x453fa1(0x2ae)](_0x453fa1(0x36e)+_0x5a42d8),_0x54d193&&console[_0x453fa1(0x2ae)](_0x453fa1(0x20c)+_0x54d193));const _0x3cd632=await withSpinner(_0x453fa1(0x1ce)+_0x59629d+_0x453fa1(0x320),()=>_0xa9dc0e[_0x453fa1(0x2f9)][_0x453fa1(0x224)](_0x59629d,_0x5a42d8,{'revision':_0x54d193}),{'verbose':_0x4410bf[_0x453fa1(0x31f)]}),_0x128565=_0x3cd632[_0x453fa1(0x2c0)];return console[_0x453fa1(0x2ae)](_0x453fa1(0x32a)+_0x128565[_0x453fa1(0x282)]),console[_0x453fa1(0x2ae)](_0x453fa1(0x1f0)+_0x128565['revision']),console[_0x453fa1(0x2ae)](_0x453fa1(0x250)+_0x128565[_0x453fa1(0x2d6)]),console[_0x453fa1(0x2ae)](_0x453fa1(0x21b)+_0x5a42d8+'/'+_0x128565[_0x453fa1(0x282)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x357);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x1da);async[a54_0x2a0943(0x295)](_0x321086){const _0x14f715=a54_0x2a0943,{options:_0x1813d6,args:_0x11cf39,tdx:_0x3a3753}=_0x321086;let _0x407471='.',_0x36373c=_0x1813d6[_0x14f715(0x1c3)];if(_0x11cf39[0x0]){const {promises:_0x1a246c}=await import('fs');try{const _0x58b509=await _0x1a246c['stat'](_0x11cf39[0x0]);if(_0x58b509[_0x14f715(0x2af)]())_0x407471=_0x11cf39[0x0];else return console[_0x14f715(0x2ae)](_0x14f715(0x2cb)+_0x11cf39[0x0]+_0x14f715(0x276)),0x1;}catch{_0x36373c=_0x11cf39[0x0],_0x407471='.';}}const _0x3b4970=_0x1813d6[_0x14f715(0x271)],_0x410452=_0x1813d6[_0x14f715(0x251)];_0x1813d6['verbose']&&(console[_0x14f715(0x2ae)](_0x14f715(0x28c)+_0x407471),_0x36373c&&console[_0x14f715(0x2ae)](_0x14f715(0x345)+_0x36373c),_0x3b4970&&console[_0x14f715(0x2ae)](_0x14f715(0x20c)+_0x3b4970),_0x410452&&console['error'](_0x14f715(0x2e8)));const _0x15f00b=await withSpinner(_0x14f715(0x1c7),()=>_0x3a3753[_0x14f715(0x2f9)]['push'](_0x407471,{'projectName':_0x36373c,'revision':_0x3b4970,'skipValidation':_0x410452}),{'verbose':_0x1813d6[_0x14f715(0x31f)]}),_0x8ba727=_0x15f00b['data'];return console['error'](_0x14f715(0x25a)+_0x8ba727[_0x14f715(0x282)]),console[_0x14f715(0x2ae)](_0x14f715(0x2db)+_0x8ba727[_0x14f715(0x360)]),console[_0x14f715(0x2ae)]('\x20\x20Revision:\x20'+_0x8ba727[_0x14f715(0x271)]),await this[_0x14f715(0x388)](_0x3a3753,_0x8ba727['projectName'],_0x1813d6[_0x14f715(0x1e2)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x2c8);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x2fe);async['execute'](_0x49d05f){const _0x31e613=a54_0x2a0943,{options:_0x4eeb45,args:_0xf0d337,tdx:_0x2c0d0a}=_0x49d05f,_0x2014f7=_0xf0d337[0x0],_0x395c51=_0xf0d337[0x1];if(!_0x2014f7)return console['error'](a54_0x13943d[_0x31e613(0x1fc)](_0x31e613(0x33f)),_0x31e613(0x24c)),console[_0x31e613(0x2ae)](a54_0x13943d[_0x31e613(0x31c)](_0x31e613(0x207))),0x1;const _0x5c4ff3=_0x4eeb45[_0x31e613(0x271)];_0x4eeb45['verbose']&&(console[_0x31e613(0x2ae)]('Project:\x20'+_0x2014f7),_0x395c51&&console[_0x31e613(0x2ae)]('Target\x20directory:\x20'+_0x395c51),_0x5c4ff3&&console[_0x31e613(0x2ae)]('Revision:\x20'+_0x5c4ff3),_0x4eeb45[_0x31e613(0x21f)]&&console[_0x31e613(0x2ae)](_0x31e613(0x329)));const _0x15c4c7=await withSpinner(_0x31e613(0x272)+_0x2014f7+_0x31e613(0x320),()=>_0x2c0d0a[_0x31e613(0x2f9)][_0x31e613(0x1db)](_0x2014f7,{'targetDir':_0x395c51,'revision':_0x5c4ff3}),{'verbose':_0x4eeb45[_0x31e613(0x31f)]}),_0xa2dc45=_0x15c4c7['data'];_0xa2dc45['isNewProject']?console[_0x31e613(0x2ae)](_0x31e613(0x237)+_0xa2dc45[_0x31e613(0x282)]):console[_0x31e613(0x2ae)](_0x31e613(0x20f)+_0xa2dc45[_0x31e613(0x282)]);console['error'](_0x31e613(0x1f0)+_0xa2dc45[_0x31e613(0x271)]),console[_0x31e613(0x2ae)](_0x31e613(0x2cc)+(a54_0x4c5432[_0x31e613(0x1fa)](process['cwd'](),_0xa2dc45[_0x31e613(0x1c8)])||'.')),console[_0x31e613(0x2ae)](_0x31e613(0x2e3)+a54_0x13943d[_0x31e613(0x211)]('+'+_0xa2dc45['summary'][_0x31e613(0x384)]+_0x31e613(0x30a))+',\x20'+(a54_0x13943d[_0x31e613(0x2f5)]('~'+_0xa2dc45[_0x31e613(0x301)][_0x31e613(0x1cb)]+_0x31e613(0x378))+',\x20')+(a54_0x13943d[_0x31e613(0x1fc)]('-'+_0xa2dc45[_0x31e613(0x301)][_0x31e613(0x1e1)]+_0x31e613(0x29a))+',\x20')+(''+a54_0x13943d[_0x31e613(0x31c)](_0xa2dc45[_0x31e613(0x301)][_0x31e613(0x1dc)]+_0x31e613(0x1d0))));for(const _0x1c826d of _0xa2dc45[_0x31e613(0x2e1)]){_0x1c826d[_0x31e613(0x275)]===_0x31e613(0x1cb)&&_0x1c826d[_0x31e613(0x27b)]&&(console[_0x31e613(0x2ae)]('\x0a'+a54_0x13943d[_0x31e613(0x38a)](_0x31e613(0x2d7)+_0x1c826d[_0x31e613(0x26e)])),console['error'](_0x1c826d['diff']));}if(!_0xa2dc45['hasChanges'])return saveSessionContext({'workflow_project':_0xa2dc45[_0x31e613(0x282)]},_0x4eeb45[_0x31e613(0x229)]),console[_0x31e613(0x2ae)](a54_0x13943d['green']('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x31e613(0x2ae)](a54_0x13943d['dim'](_0x31e613(0x380)+_0xa2dc45['projectName'])),0x0;if(_0x4eeb45['dryRun'])return console[_0x31e613(0x2ae)](a54_0x13943d['yellow']('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x4eeb45['yes']){if(!isInteractive())return console['error'](a54_0x13943d[_0x31e613(0x1fc)](_0x31e613(0x252)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x13943d[_0x31e613(0x31c)](_0x31e613(0x25d))),0x1;const _0x303dc1=await confirmKey(_0x31e613(0x206));if(!_0x303dc1)return console['error'](a54_0x13943d[_0x31e613(0x2f5)](_0x31e613(0x22c)),_0x31e613(0x2eb)),0x1;}await withSpinner('Writing\x20files...',()=>_0x2c0d0a['workflow'][_0x31e613(0x1b9)](_0xa2dc45,{'revision':_0x5c4ff3}),{'verbose':_0x4eeb45['verbose']}),saveSessionContext({'workflow_project':_0xa2dc45[_0x31e613(0x282)]},_0x4eeb45[_0x31e613(0x229)]),console[_0x31e613(0x2ae)](a54_0x13943d[_0x31e613(0x211)](_0x31e613(0x353)));const _0x3562af=a54_0x4c5432[_0x31e613(0x1fa)](process[_0x31e613(0x239)](),_0xa2dc45['targetDir'])||'.';return console['error'](a54_0x13943d[_0x31e613(0x31c)]('\x20\x20Location:\x20'+_0x3562af)),console[_0x31e613(0x2ae)](a54_0x13943d[_0x31e613(0x31c)](_0x31e613(0x380)+_0xa2dc45[_0x31e613(0x282)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x2f8);['description']=a54_0x2a0943(0x2ef);async['execute'](_0x33e279){const _0x417029=a54_0x2a0943,{options:_0x538de4,args:_0x8a2a78,tdx:_0x307cc4}=_0x33e279,_0x4f7bfd=this['resolveProjectDir'](_0x8a2a78,_0x538de4),_0x2467a0=_0x538de4[_0x417029(0x271)],_0x4af9d7=_0x538de4[_0x417029(0x251)];_0x538de4['verbose']&&(_0x4f7bfd&&console[_0x417029(0x2ae)](_0x417029(0x2a5)+_0x4f7bfd),_0x2467a0&&console[_0x417029(0x2ae)](_0x417029(0x20c)+_0x2467a0),_0x538de4[_0x417029(0x21f)]&&console['error'](_0x417029(0x329)),_0x4af9d7&&console[_0x417029(0x2ae)](_0x417029(0x2e8)));let _0xbb5d5c;try{_0xbb5d5c=await withSpinner(_0x417029(0x37c),()=>_0x307cc4['workflow']['preparePushProject']({'sourceDir':_0x4f7bfd,'revision':_0x2467a0,'skipValidation':_0x4af9d7}),{'verbose':_0x538de4[_0x417029(0x31f)]});}catch(_0x24f935){if(_0x24f935 instanceof Error&&_0x24f935[_0x417029(0x266)][_0x417029(0x2c6)](_0x417029(0x208)))return console['error'](a54_0x13943d[_0x417029(0x1fc)](_0x417029(0x33f)),_0x417029(0x278)),_0x538de4[_0x417029(0x2fb)]?console[_0x417029(0x2ae)](a54_0x13943d[_0x417029(0x31c)](_0x417029(0x2a4)+_0x538de4[_0x417029(0x2fb)]+_0x417029(0x247)+_0x538de4[_0x417029(0x2fb)]+'\x27')):console[_0x417029(0x2ae)](a54_0x13943d['dim'](_0x417029(0x210))),0x1;throw _0x24f935;}const _0x26df14=_0xbb5d5c[_0x417029(0x2c0)];console[_0x417029(0x2ae)](_0x417029(0x35a)+_0x26df14['projectName']),console[_0x417029(0x2ae)]('\x20\x20Source:\x20'+_0x26df14[_0x417029(0x1f2)]),console[_0x417029(0x2ae)]('\x20\x20Revision:\x20'+_0x26df14[_0x417029(0x271)]),console['error'](_0x417029(0x2e3)+a54_0x13943d['green']('+'+_0x26df14[_0x417029(0x301)]['new']+'\x20new')+',\x20'+(a54_0x13943d[_0x417029(0x2f5)]('~'+_0x26df14[_0x417029(0x301)][_0x417029(0x1cb)]+_0x417029(0x378))+',\x20')+(a54_0x13943d[_0x417029(0x1fc)]('-'+_0x26df14[_0x417029(0x301)][_0x417029(0x1e1)]+_0x417029(0x29a))+',\x20')+(''+a54_0x13943d[_0x417029(0x31c)](_0x26df14[_0x417029(0x301)]['unchanged']+_0x417029(0x1d0))));for(const _0x26c166 of _0x26df14['changes']){_0x26c166[_0x417029(0x275)]==='modified'&&_0x26c166[_0x417029(0x27b)]&&(console[_0x417029(0x2ae)]('\x0a'+a54_0x13943d['cyan'](_0x417029(0x2d7)+_0x26c166[_0x417029(0x26e)])),console[_0x417029(0x2ae)](_0x26c166['diff']));}if(!_0x26df14[_0x417029(0x25c)])return console['error'](a54_0x13943d[_0x417029(0x211)](_0x417029(0x249))),await this[_0x417029(0x388)](_0x307cc4,_0x26df14[_0x417029(0x282)],_0x538de4[_0x417029(0x1e2)]),0x0;if(_0x538de4[_0x417029(0x21f)])return console[_0x417029(0x2ae)](a54_0x13943d[_0x417029(0x2f5)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x538de4[_0x417029(0x340)]){if(!isInteractive())return console['error'](a54_0x13943d[_0x417029(0x1fc)]('\x0aError:'),_0x417029(0x2e4)),console[_0x417029(0x2ae)](a54_0x13943d[_0x417029(0x31c)](_0x417029(0x25d))),0x1;const _0x5a9b28=await confirmKey(_0x417029(0x21d));if(!_0x5a9b28)return console[_0x417029(0x2ae)](a54_0x13943d[_0x417029(0x2f5)](_0x417029(0x22c)),_0x417029(0x36d)),0x1;}const _0x36fbb6=await withSpinner(_0x417029(0x262),()=>_0x307cc4['workflow'][_0x417029(0x2b0)](_0x26df14),{'verbose':_0x538de4[_0x417029(0x31f)]}),_0x1e7828=_0x36fbb6[_0x417029(0x2c0)];return console['error'](a54_0x13943d[_0x417029(0x211)](_0x417029(0x292))),console['error'](_0x417029(0x2db)+_0x1e7828[_0x417029(0x360)]),console[_0x417029(0x2ae)](_0x417029(0x1f0)+_0x1e7828[_0x417029(0x271)]),await this[_0x417029(0x388)](_0x307cc4,_0x1e7828[_0x417029(0x282)],_0x538de4[_0x417029(0x1e2)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a54_0x2a0943(0x2f6);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x323);async[a54_0x2a0943(0x295)](_0x361acd){const _0x1cd8de=a54_0x2a0943,{options:_0x5ed3e8,args:_0x3df2d8,tdx:_0x31c5e5}=_0x361acd,_0x50dccf=this['resolveProjectDir'](_0x3df2d8,_0x5ed3e8),_0x29dafb=_0x5ed3e8[_0x1cd8de(0x1c3)],_0xab1196=_0x5ed3e8[_0x1cd8de(0x271)],_0x5509ac=_0x5ed3e8[_0x1cd8de(0x251)];if(!_0x50dccf)return console[_0x1cd8de(0x2ae)](a54_0x13943d[_0x1cd8de(0x1fc)]('Error:'),_0x1cd8de(0x385)),console[_0x1cd8de(0x2ae)](a54_0x13943d['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x1cd8de(0x2ae)](a54_0x13943d['dim'](_0x1cd8de(0x280))),0x1;if(!_0x29dafb)return console[_0x1cd8de(0x2ae)](a54_0x13943d[_0x1cd8de(0x1fc)](_0x1cd8de(0x33f)),_0x1cd8de(0x290)),console[_0x1cd8de(0x2ae)](a54_0x13943d['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x5ed3e8['verbose']&&(console['error'](_0x1cd8de(0x2a5)+_0x50dccf),console[_0x1cd8de(0x2ae)]('New\x20project\x20name:\x20'+_0x29dafb),_0xab1196&&console[_0x1cd8de(0x2ae)](_0x1cd8de(0x20c)+_0xab1196),_0x5ed3e8['dryRun']&&console[_0x1cd8de(0x2ae)](_0x1cd8de(0x329)),_0x5509ac&&console[_0x1cd8de(0x2ae)](_0x1cd8de(0x2e8)));const _0x3cffbf=await withSpinner(_0x1cd8de(0x2b3),()=>_0x31c5e5[_0x1cd8de(0x2f9)][_0x1cd8de(0x319)](_0x50dccf,_0x29dafb,{'revision':_0xab1196,'skipValidation':_0x5509ac}),{'verbose':_0x5ed3e8['verbose']}),_0x79d7cc=_0x3cffbf[_0x1cd8de(0x2c0)];console[_0x1cd8de(0x2ae)](_0x1cd8de(0x335)+_0x79d7cc['sourceDir']);_0x79d7cc[_0x1cd8de(0x2c7)]&&console[_0x1cd8de(0x2ae)]('Source\x20project:\x20'+_0x79d7cc[_0x1cd8de(0x2c7)]);console[_0x1cd8de(0x2ae)](_0x1cd8de(0x307)+_0x79d7cc[_0x1cd8de(0x1e7)]),console['error'](_0x1cd8de(0x20c)+_0x79d7cc[_0x1cd8de(0x271)]),console[_0x1cd8de(0x2ae)](_0x1cd8de(0x1e8)+_0x79d7cc[_0x1cd8de(0x24e)]);_0x79d7cc[_0x1cd8de(0x34b)]&&(console['error'](a54_0x13943d[_0x1cd8de(0x2f5)](_0x1cd8de(0x2a2)+_0x79d7cc[_0x1cd8de(0x1e7)]+_0x1cd8de(0x317)+_0x79d7cc[_0x1cd8de(0x202)]+')')),console[_0x1cd8de(0x2ae)](a54_0x13943d[_0x1cd8de(0x2f5)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x5ed3e8[_0x1cd8de(0x21f)])return console[_0x1cd8de(0x2ae)](a54_0x13943d[_0x1cd8de(0x2f5)](_0x1cd8de(0x1bc))),0x0;if(!_0x5ed3e8[_0x1cd8de(0x340)]){if(!isInteractive())return console['error'](a54_0x13943d['red'](_0x1cd8de(0x252)),_0x1cd8de(0x2e4)),console[_0x1cd8de(0x2ae)](a54_0x13943d[_0x1cd8de(0x31c)](_0x1cd8de(0x25d))),0x1;const _0x417e40=_0x79d7cc[_0x1cd8de(0x2c7)]||a54_0x4c5432[_0x1cd8de(0x32d)](_0x50dccf),_0x26769f=_0x79d7cc[_0x1cd8de(0x34b)]?_0x1cd8de(0x35f)+_0x29dafb+_0x1cd8de(0x2fa):_0x1cd8de(0x289)+_0x417e40+_0x1cd8de(0x2f2)+_0x29dafb+'\x22?',_0x527df8=await confirmKey(_0x26769f);if(!_0x527df8)return console[_0x1cd8de(0x2ae)](a54_0x13943d['yellow'](_0x1cd8de(0x22c))),0x1;}const _0x48cfe9=await withSpinner(_0x79d7cc['targetExists']?_0x1cd8de(0x205)+_0x29dafb+_0x1cd8de(0x320):_0x1cd8de(0x23e)+_0x29dafb+_0x1cd8de(0x320),()=>_0x31c5e5[_0x1cd8de(0x2f9)]['executeCloneProject'](_0x79d7cc),{'verbose':_0x5ed3e8[_0x1cd8de(0x31f)]}),_0x34b1f6=_0x48cfe9['data'];return console[_0x1cd8de(0x2ae)](a54_0x13943d[_0x1cd8de(0x211)](_0x79d7cc['targetExists']?_0x1cd8de(0x35d):'✔\x20Clone\x20complete')),console['error'](_0x1cd8de(0x33b)+_0x34b1f6['newProjectName']),console[_0x1cd8de(0x2ae)](_0x1cd8de(0x2db)+_0x34b1f6[_0x1cd8de(0x37f)]),console['error'](_0x1cd8de(0x1f0)+_0x34b1f6['revision']),await this['showWorkflowConsoleUrl'](_0x31c5e5,_0x34b1f6['newProjectName'],_0x5ed3e8['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x267);['description']=a54_0x2a0943(0x201);async['execute'](_0x87e2e6){const _0x2c4b1b=a54_0x2a0943,{options:_0x4aad55,args:_0x392a2d,tdx:_0x5b2b5a}=_0x87e2e6,_0x263a8d=_0x392a2d[0x0];if(!_0x263a8d)return console[_0x2c4b1b(0x2ae)](_0x2c4b1b(0x26d)),console['error']('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x4aad55[_0x2c4b1b(0x31f)]&&console[_0x2c4b1b(0x2ae)](_0x2c4b1b(0x30e)+_0x263a8d);if(!_0x4aad55['yes']){if(!isInteractive())return console['error'](a54_0x13943d[_0x2c4b1b(0x1fc)](_0x2c4b1b(0x252)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2c4b1b(0x2ae)](a54_0x13943d[_0x2c4b1b(0x31c)](_0x2c4b1b(0x25d))),0x1;const _0x52dbc4=await confirmKey(_0x2c4b1b(0x25e)+_0x263a8d+_0x2c4b1b(0x2a3));if(!_0x52dbc4)return console[_0x2c4b1b(0x2ae)](a54_0x13943d[_0x2c4b1b(0x2f5)](_0x2c4b1b(0x22c))),0x1;}const _0x486ead=await withSpinner(_0x2c4b1b(0x1df)+_0x263a8d+_0x2c4b1b(0x320),()=>_0x5b2b5a[_0x2c4b1b(0x2f9)]['delete'](_0x263a8d),{'verbose':_0x4aad55[_0x2c4b1b(0x31f)]}),_0x5ec44c=_0x486ead[_0x2c4b1b(0x2c0)];return console['error'](_0x2c4b1b(0x30b)+_0x5ec44c[_0x2c4b1b(0x282)]),console[_0x2c4b1b(0x2ae)](_0x2c4b1b(0x2db)+_0x5ec44c[_0x2c4b1b(0x360)]),0x0;}}export function parseKeyValue(_0x188d85){const _0x53e662=a54_0x2a0943,_0x3f29c3=_0x188d85[_0x53e662(0x2dc)]('=');if(_0x3f29c3===-0x1)throw new Error(_0x53e662(0x309)+_0x188d85+_0x53e662(0x36f));const _0x1eff98=_0x188d85[_0x53e662(0x259)](0x0,_0x3f29c3),_0x25fd0f=_0x188d85[_0x53e662(0x259)](_0x3f29c3+0x1);if(!_0x1eff98)throw new Error(_0x53e662(0x2ff));return{'key':_0x1eff98,'value':_0x25fd0f};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x373);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x287);async[a54_0x2a0943(0x295)](_0x4bd9ca){const _0x8379d4=a54_0x2a0943,{options:_0xd55625,args:_0x2a5171,tdx:_0x1f91d4}=_0x4bd9ca,_0x159300=this[_0x8379d4(0x240)](_0x2a5171,_0xd55625);if(!_0x159300)return 0x1;_0xd55625[_0x8379d4(0x31f)]&&console['error']('Project:\x20'+_0x159300);const _0x45a4ce=await withSpinner(_0x8379d4(0x1cf),()=>_0x1f91d4[_0x8379d4(0x2f9)]['listSecrets'](_0x159300),{'verbose':_0xd55625['verbose']}),{secrets:_0x35c5ba}=_0x45a4ce[_0x8379d4(0x2c0)];return console[_0x8379d4(0x2ae)](_0x8379d4(0x37e)+_0x35c5ba[_0x8379d4(0x2c2)]+'\x20secret'+(_0x35c5ba[_0x8379d4(0x2c2)]!==0x1?'s':'')),await handleSDKOutput(_0x35c5ba,_0xd55625),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a54_0x2a0943(0x31a);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x2ee);async[a54_0x2a0943(0x295)](_0x43399f){const _0x4aadcd=a54_0x2a0943,{options:_0x26314b,args:_0x3f9b52,tdx:_0x3e777d}=_0x43399f;let _0x4723ef,_0x44cac3;if(_0x3f9b52[_0x4aadcd(0x2c2)]>=0x1&&!_0x3f9b52[0x0][_0x4aadcd(0x2c6)]('='))_0x4723ef=_0x3f9b52[0x0],_0x44cac3=_0x3f9b52['slice'](0x1);else{if(_0x3f9b52['length']>=0x1&&_0x26314b['workflowProject'])_0x4723ef=_0x26314b[_0x4aadcd(0x2fb)],_0x44cac3=_0x3f9b52;else return _0x3f9b52[_0x4aadcd(0x2c2)]>=0x1?(console[_0x4aadcd(0x2ae)](_0x4aadcd(0x21c)),console[_0x4aadcd(0x2ae)](_0x4aadcd(0x362)),0x1):(console['error'](_0x4aadcd(0x32b)),console[_0x4aadcd(0x2ae)](_0x4aadcd(0x32c)),0x1);}if(_0x44cac3['length']===0x0)return console[_0x4aadcd(0x2ae)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x4aadcd(0x2ae)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1;const _0x5e803e={};try{for(const _0x3a6cc7 of _0x44cac3){const {key:_0x2968c8,value:_0x34e61d}=parseKeyValue(_0x3a6cc7);_0x5e803e[_0x2968c8]=_0x34e61d;}}catch(_0x20cecc){return _0x20cecc instanceof Error&&console['error'](a54_0x13943d[_0x4aadcd(0x1fc)](_0x4aadcd(0x33f)),_0x20cecc[_0x4aadcd(0x266)]),0x1;}const _0x4d851e=Object[_0x4aadcd(0x1c9)](_0x5e803e);_0x26314b[_0x4aadcd(0x31f)]&&(console[_0x4aadcd(0x2ae)]('Project:\x20'+_0x4723ef),console[_0x4aadcd(0x2ae)]('Secrets\x20to\x20set:\x20'+_0x4d851e[_0x4aadcd(0x219)](',\x20')));const _0x33845e=await withSpinner(_0x4d851e[_0x4aadcd(0x2c2)]===0x1?_0x4aadcd(0x28e):_0x4aadcd(0x1e6)+_0x4d851e[_0x4aadcd(0x2c2)]+_0x4aadcd(0x332),()=>_0x3e777d['workflow'][_0x4aadcd(0x242)](_0x4723ef,_0x5e803e),{'verbose':_0x26314b[_0x4aadcd(0x31f)]}),_0x282326=_0x33845e[_0x4aadcd(0x2c0)];return console[_0x4aadcd(0x2ae)](_0x4d851e['length']===0x1?'✔\x20Secret\x20\x27'+_0x282326[_0x4aadcd(0x1c9)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x282326[_0x4aadcd(0x282)]+'\x27':'✔\x20'+_0x282326[_0x4aadcd(0x1c9)][_0x4aadcd(0x2c2)]+_0x4aadcd(0x1eb)+_0x282326[_0x4aadcd(0x282)]+'\x27'),(_0x26314b['json']||_0x26314b[_0x4aadcd(0x291)])&&await handleSingleObjectOutput(_0x282326,_0x26314b),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x274);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x33c);async[a54_0x2a0943(0x295)](_0x4f1eaf){const _0x45b39b=a54_0x2a0943,{options:_0xb4501,args:_0x593655,tdx:_0x31cce8}=_0x4f1eaf;let _0xdfc62b,_0x1f550f;if(_0x593655[_0x45b39b(0x2c2)]>=0x2)_0xdfc62b=_0x593655[0x0],_0x1f550f=_0x593655[0x1];else{if(_0x593655[_0x45b39b(0x2c2)]===0x1&&_0xb4501[_0x45b39b(0x2fb)])_0xdfc62b=_0xb4501['workflowProject'],_0x1f550f=_0x593655[0x0];else return _0x593655['length']===0x1?(console[_0x45b39b(0x2ae)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x45b39b(0x2ae)](_0x45b39b(0x362)),0x1):(console[_0x45b39b(0x2ae)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0x45b39b(0x2ae)](_0x45b39b(0x288)),0x1);}_0xb4501['verbose']&&(console['error'](_0x45b39b(0x30e)+_0xdfc62b),console['error']('Key:\x20'+_0x1f550f));if(!_0xb4501[_0x45b39b(0x340)]){if(!isInteractive())return console[_0x45b39b(0x2ae)](a54_0x13943d[_0x45b39b(0x1fc)](_0x45b39b(0x252)),_0x45b39b(0x2e4)),console['error'](a54_0x13943d[_0x45b39b(0x31c)](_0x45b39b(0x25d))),0x1;const _0xe74587=await confirmKey(_0x45b39b(0x2d9)+_0x1f550f+_0x45b39b(0x32f)+_0xdfc62b+'\x27?');if(!_0xe74587)return console[_0x45b39b(0x2ae)](a54_0x13943d[_0x45b39b(0x2f5)](_0x45b39b(0x22c))),0x1;}const _0x50f93c=await withSpinner('Deleting\x20secret...',()=>_0x31cce8[_0x45b39b(0x2f9)][_0x45b39b(0x33e)](_0xdfc62b,_0x1f550f),{'verbose':_0xb4501[_0x45b39b(0x31f)]}),_0x2a4d09=_0x50f93c[_0x45b39b(0x2c0)];return console[_0x45b39b(0x2ae)](_0x45b39b(0x304)+_0x2a4d09[_0x45b39b(0x1d2)]+_0x45b39b(0x20e)+_0x2a4d09[_0x45b39b(0x282)]+'\x27'),(_0xb4501[_0x45b39b(0x200)]||_0xb4501['jsonl'])&&await handleSingleObjectOutput(_0x2a4d09,_0xb4501),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(_0xd7b3a){const _0x1e4820=a54_0x2a0943,_0x1e1ba5=Math[_0x1e4820(0x2bc)](_0xd7b3a/0x3e8),_0x32b4a3=Math[_0x1e4820(0x2bc)](_0x1e1ba5/0x3c),_0xf07283=Math[_0x1e4820(0x2bc)](_0x32b4a3/0x3c),_0x197587=Math[_0x1e4820(0x2bc)](_0xf07283/0x18);if(_0x197587>0x0){const _0xbf2b49=_0xf07283%0x18;return _0xbf2b49>0x0?_0x197587+'d\x20'+_0xbf2b49+'h':_0x197587+'d';}else{if(_0xf07283>0x0){const _0x4d84ac=_0x32b4a3%0x3c;return _0x4d84ac>0x0?_0xf07283+'h\x20'+_0x4d84ac+'m':_0xf07283+'h';}else{if(_0x32b4a3>0x0){const _0x493e57=_0x1e1ba5%0x3c;return _0x493e57>0x0?_0x32b4a3+'m\x20'+_0x493e57+'s':_0x32b4a3+'m';}else return _0x1e1ba5+'s';}}}function formatTimestamp(_0x2e32f4,_0x4a3a2f){const _0x37b67e=a54_0x2a0943,_0x23dc13=new Date(_0x2e32f4),_0x522812=String(_0x23dc13[_0x37b67e(0x37a)]())[_0x37b67e(0x299)](0x2,'0'),_0x3943ec=String(_0x23dc13[_0x37b67e(0x27d)]())[_0x37b67e(0x299)](0x2,'0'),_0x5b244f=_0x522812+':'+_0x3943ec,_0x56344e=_0x23dc13['getFullYear']()===_0x4a3a2f['getFullYear']()&&_0x23dc13[_0x37b67e(0x30f)]()===_0x4a3a2f[_0x37b67e(0x30f)]()&&_0x23dc13[_0x37b67e(0x30d)]()===_0x4a3a2f['getDate']();if(_0x56344e)return _0x5b244f;else{const _0x8321e4=String(_0x23dc13[_0x37b67e(0x30f)]()+0x1)[_0x37b67e(0x299)](0x2,'0'),_0x35cbd2=String(_0x23dc13[_0x37b67e(0x30d)]())[_0x37b67e(0x299)](0x2,'0');return _0x8321e4+'-'+_0x35cbd2+'\x20'+_0x5b244f;}}function formatDate(_0x3b1e30){const _0x3b9c46=a54_0x2a0943,_0x33d973=_0x3b1e30[_0x3b9c46(0x1f4)](),_0x40c1de=String(_0x3b1e30[_0x3b9c46(0x30f)]()+0x1)[_0x3b9c46(0x299)](0x2,'0'),_0x29490f=String(_0x3b1e30[_0x3b9c46(0x30d)]())[_0x3b9c46(0x299)](0x2,'0');return _0x33d973+'-'+_0x40c1de+'-'+_0x29490f;}function a54_0x5ebb(_0x5da824,_0x212514){_0x5da824=_0x5da824-0x1b9;const _0x2768a6=a54_0x2768();let _0x5ebbc7=_0x2768a6[_0x5da824];return _0x5ebbc7;}function getTaskStateIcon(_0x15811b){const _0x7c925={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x7c925[_0x15811b]||'⚪';}function getBarChar(_0x386d2c){const _0xc9f643=a54_0x2a0943;return _0x386d2c===_0xc9f643(0x2ae)||_0x386d2c===_0xc9f643(0x1f9)?'×':'─';}function getBarColor(_0xf491c4){const _0x3f58a7=a54_0x2a0943,_0x47cc1a={'success':a54_0x13943d[_0x3f58a7(0x211)],'error':a54_0x13943d[_0x3f58a7(0x1fc)],'group_error':a54_0x13943d[_0x3f58a7(0x1fc)],'running':a54_0x13943d[_0x3f58a7(0x258)],'blocked':a54_0x13943d[_0x3f58a7(0x2f5)],'planned':a54_0x13943d['dim'],'canceling':a54_0x13943d[_0x3f58a7(0x2f5)]};return _0x47cc1a[_0xf491c4]||a54_0x13943d[_0x3f58a7(0x305)];}function parseTaskName(_0x3a2452){const _0x3b3eeb=a54_0x2a0943;let _0x5e057e=_0x3a2452[_0x3b3eeb(0x23f)](/^\++/,'');const _0x374383=_0x5e057e[_0x3b3eeb(0x2ca)]('+'),_0x10bbd3=_0x374383[_0x3b3eeb(0x2c2)]>0x1?_0x374383[_0x3b3eeb(0x2c2)]-0x2:0x0,_0x3bbf89=_0x374383[_0x374383[_0x3b3eeb(0x2c2)]-0x1]||_0x5e057e;return{'level':_0x10bbd3,'name':'+'+_0x3bbf89};}function truncateTaskName(_0x2f410c,_0x2c9748){const _0x342749=a54_0x2a0943,_0x3c2e41=stringWidth(_0x2f410c);if(_0x3c2e41<=_0x2c9748)return _0x2f410c;let _0x5e21f7=_0x2f410c;while(stringWidth(_0x5e21f7+'…')>_0x2c9748&&_0x5e21f7[_0x342749(0x2c2)]>0x0){_0x5e21f7=_0x5e21f7['slice'](0x0,-0x1);}return _0x5e21f7+'…';}function calculateTimeScale(_0x244b8c,_0x4e62d6){const _0x5a895b=a54_0x2a0943;return{'startTime':_0x244b8c['start'],'endTime':_0x244b8c[_0x5a895b(0x313)],'durationMs':_0x244b8c[_0x5a895b(0x298)],'msPerChar':_0x244b8c['duration']/_0x4e62d6};}function timeToPosition(_0x40bc4e,_0x3006fb,_0x5c9ab2){const _0x15e3f8=a54_0x2a0943,_0x4de0bc=_0x40bc4e-_0x3006fb[_0x15e3f8(0x2c3)],_0x37cd8c=Math[_0x15e3f8(0x2bc)](_0x4de0bc/_0x3006fb[_0x15e3f8(0x33d)]);return Math[_0x15e3f8(0x26c)](0x0,Math[_0x15e3f8(0x294)](_0x37cd8c,_0x5c9ab2));}function renderTimeAxis(_0x3c9608,_0x2d4ea2){const _0x435f96=a54_0x2a0943,_0x39bede=Math[_0x435f96(0x294)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x435f96(0x26c)](TIMELINE_CONFIG[_0x435f96(0x355)],Math[_0x435f96(0x2bc)](_0x2d4ea2/TIMELINE_CONFIG[_0x435f96(0x374)]))),_0x1932a6=_0x3c9608['durationMs']/(_0x39bede-0x1),_0x1bd023=new Date(_0x3c9608[_0x435f96(0x2c3)]),_0x56380f=[];for(let _0x4bd5c5=0x0;_0x4bd5c5<_0x39bede;_0x4bd5c5++){const _0x5b0289=_0x3c9608[_0x435f96(0x2c3)]+_0x4bd5c5*_0x1932a6,_0x35c2d2=timeToPosition(_0x5b0289,_0x3c9608,_0x2d4ea2),_0x458279=formatTimestamp(_0x5b0289,_0x1bd023);_0x56380f[_0x435f96(0x377)]({'pos':_0x35c2d2,'text':_0x458279});}const _0x14d98f=new Array(_0x2d4ea2)['fill']('\x20');let _0x56a80a=-0x1;for(const {pos:_0x211e87,text:_0x2e07ee}of _0x56380f){let _0x635068=Math['max'](0x0,_0x211e87-Math[_0x435f96(0x2bc)](_0x2e07ee[_0x435f96(0x2c2)]/0x2));_0x635068<=_0x56a80a+TIMELINE_CONFIG[_0x435f96(0x2c4)]&&(_0x635068=_0x56a80a+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x635068+_0x2e07ee[_0x435f96(0x2c2)]>_0x2d4ea2&&(_0x635068=_0x2d4ea2-_0x2e07ee[_0x435f96(0x2c2)]);if(_0x635068>=0x0&&_0x635068+_0x2e07ee[_0x435f96(0x2c2)]<=_0x2d4ea2&&_0x635068>_0x56a80a){for(let _0x21aba5=0x0;_0x21aba5<_0x2e07ee[_0x435f96(0x2c2)];_0x21aba5++){_0x14d98f[_0x635068+_0x21aba5]=_0x2e07ee[_0x21aba5];}_0x56a80a=_0x635068+_0x2e07ee[_0x435f96(0x2c2)]-0x1;}}return _0x14d98f[_0x435f96(0x219)]('');}function renderTaskRow(_0x5b9ae4,_0x95d3ac,_0x42bbd7,_0x569f94){const _0x2c46e2=a54_0x2a0943,{level:_0x2f8397,name:_0x28386b}=parseTaskName(_0x5b9ae4[_0x2c46e2(0x1c3)]),_0x5db911='\x20'[_0x2c46e2(0x297)](_0x2f8397),_0x750038=_0x5b9ae4['window']?'('+formatElapsed(_0x5b9ae4[_0x2c46e2(0x261)][_0x2c46e2(0x298)])+')':'',_0x40a193=stringWidth(_0x750038),_0x2c7b21=_0x2f8397*0x1,_0xd7906e=_0x569f94-_0x2c7b21-_0x40a193-0x1,_0x555026=truncateTaskName(_0x28386b,_0xd7906e),_0x3bbc29=_0x5db911+_0x555026,_0x443199=stringWidth(_0x3bbc29),_0x221de1=_0x569f94-_0x443199-_0x40a193,_0x535caa=_0x3bbc29+'\x20'[_0x2c46e2(0x297)](Math[_0x2c46e2(0x26c)](0x1,_0x221de1))+a54_0x13943d[_0x2c46e2(0x31c)](_0x750038),_0x4a7545=getTaskStateIcon(_0x5b9ae4['state']),_0x4982c5=new Array(_0x42bbd7)[_0x2c46e2(0x26a)]('\x20');if(_0x5b9ae4[_0x2c46e2(0x261)]){const _0x1b3d2d=timeToPosition(_0x5b9ae4[_0x2c46e2(0x261)][_0x2c46e2(0x273)],_0x95d3ac,_0x42bbd7),_0x51d019=timeToPosition(_0x5b9ae4[_0x2c46e2(0x261)]['end'],_0x95d3ac,_0x42bbd7),_0x3de04f=getBarChar(_0x5b9ae4['state']),_0x5a964b=Math[_0x2c46e2(0x26c)](_0x1b3d2d+0x1,_0x51d019);for(let _0x1bcdc8=_0x1b3d2d;_0x1bcdc8<Math['min'](_0x5a964b,_0x42bbd7);_0x1bcdc8++){_0x4982c5[_0x1bcdc8]=_0x3de04f;}}const _0x853598=getBarColor(_0x5b9ae4[_0x2c46e2(0x233)]),_0x6c7287=_0x4982c5['map'](_0x2e684e=>_0x2e684e==='\x20'?'\x20':_0x853598(_0x2e684e))['join']('');return _0x4a7545+'\x20'+_0x535caa+'│'+_0x6c7287+'│';}function a54_0x2768(){const _0x1524af=['getFullYear','kill','1248TaKfvg','MAX_TIMELINE_WIDTH','session_id','group_error','relative','value','red','rows','sessionId','attempt','json','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','existingProjectId','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','success','Updating\x20','\x0aApply\x20these\x20changes?','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','No\x20workflow\x20tdx.json\x20found','includeSubtasks','done','attemptId','Revision:\x20','Session\x20time:\x20','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','→\x20Project:\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','green','\x20attempt','clear','autocomplete','renderTimeline','📅\x20#','all','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','join','context','\x20\x20Location:\x20','Error:\x20Project\x20name\x20is\x20required','\x0aPush\x20these\x20changes?','param','dryRun','resumeFrom','pending','Disable\x20a\x20workflow\x20schedule','resolve','download','updatedAt','listSchedules','renderSessionsTimeline','parseProjectWorkflowPattern','session',',\x20Workflow:\x20','Starting\x20workflow\x20run...','Cancelled','ICON_SPACING','now','session:','\x20to\x20see\x20detailed\x20logs','Error:\x20Attempt\x20ID\x20is\x20required','No\x20workflows\x20found\x20in\x20project:\x20','state','No\x20sessions\x20found\x20for:\x20','ICON_WIDTH','Select\x20a\x20task\x20to\x20view\x20logs:','→\x20New\x20project:\x20','\x20(disabled)','cwd','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','Project\x20filter:\x20','\x20\x20Next\x20run:\x20','workflow:tasks','Cloning\x20to\x20','replace','requireProject','attempt:','setSecrets','No\x20workflow\x20projects\x20found','sys','renderSingleTimeline','\x20disabled\x20(','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Session\x20not\x20found:\x20','\x0a✔\x20No\x20changes\x20to\x20push','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Error:\x20Invalid\x20JSON\x20in\x20--params','Project\x20name\x20is\x20required','Kill\x20a\x20running\x20attempt','fileCount','Filter:\x20','\x20\x20Files\x20extracted:\x20','skipValidation','\x0aError:','params','reason','Retry\x20a\x20session\x20or\x20attempt','\x20\x20Session\x20ID:\x20','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','blue','substring','✔\x20Pushed\x20','Retrying\x20session...','hasChanges','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','3657380tVpBQz','resolveProjectId','window','Pushing\x20project...','unknown','\x20\x20tdx\x20wf\x20use\x20<project>','No\x20projects\x20match\x20pattern:\x20','message','workflow:delete','Select\x20a\x20session\x20to\x20view\x20timeline:','\x20enabled\x20(','fill','revision:\x20','max','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','path','Schedule\x20ID\x20is\x20required','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','revision','Pulling\x20project\x20','start','workflow:secrets:delete','type','\x20is\x20not\x20a\x20directory','round','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Workflow:\x20','diff','canceling','getMinutes','task','Error:\x20Invalid\x20parameter\x20format:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','retryAttempt','projectName','Show\x20logs\x20for\x20a\x20workflow\x20attempt','\x20session','map','logFiles','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','\x0aClone\x20\x22','No\x20attempts\x20found\x20for:\x20','run','Project\x20directory:\x20','979866RJuRzs','Setting\x20secret...','⚠\x20Showing\x20first\x20','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','jsonl','✔\x20Push\x20complete','No\x20workflows\x20found','min','execute','sessions','repeat','duration','padStart','\x20deleted','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','getTime','\x20sessions\x20','✔\x20Workflow\x20run\x20started','disabledAt','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Failed\x20to\x20fetch\x20attempt\x20data','\x0a⚠\x20Project\x20\x22','\x22?\x20This\x20cannot\x20be\x20undone.','Tip:\x20cd\x20to\x20workflows/','Source\x20directory:\x20','Listing\x20schedules...','set','workflow:sessions','cancelRequested','isTTY','enableSchedule','Resolving\x20project\x20\x27','Start\x20a\x20workflow\x20run','error','isDirectory','executePushProject','🔄\x20','\x1b[1A\x1b[2K','Analyzing\x20project...','\x20next:\x20','workflow:attempts','13116hHoiJL','\x20\x20Attempt\x20ID:\x20','Listing\x20workflows...','displayLine','sort','List\x20workflows','floor','Reason:\x20','workflow:download','index','data','List\x20workflow\x20schedules','length','startTime','LABEL_MIN_SPACING','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','includes','sourceProjectName','workflow:pull','trim','split','Error:\x20','\x20\x20Target:\x20','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','1476568kTRZIo','Listing\x20workflow\x20sessions...','/attempt/','\x20\x20New\x20attempt\x20ID:\x20','tasks','projects','match','Filter:\x20project=','filesExtracted','---\x20','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x0aPolling...\x20(','\x20\x20Project\x20ID:\x20','indexOf','Loading\x20session...','\x20of\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','finishedAt','changes','readFile','\x20\x20Changes:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20(use\x20--limit\x20to\x20show\x20more)','pollTimeline','Include\x20retried:\x20yes','Validation:\x20skipped','MIN_TIMELINE_WIDTH','running','-\x20no\x20files\x20written','status','filter','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','some','✔\x20Showing\x20','\x22\x20to\x20new\x20project\x20\x22','Getting\x20attempt\x20details...','90pWCMxM','yellow','workflow:clone','Auto-selected\x20latest\x20session:\x20','workflow:push','workflow','\x22\x20with\x20new\x20revision?','workflowProject','stdout','\x20\x20Console:\x20','Pull\x20workflow\x20project\x20to\x20local\x20folder','Key\x20cannot\x20be\x20empty','✔\x20Schedule\x20#','summary','468286ZVRJYk','Force:\x20yes','✔\x20Secret\x20\x27','white','✔\x20Retry\x20started','New\x20project\x20name:\x20','Task\x20name:\x20','Invalid\x20format:\x20','\x20new','✔\x20Deleted\x20project\x20','Fetching\x20log\x20files...','getDate','Project:\x20','getMonth','Attempt\x20ID:\x20','table','Latest\x20session\x20has\x20no\x20attempt','end','follow','workflowName','\x20workflow','\x22\x20already\x20exists\x20(ID:\x20','text','prepareCloneProject','workflow:secrets:set','✔\x20Workflow\x20project\x20context\x20cleared.','dim','workflow:schedules','log','verbose','...','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','No\x20workflow\x20sessions\x20found','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','1929UjJnrx','\x20(system)','buildTimelineData','stringify','force','Dry\x20run:\x20yes','✔\x20Downloaded\x20','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','basename','Disabling\x20schedule\x20#','\x27\x20from\x20project\x20\x27','project','find','\x20secrets...','workflow:run','No\x20sessions\x20found','Source:\x20','select','description','\x20has\x20no\x20attempts','Session\x20','/app/workflows/','\x20\x20Project:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','msPerChar','deleteSecret','Error:','yes','Loading\x20workflows...','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','taskName','325754OajneB','Project\x20name:\x20','Status:\x20','MAX_TASKS_DISPLAY','\x20-\x20','1aEWiBp','columns','targetExists','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','limit','createdAt','values','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','localeCompare','format','✔\x20Pull\x20complete','list','MIN_LABEL_COUNT','Attempt:\x20','workflow:upload','retryAttemptName','Including\x20subtasks:\x20yes','✔\x20Project:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','From\x20task:\x20','✔\x20Project\x20updated','\x20\x20Workflow:\x20','\x0aUpdate\x20existing\x20project\x20\x22','projectId','planned','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','lastAttempt','(use\x20--limit\x20to\x20see\x20more)','from','workflow:projects','Enable\x20a\x20workflow\x20schedule','No\x20attempts\x20found','fileSize','sessionTime','workflow:schedule:disable','navigateSessionsInteractive','-\x20nothing\x20pushed','Output\x20directory:\x20','.\x20Expected\x20format:\x20KEY=VALUE','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Getting\x20attempt\x20tasks...','No\x20sessions\x20found\x20in\x20project:\x20','workflow:secrets:list','LABEL_WIDTH_DIVISOR','List\x20workflow\x20execution\x20sessions','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','push','\x20modified','metadata','getHours','List\x20all\x20workflow\x20projects','Analyzing\x20changes...','startsWith','✔\x20Found\x20','newProjectId','\x20\x20Session\x20context\x20set\x20to:\x20','📋\x20','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','has','new','Source\x20directory\x20is\x20required','workflow:kill','Listing\x20workflow\x20projects...','showWorkflowConsoleUrl','generateSessionTimelineRows','cyan','applyPullProject','tdx\x20wf\x20attempt\x20','output','\x0aDry\x20run\x20-\x20no\x20project\x20created','parse','\x20from\x20session\x20','get','workflow:use','workflow:timeline','workflow:attempt','name','workflow:logs','Downloading\x20logs...','POLL_INTERVAL_MS','Pushing\x20workflow\x20project...','targetDir','keys','fullName','modified','💡\x20Tip:\x20Use\x20','/sessions/','Downloading\x20project\x20','Listing\x20secrets...','\x20unchanged','logs','key','nextRunTime','resolveProject','workflows','write','Loading\x20sessions...','(unknown)','List\x20workflow\x20attempts','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','pullProject','unchanged','No\x20attempts\x20found\x20in\x20project:\x20','\x20task','Deleting\x20project\x20','Enabling\x20schedule\x20#','deleted','site','toISOString','toLocaleString','size','Setting\x20','newProjectName','Files\x20to\x20upload:\x20','startedAt','toLowerCase','\x20secrets\x20set\x20for\x20project\x20\x27','\x20project','every','workflow:workflows','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','\x20\x20Revision:\x20','fs/promises','sourceDir','Pattern:\x20'];a54_0x2768=function(){return _0x1524af;};return a54_0x2768();}function calculateStats(_0x4d33b6){const _0x5b03db=a54_0x2a0943,_0x426611={'total':_0x4d33b6['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x433a91 of _0x4d33b6){if(_0x433a91[_0x5b03db(0x233)]===_0x5b03db(0x204))_0x426611[_0x5b03db(0x204)]++;else{if(_0x433a91[_0x5b03db(0x233)]==='error'||_0x433a91[_0x5b03db(0x233)]===_0x5b03db(0x1f9))_0x426611[_0x5b03db(0x2ae)]++;else _0x433a91[_0x5b03db(0x233)]===_0x5b03db(0x2ea)?_0x426611[_0x5b03db(0x2ea)]++:_0x426611[_0x5b03db(0x221)]++;}}return _0x426611;}function formatStats(_0x2d839b){const _0x282149=a54_0x2a0943;return['Total:\x20'+_0x2d839b['total'],'✅\x20'+_0x2d839b['success'],'❌\x20'+_0x2d839b['error'],_0x282149(0x2b1)+_0x2d839b[_0x282149(0x2ea)],'⏳\x20'+_0x2d839b[_0x282149(0x221)]][_0x282149(0x219)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x1c1);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x321);async[a54_0x2a0943(0x295)](_0x4904f4){const _0x45bc85=a54_0x2a0943,{options:_0x219e52,args:_0x87ca29,tdx:_0x366f38}=_0x4904f4;let _0x10a600,_0x4b4d74,_0x2c5e66=![];if(_0x87ca29[0x0]){if(_0x87ca29[0x0][_0x45bc85(0x2c6)]('.')){const _0x28f7dd=this['parseProjectWorkflowPattern'](_0x87ca29,_0x219e52);if(!_0x28f7dd)return 0x1;_0x10a600=_0x28f7dd[_0x45bc85(0x282)],_0x4b4d74=_0x28f7dd['workflowName'];}else{_0x4b4d74=_0x87ca29[0x0],_0x10a600=_0x219e52[_0x45bc85(0x2fb)];if(!_0x10a600)return console['error'](a54_0x13943d[_0x45bc85(0x1fc)](_0x45bc85(0x33f)),_0x45bc85(0x218)),0x1;_0x2c5e66=!![];}}else{const _0x310b3b=this[_0x45bc85(0x228)](_0x87ca29,_0x219e52);if(!_0x310b3b)return 0x1;_0x10a600=_0x310b3b[_0x45bc85(0x282)],_0x4b4d74=_0x310b3b[_0x45bc85(0x315)];}if(_0x219e52[_0x45bc85(0x31f)]){if(_0x10a600&&_0x4b4d74)console[_0x45bc85(0x2ae)](_0x45bc85(0x24f)+_0x10a600+'.'+_0x4b4d74);else _0x10a600&&console[_0x45bc85(0x2ae)](_0x45bc85(0x2d5)+_0x10a600);}const _0x21069e=_0x219e52[_0x45bc85(0x20b)],_0x4ab1ef=_0x219e52[_0x45bc85(0x1fe)];if(_0x21069e){_0x4ab1ef&&console[_0x45bc85(0x2ae)](a54_0x13943d[_0x45bc85(0x2f5)]('Warning:'),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x49dc99=_0x219e52['follow'];return _0x49dc99?await this[_0x45bc85(0x2e6)](_0x4904f4,_0x21069e):await this[_0x45bc85(0x245)](_0x4904f4,_0x21069e,_0x219e52),0x0;}if(_0x4ab1ef){const _0x2cd299=await withSpinner(_0x45bc85(0x2dd),()=>_0x366f38[_0x45bc85(0x2f9)][_0x45bc85(0x296)]({'projectName':_0x10a600,'workflowName':_0x4b4d74,'limit':0x64}),{'verbose':_0x219e52[_0x45bc85(0x31f)]}),_0x283b65=_0x2cd299[_0x45bc85(0x2c0)][_0x45bc85(0x331)](_0x3b095d=>_0x3b095d['id']===_0x4ab1ef);if(!_0x283b65)return console['error'](a54_0x13943d[_0x45bc85(0x1fc)](_0x45bc85(0x33f)),_0x45bc85(0x248)+_0x4ab1ef),0x1;if(!_0x283b65['lastAttempt']?.['id'])return console[_0x45bc85(0x2ae)](a54_0x13943d[_0x45bc85(0x1fc)]('Error:'),_0x45bc85(0x339)+_0x4ab1ef+_0x45bc85(0x338)),0x1;const _0x552d2e=_0x283b65[_0x45bc85(0x363)]['id'];_0x219e52['verbose']&&console[_0x45bc85(0x2ae)]('Using\x20attempt\x20'+_0x552d2e+_0x45bc85(0x1be)+_0x4ab1ef);const _0x553c28=_0x219e52[_0x45bc85(0x314)];return _0x553c28?await this[_0x45bc85(0x2e6)](_0x4904f4,_0x552d2e):await this[_0x45bc85(0x245)](_0x4904f4,_0x552d2e,_0x219e52),0x0;}const _0x3145d5=await withSpinner(_0x45bc85(0x1d7),()=>_0x366f38[_0x45bc85(0x2f9)]['sessions']({'projectName':_0x10a600,'workflowName':_0x4b4d74,'limit':_0x219e52[_0x45bc85(0x34d)]||0x32}),{'verbose':_0x219e52['verbose']}),_0x5a031e=_0x3145d5[_0x45bc85(0x2c0)];if(_0x5a031e[_0x45bc85(0x2c2)]===0x0){if(_0x10a600&&_0x4b4d74)console[_0x45bc85(0x2ae)]('No\x20sessions\x20found\x20for:\x20'+_0x10a600+'.'+_0x4b4d74);else _0x10a600?console[_0x45bc85(0x2ae)](_0x45bc85(0x372)+_0x10a600):(console[_0x45bc85(0x2ae)](_0x45bc85(0x322)),console['error'](a54_0x13943d['dim'](_0x45bc85(0x279))));return 0x0;}_0x5a031e[_0x45bc85(0x2ba)]((_0x451fff,_0x435b91)=>{const _0x100e18=_0x45bc85,_0x161623=_0x451fff['sessionTime']||'',_0x157664=_0x435b91[_0x100e18(0x36a)]||'';return _0x157664['localeCompare'](_0x161623);});if(_0x219e52[_0x45bc85(0x200)]||_0x219e52[_0x45bc85(0x291)])return await handleSDKOutput(_0x5a031e,_0x219e52),0x0;let _0x15f997;if(_0x2c5e66){const _0x33611c=_0x5a031e[0x0];if(!_0x33611c[_0x45bc85(0x363)]?.['id'])return console['error'](_0x45bc85(0x312)),0x0;_0x15f997=_0x33611c[_0x45bc85(0x363)]['id'],_0x219e52[_0x45bc85(0x31f)]&&console['error'](_0x45bc85(0x2f7)+_0x33611c['sessionTime']);}else{const _0x3ec5dd=_0x5a031e[_0x45bc85(0x285)](_0x167c82=>{const _0xee57bd=_0x45bc85,_0x54c205=getAttemptStatusDisplay(_0x167c82['lastAttempt']);return{'title':_0x167c82[_0xee57bd(0x330)]?.['name']+'.'+_0x167c82[_0xee57bd(0x2f9)]?.[_0xee57bd(0x1c3)]+'\x20-\x20'+_0x167c82['sessionTime']+'\x20'+_0x54c205['icon'],'value':_0x167c82[_0xee57bd(0x363)]?.['id']||'','description':_0x54c205[_0xee57bd(0x318)]};}),_0x577981=await a54_0x1b2330({'type':'select','name':_0x45bc85(0x20b),'message':_0x45bc85(0x268),'choices':_0x3ec5dd[_0x45bc85(0x2ed)](_0x386de9=>_0x386de9[_0x45bc85(0x1fb)]!=='')});if(!_0x577981['attemptId'])return 0x0;_0x15f997=_0x577981['attemptId'];}const _0x2a7056=_0x219e52[_0x45bc85(0x314)];return _0x2a7056?await this[_0x45bc85(0x2e6)](_0x4904f4,_0x15f997):await this[_0x45bc85(0x245)](_0x4904f4,_0x15f997,_0x219e52),0x0;}async[a54_0x2a0943(0x245)](_0x54d9bb,_0x504dac,_0x589595){const _0x3d97cc=a54_0x2a0943,{tdx:_0x3da4d1}=_0x54d9bb;let _0x54706a,_0x293598;try{[_0x54706a,_0x293598]=await Promise['all']([_0x3da4d1[_0x3d97cc(0x2f9)][_0x3d97cc(0x1ff)](_0x504dac),_0x3da4d1[_0x3d97cc(0x2f9)][_0x3d97cc(0x2d2)](_0x504dac,![])]);}catch(_0x365a1b){console[_0x3d97cc(0x2ae)](a54_0x13943d[_0x3d97cc(0x1fc)](_0x3d97cc(0x2a1)));_0x589595[_0x3d97cc(0x31f)]&&console[_0x3d97cc(0x2ae)](_0x365a1b);throw _0x365a1b;}if(_0x589595[_0x3d97cc(0x200)]||_0x589595['jsonl']){const _0x36473f=this[_0x3d97cc(0x326)](_0x54706a,_0x293598);await handleSDKOutput([_0x36473f],_0x589595);return;}const _0x5c0f69=_0x3da4d1[_0x3d97cc(0x21a)][_0x3d97cc(0x1e2)],_0x950c1c=this[_0x3d97cc(0x215)](_0x54706a,_0x293598,_0x5c0f69);console[_0x3d97cc(0x31e)](_0x950c1c);}async['pollTimeline'](_0x23e5d7,_0xdfbc3){const _0xd75e61=a54_0x2a0943,{tdx:_0x19df3c}=_0x23e5d7,_0x2f9685=TIMELINE_CONFIG[_0xd75e61(0x1c6)],_0x363a78=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x2fa3e3=0x0;while(_0x2fa3e3<_0x363a78){process[_0xd75e61(0x2fc)][_0xd75e61(0x2aa)]&&process[_0xd75e61(0x2fc)][_0xd75e61(0x1d6)]('\x1bc');let _0x3cc12f,_0x3bc1ff;try{[_0x3cc12f,_0x3bc1ff]=await Promise[_0xd75e61(0x217)]([_0x19df3c[_0xd75e61(0x2f9)]['attempt'](_0xdfbc3),_0x19df3c[_0xd75e61(0x2f9)][_0xd75e61(0x2d2)](_0xdfbc3,![])]);}catch(_0x56823d){console['error'](a54_0x13943d[_0xd75e61(0x1fc)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x2fa3e3>0x0&&console[_0xd75e61(0x2ae)](a54_0x13943d[_0xd75e61(0x31c)](_0xd75e61(0x370)+_0x2fa3e3));throw _0x56823d;}const _0xf1c96d=_0x19df3c[_0xd75e61(0x21a)][_0xd75e61(0x1e2)],_0x3ae908=this['renderTimeline'](_0x3cc12f,_0x3bc1ff,_0xf1c96d);console[_0xd75e61(0x31e)](_0x3ae908);const _0x59179c=_0x3cc12f[_0xd75e61(0x20a)]&&_0x3bc1ff[_0xd75e61(0x1ed)](_0x37256e=>_0x37256e['state']!==_0xd75e61(0x2ea)&&_0x37256e[_0xd75e61(0x233)]!==_0xd75e61(0x361));if(_0x59179c){console[_0xd75e61(0x2ae)](a54_0x13943d[_0xd75e61(0x211)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0xd75e61(0x2ae)](a54_0x13943d[_0xd75e61(0x31c)](_0xd75e61(0x2da)+_0x2fa3e3*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x3ee7f7=>setTimeout(_0x3ee7f7,_0x2f9685)),_0x2fa3e3++;}_0x2fa3e3>=_0x363a78&&console[_0xd75e61(0x2ae)](a54_0x13943d[_0xd75e61(0x2f5)](_0xd75e61(0x1ef)));}[a54_0x2a0943(0x215)](_0x4faa26,_0x817377,_0x4ba71d){const _0x5267ba=a54_0x2a0943,_0x1145d1=[],_0x1e9a31=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x5f36d9=0x5,_0x3badfb=process['stdout'][_0x5267ba(0x34a)]||0x78,_0x28acc8=_0x3badfb-_0x1e9a31-_0x5f36d9,_0x42151d=Math['max'](TIMELINE_CONFIG[_0x5267ba(0x2e9)],Math[_0x5267ba(0x294)](_0x28acc8,TIMELINE_CONFIG[_0x5267ba(0x1f7)])),_0x3c5586=new Date(_0x4faa26['createdAt'])[_0x5267ba(0x29c)](),_0x148b8c=_0x4faa26[_0x5267ba(0x2e0)]?new Date(_0x4faa26[_0x5267ba(0x2e0)])[_0x5267ba(0x29c)]():Date[_0x5267ba(0x22e)](),_0x130f0f={'start':_0x3c5586,'end':_0x148b8c,'duration':_0x148b8c-_0x3c5586},_0x1ee08a=new Map(),_0x94aa97=[];for(const _0x25a3f0 of _0x817377){if(_0x25a3f0['startedAt']){const _0x1871cc=new Date(_0x25a3f0[_0x5267ba(0x1e9)])['getTime'](),_0x30fd62=_0x25a3f0[_0x5267ba(0x225)]?new Date(_0x25a3f0[_0x5267ba(0x225)])[_0x5267ba(0x29c)]():Date[_0x5267ba(0x22e)](),_0x399a29={'start':_0x1871cc,'end':_0x30fd62,'duration':_0x30fd62-_0x1871cc};_0x1ee08a[_0x5267ba(0x2a7)](_0x25a3f0['id'],_0x399a29),_0x94aa97['push']({'name':_0x25a3f0[_0x5267ba(0x1ca)],'state':_0x25a3f0[_0x5267ba(0x233)]||_0x5267ba(0x263),'window':_0x399a29});}else _0x94aa97[_0x5267ba(0x377)]({'name':_0x25a3f0[_0x5267ba(0x1ca)],'state':_0x25a3f0['state']||_0x5267ba(0x361),'window':undefined});}_0x94aa97[_0x5267ba(0x2ba)]((_0x690f61,_0x39c56d)=>{const _0x527c97=_0x5267ba;if(!_0x690f61['window'])return 0x1;if(!_0x39c56d[_0x527c97(0x261)])return-0x1;return _0x690f61['window'][_0x527c97(0x273)]-_0x39c56d[_0x527c97(0x261)][_0x527c97(0x273)];});const _0x4867b3=_0x94aa97['length'],_0xaaf960=_0x4867b3>TIMELINE_CONFIG[_0x5267ba(0x347)];_0xaaf960&&_0x94aa97['splice'](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x3ede6a=calculateTimeScale(_0x130f0f,_0x42151d),_0x5ab640=_0x4faa26[_0x5267ba(0x20a)]?_0x4faa26['success']?a54_0x13943d['green'](_0x5267ba(0x204)):a54_0x13943d[_0x5267ba(0x1fc)]('error'):a54_0x13943d[_0x5267ba(0x258)](_0x5267ba(0x2ea)),_0x5417de=_0x4faa26[_0x5267ba(0x330)]?.['id'],_0xf83000=_0x4faa26[_0x5267ba(0x1fe)];let _0x10fd4a;if(_0x5417de&&_0xf83000){const _0x2822e8=getWorkflowAttemptUrl(_0x4ba71d,_0x5417de,_0xf83000,_0x4faa26['id']);_0x10fd4a=hyperlink(a54_0x13943d[_0x5267ba(0x31c)](_0x4faa26['id']),_0x2822e8);}else _0x10fd4a=a54_0x13943d[_0x5267ba(0x31c)](_0x4faa26['id']);_0x1145d1[_0x5267ba(0x377)](_0x5267ba(0x356)+_0x10fd4a+_0x5267ba(0x348)+_0x5ab640+'\x20-\x20'+formatElapsed(_0x130f0f[_0x5267ba(0x298)]));if(_0x94aa97['length']>0x0){const _0x3ceeeb=renderTimeAxis(_0x3ede6a,_0x42151d),_0x429bbe=new Date(_0x130f0f[_0x5267ba(0x273)]),_0x3eb942=formatDate(_0x429bbe),_0x6dde4d=TIMELINE_CONFIG[_0x5267ba(0x235)]+TIMELINE_CONFIG[_0x5267ba(0x22d)]+_0x1e9a31,_0x44fcaf=_0x3eb942['padStart'](_0x6dde4d),_0x38fba6=a54_0x13943d['dim'](_0x44fcaf);_0x1145d1['push'](_0x38fba6+'\x20'+_0x3ceeeb);for(const _0x2fb8b0 of _0x94aa97){_0x1145d1[_0x5267ba(0x377)](renderTaskRow(_0x2fb8b0,_0x3ede6a,_0x42151d,_0x1e9a31));}const _0x1fdba2=calculateStats(_0x94aa97);_0x1145d1[_0x5267ba(0x377)](formatStats(_0x1fdba2)),_0xaaf960&&_0x1145d1[_0x5267ba(0x377)](a54_0x13943d['yellow'](_0x5267ba(0x28f)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x5267ba(0x2de)+_0x4867b3+'\x20tasks')),_0x1145d1[_0x5267ba(0x377)](''),_0x1145d1[_0x5267ba(0x377)](a54_0x13943d[_0x5267ba(0x31c)](_0x5267ba(0x1cc))+(_0x5267ba(0x1ba)+_0x4faa26['id']+'\x20logs')+a54_0x13943d[_0x5267ba(0x31c)](_0x5267ba(0x230)));}else _0x1145d1[_0x5267ba(0x377)](_0x5267ba(0x257));return _0x1145d1[_0x5267ba(0x219)]('\x0a');}['buildTimelineData'](_0x5b2aa3,_0x36ba3a){const _0xd128cc=a54_0x2a0943,_0x290d6e=new Date(_0x5b2aa3['createdAt'])[_0xd128cc(0x29c)](),_0xe7debf=_0x5b2aa3['finishedAt']?new Date(_0x5b2aa3['finishedAt'])[_0xd128cc(0x29c)]():Date[_0xd128cc(0x22e)](),_0x2a8e4e=_0xe7debf-_0x290d6e,_0xae8e97=[];for(const _0x345bca of _0x36ba3a){if(_0x345bca[_0xd128cc(0x1e9)]){const _0x3e08a7=new Date(_0x345bca['startedAt'])['getTime'](),_0x1eed71=_0x345bca[_0xd128cc(0x225)]?new Date(_0x345bca[_0xd128cc(0x225)])['getTime']():Date['now']();_0xae8e97[_0xd128cc(0x377)]({'name':_0x345bca['fullName'],'state':_0x345bca[_0xd128cc(0x233)]||_0xd128cc(0x263),'window':{'start':_0x3e08a7,'end':_0x1eed71,'duration':_0x1eed71-_0x3e08a7}});}else _0xae8e97[_0xd128cc(0x377)]({'name':_0x345bca['fullName'],'state':_0x345bca[_0xd128cc(0x233)]||'planned','window':undefined});}const _0x2c67cd=calculateStats(_0xae8e97);return{'attempt':{'id':_0x5b2aa3['id'],'status':_0x5b2aa3[_0xd128cc(0x20a)]?_0x5b2aa3['success']?_0xd128cc(0x204):_0xd128cc(0x2ae):_0xd128cc(0x2ea),'createdAt':_0x5b2aa3[_0xd128cc(0x34e)],'finishedAt':_0x5b2aa3[_0xd128cc(0x2e0)],'duration_ms':_0x2a8e4e},'tasks':_0xae8e97[_0xd128cc(0x285)](_0x3c0215=>({'name':_0x3c0215['name'],'state':_0x3c0215['state'],'startedAt':_0x3c0215[_0xd128cc(0x261)]?new Date(_0x3c0215[_0xd128cc(0x261)][_0xd128cc(0x273)])[_0xd128cc(0x1e3)]():null,'updatedAt':_0x3c0215[_0xd128cc(0x261)]?new Date(_0x3c0215[_0xd128cc(0x261)]['end'])[_0xd128cc(0x1e3)]():null,'duration_ms':_0x3c0215[_0xd128cc(0x261)]?.[_0xd128cc(0x298)]||null})),'stats':_0x2c67cd};}}export class WorkflowSchedulesCommand extends BaseCommand{['name']=a54_0x2a0943(0x31d);[a54_0x2a0943(0x337)]=a54_0x2a0943(0x2c1);async['execute'](_0x2b70a4){const _0x13ac2d=a54_0x2a0943,{options:_0x32cf6b,tdx:_0x5f2035}=_0x2b70a4,_0x33a6cd=await withSpinner(_0x13ac2d(0x2a6),()=>_0x5f2035[_0x13ac2d(0x2f9)][_0x13ac2d(0x226)](),{'verbose':_0x32cf6b['verbose']}),_0x4ae562=_0x33a6cd[_0x13ac2d(0x2c0)];console[_0x13ac2d(0x2ae)]('✔\x20Found\x20'+_0x4ae562[_0x13ac2d(0x2c2)]+'\x20schedule'+(_0x4ae562[_0x13ac2d(0x2c2)]!==0x1?'s':''));if(isStructuredFormat(_0x32cf6b))await handleSDKOutput(_0x4ae562,_0x32cf6b);else{if(_0x4ae562[_0x13ac2d(0x2c2)]===0x0)console['log']('No\x20schedules\x20found');else for(const _0x5bad7c of _0x4ae562){const _0x36b644=_0x5bad7c[_0x13ac2d(0x29f)]?a54_0x13943d['yellow'](_0x13ac2d(0x238)):'',_0xf6d701=_0x5bad7c[_0x13ac2d(0x330)]?.['name']?a54_0x13943d[_0x13ac2d(0x31c)]('\x20['+_0x5bad7c[_0x13ac2d(0x330)]['name']+']'):'',_0x3c3c73=_0x5bad7c['nextRunTime']?a54_0x13943d['dim'](_0x13ac2d(0x2b4)+new Date(_0x5bad7c['nextRunTime'])[_0x13ac2d(0x1e4)]()):'';console['log'](_0x13ac2d(0x216)+_0x5bad7c['id']+'\x20'+(_0x5bad7c[_0x13ac2d(0x2f9)]?.[_0x13ac2d(0x1c3)]||'(unknown)')+_0xf6d701+_0x36b644+_0x3c3c73);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]='workflow:schedule:enable';['description']=a54_0x2a0943(0x367);async[a54_0x2a0943(0x295)](_0x1f52aa){const _0x1ef387=a54_0x2a0943,{options:_0x5e3975,args:_0x5153c8,tdx:_0x24a8ba}=_0x1f52aa,_0x57df67=_0x5153c8[0x0];if(!_0x57df67)return console[_0x1ef387(0x2ae)](a54_0x13943d[_0x1ef387(0x1fc)](_0x1ef387(0x33f)),_0x1ef387(0x26f)),console['error'](a54_0x13943d[_0x1ef387(0x31c)](_0x1ef387(0x2cd))),console['error'](a54_0x13943d[_0x1ef387(0x31c)](_0x1ef387(0x382))),0x1;const _0x108dd3=await withSpinner(_0x1ef387(0x1e0)+_0x57df67+_0x1ef387(0x320),()=>_0x24a8ba[_0x1ef387(0x2f9)][_0x1ef387(0x2ab)](_0x57df67),{'verbose':_0x5e3975[_0x1ef387(0x31f)]}),_0x3df794=_0x108dd3['data'];return isStructuredFormat(_0x5e3975)?await handleSingleObjectOutput(_0x3df794,_0x5e3975):(console['log']('✔\x20Schedule\x20#'+_0x57df67+_0x1ef387(0x269)+(_0x3df794[_0x1ef387(0x2f9)]?.[_0x1ef387(0x1c3)]||_0x1ef387(0x263))+')'),_0x3df794['nextRunTime']&&console[_0x1ef387(0x31e)](a54_0x13943d[_0x1ef387(0x31c)](_0x1ef387(0x23c)+new Date(_0x3df794[_0x1ef387(0x1d3)])[_0x1ef387(0x1e4)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x2a0943(0x1c3)]=a54_0x2a0943(0x36b);['description']=a54_0x2a0943(0x222);async['execute'](_0x350c4f){const _0x4e22fc=a54_0x2a0943,{options:_0x2c1a79,args:_0x5113f5,tdx:_0x573e81}=_0x350c4f,_0x4b573c=_0x5113f5[0x0];if(!_0x4b573c)return console[_0x4e22fc(0x2ae)](a54_0x13943d[_0x4e22fc(0x1fc)]('Error:'),'Schedule\x20ID\x20is\x20required'),console[_0x4e22fc(0x2ae)](a54_0x13943d[_0x4e22fc(0x31c)](_0x4e22fc(0x23a))),console[_0x4e22fc(0x2ae)](a54_0x13943d[_0x4e22fc(0x31c)](_0x4e22fc(0x382))),0x1;const _0x398386=await withSpinner(_0x4e22fc(0x32e)+_0x4b573c+'...',()=>_0x573e81[_0x4e22fc(0x2f9)]['disableSchedule'](_0x4b573c),{'verbose':_0x2c1a79['verbose']}),_0x4488fb=_0x398386[_0x4e22fc(0x2c0)];return isStructuredFormat(_0x2c1a79)?await handleSingleObjectOutput(_0x4488fb,_0x2c1a79):console[_0x4e22fc(0x31e)](_0x4e22fc(0x300)+_0x4b573c+_0x4e22fc(0x246)+(_0x4488fb['workflow']?.[_0x4e22fc(0x1c3)]||'unknown')+')'),0x0;}}
1
+ const a54_0x478897=a54_0x50e0;(function(_0x2bef41,_0x24dcd8){const _0x366e51=a54_0x50e0,_0x2d1dba=_0x2bef41();while(!![]){try{const _0x50592f=-parseInt(_0x366e51(0x20c))/0x1+-parseInt(_0x366e51(0x26d))/0x2*(-parseInt(_0x366e51(0x2bf))/0x3)+-parseInt(_0x366e51(0x28f))/0x4+parseInt(_0x366e51(0x1a2))/0x5*(parseInt(_0x366e51(0x202))/0x6)+-parseInt(_0x366e51(0x222))/0x7+parseInt(_0x366e51(0x287))/0x8*(parseInt(_0x366e51(0x1ea))/0x9)+-parseInt(_0x366e51(0x237))/0xa;if(_0x50592f===_0x24dcd8)break;else _0x2d1dba['push'](_0x2d1dba['shift']());}catch(_0x989028){_0x2d1dba['push'](_0x2d1dba['shift']());}}}(a54_0xa03e,0x9f382));import a54_0x5a87b0 from'chalk';import{existsSync}from'fs';import a54_0x2b2dff 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 a54_0xfbc779 from'prompts';function getAttemptStatusDisplay(_0x322894){const _0x22238e=a54_0x50e0;if(!_0x322894)return{'icon':'⏳','text':''};const {done:_0x137b05,success:_0x12f203,cancelRequested:_0xd510e5}=_0x322894;if(!_0x137b05)return _0xd510e5?{'icon':'🛑','text':a54_0x5a87b0[_0x22238e(0x1c9)](_0x22238e(0x1f3))}:{'icon':'🔄','text':a54_0x5a87b0[_0x22238e(0x1b5)](_0x22238e(0x296))};if(_0x12f203)return{'icon':'✅','text':a54_0x5a87b0[_0x22238e(0x31f)](_0x22238e(0x2e1))};return{'icon':'❌','text':a54_0x5a87b0[_0x22238e(0x264)](_0x22238e(0x2f5))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x5382fd,_0x3c379b,_0x5bf4fe=0x0){const _0x2636b7=a54_0x50e0;return _0x5382fd[_0x5bf4fe]||_0x3c379b[_0x2636b7(0x2f7)];}['requireProject'](_0x48593d,_0xfb1de7,_0x566616=0x0){const _0xf6b7b2=a54_0x50e0,_0x399101=this['resolveProject'](_0x48593d,_0xfb1de7,_0x566616);if(!_0x399101)return console[_0xf6b7b2(0x2f5)](a54_0x5a87b0[_0xf6b7b2(0x264)](_0xf6b7b2(0x32c)),'Project\x20name\x20is\x20required'),console[_0xf6b7b2(0x2f5)](a54_0x5a87b0[_0xf6b7b2(0x1e4)](_0xf6b7b2(0x2f1))),null;return _0x399101;}['parseProjectWorkflowPattern'](_0x18d30c,_0x5a98d4){const _0x3e9f9f=a54_0x50e0;if(_0x18d30c[0x0]){const _0x1d064d=_0x18d30c[0x0][_0x3e9f9f(0x2de)]('.');if(_0x1d064d[_0x3e9f9f(0x1b1)]===0x1)return{'projectName':_0x1d064d[0x0],'workflowName':undefined};else return _0x1d064d['length']===0x2?{'projectName':_0x1d064d[0x0],'workflowName':_0x1d064d[0x1]}:(console[_0x3e9f9f(0x2f5)](a54_0x5a87b0[_0x3e9f9f(0x264)](_0x3e9f9f(0x32c)),_0x3e9f9f(0x260)),null);}return{'projectName':_0x5a98d4[_0x3e9f9f(0x2f7)],'workflowName':undefined};}['resolveProjectDir'](_0x1f8974,_0x54b77d,_0x461f13=0x0){const _0x30af28=a54_0x50e0;if(_0x1f8974[_0x461f13])return _0x1f8974[_0x461f13];if(_0x54b77d[_0x30af28(0x2f7)]){const _0x5837c6=a54_0x2b2dff[_0x30af28(0x1bc)](process[_0x30af28(0x215)](),_0x30af28(0x2af),_0x54b77d['workflowProject']);if(existsSync(a54_0x2b2dff[_0x30af28(0x1bc)](_0x5837c6,_0x30af28(0x2a5))))return _0x5837c6;}return undefined;}async[a54_0x478897(0x236)](_0x57c65,_0x1cbe02,_0x46979d){const _0x3f9eb9=a54_0x478897;try{const _0x11a10d=await _0x57c65['workflow']['workflows'](_0x1cbe02,{'limit':0x1});if(_0x11a10d['length']>0x0){const _0x2bd0c3=_0x11a10d[0x0]['id'],_0x224bfc=getWorkflowUrl(_0x46979d,_0x2bd0c3);console[_0x3f9eb9(0x2f5)](_0x3f9eb9(0x275)+a54_0x5a87b0[_0x3f9eb9(0x2c4)](_0x224bfc));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x478897(0x346)]='workflow:use';['description']='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a54_0x478897(0x339)](_0x42e3bd){const _0x1dd20d=a54_0x478897,{options:_0x3881b7,args:_0x532fd2,tdx:_0x3e5d8f}=_0x42e3bd,_0x5ac966=_0x532fd2[0x0],_0x505665=_0x3881b7[_0x1dd20d(0x1e7)];if(_0x505665)return saveSessionContext({'workflow_project':undefined},_0x3881b7[_0x1dd20d(0x22a)]),console[_0x1dd20d(0x224)](a54_0x5a87b0[_0x1dd20d(0x31f)](_0x1dd20d(0x1cb))),0x0;if(!_0x5ac966)return console['error'](a54_0x5a87b0[_0x1dd20d(0x264)](_0x1dd20d(0x32c)),'Project\x20name\x20is\x20required'),console[_0x1dd20d(0x2f5)](a54_0x5a87b0[_0x1dd20d(0x1e4)](_0x1dd20d(0x1be))),console[_0x1dd20d(0x2f5)](a54_0x5a87b0[_0x1dd20d(0x1e4)](_0x1dd20d(0x255))),0x1;const _0x4fad55=await withSpinner(_0x1dd20d(0x340)+_0x5ac966+_0x1dd20d(0x33d),()=>_0x3e5d8f['workflow']['resolveProjectId'](_0x5ac966),{'verbose':_0x3881b7[_0x1dd20d(0x1c0)]}),{name:_0x52da41}=_0x4fad55[_0x1dd20d(0x223)];return saveSessionContext({'workflow_project':_0x52da41},_0x3881b7[_0x1dd20d(0x22a)]),console[_0x1dd20d(0x224)](a54_0x5a87b0['green']('✔\x20Workflow\x20project\x20set\x20to:\x20'+a54_0x5a87b0['cyan'](_0x52da41))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x1d3);[a54_0x478897(0x320)]='List\x20all\x20workflow\x20projects';async[a54_0x478897(0x339)](_0x59aac7){const _0xe5a12d=a54_0x478897,{options:_0x58b5e8,args:_0x3441a0,tdx:_0x43d51b}=_0x59aac7,_0x5b1c9c=_0x3441a0[0x0];_0x58b5e8[_0xe5a12d(0x1c0)]&&_0x5b1c9c&&console['error']('Pattern:\x20'+_0x5b1c9c);const _0x43a51b=await withSpinner(_0xe5a12d(0x1c2),()=>_0x43d51b[_0xe5a12d(0x266)][_0xe5a12d(0x22c)](_0x5b1c9c,{'limit':_0x58b5e8[_0xe5a12d(0x1ff)]}),{'verbose':_0x58b5e8[_0xe5a12d(0x1c0)]});let _0x393477=_0x43a51b[_0xe5a12d(0x223)];_0x393477[_0xe5a12d(0x1ee)]((_0x4a5456,_0x287012)=>_0x4a5456[_0xe5a12d(0x346)][_0xe5a12d(0x2a3)](_0x287012[_0xe5a12d(0x346)]));const _0xbf2bed=_0x58b5e8[_0xe5a12d(0x1ff)]||0x64,_0x57632c=_0x393477[_0xe5a12d(0x1b1)]>=_0xbf2bed?a54_0x5a87b0[_0xe5a12d(0x1e4)](_0xe5a12d(0x298)):'';console[_0xe5a12d(0x2f5)]('✔\x20Found\x20'+_0x393477[_0xe5a12d(0x1b1)]+_0xe5a12d(0x24d)+(_0x393477['length']!==0x1?'s':'')+_0x57632c);if(_0x58b5e8[_0xe5a12d(0x233)]===_0xe5a12d(0x221)||_0x58b5e8[_0xe5a12d(0x233)]===_0xe5a12d(0x2f0)||_0x58b5e8['format']===_0xe5a12d(0x216))await handleSDKOutput(_0x393477,_0x58b5e8);else{if(_0x393477[_0xe5a12d(0x1b1)]===0x0)_0x5b1c9c?console['log']('No\x20projects\x20match\x20pattern:\x20'+_0x5b1c9c):console['log'](_0xe5a12d(0x2fd));else{const _0x1a1feb=_0x393477[_0xe5a12d(0x30b)](_0x4027bf=>{const _0x59ed28=_0xe5a12d,_0x14f667=_0x4027bf['metadata']?.[_0x59ed28(0x1b7)](_0x200475=>_0x200475[_0x59ed28(0x261)]===_0x59ed28(0x309)),_0x97b63a=_0x14f667?a54_0x5a87b0['dim'](_0x59ed28(0x2ca)):'';return _0x59ed28(0x1fd)+_0x4027bf[_0x59ed28(0x346)]+_0x97b63a;});await writeOutput(_0x1a1feb[_0xe5a12d(0x1bc)]('\x0a'),_0x58b5e8[_0xe5a12d(0x28d)],_0xe5a12d(0x336));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x478897(0x346)]='workflow:workflows';['description']='List\x20workflows';async[a54_0x478897(0x339)](_0x46379e){const _0x24cdfb=a54_0x478897,{options:_0x6afd07,args:_0x40b3a7,tdx:_0x12ebe1}=_0x46379e,_0x117af9=this[_0x24cdfb(0x284)](_0x40b3a7,_0x6afd07);_0x6afd07[_0x24cdfb(0x1c0)]&&_0x117af9&&console['error'](_0x24cdfb(0x2ac)+_0x117af9);const _0x243702=await withSpinner(_0x24cdfb(0x23d),()=>_0x12ebe1['workflow'][_0x24cdfb(0x2af)](_0x117af9,{'limit':_0x6afd07[_0x24cdfb(0x1ff)]}),{'verbose':_0x6afd07[_0x24cdfb(0x1c0)]});let _0x43a869=_0x243702[_0x24cdfb(0x223)];_0x43a869[_0x24cdfb(0x1ee)]((_0x147d38,_0x2597aa)=>{const _0xee44c0=_0x24cdfb,_0x2f7a21=_0x147d38[_0xee44c0(0x346)][_0xee44c0(0x2a3)](_0x2597aa[_0xee44c0(0x346)]);if(_0x2f7a21!==0x0)return _0x2f7a21;return(_0x147d38[_0xee44c0(0x2e5)]?.['name']||'')['localeCompare'](_0x2597aa[_0xee44c0(0x2e5)]?.[_0xee44c0(0x346)]||'');});const _0x174f61=_0x6afd07[_0x24cdfb(0x1ff)]||0x64,_0x48d3fa=_0x43a869['length']>=_0x174f61?a54_0x5a87b0[_0x24cdfb(0x1e4)](_0x24cdfb(0x298)):'';console[_0x24cdfb(0x2f5)](_0x24cdfb(0x1ab)+_0x43a869[_0x24cdfb(0x1b1)]+_0x24cdfb(0x235)+(_0x43a869[_0x24cdfb(0x1b1)]!==0x1?'s':'')+_0x48d3fa);if(_0x6afd07[_0x24cdfb(0x233)]===_0x24cdfb(0x221)||_0x6afd07[_0x24cdfb(0x233)]===_0x24cdfb(0x2f0)||_0x6afd07[_0x24cdfb(0x233)]===_0x24cdfb(0x216))await handleSDKOutput(_0x43a869,_0x6afd07);else{if(_0x43a869['length']===0x0)_0x117af9?console['log']('No\x20workflows\x20found\x20in\x20project:\x20'+_0x117af9):console['log'](_0x24cdfb(0x31b));else{const _0x380fc9=_0x6afd07[_0x24cdfb(0x30d)],_0x27015c=_0x43a869[_0x24cdfb(0x30b)](_0x460845=>{const _0x4c7fb3=_0x24cdfb,_0x134477=a54_0x5a87b0[_0x4c7fb3(0x1e4)]('#'+_0x460845['id']),_0x3f6b1d=hyperlink(_0x134477,getWorkflowUrl(_0x380fc9,_0x460845['id'])),_0x1c6cc2=_0x460845[_0x4c7fb3(0x2e5)]?.[_0x4c7fb3(0x346)]?a54_0x5a87b0[_0x4c7fb3(0x1e4)]('\x20('+_0x460845[_0x4c7fb3(0x2e5)]['name']+')'):'';return _0x4c7fb3(0x279)+_0x3f6b1d+'\x20'+_0x460845[_0x4c7fb3(0x346)]+_0x1c6cc2;});await writeOutput(_0x27015c['join']('\x0a'),_0x6afd07['output'],_0x24cdfb(0x336));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x33c);[a54_0x478897(0x320)]=a54_0x478897(0x274);async['execute'](_0x1a6bcc){const _0x51361c=a54_0x478897,{options:_0x5cfc69,args:_0x4fc798,tdx:_0xc169fc}=_0x1a6bcc,_0x1710b2=this['parseProjectWorkflowPattern'](_0x4fc798,_0x5cfc69);if(!_0x1710b2)return 0x1;const {projectName:_0x782772,workflowName:_0x57cefb}=_0x1710b2;if(_0x5cfc69[_0x51361c(0x1c0)]){if(_0x782772&&_0x57cefb)console['error']('Filter:\x20'+_0x782772+'.'+_0x57cefb);else _0x782772&&console[_0x51361c(0x2f5)](_0x51361c(0x303)+_0x782772);const _0x5b9ba4=_0x5cfc69[_0x51361c(0x2e6)];_0x5b9ba4&&console[_0x51361c(0x2f5)](_0x51361c(0x20b)+_0x5b9ba4);}let _0x50a9bd=0x28;if(process[_0x51361c(0x19c)]['isTTY']&&!_0x5cfc69['output']&&!_0x5cfc69[_0x51361c(0x233)]){const _0x439921=process[_0x51361c(0x19c)][_0x51361c(0x331)]||0x28;_0x50a9bd=Math[_0x51361c(0x31e)](0x14,Math[_0x51361c(0x1fc)](_0x439921*0x2/0x3));}const _0x27178c=_0x5cfc69[_0x51361c(0x1ff)]||_0x50a9bd,_0x247c7f=await withSpinner(_0x51361c(0x22e),()=>_0xc169fc[_0x51361c(0x266)][_0x51361c(0x2ab)]({'projectName':_0x782772,'workflowName':_0x57cefb,'status':_0x5cfc69['status'],'fromTime':_0x5cfc69[_0x51361c(0x197)],'toTime':_0x5cfc69['to'],'limit':_0x27178c}),{'verbose':_0x5cfc69[_0x51361c(0x1c0)]}),_0x3d76e4=_0x247c7f[_0x51361c(0x223)];_0x3d76e4[_0x51361c(0x1ee)]((_0x39a9ae,_0x4e64c0)=>{const _0x2ab567=_0x51361c,_0x1f8509=_0x39a9ae[_0x2ab567(0x301)]||'',_0x1880a5=_0x4e64c0[_0x2ab567(0x301)]||'';return _0x1880a5[_0x2ab567(0x2a3)](_0x1f8509);});_0x3d76e4[_0x51361c(0x1b1)]>=_0x27178c?console['error'](_0x51361c(0x2cc)+_0x3d76e4[_0x51361c(0x1b1)]+_0x51361c(0x1e9)+a54_0x5a87b0[_0x51361c(0x1e4)](_0x51361c(0x227))):console[_0x51361c(0x2f5)](_0x51361c(0x1ab)+_0x3d76e4[_0x51361c(0x1b1)]+_0x51361c(0x1a7)+(_0x3d76e4[_0x51361c(0x1b1)]!==0x1?'s':''));if(_0x5cfc69['format']==='json'||_0x5cfc69['format']==='jsonl'||_0x5cfc69[_0x51361c(0x233)]==='table')await handleSDKOutput(_0x3d76e4,_0x5cfc69);else{if(!process[_0x51361c(0x19c)][_0x51361c(0x25d)]||_0x5cfc69['output']){if(_0x3d76e4[_0x51361c(0x1b1)]===0x0){if(_0x782772&&_0x57cefb)console['log']('No\x20sessions\x20found\x20for:\x20'+_0x782772+'.'+_0x57cefb);else _0x782772?console[_0x51361c(0x224)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x782772):console[_0x51361c(0x224)]('No\x20sessions\x20found');}else{const _0x4047da=_0x5cfc69[_0x51361c(0x30d)],_0x2384ee=this['renderSessionsTimeline'](_0x3d76e4,_0x4047da);_0x5cfc69[_0x51361c(0x28d)]?await writeOutput(_0x2384ee,_0x5cfc69[_0x51361c(0x28d)],_0x51361c(0x336)):console[_0x51361c(0x224)](_0x2384ee);}!_0x782772&&(console[_0x51361c(0x2f5)](''),console[_0x51361c(0x2f5)](a54_0x5a87b0[_0x51361c(0x1e4)](_0x51361c(0x1f9))),console[_0x51361c(0x2f5)](a54_0x5a87b0[_0x51361c(0x1e4)](_0x51361c(0x26c))+'or'+a54_0x5a87b0[_0x51361c(0x1e4)](_0x51361c(0x29e))));}else{if(_0x3d76e4[_0x51361c(0x1b1)]===0x0){if(_0x782772&&_0x57cefb)console[_0x51361c(0x224)]('No\x20sessions\x20found\x20for:\x20'+_0x782772+'.'+_0x57cefb);else _0x782772?console[_0x51361c(0x224)](_0x51361c(0x319)+_0x782772):console[_0x51361c(0x224)](_0x51361c(0x322));}else await this[_0x51361c(0x272)](_0x3d76e4,_0x1a6bcc,_0x782772);}}return 0x0;}[a54_0x478897(0x212)](_0x184aeb,_0x3fc0a5){const _0x9a00de=a54_0x478897,_0x116c74=[],_0x26a018=new Map();let _0x71e8e0=Infinity,_0x3087f5=-Infinity;for(const _0x4071b1 of _0x184aeb){if(_0x4071b1['lastAttempt']?.['createdAt']){const _0xc9a241=new Date(_0x4071b1[_0x9a00de(0x1c4)]['createdAt'])['getTime'](),_0x45a833=_0x4071b1[_0x9a00de(0x1c4)][_0x9a00de(0x2ce)]?new Date(_0x4071b1[_0x9a00de(0x1c4)][_0x9a00de(0x2ce)])[_0x9a00de(0x300)]():Date[_0x9a00de(0x196)](),_0x29a701=_0x4071b1[_0x9a00de(0x2e5)]?.['name']||_0x9a00de(0x208);!_0x26a018[_0x9a00de(0x231)](_0x29a701)&&_0x26a018[_0x9a00de(0x1f2)](_0x29a701,[]),_0x26a018['get'](_0x29a701)['push']({'session':_0x4071b1,'startTime':_0xc9a241,'endTime':_0x45a833,'duration':_0x45a833-_0xc9a241}),_0x71e8e0=Math[_0x9a00de(0x1c7)](_0x71e8e0,_0xc9a241),_0x3087f5=Math[_0x9a00de(0x31e)](_0x3087f5,_0x45a833);}}if(_0x26a018[_0x9a00de(0x1d0)]===0x0)return _0x9a00de(0x1ed);const _0x2a8602=process[_0x9a00de(0x19c)]['columns']||0x78,_0x1bb51f=0x1e,_0x21ecbe=0x32,_0x5dd4a7=0x4,_0x477305=Math[_0x9a00de(0x1c7)](_0x21ecbe,Math[_0x9a00de(0x31e)](_0x1bb51f,Math[_0x9a00de(0x1fc)](_0x2a8602*0.3))),_0xcfac5a=_0x2a8602-_0x477305-TIMELINE_CONFIG[_0x9a00de(0x28e)]-0x3-_0x5dd4a7,_0x1dc8bf=_0x3087f5-_0x71e8e0,_0x2fca75=_0x1dc8bf/_0x477305,_0xa163bd=renderTimeAxis({'startTime':_0x71e8e0,'endTime':_0x3087f5,'durationMs':_0x1dc8bf,'msPerChar':_0x2fca75},_0x477305),_0x153278=[];for(const _0x5d2261 of _0x26a018['values']()){_0x153278[_0x9a00de(0x240)](..._0x5d2261);}_0x153278['sort']((_0x3a874d,_0x54ef25)=>_0x54ef25[_0x9a00de(0x2bb)]-_0x3a874d[_0x9a00de(0x2bb)]);const _0x1e9b2a=new Date(_0x71e8e0),_0xa89f4a=formatDate(_0x1e9b2a),_0x2c9052=_0x5dd4a7+TIMELINE_CONFIG[_0x9a00de(0x26e)]+TIMELINE_CONFIG[_0x9a00de(0x2dc)]+_0xcfac5a,_0x5b09f6='\x20'[_0x9a00de(0x245)](_0x2c9052-_0xa89f4a[_0x9a00de(0x1b1)]),_0x388b6f=_0x5b09f6+a54_0x5a87b0[_0x9a00de(0x1e4)](_0xa89f4a)+'\x20'+_0xa163bd;_0x116c74[_0x9a00de(0x240)](_0x388b6f);const _0x11ae3d=0x16;let _0x307ec8=0x0;for(const _0x575681 of _0x153278){const _0x5c1575=_0x575681[_0x9a00de(0x22a)][_0x9a00de(0x2e5)]?.[_0x9a00de(0x346)]||'?',_0x360cac=Math[_0x9a00de(0x1c7)](stringWidth(_0x5c1575),_0x11ae3d);_0x307ec8=Math['max'](_0x307ec8,_0x360cac);}for(const _0x3cf767 of _0x153278){const {session:_0x389189,startTime:_0x4dbed7,endTime:_0x4c040d,duration:_0x33ebac}=_0x3cf767,_0x132edc=_0x389189[_0x9a00de(0x2e5)]?.['id'],_0x5658be=_0x389189['id'],_0x5c39f2=_0x389189[_0x9a00de(0x2e5)]?.[_0x9a00de(0x346)]||'?',_0x5dba70=_0x389189[_0x9a00de(0x266)]?.[_0x9a00de(0x346)]||'?';let _0x2ace7a,_0x2036a7;if(_0x389189[_0x9a00de(0x1c4)]){const _0x53735c=_0x389189['lastAttempt'];!_0x53735c[_0x9a00de(0x25e)]?(_0x2ace7a=_0x53735c[_0x9a00de(0x2c5)]?'🛑':'🔄',_0x2036a7=_0x53735c[_0x9a00de(0x2c5)]?a54_0x5a87b0[_0x9a00de(0x1c9)]:a54_0x5a87b0['blue']):(_0x2ace7a=_0x53735c[_0x9a00de(0x2e1)]?'✅':'❌',_0x2036a7=_0x53735c['success']?a54_0x5a87b0[_0x9a00de(0x31f)]:a54_0x5a87b0[_0x9a00de(0x264)]);}else _0x2ace7a='⏳',_0x2036a7=a54_0x5a87b0[_0x9a00de(0x1e4)];const _0x19c708='#'+_0x5658be,_0x4a1cbb=_0x132edc?hyperlink(_0x19c708,getWorkflowSessionUrl(_0x3fc0a5,_0x132edc,_0x5658be)):_0x19c708;let _0x56db20=_0x5c39f2;stringWidth(_0x5c39f2)>_0x11ae3d&&(_0x56db20=_0x5c39f2[_0x9a00de(0x242)](0x0,_0x11ae3d-0x1)+'…');const _0x1bd92f=a54_0x5a87b0['dim'](_0x56db20),_0x184357=stringWidth(_0x56db20),_0x5642eb='\x20'[_0x9a00de(0x245)](_0x307ec8-stringWidth(_0x56db20)+0x2),_0x5caafe='('+formatElapsed(_0x33ebac)+')',_0x53c0f4=stringWidth(_0x5caafe),_0x13a909=stringWidth(_0x19c708),_0x141dfd=_0x13a909+0x1+_0x184357+_0x5642eb[_0x9a00de(0x1b1)],_0x130cc9=_0xcfac5a-_0x141dfd-_0x53c0f4-0x1-0x8;let _0x3ab8ec=_0x5dba70;stringWidth(_0x3ab8ec)>_0x130cc9&&(_0x3ab8ec=_0x3ab8ec[_0x9a00de(0x242)](0x0,_0x130cc9-0x1)+'…');const _0x3c0515=_0x4a1cbb+'\x20'+_0x1bd92f+_0x5642eb+_0x3ab8ec,_0x36a86f=stringWidth(_0x3c0515),_0x230f8a=_0xcfac5a-_0x36a86f-_0x53c0f4,_0x478690=_0x3c0515+'\x20'[_0x9a00de(0x245)](Math[_0x9a00de(0x31e)](0x1,_0x230f8a))+a54_0x5a87b0[_0x9a00de(0x1e4)](_0x5caafe),_0x2d30a7=Math[_0x9a00de(0x1fc)]((_0x4dbed7-_0x71e8e0)/_0x2fca75),_0x47fa43=Math[_0x9a00de(0x1fc)]((_0x4c040d-_0x71e8e0)/_0x2fca75),_0x47b0a9=Math[_0x9a00de(0x31e)](_0x2d30a7+0x1,_0x47fa43),_0x14eea5=new Array(_0x477305)[_0x9a00de(0x1b8)]('\x20');for(let _0x1c2424=_0x2d30a7;_0x1c2424<Math[_0x9a00de(0x1c7)](_0x47b0a9,_0x477305);_0x1c2424++){_0x14eea5[_0x1c2424]='─';}const _0x3a09d3=_0x14eea5[_0x9a00de(0x30b)](_0x50638a=>_0x50638a==='\x20'?'\x20':_0x2036a7(_0x50638a))['join']('');_0x116c74[_0x9a00de(0x240)](_0x2ace7a+'\x20'+_0x478690+'│'+_0x3a09d3+'│');}return _0x116c74[_0x9a00de(0x1bc)]('\x0a');}async[a54_0x478897(0x272)](_0x413cbc,_0x1bf1cc,_0x4effe3){const _0x3de73f=a54_0x478897,{options:_0x2e6b33,tdx:_0x38f36e}=_0x1bf1cc,_0x37913e=_0x2e6b33[_0x3de73f(0x30d)],{timelineRows:_0x3334e4,timeAxisHeader:_0xfaa0cd}=this[_0x3de73f(0x20f)](_0x413cbc,_0x37913e),_0x2687cf=_0x3334e4['filter'](_0x11ee81=>_0x11ee81[_0x3de73f(0x1a3)]);if(_0x2687cf['length']===0x0){const _0x358710=this[_0x3de73f(0x212)](_0x413cbc,_0x37913e);console[_0x3de73f(0x224)](_0x358710);!_0x4effe3&&(console[_0x3de73f(0x2f5)](''),console[_0x3de73f(0x2f5)](a54_0x5a87b0[_0x3de73f(0x1e4)](_0x3de73f(0x1f9))),console[_0x3de73f(0x2f5)](a54_0x5a87b0[_0x3de73f(0x1e4)](_0x3de73f(0x26c))+'or'+a54_0x5a87b0[_0x3de73f(0x1e4)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0xfaa0cd&&console[_0x3de73f(0x224)](_0xfaa0cd);const _0x773215=_0x3334e4['filter'](_0x346990=>_0x346990[_0x3de73f(0x1a3)])[_0x3de73f(0x30b)](_0x3a6eb6=>({'title':_0x3a6eb6[_0x3de73f(0x205)],'value':_0x3a6eb6[_0x3de73f(0x1a3)]})),_0x40953e=process[_0x3de73f(0x19c)]['rows']||0x3c,_0x4425ac=Math[_0x3de73f(0x31e)](0x28,Math[_0x3de73f(0x1fc)](_0x40953e*0x2/0x3)),_0x4a1063=await a54_0xfbc779({'type':_0x3de73f(0x2d3),'name':_0x3de73f(0x1a3),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x773215,'initial':-0x1,'limit':_0x4425ac,'clearFirst':!![],'fallback':{'title':_0x3de73f(0x1fe),'value':null},'suggest':(_0x4441c4,_0x3bb107)=>{const _0x525ce3=_0x3de73f;if(!_0x4441c4)return Promise['resolve'](_0x3bb107);const _0x299520=_0x3bb107[_0x525ce3(0x2c8)](_0xf43624=>{const _0x42a505=_0x525ce3,_0x50ed2e=_0xf43624;return _0x50ed2e[_0x42a505(0x1f7)][_0x42a505(0x22d)]()[_0x42a505(0x1cc)](_0x4441c4['toLowerCase']());});return Promise[_0x525ce3(0x2fc)](_0x299520);}}),_0x3ebd31=()=>{const _0x2d4986=_0x3de73f;process[_0x2d4986(0x19c)]['write'](_0x2d4986(0x1d9)),process[_0x2d4986(0x19c)][_0x2d4986(0x267)](_0x2d4986(0x1d9)),process[_0x2d4986(0x19c)]['write']('\x1b[1A\x1b[2K');},_0x3812a=_0x4a1063&&_0x4a1063[_0x3de73f(0x1a3)]&&_0x4a1063[_0x3de73f(0x1a3)]!==null&&_0x4a1063['attemptId'][_0x3de73f(0x334)]()!=='';if(!_0x3812a){_0x3ebd31(),console[_0x3de73f(0x224)](a54_0x5a87b0['dim'](_0x3de73f(0x1ec)));return;}_0x3ebd31();const _0x44f87c=_0x413cbc[_0x3de73f(0x281)](_0x86c14f=>_0x86c14f[_0x3de73f(0x1c4)]?.['id']===_0x4a1063[_0x3de73f(0x1a3)]);if(_0x44f87c){const _0x25ca8c=_0x44f87c[_0x3de73f(0x2e5)]?.[_0x3de73f(0x346)]||'?',_0x28fe12=_0x44f87c[_0x3de73f(0x266)]?.[_0x3de73f(0x346)]||'?';console[_0x3de73f(0x224)](_0x3de73f(0x1d1)+a54_0x5a87b0[_0x3de73f(0x1e4)](_0x25ca8c)+',\x20Workflow:\x20'+a54_0x5a87b0[_0x3de73f(0x1e4)](_0x28fe12));}const _0x4a1658=new WorkflowTimelineCommand();await _0x4a1658['execute']({'args':[],'options':{..._0x2e6b33,'attemptId':_0x4a1063[_0x3de73f(0x1a3)]},'tdx':_0x38f36e});}['generateSessionTimelineRows'](_0x5d0c9c,_0x23c206){const _0x475865=a54_0x478897,_0x260e73=new Map();for(const _0x2a8783 of _0x5d0c9c){_0x2a8783['id']&&_0x2a8783['lastAttempt']?.['id']&&_0x260e73[_0x475865(0x1f2)](_0x2a8783['id'],_0x2a8783[_0x475865(0x1c4)]['id']);}const _0x3b6fb9=[];let _0x153c97='';const _0x2564d3=this[_0x475865(0x212)](_0x5d0c9c,_0x23c206),_0x4db854=_0x2564d3[_0x475865(0x2de)]('\x0a');for(const _0x1059dc of _0x4db854){if(_0x1059dc[_0x475865(0x225)](_0x475865(0x2d8))||_0x1059dc['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x153c97=_0x1059dc;else{if(_0x1059dc[_0x475865(0x2e7)](/^[✅❌🔄🛑⏳]/)){const _0x522b3a=_0x1059dc[_0x475865(0x2e7)](/#(\d+)/),_0x56c295=_0x522b3a?_0x522b3a[0x1]:null,_0x3a625b=_0x56c295?_0x260e73[_0x475865(0x2e4)](_0x56c295)||null:null,_0x41a985=_0x5d0c9c[_0x475865(0x281)](_0x4cdc02=>_0x4cdc02['id']===_0x56c295),_0x4bb3a3=_0x41a985?.[_0x475865(0x2e5)]?.[_0x475865(0x346)]||'';_0x3b6fb9[_0x475865(0x240)]({'displayLine':_0x1059dc,'attemptId':_0x3a625b,'projectName':_0x4bb3a3});}}}return{'timelineRows':_0x3b6fb9,'timeAxisHeader':_0x153c97};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x478897(0x346)]='workflow:attempts';[a54_0x478897(0x320)]=a54_0x478897(0x25b);async[a54_0x478897(0x339)](_0x1b4321){const _0x399402=a54_0x478897,{options:_0x354eec,args:_0xdfaa1e,tdx:_0x9bc724}=_0x1b4321,_0x261f6e=this[_0x399402(0x1c1)](_0xdfaa1e,_0x354eec);if(!_0x261f6e)return 0x1;const {projectName:_0x18f620,workflowName:_0x6b4b7f}=_0x261f6e,_0x436adb=_0x354eec['includeRetried'];if(_0x354eec['verbose']){if(_0x18f620&&_0x6b4b7f)console[_0x399402(0x2f5)]('Filter:\x20'+_0x18f620+'.'+_0x6b4b7f);else _0x18f620&&console[_0x399402(0x2f5)]('Filter:\x20project='+_0x18f620);_0x436adb&&console[_0x399402(0x2f5)](_0x399402(0x257));}const _0x413e47=await withSpinner(_0x399402(0x328),()=>_0x9bc724[_0x399402(0x266)]['attempts']({'projectName':_0x18f620,'workflowName':_0x6b4b7f,'includeRetried':_0x436adb,'limit':_0x354eec['limit']}),{'verbose':_0x354eec['verbose']}),_0x435bf1=_0x413e47[_0x399402(0x223)],_0x128598=_0x354eec[_0x399402(0x1ff)]||0x64,_0x504a29=_0x435bf1[_0x399402(0x1b1)]>=_0x128598?a54_0x5a87b0[_0x399402(0x1e4)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x399402(0x2f5)]('✔\x20Found\x20'+_0x435bf1['length']+'\x20attempt'+(_0x435bf1['length']!==0x1?'s':'')+_0x504a29);if(_0x354eec[_0x399402(0x233)]===_0x399402(0x221)||_0x354eec['format']===_0x399402(0x2f0)||_0x354eec[_0x399402(0x233)]===_0x399402(0x216))await handleSDKOutput(_0x435bf1,_0x354eec);else{if(_0x435bf1[_0x399402(0x1b1)]===0x0){if(_0x18f620&&_0x6b4b7f)console[_0x399402(0x224)](_0x399402(0x2db)+_0x18f620+'.'+_0x6b4b7f);else _0x18f620?console[_0x399402(0x224)](_0x399402(0x2b0)+_0x18f620):console[_0x399402(0x224)](_0x399402(0x290));}else{const _0x580490=_0x354eec[_0x399402(0x30d)],_0x58e150=_0x435bf1[_0x399402(0x30b)](_0x47496e=>{const _0x4cfd92=_0x399402,_0x296598=a54_0x5a87b0[_0x4cfd92(0x1e4)]('#'+_0x47496e['id']),_0x52a231=_0x47496e[_0x4cfd92(0x2e5)]?.['id'],_0x59dc34=_0x47496e['session_id']||_0x47496e[_0x4cfd92(0x25c)],_0x179a26=_0x52a231&&_0x59dc34?hyperlink(_0x296598,getWorkflowAttemptUrl(_0x580490,_0x52a231,_0x59dc34,_0x47496e['id'])):_0x296598,{icon:_0xb4eb60,text:_0x98f3e}=getAttemptStatusDisplay(_0x47496e),_0x286d7b=(_0x47496e[_0x4cfd92(0x2e5)]?.[_0x4cfd92(0x346)]||'?')+'.'+(_0x47496e[_0x4cfd92(0x266)]?.['name']||'?'),_0xbf39d9=_0x47496e[_0x4cfd92(0x301)]?a54_0x5a87b0[_0x4cfd92(0x1e4)](_0x47496e[_0x4cfd92(0x301)]):'';return(_0x179a26+'\x20'+_0xb4eb60+(_0x98f3e?'\x20'+_0x98f3e:'')+'\x20'+_0x286d7b+'\x20'+_0xbf39d9)[_0x4cfd92(0x1cd)]();});await writeOutput(_0x58e150[_0x399402(0x1bc)]('\x0a'),_0x354eec[_0x399402(0x28d)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x204);['description']=a54_0x478897(0x21a);async[a54_0x478897(0x339)](_0x522d3c){const _0x51df4b=a54_0x478897,{options:_0x4b5b3a,args:_0x415b06,tdx:_0x307d08}=_0x522d3c,_0x31c702=_0x415b06[0x0];if(!_0x31c702)return console[_0x51df4b(0x2f5)](_0x51df4b(0x1dd)),0x1;_0x4b5b3a[_0x51df4b(0x1c0)]&&console[_0x51df4b(0x2f5)](_0x51df4b(0x282)+_0x31c702);const _0x578b2d=await withSpinner('Getting\x20attempt\x20details...',()=>_0x307d08['workflow']['attempt'](_0x31c702),{'verbose':_0x4b5b3a[_0x51df4b(0x1c0)]}),_0xbb5063=_0x578b2d['data'];let _0x1ce276;!_0xbb5063[_0x51df4b(0x25e)]?_0x1ce276=_0xbb5063[_0x51df4b(0x2c5)]?'canceling':_0x51df4b(0x296):_0x1ce276=_0xbb5063[_0x51df4b(0x2e1)]?_0x51df4b(0x2e1):_0x51df4b(0x2f5);let _0x2b2c6a;if(_0xbb5063['createdAt']&&_0xbb5063[_0x51df4b(0x2ce)]){const _0x38767e=new Date(_0xbb5063[_0x51df4b(0x327)])[_0x51df4b(0x300)](),_0x2a6269=new Date(_0xbb5063[_0x51df4b(0x2ce)])[_0x51df4b(0x300)]();_0x2b2c6a=Math[_0x51df4b(0x2d0)]((_0x2a6269-_0x38767e)/0x3e8);}const _0xb15cbd={'attempt_id':_0xbb5063['id'],'status':_0x1ce276,..._0xbb5063[_0x51df4b(0x2bd)]!==undefined&&{'index':_0xbb5063[_0x51df4b(0x2bd)]},..._0xbb5063[_0x51df4b(0x2e5)]&&{'project':_0xbb5063[_0x51df4b(0x2e5)]['name']},..._0xbb5063[_0x51df4b(0x266)]&&{'workflow':_0xbb5063['workflow'][_0x51df4b(0x346)]},..._0xbb5063[_0x51df4b(0x25c)]&&{'session_id':_0xbb5063[_0x51df4b(0x25c)]},..._0xbb5063[_0x51df4b(0x301)]&&{'session_time':_0xbb5063[_0x51df4b(0x301)]},..._0xbb5063[_0x51df4b(0x311)]&&{'retry_attempt':_0xbb5063[_0x51df4b(0x311)]},..._0x2b2c6a!==undefined&&{'duration_sec':_0x2b2c6a},..._0xbb5063[_0x51df4b(0x327)]&&{'created_at':_0xbb5063['createdAt']},..._0xbb5063[_0x51df4b(0x2ce)]&&{'finished_at':_0xbb5063[_0x51df4b(0x2ce)]},...Object[_0x51df4b(0x27b)](_0xbb5063['params'])['length']>0x0&&{'params':_0xbb5063['params']}};return await handleSingleObjectOutput(_0xb15cbd,_0x4b5b3a),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']='workflow:tasks';[a54_0x478897(0x320)]='Show\x20tasks\x20for\x20an\x20attempt';async['execute'](_0x388a23){const _0x523792=a54_0x478897,{options:_0x35b566,args:_0x3395fe,tdx:_0x40bf4a}=_0x388a23,_0x416b7f=_0x3395fe[0x0];if(!_0x416b7f)return console['error'](_0x523792(0x1dd)),0x1;const _0x3ccd16=_0x35b566[_0x523792(0x1e1)];_0x35b566[_0x523792(0x1c0)]&&(console[_0x523792(0x2f5)]('Attempt\x20ID:\x20'+_0x416b7f),_0x3ccd16&&console[_0x523792(0x2f5)](_0x523792(0x228)));const _0x105641=await withSpinner(_0x523792(0x31c),()=>_0x40bf4a[_0x523792(0x266)]['tasks'](_0x416b7f,_0x3ccd16||![]),{'verbose':_0x35b566[_0x523792(0x1c0)]}),_0x4e03ff=_0x105641[_0x523792(0x223)];return console[_0x523792(0x2f5)]('✔\x20Found\x20'+_0x4e03ff['length']+_0x523792(0x232)+(_0x4e03ff[_0x523792(0x1b1)]!==0x1?'s':'')),await handleSDKOutput(_0x4e03ff,_0x35b566),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x2a0);[a54_0x478897(0x320)]=a54_0x478897(0x217);async[a54_0x478897(0x339)](_0x4642ba){const _0x4dc0b4=a54_0x478897,{options:_0x282373,args:_0x17f08a,tdx:_0x5e5a2c}=_0x4642ba,_0x386901=_0x17f08a[0x0];let _0x2983b2=_0x17f08a[0x1];if(!_0x386901)return console[_0x4dc0b4(0x2f5)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x282373[_0x4dc0b4(0x1c0)]&&(console[_0x4dc0b4(0x2f5)]('Attempt\x20ID:\x20'+_0x386901),_0x2983b2&&console[_0x4dc0b4(0x2f5)](_0x4dc0b4(0x24f)+_0x2983b2));const _0x36108e=await withSpinner('Fetching\x20log\x20files...',()=>_0x5e5a2c['workflow'][_0x4dc0b4(0x323)](_0x386901,_0x2983b2),{'verbose':_0x282373[_0x4dc0b4(0x1c0)]}),_0x29398b=_0x36108e['data'];if(_0x29398b['length']===0x0)return console[_0x4dc0b4(0x2f5)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x2983b2&&(_0x282373['json']||_0x282373[_0x4dc0b4(0x233)]))return await handleSDKOutput(_0x29398b,_0x282373),0x0;if(!_0x2983b2){const _0x4e0e48=_0x29398b['map'](_0x17b142=>({'title':_0x17b142[_0x4dc0b4(0x2e2)]+'\x20('+formatBytes(_0x17b142[_0x4dc0b4(0x2ee)])+')','value':_0x17b142['taskName']})),_0x5a78af=await a54_0xfbc779({'type':_0x4dc0b4(0x30f),'name':_0x4dc0b4(0x23c),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x4e0e48});if(!_0x5a78af[_0x4dc0b4(0x23c)])return console['error'](_0x4dc0b4(0x1ec)),0x0;_0x2983b2=_0x5a78af[_0x4dc0b4(0x23c)];}const _0x35df87=await withSpinner('Downloading\x20logs...',()=>_0x5e5a2c[_0x4dc0b4(0x266)][_0x4dc0b4(0x1dc)](_0x386901,_0x2983b2),{'verbose':_0x282373[_0x4dc0b4(0x1c0)]}),_0x421b5d=_0x35df87[_0x4dc0b4(0x223)];return _0x421b5d?console[_0x4dc0b4(0x224)](_0x421b5d):console['error'](_0x4dc0b4(0x1b9)),0x0;}}function a54_0x50e0(_0x3bbbd8,_0x18c6cb){_0x3bbbd8=_0x3bbbd8-0x193;const _0xa03ea6=a54_0xa03e();let _0x50e058=_0xa03ea6[_0x3bbbd8];return _0x50e058;}export class WorkflowKillCommand extends BaseCommand{['name']=a54_0x478897(0x2d5);[a54_0x478897(0x320)]=a54_0x478897(0x27d);async[a54_0x478897(0x339)](_0x4b03c8){const _0x14591c=a54_0x478897,{options:_0x21b7ea,args:_0x5cb449,tdx:_0x4c0677}=_0x4b03c8,_0x4b5321=_0x5cb449[0x0];if(!_0x4b5321)return console['error'](_0x14591c(0x1dd)),0x1;const _0x296756=_0x21b7ea[_0x14591c(0x343)];_0x21b7ea['verbose']&&(console[_0x14591c(0x2f5)]('Attempt\x20ID:\x20'+_0x4b5321),_0x296756&&console[_0x14591c(0x2f5)](_0x14591c(0x345)+_0x296756));if(!_0x21b7ea[_0x14591c(0x1f5)]){if(!isInteractive())return console[_0x14591c(0x2f5)](a54_0x5a87b0['red']('\x0aError:'),_0x14591c(0x34b)),console[_0x14591c(0x2f5)](a54_0x5a87b0[_0x14591c(0x1e4)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2f57c9=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x4b5321+'?');if(!_0x2f57c9)return console['error'](a54_0x5a87b0['yellow'](_0x14591c(0x1ec))),0x1;}const _0x5bd8d7=await withSpinner(_0x14591c(0x24e),()=>_0x4c0677['workflow'][_0x14591c(0x1ce)](_0x4b5321,_0x296756),{'verbose':_0x21b7ea[_0x14591c(0x1c0)]}),_0x24e0e2=_0x5bd8d7[_0x14591c(0x223)];return console[_0x14591c(0x2f5)]('✔\x20'+_0x24e0e2),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x1ac);[a54_0x478897(0x320)]=a54_0x478897(0x2b3);async[a54_0x478897(0x339)](_0x5a4c30){const _0x33505c=a54_0x478897,{options:_0x5b66f4,args:_0x36cfa0,tdx:_0x5a065d}=_0x5a4c30,_0x5989f8=_0x36cfa0[0x0];if(!_0x5989f8)return console[_0x33505c(0x2f5)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x33505c(0x2f5)](_0x33505c(0x302)),0x1;let _0x11f2a0=![],_0x46f80c=_0x5989f8;if(_0x5989f8[_0x33505c(0x225)](_0x33505c(0x2ad)))_0x11f2a0=!![],_0x46f80c=_0x5989f8[_0x33505c(0x28c)](0x8);else{if(_0x5989f8['startsWith'](_0x33505c(0x213)))_0x11f2a0=![],_0x46f80c=_0x5989f8[_0x33505c(0x28c)](0x8);else return console[_0x33505c(0x2f5)](_0x33505c(0x2d6)),console[_0x33505c(0x2f5)](_0x33505c(0x302)),0x1;}const _0x4cf534=_0x5b66f4[_0x33505c(0x243)],_0x207383=_0x5b66f4[_0x33505c(0x1bd)],_0x263db1=_0x5b66f4[_0x33505c(0x269)],_0x1f8cd0=_0x5b66f4['force'];_0x5b66f4[_0x33505c(0x1c0)]&&(console[_0x33505c(0x2f5)]('Target:\x20'+(_0x11f2a0?_0x33505c(0x22a):'attempt')+'\x20'+_0x46f80c),_0x4cf534&&console[_0x33505c(0x2f5)]('From\x20task:\x20'+_0x4cf534),_0x207383&&console[_0x33505c(0x2f5)](_0x33505c(0x276)+_0x207383),_0x263db1&&console['error'](_0x33505c(0x258)+_0x263db1),_0x1f8cd0&&console[_0x33505c(0x2f5)](_0x33505c(0x253)));let _0x26c974;if(_0x263db1)try{if(_0x263db1['startsWith']('@')){const _0x57889c=await import(_0x33505c(0x2fa)),_0x29be29=_0x263db1[_0x33505c(0x28c)](0x1),_0x4989fc=await _0x57889c['readFile'](_0x29be29,_0x33505c(0x1f4));_0x26c974=JSON[_0x33505c(0x247)](_0x4989fc);}else _0x26c974=JSON[_0x33505c(0x247)](_0x263db1);}catch{return console['error'](_0x33505c(0x1a8)),0x1;}if(!_0x5b66f4[_0x33505c(0x1f5)]){if(!isInteractive())return console[_0x33505c(0x2f5)](a54_0x5a87b0[_0x33505c(0x264)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x33505c(0x2f5)](a54_0x5a87b0[_0x33505c(0x1e4)](_0x33505c(0x2dd))),0x1;const _0x5f5509=await confirmKey(_0x33505c(0x348)+(_0x11f2a0?'session':_0x33505c(0x21b))+'\x20'+_0x46f80c+'?');if(!_0x5f5509)return console[_0x33505c(0x2f5)](a54_0x5a87b0[_0x33505c(0x1c9)]('Cancelled')),0x1;}let _0x16b6a4;_0x11f2a0?_0x16b6a4=await withSpinner(_0x33505c(0x244),()=>_0x5a065d['workflow'][_0x33505c(0x2f2)](_0x46f80c,{'fromTask':_0x4cf534,'retryParams':_0x26c974}),{'verbose':_0x5b66f4[_0x33505c(0x1c0)]}):_0x16b6a4=await withSpinner(_0x33505c(0x314),()=>_0x5a065d[_0x33505c(0x266)][_0x33505c(0x2c1)](_0x46f80c,{'resumeFrom':_0x207383,'retryParams':_0x26c974,'force':_0x1f8cd0}),{'verbose':_0x5b66f4[_0x33505c(0x1c0)]});const _0x4db758=_0x16b6a4[_0x33505c(0x223)];return console[_0x33505c(0x2f5)](_0x33505c(0x1b6)),console[_0x33505c(0x2f5)](_0x33505c(0x286)+_0x4db758[_0x33505c(0x1a3)]),console['error'](_0x33505c(0x1e2)+_0x4db758['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a54_0x478897(0x239);['description']=a54_0x478897(0x31a);async[a54_0x478897(0x339)](_0x1223b4){const _0x4b015e=a54_0x478897,{options:_0xb65f25,args:_0xce90b1,tdx:_0x3f20e5}=_0x1223b4;let _0x47a920=_0xce90b1[0x0];if(!_0x47a920){const _0x13751b=this[_0x4b015e(0x284)]([],_0xb65f25),_0x435cf2=await withSpinner(_0x4b015e(0x248),()=>_0x3f20e5[_0x4b015e(0x266)][_0x4b015e(0x2af)](_0x13751b,{'limit':_0xb65f25[_0x4b015e(0x1ff)]}),{'verbose':_0xb65f25[_0x4b015e(0x1c0)]}),_0x39b29d=_0x435cf2[_0x4b015e(0x223)];if(_0x39b29d['length']===0x0)return console[_0x4b015e(0x2f5)]('No\x20workflows\x20found'),!_0x13751b&&console[_0x4b015e(0x2f5)](a54_0x5a87b0[_0x4b015e(0x1e4)](_0x4b015e(0x2f1))),0x1;const _0x5d1615=_0x39b29d['map'](_0x1ef705=>({'title':_0x1ef705[_0x4b015e(0x2e5)]?.['name']+'.'+_0x1ef705[_0x4b015e(0x346)],'value':_0x1ef705['project']?.['name']+'.'+_0x1ef705[_0x4b015e(0x346)],'description':_0x1ef705[_0x4b015e(0x226)]?_0x4b015e(0x2c0)+_0x1ef705['revision']:undefined})),_0x2a1b81=await a54_0xfbc779({'type':_0x4b015e(0x30f),'name':_0x4b015e(0x266),'message':_0x4b015e(0x2b4),'choices':_0x5d1615});if(!_0x2a1b81['workflow'])return 0x1;_0x47a920=_0x2a1b81[_0x4b015e(0x266)];}if(!_0x47a920[_0x4b015e(0x1cc)]('.')){const _0x5dc404=this[_0x4b015e(0x284)]([],_0xb65f25);if(_0x5dc404)_0x47a920=_0x5dc404+'.'+_0x47a920;else return console['error'](a54_0x5a87b0[_0x4b015e(0x264)]('Error:'),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x4b015e(0x2f5)](a54_0x5a87b0['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x45fe6f=_0xb65f25[_0x4b015e(0x2a9)],_0x4def62=_0xb65f25[_0x4b015e(0x301)],_0x3aecd1={};if(_0x45fe6f&&Array[_0x4b015e(0x271)](_0x45fe6f))for(const _0x422ac8 of _0x45fe6f){const _0x20a73c=_0x422ac8['indexOf']('=');if(_0x20a73c===-0x1)return console[_0x4b015e(0x2f5)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x422ac8),console[_0x4b015e(0x2f5)](_0x4b015e(0x246)),0x1;const _0x5d7e19=_0x422ac8[_0x4b015e(0x28c)](0x0,_0x20a73c),_0x514d56=_0x422ac8['substring'](_0x20a73c+0x1);try{_0x3aecd1[_0x5d7e19]=JSON['parse'](_0x514d56);}catch{_0x3aecd1[_0x5d7e19]=_0x514d56;}}_0xb65f25['verbose']&&(console[_0x4b015e(0x2f5)](_0x4b015e(0x1e3)+_0x47a920),Object['keys'](_0x3aecd1)[_0x4b015e(0x1b1)]>0x0&&console[_0x4b015e(0x2f5)](_0x4b015e(0x2a7)+JSON[_0x4b015e(0x2cf)](_0x3aecd1)),_0x4def62&&console[_0x4b015e(0x2f5)](_0x4b015e(0x332)+_0x4def62));const _0x3a92b2=await withSpinner('Starting\x20workflow\x20run...',()=>_0x3f20e5['workflow'][_0x4b015e(0x27f)](_0x47a920,_0x3aecd1,{'sessionTime':_0x4def62}),{'verbose':_0xb65f25[_0x4b015e(0x1c0)]}),_0x56bffb=_0x3a92b2['data'];console[_0x4b015e(0x2f5)]('✔\x20Workflow\x20run\x20started'),console[_0x4b015e(0x2f5)](_0x4b015e(0x1d4)+_0x56bffb['id']),console[_0x4b015e(0x2f5)]('\x20\x20Session\x20ID:\x20'+_0x56bffb[_0x4b015e(0x25c)]),console['error'](_0x4b015e(0x299)+_0x56bffb[_0x4b015e(0x2e5)]?.[_0x4b015e(0x346)]),console[_0x4b015e(0x2f5)]('\x20\x20Workflow:\x20'+_0x56bffb[_0x4b015e(0x266)]?.[_0x4b015e(0x346)]);if(_0x56bffb[_0x4b015e(0x2e5)]?.['id']&&_0x56bffb[_0x4b015e(0x25c)]&&_0x56bffb['id']){const _0x42d0ca=_0xb65f25['site'],_0x23957e=getConsoleUrl(_0x42d0ca,'/app/workflows/'+_0x56bffb[_0x4b015e(0x2e5)]['id']+'/sessions/'+_0x56bffb[_0x4b015e(0x25c)]+_0x4b015e(0x230)+_0x56bffb['id']);console['error'](_0x4b015e(0x275)+a54_0x5a87b0[_0x4b015e(0x2c4)](_0x23957e));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a54_0x478897(0x241);[a54_0x478897(0x320)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a54_0x478897(0x339)](_0x170206){const _0x3c3e85=a54_0x478897,{options:_0x204ce3,args:_0x179958,tdx:_0x168b5a}=_0x170206,_0x18219b=_0x179958[0x0],_0x2f9124=_0x179958[0x1]||'.';if(!_0x18219b)return console['error'](_0x3c3e85(0x347)),console[_0x3c3e85(0x2f5)](_0x3c3e85(0x1e8)),0x1;const _0x5cc57f=_0x204ce3[_0x3c3e85(0x226)];_0x204ce3['verbose']&&(console['error'](_0x3c3e85(0x1d1)+_0x18219b),console[_0x3c3e85(0x2f5)](_0x3c3e85(0x29d)+_0x2f9124),_0x5cc57f&&console[_0x3c3e85(0x2f5)](_0x3c3e85(0x283)+_0x5cc57f));const _0x25d96c=await withSpinner(_0x3c3e85(0x1d8)+_0x18219b+_0x3c3e85(0x22b),()=>_0x168b5a[_0x3c3e85(0x266)][_0x3c3e85(0x26a)](_0x18219b,_0x2f9124,{'revision':_0x5cc57f}),{'verbose':_0x204ce3[_0x3c3e85(0x1c0)]}),_0x4aa304=_0x25d96c['data'];return console[_0x3c3e85(0x2f5)]('✔\x20Downloaded\x20'+_0x4aa304['projectName']),console[_0x3c3e85(0x2f5)](_0x3c3e85(0x20d)+_0x4aa304[_0x3c3e85(0x226)]),console[_0x3c3e85(0x2f5)](_0x3c3e85(0x2e9)+_0x4aa304['filesExtracted']),console['error']('\x20\x20Location:\x20'+_0x2f9124+'/'+_0x4aa304[_0x3c3e85(0x2b7)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a54_0x478897(0x259);[a54_0x478897(0x320)]=a54_0x478897(0x2df);async[a54_0x478897(0x339)](_0x192c4e){const _0x403008=a54_0x478897,{options:_0x5477f2,args:_0x1537f9,tdx:_0x81d132}=_0x192c4e;let _0x11329e='.',_0x9d26cf=_0x5477f2['name'];if(_0x1537f9[0x0]){const {promises:_0x181706}=await import('fs');try{const _0x59eb4b=await _0x181706[_0x403008(0x325)](_0x1537f9[0x0]);if(_0x59eb4b[_0x403008(0x20a)]())_0x11329e=_0x1537f9[0x0];else return console[_0x403008(0x2f5)](_0x403008(0x1ad)+_0x1537f9[0x0]+_0x403008(0x1ba)),0x1;}catch{_0x9d26cf=_0x1537f9[0x0],_0x11329e='.';}}const _0x4c5d55=_0x5477f2[_0x403008(0x226)],_0x1cae0e=_0x5477f2[_0x403008(0x19f)];_0x5477f2[_0x403008(0x1c0)]&&(console[_0x403008(0x2f5)](_0x403008(0x2da)+_0x11329e),_0x9d26cf&&console[_0x403008(0x2f5)](_0x403008(0x2b5)+_0x9d26cf),_0x4c5d55&&console['error'](_0x403008(0x283)+_0x4c5d55),_0x1cae0e&&console[_0x403008(0x2f5)](_0x403008(0x1b4)));const _0x409733=await withSpinner(_0x403008(0x28b),()=>_0x81d132[_0x403008(0x266)][_0x403008(0x240)](_0x11329e,{'projectName':_0x9d26cf,'revision':_0x4c5d55,'skipValidation':_0x1cae0e}),{'verbose':_0x5477f2[_0x403008(0x1c0)]}),_0x2658fb=_0x409733['data'];return console[_0x403008(0x2f5)](_0x403008(0x33a)+_0x2658fb[_0x403008(0x2b7)]),console[_0x403008(0x2f5)](_0x403008(0x1df)+_0x2658fb['projectId']),console['error']('\x20\x20Revision:\x20'+_0x2658fb[_0x403008(0x226)]),await this[_0x403008(0x236)](_0x81d132,_0x2658fb[_0x403008(0x2b7)],_0x5477f2[_0x403008(0x30d)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x478897(0x346)]='workflow:pull';[a54_0x478897(0x320)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async['execute'](_0x5a7400){const _0x1ee59a=a54_0x478897,{options:_0x5bfe47,args:_0x44a152,tdx:_0x873da8}=_0x5a7400,_0x200e75=_0x44a152[0x0],_0x447281=_0x44a152[0x1];if(!_0x200e75)return console[_0x1ee59a(0x2f5)](a54_0x5a87b0[_0x1ee59a(0x264)]('Error:'),_0x1ee59a(0x2d9)),console['error'](a54_0x5a87b0[_0x1ee59a(0x1e4)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x5baaab=_0x5bfe47['revision'];_0x5bfe47[_0x1ee59a(0x1c0)]&&(console[_0x1ee59a(0x2f5)]('Project:\x20'+_0x200e75),_0x447281&&console['error'](_0x1ee59a(0x29a)+_0x447281),_0x5baaab&&console['error'](_0x1ee59a(0x283)+_0x5baaab),_0x5bfe47[_0x1ee59a(0x1d7)]&&console[_0x1ee59a(0x2f5)]('Dry\x20run:\x20yes'));const _0x59c2bd=await withSpinner(_0x1ee59a(0x324)+_0x200e75+'...',()=>_0x873da8[_0x1ee59a(0x266)][_0x1ee59a(0x249)](_0x200e75,{'targetDir':_0x447281,'revision':_0x5baaab}),{'verbose':_0x5bfe47[_0x1ee59a(0x1c0)]}),_0x1aa498=_0x59c2bd['data'];_0x1aa498[_0x1ee59a(0x24a)]?console['error']('→\x20New\x20project:\x20'+_0x1aa498['projectName']):console['error']('→\x20Project:\x20'+_0x1aa498[_0x1ee59a(0x2b7)]);console['error']('\x20\x20Revision:\x20'+_0x1aa498[_0x1ee59a(0x226)]),console[_0x1ee59a(0x2f5)](_0x1ee59a(0x1a1)+(a54_0x2b2dff[_0x1ee59a(0x207)](process[_0x1ee59a(0x215)](),_0x1aa498[_0x1ee59a(0x234)])||'.')),console[_0x1ee59a(0x2f5)](_0x1ee59a(0x2ae)+a54_0x5a87b0[_0x1ee59a(0x31f)]('+'+_0x1aa498[_0x1ee59a(0x1a6)][_0x1ee59a(0x304)]+'\x20new')+',\x20'+(a54_0x5a87b0[_0x1ee59a(0x1c9)]('~'+_0x1aa498[_0x1ee59a(0x1a6)][_0x1ee59a(0x1b3)]+'\x20modified')+',\x20')+(a54_0x5a87b0[_0x1ee59a(0x264)]('-'+_0x1aa498['summary'][_0x1ee59a(0x2f3)]+_0x1ee59a(0x2ff))+',\x20')+(''+a54_0x5a87b0[_0x1ee59a(0x1e4)](_0x1aa498[_0x1ee59a(0x1a6)][_0x1ee59a(0x25f)]+_0x1ee59a(0x306))));for(const _0x521698 of _0x1aa498[_0x1ee59a(0x19e)]){_0x521698[_0x1ee59a(0x291)]===_0x1ee59a(0x1b3)&&_0x521698[_0x1ee59a(0x277)]&&(console['error']('\x0a'+a54_0x5a87b0[_0x1ee59a(0x2c4)](_0x1ee59a(0x329)+_0x521698['path'])),console[_0x1ee59a(0x2f5)](_0x521698[_0x1ee59a(0x277)]));}if(!_0x1aa498[_0x1ee59a(0x1eb)])return saveSessionContext({'workflow_project':_0x1aa498['projectName']},_0x5bfe47[_0x1ee59a(0x22a)]),console[_0x1ee59a(0x2f5)](a54_0x5a87b0['green']('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x1ee59a(0x2f5)](a54_0x5a87b0['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x1aa498[_0x1ee59a(0x2b7)])),0x0;if(_0x5bfe47[_0x1ee59a(0x1d7)])return console[_0x1ee59a(0x2f5)](a54_0x5a87b0[_0x1ee59a(0x1c9)](_0x1ee59a(0x268))),0x0;if(!_0x5bfe47[_0x1ee59a(0x1f5)]){if(!isInteractive())return console[_0x1ee59a(0x2f5)](a54_0x5a87b0[_0x1ee59a(0x264)](_0x1ee59a(0x211)),_0x1ee59a(0x34b)),console[_0x1ee59a(0x2f5)](a54_0x5a87b0[_0x1ee59a(0x1e4)](_0x1ee59a(0x2dd))),0x1;const _0xa59623=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0xa59623)return console['error'](a54_0x5a87b0['yellow'](_0x1ee59a(0x1ec)),_0x1ee59a(0x22f)),0x1;}await withSpinner(_0x1ee59a(0x24c),()=>_0x873da8[_0x1ee59a(0x266)][_0x1ee59a(0x19d)](_0x1aa498,{'revision':_0x5baaab}),{'verbose':_0x5bfe47['verbose']}),saveSessionContext({'workflow_project':_0x1aa498['projectName']},_0x5bfe47[_0x1ee59a(0x22a)]),console[_0x1ee59a(0x2f5)](a54_0x5a87b0[_0x1ee59a(0x31f)](_0x1ee59a(0x1c5)));const _0x1d8851=a54_0x2b2dff[_0x1ee59a(0x207)](process[_0x1ee59a(0x215)](),_0x1aa498[_0x1ee59a(0x234)])||'.';return console[_0x1ee59a(0x2f5)](a54_0x5a87b0[_0x1ee59a(0x1e4)](_0x1ee59a(0x21e)+_0x1d8851)),console[_0x1ee59a(0x2f5)](a54_0x5a87b0[_0x1ee59a(0x1e4)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x1aa498[_0x1ee59a(0x2b7)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x2b8);[a54_0x478897(0x320)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a54_0x478897(0x339)](_0x3c501c){const _0x221902=a54_0x478897,{options:_0x4e3e09,args:_0x486117,tdx:_0xa37c5d}=_0x3c501c,_0x4a3c57=this[_0x221902(0x32a)](_0x486117,_0x4e3e09),_0x5d93a2=_0x4e3e09[_0x221902(0x226)],_0x16f652=_0x4e3e09[_0x221902(0x19f)];_0x4e3e09['verbose']&&(_0x4a3c57&&console[_0x221902(0x2f5)](_0x221902(0x2c7)+_0x4a3c57),_0x5d93a2&&console[_0x221902(0x2f5)](_0x221902(0x283)+_0x5d93a2),_0x4e3e09[_0x221902(0x1d7)]&&console[_0x221902(0x2f5)](_0x221902(0x312)),_0x16f652&&console[_0x221902(0x2f5)](_0x221902(0x1b4)));let _0xbf7fb3;try{_0xbf7fb3=await withSpinner(_0x221902(0x2c6),()=>_0xa37c5d[_0x221902(0x266)]['preparePushProject']({'sourceDir':_0x4a3c57,'revision':_0x5d93a2,'skipValidation':_0x16f652}),{'verbose':_0x4e3e09[_0x221902(0x1c0)]});}catch(_0x5b06b7){if(_0x5b06b7 instanceof Error&&_0x5b06b7[_0x221902(0x1a4)][_0x221902(0x1cc)](_0x221902(0x307)))return console[_0x221902(0x2f5)](a54_0x5a87b0['red'](_0x221902(0x32c)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x4e3e09[_0x221902(0x2f7)]?console[_0x221902(0x2f5)](a54_0x5a87b0['dim']('Tip:\x20cd\x20to\x20workflows/'+_0x4e3e09[_0x221902(0x2f7)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x4e3e09['workflowProject']+'\x27')):console[_0x221902(0x2f5)](a54_0x5a87b0[_0x221902(0x1e4)](_0x221902(0x2cb))),0x1;throw _0x5b06b7;}const _0xab789f=_0xbf7fb3[_0x221902(0x223)];console[_0x221902(0x2f5)](_0x221902(0x28a)+_0xab789f[_0x221902(0x2b7)]),console[_0x221902(0x2f5)](_0x221902(0x195)+_0xab789f[_0x221902(0x20e)]),console['error']('\x20\x20Revision:\x20'+_0xab789f['revision']),console[_0x221902(0x2f5)](_0x221902(0x2ae)+a54_0x5a87b0[_0x221902(0x31f)]('+'+_0xab789f['summary'][_0x221902(0x304)]+_0x221902(0x1e6))+',\x20'+(a54_0x5a87b0[_0x221902(0x1c9)]('~'+_0xab789f['summary']['modified']+'\x20modified')+',\x20')+(a54_0x5a87b0['red']('-'+_0xab789f['summary'][_0x221902(0x2f3)]+_0x221902(0x2ff))+',\x20')+(''+a54_0x5a87b0[_0x221902(0x1e4)](_0xab789f['summary']['unchanged']+_0x221902(0x306))));for(const _0x35f1d7 of _0xab789f['changes']){_0x35f1d7[_0x221902(0x291)]===_0x221902(0x1b3)&&_0x35f1d7[_0x221902(0x277)]&&(console['error']('\x0a'+a54_0x5a87b0[_0x221902(0x2c4)](_0x221902(0x329)+_0x35f1d7['path'])),console[_0x221902(0x2f5)](_0x35f1d7[_0x221902(0x277)]));}if(!_0xab789f[_0x221902(0x1eb)])return console['error'](a54_0x5a87b0['green'](_0x221902(0x220))),await this[_0x221902(0x236)](_0xa37c5d,_0xab789f[_0x221902(0x2b7)],_0x4e3e09[_0x221902(0x30d)]),0x0;if(_0x4e3e09[_0x221902(0x1d7)])return console['error'](a54_0x5a87b0[_0x221902(0x1c9)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x4e3e09['yes']){if(!isInteractive())return console[_0x221902(0x2f5)](a54_0x5a87b0[_0x221902(0x264)]('\x0aError:'),_0x221902(0x34b)),console[_0x221902(0x2f5)](a54_0x5a87b0[_0x221902(0x1e4)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x22d378=await confirmKey(_0x221902(0x21c));if(!_0x22d378)return console[_0x221902(0x2f5)](a54_0x5a87b0[_0x221902(0x1c9)](_0x221902(0x1ec)),_0x221902(0x321)),0x1;}const _0x25d277=await withSpinner(_0x221902(0x2fe),()=>_0xa37c5d['workflow'][_0x221902(0x2d7)](_0xab789f),{'verbose':_0x4e3e09[_0x221902(0x1c0)]}),_0x29c6db=_0x25d277[_0x221902(0x223)];return console['error'](a54_0x5a87b0['green'](_0x221902(0x203))),console[_0x221902(0x2f5)]('\x20\x20Project\x20ID:\x20'+_0x29c6db[_0x221902(0x262)]),console[_0x221902(0x2f5)](_0x221902(0x20d)+_0x29c6db['revision']),await this[_0x221902(0x236)](_0xa37c5d,_0x29c6db[_0x221902(0x2b7)],_0x4e3e09[_0x221902(0x30d)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x297);[a54_0x478897(0x320)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a54_0x478897(0x339)](_0x4bb390){const _0x54242c=a54_0x478897,{options:_0x171aaa,args:_0x55e640,tdx:_0x5d5051}=_0x4bb390,_0x5e27f9=this[_0x54242c(0x32a)](_0x55e640,_0x171aaa),_0x5aa922=_0x171aaa[_0x54242c(0x346)],_0x155b79=_0x171aaa[_0x54242c(0x226)],_0x31becb=_0x171aaa[_0x54242c(0x19f)];if(!_0x5e27f9)return console[_0x54242c(0x2f5)](a54_0x5a87b0[_0x54242c(0x264)]('Error:'),_0x54242c(0x24b)),console[_0x54242c(0x2f5)](a54_0x5a87b0[_0x54242c(0x1e4)](_0x54242c(0x1f8))),console[_0x54242c(0x2f5)](a54_0x5a87b0[_0x54242c(0x1e4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x5aa922)return console['error'](a54_0x5a87b0['red'](_0x54242c(0x32c)),_0x54242c(0x26b)),console[_0x54242c(0x2f5)](a54_0x5a87b0[_0x54242c(0x1e4)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x171aaa[_0x54242c(0x1c0)]&&(console[_0x54242c(0x2f5)](_0x54242c(0x2c7)+_0x5e27f9),console[_0x54242c(0x2f5)]('New\x20project\x20name:\x20'+_0x5aa922),_0x155b79&&console[_0x54242c(0x2f5)](_0x54242c(0x283)+_0x155b79),_0x171aaa['dryRun']&&console[_0x54242c(0x2f5)](_0x54242c(0x312)),_0x31becb&&console[_0x54242c(0x2f5)](_0x54242c(0x1b4)));const _0x40c715=await withSpinner(_0x54242c(0x229),()=>_0x5d5051[_0x54242c(0x266)][_0x54242c(0x308)](_0x5e27f9,_0x5aa922,{'revision':_0x155b79,'skipValidation':_0x31becb}),{'verbose':_0x171aaa['verbose']}),_0x24b4e6=_0x40c715['data'];console[_0x54242c(0x2f5)](_0x54242c(0x1b0)+_0x24b4e6[_0x54242c(0x20e)]);_0x24b4e6['sourceProjectName']&&console[_0x54242c(0x2f5)](_0x54242c(0x30a)+_0x24b4e6[_0x54242c(0x2be)]);console[_0x54242c(0x2f5)](_0x54242c(0x33e)+_0x24b4e6[_0x54242c(0x1bb)]),console[_0x54242c(0x2f5)](_0x54242c(0x283)+_0x24b4e6[_0x54242c(0x226)]),console[_0x54242c(0x2f5)]('Files\x20to\x20upload:\x20'+_0x24b4e6['fileCount']);_0x24b4e6[_0x54242c(0x2d1)]&&(console[_0x54242c(0x2f5)](a54_0x5a87b0[_0x54242c(0x1c9)]('\x0a⚠\x20Project\x20\x22'+_0x24b4e6[_0x54242c(0x1bb)]+_0x54242c(0x278)+_0x24b4e6[_0x54242c(0x294)]+')')),console[_0x54242c(0x2f5)](a54_0x5a87b0[_0x54242c(0x1c9)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x171aaa['dryRun'])return console[_0x54242c(0x2f5)](a54_0x5a87b0['yellow']('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x171aaa['yes']){if(!isInteractive())return console[_0x54242c(0x2f5)](a54_0x5a87b0[_0x54242c(0x264)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x54242c(0x2f5)](a54_0x5a87b0[_0x54242c(0x1e4)](_0x54242c(0x2dd))),0x1;const _0x3642cf=_0x24b4e6[_0x54242c(0x2be)]||a54_0x2b2dff['basename'](_0x5e27f9),_0x31c52e=_0x24b4e6[_0x54242c(0x2d1)]?_0x54242c(0x256)+_0x5aa922+_0x54242c(0x285):_0x54242c(0x2ec)+_0x3642cf+'\x22\x20to\x20new\x20project\x20\x22'+_0x5aa922+'\x22?',_0x584838=await confirmKey(_0x31c52e);if(!_0x584838)return console[_0x54242c(0x2f5)](a54_0x5a87b0[_0x54242c(0x1c9)](_0x54242c(0x1ec))),0x1;}const _0x629f15=await withSpinner(_0x24b4e6[_0x54242c(0x2d1)]?_0x54242c(0x1f0)+_0x5aa922+_0x54242c(0x22b):_0x54242c(0x333)+_0x5aa922+_0x54242c(0x22b),()=>_0x5d5051[_0x54242c(0x266)][_0x54242c(0x315)](_0x24b4e6),{'verbose':_0x171aaa[_0x54242c(0x1c0)]}),_0x38b192=_0x629f15[_0x54242c(0x223)];return console['error'](a54_0x5a87b0[_0x54242c(0x31f)](_0x24b4e6['targetExists']?'✔\x20Project\x20updated':_0x54242c(0x27a))),console[_0x54242c(0x2f5)](_0x54242c(0x299)+_0x38b192[_0x54242c(0x1bb)]),console['error'](_0x54242c(0x1df)+_0x38b192[_0x54242c(0x1f1)]),console[_0x54242c(0x2f5)](_0x54242c(0x20d)+_0x38b192['revision']),await this[_0x54242c(0x236)](_0x5d5051,_0x38b192[_0x54242c(0x1bb)],_0x171aaa[_0x54242c(0x30d)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']='workflow:delete';[a54_0x478897(0x320)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a54_0x478897(0x339)](_0x47cd18){const _0x24c0ac=a54_0x478897,{options:_0x124cf3,args:_0x32492f,tdx:_0x543cbf}=_0x47cd18,_0x482277=_0x32492f[0x0];if(!_0x482277)return console['error'](_0x24c0ac(0x34d)),console[_0x24c0ac(0x2f5)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x124cf3[_0x24c0ac(0x1c0)]&&console['error'](_0x24c0ac(0x1d1)+_0x482277);if(!_0x124cf3[_0x24c0ac(0x1f5)]){if(!isInteractive())return console[_0x24c0ac(0x2f5)](a54_0x5a87b0[_0x24c0ac(0x264)](_0x24c0ac(0x211)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x5a87b0[_0x24c0ac(0x1e4)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x38277b=await confirmKey(_0x24c0ac(0x23a)+_0x482277+_0x24c0ac(0x1ef));if(!_0x38277b)return console[_0x24c0ac(0x2f5)](a54_0x5a87b0[_0x24c0ac(0x1c9)]('Cancelled')),0x1;}const _0x598735=await withSpinner(_0x24c0ac(0x29c)+_0x482277+'...',()=>_0x543cbf['workflow']['delete'](_0x482277),{'verbose':_0x124cf3[_0x24c0ac(0x1c0)]}),_0x2f6fee=_0x598735[_0x24c0ac(0x223)];return console[_0x24c0ac(0x2f5)](_0x24c0ac(0x1b2)+_0x2f6fee[_0x24c0ac(0x2b7)]),console[_0x24c0ac(0x2f5)](_0x24c0ac(0x1df)+_0x2f6fee[_0x24c0ac(0x262)]),0x0;}}export function parseKeyValue(_0x36351e){const _0x406c62=a54_0x478897,_0x31057b=_0x36351e[_0x406c62(0x2f6)]('=');if(_0x31057b===-0x1)throw new Error(_0x406c62(0x2c3)+_0x36351e+_0x406c62(0x2f4));const _0x200501=_0x36351e[_0x406c62(0x28c)](0x0,_0x31057b),_0xea32b9=_0x36351e[_0x406c62(0x28c)](_0x31057b+0x1);if(!_0x200501)throw new Error(_0x406c62(0x214));return{'key':_0x200501,'value':_0xea32b9};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x478897(0x346)]='workflow:secrets:list';[a54_0x478897(0x320)]=a54_0x478897(0x2d4);async[a54_0x478897(0x339)](_0x2762ff){const _0x4019c1=a54_0x478897,{options:_0x2a40a1,args:_0x227be1,tdx:_0x16c181}=_0x2762ff,_0x38e5ad=this[_0x4019c1(0x263)](_0x227be1,_0x2a40a1);if(!_0x38e5ad)return 0x1;_0x2a40a1['verbose']&&console[_0x4019c1(0x2f5)](_0x4019c1(0x1d1)+_0x38e5ad);const _0x475f1e=await withSpinner(_0x4019c1(0x33f),()=>_0x16c181[_0x4019c1(0x266)][_0x4019c1(0x280)](_0x38e5ad),{'verbose':_0x2a40a1[_0x4019c1(0x1c0)]}),{secrets:_0x3e97be}=_0x475f1e[_0x4019c1(0x223)];return console['error'](_0x4019c1(0x1ab)+_0x3e97be[_0x4019c1(0x1b1)]+_0x4019c1(0x2cd)+(_0x3e97be[_0x4019c1(0x1b1)]!==0x1?'s':'')),await handleSDKOutput(_0x3e97be,_0x2a40a1),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x478897(0x346)]='workflow:secrets:set';[a54_0x478897(0x320)]=a54_0x478897(0x1fb);async[a54_0x478897(0x339)](_0x42b1e7){const _0x5e1810=a54_0x478897,{options:_0x20e296,args:_0x497f11,tdx:_0x2e3de4}=_0x42b1e7;let _0x44bfd8,_0x10167e;if(_0x497f11[_0x5e1810(0x1b1)]>=0x1&&!_0x497f11[0x0]['includes']('='))_0x44bfd8=_0x497f11[0x0],_0x10167e=_0x497f11['slice'](0x1);else{if(_0x497f11[_0x5e1810(0x1b1)]>=0x1&&_0x20e296[_0x5e1810(0x2f7)])_0x44bfd8=_0x20e296[_0x5e1810(0x2f7)],_0x10167e=_0x497f11;else return _0x497f11[_0x5e1810(0x1b1)]>=0x1?(console['error'](_0x5e1810(0x347)),console[_0x5e1810(0x2f5)](_0x5e1810(0x2f1)),0x1):(console['error'](_0x5e1810(0x34f)),console[_0x5e1810(0x2f5)](_0x5e1810(0x1d6)),0x1);}if(_0x10167e[_0x5e1810(0x1b1)]===0x0)return console[_0x5e1810(0x2f5)](_0x5e1810(0x34f)),console[_0x5e1810(0x2f5)](_0x5e1810(0x1d6)),0x1;const _0x305ad6={};try{for(const _0x10fbfc of _0x10167e){const {key:_0x211f0e,value:_0x1197e4}=parseKeyValue(_0x10fbfc);_0x305ad6[_0x211f0e]=_0x1197e4;}}catch(_0x468380){return _0x468380 instanceof Error&&console[_0x5e1810(0x2f5)](a54_0x5a87b0[_0x5e1810(0x264)](_0x5e1810(0x32c)),_0x468380[_0x5e1810(0x1a4)]),0x1;}const _0xbd5947=Object[_0x5e1810(0x27b)](_0x305ad6);_0x20e296['verbose']&&(console[_0x5e1810(0x2f5)](_0x5e1810(0x1d1)+_0x44bfd8),console['error'](_0x5e1810(0x30c)+_0xbd5947['join'](',\x20')));const _0x5f16a9=await withSpinner(_0xbd5947[_0x5e1810(0x1b1)]===0x1?_0x5e1810(0x1da):'Setting\x20'+_0xbd5947['length']+_0x5e1810(0x209),()=>_0x2e3de4[_0x5e1810(0x266)][_0x5e1810(0x26f)](_0x44bfd8,_0x305ad6),{'verbose':_0x20e296[_0x5e1810(0x1c0)]}),_0x1be561=_0x5f16a9['data'];return console[_0x5e1810(0x2f5)](_0xbd5947[_0x5e1810(0x1b1)]===0x1?_0x5e1810(0x2ba)+_0x1be561[_0x5e1810(0x27b)][0x0]+_0x5e1810(0x295)+_0x1be561[_0x5e1810(0x2b7)]+'\x27':'✔\x20'+_0x1be561['keys'][_0x5e1810(0x1b1)]+_0x5e1810(0x238)+_0x1be561[_0x5e1810(0x2b7)]+'\x27'),(_0x20e296[_0x5e1810(0x221)]||_0x20e296[_0x5e1810(0x2f0)])&&await handleSingleObjectOutput(_0x1be561,_0x20e296),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x289);[a54_0x478897(0x320)]=a54_0x478897(0x206);async[a54_0x478897(0x339)](_0x264cde){const _0x2b5143=a54_0x478897,{options:_0x569b94,args:_0x280d72,tdx:_0x18252f}=_0x264cde;let _0x220d45,_0xd21765;if(_0x280d72[_0x2b5143(0x1b1)]>=0x2)_0x220d45=_0x280d72[0x0],_0xd21765=_0x280d72[0x1];else{if(_0x280d72[_0x2b5143(0x1b1)]===0x1&&_0x569b94[_0x2b5143(0x2f7)])_0x220d45=_0x569b94[_0x2b5143(0x2f7)],_0xd21765=_0x280d72[0x0];else return _0x280d72[_0x2b5143(0x1b1)]===0x1?(console[_0x2b5143(0x2f5)](_0x2b5143(0x347)),console[_0x2b5143(0x2f5)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error'](_0x2b5143(0x273)),console[_0x2b5143(0x2f5)](_0x2b5143(0x338)),0x1);}_0x569b94[_0x2b5143(0x1c0)]&&(console[_0x2b5143(0x2f5)](_0x2b5143(0x1d1)+_0x220d45),console['error'](_0x2b5143(0x292)+_0xd21765));if(!_0x569b94['yes']){if(!isInteractive())return console[_0x2b5143(0x2f5)](a54_0x5a87b0[_0x2b5143(0x264)](_0x2b5143(0x211)),_0x2b5143(0x34b)),console[_0x2b5143(0x2f5)](a54_0x5a87b0['dim'](_0x2b5143(0x2dd))),0x1;const _0x6abfe4=await confirmKey(_0x2b5143(0x1a0)+_0xd21765+_0x2b5143(0x219)+_0x220d45+'\x27?');if(!_0x6abfe4)return console[_0x2b5143(0x2f5)](a54_0x5a87b0[_0x2b5143(0x1c9)](_0x2b5143(0x1ec))),0x1;}const _0x1d0cd3=await withSpinner(_0x2b5143(0x2e0),()=>_0x18252f['workflow'][_0x2b5143(0x201)](_0x220d45,_0xd21765),{'verbose':_0x569b94[_0x2b5143(0x1c0)]}),_0x2a924b=_0x1d0cd3['data'];return console['error'](_0x2b5143(0x2ba)+_0x2a924b[_0x2b5143(0x261)]+_0x2b5143(0x2a6)+_0x2a924b[_0x2b5143(0x2b7)]+'\x27'),(_0x569b94[_0x2b5143(0x221)]||_0x569b94[_0x2b5143(0x2f0)])&&await handleSingleObjectOutput(_0x2a924b,_0x569b94),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(_0x33921c){const _0x11c50b=a54_0x478897,_0x3b29c7=Math[_0x11c50b(0x1fc)](_0x33921c/0x3e8),_0x50d803=Math[_0x11c50b(0x1fc)](_0x3b29c7/0x3c),_0x4af91e=Math[_0x11c50b(0x1fc)](_0x50d803/0x3c),_0x11a954=Math['floor'](_0x4af91e/0x18);if(_0x11a954>0x0){const _0x2f5f80=_0x4af91e%0x18;return _0x2f5f80>0x0?_0x11a954+'d\x20'+_0x2f5f80+'h':_0x11a954+'d';}else{if(_0x4af91e>0x0){const _0x591adf=_0x50d803%0x3c;return _0x591adf>0x0?_0x4af91e+'h\x20'+_0x591adf+'m':_0x4af91e+'h';}else{if(_0x50d803>0x0){const _0x40abaa=_0x3b29c7%0x3c;return _0x40abaa>0x0?_0x50d803+'m\x20'+_0x40abaa+'s':_0x50d803+'m';}else return _0x3b29c7+'s';}}}function formatTimestamp(_0x33874f,_0x5a8124){const _0x543a80=a54_0x478897,_0x40e745=new Date(_0x33874f),_0x9f03b6=String(_0x40e745[_0x543a80(0x1ae)]())[_0x543a80(0x318)](0x2,'0'),_0x141a34=String(_0x40e745[_0x543a80(0x34c)]())[_0x543a80(0x318)](0x2,'0'),_0x437eb2=_0x9f03b6+':'+_0x141a34,_0x58ea49=_0x40e745['getFullYear']()===_0x5a8124[_0x543a80(0x1e5)]()&&_0x40e745['getMonth']()===_0x5a8124['getMonth']()&&_0x40e745[_0x543a80(0x349)]()===_0x5a8124[_0x543a80(0x349)]();if(_0x58ea49)return _0x437eb2;else{const _0x1dc6e8=String(_0x40e745['getMonth']()+0x1)[_0x543a80(0x318)](0x2,'0'),_0x1e8399=String(_0x40e745[_0x543a80(0x349)]())[_0x543a80(0x318)](0x2,'0');return _0x1dc6e8+'-'+_0x1e8399+'\x20'+_0x437eb2;}}function formatDate(_0x49c626){const _0x3148c7=a54_0x478897,_0x3673e8=_0x49c626[_0x3148c7(0x1e5)](),_0x2d1c03=String(_0x49c626[_0x3148c7(0x316)]()+0x1)[_0x3148c7(0x318)](0x2,'0'),_0x40ed7c=String(_0x49c626[_0x3148c7(0x349)]())[_0x3148c7(0x318)](0x2,'0');return _0x3673e8+'-'+_0x2d1c03+'-'+_0x40ed7c;}function getTaskStateIcon(_0x1b2b40){const _0x428f9d={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x428f9d[_0x1b2b40]||'⚪';}function getBarChar(_0xa5defb){const _0x4c5419=a54_0x478897;return _0xa5defb===_0x4c5419(0x2f5)||_0xa5defb===_0x4c5419(0x23e)?'×':'─';}function getBarColor(_0x60359b){const _0x32157c=a54_0x478897,_0x178fa0={'success':a54_0x5a87b0[_0x32157c(0x31f)],'error':a54_0x5a87b0[_0x32157c(0x264)],'group_error':a54_0x5a87b0['red'],'running':a54_0x5a87b0[_0x32157c(0x1b5)],'blocked':a54_0x5a87b0[_0x32157c(0x1c9)],'planned':a54_0x5a87b0['dim'],'canceling':a54_0x5a87b0[_0x32157c(0x1c9)]};return _0x178fa0[_0x60359b]||a54_0x5a87b0[_0x32157c(0x30e)];}function parseTaskName(_0x1dd832){const _0x1e2731=a54_0x478897;let _0x3f353b=_0x1dd832['replace'](/^\++/,'');const _0x59aedb=_0x3f353b[_0x1e2731(0x2de)]('+'),_0x37e50c=_0x59aedb[_0x1e2731(0x1b1)]>0x1?_0x59aedb[_0x1e2731(0x1b1)]-0x2:0x0,_0x3037ed=_0x59aedb[_0x59aedb[_0x1e2731(0x1b1)]-0x1]||_0x3f353b;return{'level':_0x37e50c,'name':'+'+_0x3037ed};}function truncateTaskName(_0x63a698,_0x1f5542){const _0x39c177=a54_0x478897,_0x117867=stringWidth(_0x63a698);if(_0x117867<=_0x1f5542)return _0x63a698;let _0x1b1747=_0x63a698;while(stringWidth(_0x1b1747+'…')>_0x1f5542&&_0x1b1747[_0x39c177(0x1b1)]>0x0){_0x1b1747=_0x1b1747[_0x39c177(0x242)](0x0,-0x1);}return _0x1b1747+'…';}function calculateTimeScale(_0x416d64,_0x52a044){const _0x473c90=a54_0x478897;return{'startTime':_0x416d64['start'],'endTime':_0x416d64[_0x473c90(0x335)],'durationMs':_0x416d64[_0x473c90(0x1f6)],'msPerChar':_0x416d64[_0x473c90(0x1f6)]/_0x52a044};}function timeToPosition(_0xf6429f,_0x24b838,_0x327999){const _0x32a73b=a54_0x478897,_0x800dd0=_0xf6429f-_0x24b838[_0x32a73b(0x2bb)],_0x1d2b5c=Math[_0x32a73b(0x1fc)](_0x800dd0/_0x24b838[_0x32a73b(0x326)]);return Math[_0x32a73b(0x31e)](0x0,Math[_0x32a73b(0x1c7)](_0x1d2b5c,_0x327999));}function renderTimeAxis(_0x241b47,_0x1e71d3){const _0x528800=a54_0x478897,_0x3d7067=Math[_0x528800(0x1c7)](TIMELINE_CONFIG[_0x528800(0x218)],Math[_0x528800(0x31e)](TIMELINE_CONFIG[_0x528800(0x2ea)],Math[_0x528800(0x1fc)](_0x1e71d3/TIMELINE_CONFIG[_0x528800(0x1d2)]))),_0x493bcc=_0x241b47[_0x528800(0x2eb)]/(_0x3d7067-0x1),_0xf0d0e=new Date(_0x241b47['startTime']),_0x4daa5d=[];for(let _0x349218=0x0;_0x349218<_0x3d7067;_0x349218++){const _0x34a176=_0x241b47[_0x528800(0x2bb)]+_0x349218*_0x493bcc,_0x208951=timeToPosition(_0x34a176,_0x241b47,_0x1e71d3),_0x3b1cc4=formatTimestamp(_0x34a176,_0xf0d0e);_0x4daa5d[_0x528800(0x240)]({'pos':_0x208951,'text':_0x3b1cc4});}const _0x4d851c=new Array(_0x1e71d3)[_0x528800(0x1b8)]('\x20');let _0x364f01=-0x1;for(const {pos:_0x32a1e8,text:_0x2f2987}of _0x4daa5d){let _0x401b14=Math[_0x528800(0x31e)](0x0,_0x32a1e8-Math[_0x528800(0x1fc)](_0x2f2987[_0x528800(0x1b1)]/0x2));_0x401b14<=_0x364f01+TIMELINE_CONFIG[_0x528800(0x2bc)]&&(_0x401b14=_0x364f01+TIMELINE_CONFIG[_0x528800(0x2bc)]+0x1);_0x401b14+_0x2f2987[_0x528800(0x1b1)]>_0x1e71d3&&(_0x401b14=_0x1e71d3-_0x2f2987[_0x528800(0x1b1)]);if(_0x401b14>=0x0&&_0x401b14+_0x2f2987[_0x528800(0x1b1)]<=_0x1e71d3&&_0x401b14>_0x364f01){for(let _0x5368f4=0x0;_0x5368f4<_0x2f2987[_0x528800(0x1b1)];_0x5368f4++){_0x4d851c[_0x401b14+_0x5368f4]=_0x2f2987[_0x5368f4];}_0x364f01=_0x401b14+_0x2f2987[_0x528800(0x1b1)]-0x1;}}return _0x4d851c['join']('');}function a54_0xa03e(){const _0x2bbecf=['rows','Session\x20time:\x20','Cloning\x20to\x20','trim','end','list','workflowName','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','execute','✔\x20Pushed\x20','Enable\x20a\x20workflow\x20schedule','workflow:sessions','\x27...','New\x20project\x20name:\x20','Listing\x20secrets...','Resolving\x20project\x20\x27','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','text','reason','value','Reason:\x20','name','Error:\x20Project\x20name\x20is\x20required','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','getDate','\x20to\x20see\x20detailed\x20logs','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','getMinutes','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','icon','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','follow','workflow:schedule:disable','\x20\x20Source:\x20','now','from','\x20of\x20','MAX_TASKS_DISPLAY','pollTimeline','start','stdout','applyPullProject','changes','skipValidation','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x20\x20Target:\x20','2312305JfuUiH','attemptId','message','\x0a✔\x20Attempt\x20complete','summary','\x20session','Error:\x20Invalid\x20JSON\x20in\x20--params','state','\x20disabled\x20(','✔\x20Found\x20','workflow:retry','Error:\x20','getHours','Select\x20a\x20session\x20to\x20view\x20timeline:','Source:\x20','length','✔\x20Deleted\x20project\x20','modified','Validation:\x20skipped','blue','✔\x20Retry\x20started','some','fill','No\x20log\x20content\x20found','\x20is\x20not\x20a\x20directory','newProjectName','join','resumeFrom','Usage:\x20tdx\x20wf\x20use\x20<project>','startedAt','verbose','parseProjectWorkflowPattern','Listing\x20workflow\x20projects...','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','lastAttempt','✔\x20Pull\x20complete','workflow:schedules','min','buildTimelineData','yellow','Warning:','✔\x20Workflow\x20project\x20context\x20cleared.','includes','trimEnd','kill','unknown','size','Project:\x20','LABEL_WIDTH_DIVISOR','workflow:projects','\x20\x20Attempt\x20ID:\x20','planned','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','dryRun','Downloading\x20project\x20','\x1b[1A\x1b[2K','Setting\x20secret...','Auto-selected\x20latest\x20session:\x20','logs','Error:\x20Attempt\x20ID\x20is\x20required','💡\x20Tip:\x20Use\x20','\x20\x20Project\x20ID:\x20','Disable\x20a\x20workflow\x20schedule','includeSubtasks','\x20\x20Session\x20ID:\x20','Workflow:\x20','dim','getFullYear','\x20new','clear','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x20sessions\x20','54JMwGNe','hasChanges','Cancelled','No\x20sessions\x20with\x20timing\x20information','sort','\x22?\x20This\x20cannot\x20be\x20undone.','Updating\x20','newProjectId','set','canceling','utf-8','yes','duration','title','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','floor','📁\x20','No\x20matching\x20sessions\x20found','limit','\x20from\x20session\x20','deleteSecret','6AeztWO','✔\x20Push\x20complete','workflow:attempt','displayLine','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','relative','(unknown)','\x20secrets...','isDirectory','Status:\x20','358079cHfHBc','\x20\x20Revision:\x20','sourceDir','generateSessionTimelineRows','renderTimeline','\x0aError:','renderSessionsTimeline','attempt:','Key\x20cannot\x20be\x20empty','cwd','table','Show\x20logs\x20for\x20a\x20workflow\x20attempt','MAX_LABEL_COUNT','\x27\x20from\x20project\x20\x27','Show\x20specific\x20attempt\x20details','attempt','\x0aPush\x20these\x20changes?','MAX_TIMELINE_WIDTH','\x20\x20Location:\x20','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','\x0a✔\x20No\x20changes\x20to\x20push','json','2623376qPqCAQ','data','log','startsWith','revision','(use\x20--limit\x20to\x20see\x20more)','Including\x20subtasks:\x20yes','Analyzing\x20project...','session','...','projects','toLowerCase','Listing\x20workflow\x20sessions...','-\x20no\x20files\x20written','/attempt/','has','\x20task','format','targetDir','\x20workflow','showWorkflowConsoleUrl','5830040GijMHm','\x20secrets\x20set\x20for\x20project\x20\x27','workflow:run','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','tdx\x20wf\x20attempt\x20','task','Listing\x20workflows...','group_error','Loading\x20session...','push','workflow:download','slice','fromTask','Retrying\x20session...','repeat','Expected\x20format:\x20--param\x20key=value','parse','Loading\x20workflows...','pullProject','isNewProject','Source\x20directory\x20is\x20required','Writing\x20files...','\x20project','Killing\x20attempt...','Task\x20name:\x20','📅\x20#','Filter:\x20','toISOString','Force:\x20yes','tasks','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','\x0aUpdate\x20existing\x20project\x20\x22','Include\x20retried:\x20yes','Params:\x20','workflow:upload','Latest\x20session\x20has\x20no\x20attempt','List\x20workflow\x20attempts','sessionId','isTTY','done','unchanged','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','key','projectId','requireProject','red','Total:\x20','workflow','write','\x0aDry\x20run\x20-\x20no\x20files\x20written','params','download','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','248FpMvMT','ICON_WIDTH','setSecrets','workflow:timeline','isArray','navigateSessionsInteractive','Error:\x20Secret\x20key\x20is\x20required','List\x20workflow\x20execution\x20sessions','\x20\x20Console:\x20','Resume\x20from:\x20','diff','\x22\x20already\x20exists\x20(ID:\x20','📋\x20','✔\x20Clone\x20complete','keys','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','Kill\x20a\x20running\x20attempt','Schedule\x20ID\x20is\x20required','run','listSecrets','find','Attempt\x20ID:\x20','Revision:\x20','resolveProject','\x22\x20with\x20new\x20revision?','\x20\x20New\x20attempt\x20ID:\x20','1728528rAWNSY','all','workflow:secrets:delete','✔\x20Project:\x20','Pushing\x20workflow\x20project...','substring','output','GUTTER','1835328tACFMF','No\x20attempts\x20found','type','Key:\x20','enableSchedule','existingProjectId','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','running','workflow:clone','\x20(use\x20--limit\x20to\x20show\x20more)','\x20\x20Project:\x20','Target\x20directory:\x20','\x20has\x20no\x20attempts','Deleting\x20project\x20','Output\x20directory:\x20','\x20\x20tdx\x20wf\x20use\x20<project>','workflow:schedule:enable','workflow:logs','updatedAt','total','localeCompare','pending','tdx.json','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Parameters:\x20','nextRunTime','param','every','sessions','Project\x20filter:\x20','session:','\x20\x20Changes:\x20','workflows','No\x20attempts\x20found\x20in\x20project:\x20','fullName','No\x20workflow\x20sessions\x20found','Retry\x20a\x20session\x20or\x20attempt','Select\x20a\x20workflow\x20to\x20run','Project\x20name:\x20','columns','projectName','workflow:push','renderSingleTimeline','✔\x20Secret\x20\x27','startTime','LABEL_MIN_SPACING','index','sourceProjectName','16161aPzzfV','revision:\x20','retryAttempt','\x20-\x20','Invalid\x20format:\x20','cyan','cancelRequested','Analyzing\x20changes...','Source\x20directory:\x20','filter','\x20next:\x20','\x20(system)','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','✔\x20Showing\x20','\x20secret','finishedAt','stringify','round','targetExists','\x0aPolling...\x20(','autocomplete','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','workflow:kill','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','executePushProject','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Project\x20name\x20is\x20required','Project\x20directory:\x20','No\x20attempts\x20found\x20for:\x20','ICON_SPACING','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','split','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Deleting\x20secret...','success','taskName','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','get','project','status','match','POLL_INTERVAL_MS','\x20\x20Files\x20extracted:\x20','MIN_LABEL_COUNT','durationMs','\x0aClone\x20\x22','Disabling\x20schedule\x20#','fileSize','\x20schedule','jsonl','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','retrySession','deleted','.\x20Expected\x20format:\x20KEY=VALUE','error','indexOf','workflowProject','Session\x20','disabledAt','fs/promises','context','resolve','No\x20workflow\x20projects\x20found','Pushing\x20project...','\x20deleted','getTime','sessionTime','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Filter:\x20project=','new','✔\x20Schedule\x20#','\x20unchanged','No\x20workflow\x20tdx.json\x20found','prepareCloneProject','sys','Source\x20project:\x20','map','Secrets\x20to\x20set:\x20','site','white','select','MAX_POLL_ITERATIONS','retryAttemptName','Dry\x20run:\x20yes','window','Retrying\x20attempt...','executeCloneProject','getMonth','Loading\x20sessions...','padStart','No\x20sessions\x20found\x20in\x20project:\x20','Start\x20a\x20workflow\x20run','No\x20workflows\x20found','Getting\x20attempt\x20tasks...','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','max','green','description','-\x20nothing\x20pushed','No\x20sessions\x20found','logFiles','Pulling\x20project\x20','stat','msPerChar','createdAt','Listing\x20workflow\x20attempts...','---\x20','resolveProjectDir','toLocaleString','Error:','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','Session\x20not\x20found:\x20','\x20\x20Next\x20run:\x20','\x20(disabled)'];a54_0xa03e=function(){return _0x2bbecf;};return a54_0xa03e();}function renderTaskRow(_0x59c2b7,_0x5ec535,_0xb4160a,_0x4ec583){const _0x311ee0=a54_0x478897,{level:_0x1d8983,name:_0x4866ea}=parseTaskName(_0x59c2b7[_0x311ee0(0x346)]),_0x4f1e36='\x20'[_0x311ee0(0x245)](_0x1d8983),_0x54d319=_0x59c2b7[_0x311ee0(0x313)]?'('+formatElapsed(_0x59c2b7[_0x311ee0(0x313)][_0x311ee0(0x1f6)])+')':'',_0x56c172=stringWidth(_0x54d319),_0x33f8e4=_0x1d8983*0x1,_0x18ede5=_0x4ec583-_0x33f8e4-_0x56c172-0x1,_0x341dde=truncateTaskName(_0x4866ea,_0x18ede5),_0xc7083a=_0x4f1e36+_0x341dde,_0x2f273b=stringWidth(_0xc7083a),_0x6ea106=_0x4ec583-_0x2f273b-_0x56c172,_0x41dd37=_0xc7083a+'\x20'[_0x311ee0(0x245)](Math['max'](0x1,_0x6ea106))+a54_0x5a87b0[_0x311ee0(0x1e4)](_0x54d319),_0x4aaf72=getTaskStateIcon(_0x59c2b7[_0x311ee0(0x1a9)]),_0x368688=new Array(_0xb4160a)[_0x311ee0(0x1b8)]('\x20');if(_0x59c2b7[_0x311ee0(0x313)]){const _0x2d9b58=timeToPosition(_0x59c2b7[_0x311ee0(0x313)][_0x311ee0(0x19b)],_0x5ec535,_0xb4160a),_0x19bf73=timeToPosition(_0x59c2b7[_0x311ee0(0x313)]['end'],_0x5ec535,_0xb4160a),_0xd6ebea=getBarChar(_0x59c2b7[_0x311ee0(0x1a9)]),_0x459088=Math[_0x311ee0(0x31e)](_0x2d9b58+0x1,_0x19bf73);for(let _0xc1e873=_0x2d9b58;_0xc1e873<Math[_0x311ee0(0x1c7)](_0x459088,_0xb4160a);_0xc1e873++){_0x368688[_0xc1e873]=_0xd6ebea;}}const _0x534e74=getBarColor(_0x59c2b7[_0x311ee0(0x1a9)]),_0x302146=_0x368688[_0x311ee0(0x30b)](_0x2864d6=>_0x2864d6==='\x20'?'\x20':_0x534e74(_0x2864d6))[_0x311ee0(0x1bc)]('');return _0x4aaf72+'\x20'+_0x41dd37+'│'+_0x302146+'│';}function calculateStats(_0x4edb16){const _0x489783=a54_0x478897,_0x1ade8c={'total':_0x4edb16[_0x489783(0x1b1)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0xebdc8a of _0x4edb16){if(_0xebdc8a[_0x489783(0x1a9)]==='success')_0x1ade8c['success']++;else{if(_0xebdc8a[_0x489783(0x1a9)]===_0x489783(0x2f5)||_0xebdc8a[_0x489783(0x1a9)]==='group_error')_0x1ade8c[_0x489783(0x2f5)]++;else _0xebdc8a[_0x489783(0x1a9)]===_0x489783(0x296)?_0x1ade8c[_0x489783(0x296)]++:_0x1ade8c[_0x489783(0x2a4)]++;}}return _0x1ade8c;}function formatStats(_0x47d2e8){const _0x1a55ae=a54_0x478897;return[_0x1a55ae(0x265)+_0x47d2e8[_0x1a55ae(0x2a2)],'✅\x20'+_0x47d2e8[_0x1a55ae(0x2e1)],'❌\x20'+_0x47d2e8[_0x1a55ae(0x2f5)],'🔄\x20'+_0x47d2e8[_0x1a55ae(0x296)],'⏳\x20'+_0x47d2e8['pending']][_0x1a55ae(0x1bc)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x270);[a54_0x478897(0x320)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x478263){const _0x2c59ad=a54_0x478897,{options:_0x413f73,args:_0x6d2d2d,tdx:_0x2c0d23}=_0x478263;let _0x3bb5e2,_0x184ab7,_0x424b36=![];if(_0x6d2d2d[0x0]){if(_0x6d2d2d[0x0][_0x2c59ad(0x1cc)]('.')){const _0x41dee6=this[_0x2c59ad(0x1c1)](_0x6d2d2d,_0x413f73);if(!_0x41dee6)return 0x1;_0x3bb5e2=_0x41dee6[_0x2c59ad(0x2b7)],_0x184ab7=_0x41dee6['workflowName'];}else{_0x184ab7=_0x6d2d2d[0x0],_0x3bb5e2=_0x413f73['workflowProject'];if(!_0x3bb5e2)return console[_0x2c59ad(0x2f5)](a54_0x5a87b0[_0x2c59ad(0x264)](_0x2c59ad(0x32c)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x424b36=!![];}}else{const _0x2f31da=this[_0x2c59ad(0x1c1)](_0x6d2d2d,_0x413f73);if(!_0x2f31da)return 0x1;_0x3bb5e2=_0x2f31da[_0x2c59ad(0x2b7)],_0x184ab7=_0x2f31da[_0x2c59ad(0x337)];}if(_0x413f73[_0x2c59ad(0x1c0)]){if(_0x3bb5e2&&_0x184ab7)console[_0x2c59ad(0x2f5)](_0x2c59ad(0x251)+_0x3bb5e2+'.'+_0x184ab7);else _0x3bb5e2&&console[_0x2c59ad(0x2f5)]('Filter:\x20project='+_0x3bb5e2);}const _0x3117e7=_0x413f73['attemptId'],_0x1f841e=_0x413f73['sessionId'];if(_0x3117e7){_0x1f841e&&console[_0x2c59ad(0x2f5)](a54_0x5a87b0[_0x2c59ad(0x1c9)](_0x2c59ad(0x1ca)),_0x2c59ad(0x341));const _0x3c0f2c=_0x413f73[_0x2c59ad(0x193)];return _0x3c0f2c?await this[_0x2c59ad(0x19a)](_0x478263,_0x3117e7):await this[_0x2c59ad(0x2b9)](_0x478263,_0x3117e7,_0x413f73),0x0;}if(_0x1f841e){const _0x3865f3=await withSpinner(_0x2c59ad(0x23f),()=>_0x2c0d23[_0x2c59ad(0x266)]['sessions']({'projectName':_0x3bb5e2,'workflowName':_0x184ab7,'limit':0x64}),{'verbose':_0x413f73['verbose']}),_0x4e6216=_0x3865f3[_0x2c59ad(0x223)]['find'](_0xd5e37d=>_0xd5e37d['id']===_0x1f841e);if(!_0x4e6216)return console['error'](a54_0x5a87b0[_0x2c59ad(0x264)]('Error:'),_0x2c59ad(0x32e)+_0x1f841e),0x1;if(!_0x4e6216['lastAttempt']?.['id'])return console[_0x2c59ad(0x2f5)](a54_0x5a87b0[_0x2c59ad(0x264)](_0x2c59ad(0x32c)),_0x2c59ad(0x2f8)+_0x1f841e+_0x2c59ad(0x29b)),0x1;const _0x10bb3e=_0x4e6216[_0x2c59ad(0x1c4)]['id'];_0x413f73['verbose']&&console[_0x2c59ad(0x2f5)]('Using\x20attempt\x20'+_0x10bb3e+_0x2c59ad(0x200)+_0x1f841e);const _0x1a4291=_0x413f73[_0x2c59ad(0x193)];return _0x1a4291?await this[_0x2c59ad(0x19a)](_0x478263,_0x10bb3e):await this['renderSingleTimeline'](_0x478263,_0x10bb3e,_0x413f73),0x0;}const _0x320bff=await withSpinner(_0x2c59ad(0x317),()=>_0x2c0d23[_0x2c59ad(0x266)][_0x2c59ad(0x2ab)]({'projectName':_0x3bb5e2,'workflowName':_0x184ab7,'limit':_0x413f73[_0x2c59ad(0x1ff)]||0x32}),{'verbose':_0x413f73[_0x2c59ad(0x1c0)]}),_0x167ef5=_0x320bff['data'];if(_0x167ef5[_0x2c59ad(0x1b1)]===0x0){if(_0x3bb5e2&&_0x184ab7)console['error']('No\x20sessions\x20found\x20for:\x20'+_0x3bb5e2+'.'+_0x184ab7);else _0x3bb5e2?console['error'](_0x2c59ad(0x319)+_0x3bb5e2):(console[_0x2c59ad(0x2f5)](_0x2c59ad(0x2b2)),console[_0x2c59ad(0x2f5)](a54_0x5a87b0[_0x2c59ad(0x1e4)](_0x2c59ad(0x31d))));return 0x0;}_0x167ef5[_0x2c59ad(0x1ee)]((_0x3b78b7,_0x34675e)=>{const _0x4efbd0=_0x2c59ad,_0x5917b5=_0x3b78b7[_0x4efbd0(0x301)]||'',_0x1119a5=_0x34675e['sessionTime']||'';return _0x1119a5[_0x4efbd0(0x2a3)](_0x5917b5);});if(_0x413f73[_0x2c59ad(0x221)]||_0x413f73[_0x2c59ad(0x2f0)])return await handleSDKOutput(_0x167ef5,_0x413f73),0x0;let _0x5b3039;if(_0x424b36){const _0x4fb7a8=_0x167ef5[0x0];if(!_0x4fb7a8['lastAttempt']?.['id'])return console[_0x2c59ad(0x2f5)](_0x2c59ad(0x25a)),0x0;_0x5b3039=_0x4fb7a8[_0x2c59ad(0x1c4)]['id'],_0x413f73[_0x2c59ad(0x1c0)]&&console[_0x2c59ad(0x2f5)](_0x2c59ad(0x1db)+_0x4fb7a8['sessionTime']);}else{const _0x110acf=_0x167ef5[_0x2c59ad(0x30b)](_0x28ddd1=>{const _0x839bd4=_0x2c59ad,_0x359d97=getAttemptStatusDisplay(_0x28ddd1[_0x839bd4(0x1c4)]);return{'title':_0x28ddd1[_0x839bd4(0x2e5)]?.[_0x839bd4(0x346)]+'.'+_0x28ddd1[_0x839bd4(0x266)]?.['name']+_0x839bd4(0x2c2)+_0x28ddd1[_0x839bd4(0x301)]+'\x20'+_0x359d97[_0x839bd4(0x34e)],'value':_0x28ddd1['lastAttempt']?.['id']||'','description':_0x359d97[_0x839bd4(0x342)]};}),_0x136f93=await a54_0xfbc779({'type':'select','name':'attemptId','message':_0x2c59ad(0x1af),'choices':_0x110acf[_0x2c59ad(0x2c8)](_0x3e8872=>_0x3e8872[_0x2c59ad(0x344)]!=='')});if(!_0x136f93[_0x2c59ad(0x1a3)])return 0x0;_0x5b3039=_0x136f93[_0x2c59ad(0x1a3)];}const _0x5729e7=_0x413f73['follow'];return _0x5729e7?await this[_0x2c59ad(0x19a)](_0x478263,_0x5b3039):await this[_0x2c59ad(0x2b9)](_0x478263,_0x5b3039,_0x413f73),0x0;}async[a54_0x478897(0x2b9)](_0x18c372,_0x263cec,_0x14ad90){const _0xac818=a54_0x478897,{tdx:_0x533f9e}=_0x18c372;let _0x8e4802,_0x59da01;try{[_0x8e4802,_0x59da01]=await Promise[_0xac818(0x288)]([_0x533f9e[_0xac818(0x266)][_0xac818(0x21b)](_0x263cec),_0x533f9e[_0xac818(0x266)][_0xac818(0x254)](_0x263cec,![])]);}catch(_0x3ffa3b){console[_0xac818(0x2f5)](a54_0x5a87b0[_0xac818(0x264)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x14ad90[_0xac818(0x1c0)]&&console['error'](_0x3ffa3b);throw _0x3ffa3b;}if(_0x14ad90['json']||_0x14ad90[_0xac818(0x2f0)]){const _0x11172c=this[_0xac818(0x1c8)](_0x8e4802,_0x59da01);await handleSDKOutput([_0x11172c],_0x14ad90);return;}const _0x4a843e=_0x533f9e[_0xac818(0x2fb)][_0xac818(0x30d)],_0x30e79b=this[_0xac818(0x210)](_0x8e4802,_0x59da01,_0x4a843e);console['log'](_0x30e79b);}async['pollTimeline'](_0x29cdf8,_0x5d2db4){const _0x2b440e=a54_0x478897,{tdx:_0x3dea7f}=_0x29cdf8,_0x43c527=TIMELINE_CONFIG[_0x2b440e(0x2e8)],_0x29e686=TIMELINE_CONFIG[_0x2b440e(0x310)];let _0x2f6514=0x0;while(_0x2f6514<_0x29e686){process[_0x2b440e(0x19c)][_0x2b440e(0x25d)]&&process[_0x2b440e(0x19c)][_0x2b440e(0x267)]('\x1bc');let _0x56ec9d,_0x377997;try{[_0x56ec9d,_0x377997]=await Promise[_0x2b440e(0x288)]([_0x3dea7f[_0x2b440e(0x266)]['attempt'](_0x5d2db4),_0x3dea7f[_0x2b440e(0x266)][_0x2b440e(0x254)](_0x5d2db4,![])]);}catch(_0x5afac7){console[_0x2b440e(0x2f5)](a54_0x5a87b0[_0x2b440e(0x264)](_0x2b440e(0x1fa)));_0x2f6514>0x0&&console[_0x2b440e(0x2f5)](a54_0x5a87b0[_0x2b440e(0x1e4)](_0x2b440e(0x1c3)+_0x2f6514));throw _0x5afac7;}const _0x48f1db=_0x3dea7f[_0x2b440e(0x2fb)][_0x2b440e(0x30d)],_0x1c46a2=this[_0x2b440e(0x210)](_0x56ec9d,_0x377997,_0x48f1db);console[_0x2b440e(0x224)](_0x1c46a2);const _0x5439e0=_0x56ec9d[_0x2b440e(0x25e)]&&_0x377997[_0x2b440e(0x2aa)](_0x36aa1f=>_0x36aa1f[_0x2b440e(0x1a9)]!==_0x2b440e(0x296)&&_0x36aa1f[_0x2b440e(0x1a9)]!==_0x2b440e(0x1d5));if(_0x5439e0){console[_0x2b440e(0x2f5)](a54_0x5a87b0[_0x2b440e(0x31f)](_0x2b440e(0x1a5)));break;}console[_0x2b440e(0x2f5)](a54_0x5a87b0[_0x2b440e(0x1e4)](_0x2b440e(0x2d2)+_0x2f6514*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x18375e=>setTimeout(_0x18375e,_0x43c527)),_0x2f6514++;}_0x2f6514>=_0x29e686&&console['error'](a54_0x5a87b0[_0x2b440e(0x1c9)](_0x2b440e(0x21f)));}[a54_0x478897(0x210)](_0x371a1f,_0x5ad92d,_0xc92ae3){const _0xc24c7=a54_0x478897,_0x219d12=[],_0x10c43b=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x5e5fc2=0x5,_0xf3db07=process[_0xc24c7(0x19c)][_0xc24c7(0x2b6)]||0x78,_0x5ef812=_0xf3db07-_0x10c43b-_0x5e5fc2,_0xefa553=Math[_0xc24c7(0x31e)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math[_0xc24c7(0x1c7)](_0x5ef812,TIMELINE_CONFIG[_0xc24c7(0x21d)])),_0x1e11fa=new Date(_0x371a1f[_0xc24c7(0x327)])[_0xc24c7(0x300)](),_0x318cb4=_0x371a1f['finishedAt']?new Date(_0x371a1f[_0xc24c7(0x2ce)])[_0xc24c7(0x300)]():Date[_0xc24c7(0x196)](),_0xaa970e={'start':_0x1e11fa,'end':_0x318cb4,'duration':_0x318cb4-_0x1e11fa},_0x4aee91=new Map(),_0x3251f3=[];for(const _0x414a90 of _0x5ad92d){if(_0x414a90[_0xc24c7(0x1bf)]){const _0x526fd4=new Date(_0x414a90['startedAt'])['getTime'](),_0xf6fc38=_0x414a90[_0xc24c7(0x2a1)]?new Date(_0x414a90[_0xc24c7(0x2a1)])[_0xc24c7(0x300)]():Date[_0xc24c7(0x196)](),_0x55a13b={'start':_0x526fd4,'end':_0xf6fc38,'duration':_0xf6fc38-_0x526fd4};_0x4aee91[_0xc24c7(0x1f2)](_0x414a90['id'],_0x55a13b),_0x3251f3[_0xc24c7(0x240)]({'name':_0x414a90['fullName'],'state':_0x414a90[_0xc24c7(0x1a9)]||'unknown','window':_0x55a13b});}else _0x3251f3[_0xc24c7(0x240)]({'name':_0x414a90[_0xc24c7(0x2b1)],'state':_0x414a90[_0xc24c7(0x1a9)]||_0xc24c7(0x1d5),'window':undefined});}_0x3251f3[_0xc24c7(0x1ee)]((_0x558bed,_0x588ad8)=>{const _0x42e1a8=_0xc24c7;if(!_0x558bed[_0x42e1a8(0x313)])return 0x1;if(!_0x588ad8['window'])return-0x1;return _0x558bed[_0x42e1a8(0x313)]['start']-_0x588ad8['window'][_0x42e1a8(0x19b)];});const _0x2ba3c1=_0x3251f3[_0xc24c7(0x1b1)],_0x4033e9=_0x2ba3c1>TIMELINE_CONFIG[_0xc24c7(0x199)];_0x4033e9&&_0x3251f3['splice'](TIMELINE_CONFIG[_0xc24c7(0x199)]);const _0x2548d5=calculateTimeScale(_0xaa970e,_0xefa553),_0x2d3d08=_0x371a1f[_0xc24c7(0x25e)]?_0x371a1f[_0xc24c7(0x2e1)]?a54_0x5a87b0['green'](_0xc24c7(0x2e1)):a54_0x5a87b0[_0xc24c7(0x264)]('error'):a54_0x5a87b0['blue'](_0xc24c7(0x296)),_0x102430=_0x371a1f['project']?.['id'],_0x2cf68b=_0x371a1f[_0xc24c7(0x25c)];let _0x2807a0;if(_0x102430&&_0x2cf68b){const _0x1dd295=getWorkflowAttemptUrl(_0xc92ae3,_0x102430,_0x2cf68b,_0x371a1f['id']);_0x2807a0=hyperlink(a54_0x5a87b0[_0xc24c7(0x1e4)](_0x371a1f['id']),_0x1dd295);}else _0x2807a0=a54_0x5a87b0[_0xc24c7(0x1e4)](_0x371a1f['id']);_0x219d12[_0xc24c7(0x240)]('Attempt:\x20'+_0x2807a0+_0xc24c7(0x2c2)+_0x2d3d08+_0xc24c7(0x2c2)+formatElapsed(_0xaa970e['duration']));if(_0x3251f3[_0xc24c7(0x1b1)]>0x0){const _0x4eba48=renderTimeAxis(_0x2548d5,_0xefa553),_0x25079f=new Date(_0xaa970e[_0xc24c7(0x19b)]),_0x38e310=formatDate(_0x25079f),_0x3399ef=TIMELINE_CONFIG[_0xc24c7(0x26e)]+TIMELINE_CONFIG[_0xc24c7(0x2dc)]+_0x10c43b,_0x1d930d=_0x38e310[_0xc24c7(0x318)](_0x3399ef),_0x1477f9=a54_0x5a87b0[_0xc24c7(0x1e4)](_0x1d930d);_0x219d12[_0xc24c7(0x240)](_0x1477f9+'\x20'+_0x4eba48);for(const _0x508dfb of _0x3251f3){_0x219d12[_0xc24c7(0x240)](renderTaskRow(_0x508dfb,_0x2548d5,_0xefa553,_0x10c43b));}const _0x4e178f=calculateStats(_0x3251f3);_0x219d12['push'](formatStats(_0x4e178f)),_0x4033e9&&_0x219d12[_0xc24c7(0x240)](a54_0x5a87b0[_0xc24c7(0x1c9)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0xc24c7(0x198)+_0x2ba3c1+'\x20tasks')),_0x219d12[_0xc24c7(0x240)](''),_0x219d12[_0xc24c7(0x240)](a54_0x5a87b0[_0xc24c7(0x1e4)](_0xc24c7(0x1de))+(_0xc24c7(0x23b)+_0x371a1f['id']+'\x20logs')+a54_0x5a87b0[_0xc24c7(0x1e4)](_0xc24c7(0x34a)));}else _0x219d12[_0xc24c7(0x240)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x219d12[_0xc24c7(0x1bc)]('\x0a');}['buildTimelineData'](_0x2366b0,_0x114651){const _0x54ebb9=a54_0x478897,_0x1da8dd=new Date(_0x2366b0[_0x54ebb9(0x327)])['getTime'](),_0x470132=_0x2366b0['finishedAt']?new Date(_0x2366b0[_0x54ebb9(0x2ce)])[_0x54ebb9(0x300)]():Date[_0x54ebb9(0x196)](),_0x48f07c=_0x470132-_0x1da8dd,_0x3341a3=[];for(const _0x4cac74 of _0x114651){if(_0x4cac74[_0x54ebb9(0x1bf)]){const _0x1ee1e8=new Date(_0x4cac74[_0x54ebb9(0x1bf)])['getTime'](),_0x438ba0=_0x4cac74['updatedAt']?new Date(_0x4cac74[_0x54ebb9(0x2a1)])['getTime']():Date[_0x54ebb9(0x196)]();_0x3341a3[_0x54ebb9(0x240)]({'name':_0x4cac74[_0x54ebb9(0x2b1)],'state':_0x4cac74[_0x54ebb9(0x1a9)]||'unknown','window':{'start':_0x1ee1e8,'end':_0x438ba0,'duration':_0x438ba0-_0x1ee1e8}});}else _0x3341a3[_0x54ebb9(0x240)]({'name':_0x4cac74[_0x54ebb9(0x2b1)],'state':_0x4cac74[_0x54ebb9(0x1a9)]||_0x54ebb9(0x1d5),'window':undefined});}const _0x25125f=calculateStats(_0x3341a3);return{'attempt':{'id':_0x2366b0['id'],'status':_0x2366b0['done']?_0x2366b0[_0x54ebb9(0x2e1)]?_0x54ebb9(0x2e1):_0x54ebb9(0x2f5):_0x54ebb9(0x296),'createdAt':_0x2366b0[_0x54ebb9(0x327)],'finishedAt':_0x2366b0[_0x54ebb9(0x2ce)],'duration_ms':_0x48f07c},'tasks':_0x3341a3[_0x54ebb9(0x30b)](_0x2eac72=>({'name':_0x2eac72['name'],'state':_0x2eac72[_0x54ebb9(0x1a9)],'startedAt':_0x2eac72[_0x54ebb9(0x313)]?new Date(_0x2eac72[_0x54ebb9(0x313)][_0x54ebb9(0x19b)])[_0x54ebb9(0x252)]():null,'updatedAt':_0x2eac72[_0x54ebb9(0x313)]?new Date(_0x2eac72[_0x54ebb9(0x313)][_0x54ebb9(0x335)])[_0x54ebb9(0x252)]():null,'duration_ms':_0x2eac72[_0x54ebb9(0x313)]?.[_0x54ebb9(0x1f6)]||null})),'stats':_0x25125f};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x1c6);[a54_0x478897(0x320)]='List\x20workflow\x20schedules';async[a54_0x478897(0x339)](_0x3c2108){const _0x209d13=a54_0x478897,{options:_0x2cd182,tdx:_0xad129e}=_0x3c2108,_0x1ee156=await withSpinner('Listing\x20schedules...',()=>_0xad129e[_0x209d13(0x266)]['listSchedules'](),{'verbose':_0x2cd182['verbose']}),_0x5365a2=_0x1ee156['data'];console['error'](_0x209d13(0x1ab)+_0x5365a2[_0x209d13(0x1b1)]+_0x209d13(0x2ef)+(_0x5365a2[_0x209d13(0x1b1)]!==0x1?'s':''));if(isStructuredFormat(_0x2cd182))await handleSDKOutput(_0x5365a2,_0x2cd182);else{if(_0x5365a2[_0x209d13(0x1b1)]===0x0)console['log']('No\x20schedules\x20found');else for(const _0x490262 of _0x5365a2){const _0x4029a2=_0x490262[_0x209d13(0x2f9)]?a54_0x5a87b0[_0x209d13(0x1c9)](_0x209d13(0x330)):'',_0x196f0a=_0x490262['project']?.[_0x209d13(0x346)]?a54_0x5a87b0[_0x209d13(0x1e4)]('\x20['+_0x490262[_0x209d13(0x2e5)][_0x209d13(0x346)]+']'):'',_0x693d0b=_0x490262[_0x209d13(0x2a8)]?a54_0x5a87b0[_0x209d13(0x1e4)](_0x209d13(0x2c9)+new Date(_0x490262[_0x209d13(0x2a8)])[_0x209d13(0x32b)]()):'';console['log'](_0x209d13(0x250)+_0x490262['id']+'\x20'+(_0x490262[_0x209d13(0x266)]?.['name']||_0x209d13(0x208))+_0x196f0a+_0x4029a2+_0x693d0b);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x29f);[a54_0x478897(0x320)]=a54_0x478897(0x33b);async[a54_0x478897(0x339)](_0x6bd3a6){const _0x5581bc=a54_0x478897,{options:_0x19e153,args:_0x58ae35,tdx:_0x4e4cb2}=_0x6bd3a6,_0x2226b5=_0x58ae35[0x0];if(!_0x2226b5)return console[_0x5581bc(0x2f5)](a54_0x5a87b0['red']('Error:'),'Schedule\x20ID\x20is\x20required'),console[_0x5581bc(0x2f5)](a54_0x5a87b0[_0x5581bc(0x1e4)](_0x5581bc(0x27c))),console[_0x5581bc(0x2f5)](a54_0x5a87b0[_0x5581bc(0x1e4)]('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const _0x21fd8b=await withSpinner('Enabling\x20schedule\x20#'+_0x2226b5+_0x5581bc(0x22b),()=>_0x4e4cb2[_0x5581bc(0x266)][_0x5581bc(0x293)](_0x2226b5),{'verbose':_0x19e153[_0x5581bc(0x1c0)]}),_0x239c8c=_0x21fd8b[_0x5581bc(0x223)];return isStructuredFormat(_0x19e153)?await handleSingleObjectOutput(_0x239c8c,_0x19e153):(console[_0x5581bc(0x224)](_0x5581bc(0x305)+_0x2226b5+'\x20enabled\x20('+(_0x239c8c[_0x5581bc(0x266)]?.['name']||_0x5581bc(0x1cf))+')'),_0x239c8c['nextRunTime']&&console[_0x5581bc(0x224)](a54_0x5a87b0[_0x5581bc(0x1e4)](_0x5581bc(0x32f)+new Date(_0x239c8c['nextRunTime'])[_0x5581bc(0x32b)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x478897(0x346)]=a54_0x478897(0x194);['description']=a54_0x478897(0x1e0);async['execute'](_0x593e1a){const _0x5f0876=a54_0x478897,{options:_0x164857,args:_0x11aa79,tdx:_0x50656e}=_0x593e1a,_0x3d087c=_0x11aa79[0x0];if(!_0x3d087c)return console['error'](a54_0x5a87b0[_0x5f0876(0x264)](_0x5f0876(0x32c)),_0x5f0876(0x27e)),console[_0x5f0876(0x2f5)](a54_0x5a87b0[_0x5f0876(0x1e4)](_0x5f0876(0x32d))),console[_0x5f0876(0x2f5)](a54_0x5a87b0[_0x5f0876(0x1e4)](_0x5f0876(0x2e3))),0x1;const _0x94fc0b=await withSpinner(_0x5f0876(0x2ed)+_0x3d087c+_0x5f0876(0x22b),()=>_0x50656e[_0x5f0876(0x266)]['disableSchedule'](_0x3d087c),{'verbose':_0x164857[_0x5f0876(0x1c0)]}),_0x374ba2=_0x94fc0b[_0x5f0876(0x223)];return isStructuredFormat(_0x164857)?await handleSingleObjectOutput(_0x374ba2,_0x164857):console[_0x5f0876(0x224)]('✔\x20Schedule\x20#'+_0x3d087c+_0x5f0876(0x1aa)+(_0x374ba2[_0x5f0876(0x266)]?.[_0x5f0876(0x346)]||_0x5f0876(0x1cf))+')'),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x43ae43,_0x2a6f45){const _0x3e0589=a55_0x1c45,_0x4e9595=_0x43ae43();while(!![]){try{const _0x2dc303=parseInt(_0x3e0589(0x67))/0x1*(-parseInt(_0x3e0589(0x6c))/0x2)+parseInt(_0x3e0589(0x73))/0x3+-parseInt(_0x3e0589(0x72))/0x4+-parseInt(_0x3e0589(0x70))/0x5*(parseInt(_0x3e0589(0x68))/0x6)+parseInt(_0x3e0589(0x6d))/0x7+parseInt(_0x3e0589(0x6b))/0x8+parseInt(_0x3e0589(0x6a))/0x9;if(_0x2dc303===_0x2a6f45)break;else _0x4e9595['push'](_0x4e9595['shift']());}catch(_0x355468){_0x4e9595['push'](_0x4e9595['shift']());}}}(a55_0xd09a,0x99378));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a55_0x1c45(_0xe201b9,_0x271a6d){_0xe201b9=_0xe201b9-0x67;const _0xd09a8b=a55_0xd09a();let _0x1c451d=_0xd09a8b[_0xe201b9];return _0x1c451d;}export function getUserAgent(){const _0x475930=a55_0x1c45,_0x48033a=getVersion(),_0xdec034=platform(),_0x429402=process[_0x475930(0x6f)][_0x475930(0x69)]('v','');return'tdx/'+_0x48033a+'\x20('+_0xdec034+';\x20node/'+_0x429402+')';}export function getAuthHeaders(_0x26c989,_0x419546,_0x2ee35e){const _0x4d91c8=a55_0x1c45,_0x56a71e=getVersion(),_0x54b9c8={'User-Agent':getUserAgent(),'X-TD-Client':_0x4d91c8(0x6e),'X-TD-Client-Version':_0x56a71e};if(_0x2ee35e)_0x54b9c8[_0x4d91c8(0x74)]=_0x4d91c8(0x75)+_0x2ee35e;else _0x419546&&(_0x54b9c8['Authorization']='TD1\x20'+_0x419546);return _0x54b9c8;}export function toHeaderRecord(_0x424f33){const _0x1e0ce1={};for(const [_0x289dfb,_0x5079b9]of Object['entries'](_0x424f33)){_0x5079b9!==undefined&&(_0x1e0ce1[_0x289dfb]=_0x5079b9);}return _0x1e0ce1;}export function getTrinoHeaders(_0x58064d,_0x46f0bc,_0x49cc1b){const _0x24a754=a55_0x1c45,_0x1bde29=getAuthHeaders(_0x58064d),_0x5024a8=toHeaderRecord(_0x1bde29);if(_0x49cc1b)_0x5024a8[_0x24a754(0x74)]=_0x24a754(0x75)+_0x49cc1b;else _0x46f0bc&&(_0x5024a8[_0x24a754(0x71)]=_0x46f0bc);return _0x5024a8;}export function hasAPIKey(_0x99a94c){const _0x3d6fe8=getAPIKey();return _0x3d6fe8!==undefined&&_0x3d6fe8['length']>0x0;}function a55_0xd09a(){const _0x2ea6ca=['3006426CUiBEP','replace','8744544yDJWxZ','4809216FzxVIh','16fJwPhA','6643014QQQDrH','tdx','version','10QoGgUU','X-Trino-User','1607032hmNCtr','1093614rsMVTu','Authorization','Bearer\x20','106854CWdgQz'];a55_0xd09a=function(){return _0x2ea6ca;};return a55_0xd09a();}
1
+ (function(_0x12d36c,_0x24fa52){const _0x2e6fe5=a55_0x2ae2,_0x8d1b7c=_0x12d36c();while(!![]){try{const _0x204ca5=parseInt(_0x2e6fe5(0x19d))/0x1+parseInt(_0x2e6fe5(0x196))/0x2*(parseInt(_0x2e6fe5(0x199))/0x3)+-parseInt(_0x2e6fe5(0x19f))/0x4*(-parseInt(_0x2e6fe5(0x198))/0x5)+parseInt(_0x2e6fe5(0x19c))/0x6*(-parseInt(_0x2e6fe5(0x19a))/0x7)+parseInt(_0x2e6fe5(0x197))/0x8+-parseInt(_0x2e6fe5(0x1a1))/0x9+-parseInt(_0x2e6fe5(0x1a8))/0xa;if(_0x204ca5===_0x24fa52)break;else _0x8d1b7c['push'](_0x8d1b7c['shift']());}catch(_0x1d0b60){_0x8d1b7c['push'](_0x8d1b7c['shift']());}}}(a55_0x1822,0xb3911));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a55_0x2ae2(_0x1b6c3c,_0x2899eb){_0x1b6c3c=_0x1b6c3c-0x196;const _0x18223f=a55_0x1822();let _0x2ae246=_0x18223f[_0x1b6c3c];return _0x2ae246;}function a55_0x1822(){const _0x4a49f9=['395424ejTWQF','356923tYniXu','version','12ERazMH','57958gLgxKJ','X-Trino-User','4084972InuczY','replace','818163RtaNIo','Authorization',';\x20node/','entries','length','TD1\x20','Bearer\x20','28735780dYUNfm','22WCtARD','10183032fNMncf','5vmsHVw'];a55_0x1822=function(){return _0x4a49f9;};return a55_0x1822();}export function getUserAgent(){const _0x5a05f8=a55_0x2ae2,_0xd47ea6=getVersion(),_0x5613fc=platform(),_0x5632be=process[_0x5a05f8(0x19b)][_0x5a05f8(0x1a0)]('v','');return'tdx/'+_0xd47ea6+'\x20('+_0x5613fc+_0x5a05f8(0x1a3)+_0x5632be+')';}export function getAuthHeaders(_0x3f1b44,_0x29f619,_0x12c860){const _0x9e9133=a55_0x2ae2,_0x4e7de7=getVersion(),_0x32de4a={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x4e7de7};if(_0x12c860)_0x32de4a[_0x9e9133(0x1a2)]=_0x9e9133(0x1a7)+_0x12c860;else _0x29f619&&(_0x32de4a[_0x9e9133(0x1a2)]=_0x9e9133(0x1a6)+_0x29f619);return _0x32de4a;}export function toHeaderRecord(_0x436636){const _0x300366=a55_0x2ae2,_0x34b65d={};for(const [_0x183d97,_0xee603c]of Object[_0x300366(0x1a4)](_0x436636)){_0xee603c!==undefined&&(_0x34b65d[_0x183d97]=_0xee603c);}return _0x34b65d;}export function getTrinoHeaders(_0x2aa361,_0x50879e,_0x5e357d){const _0x16870a=a55_0x2ae2,_0x342817=getAuthHeaders(_0x2aa361),_0x3d4e2c=toHeaderRecord(_0x342817);if(_0x5e357d)_0x3d4e2c[_0x16870a(0x1a2)]=_0x16870a(0x1a7)+_0x5e357d;else _0x50879e&&(_0x3d4e2c[_0x16870a(0x19e)]=_0x50879e);return _0x3d4e2c;}export function hasAPIKey(_0x37cc8c){const _0x54e374=a55_0x2ae2,_0x59297e=getAPIKey();return _0x59297e!==undefined&&_0x59297e[_0x54e374(0x1a5)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x5618e4,_0xaea572){const _0x8981cd=a56_0x3663,_0x277f83=_0x5618e4();while(!![]){try{const _0x3f0e7d=parseInt(_0x8981cd(0x93))/0x1*(parseInt(_0x8981cd(0xc0))/0x2)+-parseInt(_0x8981cd(0xb9))/0x3+parseInt(_0x8981cd(0xb3))/0x4*(-parseInt(_0x8981cd(0xa4))/0x5)+-parseInt(_0x8981cd(0xc1))/0x6+parseInt(_0x8981cd(0x9d))/0x7*(-parseInt(_0x8981cd(0xa0))/0x8)+-parseInt(_0x8981cd(0xb2))/0x9*(parseInt(_0x8981cd(0xbb))/0xa)+parseInt(_0x8981cd(0x91))/0xb;if(_0x3f0e7d===_0xaea572)break;else _0x277f83['push'](_0x277f83['shift']());}catch(_0x44b52b){_0x277f83['push'](_0x277f83['shift']());}}}(a56_0xbfa4,0x67841));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';function a56_0x3663(_0x3aebf4,_0x52ead9){_0x3aebf4=_0x3aebf4-0x8d;const _0xbfa40=a56_0xbfa4();let _0x366382=_0xbfa40[_0x3aebf4];return _0x366382;}import a56_0x5babab from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x35ee6e){const _0x8d2e9a=a56_0x3663;return _0x35ee6e['format']===_0x8d2e9a(0xa3)||_0x35ee6e[_0x8d2e9a(0x9e)]==='jsonl'||_0x35ee6e[_0x8d2e9a(0x9e)]===_0x8d2e9a(0xbe)||_0x35ee6e['format']===_0x8d2e9a(0xb7)||_0x35ee6e['json']===!![]||_0x35ee6e[_0x8d2e9a(0xce)]===!![]||_0x35ee6e[_0x8d2e9a(0xbe)]===!![]||_0x35ee6e[_0x8d2e9a(0xb7)]===!![];}export function parseOutputOptions(_0x42dc04){const _0x20f920=a56_0x3663;return{'format':_0x42dc04[_0x20f920(0x9e)]||_0x20f920(0xb7),'output':_0x42dc04[_0x20f920(0xcb)]||'','limit':_0x42dc04['limit'],'limitStructuredFormats':_0x42dc04[_0x20f920(0xd5)],'color':_0x42dc04[_0x20f920(0xa6)],'noColor':_0x42dc04['noColor']};}function convertSDKResultToQueryResult(_0x4f8f4d){const _0x1af600=a56_0x3663,_0x502e26=[];if(_0x4f8f4d[_0x1af600(0xa9)]>0x0){const _0x3b6af1=_0x4f8f4d[0x0];for(const [_0x10bb11,_0x1b61c2]of Object['entries'](_0x3b6af1)){let _0x9e1028=_0x1af600(0xc2);if(typeof _0x1b61c2==='number')_0x9e1028=Number[_0x1af600(0xd3)](_0x1b61c2)?_0x1af600(0xc8):_0x1af600(0xd7);else{if(typeof _0x1b61c2===_0x1af600(0xac))_0x9e1028='boolean';else _0x1b61c2===null&&(_0x9e1028=_0x1af600(0xc2));}_0x502e26[_0x1af600(0x96)]({'name':_0x10bb11,'type':_0x9e1028});}}return{'queryId':_0x1af600(0x90),'columns':_0x502e26,'data':_0x4f8f4d,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4f8f4d[_0x1af600(0xa9)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x2556c8,_0x59dcb7){const _0x4b06f7=convertSDKResultToQueryResult(_0x2556c8);return formatQueryOutput(_0x4b06f7,_0x59dcb7);}export async function formatQueryOutput(_0x148b1d,_0x73b2f2){const _0x2051b0=a56_0x3663,{format:_0x269399,limit:_0x23c94c,output:_0xb454af,color:_0x8a947e,noColor:_0x509bf0,limitStructuredFormats:_0x59848c}=_0x73b2f2,_0x3356cd=Boolean(_0xb454af)&&!_0x8a947e,_0x534ba2={'color':_0x8a947e,'noColor':_0x509bf0||_0x3356cd};if(_0x269399===_0x2051b0(0xb7)){const _0x120a2c=shouldUseLess(_0x269399,_0xb454af);return formatAsTable(_0x148b1d,_0x23c94c,_0x120a2c,_0x534ba2);}const _0x1a242b=_0x59848c&&Number[_0x2051b0(0xcf)](_0x23c94c)&&_0x148b1d[_0x2051b0(0xad)][_0x2051b0(0xa9)]>_0x23c94c?{..._0x148b1d,'data':_0x148b1d[_0x2051b0(0xad)][_0x2051b0(0xaf)](0x0,_0x23c94c)}:_0x148b1d;if(_0x269399===_0x2051b0(0xa3))return formatAsJSON(_0x1a242b,_0x534ba2);else return _0x269399==='jsonl'?formatAsJSONL(_0x1a242b,_0x534ba2):formatQueryResult(_0x1a242b,_0x269399);}function shouldUseLess(_0x2a5207,_0x1fcf58){const _0x351d6f=a56_0x3663;return(_0x2a5207===_0x351d6f(0xb7)||_0x2a5207===_0x351d6f(0xc6))&&process[_0x351d6f(0xb5)][_0x351d6f(0xa1)]&&!_0x1fcf58;}export function resolveOutputOptions(_0x22fbb5){const _0xf1688d=a56_0x3663,_0x120ddd=_0x22fbb5[_0xf1688d(0xcb)]||'',_0x3ca5dd=resolveOutputFormat(_0x22fbb5['format'],_0x120ddd,_0xf1688d(0xb7));let _0x42237d=typeof _0x22fbb5[_0xf1688d(0xa5)]===_0xf1688d(0xc9)?_0x22fbb5['limit']:parseInt(_0x22fbb5[_0xf1688d(0xa5)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x22fbb5[_0xf1688d(0xa5)]===undefined&&shouldUseLess(_0x3ca5dd,_0x120ddd)&&(_0x42237d=Infinity),{'format':_0x3ca5dd,'output':_0x120ddd,'limit':_0x42237d,'limitStructuredFormats':_0x22fbb5[_0xf1688d(0xd5)],'color':_0x22fbb5[_0xf1688d(0xa6)],'noColor':_0x22fbb5[_0xf1688d(0xa2)]};}export function writeOutput(_0x1f5b70,_0x5da70a,_0xbaf941){const _0x84c103=a56_0x3663;return _0x5da70a?(writeFileSync(_0x5da70a,_0x1f5b70),console[_0x84c103(0xd8)](_0x84c103(0xa7)+_0x5da70a),Promise['resolve']()):shouldUseLess(_0xbaf941||'','')?new Promise(_0x431529=>{const _0x15dc37=_0x84c103,_0x43ac3c=spawn(_0x15dc37(0xd9),[_0x15dc37(0xbd)],{'stdio':['pipe',_0x15dc37(0xd6),_0x15dc37(0xd6)]});let _0x246f93=![];_0x43ac3c['on']('error',()=>{const _0x41bec2=_0x15dc37;!_0x246f93&&(_0x246f93=!![],console[_0x41bec2(0xb8)](_0x1f5b70),_0x431529());}),_0x43ac3c['on'](_0x15dc37(0x9b),()=>{!_0x246f93&&(_0x246f93=!![],_0x431529());}),_0x43ac3c['on'](_0x15dc37(0xc7),()=>{const _0x23bd34=_0x15dc37;!_0x246f93&&_0x43ac3c['stdin']&&(_0x43ac3c[_0x23bd34(0x9c)]['on'](_0x23bd34(0xd8),()=>{}),_0x43ac3c['stdin'][_0x23bd34(0xd1)](_0x1f5b70),_0x43ac3c[_0x23bd34(0x9c)]['end']());}),!_0x43ac3c['stdin']&&(!_0x246f93&&(_0x246f93=!![],console[_0x15dc37(0xb8)](_0x1f5b70),_0x431529()));}):(console[_0x84c103(0xb8)](_0x1f5b70),Promise[_0x84c103(0x8f)]());}export async function handleSDKOutput(_0x15392e,_0x42d06e){const _0x36dd74=a56_0x3663,_0x54347c=resolveOutputOptions(_0x42d06e),_0x55bcdd=await formatSDKOutput(_0x15392e,_0x54347c);await writeOutput(_0x55bcdd,_0x54347c[_0x36dd74(0xcb)]||undefined,_0x54347c[_0x36dd74(0x9e)]);}export async function handleQueryOutput(_0x37cf51,_0x2a360b){const _0x1ecdb8=a56_0x3663,_0x53106b=resolveOutputOptions(_0x2a360b),_0x85350c=await formatQueryOutput(_0x37cf51,_0x53106b);await writeOutput(_0x85350c,_0x53106b[_0x1ecdb8(0xcb)]||undefined,_0x53106b[_0x1ecdb8(0x9e)]);}function a56_0xbfa4(){const _0x3aca5e=['─┴─','table','log','1386558AIGnla','[params]','30TFBnjG','filter','-FXRSn','tsv','cyan','2sGNAvY','4686516PQtptx','varchar','debug','─┬─','cmdout','list','spawn','bigint','number','entries','output','[Object]','blue','jsonl','isFinite','query','write','magenta','isInteger','trim','limitStructuredFormats','inherit','double','error','less','repeat','string','resolve','sdk-result','20269733SSVtIT','object','441293JxVTap','keys','bold','push','rule','[error]','split','forEach','close','stdin','42wmUXHV','format','stderr','81744YuDBJo','isTTY','noColor','json','308110sQEvvE','limit','color','Results\x20saved\x20to\x20','[logs]','length','stringify','map','boolean','data','red','slice','params','padEnd','741915VueuAz','20SkMzzX','max','stdout'];a56_0xbfa4=function(){return _0x3aca5e;};return a56_0xbfa4();}async function formatSingleObject(_0x360309,_0x554280){const _0x357f85=a56_0x3663,{format:_0x4d3b21,color:_0x34b718,noColor:_0x164824}=_0x554280,_0x43e337={'color':_0x34b718,'noColor':_0x164824};if(_0x4d3b21===_0x357f85(0xa3)){if(shouldUseColor(_0x43e337))return colorizeJSON(_0x360309,_0x43e337);return JSON[_0x357f85(0xaa)](_0x360309,null,0x2);}else{if(_0x4d3b21===_0x357f85(0xce)){if(shouldUseColor(_0x43e337))return colorizeJSONCompact(_0x360309,_0x43e337);return JSON[_0x357f85(0xaa)](_0x360309);}else{if(_0x4d3b21===_0x357f85(0xbe))return Object[_0x357f85(0xca)](_0x360309)[_0x357f85(0xab)](([_0x2e29c4,_0x18a687])=>_0x2e29c4+'\x09'+_0x18a687)['join']('\x0a');else{const _0x68fb91=Object[_0x357f85(0xca)](_0x360309);if(_0x68fb91[_0x357f85(0xa9)]===0x0)return'No\x20data';const _0x384523=_0x360309[_0x357f85(0xc3)],_0x1517d3=_0x360309[_0x357f85(0xd0)],_0x47cdcb=_0x360309[_0x357f85(0xb0)],_0xa2a8c9=_0x360309[_0x357f85(0x97)],_0x2f5706=_0x1517d3?typeof _0x1517d3===_0x357f85(0x8e)?_0x1517d3:JSON['stringify'](_0x1517d3,null,0x2):undefined,_0x1be428=_0x47cdcb&&Object[_0x357f85(0x94)](_0x47cdcb)[_0x357f85(0xa9)]>0x0?JSON[_0x357f85(0xaa)](_0x47cdcb,null,0x2):undefined,_0x51ce06=_0xa2a8c9&&Object[_0x357f85(0x94)](_0xa2a8c9)[_0x357f85(0xa9)]>0x0?JSON[_0x357f85(0xaa)](_0xa2a8c9,null,0x2):undefined,_0x71c480=_0x68fb91[_0x357f85(0xbc)](([_0x2f7d15])=>_0x2f7d15!==_0x357f85(0xc3)&&_0x2f7d15!=='query'&&_0x2f7d15!==_0x357f85(0xb0)&&_0x2f7d15!==_0x357f85(0x97)),_0x1eb905=Math[_0x357f85(0xb4)](..._0x71c480['map'](([_0x10df30])=>_0x10df30[_0x357f85(0xa9)])),_0x5b5f7a=Math[_0x357f85(0xb4)](..._0x71c480['map'](([,_0x42a589])=>{const _0x21c939=_0x357f85;try{const _0x10f0d4=_0x42a589===null||_0x42a589===undefined?'':typeof _0x42a589===_0x21c939(0x92)?JSON[_0x21c939(0xaa)](_0x42a589):String(_0x42a589),_0x2f945=_0x10f0d4['split']('\x0a');return Math[_0x21c939(0xb4)](..._0x2f945[_0x21c939(0xab)](_0x4c3b61=>_0x4c3b61[_0x21c939(0xa9)]),0x0);}catch{return 0x0;}}),0x14),_0x5b1fc2=[];_0x5b1fc2['push'](colorBorder('┌─'+'─'[_0x357f85(0x8d)](_0x1eb905)+_0x357f85(0xc4)+'─'[_0x357f85(0x8d)](_0x5b5f7a)+'─┐',_0x43e337)),_0x71c480[_0x357f85(0x9a)](([_0x2b366b,_0x3e5571])=>{const _0x14e35b=_0x357f85;let _0x5e7cbc;try{_0x5e7cbc=_0x3e5571===null||_0x3e5571===undefined?'':typeof _0x3e5571===_0x14e35b(0x92)?JSON[_0x14e35b(0xaa)](_0x3e5571):String(_0x3e5571);}catch{_0x5e7cbc=_0x14e35b(0xcc);}const _0x493e74=_0x2b366b['padEnd'](_0x1eb905),_0x396800=_0x5e7cbc[_0x14e35b(0x99)]('\x0a');_0x396800[_0x14e35b(0x9a)]((_0x10424d,_0x52c106)=>{const _0x48ae22=_0x14e35b,_0x592110=colorBorder('│',_0x43e337);_0x52c106===0x0?_0x5b1fc2[_0x48ae22(0x96)](_0x592110+'\x20'+_0x493e74+'\x20'+_0x592110+'\x20'+_0x10424d[_0x48ae22(0xb1)](_0x5b5f7a)+'\x20'+_0x592110):_0x5b1fc2['push'](_0x592110+'\x20'+'\x20'[_0x48ae22(0x8d)](_0x1eb905)+'\x20'+_0x592110+'\x20'+_0x10424d[_0x48ae22(0xb1)](_0x5b5f7a)+'\x20'+_0x592110);});}),_0x5b1fc2[_0x357f85(0x96)](colorBorder('└─'+'─'[_0x357f85(0x8d)](_0x1eb905)+_0x357f85(0xb6)+'─'[_0x357f85(0x8d)](_0x5b5f7a)+'─┘',_0x43e337));_0x2f5706&&(_0x5b1fc2['push'](''),_0x5b1fc2[_0x357f85(0x96)](String(a56_0x5babab['yellow']['bold']('[query]'))),_0x5b1fc2[_0x357f85(0x96)](_0x2f5706));_0x1be428&&(_0x5b1fc2['push'](''),_0x5b1fc2[_0x357f85(0x96)](String(a56_0x5babab[_0x357f85(0xcd)][_0x357f85(0x95)](_0x357f85(0xba)))),_0x5b1fc2[_0x357f85(0x96)](_0x1be428));_0x51ce06&&(_0x5b1fc2[_0x357f85(0x96)](''),_0x5b1fc2[_0x357f85(0x96)](String(a56_0x5babab[_0x357f85(0xd2)]['bold']('[rule]'))),_0x5b1fc2[_0x357f85(0x96)](_0x51ce06));if(_0x384523){if(_0x384523['stderr']){_0x5b1fc2[_0x357f85(0x96)](''),_0x5b1fc2[_0x357f85(0x96)](String(a56_0x5babab[_0x357f85(0xae)][_0x357f85(0x95)](_0x357f85(0x98))));const _0xf7601e=_0x384523[_0x357f85(0x9f)][_0x357f85(0x99)]('\x0a');_0xf7601e[_0x357f85(0x9a)](_0x1d18d7=>{const _0x22e8f2=_0x357f85;_0x1d18d7[_0x22e8f2(0xd4)]()&&_0x5b1fc2['push'](_0x1d18d7);});}if(_0x384523[_0x357f85(0xc5)]){_0x5b1fc2[_0x357f85(0x96)](''),_0x5b1fc2[_0x357f85(0x96)](String(a56_0x5babab[_0x357f85(0xbf)][_0x357f85(0x95)](_0x357f85(0xa8))));const _0x4b4970=_0x384523['cmdout'][_0x357f85(0x99)]('\x0a');_0x4b4970[_0x357f85(0x9a)](_0x59c3dd=>{const _0x1d4889=_0x357f85;_0x59c3dd['trim']()&&_0x5b1fc2[_0x1d4889(0x96)](_0x59c3dd);});}}return _0x5b1fc2['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x5b91c6,_0x3721c5){const _0x1b5349=a56_0x3663;if(_0x3721c5[_0x1b5349(0x9e)]===_0x1b5349(0xb7)){await handleSDKOutput([_0x5b91c6],_0x3721c5);return;}const _0x4ab00f=resolveOutputOptions(_0x3721c5),_0x58eae8=await formatSingleObject(_0x5b91c6,_0x4ab00f);await writeOutput(_0x58eae8,_0x4ab00f[_0x1b5349(0xcb)]||undefined,_0x4ab00f[_0x1b5349(0x9e)]);}
1
+ (function(_0x4b5e55,_0x14f9c7){const _0x390329=a56_0x1cb4,_0x346926=_0x4b5e55();while(!![]){try{const _0x18bb0d=-parseInt(_0x390329(0x142))/0x1*(parseInt(_0x390329(0x139))/0x2)+parseInt(_0x390329(0x15e))/0x3+parseInt(_0x390329(0x122))/0x4+-parseInt(_0x390329(0x136))/0x5+-parseInt(_0x390329(0x13b))/0x6*(-parseInt(_0x390329(0x125))/0x7)+parseInt(_0x390329(0x161))/0x8*(parseInt(_0x390329(0x160))/0x9)+-parseInt(_0x390329(0x145))/0xa;if(_0x18bb0d===_0x14f9c7)break;else _0x346926['push'](_0x346926['shift']());}catch(_0x4a6343){_0x346926['push'](_0x346926['shift']());}}}(a56_0x217c,0xbaf9b));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a56_0x41d5cc from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x5a40be){const _0x4403b3=a56_0x1cb4;return _0x5a40be[_0x4403b3(0x156)]==='json'||_0x5a40be[_0x4403b3(0x156)]===_0x4403b3(0x13a)||_0x5a40be[_0x4403b3(0x156)]===_0x4403b3(0x166)||_0x5a40be[_0x4403b3(0x156)]===_0x4403b3(0x130)||_0x5a40be[_0x4403b3(0x151)]===!![]||_0x5a40be[_0x4403b3(0x13a)]===!![]||_0x5a40be[_0x4403b3(0x166)]===!![]||_0x5a40be[_0x4403b3(0x130)]===!![];}export function parseOutputOptions(_0x47cace){const _0x2a8c11=a56_0x1cb4;return{'format':_0x47cace['format']||'table','output':_0x47cace['output']||'','limit':_0x47cace[_0x2a8c11(0x141)],'limitStructuredFormats':_0x47cace[_0x2a8c11(0x120)],'color':_0x47cace[_0x2a8c11(0x153)],'noColor':_0x47cace[_0x2a8c11(0x15d)]};}function convertSDKResultToQueryResult(_0x458b66){const _0x1cbfde=a56_0x1cb4,_0x3c206d=[];if(_0x458b66[_0x1cbfde(0x15a)]>0x0){const _0x20a273=_0x458b66[0x0];for(const [_0x2fcea3,_0xde6651]of Object[_0x1cbfde(0x152)](_0x20a273)){let _0x1039bc=_0x1cbfde(0x135);if(typeof _0xde6651===_0x1cbfde(0x14a))_0x1039bc=Number['isInteger'](_0xde6651)?_0x1cbfde(0x127):_0x1cbfde(0x137);else{if(typeof _0xde6651==='boolean')_0x1039bc='boolean';else _0xde6651===null&&(_0x1039bc='varchar');}_0x3c206d[_0x1cbfde(0x12d)]({'name':_0x2fcea3,'type':_0x1039bc});}}return{'queryId':_0x1cbfde(0x121),'columns':_0x3c206d,'data':_0x458b66,'stats':{'state':_0x1cbfde(0x148),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x458b66[_0x1cbfde(0x15a)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x4849dd,_0x12c737){const _0x2f1839=convertSDKResultToQueryResult(_0x4849dd);return formatQueryOutput(_0x2f1839,_0x12c737);}function a56_0x1cb4(_0x15b4d6,_0x38edce){_0x15b4d6=_0x15b4d6-0x120;const _0x217c18=a56_0x217c();let _0x1cb4c3=_0x217c18[_0x15b4d6];return _0x1cb4c3;}export async function formatQueryOutput(_0x4e4b98,_0x1b00a7){const _0x16413e=a56_0x1cb4,{format:_0x2adf32,limit:_0x582d64,output:_0x3c8d75,color:_0x14462b,noColor:_0x1adc7b,limitStructuredFormats:_0x265b2e}=_0x1b00a7,_0x1fb32b=Boolean(_0x3c8d75)&&!_0x14462b,_0x17bd43={'color':_0x14462b,'noColor':_0x1adc7b||_0x1fb32b};if(_0x2adf32===_0x16413e(0x130)){const _0x422461=shouldUseLess(_0x2adf32,_0x3c8d75);return formatAsTable(_0x4e4b98,_0x582d64,_0x422461,_0x17bd43);}const _0x519e26=_0x265b2e&&Number[_0x16413e(0x14c)](_0x582d64)&&_0x4e4b98[_0x16413e(0x12b)][_0x16413e(0x15a)]>_0x582d64?{..._0x4e4b98,'data':_0x4e4b98[_0x16413e(0x12b)][_0x16413e(0x13e)](0x0,_0x582d64)}:_0x4e4b98;if(_0x2adf32===_0x16413e(0x151))return formatAsJSON(_0x519e26,_0x17bd43);else return _0x2adf32===_0x16413e(0x13a)?formatAsJSONL(_0x519e26,_0x17bd43):formatQueryResult(_0x519e26,_0x2adf32);}function shouldUseLess(_0x4fcc66,_0x23741a){const _0x481ab4=a56_0x1cb4;return(_0x4fcc66===_0x481ab4(0x130)||_0x4fcc66==='list')&&process['stdout']['isTTY']&&!_0x23741a;}export function resolveOutputOptions(_0x2e22b5){const _0x306042=a56_0x1cb4,_0x4d6468=_0x2e22b5[_0x306042(0x12f)]||'',_0x102297=resolveOutputFormat(_0x2e22b5[_0x306042(0x156)],_0x4d6468,_0x306042(0x130));let _0x65165d=typeof _0x2e22b5[_0x306042(0x141)]===_0x306042(0x14a)?_0x2e22b5[_0x306042(0x141)]:parseInt(_0x2e22b5[_0x306042(0x141)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x2e22b5[_0x306042(0x141)]===undefined&&shouldUseLess(_0x102297,_0x4d6468)&&(_0x65165d=Infinity),{'format':_0x102297,'output':_0x4d6468,'limit':_0x65165d,'limitStructuredFormats':_0x2e22b5[_0x306042(0x120)],'color':_0x2e22b5[_0x306042(0x153)],'noColor':_0x2e22b5['noColor']};}export function writeOutput(_0x15795c,_0x6270b,_0x5e7ef7){const _0x528de6=a56_0x1cb4;return _0x6270b?(writeFileSync(_0x6270b,_0x15795c),console['error']('Results\x20saved\x20to\x20'+_0x6270b),Promise[_0x528de6(0x15b)]()):shouldUseLess(_0x5e7ef7||'','')?new Promise(_0x7989ed=>{const _0x266489=_0x528de6,_0xcce015=spawn(_0x266489(0x157),['-FXRSn'],{'stdio':[_0x266489(0x143),_0x266489(0x165),_0x266489(0x165)]});let _0x11e4bf=![];_0xcce015['on']('error',()=>{!_0x11e4bf&&(_0x11e4bf=!![],console['log'](_0x15795c),_0x7989ed());}),_0xcce015['on'](_0x266489(0x15f),()=>{!_0x11e4bf&&(_0x11e4bf=!![],_0x7989ed());}),_0xcce015['on'](_0x266489(0x162),()=>{const _0x1077ea=_0x266489;!_0x11e4bf&&_0xcce015[_0x1077ea(0x124)]&&(_0xcce015['stdin']['on'](_0x1077ea(0x12a),()=>{}),_0xcce015['stdin']['write'](_0x15795c),_0xcce015[_0x1077ea(0x124)][_0x1077ea(0x132)]());}),!_0xcce015[_0x266489(0x124)]&&(!_0x11e4bf&&(_0x11e4bf=!![],console[_0x266489(0x15c)](_0x15795c),_0x7989ed()));}):(console['log'](_0x15795c),Promise['resolve']());}export async function handleSDKOutput(_0x47d584,_0x55db24){const _0x49ac9b=a56_0x1cb4,_0x53c009=resolveOutputOptions(_0x55db24),_0x47f1a7=await formatSDKOutput(_0x47d584,_0x53c009);await writeOutput(_0x47f1a7,_0x53c009[_0x49ac9b(0x12f)]||undefined,_0x53c009['format']);}function a56_0x217c(){const _0x1c7deb=['stringify','62638rWQwaC','jsonl','6OUSNDZ','forEach','─┬─','slice','trim','split','limit','21SZZGYx','pipe','params','2793000rfobRT','max','[rule]','FINISHED','map','number','[params]','isFinite','yellow','debug','cmdout','No\x20data','json','entries','color','repeat','rule','format','less','blue','query','length','resolve','log','noColor','1719783UZPWUC','close','1773fAqfqC','59448hCVSBJ','spawn','filter','join','inherit','tsv','stderr','limitStructuredFormats','sdk-result','1281608iUyVgy','object','stdin','2240462rlWRNe','[logs]','bigint','[Object]','bold','error','data','padEnd','push','magenta','output','table','[query]','end','red','keys','varchar','4873930flzfYw','double'];a56_0x217c=function(){return _0x1c7deb;};return a56_0x217c();}export async function handleQueryOutput(_0x554355,_0x4b1710){const _0x2713cd=a56_0x1cb4,_0x437b4a=resolveOutputOptions(_0x4b1710),_0x29afb7=await formatQueryOutput(_0x554355,_0x437b4a);await writeOutput(_0x29afb7,_0x437b4a[_0x2713cd(0x12f)]||undefined,_0x437b4a['format']);}async function formatSingleObject(_0x18e898,_0x489abf){const _0x54007d=a56_0x1cb4,{format:_0x2374c2,color:_0x39352a,noColor:_0x4bdc7e}=_0x489abf,_0x12dd1e={'color':_0x39352a,'noColor':_0x4bdc7e};if(_0x2374c2===_0x54007d(0x151)){if(shouldUseColor(_0x12dd1e))return colorizeJSON(_0x18e898,_0x12dd1e);return JSON[_0x54007d(0x138)](_0x18e898,null,0x2);}else{if(_0x2374c2===_0x54007d(0x13a)){if(shouldUseColor(_0x12dd1e))return colorizeJSONCompact(_0x18e898,_0x12dd1e);return JSON['stringify'](_0x18e898);}else{if(_0x2374c2===_0x54007d(0x166))return Object[_0x54007d(0x152)](_0x18e898)['map'](([_0x9e805b,_0xed8254])=>_0x9e805b+'\x09'+_0xed8254)[_0x54007d(0x164)]('\x0a');else{const _0x468599=Object[_0x54007d(0x152)](_0x18e898);if(_0x468599[_0x54007d(0x15a)]===0x0)return _0x54007d(0x150);const _0x5cc658=_0x18e898[_0x54007d(0x14e)],_0x2317ad=_0x18e898[_0x54007d(0x159)],_0x3f1ee2=_0x18e898[_0x54007d(0x144)],_0x426bdc=_0x18e898[_0x54007d(0x155)],_0x5af97d=_0x2317ad?typeof _0x2317ad==='string'?_0x2317ad:JSON[_0x54007d(0x138)](_0x2317ad,null,0x2):undefined,_0x3a01e6=_0x3f1ee2&&Object[_0x54007d(0x134)](_0x3f1ee2)[_0x54007d(0x15a)]>0x0?JSON[_0x54007d(0x138)](_0x3f1ee2,null,0x2):undefined,_0x20d2ce=_0x426bdc&&Object[_0x54007d(0x134)](_0x426bdc)[_0x54007d(0x15a)]>0x0?JSON[_0x54007d(0x138)](_0x426bdc,null,0x2):undefined,_0x59cf11=_0x468599[_0x54007d(0x163)](([_0x2ac4ea])=>_0x2ac4ea!==_0x54007d(0x14e)&&_0x2ac4ea!==_0x54007d(0x159)&&_0x2ac4ea!==_0x54007d(0x144)&&_0x2ac4ea!==_0x54007d(0x155)),_0x386964=Math[_0x54007d(0x146)](..._0x59cf11[_0x54007d(0x149)](([_0x16a849])=>_0x16a849['length'])),_0x2e16e2=Math['max'](..._0x59cf11[_0x54007d(0x149)](([,_0x515599])=>{const _0x2e49e6=_0x54007d;try{const _0x23c62d=_0x515599===null||_0x515599===undefined?'':typeof _0x515599===_0x2e49e6(0x123)?JSON[_0x2e49e6(0x138)](_0x515599):String(_0x515599),_0x2d5c01=_0x23c62d['split']('\x0a');return Math[_0x2e49e6(0x146)](..._0x2d5c01[_0x2e49e6(0x149)](_0x5f3298=>_0x5f3298['length']),0x0);}catch{return 0x0;}}),0x14),_0x3d88f9=[];_0x3d88f9['push'](colorBorder('┌─'+'─'['repeat'](_0x386964)+_0x54007d(0x13d)+'─'[_0x54007d(0x154)](_0x2e16e2)+'─┐',_0x12dd1e)),_0x59cf11['forEach'](([_0x356369,_0x3c1ebb])=>{const _0x318fbe=_0x54007d;let _0x68df95;try{_0x68df95=_0x3c1ebb===null||_0x3c1ebb===undefined?'':typeof _0x3c1ebb==='object'?JSON[_0x318fbe(0x138)](_0x3c1ebb):String(_0x3c1ebb);}catch{_0x68df95=_0x318fbe(0x128);}const _0x40a747=_0x356369['padEnd'](_0x386964),_0x263448=_0x68df95['split']('\x0a');_0x263448['forEach']((_0xa7edcf,_0x2d192a)=>{const _0x4ae9b5=_0x318fbe,_0x15e96a=colorBorder('│',_0x12dd1e);_0x2d192a===0x0?_0x3d88f9[_0x4ae9b5(0x12d)](_0x15e96a+'\x20'+_0x40a747+'\x20'+_0x15e96a+'\x20'+_0xa7edcf[_0x4ae9b5(0x12c)](_0x2e16e2)+'\x20'+_0x15e96a):_0x3d88f9[_0x4ae9b5(0x12d)](_0x15e96a+'\x20'+'\x20'[_0x4ae9b5(0x154)](_0x386964)+'\x20'+_0x15e96a+'\x20'+_0xa7edcf[_0x4ae9b5(0x12c)](_0x2e16e2)+'\x20'+_0x15e96a);});}),_0x3d88f9['push'](colorBorder('└─'+'─'[_0x54007d(0x154)](_0x386964)+'─┴─'+'─'[_0x54007d(0x154)](_0x2e16e2)+'─┘',_0x12dd1e));_0x5af97d&&(_0x3d88f9[_0x54007d(0x12d)](''),_0x3d88f9[_0x54007d(0x12d)](String(a56_0x41d5cc[_0x54007d(0x14d)][_0x54007d(0x129)](_0x54007d(0x131)))),_0x3d88f9[_0x54007d(0x12d)](_0x5af97d));_0x3a01e6&&(_0x3d88f9[_0x54007d(0x12d)](''),_0x3d88f9['push'](String(a56_0x41d5cc[_0x54007d(0x158)][_0x54007d(0x129)](_0x54007d(0x14b)))),_0x3d88f9[_0x54007d(0x12d)](_0x3a01e6));_0x20d2ce&&(_0x3d88f9[_0x54007d(0x12d)](''),_0x3d88f9[_0x54007d(0x12d)](String(a56_0x41d5cc[_0x54007d(0x12e)][_0x54007d(0x129)](_0x54007d(0x147)))),_0x3d88f9[_0x54007d(0x12d)](_0x20d2ce));if(_0x5cc658){if(_0x5cc658['stderr']){_0x3d88f9['push'](''),_0x3d88f9['push'](String(a56_0x41d5cc[_0x54007d(0x133)][_0x54007d(0x129)]('[error]')));const _0xfbc2d0=_0x5cc658[_0x54007d(0x167)][_0x54007d(0x140)]('\x0a');_0xfbc2d0[_0x54007d(0x13c)](_0x232664=>{const _0x6dbfb5=_0x54007d;_0x232664[_0x6dbfb5(0x13f)]()&&_0x3d88f9[_0x6dbfb5(0x12d)](_0x232664);});}if(_0x5cc658[_0x54007d(0x14f)]){_0x3d88f9[_0x54007d(0x12d)](''),_0x3d88f9['push'](String(a56_0x41d5cc['cyan'][_0x54007d(0x129)](_0x54007d(0x126))));const _0x20b085=_0x5cc658[_0x54007d(0x14f)][_0x54007d(0x140)]('\x0a');_0x20b085[_0x54007d(0x13c)](_0x4b1758=>{const _0x2b077f=_0x54007d;_0x4b1758[_0x2b077f(0x13f)]()&&_0x3d88f9[_0x2b077f(0x12d)](_0x4b1758);});}}return _0x3d88f9[_0x54007d(0x164)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x4fc44a,_0x14ca8c){const _0x4f2e32=a56_0x1cb4;if(_0x14ca8c['format']===_0x4f2e32(0x130)){await handleSDKOutput([_0x4fc44a],_0x14ca8c);return;}const _0x4ff326=resolveOutputOptions(_0x14ca8c),_0x312fd3=await formatSingleObject(_0x4fc44a,_0x4ff326);await writeOutput(_0x312fd3,_0x4ff326[_0x4f2e32(0x12f)]||undefined,_0x4ff326[_0x4f2e32(0x156)]);}