@treasuredata/tdx 0.29.0 → 0.29.1

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 (208) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/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/job-command.js +1 -1
  26. package/dist/commands/journey-command.js +1 -1
  27. package/dist/commands/journey-validate-command.js +1 -1
  28. package/dist/commands/llm-command.js +1 -1
  29. package/dist/commands/mcp-command.js +1 -1
  30. package/dist/commands/parent-segment-command.js +1 -1
  31. package/dist/commands/profile-command.js +1 -1
  32. package/dist/commands/profiles-command.js +1 -1
  33. package/dist/commands/query-command.js +1 -1
  34. package/dist/commands/schedule-command.js +1 -1
  35. package/dist/commands/segment-command.d.ts +8 -0
  36. package/dist/commands/segment-command.d.ts.map +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-command.js.map +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.d.ts +2 -2
  56. package/dist/core/auth.js +1 -1
  57. package/dist/core/command-output.js +1 -1
  58. package/dist/core/config.js +1 -1
  59. package/dist/core/connection-cache.js +1 -1
  60. package/dist/core/constants.js +1 -1
  61. package/dist/core/credential-cache.js +1 -1
  62. package/dist/core/global-context.js +1 -1
  63. package/dist/core/keychain.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/core/version.js +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/mcp/server.js +1 -1
  71. package/dist/mcp/tools/index.js +1 -1
  72. package/dist/mcp/tools/tdx-run.js +1 -1
  73. package/dist/mcp/tools/tdx-search.js +1 -1
  74. package/dist/mcp/utils.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/passthrough-server.js +1 -1
  77. package/dist/proxy/sse-usage-parser.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/agent/test/evaluator.js +1 -1
  82. package/dist/sdk/agent/test/executor.js +1 -1
  83. package/dist/sdk/agent/test/index.js +1 -1
  84. package/dist/sdk/agent/test/output.js +1 -1
  85. package/dist/sdk/agent/test/parser.js +1 -1
  86. package/dist/sdk/agent/tool-target-registry.js +1 -1
  87. package/dist/sdk/api.js +1 -1
  88. package/dist/sdk/client/cdp-api-client.d.ts +15 -0
  89. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  90. package/dist/sdk/client/cdp-api-client.js +1 -1
  91. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  92. package/dist/sdk/client/delivery-api-client.js +1 -1
  93. package/dist/sdk/client/endpoints.d.ts +5 -5
  94. package/dist/sdk/client/endpoints.js +1 -1
  95. package/dist/sdk/client/engage-api-client.js +1 -1
  96. package/dist/sdk/client/http-client.js +1 -1
  97. package/dist/sdk/client/llm-api-client.js +1 -1
  98. package/dist/sdk/client/rate-limiter.js +1 -1
  99. package/dist/sdk/client/td-api-client.js +1 -1
  100. package/dist/sdk/client/trino-api-client.js +1 -1
  101. package/dist/sdk/client/workflow-client.js +1 -1
  102. package/dist/sdk/connection-validator.js +1 -1
  103. package/dist/sdk/connection.js +1 -1
  104. package/dist/sdk/delivery.js +1 -1
  105. package/dist/sdk/engage/campaign-pull.js +1 -1
  106. package/dist/sdk/engage/campaign-push.js +1 -1
  107. package/dist/sdk/engage/campaign-validator.js +1 -1
  108. package/dist/sdk/engage/campaign-yaml.js +1 -1
  109. package/dist/sdk/engage/types/campaign-def.js +1 -1
  110. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  111. package/dist/sdk/engage.js +1 -1
  112. package/dist/sdk/errors.js +1 -1
  113. package/dist/sdk/index.d.ts +2 -2
  114. package/dist/sdk/index.d.ts.map +1 -1
  115. package/dist/sdk/index.js +1 -1
  116. package/dist/sdk/index.js.map +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/query/index.js +1 -1
  127. package/dist/sdk/query/sql-parser.js +1 -1
  128. package/dist/sdk/realtime.js +1 -1
  129. package/dist/sdk/schedule.js +1 -1
  130. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  131. package/dist/sdk/segment/fields-display.js +1 -1
  132. package/dist/sdk/segment/file-discovery.js +1 -1
  133. package/dist/sdk/segment/journey-utils.js +1 -1
  134. package/dist/sdk/segment/journey-validator.js +1 -1
  135. package/dist/sdk/segment/journey-yaml.js +1 -1
  136. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  137. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  138. package/dist/sdk/segment/pull-workflow.js +1 -1
  139. package/dist/sdk/segment/push-recovery.js +1 -1
  140. package/dist/sdk/segment/push-workflow.js +1 -1
  141. package/dist/sdk/segment/resolution-context.js +1 -1
  142. package/dist/sdk/segment/segment-path-parser.d.ts +2 -0
  143. package/dist/sdk/segment/segment-path-parser.d.ts.map +1 -1
  144. package/dist/sdk/segment/segment-path-parser.js +1 -1
  145. package/dist/sdk/segment/segment-path-parser.js.map +1 -1
  146. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  147. package/dist/sdk/segment/segment-validator.js +1 -1
  148. package/dist/sdk/segment/segment-validator.js.map +1 -1
  149. package/dist/sdk/segment/target-resolution.js +1 -1
  150. package/dist/sdk/segment/tdx-config.js +1 -1
  151. package/dist/sdk/segment/types/segment-def.js +1 -1
  152. package/dist/sdk/segment/types/segment-schema.js +1 -1
  153. package/dist/sdk/segment/validate-files.js +1 -1
  154. package/dist/sdk/segment/yaml-validator.js +1 -1
  155. package/dist/sdk/segment.d.ts +20 -1
  156. package/dist/sdk/segment.d.ts.map +1 -1
  157. package/dist/sdk/segment.js +1 -1
  158. package/dist/sdk/segment.js.map +1 -1
  159. package/dist/sdk/types/index.d.ts +3 -3
  160. package/dist/sdk/types/index.d.ts.map +1 -1
  161. package/dist/sdk/types/index.js +1 -1
  162. package/dist/sdk/types/index.js.map +1 -1
  163. package/dist/sdk/types/progress.js +1 -1
  164. package/dist/sdk/user.js +1 -1
  165. package/dist/sdk/util/format-detector.js +1 -1
  166. package/dist/sdk/util/formatters.js +1 -1
  167. package/dist/sdk/util/index.js +1 -1
  168. package/dist/sdk/util/tree-formatter.js +1 -1
  169. package/dist/sdk/workflow/archive-validation.js +1 -1
  170. package/dist/sdk/workflow/clone-workflow.js +1 -1
  171. package/dist/sdk/workflow/index.js +1 -1
  172. package/dist/sdk/workflow/pull-workflow.js +1 -1
  173. package/dist/sdk/workflow/push-workflow.js +1 -1
  174. package/dist/sdk/workflow/tdx-config.js +1 -1
  175. package/dist/sdk/workflow/workflow-utils.js +1 -1
  176. package/dist/test-utils/command-runner.js +1 -1
  177. package/dist/test-utils/factories.d.ts +1 -1
  178. package/dist/test-utils/factories.js +1 -1
  179. package/dist/test-utils/fixtures.js +1 -1
  180. package/dist/test-utils/http-mock.js +1 -1
  181. package/dist/test-utils/index.js +1 -1
  182. package/dist/utils/async.js +1 -1
  183. package/dist/utils/colors.js +1 -1
  184. package/dist/utils/diff.js +1 -1
  185. package/dist/utils/file-permissions.js +1 -1
  186. package/dist/utils/file-reader.js +1 -1
  187. package/dist/utils/global-cache.js +1 -1
  188. package/dist/utils/json-loader.js +1 -1
  189. package/dist/utils/local-cache.js +1 -1
  190. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  191. package/dist/utils/logger/formatters/index.js +1 -1
  192. package/dist/utils/logger/handlers/console-handler.js +1 -1
  193. package/dist/utils/logger/handlers/file-handler.js +1 -1
  194. package/dist/utils/logger/handlers/index.js +1 -1
  195. package/dist/utils/logger/handlers/null-handler.js +1 -1
  196. package/dist/utils/logger/index.js +1 -1
  197. package/dist/utils/logger/logger.js +1 -1
  198. package/dist/utils/logger/types.js +1 -1
  199. package/dist/utils/option-validation.js +1 -1
  200. package/dist/utils/process.js +1 -1
  201. package/dist/utils/prompt.js +1 -1
  202. package/dist/utils/spinner.js +1 -1
  203. package/dist/utils/sse-parser.js +1 -1
  204. package/dist/utils/string-utils.js +1 -1
  205. package/dist/utils/table-ref-parser.js +1 -1
  206. package/dist/utils/tdx-logger.js +1 -1
  207. package/dist/utils/version-check.js +1 -1
  208. package/package.json +1 -1
@@ -1 +1 @@
1
- const a47_0x18ff36=a47_0x1fbc;(function(_0x269d6a,_0x3d3b39){const _0x17a331=a47_0x1fbc,_0x378150=_0x269d6a();while(!![]){try{const _0x46aa12=-parseInt(_0x17a331(0x2ec))/0x1+parseInt(_0x17a331(0x239))/0x2+-parseInt(_0x17a331(0x285))/0x3*(parseInt(_0x17a331(0x1dd))/0x4)+-parseInt(_0x17a331(0x213))/0x5*(-parseInt(_0x17a331(0x2de))/0x6)+-parseInt(_0x17a331(0x2e7))/0x7*(-parseInt(_0x17a331(0x311))/0x8)+-parseInt(_0x17a331(0x18a))/0x9+parseInt(_0x17a331(0x1a8))/0xa;if(_0x46aa12===_0x3d3b39)break;else _0x378150['push'](_0x378150['shift']());}catch(_0x2b1499){_0x378150['push'](_0x378150['shift']());}}}(a47_0x146a,0x958a6));import a47_0x2bf1fc from'chalk';import{existsSync}from'fs';import a47_0x39bbb8 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,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 a47_0x307e4a from'prompts';function getAttemptStatusDisplay(_0x90b37e){const _0x15444f=a47_0x1fbc;if(!_0x90b37e)return{'icon':'⏳','text':''};const {done:_0x30fc06,success:_0x3bdc30,cancelRequested:_0x5ee171}=_0x90b37e;if(!_0x30fc06)return _0x5ee171?{'icon':'🛑','text':a47_0x2bf1fc[_0x15444f(0x29b)](_0x15444f(0x308))}:{'icon':'🔄','text':a47_0x2bf1fc[_0x15444f(0x2a6)](_0x15444f(0x2da))};if(_0x3bdc30)return{'icon':'✅','text':a47_0x2bf1fc['green']('success')};return{'icon':'❌','text':a47_0x2bf1fc[_0x15444f(0x2be)]('error')};}export class WorkflowBaseCommand extends BaseCommand{[a47_0x18ff36(0x2a8)](_0x5ef257,_0x441167,_0x3f1e6d=0x0){const _0x17fc47=a47_0x18ff36;return _0x5ef257[_0x3f1e6d]||_0x441167[_0x17fc47(0x18b)];}[a47_0x18ff36(0x2c8)](_0x245a7a,_0x7d6c77,_0x2922f4=0x0){const _0x2a1524=a47_0x18ff36,_0x30d758=this[_0x2a1524(0x2a8)](_0x245a7a,_0x7d6c77,_0x2922f4);if(!_0x30d758)return console[_0x2a1524(0x1b7)](a47_0x2bf1fc['red'](_0x2a1524(0x2f1)),_0x2a1524(0x2cc)),console[_0x2a1524(0x1b7)](a47_0x2bf1fc['dim'](_0x2a1524(0x230))),null;return _0x30d758;}[a47_0x18ff36(0x313)](_0x346abc,_0xb62555){const _0x1f3b8f=a47_0x18ff36;if(_0x346abc[0x0]){const _0x4b3b98=_0x346abc[0x0]['split']('.');if(_0x4b3b98[_0x1f3b8f(0x1b9)]===0x1)return{'projectName':_0x4b3b98[0x0],'workflowName':undefined};else return _0x4b3b98['length']===0x2?{'projectName':_0x4b3b98[0x0],'workflowName':_0x4b3b98[0x1]}:(console[_0x1f3b8f(0x1b7)](a47_0x2bf1fc[_0x1f3b8f(0x2be)]('Error:'),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0xb62555[_0x1f3b8f(0x18b)],'workflowName':undefined};}[a47_0x18ff36(0x232)](_0xbca06c,_0x43bbaf,_0x44b791=0x0){const _0xfdb86b=a47_0x18ff36;if(_0xbca06c[_0x44b791])return _0xbca06c[_0x44b791];if(_0x43bbaf[_0xfdb86b(0x18b)]){const _0x13b369=a47_0x39bbb8[_0xfdb86b(0x2c7)](process['cwd'](),_0xfdb86b(0x2b6),_0x43bbaf['workflowProject']);if(existsSync(a47_0x39bbb8[_0xfdb86b(0x2c7)](_0x13b369,_0xfdb86b(0x320))))return _0x13b369;}return undefined;}async[a47_0x18ff36(0x2d5)](_0x1c919c,_0x1648ff,_0x413522){const _0x1ab0c1=a47_0x18ff36;try{const _0x4d3e3e=await _0x1c919c[_0x1ab0c1(0x23c)][_0x1ab0c1(0x2b6)](_0x1648ff,{'limit':0x1});if(_0x4d3e3e[_0x1ab0c1(0x1b9)]>0x0){const _0x3b3a87=_0x4d3e3e[0x0]['id'],_0x141031=getWorkflowUrl(_0x413522,_0x3b3a87);console[_0x1ab0c1(0x1b7)](_0x1ab0c1(0x31b)+a47_0x2bf1fc[_0x1ab0c1(0x299)](_0x141031));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a47_0x18ff36(0x1cd);[a47_0x18ff36(0x321)]=a47_0x18ff36(0x2bd);async[a47_0x18ff36(0x2f8)](_0x697094){const _0x252037=a47_0x18ff36,{options:_0x51f6b6,args:_0x55acdc,tdx:_0x26cd50}=_0x697094,_0x500d0b=_0x55acdc[0x0],_0xd37580=_0x51f6b6[_0x252037(0x2ea)];if(_0xd37580)return saveSessionContext({'workflow_project':undefined},_0x51f6b6[_0x252037(0x334)]),console[_0x252037(0x1f9)](a47_0x2bf1fc[_0x252037(0x1cb)](_0x252037(0x267))),0x0;if(!_0x500d0b)return console[_0x252037(0x1b7)](a47_0x2bf1fc['red'](_0x252037(0x2f1)),'Project\x20name\x20is\x20required'),console[_0x252037(0x1b7)](a47_0x2bf1fc[_0x252037(0x22a)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x252037(0x1b7)](a47_0x2bf1fc['dim'](_0x252037(0x2e9))),0x1;const _0x50b277=await withSpinner(_0x252037(0x1d9)+_0x500d0b+_0x252037(0x2b2),()=>_0x26cd50[_0x252037(0x23c)][_0x252037(0x29a)](_0x500d0b),{'verbose':_0x51f6b6['verbose']}),{name:_0xde826e}=_0x50b277[_0x252037(0x258)];return saveSessionContext({'workflow_project':_0xde826e},_0x51f6b6[_0x252037(0x334)]),console[_0x252037(0x1f9)](a47_0x2bf1fc[_0x252037(0x1cb)](_0x252037(0x2d1)+a47_0x2bf1fc[_0x252037(0x299)](_0xde826e))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a47_0x18ff36(0x324)]='workflow:projects';[a47_0x18ff36(0x321)]=a47_0x18ff36(0x1c4);async[a47_0x18ff36(0x2f8)](_0x4dcd91){const _0xdf98c4=a47_0x18ff36,{options:_0x2927b4,args:_0x292807,tdx:_0x174add}=_0x4dcd91,_0x5dc824=_0x292807[0x0];_0x2927b4[_0xdf98c4(0x1bd)]&&_0x5dc824&&console[_0xdf98c4(0x1b7)](_0xdf98c4(0x1b8)+_0x5dc824);const _0x113b45=await withSpinner(_0xdf98c4(0x2fb),()=>_0x174add[_0xdf98c4(0x23c)][_0xdf98c4(0x329)](_0x5dc824,{'limit':_0x2927b4[_0xdf98c4(0x30e)]}),{'verbose':_0x2927b4[_0xdf98c4(0x1bd)]});let _0x3427cf=_0x113b45['data'];_0x3427cf[_0xdf98c4(0x32b)]((_0x18bb7a,_0x3349ba)=>_0x18bb7a[_0xdf98c4(0x324)][_0xdf98c4(0x240)](_0x3349ba[_0xdf98c4(0x324)]));const _0xb2ad3a=_0x2927b4[_0xdf98c4(0x30e)]||0x64,_0x4a0a83=_0x3427cf[_0xdf98c4(0x1b9)]>=_0xb2ad3a?a47_0x2bf1fc[_0xdf98c4(0x22a)](_0xdf98c4(0x1df)):'';console[_0xdf98c4(0x1b7)](_0xdf98c4(0x261)+_0x3427cf['length']+_0xdf98c4(0x2dc)+(_0x3427cf[_0xdf98c4(0x1b9)]!==0x1?'s':'')+_0x4a0a83);if(_0x2927b4[_0xdf98c4(0x2f9)]==='json'||_0x2927b4[_0xdf98c4(0x2f9)]===_0xdf98c4(0x27e)||_0x2927b4[_0xdf98c4(0x2f9)]===_0xdf98c4(0x2d7))await handleSDKOutput(_0x3427cf,_0x2927b4);else{if(_0x3427cf[_0xdf98c4(0x1b9)]===0x0)_0x5dc824?console['log'](_0xdf98c4(0x202)+_0x5dc824):console[_0xdf98c4(0x1f9)](_0xdf98c4(0x30f));else{const _0x5e9044=_0x3427cf['map'](_0x2bb5c4=>{const _0x50af4b=_0xdf98c4,_0xb45fe2=_0x2bb5c4[_0x50af4b(0x1b2)]?.[_0x50af4b(0x318)](_0x467332=>_0x467332['key']===_0x50af4b(0x283)),_0x34a7de=_0xb45fe2?a47_0x2bf1fc[_0x50af4b(0x22a)](_0x50af4b(0x1cf)):'';return'📁\x20'+_0x2bb5c4['name']+_0x34a7de;});await writeOutput(_0x5e9044[_0xdf98c4(0x2c7)]('\x0a'),_0x2927b4[_0xdf98c4(0x19c)],_0xdf98c4(0x1de));}}return 0x0;}}function a47_0x1fbc(_0x42f0d5,_0x5aa2a8){_0x42f0d5=_0x42f0d5-0x187;const _0x146a8b=a47_0x146a();let _0x1fbc3e=_0x146a8b[_0x42f0d5];return _0x1fbc3e;}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a47_0x18ff36(0x324)]='workflow:workflows';['description']=a47_0x18ff36(0x276);async['execute'](_0x1d82a4){const _0x56ef39=a47_0x18ff36,{options:_0x42f35b,args:_0x278b47,tdx:_0x34bbcb}=_0x1d82a4,_0x14389b=this['resolveProject'](_0x278b47,_0x42f35b);_0x42f35b[_0x56ef39(0x1bd)]&&_0x14389b&&console[_0x56ef39(0x1b7)]('Project\x20filter:\x20'+_0x14389b);const _0x5a8912=await withSpinner(_0x56ef39(0x257),()=>_0x34bbcb[_0x56ef39(0x23c)][_0x56ef39(0x2b6)](_0x14389b,{'limit':_0x42f35b[_0x56ef39(0x30e)]}),{'verbose':_0x42f35b[_0x56ef39(0x1bd)]});let _0x2964f0=_0x5a8912[_0x56ef39(0x258)];_0x2964f0[_0x56ef39(0x32b)]((_0x4e50d9,_0x1d3827)=>{const _0x1dc9e4=_0x56ef39,_0x9c46e8=_0x4e50d9['name'][_0x1dc9e4(0x240)](_0x1d3827[_0x1dc9e4(0x324)]);if(_0x9c46e8!==0x0)return _0x9c46e8;return(_0x4e50d9[_0x1dc9e4(0x2b8)]?.[_0x1dc9e4(0x324)]||'')[_0x1dc9e4(0x240)](_0x1d3827[_0x1dc9e4(0x2b8)]?.[_0x1dc9e4(0x324)]||'');});const _0x1a85b5=_0x42f35b['limit']||0x64,_0x39bec3=_0x2964f0['length']>=_0x1a85b5?a47_0x2bf1fc[_0x56ef39(0x22a)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x56ef39(0x1b7)](_0x56ef39(0x261)+_0x2964f0[_0x56ef39(0x1b9)]+_0x56ef39(0x24d)+(_0x2964f0[_0x56ef39(0x1b9)]!==0x1?'s':'')+_0x39bec3);if(_0x42f35b[_0x56ef39(0x2f9)]==='json'||_0x42f35b[_0x56ef39(0x2f9)]===_0x56ef39(0x27e)||_0x42f35b['format']===_0x56ef39(0x2d7))await handleSDKOutput(_0x2964f0,_0x42f35b);else{if(_0x2964f0[_0x56ef39(0x1b9)]===0x0)_0x14389b?console[_0x56ef39(0x1f9)](_0x56ef39(0x27a)+_0x14389b):console[_0x56ef39(0x1f9)]('No\x20workflows\x20found');else{const _0x3dd33f=_0x42f35b[_0x56ef39(0x236)],_0x1913f9=_0x2964f0['map'](_0x2ee1b2=>{const _0x58297a=_0x56ef39,_0x140cc5=a47_0x2bf1fc[_0x58297a(0x22a)]('#'+_0x2ee1b2['id']),_0x25d3a5=hyperlink(_0x140cc5,getWorkflowUrl(_0x3dd33f,_0x2ee1b2['id'])),_0x2cd75b=_0x2ee1b2[_0x58297a(0x2b8)]?.[_0x58297a(0x324)]?a47_0x2bf1fc[_0x58297a(0x22a)]('\x20('+_0x2ee1b2[_0x58297a(0x2b8)]['name']+')'):'';return _0x58297a(0x1fe)+_0x25d3a5+'\x20'+_0x2ee1b2[_0x58297a(0x324)]+_0x2cd75b;});await writeOutput(_0x1913f9[_0x56ef39(0x2c7)]('\x0a'),_0x42f35b[_0x56ef39(0x19c)],_0x56ef39(0x1de));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x286);[a47_0x18ff36(0x321)]=a47_0x18ff36(0x2ed);async[a47_0x18ff36(0x2f8)](_0x253395){const _0x4d2d44=a47_0x18ff36,{options:_0x3a43a2,args:_0x3288ac,tdx:_0x5e7933}=_0x253395,_0x383820=this[_0x4d2d44(0x313)](_0x3288ac,_0x3a43a2);if(!_0x383820)return 0x1;const {projectName:_0x31da50,workflowName:_0x439bc4}=_0x383820;if(_0x3a43a2[_0x4d2d44(0x1bd)]){if(_0x31da50&&_0x439bc4)console[_0x4d2d44(0x1b7)](_0x4d2d44(0x1d2)+_0x31da50+'.'+_0x439bc4);else _0x31da50&&console[_0x4d2d44(0x1b7)]('Filter:\x20project='+_0x31da50);const _0x14b5d2=_0x3a43a2[_0x4d2d44(0x303)];_0x14b5d2&&console[_0x4d2d44(0x1b7)](_0x4d2d44(0x1e4)+_0x14b5d2);}let _0x588872=0x28;if(process[_0x4d2d44(0x2ef)][_0x4d2d44(0x29d)]&&!_0x3a43a2[_0x4d2d44(0x19c)]&&!_0x3a43a2[_0x4d2d44(0x2f9)]){const _0x502d8e=process[_0x4d2d44(0x2ef)][_0x4d2d44(0x21b)]||0x28;_0x588872=Math[_0x4d2d44(0x1f7)](0x14,Math[_0x4d2d44(0x2a3)](_0x502d8e*0x2/0x3));}const _0x397db9=_0x3a43a2[_0x4d2d44(0x30e)]||_0x588872,_0x5e0a5f=await withSpinner(_0x4d2d44(0x30c),()=>_0x5e7933[_0x4d2d44(0x23c)]['sessions']({'projectName':_0x31da50,'workflowName':_0x439bc4,'status':_0x3a43a2['status'],'fromTime':_0x3a43a2[_0x4d2d44(0x305)],'toTime':_0x3a43a2['to'],'limit':_0x397db9}),{'verbose':_0x3a43a2[_0x4d2d44(0x1bd)]}),_0x386101=_0x5e0a5f['data'];_0x386101[_0x4d2d44(0x32b)]((_0x1e38cb,_0x15741a)=>{const _0x186dcb=_0x4d2d44,_0x4b5fb8=_0x1e38cb[_0x186dcb(0x255)]||'',_0x5b785b=_0x15741a[_0x186dcb(0x255)]||'';return _0x5b785b[_0x186dcb(0x240)](_0x4b5fb8);});_0x386101['length']>=_0x397db9?console[_0x4d2d44(0x1b7)](_0x4d2d44(0x27c)+_0x386101[_0x4d2d44(0x1b9)]+_0x4d2d44(0x1e6)+a47_0x2bf1fc[_0x4d2d44(0x22a)](_0x4d2d44(0x199))):console[_0x4d2d44(0x1b7)](_0x4d2d44(0x261)+_0x386101['length']+_0x4d2d44(0x248)+(_0x386101[_0x4d2d44(0x1b9)]!==0x1?'s':''));if(_0x3a43a2['format']===_0x4d2d44(0x222)||_0x3a43a2[_0x4d2d44(0x2f9)]===_0x4d2d44(0x27e)||_0x3a43a2[_0x4d2d44(0x2f9)]==='table')await handleSDKOutput(_0x386101,_0x3a43a2);else{if(!process[_0x4d2d44(0x2ef)][_0x4d2d44(0x29d)]||_0x3a43a2['output']){if(_0x386101[_0x4d2d44(0x1b9)]===0x0){if(_0x31da50&&_0x439bc4)console[_0x4d2d44(0x1f9)](_0x4d2d44(0x23a)+_0x31da50+'.'+_0x439bc4);else _0x31da50?console[_0x4d2d44(0x1f9)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x31da50):console[_0x4d2d44(0x1f9)](_0x4d2d44(0x1f0));}else{const _0x18bc0b=_0x3a43a2[_0x4d2d44(0x236)],_0xcf7e7a=this[_0x4d2d44(0x277)](_0x386101,_0x18bc0b);_0x3a43a2['output']?await writeOutput(_0xcf7e7a,_0x3a43a2['output'],'list'):console['log'](_0xcf7e7a);}!_0x31da50&&(console[_0x4d2d44(0x1b7)](''),console[_0x4d2d44(0x1b7)](a47_0x2bf1fc[_0x4d2d44(0x22a)](_0x4d2d44(0x224))),console[_0x4d2d44(0x1b7)](a47_0x2bf1fc[_0x4d2d44(0x22a)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a47_0x2bf1fc[_0x4d2d44(0x22a)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x386101[_0x4d2d44(0x1b9)]===0x0){if(_0x31da50&&_0x439bc4)console[_0x4d2d44(0x1f9)](_0x4d2d44(0x23a)+_0x31da50+'.'+_0x439bc4);else _0x31da50?console['log'](_0x4d2d44(0x1f4)+_0x31da50):console['log'](_0x4d2d44(0x1f0));}else await this[_0x4d2d44(0x2b7)](_0x386101,_0x253395,_0x31da50);}}return 0x0;}[a47_0x18ff36(0x277)](_0x9f5659,_0x50b275){const _0x501558=a47_0x18ff36,_0x176b0e=[],_0x284b08=new Map();let _0x29b723=Infinity,_0x3872a9=-Infinity;for(const _0x34e5e5 of _0x9f5659){if(_0x34e5e5[_0x501558(0x237)]?.[_0x501558(0x282)]){const _0x2a4ad4=new Date(_0x34e5e5[_0x501558(0x237)][_0x501558(0x282)])['getTime'](),_0xb43a10=_0x34e5e5[_0x501558(0x237)]['finishedAt']?new Date(_0x34e5e5[_0x501558(0x237)]['finishedAt'])[_0x501558(0x22e)]():Date[_0x501558(0x29c)](),_0x27cc20=_0x34e5e5[_0x501558(0x2b8)]?.[_0x501558(0x324)]||'(unknown)';!_0x284b08['has'](_0x27cc20)&&_0x284b08[_0x501558(0x1a0)](_0x27cc20,[]),_0x284b08[_0x501558(0x247)](_0x27cc20)[_0x501558(0x1e7)]({'session':_0x34e5e5,'startTime':_0x2a4ad4,'endTime':_0xb43a10,'duration':_0xb43a10-_0x2a4ad4}),_0x29b723=Math[_0x501558(0x1e8)](_0x29b723,_0x2a4ad4),_0x3872a9=Math[_0x501558(0x1f7)](_0x3872a9,_0xb43a10);}}if(_0x284b08[_0x501558(0x19e)]===0x0)return _0x501558(0x293);const _0x524021=process['stdout']['columns']||0x78,_0x1a4586=0x1e,_0x3a14d7=0x32,_0x26dbdc=0x4,_0x3fc19c=Math[_0x501558(0x1e8)](_0x3a14d7,Math[_0x501558(0x1f7)](_0x1a4586,Math['floor'](_0x524021*0.3))),_0x46df90=_0x524021-_0x3fc19c-TIMELINE_CONFIG['GUTTER']-0x3-_0x26dbdc,_0x5f5861=_0x3872a9-_0x29b723,_0x21ed05=_0x5f5861/_0x3fc19c,_0x317b86=renderTimeAxis({'startTime':_0x29b723,'endTime':_0x3872a9,'durationMs':_0x5f5861,'msPerChar':_0x21ed05},_0x3fc19c),_0x112ea6=[];for(const _0x59f14e of _0x284b08[_0x501558(0x1ca)]()){_0x112ea6[_0x501558(0x1e7)](..._0x59f14e);}_0x112ea6[_0x501558(0x32b)]((_0x20930d,_0x584792)=>_0x584792[_0x501558(0x18d)]-_0x20930d[_0x501558(0x18d)]);const _0x4fd2de=new Date(_0x29b723),_0x206607=formatDate(_0x4fd2de),_0xeb4b96=_0x26dbdc+TIMELINE_CONFIG[_0x501558(0x196)]+TIMELINE_CONFIG[_0x501558(0x31c)]+_0x46df90,_0x483806='\x20'[_0x501558(0x307)](_0xeb4b96-_0x206607[_0x501558(0x1b9)]),_0x50f434=_0x483806+a47_0x2bf1fc[_0x501558(0x22a)](_0x206607)+'\x20'+_0x317b86;_0x176b0e[_0x501558(0x1e7)](_0x50f434);const _0x1f68d9=0x16;let _0x230839=0x0;for(const _0x5e79fc of _0x112ea6){const _0x5d4122=_0x5e79fc[_0x501558(0x334)][_0x501558(0x2b8)]?.[_0x501558(0x324)]||'?',_0x40ff86=Math[_0x501558(0x1e8)](stringWidth(_0x5d4122),_0x1f68d9);_0x230839=Math[_0x501558(0x1f7)](_0x230839,_0x40ff86);}for(const _0x9fa3cf of _0x112ea6){const {session:_0x28d17d,startTime:_0x1a9196,endTime:_0x318d10,duration:_0x2d2025}=_0x9fa3cf,_0x3f708d=_0x28d17d['project']?.['id'],_0x499c70=_0x28d17d['id'],_0x55aa8f=_0x28d17d[_0x501558(0x2b8)]?.[_0x501558(0x324)]||'?',_0xa020dd=_0x28d17d['workflow']?.[_0x501558(0x324)]||'?';let _0xd84653,_0x4cb8c0;if(_0x28d17d[_0x501558(0x237)]){const _0x399a24=_0x28d17d[_0x501558(0x237)];!_0x399a24['done']?(_0xd84653=_0x399a24['cancelRequested']?'🛑':'🔄',_0x4cb8c0=_0x399a24[_0x501558(0x1fd)]?a47_0x2bf1fc[_0x501558(0x29b)]:a47_0x2bf1fc[_0x501558(0x2a6)]):(_0xd84653=_0x399a24[_0x501558(0x24f)]?'✅':'❌',_0x4cb8c0=_0x399a24[_0x501558(0x24f)]?a47_0x2bf1fc['green']:a47_0x2bf1fc[_0x501558(0x2be)]);}else _0xd84653='⏳',_0x4cb8c0=a47_0x2bf1fc[_0x501558(0x22a)];const _0x526050='#'+_0x499c70,_0x4f108a=_0x3f708d?hyperlink(_0x526050,getWorkflowSessionUrl(_0x50b275,_0x3f708d,_0x499c70)):_0x526050;let _0x1ec349=_0x55aa8f;stringWidth(_0x55aa8f)>_0x1f68d9&&(_0x1ec349=_0x55aa8f[_0x501558(0x24a)](0x0,_0x1f68d9-0x1)+'…');const _0x3696eb=a47_0x2bf1fc[_0x501558(0x22a)](_0x1ec349),_0x1af857=stringWidth(_0x1ec349),_0x5377e6='\x20'[_0x501558(0x307)](_0x230839-stringWidth(_0x1ec349)+0x2),_0x50798b='('+formatElapsed(_0x2d2025)+')',_0x8dbeb5=stringWidth(_0x50798b),_0x5ecab5=stringWidth(_0x526050),_0x4bb969=_0x5ecab5+0x1+_0x1af857+_0x5377e6['length'],_0x3ad4df=_0x46df90-_0x4bb969-_0x8dbeb5-0x1-0x8;let _0x223682=_0xa020dd;stringWidth(_0x223682)>_0x3ad4df&&(_0x223682=_0x223682['slice'](0x0,_0x3ad4df-0x1)+'…');const _0x4c851e=_0x4f108a+'\x20'+_0x3696eb+_0x5377e6+_0x223682,_0x1332e9=stringWidth(_0x4c851e),_0x411acc=_0x46df90-_0x1332e9-_0x8dbeb5,_0x574f54=_0x4c851e+'\x20'[_0x501558(0x307)](Math['max'](0x1,_0x411acc))+a47_0x2bf1fc[_0x501558(0x22a)](_0x50798b),_0x12f1de=Math[_0x501558(0x2a3)]((_0x1a9196-_0x29b723)/_0x21ed05),_0xb3c30d=Math[_0x501558(0x2a3)]((_0x318d10-_0x29b723)/_0x21ed05),_0x1a2a93=Math[_0x501558(0x1f7)](_0x12f1de+0x1,_0xb3c30d),_0x16cbf6=new Array(_0x3fc19c)[_0x501558(0x2b5)]('\x20');for(let _0x4176b1=_0x12f1de;_0x4176b1<Math['min'](_0x1a2a93,_0x3fc19c);_0x4176b1++){_0x16cbf6[_0x4176b1]='─';}const _0x582381=_0x16cbf6[_0x501558(0x2b9)](_0x4c1b4d=>_0x4c1b4d==='\x20'?'\x20':_0x4cb8c0(_0x4c1b4d))[_0x501558(0x2c7)]('');_0x176b0e['push'](_0xd84653+'\x20'+_0x574f54+'│'+_0x582381+'│');}return _0x176b0e[_0x501558(0x2c7)]('\x0a');}async['navigateSessionsInteractive'](_0x401da6,_0x3d540e,_0x297633){const _0x3f5eae=a47_0x18ff36,{options:_0x2ff0d7,tdx:_0x1abaee}=_0x3d540e,_0xb0f970=_0x2ff0d7[_0x3f5eae(0x236)],{timelineRows:_0x3a6ff2,timeAxisHeader:_0x302343}=this[_0x3f5eae(0x26f)](_0x401da6,_0xb0f970),_0x1030db=_0x3a6ff2[_0x3f5eae(0x2ad)](_0x25ae21=>_0x25ae21[_0x3f5eae(0x1b6)]);if(_0x1030db[_0x3f5eae(0x1b9)]===0x0){const _0x447545=this['renderSessionsTimeline'](_0x401da6,_0xb0f970);console[_0x3f5eae(0x1f9)](_0x447545);!_0x297633&&(console[_0x3f5eae(0x1b7)](''),console['error'](a47_0x2bf1fc['dim'](_0x3f5eae(0x224))),console[_0x3f5eae(0x1b7)](a47_0x2bf1fc[_0x3f5eae(0x22a)](_0x3f5eae(0x21c))+'or'+a47_0x2bf1fc[_0x3f5eae(0x22a)](_0x3f5eae(0x260))));return;}_0x302343&&console[_0x3f5eae(0x1f9)](_0x302343);const _0x5467ad=_0x3a6ff2[_0x3f5eae(0x2ad)](_0x156f8c=>_0x156f8c[_0x3f5eae(0x1b6)])[_0x3f5eae(0x2b9)](_0x521d68=>({'title':_0x521d68[_0x3f5eae(0x233)],'value':_0x521d68['attemptId']})),_0x2dd25a=process[_0x3f5eae(0x2ef)][_0x3f5eae(0x21b)]||0x3c,_0x1a0154=Math[_0x3f5eae(0x1f7)](0x28,Math['floor'](_0x2dd25a*0x2/0x3)),_0x3c59b5=await a47_0x307e4a({'type':'autocomplete','name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x5467ad,'initial':-0x1,'limit':_0x1a0154,'clearFirst':!![],'fallback':{'title':_0x3f5eae(0x1e1),'value':null},'suggest':(_0x396005,_0x517170)=>{const _0x23b1e9=_0x3f5eae;if(!_0x396005)return Promise[_0x23b1e9(0x238)](_0x517170);const _0x3e1b88=_0x517170['filter'](_0x5db783=>{const _0x2f8e4c=_0x23b1e9,_0x51f54d=_0x5db783;return _0x51f54d[_0x2f8e4c(0x279)][_0x2f8e4c(0x2ae)]()['includes'](_0x396005[_0x2f8e4c(0x2ae)]());});return Promise[_0x23b1e9(0x238)](_0x3e1b88);}}),_0x364e7c=()=>{const _0x5cc4c4=_0x3f5eae;process['stdout'][_0x5cc4c4(0x275)]('\x1b[1A\x1b[2K'),process[_0x5cc4c4(0x2ef)]['write'](_0x5cc4c4(0x290)),process['stdout'][_0x5cc4c4(0x275)](_0x5cc4c4(0x290));},_0x355cc8=_0x3c59b5&&_0x3c59b5[_0x3f5eae(0x1b6)]&&_0x3c59b5[_0x3f5eae(0x1b6)]!==null&&_0x3c59b5[_0x3f5eae(0x1b6)][_0x3f5eae(0x28a)]()!=='';if(!_0x355cc8){_0x364e7c(),console['log'](a47_0x2bf1fc[_0x3f5eae(0x22a)](_0x3f5eae(0x1a4)));return;}_0x364e7c();const _0x3edb6a=_0x401da6[_0x3f5eae(0x197)](_0x4492f6=>_0x4492f6['lastAttempt']?.['id']===_0x3c59b5[_0x3f5eae(0x1b6)]);if(_0x3edb6a){const _0x11fb53=_0x3edb6a[_0x3f5eae(0x2b8)]?.[_0x3f5eae(0x324)]||'?',_0x5f4df0=_0x3edb6a[_0x3f5eae(0x23c)]?.[_0x3f5eae(0x324)]||'?';console['log'](_0x3f5eae(0x1c8)+a47_0x2bf1fc[_0x3f5eae(0x22a)](_0x11fb53)+_0x3f5eae(0x2dd)+a47_0x2bf1fc[_0x3f5eae(0x22a)](_0x5f4df0));}const _0x36de86=new WorkflowTimelineCommand();await _0x36de86[_0x3f5eae(0x2f8)]({'args':[],'options':{..._0x2ff0d7,'attemptId':_0x3c59b5[_0x3f5eae(0x1b6)]},'tdx':_0x1abaee});}['generateSessionTimelineRows'](_0x49c740,_0x2e8ce4){const _0x5d4766=a47_0x18ff36,_0x55ba5c=new Map();for(const _0x146da1 of _0x49c740){_0x146da1['id']&&_0x146da1['lastAttempt']?.['id']&&_0x55ba5c[_0x5d4766(0x1a0)](_0x146da1['id'],_0x146da1['lastAttempt']['id']);}const _0x394130=[];let _0x34c70b='';const _0x58c286=this['renderSessionsTimeline'](_0x49c740,_0x2e8ce4),_0x54cb10=_0x58c286[_0x5d4766(0x1b5)]('\x0a');for(const _0x517b86 of _0x54cb10){if(_0x517b86[_0x5d4766(0x265)](_0x5d4766(0x25c))||_0x517b86[_0x5d4766(0x1a5)](/^\s+\d{4}-\d{2}-\d{2}/))_0x34c70b=_0x517b86;else{if(_0x517b86[_0x5d4766(0x1a5)](/^[✅❌🔄🛑⏳]/)){const _0x31a54a=_0x517b86['match'](/#(\d+)/),_0x436389=_0x31a54a?_0x31a54a[0x1]:null,_0x2eaf96=_0x436389?_0x55ba5c[_0x5d4766(0x247)](_0x436389)||null:null,_0x2c7fea=_0x49c740[_0x5d4766(0x197)](_0x1230a4=>_0x1230a4['id']===_0x436389),_0x55330d=_0x2c7fea?.['project']?.[_0x5d4766(0x324)]||'';_0x394130[_0x5d4766(0x1e7)]({'displayLine':_0x517b86,'attemptId':_0x2eaf96,'projectName':_0x55330d});}}}return{'timelineRows':_0x394130,'timeAxisHeader':_0x34c70b};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a47_0x18ff36(0x324)]='workflow:attempts';[a47_0x18ff36(0x321)]=a47_0x18ff36(0x1f1);async['execute'](_0x22846b){const _0x318c9a=a47_0x18ff36,{options:_0x34628b,args:_0x5374bf,tdx:_0x418e4d}=_0x22846b,_0x540908=this['parseProjectWorkflowPattern'](_0x5374bf,_0x34628b);if(!_0x540908)return 0x1;const {projectName:_0x5e6abc,workflowName:_0x8c71d6}=_0x540908,_0x424892=_0x34628b[_0x318c9a(0x18c)];if(_0x34628b[_0x318c9a(0x1bd)]){if(_0x5e6abc&&_0x8c71d6)console['error'](_0x318c9a(0x1d2)+_0x5e6abc+'.'+_0x8c71d6);else _0x5e6abc&&console[_0x318c9a(0x1b7)](_0x318c9a(0x24e)+_0x5e6abc);_0x424892&&console[_0x318c9a(0x1b7)](_0x318c9a(0x272));}const _0x3ad320=await withSpinner(_0x318c9a(0x259),()=>_0x418e4d[_0x318c9a(0x23c)]['attempts']({'projectName':_0x5e6abc,'workflowName':_0x8c71d6,'includeRetried':_0x424892,'limit':_0x34628b[_0x318c9a(0x30e)]}),{'verbose':_0x34628b[_0x318c9a(0x1bd)]}),_0x4386ce=_0x3ad320[_0x318c9a(0x258)],_0xcd2ab1=_0x34628b[_0x318c9a(0x30e)]||0x64,_0x3675ec=_0x4386ce[_0x318c9a(0x1b9)]>=_0xcd2ab1?a47_0x2bf1fc[_0x318c9a(0x22a)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x318c9a(0x1b7)]('✔\x20Found\x20'+_0x4386ce[_0x318c9a(0x1b9)]+_0x318c9a(0x29e)+(_0x4386ce[_0x318c9a(0x1b9)]!==0x1?'s':'')+_0x3675ec);if(_0x34628b[_0x318c9a(0x2f9)]===_0x318c9a(0x222)||_0x34628b[_0x318c9a(0x2f9)]===_0x318c9a(0x27e)||_0x34628b[_0x318c9a(0x2f9)]===_0x318c9a(0x2d7))await handleSDKOutput(_0x4386ce,_0x34628b);else{if(_0x4386ce[_0x318c9a(0x1b9)]===0x0){if(_0x5e6abc&&_0x8c71d6)console[_0x318c9a(0x1f9)](_0x318c9a(0x1dc)+_0x5e6abc+'.'+_0x8c71d6);else _0x5e6abc?console[_0x318c9a(0x1f9)](_0x318c9a(0x319)+_0x5e6abc):console[_0x318c9a(0x1f9)](_0x318c9a(0x187));}else{const _0x591846=_0x34628b[_0x318c9a(0x236)],_0x58d62d=_0x4386ce[_0x318c9a(0x2b9)](_0x462b18=>{const _0x448b6f=_0x318c9a,_0x28d22b=a47_0x2bf1fc[_0x448b6f(0x22a)]('#'+_0x462b18['id']),_0x5ac592=_0x462b18[_0x448b6f(0x2b8)]?.['id'],_0x409e37=_0x462b18['session_id']||_0x462b18[_0x448b6f(0x2d8)],_0x1209a0=_0x5ac592&&_0x409e37?hyperlink(_0x28d22b,getWorkflowAttemptUrl(_0x591846,_0x5ac592,_0x409e37,_0x462b18['id'])):_0x28d22b,{icon:_0x360cff,text:_0x2ddb1e}=getAttemptStatusDisplay(_0x462b18),_0xf4d07a=(_0x462b18[_0x448b6f(0x2b8)]?.[_0x448b6f(0x324)]||'?')+'.'+(_0x462b18['workflow']?.[_0x448b6f(0x324)]||'?'),_0x413759=_0x462b18[_0x448b6f(0x255)]?a47_0x2bf1fc['dim'](_0x462b18['sessionTime']):'';return(_0x1209a0+'\x20'+_0x360cff+(_0x2ddb1e?'\x20'+_0x2ddb1e:'')+'\x20'+_0xf4d07a+'\x20'+_0x413759)[_0x448b6f(0x323)]();});await writeOutput(_0x58d62d[_0x318c9a(0x2c7)]('\x0a'),_0x34628b['output'],_0x318c9a(0x1de));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x1fb);[a47_0x18ff36(0x321)]=a47_0x18ff36(0x217);async['execute'](_0x5acd02){const _0x2b7962=a47_0x18ff36,{options:_0x33ebcb,args:_0x43030f,tdx:_0x53068e}=_0x5acd02,_0x1b5ff3=_0x43030f[0x0];if(!_0x1b5ff3)return console[_0x2b7962(0x1b7)](_0x2b7962(0x271)),0x1;_0x33ebcb[_0x2b7962(0x1bd)]&&console[_0x2b7962(0x1b7)]('Attempt\x20ID:\x20'+_0x1b5ff3);const _0x4f40bb=await withSpinner(_0x2b7962(0x22f),()=>_0x53068e['workflow'][_0x2b7962(0x1da)](_0x1b5ff3),{'verbose':_0x33ebcb['verbose']}),_0x33ad98=_0x4f40bb['data'];let _0xe41b5c;!_0x33ad98[_0x2b7962(0x32f)]?_0xe41b5c=_0x33ad98[_0x2b7962(0x1fd)]?_0x2b7962(0x308):'running':_0xe41b5c=_0x33ad98[_0x2b7962(0x24f)]?'success':_0x2b7962(0x1b7);let _0x293971;if(_0x33ad98['createdAt']&&_0x33ad98['finishedAt']){const _0x192330=new Date(_0x33ad98['createdAt'])[_0x2b7962(0x22e)](),_0x1c6654=new Date(_0x33ad98['finishedAt'])[_0x2b7962(0x22e)]();_0x293971=Math[_0x2b7962(0x1e5)]((_0x1c6654-_0x192330)/0x3e8);}const _0x3d19c8={'attempt_id':_0x33ad98['id'],'status':_0xe41b5c,..._0x33ad98[_0x2b7962(0x225)]!==undefined&&{'index':_0x33ad98['index']},..._0x33ad98[_0x2b7962(0x2b8)]&&{'project':_0x33ad98['project'][_0x2b7962(0x324)]},..._0x33ad98[_0x2b7962(0x23c)]&&{'workflow':_0x33ad98[_0x2b7962(0x23c)][_0x2b7962(0x324)]},..._0x33ad98[_0x2b7962(0x2d8)]&&{'session_id':_0x33ad98[_0x2b7962(0x2d8)]},..._0x33ad98[_0x2b7962(0x255)]&&{'session_time':_0x33ad98[_0x2b7962(0x255)]},..._0x33ad98[_0x2b7962(0x30d)]&&{'retry_attempt':_0x33ad98[_0x2b7962(0x30d)]},..._0x293971!==undefined&&{'duration_sec':_0x293971},..._0x33ad98[_0x2b7962(0x282)]&&{'created_at':_0x33ad98[_0x2b7962(0x282)]},..._0x33ad98['finishedAt']&&{'finished_at':_0x33ad98[_0x2b7962(0x2f0)]},...Object[_0x2b7962(0x20a)](_0x33ad98['params'])[_0x2b7962(0x1b9)]>0x0&&{'params':_0x33ad98[_0x2b7962(0x302)]}};return await handleSingleObjectOutput(_0x3d19c8,_0x33ebcb),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a47_0x18ff36(0x1a7);[a47_0x18ff36(0x321)]='Show\x20tasks\x20for\x20an\x20attempt';async[a47_0x18ff36(0x2f8)](_0x414a75){const _0x57f10e=a47_0x18ff36,{options:_0x1e57b4,args:_0x398234,tdx:_0x19b174}=_0x414a75,_0x2ddb8d=_0x398234[0x0];if(!_0x2ddb8d)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x5452ce=_0x1e57b4[_0x57f10e(0x312)];_0x1e57b4['verbose']&&(console[_0x57f10e(0x1b7)]('Attempt\x20ID:\x20'+_0x2ddb8d),_0x5452ce&&console[_0x57f10e(0x1b7)](_0x57f10e(0x241)));const _0x390459=await withSpinner(_0x57f10e(0x32d),()=>_0x19b174['workflow']['tasks'](_0x2ddb8d,_0x5452ce||![]),{'verbose':_0x1e57b4[_0x57f10e(0x1bd)]}),_0x64b925=_0x390459[_0x57f10e(0x258)];return console[_0x57f10e(0x1b7)](_0x57f10e(0x261)+_0x64b925[_0x57f10e(0x1b9)]+'\x20task'+(_0x64b925[_0x57f10e(0x1b9)]!==0x1?'s':'')),await handleSDKOutput(_0x64b925,_0x1e57b4),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x229);['description']=a47_0x18ff36(0x327);async[a47_0x18ff36(0x2f8)](_0x50fcd2){const _0xb7bfce=a47_0x18ff36,{options:_0x1b8e24,args:_0x4bf257,tdx:_0x191bc3}=_0x50fcd2,_0x487eeb=_0x4bf257[0x0];let _0x5f5438=_0x4bf257[0x1];if(!_0x487eeb)return console['error'](_0xb7bfce(0x271)),0x1;_0x1b8e24['verbose']&&(console[_0xb7bfce(0x1b7)](_0xb7bfce(0x281)+_0x487eeb),_0x5f5438&&console[_0xb7bfce(0x1b7)]('Task\x20name:\x20'+_0x5f5438));const _0x358e3c=await withSpinner(_0xb7bfce(0x2ac),()=>_0x191bc3[_0xb7bfce(0x23c)][_0xb7bfce(0x1e2)](_0x487eeb,_0x5f5438),{'verbose':_0x1b8e24[_0xb7bfce(0x1bd)]}),_0x2b5cd9=_0x358e3c[_0xb7bfce(0x258)];if(_0x2b5cd9['length']===0x0)return console[_0xb7bfce(0x1b7)](_0xb7bfce(0x331)),0x0;if(!_0x5f5438&&(_0x1b8e24[_0xb7bfce(0x222)]||_0x1b8e24[_0xb7bfce(0x2f9)]))return await handleSDKOutput(_0x2b5cd9,_0x1b8e24),0x0;if(!_0x5f5438){const _0x3d6d0f=_0x2b5cd9['map'](_0x107e0d=>({'title':_0x107e0d[_0xb7bfce(0x1c2)]+'\x20('+formatBytes(_0x107e0d[_0xb7bfce(0x1ff)])+')','value':_0x107e0d[_0xb7bfce(0x1c2)]})),_0x43e1f1=await a47_0x307e4a({'type':_0xb7bfce(0x1f8),'name':_0xb7bfce(0x231),'message':_0xb7bfce(0x218),'choices':_0x3d6d0f});if(!_0x43e1f1[_0xb7bfce(0x231)])return console['error']('Cancelled'),0x0;_0x5f5438=_0x43e1f1[_0xb7bfce(0x231)];}const _0x1242ab=await withSpinner(_0xb7bfce(0x1a6),()=>_0x191bc3['workflow'][_0xb7bfce(0x28d)](_0x487eeb,_0x5f5438),{'verbose':_0x1b8e24[_0xb7bfce(0x1bd)]}),_0x5bd48d=_0x1242ab[_0xb7bfce(0x258)];return _0x5bd48d?console[_0xb7bfce(0x1f9)](_0x5bd48d):console[_0xb7bfce(0x1b7)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x262);['description']=a47_0x18ff36(0x2f7);async[a47_0x18ff36(0x2f8)](_0x2d9815){const _0x5e178c=a47_0x18ff36,{options:_0x432146,args:_0x5c43d3,tdx:_0x22698d}=_0x2d9815,_0x59ae06=_0x5c43d3[0x0];if(!_0x59ae06)return console[_0x5e178c(0x1b7)](_0x5e178c(0x271)),0x1;const _0x46cc89=_0x432146['reason'];_0x432146[_0x5e178c(0x1bd)]&&(console[_0x5e178c(0x1b7)](_0x5e178c(0x281)+_0x59ae06),_0x46cc89&&console[_0x5e178c(0x1b7)](_0x5e178c(0x32c)+_0x46cc89));if(!_0x432146[_0x5e178c(0x316)]){if(!isInteractive())return console['error'](a47_0x2bf1fc[_0x5e178c(0x2be)](_0x5e178c(0x1db)),_0x5e178c(0x19f)),console[_0x5e178c(0x1b7)](a47_0x2bf1fc[_0x5e178c(0x22a)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x217321=await confirmKey(_0x5e178c(0x335)+_0x59ae06+'?');if(!_0x217321)return console[_0x5e178c(0x1b7)](a47_0x2bf1fc['yellow']('Cancelled')),0x1;}const _0x255271=await withSpinner('Killing\x20attempt...',()=>_0x22698d[_0x5e178c(0x23c)]['kill'](_0x59ae06,_0x46cc89),{'verbose':_0x432146[_0x5e178c(0x1bd)]}),_0x3d504a=_0x255271[_0x5e178c(0x258)];return console['error']('✔\x20'+_0x3d504a),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x294);[a47_0x18ff36(0x321)]=a47_0x18ff36(0x26d);async[a47_0x18ff36(0x2f8)](_0x55d70c){const _0xf271aa=a47_0x18ff36,{options:_0x58ab5d,args:_0x34a726,tdx:_0x37f91d}=_0x55d70c,_0x2ee4d3=_0x34a726[0x0];if(!_0x2ee4d3)return console['error'](_0xf271aa(0x28c)),console[_0xf271aa(0x1b7)](_0xf271aa(0x2a5)),0x1;let _0x570fa4=![],_0x59d138=_0x2ee4d3;if(_0x2ee4d3[_0xf271aa(0x265)](_0xf271aa(0x20f)))_0x570fa4=!![],_0x59d138=_0x2ee4d3[_0xf271aa(0x314)](0x8);else{if(_0x2ee4d3[_0xf271aa(0x265)](_0xf271aa(0x1ea)))_0x570fa4=![],_0x59d138=_0x2ee4d3[_0xf271aa(0x314)](0x8);else return console[_0xf271aa(0x1b7)](_0xf271aa(0x201)),console[_0xf271aa(0x1b7)](_0xf271aa(0x2a5)),0x1;}const _0x6c4e24=_0x58ab5d[_0xf271aa(0x18f)],_0x7c31e7=_0x58ab5d['resumeFrom'],_0x59d29e=_0x58ab5d[_0xf271aa(0x302)],_0x4fc9c4=_0x58ab5d[_0xf271aa(0x2c0)];_0x58ab5d[_0xf271aa(0x1bd)]&&(console['error'](_0xf271aa(0x2f5)+(_0x570fa4?'session':_0xf271aa(0x1da))+'\x20'+_0x59d138),_0x6c4e24&&console[_0xf271aa(0x1b7)](_0xf271aa(0x26b)+_0x6c4e24),_0x7c31e7&&console[_0xf271aa(0x1b7)]('Resume\x20from:\x20'+_0x7c31e7),_0x59d29e&&console[_0xf271aa(0x1b7)]('Params:\x20'+_0x59d29e),_0x4fc9c4&&console[_0xf271aa(0x1b7)]('Force:\x20yes'));let _0xf8020a;if(_0x59d29e)try{if(_0x59d29e[_0xf271aa(0x265)]('@')){const _0x4a93af=await import('fs/promises'),_0x92d686=_0x59d29e['substring'](0x1),_0x2239df=await _0x4a93af[_0xf271aa(0x2d0)](_0x92d686,_0xf271aa(0x1d6));_0xf8020a=JSON[_0xf271aa(0x18e)](_0x2239df);}else _0xf8020a=JSON[_0xf271aa(0x18e)](_0x59d29e);}catch{return console[_0xf271aa(0x1b7)](_0xf271aa(0x27f)),0x1;}if(!_0x58ab5d[_0xf271aa(0x316)]){if(!isInteractive())return console[_0xf271aa(0x1b7)](a47_0x2bf1fc[_0xf271aa(0x2be)]('\x0aError:'),_0xf271aa(0x19f)),console['error'](a47_0x2bf1fc[_0xf271aa(0x22a)](_0xf271aa(0x2c5))),0x1;const _0x790bc=await confirmKey(_0xf271aa(0x2d6)+(_0x570fa4?'session':_0xf271aa(0x1da))+'\x20'+_0x59d138+'?');if(!_0x790bc)return console[_0xf271aa(0x1b7)](a47_0x2bf1fc[_0xf271aa(0x29b)]('Cancelled')),0x1;}let _0x1e46f0;_0x570fa4?_0x1e46f0=await withSpinner(_0xf271aa(0x1c7),()=>_0x37f91d[_0xf271aa(0x23c)][_0xf271aa(0x1d3)](_0x59d138,{'fromTask':_0x6c4e24,'retryParams':_0xf8020a}),{'verbose':_0x58ab5d[_0xf271aa(0x1bd)]}):_0x1e46f0=await withSpinner(_0xf271aa(0x2db),()=>_0x37f91d[_0xf271aa(0x23c)][_0xf271aa(0x203)](_0x59d138,{'resumeFrom':_0x7c31e7,'retryParams':_0xf8020a,'force':_0x4fc9c4}),{'verbose':_0x58ab5d[_0xf271aa(0x1bd)]});const _0x20c53e=_0x1e46f0[_0xf271aa(0x258)];return console[_0xf271aa(0x1b7)](_0xf271aa(0x2fa)),console[_0xf271aa(0x1b7)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x20c53e[_0xf271aa(0x1b6)]),console[_0xf271aa(0x1b7)](_0xf271aa(0x2ba)+_0x20c53e[_0xf271aa(0x2d8)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x1d1);[a47_0x18ff36(0x321)]=a47_0x18ff36(0x2ff);async[a47_0x18ff36(0x2f8)](_0x55ef63){const _0xa3ee3a=a47_0x18ff36,{options:_0x262ff4,args:_0x204eab,tdx:_0xbd59d0}=_0x55ef63;let _0x4fc333=_0x204eab[0x0];if(!_0x4fc333){const _0x2f88bf=this['resolveProject']([],_0x262ff4),_0x24941d=await withSpinner('Loading\x20workflows...',()=>_0xbd59d0[_0xa3ee3a(0x23c)][_0xa3ee3a(0x2b6)](_0x2f88bf,{'limit':_0x262ff4[_0xa3ee3a(0x30e)]}),{'verbose':_0x262ff4[_0xa3ee3a(0x1bd)]}),_0x30ff9=_0x24941d[_0xa3ee3a(0x258)];if(_0x30ff9[_0xa3ee3a(0x1b9)]===0x0)return console[_0xa3ee3a(0x1b7)](_0xa3ee3a(0x315)),!_0x2f88bf&&console[_0xa3ee3a(0x1b7)](a47_0x2bf1fc[_0xa3ee3a(0x22a)](_0xa3ee3a(0x230))),0x1;const _0x5c5ac9=_0x30ff9[_0xa3ee3a(0x2b9)](_0x123430=>({'title':_0x123430[_0xa3ee3a(0x2b8)]?.[_0xa3ee3a(0x324)]+'.'+_0x123430[_0xa3ee3a(0x324)],'value':_0x123430[_0xa3ee3a(0x2b8)]?.[_0xa3ee3a(0x324)]+'.'+_0x123430[_0xa3ee3a(0x324)],'description':_0x123430['revision']?'revision:\x20'+_0x123430[_0xa3ee3a(0x207)]:undefined})),_0x15231f=await a47_0x307e4a({'type':_0xa3ee3a(0x1f8),'name':_0xa3ee3a(0x23c),'message':_0xa3ee3a(0x289),'choices':_0x5c5ac9});if(!_0x15231f[_0xa3ee3a(0x23c)])return 0x1;_0x4fc333=_0x15231f['workflow'];}if(!_0x4fc333[_0xa3ee3a(0x214)]('.')){const _0x3234dc=this['resolveProject']([],_0x262ff4);if(_0x3234dc)_0x4fc333=_0x3234dc+'.'+_0x4fc333;else return console[_0xa3ee3a(0x1b7)](a47_0x2bf1fc[_0xa3ee3a(0x2be)]('Error:'),_0xa3ee3a(0x208)),console['error'](a47_0x2bf1fc['dim'](_0xa3ee3a(0x230))),0x1;}const _0x1590c9=_0x262ff4['param'],_0x5d507a=_0x262ff4[_0xa3ee3a(0x255)],_0x40ada1={};if(_0x1590c9&&Array[_0xa3ee3a(0x301)](_0x1590c9))for(const _0x5e64f9 of _0x1590c9){const _0x124f9c=_0x5e64f9[_0xa3ee3a(0x219)]('=');if(_0x124f9c===-0x1)return console[_0xa3ee3a(0x1b7)](_0xa3ee3a(0x273)+_0x5e64f9),console[_0xa3ee3a(0x1b7)](_0xa3ee3a(0x337)),0x1;const _0x20684c=_0x5e64f9[_0xa3ee3a(0x314)](0x0,_0x124f9c),_0x50304f=_0x5e64f9[_0xa3ee3a(0x314)](_0x124f9c+0x1);try{_0x40ada1[_0x20684c]=JSON[_0xa3ee3a(0x18e)](_0x50304f);}catch{_0x40ada1[_0x20684c]=_0x50304f;}}_0x262ff4[_0xa3ee3a(0x1bd)]&&(console['error'](_0xa3ee3a(0x1f6)+_0x4fc333),Object[_0xa3ee3a(0x20a)](_0x40ada1)['length']>0x0&&console['error'](_0xa3ee3a(0x2c6)+JSON[_0xa3ee3a(0x2d4)](_0x40ada1)),_0x5d507a&&console[_0xa3ee3a(0x1b7)](_0xa3ee3a(0x245)+_0x5d507a));const _0x302163=await withSpinner(_0xa3ee3a(0x21d),()=>_0xbd59d0[_0xa3ee3a(0x23c)]['run'](_0x4fc333,_0x40ada1,{'sessionTime':_0x5d507a}),{'verbose':_0x262ff4[_0xa3ee3a(0x1bd)]}),_0x1c7eab=_0x302163[_0xa3ee3a(0x258)];console[_0xa3ee3a(0x1b7)](_0xa3ee3a(0x22d)),console[_0xa3ee3a(0x1b7)](_0xa3ee3a(0x254)+_0x1c7eab['id']),console[_0xa3ee3a(0x1b7)](_0xa3ee3a(0x2ba)+_0x1c7eab[_0xa3ee3a(0x2d8)]),console[_0xa3ee3a(0x1b7)](_0xa3ee3a(0x206)+_0x1c7eab['project']?.[_0xa3ee3a(0x324)]),console['error'](_0xa3ee3a(0x300)+_0x1c7eab[_0xa3ee3a(0x23c)]?.['name']);if(_0x1c7eab['project']?.['id']&&_0x1c7eab[_0xa3ee3a(0x2d8)]&&_0x1c7eab['id']){const _0x5e6712=_0x262ff4[_0xa3ee3a(0x236)],_0x1973c3=getConsoleUrl(_0x5e6712,_0xa3ee3a(0x2a9)+_0x1c7eab['project']['id']+_0xa3ee3a(0x1a2)+_0x1c7eab[_0xa3ee3a(0x2d8)]+'/attempt/'+_0x1c7eab['id']);console['error']('\x20\x20Console:\x20'+a47_0x2bf1fc['cyan'](_0x1973c3));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a47_0x18ff36(0x324)]='workflow:download';[a47_0x18ff36(0x321)]=a47_0x18ff36(0x25e);async[a47_0x18ff36(0x2f8)](_0x1f66d0){const _0x3d2801=a47_0x18ff36,{options:_0x282abb,args:_0x5bc288,tdx:_0x3025c2}=_0x1f66d0,_0x5f5c85=_0x5bc288[0x0],_0x4967a8=_0x5bc288[0x1]||'.';if(!_0x5f5c85)return console[_0x3d2801(0x1b7)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x3d2801(0x190)),0x1;const _0x447c2b=_0x282abb['revision'];_0x282abb[_0x3d2801(0x1bd)]&&(console['error'](_0x3d2801(0x1c8)+_0x5f5c85),console['error'](_0x3d2801(0x298)+_0x4967a8),_0x447c2b&&console[_0x3d2801(0x1b7)](_0x3d2801(0x27b)+_0x447c2b));const _0x51b0a4=await withSpinner(_0x3d2801(0x310)+_0x5f5c85+'...',()=>_0x3025c2['workflow'][_0x3d2801(0x264)](_0x5f5c85,_0x4967a8,{'revision':_0x447c2b}),{'verbose':_0x282abb[_0x3d2801(0x1bd)]}),_0x1c871e=_0x51b0a4['data'];return console['error'](_0x3d2801(0x1e9)+_0x1c871e[_0x3d2801(0x2af)]),console[_0x3d2801(0x1b7)]('\x20\x20Revision:\x20'+_0x1c871e['revision']),console[_0x3d2801(0x1b7)](_0x3d2801(0x325)+_0x1c871e['filesExtracted']),console[_0x3d2801(0x1b7)]('\x20\x20Location:\x20'+_0x4967a8+'/'+_0x1c871e[_0x3d2801(0x2af)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x31f);[a47_0x18ff36(0x321)]=a47_0x18ff36(0x2bf);async[a47_0x18ff36(0x2f8)](_0x139790){const _0x2e2bc5=a47_0x18ff36,{options:_0x2c4f3f,args:_0x3c4cd3,tdx:_0x388d9b}=_0x139790;let _0xe17e6f='.',_0x5834fb=_0x2c4f3f[_0x2e2bc5(0x324)];if(_0x3c4cd3[0x0]){const {promises:_0x4a7319}=await import('fs');try{const _0x5eec65=await _0x4a7319[_0x2e2bc5(0x1d7)](_0x3c4cd3[0x0]);if(_0x5eec65[_0x2e2bc5(0x2e6)]())_0xe17e6f=_0x3c4cd3[0x0];else return console[_0x2e2bc5(0x1b7)](_0x2e2bc5(0x2bb)+_0x3c4cd3[0x0]+_0x2e2bc5(0x317)),0x1;}catch{_0x5834fb=_0x3c4cd3[0x0],_0xe17e6f='.';}}const _0x225bc3=_0x2c4f3f[_0x2e2bc5(0x207)],_0x50faf7=_0x2c4f3f[_0x2e2bc5(0x2e0)];_0x2c4f3f[_0x2e2bc5(0x1bd)]&&(console['error'](_0x2e2bc5(0x280)+_0xe17e6f),_0x5834fb&&console[_0x2e2bc5(0x1b7)]('Project\x20name:\x20'+_0x5834fb),_0x225bc3&&console['error'](_0x2e2bc5(0x27b)+_0x225bc3),_0x50faf7&&console[_0x2e2bc5(0x1b7)](_0x2e2bc5(0x242)));const _0x4d1d8b=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x388d9b['workflow'][_0x2e2bc5(0x1e7)](_0xe17e6f,{'projectName':_0x5834fb,'revision':_0x225bc3,'skipValidation':_0x50faf7}),{'verbose':_0x2c4f3f['verbose']}),_0x2c1616=_0x4d1d8b[_0x2e2bc5(0x258)];return console[_0x2e2bc5(0x1b7)](_0x2e2bc5(0x2c4)+_0x2c1616[_0x2e2bc5(0x2af)]),console[_0x2e2bc5(0x1b7)]('\x20\x20Project\x20ID:\x20'+_0x2c1616['projectId']),console[_0x2e2bc5(0x1b7)](_0x2e2bc5(0x2b3)+_0x2c1616[_0x2e2bc5(0x207)]),await this[_0x2e2bc5(0x2d5)](_0x388d9b,_0x2c1616['projectName'],_0x2c4f3f[_0x2e2bc5(0x236)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x1be);['description']=a47_0x18ff36(0x330);async[a47_0x18ff36(0x2f8)](_0x5b5c6f){const _0x3f8db7=a47_0x18ff36,{options:_0x4ecfc4,args:_0x1d7317,tdx:_0x265fe3}=_0x5b5c6f,_0x4e1361=_0x1d7317[0x0],_0x317ebd=_0x1d7317[0x1];if(!_0x4e1361)return console[_0x3f8db7(0x1b7)](a47_0x2bf1fc[_0x3f8db7(0x2be)](_0x3f8db7(0x2f1)),_0x3f8db7(0x2cc)),console['error'](a47_0x2bf1fc[_0x3f8db7(0x22a)](_0x3f8db7(0x2c1))),0x1;const _0x2139e3=_0x4ecfc4[_0x3f8db7(0x207)];_0x4ecfc4[_0x3f8db7(0x1bd)]&&(console[_0x3f8db7(0x1b7)](_0x3f8db7(0x1c8)+_0x4e1361),_0x317ebd&&console[_0x3f8db7(0x1b7)]('Target\x20directory:\x20'+_0x317ebd),_0x2139e3&&console[_0x3f8db7(0x1b7)](_0x3f8db7(0x27b)+_0x2139e3),_0x4ecfc4[_0x3f8db7(0x2fe)]&&console[_0x3f8db7(0x1b7)](_0x3f8db7(0x2e4)));const _0x444af1=await withSpinner('Pulling\x20project\x20'+_0x4e1361+'...',()=>_0x265fe3[_0x3f8db7(0x23c)][_0x3f8db7(0x2d9)](_0x4e1361,{'targetDir':_0x317ebd,'revision':_0x2139e3}),{'verbose':_0x4ecfc4['verbose']}),_0x290e92=_0x444af1[_0x3f8db7(0x258)];_0x290e92['isNewProject']?console[_0x3f8db7(0x1b7)](_0x3f8db7(0x2e1)+_0x290e92[_0x3f8db7(0x2af)]):console['error'](_0x3f8db7(0x1c9)+_0x290e92[_0x3f8db7(0x2af)]);console['error'](_0x3f8db7(0x2b3)+_0x290e92[_0x3f8db7(0x207)]),console['error'](_0x3f8db7(0x1a9)+(a47_0x39bbb8['relative'](process[_0x3f8db7(0x194)](),_0x290e92[_0x3f8db7(0x336)])||'.')),console[_0x3f8db7(0x1b7)](_0x3f8db7(0x1c3)+a47_0x2bf1fc[_0x3f8db7(0x1cb)]('+'+_0x290e92['summary']['new']+'\x20new')+',\x20'+(a47_0x2bf1fc['yellow']('~'+_0x290e92[_0x3f8db7(0x246)]['modified']+_0x3f8db7(0x204))+',\x20')+(a47_0x2bf1fc[_0x3f8db7(0x2be)]('-'+_0x290e92[_0x3f8db7(0x246)][_0x3f8db7(0x2cb)]+_0x3f8db7(0x31d))+',\x20')+(''+a47_0x2bf1fc[_0x3f8db7(0x22a)](_0x290e92[_0x3f8db7(0x246)][_0x3f8db7(0x309)]+'\x20unchanged')));for(const _0x2c6631 of _0x290e92['changes']){_0x2c6631['type']===_0x3f8db7(0x243)&&_0x2c6631['diff']&&(console[_0x3f8db7(0x1b7)]('\x0a'+a47_0x2bf1fc['cyan'](_0x3f8db7(0x23e)+_0x2c6631[_0x3f8db7(0x1aa)])),console[_0x3f8db7(0x1b7)](_0x2c6631[_0x3f8db7(0x30b)]));}if(!_0x290e92[_0x3f8db7(0x2e5)])return saveSessionContext({'workflow_project':_0x290e92[_0x3f8db7(0x2af)]},_0x4ecfc4[_0x3f8db7(0x334)]),console[_0x3f8db7(0x1b7)](a47_0x2bf1fc[_0x3f8db7(0x1cb)](_0x3f8db7(0x256))),console[_0x3f8db7(0x1b7)](a47_0x2bf1fc[_0x3f8db7(0x22a)](_0x3f8db7(0x209)+_0x290e92[_0x3f8db7(0x2af)])),0x0;if(_0x4ecfc4[_0x3f8db7(0x2fe)])return console[_0x3f8db7(0x1b7)](a47_0x2bf1fc[_0x3f8db7(0x29b)](_0x3f8db7(0x25a))),0x0;if(!_0x4ecfc4['yes']){if(!isInteractive())return console[_0x3f8db7(0x1b7)](a47_0x2bf1fc[_0x3f8db7(0x2be)](_0x3f8db7(0x1db)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3f8db7(0x1b7)](a47_0x2bf1fc[_0x3f8db7(0x22a)](_0x3f8db7(0x2c5))),0x1;const _0x4a755a=await confirmKey(_0x3f8db7(0x2cd));if(!_0x4a755a)return console[_0x3f8db7(0x1b7)](a47_0x2bf1fc[_0x3f8db7(0x29b)]('Cancelled'),_0x3f8db7(0x205)),0x1;}await withSpinner(_0x3f8db7(0x2ee),()=>_0x265fe3[_0x3f8db7(0x23c)][_0x3f8db7(0x1cc)](_0x290e92,{'revision':_0x2139e3}),{'verbose':_0x4ecfc4[_0x3f8db7(0x1bd)]}),saveSessionContext({'workflow_project':_0x290e92[_0x3f8db7(0x2af)]},_0x4ecfc4[_0x3f8db7(0x334)]),console[_0x3f8db7(0x1b7)](a47_0x2bf1fc[_0x3f8db7(0x1cb)](_0x3f8db7(0x2df)));const _0x7f5b02=a47_0x39bbb8[_0x3f8db7(0x234)](process['cwd'](),_0x290e92[_0x3f8db7(0x336)])||'.';return console['error'](a47_0x2bf1fc['dim'](_0x3f8db7(0x249)+_0x7f5b02)),console[_0x3f8db7(0x1b7)](a47_0x2bf1fc[_0x3f8db7(0x22a)](_0x3f8db7(0x209)+_0x290e92[_0x3f8db7(0x2af)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a47_0x18ff36(0x1d5);[a47_0x18ff36(0x321)]=a47_0x18ff36(0x1bb);async[a47_0x18ff36(0x2f8)](_0x4b781d){const _0x3b165a=a47_0x18ff36,{options:_0xf3c339,args:_0x5bff7f,tdx:_0x14b294}=_0x4b781d,_0x2ff822=this[_0x3b165a(0x232)](_0x5bff7f,_0xf3c339),_0x4f2fcd=_0xf3c339[_0x3b165a(0x207)],_0x4e89c6=_0xf3c339[_0x3b165a(0x2e0)];_0xf3c339[_0x3b165a(0x1bd)]&&(_0x2ff822&&console['error']('Source\x20directory:\x20'+_0x2ff822),_0x4f2fcd&&console['error'](_0x3b165a(0x27b)+_0x4f2fcd),_0xf3c339[_0x3b165a(0x2fe)]&&console[_0x3b165a(0x1b7)](_0x3b165a(0x2e4)),_0x4e89c6&&console[_0x3b165a(0x1b7)]('Validation:\x20skipped'));let _0x57e419;try{_0x57e419=await withSpinner(_0x3b165a(0x268),()=>_0x14b294['workflow'][_0x3b165a(0x251)]({'sourceDir':_0x2ff822,'revision':_0x4f2fcd,'skipValidation':_0x4e89c6}),{'verbose':_0xf3c339[_0x3b165a(0x1bd)]});}catch(_0x5d67ae){if(_0x5d67ae instanceof Error&&_0x5d67ae[_0x3b165a(0x21e)][_0x3b165a(0x214)]('No\x20workflow\x20tdx.json\x20found'))return console[_0x3b165a(0x1b7)](a47_0x2bf1fc[_0x3b165a(0x2be)]('Error:'),_0x3b165a(0x228)),_0xf3c339['workflowProject']?console['error'](a47_0x2bf1fc['dim'](_0x3b165a(0x31a)+_0xf3c339[_0x3b165a(0x18b)]+_0x3b165a(0x189)+_0xf3c339[_0x3b165a(0x18b)]+'\x27')):console[_0x3b165a(0x1b7)](a47_0x2bf1fc['dim']('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x5d67ae;}const _0x1dea32=_0x57e419[_0x3b165a(0x258)];console[_0x3b165a(0x1b7)](_0x3b165a(0x250)+_0x1dea32['projectName']),console['error']('\x20\x20Source:\x20'+_0x1dea32[_0x3b165a(0x22b)]),console[_0x3b165a(0x1b7)]('\x20\x20Revision:\x20'+_0x1dea32['revision']),console[_0x3b165a(0x1b7)]('\x20\x20Changes:\x20'+a47_0x2bf1fc['green']('+'+_0x1dea32['summary']['new']+_0x3b165a(0x23f))+',\x20'+(a47_0x2bf1fc[_0x3b165a(0x29b)]('~'+_0x1dea32[_0x3b165a(0x246)][_0x3b165a(0x243)]+_0x3b165a(0x204))+',\x20')+(a47_0x2bf1fc[_0x3b165a(0x2be)]('-'+_0x1dea32[_0x3b165a(0x246)]['deleted']+_0x3b165a(0x31d))+',\x20')+(''+a47_0x2bf1fc[_0x3b165a(0x22a)](_0x1dea32[_0x3b165a(0x246)][_0x3b165a(0x309)]+'\x20unchanged')));for(const _0x40d7c7 of _0x1dea32[_0x3b165a(0x326)]){_0x40d7c7[_0x3b165a(0x27d)]===_0x3b165a(0x243)&&_0x40d7c7['diff']&&(console[_0x3b165a(0x1b7)]('\x0a'+a47_0x2bf1fc['cyan'](_0x3b165a(0x23e)+_0x40d7c7['path'])),console[_0x3b165a(0x1b7)](_0x40d7c7[_0x3b165a(0x30b)]));}if(!_0x1dea32[_0x3b165a(0x2e5)])return console[_0x3b165a(0x1b7)](a47_0x2bf1fc[_0x3b165a(0x1cb)](_0x3b165a(0x191))),await this[_0x3b165a(0x2d5)](_0x14b294,_0x1dea32[_0x3b165a(0x2af)],_0xf3c339[_0x3b165a(0x236)]),0x0;if(_0xf3c339[_0x3b165a(0x2fe)])return console[_0x3b165a(0x1b7)](a47_0x2bf1fc[_0x3b165a(0x29b)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0xf3c339['yes']){if(!isInteractive())return console[_0x3b165a(0x1b7)](a47_0x2bf1fc[_0x3b165a(0x2be)]('\x0aError:'),_0x3b165a(0x19f)),console['error'](a47_0x2bf1fc[_0x3b165a(0x22a)](_0x3b165a(0x2c5))),0x1;const _0x49db41=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x49db41)return console[_0x3b165a(0x1b7)](a47_0x2bf1fc[_0x3b165a(0x29b)](_0x3b165a(0x1a4)),_0x3b165a(0x2b0)),0x1;}const _0x96e0f1=await withSpinner(_0x3b165a(0x2eb),()=>_0x14b294[_0x3b165a(0x23c)][_0x3b165a(0x2f6)](_0x1dea32),{'verbose':_0xf3c339[_0x3b165a(0x1bd)]}),_0x1edbbc=_0x96e0f1[_0x3b165a(0x258)];return console['error'](a47_0x2bf1fc[_0x3b165a(0x1cb)](_0x3b165a(0x22c))),console[_0x3b165a(0x1b7)]('\x20\x20Project\x20ID:\x20'+_0x1edbbc['projectId']),console[_0x3b165a(0x1b7)](_0x3b165a(0x2b3)+_0x1edbbc[_0x3b165a(0x207)]),await this[_0x3b165a(0x2d5)](_0x14b294,_0x1edbbc['projectName'],_0xf3c339['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']='workflow:clone';['description']=a47_0x18ff36(0x278);async[a47_0x18ff36(0x2f8)](_0x57970b){const _0x149d0c=a47_0x18ff36,{options:_0x120837,args:_0x1ede6e,tdx:_0x4dfd6d}=_0x57970b,_0x561bce=this[_0x149d0c(0x232)](_0x1ede6e,_0x120837),_0x2efdbc=_0x120837['name'],_0x54976b=_0x120837[_0x149d0c(0x207)],_0x70ec99=_0x120837['skipValidation'];if(!_0x561bce)return console[_0x149d0c(0x1b7)](a47_0x2bf1fc[_0x149d0c(0x2be)]('Error:'),_0x149d0c(0x1b3)),console[_0x149d0c(0x1b7)](a47_0x2bf1fc['dim'](_0x149d0c(0x211))),console['error'](a47_0x2bf1fc[_0x149d0c(0x22a)](_0x149d0c(0x1eb))),0x1;if(!_0x2efdbc)return console[_0x149d0c(0x1b7)](a47_0x2bf1fc['red']('Error:'),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x149d0c(0x1b7)](a47_0x2bf1fc['dim'](_0x149d0c(0x211))),0x1;_0x120837[_0x149d0c(0x1bd)]&&(console['error'](_0x149d0c(0x19b)+_0x561bce),console['error'](_0x149d0c(0x2e8)+_0x2efdbc),_0x54976b&&console['error'](_0x149d0c(0x27b)+_0x54976b),_0x120837[_0x149d0c(0x2fe)]&&console[_0x149d0c(0x1b7)](_0x149d0c(0x2e4)),_0x70ec99&&console[_0x149d0c(0x1b7)](_0x149d0c(0x242)));const _0x3dede2=await withSpinner(_0x149d0c(0x19a),()=>_0x4dfd6d['workflow'][_0x149d0c(0x25d)](_0x561bce,_0x2efdbc,{'revision':_0x54976b,'skipValidation':_0x70ec99}),{'verbose':_0x120837[_0x149d0c(0x1bd)]}),_0x36dbe7=_0x3dede2[_0x149d0c(0x258)];console[_0x149d0c(0x1b7)](_0x149d0c(0x2b1)+_0x36dbe7[_0x149d0c(0x22b)]);_0x36dbe7[_0x149d0c(0x26e)]&&console['error'](_0x149d0c(0x1ab)+_0x36dbe7[_0x149d0c(0x26e)]);console[_0x149d0c(0x1b7)](_0x149d0c(0x2e8)+_0x36dbe7[_0x149d0c(0x26c)]),console[_0x149d0c(0x1b7)]('Revision:\x20'+_0x36dbe7[_0x149d0c(0x207)]),console['error'](_0x149d0c(0x2a2)+_0x36dbe7[_0x149d0c(0x24c)]);_0x36dbe7[_0x149d0c(0x2a7)]&&(console[_0x149d0c(0x1b7)](a47_0x2bf1fc[_0x149d0c(0x29b)]('\x0a⚠\x20Project\x20\x22'+_0x36dbe7[_0x149d0c(0x26c)]+_0x149d0c(0x296)+_0x36dbe7['existingProjectId']+')')),console[_0x149d0c(0x1b7)](a47_0x2bf1fc['yellow'](_0x149d0c(0x2bc))));if(_0x120837[_0x149d0c(0x2fe)])return console[_0x149d0c(0x1b7)](a47_0x2bf1fc['yellow'](_0x149d0c(0x2c9))),0x0;if(!_0x120837[_0x149d0c(0x316)]){if(!isInteractive())return console[_0x149d0c(0x1b7)](a47_0x2bf1fc['red'](_0x149d0c(0x1db)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x149d0c(0x1b7)](a47_0x2bf1fc[_0x149d0c(0x22a)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x19c5f9=_0x36dbe7['sourceProjectName']||a47_0x39bbb8['basename'](_0x561bce),_0x29324a=_0x36dbe7[_0x149d0c(0x2a7)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x2efdbc+_0x149d0c(0x1d0):_0x149d0c(0x288)+_0x19c5f9+_0x149d0c(0x2ca)+_0x2efdbc+'\x22?',_0x5a104c=await confirmKey(_0x29324a);if(!_0x5a104c)return console['error'](a47_0x2bf1fc[_0x149d0c(0x29b)](_0x149d0c(0x1a4))),0x1;}const _0x1b0c25=await withSpinner(_0x36dbe7['targetExists']?_0x149d0c(0x1bf)+_0x2efdbc+_0x149d0c(0x2ce):_0x149d0c(0x1ec)+_0x2efdbc+'...',()=>_0x4dfd6d[_0x149d0c(0x23c)]['executeCloneProject'](_0x36dbe7),{'verbose':_0x120837[_0x149d0c(0x1bd)]}),_0x54c1ef=_0x1b0c25[_0x149d0c(0x258)];return console[_0x149d0c(0x1b7)](a47_0x2bf1fc[_0x149d0c(0x1cb)](_0x36dbe7[_0x149d0c(0x2a7)]?'✔\x20Project\x20updated':'✔\x20Clone\x20complete')),console[_0x149d0c(0x1b7)](_0x149d0c(0x206)+_0x54c1ef[_0x149d0c(0x26c)]),console['error'](_0x149d0c(0x19d)+_0x54c1ef[_0x149d0c(0x2d3)]),console['error']('\x20\x20Revision:\x20'+_0x54c1ef[_0x149d0c(0x207)]),await this[_0x149d0c(0x2d5)](_0x4dfd6d,_0x54c1ef['newProjectName'],_0x120837[_0x149d0c(0x236)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a47_0x18ff36(0x21a);[a47_0x18ff36(0x321)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a47_0x18ff36(0x2f8)](_0x2ceeb1){const _0x50c7fb=a47_0x18ff36,{options:_0x5217cc,args:_0x5007ce,tdx:_0x311989}=_0x2ceeb1,_0x343d66=_0x5007ce[0x0];if(!_0x343d66)return console['error'](_0x50c7fb(0x1d8)),console['error'](_0x50c7fb(0x284)),0x1;_0x5217cc[_0x50c7fb(0x1bd)]&&console[_0x50c7fb(0x1b7)]('Project:\x20'+_0x343d66);if(!_0x5217cc['yes']){if(!isInteractive())return console[_0x50c7fb(0x1b7)](a47_0x2bf1fc['red'](_0x50c7fb(0x1db)),_0x50c7fb(0x19f)),console[_0x50c7fb(0x1b7)](a47_0x2bf1fc[_0x50c7fb(0x22a)](_0x50c7fb(0x2c5))),0x1;const _0x2267a0=await confirmKey(_0x50c7fb(0x2cf)+_0x343d66+_0x50c7fb(0x2f2));if(!_0x2267a0)return console[_0x50c7fb(0x1b7)](a47_0x2bf1fc[_0x50c7fb(0x29b)](_0x50c7fb(0x1a4))),0x1;}const _0x2d4550=await withSpinner(_0x50c7fb(0x1af)+_0x343d66+_0x50c7fb(0x2ce),()=>_0x311989[_0x50c7fb(0x23c)][_0x50c7fb(0x25b)](_0x343d66),{'verbose':_0x5217cc[_0x50c7fb(0x1bd)]}),_0x259c68=_0x2d4550[_0x50c7fb(0x258)];return console['error'](_0x50c7fb(0x32e)+_0x259c68[_0x50c7fb(0x2af)]),console[_0x50c7fb(0x1b7)](_0x50c7fb(0x19d)+_0x259c68[_0x50c7fb(0x244)]),0x0;}}export function parseKeyValue(_0x53cfee){const _0x4908c0=a47_0x18ff36,_0x1dbde5=_0x53cfee[_0x4908c0(0x219)]('=');if(_0x1dbde5===-0x1)throw new Error(_0x4908c0(0x1f3)+_0x53cfee+_0x4908c0(0x328));const _0x1bfed3=_0x53cfee[_0x4908c0(0x314)](0x0,_0x1dbde5),_0x151b5c=_0x53cfee['substring'](_0x1dbde5+0x1);if(!_0x1bfed3)throw new Error(_0x4908c0(0x1ac));return{'key':_0x1bfed3,'value':_0x151b5c};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x220);[a47_0x18ff36(0x321)]=a47_0x18ff36(0x2f4);async[a47_0x18ff36(0x2f8)](_0x3adf8c){const _0x5952c4=a47_0x18ff36,{options:_0x275777,args:_0x2b7cb1,tdx:_0x567498}=_0x3adf8c,_0x5da783=this['requireProject'](_0x2b7cb1,_0x275777);if(!_0x5da783)return 0x1;_0x275777[_0x5952c4(0x1bd)]&&console[_0x5952c4(0x1b7)](_0x5952c4(0x1c8)+_0x5da783);const _0x5bbe6e=await withSpinner('Listing\x20secrets...',()=>_0x567498[_0x5952c4(0x23c)][_0x5952c4(0x193)](_0x5da783),{'verbose':_0x275777['verbose']}),{secrets:_0xe805b}=_0x5bbe6e['data'];return console[_0x5952c4(0x1b7)](_0x5952c4(0x261)+_0xe805b[_0x5952c4(0x1b9)]+_0x5952c4(0x2e2)+(_0xe805b['length']!==0x1?'s':'')),await handleSDKOutput(_0xe805b,_0x275777),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x1f2);['description']=a47_0x18ff36(0x269);async[a47_0x18ff36(0x2f8)](_0x93afcb){const _0x3d0e37=a47_0x18ff36,{options:_0x407dde,args:_0x421213,tdx:_0x4b403c}=_0x93afcb;let _0x12460b,_0x53f602;if(_0x421213[_0x3d0e37(0x1b9)]>=0x2)_0x12460b=_0x421213[0x0],_0x53f602=_0x421213[0x1];else{if(_0x421213[_0x3d0e37(0x1b9)]===0x1&&_0x407dde['workflowProject'])_0x12460b=_0x407dde[_0x3d0e37(0x18b)],_0x53f602=_0x421213[0x0];else return _0x421213[_0x3d0e37(0x1b9)]===0x1?(console['error'](_0x3d0e37(0x192)),console[_0x3d0e37(0x1b7)](_0x3d0e37(0x230)),0x1):(console[_0x3d0e37(0x1b7)](_0x3d0e37(0x1ce)),console[_0x3d0e37(0x1b7)](_0x3d0e37(0x210)),0x1);}let _0x1c690d,_0x3fba0e;try{({key:_0x1c690d,value:_0x3fba0e}=parseKeyValue(_0x53f602));}catch(_0x4f787d){return _0x4f787d instanceof Error&&console['error'](a47_0x2bf1fc[_0x3d0e37(0x2be)](_0x3d0e37(0x2f1)),_0x4f787d[_0x3d0e37(0x21e)]),0x1;}_0x407dde[_0x3d0e37(0x1bd)]&&(console[_0x3d0e37(0x1b7)](_0x3d0e37(0x1c8)+_0x12460b),console['error'](_0x3d0e37(0x1ae)+_0x1c690d));const _0x4be714=await withSpinner('Setting\x20secret...',()=>_0x4b403c[_0x3d0e37(0x23c)][_0x3d0e37(0x1ed)](_0x12460b,_0x1c690d,_0x3fba0e),{'verbose':_0x407dde['verbose']}),_0x515ac9=_0x4be714[_0x3d0e37(0x258)];return console[_0x3d0e37(0x1b7)](_0x3d0e37(0x1b0)+_0x515ac9['key']+_0x3d0e37(0x1ef)+_0x515ac9[_0x3d0e37(0x2af)]+'\x27'),(_0x407dde[_0x3d0e37(0x222)]||_0x407dde[_0x3d0e37(0x27e)])&&await handleSingleObjectOutput(_0x515ac9,_0x407dde),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']='workflow:secrets:delete';['description']=a47_0x18ff36(0x212);async['execute'](_0x436642){const _0x4f3aa7=a47_0x18ff36,{options:_0x574014,args:_0x3d80d8,tdx:_0x496e1d}=_0x436642;let _0x2490d9,_0x55edd7;if(_0x3d80d8['length']>=0x2)_0x2490d9=_0x3d80d8[0x0],_0x55edd7=_0x3d80d8[0x1];else{if(_0x3d80d8['length']===0x1&&_0x574014[_0x4f3aa7(0x18b)])_0x2490d9=_0x574014['workflowProject'],_0x55edd7=_0x3d80d8[0x0];else return _0x3d80d8['length']===0x1?(console[_0x4f3aa7(0x1b7)](_0x4f3aa7(0x192)),console['error'](_0x4f3aa7(0x230)),0x1):(console[_0x4f3aa7(0x1b7)](_0x4f3aa7(0x270)),console[_0x4f3aa7(0x1b7)](_0x4f3aa7(0x20e)),0x1);}_0x574014['verbose']&&(console[_0x4f3aa7(0x1b7)]('Project:\x20'+_0x2490d9),console[_0x4f3aa7(0x1b7)](_0x4f3aa7(0x1ae)+_0x55edd7));if(!_0x574014[_0x4f3aa7(0x316)]){if(!isInteractive())return console[_0x4f3aa7(0x1b7)](a47_0x2bf1fc['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4f3aa7(0x1b7)](a47_0x2bf1fc[_0x4f3aa7(0x22a)](_0x4f3aa7(0x2c5))),0x1;const _0x522ea3=await confirmKey(_0x4f3aa7(0x1c1)+_0x55edd7+_0x4f3aa7(0x23b)+_0x2490d9+'\x27?');if(!_0x522ea3)return console['error'](a47_0x2bf1fc[_0x4f3aa7(0x29b)](_0x4f3aa7(0x1a4))),0x1;}const _0x270ffd=await withSpinner('Deleting\x20secret...',()=>_0x496e1d['workflow']['deleteSecret'](_0x2490d9,_0x55edd7),{'verbose':_0x574014['verbose']}),_0x298197=_0x270ffd[_0x4f3aa7(0x258)];return console['error']('✔\x20Secret\x20\x27'+_0x298197[_0x4f3aa7(0x20c)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x298197[_0x4f3aa7(0x2af)]+'\x27'),(_0x574014[_0x4f3aa7(0x222)]||_0x574014['jsonl'])&&await handleSingleObjectOutput(_0x298197,_0x574014),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 a47_0x146a(){const _0x261830=['changes','Show\x20logs\x20for\x20a\x20workflow\x20attempt','.\x20Expected\x20format:\x20KEY=VALUE','projects','MIN_TIMELINE_WIDTH','sort','Reason:\x20','Getting\x20attempt\x20tasks...','✔\x20Deleted\x20project\x20','done','Pull\x20workflow\x20project\x20to\x20local\x20folder','No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x20logs','workflowName','session','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','targetDir','Expected\x20format:\x20--param\x20key=value','No\x20attempts\x20found','getHours','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','2612322NsXDDz','workflowProject','includeRetried','startTime','parse','fromTask','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x0a✔\x20No\x20changes\x20to\x20push','Error:\x20Project\x20name\x20is\x20required','listSecrets','cwd','startedAt','ICON_WIDTH','find','POLL_INTERVAL_MS','(use\x20--limit\x20to\x20see\x20more)','Analyzing\x20project...','Source\x20directory:\x20','output','\x20\x20Project\x20ID:\x20','size','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','set','value','/sessions/','Session\x20not\x20found:\x20','Cancelled','match','Downloading\x20logs...','workflow:tasks','11754220msYJZw','\x20\x20Target:\x20','path','Source\x20project:\x20','Key\x20cannot\x20be\x20empty','planned','Key:\x20','Deleting\x20project\x20','✔\x20Secret\x20\x27','Failed\x20to\x20fetch\x20attempt\x20data','metadata','Source\x20directory\x20is\x20required','🔄\x20','split','attemptId','error','Pattern:\x20','length','state','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','LABEL_WIDTH_DIVISOR','verbose','workflow:pull','Updating\x20','MAX_TASKS_DISPLAY','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','taskName','\x20\x20Changes:\x20','List\x20all\x20workflow\x20projects','total','LABEL_MIN_SPACING','Retrying\x20session...','Project:\x20','→\x20Project:\x20','values','green','applyPullProject','workflow:use','Error:\x20KEY=VALUE\x20is\x20required','\x20(system)','\x22\x20with\x20new\x20revision?','workflow:run','Filter:\x20','retrySession','end','workflow:push','utf-8','stat','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Resolving\x20project\x20\x27','attempt','\x0aError:','No\x20attempts\x20found\x20for:\x20','32cawFCG','list','\x20(use\x20--limit\x20to\x20show\x20more)','durationMs','No\x20matching\x20sessions\x20found','logFiles','MAX_LABEL_COUNT','Status:\x20','round','\x20sessions\x20','push','min','✔\x20Downloaded\x20','attempt:','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','Cloning\x20to\x20','setSecret','\x20from\x20session\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','No\x20sessions\x20found','List\x20workflow\x20attempts','workflow:secrets:set','Invalid\x20format:\x20','No\x20sessions\x20found\x20in\x20project:\x20','renderTimeline','Workflow:\x20','max','select','log','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','workflow:attempt','msPerChar','cancelRequested','📋\x20','fileSize','TASK_NAME_WIDTH','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','No\x20projects\x20match\x20pattern:\x20','retryAttempt','\x20modified','-\x20no\x20files\x20written','\x20\x20Project:\x20','revision','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','\x20\x20Session\x20context\x20set\x20to:\x20','keys','icon','key','follow','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','session:','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','4030CLnotv','includes','\x20has\x20no\x20attempts','splice','Show\x20specific\x20attempt\x20details','Select\x20a\x20task\x20to\x20view\x20logs:','indexOf','workflow:delete','rows','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Starting\x20workflow\x20run...','message','Loading\x20sessions...','workflow:secrets:list','white','json','buildTimelineData','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','index','\x0aPolling...\x20(','\x20tasks','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','workflow:logs','dim','sourceDir','✔\x20Push\x20complete','✔\x20Workflow\x20run\x20started','getTime','Getting\x20attempt\x20details...','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','task','resolveProjectDir','displayLine','relative','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','site','lastAttempt','resolve','860022ffNGIg','No\x20sessions\x20found\x20for:\x20','\x27\x20from\x20project\x20\x27','workflow','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','---\x20','\x20new','localeCompare','Including\x20subtasks:\x20yes','Validation:\x20skipped','modified','projectId','Session\x20time:\x20','summary','get','\x20session','\x20\x20Location:\x20','slice','\x0aFailed\x20to\x20fetch\x20attempt\x20data','fileCount','\x20workflow','Filter:\x20project=','success','✔\x20Project:\x20','preparePushProject','Latest\x20session\x20has\x20no\x20attempt','unknown','\x20\x20Attempt\x20ID:\x20','sessionTime','\x0a✔\x20Already\x20up\x20to\x20date','Listing\x20workflows...','data','Listing\x20workflow\x20attempts...','\x0aDry\x20run\x20-\x20no\x20files\x20written','delete','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','prepareCloneProject','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Loading\x20session...','\x20\x20tdx\x20wf\x20use\x20<project>','✔\x20Found\x20','workflow:kill','\x20of\x20','download','startsWith','getMonth','✔\x20Workflow\x20project\x20context\x20cleared.','Analyzing\x20changes...','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Attempt:\x20','From\x20task:\x20','newProjectName','Retry\x20a\x20session\x20or\x20attempt','sourceProjectName','generateSessionTimelineRows','Error:\x20Secret\x20key\x20is\x20required','Error:\x20Attempt\x20ID\x20is\x20required','Include\x20retried:\x20yes','Error:\x20Invalid\x20parameter\x20format:\x20','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','write','List\x20workflows','renderSessionsTimeline','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','title','No\x20workflows\x20found\x20in\x20project:\x20','Revision:\x20','✔\x20Showing\x20','type','jsonl','Error:\x20Invalid\x20JSON\x20in\x20--params','Project\x20directory:\x20','Attempt\x20ID:\x20','createdAt','sys','Usage:\x20workflow:delete\x20<project-name-or-id>','445599OPPqoT','workflow:sessions','\x20-\x20','\x0aClone\x20\x22','Select\x20a\x20workflow\x20to\x20run','trim','group_error','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','logs','tasks','start','\x1b[1A\x1b[2K','💡\x20Tip:\x20Use\x20','⚠\x20Showing\x20first\x20','No\x20sessions\x20with\x20timing\x20information','workflow:retry','fullName','\x22\x20already\x20exists\x20(ID:\x20','every','Output\x20directory:\x20','cyan','resolveProjectId','yellow','now','isTTY','\x20attempt','getFullYear','padStart','Using\x20attempt\x20','Files\x20to\x20upload:\x20','floor','pending','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','blue','targetExists','resolveProject','/app/workflows/','pollTimeline','Select\x20a\x20session\x20to\x20view\x20timeline:','Fetching\x20log\x20files...','filter','toLowerCase','projectName','-\x20nothing\x20pushed','Source:\x20','\x27...','\x20\x20Revision:\x20','workflow:timeline','fill','workflows','navigateSessionsInteractive','project','map','\x20\x20Session\x20ID:\x20','Error:\x20','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','red','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','force','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','window','sessions','✔\x20Pushed\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Parameters:\x20','join','requireProject','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x22\x20to\x20new\x20project\x20\x22','deleted','Project\x20name\x20is\x20required','\x0aApply\x20these\x20changes?','...','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','readFile','✔\x20Workflow\x20project\x20set\x20to:\x20','getDate','newProjectId','stringify','showWorkflowConsoleUrl','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','table','sessionId','pullProject','running','Retrying\x20attempt...','\x20project',',\x20Workflow:\x20','4098VoFXeJ','✔\x20Pull\x20complete','skipValidation','→\x20New\x20project:\x20','\x20secret','toISOString','Dry\x20run:\x20yes','hasChanges','isDirectory','1102717mPeptI','New\x20project\x20name:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','clear','Pushing\x20project...','537484pvtpkR','List\x20workflow\x20execution\x20sessions','Writing\x20files...','stdout','finishedAt','Error:','\x22?\x20This\x20cannot\x20be\x20undone.','MAX_TIMELINE_WIDTH','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Target:\x20','executePushProject','Kill\x20a\x20running\x20attempt','execute','format','✔\x20Retry\x20started','Listing\x20workflow\x20projects...','renderSingleTimeline','No\x20workflow\x20sessions\x20found','dryRun','Start\x20a\x20workflow\x20run','\x20\x20Workflow:\x20','isArray','params','status','context','from','updatedAt','repeat','canceling','unchanged','duration','diff','Listing\x20workflow\x20sessions...','retryAttemptName','limit','No\x20workflow\x20projects\x20found','Downloading\x20project\x20','24jMRgBV','includeSubtasks','parseProjectWorkflowPattern','substring','No\x20workflows\x20found','yes','\x20is\x20not\x20a\x20directory','some','No\x20attempts\x20found\x20in\x20project:\x20','Tip:\x20cd\x20to\x20workflows/','\x20\x20Console:\x20','ICON_SPACING','\x20deleted','MIN_LABEL_COUNT','workflow:upload','tdx.json','description','Total:\x20','trimEnd','name','\x20\x20Files\x20extracted:\x20'];a47_0x146a=function(){return _0x261830;};return a47_0x146a();}function formatElapsed(_0x2c5822){const _0x54eec8=a47_0x18ff36,_0x26db35=Math[_0x54eec8(0x2a3)](_0x2c5822/0x3e8),_0x25c613=Math[_0x54eec8(0x2a3)](_0x26db35/0x3c),_0x28c086=Math[_0x54eec8(0x2a3)](_0x25c613/0x3c),_0x473d18=Math['floor'](_0x28c086/0x18);if(_0x473d18>0x0){const _0x19baad=_0x28c086%0x18;return _0x19baad>0x0?_0x473d18+'d\x20'+_0x19baad+'h':_0x473d18+'d';}else{if(_0x28c086>0x0){const _0x13ccbb=_0x25c613%0x3c;return _0x13ccbb>0x0?_0x28c086+'h\x20'+_0x13ccbb+'m':_0x28c086+'h';}else{if(_0x25c613>0x0){const _0x1616d3=_0x26db35%0x3c;return _0x1616d3>0x0?_0x25c613+'m\x20'+_0x1616d3+'s':_0x25c613+'m';}else return _0x26db35+'s';}}}function formatTimestamp(_0x39419e,_0x1bfb1d){const _0x6d5ecc=a47_0x18ff36,_0x29824e=new Date(_0x39419e),_0x56a488=String(_0x29824e[_0x6d5ecc(0x188)]())[_0x6d5ecc(0x2a0)](0x2,'0'),_0x48d819=String(_0x29824e['getMinutes']())['padStart'](0x2,'0'),_0x4cb45a=_0x56a488+':'+_0x48d819,_0x45927d=_0x29824e['getFullYear']()===_0x1bfb1d[_0x6d5ecc(0x29f)]()&&_0x29824e[_0x6d5ecc(0x266)]()===_0x1bfb1d[_0x6d5ecc(0x266)]()&&_0x29824e[_0x6d5ecc(0x2d2)]()===_0x1bfb1d['getDate']();if(_0x45927d)return _0x4cb45a;else{const _0x1b92e1=String(_0x29824e[_0x6d5ecc(0x266)]()+0x1)[_0x6d5ecc(0x2a0)](0x2,'0'),_0x283e0a=String(_0x29824e['getDate']())['padStart'](0x2,'0');return _0x1b92e1+'-'+_0x283e0a+'\x20'+_0x4cb45a;}}function formatDate(_0x2fc6d5){const _0x34ef7b=a47_0x18ff36,_0x2e9e5c=_0x2fc6d5[_0x34ef7b(0x29f)](),_0x599071=String(_0x2fc6d5[_0x34ef7b(0x266)]()+0x1)[_0x34ef7b(0x2a0)](0x2,'0'),_0x56702c=String(_0x2fc6d5[_0x34ef7b(0x2d2)]())[_0x34ef7b(0x2a0)](0x2,'0');return _0x2e9e5c+'-'+_0x599071+'-'+_0x56702c;}function getTaskStateIcon(_0x5b6ace){const _0x1090b8={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x1090b8[_0x5b6ace]||'⚪';}function getBarChar(_0x2f23a3){const _0x47f6a1=a47_0x18ff36;return _0x2f23a3===_0x47f6a1(0x1b7)||_0x2f23a3==='group_error'?'×':'─';}function getBarColor(_0xdc8fd5){const _0x5243ae=a47_0x18ff36,_0x533160={'success':a47_0x2bf1fc[_0x5243ae(0x1cb)],'error':a47_0x2bf1fc[_0x5243ae(0x2be)],'group_error':a47_0x2bf1fc[_0x5243ae(0x2be)],'running':a47_0x2bf1fc[_0x5243ae(0x2a6)],'blocked':a47_0x2bf1fc[_0x5243ae(0x29b)],'planned':a47_0x2bf1fc[_0x5243ae(0x22a)],'canceling':a47_0x2bf1fc['yellow']};return _0x533160[_0xdc8fd5]||a47_0x2bf1fc[_0x5243ae(0x221)];}function parseTaskName(_0x56bd94){const _0x42a18f=a47_0x18ff36;let _0x4be6e5=_0x56bd94['replace'](/^\++/,'');const _0x489432=_0x4be6e5['split']('+'),_0x19deed=_0x489432[_0x42a18f(0x1b9)]>0x1?_0x489432['length']-0x2:0x0,_0x4f090a=_0x489432[_0x489432[_0x42a18f(0x1b9)]-0x1]||_0x4be6e5;return{'level':_0x19deed,'name':'+'+_0x4f090a};}function truncateTaskName(_0xaed139,_0xf43db7){const _0xff1531=a47_0x18ff36,_0x47b48a=stringWidth(_0xaed139);if(_0x47b48a<=_0xf43db7)return _0xaed139;let _0xdf397c=_0xaed139;while(stringWidth(_0xdf397c+'…')>_0xf43db7&&_0xdf397c[_0xff1531(0x1b9)]>0x0){_0xdf397c=_0xdf397c[_0xff1531(0x24a)](0x0,-0x1);}return _0xdf397c+'…';}function calculateTimeScale(_0x3b5669,_0x51546e){const _0x1883b6=a47_0x18ff36;return{'startTime':_0x3b5669[_0x1883b6(0x28f)],'endTime':_0x3b5669['end'],'durationMs':_0x3b5669['duration'],'msPerChar':_0x3b5669[_0x1883b6(0x30a)]/_0x51546e};}function timeToPosition(_0x4e50cf,_0x4ba28b,_0x4afe6f){const _0x22bcf8=a47_0x18ff36,_0xc4638f=_0x4e50cf-_0x4ba28b[_0x22bcf8(0x18d)],_0x2307f0=Math[_0x22bcf8(0x2a3)](_0xc4638f/_0x4ba28b[_0x22bcf8(0x1fc)]);return Math[_0x22bcf8(0x1f7)](0x0,Math[_0x22bcf8(0x1e8)](_0x2307f0,_0x4afe6f));}function renderTimeAxis(_0x3ef21b,_0x45dc46){const _0x390450=a47_0x18ff36,_0x332795=Math[_0x390450(0x1e8)](TIMELINE_CONFIG[_0x390450(0x1e3)],Math['max'](TIMELINE_CONFIG[_0x390450(0x31e)],Math[_0x390450(0x2a3)](_0x45dc46/TIMELINE_CONFIG[_0x390450(0x1bc)]))),_0xbc3495=_0x3ef21b[_0x390450(0x1e0)]/(_0x332795-0x1),_0x1c6496=new Date(_0x3ef21b[_0x390450(0x18d)]),_0xa941ad=[];for(let _0x2ad90f=0x0;_0x2ad90f<_0x332795;_0x2ad90f++){const _0x70185b=_0x3ef21b['startTime']+_0x2ad90f*_0xbc3495,_0x2084aa=timeToPosition(_0x70185b,_0x3ef21b,_0x45dc46),_0x284638=formatTimestamp(_0x70185b,_0x1c6496);_0xa941ad[_0x390450(0x1e7)]({'pos':_0x2084aa,'text':_0x284638});}const _0x3018bf=new Array(_0x45dc46)[_0x390450(0x2b5)]('\x20');let _0x29d7c9=-0x1;for(const {pos:_0x4fdc16,text:_0x35d804}of _0xa941ad){let _0x3a3a32=Math['max'](0x0,_0x4fdc16-Math[_0x390450(0x2a3)](_0x35d804[_0x390450(0x1b9)]/0x2));_0x3a3a32<=_0x29d7c9+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x3a3a32=_0x29d7c9+TIMELINE_CONFIG[_0x390450(0x1c6)]+0x1);_0x3a3a32+_0x35d804[_0x390450(0x1b9)]>_0x45dc46&&(_0x3a3a32=_0x45dc46-_0x35d804[_0x390450(0x1b9)]);if(_0x3a3a32>=0x0&&_0x3a3a32+_0x35d804['length']<=_0x45dc46&&_0x3a3a32>_0x29d7c9){for(let _0x36c10f=0x0;_0x36c10f<_0x35d804[_0x390450(0x1b9)];_0x36c10f++){_0x3018bf[_0x3a3a32+_0x36c10f]=_0x35d804[_0x36c10f];}_0x29d7c9=_0x3a3a32+_0x35d804[_0x390450(0x1b9)]-0x1;}}return _0x3018bf[_0x390450(0x2c7)]('');}function renderTaskRow(_0x158014,_0x3321e1,_0xe82189,_0x3268d4){const _0x1128ea=a47_0x18ff36,{level:_0x553667,name:_0x400060}=parseTaskName(_0x158014['name']),_0x377acd='\x20'['repeat'](_0x553667),_0x23c07c=_0x158014[_0x1128ea(0x2c2)]?'('+formatElapsed(_0x158014[_0x1128ea(0x2c2)]['duration'])+')':'',_0x5d6bbb=stringWidth(_0x23c07c),_0x1096ae=_0x553667*0x1,_0x2afada=_0x3268d4-_0x1096ae-_0x5d6bbb-0x1,_0xa6fc53=truncateTaskName(_0x400060,_0x2afada),_0x554099=_0x377acd+_0xa6fc53,_0x49a3f9=stringWidth(_0x554099),_0x524eff=_0x3268d4-_0x49a3f9-_0x5d6bbb,_0x565577=_0x554099+'\x20'[_0x1128ea(0x307)](Math[_0x1128ea(0x1f7)](0x1,_0x524eff))+a47_0x2bf1fc[_0x1128ea(0x22a)](_0x23c07c),_0x13f981=getTaskStateIcon(_0x158014[_0x1128ea(0x1ba)]),_0xf8c086=new Array(_0xe82189)[_0x1128ea(0x2b5)]('\x20');if(_0x158014['window']){const _0x376f06=timeToPosition(_0x158014['window'][_0x1128ea(0x28f)],_0x3321e1,_0xe82189),_0x9d3b3b=timeToPosition(_0x158014[_0x1128ea(0x2c2)][_0x1128ea(0x1d4)],_0x3321e1,_0xe82189),_0x33df49=getBarChar(_0x158014[_0x1128ea(0x1ba)]),_0x35838e=Math[_0x1128ea(0x1f7)](_0x376f06+0x1,_0x9d3b3b);for(let _0x45277a=_0x376f06;_0x45277a<Math[_0x1128ea(0x1e8)](_0x35838e,_0xe82189);_0x45277a++){_0xf8c086[_0x45277a]=_0x33df49;}}const _0x393b15=getBarColor(_0x158014['state']),_0x220fdd=_0xf8c086[_0x1128ea(0x2b9)](_0x4246b1=>_0x4246b1==='\x20'?'\x20':_0x393b15(_0x4246b1))['join']('');return _0x13f981+'\x20'+_0x565577+'│'+_0x220fdd+'│';}function calculateStats(_0x1808de){const _0x52d501=a47_0x18ff36,_0x373f3f={'total':_0x1808de['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0xa828c6 of _0x1808de){if(_0xa828c6[_0x52d501(0x1ba)]==='success')_0x373f3f[_0x52d501(0x24f)]++;else{if(_0xa828c6[_0x52d501(0x1ba)]==='error'||_0xa828c6[_0x52d501(0x1ba)]===_0x52d501(0x28b))_0x373f3f[_0x52d501(0x1b7)]++;else _0xa828c6[_0x52d501(0x1ba)]===_0x52d501(0x2da)?_0x373f3f[_0x52d501(0x2da)]++:_0x373f3f[_0x52d501(0x2a4)]++;}}return _0x373f3f;}function formatStats(_0x55ae39){const _0x22e40b=a47_0x18ff36;return[_0x22e40b(0x322)+_0x55ae39[_0x22e40b(0x1c5)],'✅\x20'+_0x55ae39[_0x22e40b(0x24f)],'❌\x20'+_0x55ae39['error'],_0x22e40b(0x1b4)+_0x55ae39[_0x22e40b(0x2da)],'⏳\x20'+_0x55ae39[_0x22e40b(0x2a4)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a47_0x18ff36(0x324)]=a47_0x18ff36(0x2b4);['description']=a47_0x18ff36(0x274);async[a47_0x18ff36(0x2f8)](_0x210fab){const _0x4221ba=a47_0x18ff36,{options:_0x311a12,args:_0x178357,tdx:_0x31307f}=_0x210fab;let _0xe9833a,_0x23e62b,_0x353766=![];if(_0x178357[0x0]){if(_0x178357[0x0][_0x4221ba(0x214)]('.')){const _0x2b4bc3=this[_0x4221ba(0x313)](_0x178357,_0x311a12);if(!_0x2b4bc3)return 0x1;_0xe9833a=_0x2b4bc3[_0x4221ba(0x2af)],_0x23e62b=_0x2b4bc3[_0x4221ba(0x333)];}else{_0x23e62b=_0x178357[0x0],_0xe9833a=_0x311a12[_0x4221ba(0x18b)];if(!_0xe9833a)return console['error'](a47_0x2bf1fc['red'](_0x4221ba(0x2f1)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x353766=!![];}}else{const _0x14e709=this[_0x4221ba(0x313)](_0x178357,_0x311a12);if(!_0x14e709)return 0x1;_0xe9833a=_0x14e709[_0x4221ba(0x2af)],_0x23e62b=_0x14e709[_0x4221ba(0x333)];}if(_0x311a12['verbose']){if(_0xe9833a&&_0x23e62b)console[_0x4221ba(0x1b7)](_0x4221ba(0x1d2)+_0xe9833a+'.'+_0x23e62b);else _0xe9833a&&console['error'](_0x4221ba(0x24e)+_0xe9833a);}const _0x5e8bba=_0x311a12[_0x4221ba(0x1b6)],_0x576ce2=_0x311a12[_0x4221ba(0x2d8)];if(_0x5e8bba){_0x576ce2&&console['error'](a47_0x2bf1fc[_0x4221ba(0x29b)]('Warning:'),_0x4221ba(0x1fa));const _0x34cffa=_0x311a12['follow'];return _0x34cffa?await this[_0x4221ba(0x2aa)](_0x210fab,_0x5e8bba):await this['renderSingleTimeline'](_0x210fab,_0x5e8bba,_0x311a12),0x0;}if(_0x576ce2){const _0x157d98=await withSpinner(_0x4221ba(0x25f),()=>_0x31307f[_0x4221ba(0x23c)]['sessions']({'projectName':_0xe9833a,'workflowName':_0x23e62b,'limit':0x64}),{'verbose':_0x311a12[_0x4221ba(0x1bd)]}),_0x37eb8c=_0x157d98[_0x4221ba(0x258)]['find'](_0x234c2e=>_0x234c2e['id']===_0x576ce2);if(!_0x37eb8c)return console['error'](a47_0x2bf1fc[_0x4221ba(0x2be)](_0x4221ba(0x2f1)),_0x4221ba(0x1a3)+_0x576ce2),0x1;if(!_0x37eb8c[_0x4221ba(0x237)]?.['id'])return console[_0x4221ba(0x1b7)](a47_0x2bf1fc[_0x4221ba(0x2be)](_0x4221ba(0x2f1)),'Session\x20'+_0x576ce2+_0x4221ba(0x215)),0x1;const _0x93e437=_0x37eb8c[_0x4221ba(0x237)]['id'];_0x311a12[_0x4221ba(0x1bd)]&&console[_0x4221ba(0x1b7)](_0x4221ba(0x2a1)+_0x93e437+_0x4221ba(0x1ee)+_0x576ce2);const _0x582ddc=_0x311a12[_0x4221ba(0x20d)];return _0x582ddc?await this['pollTimeline'](_0x210fab,_0x93e437):await this['renderSingleTimeline'](_0x210fab,_0x93e437,_0x311a12),0x0;}const _0x4b66a0=await withSpinner(_0x4221ba(0x21f),()=>_0x31307f[_0x4221ba(0x23c)][_0x4221ba(0x2c3)]({'projectName':_0xe9833a,'workflowName':_0x23e62b,'limit':_0x311a12['limit']||0x32}),{'verbose':_0x311a12[_0x4221ba(0x1bd)]}),_0x513500=_0x4b66a0[_0x4221ba(0x258)];if(_0x513500[_0x4221ba(0x1b9)]===0x0){if(_0xe9833a&&_0x23e62b)console[_0x4221ba(0x1b7)](_0x4221ba(0x23a)+_0xe9833a+'.'+_0x23e62b);else _0xe9833a?console[_0x4221ba(0x1b7)](_0x4221ba(0x1f4)+_0xe9833a):(console[_0x4221ba(0x1b7)](_0x4221ba(0x2fd)),console[_0x4221ba(0x1b7)](a47_0x2bf1fc['dim']('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x513500['sort']((_0xfe3db2,_0x318f3e)=>{const _0x38ef15=_0x4221ba,_0x3f55f4=_0xfe3db2[_0x38ef15(0x255)]||'',_0x461f23=_0x318f3e[_0x38ef15(0x255)]||'';return _0x461f23[_0x38ef15(0x240)](_0x3f55f4);});if(_0x311a12['json']||_0x311a12['jsonl'])return await handleSDKOutput(_0x513500,_0x311a12),0x0;let _0x2a8e64;if(_0x353766){const _0x2081f6=_0x513500[0x0];if(!_0x2081f6[_0x4221ba(0x237)]?.['id'])return console[_0x4221ba(0x1b7)](_0x4221ba(0x252)),0x0;_0x2a8e64=_0x2081f6[_0x4221ba(0x237)]['id'],_0x311a12['verbose']&&console[_0x4221ba(0x1b7)]('Auto-selected\x20latest\x20session:\x20'+_0x2081f6[_0x4221ba(0x255)]);}else{const _0x398969=_0x513500[_0x4221ba(0x2b9)](_0x541826=>{const _0x4a24f1=_0x4221ba,_0x2dc4b0=getAttemptStatusDisplay(_0x541826[_0x4a24f1(0x237)]);return{'title':_0x541826[_0x4a24f1(0x2b8)]?.[_0x4a24f1(0x324)]+'.'+_0x541826[_0x4a24f1(0x23c)]?.[_0x4a24f1(0x324)]+_0x4a24f1(0x287)+_0x541826[_0x4a24f1(0x255)]+'\x20'+_0x2dc4b0[_0x4a24f1(0x20b)],'value':_0x541826[_0x4a24f1(0x237)]?.['id']||'','description':_0x2dc4b0['text']};}),_0x19d22c=await a47_0x307e4a({'type':'select','name':_0x4221ba(0x1b6),'message':_0x4221ba(0x2ab),'choices':_0x398969['filter'](_0x4b9991=>_0x4b9991[_0x4221ba(0x1a1)]!=='')});if(!_0x19d22c[_0x4221ba(0x1b6)])return 0x0;_0x2a8e64=_0x19d22c[_0x4221ba(0x1b6)];}const _0x4509da=_0x311a12['follow'];return _0x4509da?await this[_0x4221ba(0x2aa)](_0x210fab,_0x2a8e64):await this[_0x4221ba(0x2fc)](_0x210fab,_0x2a8e64,_0x311a12),0x0;}async['renderSingleTimeline'](_0x2ab9a2,_0xaf68d2,_0x9d8205){const _0x2d9eaa=a47_0x18ff36,{tdx:_0x1673cf}=_0x2ab9a2;let _0x58452d,_0x478ab6;try{[_0x58452d,_0x478ab6]=await Promise['all']([_0x1673cf[_0x2d9eaa(0x23c)][_0x2d9eaa(0x1da)](_0xaf68d2),_0x1673cf[_0x2d9eaa(0x23c)][_0x2d9eaa(0x28e)](_0xaf68d2,![])]);}catch(_0x71922e){console['error'](a47_0x2bf1fc['red'](_0x2d9eaa(0x1b1)));_0x9d8205[_0x2d9eaa(0x1bd)]&&console['error'](_0x71922e);throw _0x71922e;}if(_0x9d8205[_0x2d9eaa(0x222)]||_0x9d8205[_0x2d9eaa(0x27e)]){const _0x272eb3=this[_0x2d9eaa(0x223)](_0x58452d,_0x478ab6);await handleSDKOutput([_0x272eb3],_0x9d8205);return;}const _0x5b48c5=_0x1673cf['context'][_0x2d9eaa(0x236)],_0x113686=this[_0x2d9eaa(0x1f5)](_0x58452d,_0x478ab6,_0x5b48c5);console[_0x2d9eaa(0x1f9)](_0x113686);}async[a47_0x18ff36(0x2aa)](_0x495f68,_0x2444d6){const _0x57b67c=a47_0x18ff36,{tdx:_0x36eea1}=_0x495f68,_0x262305=TIMELINE_CONFIG[_0x57b67c(0x198)],_0x2ef80f=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x2133ae=0x0;while(_0x2133ae<_0x2ef80f){process['stdout'][_0x57b67c(0x29d)]&&process[_0x57b67c(0x2ef)][_0x57b67c(0x275)]('\x1bc');let _0xde3539,_0x4d501d;try{[_0xde3539,_0x4d501d]=await Promise['all']([_0x36eea1[_0x57b67c(0x23c)][_0x57b67c(0x1da)](_0x2444d6),_0x36eea1[_0x57b67c(0x23c)][_0x57b67c(0x28e)](_0x2444d6,![])]);}catch(_0x5b915d){console['error'](a47_0x2bf1fc[_0x57b67c(0x2be)](_0x57b67c(0x24b)));_0x2133ae>0x0&&console['error'](a47_0x2bf1fc[_0x57b67c(0x22a)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x2133ae));throw _0x5b915d;}const _0x1cd40a=_0x36eea1[_0x57b67c(0x304)][_0x57b67c(0x236)],_0x2b1f09=this[_0x57b67c(0x1f5)](_0xde3539,_0x4d501d,_0x1cd40a);console[_0x57b67c(0x1f9)](_0x2b1f09);const _0x31ba34=_0xde3539['done']&&_0x4d501d[_0x57b67c(0x297)](_0x3a741f=>_0x3a741f['state']!==_0x57b67c(0x2da)&&_0x3a741f[_0x57b67c(0x1ba)]!==_0x57b67c(0x1ad));if(_0x31ba34){console[_0x57b67c(0x1b7)](a47_0x2bf1fc[_0x57b67c(0x1cb)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0x57b67c(0x1b7)](a47_0x2bf1fc[_0x57b67c(0x22a)](_0x57b67c(0x226)+_0x2133ae*0x2+_0x57b67c(0x23d))),await new Promise(_0x9c0454=>setTimeout(_0x9c0454,_0x262305)),_0x2133ae++;}_0x2133ae>=_0x2ef80f&&console[_0x57b67c(0x1b7)](a47_0x2bf1fc['yellow']('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a47_0x18ff36(0x1f5)](_0x12d355,_0x500c56,_0x69dcfc){const _0x243885=a47_0x18ff36,_0x1f00fe=[],_0x108090=TIMELINE_CONFIG[_0x243885(0x200)],_0x3ea5bd=0x5,_0x4c2700=process[_0x243885(0x2ef)]['columns']||0x78,_0x11fe8e=_0x4c2700-_0x108090-_0x3ea5bd,_0x1af597=Math[_0x243885(0x1f7)](TIMELINE_CONFIG[_0x243885(0x32a)],Math[_0x243885(0x1e8)](_0x11fe8e,TIMELINE_CONFIG[_0x243885(0x2f3)])),_0x4226cd=new Date(_0x12d355[_0x243885(0x282)])[_0x243885(0x22e)](),_0x4f0d44=_0x12d355[_0x243885(0x2f0)]?new Date(_0x12d355[_0x243885(0x2f0)])[_0x243885(0x22e)]():Date['now'](),_0x1c331c={'start':_0x4226cd,'end':_0x4f0d44,'duration':_0x4f0d44-_0x4226cd},_0x1fb206=new Map(),_0x4f53a5=[];for(const _0x42b7a8 of _0x500c56){if(_0x42b7a8[_0x243885(0x195)]){const _0x16442b=new Date(_0x42b7a8[_0x243885(0x195)])[_0x243885(0x22e)](),_0x4b36d6=_0x42b7a8['updatedAt']?new Date(_0x42b7a8['updatedAt'])[_0x243885(0x22e)]():Date[_0x243885(0x29c)](),_0x40264c={'start':_0x16442b,'end':_0x4b36d6,'duration':_0x4b36d6-_0x16442b};_0x1fb206['set'](_0x42b7a8['id'],_0x40264c),_0x4f53a5['push']({'name':_0x42b7a8[_0x243885(0x295)],'state':_0x42b7a8[_0x243885(0x1ba)]||_0x243885(0x253),'window':_0x40264c});}else _0x4f53a5[_0x243885(0x1e7)]({'name':_0x42b7a8[_0x243885(0x295)],'state':_0x42b7a8[_0x243885(0x1ba)]||_0x243885(0x1ad),'window':undefined});}_0x4f53a5[_0x243885(0x32b)]((_0x2ab7f4,_0xaf5a97)=>{const _0x37177c=_0x243885;if(!_0x2ab7f4['window'])return 0x1;if(!_0xaf5a97[_0x37177c(0x2c2)])return-0x1;return _0x2ab7f4[_0x37177c(0x2c2)][_0x37177c(0x28f)]-_0xaf5a97[_0x37177c(0x2c2)][_0x37177c(0x28f)];});const _0x5c5591=_0x4f53a5[_0x243885(0x1b9)],_0x4b5e3f=_0x5c5591>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x4b5e3f&&_0x4f53a5[_0x243885(0x216)](TIMELINE_CONFIG[_0x243885(0x1c0)]);const _0x301efa=calculateTimeScale(_0x1c331c,_0x1af597),_0x48d2b2=_0x12d355[_0x243885(0x32f)]?_0x12d355[_0x243885(0x24f)]?a47_0x2bf1fc['green'](_0x243885(0x24f)):a47_0x2bf1fc[_0x243885(0x2be)]('error'):a47_0x2bf1fc[_0x243885(0x2a6)]('running'),_0x314626=_0x12d355[_0x243885(0x2b8)]?.['id'],_0x262f2b=_0x12d355['sessionId'];let _0x539348;if(_0x314626&&_0x262f2b){const _0x24371b=getWorkflowAttemptUrl(_0x69dcfc,_0x314626,_0x262f2b,_0x12d355['id']);_0x539348=hyperlink(a47_0x2bf1fc[_0x243885(0x22a)](_0x12d355['id']),_0x24371b);}else _0x539348=a47_0x2bf1fc['dim'](_0x12d355['id']);_0x1f00fe[_0x243885(0x1e7)](_0x243885(0x26a)+_0x539348+_0x243885(0x287)+_0x48d2b2+_0x243885(0x287)+formatElapsed(_0x1c331c[_0x243885(0x30a)]));if(_0x4f53a5[_0x243885(0x1b9)]>0x0){const _0xe9e954=renderTimeAxis(_0x301efa,_0x1af597),_0x13334b=new Date(_0x1c331c['start']),_0x595b82=formatDate(_0x13334b),_0x51689a=TIMELINE_CONFIG[_0x243885(0x196)]+TIMELINE_CONFIG['ICON_SPACING']+_0x108090,_0x4f1403=_0x595b82['padStart'](_0x51689a),_0xe73c9c=a47_0x2bf1fc[_0x243885(0x22a)](_0x4f1403);_0x1f00fe['push'](_0xe73c9c+'\x20'+_0xe9e954);for(const _0x138da5 of _0x4f53a5){_0x1f00fe[_0x243885(0x1e7)](renderTaskRow(_0x138da5,_0x301efa,_0x1af597,_0x108090));}const _0x1f3aae=calculateStats(_0x4f53a5);_0x1f00fe[_0x243885(0x1e7)](formatStats(_0x1f3aae)),_0x4b5e3f&&_0x1f00fe[_0x243885(0x1e7)](a47_0x2bf1fc[_0x243885(0x29b)](_0x243885(0x292)+TIMELINE_CONFIG[_0x243885(0x1c0)]+_0x243885(0x263)+_0x5c5591+_0x243885(0x227))),_0x1f00fe[_0x243885(0x1e7)](''),_0x1f00fe[_0x243885(0x1e7)](a47_0x2bf1fc['dim'](_0x243885(0x291))+('tdx\x20wf\x20attempt\x20'+_0x12d355['id']+_0x243885(0x332))+a47_0x2bf1fc['dim']('\x20to\x20see\x20detailed\x20logs'));}else _0x1f00fe[_0x243885(0x1e7)](_0x243885(0x235));return _0x1f00fe[_0x243885(0x2c7)]('\x0a');}[a47_0x18ff36(0x223)](_0x3fb841,_0x45557c){const _0x96f7cf=a47_0x18ff36,_0x1920bf=new Date(_0x3fb841[_0x96f7cf(0x282)])[_0x96f7cf(0x22e)](),_0x20a349=_0x3fb841['finishedAt']?new Date(_0x3fb841[_0x96f7cf(0x2f0)])['getTime']():Date[_0x96f7cf(0x29c)](),_0x43d890=_0x20a349-_0x1920bf,_0x1b3558=[];for(const _0x3c4750 of _0x45557c){if(_0x3c4750[_0x96f7cf(0x195)]){const _0x2268f0=new Date(_0x3c4750[_0x96f7cf(0x195)])['getTime'](),_0x25a41b=_0x3c4750[_0x96f7cf(0x306)]?new Date(_0x3c4750[_0x96f7cf(0x306)])['getTime']():Date['now']();_0x1b3558[_0x96f7cf(0x1e7)]({'name':_0x3c4750[_0x96f7cf(0x295)],'state':_0x3c4750[_0x96f7cf(0x1ba)]||'unknown','window':{'start':_0x2268f0,'end':_0x25a41b,'duration':_0x25a41b-_0x2268f0}});}else _0x1b3558[_0x96f7cf(0x1e7)]({'name':_0x3c4750[_0x96f7cf(0x295)],'state':_0x3c4750[_0x96f7cf(0x1ba)]||_0x96f7cf(0x1ad),'window':undefined});}const _0xc00f8=calculateStats(_0x1b3558);return{'attempt':{'id':_0x3fb841['id'],'status':_0x3fb841[_0x96f7cf(0x32f)]?_0x3fb841[_0x96f7cf(0x24f)]?_0x96f7cf(0x24f):_0x96f7cf(0x1b7):_0x96f7cf(0x2da),'createdAt':_0x3fb841['createdAt'],'finishedAt':_0x3fb841[_0x96f7cf(0x2f0)],'duration_ms':_0x43d890},'tasks':_0x1b3558[_0x96f7cf(0x2b9)](_0x5346ec=>({'name':_0x5346ec[_0x96f7cf(0x324)],'state':_0x5346ec[_0x96f7cf(0x1ba)],'startedAt':_0x5346ec['window']?new Date(_0x5346ec[_0x96f7cf(0x2c2)][_0x96f7cf(0x28f)])[_0x96f7cf(0x2e3)]():null,'updatedAt':_0x5346ec[_0x96f7cf(0x2c2)]?new Date(_0x5346ec[_0x96f7cf(0x2c2)]['end'])[_0x96f7cf(0x2e3)]():null,'duration_ms':_0x5346ec[_0x96f7cf(0x2c2)]?.['duration']||null})),'stats':_0xc00f8};}}
1
+ const a47_0x4daf2f=a47_0x3695;(function(_0x4f83f9,_0x256edb){const _0x30ee4d=a47_0x3695,_0x126569=_0x4f83f9();while(!![]){try{const _0xfef97d=parseInt(_0x30ee4d(0x182))/0x1*(-parseInt(_0x30ee4d(0x188))/0x2)+-parseInt(_0x30ee4d(0x28d))/0x3+-parseInt(_0x30ee4d(0x2c6))/0x4*(-parseInt(_0x30ee4d(0x2df))/0x5)+parseInt(_0x30ee4d(0x1f3))/0x6*(parseInt(_0x30ee4d(0x24d))/0x7)+parseInt(_0x30ee4d(0x1ae))/0x8*(parseInt(_0x30ee4d(0x172))/0x9)+parseInt(_0x30ee4d(0x1b0))/0xa+-parseInt(_0x30ee4d(0x20d))/0xb*(parseInt(_0x30ee4d(0x1bf))/0xc);if(_0xfef97d===_0x256edb)break;else _0x126569['push'](_0x126569['shift']());}catch(_0x18fd4b){_0x126569['push'](_0x126569['shift']());}}}(a47_0x8231,0x8a2bc));import a47_0x59ff5e from'chalk';import{existsSync}from'fs';import a47_0x32b188 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a47_0x3695(_0x1cd449,_0x59334a){_0x1cd449=_0x1cd449-0x171;const _0x82310b=a47_0x8231();let _0x3695de=_0x82310b[_0x1cd449];return _0x3695de;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';function a47_0x8231(){const _0x53e332=['Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','✔\x20Secret\x20\x27','Project:\x20','cyan','✔\x20Clone\x20complete','lastAttempt','/app/workflows/','keys','now','Filter:\x20','slice','Output\x20directory:\x20','GUTTER','renderSessionsTimeline','executePushProject','List\x20workflows','workflow:download','pending','dim','parseProjectWorkflowPattern','fill','resolveProjectDir','filesExtracted','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','/sessions/','select','logs','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','workflow:upload','match','fs/promises','\x20\x20Target:\x20','4xiltte','\x0aApply\x20these\x20changes?','sessionId','workflow:retry','data','all','No\x20log\x20files\x20found\x20for\x20this\x20attempt','index','Files\x20to\x20upload:\x20','Params:\x20','\x0a✔\x20Already\x20up\x20to\x20date','\x20\x20Revision:\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','tasks','Downloading\x20logs...','createdAt','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','cancelRequested','\x20\x20Workflow:\x20','renderSingleTimeline','basename','\x22\x20with\x20new\x20revision?','\x20deleted','Target:\x20','fromTask','1977015AOmbCn','Listing\x20workflows...','\x20\x20Project:\x20','startTime','Setting\x20secret...','renderTimeline','unchanged','\x20unchanged','get','Project\x20filter:\x20','\x20\x20Attempt\x20ID:\x20','new','revision:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x20\x20tdx\x20wf\x20use\x20<project>','workflow:push','isNewProject','green','\x20\x20Changes:\x20','length','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','max','Writing\x20files...','\x20session','resolve','Select\x20a\x20session\x20to\x20view\x20timeline:','sessionTime','task','Validation:\x20skipped','Parameters:\x20','kill','Show\x20tasks\x20for\x20an\x20attempt','\x0aDry\x20run\x20-\x20no\x20project\x20created','workflow','Tip:\x20cd\x20to\x20workflows/','Source\x20directory:\x20','\x27...','start','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','planned','\x20\x20Session\x20context\x20set\x20to:\x20','isDirectory','\x20project','Select\x20a\x20workflow\x20to\x20run','startedAt','resolveProjectId','\x22\x20to\x20new\x20project\x20\x22','duration','params','stringify','Updating\x20','durationMs','stdout','LABEL_MIN_SPACING','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Getting\x20attempt\x20details...','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','find','type','clear','workflow:clone','success','Cancelled','name','Dry\x20run:\x20yes','\x20has\x20no\x20attempts','delete','end','\x20sessions\x20','window','Pull\x20workflow\x20project\x20to\x20local\x20folder','Retrying\x20session...','pollTimeline','dryRun','63hWmLXt','workflowName','applyPullProject','Force:\x20yes','getHours','-\x20nothing\x20pushed','Pulling\x20project\x20','workflow:use','generateSessionTimelineRows','Include\x20retried:\x20yes','workflow:tasks','workflows','Attempt\x20ID:\x20','No\x20workflows\x20found','toLowerCase','Retry\x20a\x20session\x20or\x20attempt','169757WYlpRp','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','\x20secret','Project\x20name\x20is\x20required','localeCompare','Resume\x20from:\x20','6ssNkXa','indexOf','description','log','sourceDir','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Error:\x20Invalid\x20JSON\x20in\x20--params','trim','Filter:\x20project=','Loading\x20session...','No\x20matching\x20sessions\x20found','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','stat','workflow:pull','project','retryAttemptName','Status:\x20','📋\x20','floor','List\x20workflow\x20execution\x20sessions','list','attempt','workflow:secrets:delete','navigateSessionsInteractive','No\x20attempts\x20found','force','Error:\x20KEY=VALUE\x20is\x20required','\x0aUpdate\x20existing\x20project\x20\x22','has',',\x20Workflow:\x20','\x20from\x20session\x20','Task\x20name:\x20','showWorkflowConsoleUrl','✔\x20Showing\x20','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Analyzing\x20project...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','retryAttempt','1067304caJnMy','List\x20workflow\x20attempts','2036190mCKkbe','autocomplete','logFiles','tdx.json','---\x20','path','padStart','New\x20project\x20name:\x20','push','Key:\x20','trimEnd','\x20of\x20','prepareCloneProject','✔\x20Project\x20updated','json','12cREllh','resumeFrom','min','\x20\x20Location:\x20','\x20task','\x0a✔\x20Attempt\x20complete','Getting\x20attempt\x20tasks...','modified','readFile','Start\x20a\x20workflow\x20run','\x20is\x20not\x20a\x20directory','parse','workflow:attempts','newProjectName','✔\x20Workflow\x20project\x20set\x20to:\x20','Select\x20a\x20task\x20to\x20view\x20logs:','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','replace','repeat','Show\x20specific\x20attempt\x20details','\x20\x20Console:\x20','output','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✔\x20Push\x20complete','Reason:\x20','sourceProjectName','state','unknown','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','\x20\x20Project\x20ID:\x20','limit','substring','✔\x20Retry\x20started','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','total','splice','getMonth','session:','rows','\x27\x20from\x20project\x20\x27','site','targetExists','Error:\x20Invalid\x20parameter\x20format:\x20','values','cwd','error','workflow:sessions','workflow:delete','title','501366XXVYdT','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','yellow','newProjectId','verbose','white','running','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','join','sessions','targetDir','...','projectName','write','includeRetried','map','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','\x20(use\x20--limit\x20to\x20show\x20more)','buildTimelineData','round','updatedAt','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Usage:\x20workflow:delete\x20<project-name-or-id>','Error:','attemptId','11743501FnMSBc','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','changes','No\x20sessions\x20found','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x0a✔\x20No\x20changes\x20to\x20push','Source\x20directory\x20is\x20required','requireProject','status','Workflow:\x20','columns','✔\x20Project:\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Project\x20name:\x20','List\x20all\x20workflow\x20projects','metadata','Fetching\x20log\x20files...','Error:\x20Project\x20name\x20is\x20required','\x0aError:','every','workflow:secrets:list','sys','format','No\x20sessions\x20found\x20in\x20project:\x20','workflow:timeline','Source:\x20','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','workflow:projects','pullProject','Deleting\x20secret...','deleteSecret','\x20\x20Session\x20ID:\x20','\x20-\x20','Total:\x20','sort','Starting\x20workflow\x20run...','session','key','MAX_TASKS_DISPLAY','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','done','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','group_error','No\x20projects\x20match\x20pattern:\x20','workflowProject','✔\x20Found\x20','Pushing\x20workflow\x20project...','isTTY','set','Error:\x20Attempt\x20ID\x20is\x20required','isArray','deleted','Session\x20not\x20found:\x20','getDate','\x0aDry\x20run\x20-\x20nothing\x20pushed','finishedAt','table','attempts','red','Loading\x20sessions...','fileCount','Auto-selected\x20latest\x20session:\x20','execute','retrySession','84HUpbMY','-\x20no\x20files\x20written','workflow:kill','yes','Listing\x20workflow\x20attempts...','\x20\x20Files\x20extracted:\x20','Invalid\x20format:\x20','getFullYear','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x22?\x20This\x20cannot\x20be\x20undone.','Deleting\x20project\x20','\x0aPush\x20these\x20changes?','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Downloading\x20project\x20','workflow:secrets:set','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Latest\x20session\x20has\x20no\x20attempt','No\x20workflow\x20tdx.json\x20found','existingProjectId','\x20attempt','Warning:','resolveProject','value','Project\x20directory:\x20','→\x20Project:\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','ICON_WIDTH','revision','hasChanges','text','blue','fullName','Including\x20subtasks:\x20yes','executeCloneProject','No\x20log\x20content\x20found','startsWith','message','Show\x20logs\x20for\x20a\x20workflow\x20attempt','\x20\x20Source:\x20','✔\x20Deleted\x20project\x20','Listing\x20secrets...','LABEL_WIDTH_DIVISOR','\x0aPolling...\x20(','⚠\x20Showing\x20first\x20','utf-8','\x0aDry\x20run\x20-\x20no\x20files\x20written','diff','toISOString','summary','MAX_TIMELINE_WIDTH','includes','Revision:\x20','Loading\x20workflows...','Analyzing\x20changes...','session_id','getMinutes','(use\x20--limit\x20to\x20see\x20more)','getTime','canceling','workflow:run','skipValidation','listSecrets','✔\x20Pushed\x20','Failed\x20to\x20fetch\x20attempt\x20data','1178505AcuvXw','download','taskName','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Error:\x20','relative','From\x20task:\x20','→\x20New\x20project:\x20','Error:\x20Secret\x20key\x20is\x20required','jsonl','filter','No\x20sessions\x20with\x20timing\x20information','Resolving\x20project\x20\x27','workflow:workflows','Retrying\x20attempt...','projectId','Session\x20time:\x20','Expected\x20format:\x20--param\x20key=value','context','.\x20Expected\x20format:\x20KEY=VALUE','POLL_INTERVAL_MS','No\x20sessions\x20found\x20for:\x20','✔\x20Workflow\x20project\x20context\x20cleared.','follow','split'];a47_0x8231=function(){return _0x53e332;};return a47_0x8231();}import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a47_0x20f678 from'prompts';function getAttemptStatusDisplay(_0x15ad96){const _0x4d31e9=a47_0x3695;if(!_0x15ad96)return{'icon':'⏳','text':''};const {done:_0x435ca7,success:_0xe173d9,cancelRequested:_0x3d61f7}=_0x15ad96;if(!_0x435ca7)return _0x3d61f7?{'icon':'🛑','text':a47_0x59ff5e[_0x4d31e9(0x1f5)](_0x4d31e9(0x287))}:{'icon':'🔄','text':a47_0x59ff5e[_0x4d31e9(0x26b)](_0x4d31e9(0x1f9))};if(_0xe173d9)return{'icon':'✅','text':a47_0x59ff5e[_0x4d31e9(0x2f0)](_0x4d31e9(0x31d))};return{'icon':'❌','text':a47_0x59ff5e['red'](_0x4d31e9(0x1ef))};}export class WorkflowBaseCommand extends BaseCommand{[a47_0x4daf2f(0x262)](_0x23be70,_0x4527dd,_0x2fad45=0x0){const _0x44e3a9=a47_0x4daf2f;return _0x23be70[_0x2fad45]||_0x4527dd[_0x44e3a9(0x239)];}[a47_0x4daf2f(0x214)](_0x4630d2,_0x5cad44,_0x51907f=0x0){const _0x168605=a47_0x4daf2f,_0xd7278c=this[_0x168605(0x262)](_0x4630d2,_0x5cad44,_0x51907f);if(!_0xd7278c)return console[_0x168605(0x1ef)](a47_0x59ff5e[_0x168605(0x247)](_0x168605(0x20b)),_0x168605(0x185)),console['error'](a47_0x59ff5e[_0x168605(0x2b8)](_0x168605(0x2bd))),null;return _0xd7278c;}[a47_0x4daf2f(0x2b9)](_0x18fa7a,_0x563aec){const _0x1fcbe1=a47_0x4daf2f;if(_0x18fa7a[0x0]){const _0x3100bb=_0x18fa7a[0x0][_0x1fcbe1(0x2a5)]('.');if(_0x3100bb[_0x1fcbe1(0x2f2)]===0x1)return{'projectName':_0x3100bb[0x0],'workflowName':undefined};else return _0x3100bb[_0x1fcbe1(0x2f2)]===0x2?{'projectName':_0x3100bb[0x0],'workflowName':_0x3100bb[0x1]}:(console[_0x1fcbe1(0x1ef)](a47_0x59ff5e[_0x1fcbe1(0x247)](_0x1fcbe1(0x20b)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x563aec[_0x1fcbe1(0x239)],'workflowName':undefined};}[a47_0x4daf2f(0x2bb)](_0x367b74,_0x1fe8df,_0xc1dbf=0x0){const _0x738d9a=a47_0x4daf2f;if(_0x367b74[_0xc1dbf])return _0x367b74[_0xc1dbf];if(_0x1fe8df[_0x738d9a(0x239)]){const _0x25884f=a47_0x32b188[_0x738d9a(0x1fb)](process[_0x738d9a(0x1ee)](),_0x738d9a(0x17d),_0x1fe8df[_0x738d9a(0x239)]);if(existsSync(a47_0x32b188[_0x738d9a(0x1fb)](_0x25884f,_0x738d9a(0x1b3))))return _0x25884f;}return undefined;}async[a47_0x4daf2f(0x1a8)](_0x52d503,_0x14c084,_0x5592c4){const _0xe17dc3=a47_0x4daf2f;try{const _0x5cb384=await _0x52d503[_0xe17dc3(0x300)][_0xe17dc3(0x17d)](_0x14c084,{'limit':0x1});if(_0x5cb384[_0xe17dc3(0x2f2)]>0x0){const _0x32a56c=_0x5cb384[0x0]['id'],_0xc1dfec=getWorkflowUrl(_0x5592c4,_0x32a56c);console['error'](_0xe17dc3(0x1d4)+a47_0x59ff5e[_0xe17dc3(0x2a9)](_0xc1dfec));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a47_0x4daf2f(0x31f)]=a47_0x4daf2f(0x179);['description']=a47_0x4daf2f(0x1cf);async[a47_0x4daf2f(0x24b)](_0x479f05){const _0x3179cb=a47_0x4daf2f,{options:_0x6ed59,args:_0x4841eb,tdx:_0x4ce353}=_0x479f05,_0x700116=_0x4841eb[0x0],_0x21b8bc=_0x6ed59[_0x3179cb(0x31b)];if(_0x21b8bc)return saveSessionContext({'workflow_project':undefined},_0x6ed59[_0x3179cb(0x231)]),console['log'](a47_0x59ff5e[_0x3179cb(0x2f0)](_0x3179cb(0x2a3))),0x0;if(!_0x700116)return console['error'](a47_0x59ff5e[_0x3179cb(0x247)](_0x3179cb(0x20b)),'Project\x20name\x20is\x20required'),console[_0x3179cb(0x1ef)](a47_0x59ff5e['dim']('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x3179cb(0x1ef)](a47_0x59ff5e[_0x3179cb(0x2b8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x485bf9=await withSpinner(_0x3179cb(0x299)+_0x700116+_0x3179cb(0x303),()=>_0x4ce353[_0x3179cb(0x300)][_0x3179cb(0x30d)](_0x700116),{'verbose':_0x6ed59[_0x3179cb(0x1f7)]}),{name:_0x527195}=_0x485bf9[_0x3179cb(0x2ca)];return saveSessionContext({'workflow_project':_0x527195},_0x6ed59[_0x3179cb(0x231)]),console['log'](a47_0x59ff5e[_0x3179cb(0x2f0)](_0x3179cb(0x1cd)+a47_0x59ff5e['cyan'](_0x527195))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a47_0x4daf2f(0x31f)]=a47_0x4daf2f(0x228);[a47_0x4daf2f(0x18a)]=a47_0x4daf2f(0x21b);async[a47_0x4daf2f(0x24b)](_0x3806ef){const _0x10689a=a47_0x4daf2f,{options:_0x2a6247,args:_0x2dc469,tdx:_0x5496ee}=_0x3806ef,_0x561a1d=_0x2dc469[0x0];_0x2a6247['verbose']&&_0x561a1d&&console[_0x10689a(0x1ef)]('Pattern:\x20'+_0x561a1d);const _0x557751=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x5496ee[_0x10689a(0x300)]['projects'](_0x561a1d,{'limit':_0x2a6247['limit']}),{'verbose':_0x2a6247[_0x10689a(0x1f7)]});let _0x4118ff=_0x557751[_0x10689a(0x2ca)];_0x4118ff[_0x10689a(0x22f)]((_0x391d39,_0x4701c1)=>_0x391d39[_0x10689a(0x31f)][_0x10689a(0x186)](_0x4701c1[_0x10689a(0x31f)]));const _0x5dc6da=_0x2a6247[_0x10689a(0x1e0)]||0x64,_0x156081=_0x4118ff[_0x10689a(0x2f2)]>=_0x5dc6da?a47_0x59ff5e[_0x10689a(0x2b8)](_0x10689a(0x205)):'';console[_0x10689a(0x1ef)](_0x10689a(0x23a)+_0x4118ff[_0x10689a(0x2f2)]+_0x10689a(0x30a)+(_0x4118ff[_0x10689a(0x2f2)]!==0x1?'s':'')+_0x156081);if(_0x2a6247[_0x10689a(0x223)]===_0x10689a(0x1be)||_0x2a6247[_0x10689a(0x223)]===_0x10689a(0x296)||_0x2a6247[_0x10689a(0x223)]===_0x10689a(0x245))await handleSDKOutput(_0x4118ff,_0x2a6247);else{if(_0x4118ff['length']===0x0)_0x561a1d?console[_0x10689a(0x18b)](_0x10689a(0x238)+_0x561a1d):console['log']('No\x20workflow\x20projects\x20found');else{const _0x2af5a2=_0x4118ff[_0x10689a(0x202)](_0x463223=>{const _0x1f4135=_0x10689a,_0x5f1a85=_0x463223[_0x1f4135(0x21c)]?.['some'](_0x561c25=>_0x561c25[_0x1f4135(0x232)]===_0x1f4135(0x222)),_0x2399bd=_0x5f1a85?a47_0x59ff5e[_0x1f4135(0x2b8)]('\x20(system)'):'';return'📁\x20'+_0x463223[_0x1f4135(0x31f)]+_0x2399bd;});await writeOutput(_0x2af5a2[_0x10689a(0x1fb)]('\x0a'),_0x2a6247[_0x10689a(0x1d5)],_0x10689a(0x19c));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a47_0x4daf2f(0x31f)]=a47_0x4daf2f(0x29a);[a47_0x4daf2f(0x18a)]=a47_0x4daf2f(0x2b5);async[a47_0x4daf2f(0x24b)](_0x287a15){const _0x142444=a47_0x4daf2f,{options:_0x1b5a4c,args:_0x486927,tdx:_0xb7358a}=_0x287a15,_0x19a14c=this['resolveProject'](_0x486927,_0x1b5a4c);_0x1b5a4c[_0x142444(0x1f7)]&&_0x19a14c&&console[_0x142444(0x1ef)](_0x142444(0x2e8)+_0x19a14c);const _0x45b7c8=await withSpinner(_0x142444(0x2e0),()=>_0xb7358a[_0x142444(0x300)][_0x142444(0x17d)](_0x19a14c,{'limit':_0x1b5a4c[_0x142444(0x1e0)]}),{'verbose':_0x1b5a4c['verbose']});let _0x4ebcfd=_0x45b7c8[_0x142444(0x2ca)];_0x4ebcfd[_0x142444(0x22f)]((_0x4a9d4e,_0x4e03de)=>{const _0x5f49ef=_0x142444,_0x47e214=_0x4a9d4e[_0x5f49ef(0x31f)][_0x5f49ef(0x186)](_0x4e03de[_0x5f49ef(0x31f)]);if(_0x47e214!==0x0)return _0x47e214;return(_0x4a9d4e[_0x5f49ef(0x196)]?.[_0x5f49ef(0x31f)]||'')[_0x5f49ef(0x186)](_0x4e03de[_0x5f49ef(0x196)]?.[_0x5f49ef(0x31f)]||'');});const _0x14712d=_0x1b5a4c[_0x142444(0x1e0)]||0x64,_0x2856e7=_0x4ebcfd[_0x142444(0x2f2)]>=_0x14712d?a47_0x59ff5e[_0x142444(0x2b8)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x142444(0x1ef)]('✔\x20Found\x20'+_0x4ebcfd[_0x142444(0x2f2)]+'\x20workflow'+(_0x4ebcfd['length']!==0x1?'s':'')+_0x2856e7);if(_0x1b5a4c[_0x142444(0x223)]===_0x142444(0x1be)||_0x1b5a4c[_0x142444(0x223)]===_0x142444(0x296)||_0x1b5a4c[_0x142444(0x223)]===_0x142444(0x245))await handleSDKOutput(_0x4ebcfd,_0x1b5a4c);else{if(_0x4ebcfd[_0x142444(0x2f2)]===0x0)_0x19a14c?console['log']('No\x20workflows\x20found\x20in\x20project:\x20'+_0x19a14c):console[_0x142444(0x18b)](_0x142444(0x17f));else{const _0x18160e=_0x1b5a4c['site'],_0x485524=_0x4ebcfd[_0x142444(0x202)](_0x4ceab9=>{const _0x1238c=_0x142444,_0x4e062d=a47_0x59ff5e[_0x1238c(0x2b8)]('#'+_0x4ceab9['id']),_0x2626cc=hyperlink(_0x4e062d,getWorkflowUrl(_0x18160e,_0x4ceab9['id'])),_0x1f3976=_0x4ceab9[_0x1238c(0x196)]?.[_0x1238c(0x31f)]?a47_0x59ff5e['dim']('\x20('+_0x4ceab9[_0x1238c(0x196)][_0x1238c(0x31f)]+')'):'';return _0x1238c(0x199)+_0x2626cc+'\x20'+_0x4ceab9[_0x1238c(0x31f)]+_0x1f3976;});await writeOutput(_0x485524['join']('\x0a'),_0x1b5a4c['output'],_0x142444(0x19c));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a47_0x4daf2f(0x31f)]=a47_0x4daf2f(0x1f0);[a47_0x4daf2f(0x18a)]=a47_0x4daf2f(0x19b);async[a47_0x4daf2f(0x24b)](_0x23df64){const _0x13156a=a47_0x4daf2f,{options:_0x51f4f0,args:_0x15f2ec,tdx:_0x1ff9bd}=_0x23df64,_0x3158a9=this[_0x13156a(0x2b9)](_0x15f2ec,_0x51f4f0);if(!_0x3158a9)return 0x1;const {projectName:_0x2bf570,workflowName:_0x3b1ed5}=_0x3158a9;if(_0x51f4f0['verbose']){if(_0x2bf570&&_0x3b1ed5)console[_0x13156a(0x1ef)](_0x13156a(0x2af)+_0x2bf570+'.'+_0x3b1ed5);else _0x2bf570&&console[_0x13156a(0x1ef)](_0x13156a(0x190)+_0x2bf570);const _0x59f7bb=_0x51f4f0[_0x13156a(0x215)];_0x59f7bb&&console[_0x13156a(0x1ef)](_0x13156a(0x198)+_0x59f7bb);}let _0x383f0f=0x28;if(process['stdout'][_0x13156a(0x23c)]&&!_0x51f4f0['output']&&!_0x51f4f0[_0x13156a(0x223)]){const _0x36df26=process[_0x13156a(0x314)][_0x13156a(0x1e8)]||0x28;_0x383f0f=Math[_0x13156a(0x2f4)](0x14,Math[_0x13156a(0x19a)](_0x36df26*0x2/0x3));}const _0xe5d261=_0x51f4f0[_0x13156a(0x1e0)]||_0x383f0f,_0x30d2e6=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x1ff9bd[_0x13156a(0x300)][_0x13156a(0x1fc)]({'projectName':_0x2bf570,'workflowName':_0x3b1ed5,'status':_0x51f4f0['status'],'fromTime':_0x51f4f0['from'],'toTime':_0x51f4f0['to'],'limit':_0xe5d261}),{'verbose':_0x51f4f0[_0x13156a(0x1f7)]}),_0x58087d=_0x30d2e6[_0x13156a(0x2ca)];_0x58087d[_0x13156a(0x22f)]((_0x9d2ec0,_0x541b55)=>{const _0x4479b3=_0x13156a,_0x103c68=_0x9d2ec0['sessionTime']||'',_0x283293=_0x541b55[_0x4479b3(0x2f9)]||'';return _0x283293[_0x4479b3(0x186)](_0x103c68);});_0x58087d[_0x13156a(0x2f2)]>=_0xe5d261?console[_0x13156a(0x1ef)](_0x13156a(0x1a9)+_0x58087d[_0x13156a(0x2f2)]+_0x13156a(0x324)+a47_0x59ff5e['dim'](_0x13156a(0x285))):console['error'](_0x13156a(0x23a)+_0x58087d['length']+_0x13156a(0x2f6)+(_0x58087d[_0x13156a(0x2f2)]!==0x1?'s':''));if(_0x51f4f0['format']==='json'||_0x51f4f0['format']===_0x13156a(0x296)||_0x51f4f0[_0x13156a(0x223)]===_0x13156a(0x245))await handleSDKOutput(_0x58087d,_0x51f4f0);else{if(!process[_0x13156a(0x314)][_0x13156a(0x23c)]||_0x51f4f0[_0x13156a(0x1d5)]){if(_0x58087d[_0x13156a(0x2f2)]===0x0){if(_0x2bf570&&_0x3b1ed5)console[_0x13156a(0x18b)]('No\x20sessions\x20found\x20for:\x20'+_0x2bf570+'.'+_0x3b1ed5);else _0x2bf570?console[_0x13156a(0x18b)](_0x13156a(0x224)+_0x2bf570):console[_0x13156a(0x18b)](_0x13156a(0x210));}else{const _0x5dd538=_0x51f4f0[_0x13156a(0x1ea)],_0x1cf4b6=this[_0x13156a(0x2b3)](_0x58087d,_0x5dd538);_0x51f4f0[_0x13156a(0x1d5)]?await writeOutput(_0x1cf4b6,_0x51f4f0[_0x13156a(0x1d5)],_0x13156a(0x19c)):console[_0x13156a(0x18b)](_0x1cf4b6);}!_0x2bf570&&(console['error'](''),console[_0x13156a(0x1ef)](a47_0x59ff5e['dim']('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x13156a(0x1ef)](a47_0x59ff5e[_0x13156a(0x2b8)](_0x13156a(0x1aa))+'or'+a47_0x59ff5e[_0x13156a(0x2b8)](_0x13156a(0x2ed))));}else{if(_0x58087d[_0x13156a(0x2f2)]===0x0){if(_0x2bf570&&_0x3b1ed5)console['log']('No\x20sessions\x20found\x20for:\x20'+_0x2bf570+'.'+_0x3b1ed5);else _0x2bf570?console[_0x13156a(0x18b)](_0x13156a(0x224)+_0x2bf570):console[_0x13156a(0x18b)]('No\x20sessions\x20found');}else await this[_0x13156a(0x19f)](_0x58087d,_0x23df64,_0x2bf570);}}return 0x0;}[a47_0x4daf2f(0x2b3)](_0x5b9623,_0x325bc6){const _0x35528a=a47_0x4daf2f,_0x3d5001=[],_0x290a9f=new Map();let _0x5728b4=Infinity,_0x2ac617=-Infinity;for(const _0x31ab0a of _0x5b9623){if(_0x31ab0a['lastAttempt']?.[_0x35528a(0x2d5)]){const _0x51d162=new Date(_0x31ab0a[_0x35528a(0x2ab)][_0x35528a(0x2d5)])[_0x35528a(0x286)](),_0x4af9db=_0x31ab0a[_0x35528a(0x2ab)][_0x35528a(0x244)]?new Date(_0x31ab0a[_0x35528a(0x2ab)][_0x35528a(0x244)])['getTime']():Date['now'](),_0x497072=_0x31ab0a[_0x35528a(0x196)]?.[_0x35528a(0x31f)]||'(unknown)';!_0x290a9f[_0x35528a(0x1a4)](_0x497072)&&_0x290a9f['set'](_0x497072,[]),_0x290a9f['get'](_0x497072)['push']({'session':_0x31ab0a,'startTime':_0x51d162,'endTime':_0x4af9db,'duration':_0x4af9db-_0x51d162}),_0x5728b4=Math[_0x35528a(0x1c1)](_0x5728b4,_0x51d162),_0x2ac617=Math[_0x35528a(0x2f4)](_0x2ac617,_0x4af9db);}}if(_0x290a9f['size']===0x0)return _0x35528a(0x298);const _0x2c82eb=process[_0x35528a(0x314)][_0x35528a(0x217)]||0x78,_0x4eb82d=0x1e,_0xa74ab5=0x32,_0x8b9b27=0x4,_0x160ecf=Math[_0x35528a(0x1c1)](_0xa74ab5,Math[_0x35528a(0x2f4)](_0x4eb82d,Math['floor'](_0x2c82eb*0.3))),_0x489d2e=_0x2c82eb-_0x160ecf-TIMELINE_CONFIG[_0x35528a(0x2b2)]-0x3-_0x8b9b27,_0x259b7b=_0x2ac617-_0x5728b4,_0x730bc0=_0x259b7b/_0x160ecf,_0x2e150e=renderTimeAxis({'startTime':_0x5728b4,'endTime':_0x2ac617,'durationMs':_0x259b7b,'msPerChar':_0x730bc0},_0x160ecf),_0x48dccc=[];for(const _0x69758 of _0x290a9f[_0x35528a(0x1ed)]()){_0x48dccc[_0x35528a(0x1b8)](..._0x69758);}_0x48dccc[_0x35528a(0x22f)]((_0x5bc445,_0x556b9c)=>_0x556b9c[_0x35528a(0x2e2)]-_0x5bc445[_0x35528a(0x2e2)]);const _0x4453e4=new Date(_0x5728b4),_0x2a91c5=formatDate(_0x4453e4),_0x4eeb88=_0x8b9b27+TIMELINE_CONFIG[_0x35528a(0x267)]+TIMELINE_CONFIG['ICON_SPACING']+_0x489d2e,_0xba22f1='\x20'[_0x35528a(0x1d2)](_0x4eeb88-_0x2a91c5[_0x35528a(0x2f2)]),_0x4d4201=_0xba22f1+a47_0x59ff5e[_0x35528a(0x2b8)](_0x2a91c5)+'\x20'+_0x2e150e;_0x3d5001[_0x35528a(0x1b8)](_0x4d4201);const _0x25bd1e=0x16;let _0x31689b=0x0;for(const _0xf7bc19 of _0x48dccc){const _0x43e2f9=_0xf7bc19[_0x35528a(0x231)][_0x35528a(0x196)]?.['name']||'?',_0x3972ab=Math[_0x35528a(0x1c1)](stringWidth(_0x43e2f9),_0x25bd1e);_0x31689b=Math[_0x35528a(0x2f4)](_0x31689b,_0x3972ab);}for(const _0x2a42b0 of _0x48dccc){const {session:_0x38d9cf,startTime:_0x5ca227,endTime:_0x40bc44,duration:_0x46672c}=_0x2a42b0,_0x293961=_0x38d9cf[_0x35528a(0x196)]?.['id'],_0x47ba5c=_0x38d9cf['id'],_0x2e3be3=_0x38d9cf['project']?.['name']||'?',_0x26c982=_0x38d9cf['workflow']?.[_0x35528a(0x31f)]||'?';let _0x545b9b,_0x2f9e92;if(_0x38d9cf['lastAttempt']){const _0x5a6ca2=_0x38d9cf[_0x35528a(0x2ab)];!_0x5a6ca2['done']?(_0x545b9b=_0x5a6ca2[_0x35528a(0x2d7)]?'🛑':'🔄',_0x2f9e92=_0x5a6ca2[_0x35528a(0x2d7)]?a47_0x59ff5e['yellow']:a47_0x59ff5e['blue']):(_0x545b9b=_0x5a6ca2[_0x35528a(0x31d)]?'✅':'❌',_0x2f9e92=_0x5a6ca2[_0x35528a(0x31d)]?a47_0x59ff5e['green']:a47_0x59ff5e[_0x35528a(0x247)]);}else _0x545b9b='⏳',_0x2f9e92=a47_0x59ff5e[_0x35528a(0x2b8)];const _0x4b57d5='#'+_0x47ba5c,_0x37af54=_0x293961?hyperlink(_0x4b57d5,getWorkflowSessionUrl(_0x325bc6,_0x293961,_0x47ba5c)):_0x4b57d5;let _0x304ba2=_0x2e3be3;stringWidth(_0x2e3be3)>_0x25bd1e&&(_0x304ba2=_0x2e3be3[_0x35528a(0x2b0)](0x0,_0x25bd1e-0x1)+'…');const _0x1486a2=a47_0x59ff5e[_0x35528a(0x2b8)](_0x304ba2),_0x1df9da=stringWidth(_0x304ba2),_0x48b560='\x20'[_0x35528a(0x1d2)](_0x31689b-stringWidth(_0x304ba2)+0x2),_0x31c23e='('+formatElapsed(_0x46672c)+')',_0x47cf9d=stringWidth(_0x31c23e),_0xbfc58=stringWidth(_0x4b57d5),_0x4d5fae=_0xbfc58+0x1+_0x1df9da+_0x48b560[_0x35528a(0x2f2)],_0x1a16cd=_0x489d2e-_0x4d5fae-_0x47cf9d-0x1-0x8;let _0x23e467=_0x26c982;stringWidth(_0x23e467)>_0x1a16cd&&(_0x23e467=_0x23e467[_0x35528a(0x2b0)](0x0,_0x1a16cd-0x1)+'…');const _0x31d41e=_0x37af54+'\x20'+_0x1486a2+_0x48b560+_0x23e467,_0x19d2ec=stringWidth(_0x31d41e),_0x53dd88=_0x489d2e-_0x19d2ec-_0x47cf9d,_0x1325df=_0x31d41e+'\x20'[_0x35528a(0x1d2)](Math[_0x35528a(0x2f4)](0x1,_0x53dd88))+a47_0x59ff5e[_0x35528a(0x2b8)](_0x31c23e),_0x161dcd=Math[_0x35528a(0x19a)]((_0x5ca227-_0x5728b4)/_0x730bc0),_0x364155=Math[_0x35528a(0x19a)]((_0x40bc44-_0x5728b4)/_0x730bc0),_0x2c400f=Math[_0x35528a(0x2f4)](_0x161dcd+0x1,_0x364155),_0x511ad6=new Array(_0x160ecf)[_0x35528a(0x2ba)]('\x20');for(let _0x5cfdff=_0x161dcd;_0x5cfdff<Math[_0x35528a(0x1c1)](_0x2c400f,_0x160ecf);_0x5cfdff++){_0x511ad6[_0x5cfdff]='─';}const _0x402307=_0x511ad6[_0x35528a(0x202)](_0x3d9730=>_0x3d9730==='\x20'?'\x20':_0x2f9e92(_0x3d9730))[_0x35528a(0x1fb)]('');_0x3d5001['push'](_0x545b9b+'\x20'+_0x1325df+'│'+_0x402307+'│');}return _0x3d5001['join']('\x0a');}async[a47_0x4daf2f(0x19f)](_0x42738d,_0x482101,_0x23dce9){const _0x45bed6=a47_0x4daf2f,{options:_0x17cfb7,tdx:_0x3623cb}=_0x482101,_0x5dd790=_0x17cfb7[_0x45bed6(0x1ea)],{timelineRows:_0x504d01,timeAxisHeader:_0x20485a}=this['generateSessionTimelineRows'](_0x42738d,_0x5dd790),_0x2b62cf=_0x504d01[_0x45bed6(0x297)](_0x552876=>_0x552876['attemptId']);if(_0x2b62cf[_0x45bed6(0x2f2)]===0x0){const _0x57b8cc=this[_0x45bed6(0x2b3)](_0x42738d,_0x5dd790);console[_0x45bed6(0x18b)](_0x57b8cc);!_0x23dce9&&(console[_0x45bed6(0x1ef)](''),console[_0x45bed6(0x1ef)](a47_0x59ff5e[_0x45bed6(0x2b8)](_0x45bed6(0x1dd))),console[_0x45bed6(0x1ef)](a47_0x59ff5e[_0x45bed6(0x2b8)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a47_0x59ff5e['dim'](_0x45bed6(0x2ed))));return;}_0x20485a&&console[_0x45bed6(0x18b)](_0x20485a);const _0x22c3b4=_0x504d01[_0x45bed6(0x297)](_0x20cc5f=>_0x20cc5f['attemptId'])[_0x45bed6(0x202)](_0x34ab4e=>({'title':_0x34ab4e['displayLine'],'value':_0x34ab4e[_0x45bed6(0x20c)]})),_0x194723=process[_0x45bed6(0x314)][_0x45bed6(0x1e8)]||0x3c,_0x4a10f0=Math[_0x45bed6(0x2f4)](0x28,Math['floor'](_0x194723*0x2/0x3)),_0x3c05e4=await a47_0x20f678({'type':_0x45bed6(0x1b1),'name':_0x45bed6(0x20c),'message':_0x45bed6(0x2c1),'choices':_0x22c3b4,'initial':-0x1,'limit':_0x4a10f0,'clearFirst':!![],'fallback':{'title':_0x45bed6(0x192),'value':null},'suggest':(_0x3e45e1,_0x2c25e1)=>{const _0x5571a3=_0x45bed6;if(!_0x3e45e1)return Promise[_0x5571a3(0x2f7)](_0x2c25e1);const _0x8e9039=_0x2c25e1['filter'](_0x4e22d9=>{const _0x4b14a0=_0x5571a3,_0x3c828f=_0x4e22d9;return _0x3c828f[_0x4b14a0(0x1f2)][_0x4b14a0(0x180)]()[_0x4b14a0(0x27f)](_0x3e45e1[_0x4b14a0(0x180)]());});return Promise['resolve'](_0x8e9039);}}),_0x5958b0=()=>{const _0x57b890=_0x45bed6;process[_0x57b890(0x314)][_0x57b890(0x200)]('\x1b[1A\x1b[2K'),process[_0x57b890(0x314)][_0x57b890(0x200)]('\x1b[1A\x1b[2K'),process[_0x57b890(0x314)][_0x57b890(0x200)]('\x1b[1A\x1b[2K');},_0x57cea4=_0x3c05e4&&_0x3c05e4[_0x45bed6(0x20c)]&&_0x3c05e4[_0x45bed6(0x20c)]!==null&&_0x3c05e4[_0x45bed6(0x20c)][_0x45bed6(0x18f)]()!=='';if(!_0x57cea4){_0x5958b0(),console['log'](a47_0x59ff5e['dim'](_0x45bed6(0x31e)));return;}_0x5958b0();const _0x202178=_0x42738d['find'](_0x3cba64=>_0x3cba64['lastAttempt']?.['id']===_0x3c05e4[_0x45bed6(0x20c)]);if(_0x202178){const _0x376e62=_0x202178[_0x45bed6(0x196)]?.[_0x45bed6(0x31f)]||'?',_0x16ed71=_0x202178['workflow']?.[_0x45bed6(0x31f)]||'?';console[_0x45bed6(0x18b)](_0x45bed6(0x2a8)+a47_0x59ff5e[_0x45bed6(0x2b8)](_0x376e62)+_0x45bed6(0x1a5)+a47_0x59ff5e[_0x45bed6(0x2b8)](_0x16ed71));}const _0x9a0e6e=new WorkflowTimelineCommand();await _0x9a0e6e['execute']({'args':[],'options':{..._0x17cfb7,'attemptId':_0x3c05e4[_0x45bed6(0x20c)]},'tdx':_0x3623cb});}[a47_0x4daf2f(0x17a)](_0x1b6f2a,_0x3b296a){const _0x37f107=a47_0x4daf2f,_0x2f38b1=new Map();for(const _0x5d40a0 of _0x1b6f2a){_0x5d40a0['id']&&_0x5d40a0[_0x37f107(0x2ab)]?.['id']&&_0x2f38b1[_0x37f107(0x23d)](_0x5d40a0['id'],_0x5d40a0['lastAttempt']['id']);}const _0x1ab1d8=[];let _0x34f991='';const _0x109425=this[_0x37f107(0x2b3)](_0x1b6f2a,_0x3b296a),_0x2554ca=_0x109425[_0x37f107(0x2a5)]('\x0a');for(const _0x4e72f9 of _0x2554ca){if(_0x4e72f9[_0x37f107(0x270)](_0x37f107(0x1d7))||_0x4e72f9[_0x37f107(0x2c3)](/^\s+\d{4}-\d{2}-\d{2}/))_0x34f991=_0x4e72f9;else{if(_0x4e72f9[_0x37f107(0x2c3)](/^[✅❌🔄🛑⏳]/)){const _0x9798c1=_0x4e72f9[_0x37f107(0x2c3)](/#(\d+)/),_0x46a47c=_0x9798c1?_0x9798c1[0x1]:null,_0x22367a=_0x46a47c?_0x2f38b1[_0x37f107(0x2e7)](_0x46a47c)||null:null,_0x10e9ee=_0x1b6f2a[_0x37f107(0x319)](_0x591691=>_0x591691['id']===_0x46a47c),_0x4d5877=_0x10e9ee?.['project']?.[_0x37f107(0x31f)]||'';_0x1ab1d8[_0x37f107(0x1b8)]({'displayLine':_0x4e72f9,'attemptId':_0x22367a,'projectName':_0x4d5877});}}}return{'timelineRows':_0x1ab1d8,'timeAxisHeader':_0x34f991};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a47_0x4daf2f(0x1cb);[a47_0x4daf2f(0x18a)]=a47_0x4daf2f(0x1af);async[a47_0x4daf2f(0x24b)](_0x5b9885){const _0x35e262=a47_0x4daf2f,{options:_0x486ac3,args:_0x2c9811,tdx:_0x2169da}=_0x5b9885,_0x545c3f=this[_0x35e262(0x2b9)](_0x2c9811,_0x486ac3);if(!_0x545c3f)return 0x1;const {projectName:_0x3f0d80,workflowName:_0x33eb93}=_0x545c3f,_0x176634=_0x486ac3[_0x35e262(0x201)];if(_0x486ac3[_0x35e262(0x1f7)]){if(_0x3f0d80&&_0x33eb93)console[_0x35e262(0x1ef)]('Filter:\x20'+_0x3f0d80+'.'+_0x33eb93);else _0x3f0d80&&console['error'](_0x35e262(0x190)+_0x3f0d80);_0x176634&&console[_0x35e262(0x1ef)](_0x35e262(0x17b));}const _0x137038=await withSpinner(_0x35e262(0x251),()=>_0x2169da[_0x35e262(0x300)][_0x35e262(0x246)]({'projectName':_0x3f0d80,'workflowName':_0x33eb93,'includeRetried':_0x176634,'limit':_0x486ac3['limit']}),{'verbose':_0x486ac3[_0x35e262(0x1f7)]}),_0x307e62=_0x137038[_0x35e262(0x2ca)],_0xbb24cc=_0x486ac3[_0x35e262(0x1e0)]||0x64,_0x37812b=_0x307e62[_0x35e262(0x2f2)]>=_0xbb24cc?a47_0x59ff5e[_0x35e262(0x2b8)](_0x35e262(0x205)):'';console[_0x35e262(0x1ef)](_0x35e262(0x23a)+_0x307e62[_0x35e262(0x2f2)]+_0x35e262(0x260)+(_0x307e62[_0x35e262(0x2f2)]!==0x1?'s':'')+_0x37812b);if(_0x486ac3[_0x35e262(0x223)]===_0x35e262(0x1be)||_0x486ac3[_0x35e262(0x223)]===_0x35e262(0x296)||_0x486ac3[_0x35e262(0x223)]===_0x35e262(0x245))await handleSDKOutput(_0x307e62,_0x486ac3);else{if(_0x307e62['length']===0x0){if(_0x3f0d80&&_0x33eb93)console[_0x35e262(0x18b)]('No\x20attempts\x20found\x20for:\x20'+_0x3f0d80+'.'+_0x33eb93);else _0x3f0d80?console[_0x35e262(0x18b)]('No\x20attempts\x20found\x20in\x20project:\x20'+_0x3f0d80):console[_0x35e262(0x18b)](_0x35e262(0x1a0));}else{const _0x4402ee=_0x486ac3[_0x35e262(0x1ea)],_0x5b94f5=_0x307e62[_0x35e262(0x202)](_0x5e402a=>{const _0x22ae84=_0x35e262,_0x588cc8=a47_0x59ff5e[_0x22ae84(0x2b8)]('#'+_0x5e402a['id']),_0x1eaeec=_0x5e402a[_0x22ae84(0x196)]?.['id'],_0x28f828=_0x5e402a[_0x22ae84(0x283)]||_0x5e402a[_0x22ae84(0x2c8)],_0x3325ff=_0x1eaeec&&_0x28f828?hyperlink(_0x588cc8,getWorkflowAttemptUrl(_0x4402ee,_0x1eaeec,_0x28f828,_0x5e402a['id'])):_0x588cc8,{icon:_0x5b5cd3,text:_0x4e7f42}=getAttemptStatusDisplay(_0x5e402a),_0x57adb2=(_0x5e402a[_0x22ae84(0x196)]?.[_0x22ae84(0x31f)]||'?')+'.'+(_0x5e402a[_0x22ae84(0x300)]?.[_0x22ae84(0x31f)]||'?'),_0x3ceac9=_0x5e402a[_0x22ae84(0x2f9)]?a47_0x59ff5e['dim'](_0x5e402a[_0x22ae84(0x2f9)]):'';return(_0x3325ff+'\x20'+_0x5b5cd3+(_0x4e7f42?'\x20'+_0x4e7f42:'')+'\x20'+_0x57adb2+'\x20'+_0x3ceac9)[_0x22ae84(0x1ba)]();});await writeOutput(_0x5b94f5[_0x35e262(0x1fb)]('\x0a'),_0x486ac3[_0x35e262(0x1d5)],_0x35e262(0x19c));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a47_0x4daf2f(0x31f)]='workflow:attempt';[a47_0x4daf2f(0x18a)]=a47_0x4daf2f(0x1d3);async[a47_0x4daf2f(0x24b)](_0x29e607){const _0x837a42=a47_0x4daf2f,{options:_0x2fc03f,args:_0x4ba139,tdx:_0x131d1c}=_0x29e607,_0x186fcb=_0x4ba139[0x0];if(!_0x186fcb)return console[_0x837a42(0x1ef)](_0x837a42(0x23e)),0x1;_0x2fc03f[_0x837a42(0x1f7)]&&console['error'](_0x837a42(0x17e)+_0x186fcb);const _0x489628=await withSpinner(_0x837a42(0x317),()=>_0x131d1c[_0x837a42(0x300)][_0x837a42(0x19d)](_0x186fcb),{'verbose':_0x2fc03f[_0x837a42(0x1f7)]}),_0x354545=_0x489628[_0x837a42(0x2ca)];let _0xb9b587;!_0x354545[_0x837a42(0x235)]?_0xb9b587=_0x354545[_0x837a42(0x2d7)]?_0x837a42(0x287):'running':_0xb9b587=_0x354545[_0x837a42(0x31d)]?_0x837a42(0x31d):_0x837a42(0x1ef);let _0x1cc3ba;if(_0x354545[_0x837a42(0x2d5)]&&_0x354545[_0x837a42(0x244)]){const _0x2a357c=new Date(_0x354545['createdAt'])[_0x837a42(0x286)](),_0x5bb2c3=new Date(_0x354545[_0x837a42(0x244)])[_0x837a42(0x286)]();_0x1cc3ba=Math[_0x837a42(0x207)]((_0x5bb2c3-_0x2a357c)/0x3e8);}const _0xc4d911={'attempt_id':_0x354545['id'],'status':_0xb9b587,..._0x354545[_0x837a42(0x2cd)]!==undefined&&{'index':_0x354545[_0x837a42(0x2cd)]},..._0x354545[_0x837a42(0x196)]&&{'project':_0x354545[_0x837a42(0x196)][_0x837a42(0x31f)]},..._0x354545[_0x837a42(0x300)]&&{'workflow':_0x354545['workflow'][_0x837a42(0x31f)]},..._0x354545[_0x837a42(0x2c8)]&&{'session_id':_0x354545[_0x837a42(0x2c8)]},..._0x354545[_0x837a42(0x2f9)]&&{'session_time':_0x354545['sessionTime']},..._0x354545[_0x837a42(0x197)]&&{'retry_attempt':_0x354545[_0x837a42(0x197)]},..._0x1cc3ba!==undefined&&{'duration_sec':_0x1cc3ba},..._0x354545['createdAt']&&{'created_at':_0x354545['createdAt']},..._0x354545['finishedAt']&&{'finished_at':_0x354545[_0x837a42(0x244)]},...Object['keys'](_0x354545[_0x837a42(0x310)])[_0x837a42(0x2f2)]>0x0&&{'params':_0x354545[_0x837a42(0x310)]}};return await handleSingleObjectOutput(_0xc4d911,_0x2fc03f),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a47_0x4daf2f(0x31f)]=a47_0x4daf2f(0x17c);['description']=a47_0x4daf2f(0x2fe);async[a47_0x4daf2f(0x24b)](_0x5d5983){const _0x14fbc1=a47_0x4daf2f,{options:_0x23ca23,args:_0x40f53d,tdx:_0x3bcb2d}=_0x5d5983,_0x2d6c23=_0x40f53d[0x0];if(!_0x2d6c23)return console[_0x14fbc1(0x1ef)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x139f4e=_0x23ca23['includeSubtasks'];_0x23ca23[_0x14fbc1(0x1f7)]&&(console[_0x14fbc1(0x1ef)](_0x14fbc1(0x17e)+_0x2d6c23),_0x139f4e&&console[_0x14fbc1(0x1ef)](_0x14fbc1(0x26d)));const _0x9ae71a=await withSpinner(_0x14fbc1(0x1c5),()=>_0x3bcb2d[_0x14fbc1(0x300)][_0x14fbc1(0x2d3)](_0x2d6c23,_0x139f4e||![]),{'verbose':_0x23ca23[_0x14fbc1(0x1f7)]}),_0x4add59=_0x9ae71a[_0x14fbc1(0x2ca)];return console['error']('✔\x20Found\x20'+_0x4add59[_0x14fbc1(0x2f2)]+_0x14fbc1(0x1c3)+(_0x4add59['length']!==0x1?'s':'')),await handleSDKOutput(_0x4add59,_0x23ca23),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a47_0x4daf2f(0x31f)]='workflow:logs';[a47_0x4daf2f(0x18a)]=a47_0x4daf2f(0x272);async[a47_0x4daf2f(0x24b)](_0x5828de){const _0x434942=a47_0x4daf2f,{options:_0xecaf35,args:_0x585ace,tdx:_0x5ca86b}=_0x5828de,_0x4556a0=_0x585ace[0x0];let _0x521831=_0x585ace[0x1];if(!_0x4556a0)return console[_0x434942(0x1ef)](_0x434942(0x23e)),0x1;_0xecaf35['verbose']&&(console[_0x434942(0x1ef)](_0x434942(0x17e)+_0x4556a0),_0x521831&&console[_0x434942(0x1ef)](_0x434942(0x1a7)+_0x521831));const _0x530259=await withSpinner(_0x434942(0x21d),()=>_0x5ca86b[_0x434942(0x300)][_0x434942(0x1b2)](_0x4556a0,_0x521831),{'verbose':_0xecaf35[_0x434942(0x1f7)]}),_0x1ab21e=_0x530259[_0x434942(0x2ca)];if(_0x1ab21e[_0x434942(0x2f2)]===0x0)return console[_0x434942(0x1ef)](_0x434942(0x2cc)),0x0;if(!_0x521831&&(_0xecaf35[_0x434942(0x1be)]||_0xecaf35[_0x434942(0x223)]))return await handleSDKOutput(_0x1ab21e,_0xecaf35),0x0;if(!_0x521831){const _0x21514d=_0x1ab21e['map'](_0x3c1660=>({'title':_0x3c1660[_0x434942(0x28f)]+'\x20('+formatBytes(_0x3c1660['fileSize'])+')','value':_0x3c1660[_0x434942(0x28f)]})),_0x4567b5=await a47_0x20f678({'type':'select','name':'task','message':_0x434942(0x1ce),'choices':_0x21514d});if(!_0x4567b5[_0x434942(0x2fa)])return console[_0x434942(0x1ef)](_0x434942(0x31e)),0x0;_0x521831=_0x4567b5[_0x434942(0x2fa)];}const _0x19080a=await withSpinner(_0x434942(0x2d4),()=>_0x5ca86b[_0x434942(0x300)][_0x434942(0x2c0)](_0x4556a0,_0x521831),{'verbose':_0xecaf35[_0x434942(0x1f7)]}),_0x2b3164=_0x19080a[_0x434942(0x2ca)];return _0x2b3164?console[_0x434942(0x18b)](_0x2b3164):console[_0x434942(0x1ef)](_0x434942(0x26f)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a47_0x4daf2f(0x31f)]=a47_0x4daf2f(0x24f);[a47_0x4daf2f(0x18a)]='Kill\x20a\x20running\x20attempt';async['execute'](_0x4f8f0e){const _0x3c5aa8=a47_0x4daf2f,{options:_0x159300,args:_0x30d452,tdx:_0x23a1e0}=_0x4f8f0e,_0x4fae74=_0x30d452[0x0];if(!_0x4fae74)return console[_0x3c5aa8(0x1ef)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x425d14=_0x159300['reason'];_0x159300[_0x3c5aa8(0x1f7)]&&(console[_0x3c5aa8(0x1ef)](_0x3c5aa8(0x17e)+_0x4fae74),_0x425d14&&console['error'](_0x3c5aa8(0x1d9)+_0x425d14));if(!_0x159300[_0x3c5aa8(0x250)]){if(!isInteractive())return console[_0x3c5aa8(0x1ef)](a47_0x59ff5e[_0x3c5aa8(0x247)](_0x3c5aa8(0x21f)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3c5aa8(0x1ef)](a47_0x59ff5e[_0x3c5aa8(0x2b8)](_0x3c5aa8(0x2f3))),0x1;const _0x55b5e2=await confirmKey(_0x3c5aa8(0x203)+_0x4fae74+'?');if(!_0x55b5e2)return console['error'](a47_0x59ff5e[_0x3c5aa8(0x1f5)](_0x3c5aa8(0x31e))),0x1;}const _0x319625=await withSpinner('Killing\x20attempt...',()=>_0x23a1e0['workflow'][_0x3c5aa8(0x2fd)](_0x4fae74,_0x425d14),{'verbose':_0x159300['verbose']}),_0x46a383=_0x319625[_0x3c5aa8(0x2ca)];return console[_0x3c5aa8(0x1ef)]('✔\x20'+_0x46a383),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a47_0x4daf2f(0x31f)]=a47_0x4daf2f(0x2c9);[a47_0x4daf2f(0x18a)]=a47_0x4daf2f(0x181);async[a47_0x4daf2f(0x24b)](_0x1d441f){const _0xe919ce=a47_0x4daf2f,{options:_0x51d95b,args:_0x23ba3c,tdx:_0x38dcdd}=_0x1d441f,_0x1c8ecb=_0x23ba3c[0x0];if(!_0x1c8ecb)return console[_0xe919ce(0x1ef)](_0xe919ce(0x211)),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x522e52=![],_0x16b890=_0x1c8ecb;if(_0x1c8ecb['startsWith'](_0xe919ce(0x1e7)))_0x522e52=!![],_0x16b890=_0x1c8ecb[_0xe919ce(0x1e1)](0x8);else{if(_0x1c8ecb[_0xe919ce(0x270)]('attempt:'))_0x522e52=![],_0x16b890=_0x1c8ecb['substring'](0x8);else return console[_0xe919ce(0x1ef)](_0xe919ce(0x1fa)),console[_0xe919ce(0x1ef)](_0xe919ce(0x2a6)),0x1;}const _0x58b879=_0x51d95b[_0xe919ce(0x2de)],_0x360d1c=_0x51d95b[_0xe919ce(0x1c0)],_0x2e9034=_0x51d95b[_0xe919ce(0x310)],_0x5e55ef=_0x51d95b[_0xe919ce(0x1a1)];_0x51d95b['verbose']&&(console[_0xe919ce(0x1ef)](_0xe919ce(0x2dd)+(_0x522e52?'session':_0xe919ce(0x19d))+'\x20'+_0x16b890),_0x58b879&&console[_0xe919ce(0x1ef)](_0xe919ce(0x293)+_0x58b879),_0x360d1c&&console[_0xe919ce(0x1ef)](_0xe919ce(0x187)+_0x360d1c),_0x2e9034&&console[_0xe919ce(0x1ef)](_0xe919ce(0x2cf)+_0x2e9034),_0x5e55ef&&console[_0xe919ce(0x1ef)](_0xe919ce(0x175)));let _0x21c2c4;if(_0x2e9034)try{if(_0x2e9034['startsWith']('@')){const _0x101242=await import(_0xe919ce(0x2c4)),_0x757b17=_0x2e9034[_0xe919ce(0x1e1)](0x1),_0x1e6f07=await _0x101242[_0xe919ce(0x1c7)](_0x757b17,_0xe919ce(0x279));_0x21c2c4=JSON[_0xe919ce(0x1ca)](_0x1e6f07);}else _0x21c2c4=JSON[_0xe919ce(0x1ca)](_0x2e9034);}catch{return console[_0xe919ce(0x1ef)](_0xe919ce(0x18e)),0x1;}if(!_0x51d95b[_0xe919ce(0x250)]){if(!isInteractive())return console['error'](a47_0x59ff5e['red'](_0xe919ce(0x21f)),_0xe919ce(0x1ac)),console['error'](a47_0x59ff5e[_0xe919ce(0x2b8)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x212b17=await confirmKey(_0xe919ce(0x1f4)+(_0x522e52?_0xe919ce(0x231):'attempt')+'\x20'+_0x16b890+'?');if(!_0x212b17)return console['error'](a47_0x59ff5e[_0xe919ce(0x1f5)](_0xe919ce(0x31e))),0x1;}let _0x51e09b;_0x522e52?_0x51e09b=await withSpinner(_0xe919ce(0x327),()=>_0x38dcdd['workflow'][_0xe919ce(0x24c)](_0x16b890,{'fromTask':_0x58b879,'retryParams':_0x21c2c4}),{'verbose':_0x51d95b[_0xe919ce(0x1f7)]}):_0x51e09b=await withSpinner(_0xe919ce(0x29b),()=>_0x38dcdd['workflow'][_0xe919ce(0x1ad)](_0x16b890,{'resumeFrom':_0x360d1c,'retryParams':_0x21c2c4,'force':_0x5e55ef}),{'verbose':_0x51d95b[_0xe919ce(0x1f7)]});const _0x3e74bb=_0x51e09b[_0xe919ce(0x2ca)];return console[_0xe919ce(0x1ef)](_0xe919ce(0x1e2)),console[_0xe919ce(0x1ef)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x3e74bb[_0xe919ce(0x20c)]),console[_0xe919ce(0x1ef)](_0xe919ce(0x22c)+_0x3e74bb['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a47_0x4daf2f(0x288);[a47_0x4daf2f(0x18a)]=a47_0x4daf2f(0x1c8);async[a47_0x4daf2f(0x24b)](_0x307950){const _0x4daabe=a47_0x4daf2f,{options:_0x3f1c64,args:_0x465476,tdx:_0x3b41db}=_0x307950;let _0x577f3e=_0x465476[0x0];if(!_0x577f3e){const _0x511738=this[_0x4daabe(0x262)]([],_0x3f1c64),_0x31fd44=await withSpinner(_0x4daabe(0x281),()=>_0x3b41db['workflow']['workflows'](_0x511738,{'limit':_0x3f1c64['limit']}),{'verbose':_0x3f1c64[_0x4daabe(0x1f7)]}),_0x504b9e=_0x31fd44[_0x4daabe(0x2ca)];if(_0x504b9e[_0x4daabe(0x2f2)]===0x0)return console[_0x4daabe(0x1ef)]('No\x20workflows\x20found'),!_0x511738&&console['error'](a47_0x59ff5e[_0x4daabe(0x2b8)](_0x4daabe(0x2bd))),0x1;const _0x49b9c6=_0x504b9e[_0x4daabe(0x202)](_0x481850=>({'title':_0x481850[_0x4daabe(0x196)]?.[_0x4daabe(0x31f)]+'.'+_0x481850[_0x4daabe(0x31f)],'value':_0x481850['project']?.['name']+'.'+_0x481850[_0x4daabe(0x31f)],'description':_0x481850['revision']?_0x4daabe(0x2eb)+_0x481850[_0x4daabe(0x268)]:undefined})),_0x32499c=await a47_0x20f678({'type':'select','name':_0x4daabe(0x300),'message':_0x4daabe(0x30b),'choices':_0x49b9c6});if(!_0x32499c['workflow'])return 0x1;_0x577f3e=_0x32499c[_0x4daabe(0x300)];}if(!_0x577f3e[_0x4daabe(0x27f)]('.')){const _0x1e4cba=this[_0x4daabe(0x262)]([],_0x3f1c64);if(_0x1e4cba)_0x577f3e=_0x1e4cba+'.'+_0x577f3e;else return console[_0x4daabe(0x1ef)](a47_0x59ff5e[_0x4daabe(0x247)](_0x4daabe(0x20b)),_0x4daabe(0x183)),console[_0x4daabe(0x1ef)](a47_0x59ff5e['dim'](_0x4daabe(0x2bd))),0x1;}const _0x10be1b=_0x3f1c64['param'],_0x213302=_0x3f1c64[_0x4daabe(0x2f9)],_0x2fa01e={};if(_0x10be1b&&Array[_0x4daabe(0x23f)](_0x10be1b))for(const _0x380c96 of _0x10be1b){const _0x3cfdf9=_0x380c96[_0x4daabe(0x189)]('=');if(_0x3cfdf9===-0x1)return console['error'](_0x4daabe(0x1ec)+_0x380c96),console['error'](_0x4daabe(0x29e)),0x1;const _0x1845b6=_0x380c96[_0x4daabe(0x1e1)](0x0,_0x3cfdf9),_0x26fd94=_0x380c96['substring'](_0x3cfdf9+0x1);try{_0x2fa01e[_0x1845b6]=JSON[_0x4daabe(0x1ca)](_0x26fd94);}catch{_0x2fa01e[_0x1845b6]=_0x26fd94;}}_0x3f1c64['verbose']&&(console[_0x4daabe(0x1ef)](_0x4daabe(0x216)+_0x577f3e),Object[_0x4daabe(0x2ad)](_0x2fa01e)[_0x4daabe(0x2f2)]>0x0&&console['error'](_0x4daabe(0x2fc)+JSON[_0x4daabe(0x311)](_0x2fa01e)),_0x213302&&console[_0x4daabe(0x1ef)](_0x4daabe(0x29d)+_0x213302));const _0x5a6ad7=await withSpinner(_0x4daabe(0x230),()=>_0x3b41db[_0x4daabe(0x300)]['run'](_0x577f3e,_0x2fa01e,{'sessionTime':_0x213302}),{'verbose':_0x3f1c64['verbose']}),_0x2fa43a=_0x5a6ad7[_0x4daabe(0x2ca)];console[_0x4daabe(0x1ef)]('✔\x20Workflow\x20run\x20started'),console['error'](_0x4daabe(0x2e9)+_0x2fa43a['id']),console[_0x4daabe(0x1ef)](_0x4daabe(0x22c)+_0x2fa43a['sessionId']),console[_0x4daabe(0x1ef)](_0x4daabe(0x2e1)+_0x2fa43a[_0x4daabe(0x196)]?.['name']),console['error'](_0x4daabe(0x2d8)+_0x2fa43a[_0x4daabe(0x300)]?.['name']);if(_0x2fa43a['project']?.['id']&&_0x2fa43a[_0x4daabe(0x2c8)]&&_0x2fa43a['id']){const _0x386d36=_0x3f1c64[_0x4daabe(0x1ea)],_0x5e8f72=getConsoleUrl(_0x386d36,_0x4daabe(0x2ac)+_0x2fa43a[_0x4daabe(0x196)]['id']+_0x4daabe(0x2be)+_0x2fa43a[_0x4daabe(0x2c8)]+'/attempt/'+_0x2fa43a['id']);console[_0x4daabe(0x1ef)](_0x4daabe(0x1d4)+a47_0x59ff5e['cyan'](_0x5e8f72));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a47_0x4daf2f(0x31f)]=a47_0x4daf2f(0x2b6);['description']=a47_0x4daf2f(0x1d6);async[a47_0x4daf2f(0x24b)](_0x2c7116){const _0x4734f9=a47_0x4daf2f,{options:_0xbba1f3,args:_0x246ab1,tdx:_0xd1405e}=_0x2c7116,_0x1e3a94=_0x246ab1[0x0],_0x51aa04=_0x246ab1[0x1]||'.';if(!_0x1e3a94)return console[_0x4734f9(0x1ef)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x4734f9(0x1ef)](_0x4734f9(0x236)),0x1;const _0x938338=_0xbba1f3[_0x4734f9(0x268)];_0xbba1f3[_0x4734f9(0x1f7)]&&(console['error']('Project:\x20'+_0x1e3a94),console['error'](_0x4734f9(0x2b1)+_0x51aa04),_0x938338&&console[_0x4734f9(0x1ef)](_0x4734f9(0x280)+_0x938338));const _0x2c2fd2=await withSpinner(_0x4734f9(0x25a)+_0x1e3a94+_0x4734f9(0x1fe),()=>_0xd1405e[_0x4734f9(0x300)][_0x4734f9(0x28e)](_0x1e3a94,_0x51aa04,{'revision':_0x938338}),{'verbose':_0xbba1f3['verbose']}),_0x31f085=_0x2c2fd2[_0x4734f9(0x2ca)];return console[_0x4734f9(0x1ef)]('✔\x20Downloaded\x20'+_0x31f085['projectName']),console[_0x4734f9(0x1ef)]('\x20\x20Revision:\x20'+_0x31f085[_0x4734f9(0x268)]),console[_0x4734f9(0x1ef)](_0x4734f9(0x252)+_0x31f085[_0x4734f9(0x2bc)]),console[_0x4734f9(0x1ef)](_0x4734f9(0x1c2)+_0x51aa04+'/'+_0x31f085['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a47_0x4daf2f(0x2c2);[a47_0x4daf2f(0x18a)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async[a47_0x4daf2f(0x24b)](_0x4595cf){const _0x2fd425=a47_0x4daf2f,{options:_0x213514,args:_0x456fe5,tdx:_0x2ee006}=_0x4595cf;let _0x26e447='.',_0x2ab5bc=_0x213514[_0x2fd425(0x31f)];if(_0x456fe5[0x0]){const {promises:_0x50b67c}=await import('fs');try{const _0x493fa6=await _0x50b67c[_0x2fd425(0x194)](_0x456fe5[0x0]);if(_0x493fa6[_0x2fd425(0x309)]())_0x26e447=_0x456fe5[0x0];else return console[_0x2fd425(0x1ef)](_0x2fd425(0x291)+_0x456fe5[0x0]+_0x2fd425(0x1c9)),0x1;}catch{_0x2ab5bc=_0x456fe5[0x0],_0x26e447='.';}}const _0x209967=_0x213514[_0x2fd425(0x268)],_0x29ed1f=_0x213514[_0x2fd425(0x289)];_0x213514[_0x2fd425(0x1f7)]&&(console[_0x2fd425(0x1ef)](_0x2fd425(0x264)+_0x26e447),_0x2ab5bc&&console[_0x2fd425(0x1ef)](_0x2fd425(0x21a)+_0x2ab5bc),_0x209967&&console['error']('Revision:\x20'+_0x209967),_0x29ed1f&&console[_0x2fd425(0x1ef)](_0x2fd425(0x2fb)));const _0x519cb8=await withSpinner(_0x2fd425(0x23b),()=>_0x2ee006[_0x2fd425(0x300)][_0x2fd425(0x1b8)](_0x26e447,{'projectName':_0x2ab5bc,'revision':_0x209967,'skipValidation':_0x29ed1f}),{'verbose':_0x213514[_0x2fd425(0x1f7)]}),_0x29c41c=_0x519cb8['data'];return console[_0x2fd425(0x1ef)](_0x2fd425(0x28b)+_0x29c41c[_0x2fd425(0x1ff)]),console['error'](_0x2fd425(0x1df)+_0x29c41c[_0x2fd425(0x29c)]),console[_0x2fd425(0x1ef)](_0x2fd425(0x2d1)+_0x29c41c[_0x2fd425(0x268)]),await this['showWorkflowConsoleUrl'](_0x2ee006,_0x29c41c[_0x2fd425(0x1ff)],_0x213514[_0x2fd425(0x1ea)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a47_0x4daf2f(0x195);[a47_0x4daf2f(0x18a)]=a47_0x4daf2f(0x326);async['execute'](_0x1b5f1a){const _0x10e0c7=a47_0x4daf2f,{options:_0x5378a4,args:_0x1cb4e3,tdx:_0x2b811e}=_0x1b5f1a,_0x29326e=_0x1cb4e3[0x0],_0xae42e2=_0x1cb4e3[0x1];if(!_0x29326e)return console[_0x10e0c7(0x1ef)](a47_0x59ff5e[_0x10e0c7(0x247)](_0x10e0c7(0x20b)),_0x10e0c7(0x185)),console[_0x10e0c7(0x1ef)](a47_0x59ff5e[_0x10e0c7(0x2b8)](_0x10e0c7(0x318))),0x1;const _0x2d4bd1=_0x5378a4[_0x10e0c7(0x268)];_0x5378a4[_0x10e0c7(0x1f7)]&&(console['error'](_0x10e0c7(0x2a8)+_0x29326e),_0xae42e2&&console[_0x10e0c7(0x1ef)]('Target\x20directory:\x20'+_0xae42e2),_0x2d4bd1&&console[_0x10e0c7(0x1ef)](_0x10e0c7(0x280)+_0x2d4bd1),_0x5378a4[_0x10e0c7(0x171)]&&console[_0x10e0c7(0x1ef)](_0x10e0c7(0x320)));const _0x1fba7f=await withSpinner(_0x10e0c7(0x178)+_0x29326e+_0x10e0c7(0x1fe),()=>_0x2b811e[_0x10e0c7(0x300)][_0x10e0c7(0x229)](_0x29326e,{'targetDir':_0xae42e2,'revision':_0x2d4bd1}),{'verbose':_0x5378a4[_0x10e0c7(0x1f7)]}),_0x30bc30=_0x1fba7f['data'];_0x30bc30[_0x10e0c7(0x2ef)]?console[_0x10e0c7(0x1ef)](_0x10e0c7(0x294)+_0x30bc30[_0x10e0c7(0x1ff)]):console[_0x10e0c7(0x1ef)](_0x10e0c7(0x265)+_0x30bc30[_0x10e0c7(0x1ff)]);console[_0x10e0c7(0x1ef)](_0x10e0c7(0x2d1)+_0x30bc30['revision']),console[_0x10e0c7(0x1ef)](_0x10e0c7(0x2c5)+(a47_0x32b188['relative'](process[_0x10e0c7(0x1ee)](),_0x30bc30[_0x10e0c7(0x1fd)])||'.')),console['error'](_0x10e0c7(0x2f1)+a47_0x59ff5e[_0x10e0c7(0x2f0)]('+'+_0x30bc30[_0x10e0c7(0x27d)][_0x10e0c7(0x2ea)]+'\x20new')+',\x20'+(a47_0x59ff5e['yellow']('~'+_0x30bc30['summary'][_0x10e0c7(0x1c6)]+'\x20modified')+',\x20')+(a47_0x59ff5e['red']('-'+_0x30bc30[_0x10e0c7(0x27d)][_0x10e0c7(0x240)]+'\x20deleted')+',\x20')+(''+a47_0x59ff5e['dim'](_0x30bc30[_0x10e0c7(0x27d)][_0x10e0c7(0x2e5)]+_0x10e0c7(0x2e6))));for(const _0x53bfe1 of _0x30bc30[_0x10e0c7(0x20f)]){_0x53bfe1[_0x10e0c7(0x31a)]===_0x10e0c7(0x1c6)&&_0x53bfe1['diff']&&(console[_0x10e0c7(0x1ef)]('\x0a'+a47_0x59ff5e['cyan'](_0x10e0c7(0x1b4)+_0x53bfe1[_0x10e0c7(0x1b5)])),console['error'](_0x53bfe1['diff']));}if(!_0x30bc30['hasChanges'])return saveSessionContext({'workflow_project':_0x30bc30[_0x10e0c7(0x1ff)]},_0x5378a4[_0x10e0c7(0x231)]),console[_0x10e0c7(0x1ef)](a47_0x59ff5e['green'](_0x10e0c7(0x2d0))),console[_0x10e0c7(0x1ef)](a47_0x59ff5e[_0x10e0c7(0x2b8)](_0x10e0c7(0x308)+_0x30bc30['projectName'])),0x0;if(_0x5378a4[_0x10e0c7(0x171)])return console[_0x10e0c7(0x1ef)](a47_0x59ff5e[_0x10e0c7(0x1f5)](_0x10e0c7(0x27a))),0x0;if(!_0x5378a4[_0x10e0c7(0x250)]){if(!isInteractive())return console['error'](a47_0x59ff5e[_0x10e0c7(0x247)]('\x0aError:'),_0x10e0c7(0x1ac)),console['error'](a47_0x59ff5e[_0x10e0c7(0x2b8)](_0x10e0c7(0x2f3))),0x1;const _0x4dbbee=await confirmKey(_0x10e0c7(0x2c7));if(!_0x4dbbee)return console[_0x10e0c7(0x1ef)](a47_0x59ff5e[_0x10e0c7(0x1f5)]('Cancelled'),_0x10e0c7(0x24e)),0x1;}await withSpinner(_0x10e0c7(0x2f5),()=>_0x2b811e['workflow'][_0x10e0c7(0x174)](_0x30bc30,{'revision':_0x2d4bd1}),{'verbose':_0x5378a4['verbose']}),saveSessionContext({'workflow_project':_0x30bc30[_0x10e0c7(0x1ff)]},_0x5378a4[_0x10e0c7(0x231)]),console[_0x10e0c7(0x1ef)](a47_0x59ff5e[_0x10e0c7(0x2f0)]('✔\x20Pull\x20complete'));const _0x56e3ba=a47_0x32b188[_0x10e0c7(0x292)](process[_0x10e0c7(0x1ee)](),_0x30bc30[_0x10e0c7(0x1fd)])||'.';return console[_0x10e0c7(0x1ef)](a47_0x59ff5e[_0x10e0c7(0x2b8)]('\x20\x20Location:\x20'+_0x56e3ba)),console[_0x10e0c7(0x1ef)](a47_0x59ff5e[_0x10e0c7(0x2b8)](_0x10e0c7(0x308)+_0x30bc30[_0x10e0c7(0x1ff)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a47_0x4daf2f(0x31f)]=a47_0x4daf2f(0x2ee);[a47_0x4daf2f(0x18a)]=a47_0x4daf2f(0x1e3);async[a47_0x4daf2f(0x24b)](_0x15693d){const _0x736345=a47_0x4daf2f,{options:_0x2bbd3c,args:_0x2a8a01,tdx:_0x148c5b}=_0x15693d,_0x4b7e45=this[_0x736345(0x2bb)](_0x2a8a01,_0x2bbd3c),_0x57489e=_0x2bbd3c['revision'],_0x5b5f5e=_0x2bbd3c[_0x736345(0x289)];_0x2bbd3c[_0x736345(0x1f7)]&&(_0x4b7e45&&console[_0x736345(0x1ef)](_0x736345(0x302)+_0x4b7e45),_0x57489e&&console['error'](_0x736345(0x280)+_0x57489e),_0x2bbd3c[_0x736345(0x171)]&&console[_0x736345(0x1ef)](_0x736345(0x320)),_0x5b5f5e&&console['error'](_0x736345(0x2fb)));let _0x5e2966;try{_0x5e2966=await withSpinner(_0x736345(0x282),()=>_0x148c5b[_0x736345(0x300)]['preparePushProject']({'sourceDir':_0x4b7e45,'revision':_0x57489e,'skipValidation':_0x5b5f5e}),{'verbose':_0x2bbd3c[_0x736345(0x1f7)]});}catch(_0x36c235){if(_0x36c235 instanceof Error&&_0x36c235[_0x736345(0x271)]['includes'](_0x736345(0x25e)))return console[_0x736345(0x1ef)](a47_0x59ff5e[_0x736345(0x247)](_0x736345(0x20b)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x2bbd3c[_0x736345(0x239)]?console[_0x736345(0x1ef)](a47_0x59ff5e[_0x736345(0x2b8)](_0x736345(0x301)+_0x2bbd3c[_0x736345(0x239)]+_0x736345(0x20e)+_0x2bbd3c[_0x736345(0x239)]+'\x27')):console[_0x736345(0x1ef)](a47_0x59ff5e[_0x736345(0x2b8)](_0x736345(0x290))),0x1;throw _0x36c235;}const _0x4ec805=_0x5e2966['data'];console[_0x736345(0x1ef)](_0x736345(0x218)+_0x4ec805['projectName']),console[_0x736345(0x1ef)](_0x736345(0x273)+_0x4ec805[_0x736345(0x18c)]),console[_0x736345(0x1ef)]('\x20\x20Revision:\x20'+_0x4ec805['revision']),console[_0x736345(0x1ef)](_0x736345(0x2f1)+a47_0x59ff5e[_0x736345(0x2f0)]('+'+_0x4ec805[_0x736345(0x27d)][_0x736345(0x2ea)]+'\x20new')+',\x20'+(a47_0x59ff5e[_0x736345(0x1f5)]('~'+_0x4ec805[_0x736345(0x27d)][_0x736345(0x1c6)]+'\x20modified')+',\x20')+(a47_0x59ff5e[_0x736345(0x247)]('-'+_0x4ec805[_0x736345(0x27d)][_0x736345(0x240)]+_0x736345(0x2dc))+',\x20')+(''+a47_0x59ff5e[_0x736345(0x2b8)](_0x4ec805[_0x736345(0x27d)][_0x736345(0x2e5)]+_0x736345(0x2e6))));for(const _0xf09215 of _0x4ec805[_0x736345(0x20f)]){_0xf09215[_0x736345(0x31a)]===_0x736345(0x1c6)&&_0xf09215[_0x736345(0x27b)]&&(console[_0x736345(0x1ef)]('\x0a'+a47_0x59ff5e[_0x736345(0x2a9)](_0x736345(0x1b4)+_0xf09215[_0x736345(0x1b5)])),console[_0x736345(0x1ef)](_0xf09215[_0x736345(0x27b)]));}if(!_0x4ec805[_0x736345(0x269)])return console['error'](a47_0x59ff5e[_0x736345(0x2f0)](_0x736345(0x212))),await this[_0x736345(0x1a8)](_0x148c5b,_0x4ec805[_0x736345(0x1ff)],_0x2bbd3c['site']),0x0;if(_0x2bbd3c[_0x736345(0x171)])return console[_0x736345(0x1ef)](a47_0x59ff5e[_0x736345(0x1f5)](_0x736345(0x243))),0x0;if(!_0x2bbd3c[_0x736345(0x250)]){if(!isInteractive())return console['error'](a47_0x59ff5e[_0x736345(0x247)](_0x736345(0x21f)),_0x736345(0x1ac)),console[_0x736345(0x1ef)](a47_0x59ff5e['dim'](_0x736345(0x2f3))),0x1;const _0xbf7e83=await confirmKey(_0x736345(0x258));if(!_0xbf7e83)return console[_0x736345(0x1ef)](a47_0x59ff5e[_0x736345(0x1f5)](_0x736345(0x31e)),_0x736345(0x177)),0x1;}const _0x373fb7=await withSpinner('Pushing\x20project...',()=>_0x148c5b[_0x736345(0x300)][_0x736345(0x2b4)](_0x4ec805),{'verbose':_0x2bbd3c[_0x736345(0x1f7)]}),_0x28f15e=_0x373fb7[_0x736345(0x2ca)];return console[_0x736345(0x1ef)](a47_0x59ff5e[_0x736345(0x2f0)](_0x736345(0x1d8))),console['error'](_0x736345(0x1df)+_0x28f15e[_0x736345(0x29c)]),console[_0x736345(0x1ef)](_0x736345(0x2d1)+_0x28f15e[_0x736345(0x268)]),await this[_0x736345(0x1a8)](_0x148c5b,_0x28f15e['projectName'],_0x2bbd3c[_0x736345(0x1ea)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a47_0x4daf2f(0x31f)]=a47_0x4daf2f(0x31c);[a47_0x4daf2f(0x18a)]=a47_0x4daf2f(0x306);async[a47_0x4daf2f(0x24b)](_0x16cd24){const _0x113492=a47_0x4daf2f,{options:_0x2854dc,args:_0x48bbcd,tdx:_0x3cedf4}=_0x16cd24,_0x540356=this[_0x113492(0x2bb)](_0x48bbcd,_0x2854dc),_0xa23f03=_0x2854dc['name'],_0x29a647=_0x2854dc[_0x113492(0x268)],_0x584e56=_0x2854dc[_0x113492(0x289)];if(!_0x540356)return console[_0x113492(0x1ef)](a47_0x59ff5e['red'](_0x113492(0x20b)),_0x113492(0x213)),console['error'](a47_0x59ff5e['dim'](_0x113492(0x219))),console[_0x113492(0x1ef)](a47_0x59ff5e[_0x113492(0x2b8)](_0x113492(0x204))),0x1;if(!_0xa23f03)return console[_0x113492(0x1ef)](a47_0x59ff5e[_0x113492(0x247)](_0x113492(0x20b)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x113492(0x1ef)](a47_0x59ff5e[_0x113492(0x2b8)](_0x113492(0x219))),0x1;_0x2854dc[_0x113492(0x1f7)]&&(console[_0x113492(0x1ef)](_0x113492(0x302)+_0x540356),console[_0x113492(0x1ef)](_0x113492(0x1b7)+_0xa23f03),_0x29a647&&console[_0x113492(0x1ef)](_0x113492(0x280)+_0x29a647),_0x2854dc[_0x113492(0x171)]&&console[_0x113492(0x1ef)](_0x113492(0x320)),_0x584e56&&console[_0x113492(0x1ef)](_0x113492(0x2fb)));const _0x6a5f2d=await withSpinner(_0x113492(0x1ab),()=>_0x3cedf4[_0x113492(0x300)][_0x113492(0x1bc)](_0x540356,_0xa23f03,{'revision':_0x29a647,'skipValidation':_0x584e56}),{'verbose':_0x2854dc[_0x113492(0x1f7)]}),_0x1c7f98=_0x6a5f2d['data'];console[_0x113492(0x1ef)](_0x113492(0x226)+_0x1c7f98[_0x113492(0x18c)]);_0x1c7f98[_0x113492(0x1da)]&&console[_0x113492(0x1ef)]('Source\x20project:\x20'+_0x1c7f98['sourceProjectName']);console['error'](_0x113492(0x1b7)+_0x1c7f98[_0x113492(0x1cc)]),console[_0x113492(0x1ef)](_0x113492(0x280)+_0x1c7f98['revision']),console[_0x113492(0x1ef)](_0x113492(0x2ce)+_0x1c7f98[_0x113492(0x249)]);_0x1c7f98[_0x113492(0x1eb)]&&(console[_0x113492(0x1ef)](a47_0x59ff5e[_0x113492(0x1f5)]('\x0a⚠\x20Project\x20\x22'+_0x1c7f98['newProjectName']+'\x22\x20already\x20exists\x20(ID:\x20'+_0x1c7f98[_0x113492(0x25f)]+')')),console[_0x113492(0x1ef)](a47_0x59ff5e[_0x113492(0x1f5)](_0x113492(0x255))));if(_0x2854dc['dryRun'])return console[_0x113492(0x1ef)](a47_0x59ff5e[_0x113492(0x1f5)](_0x113492(0x2ff))),0x0;if(!_0x2854dc[_0x113492(0x250)]){if(!isInteractive())return console[_0x113492(0x1ef)](a47_0x59ff5e[_0x113492(0x247)](_0x113492(0x21f)),_0x113492(0x1ac)),console[_0x113492(0x1ef)](a47_0x59ff5e['dim'](_0x113492(0x2f3))),0x1;const _0x4e28a9=_0x1c7f98['sourceProjectName']||a47_0x32b188[_0x113492(0x2da)](_0x540356),_0x2647a6=_0x1c7f98[_0x113492(0x1eb)]?_0x113492(0x1a3)+_0xa23f03+_0x113492(0x2db):'\x0aClone\x20\x22'+_0x4e28a9+_0x113492(0x30e)+_0xa23f03+'\x22?',_0xbb90c5=await confirmKey(_0x2647a6);if(!_0xbb90c5)return console[_0x113492(0x1ef)](a47_0x59ff5e[_0x113492(0x1f5)](_0x113492(0x31e))),0x1;}const _0x4b67a6=await withSpinner(_0x1c7f98[_0x113492(0x1eb)]?_0x113492(0x312)+_0xa23f03+_0x113492(0x1fe):'Cloning\x20to\x20'+_0xa23f03+_0x113492(0x1fe),()=>_0x3cedf4[_0x113492(0x300)][_0x113492(0x26e)](_0x1c7f98),{'verbose':_0x2854dc['verbose']}),_0x2f7ff1=_0x4b67a6[_0x113492(0x2ca)];return console[_0x113492(0x1ef)](a47_0x59ff5e[_0x113492(0x2f0)](_0x1c7f98[_0x113492(0x1eb)]?_0x113492(0x1bd):_0x113492(0x2aa))),console[_0x113492(0x1ef)]('\x20\x20Project:\x20'+_0x2f7ff1[_0x113492(0x1cc)]),console['error'](_0x113492(0x1df)+_0x2f7ff1[_0x113492(0x1f6)]),console[_0x113492(0x1ef)]('\x20\x20Revision:\x20'+_0x2f7ff1[_0x113492(0x268)]),await this[_0x113492(0x1a8)](_0x3cedf4,_0x2f7ff1[_0x113492(0x1cc)],_0x2854dc[_0x113492(0x1ea)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a47_0x4daf2f(0x1f1);[a47_0x4daf2f(0x18a)]=a47_0x4daf2f(0x2d6);async['execute'](_0x44cdcf){const _0x1715da=a47_0x4daf2f,{options:_0x57a376,args:_0x519a8b,tdx:_0x35d258}=_0x44cdcf,_0x839a25=_0x519a8b[0x0];if(!_0x839a25)return console['error'](_0x1715da(0x266)),console[_0x1715da(0x1ef)](_0x1715da(0x20a)),0x1;_0x57a376['verbose']&&console[_0x1715da(0x1ef)]('Project:\x20'+_0x839a25);if(!_0x57a376[_0x1715da(0x250)]){if(!isInteractive())return console[_0x1715da(0x1ef)](a47_0x59ff5e[_0x1715da(0x247)](_0x1715da(0x21f)),_0x1715da(0x1ac)),console[_0x1715da(0x1ef)](a47_0x59ff5e[_0x1715da(0x2b8)](_0x1715da(0x2f3))),0x1;const _0x4f9ac0=await confirmKey(_0x1715da(0x2ec)+_0x839a25+_0x1715da(0x256));if(!_0x4f9ac0)return console[_0x1715da(0x1ef)](a47_0x59ff5e['yellow']('Cancelled')),0x1;}const _0x3c7d18=await withSpinner(_0x1715da(0x257)+_0x839a25+_0x1715da(0x1fe),()=>_0x35d258[_0x1715da(0x300)][_0x1715da(0x322)](_0x839a25),{'verbose':_0x57a376[_0x1715da(0x1f7)]}),_0x4baca0=_0x3c7d18[_0x1715da(0x2ca)];return console['error'](_0x1715da(0x274)+_0x4baca0[_0x1715da(0x1ff)]),console[_0x1715da(0x1ef)](_0x1715da(0x1df)+_0x4baca0[_0x1715da(0x29c)]),0x0;}}export function parseKeyValue(_0x3a37dc){const _0x25f73c=a47_0x4daf2f,_0x436284=_0x3a37dc['indexOf']('=');if(_0x436284===-0x1)throw new Error(_0x25f73c(0x253)+_0x3a37dc+_0x25f73c(0x2a0));const _0x26f164=_0x3a37dc[_0x25f73c(0x1e1)](0x0,_0x436284),_0x139106=_0x3a37dc['substring'](_0x436284+0x1);if(!_0x26f164)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x26f164,'value':_0x139106};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a47_0x4daf2f(0x221);[a47_0x4daf2f(0x18a)]=a47_0x4daf2f(0x18d);async[a47_0x4daf2f(0x24b)](_0x3308b0){const _0x3faa9d=a47_0x4daf2f,{options:_0x2a00ac,args:_0x343dc4,tdx:_0x28a5cb}=_0x3308b0,_0x9f8841=this[_0x3faa9d(0x214)](_0x343dc4,_0x2a00ac);if(!_0x9f8841)return 0x1;_0x2a00ac['verbose']&&console[_0x3faa9d(0x1ef)]('Project:\x20'+_0x9f8841);const _0x5e421a=await withSpinner(_0x3faa9d(0x275),()=>_0x28a5cb[_0x3faa9d(0x300)][_0x3faa9d(0x28a)](_0x9f8841),{'verbose':_0x2a00ac['verbose']}),{secrets:_0x3ff4d9}=_0x5e421a[_0x3faa9d(0x2ca)];return console[_0x3faa9d(0x1ef)](_0x3faa9d(0x23a)+_0x3ff4d9[_0x3faa9d(0x2f2)]+_0x3faa9d(0x184)+(_0x3ff4d9[_0x3faa9d(0x2f2)]!==0x1?'s':'')),await handleSDKOutput(_0x3ff4d9,_0x2a00ac),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a47_0x4daf2f(0x31f)]=a47_0x4daf2f(0x25b);[a47_0x4daf2f(0x18a)]=a47_0x4daf2f(0x209);async['execute'](_0x5dd1bc){const _0x364bc2=a47_0x4daf2f,{options:_0x3e068e,args:_0x9033a5,tdx:_0x2a64e7}=_0x5dd1bc;let _0x5a2c9e,_0x43ff0f;if(_0x9033a5[_0x364bc2(0x2f2)]>=0x2)_0x5a2c9e=_0x9033a5[0x0],_0x43ff0f=_0x9033a5[0x1];else{if(_0x9033a5[_0x364bc2(0x2f2)]===0x1&&_0x3e068e[_0x364bc2(0x239)])_0x5a2c9e=_0x3e068e[_0x364bc2(0x239)],_0x43ff0f=_0x9033a5[0x0];else return _0x9033a5[_0x364bc2(0x2f2)]===0x1?(console[_0x364bc2(0x1ef)](_0x364bc2(0x21e)),console[_0x364bc2(0x1ef)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x364bc2(0x1ef)](_0x364bc2(0x1a2)),console[_0x364bc2(0x1ef)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE'),0x1);}let _0x5e4b16,_0x59619c;try{({key:_0x5e4b16,value:_0x59619c}=parseKeyValue(_0x43ff0f));}catch(_0x200c4f){return _0x200c4f instanceof Error&&console[_0x364bc2(0x1ef)](a47_0x59ff5e['red'](_0x364bc2(0x20b)),_0x200c4f[_0x364bc2(0x271)]),0x1;}_0x3e068e['verbose']&&(console['error'](_0x364bc2(0x2a8)+_0x5a2c9e),console[_0x364bc2(0x1ef)](_0x364bc2(0x1b9)+_0x5e4b16));const _0x1042e1=await withSpinner(_0x364bc2(0x2e3),()=>_0x2a64e7['workflow']['setSecret'](_0x5a2c9e,_0x5e4b16,_0x59619c),{'verbose':_0x3e068e[_0x364bc2(0x1f7)]}),_0x2271a=_0x1042e1['data'];return console[_0x364bc2(0x1ef)](_0x364bc2(0x2a7)+_0x2271a[_0x364bc2(0x232)]+_0x364bc2(0x2d2)+_0x2271a[_0x364bc2(0x1ff)]+'\x27'),(_0x3e068e['json']||_0x3e068e[_0x364bc2(0x296)])&&await handleSingleObjectOutput(_0x2271a,_0x3e068e),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a47_0x4daf2f(0x19e);['description']=a47_0x4daf2f(0x193);async[a47_0x4daf2f(0x24b)](_0x596bb8){const _0x41afaa=a47_0x4daf2f,{options:_0x228cc2,args:_0x530512,tdx:_0x2bd0a5}=_0x596bb8;let _0x4c19a8,_0x4ad620;if(_0x530512[_0x41afaa(0x2f2)]>=0x2)_0x4c19a8=_0x530512[0x0],_0x4ad620=_0x530512[0x1];else{if(_0x530512[_0x41afaa(0x2f2)]===0x1&&_0x228cc2[_0x41afaa(0x239)])_0x4c19a8=_0x228cc2['workflowProject'],_0x4ad620=_0x530512[0x0];else return _0x530512[_0x41afaa(0x2f2)]===0x1?(console[_0x41afaa(0x1ef)](_0x41afaa(0x21e)),console['error'](_0x41afaa(0x2bd)),0x1):(console['error'](_0x41afaa(0x295)),console['error'](_0x41afaa(0x1d0)),0x1);}_0x228cc2[_0x41afaa(0x1f7)]&&(console[_0x41afaa(0x1ef)]('Project:\x20'+_0x4c19a8),console[_0x41afaa(0x1ef)](_0x41afaa(0x1b9)+_0x4ad620));if(!_0x228cc2[_0x41afaa(0x250)]){if(!isInteractive())return console[_0x41afaa(0x1ef)](a47_0x59ff5e[_0x41afaa(0x247)](_0x41afaa(0x21f)),_0x41afaa(0x1ac)),console[_0x41afaa(0x1ef)](a47_0x59ff5e[_0x41afaa(0x2b8)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x358c4c=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x4ad620+_0x41afaa(0x1e9)+_0x4c19a8+'\x27?');if(!_0x358c4c)return console[_0x41afaa(0x1ef)](a47_0x59ff5e['yellow'](_0x41afaa(0x31e))),0x1;}const _0x2be919=await withSpinner(_0x41afaa(0x22a),()=>_0x2bd0a5[_0x41afaa(0x300)][_0x41afaa(0x22b)](_0x4c19a8,_0x4ad620),{'verbose':_0x228cc2[_0x41afaa(0x1f7)]}),_0x391cfe=_0x2be919['data'];return console[_0x41afaa(0x1ef)]('✔\x20Secret\x20\x27'+_0x391cfe[_0x41afaa(0x232)]+_0x41afaa(0x305)+_0x391cfe[_0x41afaa(0x1ff)]+'\x27'),(_0x228cc2[_0x41afaa(0x1be)]||_0x228cc2[_0x41afaa(0x296)])&&await handleSingleObjectOutput(_0x391cfe,_0x228cc2),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(_0x29311f){const _0x504fcd=a47_0x4daf2f,_0x3f8996=Math['floor'](_0x29311f/0x3e8),_0x3a5f75=Math[_0x504fcd(0x19a)](_0x3f8996/0x3c),_0x82d423=Math[_0x504fcd(0x19a)](_0x3a5f75/0x3c),_0x5996de=Math[_0x504fcd(0x19a)](_0x82d423/0x18);if(_0x5996de>0x0){const _0x2edc93=_0x82d423%0x18;return _0x2edc93>0x0?_0x5996de+'d\x20'+_0x2edc93+'h':_0x5996de+'d';}else{if(_0x82d423>0x0){const _0x4c993d=_0x3a5f75%0x3c;return _0x4c993d>0x0?_0x82d423+'h\x20'+_0x4c993d+'m':_0x82d423+'h';}else{if(_0x3a5f75>0x0){const _0x4b7380=_0x3f8996%0x3c;return _0x4b7380>0x0?_0x3a5f75+'m\x20'+_0x4b7380+'s':_0x3a5f75+'m';}else return _0x3f8996+'s';}}}function formatTimestamp(_0x3a2fff,_0x17f91c){const _0x5d3456=a47_0x4daf2f,_0x48ac32=new Date(_0x3a2fff),_0x36b15b=String(_0x48ac32[_0x5d3456(0x176)]())[_0x5d3456(0x1b6)](0x2,'0'),_0x6d011=String(_0x48ac32[_0x5d3456(0x284)]())[_0x5d3456(0x1b6)](0x2,'0'),_0x496767=_0x36b15b+':'+_0x6d011,_0x38dfd5=_0x48ac32[_0x5d3456(0x254)]()===_0x17f91c[_0x5d3456(0x254)]()&&_0x48ac32['getMonth']()===_0x17f91c[_0x5d3456(0x1e6)]()&&_0x48ac32[_0x5d3456(0x242)]()===_0x17f91c['getDate']();if(_0x38dfd5)return _0x496767;else{const _0x363475=String(_0x48ac32[_0x5d3456(0x1e6)]()+0x1)[_0x5d3456(0x1b6)](0x2,'0'),_0x3249b4=String(_0x48ac32[_0x5d3456(0x242)]())[_0x5d3456(0x1b6)](0x2,'0');return _0x363475+'-'+_0x3249b4+'\x20'+_0x496767;}}function formatDate(_0x24a822){const _0x2b2e08=a47_0x4daf2f,_0x1e0bfc=_0x24a822[_0x2b2e08(0x254)](),_0x16edfa=String(_0x24a822[_0x2b2e08(0x1e6)]()+0x1)[_0x2b2e08(0x1b6)](0x2,'0'),_0x19d747=String(_0x24a822[_0x2b2e08(0x242)]())[_0x2b2e08(0x1b6)](0x2,'0');return _0x1e0bfc+'-'+_0x16edfa+'-'+_0x19d747;}function getTaskStateIcon(_0x208cf2){const _0x296b2e={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x296b2e[_0x208cf2]||'⚪';}function getBarChar(_0x331cdf){const _0x43bb26=a47_0x4daf2f;return _0x331cdf==='error'||_0x331cdf===_0x43bb26(0x237)?'×':'─';}function getBarColor(_0x544d8d){const _0xab55e4=a47_0x4daf2f,_0x2b7252={'success':a47_0x59ff5e['green'],'error':a47_0x59ff5e[_0xab55e4(0x247)],'group_error':a47_0x59ff5e['red'],'running':a47_0x59ff5e['blue'],'blocked':a47_0x59ff5e[_0xab55e4(0x1f5)],'planned':a47_0x59ff5e['dim'],'canceling':a47_0x59ff5e[_0xab55e4(0x1f5)]};return _0x2b7252[_0x544d8d]||a47_0x59ff5e[_0xab55e4(0x1f8)];}function parseTaskName(_0x37886f){const _0x334173=a47_0x4daf2f;let _0x2f4eac=_0x37886f[_0x334173(0x1d1)](/^\++/,'');const _0x34c7c1=_0x2f4eac[_0x334173(0x2a5)]('+'),_0x3da58d=_0x34c7c1['length']>0x1?_0x34c7c1[_0x334173(0x2f2)]-0x2:0x0,_0x3e83ff=_0x34c7c1[_0x34c7c1[_0x334173(0x2f2)]-0x1]||_0x2f4eac;return{'level':_0x3da58d,'name':'+'+_0x3e83ff};}function truncateTaskName(_0x3ddd3b,_0x5c1381){const _0x1952b4=a47_0x4daf2f,_0x30dfe1=stringWidth(_0x3ddd3b);if(_0x30dfe1<=_0x5c1381)return _0x3ddd3b;let _0x3d05a3=_0x3ddd3b;while(stringWidth(_0x3d05a3+'…')>_0x5c1381&&_0x3d05a3[_0x1952b4(0x2f2)]>0x0){_0x3d05a3=_0x3d05a3[_0x1952b4(0x2b0)](0x0,-0x1);}return _0x3d05a3+'…';}function calculateTimeScale(_0x1d717a,_0x5c7798){const _0x346a90=a47_0x4daf2f;return{'startTime':_0x1d717a[_0x346a90(0x304)],'endTime':_0x1d717a['end'],'durationMs':_0x1d717a['duration'],'msPerChar':_0x1d717a[_0x346a90(0x30f)]/_0x5c7798};}function timeToPosition(_0x21f2d7,_0x26e7d1,_0x28eb31){const _0x4a6201=a47_0x4daf2f,_0x4ccd86=_0x21f2d7-_0x26e7d1[_0x4a6201(0x2e2)],_0x31dbb8=Math[_0x4a6201(0x19a)](_0x4ccd86/_0x26e7d1['msPerChar']);return Math[_0x4a6201(0x2f4)](0x0,Math[_0x4a6201(0x1c1)](_0x31dbb8,_0x28eb31));}function renderTimeAxis(_0x354e1c,_0x209778){const _0x147abe=a47_0x4daf2f,_0x455770=Math[_0x147abe(0x1c1)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x147abe(0x2f4)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math['floor'](_0x209778/TIMELINE_CONFIG[_0x147abe(0x276)]))),_0x1cdf6f=_0x354e1c[_0x147abe(0x313)]/(_0x455770-0x1),_0x24d32d=new Date(_0x354e1c['startTime']),_0x4f53ad=[];for(let _0x1356be=0x0;_0x1356be<_0x455770;_0x1356be++){const _0x3df1a9=_0x354e1c[_0x147abe(0x2e2)]+_0x1356be*_0x1cdf6f,_0x3edf50=timeToPosition(_0x3df1a9,_0x354e1c,_0x209778),_0x2dbd31=formatTimestamp(_0x3df1a9,_0x24d32d);_0x4f53ad[_0x147abe(0x1b8)]({'pos':_0x3edf50,'text':_0x2dbd31});}const _0xb4c74a=new Array(_0x209778)[_0x147abe(0x2ba)]('\x20');let _0x3d586a=-0x1;for(const {pos:_0x583eda,text:_0x5a0f3d}of _0x4f53ad){let _0x7f3bb3=Math[_0x147abe(0x2f4)](0x0,_0x583eda-Math[_0x147abe(0x19a)](_0x5a0f3d[_0x147abe(0x2f2)]/0x2));_0x7f3bb3<=_0x3d586a+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x7f3bb3=_0x3d586a+TIMELINE_CONFIG[_0x147abe(0x315)]+0x1);_0x7f3bb3+_0x5a0f3d[_0x147abe(0x2f2)]>_0x209778&&(_0x7f3bb3=_0x209778-_0x5a0f3d[_0x147abe(0x2f2)]);if(_0x7f3bb3>=0x0&&_0x7f3bb3+_0x5a0f3d[_0x147abe(0x2f2)]<=_0x209778&&_0x7f3bb3>_0x3d586a){for(let _0x2c2b3d=0x0;_0x2c2b3d<_0x5a0f3d['length'];_0x2c2b3d++){_0xb4c74a[_0x7f3bb3+_0x2c2b3d]=_0x5a0f3d[_0x2c2b3d];}_0x3d586a=_0x7f3bb3+_0x5a0f3d[_0x147abe(0x2f2)]-0x1;}}return _0xb4c74a['join']('');}function renderTaskRow(_0x1b8e28,_0xdf87f2,_0x316643,_0x220ff8){const _0xd195f0=a47_0x4daf2f,{level:_0x789a8e,name:_0x52e52c}=parseTaskName(_0x1b8e28[_0xd195f0(0x31f)]),_0x4ad929='\x20'[_0xd195f0(0x1d2)](_0x789a8e),_0x489556=_0x1b8e28['window']?'('+formatElapsed(_0x1b8e28[_0xd195f0(0x325)][_0xd195f0(0x30f)])+')':'',_0x19369c=stringWidth(_0x489556),_0x7879a6=_0x789a8e*0x1,_0x2384ec=_0x220ff8-_0x7879a6-_0x19369c-0x1,_0x54c309=truncateTaskName(_0x52e52c,_0x2384ec),_0x4da990=_0x4ad929+_0x54c309,_0x4e47b3=stringWidth(_0x4da990),_0x12bc64=_0x220ff8-_0x4e47b3-_0x19369c,_0x1b9bea=_0x4da990+'\x20'[_0xd195f0(0x1d2)](Math[_0xd195f0(0x2f4)](0x1,_0x12bc64))+a47_0x59ff5e['dim'](_0x489556),_0x237fc9=getTaskStateIcon(_0x1b8e28[_0xd195f0(0x1db)]),_0x5e5c14=new Array(_0x316643)[_0xd195f0(0x2ba)]('\x20');if(_0x1b8e28[_0xd195f0(0x325)]){const _0x12d580=timeToPosition(_0x1b8e28['window'][_0xd195f0(0x304)],_0xdf87f2,_0x316643),_0x54abb6=timeToPosition(_0x1b8e28[_0xd195f0(0x325)]['end'],_0xdf87f2,_0x316643),_0x2db0a1=getBarChar(_0x1b8e28[_0xd195f0(0x1db)]),_0x291786=Math[_0xd195f0(0x2f4)](_0x12d580+0x1,_0x54abb6);for(let _0xd0a484=_0x12d580;_0xd0a484<Math[_0xd195f0(0x1c1)](_0x291786,_0x316643);_0xd0a484++){_0x5e5c14[_0xd0a484]=_0x2db0a1;}}const _0x3dd9bd=getBarColor(_0x1b8e28[_0xd195f0(0x1db)]),_0x3506d2=_0x5e5c14[_0xd195f0(0x202)](_0xf670d1=>_0xf670d1==='\x20'?'\x20':_0x3dd9bd(_0xf670d1))[_0xd195f0(0x1fb)]('');return _0x237fc9+'\x20'+_0x1b9bea+'│'+_0x3506d2+'│';}function calculateStats(_0x154ce2){const _0x7bb20c=a47_0x4daf2f,_0x161b79={'total':_0x154ce2[_0x7bb20c(0x2f2)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x331ce7 of _0x154ce2){if(_0x331ce7[_0x7bb20c(0x1db)]==='success')_0x161b79['success']++;else{if(_0x331ce7[_0x7bb20c(0x1db)]===_0x7bb20c(0x1ef)||_0x331ce7[_0x7bb20c(0x1db)]===_0x7bb20c(0x237))_0x161b79[_0x7bb20c(0x1ef)]++;else _0x331ce7['state']==='running'?_0x161b79[_0x7bb20c(0x1f9)]++:_0x161b79[_0x7bb20c(0x2b7)]++;}}return _0x161b79;}function formatStats(_0x5dbe48){const _0x19dc88=a47_0x4daf2f;return[_0x19dc88(0x22e)+_0x5dbe48[_0x19dc88(0x1e4)],'✅\x20'+_0x5dbe48[_0x19dc88(0x31d)],'❌\x20'+_0x5dbe48[_0x19dc88(0x1ef)],'🔄\x20'+_0x5dbe48['running'],'⏳\x20'+_0x5dbe48[_0x19dc88(0x2b7)]][_0x19dc88(0x1fb)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a47_0x4daf2f(0x31f)]=a47_0x4daf2f(0x225);[a47_0x4daf2f(0x18a)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a47_0x4daf2f(0x24b)](_0x449d32){const _0xaa98df=a47_0x4daf2f,{options:_0x5e3bd3,args:_0x3c0e6d,tdx:_0x4f1361}=_0x449d32;let _0x1fe39c,_0x2f867e,_0x221b2f=![];if(_0x3c0e6d[0x0]){if(_0x3c0e6d[0x0][_0xaa98df(0x27f)]('.')){const _0x205e88=this[_0xaa98df(0x2b9)](_0x3c0e6d,_0x5e3bd3);if(!_0x205e88)return 0x1;_0x1fe39c=_0x205e88[_0xaa98df(0x1ff)],_0x2f867e=_0x205e88[_0xaa98df(0x173)];}else{_0x2f867e=_0x3c0e6d[0x0],_0x1fe39c=_0x5e3bd3[_0xaa98df(0x239)];if(!_0x1fe39c)return console['error'](a47_0x59ff5e[_0xaa98df(0x247)](_0xaa98df(0x20b)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x221b2f=!![];}}else{const _0x5952d4=this['parseProjectWorkflowPattern'](_0x3c0e6d,_0x5e3bd3);if(!_0x5952d4)return 0x1;_0x1fe39c=_0x5952d4['projectName'],_0x2f867e=_0x5952d4['workflowName'];}if(_0x5e3bd3[_0xaa98df(0x1f7)]){if(_0x1fe39c&&_0x2f867e)console[_0xaa98df(0x1ef)](_0xaa98df(0x2af)+_0x1fe39c+'.'+_0x2f867e);else _0x1fe39c&&console[_0xaa98df(0x1ef)](_0xaa98df(0x190)+_0x1fe39c);}const _0x43149e=_0x5e3bd3[_0xaa98df(0x20c)],_0x2d348f=_0x5e3bd3[_0xaa98df(0x2c8)];if(_0x43149e){_0x2d348f&&console[_0xaa98df(0x1ef)](a47_0x59ff5e[_0xaa98df(0x1f5)](_0xaa98df(0x261)),_0xaa98df(0x259));const _0x57cb77=_0x5e3bd3[_0xaa98df(0x2a4)];return _0x57cb77?await this[_0xaa98df(0x328)](_0x449d32,_0x43149e):await this[_0xaa98df(0x2d9)](_0x449d32,_0x43149e,_0x5e3bd3),0x0;}if(_0x2d348f){const _0x1ea26c=await withSpinner(_0xaa98df(0x191),()=>_0x4f1361[_0xaa98df(0x300)][_0xaa98df(0x1fc)]({'projectName':_0x1fe39c,'workflowName':_0x2f867e,'limit':0x64}),{'verbose':_0x5e3bd3[_0xaa98df(0x1f7)]}),_0x467316=_0x1ea26c['data'][_0xaa98df(0x319)](_0x3a02db=>_0x3a02db['id']===_0x2d348f);if(!_0x467316)return console[_0xaa98df(0x1ef)](a47_0x59ff5e[_0xaa98df(0x247)](_0xaa98df(0x20b)),_0xaa98df(0x241)+_0x2d348f),0x1;if(!_0x467316[_0xaa98df(0x2ab)]?.['id'])return console[_0xaa98df(0x1ef)](a47_0x59ff5e[_0xaa98df(0x247)]('Error:'),'Session\x20'+_0x2d348f+_0xaa98df(0x321)),0x1;const _0xafa25d=_0x467316['lastAttempt']['id'];_0x5e3bd3['verbose']&&console[_0xaa98df(0x1ef)]('Using\x20attempt\x20'+_0xafa25d+_0xaa98df(0x1a6)+_0x2d348f);const _0x58d6a2=_0x5e3bd3['follow'];return _0x58d6a2?await this[_0xaa98df(0x328)](_0x449d32,_0xafa25d):await this[_0xaa98df(0x2d9)](_0x449d32,_0xafa25d,_0x5e3bd3),0x0;}const _0x1bda30=await withSpinner(_0xaa98df(0x248),()=>_0x4f1361[_0xaa98df(0x300)][_0xaa98df(0x1fc)]({'projectName':_0x1fe39c,'workflowName':_0x2f867e,'limit':_0x5e3bd3[_0xaa98df(0x1e0)]||0x32}),{'verbose':_0x5e3bd3['verbose']}),_0x4b936e=_0x1bda30[_0xaa98df(0x2ca)];if(_0x4b936e[_0xaa98df(0x2f2)]===0x0){if(_0x1fe39c&&_0x2f867e)console[_0xaa98df(0x1ef)](_0xaa98df(0x2a2)+_0x1fe39c+'.'+_0x2f867e);else _0x1fe39c?console[_0xaa98df(0x1ef)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x1fe39c):(console[_0xaa98df(0x1ef)]('No\x20workflow\x20sessions\x20found'),console['error'](a47_0x59ff5e[_0xaa98df(0x2b8)](_0xaa98df(0x1de))));return 0x0;}_0x4b936e[_0xaa98df(0x22f)]((_0x5e8b2f,_0x34171d)=>{const _0x365a49=_0xaa98df,_0x5245cf=_0x5e8b2f[_0x365a49(0x2f9)]||'',_0x5457b4=_0x34171d[_0x365a49(0x2f9)]||'';return _0x5457b4[_0x365a49(0x186)](_0x5245cf);});if(_0x5e3bd3['json']||_0x5e3bd3[_0xaa98df(0x296)])return await handleSDKOutput(_0x4b936e,_0x5e3bd3),0x0;let _0x2ed6ef;if(_0x221b2f){const _0x113dbe=_0x4b936e[0x0];if(!_0x113dbe[_0xaa98df(0x2ab)]?.['id'])return console[_0xaa98df(0x1ef)](_0xaa98df(0x25d)),0x0;_0x2ed6ef=_0x113dbe['lastAttempt']['id'],_0x5e3bd3[_0xaa98df(0x1f7)]&&console['error'](_0xaa98df(0x24a)+_0x113dbe[_0xaa98df(0x2f9)]);}else{const _0x5d280d=_0x4b936e['map'](_0x106a76=>{const _0x5c3ec2=_0xaa98df,_0x4c675f=getAttemptStatusDisplay(_0x106a76['lastAttempt']);return{'title':_0x106a76['project']?.[_0x5c3ec2(0x31f)]+'.'+_0x106a76[_0x5c3ec2(0x300)]?.[_0x5c3ec2(0x31f)]+_0x5c3ec2(0x22d)+_0x106a76[_0x5c3ec2(0x2f9)]+'\x20'+_0x4c675f['icon'],'value':_0x106a76['lastAttempt']?.['id']||'','description':_0x4c675f[_0x5c3ec2(0x26a)]};}),_0x46aa42=await a47_0x20f678({'type':_0xaa98df(0x2bf),'name':_0xaa98df(0x20c),'message':_0xaa98df(0x2f8),'choices':_0x5d280d['filter'](_0x1c4070=>_0x1c4070[_0xaa98df(0x263)]!=='')});if(!_0x46aa42[_0xaa98df(0x20c)])return 0x0;_0x2ed6ef=_0x46aa42[_0xaa98df(0x20c)];}const _0x28191b=_0x5e3bd3[_0xaa98df(0x2a4)];return _0x28191b?await this[_0xaa98df(0x328)](_0x449d32,_0x2ed6ef):await this[_0xaa98df(0x2d9)](_0x449d32,_0x2ed6ef,_0x5e3bd3),0x0;}async[a47_0x4daf2f(0x2d9)](_0x35f7c6,_0x26108b,_0x43d62f){const _0x10019d=a47_0x4daf2f,{tdx:_0x4daa0d}=_0x35f7c6;let _0x48ce41,_0x20d9e4;try{[_0x48ce41,_0x20d9e4]=await Promise[_0x10019d(0x2cb)]([_0x4daa0d[_0x10019d(0x300)][_0x10019d(0x19d)](_0x26108b),_0x4daa0d[_0x10019d(0x300)][_0x10019d(0x2d3)](_0x26108b,![])]);}catch(_0x2c6747){console[_0x10019d(0x1ef)](a47_0x59ff5e['red'](_0x10019d(0x28c)));_0x43d62f[_0x10019d(0x1f7)]&&console['error'](_0x2c6747);throw _0x2c6747;}if(_0x43d62f[_0x10019d(0x1be)]||_0x43d62f[_0x10019d(0x296)]){const _0x4f913e=this[_0x10019d(0x206)](_0x48ce41,_0x20d9e4);await handleSDKOutput([_0x4f913e],_0x43d62f);return;}const _0x57aaff=_0x4daa0d[_0x10019d(0x29f)][_0x10019d(0x1ea)],_0x2c0756=this[_0x10019d(0x2e4)](_0x48ce41,_0x20d9e4,_0x57aaff);console[_0x10019d(0x18b)](_0x2c0756);}async[a47_0x4daf2f(0x328)](_0x2b453f,_0x336c71){const _0x23813c=a47_0x4daf2f,{tdx:_0x1127e4}=_0x2b453f,_0x43436b=TIMELINE_CONFIG[_0x23813c(0x2a1)],_0x416766=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x187aee=0x0;while(_0x187aee<_0x416766){process['stdout'][_0x23813c(0x23c)]&&process[_0x23813c(0x314)][_0x23813c(0x200)]('\x1bc');let _0x477721,_0x2b4d38;try{[_0x477721,_0x2b4d38]=await Promise['all']([_0x1127e4[_0x23813c(0x300)]['attempt'](_0x336c71),_0x1127e4[_0x23813c(0x300)][_0x23813c(0x2d3)](_0x336c71,![])]);}catch(_0x52072d){console[_0x23813c(0x1ef)](a47_0x59ff5e['red'](_0x23813c(0x25c)));_0x187aee>0x0&&console['error'](a47_0x59ff5e['dim'](_0x23813c(0x234)+_0x187aee));throw _0x52072d;}const _0x214f40=_0x1127e4['context']['site'],_0x4f9c7d=this[_0x23813c(0x2e4)](_0x477721,_0x2b4d38,_0x214f40);console[_0x23813c(0x18b)](_0x4f9c7d);const _0x54b843=_0x477721[_0x23813c(0x235)]&&_0x2b4d38[_0x23813c(0x220)](_0xa47741=>_0xa47741[_0x23813c(0x1db)]!==_0x23813c(0x1f9)&&_0xa47741[_0x23813c(0x1db)]!==_0x23813c(0x307));if(_0x54b843){console['error'](a47_0x59ff5e['green'](_0x23813c(0x1c4)));break;}console[_0x23813c(0x1ef)](a47_0x59ff5e[_0x23813c(0x2b8)](_0x23813c(0x277)+_0x187aee*0x2+_0x23813c(0x316))),await new Promise(_0x3f6ec8=>setTimeout(_0x3f6ec8,_0x43436b)),_0x187aee++;}_0x187aee>=_0x416766&&console[_0x23813c(0x1ef)](a47_0x59ff5e['yellow']('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a47_0x4daf2f(0x2e4)](_0xa7ce12,_0x79bb82,_0x40a7f0){const _0x4032e2=a47_0x4daf2f,_0x553001=[],_0x84bde9=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x43f9d4=0x5,_0x12fb97=process[_0x4032e2(0x314)]['columns']||0x78,_0x2bde24=_0x12fb97-_0x84bde9-_0x43f9d4,_0xf6759c=Math[_0x4032e2(0x2f4)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math['min'](_0x2bde24,TIMELINE_CONFIG[_0x4032e2(0x27e)])),_0x4ef390=new Date(_0xa7ce12['createdAt'])[_0x4032e2(0x286)](),_0x4adbe0=_0xa7ce12[_0x4032e2(0x244)]?new Date(_0xa7ce12[_0x4032e2(0x244)])['getTime']():Date[_0x4032e2(0x2ae)](),_0x16aa2f={'start':_0x4ef390,'end':_0x4adbe0,'duration':_0x4adbe0-_0x4ef390},_0x7a48fe=new Map(),_0x4419b5=[];for(const _0xa19653 of _0x79bb82){if(_0xa19653[_0x4032e2(0x30c)]){const _0x2abef3=new Date(_0xa19653['startedAt'])[_0x4032e2(0x286)](),_0x9c3a56=_0xa19653['updatedAt']?new Date(_0xa19653[_0x4032e2(0x208)])['getTime']():Date['now'](),_0xbe1de3={'start':_0x2abef3,'end':_0x9c3a56,'duration':_0x9c3a56-_0x2abef3};_0x7a48fe[_0x4032e2(0x23d)](_0xa19653['id'],_0xbe1de3),_0x4419b5[_0x4032e2(0x1b8)]({'name':_0xa19653['fullName'],'state':_0xa19653[_0x4032e2(0x1db)]||_0x4032e2(0x1dc),'window':_0xbe1de3});}else _0x4419b5[_0x4032e2(0x1b8)]({'name':_0xa19653[_0x4032e2(0x26c)],'state':_0xa19653[_0x4032e2(0x1db)]||_0x4032e2(0x307),'window':undefined});}_0x4419b5[_0x4032e2(0x22f)]((_0x54795b,_0x4135f4)=>{const _0x365830=_0x4032e2;if(!_0x54795b['window'])return 0x1;if(!_0x4135f4['window'])return-0x1;return _0x54795b['window']['start']-_0x4135f4['window'][_0x365830(0x304)];});const _0x43d8ab=_0x4419b5['length'],_0x2fc387=_0x43d8ab>TIMELINE_CONFIG[_0x4032e2(0x233)];_0x2fc387&&_0x4419b5[_0x4032e2(0x1e5)](TIMELINE_CONFIG[_0x4032e2(0x233)]);const _0x214ec3=calculateTimeScale(_0x16aa2f,_0xf6759c),_0x270ff1=_0xa7ce12[_0x4032e2(0x235)]?_0xa7ce12['success']?a47_0x59ff5e['green'](_0x4032e2(0x31d)):a47_0x59ff5e[_0x4032e2(0x247)]('error'):a47_0x59ff5e[_0x4032e2(0x26b)](_0x4032e2(0x1f9)),_0x451f93=_0xa7ce12[_0x4032e2(0x196)]?.['id'],_0xed495=_0xa7ce12[_0x4032e2(0x2c8)];let _0x35a7da;if(_0x451f93&&_0xed495){const _0x39f3fd=getWorkflowAttemptUrl(_0x40a7f0,_0x451f93,_0xed495,_0xa7ce12['id']);_0x35a7da=hyperlink(a47_0x59ff5e[_0x4032e2(0x2b8)](_0xa7ce12['id']),_0x39f3fd);}else _0x35a7da=a47_0x59ff5e[_0x4032e2(0x2b8)](_0xa7ce12['id']);_0x553001[_0x4032e2(0x1b8)]('Attempt:\x20'+_0x35a7da+_0x4032e2(0x22d)+_0x270ff1+_0x4032e2(0x22d)+formatElapsed(_0x16aa2f['duration']));if(_0x4419b5['length']>0x0){const _0x659a77=renderTimeAxis(_0x214ec3,_0xf6759c),_0x4f5a6c=new Date(_0x16aa2f[_0x4032e2(0x304)]),_0x4d727d=formatDate(_0x4f5a6c),_0x1eed2a=TIMELINE_CONFIG[_0x4032e2(0x267)]+TIMELINE_CONFIG['ICON_SPACING']+_0x84bde9,_0x24418d=_0x4d727d['padStart'](_0x1eed2a),_0x3278e6=a47_0x59ff5e[_0x4032e2(0x2b8)](_0x24418d);_0x553001['push'](_0x3278e6+'\x20'+_0x659a77);for(const _0x1382b7 of _0x4419b5){_0x553001[_0x4032e2(0x1b8)](renderTaskRow(_0x1382b7,_0x214ec3,_0xf6759c,_0x84bde9));}const _0x58e6c4=calculateStats(_0x4419b5);_0x553001[_0x4032e2(0x1b8)](formatStats(_0x58e6c4)),_0x2fc387&&_0x553001[_0x4032e2(0x1b8)](a47_0x59ff5e['yellow'](_0x4032e2(0x278)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x4032e2(0x1bb)+_0x43d8ab+'\x20tasks')),_0x553001['push'](''),_0x553001[_0x4032e2(0x1b8)](a47_0x59ff5e[_0x4032e2(0x2b8)]('💡\x20Tip:\x20Use\x20')+('tdx\x20wf\x20attempt\x20'+_0xa7ce12['id']+'\x20logs')+a47_0x59ff5e[_0x4032e2(0x2b8)]('\x20to\x20see\x20detailed\x20logs'));}else _0x553001[_0x4032e2(0x1b8)](_0x4032e2(0x227));return _0x553001[_0x4032e2(0x1fb)]('\x0a');}[a47_0x4daf2f(0x206)](_0x582b86,_0xac6c65){const _0x1d18b7=a47_0x4daf2f,_0x442bdb=new Date(_0x582b86[_0x1d18b7(0x2d5)])[_0x1d18b7(0x286)](),_0x3f3c02=_0x582b86['finishedAt']?new Date(_0x582b86[_0x1d18b7(0x244)])[_0x1d18b7(0x286)]():Date[_0x1d18b7(0x2ae)](),_0x3a7e21=_0x3f3c02-_0x442bdb,_0x39de0c=[];for(const _0x510798 of _0xac6c65){if(_0x510798[_0x1d18b7(0x30c)]){const _0x589f78=new Date(_0x510798[_0x1d18b7(0x30c)])[_0x1d18b7(0x286)](),_0x34821d=_0x510798[_0x1d18b7(0x208)]?new Date(_0x510798[_0x1d18b7(0x208)])[_0x1d18b7(0x286)]():Date['now']();_0x39de0c['push']({'name':_0x510798['fullName'],'state':_0x510798[_0x1d18b7(0x1db)]||'unknown','window':{'start':_0x589f78,'end':_0x34821d,'duration':_0x34821d-_0x589f78}});}else _0x39de0c['push']({'name':_0x510798[_0x1d18b7(0x26c)],'state':_0x510798[_0x1d18b7(0x1db)]||_0x1d18b7(0x307),'window':undefined});}const _0xec2be4=calculateStats(_0x39de0c);return{'attempt':{'id':_0x582b86['id'],'status':_0x582b86[_0x1d18b7(0x235)]?_0x582b86[_0x1d18b7(0x31d)]?_0x1d18b7(0x31d):_0x1d18b7(0x1ef):_0x1d18b7(0x1f9),'createdAt':_0x582b86[_0x1d18b7(0x2d5)],'finishedAt':_0x582b86['finishedAt'],'duration_ms':_0x3a7e21},'tasks':_0x39de0c[_0x1d18b7(0x202)](_0x36fe6d=>({'name':_0x36fe6d[_0x1d18b7(0x31f)],'state':_0x36fe6d['state'],'startedAt':_0x36fe6d[_0x1d18b7(0x325)]?new Date(_0x36fe6d['window'][_0x1d18b7(0x304)])['toISOString']():null,'updatedAt':_0x36fe6d[_0x1d18b7(0x325)]?new Date(_0x36fe6d[_0x1d18b7(0x325)][_0x1d18b7(0x323)])[_0x1d18b7(0x27c)]():null,'duration_ms':_0x36fe6d[_0x1d18b7(0x325)]?.[_0x1d18b7(0x30f)]||null})),'stats':_0xec2be4};}}
@@ -27,7 +27,7 @@ export interface AuthHeaders {
27
27
  /**
28
28
  * Get authentication headers for TD API requests
29
29
  *
30
- * @param _site - TD site (us01, jp01, eu01, ap02) - currently unused but kept for API consistency
30
+ * @param _site - TD site (us01, ap01, eu01, ap02) - currently unused but kept for API consistency
31
31
  * @param apiKey - Optional API key. Should be resolved before calling this function.
32
32
  * @returns HTTP headers object (Authorization header omitted if no API key available)
33
33
  */
@@ -41,7 +41,7 @@ export declare function toHeaderRecord(headers: AuthHeaders): Record<string, str
41
41
  * Get Trino-specific headers
42
42
  * Trino uses X-Trino-User instead of Authorization header
43
43
  *
44
- * @param site - TD site (us01, jp01, eu01, ap02)
44
+ * @param site - TD site (us01, ap01, eu01, ap02)
45
45
  * @param apiKey - Optional API key. Should be resolved before calling this function.
46
46
  * @returns Trino-specific headers (without Authorization, with X-Trino-User if API key available)
47
47
  */
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x5d4d23,_0x1e4dbd){const _0x1237b6=a48_0x3c13,_0x519bc9=_0x5d4d23();while(!![]){try{const _0x248037=parseInt(_0x1237b6(0xfa))/0x1*(parseInt(_0x1237b6(0xfc))/0x2)+parseInt(_0x1237b6(0x101))/0x3*(-parseInt(_0x1237b6(0x100))/0x4)+-parseInt(_0x1237b6(0xf3))/0x5*(parseInt(_0x1237b6(0xf9))/0x6)+-parseInt(_0x1237b6(0x102))/0x7+parseInt(_0x1237b6(0xf5))/0x8*(parseInt(_0x1237b6(0xff))/0x9)+parseInt(_0x1237b6(0xf6))/0xa+-parseInt(_0x1237b6(0xf8))/0xb*(parseInt(_0x1237b6(0xf0))/0xc);if(_0x248037===_0x1e4dbd)break;else _0x519bc9['push'](_0x519bc9['shift']());}catch(_0x258a91){_0x519bc9['push'](_0x519bc9['shift']());}}}(a48_0x5105,0x9c6b2));function a48_0x5105(){const _0xb992ad=['12ruLpal','replace',';\x20node/','5691940DLSWEo','tdx/','1979440HdrkZg','8402500xafwsP','Authorization','194821lpjMVs','6wwGiGb','612ZFhCfb','TD1\x20','1826HwHLSg','length','X-Trino-User','45ZjuVpx','1337660tgaaCd','6SDPnLQ','1193759OwVwXa'];a48_0x5105=function(){return _0xb992ad;};return a48_0x5105();}import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0xa669a7=a48_0x3c13,_0x3ce91c=getVersion(),_0x2945c7=platform(),_0x220da1=process['version'][_0xa669a7(0xf1)]('v','');return _0xa669a7(0xf4)+_0x3ce91c+'\x20('+_0x2945c7+_0xa669a7(0xf2)+_0x220da1+')';}export function getAuthHeaders(_0x113d6a,_0x1067a2){const _0x3cb04f=a48_0x3c13,_0x143523=getVersion(),_0x42c2d2={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x143523};return _0x1067a2&&(_0x42c2d2[_0x3cb04f(0xf7)]=_0x3cb04f(0xfb)+_0x1067a2),_0x42c2d2;}export function toHeaderRecord(_0x14ce67){const _0x2eb89f={};for(const [_0x4af716,_0x500cc7]of Object['entries'](_0x14ce67)){_0x500cc7!==undefined&&(_0x2eb89f[_0x4af716]=_0x500cc7);}return _0x2eb89f;}export function getTrinoHeaders(_0x35450a,_0x50fafc){const _0x5bcc74=a48_0x3c13,_0xaec391=getAuthHeaders(_0x35450a,_0x50fafc),_0x10dbf9=toHeaderRecord(_0xaec391);return delete _0x10dbf9['Authorization'],_0x50fafc&&(_0x10dbf9[_0x5bcc74(0xfe)]=_0x50fafc),_0x10dbf9;}function a48_0x3c13(_0x4ec2d8,_0x20eeac){_0x4ec2d8=_0x4ec2d8-0xf0;const _0x5105af=a48_0x5105();let _0x3c137c=_0x5105af[_0x4ec2d8];return _0x3c137c;}export function hasAPIKey(_0x5069de){const _0xa05b7e=a48_0x3c13,_0x5d097e=getAPIKey();return _0x5d097e!==undefined&&_0x5d097e[_0xa05b7e(0xfd)]>0x0;}
1
+ (function(_0x2fc253,_0xacc124){const _0x374d97=a48_0x33f1,_0x43200f=_0x2fc253();while(!![]){try{const _0x49f79b=parseInt(_0x374d97(0x1fd))/0x1*(-parseInt(_0x374d97(0x1f3))/0x2)+-parseInt(_0x374d97(0x1f2))/0x3+parseInt(_0x374d97(0x1fc))/0x4*(-parseInt(_0x374d97(0x1fe))/0x5)+parseInt(_0x374d97(0x1f9))/0x6+-parseInt(_0x374d97(0x201))/0x7+parseInt(_0x374d97(0x1f6))/0x8+parseInt(_0x374d97(0x1f7))/0x9;if(_0x49f79b===_0xacc124)break;else _0x43200f['push'](_0x43200f['shift']());}catch(_0x247051){_0x43200f['push'](_0x43200f['shift']());}}}(a48_0x462f,0xc31be));import{platform}from'os';import{getAPIKey}from'./config.js';function a48_0x33f1(_0xc5c4fd,_0x4d2cdc){_0xc5c4fd=_0xc5c4fd-0x1f2;const _0x462fd5=a48_0x462f();let _0x33f1c0=_0x462fd5[_0xc5c4fd];return _0x33f1c0;}import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a48_0x462f(){const _0x3ef797=['5GozZOc','X-Trino-User','Authorization','3640077hVLwmt','2492142UcdweE','486fhOuAO','TD1\x20','tdx/','4883136tAjBri','26707401sNwdAa',';\x20node/','6320232hKPZZG','version','tdx','5062532WNjzuE','5003AbjjYT'];a48_0x462f=function(){return _0x3ef797;};return a48_0x462f();}export function getUserAgent(){const _0x27127b=a48_0x33f1,_0x5b4f9e=getVersion(),_0x124d4d=platform(),_0x2fbf20=process[_0x27127b(0x1fa)]['replace']('v','');return _0x27127b(0x1f5)+_0x5b4f9e+'\x20('+_0x124d4d+_0x27127b(0x1f8)+_0x2fbf20+')';}export function getAuthHeaders(_0x94576f,_0xc461b){const _0x3ed77e=a48_0x33f1,_0x308eee=getVersion(),_0x3ca676={'User-Agent':getUserAgent(),'X-TD-Client':_0x3ed77e(0x1fb),'X-TD-Client-Version':_0x308eee};return _0xc461b&&(_0x3ca676[_0x3ed77e(0x200)]=_0x3ed77e(0x1f4)+_0xc461b),_0x3ca676;}export function toHeaderRecord(_0x5f0664){const _0xb48e8a={};for(const [_0x51542c,_0x5ae5d7]of Object['entries'](_0x5f0664)){_0x5ae5d7!==undefined&&(_0xb48e8a[_0x51542c]=_0x5ae5d7);}return _0xb48e8a;}export function getTrinoHeaders(_0x2b0c42,_0x4d239e){const _0xb562f3=a48_0x33f1,_0x293f1e=getAuthHeaders(_0x2b0c42,_0x4d239e),_0x5234a5=toHeaderRecord(_0x293f1e);return delete _0x5234a5[_0xb562f3(0x200)],_0x4d239e&&(_0x5234a5[_0xb562f3(0x1ff)]=_0x4d239e),_0x5234a5;}export function hasAPIKey(_0x6a0051){const _0x4bbcb4=getAPIKey();return _0x4bbcb4!==undefined&&_0x4bbcb4['length']>0x0;}
@@ -1 +1 @@
1
- (function(_0x51dcf2,_0x2c2fe5){const _0x14b531=a49_0x5efd,_0x4a51c0=_0x51dcf2();while(!![]){try{const _0x137a80=-parseInt(_0x14b531(0x9b))/0x1*(-parseInt(_0x14b531(0xa2))/0x2)+-parseInt(_0x14b531(0xaa))/0x3*(parseInt(_0x14b531(0x95))/0x4)+parseInt(_0x14b531(0xc5))/0x5+-parseInt(_0x14b531(0xb5))/0x6+parseInt(_0x14b531(0xca))/0x7*(-parseInt(_0x14b531(0xba))/0x8)+-parseInt(_0x14b531(0xaf))/0x9+parseInt(_0x14b531(0x8c))/0xa;if(_0x137a80===_0x2c2fe5)break;else _0x4a51c0['push'](_0x4a51c0['shift']());}catch(_0xa9a9f5){_0x4a51c0['push'](_0x4a51c0['shift']());}}}(a49_0x1444,0xce91c));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 a49_0x4ae290 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';function a49_0x1444(){const _0x2f0789=['red','debug','stdout','write','12qISfik','keys','format','bigint','end','10621224XFRScu','-FXRSn','[Object]','spawn','[logs]','bold','9613884OsbqkB','stringify','boolean','[error]','No\x20data','8vsuNXJ','Results\x20saved\x20to\x20','length','cmdout','isTTY','limit','push','repeat','list','less','─┬─','2271355ybiSuY','number','noColor','string','padEnd','6013252NejlgW','inherit','sdk-result','forEach','blue','resolve','split','stderr','tsv','join','isInteger','42183660SHEJUM','─┴─','log','entries','table','json','params','varchar','cyan','669316YaGMOE','pipe','output','color','map','[rule]','2971lnufMf','max','stdin','jsonl','[params]','query','rule','326CkhyCY','FINISHED','object','trim'];a49_0x1444=function(){return _0x2f0789;};return a49_0x1444();}import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x162882){const _0x3a0370=a49_0x5efd;return _0x162882[_0x3a0370(0xac)]===_0x3a0370(0x91)||_0x162882[_0x3a0370(0xac)]==='jsonl'||_0x162882[_0x3a0370(0xac)]===_0x3a0370(0xd2)||_0x162882[_0x3a0370(0xac)]===_0x3a0370(0x90)||_0x162882[_0x3a0370(0x91)]===!![]||_0x162882[_0x3a0370(0x9e)]===!![]||_0x162882['tsv']===!![]||_0x162882[_0x3a0370(0x90)]===!![];}export function parseOutputOptions(_0x28a8cd){const _0x54dc93=a49_0x5efd;return{'format':_0x28a8cd[_0x54dc93(0xac)]||_0x54dc93(0x90),'output':_0x28a8cd[_0x54dc93(0x97)]||'','limit':_0x28a8cd[_0x54dc93(0xbf)],'color':_0x28a8cd['color'],'noColor':_0x28a8cd[_0x54dc93(0xc7)]};}function convertSDKResultToQueryResult(_0x3b5ba6){const _0x1d50d9=a49_0x5efd,_0x7efd01=[];if(_0x3b5ba6['length']>0x0){const _0x3321bf=_0x3b5ba6[0x0];for(const [_0x2a2208,_0x3fa5f5]of Object['entries'](_0x3321bf)){let _0x1271d1=_0x1d50d9(0x93);if(typeof _0x3fa5f5===_0x1d50d9(0xc6))_0x1271d1=Number[_0x1d50d9(0x8b)](_0x3fa5f5)?_0x1d50d9(0xad):'double';else{if(typeof _0x3fa5f5===_0x1d50d9(0xb7))_0x1271d1=_0x1d50d9(0xb7);else _0x3fa5f5===null&&(_0x1271d1='varchar');}_0x7efd01[_0x1d50d9(0xc0)]({'name':_0x2a2208,'type':_0x1271d1});}}return{'queryId':_0x1d50d9(0xcc),'columns':_0x7efd01,'data':_0x3b5ba6,'stats':{'state':_0x1d50d9(0xa3),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3b5ba6[_0x1d50d9(0xbc)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x1635d9,_0x7825d7){const _0x2252f7=convertSDKResultToQueryResult(_0x1635d9);return formatQueryOutput(_0x2252f7,_0x7825d7);}export async function formatQueryOutput(_0x2406ff,_0x18d8a7){const _0x51fee2=a49_0x5efd,{format:_0x539326,limit:_0xb038bc,output:_0xb4f834,color:_0x1dfad4,noColor:_0x57a5e8}=_0x18d8a7,_0x214197=Boolean(_0xb4f834)&&!_0x1dfad4,_0xd71fee={'color':_0x1dfad4,'noColor':_0x57a5e8||_0x214197};if(_0x539326==='table'){const _0x257198=shouldUseLess(_0x539326,_0xb4f834);return formatAsTable(_0x2406ff,_0xb038bc,_0x257198,_0xd71fee);}else{if(_0x539326===_0x51fee2(0x91))return formatAsJSON(_0x2406ff,_0xd71fee);else return _0x539326===_0x51fee2(0x9e)?formatAsJSONL(_0x2406ff,_0xd71fee):formatQueryResult(_0x2406ff,_0x539326);}}function shouldUseLess(_0x25e0ba,_0x3fbd2f){const _0x53c2de=a49_0x5efd;return(_0x25e0ba===_0x53c2de(0x90)||_0x25e0ba===_0x53c2de(0xc2))&&process[_0x53c2de(0xa8)][_0x53c2de(0xbe)]&&!_0x3fbd2f;}export function resolveOutputOptions(_0x479105){const _0x4cf1f4=a49_0x5efd,_0x39fedb=resolveOutputFormat(_0x479105[_0x4cf1f4(0xac)],_0x479105[_0x4cf1f4(0x97)],_0x4cf1f4(0x90));let _0x388716=typeof _0x479105[_0x4cf1f4(0xbf)]===_0x4cf1f4(0xc6)?_0x479105[_0x4cf1f4(0xbf)]:parseInt(_0x479105['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x2ccd8e=_0x479105['output']||'';return shouldUseLess(_0x39fedb,_0x2ccd8e)&&(_0x388716=Infinity),{'format':_0x39fedb,'output':_0x2ccd8e,'limit':_0x388716,'color':_0x479105[_0x4cf1f4(0x98)],'noColor':_0x479105[_0x4cf1f4(0xc7)]};}export function writeOutput(_0x19dbcf,_0x3c4630,_0x49bb85){const _0x2d216d=a49_0x5efd;return _0x3c4630?(writeFileSync(_0x3c4630,_0x19dbcf),console['error'](_0x2d216d(0xbb)+_0x3c4630),Promise[_0x2d216d(0xcf)]()):shouldUseLess(_0x49bb85||'','')?new Promise(_0x5362b4=>{const _0x3d1cb0=_0x2d216d,_0x5130fa=spawn(_0x3d1cb0(0xc3),[_0x3d1cb0(0xb0)],{'stdio':[_0x3d1cb0(0x96),_0x3d1cb0(0xcb),_0x3d1cb0(0xcb)]});let _0x2b1d79=![];_0x5130fa['on']('error',()=>{const _0x79f73b=_0x3d1cb0;!_0x2b1d79&&(_0x2b1d79=!![],console[_0x79f73b(0x8e)](_0x19dbcf),_0x5362b4());}),_0x5130fa['on']('close',()=>{!_0x2b1d79&&(_0x2b1d79=!![],_0x5362b4());}),_0x5130fa['on'](_0x3d1cb0(0xb2),()=>{const _0x3a4169=_0x3d1cb0;!_0x2b1d79&&_0x5130fa['stdin']&&(_0x5130fa['stdin']['on']('error',()=>{}),_0x5130fa[_0x3a4169(0x9d)][_0x3a4169(0xa9)](_0x19dbcf),_0x5130fa['stdin'][_0x3a4169(0xae)]());}),!_0x5130fa[_0x3d1cb0(0x9d)]&&(!_0x2b1d79&&(_0x2b1d79=!![],console['log'](_0x19dbcf),_0x5362b4()));}):(console[_0x2d216d(0x8e)](_0x19dbcf),Promise[_0x2d216d(0xcf)]());}function a49_0x5efd(_0x117d02,_0x302641){_0x117d02=_0x117d02-0x8a;const _0x1444c1=a49_0x1444();let _0x5efd8f=_0x1444c1[_0x117d02];return _0x5efd8f;}export async function handleSDKOutput(_0xc95bfb,_0x550dcf){const _0x45aca5=a49_0x5efd,_0x2e0950=resolveOutputOptions(_0x550dcf),_0x42f7bd=await formatSDKOutput(_0xc95bfb,_0x2e0950);await writeOutput(_0x42f7bd,_0x2e0950[_0x45aca5(0x97)]||undefined,_0x2e0950[_0x45aca5(0xac)]);}export async function handleQueryOutput(_0x56d021,_0x1c7e26){const _0x3508c0=a49_0x5efd,_0x578e68=resolveOutputOptions(_0x1c7e26),_0x3a71aa=await formatQueryOutput(_0x56d021,_0x578e68);await writeOutput(_0x3a71aa,_0x578e68[_0x3508c0(0x97)]||undefined,_0x578e68[_0x3508c0(0xac)]);}async function formatSingleObject(_0x5019a4,_0x14fec2){const _0x40fcf3=a49_0x5efd,{format:_0x50a06c,color:_0x475ffb,noColor:_0x2af04b}=_0x14fec2,_0x22662b={'color':_0x475ffb,'noColor':_0x2af04b};if(_0x50a06c===_0x40fcf3(0x91)){if(shouldUseColor(_0x22662b))return colorizeJSON(_0x5019a4,_0x22662b);return JSON['stringify'](_0x5019a4,null,0x2);}else{if(_0x50a06c===_0x40fcf3(0x9e)){if(shouldUseColor(_0x22662b))return colorizeJSONCompact(_0x5019a4,_0x22662b);return JSON[_0x40fcf3(0xb6)](_0x5019a4);}else{if(_0x50a06c===_0x40fcf3(0xd2))return Object[_0x40fcf3(0x8f)](_0x5019a4)['map'](([_0x2e1c37,_0xe77f41])=>_0x2e1c37+'\x09'+_0xe77f41)[_0x40fcf3(0x8a)]('\x0a');else{const _0x15d57b=Object[_0x40fcf3(0x8f)](_0x5019a4);if(_0x15d57b['length']===0x0)return _0x40fcf3(0xb9);const _0x114470=_0x5019a4[_0x40fcf3(0xa7)],_0x55e2fe=_0x5019a4[_0x40fcf3(0xa0)],_0x52fc27=_0x5019a4[_0x40fcf3(0x92)],_0x343ca7=_0x5019a4[_0x40fcf3(0xa1)],_0x1513e8=_0x55e2fe?typeof _0x55e2fe===_0x40fcf3(0xc8)?_0x55e2fe:JSON['stringify'](_0x55e2fe,null,0x2):undefined,_0xe524f0=_0x52fc27&&Object[_0x40fcf3(0xab)](_0x52fc27)['length']>0x0?JSON['stringify'](_0x52fc27,null,0x2):undefined,_0xcab1a8=_0x343ca7&&Object['keys'](_0x343ca7)[_0x40fcf3(0xbc)]>0x0?JSON['stringify'](_0x343ca7,null,0x2):undefined,_0xa2cef6=_0x15d57b['filter'](([_0x250537])=>_0x250537!=='debug'&&_0x250537!==_0x40fcf3(0xa0)&&_0x250537!=='params'&&_0x250537!==_0x40fcf3(0xa1)),_0x3eca36=Math[_0x40fcf3(0x9c)](..._0xa2cef6[_0x40fcf3(0x99)](([_0x453f56])=>_0x453f56[_0x40fcf3(0xbc)])),_0x458935=Math[_0x40fcf3(0x9c)](..._0xa2cef6['map'](([,_0x30e81f])=>{const _0x4b78e5=_0x40fcf3;try{const _0x2ea00c=_0x30e81f===null||_0x30e81f===undefined?'':typeof _0x30e81f===_0x4b78e5(0xa4)?JSON['stringify'](_0x30e81f):String(_0x30e81f),_0x24e8f2=_0x2ea00c[_0x4b78e5(0xd0)]('\x0a');return Math[_0x4b78e5(0x9c)](..._0x24e8f2[_0x4b78e5(0x99)](_0x335f26=>_0x335f26[_0x4b78e5(0xbc)]),0x0);}catch{return 0x0;}}),0x14),_0x29dd92=[];_0x29dd92[_0x40fcf3(0xc0)](colorBorder('┌─'+'─'[_0x40fcf3(0xc1)](_0x3eca36)+_0x40fcf3(0xc4)+'─'['repeat'](_0x458935)+'─┐',_0x22662b)),_0xa2cef6[_0x40fcf3(0xcd)](([_0x3a6d7b,_0x382bcb])=>{const _0x51d117=_0x40fcf3;let _0x5ebe5b;try{_0x5ebe5b=_0x382bcb===null||_0x382bcb===undefined?'':typeof _0x382bcb==='object'?JSON[_0x51d117(0xb6)](_0x382bcb):String(_0x382bcb);}catch{_0x5ebe5b=_0x51d117(0xb1);}const _0x5147cd=_0x3a6d7b[_0x51d117(0xc9)](_0x3eca36),_0x2db10c=_0x5ebe5b[_0x51d117(0xd0)]('\x0a');_0x2db10c[_0x51d117(0xcd)]((_0x42e4b5,_0x567180)=>{const _0x5da645=_0x51d117,_0x1cf96d=colorBorder('│',_0x22662b);_0x567180===0x0?_0x29dd92[_0x5da645(0xc0)](_0x1cf96d+'\x20'+_0x5147cd+'\x20'+_0x1cf96d+'\x20'+_0x42e4b5['padEnd'](_0x458935)+'\x20'+_0x1cf96d):_0x29dd92[_0x5da645(0xc0)](_0x1cf96d+'\x20'+'\x20'['repeat'](_0x3eca36)+'\x20'+_0x1cf96d+'\x20'+_0x42e4b5['padEnd'](_0x458935)+'\x20'+_0x1cf96d);});}),_0x29dd92[_0x40fcf3(0xc0)](colorBorder('└─'+'─'[_0x40fcf3(0xc1)](_0x3eca36)+_0x40fcf3(0x8d)+'─'['repeat'](_0x458935)+'─┘',_0x22662b));_0x1513e8&&(_0x29dd92[_0x40fcf3(0xc0)](''),_0x29dd92[_0x40fcf3(0xc0)](String(a49_0x4ae290['yellow']['bold']('[query]'))),_0x29dd92[_0x40fcf3(0xc0)](_0x1513e8));_0xe524f0&&(_0x29dd92['push'](''),_0x29dd92[_0x40fcf3(0xc0)](String(a49_0x4ae290[_0x40fcf3(0xce)][_0x40fcf3(0xb4)](_0x40fcf3(0x9f)))),_0x29dd92[_0x40fcf3(0xc0)](_0xe524f0));_0xcab1a8&&(_0x29dd92[_0x40fcf3(0xc0)](''),_0x29dd92[_0x40fcf3(0xc0)](String(a49_0x4ae290['magenta'][_0x40fcf3(0xb4)](_0x40fcf3(0x9a)))),_0x29dd92['push'](_0xcab1a8));if(_0x114470){if(_0x114470[_0x40fcf3(0xd1)]){_0x29dd92[_0x40fcf3(0xc0)](''),_0x29dd92[_0x40fcf3(0xc0)](String(a49_0x4ae290[_0x40fcf3(0xa6)]['bold'](_0x40fcf3(0xb8))));const _0x529d14=_0x114470[_0x40fcf3(0xd1)][_0x40fcf3(0xd0)]('\x0a');_0x529d14[_0x40fcf3(0xcd)](_0x5c0839=>{const _0x179043=_0x40fcf3;_0x5c0839[_0x179043(0xa5)]()&&_0x29dd92[_0x179043(0xc0)](_0x5c0839);});}if(_0x114470['cmdout']){_0x29dd92['push'](''),_0x29dd92['push'](String(a49_0x4ae290[_0x40fcf3(0x94)]['bold'](_0x40fcf3(0xb3))));const _0x4df238=_0x114470[_0x40fcf3(0xbd)]['split']('\x0a');_0x4df238[_0x40fcf3(0xcd)](_0x3b38b4=>{_0x3b38b4['trim']()&&_0x29dd92['push'](_0x3b38b4);});}}return _0x29dd92['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x362b5f,_0x58667d){const _0x4b814d=a49_0x5efd;if(_0x58667d['format']===_0x4b814d(0x90)){await handleSDKOutput([_0x362b5f],_0x58667d);return;}const _0xd67cf0=resolveOutputOptions(_0x58667d),_0x3f65c5=await formatSingleObject(_0x362b5f,_0xd67cf0);await writeOutput(_0x3f65c5,_0xd67cf0[_0x4b814d(0x97)]||undefined,_0xd67cf0[_0x4b814d(0xac)]);}
1
+ (function(_0x4d22b3,_0xd21654){const _0x5b0b9d=a49_0x4432,_0x589f3e=_0x4d22b3();while(!![]){try{const _0xa810ad=parseInt(_0x5b0b9d(0x109))/0x1*(parseInt(_0x5b0b9d(0xe6))/0x2)+-parseInt(_0x5b0b9d(0x119))/0x3*(parseInt(_0x5b0b9d(0xe7))/0x4)+parseInt(_0x5b0b9d(0x10f))/0x5+parseInt(_0x5b0b9d(0x101))/0x6+parseInt(_0x5b0b9d(0xea))/0x7+-parseInt(_0x5b0b9d(0x103))/0x8+-parseInt(_0x5b0b9d(0x11c))/0x9;if(_0xa810ad===_0xd21654)break;else _0x589f3e['push'](_0x589f3e['shift']());}catch(_0x3021c7){_0x589f3e['push'](_0x589f3e['shift']());}}}(a49_0x1fc3,0xce73c));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 a49_0x4432(_0x599ee3,_0x19578e){_0x599ee3=_0x599ee3-0xe4;const _0x1fc340=a49_0x1fc3();let _0x44324d=_0x1fc340[_0x599ee3];return _0x44324d;}import a49_0x1a5637 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x5a4de6){const _0xf9fd0d=a49_0x4432;return _0x5a4de6[_0xf9fd0d(0x11b)]==='json'||_0x5a4de6[_0xf9fd0d(0x11b)]===_0xf9fd0d(0x10c)||_0x5a4de6[_0xf9fd0d(0x11b)]==='tsv'||_0x5a4de6[_0xf9fd0d(0x11b)]===_0xf9fd0d(0xf5)||_0x5a4de6[_0xf9fd0d(0x10b)]===!![]||_0x5a4de6['jsonl']===!![]||_0x5a4de6[_0xf9fd0d(0x122)]===!![]||_0x5a4de6[_0xf9fd0d(0xf5)]===!![];}export function parseOutputOptions(_0x53a467){const _0x24d173=a49_0x4432;return{'format':_0x53a467[_0x24d173(0x11b)]||_0x24d173(0xf5),'output':_0x53a467[_0x24d173(0x115)]||'','limit':_0x53a467[_0x24d173(0x11f)],'color':_0x53a467[_0x24d173(0xfb)],'noColor':_0x53a467['noColor']};}function convertSDKResultToQueryResult(_0x326aa1){const _0xb7b1c4=a49_0x4432,_0x67b4a5=[];if(_0x326aa1['length']>0x0){const _0x4aaf7c=_0x326aa1[0x0];for(const [_0x364271,_0xa1b0b1]of Object[_0xb7b1c4(0xee)](_0x4aaf7c)){let _0x541f86=_0xb7b1c4(0x116);if(typeof _0xa1b0b1===_0xb7b1c4(0x123))_0x541f86=Number[_0xb7b1c4(0x127)](_0xa1b0b1)?'bigint':_0xb7b1c4(0x117);else{if(typeof _0xa1b0b1==='boolean')_0x541f86=_0xb7b1c4(0xe5);else _0xa1b0b1===null&&(_0x541f86=_0xb7b1c4(0x116));}_0x67b4a5[_0xb7b1c4(0xef)]({'name':_0x364271,'type':_0x541f86});}}return{'queryId':_0xb7b1c4(0xf9),'columns':_0x67b4a5,'data':_0x326aa1,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x326aa1[_0xb7b1c4(0x10e)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x17308f,_0x34aa2d){const _0x48aa59=convertSDKResultToQueryResult(_0x17308f);return formatQueryOutput(_0x48aa59,_0x34aa2d);}export async function formatQueryOutput(_0xdd05d2,_0x4fff18){const _0x2dd741=a49_0x4432,{format:_0x502e1e,limit:_0x1c1089,output:_0x47d1a9,color:_0x5b2213,noColor:_0x48fbf1}=_0x4fff18,_0x553ec1=Boolean(_0x47d1a9)&&!_0x5b2213,_0x18c509={'color':_0x5b2213,'noColor':_0x48fbf1||_0x553ec1};if(_0x502e1e==='table'){const _0x356f9f=shouldUseLess(_0x502e1e,_0x47d1a9);return formatAsTable(_0xdd05d2,_0x1c1089,_0x356f9f,_0x18c509);}else{if(_0x502e1e===_0x2dd741(0x10b))return formatAsJSON(_0xdd05d2,_0x18c509);else return _0x502e1e===_0x2dd741(0x10c)?formatAsJSONL(_0xdd05d2,_0x18c509):formatQueryResult(_0xdd05d2,_0x502e1e);}}function shouldUseLess(_0x18dc0b,_0x426b4c){const _0x3fb406=a49_0x4432;return(_0x18dc0b===_0x3fb406(0xf5)||_0x18dc0b===_0x3fb406(0x102))&&process[_0x3fb406(0xfa)][_0x3fb406(0x110)]&&!_0x426b4c;}export function resolveOutputOptions(_0x4613a1){const _0x492eb8=a49_0x4432,_0x386d97=resolveOutputFormat(_0x4613a1[_0x492eb8(0x11b)],_0x4613a1[_0x492eb8(0x115)],_0x492eb8(0xf5));let _0xab4156=typeof _0x4613a1['limit']===_0x492eb8(0x123)?_0x4613a1[_0x492eb8(0x11f)]:parseInt(_0x4613a1[_0x492eb8(0x11f)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x4f2dd4=_0x4613a1[_0x492eb8(0x115)]||'';return shouldUseLess(_0x386d97,_0x4f2dd4)&&(_0xab4156=Infinity),{'format':_0x386d97,'output':_0x4f2dd4,'limit':_0xab4156,'color':_0x4613a1['color'],'noColor':_0x4613a1[_0x492eb8(0xf0)]};}function a49_0x1fc3(){const _0x1595ad=['stdin','magenta','resolve','error','9UPGOJH','trim','json','jsonl','[rule]','length','6448290QBTYtP','isTTY','red','close','stringify','No\x20data','output','varchar','double','repeat','3189nFMyHP','[error]','format','13312485XNEevW','yellow','query','limit','rule','[Object]','tsv','number','split','blue','stderr','isInteger','-FXRSn','forEach','max','boolean','2452qbqXEt','592HLmrqx','padEnd','─┴─','9577337EiTuwi','params','log','debug','entries','push','noColor','less','keys','object','pipe','table','bold','map','cmdout','sdk-result','stdout','color','string','cyan','filter','join','[query]','3355602KVrCYe','list','5968264iygtUt','Results\x20saved\x20to\x20'];a49_0x1fc3=function(){return _0x1595ad;};return a49_0x1fc3();}export function writeOutput(_0x31310e,_0x1fd150,_0x34c9d5){const _0x704751=a49_0x4432;return _0x1fd150?(writeFileSync(_0x1fd150,_0x31310e),console[_0x704751(0x108)](_0x704751(0x104)+_0x1fd150),Promise[_0x704751(0x107)]()):shouldUseLess(_0x34c9d5||'','')?new Promise(_0x5b6061=>{const _0x1c9c91=_0x704751,_0x3bd4b1=spawn(_0x1c9c91(0xf1),[_0x1c9c91(0x128)],{'stdio':[_0x1c9c91(0xf4),'inherit','inherit']});let _0x4129c6=![];_0x3bd4b1['on'](_0x1c9c91(0x108),()=>{!_0x4129c6&&(_0x4129c6=!![],console['log'](_0x31310e),_0x5b6061());}),_0x3bd4b1['on'](_0x1c9c91(0x112),()=>{!_0x4129c6&&(_0x4129c6=!![],_0x5b6061());}),_0x3bd4b1['on']('spawn',()=>{const _0x5444a8=_0x1c9c91;!_0x4129c6&&_0x3bd4b1['stdin']&&(_0x3bd4b1[_0x5444a8(0x105)]['on'](_0x5444a8(0x108),()=>{}),_0x3bd4b1[_0x5444a8(0x105)]['write'](_0x31310e),_0x3bd4b1[_0x5444a8(0x105)]['end']());}),!_0x3bd4b1[_0x1c9c91(0x105)]&&(!_0x4129c6&&(_0x4129c6=!![],console[_0x1c9c91(0xec)](_0x31310e),_0x5b6061()));}):(console[_0x704751(0xec)](_0x31310e),Promise[_0x704751(0x107)]());}export async function handleSDKOutput(_0x435719,_0x411f87){const _0x5e1e47=resolveOutputOptions(_0x411f87),_0x97aa6f=await formatSDKOutput(_0x435719,_0x5e1e47);await writeOutput(_0x97aa6f,_0x5e1e47['output']||undefined,_0x5e1e47['format']);}export async function handleQueryOutput(_0x506f3e,_0x250302){const _0x16f37b=a49_0x4432,_0x3b57c3=resolveOutputOptions(_0x250302),_0x4172b2=await formatQueryOutput(_0x506f3e,_0x3b57c3);await writeOutput(_0x4172b2,_0x3b57c3[_0x16f37b(0x115)]||undefined,_0x3b57c3[_0x16f37b(0x11b)]);}async function formatSingleObject(_0x5b81fa,_0x170ea2){const _0xc71940=a49_0x4432,{format:_0x519678,color:_0x3dd042,noColor:_0x5ecb65}=_0x170ea2,_0x3c7aa5={'color':_0x3dd042,'noColor':_0x5ecb65};if(_0x519678===_0xc71940(0x10b)){if(shouldUseColor(_0x3c7aa5))return colorizeJSON(_0x5b81fa,_0x3c7aa5);return JSON['stringify'](_0x5b81fa,null,0x2);}else{if(_0x519678===_0xc71940(0x10c)){if(shouldUseColor(_0x3c7aa5))return colorizeJSONCompact(_0x5b81fa,_0x3c7aa5);return JSON[_0xc71940(0x113)](_0x5b81fa);}else{if(_0x519678===_0xc71940(0x122))return Object[_0xc71940(0xee)](_0x5b81fa)['map'](([_0x200525,_0x463b6f])=>_0x200525+'\x09'+_0x463b6f)[_0xc71940(0xff)]('\x0a');else{const _0x4c840b=Object[_0xc71940(0xee)](_0x5b81fa);if(_0x4c840b[_0xc71940(0x10e)]===0x0)return _0xc71940(0x114);const _0x98e572=_0x5b81fa[_0xc71940(0xed)],_0x3fe35a=_0x5b81fa[_0xc71940(0x11e)],_0x38af93=_0x5b81fa[_0xc71940(0xeb)],_0x440c19=_0x5b81fa[_0xc71940(0x120)],_0x3960cb=_0x3fe35a?typeof _0x3fe35a===_0xc71940(0xfc)?_0x3fe35a:JSON[_0xc71940(0x113)](_0x3fe35a,null,0x2):undefined,_0x32b169=_0x38af93&&Object[_0xc71940(0xf2)](_0x38af93)['length']>0x0?JSON[_0xc71940(0x113)](_0x38af93,null,0x2):undefined,_0x2ac839=_0x440c19&&Object[_0xc71940(0xf2)](_0x440c19)['length']>0x0?JSON['stringify'](_0x440c19,null,0x2):undefined,_0x3f409a=_0x4c840b[_0xc71940(0xfe)](([_0x4fa3a5])=>_0x4fa3a5!==_0xc71940(0xed)&&_0x4fa3a5!==_0xc71940(0x11e)&&_0x4fa3a5!==_0xc71940(0xeb)&&_0x4fa3a5!==_0xc71940(0x120)),_0x59f2af=Math[_0xc71940(0xe4)](..._0x3f409a['map'](([_0x5151fd])=>_0x5151fd['length'])),_0x6cb0a6=Math[_0xc71940(0xe4)](..._0x3f409a[_0xc71940(0xf7)](([,_0x184290])=>{const _0x180725=_0xc71940;try{const _0x51d8e1=_0x184290===null||_0x184290===undefined?'':typeof _0x184290===_0x180725(0xf3)?JSON[_0x180725(0x113)](_0x184290):String(_0x184290),_0x40529f=_0x51d8e1[_0x180725(0x124)]('\x0a');return Math[_0x180725(0xe4)](..._0x40529f[_0x180725(0xf7)](_0x2f0387=>_0x2f0387[_0x180725(0x10e)]),0x0);}catch{return 0x0;}}),0x14),_0x26b162=[];_0x26b162[_0xc71940(0xef)](colorBorder('┌─'+'─'[_0xc71940(0x118)](_0x59f2af)+'─┬─'+'─'[_0xc71940(0x118)](_0x6cb0a6)+'─┐',_0x3c7aa5)),_0x3f409a['forEach'](([_0x23a58c,_0x4e22ad])=>{const _0x5abef3=_0xc71940;let _0x39d402;try{_0x39d402=_0x4e22ad===null||_0x4e22ad===undefined?'':typeof _0x4e22ad===_0x5abef3(0xf3)?JSON[_0x5abef3(0x113)](_0x4e22ad):String(_0x4e22ad);}catch{_0x39d402=_0x5abef3(0x121);}const _0x4ec395=_0x23a58c[_0x5abef3(0xe8)](_0x59f2af),_0x10dd19=_0x39d402[_0x5abef3(0x124)]('\x0a');_0x10dd19['forEach']((_0x2e5c77,_0x3aa2ea)=>{const _0x348a51=_0x5abef3,_0x3e11ff=colorBorder('│',_0x3c7aa5);_0x3aa2ea===0x0?_0x26b162['push'](_0x3e11ff+'\x20'+_0x4ec395+'\x20'+_0x3e11ff+'\x20'+_0x2e5c77[_0x348a51(0xe8)](_0x6cb0a6)+'\x20'+_0x3e11ff):_0x26b162['push'](_0x3e11ff+'\x20'+'\x20'[_0x348a51(0x118)](_0x59f2af)+'\x20'+_0x3e11ff+'\x20'+_0x2e5c77[_0x348a51(0xe8)](_0x6cb0a6)+'\x20'+_0x3e11ff);});}),_0x26b162[_0xc71940(0xef)](colorBorder('└─'+'─'['repeat'](_0x59f2af)+_0xc71940(0xe9)+'─'['repeat'](_0x6cb0a6)+'─┘',_0x3c7aa5));_0x3960cb&&(_0x26b162['push'](''),_0x26b162[_0xc71940(0xef)](String(a49_0x1a5637[_0xc71940(0x11d)][_0xc71940(0xf6)](_0xc71940(0x100)))),_0x26b162['push'](_0x3960cb));_0x32b169&&(_0x26b162[_0xc71940(0xef)](''),_0x26b162['push'](String(a49_0x1a5637[_0xc71940(0x125)]['bold']('[params]'))),_0x26b162['push'](_0x32b169));_0x2ac839&&(_0x26b162[_0xc71940(0xef)](''),_0x26b162[_0xc71940(0xef)](String(a49_0x1a5637[_0xc71940(0x106)]['bold'](_0xc71940(0x10d)))),_0x26b162[_0xc71940(0xef)](_0x2ac839));if(_0x98e572){if(_0x98e572[_0xc71940(0x126)]){_0x26b162[_0xc71940(0xef)](''),_0x26b162[_0xc71940(0xef)](String(a49_0x1a5637[_0xc71940(0x111)][_0xc71940(0xf6)](_0xc71940(0x11a))));const _0x5e3793=_0x98e572[_0xc71940(0x126)]['split']('\x0a');_0x5e3793[_0xc71940(0x129)](_0xf4dcf9=>{const _0x548692=_0xc71940;_0xf4dcf9[_0x548692(0x10a)]()&&_0x26b162[_0x548692(0xef)](_0xf4dcf9);});}if(_0x98e572[_0xc71940(0xf8)]){_0x26b162['push'](''),_0x26b162['push'](String(a49_0x1a5637[_0xc71940(0xfd)][_0xc71940(0xf6)]('[logs]')));const _0x57be33=_0x98e572[_0xc71940(0xf8)][_0xc71940(0x124)]('\x0a');_0x57be33['forEach'](_0x29ba43=>{const _0x1f346d=_0xc71940;_0x29ba43[_0x1f346d(0x10a)]()&&_0x26b162[_0x1f346d(0xef)](_0x29ba43);});}}return _0x26b162[_0xc71940(0xff)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x47bdbc,_0x18b199){const _0x130827=a49_0x4432;if(_0x18b199[_0x130827(0x11b)]===_0x130827(0xf5)){await handleSDKOutput([_0x47bdbc],_0x18b199);return;}const _0x1b4d35=resolveOutputOptions(_0x18b199),_0x5bfe25=await formatSingleObject(_0x47bdbc,_0x1b4d35);await writeOutput(_0x5bfe25,_0x1b4d35['output']||undefined,_0x1b4d35[_0x130827(0x11b)]);}