@treasuredata/tdx 2026.3.4 → 2026.3.6

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 (231) 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.d.ts.map +1 -1
  12. package/dist/commands/auth-command.js +1 -1
  13. package/dist/commands/auth-command.js.map +1 -1
  14. package/dist/commands/auth-login-command.d.ts +29 -0
  15. package/dist/commands/auth-login-command.d.ts.map +1 -0
  16. package/dist/commands/auth-login-command.js +1 -0
  17. package/dist/commands/auth-login-command.js.map +1 -0
  18. package/dist/commands/chat-command.js +1 -1
  19. package/dist/commands/claude-command.js +1 -1
  20. package/dist/commands/claude-statusline-command.js +1 -1
  21. package/dist/commands/claude-usage-command.js +1 -1
  22. package/dist/commands/command.js +1 -1
  23. package/dist/commands/connection-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/delivery-command.js +1 -1
  26. package/dist/commands/describe.js +1 -1
  27. package/dist/commands/engage-campaign-pull-command.js +1 -1
  28. package/dist/commands/engage-campaign-push-command.js +1 -1
  29. package/dist/commands/engage-campaign-validate-command.js +1 -1
  30. package/dist/commands/engage-command.js +1 -1
  31. package/dist/commands/engage-template-pull-command.js +1 -1
  32. package/dist/commands/engage-template-push-command.js +1 -1
  33. package/dist/commands/engage-template-validate-command.js +1 -1
  34. package/dist/commands/job-command.js +1 -1
  35. package/dist/commands/journey-command.js +1 -1
  36. package/dist/commands/journey-validate-command.js +1 -1
  37. package/dist/commands/llm-command.js +1 -1
  38. package/dist/commands/mcp-command.d.ts.map +1 -1
  39. package/dist/commands/mcp-command.js +1 -1
  40. package/dist/commands/mcp-command.js.map +1 -1
  41. package/dist/commands/parent-segment-command.js +1 -1
  42. package/dist/commands/profile-command.d.ts.map +1 -1
  43. package/dist/commands/profile-command.js +1 -1
  44. package/dist/commands/profile-command.js.map +1 -1
  45. package/dist/commands/profiles-command.js +1 -1
  46. package/dist/commands/query-command.js +1 -1
  47. package/dist/commands/schedule-command.js +1 -1
  48. package/dist/commands/segment-command.js +1 -1
  49. package/dist/commands/segment-create-command.js +1 -1
  50. package/dist/commands/segment-fields-command.js +1 -1
  51. package/dist/commands/segment-pull-command.js +1 -1
  52. package/dist/commands/segment-push-command.js +1 -1
  53. package/dist/commands/segment-update-command.js +1 -1
  54. package/dist/commands/segment-use-command.js +1 -1
  55. package/dist/commands/segment-validate-command.js +1 -1
  56. package/dist/commands/segments.js +1 -1
  57. package/dist/commands/show.js +1 -1
  58. package/dist/commands/status-command.d.ts.map +1 -1
  59. package/dist/commands/status-command.js +1 -1
  60. package/dist/commands/status-command.js.map +1 -1
  61. package/dist/commands/tables.js +1 -1
  62. package/dist/commands/unset-command.js +1 -1
  63. package/dist/commands/upgrade-command.js +1 -1
  64. package/dist/commands/use-command.js +1 -1
  65. package/dist/commands/user-command.js +1 -1
  66. package/dist/commands/workflow-command.js +1 -1
  67. package/dist/core/auth.js +1 -1
  68. package/dist/core/command-output.js +1 -1
  69. package/dist/core/config.js +1 -1
  70. package/dist/core/connection-cache.js +1 -1
  71. package/dist/core/constants.d.ts +11 -0
  72. package/dist/core/constants.d.ts.map +1 -1
  73. package/dist/core/constants.js +1 -1
  74. package/dist/core/constants.js.map +1 -1
  75. package/dist/core/credential-cache.js +1 -1
  76. package/dist/core/global-context.d.ts.map +1 -1
  77. package/dist/core/global-context.js +1 -1
  78. package/dist/core/global-context.js.map +1 -1
  79. package/dist/core/keychain.js +1 -1
  80. package/dist/core/oauth-keychain.d.ts +32 -0
  81. package/dist/core/oauth-keychain.d.ts.map +1 -0
  82. package/dist/core/oauth-keychain.js +1 -0
  83. package/dist/core/oauth-keychain.js.map +1 -0
  84. package/dist/core/oauth.d.ts +112 -0
  85. package/dist/core/oauth.d.ts.map +1 -0
  86. package/dist/core/oauth.js +1 -0
  87. package/dist/core/oauth.js.map +1 -0
  88. package/dist/core/profile.js +1 -1
  89. package/dist/core/project-config.js +1 -1
  90. package/dist/core/session.js +1 -1
  91. package/dist/core/user-cache.js +1 -1
  92. package/dist/core/version.js +1 -1
  93. package/dist/index.js +1 -1
  94. package/dist/mcp/server.js +1 -1
  95. package/dist/mcp/tools/index.js +1 -1
  96. package/dist/mcp/tools/tdx-run.js +1 -1
  97. package/dist/mcp/tools/tdx-search.js +1 -1
  98. package/dist/mcp/utils.js +1 -1
  99. package/dist/proxy/claude-usage-tracker.js +1 -1
  100. package/dist/proxy/passthrough-server.js +1 -1
  101. package/dist/proxy/sse-usage-parser.js +1 -1
  102. package/dist/sdk/agent/agent-config.js +1 -1
  103. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  104. package/dist/sdk/agent/agent-yaml.js +1 -1
  105. package/dist/sdk/agent/test/evaluator.js +1 -1
  106. package/dist/sdk/agent/test/executor.js +1 -1
  107. package/dist/sdk/agent/test/index.js +1 -1
  108. package/dist/sdk/agent/test/output.js +1 -1
  109. package/dist/sdk/agent/test/parser.js +1 -1
  110. package/dist/sdk/agent/tool-target-registry.js +1 -1
  111. package/dist/sdk/api.js +1 -1
  112. package/dist/sdk/client/cdp-api-client.js +1 -1
  113. package/dist/sdk/client/delivery-api-client.js +1 -1
  114. package/dist/sdk/client/endpoints.js +1 -1
  115. package/dist/sdk/client/endpoints.js.map +1 -1
  116. package/dist/sdk/client/engage-api-client.js +1 -1
  117. package/dist/sdk/client/http-client.js +1 -1
  118. package/dist/sdk/client/llm-api-client.js +1 -1
  119. package/dist/sdk/client/oauth-refresh.d.ts +16 -0
  120. package/dist/sdk/client/oauth-refresh.d.ts.map +1 -0
  121. package/dist/sdk/client/oauth-refresh.js +1 -0
  122. package/dist/sdk/client/oauth-refresh.js.map +1 -0
  123. package/dist/sdk/client/rate-limiter.js +1 -1
  124. package/dist/sdk/client/td-api-client.js +1 -1
  125. package/dist/sdk/client/trino-api-client.js +1 -1
  126. package/dist/sdk/client/workflow-client.js +1 -1
  127. package/dist/sdk/connection-validator.js +1 -1
  128. package/dist/sdk/connection.js +1 -1
  129. package/dist/sdk/delivery.js +1 -1
  130. package/dist/sdk/engage/campaign-pull.js +1 -1
  131. package/dist/sdk/engage/campaign-push.js +1 -1
  132. package/dist/sdk/engage/campaign-validator.js +1 -1
  133. package/dist/sdk/engage/campaign-yaml.js +1 -1
  134. package/dist/sdk/engage/template-pull.js +1 -1
  135. package/dist/sdk/engage/template-push.js +1 -1
  136. package/dist/sdk/engage/template-validator.js +1 -1
  137. package/dist/sdk/engage/template-yaml.js +1 -1
  138. package/dist/sdk/engage/types/campaign-def.js +1 -1
  139. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  140. package/dist/sdk/engage/types/template-schema.js +1 -1
  141. package/dist/sdk/engage.js +1 -1
  142. package/dist/sdk/errors.js +1 -1
  143. package/dist/sdk/index.js +1 -1
  144. package/dist/sdk/io/index.js +1 -1
  145. package/dist/sdk/io/node-filesystem.js +1 -1
  146. package/dist/sdk/job.js +1 -1
  147. package/dist/sdk/journey.js +1 -1
  148. package/dist/sdk/llm/chat-cache.js +1 -1
  149. package/dist/sdk/llm/index.js +1 -1
  150. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  151. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  152. package/dist/sdk/llm/model-factors.js +1 -1
  153. package/dist/sdk/llm/model-factors.js.map +1 -1
  154. package/dist/sdk/personalization.js +1 -1
  155. package/dist/sdk/query/index.js +1 -1
  156. package/dist/sdk/query/sql-parser.js +1 -1
  157. package/dist/sdk/realtime.js +1 -1
  158. package/dist/sdk/schedule.js +1 -1
  159. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  160. package/dist/sdk/segment/fields-display.js +1 -1
  161. package/dist/sdk/segment/file-discovery.js +1 -1
  162. package/dist/sdk/segment/journey-utils.js +1 -1
  163. package/dist/sdk/segment/journey-validator.js +1 -1
  164. package/dist/sdk/segment/journey-yaml.js +1 -1
  165. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  166. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  167. package/dist/sdk/segment/pull-workflow.js +1 -1
  168. package/dist/sdk/segment/push-recovery.js +1 -1
  169. package/dist/sdk/segment/push-workflow.js +1 -1
  170. package/dist/sdk/segment/resolution-context.js +1 -1
  171. package/dist/sdk/segment/segment-path-parser.js +1 -1
  172. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  173. package/dist/sdk/segment/segment-validator.js +1 -1
  174. package/dist/sdk/segment/target-resolution.js +1 -1
  175. package/dist/sdk/segment/tdx-config.js +1 -1
  176. package/dist/sdk/segment/types/activation-schema.js +1 -1
  177. package/dist/sdk/segment/types/journey-def.js +1 -1
  178. package/dist/sdk/segment/types/journey-schema.js +1 -1
  179. package/dist/sdk/segment/types/segment-def.js +1 -1
  180. package/dist/sdk/segment/types/segment-schema.js +1 -1
  181. package/dist/sdk/segment/validate-files.js +1 -1
  182. package/dist/sdk/segment/yaml-validator.js +1 -1
  183. package/dist/sdk/segment.js +1 -1
  184. package/dist/sdk/types/index.js +1 -1
  185. package/dist/sdk/types/progress.js +1 -1
  186. package/dist/sdk/user.js +1 -1
  187. package/dist/sdk/util/format-detector.js +1 -1
  188. package/dist/sdk/util/formatters.js +1 -1
  189. package/dist/sdk/util/index.js +1 -1
  190. package/dist/sdk/util/paginate.js +1 -1
  191. package/dist/sdk/util/tree-formatter.js +1 -1
  192. package/dist/sdk/workflow/archive-validation.js +1 -1
  193. package/dist/sdk/workflow/clone-workflow.js +1 -1
  194. package/dist/sdk/workflow/index.js +1 -1
  195. package/dist/sdk/workflow/pull-workflow.js +1 -1
  196. package/dist/sdk/workflow/push-workflow.js +1 -1
  197. package/dist/sdk/workflow/tdx-config.js +1 -1
  198. package/dist/sdk/workflow/workflow-utils.js +1 -1
  199. package/dist/test-utils/command-runner.js +1 -1
  200. package/dist/test-utils/factories.js +1 -1
  201. package/dist/test-utils/fixtures.js +1 -1
  202. package/dist/test-utils/http-mock.js +1 -1
  203. package/dist/test-utils/index.js +1 -1
  204. package/dist/utils/async.js +1 -1
  205. package/dist/utils/colors.js +1 -1
  206. package/dist/utils/diff.js +1 -1
  207. package/dist/utils/file-permissions.js +1 -1
  208. package/dist/utils/file-reader.js +1 -1
  209. package/dist/utils/github-releases.js +1 -1
  210. package/dist/utils/global-cache.js +1 -1
  211. package/dist/utils/json-loader.js +1 -1
  212. package/dist/utils/local-cache.js +1 -1
  213. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  214. package/dist/utils/logger/formatters/index.js +1 -1
  215. package/dist/utils/logger/handlers/console-handler.js +1 -1
  216. package/dist/utils/logger/handlers/file-handler.js +1 -1
  217. package/dist/utils/logger/handlers/index.js +1 -1
  218. package/dist/utils/logger/handlers/null-handler.js +1 -1
  219. package/dist/utils/logger/index.js +1 -1
  220. package/dist/utils/logger/logger.js +1 -1
  221. package/dist/utils/logger/types.js +1 -1
  222. package/dist/utils/option-validation.js +1 -1
  223. package/dist/utils/process.js +1 -1
  224. package/dist/utils/prompt.js +1 -1
  225. package/dist/utils/spinner.js +1 -1
  226. package/dist/utils/sse-parser.js +1 -1
  227. package/dist/utils/string-utils.js +1 -1
  228. package/dist/utils/table-ref-parser.js +1 -1
  229. package/dist/utils/tdx-logger.js +1 -1
  230. package/dist/utils/version-check.js +1 -1
  231. package/package.json +1 -1
@@ -1 +1 @@
1
- const a50_0x474bcd=a50_0x1892;(function(_0x58b4c2,_0x406e74){const _0x2ab244=a50_0x1892,_0x6c5814=_0x58b4c2();while(!![]){try{const _0x4226a0=parseInt(_0x2ab244(0x195))/0x1+-parseInt(_0x2ab244(0x24e))/0x2*(-parseInt(_0x2ab244(0x2ae))/0x3)+parseInt(_0x2ab244(0x1e7))/0x4*(parseInt(_0x2ab244(0x261))/0x5)+parseInt(_0x2ab244(0x22e))/0x6*(-parseInt(_0x2ab244(0x1b1))/0x7)+parseInt(_0x2ab244(0x204))/0x8*(parseInt(_0x2ab244(0x22a))/0x9)+-parseInt(_0x2ab244(0x1c7))/0xa*(parseInt(_0x2ab244(0x1f1))/0xb)+-parseInt(_0x2ab244(0x173))/0xc*(parseInt(_0x2ab244(0x270))/0xd);if(_0x4226a0===_0x406e74)break;else _0x6c5814['push'](_0x6c5814['shift']());}catch(_0x303c1e){_0x6c5814['push'](_0x6c5814['shift']());}}}(a50_0x1338,0x9577c));import a50_0x17f5af from'chalk';import{existsSync}from'fs';import a50_0x51377e 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 a50_0xb9a0b4 from'prompts';function getAttemptStatusDisplay(_0x41bbe0){const _0x41b7fc=a50_0x1892;if(!_0x41bbe0)return{'icon':'⏳','text':''};const {done:_0x39775b,success:_0x402dd7,cancelRequested:_0x19ee44}=_0x41bbe0;if(!_0x39775b)return _0x19ee44?{'icon':'🛑','text':a50_0x17f5af[_0x41b7fc(0x2dd)]('canceling')}:{'icon':'🔄','text':a50_0x17f5af[_0x41b7fc(0x250)]('running')};if(_0x402dd7)return{'icon':'✅','text':a50_0x17f5af[_0x41b7fc(0x214)](_0x41b7fc(0x25a))};return{'icon':'❌','text':a50_0x17f5af[_0x41b7fc(0x1cc)](_0x41b7fc(0x1b9))};}export class WorkflowBaseCommand extends BaseCommand{[a50_0x474bcd(0x2ac)](_0x4b18ef,_0x5f4ae4,_0x3efd7a=0x0){const _0xf6e6ad=a50_0x474bcd;return _0x4b18ef[_0x3efd7a]||_0x5f4ae4[_0xf6e6ad(0x235)];}[a50_0x474bcd(0x23f)](_0x9a8276,_0x4765d8,_0x1dcb17=0x0){const _0x52949a=a50_0x474bcd,_0x44685c=this[_0x52949a(0x2ac)](_0x9a8276,_0x4765d8,_0x1dcb17);if(!_0x44685c)return console['error'](a50_0x17f5af[_0x52949a(0x1cc)](_0x52949a(0x176)),_0x52949a(0x289)),console[_0x52949a(0x1b9)](a50_0x17f5af[_0x52949a(0x1b6)](_0x52949a(0x1ad))),null;return _0x44685c;}[a50_0x474bcd(0x184)](_0xb54faa,_0xe42427){const _0x4a35df=a50_0x474bcd;if(_0xb54faa[0x0]){const _0x193951=_0xb54faa[0x0][_0x4a35df(0x2b7)]('.');if(_0x193951[_0x4a35df(0x27a)]===0x1)return{'projectName':_0x193951[0x0],'workflowName':undefined};else return _0x193951[_0x4a35df(0x27a)]===0x2?{'projectName':_0x193951[0x0],'workflowName':_0x193951[0x1]}:(console[_0x4a35df(0x1b9)](a50_0x17f5af[_0x4a35df(0x1cc)](_0x4a35df(0x176)),_0x4a35df(0x1f9)),null);}return{'projectName':_0xe42427['workflowProject'],'workflowName':undefined};}[a50_0x474bcd(0x1e8)](_0x2c3003,_0x31cd79,_0x16f763=0x0){const _0x3882fa=a50_0x474bcd;if(_0x2c3003[_0x16f763])return _0x2c3003[_0x16f763];if(_0x31cd79[_0x3882fa(0x235)]){const _0x2afc67=a50_0x51377e['join'](process[_0x3882fa(0x2c3)](),'workflows',_0x31cd79[_0x3882fa(0x235)]);if(existsSync(a50_0x51377e[_0x3882fa(0x2a9)](_0x2afc67,_0x3882fa(0x242))))return _0x2afc67;}return undefined;}async[a50_0x474bcd(0x2c8)](_0x27f9a2,_0x12d6b7,_0x5dd778){const _0x479cfe=a50_0x474bcd;try{const _0x5b0e36=await _0x27f9a2['workflow']['workflows'](_0x12d6b7,{'limit':0x1});if(_0x5b0e36['length']>0x0){const _0x193140=_0x5b0e36[0x0]['id'],_0x474130=getWorkflowUrl(_0x5dd778,_0x193140);console[_0x479cfe(0x1b9)]('\x20\x20Console:\x20'+a50_0x17f5af[_0x479cfe(0x24c)](_0x474130));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a50_0x474bcd(0x2ba)]=a50_0x474bcd(0x2a1);[a50_0x474bcd(0x299)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a50_0x474bcd(0x181)](_0xe447b9){const _0x1c1a6e=a50_0x474bcd,{options:_0x193546,args:_0x29e063,tdx:_0x255be0}=_0xe447b9,_0x2224e4=_0x29e063[0x0],_0x437b7c=_0x193546[_0x1c1a6e(0x153)];if(_0x437b7c)return saveSessionContext({'workflow_project':undefined},_0x193546[_0x1c1a6e(0x2d5)]),console[_0x1c1a6e(0x23a)](a50_0x17f5af[_0x1c1a6e(0x214)](_0x1c1a6e(0x234))),0x0;if(!_0x2224e4)return console[_0x1c1a6e(0x1b9)](a50_0x17f5af[_0x1c1a6e(0x1cc)](_0x1c1a6e(0x176)),_0x1c1a6e(0x289)),console[_0x1c1a6e(0x1b9)](a50_0x17f5af[_0x1c1a6e(0x1b6)](_0x1c1a6e(0x1ec))),console[_0x1c1a6e(0x1b9)](a50_0x17f5af[_0x1c1a6e(0x1b6)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x449f40=await withSpinner(_0x1c1a6e(0x154)+_0x2224e4+_0x1c1a6e(0x238),()=>_0x255be0[_0x1c1a6e(0x252)][_0x1c1a6e(0x18b)](_0x2224e4),{'verbose':_0x193546['verbose']}),{name:_0x529990}=_0x449f40['data'];return saveSessionContext({'workflow_project':_0x529990},_0x193546['session']),console['log'](a50_0x17f5af[_0x1c1a6e(0x214)](_0x1c1a6e(0x1b0)+a50_0x17f5af[_0x1c1a6e(0x24c)](_0x529990))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a50_0x474bcd(0x2ba)]=a50_0x474bcd(0x19c);[a50_0x474bcd(0x299)]=a50_0x474bcd(0x143);async[a50_0x474bcd(0x181)](_0x26aa4b){const _0x34dad6=a50_0x474bcd,{options:_0x4e91a0,args:_0x200a61,tdx:_0x28205e}=_0x26aa4b,_0x55cd7b=_0x200a61[0x0];_0x4e91a0[_0x34dad6(0x2bc)]&&_0x55cd7b&&console[_0x34dad6(0x1b9)]('Pattern:\x20'+_0x55cd7b);const _0x38f25a=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x28205e[_0x34dad6(0x252)][_0x34dad6(0x158)](_0x55cd7b,{'limit':_0x4e91a0['limit']}),{'verbose':_0x4e91a0[_0x34dad6(0x2bc)]});let _0x5d3255=_0x38f25a[_0x34dad6(0x1d5)];_0x5d3255[_0x34dad6(0x257)]((_0x3e0fb6,_0x29aa45)=>_0x3e0fb6[_0x34dad6(0x2ba)]['localeCompare'](_0x29aa45[_0x34dad6(0x2ba)]));const _0x342bbe=_0x4e91a0[_0x34dad6(0x1f3)]||0x64,_0x522d16=_0x5d3255['length']>=_0x342bbe?a50_0x17f5af[_0x34dad6(0x1b6)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x34dad6(0x1b9)](_0x34dad6(0x286)+_0x5d3255['length']+_0x34dad6(0x227)+(_0x5d3255[_0x34dad6(0x27a)]!==0x1?'s':'')+_0x522d16);if(_0x4e91a0[_0x34dad6(0x150)]==='json'||_0x4e91a0[_0x34dad6(0x150)]===_0x34dad6(0x1fd)||_0x4e91a0[_0x34dad6(0x150)]===_0x34dad6(0x276))await handleSDKOutput(_0x5d3255,_0x4e91a0);else{if(_0x5d3255[_0x34dad6(0x27a)]===0x0)_0x55cd7b?console[_0x34dad6(0x23a)](_0x34dad6(0x16c)+_0x55cd7b):console[_0x34dad6(0x23a)](_0x34dad6(0x180));else{const _0x105e14=_0x5d3255['map'](_0x5d3ca5=>{const _0x1a0632=_0x34dad6,_0x20192a=_0x5d3ca5[_0x1a0632(0x1b8)]?.[_0x1a0632(0x1ce)](_0x27c6ef=>_0x27c6ef[_0x1a0632(0x21a)]===_0x1a0632(0x2bd)),_0x2315ca=_0x20192a?a50_0x17f5af[_0x1a0632(0x1b6)](_0x1a0632(0x22d)):'';return'📁\x20'+_0x5d3ca5[_0x1a0632(0x2ba)]+_0x2315ca;});await writeOutput(_0x105e14[_0x34dad6(0x2a9)]('\x0a'),_0x4e91a0[_0x34dad6(0x273)],_0x34dad6(0x1b7));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a50_0x474bcd(0x2d1);[a50_0x474bcd(0x299)]=a50_0x474bcd(0x283);async[a50_0x474bcd(0x181)](_0x36f54f){const _0x58d8c4=a50_0x474bcd,{options:_0x42e35a,args:_0x554563,tdx:_0x188eeb}=_0x36f54f,_0x3ecf9f=this[_0x58d8c4(0x2ac)](_0x554563,_0x42e35a);_0x42e35a['verbose']&&_0x3ecf9f&&console[_0x58d8c4(0x1b9)](_0x58d8c4(0x274)+_0x3ecf9f);const _0x57dfce=await withSpinner(_0x58d8c4(0x279),()=>_0x188eeb['workflow']['workflows'](_0x3ecf9f,{'limit':_0x42e35a[_0x58d8c4(0x1f3)]}),{'verbose':_0x42e35a[_0x58d8c4(0x2bc)]});let _0x111563=_0x57dfce[_0x58d8c4(0x1d5)];_0x111563['sort']((_0x453352,_0x10c7c6)=>{const _0x53a2b7=_0x58d8c4,_0xd3490c=_0x453352['name']['localeCompare'](_0x10c7c6[_0x53a2b7(0x2ba)]);if(_0xd3490c!==0x0)return _0xd3490c;return(_0x453352[_0x53a2b7(0x166)]?.[_0x53a2b7(0x2ba)]||'')[_0x53a2b7(0x1e5)](_0x10c7c6[_0x53a2b7(0x166)]?.[_0x53a2b7(0x2ba)]||'');});const _0x3eefc7=_0x42e35a['limit']||0x64,_0x2c87a1=_0x111563[_0x58d8c4(0x27a)]>=_0x3eefc7?a50_0x17f5af['dim'](_0x58d8c4(0x1da)):'';console[_0x58d8c4(0x1b9)](_0x58d8c4(0x286)+_0x111563[_0x58d8c4(0x27a)]+'\x20workflow'+(_0x111563[_0x58d8c4(0x27a)]!==0x1?'s':'')+_0x2c87a1);if(_0x42e35a['format']===_0x58d8c4(0x170)||_0x42e35a[_0x58d8c4(0x150)]==='jsonl'||_0x42e35a['format']===_0x58d8c4(0x276))await handleSDKOutput(_0x111563,_0x42e35a);else{if(_0x111563['length']===0x0)_0x3ecf9f?console['log']('No\x20workflows\x20found\x20in\x20project:\x20'+_0x3ecf9f):console[_0x58d8c4(0x23a)]('No\x20workflows\x20found');else{const _0x1f86b9=_0x42e35a[_0x58d8c4(0x264)],_0x5a2c2f=_0x111563['map'](_0x5b09a5=>{const _0xd33637=_0x58d8c4,_0x5131b9=a50_0x17f5af[_0xd33637(0x1b6)]('#'+_0x5b09a5['id']),_0x3dd0b2=hyperlink(_0x5131b9,getWorkflowUrl(_0x1f86b9,_0x5b09a5['id'])),_0x44514b=_0x5b09a5[_0xd33637(0x166)]?.['name']?a50_0x17f5af['dim']('\x20('+_0x5b09a5['project'][_0xd33637(0x2ba)]+')'):'';return _0xd33637(0x20f)+_0x3dd0b2+'\x20'+_0x5b09a5[_0xd33637(0x2ba)]+_0x44514b;});await writeOutput(_0x5a2c2f[_0x58d8c4(0x2a9)]('\x0a'),_0x42e35a[_0x58d8c4(0x273)],_0x58d8c4(0x1b7));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a50_0x474bcd(0x2ba)]=a50_0x474bcd(0x2a4);[a50_0x474bcd(0x299)]=a50_0x474bcd(0x148);async[a50_0x474bcd(0x181)](_0xfb17a1){const _0x2c3028=a50_0x474bcd,{options:_0x3c10aa,args:_0x1a1134,tdx:_0x1291f7}=_0xfb17a1,_0x4b8dc2=this['parseProjectWorkflowPattern'](_0x1a1134,_0x3c10aa);if(!_0x4b8dc2)return 0x1;const {projectName:_0x15f2b1,workflowName:_0x81cf21}=_0x4b8dc2;if(_0x3c10aa[_0x2c3028(0x2bc)]){if(_0x15f2b1&&_0x81cf21)console[_0x2c3028(0x1b9)](_0x2c3028(0x21b)+_0x15f2b1+'.'+_0x81cf21);else _0x15f2b1&&console[_0x2c3028(0x1b9)]('Filter:\x20project='+_0x15f2b1);const _0x422b38=_0x3c10aa[_0x2c3028(0x14b)];_0x422b38&&console['error'](_0x2c3028(0x152)+_0x422b38);}let _0xb6fea1=0x28;if(process[_0x2c3028(0x267)][_0x2c3028(0x251)]&&!_0x3c10aa[_0x2c3028(0x273)]&&!_0x3c10aa['format']){const _0x1b56f5=process[_0x2c3028(0x267)][_0x2c3028(0x1cf)]||0x28;_0xb6fea1=Math[_0x2c3028(0x1e6)](0x14,Math[_0x2c3028(0x2c9)](_0x1b56f5*0x2/0x3));}const _0x3bc436=_0x3c10aa['limit']||_0xb6fea1,_0x586275=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x1291f7['workflow'][_0x2c3028(0x185)]({'projectName':_0x15f2b1,'workflowName':_0x81cf21,'status':_0x3c10aa[_0x2c3028(0x14b)],'fromTime':_0x3c10aa[_0x2c3028(0x228)],'toTime':_0x3c10aa['to'],'limit':_0x3bc436}),{'verbose':_0x3c10aa[_0x2c3028(0x2bc)]}),_0x5ea304=_0x586275[_0x2c3028(0x1d5)];_0x5ea304['sort']((_0x10733e,_0x23668f)=>{const _0x4ea529=_0x2c3028,_0x27b681=_0x10733e[_0x4ea529(0x1a7)]||'',_0x56c088=_0x23668f[_0x4ea529(0x1a7)]||'';return _0x56c088[_0x4ea529(0x1e5)](_0x27b681);});_0x5ea304[_0x2c3028(0x27a)]>=_0x3bc436?console[_0x2c3028(0x1b9)](_0x2c3028(0x26b)+_0x5ea304['length']+_0x2c3028(0x25e)+a50_0x17f5af[_0x2c3028(0x1b6)](_0x2c3028(0x22c))):console[_0x2c3028(0x1b9)](_0x2c3028(0x286)+_0x5ea304['length']+_0x2c3028(0x1dd)+(_0x5ea304[_0x2c3028(0x27a)]!==0x1?'s':''));if(_0x3c10aa['format']===_0x2c3028(0x170)||_0x3c10aa[_0x2c3028(0x150)]===_0x2c3028(0x1fd)||_0x3c10aa[_0x2c3028(0x150)]===_0x2c3028(0x276))await handleSDKOutput(_0x5ea304,_0x3c10aa);else{if(!process['stdout'][_0x2c3028(0x251)]||_0x3c10aa['output']){if(_0x5ea304[_0x2c3028(0x27a)]===0x0){if(_0x15f2b1&&_0x81cf21)console[_0x2c3028(0x23a)](_0x2c3028(0x2d2)+_0x15f2b1+'.'+_0x81cf21);else _0x15f2b1?console['log'](_0x2c3028(0x29e)+_0x15f2b1):console[_0x2c3028(0x23a)]('No\x20sessions\x20found');}else{const _0x304e04=_0x3c10aa['site'],_0x39f37f=this['renderSessionsTimeline'](_0x5ea304,_0x304e04);_0x3c10aa[_0x2c3028(0x273)]?await writeOutput(_0x39f37f,_0x3c10aa['output'],'list'):console[_0x2c3028(0x23a)](_0x39f37f);}!_0x15f2b1&&(console[_0x2c3028(0x1b9)](''),console[_0x2c3028(0x1b9)](a50_0x17f5af[_0x2c3028(0x1b6)](_0x2c3028(0x2b1))),console[_0x2c3028(0x1b9)](a50_0x17f5af[_0x2c3028(0x1b6)](_0x2c3028(0x18e))+'or'+a50_0x17f5af[_0x2c3028(0x1b6)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x5ea304[_0x2c3028(0x27a)]===0x0){if(_0x15f2b1&&_0x81cf21)console['log'](_0x2c3028(0x2d2)+_0x15f2b1+'.'+_0x81cf21);else _0x15f2b1?console['log'](_0x2c3028(0x29e)+_0x15f2b1):console['log']('No\x20sessions\x20found');}else await this[_0x2c3028(0x253)](_0x5ea304,_0xfb17a1,_0x15f2b1);}}return 0x0;}[a50_0x474bcd(0x231)](_0x220663,_0x4fc1c3){const _0x3a0b78=a50_0x474bcd,_0x490453=[],_0x68c4e=new Map();let _0x5af11a=Infinity,_0x37699e=-Infinity;for(const _0x4f7f08 of _0x220663){if(_0x4f7f08['lastAttempt']?.['createdAt']){const _0xfc2122=new Date(_0x4f7f08[_0x3a0b78(0x2d8)][_0x3a0b78(0x2b2)])['getTime'](),_0x217719=_0x4f7f08[_0x3a0b78(0x2d8)][_0x3a0b78(0x1a1)]?new Date(_0x4f7f08[_0x3a0b78(0x2d8)]['finishedAt'])['getTime']():Date[_0x3a0b78(0x1f2)](),_0x33d621=_0x4f7f08[_0x3a0b78(0x166)]?.[_0x3a0b78(0x2ba)]||_0x3a0b78(0x2a2);!_0x68c4e['has'](_0x33d621)&&_0x68c4e['set'](_0x33d621,[]),_0x68c4e[_0x3a0b78(0x169)](_0x33d621)[_0x3a0b78(0x29a)]({'session':_0x4f7f08,'startTime':_0xfc2122,'endTime':_0x217719,'duration':_0x217719-_0xfc2122}),_0x5af11a=Math[_0x3a0b78(0x2d9)](_0x5af11a,_0xfc2122),_0x37699e=Math['max'](_0x37699e,_0x217719);}}if(_0x68c4e[_0x3a0b78(0x1eb)]===0x0)return _0x3a0b78(0x226);const _0xbf0e89=process[_0x3a0b78(0x267)]['columns']||0x78,_0x4953ef=0x1e,_0x4322d8=0x32,_0x362f93=0x4,_0x5e2196=Math['min'](_0x4322d8,Math[_0x3a0b78(0x1e6)](_0x4953ef,Math['floor'](_0xbf0e89*0.3))),_0x112143=_0xbf0e89-_0x5e2196-TIMELINE_CONFIG['GUTTER']-0x3-_0x362f93,_0x1dca0c=_0x37699e-_0x5af11a,_0x2cc6a6=_0x1dca0c/_0x5e2196,_0x1089e2=renderTimeAxis({'startTime':_0x5af11a,'endTime':_0x37699e,'durationMs':_0x1dca0c,'msPerChar':_0x2cc6a6},_0x5e2196),_0x2e38b0=[];for(const _0x3a76d0 of _0x68c4e[_0x3a0b78(0x268)]()){_0x2e38b0[_0x3a0b78(0x29a)](..._0x3a76d0);}_0x2e38b0[_0x3a0b78(0x257)]((_0x3f959a,_0x440d4a)=>_0x440d4a['startTime']-_0x3f959a[_0x3a0b78(0x1fa)]);const _0x219489=new Date(_0x5af11a),_0x213c49=formatDate(_0x219489),_0x25d82a=_0x362f93+TIMELINE_CONFIG[_0x3a0b78(0x2be)]+TIMELINE_CONFIG['ICON_SPACING']+_0x112143,_0x302bbb='\x20'['repeat'](_0x25d82a-_0x213c49[_0x3a0b78(0x27a)]),_0x4b7c0f=_0x302bbb+a50_0x17f5af[_0x3a0b78(0x1b6)](_0x213c49)+'\x20'+_0x1089e2;_0x490453[_0x3a0b78(0x29a)](_0x4b7c0f);const _0x4defa1=0x16;let _0x55d2e4=0x0;for(const _0x357707 of _0x2e38b0){const _0x337a08=_0x357707['session'][_0x3a0b78(0x166)]?.['name']||'?',_0x32dee1=Math[_0x3a0b78(0x2d9)](stringWidth(_0x337a08),_0x4defa1);_0x55d2e4=Math['max'](_0x55d2e4,_0x32dee1);}for(const _0x5e2471 of _0x2e38b0){const {session:_0x44b79e,startTime:_0x1c11cd,endTime:_0x3c2b09,duration:_0x5634ce}=_0x5e2471,_0x5129cf=_0x44b79e[_0x3a0b78(0x166)]?.['id'],_0x535b81=_0x44b79e['id'],_0x459259=_0x44b79e[_0x3a0b78(0x166)]?.['name']||'?',_0x1ce1c3=_0x44b79e[_0x3a0b78(0x252)]?.[_0x3a0b78(0x2ba)]||'?';let _0x27e2d7,_0x4698cd;if(_0x44b79e[_0x3a0b78(0x2d8)]){const _0x7951cf=_0x44b79e['lastAttempt'];!_0x7951cf['done']?(_0x27e2d7=_0x7951cf[_0x3a0b78(0x1d6)]?'🛑':'🔄',_0x4698cd=_0x7951cf['cancelRequested']?a50_0x17f5af[_0x3a0b78(0x2dd)]:a50_0x17f5af[_0x3a0b78(0x250)]):(_0x27e2d7=_0x7951cf['success']?'✅':'❌',_0x4698cd=_0x7951cf[_0x3a0b78(0x25a)]?a50_0x17f5af[_0x3a0b78(0x214)]:a50_0x17f5af[_0x3a0b78(0x1cc)]);}else _0x27e2d7='⏳',_0x4698cd=a50_0x17f5af[_0x3a0b78(0x1b6)];const _0x2deb08='#'+_0x535b81,_0x401355=_0x5129cf?hyperlink(_0x2deb08,getWorkflowSessionUrl(_0x4fc1c3,_0x5129cf,_0x535b81)):_0x2deb08;let _0xd6453c=_0x459259;stringWidth(_0x459259)>_0x4defa1&&(_0xd6453c=_0x459259[_0x3a0b78(0x236)](0x0,_0x4defa1-0x1)+'…');const _0xb1ecad=a50_0x17f5af[_0x3a0b78(0x1b6)](_0xd6453c),_0x503ab0=stringWidth(_0xd6453c),_0x133f29='\x20'[_0x3a0b78(0x2cc)](_0x55d2e4-stringWidth(_0xd6453c)+0x2),_0x3126b9='('+formatElapsed(_0x5634ce)+')',_0x27a3d7=stringWidth(_0x3126b9),_0x5d3ce7=stringWidth(_0x2deb08),_0x1c1e6e=_0x5d3ce7+0x1+_0x503ab0+_0x133f29[_0x3a0b78(0x27a)],_0x3b10dc=_0x112143-_0x1c1e6e-_0x27a3d7-0x1-0x8;let _0x59939e=_0x1ce1c3;stringWidth(_0x59939e)>_0x3b10dc&&(_0x59939e=_0x59939e[_0x3a0b78(0x236)](0x0,_0x3b10dc-0x1)+'…');const _0x2c25fc=_0x401355+'\x20'+_0xb1ecad+_0x133f29+_0x59939e,_0x5ca82e=stringWidth(_0x2c25fc),_0x370086=_0x112143-_0x5ca82e-_0x27a3d7,_0x33acc2=_0x2c25fc+'\x20'[_0x3a0b78(0x2cc)](Math[_0x3a0b78(0x1e6)](0x1,_0x370086))+a50_0x17f5af[_0x3a0b78(0x1b6)](_0x3126b9),_0x3f0e59=Math[_0x3a0b78(0x2c9)]((_0x1c11cd-_0x5af11a)/_0x2cc6a6),_0x125cee=Math[_0x3a0b78(0x2c9)]((_0x3c2b09-_0x5af11a)/_0x2cc6a6),_0x1fcc1f=Math[_0x3a0b78(0x1e6)](_0x3f0e59+0x1,_0x125cee),_0x29b7c9=new Array(_0x5e2196)[_0x3a0b78(0x1d2)]('\x20');for(let _0x3d8163=_0x3f0e59;_0x3d8163<Math[_0x3a0b78(0x2d9)](_0x1fcc1f,_0x5e2196);_0x3d8163++){_0x29b7c9[_0x3d8163]='─';}const _0x4f8207=_0x29b7c9['map'](_0x30d964=>_0x30d964==='\x20'?'\x20':_0x4698cd(_0x30d964))[_0x3a0b78(0x2a9)]('');_0x490453[_0x3a0b78(0x29a)](_0x27e2d7+'\x20'+_0x33acc2+'│'+_0x4f8207+'│');}return _0x490453[_0x3a0b78(0x2a9)]('\x0a');}async[a50_0x474bcd(0x253)](_0x3fc9e4,_0x4a73c6,_0x164350){const _0x5bfb18=a50_0x474bcd,{options:_0x541c2d,tdx:_0x2b3d0b}=_0x4a73c6,_0x1d2c26=_0x541c2d[_0x5bfb18(0x264)],{timelineRows:_0x1b1bb0,timeAxisHeader:_0x6b457a}=this[_0x5bfb18(0x1d3)](_0x3fc9e4,_0x1d2c26),_0x403e0e=_0x1b1bb0['filter'](_0x5cf7ad=>_0x5cf7ad[_0x5bfb18(0x1ea)]);if(_0x403e0e[_0x5bfb18(0x27a)]===0x0){const _0x2438e6=this[_0x5bfb18(0x231)](_0x3fc9e4,_0x1d2c26);console[_0x5bfb18(0x23a)](_0x2438e6);!_0x164350&&(console['error'](''),console[_0x5bfb18(0x1b9)](a50_0x17f5af[_0x5bfb18(0x1b6)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x5bfb18(0x1b9)](a50_0x17f5af[_0x5bfb18(0x1b6)](_0x5bfb18(0x18e))+'or'+a50_0x17f5af[_0x5bfb18(0x1b6)](_0x5bfb18(0x209))));return;}_0x6b457a&&console['log'](_0x6b457a);const _0x4cf89d=_0x1b1bb0[_0x5bfb18(0x26f)](_0x1a0748=>_0x1a0748[_0x5bfb18(0x1ea)])[_0x5bfb18(0x2cf)](_0x2a2703=>({'title':_0x2a2703[_0x5bfb18(0x212)],'value':_0x2a2703[_0x5bfb18(0x1ea)]})),_0x492e8e=process[_0x5bfb18(0x267)]['rows']||0x3c,_0x4898b1=Math[_0x5bfb18(0x1e6)](0x28,Math['floor'](_0x492e8e*0x2/0x3)),_0x1b049a=await a50_0xb9a0b4({'type':_0x5bfb18(0x1d8),'name':'attemptId','message':_0x5bfb18(0x26c),'choices':_0x4cf89d,'initial':-0x1,'limit':_0x4898b1,'clearFirst':!![],'fallback':{'title':_0x5bfb18(0x25b),'value':null},'suggest':(_0x4bbc09,_0x32a082)=>{const _0x499727=_0x5bfb18;if(!_0x4bbc09)return Promise['resolve'](_0x32a082);const _0x2e8543=_0x32a082[_0x499727(0x26f)](_0x212145=>{const _0x3430f0=_0x499727,_0x59a971=_0x212145;return _0x59a971['title']['toLowerCase']()['includes'](_0x4bbc09[_0x3430f0(0x172)]());});return Promise['resolve'](_0x2e8543);}}),_0x108cfc=()=>{const _0x4339b3=_0x5bfb18;process[_0x4339b3(0x267)][_0x4339b3(0x1dc)](_0x4339b3(0x23d)),process[_0x4339b3(0x267)]['write'](_0x4339b3(0x23d)),process['stdout'][_0x4339b3(0x1dc)](_0x4339b3(0x23d));},_0x3e4185=_0x1b049a&&_0x1b049a[_0x5bfb18(0x1ea)]&&_0x1b049a['attemptId']!==null&&_0x1b049a['attemptId']['trim']()!=='';if(!_0x3e4185){_0x108cfc(),console[_0x5bfb18(0x23a)](a50_0x17f5af[_0x5bfb18(0x1b6)](_0x5bfb18(0x2d6)));return;}_0x108cfc();const _0xc235c8=_0x3fc9e4[_0x5bfb18(0x1fe)](_0x29d687=>_0x29d687[_0x5bfb18(0x2d8)]?.['id']===_0x1b049a['attemptId']);if(_0xc235c8){const _0x4dd806=_0xc235c8[_0x5bfb18(0x166)]?.[_0x5bfb18(0x2ba)]||'?',_0x54526f=_0xc235c8[_0x5bfb18(0x252)]?.[_0x5bfb18(0x2ba)]||'?';console[_0x5bfb18(0x23a)](_0x5bfb18(0x211)+a50_0x17f5af[_0x5bfb18(0x1b6)](_0x4dd806)+_0x5bfb18(0x263)+a50_0x17f5af[_0x5bfb18(0x1b6)](_0x54526f));}const _0x5be0b9=new WorkflowTimelineCommand();await _0x5be0b9[_0x5bfb18(0x181)]({'args':[],'options':{..._0x541c2d,'attemptId':_0x1b049a['attemptId']},'tdx':_0x2b3d0b});}[a50_0x474bcd(0x1d3)](_0x3894eb,_0x3a9318){const _0x41a5ce=a50_0x474bcd,_0x531f0c=new Map();for(const _0x1f0b0b of _0x3894eb){_0x1f0b0b['id']&&_0x1f0b0b[_0x41a5ce(0x2d8)]?.['id']&&_0x531f0c['set'](_0x1f0b0b['id'],_0x1f0b0b[_0x41a5ce(0x2d8)]['id']);}const _0x448437=[];let _0x51ef35='';const _0x564441=this[_0x41a5ce(0x231)](_0x3894eb,_0x3a9318),_0x4d7ab0=_0x564441[_0x41a5ce(0x2b7)]('\x0a');for(const _0x4e1360 of _0x4d7ab0){if(_0x4e1360['startsWith']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x4e1360[_0x41a5ce(0x2ad)](/^\s+\d{4}-\d{2}-\d{2}/))_0x51ef35=_0x4e1360;else{if(_0x4e1360[_0x41a5ce(0x2ad)](/^[✅❌🔄🛑⏳]/)){const _0x55c739=_0x4e1360['match'](/#(\d+)/),_0x3a7cba=_0x55c739?_0x55c739[0x1]:null,_0x3fcffc=_0x3a7cba?_0x531f0c[_0x41a5ce(0x169)](_0x3a7cba)||null:null,_0xc8b3f0=_0x3894eb[_0x41a5ce(0x1fe)](_0x927db0=>_0x927db0['id']===_0x3a7cba),_0x145cdf=_0xc8b3f0?.[_0x41a5ce(0x166)]?.[_0x41a5ce(0x2ba)]||'';_0x448437[_0x41a5ce(0x29a)]({'displayLine':_0x4e1360,'attemptId':_0x3fcffc,'projectName':_0x145cdf});}}}return{'timelineRows':_0x448437,'timeAxisHeader':_0x51ef35};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a50_0x474bcd(0x2ba)]='workflow:attempts';['description']=a50_0x474bcd(0x23c);async[a50_0x474bcd(0x181)](_0x380272){const _0x20ceef=a50_0x474bcd,{options:_0x235f4f,args:_0x5a2054,tdx:_0x1a09e0}=_0x380272,_0x13776f=this['parseProjectWorkflowPattern'](_0x5a2054,_0x235f4f);if(!_0x13776f)return 0x1;const {projectName:_0x29bb1e,workflowName:_0x4f3150}=_0x13776f,_0x1e61e4=_0x235f4f[_0x20ceef(0x171)];if(_0x235f4f[_0x20ceef(0x2bc)]){if(_0x29bb1e&&_0x4f3150)console[_0x20ceef(0x1b9)](_0x20ceef(0x21b)+_0x29bb1e+'.'+_0x4f3150);else _0x29bb1e&&console[_0x20ceef(0x1b9)](_0x20ceef(0x162)+_0x29bb1e);_0x1e61e4&&console['error']('Include\x20retried:\x20yes');}const _0x52c7ee=await withSpinner(_0x20ceef(0x282),()=>_0x1a09e0[_0x20ceef(0x252)]['attempts']({'projectName':_0x29bb1e,'workflowName':_0x4f3150,'includeRetried':_0x1e61e4,'limit':_0x235f4f[_0x20ceef(0x1f3)]}),{'verbose':_0x235f4f[_0x20ceef(0x2bc)]}),_0x5dde16=_0x52c7ee[_0x20ceef(0x1d5)],_0x13beb7=_0x235f4f[_0x20ceef(0x1f3)]||0x64,_0x1ddc67=_0x5dde16['length']>=_0x13beb7?a50_0x17f5af[_0x20ceef(0x1b6)](_0x20ceef(0x1da)):'';console[_0x20ceef(0x1b9)](_0x20ceef(0x286)+_0x5dde16[_0x20ceef(0x27a)]+'\x20attempt'+(_0x5dde16['length']!==0x1?'s':'')+_0x1ddc67);if(_0x235f4f[_0x20ceef(0x150)]===_0x20ceef(0x170)||_0x235f4f[_0x20ceef(0x150)]==='jsonl'||_0x235f4f[_0x20ceef(0x150)]===_0x20ceef(0x276))await handleSDKOutput(_0x5dde16,_0x235f4f);else{if(_0x5dde16[_0x20ceef(0x27a)]===0x0){if(_0x29bb1e&&_0x4f3150)console[_0x20ceef(0x23a)](_0x20ceef(0x2a7)+_0x29bb1e+'.'+_0x4f3150);else _0x29bb1e?console[_0x20ceef(0x23a)](_0x20ceef(0x265)+_0x29bb1e):console[_0x20ceef(0x23a)](_0x20ceef(0x1bf));}else{const _0x5b2e34=_0x235f4f[_0x20ceef(0x264)],_0xdba986=_0x5dde16[_0x20ceef(0x2cf)](_0x22d535=>{const _0x12cc70=_0x20ceef,_0x17fe95=a50_0x17f5af[_0x12cc70(0x1b6)]('#'+_0x22d535['id']),_0x455e80=_0x22d535[_0x12cc70(0x166)]?.['id'],_0x44ff08=_0x22d535[_0x12cc70(0x294)]||_0x22d535[_0x12cc70(0x174)],_0x3d03a7=_0x455e80&&_0x44ff08?hyperlink(_0x17fe95,getWorkflowAttemptUrl(_0x5b2e34,_0x455e80,_0x44ff08,_0x22d535['id'])):_0x17fe95,{icon:_0x1b8f93,text:_0x5d8628}=getAttemptStatusDisplay(_0x22d535),_0x1e933e=(_0x22d535['project']?.[_0x12cc70(0x2ba)]||'?')+'.'+(_0x22d535[_0x12cc70(0x252)]?.[_0x12cc70(0x2ba)]||'?'),_0x22cc59=_0x22d535['sessionTime']?a50_0x17f5af[_0x12cc70(0x1b6)](_0x22d535[_0x12cc70(0x1a7)]):'';return(_0x3d03a7+'\x20'+_0x1b8f93+(_0x5d8628?'\x20'+_0x5d8628:'')+'\x20'+_0x1e933e+'\x20'+_0x22cc59)['trimEnd']();});await writeOutput(_0xdba986[_0x20ceef(0x2a9)]('\x0a'),_0x235f4f[_0x20ceef(0x273)],_0x20ceef(0x1b7));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a50_0x474bcd(0x2ba)]=a50_0x474bcd(0x2c1);['description']=a50_0x474bcd(0x186);async[a50_0x474bcd(0x181)](_0x2e2407){const _0x4f87a3=a50_0x474bcd,{options:_0x13de46,args:_0x4f3dae,tdx:_0x3e1ef9}=_0x2e2407,_0x5a5905=_0x4f3dae[0x0];if(!_0x5a5905)return console[_0x4f87a3(0x1b9)](_0x4f87a3(0x160)),0x1;_0x13de46[_0x4f87a3(0x2bc)]&&console[_0x4f87a3(0x1b9)]('Attempt\x20ID:\x20'+_0x5a5905);const _0x1a81fe=await withSpinner(_0x4f87a3(0x1ab),()=>_0x3e1ef9[_0x4f87a3(0x252)][_0x4f87a3(0x1f4)](_0x5a5905),{'verbose':_0x13de46[_0x4f87a3(0x2bc)]}),_0x219b27=_0x1a81fe[_0x4f87a3(0x1d5)];let _0x233c39;!_0x219b27[_0x4f87a3(0x21f)]?_0x233c39=_0x219b27[_0x4f87a3(0x1d6)]?_0x4f87a3(0x1c4):_0x4f87a3(0x1d4):_0x233c39=_0x219b27[_0x4f87a3(0x25a)]?'success':_0x4f87a3(0x1b9);let _0x1eedc0;if(_0x219b27[_0x4f87a3(0x2b2)]&&_0x219b27['finishedAt']){const _0x245b95=new Date(_0x219b27[_0x4f87a3(0x2b2)])[_0x4f87a3(0x1f5)](),_0x23dea2=new Date(_0x219b27[_0x4f87a3(0x1a1)])[_0x4f87a3(0x1f5)]();_0x1eedc0=Math[_0x4f87a3(0x28e)]((_0x23dea2-_0x245b95)/0x3e8);}const _0x1c67ca={'attempt_id':_0x219b27['id'],'status':_0x233c39,..._0x219b27[_0x4f87a3(0x23e)]!==undefined&&{'index':_0x219b27['index']},..._0x219b27['project']&&{'project':_0x219b27[_0x4f87a3(0x166)][_0x4f87a3(0x2ba)]},..._0x219b27[_0x4f87a3(0x252)]&&{'workflow':_0x219b27[_0x4f87a3(0x252)][_0x4f87a3(0x2ba)]},..._0x219b27[_0x4f87a3(0x174)]&&{'session_id':_0x219b27[_0x4f87a3(0x174)]},..._0x219b27['sessionTime']&&{'session_time':_0x219b27[_0x4f87a3(0x1a7)]},..._0x219b27['retryAttemptName']&&{'retry_attempt':_0x219b27[_0x4f87a3(0x254)]},..._0x1eedc0!==undefined&&{'duration_sec':_0x1eedc0},..._0x219b27['createdAt']&&{'created_at':_0x219b27[_0x4f87a3(0x2b2)]},..._0x219b27['finishedAt']&&{'finished_at':_0x219b27[_0x4f87a3(0x1a1)]},...Object[_0x4f87a3(0x223)](_0x219b27[_0x4f87a3(0x15f)])[_0x4f87a3(0x27a)]>0x0&&{'params':_0x219b27[_0x4f87a3(0x15f)]}};return await handleSingleObjectOutput(_0x1c67ca,_0x13de46),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a50_0x474bcd(0x2ba)]=a50_0x474bcd(0x203);[a50_0x474bcd(0x299)]=a50_0x474bcd(0x249);async[a50_0x474bcd(0x181)](_0x1abff6){const _0x26cc77=a50_0x474bcd,{options:_0x3373f9,args:_0x525402,tdx:_0x1cf9b8}=_0x1abff6,_0x136995=_0x525402[0x0];if(!_0x136995)return console[_0x26cc77(0x1b9)](_0x26cc77(0x160)),0x1;const _0x1a7799=_0x3373f9[_0x26cc77(0x1f8)];_0x3373f9[_0x26cc77(0x2bc)]&&(console[_0x26cc77(0x1b9)](_0x26cc77(0x25f)+_0x136995),_0x1a7799&&console['error'](_0x26cc77(0x2b3)));const _0x10dd25=await withSpinner(_0x26cc77(0x1af),()=>_0x1cf9b8['workflow']['tasks'](_0x136995,_0x1a7799||![]),{'verbose':_0x3373f9[_0x26cc77(0x2bc)]}),_0x5c721f=_0x10dd25[_0x26cc77(0x1d5)];return console['error'](_0x26cc77(0x286)+_0x5c721f[_0x26cc77(0x27a)]+_0x26cc77(0x19e)+(_0x5c721f[_0x26cc77(0x27a)]!==0x1?'s':'')),await handleSDKOutput(_0x5c721f,_0x3373f9),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a50_0x474bcd(0x2dc);[a50_0x474bcd(0x299)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x3c2069){const _0x338b31=a50_0x474bcd,{options:_0x2a8c0e,args:_0x4b17cb,tdx:_0x41a09a}=_0x3c2069,_0x21074f=_0x4b17cb[0x0];let _0x26c1ea=_0x4b17cb[0x1];if(!_0x21074f)return console[_0x338b31(0x1b9)](_0x338b31(0x160)),0x1;_0x2a8c0e[_0x338b31(0x2bc)]&&(console[_0x338b31(0x1b9)](_0x338b31(0x25f)+_0x21074f),_0x26c1ea&&console[_0x338b31(0x1b9)](_0x338b31(0x1c6)+_0x26c1ea));const _0x4eef33=await withSpinner(_0x338b31(0x18a),()=>_0x41a09a[_0x338b31(0x252)][_0x338b31(0x1c9)](_0x21074f,_0x26c1ea),{'verbose':_0x2a8c0e[_0x338b31(0x2bc)]}),_0x1c0471=_0x4eef33[_0x338b31(0x1d5)];if(_0x1c0471['length']===0x0)return console[_0x338b31(0x1b9)](_0x338b31(0x213)),0x0;if(!_0x26c1ea&&(_0x2a8c0e[_0x338b31(0x170)]||_0x2a8c0e[_0x338b31(0x150)]))return await handleSDKOutput(_0x1c0471,_0x2a8c0e),0x0;if(!_0x26c1ea){const _0x13e52e=_0x1c0471[_0x338b31(0x2cf)](_0x46b687=>({'title':_0x46b687[_0x338b31(0x14e)]+'\x20('+formatBytes(_0x46b687[_0x338b31(0x147)])+')','value':_0x46b687['taskName']})),_0x2d139c=await a50_0xb9a0b4({'type':_0x338b31(0x161),'name':_0x338b31(0x1fb),'message':_0x338b31(0x298),'choices':_0x13e52e});if(!_0x2d139c[_0x338b31(0x1fb)])return console[_0x338b31(0x1b9)](_0x338b31(0x2d6)),0x0;_0x26c1ea=_0x2d139c[_0x338b31(0x1fb)];}const _0x14d85a=await withSpinner('Downloading\x20logs...',()=>_0x41a09a[_0x338b31(0x252)][_0x338b31(0x144)](_0x21074f,_0x26c1ea),{'verbose':_0x2a8c0e[_0x338b31(0x2bc)]}),_0x373ca5=_0x14d85a[_0x338b31(0x1d5)];return _0x373ca5?console['log'](_0x373ca5):console[_0x338b31(0x1b9)](_0x338b31(0x292)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a50_0x474bcd(0x2ba)]=a50_0x474bcd(0x256);[a50_0x474bcd(0x299)]=a50_0x474bcd(0x149);async[a50_0x474bcd(0x181)](_0x40be6e){const _0x3eb9c4=a50_0x474bcd,{options:_0x5807bc,args:_0x207b92,tdx:_0x111825}=_0x40be6e,_0x559388=_0x207b92[0x0];if(!_0x559388)return console['error'](_0x3eb9c4(0x160)),0x1;const _0x852fd4=_0x5807bc[_0x3eb9c4(0x245)];_0x5807bc[_0x3eb9c4(0x2bc)]&&(console['error']('Attempt\x20ID:\x20'+_0x559388),_0x852fd4&&console['error'](_0x3eb9c4(0x1ef)+_0x852fd4));if(!_0x5807bc[_0x3eb9c4(0x2bb)]){if(!isInteractive())return console['error'](a50_0x17f5af[_0x3eb9c4(0x1cc)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3eb9c4(0x1b9)](a50_0x17f5af[_0x3eb9c4(0x1b6)](_0x3eb9c4(0x210))),0x1;const _0x52df7d=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x559388+'?');if(!_0x52df7d)return console[_0x3eb9c4(0x1b9)](a50_0x17f5af[_0x3eb9c4(0x2dd)](_0x3eb9c4(0x2d6))),0x1;}const _0x29ba2a=await withSpinner(_0x3eb9c4(0x247),()=>_0x111825['workflow'][_0x3eb9c4(0x21c)](_0x559388,_0x852fd4),{'verbose':_0x5807bc[_0x3eb9c4(0x2bc)]}),_0xb604c1=_0x29ba2a[_0x3eb9c4(0x1d5)];return console[_0x3eb9c4(0x1b9)]('✔\x20'+_0xb604c1),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a50_0x474bcd(0x2ba)]='workflow:retry';['description']='Retry\x20a\x20session\x20or\x20attempt';async['execute'](_0x44739c){const _0x37d413=a50_0x474bcd,{options:_0x539b19,args:_0x3f8ce0,tdx:_0x28ed2b}=_0x44739c,_0x4551f2=_0x3f8ce0[0x0];if(!_0x4551f2)return console['error']('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x37d413(0x1b9)](_0x37d413(0x1f6)),0x1;let _0x340971=![],_0x1a56ec=_0x4551f2;if(_0x4551f2[_0x37d413(0x205)](_0x37d413(0x196)))_0x340971=!![],_0x1a56ec=_0x4551f2[_0x37d413(0x13d)](0x8);else{if(_0x4551f2[_0x37d413(0x205)](_0x37d413(0x18d)))_0x340971=![],_0x1a56ec=_0x4551f2[_0x37d413(0x13d)](0x8);else return console[_0x37d413(0x1b9)](_0x37d413(0x13a)),console[_0x37d413(0x1b9)](_0x37d413(0x1f6)),0x1;}const _0x23fdf9=_0x539b19[_0x37d413(0x275)],_0x44cd7a=_0x539b19['resumeFrom'],_0x1fe609=_0x539b19[_0x37d413(0x15f)],_0x482a9d=_0x539b19[_0x37d413(0x2cb)];_0x539b19[_0x37d413(0x2bc)]&&(console[_0x37d413(0x1b9)](_0x37d413(0x2de)+(_0x340971?_0x37d413(0x2d5):_0x37d413(0x1f4))+'\x20'+_0x1a56ec),_0x23fdf9&&console[_0x37d413(0x1b9)](_0x37d413(0x182)+_0x23fdf9),_0x44cd7a&&console[_0x37d413(0x1b9)](_0x37d413(0x2c0)+_0x44cd7a),_0x1fe609&&console[_0x37d413(0x1b9)](_0x37d413(0x157)+_0x1fe609),_0x482a9d&&console['error']('Force:\x20yes'));let _0x7bec3;if(_0x1fe609)try{if(_0x1fe609[_0x37d413(0x205)]('@')){const _0xe6d9f4=await import(_0x37d413(0x2a8)),_0x14aaac=_0x1fe609[_0x37d413(0x13d)](0x1),_0x4bf82f=await _0xe6d9f4[_0x37d413(0x1cb)](_0x14aaac,_0x37d413(0x15e));_0x7bec3=JSON[_0x37d413(0x2bf)](_0x4bf82f);}else _0x7bec3=JSON[_0x37d413(0x2bf)](_0x1fe609);}catch{return console[_0x37d413(0x1b9)](_0x37d413(0x1aa)),0x1;}if(!_0x539b19[_0x37d413(0x2bb)]){if(!isInteractive())return console[_0x37d413(0x1b9)](a50_0x17f5af['red'](_0x37d413(0x2b8)),_0x37d413(0x28a)),console[_0x37d413(0x1b9)](a50_0x17f5af['dim'](_0x37d413(0x210))),0x1;const _0x3fe680=await confirmKey(_0x37d413(0x1f0)+(_0x340971?'session':_0x37d413(0x1f4))+'\x20'+_0x1a56ec+'?');if(!_0x3fe680)return console[_0x37d413(0x1b9)](a50_0x17f5af[_0x37d413(0x2dd)](_0x37d413(0x2d6))),0x1;}let _0x7c297;_0x340971?_0x7c297=await withSpinner(_0x37d413(0x1cd),()=>_0x28ed2b[_0x37d413(0x252)][_0x37d413(0x1ca)](_0x1a56ec,{'fromTask':_0x23fdf9,'retryParams':_0x7bec3}),{'verbose':_0x539b19[_0x37d413(0x2bc)]}):_0x7c297=await withSpinner(_0x37d413(0x225),()=>_0x28ed2b['workflow'][_0x37d413(0x188)](_0x1a56ec,{'resumeFrom':_0x44cd7a,'retryParams':_0x7bec3,'force':_0x482a9d}),{'verbose':_0x539b19[_0x37d413(0x2bc)]});const _0x559160=_0x7c297['data'];return console['error'](_0x37d413(0x159)),console[_0x37d413(0x1b9)](_0x37d413(0x145)+_0x559160[_0x37d413(0x1ea)]),console['error'](_0x37d413(0x2a3)+_0x559160[_0x37d413(0x174)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a50_0x474bcd(0x2ba)]='workflow:run';[a50_0x474bcd(0x299)]=a50_0x474bcd(0x139);async['execute'](_0x5b0916){const _0x1fdab7=a50_0x474bcd,{options:_0xe77d07,args:_0x2ea7cf,tdx:_0x387e08}=_0x5b0916;let _0x41f66c=_0x2ea7cf[0x0];if(!_0x41f66c){const _0x48686f=this[_0x1fdab7(0x2ac)]([],_0xe77d07),_0x2a54e4=await withSpinner(_0x1fdab7(0x232),()=>_0x387e08[_0x1fdab7(0x252)]['workflows'](_0x48686f,{'limit':_0xe77d07[_0x1fdab7(0x1f3)]}),{'verbose':_0xe77d07[_0x1fdab7(0x2bc)]}),_0x35bafe=_0x2a54e4['data'];if(_0x35bafe[_0x1fdab7(0x27a)]===0x0)return console[_0x1fdab7(0x1b9)](_0x1fdab7(0x1e4)),!_0x48686f&&console[_0x1fdab7(0x1b9)](a50_0x17f5af[_0x1fdab7(0x1b6)](_0x1fdab7(0x1ad))),0x1;const _0x131684=_0x35bafe[_0x1fdab7(0x2cf)](_0x2de736=>({'title':_0x2de736[_0x1fdab7(0x166)]?.[_0x1fdab7(0x2ba)]+'.'+_0x2de736[_0x1fdab7(0x2ba)],'value':_0x2de736[_0x1fdab7(0x166)]?.[_0x1fdab7(0x2ba)]+'.'+_0x2de736['name'],'description':_0x2de736['revision']?'revision:\x20'+_0x2de736['revision']:undefined})),_0x200c7b=await a50_0xb9a0b4({'type':_0x1fdab7(0x161),'name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x131684});if(!_0x200c7b['workflow'])return 0x1;_0x41f66c=_0x200c7b[_0x1fdab7(0x252)];}if(!_0x41f66c[_0x1fdab7(0x281)]('.')){const _0x340530=this['resolveProject']([],_0xe77d07);if(_0x340530)_0x41f66c=_0x340530+'.'+_0x41f66c;else return console[_0x1fdab7(0x1b9)](a50_0x17f5af[_0x1fdab7(0x1cc)](_0x1fdab7(0x176)),_0x1fdab7(0x2b6)),console[_0x1fdab7(0x1b9)](a50_0x17f5af[_0x1fdab7(0x1b6)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0xd4b9c4=_0xe77d07[_0x1fdab7(0x220)],_0x43a5e3=_0xe77d07[_0x1fdab7(0x1a7)],_0x596bd8={};if(_0xd4b9c4&&Array[_0x1fdab7(0x19a)](_0xd4b9c4))for(const _0x465552 of _0xd4b9c4){const _0x4b331d=_0x465552[_0x1fdab7(0x1bc)]('=');if(_0x4b331d===-0x1)return console[_0x1fdab7(0x1b9)](_0x1fdab7(0x25c)+_0x465552),console[_0x1fdab7(0x1b9)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x1432f2=_0x465552[_0x1fdab7(0x13d)](0x0,_0x4b331d),_0x190089=_0x465552[_0x1fdab7(0x13d)](_0x4b331d+0x1);try{_0x596bd8[_0x1432f2]=JSON['parse'](_0x190089);}catch{_0x596bd8[_0x1432f2]=_0x190089;}}_0xe77d07[_0x1fdab7(0x2bc)]&&(console[_0x1fdab7(0x1b9)](_0x1fdab7(0x1a2)+_0x41f66c),Object['keys'](_0x596bd8)[_0x1fdab7(0x27a)]>0x0&&console[_0x1fdab7(0x1b9)](_0x1fdab7(0x217)+JSON['stringify'](_0x596bd8)),_0x43a5e3&&console[_0x1fdab7(0x1b9)]('Session\x20time:\x20'+_0x43a5e3));const _0x46a431=await withSpinner(_0x1fdab7(0x1c3),()=>_0x387e08[_0x1fdab7(0x252)][_0x1fdab7(0x293)](_0x41f66c,_0x596bd8,{'sessionTime':_0x43a5e3}),{'verbose':_0xe77d07['verbose']}),_0x4fc71b=_0x46a431[_0x1fdab7(0x1d5)];console['error'](_0x1fdab7(0x233)),console[_0x1fdab7(0x1b9)](_0x1fdab7(0x2e1)+_0x4fc71b['id']),console[_0x1fdab7(0x1b9)](_0x1fdab7(0x2a3)+_0x4fc71b['sessionId']),console[_0x1fdab7(0x1b9)]('\x20\x20Project:\x20'+_0x4fc71b['project']?.['name']),console[_0x1fdab7(0x1b9)](_0x1fdab7(0x164)+_0x4fc71b[_0x1fdab7(0x252)]?.[_0x1fdab7(0x2ba)]);if(_0x4fc71b[_0x1fdab7(0x166)]?.['id']&&_0x4fc71b[_0x1fdab7(0x174)]&&_0x4fc71b['id']){const _0x518923=_0xe77d07[_0x1fdab7(0x264)],_0x5b8148=getConsoleUrl(_0x518923,_0x1fdab7(0x20e)+_0x4fc71b[_0x1fdab7(0x166)]['id']+_0x1fdab7(0x280)+_0x4fc71b[_0x1fdab7(0x174)]+_0x1fdab7(0x189)+_0x4fc71b['id']);console[_0x1fdab7(0x1b9)]('\x20\x20Console:\x20'+a50_0x17f5af[_0x1fdab7(0x24c)](_0x5b8148));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a50_0x474bcd(0x27e);['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a50_0x474bcd(0x181)](_0xa67e41){const _0x2c569a=a50_0x474bcd,{options:_0x11ca46,args:_0x418d1c,tdx:_0x3da2b0}=_0xa67e41,_0x281edd=_0x418d1c[0x0],_0x4c5f42=_0x418d1c[0x1]||'.';if(!_0x281edd)return console[_0x2c569a(0x1b9)](_0x2c569a(0x20a)),console[_0x2c569a(0x1b9)](_0x2c569a(0x2a5)),0x1;const _0x4c6ce6=_0x11ca46['revision'];_0x11ca46[_0x2c569a(0x2bc)]&&(console[_0x2c569a(0x1b9)](_0x2c569a(0x211)+_0x281edd),console['error']('Output\x20directory:\x20'+_0x4c5f42),_0x4c6ce6&&console[_0x2c569a(0x1b9)](_0x2c569a(0x2d0)+_0x4c6ce6));const _0x3d8c82=await withSpinner(_0x2c569a(0x246)+_0x281edd+'...',()=>_0x3da2b0['workflow'][_0x2c569a(0x29c)](_0x281edd,_0x4c5f42,{'revision':_0x4c6ce6}),{'verbose':_0x11ca46['verbose']}),_0x2f4612=_0x3d8c82[_0x2c569a(0x1d5)];return console[_0x2c569a(0x1b9)](_0x2c569a(0x16d)+_0x2f4612[_0x2c569a(0x13c)]),console[_0x2c569a(0x1b9)](_0x2c569a(0x290)+_0x2f4612['revision']),console[_0x2c569a(0x1b9)](_0x2c569a(0x2e2)+_0x2f4612['filesExtracted']),console[_0x2c569a(0x1b9)](_0x2c569a(0x287)+_0x4c5f42+'/'+_0x2f4612['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a50_0x474bcd(0x2ba)]=a50_0x474bcd(0x16a);[a50_0x474bcd(0x299)]=a50_0x474bcd(0x244);async['execute'](_0x2e907c){const _0x44e97f=a50_0x474bcd,{options:_0x1a2450,args:_0x115bd6,tdx:_0x4f92e4}=_0x2e907c;let _0x261458='.',_0x300e76=_0x1a2450[_0x44e97f(0x2ba)];if(_0x115bd6[0x0]){const {promises:_0x5c70d4}=await import('fs');try{const _0xe288e6=await _0x5c70d4[_0x44e97f(0x1c8)](_0x115bd6[0x0]);if(_0xe288e6[_0x44e97f(0x1a8)]())_0x261458=_0x115bd6[0x0];else return console[_0x44e97f(0x1b9)](_0x44e97f(0x20b)+_0x115bd6[0x0]+_0x44e97f(0x156)),0x1;}catch{_0x300e76=_0x115bd6[0x0],_0x261458='.';}}const _0x4acd5d=_0x1a2450[_0x44e97f(0x1b3)],_0x8ce437=_0x1a2450[_0x44e97f(0x22f)];_0x1a2450[_0x44e97f(0x2bc)]&&(console['error'](_0x44e97f(0x13e)+_0x261458),_0x300e76&&console[_0x44e97f(0x1b9)](_0x44e97f(0x1c2)+_0x300e76),_0x4acd5d&&console[_0x44e97f(0x1b9)](_0x44e97f(0x2d0)+_0x4acd5d),_0x8ce437&&console[_0x44e97f(0x1b9)](_0x44e97f(0x239)));const _0x2a881b=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x4f92e4[_0x44e97f(0x252)][_0x44e97f(0x29a)](_0x261458,{'projectName':_0x300e76,'revision':_0x4acd5d,'skipValidation':_0x8ce437}),{'verbose':_0x1a2450[_0x44e97f(0x2bc)]}),_0x1c4aec=_0x2a881b[_0x44e97f(0x1d5)];return console[_0x44e97f(0x1b9)](_0x44e97f(0x2c2)+_0x1c4aec['projectName']),console[_0x44e97f(0x1b9)](_0x44e97f(0x1b5)+_0x1c4aec[_0x44e97f(0x2aa)]),console['error'](_0x44e97f(0x290)+_0x1c4aec['revision']),await this[_0x44e97f(0x2c8)](_0x4f92e4,_0x1c4aec[_0x44e97f(0x13c)],_0x1a2450[_0x44e97f(0x264)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a50_0x474bcd(0x2ba)]=a50_0x474bcd(0x1bb);['description']=a50_0x474bcd(0x224);async[a50_0x474bcd(0x181)](_0xa7d78a){const _0x5a3c07=a50_0x474bcd,{options:_0x3ec970,args:_0xe37fa,tdx:_0xdfd139}=_0xa7d78a,_0x101d5b=_0xe37fa[0x0],_0x290566=_0xe37fa[0x1];if(!_0x101d5b)return console[_0x5a3c07(0x1b9)](a50_0x17f5af['red']('Error:'),_0x5a3c07(0x289)),console['error'](a50_0x17f5af[_0x5a3c07(0x1b6)](_0x5a3c07(0x21d))),0x1;const _0x2cae16=_0x3ec970[_0x5a3c07(0x1b3)];_0x3ec970[_0x5a3c07(0x2bc)]&&(console[_0x5a3c07(0x1b9)](_0x5a3c07(0x211)+_0x101d5b),_0x290566&&console[_0x5a3c07(0x1b9)](_0x5a3c07(0x151)+_0x290566),_0x2cae16&&console['error'](_0x5a3c07(0x2d0)+_0x2cae16),_0x3ec970[_0x5a3c07(0x285)]&&console[_0x5a3c07(0x1b9)](_0x5a3c07(0x1a5)));const _0x53653e=await withSpinner('Pulling\x20project\x20'+_0x101d5b+'...',()=>_0xdfd139[_0x5a3c07(0x252)][_0x5a3c07(0x14f)](_0x101d5b,{'targetDir':_0x290566,'revision':_0x2cae16}),{'verbose':_0x3ec970[_0x5a3c07(0x2bc)]}),_0x4c6d73=_0x53653e[_0x5a3c07(0x1d5)];_0x4c6d73[_0x5a3c07(0x296)]?console['error']('→\x20New\x20project:\x20'+_0x4c6d73[_0x5a3c07(0x13c)]):console[_0x5a3c07(0x1b9)](_0x5a3c07(0x29b)+_0x4c6d73[_0x5a3c07(0x13c)]);console[_0x5a3c07(0x1b9)](_0x5a3c07(0x290)+_0x4c6d73[_0x5a3c07(0x1b3)]),console['error'](_0x5a3c07(0x1e1)+(a50_0x51377e[_0x5a3c07(0x266)](process[_0x5a3c07(0x2c3)](),_0x4c6d73['targetDir'])||'.')),console[_0x5a3c07(0x1b9)](_0x5a3c07(0x16e)+a50_0x17f5af[_0x5a3c07(0x214)]('+'+_0x4c6d73['summary'][_0x5a3c07(0x1d7)]+'\x20new')+',\x20'+(a50_0x17f5af[_0x5a3c07(0x2dd)]('~'+_0x4c6d73['summary'][_0x5a3c07(0x28b)]+_0x5a3c07(0x1c1))+',\x20')+(a50_0x17f5af['red']('-'+_0x4c6d73[_0x5a3c07(0x1e3)]['deleted']+'\x20deleted')+',\x20')+(''+a50_0x17f5af[_0x5a3c07(0x1b6)](_0x4c6d73['summary'][_0x5a3c07(0x165)]+_0x5a3c07(0x13b))));for(const _0x596fc4 of _0x4c6d73[_0x5a3c07(0x136)]){_0x596fc4[_0x5a3c07(0x197)]===_0x5a3c07(0x28b)&&_0x596fc4[_0x5a3c07(0x1a6)]&&(console[_0x5a3c07(0x1b9)]('\x0a'+a50_0x17f5af[_0x5a3c07(0x24c)](_0x5a3c07(0x2b4)+_0x596fc4[_0x5a3c07(0x1de)])),console[_0x5a3c07(0x1b9)](_0x596fc4['diff']));}if(!_0x4c6d73[_0x5a3c07(0x167)])return saveSessionContext({'workflow_project':_0x4c6d73[_0x5a3c07(0x13c)]},_0x3ec970['session']),console[_0x5a3c07(0x1b9)](a50_0x17f5af[_0x5a3c07(0x214)](_0x5a3c07(0x241))),console[_0x5a3c07(0x1b9)](a50_0x17f5af[_0x5a3c07(0x1b6)](_0x5a3c07(0x20c)+_0x4c6d73[_0x5a3c07(0x13c)])),0x0;if(_0x3ec970[_0x5a3c07(0x285)])return console[_0x5a3c07(0x1b9)](a50_0x17f5af[_0x5a3c07(0x2dd)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x3ec970[_0x5a3c07(0x2bb)]){if(!isInteractive())return console[_0x5a3c07(0x1b9)](a50_0x17f5af[_0x5a3c07(0x1cc)](_0x5a3c07(0x2b8)),_0x5a3c07(0x28a)),console['error'](a50_0x17f5af[_0x5a3c07(0x1b6)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3bd76e=await confirmKey(_0x5a3c07(0x272));if(!_0x3bd76e)return console['error'](a50_0x17f5af['yellow'](_0x5a3c07(0x2d6)),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x5a3c07(0x1d1),()=>_0xdfd139[_0x5a3c07(0x252)][_0x5a3c07(0x15b)](_0x4c6d73,{'revision':_0x2cae16}),{'verbose':_0x3ec970['verbose']}),saveSessionContext({'workflow_project':_0x4c6d73[_0x5a3c07(0x13c)]},_0x3ec970[_0x5a3c07(0x2d5)]),console['error'](a50_0x17f5af[_0x5a3c07(0x214)](_0x5a3c07(0x29d)));const _0x2eb323=a50_0x51377e[_0x5a3c07(0x266)](process[_0x5a3c07(0x2c3)](),_0x4c6d73[_0x5a3c07(0x218)])||'.';return console[_0x5a3c07(0x1b9)](a50_0x17f5af[_0x5a3c07(0x1b6)](_0x5a3c07(0x287)+_0x2eb323)),console[_0x5a3c07(0x1b9)](a50_0x17f5af[_0x5a3c07(0x1b6)](_0x5a3c07(0x20c)+_0x4c6d73['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a50_0x474bcd(0x2ba)]=a50_0x474bcd(0x28c);[a50_0x474bcd(0x299)]=a50_0x474bcd(0x258);async[a50_0x474bcd(0x181)](_0x24fd3e){const _0xd831d3=a50_0x474bcd,{options:_0x22bf8e,args:_0x1ce04f,tdx:_0x936669}=_0x24fd3e,_0x273d65=this[_0xd831d3(0x1e8)](_0x1ce04f,_0x22bf8e),_0x3b5193=_0x22bf8e['revision'],_0x355dd3=_0x22bf8e[_0xd831d3(0x22f)];_0x22bf8e[_0xd831d3(0x2bc)]&&(_0x273d65&&console['error'](_0xd831d3(0x17b)+_0x273d65),_0x3b5193&&console['error'](_0xd831d3(0x2d0)+_0x3b5193),_0x22bf8e[_0xd831d3(0x285)]&&console[_0xd831d3(0x1b9)](_0xd831d3(0x1a5)),_0x355dd3&&console[_0xd831d3(0x1b9)](_0xd831d3(0x239)));let _0x5c6cd1;try{_0x5c6cd1=await withSpinner('Analyzing\x20changes...',()=>_0x936669[_0xd831d3(0x252)][_0xd831d3(0x2db)]({'sourceDir':_0x273d65,'revision':_0x3b5193,'skipValidation':_0x355dd3}),{'verbose':_0x22bf8e[_0xd831d3(0x2bc)]});}catch(_0x22359f){if(_0x22359f instanceof Error&&_0x22359f[_0xd831d3(0x168)][_0xd831d3(0x281)](_0xd831d3(0x2d3)))return console[_0xd831d3(0x1b9)](a50_0x17f5af[_0xd831d3(0x1cc)](_0xd831d3(0x176)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x22bf8e[_0xd831d3(0x235)]?console['error'](a50_0x17f5af[_0xd831d3(0x1b6)]('Tip:\x20cd\x20to\x20workflows/'+_0x22bf8e[_0xd831d3(0x235)]+_0xd831d3(0x177)+_0x22bf8e[_0xd831d3(0x235)]+'\x27')):console[_0xd831d3(0x1b9)](a50_0x17f5af[_0xd831d3(0x1b6)](_0xd831d3(0x25d))),0x1;throw _0x22359f;}const _0x8fcbbe=_0x5c6cd1[_0xd831d3(0x1d5)];console[_0xd831d3(0x1b9)](_0xd831d3(0x216)+_0x8fcbbe[_0xd831d3(0x13c)]),console[_0xd831d3(0x1b9)]('\x20\x20Source:\x20'+_0x8fcbbe['sourceDir']),console[_0xd831d3(0x1b9)](_0xd831d3(0x290)+_0x8fcbbe['revision']),console['error'](_0xd831d3(0x16e)+a50_0x17f5af[_0xd831d3(0x214)]('+'+_0x8fcbbe[_0xd831d3(0x1e3)][_0xd831d3(0x1d7)]+_0xd831d3(0x2b0))+',\x20'+(a50_0x17f5af[_0xd831d3(0x2dd)]('~'+_0x8fcbbe[_0xd831d3(0x1e3)][_0xd831d3(0x28b)]+_0xd831d3(0x1c1))+',\x20')+(a50_0x17f5af[_0xd831d3(0x1cc)]('-'+_0x8fcbbe[_0xd831d3(0x1e3)]['deleted']+_0xd831d3(0x206))+',\x20')+(''+a50_0x17f5af[_0xd831d3(0x1b6)](_0x8fcbbe['summary'][_0xd831d3(0x165)]+_0xd831d3(0x13b))));for(const _0xfff528 of _0x8fcbbe['changes']){_0xfff528['type']==='modified'&&_0xfff528['diff']&&(console[_0xd831d3(0x1b9)]('\x0a'+a50_0x17f5af['cyan'](_0xd831d3(0x2b4)+_0xfff528[_0xd831d3(0x1de)])),console[_0xd831d3(0x1b9)](_0xfff528[_0xd831d3(0x1a6)]));}if(!_0x8fcbbe[_0xd831d3(0x167)])return console['error'](a50_0x17f5af[_0xd831d3(0x214)](_0xd831d3(0x269))),await this['showWorkflowConsoleUrl'](_0x936669,_0x8fcbbe[_0xd831d3(0x13c)],_0x22bf8e[_0xd831d3(0x264)]),0x0;if(_0x22bf8e[_0xd831d3(0x285)])return console[_0xd831d3(0x1b9)](a50_0x17f5af[_0xd831d3(0x2dd)](_0xd831d3(0x138))),0x0;if(!_0x22bf8e['yes']){if(!isInteractive())return console['error'](a50_0x17f5af[_0xd831d3(0x1cc)](_0xd831d3(0x2b8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xd831d3(0x1b9)](a50_0x17f5af[_0xd831d3(0x1b6)](_0xd831d3(0x210))),0x1;const _0x2e5687=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x2e5687)return console[_0xd831d3(0x1b9)](a50_0x17f5af[_0xd831d3(0x2dd)](_0xd831d3(0x2d6)),_0xd831d3(0x1a9)),0x1;}const _0x17e8cb=await withSpinner(_0xd831d3(0x259),()=>_0x936669['workflow'][_0xd831d3(0x2ab)](_0x8fcbbe),{'verbose':_0x22bf8e[_0xd831d3(0x2bc)]}),_0x22df99=_0x17e8cb[_0xd831d3(0x1d5)];return console[_0xd831d3(0x1b9)](a50_0x17f5af[_0xd831d3(0x214)]('✔\x20Push\x20complete')),console[_0xd831d3(0x1b9)](_0xd831d3(0x1b5)+_0x22df99[_0xd831d3(0x2aa)]),console['error'](_0xd831d3(0x290)+_0x22df99[_0xd831d3(0x1b3)]),await this[_0xd831d3(0x2c8)](_0x936669,_0x22df99[_0xd831d3(0x13c)],_0x22bf8e[_0xd831d3(0x264)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a50_0x474bcd(0x2ba)]=a50_0x474bcd(0x24b);[a50_0x474bcd(0x299)]=a50_0x474bcd(0x201);async[a50_0x474bcd(0x181)](_0x2cb1e3){const _0x240edb=a50_0x474bcd,{options:_0x286195,args:_0x1c3001,tdx:_0x3cd272}=_0x2cb1e3,_0x403be6=this[_0x240edb(0x1e8)](_0x1c3001,_0x286195),_0x3f4a38=_0x286195['name'],_0x28f3bf=_0x286195[_0x240edb(0x1b3)],_0x1b6e1b=_0x286195[_0x240edb(0x22f)];if(!_0x403be6)return console[_0x240edb(0x1b9)](a50_0x17f5af[_0x240edb(0x1cc)](_0x240edb(0x176)),_0x240edb(0x2af)),console[_0x240edb(0x1b9)](a50_0x17f5af[_0x240edb(0x1b6)](_0x240edb(0x191))),console[_0x240edb(0x1b9)](a50_0x17f5af[_0x240edb(0x1b6)](_0x240edb(0x297))),0x1;if(!_0x3f4a38)return console[_0x240edb(0x1b9)](a50_0x17f5af[_0x240edb(0x1cc)](_0x240edb(0x176)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x240edb(0x1b9)](a50_0x17f5af[_0x240edb(0x1b6)](_0x240edb(0x191))),0x1;_0x286195['verbose']&&(console['error'](_0x240edb(0x17b)+_0x403be6),console[_0x240edb(0x1b9)](_0x240edb(0x2b9)+_0x3f4a38),_0x28f3bf&&console[_0x240edb(0x1b9)](_0x240edb(0x2d0)+_0x28f3bf),_0x286195['dryRun']&&console[_0x240edb(0x1b9)](_0x240edb(0x1a5)),_0x1b6e1b&&console[_0x240edb(0x1b9)](_0x240edb(0x239)));const _0xc3544=await withSpinner(_0x240edb(0x28f),()=>_0x3cd272['workflow'][_0x240edb(0x221)](_0x403be6,_0x3f4a38,{'revision':_0x28f3bf,'skipValidation':_0x1b6e1b}),{'verbose':_0x286195[_0x240edb(0x2bc)]}),_0x8b5751=_0xc3544[_0x240edb(0x1d5)];console[_0x240edb(0x1b9)](_0x240edb(0x2da)+_0x8b5751[_0x240edb(0x288)]);_0x8b5751[_0x240edb(0x255)]&&console[_0x240edb(0x1b9)]('Source\x20project:\x20'+_0x8b5751[_0x240edb(0x255)]);console[_0x240edb(0x1b9)](_0x240edb(0x2b9)+_0x8b5751[_0x240edb(0x137)]),console['error']('Revision:\x20'+_0x8b5751['revision']),console[_0x240edb(0x1b9)](_0x240edb(0x200)+_0x8b5751['fileCount']);_0x8b5751['targetExists']&&(console[_0x240edb(0x1b9)](a50_0x17f5af[_0x240edb(0x2dd)](_0x240edb(0x193)+_0x8b5751[_0x240edb(0x137)]+_0x240edb(0x17e)+_0x8b5751[_0x240edb(0x2e0)]+')')),console[_0x240edb(0x1b9)](a50_0x17f5af[_0x240edb(0x2dd)](_0x240edb(0x2ca))));if(_0x286195[_0x240edb(0x285)])return console[_0x240edb(0x1b9)](a50_0x17f5af[_0x240edb(0x2dd)](_0x240edb(0x1db))),0x0;if(!_0x286195[_0x240edb(0x2bb)]){if(!isInteractive())return console[_0x240edb(0x1b9)](a50_0x17f5af[_0x240edb(0x1cc)](_0x240edb(0x2b8)),_0x240edb(0x28a)),console[_0x240edb(0x1b9)](a50_0x17f5af[_0x240edb(0x1b6)](_0x240edb(0x210))),0x1;const _0x49980c=_0x8b5751['sourceProjectName']||a50_0x51377e[_0x240edb(0x2b5)](_0x403be6),_0x48f77a=_0x8b5751[_0x240edb(0x26a)]?_0x240edb(0x1ff)+_0x3f4a38+'\x22\x20with\x20new\x20revision?':_0x240edb(0x14a)+_0x49980c+_0x240edb(0x215)+_0x3f4a38+'\x22?',_0x2f4628=await confirmKey(_0x48f77a);if(!_0x2f4628)return console['error'](a50_0x17f5af[_0x240edb(0x2dd)](_0x240edb(0x2d6))),0x1;}const _0x5991bf=await withSpinner(_0x8b5751[_0x240edb(0x26a)]?_0x240edb(0x1ed)+_0x3f4a38+'...':_0x240edb(0x24a)+_0x3f4a38+_0x240edb(0x1e9),()=>_0x3cd272[_0x240edb(0x252)][_0x240edb(0x163)](_0x8b5751),{'verbose':_0x286195[_0x240edb(0x2bc)]}),_0x234832=_0x5991bf[_0x240edb(0x1d5)];return console[_0x240edb(0x1b9)](a50_0x17f5af[_0x240edb(0x214)](_0x8b5751[_0x240edb(0x26a)]?_0x240edb(0x27d):'✔\x20Clone\x20complete')),console['error']('\x20\x20Project:\x20'+_0x234832['newProjectName']),console['error'](_0x240edb(0x1b5)+_0x234832['newProjectId']),console[_0x240edb(0x1b9)](_0x240edb(0x290)+_0x234832[_0x240edb(0x1b3)]),await this[_0x240edb(0x2c8)](_0x3cd272,_0x234832['newProjectName'],_0x286195[_0x240edb(0x264)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']='workflow:delete';[a50_0x474bcd(0x299)]=a50_0x474bcd(0x1e0);async[a50_0x474bcd(0x181)](_0xac19f7){const _0x2ac30a=a50_0x474bcd,{options:_0x4958c3,args:_0x22caeb,tdx:_0xe40c74}=_0xac19f7,_0x384413=_0x22caeb[0x0];if(!_0x384413)return console[_0x2ac30a(0x1b9)](_0x2ac30a(0x175)),console[_0x2ac30a(0x1b9)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x4958c3[_0x2ac30a(0x2bc)]&&console[_0x2ac30a(0x1b9)](_0x2ac30a(0x211)+_0x384413);if(!_0x4958c3['yes']){if(!isInteractive())return console[_0x2ac30a(0x1b9)](a50_0x17f5af['red'](_0x2ac30a(0x2b8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2ac30a(0x1b9)](a50_0x17f5af[_0x2ac30a(0x1b6)](_0x2ac30a(0x210))),0x1;const _0x23ec42=await confirmKey(_0x2ac30a(0x140)+_0x384413+_0x2ac30a(0x1a0));if(!_0x23ec42)return console[_0x2ac30a(0x1b9)](a50_0x17f5af[_0x2ac30a(0x2dd)]('Cancelled')),0x1;}const _0x196895=await withSpinner('Deleting\x20project\x20'+_0x384413+'...',()=>_0xe40c74[_0x2ac30a(0x252)][_0x2ac30a(0x187)](_0x384413),{'verbose':_0x4958c3[_0x2ac30a(0x2bc)]}),_0x5c4364=_0x196895[_0x2ac30a(0x1d5)];return console[_0x2ac30a(0x1b9)](_0x2ac30a(0x291)+_0x5c4364[_0x2ac30a(0x13c)]),console[_0x2ac30a(0x1b9)](_0x2ac30a(0x1b5)+_0x5c4364[_0x2ac30a(0x2aa)]),0x0;}}export function parseKeyValue(_0x24dfdf){const _0x1e7230=a50_0x474bcd,_0x2e1b72=_0x24dfdf[_0x1e7230(0x1bc)]('=');if(_0x2e1b72===-0x1)throw new Error(_0x1e7230(0x16f)+_0x24dfdf+_0x1e7230(0x1a3));const _0x136e3f=_0x24dfdf['substring'](0x0,_0x2e1b72),_0x51b372=_0x24dfdf[_0x1e7230(0x13d)](_0x2e1b72+0x1);if(!_0x136e3f)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x136e3f,'value':_0x51b372};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a50_0x474bcd(0x1a4);[a50_0x474bcd(0x299)]=a50_0x474bcd(0x190);async['execute'](_0xcb1a6e){const _0x300a33=a50_0x474bcd,{options:_0xbd2e29,args:_0x2d2b85,tdx:_0x4335aa}=_0xcb1a6e,_0x2ea7dc=this[_0x300a33(0x23f)](_0x2d2b85,_0xbd2e29);if(!_0x2ea7dc)return 0x1;_0xbd2e29[_0x300a33(0x2bc)]&&console[_0x300a33(0x1b9)]('Project:\x20'+_0x2ea7dc);const _0x44266c=await withSpinner('Listing\x20secrets...',()=>_0x4335aa[_0x300a33(0x252)][_0x300a33(0x277)](_0x2ea7dc),{'verbose':_0xbd2e29['verbose']}),{secrets:_0x274c3f}=_0x44266c[_0x300a33(0x1d5)];return console[_0x300a33(0x1b9)](_0x300a33(0x286)+_0x274c3f['length']+_0x300a33(0x240)+(_0x274c3f[_0x300a33(0x27a)]!==0x1?'s':'')),await handleSDKOutput(_0x274c3f,_0xbd2e29),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a50_0x474bcd(0x23b);[a50_0x474bcd(0x299)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a50_0x474bcd(0x181)](_0x23b725){const _0x2c2039=a50_0x474bcd,{options:_0x3b2002,args:_0x391f3c,tdx:_0x18a0fc}=_0x23b725;let _0x4f248c,_0x3f0d94;if(_0x391f3c[_0x2c2039(0x27a)]>=0x2)_0x4f248c=_0x391f3c[0x0],_0x3f0d94=_0x391f3c[0x1];else{if(_0x391f3c['length']===0x1&&_0x3b2002['workflowProject'])_0x4f248c=_0x3b2002[_0x2c2039(0x235)],_0x3f0d94=_0x391f3c[0x0];else return _0x391f3c[_0x2c2039(0x27a)]===0x1?(console[_0x2c2039(0x1b9)](_0x2c2039(0x20a)),console[_0x2c2039(0x1b9)](_0x2c2039(0x1ad)),0x1):(console[_0x2c2039(0x1b9)](_0x2c2039(0x1c0)),console[_0x2c2039(0x1b9)](_0x2c2039(0x20d)),0x1);}let _0x6de30f,_0x44f45f;try{({key:_0x6de30f,value:_0x44f45f}=parseKeyValue(_0x3f0d94));}catch(_0x26bf6c){return _0x26bf6c instanceof Error&&console[_0x2c2039(0x1b9)](a50_0x17f5af[_0x2c2039(0x1cc)]('Error:'),_0x26bf6c['message']),0x1;}_0x3b2002[_0x2c2039(0x2bc)]&&(console['error'](_0x2c2039(0x211)+_0x4f248c),console[_0x2c2039(0x1b9)]('Key:\x20'+_0x6de30f));const _0x2a21d2=await withSpinner('Setting\x20secret...',()=>_0x18a0fc[_0x2c2039(0x252)]['setSecret'](_0x4f248c,_0x6de30f,_0x44f45f),{'verbose':_0x3b2002[_0x2c2039(0x2bc)]}),_0x730fdb=_0x2a21d2[_0x2c2039(0x1d5)];return console[_0x2c2039(0x1b9)]('✔\x20Secret\x20\x27'+_0x730fdb[_0x2c2039(0x21a)]+_0x2c2039(0x2c7)+_0x730fdb['projectName']+'\x27'),(_0x3b2002[_0x2c2039(0x170)]||_0x3b2002[_0x2c2039(0x1fd)])&&await handleSingleObjectOutput(_0x730fdb,_0x3b2002),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a50_0x474bcd(0x1ee);[a50_0x474bcd(0x299)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a50_0x474bcd(0x181)](_0x49c520){const _0x2325e4=a50_0x474bcd,{options:_0xcfd869,args:_0x4972ef,tdx:_0x38aa4a}=_0x49c520;let _0x8fe367,_0x3b96d0;if(_0x4972ef[_0x2325e4(0x27a)]>=0x2)_0x8fe367=_0x4972ef[0x0],_0x3b96d0=_0x4972ef[0x1];else{if(_0x4972ef['length']===0x1&&_0xcfd869['workflowProject'])_0x8fe367=_0xcfd869[_0x2325e4(0x235)],_0x3b96d0=_0x4972ef[0x0];else return _0x4972ef[_0x2325e4(0x27a)]===0x1?(console['error'](_0x2325e4(0x20a)),console['error']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x2325e4(0x1b9)](_0x2325e4(0x14c)),console[_0x2325e4(0x1b9)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0xcfd869[_0x2325e4(0x2bc)]&&(console['error'](_0x2325e4(0x211)+_0x8fe367),console[_0x2325e4(0x1b9)]('Key:\x20'+_0x3b96d0));if(!_0xcfd869[_0x2325e4(0x2bb)]){if(!isInteractive())return console[_0x2325e4(0x1b9)](a50_0x17f5af[_0x2325e4(0x1cc)](_0x2325e4(0x2b8)),_0x2325e4(0x28a)),console[_0x2325e4(0x1b9)](a50_0x17f5af['dim'](_0x2325e4(0x210))),0x1;const _0xf4fa90=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x3b96d0+_0x2325e4(0x15d)+_0x8fe367+'\x27?');if(!_0xf4fa90)return console[_0x2325e4(0x1b9)](a50_0x17f5af[_0x2325e4(0x2dd)](_0x2325e4(0x2d6))),0x1;}const _0x93375a=await withSpinner('Deleting\x20secret...',()=>_0x38aa4a[_0x2325e4(0x252)]['deleteSecret'](_0x8fe367,_0x3b96d0),{'verbose':_0xcfd869[_0x2325e4(0x2bc)]}),_0x23f56b=_0x93375a[_0x2325e4(0x1d5)];return console[_0x2325e4(0x1b9)](_0x2325e4(0x26d)+_0x23f56b['key']+_0x2325e4(0x1df)+_0x23f56b[_0x2325e4(0x13c)]+'\x27'),(_0xcfd869['json']||_0xcfd869[_0x2325e4(0x1fd)])&&await handleSingleObjectOutput(_0x23f56b,_0xcfd869),0x0;}}function a50_0x1338(){const _0x16f91c=['.\x20Expected\x20format:\x20KEY=VALUE','workflow:secrets:list','Dry\x20run:\x20yes','diff','sessionTime','isDirectory','-\x20nothing\x20pushed','Error:\x20Invalid\x20JSON\x20in\x20--params','Getting\x20attempt\x20details...','\x20from\x20session\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','columns','Getting\x20attempt\x20tasks...','✔\x20Workflow\x20project\x20set\x20to:\x20','189cfDAag','pollTimeline','revision','Using\x20attempt\x20','\x20\x20Project\x20ID:\x20','dim','list','metadata','error','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','workflow:pull','indexOf','tdx\x20wf\x20attempt\x20','TASK_NAME_WIDTH','No\x20attempts\x20found','Error:\x20KEY=VALUE\x20is\x20required','\x20modified','Project\x20name:\x20','Starting\x20workflow\x20run...','canceling','buildTimelineData','Task\x20name:\x20','3209060utIWPY','stat','logFiles','retrySession','readFile','red','Retrying\x20session...','some','rows','text','Writing\x20files...','fill','generateSessionTimelineRows','running','data','cancelRequested','new','autocomplete','workflow:timeline','\x20(use\x20--limit\x20to\x20show\x20more)','\x0aDry\x20run\x20-\x20no\x20project\x20created','write','\x20session','path','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20\x20Target:\x20','Auto-selected\x20latest\x20session:\x20','summary','No\x20workflows\x20found','localeCompare','max','439540tKwkUK','resolveProjectDir','...','attemptId','size','Usage:\x20tdx\x20wf\x20use\x20<project>','Updating\x20','workflow:secrets:delete','Reason:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','11kgstFT','now','limit','attempt','getTime','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Loading\x20session...','includeSubtasks','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','startTime','task','LABEL_WIDTH_DIVISOR','jsonl','find','\x0aUpdate\x20existing\x20project\x20\x22','Files\x20to\x20upload:\x20','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Select\x20a\x20session\x20to\x20view\x20timeline:','workflow:tasks','8SgjFhI','startsWith','\x20deleted','planned','Session\x20','\x20\x20tdx\x20wf\x20use\x20<project>','Error:\x20Project\x20name\x20is\x20required','Error:\x20','\x20\x20Session\x20context\x20set\x20to:\x20','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','/app/workflows/','📋\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Project:\x20','displayLine','No\x20log\x20files\x20found\x20for\x20this\x20attempt','green','\x22\x20to\x20new\x20project\x20\x22','✔\x20Project:\x20','Parameters:\x20','targetDir','getMonth','key','Filter:\x20','kill','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Latest\x20session\x20has\x20no\x20attempt','done','param','prepareCloneProject','durationMs','keys','Pull\x20workflow\x20project\x20to\x20local\x20folder','Retrying\x20attempt...','No\x20sessions\x20with\x20timing\x20information','\x20project','from','MAX_LABEL_COUNT','593847dLajLp','Attempt:\x20','(use\x20--limit\x20to\x20see\x20more)','\x20(system)','41622foeIaY','skipValidation','\x20has\x20no\x20attempts','renderSessionsTimeline','Loading\x20workflows...','✔\x20Workflow\x20run\x20started','✔\x20Workflow\x20project\x20context\x20cleared.','workflowProject','slice','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','\x27...','Validation:\x20skipped','log','workflow:secrets:set','List\x20workflow\x20attempts','\x1b[1A\x1b[2K','index','requireProject','\x20secret','\x0a✔\x20Already\x20up\x20to\x20date','tdx.json','splice','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','reason','Downloading\x20project\x20','Killing\x20attempt...','Session\x20not\x20found:\x20','Show\x20tasks\x20for\x20an\x20attempt','Cloning\x20to\x20','workflow:clone','cyan','padStart','2HzkEzw','getFullYear','blue','isTTY','workflow','navigateSessionsInteractive','retryAttemptName','sourceProjectName','workflow:kill','sort','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Pushing\x20project...','success','No\x20matching\x20sessions\x20found','Error:\x20Invalid\x20parameter\x20format:\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','\x20sessions\x20','Attempt\x20ID:\x20','renderSingleTimeline','40WaZipK','state',',\x20Workflow:\x20','site','No\x20attempts\x20found\x20in\x20project:\x20','relative','stdout','values','\x0a✔\x20No\x20changes\x20to\x20push','targetExists','✔\x20Showing\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','✔\x20Secret\x20\x27','fullName','filter','19457451hluGOB','all','\x0aApply\x20these\x20changes?','output','Project\x20filter:\x20','fromTask','table','listSecrets','window','Listing\x20workflows...','length','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','🔄\x20','✔\x20Project\x20updated','workflow:download','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','/sessions/','includes','Listing\x20workflow\x20attempts...','List\x20workflows','getDate','dryRun','✔\x20Found\x20','\x20\x20Location:\x20','sourceDir','Project\x20name\x20is\x20required','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','modified','workflow:push','\x0aPolling...\x20(','round','Analyzing\x20project...','\x20\x20Revision:\x20','✔\x20Deleted\x20project\x20','No\x20log\x20content\x20found','run','session_id','MAX_TIMELINE_WIDTH','isNewProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','Select\x20a\x20task\x20to\x20view\x20logs:','description','push','→\x20Project:\x20','download','✔\x20Pull\x20complete','No\x20sessions\x20found\x20in\x20project:\x20','\x20of\x20','replace','workflow:use','(unknown)','\x20\x20Session\x20ID:\x20','workflow:sessions','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','end','No\x20attempts\x20found\x20for:\x20','fs/promises','join','projectId','executePushProject','resolveProject','match','1567947QunNFe','Source\x20directory\x20is\x20required','\x20new','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','createdAt','Including\x20subtasks:\x20yes','---\x20','basename','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','split','\x0aError:','New\x20project\x20name:\x20','name','yes','verbose','sys','ICON_WIDTH','parse','Resume\x20from:\x20','workflow:attempt','✔\x20Pushed\x20','cwd','\x20tasks','follow','startedAt','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','showWorkflowConsoleUrl','floor','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','force','repeat','MIN_LABEL_COUNT','updatedAt','map','Revision:\x20','workflow:workflows','No\x20sessions\x20found\x20for:\x20','No\x20workflow\x20tdx.json\x20found','every','session','Cancelled','No\x20workflow\x20sessions\x20found','lastAttempt','min','Source:\x20','preparePushProject','workflow:logs','yellow','Target:\x20','\x20logs','existingProjectId','\x20\x20Attempt\x20ID:\x20','\x20\x20Files\x20extracted:\x20','changes','newProjectName','\x0aDry\x20run\x20-\x20nothing\x20pushed','Start\x20a\x20workflow\x20run','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x20unchanged','projectName','substring','Project\x20directory:\x20','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x20to\x20see\x20detailed\x20logs','tasks','List\x20all\x20workflow\x20projects','logs','\x20\x20New\x20attempt\x20ID:\x20','set','fileSize','List\x20workflow\x20execution\x20sessions','Kill\x20a\x20running\x20attempt','\x0aClone\x20\x22','status','Error:\x20Secret\x20key\x20is\x20required','value','taskName','pullProject','format','Target\x20directory:\x20','Status:\x20','clear','Resolving\x20project\x20\x27','group_error','\x20is\x20not\x20a\x20directory','Params:\x20','projects','✔\x20Retry\x20started','MAX_POLL_ITERATIONS','applyPullProject','Failed\x20to\x20fetch\x20attempt\x20data','\x27\x20from\x20project\x20\x27','utf-8','params','Error:\x20Attempt\x20ID\x20is\x20required','select','Filter:\x20project=','executeCloneProject','\x20\x20Workflow:\x20','unchanged','project','hasChanges','message','get','workflow:upload','getHours','No\x20projects\x20match\x20pattern:\x20','✔\x20Downloaded\x20','\x20\x20Changes:\x20','Invalid\x20format:\x20','json','includeRetried','toLowerCase','12QKxcHS','sessionId','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Error:','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','LABEL_MIN_SPACING','renderTimeline','MAX_TASKS_DISPLAY','Source\x20directory:\x20','context','white','\x22\x20already\x20exists\x20(ID:\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','No\x20workflow\x20projects\x20found','execute','From\x20task:\x20','workflowName','parseProjectWorkflowPattern','sessions','Show\x20specific\x20attempt\x20details','delete','retryAttempt','/attempt/','Fetching\x20log\x20files...','resolveProjectId','unknown','attempt:','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','start','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','duration','\x0a⚠\x20Project\x20\x22','msPerChar','1149440WwlCEQ','session:','type','Warning:','toISOString','isArray','pending','workflow:projects','getMinutes','\x20task','\x0a✔\x20Attempt\x20complete','\x22?\x20This\x20cannot\x20be\x20undone.','finishedAt','Workflow:\x20'];a50_0x1338=function(){return _0x16f91c;};return a50_0x1338();}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(_0x5769e0){const _0x46652a=a50_0x474bcd,_0x55f32b=Math[_0x46652a(0x2c9)](_0x5769e0/0x3e8),_0x31ee9b=Math['floor'](_0x55f32b/0x3c),_0x560404=Math[_0x46652a(0x2c9)](_0x31ee9b/0x3c),_0x14ddd5=Math[_0x46652a(0x2c9)](_0x560404/0x18);if(_0x14ddd5>0x0){const _0x4820ce=_0x560404%0x18;return _0x4820ce>0x0?_0x14ddd5+'d\x20'+_0x4820ce+'h':_0x14ddd5+'d';}else{if(_0x560404>0x0){const _0x25b84f=_0x31ee9b%0x3c;return _0x25b84f>0x0?_0x560404+'h\x20'+_0x25b84f+'m':_0x560404+'h';}else{if(_0x31ee9b>0x0){const _0x5e3345=_0x55f32b%0x3c;return _0x5e3345>0x0?_0x31ee9b+'m\x20'+_0x5e3345+'s':_0x31ee9b+'m';}else return _0x55f32b+'s';}}}function formatTimestamp(_0xb23e32,_0x4b46e8){const _0x35a229=a50_0x474bcd,_0x10808f=new Date(_0xb23e32),_0x1de391=String(_0x10808f[_0x35a229(0x16b)]())['padStart'](0x2,'0'),_0x1d859d=String(_0x10808f[_0x35a229(0x19d)]())[_0x35a229(0x24d)](0x2,'0'),_0x15a163=_0x1de391+':'+_0x1d859d,_0x2920b7=_0x10808f[_0x35a229(0x24f)]()===_0x4b46e8[_0x35a229(0x24f)]()&&_0x10808f[_0x35a229(0x219)]()===_0x4b46e8['getMonth']()&&_0x10808f[_0x35a229(0x284)]()===_0x4b46e8[_0x35a229(0x284)]();if(_0x2920b7)return _0x15a163;else{const _0x58e7a5=String(_0x10808f[_0x35a229(0x219)]()+0x1)['padStart'](0x2,'0'),_0x1969d0=String(_0x10808f[_0x35a229(0x284)]())[_0x35a229(0x24d)](0x2,'0');return _0x58e7a5+'-'+_0x1969d0+'\x20'+_0x15a163;}}function formatDate(_0x176709){const _0x2d1151=a50_0x474bcd,_0x5551a0=_0x176709['getFullYear'](),_0x3dc73c=String(_0x176709[_0x2d1151(0x219)]()+0x1)[_0x2d1151(0x24d)](0x2,'0'),_0x550660=String(_0x176709[_0x2d1151(0x284)]())[_0x2d1151(0x24d)](0x2,'0');return _0x5551a0+'-'+_0x3dc73c+'-'+_0x550660;}function getTaskStateIcon(_0x563ede){const _0x672de2={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x672de2[_0x563ede]||'⚪';}function getBarChar(_0xd5cb36){const _0x4b4d6f=a50_0x474bcd;return _0xd5cb36===_0x4b4d6f(0x1b9)||_0xd5cb36===_0x4b4d6f(0x155)?'×':'─';}function getBarColor(_0x22ff4c){const _0x8faf97=a50_0x474bcd,_0x52d1ae={'success':a50_0x17f5af[_0x8faf97(0x214)],'error':a50_0x17f5af['red'],'group_error':a50_0x17f5af[_0x8faf97(0x1cc)],'running':a50_0x17f5af[_0x8faf97(0x250)],'blocked':a50_0x17f5af[_0x8faf97(0x2dd)],'planned':a50_0x17f5af[_0x8faf97(0x1b6)],'canceling':a50_0x17f5af[_0x8faf97(0x2dd)]};return _0x52d1ae[_0x22ff4c]||a50_0x17f5af[_0x8faf97(0x17d)];}function parseTaskName(_0x1f0ba){const _0x1a3947=a50_0x474bcd;let _0x4fe7ae=_0x1f0ba[_0x1a3947(0x2a0)](/^\++/,'');const _0x43ba33=_0x4fe7ae[_0x1a3947(0x2b7)]('+'),_0x3883fd=_0x43ba33[_0x1a3947(0x27a)]>0x1?_0x43ba33[_0x1a3947(0x27a)]-0x2:0x0,_0x285b05=_0x43ba33[_0x43ba33['length']-0x1]||_0x4fe7ae;return{'level':_0x3883fd,'name':'+'+_0x285b05};}function truncateTaskName(_0x80e15d,_0x2cca34){const _0x404fcb=a50_0x474bcd,_0x1846b2=stringWidth(_0x80e15d);if(_0x1846b2<=_0x2cca34)return _0x80e15d;let _0x5222d1=_0x80e15d;while(stringWidth(_0x5222d1+'…')>_0x2cca34&&_0x5222d1[_0x404fcb(0x27a)]>0x0){_0x5222d1=_0x5222d1['slice'](0x0,-0x1);}return _0x5222d1+'…';}function calculateTimeScale(_0x3d30e3,_0x2d7eba){const _0xf03e12=a50_0x474bcd;return{'startTime':_0x3d30e3[_0xf03e12(0x18f)],'endTime':_0x3d30e3['end'],'durationMs':_0x3d30e3['duration'],'msPerChar':_0x3d30e3[_0xf03e12(0x192)]/_0x2d7eba};}function timeToPosition(_0x385da2,_0x32484c,_0x14baab){const _0x368974=a50_0x474bcd,_0x3c3d78=_0x385da2-_0x32484c[_0x368974(0x1fa)],_0x571830=Math[_0x368974(0x2c9)](_0x3c3d78/_0x32484c[_0x368974(0x194)]);return Math['max'](0x0,Math[_0x368974(0x2d9)](_0x571830,_0x14baab));}function renderTimeAxis(_0x8f4748,_0x23d552){const _0x459780=a50_0x474bcd,_0x1fba0f=Math[_0x459780(0x2d9)](TIMELINE_CONFIG[_0x459780(0x229)],Math[_0x459780(0x1e6)](TIMELINE_CONFIG[_0x459780(0x2cd)],Math[_0x459780(0x2c9)](_0x23d552/TIMELINE_CONFIG[_0x459780(0x1fc)]))),_0x4b1e06=_0x8f4748[_0x459780(0x222)]/(_0x1fba0f-0x1),_0x374377=new Date(_0x8f4748[_0x459780(0x1fa)]),_0x3cca45=[];for(let _0x1e92b3=0x0;_0x1e92b3<_0x1fba0f;_0x1e92b3++){const _0x21f744=_0x8f4748[_0x459780(0x1fa)]+_0x1e92b3*_0x4b1e06,_0x16f5c8=timeToPosition(_0x21f744,_0x8f4748,_0x23d552),_0x3ac5cb=formatTimestamp(_0x21f744,_0x374377);_0x3cca45[_0x459780(0x29a)]({'pos':_0x16f5c8,'text':_0x3ac5cb});}const _0x14d562=new Array(_0x23d552)[_0x459780(0x1d2)]('\x20');let _0x55bdb3=-0x1;for(const {pos:_0x483507,text:_0x1c2ccd}of _0x3cca45){let _0x4ad450=Math[_0x459780(0x1e6)](0x0,_0x483507-Math[_0x459780(0x2c9)](_0x1c2ccd[_0x459780(0x27a)]/0x2));_0x4ad450<=_0x55bdb3+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x4ad450=_0x55bdb3+TIMELINE_CONFIG[_0x459780(0x178)]+0x1);_0x4ad450+_0x1c2ccd[_0x459780(0x27a)]>_0x23d552&&(_0x4ad450=_0x23d552-_0x1c2ccd['length']);if(_0x4ad450>=0x0&&_0x4ad450+_0x1c2ccd['length']<=_0x23d552&&_0x4ad450>_0x55bdb3){for(let _0x47c458=0x0;_0x47c458<_0x1c2ccd[_0x459780(0x27a)];_0x47c458++){_0x14d562[_0x4ad450+_0x47c458]=_0x1c2ccd[_0x47c458];}_0x55bdb3=_0x4ad450+_0x1c2ccd['length']-0x1;}}return _0x14d562['join']('');}function renderTaskRow(_0xc980e2,_0x3db2fe,_0x4f6b71,_0x375fc9){const _0x5d13a4=a50_0x474bcd,{level:_0x5c6dec,name:_0x4861ce}=parseTaskName(_0xc980e2[_0x5d13a4(0x2ba)]),_0x144d08='\x20'['repeat'](_0x5c6dec),_0x15ba8e=_0xc980e2['window']?'('+formatElapsed(_0xc980e2[_0x5d13a4(0x278)][_0x5d13a4(0x192)])+')':'',_0xef443=stringWidth(_0x15ba8e),_0x561c81=_0x5c6dec*0x1,_0x35ba59=_0x375fc9-_0x561c81-_0xef443-0x1,_0x19ff1f=truncateTaskName(_0x4861ce,_0x35ba59),_0x2a0918=_0x144d08+_0x19ff1f,_0x38b608=stringWidth(_0x2a0918),_0x53affb=_0x375fc9-_0x38b608-_0xef443,_0x417900=_0x2a0918+'\x20'[_0x5d13a4(0x2cc)](Math['max'](0x1,_0x53affb))+a50_0x17f5af[_0x5d13a4(0x1b6)](_0x15ba8e),_0x5d5d0a=getTaskStateIcon(_0xc980e2[_0x5d13a4(0x262)]),_0x1de9bd=new Array(_0x4f6b71)[_0x5d13a4(0x1d2)]('\x20');if(_0xc980e2['window']){const _0xe1e34c=timeToPosition(_0xc980e2[_0x5d13a4(0x278)][_0x5d13a4(0x18f)],_0x3db2fe,_0x4f6b71),_0x1e49ad=timeToPosition(_0xc980e2[_0x5d13a4(0x278)]['end'],_0x3db2fe,_0x4f6b71),_0x1c9160=getBarChar(_0xc980e2[_0x5d13a4(0x262)]),_0x55abbc=Math['max'](_0xe1e34c+0x1,_0x1e49ad);for(let _0x1d6c24=_0xe1e34c;_0x1d6c24<Math[_0x5d13a4(0x2d9)](_0x55abbc,_0x4f6b71);_0x1d6c24++){_0x1de9bd[_0x1d6c24]=_0x1c9160;}}const _0x4c9356=getBarColor(_0xc980e2['state']),_0x546fbf=_0x1de9bd[_0x5d13a4(0x2cf)](_0x13fa6a=>_0x13fa6a==='\x20'?'\x20':_0x4c9356(_0x13fa6a))[_0x5d13a4(0x2a9)]('');return _0x5d5d0a+'\x20'+_0x417900+'│'+_0x546fbf+'│';}function a50_0x1892(_0x47e9c9,_0x4b6cea){_0x47e9c9=_0x47e9c9-0x136;const _0x1338cf=a50_0x1338();let _0x18927b=_0x1338cf[_0x47e9c9];return _0x18927b;}function calculateStats(_0x4ea3ab){const _0x293a03=a50_0x474bcd,_0x2539fd={'total':_0x4ea3ab[_0x293a03(0x27a)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x2db439 of _0x4ea3ab){if(_0x2db439[_0x293a03(0x262)]===_0x293a03(0x25a))_0x2539fd[_0x293a03(0x25a)]++;else{if(_0x2db439[_0x293a03(0x262)]===_0x293a03(0x1b9)||_0x2db439[_0x293a03(0x262)]===_0x293a03(0x155))_0x2539fd[_0x293a03(0x1b9)]++;else _0x2db439[_0x293a03(0x262)]==='running'?_0x2539fd['running']++:_0x2539fd[_0x293a03(0x19b)]++;}}return _0x2539fd;}function formatStats(_0x49091f){const _0x359aed=a50_0x474bcd;return['Total:\x20'+_0x49091f['total'],'✅\x20'+_0x49091f[_0x359aed(0x25a)],'❌\x20'+_0x49091f[_0x359aed(0x1b9)],_0x359aed(0x27c)+_0x49091f[_0x359aed(0x1d4)],'⏳\x20'+_0x49091f['pending']]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a50_0x474bcd(0x2ba)]=a50_0x474bcd(0x1d9);['description']='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a50_0x474bcd(0x181)](_0x357a89){const _0x52478d=a50_0x474bcd,{options:_0x30d3fe,args:_0x56d57b,tdx:_0x17da0f}=_0x357a89;let _0x2e42bf,_0x16566c,_0x3ab5d9=![];if(_0x56d57b[0x0]){if(_0x56d57b[0x0][_0x52478d(0x281)]('.')){const _0x2138fc=this[_0x52478d(0x184)](_0x56d57b,_0x30d3fe);if(!_0x2138fc)return 0x1;_0x2e42bf=_0x2138fc[_0x52478d(0x13c)],_0x16566c=_0x2138fc[_0x52478d(0x183)];}else{_0x16566c=_0x56d57b[0x0],_0x2e42bf=_0x30d3fe[_0x52478d(0x235)];if(!_0x2e42bf)return console[_0x52478d(0x1b9)](a50_0x17f5af[_0x52478d(0x1cc)](_0x52478d(0x176)),_0x52478d(0x13f)),0x1;_0x3ab5d9=!![];}}else{const _0x1db9b4=this[_0x52478d(0x184)](_0x56d57b,_0x30d3fe);if(!_0x1db9b4)return 0x1;_0x2e42bf=_0x1db9b4[_0x52478d(0x13c)],_0x16566c=_0x1db9b4[_0x52478d(0x183)];}if(_0x30d3fe[_0x52478d(0x2bc)]){if(_0x2e42bf&&_0x16566c)console[_0x52478d(0x1b9)](_0x52478d(0x21b)+_0x2e42bf+'.'+_0x16566c);else _0x2e42bf&&console['error'](_0x52478d(0x162)+_0x2e42bf);}const _0x1ba3e3=_0x30d3fe[_0x52478d(0x1ea)],_0x153016=_0x30d3fe[_0x52478d(0x174)];if(_0x1ba3e3){_0x153016&&console['error'](a50_0x17f5af[_0x52478d(0x2dd)](_0x52478d(0x198)),_0x52478d(0x1ba));const _0x337def=_0x30d3fe[_0x52478d(0x2c5)];return _0x337def?await this[_0x52478d(0x1b2)](_0x357a89,_0x1ba3e3):await this[_0x52478d(0x260)](_0x357a89,_0x1ba3e3,_0x30d3fe),0x0;}if(_0x153016){const _0x1be9cd=await withSpinner(_0x52478d(0x1f7),()=>_0x17da0f['workflow'][_0x52478d(0x185)]({'projectName':_0x2e42bf,'workflowName':_0x16566c,'limit':0x64}),{'verbose':_0x30d3fe['verbose']}),_0x54a50f=_0x1be9cd[_0x52478d(0x1d5)]['find'](_0x239aa8=>_0x239aa8['id']===_0x153016);if(!_0x54a50f)return console[_0x52478d(0x1b9)](a50_0x17f5af[_0x52478d(0x1cc)](_0x52478d(0x176)),_0x52478d(0x248)+_0x153016),0x1;if(!_0x54a50f[_0x52478d(0x2d8)]?.['id'])return console['error'](a50_0x17f5af[_0x52478d(0x1cc)](_0x52478d(0x176)),_0x52478d(0x208)+_0x153016+_0x52478d(0x230)),0x1;const _0x581bd4=_0x54a50f[_0x52478d(0x2d8)]['id'];_0x30d3fe['verbose']&&console[_0x52478d(0x1b9)](_0x52478d(0x1b4)+_0x581bd4+_0x52478d(0x1ac)+_0x153016);const _0x4d3296=_0x30d3fe[_0x52478d(0x2c5)];return _0x4d3296?await this[_0x52478d(0x1b2)](_0x357a89,_0x581bd4):await this[_0x52478d(0x260)](_0x357a89,_0x581bd4,_0x30d3fe),0x0;}const _0x290094=await withSpinner('Loading\x20sessions...',()=>_0x17da0f['workflow'][_0x52478d(0x185)]({'projectName':_0x2e42bf,'workflowName':_0x16566c,'limit':_0x30d3fe['limit']||0x32}),{'verbose':_0x30d3fe[_0x52478d(0x2bc)]}),_0x9fb94e=_0x290094['data'];if(_0x9fb94e[_0x52478d(0x27a)]===0x0){if(_0x2e42bf&&_0x16566c)console[_0x52478d(0x1b9)](_0x52478d(0x2d2)+_0x2e42bf+'.'+_0x16566c);else _0x2e42bf?console[_0x52478d(0x1b9)](_0x52478d(0x29e)+_0x2e42bf):(console[_0x52478d(0x1b9)](_0x52478d(0x2d7)),console[_0x52478d(0x1b9)](a50_0x17f5af['dim'](_0x52478d(0x17f))));return 0x0;}_0x9fb94e[_0x52478d(0x257)]((_0x31d4c3,_0x24b11a)=>{const _0x37425e=_0x52478d,_0x12fd93=_0x31d4c3['sessionTime']||'',_0x22ef93=_0x24b11a[_0x37425e(0x1a7)]||'';return _0x22ef93['localeCompare'](_0x12fd93);});if(_0x30d3fe['json']||_0x30d3fe[_0x52478d(0x1fd)])return await handleSDKOutput(_0x9fb94e,_0x30d3fe),0x0;let _0x1e30b4;if(_0x3ab5d9){const _0x11fe36=_0x9fb94e[0x0];if(!_0x11fe36[_0x52478d(0x2d8)]?.['id'])return console[_0x52478d(0x1b9)](_0x52478d(0x21e)),0x0;_0x1e30b4=_0x11fe36['lastAttempt']['id'],_0x30d3fe[_0x52478d(0x2bc)]&&console[_0x52478d(0x1b9)](_0x52478d(0x1e2)+_0x11fe36[_0x52478d(0x1a7)]);}else{const _0x2652dd=_0x9fb94e['map'](_0x5e5b57=>{const _0xf929a0=_0x52478d,_0x42ef56=getAttemptStatusDisplay(_0x5e5b57[_0xf929a0(0x2d8)]);return{'title':_0x5e5b57[_0xf929a0(0x166)]?.[_0xf929a0(0x2ba)]+'.'+_0x5e5b57[_0xf929a0(0x252)]?.[_0xf929a0(0x2ba)]+'\x20-\x20'+_0x5e5b57[_0xf929a0(0x1a7)]+'\x20'+_0x42ef56['icon'],'value':_0x5e5b57[_0xf929a0(0x2d8)]?.['id']||'','description':_0x42ef56[_0xf929a0(0x1d0)]};}),_0x274917=await a50_0xb9a0b4({'type':_0x52478d(0x161),'name':_0x52478d(0x1ea),'message':_0x52478d(0x202),'choices':_0x2652dd['filter'](_0x211c86=>_0x211c86[_0x52478d(0x14d)]!=='')});if(!_0x274917[_0x52478d(0x1ea)])return 0x0;_0x1e30b4=_0x274917[_0x52478d(0x1ea)];}const _0xa7e8fe=_0x30d3fe['follow'];return _0xa7e8fe?await this[_0x52478d(0x1b2)](_0x357a89,_0x1e30b4):await this[_0x52478d(0x260)](_0x357a89,_0x1e30b4,_0x30d3fe),0x0;}async[a50_0x474bcd(0x260)](_0x335b96,_0x4111b0,_0x1a3465){const _0x375ff6=a50_0x474bcd,{tdx:_0x30e1b5}=_0x335b96;let _0x2077bb,_0x447846;try{[_0x2077bb,_0x447846]=await Promise['all']([_0x30e1b5[_0x375ff6(0x252)][_0x375ff6(0x1f4)](_0x4111b0),_0x30e1b5['workflow'][_0x375ff6(0x142)](_0x4111b0,![])]);}catch(_0x258381){console[_0x375ff6(0x1b9)](a50_0x17f5af['red'](_0x375ff6(0x15c)));_0x1a3465['verbose']&&console[_0x375ff6(0x1b9)](_0x258381);throw _0x258381;}if(_0x1a3465[_0x375ff6(0x170)]||_0x1a3465[_0x375ff6(0x1fd)]){const _0x5618c8=this['buildTimelineData'](_0x2077bb,_0x447846);await handleSDKOutput([_0x5618c8],_0x1a3465);return;}const _0xd40abf=_0x30e1b5['context'][_0x375ff6(0x264)],_0x149c4d=this[_0x375ff6(0x179)](_0x2077bb,_0x447846,_0xd40abf);console['log'](_0x149c4d);}async['pollTimeline'](_0x1d2cab,_0x4c8cad){const _0x449043=a50_0x474bcd,{tdx:_0x5b954b}=_0x1d2cab,_0x2e054b=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x1e2f2f=TIMELINE_CONFIG[_0x449043(0x15a)];let _0x32f718=0x0;while(_0x32f718<_0x1e2f2f){process[_0x449043(0x267)][_0x449043(0x251)]&&process[_0x449043(0x267)]['write']('\x1bc');let _0x48cb84,_0xdf9bea;try{[_0x48cb84,_0xdf9bea]=await Promise[_0x449043(0x271)]([_0x5b954b[_0x449043(0x252)]['attempt'](_0x4c8cad),_0x5b954b[_0x449043(0x252)][_0x449043(0x142)](_0x4c8cad,![])]);}catch(_0x39dcf3){console[_0x449043(0x1b9)](a50_0x17f5af[_0x449043(0x1cc)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x32f718>0x0&&console[_0x449043(0x1b9)](a50_0x17f5af[_0x449043(0x1b6)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x32f718));throw _0x39dcf3;}const _0xee436d=_0x5b954b[_0x449043(0x17c)][_0x449043(0x264)],_0x540a43=this[_0x449043(0x179)](_0x48cb84,_0xdf9bea,_0xee436d);console[_0x449043(0x23a)](_0x540a43);const _0x50314a=_0x48cb84['done']&&_0xdf9bea[_0x449043(0x2d4)](_0x5b03ca=>_0x5b03ca[_0x449043(0x262)]!=='running'&&_0x5b03ca[_0x449043(0x262)]!==_0x449043(0x207));if(_0x50314a){console[_0x449043(0x1b9)](a50_0x17f5af[_0x449043(0x214)](_0x449043(0x19f)));break;}console[_0x449043(0x1b9)](a50_0x17f5af[_0x449043(0x1b6)](_0x449043(0x28d)+_0x32f718*0x2+_0x449043(0x27b))),await new Promise(_0x18cb4=>setTimeout(_0x18cb4,_0x2e054b)),_0x32f718++;}_0x32f718>=_0x1e2f2f&&console['error'](a50_0x17f5af[_0x449043(0x2dd)](_0x449043(0x237)));}['renderTimeline'](_0x38de1f,_0x53c185,_0x55af11){const _0x4d2a2c=a50_0x474bcd,_0x4efd35=[],_0x42b447=TIMELINE_CONFIG[_0x4d2a2c(0x1be)],_0x557841=0x5,_0x458f1a=process[_0x4d2a2c(0x267)][_0x4d2a2c(0x1ae)]||0x78,_0x573f1c=_0x458f1a-_0x42b447-_0x557841,_0x3c842b=Math[_0x4d2a2c(0x1e6)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math[_0x4d2a2c(0x2d9)](_0x573f1c,TIMELINE_CONFIG[_0x4d2a2c(0x295)])),_0x1372c6=new Date(_0x38de1f[_0x4d2a2c(0x2b2)])[_0x4d2a2c(0x1f5)](),_0x3b362b=_0x38de1f['finishedAt']?new Date(_0x38de1f[_0x4d2a2c(0x1a1)])[_0x4d2a2c(0x1f5)]():Date['now'](),_0x626383={'start':_0x1372c6,'end':_0x3b362b,'duration':_0x3b362b-_0x1372c6},_0x3bde83=new Map(),_0x93e318=[];for(const _0x5d5d93 of _0x53c185){if(_0x5d5d93[_0x4d2a2c(0x2c6)]){const _0x39968b=new Date(_0x5d5d93['startedAt'])[_0x4d2a2c(0x1f5)](),_0x2c64eb=_0x5d5d93['updatedAt']?new Date(_0x5d5d93['updatedAt'])['getTime']():Date['now'](),_0x22e45c={'start':_0x39968b,'end':_0x2c64eb,'duration':_0x2c64eb-_0x39968b};_0x3bde83[_0x4d2a2c(0x146)](_0x5d5d93['id'],_0x22e45c),_0x93e318[_0x4d2a2c(0x29a)]({'name':_0x5d5d93['fullName'],'state':_0x5d5d93['state']||_0x4d2a2c(0x18c),'window':_0x22e45c});}else _0x93e318['push']({'name':_0x5d5d93[_0x4d2a2c(0x26e)],'state':_0x5d5d93[_0x4d2a2c(0x262)]||_0x4d2a2c(0x207),'window':undefined});}_0x93e318[_0x4d2a2c(0x257)]((_0x265cc9,_0x1c49fc)=>{const _0x3403ed=_0x4d2a2c;if(!_0x265cc9[_0x3403ed(0x278)])return 0x1;if(!_0x1c49fc[_0x3403ed(0x278)])return-0x1;return _0x265cc9['window'][_0x3403ed(0x18f)]-_0x1c49fc[_0x3403ed(0x278)][_0x3403ed(0x18f)];});const _0x7467dc=_0x93e318[_0x4d2a2c(0x27a)],_0x1bed19=_0x7467dc>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x1bed19&&_0x93e318[_0x4d2a2c(0x243)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x23966a=calculateTimeScale(_0x626383,_0x3c842b),_0x5902d9=_0x38de1f[_0x4d2a2c(0x21f)]?_0x38de1f[_0x4d2a2c(0x25a)]?a50_0x17f5af['green']('success'):a50_0x17f5af[_0x4d2a2c(0x1cc)](_0x4d2a2c(0x1b9)):a50_0x17f5af[_0x4d2a2c(0x250)]('running'),_0x57b954=_0x38de1f[_0x4d2a2c(0x166)]?.['id'],_0x4c7944=_0x38de1f[_0x4d2a2c(0x174)];let _0x5330d6;if(_0x57b954&&_0x4c7944){const _0x3d9731=getWorkflowAttemptUrl(_0x55af11,_0x57b954,_0x4c7944,_0x38de1f['id']);_0x5330d6=hyperlink(a50_0x17f5af['dim'](_0x38de1f['id']),_0x3d9731);}else _0x5330d6=a50_0x17f5af['dim'](_0x38de1f['id']);_0x4efd35['push'](_0x4d2a2c(0x22b)+_0x5330d6+'\x20-\x20'+_0x5902d9+'\x20-\x20'+formatElapsed(_0x626383['duration']));if(_0x93e318[_0x4d2a2c(0x27a)]>0x0){const _0xe736f0=renderTimeAxis(_0x23966a,_0x3c842b),_0x1ecfde=new Date(_0x626383['start']),_0x588d56=formatDate(_0x1ecfde),_0x6de905=TIMELINE_CONFIG[_0x4d2a2c(0x2be)]+TIMELINE_CONFIG['ICON_SPACING']+_0x42b447,_0x3354d8=_0x588d56[_0x4d2a2c(0x24d)](_0x6de905),_0x1ed515=a50_0x17f5af[_0x4d2a2c(0x1b6)](_0x3354d8);_0x4efd35[_0x4d2a2c(0x29a)](_0x1ed515+'\x20'+_0xe736f0);for(const _0x4a182c of _0x93e318){_0x4efd35[_0x4d2a2c(0x29a)](renderTaskRow(_0x4a182c,_0x23966a,_0x3c842b,_0x42b447));}const _0x650218=calculateStats(_0x93e318);_0x4efd35['push'](formatStats(_0x650218)),_0x1bed19&&_0x4efd35[_0x4d2a2c(0x29a)](a50_0x17f5af[_0x4d2a2c(0x2dd)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x4d2a2c(0x17a)]+_0x4d2a2c(0x29f)+_0x7467dc+_0x4d2a2c(0x2c4))),_0x4efd35[_0x4d2a2c(0x29a)](''),_0x4efd35[_0x4d2a2c(0x29a)](a50_0x17f5af[_0x4d2a2c(0x1b6)]('💡\x20Tip:\x20Use\x20')+(_0x4d2a2c(0x1bd)+_0x38de1f['id']+_0x4d2a2c(0x2df))+a50_0x17f5af['dim'](_0x4d2a2c(0x141)));}else _0x4efd35[_0x4d2a2c(0x29a)](_0x4d2a2c(0x27f));return _0x4efd35[_0x4d2a2c(0x2a9)]('\x0a');}[a50_0x474bcd(0x1c5)](_0xd277ac,_0x5a3c92){const _0xfd1b33=a50_0x474bcd,_0x22e7a6=new Date(_0xd277ac['createdAt'])[_0xfd1b33(0x1f5)](),_0x4d42d3=_0xd277ac[_0xfd1b33(0x1a1)]?new Date(_0xd277ac[_0xfd1b33(0x1a1)])['getTime']():Date['now'](),_0xff3a26=_0x4d42d3-_0x22e7a6,_0x49eab6=[];for(const _0x5921ad of _0x5a3c92){if(_0x5921ad[_0xfd1b33(0x2c6)]){const _0x1a1023=new Date(_0x5921ad[_0xfd1b33(0x2c6)])[_0xfd1b33(0x1f5)](),_0x36b531=_0x5921ad[_0xfd1b33(0x2ce)]?new Date(_0x5921ad['updatedAt'])[_0xfd1b33(0x1f5)]():Date['now']();_0x49eab6[_0xfd1b33(0x29a)]({'name':_0x5921ad[_0xfd1b33(0x26e)],'state':_0x5921ad[_0xfd1b33(0x262)]||'unknown','window':{'start':_0x1a1023,'end':_0x36b531,'duration':_0x36b531-_0x1a1023}});}else _0x49eab6[_0xfd1b33(0x29a)]({'name':_0x5921ad[_0xfd1b33(0x26e)],'state':_0x5921ad[_0xfd1b33(0x262)]||_0xfd1b33(0x207),'window':undefined});}const _0x186b71=calculateStats(_0x49eab6);return{'attempt':{'id':_0xd277ac['id'],'status':_0xd277ac[_0xfd1b33(0x21f)]?_0xd277ac[_0xfd1b33(0x25a)]?_0xfd1b33(0x25a):_0xfd1b33(0x1b9):_0xfd1b33(0x1d4),'createdAt':_0xd277ac[_0xfd1b33(0x2b2)],'finishedAt':_0xd277ac[_0xfd1b33(0x1a1)],'duration_ms':_0xff3a26},'tasks':_0x49eab6['map'](_0x5ed871=>({'name':_0x5ed871['name'],'state':_0x5ed871['state'],'startedAt':_0x5ed871[_0xfd1b33(0x278)]?new Date(_0x5ed871[_0xfd1b33(0x278)][_0xfd1b33(0x18f)])['toISOString']():null,'updatedAt':_0x5ed871[_0xfd1b33(0x278)]?new Date(_0x5ed871[_0xfd1b33(0x278)][_0xfd1b33(0x2a6)])[_0xfd1b33(0x199)]():null,'duration_ms':_0x5ed871[_0xfd1b33(0x278)]?.[_0xfd1b33(0x192)]||null})),'stats':_0x186b71};}}
1
+ const a51_0x467f12=a51_0x56f9;(function(_0xceb76b,_0x1e911a){const _0x43eabb=a51_0x56f9,_0x209e75=_0xceb76b();while(!![]){try{const _0x548da6=-parseInt(_0x43eabb(0x278))/0x1+-parseInt(_0x43eabb(0x31a))/0x2+parseInt(_0x43eabb(0x1b1))/0x3*(parseInt(_0x43eabb(0x214))/0x4)+parseInt(_0x43eabb(0x21f))/0x5+-parseInt(_0x43eabb(0x277))/0x6*(parseInt(_0x43eabb(0x26c))/0x7)+-parseInt(_0x43eabb(0x222))/0x8*(-parseInt(_0x43eabb(0x1ad))/0x9)+-parseInt(_0x43eabb(0x1b4))/0xa*(-parseInt(_0x43eabb(0x231))/0xb);if(_0x548da6===_0x1e911a)break;else _0x209e75['push'](_0x209e75['shift']());}catch(_0x14fe01){_0x209e75['push'](_0x209e75['shift']());}}}(a51_0xf6ba,0x6a7a1));import a51_0x221e70 from'chalk';import{existsSync}from'fs';import a51_0x5534f1 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';function a51_0xf6ba(){const _0x2ce8a0=['143gQTGRI','Project:\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','start','window','workflows','MAX_TASKS_DISPLAY','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x22\x20already\x20exists\x20(ID:\x20','includes','Retrying\x20session...','No\x20workflow\x20projects\x20found','running','No\x20workflows\x20found\x20in\x20project:\x20','project','parse','sort','description','List\x20workflow\x20execution\x20sessions','\x0aDry\x20run\x20-\x20no\x20files\x20written','skipValidation','durationMs','executePushProject','Loading\x20session...','stringify','Project\x20filter:\x20','params','error','isTTY','Select\x20a\x20workflow\x20to\x20run','getDate','workflow:delete','fullName','format','workflow:kill','done','execute','Pulling\x20project\x20','ICON_SPACING','New\x20project\x20name:\x20','Error:\x20Secret\x20key\x20is\x20required','green','Kill\x20a\x20running\x20attempt','startTime','startsWith','✔\x20Workflow\x20project\x20context\x20cleared.','...','\x20\x20Revision:\x20','existingProjectId','setSecret','---\x20','data','\x0a✔\x20Attempt\x20complete','get','workflow:sessions','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','workflow:timeline','basename','planned','7cQPwxa','\x20\x20Changes:\x20','length','site','msPerChar','Project\x20name:\x20','hasChanges','find','clear','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','→\x20New\x20project:\x20','599736MPAXJh','693281psvFww','Usage:\x20tdx\x20wf\x20use\x20<project>','Show\x20tasks\x20for\x20an\x20attempt','utf-8','Validation:\x20skipped','attemptId','Warning:','type','Filter:\x20','Analyzing\x20project...','Files\x20to\x20upload:\x20','Filter:\x20project=','taskName','✔\x20Found\x20','\x20\x20Session\x20ID:\x20',',\x20Workflow:\x20','modified','\x20-\x20','lastAttempt','Revision:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','unknown','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x22\x20to\x20new\x20project\x20\x22','attempt','\x20deleted','\x20\x20Console:\x20','No\x20sessions\x20found','stat','log','yellow','workflow:attempt','✔\x20Project:\x20','Listing\x20workflow\x20sessions...','pullProject','List\x20workflows','session','\x20is\x20not\x20a\x20directory','indexOf','limit','MIN_LABEL_COUNT','Pushing\x20project...','Killing\x20attempt...','Project\x20directory:\x20','fs/promises','key','end','✔\x20Secret\x20\x27','No\x20workflow\x20tdx.json\x20found','new','targetExists','summary','session:','includeSubtasks','getTime','blue','cyan','jsonl','workflow:logs','dim','substring','→\x20Project:\x20','map','Downloading\x20logs...','Listing\x20workflow\x20attempts...','context','/attempt/','No\x20projects\x20match\x20pattern:\x20','displayLine','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','slice','renderSingleTimeline','\x20\x20New\x20attempt\x20ID:\x20','Listing\x20secrets...','\x20\x20Project:\x20','round','changes','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Key:\x20','index','icon','Retry\x20a\x20session\x20or\x20attempt','MIN_TIMELINE_WIDTH','\x20sessions\x20','newProjectId','navigateSessionsInteractive','match','localeCompare','Listing\x20workflows...','\x20task','MAX_TIMELINE_WIDTH','deleteSecret','workflow:run','Source\x20directory:\x20','workflow:retry','min','Source\x20directory\x20is\x20required','projectId','pending','\x20\x20Attempt\x20ID:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','cwd','\x20secret','\x20unchanged','Error:\x20Invalid\x20JSON\x20in\x20--params','✔\x20Showing\x20','splice','json','join','List\x20workflow\x20attempts','listSecrets','table','status','renderTimeline','delete','follow','Error:\x20Project\x20name\x20is\x20required','Attempt\x20ID:\x20','\x22\x20with\x20new\x20revision?','No\x20attempts\x20found\x20in\x20project:\x20','includeRetried','updatedAt','run','revision','Total:\x20','\x0a⚠\x20Project\x20\x22','\x22?\x20This\x20cannot\x20be\x20undone.','✔\x20Clone\x20complete','Workflow:\x20','\x20\x20Target:\x20','🔄\x20','param','sourceDir','select','workflow:workflows','set','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20\x20Project\x20ID:\x20','trim','list','Analyzing\x20changes...','Resolving\x20project\x20\x27','yes','\x0a✔\x20Already\x20up\x20to\x20date','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','push','From\x20task:\x20','fill','Writing\x20files...','Error:\x20Attempt\x20ID\x20is\x20required','white','\x0aError:','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','No\x20attempts\x20found','applyPullProject','POLL_INTERVAL_MS','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','✔\x20Deleted\x20project\x20','workflowName','prepareCloneProject','relative','561370JHiNHA','rows','max','Session\x20not\x20found:\x20','Start\x20a\x20workflow\x20run','showWorkflowConsoleUrl','\x20\x20Session\x20context\x20set\x20to:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20new','sessions','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','No\x20workflows\x20found','\x20\x20Source:\x20','.\x20Expected\x20format:\x20KEY=VALUE','Source\x20project:\x20','Failed\x20to\x20fetch\x20attempt\x20data','dryRun','\x20\x20Location:\x20','pollTimeline','tdx\x20wf\x20attempt\x20','Project\x20name\x20is\x20required','filter','workflowProject','values','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','attempt:','isArray','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','has','success','verbose','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Force:\x20yes','\x0aFailed\x20to\x20fetch\x20attempt\x20data','projectName','Listing\x20workflow\x20projects...','\x20\x20Workflow:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','💡\x20Tip:\x20Use\x20','\x0aApply\x20these\x20changes?','\x1b[1A\x1b[2K','Fetching\x20log\x20files...','floor','\x20attempt','tdx.json','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','retryAttempt','diff','resumeFrom','readFile','\x0aClone\x20\x22','Task\x20name:\x20','265851RFkCVY','Attempt:\x20','sessionId','attempts','462tGeuqN','startedAt','toLowerCase','803420AswiOI','stdout','\x20of\x20','Status:\x20','from','buildTimelineData','kill','Pushing\x20workflow\x20project...','\x20to\x20see\x20detailed\x20logs','newProjectName','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','MAX_POLL_ITERATIONS','✔\x20Pushed\x20','No\x20log\x20content\x20found','Cancelled','duration','renderSessionsTimeline','parseProjectWorkflowPattern','retryAttemptName','getFullYear','Resume\x20from:\x20','Error:','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','No\x20sessions\x20found\x20in\x20project:\x20','\x20(system)','Getting\x20attempt\x20tasks...','unchanged','(use\x20--limit\x20to\x20see\x20more)','Select\x20a\x20task\x20to\x20view\x20logs:','some','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','columns','Session\x20time:\x20','/sessions/','red','Downloading\x20project\x20','Updating\x20','name','state','\x0aPolling...\x20(','Tip:\x20cd\x20to\x20workflows/','createdAt','✔\x20Downloaded\x20','fileCount','padStart','sessionTime','cancelRequested','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','finishedAt','force','Select\x20a\x20session\x20to\x20view\x20timeline:','tasks','keys','Target:\x20','No\x20sessions\x20found\x20for:\x20','workflow:use','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','canceling','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','✔\x20Retry\x20started','\x20has\x20no\x20attempts','all','Source:\x20','-\x20nothing\x20pushed','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','✔\x20Workflow\x20project\x20set\x20to:\x20','now','resolveProjectDir','Dry\x20run:\x20yes','Error:\x20Invalid\x20parameter\x20format:\x20','workflow:clone','output','\x27\x20from\x20project\x20\x27','GUTTER','No\x20attempts\x20found\x20for:\x20','workflow','sourceProjectName','No\x20matching\x20sessions\x20found','\x27...','Show\x20specific\x20attempt\x20details','group_error','task','\x0a✔\x20No\x20changes\x20to\x20push','retrySession','requireProject','preparePushProject','workflow:secrets:set','workflow:projects','Getting\x20attempt\x20details...','projects','title','workflow:download','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','\x0aPush\x20these\x20changes?','3520cFlnJz','generateSessionTimelineRows','Session\x20','autocomplete','message','No\x20workflow\x20sessions\x20found','/app/workflows/','Including\x20subtasks:\x20yes','size','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','resolve','25780FTgcgf','session_id','Setting\x20secret...','88UWRMjN','workflow:secrets:delete','write','repeat','split','resolveProject','✔\x20Push\x20complete','ICON_WIDTH','✔\x20Pull\x20complete','\x0aDry\x20run\x20-\x20no\x20project\x20created','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Output\x20directory:\x20','Starting\x20workflow\x20run...','Latest\x20session\x20has\x20no\x20attempt','toISOString'];a51_0xf6ba=function(){return _0x2ce8a0;};return a51_0xf6ba();}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 a51_0x59e223 from'prompts';function getAttemptStatusDisplay(_0x3d78da){const _0x6dd222=a51_0x56f9;if(!_0x3d78da)return{'icon':'⏳','text':''};const {done:_0x2dc84e,success:_0x4ebde9,cancelRequested:_0x2fc6a1}=_0x3d78da;if(!_0x2dc84e)return _0x2fc6a1?{'icon':'🛑','text':a51_0x221e70[_0x6dd222(0x296)]('canceling')}:{'icon':'🔄','text':a51_0x221e70[_0x6dd222(0x2af)]('running')};if(_0x4ebde9)return{'icon':'✅','text':a51_0x221e70[_0x6dd222(0x25a)](_0x6dd222(0x194))};return{'icon':'❌','text':a51_0x221e70[_0x6dd222(0x1d8)](_0x6dd222(0x24c))};}export class WorkflowBaseCommand extends BaseCommand{[a51_0x467f12(0x227)](_0x2cf2dd,_0x4d37da,_0x262f08=0x0){return _0x2cf2dd[_0x262f08]||_0x4d37da['workflowProject'];}[a51_0x467f12(0x20a)](_0x3bb82e,_0x1c28e7,_0x36db4d=0x0){const _0x2f1b73=a51_0x467f12,_0x36f96a=this[_0x2f1b73(0x227)](_0x3bb82e,_0x1c28e7,_0x36db4d);if(!_0x36f96a)return console[_0x2f1b73(0x24c)](a51_0x221e70[_0x2f1b73(0x1d8)](_0x2f1b73(0x1cb)),_0x2f1b73(0x32e)),console[_0x2f1b73(0x24c)](a51_0x221e70[_0x2f1b73(0x2b3)](_0x2f1b73(0x1a5))),null;return _0x36f96a;}[a51_0x467f12(0x1c7)](_0x435fb6,_0x24bd88){const _0x36fafd=a51_0x467f12;if(_0x435fb6[0x0]){const _0xbcbdab=_0x435fb6[0x0][_0x36fafd(0x226)]('.');if(_0xbcbdab[_0x36fafd(0x26e)]===0x1)return{'projectName':_0xbcbdab[0x0],'workflowName':undefined};else return _0xbcbdab[_0x36fafd(0x26e)]===0x2?{'projectName':_0xbcbdab[0x0],'workflowName':_0xbcbdab[0x1]}:(console['error'](a51_0x221e70[_0x36fafd(0x1d8)]('Error:'),_0x36fafd(0x196)),null);}return{'projectName':_0x24bd88[_0x36fafd(0x330)],'workflowName':undefined};}[a51_0x467f12(0x1f9)](_0x48cff8,_0x1c5fd2,_0x430547=0x0){const _0x1dc6bc=a51_0x467f12;if(_0x48cff8[_0x430547])return _0x48cff8[_0x430547];if(_0x1c5fd2['workflowProject']){const _0x54755d=a51_0x5534f1[_0x1dc6bc(0x2e4)](process[_0x1dc6bc(0x2dd)](),_0x1dc6bc(0x236),_0x1c5fd2[_0x1dc6bc(0x330)]);if(existsSync(a51_0x5534f1[_0x1dc6bc(0x2e4)](_0x54755d,_0x1dc6bc(0x1a3))))return _0x54755d;}return undefined;}async[a51_0x467f12(0x31f)](_0x602945,_0xf7b1af,_0x2a614f){const _0x149ada=a51_0x467f12;try{const _0x51a196=await _0x602945[_0x149ada(0x201)]['workflows'](_0xf7b1af,{'limit':0x1});if(_0x51a196[_0x149ada(0x26e)]>0x0){const _0x44fe5e=_0x51a196[0x0]['id'],_0x2397a9=getWorkflowUrl(_0x2a614f,_0x44fe5e);console['error'](_0x149ada(0x292)+a51_0x221e70['cyan'](_0x2397a9));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x1ed);['description']='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async['execute'](_0x36038a){const _0x3b1e6d=a51_0x467f12,{options:_0x59fe94,args:_0x248574,tdx:_0x3a7a8f}=_0x36038a,_0x602a69=_0x248574[0x0],_0x379e73=_0x59fe94[_0x3b1e6d(0x274)];if(_0x379e73)return saveSessionContext({'workflow_project':undefined},_0x59fe94[_0x3b1e6d(0x29c)]),console['log'](a51_0x221e70[_0x3b1e6d(0x25a)](_0x3b1e6d(0x25e))),0x0;if(!_0x602a69)return console['error'](a51_0x221e70[_0x3b1e6d(0x1d8)](_0x3b1e6d(0x1cb)),_0x3b1e6d(0x32e)),console['error'](a51_0x221e70['dim'](_0x3b1e6d(0x279))),console[_0x3b1e6d(0x24c)](a51_0x221e70['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x3127c4=await withSpinner(_0x3b1e6d(0x306)+_0x602a69+_0x3b1e6d(0x204),()=>_0x3a7a8f[_0x3b1e6d(0x201)]['resolveProjectId'](_0x602a69),{'verbose':_0x59fe94[_0x3b1e6d(0x195)]}),{name:_0x5e62c9}=_0x3127c4[_0x3b1e6d(0x264)];return saveSessionContext({'workflow_project':_0x5e62c9},_0x59fe94[_0x3b1e6d(0x29c)]),console['log'](a51_0x221e70['green'](_0x3b1e6d(0x1f7)+a51_0x221e70['cyan'](_0x5e62c9))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x20d);[a51_0x467f12(0x242)]='List\x20all\x20workflow\x20projects';async[a51_0x467f12(0x255)](_0x420644){const _0x48f3e5=a51_0x467f12,{options:_0x1b9504,args:_0x595e22,tdx:_0x490fce}=_0x420644,_0x13c43f=_0x595e22[0x0];_0x1b9504[_0x48f3e5(0x195)]&&_0x13c43f&&console[_0x48f3e5(0x24c)]('Pattern:\x20'+_0x13c43f);const _0x3ec4f5=await withSpinner(_0x48f3e5(0x19a),()=>_0x490fce['workflow'][_0x48f3e5(0x20f)](_0x13c43f,{'limit':_0x1b9504[_0x48f3e5(0x29f)]}),{'verbose':_0x1b9504['verbose']});let _0x4abad2=_0x3ec4f5['data'];_0x4abad2[_0x48f3e5(0x241)]((_0x169b50,_0x5c4cf8)=>_0x169b50['name'][_0x48f3e5(0x2cf)](_0x5c4cf8['name']));const _0x268fc8=_0x1b9504[_0x48f3e5(0x29f)]||0x64,_0x9d8504=_0x4abad2[_0x48f3e5(0x26e)]>=_0x268fc8?a51_0x221e70[_0x48f3e5(0x2b3)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x48f3e5(0x24c)](_0x48f3e5(0x285)+_0x4abad2[_0x48f3e5(0x26e)]+'\x20project'+(_0x4abad2[_0x48f3e5(0x26e)]!==0x1?'s':'')+_0x9d8504);if(_0x1b9504[_0x48f3e5(0x252)]===_0x48f3e5(0x2e3)||_0x1b9504[_0x48f3e5(0x252)]===_0x48f3e5(0x2b1)||_0x1b9504[_0x48f3e5(0x252)]===_0x48f3e5(0x2e7))await handleSDKOutput(_0x4abad2,_0x1b9504);else{if(_0x4abad2[_0x48f3e5(0x26e)]===0x0)_0x13c43f?console['log'](_0x48f3e5(0x2bb)+_0x13c43f):console['log'](_0x48f3e5(0x23c));else{const _0x3e2984=_0x4abad2[_0x48f3e5(0x2b6)](_0x2664fc=>{const _0x3d4e3c=_0x48f3e5,_0x4ba335=_0x2664fc['metadata']?.[_0x3d4e3c(0x1d3)](_0x2e224e=>_0x2e224e[_0x3d4e3c(0x2a5)]==='sys'),_0xcb5bab=_0x4ba335?a51_0x221e70['dim'](_0x3d4e3c(0x1ce)):'';return'📁\x20'+_0x2664fc[_0x3d4e3c(0x1db)]+_0xcb5bab;});await writeOutput(_0x3e2984[_0x48f3e5(0x2e4)]('\x0a'),_0x1b9504[_0x48f3e5(0x1fd)],_0x48f3e5(0x304));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x2fe);['description']=a51_0x467f12(0x29b);async[a51_0x467f12(0x255)](_0x427d74){const _0x3a104c=a51_0x467f12,{options:_0x16bf86,args:_0x2bb3c8,tdx:_0x261a0e}=_0x427d74,_0x40d7e9=this[_0x3a104c(0x227)](_0x2bb3c8,_0x16bf86);_0x16bf86['verbose']&&_0x40d7e9&&console[_0x3a104c(0x24c)](_0x3a104c(0x24a)+_0x40d7e9);const _0x3b8067=await withSpinner(_0x3a104c(0x2d0),()=>_0x261a0e[_0x3a104c(0x201)][_0x3a104c(0x236)](_0x40d7e9,{'limit':_0x16bf86[_0x3a104c(0x29f)]}),{'verbose':_0x16bf86[_0x3a104c(0x195)]});let _0x382eba=_0x3b8067[_0x3a104c(0x264)];_0x382eba[_0x3a104c(0x241)]((_0x215f63,_0x3ea009)=>{const _0x51a93e=_0x3a104c,_0x2b9a11=_0x215f63[_0x51a93e(0x1db)]['localeCompare'](_0x3ea009['name']);if(_0x2b9a11!==0x0)return _0x2b9a11;return(_0x215f63['project']?.[_0x51a93e(0x1db)]||'')[_0x51a93e(0x2cf)](_0x3ea009['project']?.[_0x51a93e(0x1db)]||'');});const _0x546ee9=_0x16bf86[_0x3a104c(0x29f)]||0x64,_0x51033e=_0x382eba[_0x3a104c(0x26e)]>=_0x546ee9?a51_0x221e70[_0x3a104c(0x2b3)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x3a104c(0x24c)](_0x3a104c(0x285)+_0x382eba[_0x3a104c(0x26e)]+'\x20workflow'+(_0x382eba[_0x3a104c(0x26e)]!==0x1?'s':'')+_0x51033e);if(_0x16bf86[_0x3a104c(0x252)]===_0x3a104c(0x2e3)||_0x16bf86['format']===_0x3a104c(0x2b1)||_0x16bf86['format']===_0x3a104c(0x2e7))await handleSDKOutput(_0x382eba,_0x16bf86);else{if(_0x382eba[_0x3a104c(0x26e)]===0x0)_0x40d7e9?console[_0x3a104c(0x295)](_0x3a104c(0x23e)+_0x40d7e9):console[_0x3a104c(0x295)](_0x3a104c(0x325));else{const _0x34fa17=_0x16bf86[_0x3a104c(0x26f)],_0x52b65c=_0x382eba['map'](_0x3c6fc5=>{const _0x226593=_0x3a104c,_0x2099b2=a51_0x221e70[_0x226593(0x2b3)]('#'+_0x3c6fc5['id']),_0x44e231=hyperlink(_0x2099b2,getWorkflowUrl(_0x34fa17,_0x3c6fc5['id'])),_0xe98f4c=_0x3c6fc5[_0x226593(0x23f)]?.['name']?a51_0x221e70['dim']('\x20('+_0x3c6fc5[_0x226593(0x23f)][_0x226593(0x1db)]+')'):'';return'📋\x20'+_0x44e231+'\x20'+_0x3c6fc5[_0x226593(0x1db)]+_0xe98f4c;});await writeOutput(_0x52b65c[_0x3a104c(0x2e4)]('\x0a'),_0x16bf86[_0x3a104c(0x1fd)],_0x3a104c(0x304));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x267);[a51_0x467f12(0x242)]=a51_0x467f12(0x243);async[a51_0x467f12(0x255)](_0x1aec0c){const _0x38efab=a51_0x467f12,{options:_0x377413,args:_0x127c57,tdx:_0x31d2db}=_0x1aec0c,_0x1fa47d=this[_0x38efab(0x1c7)](_0x127c57,_0x377413);if(!_0x1fa47d)return 0x1;const {projectName:_0x88bb3,workflowName:_0xd1114a}=_0x1fa47d;if(_0x377413[_0x38efab(0x195)]){if(_0x88bb3&&_0xd1114a)console['error'](_0x38efab(0x280)+_0x88bb3+'.'+_0xd1114a);else _0x88bb3&&console[_0x38efab(0x24c)](_0x38efab(0x283)+_0x88bb3);const _0x4be621=_0x377413['status'];_0x4be621&&console[_0x38efab(0x24c)](_0x38efab(0x1b7)+_0x4be621);}let _0x29d341=0x28;if(process['stdout'][_0x38efab(0x24d)]&&!_0x377413['output']&&!_0x377413[_0x38efab(0x252)]){const _0x38feec=process[_0x38efab(0x1b5)][_0x38efab(0x31b)]||0x28;_0x29d341=Math[_0x38efab(0x31c)](0x14,Math['floor'](_0x38feec*0x2/0x3));}const _0x18982b=_0x377413[_0x38efab(0x29f)]||_0x29d341,_0x5ac2ce=await withSpinner(_0x38efab(0x299),()=>_0x31d2db[_0x38efab(0x201)][_0x38efab(0x323)]({'projectName':_0x88bb3,'workflowName':_0xd1114a,'status':_0x377413[_0x38efab(0x2e8)],'fromTime':_0x377413[_0x38efab(0x1b8)],'toTime':_0x377413['to'],'limit':_0x18982b}),{'verbose':_0x377413[_0x38efab(0x195)]}),_0x45844e=_0x5ac2ce[_0x38efab(0x264)];_0x45844e[_0x38efab(0x241)]((_0x45ec36,_0x1ca32b)=>{const _0x38f185=_0x38efab,_0x5b940f=_0x45ec36[_0x38f185(0x1e3)]||'',_0x8375b5=_0x1ca32b[_0x38f185(0x1e3)]||'';return _0x8375b5[_0x38f185(0x2cf)](_0x5b940f);});_0x45844e[_0x38efab(0x26e)]>=_0x18982b?console[_0x38efab(0x24c)](_0x38efab(0x2e1)+_0x45844e['length']+_0x38efab(0x2cb)+a51_0x221e70['dim'](_0x38efab(0x1d1))):console[_0x38efab(0x24c)](_0x38efab(0x285)+_0x45844e[_0x38efab(0x26e)]+'\x20session'+(_0x45844e[_0x38efab(0x26e)]!==0x1?'s':''));if(_0x377413[_0x38efab(0x252)]==='json'||_0x377413[_0x38efab(0x252)]===_0x38efab(0x2b1)||_0x377413['format']===_0x38efab(0x2e7))await handleSDKOutput(_0x45844e,_0x377413);else{if(!process[_0x38efab(0x1b5)][_0x38efab(0x24d)]||_0x377413[_0x38efab(0x1fd)]){if(_0x45844e[_0x38efab(0x26e)]===0x0){if(_0x88bb3&&_0xd1114a)console[_0x38efab(0x295)](_0x38efab(0x1ec)+_0x88bb3+'.'+_0xd1114a);else _0x88bb3?console[_0x38efab(0x295)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x88bb3):console[_0x38efab(0x295)](_0x38efab(0x293));}else{const _0x4b2eef=_0x377413[_0x38efab(0x26f)],_0x1c204d=this[_0x38efab(0x1c6)](_0x45844e,_0x4b2eef);_0x377413[_0x38efab(0x1fd)]?await writeOutput(_0x1c204d,_0x377413[_0x38efab(0x1fd)],_0x38efab(0x304)):console['log'](_0x1c204d);}!_0x88bb3&&(console[_0x38efab(0x24c)](''),console[_0x38efab(0x24c)](a51_0x221e70[_0x38efab(0x2b3)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console['error'](a51_0x221e70[_0x38efab(0x2b3)](_0x38efab(0x301))+'or'+a51_0x221e70[_0x38efab(0x2b3)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x45844e[_0x38efab(0x26e)]===0x0){if(_0x88bb3&&_0xd1114a)console[_0x38efab(0x295)]('No\x20sessions\x20found\x20for:\x20'+_0x88bb3+'.'+_0xd1114a);else _0x88bb3?console[_0x38efab(0x295)](_0x38efab(0x1cd)+_0x88bb3):console['log'](_0x38efab(0x293));}else await this['navigateSessionsInteractive'](_0x45844e,_0x1aec0c,_0x88bb3);}}return 0x0;}[a51_0x467f12(0x1c6)](_0xa966a3,_0x128492){const _0x4df439=a51_0x467f12,_0x1f1643=[],_0x13550e=new Map();let _0x2f3c71=Infinity,_0x3d9bf7=-Infinity;for(const _0x5b230d of _0xa966a3){if(_0x5b230d['lastAttempt']?.[_0x4df439(0x1df)]){const _0xfd2348=new Date(_0x5b230d['lastAttempt'][_0x4df439(0x1df)])[_0x4df439(0x2ae)](),_0x1c2e45=_0x5b230d[_0x4df439(0x28a)]['finishedAt']?new Date(_0x5b230d[_0x4df439(0x28a)][_0x4df439(0x1e6)])['getTime']():Date['now'](),_0x400dd0=_0x5b230d[_0x4df439(0x23f)]?.['name']||'(unknown)';!_0x13550e[_0x4df439(0x193)](_0x400dd0)&&_0x13550e[_0x4df439(0x2ff)](_0x400dd0,[]),_0x13550e[_0x4df439(0x266)](_0x400dd0)[_0x4df439(0x30a)]({'session':_0x5b230d,'startTime':_0xfd2348,'endTime':_0x1c2e45,'duration':_0x1c2e45-_0xfd2348}),_0x2f3c71=Math[_0x4df439(0x2d7)](_0x2f3c71,_0xfd2348),_0x3d9bf7=Math[_0x4df439(0x31c)](_0x3d9bf7,_0x1c2e45);}}if(_0x13550e[_0x4df439(0x21c)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x1a169d=process[_0x4df439(0x1b5)][_0x4df439(0x1d5)]||0x78,_0x111d44=0x1e,_0x5e31af=0x32,_0x572dc8=0x4,_0x52c990=Math[_0x4df439(0x2d7)](_0x5e31af,Math[_0x4df439(0x31c)](_0x111d44,Math['floor'](_0x1a169d*0.3))),_0x32c71d=_0x1a169d-_0x52c990-TIMELINE_CONFIG[_0x4df439(0x1ff)]-0x3-_0x572dc8,_0xe4648b=_0x3d9bf7-_0x2f3c71,_0x21b5f4=_0xe4648b/_0x52c990,_0x3cfafd=renderTimeAxis({'startTime':_0x2f3c71,'endTime':_0x3d9bf7,'durationMs':_0xe4648b,'msPerChar':_0x21b5f4},_0x52c990),_0x1904f4=[];for(const _0x30b884 of _0x13550e[_0x4df439(0x331)]()){_0x1904f4[_0x4df439(0x30a)](..._0x30b884);}_0x1904f4[_0x4df439(0x241)]((_0x51d42d,_0x4bf58b)=>_0x4bf58b[_0x4df439(0x25c)]-_0x51d42d['startTime']);const _0x1765d8=new Date(_0x2f3c71),_0xa60809=formatDate(_0x1765d8),_0x5a59ee=_0x572dc8+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x4df439(0x257)]+_0x32c71d,_0x5bdbd6='\x20'[_0x4df439(0x225)](_0x5a59ee-_0xa60809['length']),_0x3075b4=_0x5bdbd6+a51_0x221e70[_0x4df439(0x2b3)](_0xa60809)+'\x20'+_0x3cfafd;_0x1f1643[_0x4df439(0x30a)](_0x3075b4);const _0x44b5b4=0x16;let _0x7e7279=0x0;for(const _0x3dde08 of _0x1904f4){const _0x531d0d=_0x3dde08['session'][_0x4df439(0x23f)]?.[_0x4df439(0x1db)]||'?',_0x371f2e=Math[_0x4df439(0x2d7)](stringWidth(_0x531d0d),_0x44b5b4);_0x7e7279=Math['max'](_0x7e7279,_0x371f2e);}for(const _0x30d398 of _0x1904f4){const {session:_0x566252,startTime:_0x181e03,endTime:_0x3b106a,duration:_0x4cb1e2}=_0x30d398,_0x1aa534=_0x566252[_0x4df439(0x23f)]?.['id'],_0xe7b2e0=_0x566252['id'],_0x19d4f6=_0x566252[_0x4df439(0x23f)]?.[_0x4df439(0x1db)]||'?',_0x3cd3a3=_0x566252['workflow']?.[_0x4df439(0x1db)]||'?';let _0x2ce840,_0x216558;if(_0x566252[_0x4df439(0x28a)]){const _0x3154ae=_0x566252[_0x4df439(0x28a)];!_0x3154ae[_0x4df439(0x254)]?(_0x2ce840=_0x3154ae['cancelRequested']?'🛑':'🔄',_0x216558=_0x3154ae['cancelRequested']?a51_0x221e70['yellow']:a51_0x221e70['blue']):(_0x2ce840=_0x3154ae[_0x4df439(0x194)]?'✅':'❌',_0x216558=_0x3154ae[_0x4df439(0x194)]?a51_0x221e70[_0x4df439(0x25a)]:a51_0x221e70[_0x4df439(0x1d8)]);}else _0x2ce840='⏳',_0x216558=a51_0x221e70[_0x4df439(0x2b3)];const _0x4b0084='#'+_0xe7b2e0,_0x55c7b0=_0x1aa534?hyperlink(_0x4b0084,getWorkflowSessionUrl(_0x128492,_0x1aa534,_0xe7b2e0)):_0x4b0084;let _0x69c5b=_0x19d4f6;stringWidth(_0x19d4f6)>_0x44b5b4&&(_0x69c5b=_0x19d4f6[_0x4df439(0x2be)](0x0,_0x44b5b4-0x1)+'…');const _0x1dc55e=a51_0x221e70['dim'](_0x69c5b),_0x4601f3=stringWidth(_0x69c5b),_0x859cfb='\x20'[_0x4df439(0x225)](_0x7e7279-stringWidth(_0x69c5b)+0x2),_0x556984='('+formatElapsed(_0x4cb1e2)+')',_0x215b6c=stringWidth(_0x556984),_0x1d8fc3=stringWidth(_0x4b0084),_0x29d114=_0x1d8fc3+0x1+_0x4601f3+_0x859cfb[_0x4df439(0x26e)],_0x2c7828=_0x32c71d-_0x29d114-_0x215b6c-0x1-0x8;let _0x52dac0=_0x3cd3a3;stringWidth(_0x52dac0)>_0x2c7828&&(_0x52dac0=_0x52dac0[_0x4df439(0x2be)](0x0,_0x2c7828-0x1)+'…');const _0x36cfbf=_0x55c7b0+'\x20'+_0x1dc55e+_0x859cfb+_0x52dac0,_0x5bd3d7=stringWidth(_0x36cfbf),_0x32628d=_0x32c71d-_0x5bd3d7-_0x215b6c,_0x1d7446=_0x36cfbf+'\x20'[_0x4df439(0x225)](Math[_0x4df439(0x31c)](0x1,_0x32628d))+a51_0x221e70[_0x4df439(0x2b3)](_0x556984),_0x4db779=Math[_0x4df439(0x1a1)]((_0x181e03-_0x2f3c71)/_0x21b5f4),_0x54ac2f=Math[_0x4df439(0x1a1)]((_0x3b106a-_0x2f3c71)/_0x21b5f4),_0x2e5b25=Math['max'](_0x4db779+0x1,_0x54ac2f),_0x5b6229=new Array(_0x52c990)[_0x4df439(0x30c)]('\x20');for(let _0x2ab180=_0x4db779;_0x2ab180<Math[_0x4df439(0x2d7)](_0x2e5b25,_0x52c990);_0x2ab180++){_0x5b6229[_0x2ab180]='─';}const _0x41b875=_0x5b6229[_0x4df439(0x2b6)](_0x5b636c=>_0x5b636c==='\x20'?'\x20':_0x216558(_0x5b636c))[_0x4df439(0x2e4)]('');_0x1f1643[_0x4df439(0x30a)](_0x2ce840+'\x20'+_0x1d7446+'│'+_0x41b875+'│');}return _0x1f1643[_0x4df439(0x2e4)]('\x0a');}async[a51_0x467f12(0x2cd)](_0x1d4ff4,_0x425c30,_0x3f6b1b){const _0x5ed0e6=a51_0x467f12,{options:_0x3ad489,tdx:_0x1e3294}=_0x425c30,_0xd61b7=_0x3ad489['site'],{timelineRows:_0x40b87b,timeAxisHeader:_0xc609e0}=this['generateSessionTimelineRows'](_0x1d4ff4,_0xd61b7),_0xa65e92=_0x40b87b[_0x5ed0e6(0x32f)](_0x55d6f0=>_0x55d6f0['attemptId']);if(_0xa65e92['length']===0x0){const _0xa1e642=this[_0x5ed0e6(0x1c6)](_0x1d4ff4,_0xd61b7);console[_0x5ed0e6(0x295)](_0xa1e642);!_0x3f6b1b&&(console['error'](''),console[_0x5ed0e6(0x24c)](a51_0x221e70['dim'](_0x5ed0e6(0x22c))),console[_0x5ed0e6(0x24c)](a51_0x221e70['dim'](_0x5ed0e6(0x301))+'or'+a51_0x221e70[_0x5ed0e6(0x2b3)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0xc609e0&&console[_0x5ed0e6(0x295)](_0xc609e0);const _0x31a752=_0x40b87b[_0x5ed0e6(0x32f)](_0x4dbfc6=>_0x4dbfc6['attemptId'])['map'](_0x3683ea=>({'title':_0x3683ea[_0x5ed0e6(0x2bc)],'value':_0x3683ea[_0x5ed0e6(0x27d)]})),_0x503c00=process['stdout']['rows']||0x3c,_0x2778a3=Math[_0x5ed0e6(0x31c)](0x28,Math['floor'](_0x503c00*0x2/0x3)),_0x1c2963=await a51_0x59e223({'type':_0x5ed0e6(0x217),'name':_0x5ed0e6(0x27d),'message':_0x5ed0e6(0x1cc),'choices':_0x31a752,'initial':-0x1,'limit':_0x2778a3,'clearFirst':!![],'fallback':{'title':_0x5ed0e6(0x203),'value':null},'suggest':(_0x1a2097,_0x5bba33)=>{const _0x539d8e=_0x5ed0e6;if(!_0x1a2097)return Promise[_0x539d8e(0x21e)](_0x5bba33);const _0x4c867f=_0x5bba33[_0x539d8e(0x32f)](_0x2d53db=>{const _0x562128=_0x539d8e,_0x59e71e=_0x2d53db;return _0x59e71e[_0x562128(0x210)][_0x562128(0x1b3)]()[_0x562128(0x23a)](_0x1a2097['toLowerCase']());});return Promise[_0x539d8e(0x21e)](_0x4c867f);}}),_0x109959=()=>{const _0x11ad77=_0x5ed0e6;process['stdout'][_0x11ad77(0x224)]('\x1b[1A\x1b[2K'),process[_0x11ad77(0x1b5)]['write'](_0x11ad77(0x19f)),process[_0x11ad77(0x1b5)][_0x11ad77(0x224)](_0x11ad77(0x19f));},_0x2e80dc=_0x1c2963&&_0x1c2963[_0x5ed0e6(0x27d)]&&_0x1c2963['attemptId']!==null&&_0x1c2963[_0x5ed0e6(0x27d)][_0x5ed0e6(0x303)]()!=='';if(!_0x2e80dc){_0x109959(),console[_0x5ed0e6(0x295)](a51_0x221e70[_0x5ed0e6(0x2b3)]('Cancelled'));return;}_0x109959();const _0x1f22d9=_0x1d4ff4['find'](_0x472879=>_0x472879[_0x5ed0e6(0x28a)]?.['id']===_0x1c2963[_0x5ed0e6(0x27d)]);if(_0x1f22d9){const _0x5c7f20=_0x1f22d9['project']?.[_0x5ed0e6(0x1db)]||'?',_0x1aeb03=_0x1f22d9['workflow']?.[_0x5ed0e6(0x1db)]||'?';console[_0x5ed0e6(0x295)](_0x5ed0e6(0x232)+a51_0x221e70[_0x5ed0e6(0x2b3)](_0x5c7f20)+_0x5ed0e6(0x287)+a51_0x221e70[_0x5ed0e6(0x2b3)](_0x1aeb03));}const _0x103744=new WorkflowTimelineCommand();await _0x103744[_0x5ed0e6(0x255)]({'args':[],'options':{..._0x3ad489,'attemptId':_0x1c2963['attemptId']},'tdx':_0x1e3294});}[a51_0x467f12(0x215)](_0x20d10d,_0xca40a7){const _0x377621=a51_0x467f12,_0x3b46be=new Map();for(const _0x34f63d of _0x20d10d){_0x34f63d['id']&&_0x34f63d['lastAttempt']?.['id']&&_0x3b46be[_0x377621(0x2ff)](_0x34f63d['id'],_0x34f63d[_0x377621(0x28a)]['id']);}const _0x2fcd5a=[];let _0x34a941='';const _0x32b488=this[_0x377621(0x1c6)](_0x20d10d,_0xca40a7),_0x19814a=_0x32b488['split']('\x0a');for(const _0x5a9592 of _0x19814a){if(_0x5a9592[_0x377621(0x25d)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x5a9592[_0x377621(0x2ce)](/^\s+\d{4}-\d{2}-\d{2}/))_0x34a941=_0x5a9592;else{if(_0x5a9592[_0x377621(0x2ce)](/^[✅❌🔄🛑⏳]/)){const _0x7eb204=_0x5a9592[_0x377621(0x2ce)](/#(\d+)/),_0x547985=_0x7eb204?_0x7eb204[0x1]:null,_0x77849f=_0x547985?_0x3b46be[_0x377621(0x266)](_0x547985)||null:null,_0x4af2f1=_0x20d10d[_0x377621(0x273)](_0x1d01c6=>_0x1d01c6['id']===_0x547985),_0x1b5f28=_0x4af2f1?.[_0x377621(0x23f)]?.[_0x377621(0x1db)]||'';_0x2fcd5a['push']({'displayLine':_0x5a9592,'attemptId':_0x77849f,'projectName':_0x1b5f28});}}}return{'timelineRows':_0x2fcd5a,'timeAxisHeader':_0x34a941};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']='workflow:attempts';['description']=a51_0x467f12(0x2e5);async[a51_0x467f12(0x255)](_0x36f244){const _0x1b4b78=a51_0x467f12,{options:_0x42b770,args:_0x39c2f8,tdx:_0x25095e}=_0x36f244,_0x4e233b=this[_0x1b4b78(0x1c7)](_0x39c2f8,_0x42b770);if(!_0x4e233b)return 0x1;const {projectName:_0x3ec361,workflowName:_0x5c8e52}=_0x4e233b,_0x5d8ba3=_0x42b770[_0x1b4b78(0x2f0)];if(_0x42b770[_0x1b4b78(0x195)]){if(_0x3ec361&&_0x5c8e52)console[_0x1b4b78(0x24c)](_0x1b4b78(0x280)+_0x3ec361+'.'+_0x5c8e52);else _0x3ec361&&console[_0x1b4b78(0x24c)]('Filter:\x20project='+_0x3ec361);_0x5d8ba3&&console[_0x1b4b78(0x24c)]('Include\x20retried:\x20yes');}const _0x53f7ed=await withSpinner(_0x1b4b78(0x2b8),()=>_0x25095e['workflow'][_0x1b4b78(0x1b0)]({'projectName':_0x3ec361,'workflowName':_0x5c8e52,'includeRetried':_0x5d8ba3,'limit':_0x42b770[_0x1b4b78(0x29f)]}),{'verbose':_0x42b770['verbose']}),_0x185c49=_0x53f7ed[_0x1b4b78(0x264)],_0x2c0647=_0x42b770[_0x1b4b78(0x29f)]||0x64,_0x1c9625=_0x185c49[_0x1b4b78(0x26e)]>=_0x2c0647?a51_0x221e70[_0x1b4b78(0x2b3)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x1b4b78(0x24c)](_0x1b4b78(0x285)+_0x185c49['length']+_0x1b4b78(0x1a2)+(_0x185c49['length']!==0x1?'s':'')+_0x1c9625);if(_0x42b770['format']===_0x1b4b78(0x2e3)||_0x42b770['format']==='jsonl'||_0x42b770[_0x1b4b78(0x252)]===_0x1b4b78(0x2e7))await handleSDKOutput(_0x185c49,_0x42b770);else{if(_0x185c49['length']===0x0){if(_0x3ec361&&_0x5c8e52)console['log'](_0x1b4b78(0x200)+_0x3ec361+'.'+_0x5c8e52);else _0x3ec361?console[_0x1b4b78(0x295)](_0x1b4b78(0x2ef)+_0x3ec361):console[_0x1b4b78(0x295)](_0x1b4b78(0x312));}else{const _0x2017b3=_0x42b770[_0x1b4b78(0x26f)],_0x244646=_0x185c49['map'](_0x3b4fcf=>{const _0x41a023=_0x1b4b78,_0x1f8f59=a51_0x221e70[_0x41a023(0x2b3)]('#'+_0x3b4fcf['id']),_0x50385c=_0x3b4fcf[_0x41a023(0x23f)]?.['id'],_0x31faab=_0x3b4fcf[_0x41a023(0x220)]||_0x3b4fcf[_0x41a023(0x1af)],_0x2a157d=_0x50385c&&_0x31faab?hyperlink(_0x1f8f59,getWorkflowAttemptUrl(_0x2017b3,_0x50385c,_0x31faab,_0x3b4fcf['id'])):_0x1f8f59,{icon:_0x5bdd1a,text:_0x3c0dbc}=getAttemptStatusDisplay(_0x3b4fcf),_0x7d42bb=(_0x3b4fcf['project']?.[_0x41a023(0x1db)]||'?')+'.'+(_0x3b4fcf[_0x41a023(0x201)]?.[_0x41a023(0x1db)]||'?'),_0x34219e=_0x3b4fcf['sessionTime']?a51_0x221e70['dim'](_0x3b4fcf[_0x41a023(0x1e3)]):'';return(_0x2a157d+'\x20'+_0x5bdd1a+(_0x3c0dbc?'\x20'+_0x3c0dbc:'')+'\x20'+_0x7d42bb+'\x20'+_0x34219e)['trimEnd']();});await writeOutput(_0x244646[_0x1b4b78(0x2e4)]('\x0a'),_0x42b770[_0x1b4b78(0x1fd)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x297);[a51_0x467f12(0x242)]=a51_0x467f12(0x205);async[a51_0x467f12(0x255)](_0x42bf27){const _0x54a883=a51_0x467f12,{options:_0x499c4d,args:_0x5899b3,tdx:_0x18cc11}=_0x42bf27,_0x598b07=_0x5899b3[0x0];if(!_0x598b07)return console[_0x54a883(0x24c)](_0x54a883(0x30e)),0x1;_0x499c4d['verbose']&&console['error'](_0x54a883(0x2ed)+_0x598b07);const _0x32ed5f=await withSpinner(_0x54a883(0x20e),()=>_0x18cc11[_0x54a883(0x201)][_0x54a883(0x290)](_0x598b07),{'verbose':_0x499c4d[_0x54a883(0x195)]}),_0x48ae5d=_0x32ed5f['data'];let _0x459a9a;!_0x48ae5d[_0x54a883(0x254)]?_0x459a9a=_0x48ae5d[_0x54a883(0x1e4)]?_0x54a883(0x1ef):_0x54a883(0x23d):_0x459a9a=_0x48ae5d['success']?_0x54a883(0x194):_0x54a883(0x24c);let _0x5d2f95;if(_0x48ae5d['createdAt']&&_0x48ae5d['finishedAt']){const _0x493924=new Date(_0x48ae5d['createdAt'])[_0x54a883(0x2ae)](),_0x32ba86=new Date(_0x48ae5d[_0x54a883(0x1e6)])[_0x54a883(0x2ae)]();_0x5d2f95=Math[_0x54a883(0x2c3)]((_0x32ba86-_0x493924)/0x3e8);}const _0x300a8b={'attempt_id':_0x48ae5d['id'],'status':_0x459a9a,..._0x48ae5d[_0x54a883(0x2c7)]!==undefined&&{'index':_0x48ae5d[_0x54a883(0x2c7)]},..._0x48ae5d[_0x54a883(0x23f)]&&{'project':_0x48ae5d[_0x54a883(0x23f)]['name']},..._0x48ae5d['workflow']&&{'workflow':_0x48ae5d[_0x54a883(0x201)]['name']},..._0x48ae5d['sessionId']&&{'session_id':_0x48ae5d['sessionId']},..._0x48ae5d['sessionTime']&&{'session_time':_0x48ae5d[_0x54a883(0x1e3)]},..._0x48ae5d[_0x54a883(0x1c8)]&&{'retry_attempt':_0x48ae5d['retryAttemptName']},..._0x5d2f95!==undefined&&{'duration_sec':_0x5d2f95},..._0x48ae5d[_0x54a883(0x1df)]&&{'created_at':_0x48ae5d['createdAt']},..._0x48ae5d[_0x54a883(0x1e6)]&&{'finished_at':_0x48ae5d[_0x54a883(0x1e6)]},...Object[_0x54a883(0x1ea)](_0x48ae5d['params'])[_0x54a883(0x26e)]>0x0&&{'params':_0x48ae5d[_0x54a883(0x24b)]}};return await handleSingleObjectOutput(_0x300a8b,_0x499c4d),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a51_0x467f12(0x1db)]='workflow:tasks';[a51_0x467f12(0x242)]=a51_0x467f12(0x27a);async['execute'](_0x603c95){const _0x3604e6=a51_0x467f12,{options:_0x14030b,args:_0x520ba4,tdx:_0x54b5ea}=_0x603c95,_0x1852d0=_0x520ba4[0x0];if(!_0x1852d0)return console['error'](_0x3604e6(0x30e)),0x1;const _0x3cdc81=_0x14030b[_0x3604e6(0x2ad)];_0x14030b['verbose']&&(console[_0x3604e6(0x24c)]('Attempt\x20ID:\x20'+_0x1852d0),_0x3cdc81&&console[_0x3604e6(0x24c)](_0x3604e6(0x21b)));const _0x215a9d=await withSpinner(_0x3604e6(0x1cf),()=>_0x54b5ea[_0x3604e6(0x201)][_0x3604e6(0x1e9)](_0x1852d0,_0x3cdc81||![]),{'verbose':_0x14030b['verbose']}),_0x8a73=_0x215a9d['data'];return console['error'](_0x3604e6(0x285)+_0x8a73['length']+_0x3604e6(0x2d1)+(_0x8a73[_0x3604e6(0x26e)]!==0x1?'s':'')),await handleSDKOutput(_0x8a73,_0x14030b),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x2b2);[a51_0x467f12(0x242)]=a51_0x467f12(0x233);async[a51_0x467f12(0x255)](_0x9edc82){const _0x54120c=a51_0x467f12,{options:_0x3f45ee,args:_0x39c943,tdx:_0x1831bf}=_0x9edc82,_0x4f7e0c=_0x39c943[0x0];let _0x3440b9=_0x39c943[0x1];if(!_0x4f7e0c)return console[_0x54120c(0x24c)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x3f45ee[_0x54120c(0x195)]&&(console['error'](_0x54120c(0x2ed)+_0x4f7e0c),_0x3440b9&&console[_0x54120c(0x24c)](_0x54120c(0x1ac)+_0x3440b9));const _0x27551e=await withSpinner(_0x54120c(0x1a0),()=>_0x1831bf['workflow']['logFiles'](_0x4f7e0c,_0x3440b9),{'verbose':_0x3f45ee[_0x54120c(0x195)]}),_0x2dcba0=_0x27551e['data'];if(_0x2dcba0[_0x54120c(0x26e)]===0x0)return console[_0x54120c(0x24c)](_0x54120c(0x1a4)),0x0;if(!_0x3440b9&&(_0x3f45ee[_0x54120c(0x2e3)]||_0x3f45ee[_0x54120c(0x252)]))return await handleSDKOutput(_0x2dcba0,_0x3f45ee),0x0;if(!_0x3440b9){const _0x2533dc=_0x2dcba0[_0x54120c(0x2b6)](_0x1efb39=>({'title':_0x1efb39['taskName']+'\x20('+formatBytes(_0x1efb39['fileSize'])+')','value':_0x1efb39[_0x54120c(0x284)]})),_0x1b507b=await a51_0x59e223({'type':_0x54120c(0x2fd),'name':_0x54120c(0x207),'message':_0x54120c(0x1d2),'choices':_0x2533dc});if(!_0x1b507b[_0x54120c(0x207)])return console['error'](_0x54120c(0x1c4)),0x0;_0x3440b9=_0x1b507b[_0x54120c(0x207)];}const _0x5d0571=await withSpinner(_0x54120c(0x2b7),()=>_0x1831bf[_0x54120c(0x201)]['logs'](_0x4f7e0c,_0x3440b9),{'verbose':_0x3f45ee[_0x54120c(0x195)]}),_0x431acd=_0x5d0571[_0x54120c(0x264)];return _0x431acd?console['log'](_0x431acd):console['error'](_0x54120c(0x1c3)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x253);[a51_0x467f12(0x242)]=a51_0x467f12(0x25b);async[a51_0x467f12(0x255)](_0x285d18){const _0x55fb9e=a51_0x467f12,{options:_0x1feccf,args:_0x168e71,tdx:_0xcb3980}=_0x285d18,_0x18658f=_0x168e71[0x0];if(!_0x18658f)return console['error'](_0x55fb9e(0x30e)),0x1;const _0x1d761a=_0x1feccf['reason'];_0x1feccf['verbose']&&(console[_0x55fb9e(0x24c)](_0x55fb9e(0x2ed)+_0x18658f),_0x1d761a&&console['error']('Reason:\x20'+_0x1d761a));if(!_0x1feccf[_0x55fb9e(0x307)]){if(!isInteractive())return console[_0x55fb9e(0x24c)](a51_0x221e70['red'](_0x55fb9e(0x310)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x55fb9e(0x24c)](a51_0x221e70[_0x55fb9e(0x2b3)](_0x55fb9e(0x324))),0x1;const _0x40177e=await confirmKey(_0x55fb9e(0x1e5)+_0x18658f+'?');if(!_0x40177e)return console[_0x55fb9e(0x24c)](a51_0x221e70[_0x55fb9e(0x296)](_0x55fb9e(0x1c4))),0x1;}const _0x367dd7=await withSpinner(_0x55fb9e(0x2a2),()=>_0xcb3980[_0x55fb9e(0x201)][_0x55fb9e(0x1ba)](_0x18658f,_0x1d761a),{'verbose':_0x1feccf[_0x55fb9e(0x195)]}),_0x428e38=_0x367dd7[_0x55fb9e(0x264)];return console[_0x55fb9e(0x24c)]('✔\x20'+_0x428e38),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a51_0x467f12(0x2d6);['description']=a51_0x467f12(0x2c9);async[a51_0x467f12(0x255)](_0x259e4a){const _0x4757c1=a51_0x467f12,{options:_0x59e1cb,args:_0x495bfe,tdx:_0x15722a}=_0x259e4a,_0x2799fd=_0x495bfe[0x0];if(!_0x2799fd)return console['error']('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x4757c1(0x24c)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0xa78e9c=![],_0x2c0eb3=_0x2799fd;if(_0x2799fd[_0x4757c1(0x25d)](_0x4757c1(0x2ac)))_0xa78e9c=!![],_0x2c0eb3=_0x2799fd['substring'](0x8);else{if(_0x2799fd['startsWith'](_0x4757c1(0x190)))_0xa78e9c=![],_0x2c0eb3=_0x2799fd[_0x4757c1(0x2b4)](0x8);else return console[_0x4757c1(0x24c)](_0x4757c1(0x238)),console[_0x4757c1(0x24c)](_0x4757c1(0x2c5)),0x1;}const _0x2e7380=_0x59e1cb['fromTask'],_0x3a5527=_0x59e1cb[_0x4757c1(0x1a9)],_0x4d01d0=_0x59e1cb[_0x4757c1(0x24b)],_0x324f27=_0x59e1cb[_0x4757c1(0x1e7)];_0x59e1cb[_0x4757c1(0x195)]&&(console[_0x4757c1(0x24c)](_0x4757c1(0x1eb)+(_0xa78e9c?'session':'attempt')+'\x20'+_0x2c0eb3),_0x2e7380&&console[_0x4757c1(0x24c)](_0x4757c1(0x30b)+_0x2e7380),_0x3a5527&&console[_0x4757c1(0x24c)](_0x4757c1(0x1ca)+_0x3a5527),_0x4d01d0&&console[_0x4757c1(0x24c)]('Params:\x20'+_0x4d01d0),_0x324f27&&console[_0x4757c1(0x24c)](_0x4757c1(0x197)));let _0x5cbc5b;if(_0x4d01d0)try{if(_0x4d01d0[_0x4757c1(0x25d)]('@')){const _0x11a927=await import(_0x4757c1(0x2a4)),_0x2c4151=_0x4d01d0[_0x4757c1(0x2b4)](0x1),_0xa50e54=await _0x11a927[_0x4757c1(0x1aa)](_0x2c4151,_0x4757c1(0x27b));_0x5cbc5b=JSON[_0x4757c1(0x240)](_0xa50e54);}else _0x5cbc5b=JSON[_0x4757c1(0x240)](_0x4d01d0);}catch{return console[_0x4757c1(0x24c)](_0x4757c1(0x2e0)),0x1;}if(!_0x59e1cb['yes']){if(!isInteractive())return console['error'](a51_0x221e70[_0x4757c1(0x1d8)](_0x4757c1(0x310)),_0x4757c1(0x28e)),console['error'](a51_0x221e70[_0x4757c1(0x2b3)](_0x4757c1(0x324))),0x1;const _0x224e5a=await confirmKey(_0x4757c1(0x19c)+(_0xa78e9c?_0x4757c1(0x29c):_0x4757c1(0x290))+'\x20'+_0x2c0eb3+'?');if(!_0x224e5a)return console[_0x4757c1(0x24c)](a51_0x221e70[_0x4757c1(0x296)](_0x4757c1(0x1c4))),0x1;}let _0x2767ea;_0xa78e9c?_0x2767ea=await withSpinner(_0x4757c1(0x23b),()=>_0x15722a[_0x4757c1(0x201)][_0x4757c1(0x209)](_0x2c0eb3,{'fromTask':_0x2e7380,'retryParams':_0x5cbc5b}),{'verbose':_0x59e1cb['verbose']}):_0x2767ea=await withSpinner('Retrying\x20attempt...',()=>_0x15722a['workflow'][_0x4757c1(0x1a7)](_0x2c0eb3,{'resumeFrom':_0x3a5527,'retryParams':_0x5cbc5b,'force':_0x324f27}),{'verbose':_0x59e1cb['verbose']});const _0x483028=_0x2767ea[_0x4757c1(0x264)];return console['error'](_0x4757c1(0x1f1)),console['error'](_0x4757c1(0x2c0)+_0x483028[_0x4757c1(0x27d)]),console[_0x4757c1(0x24c)](_0x4757c1(0x286)+_0x483028[_0x4757c1(0x1af)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a51_0x467f12(0x2d4);[a51_0x467f12(0x242)]=a51_0x467f12(0x31e);async[a51_0x467f12(0x255)](_0x559dba){const _0x50c908=a51_0x467f12,{options:_0x12b2b3,args:_0x452d4e,tdx:_0x1e32f4}=_0x559dba;let _0xd3c3d4=_0x452d4e[0x0];if(!_0xd3c3d4){const _0x55a9c6=this[_0x50c908(0x227)]([],_0x12b2b3),_0x4a43ab=await withSpinner('Loading\x20workflows...',()=>_0x1e32f4[_0x50c908(0x201)]['workflows'](_0x55a9c6,{'limit':_0x12b2b3[_0x50c908(0x29f)]}),{'verbose':_0x12b2b3[_0x50c908(0x195)]}),_0x4a173d=_0x4a43ab[_0x50c908(0x264)];if(_0x4a173d[_0x50c908(0x26e)]===0x0)return console[_0x50c908(0x24c)](_0x50c908(0x325)),!_0x55a9c6&&console[_0x50c908(0x24c)](a51_0x221e70['dim'](_0x50c908(0x1a5))),0x1;const _0x40598b=_0x4a173d['map'](_0x2f2d12=>({'title':_0x2f2d12[_0x50c908(0x23f)]?.[_0x50c908(0x1db)]+'.'+_0x2f2d12[_0x50c908(0x1db)],'value':_0x2f2d12[_0x50c908(0x23f)]?.[_0x50c908(0x1db)]+'.'+_0x2f2d12[_0x50c908(0x1db)],'description':_0x2f2d12[_0x50c908(0x2f3)]?'revision:\x20'+_0x2f2d12[_0x50c908(0x2f3)]:undefined})),_0x4e8836=await a51_0x59e223({'type':_0x50c908(0x2fd),'name':_0x50c908(0x201),'message':_0x50c908(0x24e),'choices':_0x40598b});if(!_0x4e8836[_0x50c908(0x201)])return 0x1;_0xd3c3d4=_0x4e8836['workflow'];}if(!_0xd3c3d4[_0x50c908(0x23a)]('.')){const _0x4b24e5=this[_0x50c908(0x227)]([],_0x12b2b3);if(_0x4b24e5)_0xd3c3d4=_0x4b24e5+'.'+_0xd3c3d4;else return console[_0x50c908(0x24c)](a51_0x221e70[_0x50c908(0x1d8)](_0x50c908(0x1cb)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console['error'](a51_0x221e70[_0x50c908(0x2b3)](_0x50c908(0x1a5))),0x1;}const _0x48e9ed=_0x12b2b3[_0x50c908(0x2fb)],_0x18b423=_0x12b2b3[_0x50c908(0x1e3)],_0x277fec={};if(_0x48e9ed&&Array[_0x50c908(0x191)](_0x48e9ed))for(const _0x425af1 of _0x48e9ed){const _0xfaf6a7=_0x425af1[_0x50c908(0x29e)]('=');if(_0xfaf6a7===-0x1)return console['error'](_0x50c908(0x1fb)+_0x425af1),console[_0x50c908(0x24c)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x32b240=_0x425af1[_0x50c908(0x2b4)](0x0,_0xfaf6a7),_0x1fce25=_0x425af1['substring'](_0xfaf6a7+0x1);try{_0x277fec[_0x32b240]=JSON[_0x50c908(0x240)](_0x1fce25);}catch{_0x277fec[_0x32b240]=_0x1fce25;}}_0x12b2b3['verbose']&&(console['error'](_0x50c908(0x2f8)+_0xd3c3d4),Object[_0x50c908(0x1ea)](_0x277fec)[_0x50c908(0x26e)]>0x0&&console[_0x50c908(0x24c)]('Parameters:\x20'+JSON[_0x50c908(0x249)](_0x277fec)),_0x18b423&&console[_0x50c908(0x24c)](_0x50c908(0x1d6)+_0x18b423));const _0x4417f5=await withSpinner(_0x50c908(0x22e),()=>_0x1e32f4['workflow'][_0x50c908(0x2f2)](_0xd3c3d4,_0x277fec,{'sessionTime':_0x18b423}),{'verbose':_0x12b2b3[_0x50c908(0x195)]}),_0x3dbe41=_0x4417f5[_0x50c908(0x264)];console[_0x50c908(0x24c)]('✔\x20Workflow\x20run\x20started'),console[_0x50c908(0x24c)](_0x50c908(0x2db)+_0x3dbe41['id']),console[_0x50c908(0x24c)]('\x20\x20Session\x20ID:\x20'+_0x3dbe41['sessionId']),console[_0x50c908(0x24c)](_0x50c908(0x2c2)+_0x3dbe41[_0x50c908(0x23f)]?.[_0x50c908(0x1db)]),console[_0x50c908(0x24c)](_0x50c908(0x19b)+_0x3dbe41[_0x50c908(0x201)]?.[_0x50c908(0x1db)]);if(_0x3dbe41['project']?.['id']&&_0x3dbe41['sessionId']&&_0x3dbe41['id']){const _0x3e22c2=_0x12b2b3[_0x50c908(0x26f)],_0x40f393=getConsoleUrl(_0x3e22c2,_0x50c908(0x21a)+_0x3dbe41[_0x50c908(0x23f)]['id']+_0x50c908(0x1d7)+_0x3dbe41[_0x50c908(0x1af)]+_0x50c908(0x2ba)+_0x3dbe41['id']);console[_0x50c908(0x24c)](_0x50c908(0x292)+a51_0x221e70['cyan'](_0x40f393));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a51_0x467f12(0x211);[a51_0x467f12(0x242)]=a51_0x467f12(0x332);async[a51_0x467f12(0x255)](_0x1aff62){const _0x3a8dc6=a51_0x467f12,{options:_0x49bed7,args:_0x221af5,tdx:_0x2852b8}=_0x1aff62,_0x17bf63=_0x221af5[0x0],_0x1efcd2=_0x221af5[0x1]||'.';if(!_0x17bf63)return console[_0x3a8dc6(0x24c)](_0x3a8dc6(0x2ec)),console[_0x3a8dc6(0x24c)](_0x3a8dc6(0x1c0)),0x1;const _0x2469ae=_0x49bed7[_0x3a8dc6(0x2f3)];_0x49bed7[_0x3a8dc6(0x195)]&&(console[_0x3a8dc6(0x24c)](_0x3a8dc6(0x232)+_0x17bf63),console[_0x3a8dc6(0x24c)](_0x3a8dc6(0x22d)+_0x1efcd2),_0x2469ae&&console[_0x3a8dc6(0x24c)](_0x3a8dc6(0x28b)+_0x2469ae));const _0x531827=await withSpinner(_0x3a8dc6(0x1d9)+_0x17bf63+_0x3a8dc6(0x25f),()=>_0x2852b8[_0x3a8dc6(0x201)]['download'](_0x17bf63,_0x1efcd2,{'revision':_0x2469ae}),{'verbose':_0x49bed7['verbose']}),_0x6929ab=_0x531827[_0x3a8dc6(0x264)];return console[_0x3a8dc6(0x24c)](_0x3a8dc6(0x1e0)+_0x6929ab[_0x3a8dc6(0x199)]),console[_0x3a8dc6(0x24c)](_0x3a8dc6(0x260)+_0x6929ab['revision']),console[_0x3a8dc6(0x24c)]('\x20\x20Files\x20extracted:\x20'+_0x6929ab['filesExtracted']),console[_0x3a8dc6(0x24c)](_0x3a8dc6(0x32b)+_0x1efcd2+'/'+_0x6929ab[_0x3a8dc6(0x199)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']='workflow:upload';[a51_0x467f12(0x242)]=a51_0x467f12(0x2bd);async[a51_0x467f12(0x255)](_0x1cb9d6){const _0x26bc08=a51_0x467f12,{options:_0xde8096,args:_0x42d349,tdx:_0x1b29fe}=_0x1cb9d6;let _0x488215='.',_0x6998f2=_0xde8096[_0x26bc08(0x1db)];if(_0x42d349[0x0]){const {promises:_0x10e317}=await import('fs');try{const _0x2da5c9=await _0x10e317[_0x26bc08(0x294)](_0x42d349[0x0]);if(_0x2da5c9['isDirectory']())_0x488215=_0x42d349[0x0];else return console[_0x26bc08(0x24c)]('Error:\x20'+_0x42d349[0x0]+_0x26bc08(0x29d)),0x1;}catch{_0x6998f2=_0x42d349[0x0],_0x488215='.';}}const _0x217a0f=_0xde8096['revision'],_0x1b4f7d=_0xde8096[_0x26bc08(0x245)];_0xde8096[_0x26bc08(0x195)]&&(console[_0x26bc08(0x24c)](_0x26bc08(0x2a3)+_0x488215),_0x6998f2&&console[_0x26bc08(0x24c)](_0x26bc08(0x271)+_0x6998f2),_0x217a0f&&console[_0x26bc08(0x24c)]('Revision:\x20'+_0x217a0f),_0x1b4f7d&&console[_0x26bc08(0x24c)](_0x26bc08(0x27c)));const _0x6e50a0=await withSpinner(_0x26bc08(0x1bb),()=>_0x1b29fe['workflow'][_0x26bc08(0x30a)](_0x488215,{'projectName':_0x6998f2,'revision':_0x217a0f,'skipValidation':_0x1b4f7d}),{'verbose':_0xde8096[_0x26bc08(0x195)]}),_0x13deac=_0x6e50a0[_0x26bc08(0x264)];return console['error'](_0x26bc08(0x1c2)+_0x13deac[_0x26bc08(0x199)]),console['error'](_0x26bc08(0x302)+_0x13deac[_0x26bc08(0x2d9)]),console[_0x26bc08(0x24c)](_0x26bc08(0x260)+_0x13deac[_0x26bc08(0x2f3)]),await this[_0x26bc08(0x31f)](_0x1b29fe,_0x13deac[_0x26bc08(0x199)],_0xde8096[_0x26bc08(0x26f)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a51_0x467f12(0x1db)]='workflow:pull';[a51_0x467f12(0x242)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a51_0x467f12(0x255)](_0x4b0bf5){const _0x48c090=a51_0x467f12,{options:_0x250dde,args:_0x494616,tdx:_0x5434c6}=_0x4b0bf5,_0x3eda25=_0x494616[0x0],_0x18ddcc=_0x494616[0x1];if(!_0x3eda25)return console['error'](a51_0x221e70[_0x48c090(0x1d8)]('Error:'),_0x48c090(0x32e)),console['error'](a51_0x221e70[_0x48c090(0x2b3)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x241e96=_0x250dde[_0x48c090(0x2f3)];_0x250dde['verbose']&&(console['error'](_0x48c090(0x232)+_0x3eda25),_0x18ddcc&&console[_0x48c090(0x24c)]('Target\x20directory:\x20'+_0x18ddcc),_0x241e96&&console[_0x48c090(0x24c)](_0x48c090(0x28b)+_0x241e96),_0x250dde[_0x48c090(0x32a)]&&console[_0x48c090(0x24c)]('Dry\x20run:\x20yes'));const _0x225382=await withSpinner(_0x48c090(0x256)+_0x3eda25+_0x48c090(0x25f),()=>_0x5434c6[_0x48c090(0x201)][_0x48c090(0x29a)](_0x3eda25,{'targetDir':_0x18ddcc,'revision':_0x241e96}),{'verbose':_0x250dde[_0x48c090(0x195)]}),_0x43821b=_0x225382['data'];_0x43821b['isNewProject']?console[_0x48c090(0x24c)](_0x48c090(0x276)+_0x43821b['projectName']):console['error'](_0x48c090(0x2b5)+_0x43821b[_0x48c090(0x199)]);console['error'](_0x48c090(0x260)+_0x43821b[_0x48c090(0x2f3)]),console[_0x48c090(0x24c)](_0x48c090(0x2f9)+(a51_0x5534f1['relative'](process['cwd'](),_0x43821b['targetDir'])||'.')),console[_0x48c090(0x24c)](_0x48c090(0x26d)+a51_0x221e70[_0x48c090(0x25a)]('+'+_0x43821b[_0x48c090(0x2ab)][_0x48c090(0x2a9)]+_0x48c090(0x322))+',\x20'+(a51_0x221e70[_0x48c090(0x296)]('~'+_0x43821b[_0x48c090(0x2ab)][_0x48c090(0x288)]+'\x20modified')+',\x20')+(a51_0x221e70[_0x48c090(0x1d8)]('-'+_0x43821b[_0x48c090(0x2ab)]['deleted']+_0x48c090(0x291))+',\x20')+(''+a51_0x221e70[_0x48c090(0x2b3)](_0x43821b[_0x48c090(0x2ab)][_0x48c090(0x1d0)]+_0x48c090(0x2df))));for(const _0x393659 of _0x43821b[_0x48c090(0x2c4)]){_0x393659['type']===_0x48c090(0x288)&&_0x393659[_0x48c090(0x1a8)]&&(console[_0x48c090(0x24c)]('\x0a'+a51_0x221e70['cyan'](_0x48c090(0x263)+_0x393659['path'])),console[_0x48c090(0x24c)](_0x393659['diff']));}if(!_0x43821b['hasChanges'])return saveSessionContext({'workflow_project':_0x43821b[_0x48c090(0x199)]},_0x250dde[_0x48c090(0x29c)]),console['error'](a51_0x221e70['green'](_0x48c090(0x308))),console[_0x48c090(0x24c)](a51_0x221e70['dim'](_0x48c090(0x320)+_0x43821b[_0x48c090(0x199)])),0x0;if(_0x250dde['dryRun'])return console[_0x48c090(0x24c)](a51_0x221e70[_0x48c090(0x296)](_0x48c090(0x244))),0x0;if(!_0x250dde[_0x48c090(0x307)]){if(!isInteractive())return console[_0x48c090(0x24c)](a51_0x221e70[_0x48c090(0x1d8)](_0x48c090(0x310)),_0x48c090(0x28e)),console['error'](a51_0x221e70['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1aa0f7=await confirmKey(_0x48c090(0x19e));if(!_0x1aa0f7)return console[_0x48c090(0x24c)](a51_0x221e70[_0x48c090(0x296)](_0x48c090(0x1c4)),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x48c090(0x30d),()=>_0x5434c6['workflow'][_0x48c090(0x313)](_0x43821b,{'revision':_0x241e96}),{'verbose':_0x250dde[_0x48c090(0x195)]}),saveSessionContext({'workflow_project':_0x43821b[_0x48c090(0x199)]},_0x250dde[_0x48c090(0x29c)]),console[_0x48c090(0x24c)](a51_0x221e70[_0x48c090(0x25a)](_0x48c090(0x22a)));const _0x2fd2de=a51_0x5534f1[_0x48c090(0x319)](process[_0x48c090(0x2dd)](),_0x43821b['targetDir'])||'.';return console[_0x48c090(0x24c)](a51_0x221e70[_0x48c090(0x2b3)]('\x20\x20Location:\x20'+_0x2fd2de)),console[_0x48c090(0x24c)](a51_0x221e70[_0x48c090(0x2b3)](_0x48c090(0x320)+_0x43821b[_0x48c090(0x199)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a51_0x467f12(0x1db)]='workflow:push';[a51_0x467f12(0x242)]=a51_0x467f12(0x309);async[a51_0x467f12(0x255)](_0x31d588){const _0x3f70a8=a51_0x467f12,{options:_0x4f42ad,args:_0x1865cd,tdx:_0x347242}=_0x31d588,_0x3f5f89=this['resolveProjectDir'](_0x1865cd,_0x4f42ad),_0x2d8b54=_0x4f42ad['revision'],_0x177ed1=_0x4f42ad['skipValidation'];_0x4f42ad[_0x3f70a8(0x195)]&&(_0x3f5f89&&console[_0x3f70a8(0x24c)](_0x3f70a8(0x2d5)+_0x3f5f89),_0x2d8b54&&console[_0x3f70a8(0x24c)](_0x3f70a8(0x28b)+_0x2d8b54),_0x4f42ad[_0x3f70a8(0x32a)]&&console[_0x3f70a8(0x24c)](_0x3f70a8(0x1fa)),_0x177ed1&&console[_0x3f70a8(0x24c)](_0x3f70a8(0x27c)));let _0x48ed42;try{_0x48ed42=await withSpinner(_0x3f70a8(0x305),()=>_0x347242['workflow'][_0x3f70a8(0x20b)]({'sourceDir':_0x3f5f89,'revision':_0x2d8b54,'skipValidation':_0x177ed1}),{'verbose':_0x4f42ad[_0x3f70a8(0x195)]});}catch(_0x27f172){if(_0x27f172 instanceof Error&&_0x27f172[_0x3f70a8(0x218)][_0x3f70a8(0x23a)](_0x3f70a8(0x2a8)))return console['error'](a51_0x221e70[_0x3f70a8(0x1d8)](_0x3f70a8(0x1cb)),_0x3f70a8(0x1d4)),_0x4f42ad[_0x3f70a8(0x330)]?console[_0x3f70a8(0x24c)](a51_0x221e70[_0x3f70a8(0x2b3)](_0x3f70a8(0x1de)+_0x4f42ad[_0x3f70a8(0x330)]+_0x3f70a8(0x275)+_0x4f42ad[_0x3f70a8(0x330)]+'\x27')):console[_0x3f70a8(0x24c)](a51_0x221e70[_0x3f70a8(0x2b3)](_0x3f70a8(0x21d))),0x1;throw _0x27f172;}const _0x3263fa=_0x48ed42['data'];console[_0x3f70a8(0x24c)](_0x3f70a8(0x298)+_0x3263fa[_0x3f70a8(0x199)]),console[_0x3f70a8(0x24c)](_0x3f70a8(0x326)+_0x3263fa[_0x3f70a8(0x2fc)]),console[_0x3f70a8(0x24c)](_0x3f70a8(0x260)+_0x3263fa[_0x3f70a8(0x2f3)]),console[_0x3f70a8(0x24c)](_0x3f70a8(0x26d)+a51_0x221e70['green']('+'+_0x3263fa['summary'][_0x3f70a8(0x2a9)]+_0x3f70a8(0x322))+',\x20'+(a51_0x221e70[_0x3f70a8(0x296)]('~'+_0x3263fa[_0x3f70a8(0x2ab)][_0x3f70a8(0x288)]+'\x20modified')+',\x20')+(a51_0x221e70[_0x3f70a8(0x1d8)]('-'+_0x3263fa['summary']['deleted']+'\x20deleted')+',\x20')+(''+a51_0x221e70['dim'](_0x3263fa[_0x3f70a8(0x2ab)][_0x3f70a8(0x1d0)]+_0x3f70a8(0x2df))));for(const _0x355f9f of _0x3263fa['changes']){_0x355f9f[_0x3f70a8(0x27f)]==='modified'&&_0x355f9f[_0x3f70a8(0x1a8)]&&(console[_0x3f70a8(0x24c)]('\x0a'+a51_0x221e70[_0x3f70a8(0x2b0)]('---\x20'+_0x355f9f['path'])),console[_0x3f70a8(0x24c)](_0x355f9f[_0x3f70a8(0x1a8)]));}if(!_0x3263fa[_0x3f70a8(0x272)])return console[_0x3f70a8(0x24c)](a51_0x221e70[_0x3f70a8(0x25a)](_0x3f70a8(0x208))),await this['showWorkflowConsoleUrl'](_0x347242,_0x3263fa[_0x3f70a8(0x199)],_0x4f42ad[_0x3f70a8(0x26f)]),0x0;if(_0x4f42ad[_0x3f70a8(0x32a)])return console[_0x3f70a8(0x24c)](a51_0x221e70['yellow']('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x4f42ad[_0x3f70a8(0x307)]){if(!isInteractive())return console[_0x3f70a8(0x24c)](a51_0x221e70[_0x3f70a8(0x1d8)](_0x3f70a8(0x310)),_0x3f70a8(0x28e)),console['error'](a51_0x221e70[_0x3f70a8(0x2b3)](_0x3f70a8(0x324))),0x1;const _0x535d33=await confirmKey(_0x3f70a8(0x213));if(!_0x535d33)return console[_0x3f70a8(0x24c)](a51_0x221e70[_0x3f70a8(0x296)](_0x3f70a8(0x1c4)),_0x3f70a8(0x1f5)),0x1;}const _0x1e8d55=await withSpinner(_0x3f70a8(0x2a1),()=>_0x347242['workflow'][_0x3f70a8(0x247)](_0x3263fa),{'verbose':_0x4f42ad[_0x3f70a8(0x195)]}),_0x5ca8d6=_0x1e8d55[_0x3f70a8(0x264)];return console[_0x3f70a8(0x24c)](a51_0x221e70[_0x3f70a8(0x25a)](_0x3f70a8(0x228))),console['error']('\x20\x20Project\x20ID:\x20'+_0x5ca8d6['projectId']),console[_0x3f70a8(0x24c)](_0x3f70a8(0x260)+_0x5ca8d6['revision']),await this[_0x3f70a8(0x31f)](_0x347242,_0x5ca8d6['projectName'],_0x4f42ad[_0x3f70a8(0x26f)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x1fc);['description']='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a51_0x467f12(0x255)](_0x29fe9b){const _0xfad1ac=a51_0x467f12,{options:_0x5328c2,args:_0xb57f01,tdx:_0x30a6b9}=_0x29fe9b,_0x8285f3=this[_0xfad1ac(0x1f9)](_0xb57f01,_0x5328c2),_0x25b726=_0x5328c2['name'],_0x38da5b=_0x5328c2['revision'],_0x2d3e1c=_0x5328c2[_0xfad1ac(0x245)];if(!_0x8285f3)return console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x1d8)](_0xfad1ac(0x1cb)),_0xfad1ac(0x2d8)),console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x2b3)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x2b3)](_0xfad1ac(0x315))),0x1;if(!_0x25b726)return console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x1d8)](_0xfad1ac(0x1cb)),_0xfad1ac(0x192)),console['error'](a51_0x221e70['dim'](_0xfad1ac(0x268))),0x1;_0x5328c2[_0xfad1ac(0x195)]&&(console[_0xfad1ac(0x24c)](_0xfad1ac(0x2d5)+_0x8285f3),console[_0xfad1ac(0x24c)](_0xfad1ac(0x258)+_0x25b726),_0x38da5b&&console['error'](_0xfad1ac(0x28b)+_0x38da5b),_0x5328c2[_0xfad1ac(0x32a)]&&console['error'](_0xfad1ac(0x1fa)),_0x2d3e1c&&console[_0xfad1ac(0x24c)](_0xfad1ac(0x27c)));const _0xd2dc17=await withSpinner(_0xfad1ac(0x281),()=>_0x30a6b9[_0xfad1ac(0x201)][_0xfad1ac(0x318)](_0x8285f3,_0x25b726,{'revision':_0x38da5b,'skipValidation':_0x2d3e1c}),{'verbose':_0x5328c2[_0xfad1ac(0x195)]}),_0x924740=_0xd2dc17['data'];console[_0xfad1ac(0x24c)](_0xfad1ac(0x1f4)+_0x924740[_0xfad1ac(0x2fc)]);_0x924740['sourceProjectName']&&console[_0xfad1ac(0x24c)](_0xfad1ac(0x328)+_0x924740[_0xfad1ac(0x202)]);console['error']('New\x20project\x20name:\x20'+_0x924740[_0xfad1ac(0x1bd)]),console[_0xfad1ac(0x24c)]('Revision:\x20'+_0x924740['revision']),console[_0xfad1ac(0x24c)](_0xfad1ac(0x282)+_0x924740[_0xfad1ac(0x1e1)]);_0x924740[_0xfad1ac(0x2aa)]&&(console['error'](a51_0x221e70[_0xfad1ac(0x296)](_0xfad1ac(0x2f5)+_0x924740[_0xfad1ac(0x1bd)]+_0xfad1ac(0x239)+_0x924740[_0xfad1ac(0x261)]+')')),console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x296)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x5328c2['dryRun'])return console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x296)](_0xfad1ac(0x22b))),0x0;if(!_0x5328c2['yes']){if(!isInteractive())return console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x1d8)](_0xfad1ac(0x310)),_0xfad1ac(0x28e)),console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x2b3)](_0xfad1ac(0x324))),0x1;const _0x27fa87=_0x924740['sourceProjectName']||a51_0x5534f1[_0xfad1ac(0x26a)](_0x8285f3),_0x2b1db1=_0x924740[_0xfad1ac(0x2aa)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x25b726+_0xfad1ac(0x2ee):_0xfad1ac(0x1ab)+_0x27fa87+_0xfad1ac(0x28f)+_0x25b726+'\x22?',_0x5622c1=await confirmKey(_0x2b1db1);if(!_0x5622c1)return console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x296)]('Cancelled')),0x1;}const _0x4dc36b=await withSpinner(_0x924740[_0xfad1ac(0x2aa)]?_0xfad1ac(0x1da)+_0x25b726+_0xfad1ac(0x25f):'Cloning\x20to\x20'+_0x25b726+_0xfad1ac(0x25f),()=>_0x30a6b9[_0xfad1ac(0x201)]['executeCloneProject'](_0x924740),{'verbose':_0x5328c2[_0xfad1ac(0x195)]}),_0x56e0eb=_0x4dc36b[_0xfad1ac(0x264)];return console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x25a)](_0x924740['targetExists']?'✔\x20Project\x20updated':_0xfad1ac(0x2f7))),console[_0xfad1ac(0x24c)](_0xfad1ac(0x2c2)+_0x56e0eb[_0xfad1ac(0x1bd)]),console[_0xfad1ac(0x24c)]('\x20\x20Project\x20ID:\x20'+_0x56e0eb[_0xfad1ac(0x2cc)]),console[_0xfad1ac(0x24c)](_0xfad1ac(0x260)+_0x56e0eb['revision']),await this['showWorkflowConsoleUrl'](_0x30a6b9,_0x56e0eb[_0xfad1ac(0x1bd)],_0x5328c2[_0xfad1ac(0x26f)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x250);[a51_0x467f12(0x242)]=a51_0x467f12(0x321);async['execute'](_0x40f15d){const _0x12ee75=a51_0x467f12,{options:_0x40a64e,args:_0x37162f,tdx:_0x162195}=_0x40f15d,_0x466b40=_0x37162f[0x0];if(!_0x466b40)return console[_0x12ee75(0x24c)](_0x12ee75(0x1be)),console[_0x12ee75(0x24c)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x40a64e[_0x12ee75(0x195)]&&console[_0x12ee75(0x24c)]('Project:\x20'+_0x466b40);if(!_0x40a64e['yes']){if(!isInteractive())return console[_0x12ee75(0x24c)](a51_0x221e70['red'](_0x12ee75(0x310)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a51_0x221e70[_0x12ee75(0x2b3)](_0x12ee75(0x324))),0x1;const _0x248f9a=await confirmKey(_0x12ee75(0x1f6)+_0x466b40+_0x12ee75(0x2f6));if(!_0x248f9a)return console[_0x12ee75(0x24c)](a51_0x221e70[_0x12ee75(0x296)](_0x12ee75(0x1c4))),0x1;}const _0xbe12fd=await withSpinner('Deleting\x20project\x20'+_0x466b40+_0x12ee75(0x25f),()=>_0x162195[_0x12ee75(0x201)][_0x12ee75(0x2ea)](_0x466b40),{'verbose':_0x40a64e[_0x12ee75(0x195)]}),_0x213288=_0xbe12fd[_0x12ee75(0x264)];return console[_0x12ee75(0x24c)](_0x12ee75(0x316)+_0x213288['projectName']),console[_0x12ee75(0x24c)]('\x20\x20Project\x20ID:\x20'+_0x213288[_0x12ee75(0x2d9)]),0x0;}}export function parseKeyValue(_0x5331b0){const _0xd324ad=a51_0x467f12,_0x15aa8c=_0x5331b0[_0xd324ad(0x29e)]('=');if(_0x15aa8c===-0x1)throw new Error('Invalid\x20format:\x20'+_0x5331b0+_0xd324ad(0x327));const _0xaf4c75=_0x5331b0['substring'](0x0,_0x15aa8c),_0x56404c=_0x5331b0[_0xd324ad(0x2b4)](_0x15aa8c+0x1);if(!_0xaf4c75)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0xaf4c75,'value':_0x56404c};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a51_0x467f12(0x1db)]='workflow:secrets:list';['description']=a51_0x467f12(0x1f0);async[a51_0x467f12(0x255)](_0x1107a9){const _0x474382=a51_0x467f12,{options:_0x92887b,args:_0x422da3,tdx:_0x9ca0f7}=_0x1107a9,_0x58b0e3=this[_0x474382(0x20a)](_0x422da3,_0x92887b);if(!_0x58b0e3)return 0x1;_0x92887b[_0x474382(0x195)]&&console['error'](_0x474382(0x232)+_0x58b0e3);const _0x3c3cab=await withSpinner(_0x474382(0x2c1),()=>_0x9ca0f7['workflow'][_0x474382(0x2e6)](_0x58b0e3),{'verbose':_0x92887b[_0x474382(0x195)]}),{secrets:_0x583627}=_0x3c3cab['data'];return console['error']('✔\x20Found\x20'+_0x583627[_0x474382(0x26e)]+_0x474382(0x2de)+(_0x583627[_0x474382(0x26e)]!==0x1?'s':'')),await handleSDKOutput(_0x583627,_0x92887b),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x20c);[a51_0x467f12(0x242)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a51_0x467f12(0x255)](_0x36aa60){const _0x7266a9=a51_0x467f12,{options:_0x21ee3d,args:_0x547b4d,tdx:_0x42533a}=_0x36aa60;let _0x28f2d0,_0x1eecf9;if(_0x547b4d['length']>=0x2)_0x28f2d0=_0x547b4d[0x0],_0x1eecf9=_0x547b4d[0x1];else{if(_0x547b4d[_0x7266a9(0x26e)]===0x1&&_0x21ee3d[_0x7266a9(0x330)])_0x28f2d0=_0x21ee3d[_0x7266a9(0x330)],_0x1eecf9=_0x547b4d[0x0];else return _0x547b4d[_0x7266a9(0x26e)]===0x1?(console[_0x7266a9(0x24c)](_0x7266a9(0x2ec)),console[_0x7266a9(0x24c)](_0x7266a9(0x1a5)),0x1):(console[_0x7266a9(0x24c)]('Error:\x20KEY=VALUE\x20is\x20required'),console[_0x7266a9(0x24c)](_0x7266a9(0x1bf)),0x1);}let _0x5b019c,_0x551c0b;try{({key:_0x5b019c,value:_0x551c0b}=parseKeyValue(_0x1eecf9));}catch(_0x1007d6){return _0x1007d6 instanceof Error&&console[_0x7266a9(0x24c)](a51_0x221e70[_0x7266a9(0x1d8)]('Error:'),_0x1007d6[_0x7266a9(0x218)]),0x1;}_0x21ee3d[_0x7266a9(0x195)]&&(console['error'](_0x7266a9(0x232)+_0x28f2d0),console[_0x7266a9(0x24c)](_0x7266a9(0x2c6)+_0x5b019c));const _0x3319c6=await withSpinner(_0x7266a9(0x221),()=>_0x42533a[_0x7266a9(0x201)][_0x7266a9(0x262)](_0x28f2d0,_0x5b019c,_0x551c0b),{'verbose':_0x21ee3d[_0x7266a9(0x195)]}),_0x10fc71=_0x3319c6[_0x7266a9(0x264)];return console[_0x7266a9(0x24c)](_0x7266a9(0x2a7)+_0x10fc71[_0x7266a9(0x2a5)]+_0x7266a9(0x300)+_0x10fc71[_0x7266a9(0x199)]+'\x27'),(_0x21ee3d[_0x7266a9(0x2e3)]||_0x21ee3d[_0x7266a9(0x2b1)])&&await handleSingleObjectOutput(_0x10fc71,_0x21ee3d),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x223);[a51_0x467f12(0x242)]=a51_0x467f12(0x2dc);async[a51_0x467f12(0x255)](_0x6821d9){const _0x32beb3=a51_0x467f12,{options:_0xf879c7,args:_0x450d8b,tdx:_0x9329c3}=_0x6821d9;let _0x35138c,_0x4cc7b3;if(_0x450d8b[_0x32beb3(0x26e)]>=0x2)_0x35138c=_0x450d8b[0x0],_0x4cc7b3=_0x450d8b[0x1];else{if(_0x450d8b[_0x32beb3(0x26e)]===0x1&&_0xf879c7[_0x32beb3(0x330)])_0x35138c=_0xf879c7['workflowProject'],_0x4cc7b3=_0x450d8b[0x0];else return _0x450d8b[_0x32beb3(0x26e)]===0x1?(console[_0x32beb3(0x24c)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x32beb3(0x24c)](_0x32beb3(0x1a5)),0x1):(console[_0x32beb3(0x24c)](_0x32beb3(0x259)),console['error'](_0x32beb3(0x28c)),0x1);}_0xf879c7[_0x32beb3(0x195)]&&(console[_0x32beb3(0x24c)](_0x32beb3(0x232)+_0x35138c),console[_0x32beb3(0x24c)](_0x32beb3(0x2c6)+_0x4cc7b3));if(!_0xf879c7[_0x32beb3(0x307)]){if(!isInteractive())return console[_0x32beb3(0x24c)](a51_0x221e70[_0x32beb3(0x1d8)](_0x32beb3(0x310)),_0x32beb3(0x28e)),console[_0x32beb3(0x24c)](a51_0x221e70[_0x32beb3(0x2b3)](_0x32beb3(0x324))),0x1;const _0x409f04=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x4cc7b3+_0x32beb3(0x1fe)+_0x35138c+'\x27?');if(!_0x409f04)return console[_0x32beb3(0x24c)](a51_0x221e70[_0x32beb3(0x296)](_0x32beb3(0x1c4))),0x1;}const _0x261c7c=await withSpinner('Deleting\x20secret...',()=>_0x9329c3[_0x32beb3(0x201)][_0x32beb3(0x2d3)](_0x35138c,_0x4cc7b3),{'verbose':_0xf879c7['verbose']}),_0x472a45=_0x261c7c[_0x32beb3(0x264)];return console[_0x32beb3(0x24c)]('✔\x20Secret\x20\x27'+_0x472a45[_0x32beb3(0x2a5)]+_0x32beb3(0x1a6)+_0x472a45[_0x32beb3(0x199)]+'\x27'),(_0xf879c7[_0x32beb3(0x2e3)]||_0xf879c7[_0x32beb3(0x2b1)])&&await handleSingleObjectOutput(_0x472a45,_0xf879c7),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(_0x165aae){const _0x2c3c15=a51_0x467f12,_0x4ef541=Math[_0x2c3c15(0x1a1)](_0x165aae/0x3e8),_0x64e67d=Math[_0x2c3c15(0x1a1)](_0x4ef541/0x3c),_0xba319c=Math[_0x2c3c15(0x1a1)](_0x64e67d/0x3c),_0x44c404=Math[_0x2c3c15(0x1a1)](_0xba319c/0x18);if(_0x44c404>0x0){const _0x3f77da=_0xba319c%0x18;return _0x3f77da>0x0?_0x44c404+'d\x20'+_0x3f77da+'h':_0x44c404+'d';}else{if(_0xba319c>0x0){const _0x22e4d6=_0x64e67d%0x3c;return _0x22e4d6>0x0?_0xba319c+'h\x20'+_0x22e4d6+'m':_0xba319c+'h';}else{if(_0x64e67d>0x0){const _0x536f54=_0x4ef541%0x3c;return _0x536f54>0x0?_0x64e67d+'m\x20'+_0x536f54+'s':_0x64e67d+'m';}else return _0x4ef541+'s';}}}function formatTimestamp(_0x39f163,_0x2c59e1){const _0xf2956d=a51_0x467f12,_0x17fec9=new Date(_0x39f163),_0x3c714f=String(_0x17fec9['getHours']())[_0xf2956d(0x1e2)](0x2,'0'),_0x47bf69=String(_0x17fec9['getMinutes']())[_0xf2956d(0x1e2)](0x2,'0'),_0x17ffcc=_0x3c714f+':'+_0x47bf69,_0x3d2767=_0x17fec9['getFullYear']()===_0x2c59e1[_0xf2956d(0x1c9)]()&&_0x17fec9['getMonth']()===_0x2c59e1['getMonth']()&&_0x17fec9['getDate']()===_0x2c59e1[_0xf2956d(0x24f)]();if(_0x3d2767)return _0x17ffcc;else{const _0x35f992=String(_0x17fec9['getMonth']()+0x1)[_0xf2956d(0x1e2)](0x2,'0'),_0x21acf3=String(_0x17fec9[_0xf2956d(0x24f)]())['padStart'](0x2,'0');return _0x35f992+'-'+_0x21acf3+'\x20'+_0x17ffcc;}}function formatDate(_0x1e951b){const _0x39ee03=a51_0x467f12,_0x21ab87=_0x1e951b[_0x39ee03(0x1c9)](),_0x20390b=String(_0x1e951b['getMonth']()+0x1)[_0x39ee03(0x1e2)](0x2,'0'),_0x4602a1=String(_0x1e951b[_0x39ee03(0x24f)]())[_0x39ee03(0x1e2)](0x2,'0');return _0x21ab87+'-'+_0x20390b+'-'+_0x4602a1;}function getTaskStateIcon(_0x2953d0){const _0x5b711e={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x5b711e[_0x2953d0]||'⚪';}function getBarChar(_0x2fdb2b){const _0x1f571c=a51_0x467f12;return _0x2fdb2b===_0x1f571c(0x24c)||_0x2fdb2b===_0x1f571c(0x206)?'×':'─';}function getBarColor(_0x40c5ef){const _0x2acc43=a51_0x467f12,_0x5e8f9d={'success':a51_0x221e70[_0x2acc43(0x25a)],'error':a51_0x221e70['red'],'group_error':a51_0x221e70[_0x2acc43(0x1d8)],'running':a51_0x221e70[_0x2acc43(0x2af)],'blocked':a51_0x221e70[_0x2acc43(0x296)],'planned':a51_0x221e70[_0x2acc43(0x2b3)],'canceling':a51_0x221e70[_0x2acc43(0x296)]};return _0x5e8f9d[_0x40c5ef]||a51_0x221e70[_0x2acc43(0x30f)];}function parseTaskName(_0x5c5a95){const _0x1c4794=a51_0x467f12;let _0xf4674e=_0x5c5a95['replace'](/^\++/,'');const _0x51cd96=_0xf4674e[_0x1c4794(0x226)]('+'),_0x3a3bb8=_0x51cd96[_0x1c4794(0x26e)]>0x1?_0x51cd96['length']-0x2:0x0,_0x34a1e8=_0x51cd96[_0x51cd96[_0x1c4794(0x26e)]-0x1]||_0xf4674e;return{'level':_0x3a3bb8,'name':'+'+_0x34a1e8};}function truncateTaskName(_0x210a10,_0x2b695e){const _0x3c4f6a=a51_0x467f12,_0x6db817=stringWidth(_0x210a10);if(_0x6db817<=_0x2b695e)return _0x210a10;let _0x1865ad=_0x210a10;while(stringWidth(_0x1865ad+'…')>_0x2b695e&&_0x1865ad[_0x3c4f6a(0x26e)]>0x0){_0x1865ad=_0x1865ad[_0x3c4f6a(0x2be)](0x0,-0x1);}return _0x1865ad+'…';}function calculateTimeScale(_0x4c45a0,_0x425c31){const _0x53ae7f=a51_0x467f12;return{'startTime':_0x4c45a0['start'],'endTime':_0x4c45a0[_0x53ae7f(0x2a6)],'durationMs':_0x4c45a0[_0x53ae7f(0x1c5)],'msPerChar':_0x4c45a0[_0x53ae7f(0x1c5)]/_0x425c31};}function timeToPosition(_0x2b5716,_0x38e222,_0x44c05d){const _0x3ca1d9=a51_0x467f12,_0x4233fc=_0x2b5716-_0x38e222[_0x3ca1d9(0x25c)],_0xdc381e=Math[_0x3ca1d9(0x1a1)](_0x4233fc/_0x38e222[_0x3ca1d9(0x270)]);return Math[_0x3ca1d9(0x31c)](0x0,Math[_0x3ca1d9(0x2d7)](_0xdc381e,_0x44c05d));}function renderTimeAxis(_0x71b4dc,_0x2ae5a7){const _0x271459=a51_0x467f12,_0x171890=Math['min'](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x271459(0x31c)](TIMELINE_CONFIG[_0x271459(0x2a0)],Math['floor'](_0x2ae5a7/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x413599=_0x71b4dc[_0x271459(0x246)]/(_0x171890-0x1),_0x52a191=new Date(_0x71b4dc['startTime']),_0x496cc1=[];for(let _0x2f77f6=0x0;_0x2f77f6<_0x171890;_0x2f77f6++){const _0x501ebf=_0x71b4dc[_0x271459(0x25c)]+_0x2f77f6*_0x413599,_0x14bc0c=timeToPosition(_0x501ebf,_0x71b4dc,_0x2ae5a7),_0x3459e4=formatTimestamp(_0x501ebf,_0x52a191);_0x496cc1[_0x271459(0x30a)]({'pos':_0x14bc0c,'text':_0x3459e4});}const _0x2c9ff4=new Array(_0x2ae5a7)['fill']('\x20');let _0x1b5d85=-0x1;for(const {pos:_0x2f3c9f,text:_0x45a7bd}of _0x496cc1){let _0x403327=Math[_0x271459(0x31c)](0x0,_0x2f3c9f-Math[_0x271459(0x1a1)](_0x45a7bd[_0x271459(0x26e)]/0x2));_0x403327<=_0x1b5d85+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x403327=_0x1b5d85+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x403327+_0x45a7bd[_0x271459(0x26e)]>_0x2ae5a7&&(_0x403327=_0x2ae5a7-_0x45a7bd[_0x271459(0x26e)]);if(_0x403327>=0x0&&_0x403327+_0x45a7bd[_0x271459(0x26e)]<=_0x2ae5a7&&_0x403327>_0x1b5d85){for(let _0x30307e=0x0;_0x30307e<_0x45a7bd[_0x271459(0x26e)];_0x30307e++){_0x2c9ff4[_0x403327+_0x30307e]=_0x45a7bd[_0x30307e];}_0x1b5d85=_0x403327+_0x45a7bd['length']-0x1;}}return _0x2c9ff4[_0x271459(0x2e4)]('');}function renderTaskRow(_0x55d141,_0x599e8b,_0x4c5112,_0x2d5255){const _0x271745=a51_0x467f12,{level:_0x16ba13,name:_0x50b9ab}=parseTaskName(_0x55d141[_0x271745(0x1db)]),_0x275bcf='\x20'[_0x271745(0x225)](_0x16ba13),_0xa6976e=_0x55d141[_0x271745(0x235)]?'('+formatElapsed(_0x55d141[_0x271745(0x235)]['duration'])+')':'',_0x51f19b=stringWidth(_0xa6976e),_0x315fda=_0x16ba13*0x1,_0x43466b=_0x2d5255-_0x315fda-_0x51f19b-0x1,_0x110aff=truncateTaskName(_0x50b9ab,_0x43466b),_0x4281b0=_0x275bcf+_0x110aff,_0xb052af=stringWidth(_0x4281b0),_0x2073a1=_0x2d5255-_0xb052af-_0x51f19b,_0x3f4cba=_0x4281b0+'\x20'[_0x271745(0x225)](Math[_0x271745(0x31c)](0x1,_0x2073a1))+a51_0x221e70[_0x271745(0x2b3)](_0xa6976e),_0x474311=getTaskStateIcon(_0x55d141[_0x271745(0x1dc)]),_0x8f783d=new Array(_0x4c5112)['fill']('\x20');if(_0x55d141[_0x271745(0x235)]){const _0x5dd7c0=timeToPosition(_0x55d141[_0x271745(0x235)][_0x271745(0x234)],_0x599e8b,_0x4c5112),_0x2fde80=timeToPosition(_0x55d141[_0x271745(0x235)]['end'],_0x599e8b,_0x4c5112),_0x36608e=getBarChar(_0x55d141[_0x271745(0x1dc)]),_0x3d5c86=Math[_0x271745(0x31c)](_0x5dd7c0+0x1,_0x2fde80);for(let _0x53d1f0=_0x5dd7c0;_0x53d1f0<Math[_0x271745(0x2d7)](_0x3d5c86,_0x4c5112);_0x53d1f0++){_0x8f783d[_0x53d1f0]=_0x36608e;}}const _0x41feb2=getBarColor(_0x55d141[_0x271745(0x1dc)]),_0x14da59=_0x8f783d[_0x271745(0x2b6)](_0xf4a25e=>_0xf4a25e==='\x20'?'\x20':_0x41feb2(_0xf4a25e))[_0x271745(0x2e4)]('');return _0x474311+'\x20'+_0x3f4cba+'│'+_0x14da59+'│';}function a51_0x56f9(_0x5657ec,_0x99f221){_0x5657ec=_0x5657ec-0x190;const _0xf6ba0a=a51_0xf6ba();let _0x56f9b6=_0xf6ba0a[_0x5657ec];return _0x56f9b6;}function calculateStats(_0xa1ffe){const _0x75a23d=a51_0x467f12,_0x1338e8={'total':_0xa1ffe[_0x75a23d(0x26e)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x196710 of _0xa1ffe){if(_0x196710['state']===_0x75a23d(0x194))_0x1338e8[_0x75a23d(0x194)]++;else{if(_0x196710[_0x75a23d(0x1dc)]===_0x75a23d(0x24c)||_0x196710[_0x75a23d(0x1dc)]==='group_error')_0x1338e8['error']++;else _0x196710['state']==='running'?_0x1338e8[_0x75a23d(0x23d)]++:_0x1338e8[_0x75a23d(0x2da)]++;}}return _0x1338e8;}function formatStats(_0x199cf3){const _0x46dac3=a51_0x467f12;return[_0x46dac3(0x2f4)+_0x199cf3['total'],'✅\x20'+_0x199cf3[_0x46dac3(0x194)],'❌\x20'+_0x199cf3[_0x46dac3(0x24c)],_0x46dac3(0x2fa)+_0x199cf3[_0x46dac3(0x23d)],'⏳\x20'+_0x199cf3[_0x46dac3(0x2da)]][_0x46dac3(0x2e4)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x269);[a51_0x467f12(0x242)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a51_0x467f12(0x255)](_0x2fc28a){const _0x398a6f=a51_0x467f12,{options:_0x578f7c,args:_0x2558d1,tdx:_0x3537d8}=_0x2fc28a;let _0x12febc,_0x4c6e06,_0x3af0df=![];if(_0x2558d1[0x0]){if(_0x2558d1[0x0][_0x398a6f(0x23a)]('.')){const _0x2eca1e=this[_0x398a6f(0x1c7)](_0x2558d1,_0x578f7c);if(!_0x2eca1e)return 0x1;_0x12febc=_0x2eca1e[_0x398a6f(0x199)],_0x4c6e06=_0x2eca1e[_0x398a6f(0x317)];}else{_0x4c6e06=_0x2558d1[0x0],_0x12febc=_0x578f7c['workflowProject'];if(!_0x12febc)return console[_0x398a6f(0x24c)](a51_0x221e70[_0x398a6f(0x1d8)](_0x398a6f(0x1cb)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x3af0df=!![];}}else{const _0x435967=this[_0x398a6f(0x1c7)](_0x2558d1,_0x578f7c);if(!_0x435967)return 0x1;_0x12febc=_0x435967['projectName'],_0x4c6e06=_0x435967[_0x398a6f(0x317)];}if(_0x578f7c[_0x398a6f(0x195)]){if(_0x12febc&&_0x4c6e06)console['error']('Filter:\x20'+_0x12febc+'.'+_0x4c6e06);else _0x12febc&&console[_0x398a6f(0x24c)](_0x398a6f(0x283)+_0x12febc);}const _0x366e95=_0x578f7c[_0x398a6f(0x27d)],_0x12418f=_0x578f7c[_0x398a6f(0x1af)];if(_0x366e95){_0x12418f&&console[_0x398a6f(0x24c)](a51_0x221e70[_0x398a6f(0x296)](_0x398a6f(0x27e)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x33f381=_0x578f7c['follow'];return _0x33f381?await this[_0x398a6f(0x32c)](_0x2fc28a,_0x366e95):await this[_0x398a6f(0x2bf)](_0x2fc28a,_0x366e95,_0x578f7c),0x0;}if(_0x12418f){const _0x370add=await withSpinner(_0x398a6f(0x248),()=>_0x3537d8[_0x398a6f(0x201)][_0x398a6f(0x323)]({'projectName':_0x12febc,'workflowName':_0x4c6e06,'limit':0x64}),{'verbose':_0x578f7c[_0x398a6f(0x195)]}),_0x3dee9d=_0x370add[_0x398a6f(0x264)]['find'](_0x28d6c0=>_0x28d6c0['id']===_0x12418f);if(!_0x3dee9d)return console['error'](a51_0x221e70[_0x398a6f(0x1d8)]('Error:'),_0x398a6f(0x31d)+_0x12418f),0x1;if(!_0x3dee9d[_0x398a6f(0x28a)]?.['id'])return console[_0x398a6f(0x24c)](a51_0x221e70['red']('Error:'),_0x398a6f(0x216)+_0x12418f+_0x398a6f(0x1f2)),0x1;const _0x4bb5a4=_0x3dee9d[_0x398a6f(0x28a)]['id'];_0x578f7c[_0x398a6f(0x195)]&&console['error']('Using\x20attempt\x20'+_0x4bb5a4+'\x20from\x20session\x20'+_0x12418f);const _0x323f3f=_0x578f7c[_0x398a6f(0x2eb)];return _0x323f3f?await this[_0x398a6f(0x32c)](_0x2fc28a,_0x4bb5a4):await this[_0x398a6f(0x2bf)](_0x2fc28a,_0x4bb5a4,_0x578f7c),0x0;}const _0x10cf30=await withSpinner('Loading\x20sessions...',()=>_0x3537d8[_0x398a6f(0x201)][_0x398a6f(0x323)]({'projectName':_0x12febc,'workflowName':_0x4c6e06,'limit':_0x578f7c[_0x398a6f(0x29f)]||0x32}),{'verbose':_0x578f7c[_0x398a6f(0x195)]}),_0x2fad71=_0x10cf30[_0x398a6f(0x264)];if(_0x2fad71[_0x398a6f(0x26e)]===0x0){if(_0x12febc&&_0x4c6e06)console[_0x398a6f(0x24c)]('No\x20sessions\x20found\x20for:\x20'+_0x12febc+'.'+_0x4c6e06);else _0x12febc?console[_0x398a6f(0x24c)](_0x398a6f(0x1cd)+_0x12febc):(console['error'](_0x398a6f(0x219)),console[_0x398a6f(0x24c)](a51_0x221e70[_0x398a6f(0x2b3)](_0x398a6f(0x1ee))));return 0x0;}_0x2fad71[_0x398a6f(0x241)]((_0x577370,_0x46dd1b)=>{const _0x50a7c1=_0x398a6f,_0x93df0f=_0x577370['sessionTime']||'',_0x55c906=_0x46dd1b[_0x50a7c1(0x1e3)]||'';return _0x55c906[_0x50a7c1(0x2cf)](_0x93df0f);});if(_0x578f7c['json']||_0x578f7c[_0x398a6f(0x2b1)])return await handleSDKOutput(_0x2fad71,_0x578f7c),0x0;let _0x24ca48;if(_0x3af0df){const _0x10760f=_0x2fad71[0x0];if(!_0x10760f['lastAttempt']?.['id'])return console[_0x398a6f(0x24c)](_0x398a6f(0x22f)),0x0;_0x24ca48=_0x10760f[_0x398a6f(0x28a)]['id'],_0x578f7c['verbose']&&console[_0x398a6f(0x24c)]('Auto-selected\x20latest\x20session:\x20'+_0x10760f[_0x398a6f(0x1e3)]);}else{const _0x38eb98=_0x2fad71[_0x398a6f(0x2b6)](_0x5618ed=>{const _0x4ef19a=_0x398a6f,_0x4cedba=getAttemptStatusDisplay(_0x5618ed[_0x4ef19a(0x28a)]);return{'title':_0x5618ed[_0x4ef19a(0x23f)]?.['name']+'.'+_0x5618ed[_0x4ef19a(0x201)]?.['name']+_0x4ef19a(0x289)+_0x5618ed[_0x4ef19a(0x1e3)]+'\x20'+_0x4cedba[_0x4ef19a(0x2c8)],'value':_0x5618ed['lastAttempt']?.['id']||'','description':_0x4cedba['text']};}),_0x530eb5=await a51_0x59e223({'type':_0x398a6f(0x2fd),'name':_0x398a6f(0x27d),'message':_0x398a6f(0x1e8),'choices':_0x38eb98[_0x398a6f(0x32f)](_0x426bf5=>_0x426bf5['value']!=='')});if(!_0x530eb5[_0x398a6f(0x27d)])return 0x0;_0x24ca48=_0x530eb5['attemptId'];}const _0x12eee3=_0x578f7c['follow'];return _0x12eee3?await this[_0x398a6f(0x32c)](_0x2fc28a,_0x24ca48):await this[_0x398a6f(0x2bf)](_0x2fc28a,_0x24ca48,_0x578f7c),0x0;}async[a51_0x467f12(0x2bf)](_0x1bf689,_0x1ed336,_0x5b8e78){const _0x59c74a=a51_0x467f12,{tdx:_0x150863}=_0x1bf689;let _0x18cd4a,_0xb33159;try{[_0x18cd4a,_0xb33159]=await Promise[_0x59c74a(0x1f3)]([_0x150863[_0x59c74a(0x201)][_0x59c74a(0x290)](_0x1ed336),_0x150863[_0x59c74a(0x201)]['tasks'](_0x1ed336,![])]);}catch(_0x181a74){console['error'](a51_0x221e70[_0x59c74a(0x1d8)](_0x59c74a(0x329)));_0x5b8e78[_0x59c74a(0x195)]&&console[_0x59c74a(0x24c)](_0x181a74);throw _0x181a74;}if(_0x5b8e78['json']||_0x5b8e78[_0x59c74a(0x2b1)]){const _0x4a4129=this['buildTimelineData'](_0x18cd4a,_0xb33159);await handleSDKOutput([_0x4a4129],_0x5b8e78);return;}const _0x1d89d9=_0x150863['context'][_0x59c74a(0x26f)],_0x22916c=this[_0x59c74a(0x2e9)](_0x18cd4a,_0xb33159,_0x1d89d9);console[_0x59c74a(0x295)](_0x22916c);}async[a51_0x467f12(0x32c)](_0x9a09da,_0x16ad16){const _0x422ba3=a51_0x467f12,{tdx:_0x5cbb80}=_0x9a09da,_0x530565=TIMELINE_CONFIG[_0x422ba3(0x314)],_0xdfabfc=TIMELINE_CONFIG[_0x422ba3(0x1c1)];let _0x568f47=0x0;while(_0x568f47<_0xdfabfc){process[_0x422ba3(0x1b5)][_0x422ba3(0x24d)]&&process[_0x422ba3(0x1b5)][_0x422ba3(0x224)]('\x1bc');let _0x13fcb8,_0x48d00b;try{[_0x13fcb8,_0x48d00b]=await Promise[_0x422ba3(0x1f3)]([_0x5cbb80[_0x422ba3(0x201)]['attempt'](_0x16ad16),_0x5cbb80[_0x422ba3(0x201)]['tasks'](_0x16ad16,![])]);}catch(_0x5d4553){console['error'](a51_0x221e70[_0x422ba3(0x1d8)](_0x422ba3(0x198)));_0x568f47>0x0&&console[_0x422ba3(0x24c)](a51_0x221e70[_0x422ba3(0x2b3)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x568f47));throw _0x5d4553;}const _0x48ae06=_0x5cbb80[_0x422ba3(0x2b9)][_0x422ba3(0x26f)],_0x348690=this[_0x422ba3(0x2e9)](_0x13fcb8,_0x48d00b,_0x48ae06);console[_0x422ba3(0x295)](_0x348690);const _0x364d63=_0x13fcb8[_0x422ba3(0x254)]&&_0x48d00b['every'](_0xc78db4=>_0xc78db4[_0x422ba3(0x1dc)]!==_0x422ba3(0x23d)&&_0xc78db4[_0x422ba3(0x1dc)]!==_0x422ba3(0x26b));if(_0x364d63){console[_0x422ba3(0x24c)](a51_0x221e70[_0x422ba3(0x25a)](_0x422ba3(0x265)));break;}console[_0x422ba3(0x24c)](a51_0x221e70[_0x422ba3(0x2b3)](_0x422ba3(0x1dd)+_0x568f47*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x46f890=>setTimeout(_0x46f890,_0x530565)),_0x568f47++;}_0x568f47>=_0xdfabfc&&console[_0x422ba3(0x24c)](a51_0x221e70[_0x422ba3(0x296)](_0x422ba3(0x212)));}[a51_0x467f12(0x2e9)](_0x587cb2,_0x19687a,_0xdda74b){const _0xb56b00=a51_0x467f12,_0x35992a=[],_0x139fde=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x2660f6=0x5,_0x2a3414=process['stdout'][_0xb56b00(0x1d5)]||0x78,_0x27e841=_0x2a3414-_0x139fde-_0x2660f6,_0x451566=Math['max'](TIMELINE_CONFIG[_0xb56b00(0x2ca)],Math[_0xb56b00(0x2d7)](_0x27e841,TIMELINE_CONFIG[_0xb56b00(0x2d2)])),_0x191861=new Date(_0x587cb2[_0xb56b00(0x1df)])['getTime'](),_0x2e216b=_0x587cb2[_0xb56b00(0x1e6)]?new Date(_0x587cb2[_0xb56b00(0x1e6)])[_0xb56b00(0x2ae)]():Date[_0xb56b00(0x1f8)](),_0x5e6840={'start':_0x191861,'end':_0x2e216b,'duration':_0x2e216b-_0x191861},_0x24f6e6=new Map(),_0x19c0f4=[];for(const _0x180644 of _0x19687a){if(_0x180644[_0xb56b00(0x1b2)]){const _0x403fa6=new Date(_0x180644['startedAt'])[_0xb56b00(0x2ae)](),_0x464150=_0x180644['updatedAt']?new Date(_0x180644[_0xb56b00(0x2f1)])['getTime']():Date[_0xb56b00(0x1f8)](),_0x54c3f2={'start':_0x403fa6,'end':_0x464150,'duration':_0x464150-_0x403fa6};_0x24f6e6[_0xb56b00(0x2ff)](_0x180644['id'],_0x54c3f2),_0x19c0f4[_0xb56b00(0x30a)]({'name':_0x180644['fullName'],'state':_0x180644[_0xb56b00(0x1dc)]||_0xb56b00(0x28d),'window':_0x54c3f2});}else _0x19c0f4[_0xb56b00(0x30a)]({'name':_0x180644[_0xb56b00(0x251)],'state':_0x180644[_0xb56b00(0x1dc)]||_0xb56b00(0x26b),'window':undefined});}_0x19c0f4[_0xb56b00(0x241)]((_0x18032f,_0x235540)=>{const _0x554268=_0xb56b00;if(!_0x18032f[_0x554268(0x235)])return 0x1;if(!_0x235540[_0x554268(0x235)])return-0x1;return _0x18032f[_0x554268(0x235)][_0x554268(0x234)]-_0x235540['window'][_0x554268(0x234)];});const _0x2a4e38=_0x19c0f4[_0xb56b00(0x26e)],_0x2c3f69=_0x2a4e38>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x2c3f69&&_0x19c0f4[_0xb56b00(0x2e2)](TIMELINE_CONFIG[_0xb56b00(0x237)]);const _0x448e24=calculateTimeScale(_0x5e6840,_0x451566),_0x41694c=_0x587cb2['done']?_0x587cb2[_0xb56b00(0x194)]?a51_0x221e70[_0xb56b00(0x25a)](_0xb56b00(0x194)):a51_0x221e70[_0xb56b00(0x1d8)](_0xb56b00(0x24c)):a51_0x221e70[_0xb56b00(0x2af)](_0xb56b00(0x23d)),_0x3d6f19=_0x587cb2['project']?.['id'],_0x58dafb=_0x587cb2[_0xb56b00(0x1af)];let _0x1e3b2b;if(_0x3d6f19&&_0x58dafb){const _0x28aafe=getWorkflowAttemptUrl(_0xdda74b,_0x3d6f19,_0x58dafb,_0x587cb2['id']);_0x1e3b2b=hyperlink(a51_0x221e70[_0xb56b00(0x2b3)](_0x587cb2['id']),_0x28aafe);}else _0x1e3b2b=a51_0x221e70[_0xb56b00(0x2b3)](_0x587cb2['id']);_0x35992a['push'](_0xb56b00(0x1ae)+_0x1e3b2b+'\x20-\x20'+_0x41694c+'\x20-\x20'+formatElapsed(_0x5e6840['duration']));if(_0x19c0f4[_0xb56b00(0x26e)]>0x0){const _0xbdac33=renderTimeAxis(_0x448e24,_0x451566),_0xe8b1ed=new Date(_0x5e6840['start']),_0x12c29e=formatDate(_0xe8b1ed),_0x2a2154=TIMELINE_CONFIG[_0xb56b00(0x229)]+TIMELINE_CONFIG['ICON_SPACING']+_0x139fde,_0x55d9be=_0x12c29e[_0xb56b00(0x1e2)](_0x2a2154),_0x4c9d28=a51_0x221e70[_0xb56b00(0x2b3)](_0x55d9be);_0x35992a['push'](_0x4c9d28+'\x20'+_0xbdac33);for(const _0x5d6076 of _0x19c0f4){_0x35992a[_0xb56b00(0x30a)](renderTaskRow(_0x5d6076,_0x448e24,_0x451566,_0x139fde));}const _0x1fe7eb=calculateStats(_0x19c0f4);_0x35992a[_0xb56b00(0x30a)](formatStats(_0x1fe7eb)),_0x2c3f69&&_0x35992a['push'](a51_0x221e70['yellow']('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0xb56b00(0x237)]+_0xb56b00(0x1b6)+_0x2a4e38+'\x20tasks')),_0x35992a['push'](''),_0x35992a['push'](a51_0x221e70[_0xb56b00(0x2b3)](_0xb56b00(0x19d))+(_0xb56b00(0x32d)+_0x587cb2['id']+'\x20logs')+a51_0x221e70[_0xb56b00(0x2b3)](_0xb56b00(0x1bc)));}else _0x35992a[_0xb56b00(0x30a)](_0xb56b00(0x311));return _0x35992a['join']('\x0a');}[a51_0x467f12(0x1b9)](_0x75a849,_0x4e9349){const _0x5797d5=a51_0x467f12,_0x2b5d69=new Date(_0x75a849[_0x5797d5(0x1df)])[_0x5797d5(0x2ae)](),_0xdbdcf=_0x75a849['finishedAt']?new Date(_0x75a849[_0x5797d5(0x1e6)])['getTime']():Date[_0x5797d5(0x1f8)](),_0x3efc12=_0xdbdcf-_0x2b5d69,_0x2ca60c=[];for(const _0x33ef99 of _0x4e9349){if(_0x33ef99[_0x5797d5(0x1b2)]){const _0x9d50e0=new Date(_0x33ef99[_0x5797d5(0x1b2)])[_0x5797d5(0x2ae)](),_0x4a8c71=_0x33ef99['updatedAt']?new Date(_0x33ef99[_0x5797d5(0x2f1)])['getTime']():Date[_0x5797d5(0x1f8)]();_0x2ca60c['push']({'name':_0x33ef99[_0x5797d5(0x251)],'state':_0x33ef99['state']||'unknown','window':{'start':_0x9d50e0,'end':_0x4a8c71,'duration':_0x4a8c71-_0x9d50e0}});}else _0x2ca60c[_0x5797d5(0x30a)]({'name':_0x33ef99[_0x5797d5(0x251)],'state':_0x33ef99[_0x5797d5(0x1dc)]||'planned','window':undefined});}const _0x37fae2=calculateStats(_0x2ca60c);return{'attempt':{'id':_0x75a849['id'],'status':_0x75a849['done']?_0x75a849[_0x5797d5(0x194)]?_0x5797d5(0x194):'error':_0x5797d5(0x23d),'createdAt':_0x75a849[_0x5797d5(0x1df)],'finishedAt':_0x75a849[_0x5797d5(0x1e6)],'duration_ms':_0x3efc12},'tasks':_0x2ca60c[_0x5797d5(0x2b6)](_0x3d2b3d=>({'name':_0x3d2b3d[_0x5797d5(0x1db)],'state':_0x3d2b3d['state'],'startedAt':_0x3d2b3d[_0x5797d5(0x235)]?new Date(_0x3d2b3d[_0x5797d5(0x235)][_0x5797d5(0x234)])['toISOString']():null,'updatedAt':_0x3d2b3d['window']?new Date(_0x3d2b3d[_0x5797d5(0x235)][_0x5797d5(0x2a6)])[_0x5797d5(0x230)]():null,'duration_ms':_0x3d2b3d[_0x5797d5(0x235)]?.[_0x5797d5(0x1c5)]||null})),'stats':_0x37fae2};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x2626d0,_0x35d6ff){const _0x3d829e=a51_0x3f1b,_0x3de19b=_0x2626d0();while(!![]){try{const _0x135872=parseInt(_0x3d829e(0x1b1))/0x1+-parseInt(_0x3d829e(0x1ac))/0x2+parseInt(_0x3d829e(0x1ad))/0x3*(parseInt(_0x3d829e(0x1b9))/0x4)+parseInt(_0x3d829e(0x1b4))/0x5+-parseInt(_0x3d829e(0x1b8))/0x6+parseInt(_0x3d829e(0x1ba))/0x7*(parseInt(_0x3d829e(0x1aa))/0x8)+-parseInt(_0x3d829e(0x1b3))/0x9*(parseInt(_0x3d829e(0x1b0))/0xa);if(_0x135872===_0x35d6ff)break;else _0x3de19b['push'](_0x3de19b['shift']());}catch(_0x16e9e8){_0x3de19b['push'](_0x3de19b['shift']());}}}(a51_0x1737,0x79c4f));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 _0x5c9300=a51_0x3f1b,_0x2dce1b=getVersion(),_0x58d5d6=platform(),_0x399077=process[_0x5c9300(0x1a9)][_0x5c9300(0x1af)]('v','');return _0x5c9300(0x1a7)+_0x2dce1b+'\x20('+_0x58d5d6+_0x5c9300(0x1b5)+_0x399077+')';}export function getAuthHeaders(_0x439c25,_0x5d61f1,_0x125e56){const _0x8a3034=a51_0x3f1b,_0x53b0cf=getVersion(),_0x2425a8={'User-Agent':getUserAgent(),'X-TD-Client':_0x8a3034(0x1bb),'X-TD-Client-Version':_0x53b0cf};if(_0x125e56)_0x2425a8[_0x8a3034(0x1b6)]=_0x8a3034(0x1b2)+_0x125e56;else _0x5d61f1&&(_0x2425a8[_0x8a3034(0x1b6)]=_0x8a3034(0x1ae)+_0x5d61f1);return _0x2425a8;}function a51_0x3f1b(_0x8cd5c1,_0x3fe38e){_0x8cd5c1=_0x8cd5c1-0x1a7;const _0x173703=a51_0x1737();let _0x3f1b12=_0x173703[_0x8cd5c1];return _0x3f1b12;}function a51_0x1737(){const _0x43d8d8=['tdx','tdx/','length','version','8psANJD','entries','1923186DAjunY','3837VDSqHy','TD1\x20','replace','10VkiMWV','829142oPNqWC','Bearer\x20','16959420UChtjG','4219035HkKnjk',';\x20node/','Authorization','X-Trino-User','1480662ehdCLX','2932hKeClv','6867427xbfImw'];a51_0x1737=function(){return _0x43d8d8;};return a51_0x1737();}export function toHeaderRecord(_0xc42140){const _0x22004f=a51_0x3f1b,_0x146495={};for(const [_0xbaf6d1,_0x5f2bcb]of Object[_0x22004f(0x1ab)](_0xc42140)){_0x5f2bcb!==undefined&&(_0x146495[_0xbaf6d1]=_0x5f2bcb);}return _0x146495;}export function getTrinoHeaders(_0x36692b,_0x4cdb48,_0x348da6){const _0x1600e0=a51_0x3f1b,_0x11aebb=getAuthHeaders(_0x36692b),_0x111678=toHeaderRecord(_0x11aebb);if(_0x348da6)_0x111678['Authorization']='Bearer\x20'+_0x348da6;else _0x4cdb48&&(_0x111678[_0x1600e0(0x1b7)]=_0x4cdb48);return _0x111678;}export function hasAPIKey(_0x4af956){const _0x36ed97=a51_0x3f1b,_0x50cb78=getAPIKey();return _0x50cb78!==undefined&&_0x50cb78[_0x36ed97(0x1a8)]>0x0;}
1
+ (function(_0x2ee971,_0x15a4ea){const _0x499c5e=a52_0x5795,_0x5d88a9=_0x2ee971();while(!![]){try{const _0x1c2fe1=-parseInt(_0x499c5e(0x134))/0x1*(parseInt(_0x499c5e(0x12c))/0x2)+-parseInt(_0x499c5e(0x133))/0x3*(parseInt(_0x499c5e(0x132))/0x4)+parseInt(_0x499c5e(0x12b))/0x5+-parseInt(_0x499c5e(0x12d))/0x6+-parseInt(_0x499c5e(0x129))/0x7*(parseInt(_0x499c5e(0x131))/0x8)+-parseInt(_0x499c5e(0x125))/0x9+parseInt(_0x499c5e(0x12f))/0xa;if(_0x1c2fe1===_0x15a4ea)break;else _0x5d88a9['push'](_0x5d88a9['shift']());}catch(_0x1450eb){_0x5d88a9['push'](_0x5d88a9['shift']());}}}(a52_0x4d82,0x6a58c));import{platform}from'os';function a52_0x4d82(){const _0x38e455=['entries','88maNJZS','9808ksAuqO','537VCXKQu','307WvBXiZ','tdx','6354180uqXRVW','Bearer\x20',';\x20node/','Authorization','20573cdgimW','TD1\x20','3455485LSWpco','2362awSKcx','1589292gDgpwE','length','15492050zJsgDB'];a52_0x4d82=function(){return _0x38e455;};return a52_0x4d82();}import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x266aa4=a52_0x5795,_0x1ea4ba=getVersion(),_0x36eb3c=platform(),_0x318a7f=process['version']['replace']('v','');return'tdx/'+_0x1ea4ba+'\x20('+_0x36eb3c+_0x266aa4(0x127)+_0x318a7f+')';}function a52_0x5795(_0x33a3e7,_0x421bcd){_0x33a3e7=_0x33a3e7-0x125;const _0x4d8209=a52_0x4d82();let _0x579512=_0x4d8209[_0x33a3e7];return _0x579512;}export function getAuthHeaders(_0x26b551,_0x1f9682,_0x53835c){const _0x336038=a52_0x5795,_0x519fc6=getVersion(),_0x40fa46={'User-Agent':getUserAgent(),'X-TD-Client':_0x336038(0x135),'X-TD-Client-Version':_0x519fc6};if(_0x53835c)_0x40fa46[_0x336038(0x128)]=_0x336038(0x126)+_0x53835c;else _0x1f9682&&(_0x40fa46[_0x336038(0x128)]=_0x336038(0x12a)+_0x1f9682);return _0x40fa46;}export function toHeaderRecord(_0x196480){const _0x4b70c9=a52_0x5795,_0x1793c4={};for(const [_0x12ec0e,_0x383d8b]of Object[_0x4b70c9(0x130)](_0x196480)){_0x383d8b!==undefined&&(_0x1793c4[_0x12ec0e]=_0x383d8b);}return _0x1793c4;}export function getTrinoHeaders(_0x4f8ffb,_0x332535,_0x5cfb5e){const _0x189596=a52_0x5795,_0x1011d7=getAuthHeaders(_0x4f8ffb),_0x2abd11=toHeaderRecord(_0x1011d7);if(_0x5cfb5e)_0x2abd11[_0x189596(0x128)]=_0x189596(0x126)+_0x5cfb5e;else _0x332535&&(_0x2abd11['X-Trino-User']=_0x332535);return _0x2abd11;}export function hasAPIKey(_0x567ca4){const _0x1f05a4=a52_0x5795,_0x1e2147=getAPIKey();return _0x1e2147!==undefined&&_0x1e2147[_0x1f05a4(0x12e)]>0x0;}
@@ -1 +1 @@
1
- function a52_0x227a(_0x412f62,_0x1a0bc8){_0x412f62=_0x412f62-0x1e0;const _0x4796f9=a52_0x4796();let _0x227a2d=_0x4796f9[_0x412f62];return _0x227a2d;}(function(_0x367761,_0x52f158){const _0x1a6a7c=a52_0x227a,_0x2bbb22=_0x367761();while(!![]){try{const _0xa8700f=-parseInt(_0x1a6a7c(0x1ef))/0x1*(parseInt(_0x1a6a7c(0x1fa))/0x2)+-parseInt(_0x1a6a7c(0x21d))/0x3*(-parseInt(_0x1a6a7c(0x1f1))/0x4)+parseInt(_0x1a6a7c(0x1e7))/0x5+-parseInt(_0x1a6a7c(0x1f6))/0x6+-parseInt(_0x1a6a7c(0x21a))/0x7+parseInt(_0x1a6a7c(0x21c))/0x8*(-parseInt(_0x1a6a7c(0x204))/0x9)+parseInt(_0x1a6a7c(0x20e))/0xa;if(_0xa8700f===_0x52f158)break;else _0x2bbb22['push'](_0x2bbb22['shift']());}catch(_0x4faaf0){_0x2bbb22['push'](_0x2bbb22['shift']());}}}(a52_0x4796,0xf3d3f));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 a52_0x14736e from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x286be9){const _0x41d324=a52_0x227a;return _0x286be9[_0x41d324(0x207)]===_0x41d324(0x1f8)||_0x286be9['format']==='jsonl'||_0x286be9['format']===_0x41d324(0x208)||_0x286be9[_0x41d324(0x207)]===_0x41d324(0x1fd)||_0x286be9[_0x41d324(0x1f8)]===!![]||_0x286be9[_0x41d324(0x203)]===!![]||_0x286be9['tsv']===!![]||_0x286be9[_0x41d324(0x1fd)]===!![];}export function parseOutputOptions(_0x2481df){const _0x313d16=a52_0x227a;return{'format':_0x2481df[_0x313d16(0x207)]||_0x313d16(0x1fd),'output':_0x2481df[_0x313d16(0x210)]||'','limit':_0x2481df[_0x313d16(0x218)],'limitStructuredFormats':_0x2481df[_0x313d16(0x216)],'color':_0x2481df['color'],'noColor':_0x2481df[_0x313d16(0x226)]};}function convertSDKResultToQueryResult(_0x161dd8){const _0x2c0134=a52_0x227a,_0x13b703=[];if(_0x161dd8[_0x2c0134(0x1e3)]>0x0){const _0x1e9676=_0x161dd8[0x0];for(const [_0x510877,_0x157874]of Object[_0x2c0134(0x1ed)](_0x1e9676)){let _0xaec9d3=_0x2c0134(0x21f);if(typeof _0x157874===_0x2c0134(0x20a))_0xaec9d3=Number[_0x2c0134(0x1ec)](_0x157874)?_0x2c0134(0x225):_0x2c0134(0x202);else{if(typeof _0x157874===_0x2c0134(0x227))_0xaec9d3=_0x2c0134(0x227);else _0x157874===null&&(_0xaec9d3=_0x2c0134(0x21f));}_0x13b703[_0x2c0134(0x1fc)]({'name':_0x510877,'type':_0xaec9d3});}}return{'queryId':_0x2c0134(0x1e8),'columns':_0x13b703,'data':_0x161dd8,'stats':{'state':_0x2c0134(0x206),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x161dd8[_0x2c0134(0x1e3)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x48faab,_0x3b8956){const _0x31bd88=convertSDKResultToQueryResult(_0x48faab);return formatQueryOutput(_0x31bd88,_0x3b8956);}export async function formatQueryOutput(_0x5d10a9,_0x164851){const _0x4a75a5=a52_0x227a,{format:_0x20fffb,limit:_0x24a806,output:_0x3a8670,color:_0x175d04,noColor:_0x911248,limitStructuredFormats:_0x26eac8}=_0x164851,_0x1a3714=Boolean(_0x3a8670)&&!_0x175d04,_0x47f335={'color':_0x175d04,'noColor':_0x911248||_0x1a3714};if(_0x20fffb===_0x4a75a5(0x1fd)){const _0xc2f2eb=shouldUseLess(_0x20fffb,_0x3a8670);return formatAsTable(_0x5d10a9,_0x24a806,_0xc2f2eb,_0x47f335);}const _0x3beec4=_0x26eac8&&Number[_0x4a75a5(0x1ea)](_0x24a806)&&_0x5d10a9[_0x4a75a5(0x223)][_0x4a75a5(0x1e3)]>_0x24a806?{..._0x5d10a9,'data':_0x5d10a9[_0x4a75a5(0x223)]['slice'](0x0,_0x24a806)}:_0x5d10a9;if(_0x20fffb===_0x4a75a5(0x1f8))return formatAsJSON(_0x3beec4,_0x47f335);else return _0x20fffb===_0x4a75a5(0x203)?formatAsJSONL(_0x3beec4,_0x47f335):formatQueryResult(_0x3beec4,_0x20fffb);}function shouldUseLess(_0x597243,_0x270c4f){const _0x3ccdc9=a52_0x227a;return(_0x597243===_0x3ccdc9(0x1fd)||_0x597243==='list')&&process[_0x3ccdc9(0x21b)][_0x3ccdc9(0x20f)]&&!_0x270c4f;}export function resolveOutputOptions(_0x1f814f){const _0x3db6e4=a52_0x227a,_0x3e2a95=_0x1f814f[_0x3db6e4(0x210)]||'',_0x2b1a9e=resolveOutputFormat(_0x1f814f[_0x3db6e4(0x207)],_0x3e2a95,_0x3db6e4(0x1fd));let _0x2fe5f4=typeof _0x1f814f['limit']===_0x3db6e4(0x20a)?_0x1f814f['limit']:parseInt(_0x1f814f['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x1f814f[_0x3db6e4(0x218)]===undefined&&shouldUseLess(_0x2b1a9e,_0x3e2a95)&&(_0x2fe5f4=Infinity),{'format':_0x2b1a9e,'output':_0x3e2a95,'limit':_0x2fe5f4,'limitStructuredFormats':_0x1f814f[_0x3db6e4(0x216)],'color':_0x1f814f[_0x3db6e4(0x20b)],'noColor':_0x1f814f['noColor']};}export function writeOutput(_0x3fd90e,_0x3eee17,_0x4e1855){const _0x524e30=a52_0x227a;return _0x3eee17?(writeFileSync(_0x3eee17,_0x3fd90e),console[_0x524e30(0x222)](_0x524e30(0x1fb)+_0x3eee17),Promise[_0x524e30(0x1f7)]()):shouldUseLess(_0x4e1855||'','')?new Promise(_0xc88450=>{const _0x17d03e=_0x524e30,_0x484df0=spawn(_0x17d03e(0x1e5),[_0x17d03e(0x214)],{'stdio':[_0x17d03e(0x205),_0x17d03e(0x229),_0x17d03e(0x229)]});let _0x3b0c3c=![];_0x484df0['on'](_0x17d03e(0x222),()=>{const _0x5ea942=_0x17d03e;!_0x3b0c3c&&(_0x3b0c3c=!![],console[_0x5ea942(0x1e1)](_0x3fd90e),_0xc88450());}),_0x484df0['on']('close',()=>{!_0x3b0c3c&&(_0x3b0c3c=!![],_0xc88450());}),_0x484df0['on'](_0x17d03e(0x1eb),()=>{const _0x27c322=_0x17d03e;!_0x3b0c3c&&_0x484df0[_0x27c322(0x200)]&&(_0x484df0[_0x27c322(0x200)]['on'](_0x27c322(0x222),()=>{}),_0x484df0[_0x27c322(0x200)][_0x27c322(0x1e6)](_0x3fd90e),_0x484df0[_0x27c322(0x200)]['end']());}),!_0x484df0[_0x17d03e(0x200)]&&(!_0x3b0c3c&&(_0x3b0c3c=!![],console[_0x17d03e(0x1e1)](_0x3fd90e),_0xc88450()));}):(console['log'](_0x3fd90e),Promise['resolve']());}export async function handleSDKOutput(_0x1876b2,_0x5691d6){const _0x365cd4=a52_0x227a,_0xab3f94=resolveOutputOptions(_0x5691d6),_0x51e975=await formatSDKOutput(_0x1876b2,_0xab3f94);await writeOutput(_0x51e975,_0xab3f94[_0x365cd4(0x210)]||undefined,_0xab3f94['format']);}export async function handleQueryOutput(_0x57c974,_0x320cc4){const _0x404f1d=a52_0x227a,_0x3ded58=resolveOutputOptions(_0x320cc4),_0x5899d2=await formatQueryOutput(_0x57c974,_0x3ded58);await writeOutput(_0x5899d2,_0x3ded58[_0x404f1d(0x210)]||undefined,_0x3ded58[_0x404f1d(0x207)]);}async function formatSingleObject(_0x276ff0,_0x2eee04){const _0x1fb979=a52_0x227a,{format:_0x3421c9,color:_0x49b5e2,noColor:_0x506dee}=_0x2eee04,_0x29775b={'color':_0x49b5e2,'noColor':_0x506dee};if(_0x3421c9===_0x1fb979(0x1f8)){if(shouldUseColor(_0x29775b))return colorizeJSON(_0x276ff0,_0x29775b);return JSON[_0x1fb979(0x20d)](_0x276ff0,null,0x2);}else{if(_0x3421c9==='jsonl'){if(shouldUseColor(_0x29775b))return colorizeJSONCompact(_0x276ff0,_0x29775b);return JSON['stringify'](_0x276ff0);}else{if(_0x3421c9===_0x1fb979(0x208))return Object[_0x1fb979(0x1ed)](_0x276ff0)[_0x1fb979(0x220)](([_0x1dcd77,_0xfad2b])=>_0x1dcd77+'\x09'+_0xfad2b)[_0x1fb979(0x1f4)]('\x0a');else{const _0x3d1d61=Object[_0x1fb979(0x1ed)](_0x276ff0);if(_0x3d1d61[_0x1fb979(0x1e3)]===0x0)return _0x1fb979(0x1f9);const _0x451df8=_0x276ff0[_0x1fb979(0x1e2)],_0x62f82e=_0x276ff0[_0x1fb979(0x1f2)],_0x1b0ca1=_0x276ff0[_0x1fb979(0x221)],_0x4726d3=_0x276ff0[_0x1fb979(0x228)],_0x54d22d=_0x62f82e?typeof _0x62f82e===_0x1fb979(0x1f5)?_0x62f82e:JSON[_0x1fb979(0x20d)](_0x62f82e,null,0x2):undefined,_0x42a24d=_0x1b0ca1&&Object[_0x1fb979(0x219)](_0x1b0ca1)['length']>0x0?JSON[_0x1fb979(0x20d)](_0x1b0ca1,null,0x2):undefined,_0x587867=_0x4726d3&&Object[_0x1fb979(0x219)](_0x4726d3)['length']>0x0?JSON[_0x1fb979(0x20d)](_0x4726d3,null,0x2):undefined,_0x24cb6d=_0x3d1d61[_0x1fb979(0x1e0)](([_0x22ea3a])=>_0x22ea3a!==_0x1fb979(0x1e2)&&_0x22ea3a!==_0x1fb979(0x1f2)&&_0x22ea3a!==_0x1fb979(0x221)&&_0x22ea3a!==_0x1fb979(0x228)),_0x535259=Math[_0x1fb979(0x212)](..._0x24cb6d[_0x1fb979(0x220)](([_0x14d3e7])=>_0x14d3e7[_0x1fb979(0x1e3)])),_0x51941c=Math[_0x1fb979(0x212)](..._0x24cb6d[_0x1fb979(0x220)](([,_0x36b69f])=>{const _0x2f9267=_0x1fb979;try{const _0x33be4b=_0x36b69f===null||_0x36b69f===undefined?'':typeof _0x36b69f===_0x2f9267(0x1f3)?JSON[_0x2f9267(0x20d)](_0x36b69f):String(_0x36b69f),_0x17de30=_0x33be4b['split']('\x0a');return Math['max'](..._0x17de30['map'](_0x456b84=>_0x456b84[_0x2f9267(0x1e3)]),0x0);}catch{return 0x0;}}),0x14),_0x283926=[];_0x283926[_0x1fb979(0x1fc)](colorBorder('┌─'+'─'['repeat'](_0x535259)+'─┬─'+'─'[_0x1fb979(0x1e9)](_0x51941c)+'─┐',_0x29775b)),_0x24cb6d[_0x1fb979(0x211)](([_0x5a116d,_0x1dc4b6])=>{const _0x605e63=_0x1fb979;let _0x52c4e4;try{_0x52c4e4=_0x1dc4b6===null||_0x1dc4b6===undefined?'':typeof _0x1dc4b6===_0x605e63(0x1f3)?JSON[_0x605e63(0x20d)](_0x1dc4b6):String(_0x1dc4b6);}catch{_0x52c4e4='[Object]';}const _0x575f6b=_0x5a116d['padEnd'](_0x535259),_0x2e6f78=_0x52c4e4[_0x605e63(0x224)]('\x0a');_0x2e6f78[_0x605e63(0x211)]((_0x1970e2,_0x16bfb7)=>{const _0xfad536=_0x605e63,_0x398247=colorBorder('│',_0x29775b);_0x16bfb7===0x0?_0x283926[_0xfad536(0x1fc)](_0x398247+'\x20'+_0x575f6b+'\x20'+_0x398247+'\x20'+_0x1970e2[_0xfad536(0x201)](_0x51941c)+'\x20'+_0x398247):_0x283926[_0xfad536(0x1fc)](_0x398247+'\x20'+'\x20'[_0xfad536(0x1e9)](_0x535259)+'\x20'+_0x398247+'\x20'+_0x1970e2[_0xfad536(0x201)](_0x51941c)+'\x20'+_0x398247);});}),_0x283926[_0x1fb979(0x1fc)](colorBorder('└─'+'─'[_0x1fb979(0x1e9)](_0x535259)+_0x1fb979(0x1f0)+'─'[_0x1fb979(0x1e9)](_0x51941c)+'─┘',_0x29775b));_0x54d22d&&(_0x283926[_0x1fb979(0x1fc)](''),_0x283926[_0x1fb979(0x1fc)](String(a52_0x14736e[_0x1fb979(0x213)][_0x1fb979(0x217)](_0x1fb979(0x215)))),_0x283926[_0x1fb979(0x1fc)](_0x54d22d));_0x42a24d&&(_0x283926['push'](''),_0x283926[_0x1fb979(0x1fc)](String(a52_0x14736e['blue']['bold']('[params]'))),_0x283926[_0x1fb979(0x1fc)](_0x42a24d));_0x587867&&(_0x283926[_0x1fb979(0x1fc)](''),_0x283926[_0x1fb979(0x1fc)](String(a52_0x14736e[_0x1fb979(0x20c)][_0x1fb979(0x217)](_0x1fb979(0x22a)))),_0x283926[_0x1fb979(0x1fc)](_0x587867));if(_0x451df8){if(_0x451df8[_0x1fb979(0x1ff)]){_0x283926[_0x1fb979(0x1fc)](''),_0x283926['push'](String(a52_0x14736e[_0x1fb979(0x1fe)][_0x1fb979(0x217)](_0x1fb979(0x1e4))));const _0x29faf1=_0x451df8[_0x1fb979(0x1ff)]['split']('\x0a');_0x29faf1[_0x1fb979(0x211)](_0x235efd=>{const _0x3a2d77=_0x1fb979;_0x235efd[_0x3a2d77(0x21e)]()&&_0x283926[_0x3a2d77(0x1fc)](_0x235efd);});}if(_0x451df8[_0x1fb979(0x209)]){_0x283926['push'](''),_0x283926['push'](String(a52_0x14736e[_0x1fb979(0x1ee)][_0x1fb979(0x217)]('[logs]')));const _0xabf7d9=_0x451df8['cmdout']['split']('\x0a');_0xabf7d9[_0x1fb979(0x211)](_0x568fed=>{const _0x34d724=_0x1fb979;_0x568fed[_0x34d724(0x21e)]()&&_0x283926[_0x34d724(0x1fc)](_0x568fed);});}}return _0x283926[_0x1fb979(0x1f4)]('\x0a');}}}}function a52_0x4796(){const _0x3a91b5=['debug','length','[error]','less','write','5641020WzEvwz','sdk-result','repeat','isFinite','spawn','isInteger','entries','cyan','251ZMsdjJ','─┴─','56nIdxsE','query','object','join','string','5966700UQrYEQ','resolve','json','No\x20data','770TpzVMH','Results\x20saved\x20to\x20','push','table','red','stderr','stdin','padEnd','double','jsonl','63GdKXHR','pipe','FINISHED','format','tsv','cmdout','number','color','magenta','stringify','11052520OENXPV','isTTY','output','forEach','max','yellow','-FXRSn','[query]','limitStructuredFormats','bold','limit','keys','11595983VMUAOk','stdout','131608kPlapv','348873iHYRpH','trim','varchar','map','params','error','data','split','bigint','noColor','boolean','rule','inherit','[rule]','filter','log'];a52_0x4796=function(){return _0x3a91b5;};return a52_0x4796();}export async function handleSingleObjectOutput(_0x40cf8c,_0x3c393b){const _0x49b679=a52_0x227a;if(_0x3c393b['format']===_0x49b679(0x1fd)){await handleSDKOutput([_0x40cf8c],_0x3c393b);return;}const _0x2418b5=resolveOutputOptions(_0x3c393b),_0x57f33d=await formatSingleObject(_0x40cf8c,_0x2418b5);await writeOutput(_0x57f33d,_0x2418b5[_0x49b679(0x210)]||undefined,_0x2418b5[_0x49b679(0x207)]);}
1
+ (function(_0x3af5a2,_0x4107f0){const _0x5342fc=a53_0x42f9,_0xe3757e=_0x3af5a2();while(!![]){try{const _0x3127c2=-parseInt(_0x5342fc(0x1e1))/0x1+-parseInt(_0x5342fc(0x1e3))/0x2*(-parseInt(_0x5342fc(0x1f1))/0x3)+-parseInt(_0x5342fc(0x1f3))/0x4+parseInt(_0x5342fc(0x1d4))/0x5+-parseInt(_0x5342fc(0x21a))/0x6+parseInt(_0x5342fc(0x207))/0x7*(parseInt(_0x5342fc(0x20e))/0x8)+parseInt(_0x5342fc(0x1df))/0x9;if(_0x3127c2===_0x4107f0)break;else _0xe3757e['push'](_0xe3757e['shift']());}catch(_0x28dda9){_0xe3757e['push'](_0xe3757e['shift']());}}}(a53_0x4a1f,0x65ac1));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 a53_0x1d096b from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x59291f){const _0x43e48d=a53_0x42f9;return _0x59291f[_0x43e48d(0x1ee)]===_0x43e48d(0x1e2)||_0x59291f['format']===_0x43e48d(0x203)||_0x59291f[_0x43e48d(0x1ee)]===_0x43e48d(0x202)||_0x59291f['format']===_0x43e48d(0x1e8)||_0x59291f[_0x43e48d(0x1e2)]===!![]||_0x59291f[_0x43e48d(0x203)]===!![]||_0x59291f[_0x43e48d(0x202)]===!![]||_0x59291f[_0x43e48d(0x1e8)]===!![];}export function parseOutputOptions(_0x25298c){const _0xb4b0ff=a53_0x42f9;return{'format':_0x25298c[_0xb4b0ff(0x1ee)]||'table','output':_0x25298c[_0xb4b0ff(0x211)]||'','limit':_0x25298c[_0xb4b0ff(0x217)],'limitStructuredFormats':_0x25298c['limitStructuredFormats'],'color':_0x25298c[_0xb4b0ff(0x1e0)],'noColor':_0x25298c[_0xb4b0ff(0x1db)]};}function convertSDKResultToQueryResult(_0x421b2d){const _0xa0a1ae=a53_0x42f9,_0x4d1f5e=[];if(_0x421b2d[_0xa0a1ae(0x1f4)]>0x0){const _0x34c5f7=_0x421b2d[0x0];for(const [_0x5e243,_0x4b64bf]of Object[_0xa0a1ae(0x1fb)](_0x34c5f7)){let _0x1fbccf=_0xa0a1ae(0x1dc);if(typeof _0x4b64bf===_0xa0a1ae(0x1fc))_0x1fbccf=Number[_0xa0a1ae(0x209)](_0x4b64bf)?_0xa0a1ae(0x1d7):_0xa0a1ae(0x1ef);else{if(typeof _0x4b64bf===_0xa0a1ae(0x20b))_0x1fbccf='boolean';else _0x4b64bf===null&&(_0x1fbccf=_0xa0a1ae(0x1dc));}_0x4d1f5e[_0xa0a1ae(0x20a)]({'name':_0x5e243,'type':_0x1fbccf});}}return{'queryId':_0xa0a1ae(0x206),'columns':_0x4d1f5e,'data':_0x421b2d,'stats':{'state':_0xa0a1ae(0x210),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x421b2d[_0xa0a1ae(0x1f4)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x24f325,_0x49b490){const _0x823292=convertSDKResultToQueryResult(_0x24f325);return formatQueryOutput(_0x823292,_0x49b490);}export async function formatQueryOutput(_0xf917bd,_0x141a19){const _0x311c83=a53_0x42f9,{format:_0x104ffd,limit:_0x4cacc3,output:_0x4206e5,color:_0x23a322,noColor:_0x449b04,limitStructuredFormats:_0x2c945b}=_0x141a19,_0x5909c5=Boolean(_0x4206e5)&&!_0x23a322,_0x51f1df={'color':_0x23a322,'noColor':_0x449b04||_0x5909c5};if(_0x104ffd===_0x311c83(0x1e8)){const _0x2c642b=shouldUseLess(_0x104ffd,_0x4206e5);return formatAsTable(_0xf917bd,_0x4cacc3,_0x2c642b,_0x51f1df);}const _0x2b8eb8=_0x2c945b&&Number['isFinite'](_0x4cacc3)&&_0xf917bd['data'][_0x311c83(0x1f4)]>_0x4cacc3?{..._0xf917bd,'data':_0xf917bd['data'][_0x311c83(0x20f)](0x0,_0x4cacc3)}:_0xf917bd;if(_0x104ffd===_0x311c83(0x1e2))return formatAsJSON(_0x2b8eb8,_0x51f1df);else return _0x104ffd==='jsonl'?formatAsJSONL(_0x2b8eb8,_0x51f1df):formatQueryResult(_0x2b8eb8,_0x104ffd);}function a53_0x42f9(_0x131c87,_0x7f51fd){_0x131c87=_0x131c87-0x1d4;const _0x4a1f24=a53_0x4a1f();let _0x42f99f=_0x4a1f24[_0x131c87];return _0x42f99f;}function shouldUseLess(_0x3df2e6,_0x139f35){const _0x24dd27=a53_0x42f9;return(_0x3df2e6==='table'||_0x3df2e6===_0x24dd27(0x1da))&&process['stdout']['isTTY']&&!_0x139f35;}export function resolveOutputOptions(_0x40726e){const _0xccb4f9=a53_0x42f9,_0x22c0fb=_0x40726e[_0xccb4f9(0x211)]||'',_0x5777f3=resolveOutputFormat(_0x40726e[_0xccb4f9(0x1ee)],_0x22c0fb,_0xccb4f9(0x1e8));let _0x52db82=typeof _0x40726e[_0xccb4f9(0x217)]===_0xccb4f9(0x1fc)?_0x40726e[_0xccb4f9(0x217)]:parseInt(_0x40726e[_0xccb4f9(0x217)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x40726e[_0xccb4f9(0x217)]===undefined&&shouldUseLess(_0x5777f3,_0x22c0fb)&&(_0x52db82=Infinity),{'format':_0x5777f3,'output':_0x22c0fb,'limit':_0x52db82,'limitStructuredFormats':_0x40726e[_0xccb4f9(0x208)],'color':_0x40726e[_0xccb4f9(0x1e0)],'noColor':_0x40726e[_0xccb4f9(0x1db)]};}export function writeOutput(_0x5315e2,_0x242870,_0x5dcb6b){const _0x530b29=a53_0x42f9;return _0x242870?(writeFileSync(_0x242870,_0x5315e2),console[_0x530b29(0x1ed)](_0x530b29(0x1f0)+_0x242870),Promise[_0x530b29(0x1e7)]()):shouldUseLess(_0x5dcb6b||'','')?new Promise(_0x5608ce=>{const _0x4d5636=_0x530b29,_0x4cdee4=spawn(_0x4d5636(0x214),[_0x4d5636(0x1e9)],{'stdio':[_0x4d5636(0x200),_0x4d5636(0x20c),'inherit']});let _0x15fca7=![];_0x4cdee4['on'](_0x4d5636(0x1ed),()=>{const _0x6430a6=_0x4d5636;!_0x15fca7&&(_0x15fca7=!![],console[_0x6430a6(0x1fd)](_0x5315e2),_0x5608ce());}),_0x4cdee4['on'](_0x4d5636(0x1fa),()=>{!_0x15fca7&&(_0x15fca7=!![],_0x5608ce());}),_0x4cdee4['on'](_0x4d5636(0x1f5),()=>{const _0x71aebf=_0x4d5636;!_0x15fca7&&_0x4cdee4[_0x71aebf(0x201)]&&(_0x4cdee4[_0x71aebf(0x201)]['on']('error',()=>{}),_0x4cdee4[_0x71aebf(0x201)]['write'](_0x5315e2),_0x4cdee4[_0x71aebf(0x201)][_0x71aebf(0x213)]());}),!_0x4cdee4['stdin']&&(!_0x15fca7&&(_0x15fca7=!![],console[_0x4d5636(0x1fd)](_0x5315e2),_0x5608ce()));}):(console[_0x530b29(0x1fd)](_0x5315e2),Promise[_0x530b29(0x1e7)]());}export async function handleSDKOutput(_0x27f18e,_0x5c3395){const _0x3b5a0a=a53_0x42f9,_0x143daf=resolveOutputOptions(_0x5c3395),_0x57fa03=await formatSDKOutput(_0x27f18e,_0x143daf);await writeOutput(_0x57fa03,_0x143daf[_0x3b5a0a(0x211)]||undefined,_0x143daf[_0x3b5a0a(0x1ee)]);}export async function handleQueryOutput(_0x3f503b,_0x17c4fb){const _0x3b2758=resolveOutputOptions(_0x17c4fb),_0x15345e=await formatQueryOutput(_0x3f503b,_0x3b2758);await writeOutput(_0x15345e,_0x3b2758['output']||undefined,_0x3b2758['format']);}async function formatSingleObject(_0x5a9cb4,_0x268978){const _0x196af2=a53_0x42f9,{format:_0x5d2569,color:_0x4fc953,noColor:_0x250333}=_0x268978,_0x55001f={'color':_0x4fc953,'noColor':_0x250333};if(_0x5d2569==='json'){if(shouldUseColor(_0x55001f))return colorizeJSON(_0x5a9cb4,_0x55001f);return JSON[_0x196af2(0x215)](_0x5a9cb4,null,0x2);}else{if(_0x5d2569===_0x196af2(0x203)){if(shouldUseColor(_0x55001f))return colorizeJSONCompact(_0x5a9cb4,_0x55001f);return JSON[_0x196af2(0x215)](_0x5a9cb4);}else{if(_0x5d2569===_0x196af2(0x202))return Object[_0x196af2(0x1fb)](_0x5a9cb4)[_0x196af2(0x204)](([_0x547873,_0x59b3f5])=>_0x547873+'\x09'+_0x59b3f5)['join']('\x0a');else{const _0x2e8c55=Object['entries'](_0x5a9cb4);if(_0x2e8c55[_0x196af2(0x1f4)]===0x0)return _0x196af2(0x1f9);const _0x12cc9c=_0x5a9cb4[_0x196af2(0x1e5)],_0x4b0e59=_0x5a9cb4[_0x196af2(0x218)],_0x992aad=_0x5a9cb4[_0x196af2(0x1d8)],_0x188cb8=_0x5a9cb4['rule'],_0x426776=_0x4b0e59?typeof _0x4b0e59==='string'?_0x4b0e59:JSON[_0x196af2(0x215)](_0x4b0e59,null,0x2):undefined,_0x57f4bd=_0x992aad&&Object['keys'](_0x992aad)[_0x196af2(0x1f4)]>0x0?JSON[_0x196af2(0x215)](_0x992aad,null,0x2):undefined,_0x5ac716=_0x188cb8&&Object[_0x196af2(0x1d9)](_0x188cb8)[_0x196af2(0x1f4)]>0x0?JSON[_0x196af2(0x215)](_0x188cb8,null,0x2):undefined,_0x457499=_0x2e8c55['filter'](([_0x48bba6])=>_0x48bba6!==_0x196af2(0x1e5)&&_0x48bba6!==_0x196af2(0x218)&&_0x48bba6!=='params'&&_0x48bba6!==_0x196af2(0x205)),_0x434788=Math[_0x196af2(0x1fe)](..._0x457499[_0x196af2(0x204)](([_0x20d7d0])=>_0x20d7d0['length'])),_0x50e8c1=Math[_0x196af2(0x1fe)](..._0x457499[_0x196af2(0x204)](([,_0x52aa6a])=>{const _0x26c008=_0x196af2;try{const _0x448309=_0x52aa6a===null||_0x52aa6a===undefined?'':typeof _0x52aa6a===_0x26c008(0x1dd)?JSON['stringify'](_0x52aa6a):String(_0x52aa6a),_0x44b90a=_0x448309[_0x26c008(0x1f6)]('\x0a');return Math[_0x26c008(0x1fe)](..._0x44b90a[_0x26c008(0x204)](_0x158145=>_0x158145[_0x26c008(0x1f4)]),0x0);}catch{return 0x0;}}),0x14),_0x4c8ba9=[];_0x4c8ba9[_0x196af2(0x20a)](colorBorder('┌─'+'─'[_0x196af2(0x1eb)](_0x434788)+_0x196af2(0x1ff)+'─'[_0x196af2(0x1eb)](_0x50e8c1)+'─┐',_0x55001f)),_0x457499[_0x196af2(0x1f8)](([_0x1079ce,_0x53a2c5])=>{const _0x188966=_0x196af2;let _0x5cb8c5;try{_0x5cb8c5=_0x53a2c5===null||_0x53a2c5===undefined?'':typeof _0x53a2c5===_0x188966(0x1dd)?JSON[_0x188966(0x215)](_0x53a2c5):String(_0x53a2c5);}catch{_0x5cb8c5='[Object]';}const _0x244a4b=_0x1079ce['padEnd'](_0x434788),_0x333f06=_0x5cb8c5[_0x188966(0x1f6)]('\x0a');_0x333f06[_0x188966(0x1f8)]((_0x22cd96,_0x3fcab7)=>{const _0x4096bb=_0x188966,_0x2ccaca=colorBorder('│',_0x55001f);_0x3fcab7===0x0?_0x4c8ba9[_0x4096bb(0x20a)](_0x2ccaca+'\x20'+_0x244a4b+'\x20'+_0x2ccaca+'\x20'+_0x22cd96['padEnd'](_0x50e8c1)+'\x20'+_0x2ccaca):_0x4c8ba9[_0x4096bb(0x20a)](_0x2ccaca+'\x20'+'\x20'[_0x4096bb(0x1eb)](_0x434788)+'\x20'+_0x2ccaca+'\x20'+_0x22cd96['padEnd'](_0x50e8c1)+'\x20'+_0x2ccaca);});}),_0x4c8ba9[_0x196af2(0x20a)](colorBorder('└─'+'─'[_0x196af2(0x1eb)](_0x434788)+_0x196af2(0x219)+'─'['repeat'](_0x50e8c1)+'─┘',_0x55001f));_0x426776&&(_0x4c8ba9[_0x196af2(0x20a)](''),_0x4c8ba9[_0x196af2(0x20a)](String(a53_0x1d096b['yellow'][_0x196af2(0x1f7)](_0x196af2(0x20d)))),_0x4c8ba9[_0x196af2(0x20a)](_0x426776));_0x57f4bd&&(_0x4c8ba9[_0x196af2(0x20a)](''),_0x4c8ba9['push'](String(a53_0x1d096b[_0x196af2(0x216)][_0x196af2(0x1f7)]('[params]'))),_0x4c8ba9[_0x196af2(0x20a)](_0x57f4bd));_0x5ac716&&(_0x4c8ba9[_0x196af2(0x20a)](''),_0x4c8ba9[_0x196af2(0x20a)](String(a53_0x1d096b[_0x196af2(0x1ec)][_0x196af2(0x1f7)](_0x196af2(0x1ea)))),_0x4c8ba9[_0x196af2(0x20a)](_0x5ac716));if(_0x12cc9c){if(_0x12cc9c[_0x196af2(0x1de)]){_0x4c8ba9[_0x196af2(0x20a)](''),_0x4c8ba9[_0x196af2(0x20a)](String(a53_0x1d096b['red'][_0x196af2(0x1f7)](_0x196af2(0x1d6))));const _0x3f5329=_0x12cc9c[_0x196af2(0x1de)][_0x196af2(0x1f6)]('\x0a');_0x3f5329[_0x196af2(0x1f8)](_0x4293bc=>{const _0x3bf971=_0x196af2;_0x4293bc[_0x3bf971(0x212)]()&&_0x4c8ba9[_0x3bf971(0x20a)](_0x4293bc);});}if(_0x12cc9c['cmdout']){_0x4c8ba9['push'](''),_0x4c8ba9[_0x196af2(0x20a)](String(a53_0x1d096b[_0x196af2(0x1e6)][_0x196af2(0x1f7)](_0x196af2(0x1e4))));const _0xa0ef66=_0x12cc9c[_0x196af2(0x1d5)][_0x196af2(0x1f6)]('\x0a');_0xa0ef66[_0x196af2(0x1f8)](_0x40873b=>{const _0x117891=_0x196af2;_0x40873b['trim']()&&_0x4c8ba9[_0x117891(0x20a)](_0x40873b);});}}return _0x4c8ba9[_0x196af2(0x1f2)]('\x0a');}}}}function a53_0x4a1f(){const _0x17c1fb=['No\x20data','close','entries','number','log','max','─┬─','pipe','stdin','tsv','jsonl','map','rule','sdk-result','7mprjXM','limitStructuredFormats','isInteger','push','boolean','inherit','[query]','2887928rkjoxj','slice','FINISHED','output','trim','end','less','stringify','blue','limit','query','─┴─','1512108jSakEk','2295130DEHyuU','cmdout','[error]','bigint','params','keys','list','noColor','varchar','object','stderr','5452668KcQozI','color','508692AGfjaK','json','54106NcBzGg','[logs]','debug','cyan','resolve','table','-FXRSn','[rule]','repeat','magenta','error','format','double','Results\x20saved\x20to\x20','48yHEACh','join','2726232YgTrKa','length','spawn','split','bold','forEach'];a53_0x4a1f=function(){return _0x17c1fb;};return a53_0x4a1f();}export async function handleSingleObjectOutput(_0x5b1ff1,_0x12a51b){const _0x316d3c=a53_0x42f9;if(_0x12a51b[_0x316d3c(0x1ee)]==='table'){await handleSDKOutput([_0x5b1ff1],_0x12a51b);return;}const _0x495d17=resolveOutputOptions(_0x12a51b),_0x283fcd=await formatSingleObject(_0x5b1ff1,_0x495d17);await writeOutput(_0x283fcd,_0x495d17[_0x316d3c(0x211)]||undefined,_0x495d17['format']);}