@treasuredata/tdx 0.28.1 → 0.28.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/status-command.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/unset-command.js +1 -1
  46. package/dist/commands/use-command.js +1 -1
  47. package/dist/commands/user-command.js +1 -1
  48. package/dist/commands/workflow-command.js +1 -1
  49. package/dist/core/auth.js +1 -1
  50. package/dist/core/command-output.js +1 -1
  51. package/dist/core/config.js +1 -1
  52. package/dist/core/connection-cache.js +1 -1
  53. package/dist/core/constants.js +1 -1
  54. package/dist/core/credential-cache.js +1 -1
  55. package/dist/core/global-context.js +1 -1
  56. package/dist/core/keychain.js +1 -1
  57. package/dist/core/profile.js +1 -1
  58. package/dist/core/project-config.js +1 -1
  59. package/dist/core/session.js +1 -1
  60. package/dist/core/user-cache.js +1 -1
  61. package/dist/core/version.js +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/mcp/server.js +1 -1
  64. package/dist/mcp/tools/index.js +1 -1
  65. package/dist/mcp/tools/tdx-run.js +1 -1
  66. package/dist/mcp/tools/tdx-search.js +1 -1
  67. package/dist/mcp/utils.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js +1 -1
  69. package/dist/proxy/passthrough-server.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/agent/test/evaluator.js +1 -1
  75. package/dist/sdk/agent/test/executor.js +1 -1
  76. package/dist/sdk/agent/test/index.js +1 -1
  77. package/dist/sdk/agent/test/output.js +1 -1
  78. package/dist/sdk/agent/test/parser.js +1 -1
  79. package/dist/sdk/agent/tool-target-registry.js +1 -1
  80. package/dist/sdk/api.js +1 -1
  81. package/dist/sdk/client/cdp-api-client.js +1 -1
  82. package/dist/sdk/client/delivery-api-client.js +1 -1
  83. package/dist/sdk/client/endpoints.js +1 -1
  84. package/dist/sdk/client/engage-api-client.js +1 -1
  85. package/dist/sdk/client/http-client.js +1 -1
  86. package/dist/sdk/client/llm-api-client.js +1 -1
  87. package/dist/sdk/client/rate-limiter.js +1 -1
  88. package/dist/sdk/client/td-api-client.js +1 -1
  89. package/dist/sdk/client/trino-api-client.js +1 -1
  90. package/dist/sdk/client/workflow-client.js +1 -1
  91. package/dist/sdk/connection-validator.js +1 -1
  92. package/dist/sdk/connection.js +1 -1
  93. package/dist/sdk/delivery.js +1 -1
  94. package/dist/sdk/engage/campaign-pull.js +1 -1
  95. package/dist/sdk/engage/campaign-push.js +1 -1
  96. package/dist/sdk/engage/campaign-validator.js +1 -1
  97. package/dist/sdk/engage/campaign-yaml.js +1 -1
  98. package/dist/sdk/engage/types/campaign-def.js +1 -1
  99. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  100. package/dist/sdk/engage.js +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/index.js +1 -1
  103. package/dist/sdk/io/index.js +1 -1
  104. package/dist/sdk/io/node-filesystem.js +1 -1
  105. package/dist/sdk/job.js +1 -1
  106. package/dist/sdk/journey.js +1 -1
  107. package/dist/sdk/llm/chat-cache.js +1 -1
  108. package/dist/sdk/llm/index.js +1 -1
  109. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  110. package/dist/sdk/llm/model-factors.js +1 -1
  111. package/dist/sdk/personalization.js +1 -1
  112. package/dist/sdk/query/index.js +1 -1
  113. package/dist/sdk/query/sql-parser.js +1 -1
  114. package/dist/sdk/realtime.js +1 -1
  115. package/dist/sdk/schedule.js +1 -1
  116. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  117. package/dist/sdk/segment/fields-display.js +1 -1
  118. package/dist/sdk/segment/file-discovery.js +1 -1
  119. package/dist/sdk/segment/journey-utils.js +1 -1
  120. package/dist/sdk/segment/journey-validator.d.ts.map +1 -1
  121. package/dist/sdk/segment/journey-validator.js +1 -1
  122. package/dist/sdk/segment/journey-validator.js.map +1 -1
  123. package/dist/sdk/segment/journey-yaml.js +1 -1
  124. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  125. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  126. package/dist/sdk/segment/pull-workflow.js +1 -1
  127. package/dist/sdk/segment/push-recovery.js +1 -1
  128. package/dist/sdk/segment/push-workflow.js +1 -1
  129. package/dist/sdk/segment/resolution-context.js +1 -1
  130. package/dist/sdk/segment/segment-path-parser.js +1 -1
  131. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  132. package/dist/sdk/segment/target-resolution.js +1 -1
  133. package/dist/sdk/segment/tdx-config.js +1 -1
  134. package/dist/sdk/segment/validate-files.js +1 -1
  135. package/dist/sdk/segment/yaml-validator.js +1 -1
  136. package/dist/sdk/segment.js +1 -1
  137. package/dist/sdk/types/index.js +1 -1
  138. package/dist/sdk/types/progress.js +1 -1
  139. package/dist/sdk/user.js +1 -1
  140. package/dist/sdk/util/format-detector.js +1 -1
  141. package/dist/sdk/util/formatters.js +1 -1
  142. package/dist/sdk/util/index.js +1 -1
  143. package/dist/sdk/util/tree-formatter.js +1 -1
  144. package/dist/sdk/workflow/archive-validation.js +1 -1
  145. package/dist/sdk/workflow/clone-workflow.js +1 -1
  146. package/dist/sdk/workflow/index.js +1 -1
  147. package/dist/sdk/workflow/pull-workflow.js +1 -1
  148. package/dist/sdk/workflow/push-workflow.js +1 -1
  149. package/dist/sdk/workflow/tdx-config.js +1 -1
  150. package/dist/sdk/workflow/workflow-utils.js +1 -1
  151. package/dist/test-utils/command-runner.js +1 -1
  152. package/dist/test-utils/factories.js +1 -1
  153. package/dist/test-utils/fixtures.js +1 -1
  154. package/dist/test-utils/http-mock.js +1 -1
  155. package/dist/test-utils/index.js +1 -1
  156. package/dist/utils/async.js +1 -1
  157. package/dist/utils/colors.js +1 -1
  158. package/dist/utils/diff.js +1 -1
  159. package/dist/utils/file-permissions.js +1 -1
  160. package/dist/utils/global-cache.js +1 -1
  161. package/dist/utils/json-loader.js +1 -1
  162. package/dist/utils/local-cache.js +1 -1
  163. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  164. package/dist/utils/logger/formatters/index.js +1 -1
  165. package/dist/utils/logger/handlers/console-handler.js +1 -1
  166. package/dist/utils/logger/handlers/file-handler.js +1 -1
  167. package/dist/utils/logger/handlers/index.js +1 -1
  168. package/dist/utils/logger/handlers/null-handler.js +1 -1
  169. package/dist/utils/logger/index.js +1 -1
  170. package/dist/utils/logger/logger.js +1 -1
  171. package/dist/utils/logger/types.js +1 -1
  172. package/dist/utils/option-validation.js +1 -1
  173. package/dist/utils/process.js +1 -1
  174. package/dist/utils/prompt.js +1 -1
  175. package/dist/utils/spinner.js +1 -1
  176. package/dist/utils/sse-parser.js +1 -1
  177. package/dist/utils/string-utils.js +1 -1
  178. package/dist/utils/table-ref-parser.js +1 -1
  179. package/dist/utils/tdx-logger.js +1 -1
  180. package/dist/utils/version-check.js +1 -1
  181. package/package.json +1 -1
@@ -1 +1 @@
1
- const a46_0x591dc6=a46_0x2532;(function(_0x5bfb5e,_0x325086){const _0x66e9b3=a46_0x2532,_0x4e3ab1=_0x5bfb5e();while(!![]){try{const _0x156a9e=-parseInt(_0x66e9b3(0x20a))/0x1*(-parseInt(_0x66e9b3(0x13b))/0x2)+parseInt(_0x66e9b3(0x1a8))/0x3*(parseInt(_0x66e9b3(0x184))/0x4)+parseInt(_0x66e9b3(0xc1))/0x5+parseInt(_0x66e9b3(0x1bb))/0x6+parseInt(_0x66e9b3(0x183))/0x7+parseInt(_0x66e9b3(0xe4))/0x8*(parseInt(_0x66e9b3(0x1d2))/0x9)+-parseInt(_0x66e9b3(0x1a3))/0xa*(parseInt(_0x66e9b3(0x1e9))/0xb);if(_0x156a9e===_0x325086)break;else _0x4e3ab1['push'](_0x4e3ab1['shift']());}catch(_0x4fba12){_0x4e3ab1['push'](_0x4e3ab1['shift']());}}}(a46_0x5415,0xb849f));import a46_0x1f96c9 from'chalk';import{existsSync}from'fs';import a46_0x14a963 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 a46_0x1147d5 from'prompts';function getAttemptStatusDisplay(_0x26298c){const _0x36e94d=a46_0x2532;if(!_0x26298c)return{'icon':'⏳','text':''};const {done:_0x457900,success:_0x289f09,cancelRequested:_0x2e1690}=_0x26298c;if(!_0x457900)return _0x2e1690?{'icon':'🛑','text':a46_0x1f96c9[_0x36e94d(0x15c)](_0x36e94d(0x146))}:{'icon':'🔄','text':a46_0x1f96c9[_0x36e94d(0x122)](_0x36e94d(0x185))};if(_0x289f09)return{'icon':'✅','text':a46_0x1f96c9[_0x36e94d(0x17f)](_0x36e94d(0xb1))};return{'icon':'❌','text':a46_0x1f96c9[_0x36e94d(0xb9)](_0x36e94d(0xb3))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x41332c,_0xad1148,_0x1edd4e=0x0){const _0x380dac=a46_0x2532;return _0x41332c[_0x1edd4e]||_0xad1148[_0x380dac(0x12c)];}[a46_0x591dc6(0x1ac)](_0x4e28ed,_0x3caaf2,_0x30318a=0x0){const _0x3ae238=a46_0x591dc6,_0x4b81a4=this[_0x3ae238(0x203)](_0x4e28ed,_0x3caaf2,_0x30318a);if(!_0x4b81a4)return console[_0x3ae238(0xb3)](a46_0x1f96c9[_0x3ae238(0xb9)]('Error:'),_0x3ae238(0x1b3)),console['error'](a46_0x1f96c9[_0x3ae238(0x192)](_0x3ae238(0x83))),null;return _0x4b81a4;}[a46_0x591dc6(0x1e1)](_0x5f0f40,_0x13a62f){const _0x2e21b0=a46_0x591dc6;if(_0x5f0f40[0x0]){const _0x2f4e2e=_0x5f0f40[0x0][_0x2e21b0(0x1a4)]('.');if(_0x2f4e2e['length']===0x1)return{'projectName':_0x2f4e2e[0x0],'workflowName':undefined};else return _0x2f4e2e[_0x2e21b0(0x1ff)]===0x2?{'projectName':_0x2f4e2e[0x0],'workflowName':_0x2f4e2e[0x1]}:(console[_0x2e21b0(0xb3)](a46_0x1f96c9['red'](_0x2e21b0(0x1a9)),_0x2e21b0(0x19e)),null);}return{'projectName':_0x13a62f['workflowProject'],'workflowName':undefined};}[a46_0x591dc6(0xef)](_0x29644d,_0x5e845d,_0x23dfb4=0x0){const _0x3854d5=a46_0x591dc6;if(_0x29644d[_0x23dfb4])return _0x29644d[_0x23dfb4];if(_0x5e845d[_0x3854d5(0x12c)]){const _0x1ffe90=a46_0x14a963[_0x3854d5(0x84)](process[_0x3854d5(0xb7)](),_0x3854d5(0x22b),_0x5e845d[_0x3854d5(0x12c)]);if(existsSync(a46_0x14a963[_0x3854d5(0x84)](_0x1ffe90,'tdx.json')))return _0x1ffe90;}return undefined;}async[a46_0x591dc6(0x13d)](_0x1ce709,_0x46a61d,_0xa7b171){const _0x158b07=a46_0x591dc6;try{const _0x5668c0=await _0x1ce709['workflow']['workflows'](_0x46a61d,{'limit':0x1});if(_0x5668c0[_0x158b07(0x1ff)]>0x0){const _0x4e9961=_0x5668c0[0x0]['id'],_0x4f77b=getWorkflowUrl(_0xa7b171,_0x4e9961);console['error']('\x20\x20Console:\x20'+a46_0x1f96c9[_0x158b07(0xd9)](_0x4f77b));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x222);[a46_0x591dc6(0x193)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async['execute'](_0x544083){const _0x4feef4=a46_0x591dc6,{options:_0x286b80,args:_0x4f2a6a,tdx:_0x27e8e9}=_0x544083,_0x5c0015=_0x4f2a6a[0x0],_0x5ecc8d=_0x286b80[_0x4feef4(0x12b)];if(_0x5ecc8d)return saveSessionContext({'workflow_project':undefined},_0x286b80['session']),console[_0x4feef4(0x9e)](a46_0x1f96c9[_0x4feef4(0x17f)](_0x4feef4(0x17c))),0x0;if(!_0x5c0015)return console[_0x4feef4(0xb3)](a46_0x1f96c9[_0x4feef4(0xb9)](_0x4feef4(0x1a9)),_0x4feef4(0x1b3)),console[_0x4feef4(0xb3)](a46_0x1f96c9['dim'](_0x4feef4(0x11d))),console[_0x4feef4(0xb3)](a46_0x1f96c9[_0x4feef4(0x192)](_0x4feef4(0x104))),0x1;const _0x6a3596=await withSpinner(_0x4feef4(0x213)+_0x5c0015+_0x4feef4(0x172),()=>_0x27e8e9[_0x4feef4(0x1f4)]['resolveProjectId'](_0x5c0015),{'verbose':_0x286b80[_0x4feef4(0x1a6)]}),{name:_0x3526e1}=_0x6a3596[_0x4feef4(0x164)];return saveSessionContext({'workflow_project':_0x3526e1},_0x286b80[_0x4feef4(0xd7)]),console[_0x4feef4(0x9e)](a46_0x1f96c9['green'](_0x4feef4(0xfe)+a46_0x1f96c9['cyan'](_0x3526e1))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a46_0x591dc6(0xc9)]='workflow:projects';[a46_0x591dc6(0x193)]=a46_0x591dc6(0x133);async['execute'](_0x5c0ea8){const _0x346516=a46_0x591dc6,{options:_0x4a4a39,args:_0x5aac43,tdx:_0x5c772c}=_0x5c0ea8,_0xca8dd9=_0x5aac43[0x0];_0x4a4a39[_0x346516(0x1a6)]&&_0xca8dd9&&console[_0x346516(0xb3)]('Pattern:\x20'+_0xca8dd9);const _0x55773b=await withSpinner(_0x346516(0x1f7),()=>_0x5c772c[_0x346516(0x1f4)]['projects'](_0xca8dd9,{'limit':_0x4a4a39[_0x346516(0xa1)]}),{'verbose':_0x4a4a39[_0x346516(0x1a6)]});let _0x1ef5f5=_0x55773b['data'];_0x1ef5f5[_0x346516(0xf9)]((_0x45c097,_0x1aeea9)=>_0x45c097[_0x346516(0xc9)][_0x346516(0x21d)](_0x1aeea9['name']));const _0x358945=_0x4a4a39[_0x346516(0xa1)]||0x64,_0x5441a8=_0x1ef5f5[_0x346516(0x1ff)]>=_0x358945?a46_0x1f96c9[_0x346516(0x192)](_0x346516(0x179)):'';console[_0x346516(0xb3)](_0x346516(0x182)+_0x1ef5f5[_0x346516(0x1ff)]+_0x346516(0x1db)+(_0x1ef5f5[_0x346516(0x1ff)]!==0x1?'s':'')+_0x5441a8);if(_0x4a4a39['format']===_0x346516(0x1fb)||_0x4a4a39['format']===_0x346516(0x1d8)||_0x4a4a39[_0x346516(0xa5)]===_0x346516(0x147))await handleSDKOutput(_0x1ef5f5,_0x4a4a39);else{if(_0x1ef5f5[_0x346516(0x1ff)]===0x0)_0xca8dd9?console[_0x346516(0x9e)](_0x346516(0x1b7)+_0xca8dd9):console[_0x346516(0x9e)](_0x346516(0x194));else{const _0x983f26=_0x1ef5f5['map'](_0x1b25dd=>{const _0x353b1f=_0x346516,_0xb03255=_0x1b25dd[_0x353b1f(0x98)]?.[_0x353b1f(0x1fe)](_0x2aa586=>_0x2aa586[_0x353b1f(0x21f)]===_0x353b1f(0x11e)),_0x5d2fdc=_0xb03255?a46_0x1f96c9['dim'](_0x353b1f(0x16c)):'';return'📁\x20'+_0x1b25dd[_0x353b1f(0xc9)]+_0x5d2fdc;});await writeOutput(_0x983f26[_0x346516(0x84)]('\x0a'),_0x4a4a39[_0x346516(0x19b)],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x1bc);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x1e5);async[a46_0x591dc6(0x1a1)](_0xdb8acb){const _0x168268=a46_0x591dc6,{options:_0x2f3f2a,args:_0x2b7e40,tdx:_0x50ea72}=_0xdb8acb,_0x1356cb=this['resolveProject'](_0x2b7e40,_0x2f3f2a);_0x2f3f2a[_0x168268(0x1a6)]&&_0x1356cb&&console[_0x168268(0xb3)](_0x168268(0x8a)+_0x1356cb);const _0x156a28=await withSpinner(_0x168268(0xc5),()=>_0x50ea72[_0x168268(0x1f4)][_0x168268(0x22b)](_0x1356cb,{'limit':_0x2f3f2a[_0x168268(0xa1)]}),{'verbose':_0x2f3f2a[_0x168268(0x1a6)]});let _0x44e6bb=_0x156a28[_0x168268(0x164)];_0x44e6bb[_0x168268(0xf9)]((_0x288cd9,_0xa3c99e)=>{const _0x4738f3=_0x168268,_0xcadcc1=_0x288cd9[_0x4738f3(0xc9)]['localeCompare'](_0xa3c99e[_0x4738f3(0xc9)]);if(_0xcadcc1!==0x0)return _0xcadcc1;return(_0x288cd9[_0x4738f3(0x1f6)]?.[_0x4738f3(0xc9)]||'')['localeCompare'](_0xa3c99e[_0x4738f3(0x1f6)]?.['name']||'');});const _0x38c308=_0x2f3f2a['limit']||0x64,_0x1af4bf=_0x44e6bb[_0x168268(0x1ff)]>=_0x38c308?a46_0x1f96c9[_0x168268(0x192)](_0x168268(0x179)):'';console['error']('✔\x20Found\x20'+_0x44e6bb['length']+_0x168268(0x208)+(_0x44e6bb[_0x168268(0x1ff)]!==0x1?'s':'')+_0x1af4bf);if(_0x2f3f2a[_0x168268(0xa5)]===_0x168268(0x1fb)||_0x2f3f2a[_0x168268(0xa5)]===_0x168268(0x1d8)||_0x2f3f2a[_0x168268(0xa5)]===_0x168268(0x147))await handleSDKOutput(_0x44e6bb,_0x2f3f2a);else{if(_0x44e6bb['length']===0x0)_0x1356cb?console[_0x168268(0x9e)](_0x168268(0xe1)+_0x1356cb):console[_0x168268(0x9e)]('No\x20workflows\x20found');else{const _0x2dd58b=_0x2f3f2a[_0x168268(0x1fa)],_0x40023d=_0x44e6bb[_0x168268(0x112)](_0x374b50=>{const _0x582f1d=_0x168268,_0x1e7e2e=a46_0x1f96c9[_0x582f1d(0x192)]('#'+_0x374b50['id']),_0x11edd7=hyperlink(_0x1e7e2e,getWorkflowUrl(_0x2dd58b,_0x374b50['id'])),_0x4631e7=_0x374b50[_0x582f1d(0x1f6)]?.['name']?a46_0x1f96c9[_0x582f1d(0x192)]('\x20('+_0x374b50[_0x582f1d(0x1f6)][_0x582f1d(0xc9)]+')'):'';return _0x582f1d(0x1ad)+_0x11edd7+'\x20'+_0x374b50[_0x582f1d(0xc9)]+_0x4631e7;});await writeOutput(_0x40023d[_0x168268(0x84)]('\x0a'),_0x2f3f2a['output'],_0x168268(0x14d));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a46_0x591dc6(0xec);['description']=a46_0x591dc6(0x131);async['execute'](_0x35ca0a){const _0x47b1b2=a46_0x591dc6,{options:_0x17fb54,args:_0x18c98b,tdx:_0x3a0cd9}=_0x35ca0a,_0xd79ff2=this['parseProjectWorkflowPattern'](_0x18c98b,_0x17fb54);if(!_0xd79ff2)return 0x1;const {projectName:_0x1d28ca,workflowName:_0x265fb8}=_0xd79ff2;if(_0x17fb54[_0x47b1b2(0x1a6)]){if(_0x1d28ca&&_0x265fb8)console[_0x47b1b2(0xb3)](_0x47b1b2(0x216)+_0x1d28ca+'.'+_0x265fb8);else _0x1d28ca&&console[_0x47b1b2(0xb3)](_0x47b1b2(0x204)+_0x1d28ca);const _0x49234d=_0x17fb54[_0x47b1b2(0xe0)];_0x49234d&&console[_0x47b1b2(0xb3)](_0x47b1b2(0x22e)+_0x49234d);}let _0x3c03ba=0x28;if(process[_0x47b1b2(0xf4)][_0x47b1b2(0xe9)]&&!_0x17fb54[_0x47b1b2(0x19b)]&&!_0x17fb54[_0x47b1b2(0xa5)]){const _0x7d4fde=process[_0x47b1b2(0xf4)][_0x47b1b2(0xbd)]||0x28;_0x3c03ba=Math[_0x47b1b2(0x13e)](0x14,Math[_0x47b1b2(0x1df)](_0x7d4fde*0x2/0x3));}const _0x673466=_0x17fb54['limit']||_0x3c03ba,_0x104e54=await withSpinner(_0x47b1b2(0x20c),()=>_0x3a0cd9[_0x47b1b2(0x1f4)][_0x47b1b2(0x1be)]({'projectName':_0x1d28ca,'workflowName':_0x265fb8,'status':_0x17fb54[_0x47b1b2(0xe0)],'fromTime':_0x17fb54[_0x47b1b2(0xc0)],'toTime':_0x17fb54['to'],'limit':_0x673466}),{'verbose':_0x17fb54[_0x47b1b2(0x1a6)]}),_0x4fe35c=_0x104e54[_0x47b1b2(0x164)];_0x4fe35c[_0x47b1b2(0xf9)]((_0x29091c,_0x265cf4)=>{const _0xdb029c=_0x47b1b2,_0x3c2904=_0x29091c[_0xdb029c(0x1a5)]||'',_0x53794d=_0x265cf4[_0xdb029c(0x1a5)]||'';return _0x53794d[_0xdb029c(0x21d)](_0x3c2904);});_0x4fe35c['length']>=_0x673466?console[_0x47b1b2(0xb3)](_0x47b1b2(0x217)+_0x4fe35c[_0x47b1b2(0x1ff)]+_0x47b1b2(0x165)+a46_0x1f96c9[_0x47b1b2(0x192)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x47b1b2(0xb3)](_0x47b1b2(0x182)+_0x4fe35c[_0x47b1b2(0x1ff)]+_0x47b1b2(0x99)+(_0x4fe35c[_0x47b1b2(0x1ff)]!==0x1?'s':''));if(_0x17fb54[_0x47b1b2(0xa5)]===_0x47b1b2(0x1fb)||_0x17fb54[_0x47b1b2(0xa5)]===_0x47b1b2(0x1d8)||_0x17fb54[_0x47b1b2(0xa5)]===_0x47b1b2(0x147))await handleSDKOutput(_0x4fe35c,_0x17fb54);else{if(!process[_0x47b1b2(0xf4)][_0x47b1b2(0xe9)]||_0x17fb54['output']){if(_0x4fe35c[_0x47b1b2(0x1ff)]===0x0){if(_0x1d28ca&&_0x265fb8)console[_0x47b1b2(0x9e)](_0x47b1b2(0x1b0)+_0x1d28ca+'.'+_0x265fb8);else _0x1d28ca?console['log'](_0x47b1b2(0x181)+_0x1d28ca):console[_0x47b1b2(0x9e)](_0x47b1b2(0xcb));}else{const _0x42580b=_0x17fb54[_0x47b1b2(0x1fa)],_0x26b1e3=this[_0x47b1b2(0x170)](_0x4fe35c,_0x42580b);_0x17fb54[_0x47b1b2(0x19b)]?await writeOutput(_0x26b1e3,_0x17fb54['output'],_0x47b1b2(0x14d)):console['log'](_0x26b1e3);}!_0x1d28ca&&(console[_0x47b1b2(0xb3)](''),console['error'](a46_0x1f96c9[_0x47b1b2(0x192)](_0x47b1b2(0xfd))),console[_0x47b1b2(0xb3)](a46_0x1f96c9['dim'](_0x47b1b2(0xac))+'or'+a46_0x1f96c9[_0x47b1b2(0x192)](_0x47b1b2(0xd5))));}else{if(_0x4fe35c[_0x47b1b2(0x1ff)]===0x0){if(_0x1d28ca&&_0x265fb8)console['log'](_0x47b1b2(0x1b0)+_0x1d28ca+'.'+_0x265fb8);else _0x1d28ca?console['log'](_0x47b1b2(0x181)+_0x1d28ca):console[_0x47b1b2(0x9e)](_0x47b1b2(0xcb));}else await this[_0x47b1b2(0xdb)](_0x4fe35c,_0x35ca0a,_0x1d28ca);}}return 0x0;}['renderSessionsTimeline'](_0x9d8224,_0x3b6af0){const _0x2d87ec=a46_0x591dc6,_0x1e08ff=[],_0x42d3fa=new Map();let _0x59ef64=Infinity,_0x464bee=-Infinity;for(const _0x5a9f78 of _0x9d8224){if(_0x5a9f78['lastAttempt']?.['createdAt']){const _0x2a8c34=new Date(_0x5a9f78[_0x2d87ec(0xae)][_0x2d87ec(0x154)])[_0x2d87ec(0xa4)](),_0x3116b5=_0x5a9f78[_0x2d87ec(0xae)]['finishedAt']?new Date(_0x5a9f78[_0x2d87ec(0xae)]['finishedAt'])['getTime']():Date['now'](),_0xc06d48=_0x5a9f78[_0x2d87ec(0x1f6)]?.[_0x2d87ec(0xc9)]||_0x2d87ec(0x144);!_0x42d3fa[_0x2d87ec(0x8f)](_0xc06d48)&&_0x42d3fa[_0x2d87ec(0x1f8)](_0xc06d48,[]),_0x42d3fa['get'](_0xc06d48)[_0x2d87ec(0x1dd)]({'session':_0x5a9f78,'startTime':_0x2a8c34,'endTime':_0x3116b5,'duration':_0x3116b5-_0x2a8c34}),_0x59ef64=Math[_0x2d87ec(0x80)](_0x59ef64,_0x2a8c34),_0x464bee=Math[_0x2d87ec(0x13e)](_0x464bee,_0x3116b5);}}if(_0x42d3fa[_0x2d87ec(0xf1)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x59b8ad=process[_0x2d87ec(0xf4)][_0x2d87ec(0x1ae)]||0x78,_0x304f7d=0x1e,_0x7fecea=0x32,_0x1d02a1=0x4,_0x29f68b=Math[_0x2d87ec(0x80)](_0x7fecea,Math[_0x2d87ec(0x13e)](_0x304f7d,Math[_0x2d87ec(0x1df)](_0x59b8ad*0.3))),_0x432718=_0x59b8ad-_0x29f68b-TIMELINE_CONFIG[_0x2d87ec(0xd8)]-0x3-_0x1d02a1,_0x2bcd2a=_0x464bee-_0x59ef64,_0x62b588=_0x2bcd2a/_0x29f68b,_0x50409c=renderTimeAxis({'startTime':_0x59ef64,'endTime':_0x464bee,'durationMs':_0x2bcd2a,'msPerChar':_0x62b588},_0x29f68b),_0x50e04d=[];for(const _0x5eb984 of _0x42d3fa[_0x2d87ec(0x93)]()){_0x50e04d['push'](..._0x5eb984);}_0x50e04d[_0x2d87ec(0xf9)]((_0x2950b6,_0x43d694)=>_0x43d694[_0x2d87ec(0x136)]-_0x2950b6[_0x2d87ec(0x136)]);const _0x57b55a=new Date(_0x59ef64),_0x1ee1ba=formatDate(_0x57b55a),_0x1ea236=_0x1d02a1+TIMELINE_CONFIG[_0x2d87ec(0x1dc)]+TIMELINE_CONFIG[_0x2d87ec(0x1e3)]+_0x432718,_0x3bbe00='\x20'[_0x2d87ec(0x20d)](_0x1ea236-_0x1ee1ba[_0x2d87ec(0x1ff)]),_0x3bb67f=_0x3bbe00+a46_0x1f96c9['dim'](_0x1ee1ba)+'\x20'+_0x50409c;_0x1e08ff[_0x2d87ec(0x1dd)](_0x3bb67f);const _0x1b0ac0=0x16;let _0x38adaf=0x0;for(const _0x574060 of _0x50e04d){const _0x381a07=_0x574060[_0x2d87ec(0xd7)][_0x2d87ec(0x1f6)]?.['name']||'?',_0x3d3a04=Math[_0x2d87ec(0x80)](stringWidth(_0x381a07),_0x1b0ac0);_0x38adaf=Math['max'](_0x38adaf,_0x3d3a04);}for(const _0x11d869 of _0x50e04d){const {session:_0x2c7c2f,startTime:_0x43b9b9,endTime:_0x5efb85,duration:_0x5d171e}=_0x11d869,_0x32ded9=_0x2c7c2f['project']?.['id'],_0x5b77a1=_0x2c7c2f['id'],_0x55288c=_0x2c7c2f['project']?.['name']||'?',_0x1d830f=_0x2c7c2f[_0x2d87ec(0x1f4)]?.[_0x2d87ec(0xc9)]||'?';let _0x6158b6,_0x26012b;if(_0x2c7c2f[_0x2d87ec(0xae)]){const _0x2140d8=_0x2c7c2f['lastAttempt'];!_0x2140d8['done']?(_0x6158b6=_0x2140d8[_0x2d87ec(0x118)]?'🛑':'🔄',_0x26012b=_0x2140d8[_0x2d87ec(0x118)]?a46_0x1f96c9[_0x2d87ec(0x15c)]:a46_0x1f96c9['blue']):(_0x6158b6=_0x2140d8[_0x2d87ec(0xb1)]?'✅':'❌',_0x26012b=_0x2140d8[_0x2d87ec(0xb1)]?a46_0x1f96c9[_0x2d87ec(0x17f)]:a46_0x1f96c9[_0x2d87ec(0xb9)]);}else _0x6158b6='⏳',_0x26012b=a46_0x1f96c9[_0x2d87ec(0x192)];const _0x1f36fe='#'+_0x5b77a1,_0x54d12d=_0x32ded9?hyperlink(_0x1f36fe,getWorkflowSessionUrl(_0x3b6af0,_0x32ded9,_0x5b77a1)):_0x1f36fe;let _0x71fbdc=_0x55288c;stringWidth(_0x55288c)>_0x1b0ac0&&(_0x71fbdc=_0x55288c[_0x2d87ec(0x130)](0x0,_0x1b0ac0-0x1)+'…');const _0x1ddbf1=a46_0x1f96c9[_0x2d87ec(0x192)](_0x71fbdc),_0x523810=stringWidth(_0x71fbdc),_0x3b895f='\x20'[_0x2d87ec(0x20d)](_0x38adaf-stringWidth(_0x71fbdc)+0x2),_0x400bdf='('+formatElapsed(_0x5d171e)+')',_0x23423e=stringWidth(_0x400bdf),_0x2caad1=stringWidth(_0x1f36fe),_0x322df7=_0x2caad1+0x1+_0x523810+_0x3b895f[_0x2d87ec(0x1ff)],_0x2a8380=_0x432718-_0x322df7-_0x23423e-0x1-0x8;let _0x58bc6d=_0x1d830f;stringWidth(_0x58bc6d)>_0x2a8380&&(_0x58bc6d=_0x58bc6d[_0x2d87ec(0x130)](0x0,_0x2a8380-0x1)+'…');const _0x23c9b2=_0x54d12d+'\x20'+_0x1ddbf1+_0x3b895f+_0x58bc6d,_0x412f02=stringWidth(_0x23c9b2),_0x2b0bbd=_0x432718-_0x412f02-_0x23423e,_0x22a3c6=_0x23c9b2+'\x20'[_0x2d87ec(0x20d)](Math[_0x2d87ec(0x13e)](0x1,_0x2b0bbd))+a46_0x1f96c9[_0x2d87ec(0x192)](_0x400bdf),_0x49b450=Math[_0x2d87ec(0x1df)]((_0x43b9b9-_0x59ef64)/_0x62b588),_0x2b027e=Math['floor']((_0x5efb85-_0x59ef64)/_0x62b588),_0x3710c4=Math['max'](_0x49b450+0x1,_0x2b027e),_0x22bf54=new Array(_0x29f68b)['fill']('\x20');for(let _0x8dffd7=_0x49b450;_0x8dffd7<Math[_0x2d87ec(0x80)](_0x3710c4,_0x29f68b);_0x8dffd7++){_0x22bf54[_0x8dffd7]='─';}const _0x44789e=_0x22bf54[_0x2d87ec(0x112)](_0x3d5518=>_0x3d5518==='\x20'?'\x20':_0x26012b(_0x3d5518))[_0x2d87ec(0x84)]('');_0x1e08ff[_0x2d87ec(0x1dd)](_0x6158b6+'\x20'+_0x22a3c6+'│'+_0x44789e+'│');}return _0x1e08ff[_0x2d87ec(0x84)]('\x0a');}async[a46_0x591dc6(0xdb)](_0x187fcd,_0x1eb7ac,_0x440d52){const _0x516a89=a46_0x591dc6,{options:_0x3e10d2,tdx:_0x55308a}=_0x1eb7ac,_0xad612c=_0x3e10d2[_0x516a89(0x1fa)],{timelineRows:_0x1d0fd9,timeAxisHeader:_0xe7956}=this['generateSessionTimelineRows'](_0x187fcd,_0xad612c),_0x3a7d6a=_0x1d0fd9[_0x516a89(0x214)](_0x119c4e=>_0x119c4e['attemptId']);if(_0x3a7d6a[_0x516a89(0x1ff)]===0x0){const _0x4beac0=this['renderSessionsTimeline'](_0x187fcd,_0xad612c);console[_0x516a89(0x9e)](_0x4beac0);!_0x440d52&&(console[_0x516a89(0xb3)](''),console[_0x516a89(0xb3)](a46_0x1f96c9[_0x516a89(0x192)](_0x516a89(0xfd))),console['error'](a46_0x1f96c9[_0x516a89(0x192)](_0x516a89(0xac))+'or'+a46_0x1f96c9[_0x516a89(0x192)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0xe7956&&console[_0x516a89(0x9e)](_0xe7956);const _0x3f06db=_0x1d0fd9[_0x516a89(0x214)](_0x55a4c5=>_0x55a4c5['attemptId'])['map'](_0xf79821=>({'title':_0xf79821[_0x516a89(0x12a)],'value':_0xf79821[_0x516a89(0x1c8)]})),_0x2ffa02=process[_0x516a89(0xf4)][_0x516a89(0xbd)]||0x3c,_0x5e423e=Math[_0x516a89(0x13e)](0x28,Math['floor'](_0x2ffa02*0x2/0x3)),_0x4f742e=await a46_0x1147d5({'type':'autocomplete','name':'attemptId','message':_0x516a89(0x1ce),'choices':_0x3f06db,'initial':-0x1,'limit':_0x5e423e,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x52b20a,_0x1b47dd)=>{const _0xc58f3c=_0x516a89;if(!_0x52b20a)return Promise[_0xc58f3c(0xde)](_0x1b47dd);const _0x3b77ed=_0x1b47dd[_0xc58f3c(0x214)](_0x500456=>{const _0x3f5f19=_0xc58f3c,_0x902fe5=_0x500456;return _0x902fe5[_0x3f5f19(0x1f1)][_0x3f5f19(0x1c4)]()[_0x3f5f19(0x18c)](_0x52b20a['toLowerCase']());});return Promise[_0xc58f3c(0xde)](_0x3b77ed);}}),_0x597cbd=()=>{const _0x44935f=_0x516a89;process[_0x44935f(0xf4)]['write'](_0x44935f(0x127)),process[_0x44935f(0xf4)][_0x44935f(0xeb)](_0x44935f(0x127)),process[_0x44935f(0xf4)]['write'](_0x44935f(0x127));},_0x8281f4=_0x4f742e&&_0x4f742e[_0x516a89(0x1c8)]&&_0x4f742e['attemptId']!==null&&_0x4f742e[_0x516a89(0x1c8)]['trim']()!=='';if(!_0x8281f4){_0x597cbd(),console[_0x516a89(0x9e)](a46_0x1f96c9[_0x516a89(0x192)]('Cancelled'));return;}_0x597cbd();const _0x40f2db=_0x187fcd['find'](_0x356f36=>_0x356f36['lastAttempt']?.['id']===_0x4f742e[_0x516a89(0x1c8)]);if(_0x40f2db){const _0x12168d=_0x40f2db[_0x516a89(0x1f6)]?.[_0x516a89(0xc9)]||'?',_0x2c6a11=_0x40f2db[_0x516a89(0x1f4)]?.[_0x516a89(0xc9)]||'?';console[_0x516a89(0x9e)]('Project:\x20'+a46_0x1f96c9['dim'](_0x12168d)+_0x516a89(0xdc)+a46_0x1f96c9[_0x516a89(0x192)](_0x2c6a11));}const _0x76d1f7=new WorkflowTimelineCommand();await _0x76d1f7[_0x516a89(0x1a1)]({'args':[],'options':{..._0x3e10d2,'attemptId':_0x4f742e[_0x516a89(0x1c8)]},'tdx':_0x55308a});}[a46_0x591dc6(0x1d6)](_0xb1b5aa,_0x31d5c3){const _0x4fb884=a46_0x591dc6,_0x4fe1c1=new Map();for(const _0xd65bb7 of _0xb1b5aa){_0xd65bb7['id']&&_0xd65bb7[_0x4fb884(0xae)]?.['id']&&_0x4fe1c1[_0x4fb884(0x1f8)](_0xd65bb7['id'],_0xd65bb7[_0x4fb884(0xae)]['id']);}const _0x418003=[];let _0x5c43dd='';const _0x45d5a8=this[_0x4fb884(0x170)](_0xb1b5aa,_0x31d5c3),_0x4703dc=_0x45d5a8[_0x4fb884(0x1a4)]('\x0a');for(const _0x4a6860 of _0x4703dc){if(_0x4a6860[_0x4fb884(0x175)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x4a6860['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x5c43dd=_0x4a6860;else{if(_0x4a6860[_0x4fb884(0x1d0)](/^[✅❌🔄🛑⏳]/)){const _0x4e2f84=_0x4a6860[_0x4fb884(0x1d0)](/#(\d+)/),_0x1e8c13=_0x4e2f84?_0x4e2f84[0x1]:null,_0x1dfaca=_0x1e8c13?_0x4fe1c1['get'](_0x1e8c13)||null:null,_0x57582a=_0xb1b5aa[_0x4fb884(0x1a2)](_0x35ddfc=>_0x35ddfc['id']===_0x1e8c13),_0x4963f3=_0x57582a?.[_0x4fb884(0x1f6)]?.['name']||'';_0x418003[_0x4fb884(0x1dd)]({'displayLine':_0x4a6860,'attemptId':_0x1dfaca,'projectName':_0x4963f3});}}}return{'timelineRows':_0x418003,'timeAxisHeader':_0x5c43dd};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a46_0x591dc6(0xc9)]='workflow:attempts';['description']=a46_0x591dc6(0xcc);async[a46_0x591dc6(0x1a1)](_0x2a0c3d){const _0x135a3c=a46_0x591dc6,{options:_0x5db1df,args:_0x348d5d,tdx:_0x3d86cf}=_0x2a0c3d,_0xf59eb=this[_0x135a3c(0x1e1)](_0x348d5d,_0x5db1df);if(!_0xf59eb)return 0x1;const {projectName:_0x636b6d,workflowName:_0x385655}=_0xf59eb,_0x26981c=_0x5db1df[_0x135a3c(0x1cf)];if(_0x5db1df[_0x135a3c(0x1a6)]){if(_0x636b6d&&_0x385655)console[_0x135a3c(0xb3)](_0x135a3c(0x216)+_0x636b6d+'.'+_0x385655);else _0x636b6d&&console[_0x135a3c(0xb3)](_0x135a3c(0x204)+_0x636b6d);_0x26981c&&console[_0x135a3c(0xb3)](_0x135a3c(0x126));}const _0x3db5d0=await withSpinner(_0x135a3c(0x230),()=>_0x3d86cf[_0x135a3c(0x1f4)][_0x135a3c(0xe7)]({'projectName':_0x636b6d,'workflowName':_0x385655,'includeRetried':_0x26981c,'limit':_0x5db1df[_0x135a3c(0xa1)]}),{'verbose':_0x5db1df[_0x135a3c(0x1a6)]}),_0x463e55=_0x3db5d0[_0x135a3c(0x164)],_0x4a2025=_0x5db1df[_0x135a3c(0xa1)]||0x64,_0xe58a93=_0x463e55['length']>=_0x4a2025?a46_0x1f96c9[_0x135a3c(0x192)](_0x135a3c(0x179)):'';console[_0x135a3c(0xb3)](_0x135a3c(0x182)+_0x463e55['length']+_0x135a3c(0x100)+(_0x463e55['length']!==0x1?'s':'')+_0xe58a93);if(_0x5db1df['format']===_0x135a3c(0x1fb)||_0x5db1df['format']===_0x135a3c(0x1d8)||_0x5db1df[_0x135a3c(0xa5)]==='table')await handleSDKOutput(_0x463e55,_0x5db1df);else{if(_0x463e55['length']===0x0){if(_0x636b6d&&_0x385655)console['log'](_0x135a3c(0x94)+_0x636b6d+'.'+_0x385655);else _0x636b6d?console[_0x135a3c(0x9e)](_0x135a3c(0x158)+_0x636b6d):console[_0x135a3c(0x9e)](_0x135a3c(0x9d));}else{const _0x313ed1=_0x5db1df[_0x135a3c(0x1fa)],_0xe5333a=_0x463e55[_0x135a3c(0x112)](_0x15c85f=>{const _0x5b917a=_0x135a3c,_0x261baa=a46_0x1f96c9[_0x5b917a(0x192)]('#'+_0x15c85f['id']),_0x3f11ab=_0x15c85f['project']?.['id'],_0x18c85a=_0x15c85f[_0x5b917a(0x22d)]||_0x15c85f['sessionId'],_0xa89771=_0x3f11ab&&_0x18c85a?hyperlink(_0x261baa,getWorkflowAttemptUrl(_0x313ed1,_0x3f11ab,_0x18c85a,_0x15c85f['id'])):_0x261baa,{icon:_0x5d93fa,text:_0x3c9bf8}=getAttemptStatusDisplay(_0x15c85f),_0x4597e8=(_0x15c85f[_0x5b917a(0x1f6)]?.[_0x5b917a(0xc9)]||'?')+'.'+(_0x15c85f[_0x5b917a(0x1f4)]?.[_0x5b917a(0xc9)]||'?'),_0x289a26=_0x15c85f[_0x5b917a(0x1a5)]?a46_0x1f96c9[_0x5b917a(0x192)](_0x15c85f[_0x5b917a(0x1a5)]):'';return(_0xa89771+'\x20'+_0x5d93fa+(_0x3c9bf8?'\x20'+_0x3c9bf8:'')+'\x20'+_0x4597e8+'\x20'+_0x289a26)[_0x5b917a(0xb8)]();});await writeOutput(_0xe5333a[_0x135a3c(0x84)]('\x0a'),_0x5db1df[_0x135a3c(0x19b)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a46_0x591dc6(0xc9)]='workflow:attempt';[a46_0x591dc6(0x193)]='Show\x20specific\x20attempt\x20details';async[a46_0x591dc6(0x1a1)](_0x15c85b){const _0x288aa2=a46_0x591dc6,{options:_0x1fd21b,args:_0x133913,tdx:_0x48ab47}=_0x15c85b,_0x1949e7=_0x133913[0x0];if(!_0x1949e7)return console[_0x288aa2(0xb3)](_0x288aa2(0x10e)),0x1;_0x1fd21b['verbose']&&console['error'](_0x288aa2(0x10f)+_0x1949e7);const _0x49fa79=await withSpinner(_0x288aa2(0x1e2),()=>_0x48ab47[_0x288aa2(0x1f4)][_0x288aa2(0x95)](_0x1949e7),{'verbose':_0x1fd21b[_0x288aa2(0x1a6)]}),_0x53cab0=_0x49fa79['data'];let _0x358e43;!_0x53cab0['done']?_0x358e43=_0x53cab0[_0x288aa2(0x118)]?'canceling':'running':_0x358e43=_0x53cab0[_0x288aa2(0xb1)]?_0x288aa2(0xb1):'error';let _0x2b442f;if(_0x53cab0[_0x288aa2(0x154)]&&_0x53cab0[_0x288aa2(0x152)]){const _0x4b3771=new Date(_0x53cab0['createdAt'])[_0x288aa2(0xa4)](),_0x53f5e5=new Date(_0x53cab0[_0x288aa2(0x152)])[_0x288aa2(0xa4)]();_0x2b442f=Math[_0x288aa2(0x91)]((_0x53f5e5-_0x4b3771)/0x3e8);}const _0x117071={'attempt_id':_0x53cab0['id'],'status':_0x358e43,..._0x53cab0[_0x288aa2(0x1b4)]!==undefined&&{'index':_0x53cab0[_0x288aa2(0x1b4)]},..._0x53cab0['project']&&{'project':_0x53cab0[_0x288aa2(0x1f6)][_0x288aa2(0xc9)]},..._0x53cab0[_0x288aa2(0x1f4)]&&{'workflow':_0x53cab0[_0x288aa2(0x1f4)][_0x288aa2(0xc9)]},..._0x53cab0[_0x288aa2(0xee)]&&{'session_id':_0x53cab0[_0x288aa2(0xee)]},..._0x53cab0['sessionTime']&&{'session_time':_0x53cab0[_0x288aa2(0x1a5)]},..._0x53cab0['retryAttemptName']&&{'retry_attempt':_0x53cab0[_0x288aa2(0x148)]},..._0x2b442f!==undefined&&{'duration_sec':_0x2b442f},..._0x53cab0[_0x288aa2(0x154)]&&{'created_at':_0x53cab0[_0x288aa2(0x154)]},..._0x53cab0[_0x288aa2(0x152)]&&{'finished_at':_0x53cab0['finishedAt']},...Object[_0x288aa2(0x1b9)](_0x53cab0[_0x288aa2(0xd4)])['length']>0x0&&{'params':_0x53cab0[_0x288aa2(0xd4)]}};return await handleSingleObjectOutput(_0x117071,_0x1fd21b),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x166);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x115);async[a46_0x591dc6(0x1a1)](_0x1004c2){const _0x2d498e=a46_0x591dc6,{options:_0x5923ef,args:_0x3db45b,tdx:_0x3461dd}=_0x1004c2,_0x3cfe7d=_0x3db45b[0x0];if(!_0x3cfe7d)return console[_0x2d498e(0xb3)](_0x2d498e(0x10e)),0x1;const _0x3db895=_0x5923ef[_0x2d498e(0x198)];_0x5923ef[_0x2d498e(0x1a6)]&&(console[_0x2d498e(0xb3)]('Attempt\x20ID:\x20'+_0x3cfe7d),_0x3db895&&console[_0x2d498e(0xb3)](_0x2d498e(0x189)));const _0x41b8f7=await withSpinner(_0x2d498e(0x199),()=>_0x3461dd[_0x2d498e(0x1f4)][_0x2d498e(0x14a)](_0x3cfe7d,_0x3db895||![]),{'verbose':_0x5923ef[_0x2d498e(0x1a6)]}),_0x5ddff3=_0x41b8f7[_0x2d498e(0x164)];return console[_0x2d498e(0xb3)](_0x2d498e(0x182)+_0x5ddff3[_0x2d498e(0x1ff)]+_0x2d498e(0x81)+(_0x5ddff3[_0x2d498e(0x1ff)]!==0x1?'s':'')),await handleSDKOutput(_0x5ddff3,_0x5923ef),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x21c);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x1c1);async['execute'](_0x1dacd0){const _0x4daee9=a46_0x591dc6,{options:_0x21bc50,args:_0x78d20e,tdx:_0x4df8b8}=_0x1dacd0,_0x23b26f=_0x78d20e[0x0];let _0x59ebac=_0x78d20e[0x1];if(!_0x23b26f)return console[_0x4daee9(0xb3)](_0x4daee9(0x10e)),0x1;_0x21bc50[_0x4daee9(0x1a6)]&&(console[_0x4daee9(0xb3)]('Attempt\x20ID:\x20'+_0x23b26f),_0x59ebac&&console['error'](_0x4daee9(0x212)+_0x59ebac));const _0x43b57c=await withSpinner(_0x4daee9(0x1eb),()=>_0x4df8b8['workflow']['logFiles'](_0x23b26f,_0x59ebac),{'verbose':_0x21bc50[_0x4daee9(0x1a6)]}),_0xe94d8a=_0x43b57c['data'];if(_0xe94d8a[_0x4daee9(0x1ff)]===0x0)return console['error'](_0x4daee9(0x9a)),0x0;if(!_0x59ebac&&(_0x21bc50[_0x4daee9(0x1fb)]||_0x21bc50[_0x4daee9(0xa5)]))return await handleSDKOutput(_0xe94d8a,_0x21bc50),0x0;if(!_0x59ebac){const _0x20eb8d=_0xe94d8a['map'](_0x504d25=>({'title':_0x504d25[_0x4daee9(0x9f)]+'\x20('+formatBytes(_0x504d25[_0x4daee9(0x224)])+')','value':_0x504d25[_0x4daee9(0x9f)]})),_0x3598e3=await a46_0x1147d5({'type':_0x4daee9(0x188),'name':_0x4daee9(0x1ea),'message':_0x4daee9(0xa8),'choices':_0x20eb8d});if(!_0x3598e3[_0x4daee9(0x1ea)])return console[_0x4daee9(0xb3)]('Cancelled'),0x0;_0x59ebac=_0x3598e3[_0x4daee9(0x1ea)];}const _0x4906ad=await withSpinner(_0x4daee9(0x103),()=>_0x4df8b8[_0x4daee9(0x1f4)]['logs'](_0x23b26f,_0x59ebac),{'verbose':_0x21bc50[_0x4daee9(0x1a6)]}),_0x43a7c6=_0x4906ad[_0x4daee9(0x164)];return _0x43a7c6?console[_0x4daee9(0x9e)](_0x43a7c6):console[_0x4daee9(0xb3)](_0x4daee9(0x219)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x178);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x206);async[a46_0x591dc6(0x1a1)](_0xc468db){const _0x4da579=a46_0x591dc6,{options:_0xd50f31,args:_0x55f3bd,tdx:_0x1b6269}=_0xc468db,_0x40c194=_0x55f3bd[0x0];if(!_0x40c194)return console[_0x4da579(0xb3)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x38a3d4=_0xd50f31[_0x4da579(0x174)];_0xd50f31['verbose']&&(console[_0x4da579(0xb3)](_0x4da579(0x10f)+_0x40c194),_0x38a3d4&&console['error'](_0x4da579(0x18f)+_0x38a3d4));if(!_0xd50f31['yes']){if(!isInteractive())return console['error'](a46_0x1f96c9[_0x4da579(0xb9)](_0x4da579(0x218)),_0x4da579(0x195)),console['error'](a46_0x1f96c9[_0x4da579(0x192)](_0x4da579(0x1e6))),0x1;const _0x6dba1a=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x40c194+'?');if(!_0x6dba1a)return console['error'](a46_0x1f96c9['yellow'](_0x4da579(0x200))),0x1;}const _0x4d5ada=await withSpinner(_0x4da579(0x14f),()=>_0x1b6269[_0x4da579(0x1f4)]['kill'](_0x40c194,_0x38a3d4),{'verbose':_0xd50f31['verbose']}),_0x4256bc=_0x4d5ada[_0x4da579(0x164)];return console[_0x4da579(0xb3)]('✔\x20'+_0x4256bc),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0xcd);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x1c0);async[a46_0x591dc6(0x1a1)](_0x556f75){const _0x26eb84=a46_0x591dc6,{options:_0x14b4b9,args:_0x1e5217,tdx:_0x214b21}=_0x556f75,_0xb11a88=_0x1e5217[0x0];if(!_0xb11a88)return console[_0x26eb84(0xb3)](_0x26eb84(0x15f)),console[_0x26eb84(0xb3)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x2cc6e9=![],_0x4668e8=_0xb11a88;if(_0xb11a88[_0x26eb84(0x175)](_0x26eb84(0x1ef)))_0x2cc6e9=!![],_0x4668e8=_0xb11a88[_0x26eb84(0x201)](0x8);else{if(_0xb11a88[_0x26eb84(0x175)](_0x26eb84(0x141)))_0x2cc6e9=![],_0x4668e8=_0xb11a88['substring'](0x8);else return console[_0x26eb84(0xb3)](_0x26eb84(0x16f)),console[_0x26eb84(0xb3)](_0x26eb84(0x10a)),0x1;}const _0x43da21=_0x14b4b9[_0x26eb84(0x1b6)],_0x489c5d=_0x14b4b9[_0x26eb84(0x1d4)],_0x57284a=_0x14b4b9['params'],_0x5d06f9=_0x14b4b9[_0x26eb84(0x128)];_0x14b4b9['verbose']&&(console[_0x26eb84(0xb3)](_0x26eb84(0x1a7)+(_0x2cc6e9?_0x26eb84(0xd7):_0x26eb84(0x95))+'\x20'+_0x4668e8),_0x43da21&&console['error'](_0x26eb84(0xbf)+_0x43da21),_0x489c5d&&console[_0x26eb84(0xb3)](_0x26eb84(0x140)+_0x489c5d),_0x57284a&&console['error']('Params:\x20'+_0x57284a),_0x5d06f9&&console[_0x26eb84(0xb3)](_0x26eb84(0x22f)));let _0x33d5ae;if(_0x57284a)try{if(_0x57284a['startsWith']('@')){const _0x4f33d0=await import(_0x26eb84(0xe6)),_0x6a0960=_0x57284a[_0x26eb84(0x201)](0x1),_0x23e9cb=await _0x4f33d0['readFile'](_0x6a0960,'utf-8');_0x33d5ae=JSON[_0x26eb84(0x116)](_0x23e9cb);}else _0x33d5ae=JSON[_0x26eb84(0x116)](_0x57284a);}catch{return console[_0x26eb84(0xb3)](_0x26eb84(0x211)),0x1;}if(!_0x14b4b9[_0x26eb84(0x1cd)]){if(!isInteractive())return console[_0x26eb84(0xb3)](a46_0x1f96c9['red']('\x0aError:'),_0x26eb84(0x195)),console['error'](a46_0x1f96c9[_0x26eb84(0x192)](_0x26eb84(0x1e6))),0x1;const _0x4f3c58=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x2cc6e9?_0x26eb84(0xd7):'attempt')+'\x20'+_0x4668e8+'?');if(!_0x4f3c58)return console[_0x26eb84(0xb3)](a46_0x1f96c9[_0x26eb84(0x15c)](_0x26eb84(0x200))),0x1;}let _0x24dd13;_0x2cc6e9?_0x24dd13=await withSpinner('Retrying\x20session...',()=>_0x214b21[_0x26eb84(0x1f4)][_0x26eb84(0x1d3)](_0x4668e8,{'fromTask':_0x43da21,'retryParams':_0x33d5ae}),{'verbose':_0x14b4b9[_0x26eb84(0x1a6)]}):_0x24dd13=await withSpinner(_0x26eb84(0x13f),()=>_0x214b21['workflow'][_0x26eb84(0x8e)](_0x4668e8,{'resumeFrom':_0x489c5d,'retryParams':_0x33d5ae,'force':_0x5d06f9}),{'verbose':_0x14b4b9[_0x26eb84(0x1a6)]});const _0x277f77=_0x24dd13[_0x26eb84(0x164)];return console['error'](_0x26eb84(0x114)),console[_0x26eb84(0xb3)](_0x26eb84(0x223)+_0x277f77['attemptId']),console[_0x26eb84(0xb3)](_0x26eb84(0x1d7)+_0x277f77[_0x26eb84(0xee)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x119);['description']=a46_0x591dc6(0x1aa);async[a46_0x591dc6(0x1a1)](_0x228ec0){const _0x357d29=a46_0x591dc6,{options:_0x5106ab,args:_0x54201e,tdx:_0x19bd46}=_0x228ec0;let _0x1d1641=_0x54201e[0x0];if(!_0x1d1641){const _0x82f783=this[_0x357d29(0x203)]([],_0x5106ab),_0x1b1c54=await withSpinner(_0x357d29(0x157),()=>_0x19bd46[_0x357d29(0x1f4)]['workflows'](_0x82f783,{'limit':_0x5106ab[_0x357d29(0xa1)]}),{'verbose':_0x5106ab[_0x357d29(0x1a6)]}),_0x171b95=_0x1b1c54[_0x357d29(0x164)];if(_0x171b95[_0x357d29(0x1ff)]===0x0)return console[_0x357d29(0xb3)](_0x357d29(0x92)),!_0x82f783&&console[_0x357d29(0xb3)](a46_0x1f96c9[_0x357d29(0x192)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x47c2f2=_0x171b95[_0x357d29(0x112)](_0x2517e6=>({'title':_0x2517e6['project']?.[_0x357d29(0xc9)]+'.'+_0x2517e6[_0x357d29(0xc9)],'value':_0x2517e6[_0x357d29(0x1f6)]?.[_0x357d29(0xc9)]+'.'+_0x2517e6['name'],'description':_0x2517e6[_0x357d29(0x11b)]?'revision:\x20'+_0x2517e6['revision']:undefined})),_0x5b1ebf=await a46_0x1147d5({'type':'select','name':_0x357d29(0x1f4),'message':_0x357d29(0x21e),'choices':_0x47c2f2});if(!_0x5b1ebf[_0x357d29(0x1f4)])return 0x1;_0x1d1641=_0x5b1ebf['workflow'];}if(!_0x1d1641[_0x357d29(0x18c)]('.')){const _0x5a7ff6=this[_0x357d29(0x203)]([],_0x5106ab);if(_0x5a7ff6)_0x1d1641=_0x5a7ff6+'.'+_0x1d1641;else return console['error'](a46_0x1f96c9[_0x357d29(0xb9)](_0x357d29(0x1a9)),_0x357d29(0x221)),console[_0x357d29(0xb3)](a46_0x1f96c9[_0x357d29(0x192)](_0x357d29(0x83))),0x1;}const _0x33de10=_0x5106ab[_0x357d29(0x1d5)],_0x4d3d35=_0x5106ab[_0x357d29(0x1a5)],_0xebedaa={};if(_0x33de10&&Array[_0x357d29(0x1ba)](_0x33de10))for(const _0x1bb4a6 of _0x33de10){const _0x388322=_0x1bb4a6['indexOf']('=');if(_0x388322===-0x1)return console[_0x357d29(0xb3)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x1bb4a6),console[_0x357d29(0xb3)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x5e1ecd=_0x1bb4a6[_0x357d29(0x201)](0x0,_0x388322),_0x28c2bf=_0x1bb4a6[_0x357d29(0x201)](_0x388322+0x1);try{_0xebedaa[_0x5e1ecd]=JSON[_0x357d29(0x116)](_0x28c2bf);}catch{_0xebedaa[_0x5e1ecd]=_0x28c2bf;}}_0x5106ab[_0x357d29(0x1a6)]&&(console[_0x357d29(0xb3)](_0x357d29(0x1b8)+_0x1d1641),Object['keys'](_0xebedaa)['length']>0x0&&console['error'](_0x357d29(0x1de)+JSON[_0x357d29(0x19d)](_0xebedaa)),_0x4d3d35&&console[_0x357d29(0xb3)](_0x357d29(0x10c)+_0x4d3d35));const _0x39d8a5=await withSpinner(_0x357d29(0x117),()=>_0x19bd46[_0x357d29(0x1f4)][_0x357d29(0x1d9)](_0x1d1641,_0xebedaa,{'sessionTime':_0x4d3d35}),{'verbose':_0x5106ab['verbose']}),_0x41bb84=_0x39d8a5[_0x357d29(0x164)];console[_0x357d29(0xb3)](_0x357d29(0x13c)),console['error']('\x20\x20Attempt\x20ID:\x20'+_0x41bb84['id']),console[_0x357d29(0xb3)](_0x357d29(0x1d7)+_0x41bb84[_0x357d29(0xee)]),console[_0x357d29(0xb3)]('\x20\x20Project:\x20'+_0x41bb84['project']?.[_0x357d29(0xc9)]),console[_0x357d29(0xb3)](_0x357d29(0x18b)+_0x41bb84[_0x357d29(0x1f4)]?.[_0x357d29(0xc9)]);if(_0x41bb84[_0x357d29(0x1f6)]?.['id']&&_0x41bb84[_0x357d29(0xee)]&&_0x41bb84['id']){const _0x56047a=_0x5106ab['site'],_0x1a24c5=getConsoleUrl(_0x56047a,'/app/workflows/'+_0x41bb84[_0x357d29(0x1f6)]['id']+'/sessions/'+_0x41bb84[_0x357d29(0xee)]+_0x357d29(0xa7)+_0x41bb84['id']);console[_0x357d29(0xb3)](_0x357d29(0x19f)+a46_0x1f96c9[_0x357d29(0xd9)](_0x1a24c5));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a46_0x591dc6(0xab);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x97);async[a46_0x591dc6(0x1a1)](_0x5bed36){const _0x456e89=a46_0x591dc6,{options:_0x38c476,args:_0x465dd5,tdx:_0x14cde4}=_0x5bed36,_0x3f8f10=_0x465dd5[0x0],_0x57d838=_0x465dd5[0x1]||'.';if(!_0x3f8f10)return console['error'](_0x456e89(0x1b5)),console[_0x456e89(0xb3)](_0x456e89(0x1e0)),0x1;const _0x57f28c=_0x38c476[_0x456e89(0x11b)];_0x38c476['verbose']&&(console['error'](_0x456e89(0xb0)+_0x3f8f10),console[_0x456e89(0xb3)](_0x456e89(0xe3)+_0x57d838),_0x57f28c&&console[_0x456e89(0xb3)](_0x456e89(0x1d1)+_0x57f28c));const _0x2f8893=await withSpinner('Downloading\x20project\x20'+_0x3f8f10+_0x456e89(0x12f),()=>_0x14cde4[_0x456e89(0x1f4)][_0x456e89(0x16e)](_0x3f8f10,_0x57d838,{'revision':_0x57f28c}),{'verbose':_0x38c476[_0x456e89(0x1a6)]}),_0x3623d3=_0x2f8893[_0x456e89(0x164)];return console[_0x456e89(0xb3)](_0x456e89(0x123)+_0x3623d3['projectName']),console[_0x456e89(0xb3)](_0x456e89(0x145)+_0x3623d3[_0x456e89(0x11b)]),console[_0x456e89(0xb3)](_0x456e89(0xf8)+_0x3623d3['filesExtracted']),console[_0x456e89(0xb3)]('\x20\x20Location:\x20'+_0x57d838+'/'+_0x3623d3[_0x456e89(0x191)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x13a);[a46_0x591dc6(0x193)]=a46_0x591dc6(0xc8);async[a46_0x591dc6(0x1a1)](_0x3773c1){const _0x18e74e=a46_0x591dc6,{options:_0x8ed5bc,args:_0x430e52,tdx:_0x4232d6}=_0x3773c1;let _0x144db8='.',_0x1f402b=_0x8ed5bc[_0x18e74e(0xc9)];if(_0x430e52[0x0]){const {promises:_0x173ad5}=await import('fs');try{const _0x39d674=await _0x173ad5[_0x18e74e(0x190)](_0x430e52[0x0]);if(_0x39d674[_0x18e74e(0xaf)]())_0x144db8=_0x430e52[0x0];else return console['error'](_0x18e74e(0x15b)+_0x430e52[0x0]+_0x18e74e(0x18d)),0x1;}catch{_0x1f402b=_0x430e52[0x0],_0x144db8='.';}}const _0xd0c305=_0x8ed5bc[_0x18e74e(0x11b)],_0x26a97b=_0x8ed5bc[_0x18e74e(0x124)];_0x8ed5bc[_0x18e74e(0x1a6)]&&(console[_0x18e74e(0xb3)](_0x18e74e(0x20e)+_0x144db8),_0x1f402b&&console[_0x18e74e(0xb3)](_0x18e74e(0x1c5)+_0x1f402b),_0xd0c305&&console[_0x18e74e(0xb3)](_0x18e74e(0x1d1)+_0xd0c305),_0x26a97b&&console[_0x18e74e(0xb3)](_0x18e74e(0x10d)));const _0x48dd58=await withSpinner(_0x18e74e(0xfb),()=>_0x4232d6['workflow'][_0x18e74e(0x1dd)](_0x144db8,{'projectName':_0x1f402b,'revision':_0xd0c305,'skipValidation':_0x26a97b}),{'verbose':_0x8ed5bc['verbose']}),_0x38db18=_0x48dd58[_0x18e74e(0x164)];return console['error'](_0x18e74e(0x202)+_0x38db18[_0x18e74e(0x191)]),console[_0x18e74e(0xb3)](_0x18e74e(0x169)+_0x38db18[_0x18e74e(0xd2)]),console['error'](_0x18e74e(0x145)+_0x38db18[_0x18e74e(0x11b)]),await this['showWorkflowConsoleUrl'](_0x4232d6,_0x38db18['projectName'],_0x8ed5bc[_0x18e74e(0x1fa)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a46_0x591dc6(0xc9)]='workflow:pull';[a46_0x591dc6(0x193)]=a46_0x591dc6(0x8b);async[a46_0x591dc6(0x1a1)](_0x451730){const _0x1d62e6=a46_0x591dc6,{options:_0x122910,args:_0xc5d21c,tdx:_0x5f2d66}=_0x451730,_0x34ec84=_0xc5d21c[0x0],_0x49d441=_0xc5d21c[0x1];if(!_0x34ec84)return console[_0x1d62e6(0xb3)](a46_0x1f96c9['red'](_0x1d62e6(0x1a9)),_0x1d62e6(0x1b3)),console['error'](a46_0x1f96c9['dim']('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x2b52c6=_0x122910[_0x1d62e6(0x11b)];_0x122910['verbose']&&(console[_0x1d62e6(0xb3)](_0x1d62e6(0xb0)+_0x34ec84),_0x49d441&&console[_0x1d62e6(0xb3)](_0x1d62e6(0x96)+_0x49d441),_0x2b52c6&&console[_0x1d62e6(0xb3)](_0x1d62e6(0x1d1)+_0x2b52c6),_0x122910[_0x1d62e6(0x18a)]&&console[_0x1d62e6(0xb3)]('Dry\x20run:\x20yes'));const _0xfd7d81=await withSpinner(_0x1d62e6(0x82)+_0x34ec84+_0x1d62e6(0x12f),()=>_0x5f2d66[_0x1d62e6(0x1f4)][_0x1d62e6(0x107)](_0x34ec84,{'targetDir':_0x49d441,'revision':_0x2b52c6}),{'verbose':_0x122910[_0x1d62e6(0x1a6)]}),_0x497671=_0xfd7d81['data'];_0x497671[_0x1d62e6(0x155)]?console['error'](_0x1d62e6(0x7f)+_0x497671[_0x1d62e6(0x191)]):console[_0x1d62e6(0xb3)](_0x1d62e6(0x159)+_0x497671['projectName']);console['error'](_0x1d62e6(0x145)+_0x497671[_0x1d62e6(0x11b)]),console[_0x1d62e6(0xb3)](_0x1d62e6(0x1ed)+(a46_0x14a963['relative'](process[_0x1d62e6(0xb7)](),_0x497671['targetDir'])||'.')),console[_0x1d62e6(0xb3)](_0x1d62e6(0x1f5)+a46_0x1f96c9['green']('+'+_0x497671[_0x1d62e6(0x1cb)][_0x1d62e6(0x205)]+_0x1d62e6(0xc3))+',\x20'+(a46_0x1f96c9[_0x1d62e6(0x15c)]('~'+_0x497671[_0x1d62e6(0x1cb)][_0x1d62e6(0x9b)]+_0x1d62e6(0x1bf))+',\x20')+(a46_0x1f96c9['red']('-'+_0x497671[_0x1d62e6(0x1cb)][_0x1d62e6(0xd3)]+_0x1d62e6(0x19a))+',\x20')+(''+a46_0x1f96c9['dim'](_0x497671[_0x1d62e6(0x1cb)][_0x1d62e6(0xf7)]+_0x1d62e6(0x160))));for(const _0x5e9917 of _0x497671[_0x1d62e6(0x1ee)]){_0x5e9917[_0x1d62e6(0x1e7)]===_0x1d62e6(0x9b)&&_0x5e9917['diff']&&(console['error']('\x0a'+a46_0x1f96c9['cyan']('---\x20'+_0x5e9917[_0x1d62e6(0x167)])),console['error'](_0x5e9917['diff']));}if(!_0x497671['hasChanges'])return saveSessionContext({'workflow_project':_0x497671[_0x1d62e6(0x191)]},_0x122910['session']),console['error'](a46_0x1f96c9[_0x1d62e6(0x17f)](_0x1d62e6(0xbc))),console[_0x1d62e6(0xb3)](a46_0x1f96c9[_0x1d62e6(0x192)](_0x1d62e6(0x1e4)+_0x497671[_0x1d62e6(0x191)])),0x0;if(_0x122910['dryRun'])return console['error'](a46_0x1f96c9[_0x1d62e6(0x15c)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x122910['yes']){if(!isInteractive())return console[_0x1d62e6(0xb3)](a46_0x1f96c9[_0x1d62e6(0xb9)](_0x1d62e6(0x218)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1d62e6(0xb3)](a46_0x1f96c9[_0x1d62e6(0x192)](_0x1d62e6(0x1e6))),0x1;const _0x2da3f7=await confirmKey(_0x1d62e6(0x17a));if(!_0x2da3f7)return console['error'](a46_0x1f96c9['yellow'](_0x1d62e6(0x200)),_0x1d62e6(0x12e)),0x1;}await withSpinner(_0x1d62e6(0xda),()=>_0x5f2d66['workflow'][_0x1d62e6(0x163)](_0x497671,{'revision':_0x2b52c6}),{'verbose':_0x122910[_0x1d62e6(0x1a6)]}),saveSessionContext({'workflow_project':_0x497671[_0x1d62e6(0x191)]},_0x122910[_0x1d62e6(0xd7)]),console[_0x1d62e6(0xb3)](a46_0x1f96c9['green'](_0x1d62e6(0xc2)));const _0x151795=a46_0x14a963[_0x1d62e6(0x15d)](process[_0x1d62e6(0xb7)](),_0x497671[_0x1d62e6(0xea)])||'.';return console[_0x1d62e6(0xb3)](a46_0x1f96c9[_0x1d62e6(0x192)](_0x1d62e6(0x106)+_0x151795)),console[_0x1d62e6(0xb3)](a46_0x1f96c9[_0x1d62e6(0x192)](_0x1d62e6(0x1e4)+_0x497671[_0x1d62e6(0x191)])),0x0;}}function a46_0x5415(){const _0x4df00d=['Updating\x20','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','name','preparePushProject','No\x20sessions\x20found','List\x20workflow\x20attempts','workflow:retry','pollTimeline','\x20secret','\x0a✔\x20Attempt\x20complete','Warning:','projectId','deleted','params','\x20\x20tdx\x20wf\x20use\x20<project>','fileCount','session','GUTTER','cyan','Writing\x20files...','navigateSessionsInteractive',',\x20Workflow:\x20','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','resolve','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','status','No\x20workflows\x20found\x20in\x20project:\x20','done','Output\x20directory:\x20','3608104obsHCo','indexOf','fs/promises','attempts','Loading\x20session...','isTTY','targetDir','write','workflow:sessions','padStart','sessionId','resolveProjectDir','✔\x20Project\x20updated','size','Key\x20cannot\x20be\x20empty','renderSingleTimeline','stdout','icon','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','unchanged','\x20\x20Files\x20extracted:\x20','sort','\x0aDry\x20run\x20-\x20no\x20project\x20created','Pushing\x20workflow\x20project...','\x20has\x20no\x20attempts','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','✔\x20Workflow\x20project\x20set\x20to:\x20','\x20-\x20','\x20attempt','existingProjectId','toISOString','Downloading\x20logs...','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','workflow:secrets:set','\x20\x20Location:\x20','pullProject','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','setSecret','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','workflow:push','Session\x20time:\x20','Validation:\x20skipped','Error:\x20Attempt\x20ID\x20is\x20required','Attempt\x20ID:\x20','MAX_TIMELINE_WIDTH','basename','map','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','✔\x20Retry\x20started','Show\x20tasks\x20for\x20an\x20attempt','parse','Starting\x20workflow\x20run...','cancelRequested','workflow:run','newProjectId','revision','getFullYear','Usage:\x20tdx\x20wf\x20use\x20<project>','sys','sourceProjectName','white','\x20logs','blue','✔\x20Downloaded\x20','skipValidation','\x22?\x20This\x20cannot\x20be\x20undone.','Include\x20retried:\x20yes','\x1b[1A\x1b[2K','force','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','displayLine','clear','workflowProject','workflowName','-\x20no\x20files\x20written','...','slice','List\x20workflow\x20execution\x20sessions','Invalid\x20format:\x20','List\x20all\x20workflow\x20projects','⚠\x20Showing\x20first\x20','Dry\x20run:\x20yes','startTime','workflow:secrets:delete','Tip:\x20cd\x20to\x20workflows/','MAX_TASKS_DISPLAY','workflow:upload','155012xkNTPu','✔\x20Workflow\x20run\x20started','showWorkflowConsoleUrl','max','Retrying\x20attempt...','Resume\x20from:\x20','attempt:','buildTimelineData','\x20to\x20see\x20detailed\x20logs','(unknown)','\x20\x20Revision:\x20','canceling','table','retryAttemptName','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','tasks','tdx\x20wf\x20attempt\x20','✔\x20Project:\x20','list','MIN_TIMELINE_WIDTH','Killing\x20attempt...','newProjectName','diff','finishedAt','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','createdAt','isNewProject','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Loading\x20workflows...','No\x20attempts\x20found\x20in\x20project:\x20','→\x20Project:\x20','\x20\x20Project:\x20','Error:\x20','yellow','relative','---\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x20unchanged','Cloning\x20to\x20','Session\x20','applyPullProject','data','\x20sessions\x20','workflow:tasks','path','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','\x20\x20Project\x20ID:\x20','Auto-selected\x20latest\x20session:\x20','TASK_NAME_WIDTH','\x20(system)','planned','download','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','renderSessionsTimeline','targetExists','\x27...','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','reason','startsWith','workflow:secrets:list','end','workflow:kill','\x20(use\x20--limit\x20to\x20show\x20more)','\x0aApply\x20these\x20changes?','LABEL_MIN_SPACING','✔\x20Workflow\x20project\x20context\x20cleared.','\x0a✔\x20No\x20changes\x20to\x20push','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','green','\x0a⚠\x20Project\x20\x22','No\x20sessions\x20found\x20in\x20project:\x20','✔\x20Found\x20','149345FpIFXX','345112LIANEe','running','listSecrets','fill','select','Including\x20subtasks:\x20yes','dryRun','\x20\x20Workflow:\x20','includes','\x20is\x20not\x20a\x20directory','message','Reason:\x20','stat','projectName','dim','description','No\x20workflow\x20projects\x20found','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Analyzing\x20project...','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','includeSubtasks','Getting\x20attempt\x20tasks...','\x20deleted','output','context','stringify','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','\x20\x20Console:\x20','\x0aClone\x20\x22','execute','find','110OmSGNC','split','sessionTime','verbose','Target:\x20','15dBgttN','Error:','Start\x20a\x20workflow\x20run','.\x20Expected\x20format:\x20KEY=VALUE','requireProject','📋\x20','columns','Pushing\x20project...','No\x20sessions\x20found\x20for:\x20','Analyzing\x20changes...','✔\x20Clone\x20complete','Project\x20name\x20is\x20required','index','Error:\x20Project\x20name\x20is\x20required','fromTask','No\x20projects\x20match\x20pattern:\x20','Workflow:\x20','keys','isArray','8346888BUzrdn','workflow:workflows','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','sessions','\x20modified','Retry\x20a\x20session\x20or\x20attempt','Show\x20logs\x20for\x20a\x20workflow\x20attempt','workflow:timeline','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','toLowerCase','Project\x20name:\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','\x27\x20from\x20project\x20\x27','attemptId','pending','total','summary','window','yes','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','includeRetried','match','Revision:\x20','9noQfED','retrySession','resumeFrom','param','generateSessionTimelineRows','\x20\x20Session\x20ID:\x20','jsonl','run','workflow:clone','\x20project','ICON_WIDTH','push','Parameters:\x20','floor','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','parseProjectWorkflowPattern','Getting\x20attempt\x20details...','ICON_SPACING','\x20\x20Session\x20context\x20set\x20to:\x20','List\x20workflows','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','type','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','2529307dtHAnp','task','Fetching\x20log\x20files...','hasChanges','\x20\x20Target:\x20','changes','session:','fullName','title','startedAt','updatedAt','workflow','\x20\x20Changes:\x20','project','Listing\x20workflow\x20projects...','set','start','site','json','Deleting\x20project\x20','Key:\x20','some','length','Cancelled','substring','✔\x20Pushed\x20','resolveProject','Filter:\x20project=','new','Kill\x20a\x20running\x20attempt','splice','\x20workflow','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','12mXLAUt','now','Listing\x20workflow\x20sessions...','repeat','Project\x20directory:\x20','Session\x20not\x20found:\x20','\x0aPolling...\x20(','Error:\x20Invalid\x20JSON\x20in\x20--params','Task\x20name:\x20','Resolving\x20project\x20\x27','filter','Error:\x20Secret\x20key\x20is\x20required','Filter:\x20','✔\x20Showing\x20','\x0aError:','No\x20log\x20content\x20found','\x22\x20with\x20new\x20revision?','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','workflow:logs','localeCompare','Select\x20a\x20workflow\x20to\x20run','key','text','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','workflow:use','\x20\x20New\x20attempt\x20ID:\x20','fileSize','Listing\x20secrets...','\x22\x20already\x20exists\x20(ID:\x20','follow','executePushProject','workflow:delete','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','workflows','duration','session_id','Status:\x20','Force:\x20yes','Listing\x20workflow\x20attempts...','→\x20New\x20project:\x20','min','\x20task','Pulling\x20project\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','join','group_error','Attempt:\x20','✔\x20Secret\x20\x27','all','getDate','Project\x20filter:\x20','Pull\x20workflow\x20project\x20to\x20local\x20folder','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','delete','retryAttempt','has','✔\x20Deleted\x20project\x20','round','No\x20workflows\x20found','values','No\x20attempts\x20found\x20for:\x20','attempt','Target\x20directory:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','metadata','\x20session','No\x20log\x20files\x20found\x20for\x20this\x20attempt','modified','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','No\x20attempts\x20found','log','taskName','-\x20nothing\x20pushed','limit','renderTimeline','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','getTime','format','Loading\x20sessions...','/attempt/','Select\x20a\x20task\x20to\x20view\x20logs:','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','New\x20project\x20name:\x20','workflow:download','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','lastAttempt','isDirectory','Project:\x20','success','state','error','Using\x20attempt\x20','getMonth','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','cwd','trimEnd','red','Source\x20directory:\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','\x0a✔\x20Already\x20up\x20to\x20date','rows','No\x20workflow\x20sessions\x20found','From\x20task:\x20','from','295980XcOXjO','✔\x20Pull\x20complete','\x20new','msPerChar','Listing\x20workflows...','Deleting\x20secret...'];a46_0x5415=function(){return _0x4df00d;};return a46_0x5415();}export class WorkflowPushCommand extends WorkflowBaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x10b);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x1bd);async[a46_0x591dc6(0x1a1)](_0x20ed33){const _0x101a6b=a46_0x591dc6,{options:_0x24d268,args:_0x16115c,tdx:_0x36eb71}=_0x20ed33,_0x3909ce=this[_0x101a6b(0xef)](_0x16115c,_0x24d268),_0x127ae6=_0x24d268[_0x101a6b(0x11b)],_0x4e8dc5=_0x24d268[_0x101a6b(0x124)];_0x24d268['verbose']&&(_0x3909ce&&console[_0x101a6b(0xb3)](_0x101a6b(0xba)+_0x3909ce),_0x127ae6&&console[_0x101a6b(0xb3)]('Revision:\x20'+_0x127ae6),_0x24d268[_0x101a6b(0x18a)]&&console[_0x101a6b(0xb3)](_0x101a6b(0x135)),_0x4e8dc5&&console[_0x101a6b(0xb3)](_0x101a6b(0x10d)));let _0x50e42b;try{_0x50e42b=await withSpinner(_0x101a6b(0x1b1),()=>_0x36eb71[_0x101a6b(0x1f4)][_0x101a6b(0xca)]({'sourceDir':_0x3909ce,'revision':_0x127ae6,'skipValidation':_0x4e8dc5}),{'verbose':_0x24d268[_0x101a6b(0x1a6)]});}catch(_0x431245){if(_0x431245 instanceof Error&&_0x431245[_0x101a6b(0x18e)]['includes']('No\x20workflow\x20tdx.json\x20found'))return console[_0x101a6b(0xb3)](a46_0x1f96c9[_0x101a6b(0xb9)](_0x101a6b(0x1a9)),_0x101a6b(0xa3)),_0x24d268['workflowProject']?console[_0x101a6b(0xb3)](a46_0x1f96c9[_0x101a6b(0x192)](_0x101a6b(0x138)+_0x24d268[_0x101a6b(0x12c)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x24d268[_0x101a6b(0x12c)]+'\x27')):console[_0x101a6b(0xb3)](a46_0x1f96c9[_0x101a6b(0x192)](_0x101a6b(0x1c3))),0x1;throw _0x431245;}const _0x34f961=_0x50e42b['data'];console[_0x101a6b(0xb3)](_0x101a6b(0x14c)+_0x34f961['projectName']),console[_0x101a6b(0xb3)]('\x20\x20Source:\x20'+_0x34f961['sourceDir']),console[_0x101a6b(0xb3)](_0x101a6b(0x145)+_0x34f961['revision']),console['error'](_0x101a6b(0x1f5)+a46_0x1f96c9[_0x101a6b(0x17f)]('+'+_0x34f961['summary'][_0x101a6b(0x205)]+_0x101a6b(0xc3))+',\x20'+(a46_0x1f96c9[_0x101a6b(0x15c)]('~'+_0x34f961[_0x101a6b(0x1cb)]['modified']+_0x101a6b(0x1bf))+',\x20')+(a46_0x1f96c9[_0x101a6b(0xb9)]('-'+_0x34f961[_0x101a6b(0x1cb)][_0x101a6b(0xd3)]+_0x101a6b(0x19a))+',\x20')+(''+a46_0x1f96c9[_0x101a6b(0x192)](_0x34f961[_0x101a6b(0x1cb)][_0x101a6b(0xf7)]+_0x101a6b(0x160))));for(const _0x2bb642 of _0x34f961[_0x101a6b(0x1ee)]){_0x2bb642[_0x101a6b(0x1e7)]==='modified'&&_0x2bb642[_0x101a6b(0x151)]&&(console[_0x101a6b(0xb3)]('\x0a'+a46_0x1f96c9[_0x101a6b(0xd9)](_0x101a6b(0x15e)+_0x2bb642[_0x101a6b(0x167)])),console[_0x101a6b(0xb3)](_0x2bb642[_0x101a6b(0x151)]));}if(!_0x34f961[_0x101a6b(0x1ec)])return console[_0x101a6b(0xb3)](a46_0x1f96c9[_0x101a6b(0x17f)](_0x101a6b(0x17d))),await this[_0x101a6b(0x13d)](_0x36eb71,_0x34f961[_0x101a6b(0x191)],_0x24d268[_0x101a6b(0x1fa)]),0x0;if(_0x24d268[_0x101a6b(0x18a)])return console[_0x101a6b(0xb3)](a46_0x1f96c9[_0x101a6b(0x15c)](_0x101a6b(0x1c6))),0x0;if(!_0x24d268[_0x101a6b(0x1cd)]){if(!isInteractive())return console['error'](a46_0x1f96c9['red'](_0x101a6b(0x218)),_0x101a6b(0x195)),console[_0x101a6b(0xb3)](a46_0x1f96c9[_0x101a6b(0x192)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x253e4d=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x253e4d)return console['error'](a46_0x1f96c9['yellow'](_0x101a6b(0x200)),_0x101a6b(0xa0)),0x1;}const _0x244315=await withSpinner(_0x101a6b(0x1af),()=>_0x36eb71[_0x101a6b(0x1f4)][_0x101a6b(0x228)](_0x34f961),{'verbose':_0x24d268[_0x101a6b(0x1a6)]}),_0x4fb920=_0x244315['data'];return console[_0x101a6b(0xb3)](a46_0x1f96c9[_0x101a6b(0x17f)]('✔\x20Push\x20complete')),console['error']('\x20\x20Project\x20ID:\x20'+_0x4fb920[_0x101a6b(0xd2)]),console[_0x101a6b(0xb3)](_0x101a6b(0x145)+_0x4fb920[_0x101a6b(0x11b)]),await this[_0x101a6b(0x13d)](_0x36eb71,_0x4fb920['projectName'],_0x24d268[_0x101a6b(0x1fa)]),0x0;}}function a46_0x2532(_0x4b16d4,_0x228a88){_0x4b16d4=_0x4b16d4-0x7f;const _0x5415d2=a46_0x5415();let _0x253266=_0x5415d2[_0x4b16d4];return _0x253266;}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x1da);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x129);async['execute'](_0x511e27){const _0xaa6c73=a46_0x591dc6,{options:_0x53155b,args:_0x227b09,tdx:_0x1467d2}=_0x511e27,_0x229af7=this['resolveProjectDir'](_0x227b09,_0x53155b),_0x2a5d9f=_0x53155b[_0xaa6c73(0xc9)],_0x258363=_0x53155b[_0xaa6c73(0x11b)],_0x5f5121=_0x53155b[_0xaa6c73(0x124)];if(!_0x229af7)return console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0xb9)](_0xaa6c73(0x1a9)),'Source\x20directory\x20is\x20required'),console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0x192)](_0xaa6c73(0xf6))),console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0x192)](_0xaa6c73(0x21b))),0x1;if(!_0x2a5d9f)return console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0xb9)](_0xaa6c73(0x1a9)),_0xaa6c73(0xdd)),console[_0xaa6c73(0xb3)](a46_0x1f96c9['dim'](_0xaa6c73(0xf6))),0x1;_0x53155b[_0xaa6c73(0x1a6)]&&(console['error']('Source\x20directory:\x20'+_0x229af7),console[_0xaa6c73(0xb3)](_0xaa6c73(0xaa)+_0x2a5d9f),_0x258363&&console[_0xaa6c73(0xb3)]('Revision:\x20'+_0x258363),_0x53155b[_0xaa6c73(0x18a)]&&console[_0xaa6c73(0xb3)]('Dry\x20run:\x20yes'),_0x5f5121&&console[_0xaa6c73(0xb3)]('Validation:\x20skipped'));const _0xe3dc0d=await withSpinner(_0xaa6c73(0x196),()=>_0x1467d2[_0xaa6c73(0x1f4)]['prepareCloneProject'](_0x229af7,_0x2a5d9f,{'revision':_0x258363,'skipValidation':_0x5f5121}),{'verbose':_0x53155b['verbose']}),_0x1b716f=_0xe3dc0d[_0xaa6c73(0x164)];console[_0xaa6c73(0xb3)]('Source:\x20'+_0x1b716f['sourceDir']);_0x1b716f[_0xaa6c73(0x11f)]&&console[_0xaa6c73(0xb3)]('Source\x20project:\x20'+_0x1b716f['sourceProjectName']);console['error'](_0xaa6c73(0xaa)+_0x1b716f[_0xaa6c73(0x150)]),console[_0xaa6c73(0xb3)](_0xaa6c73(0x1d1)+_0x1b716f[_0xaa6c73(0x11b)]),console['error']('Files\x20to\x20upload:\x20'+_0x1b716f[_0xaa6c73(0xd6)]);_0x1b716f[_0xaa6c73(0x171)]&&(console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0x15c)](_0xaa6c73(0x180)+_0x1b716f[_0xaa6c73(0x150)]+_0xaa6c73(0x226)+_0x1b716f[_0xaa6c73(0x101)]+')')),console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0x15c)](_0xaa6c73(0xa9))));if(_0x53155b['dryRun'])return console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0x15c)](_0xaa6c73(0xfa))),0x0;if(!_0x53155b['yes']){if(!isInteractive())return console[_0xaa6c73(0xb3)](a46_0x1f96c9['red'](_0xaa6c73(0x218)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0x192)](_0xaa6c73(0x1e6))),0x1;const _0x2aa901=_0x1b716f[_0xaa6c73(0x11f)]||a46_0x14a963[_0xaa6c73(0x111)](_0x229af7),_0x41680a=_0x1b716f[_0xaa6c73(0x171)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x2a5d9f+_0xaa6c73(0x21a):_0xaa6c73(0x1a0)+_0x2aa901+'\x22\x20to\x20new\x20project\x20\x22'+_0x2a5d9f+'\x22?',_0x48511d=await confirmKey(_0x41680a);if(!_0x48511d)return console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0x15c)](_0xaa6c73(0x200))),0x1;}const _0xd3d402=await withSpinner(_0x1b716f[_0xaa6c73(0x171)]?_0xaa6c73(0xc7)+_0x2a5d9f+_0xaa6c73(0x12f):_0xaa6c73(0x161)+_0x2a5d9f+_0xaa6c73(0x12f),()=>_0x1467d2[_0xaa6c73(0x1f4)]['executeCloneProject'](_0x1b716f),{'verbose':_0x53155b[_0xaa6c73(0x1a6)]}),_0xfa6e75=_0xd3d402['data'];return console[_0xaa6c73(0xb3)](a46_0x1f96c9[_0xaa6c73(0x17f)](_0x1b716f['targetExists']?_0xaa6c73(0xf0):_0xaa6c73(0x1b2))),console[_0xaa6c73(0xb3)](_0xaa6c73(0x15a)+_0xfa6e75['newProjectName']),console['error'](_0xaa6c73(0x169)+_0xfa6e75[_0xaa6c73(0x11a)]),console[_0xaa6c73(0xb3)](_0xaa6c73(0x145)+_0xfa6e75[_0xaa6c73(0x11b)]),await this[_0xaa6c73(0x13d)](_0x1467d2,_0xfa6e75[_0xaa6c73(0x150)],_0x53155b[_0xaa6c73(0x1fa)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x229);[a46_0x591dc6(0x193)]=a46_0x591dc6(0xad);async[a46_0x591dc6(0x1a1)](_0x35407a){const _0x77adb0=a46_0x591dc6,{options:_0x28657a,args:_0x507d6f,tdx:_0x621581}=_0x35407a,_0x5a75e1=_0x507d6f[0x0];if(!_0x5a75e1)return console['error'](_0x77adb0(0x17e)),console[_0x77adb0(0xb3)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x28657a['verbose']&&console['error'](_0x77adb0(0xb0)+_0x5a75e1);if(!_0x28657a[_0x77adb0(0x1cd)]){if(!isInteractive())return console[_0x77adb0(0xb3)](a46_0x1f96c9[_0x77adb0(0xb9)](_0x77adb0(0x218)),_0x77adb0(0x195)),console[_0x77adb0(0xb3)](a46_0x1f96c9[_0x77adb0(0x192)](_0x77adb0(0x1e6))),0x1;const _0x2f5367=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x5a75e1+_0x77adb0(0x125));if(!_0x2f5367)return console[_0x77adb0(0xb3)](a46_0x1f96c9[_0x77adb0(0x15c)](_0x77adb0(0x200))),0x1;}const _0x16ff8c=await withSpinner(_0x77adb0(0x1fc)+_0x5a75e1+_0x77adb0(0x12f),()=>_0x621581[_0x77adb0(0x1f4)][_0x77adb0(0x8d)](_0x5a75e1),{'verbose':_0x28657a[_0x77adb0(0x1a6)]}),_0x4f70d6=_0x16ff8c['data'];return console[_0x77adb0(0xb3)](_0x77adb0(0x90)+_0x4f70d6[_0x77adb0(0x191)]),console[_0x77adb0(0xb3)](_0x77adb0(0x169)+_0x4f70d6[_0x77adb0(0xd2)]),0x0;}}export function parseKeyValue(_0xc606e4){const _0x419b2c=a46_0x591dc6,_0x42a4ba=_0xc606e4[_0x419b2c(0xe5)]('=');if(_0x42a4ba===-0x1)throw new Error(_0x419b2c(0x132)+_0xc606e4+_0x419b2c(0x1ab));const _0x3f7e8d=_0xc606e4[_0x419b2c(0x201)](0x0,_0x42a4ba),_0x50eb01=_0xc606e4[_0x419b2c(0x201)](_0x42a4ba+0x1);if(!_0x3f7e8d)throw new Error(_0x419b2c(0xf2));return{'key':_0x3f7e8d,'value':_0x50eb01};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x176);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x1e8);async['execute'](_0x48c514){const _0x5ea267=a46_0x591dc6,{options:_0x488049,args:_0x1e7197,tdx:_0x5c7f0e}=_0x48c514,_0x3f3989=this['requireProject'](_0x1e7197,_0x488049);if(!_0x3f3989)return 0x1;_0x488049[_0x5ea267(0x1a6)]&&console['error'](_0x5ea267(0xb0)+_0x3f3989);const _0x2ac552=await withSpinner(_0x5ea267(0x225),()=>_0x5c7f0e[_0x5ea267(0x1f4)][_0x5ea267(0x186)](_0x3f3989),{'verbose':_0x488049[_0x5ea267(0x1a6)]}),{secrets:_0x285934}=_0x2ac552[_0x5ea267(0x164)];return console[_0x5ea267(0xb3)](_0x5ea267(0x182)+_0x285934[_0x5ea267(0x1ff)]+_0x5ea267(0xcf)+(_0x285934['length']!==0x1?'s':'')),await handleSDKOutput(_0x285934,_0x488049),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a46_0x591dc6(0x105);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x149);async['execute'](_0x541e64){const _0x48817e=a46_0x591dc6,{options:_0x57a14f,args:_0x403ade,tdx:_0x2a9bfb}=_0x541e64;let _0x4afdb2,_0x29ba21;if(_0x403ade['length']>=0x2)_0x4afdb2=_0x403ade[0x0],_0x29ba21=_0x403ade[0x1];else{if(_0x403ade[_0x48817e(0x1ff)]===0x1&&_0x57a14f[_0x48817e(0x12c)])_0x4afdb2=_0x57a14f[_0x48817e(0x12c)],_0x29ba21=_0x403ade[0x0];else return _0x403ade[_0x48817e(0x1ff)]===0x1?(console['error'](_0x48817e(0x1b5)),console[_0x48817e(0xb3)](_0x48817e(0x83)),0x1):(console[_0x48817e(0xb3)]('Error:\x20KEY=VALUE\x20is\x20required'),console[_0x48817e(0xb3)](_0x48817e(0x9c)),0x1);}let _0x4e0c2f,_0x445cbb;try{({key:_0x4e0c2f,value:_0x445cbb}=parseKeyValue(_0x29ba21));}catch(_0x222332){return _0x222332 instanceof Error&&console[_0x48817e(0xb3)](a46_0x1f96c9['red'](_0x48817e(0x1a9)),_0x222332[_0x48817e(0x18e)]),0x1;}_0x57a14f[_0x48817e(0x1a6)]&&(console[_0x48817e(0xb3)](_0x48817e(0xb0)+_0x4afdb2),console['error'](_0x48817e(0x1fd)+_0x4e0c2f));const _0x141511=await withSpinner('Setting\x20secret...',()=>_0x2a9bfb[_0x48817e(0x1f4)][_0x48817e(0x109)](_0x4afdb2,_0x4e0c2f,_0x445cbb),{'verbose':_0x57a14f[_0x48817e(0x1a6)]}),_0xdc055=_0x141511[_0x48817e(0x164)];return console[_0x48817e(0xb3)](_0x48817e(0x87)+_0xdc055[_0x48817e(0x21f)]+_0x48817e(0x197)+_0xdc055[_0x48817e(0x191)]+'\x27'),(_0x57a14f[_0x48817e(0x1fb)]||_0x57a14f['jsonl'])&&await handleSingleObjectOutput(_0xdc055,_0x57a14f),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a46_0x591dc6(0xc9)]=a46_0x591dc6(0x137);[a46_0x591dc6(0x193)]=a46_0x591dc6(0x22a);async[a46_0x591dc6(0x1a1)](_0x30a400){const _0x1d210a=a46_0x591dc6,{options:_0x30bdab,args:_0x57bb64,tdx:_0x193785}=_0x30a400;let _0x129784,_0x366049;if(_0x57bb64[_0x1d210a(0x1ff)]>=0x2)_0x129784=_0x57bb64[0x0],_0x366049=_0x57bb64[0x1];else{if(_0x57bb64[_0x1d210a(0x1ff)]===0x1&&_0x30bdab['workflowProject'])_0x129784=_0x30bdab[_0x1d210a(0x12c)],_0x366049=_0x57bb64[0x0];else return _0x57bb64['length']===0x1?(console[_0x1d210a(0xb3)](_0x1d210a(0x1b5)),console[_0x1d210a(0xb3)](_0x1d210a(0x83)),0x1):(console[_0x1d210a(0xb3)](_0x1d210a(0x215)),console[_0x1d210a(0xb3)](_0x1d210a(0x108)),0x1);}_0x30bdab['verbose']&&(console[_0x1d210a(0xb3)](_0x1d210a(0xb0)+_0x129784),console[_0x1d210a(0xb3)]('Key:\x20'+_0x366049));if(!_0x30bdab[_0x1d210a(0x1cd)]){if(!isInteractive())return console[_0x1d210a(0xb3)](a46_0x1f96c9[_0x1d210a(0xb9)](_0x1d210a(0x218)),_0x1d210a(0x195)),console[_0x1d210a(0xb3)](a46_0x1f96c9[_0x1d210a(0x192)](_0x1d210a(0x1e6))),0x1;const _0x2c4418=await confirmKey(_0x1d210a(0x209)+_0x366049+_0x1d210a(0x1c7)+_0x129784+'\x27?');if(!_0x2c4418)return console[_0x1d210a(0xb3)](a46_0x1f96c9['yellow'](_0x1d210a(0x200))),0x1;}const _0x3be673=await withSpinner(_0x1d210a(0xc6),()=>_0x193785['workflow']['deleteSecret'](_0x129784,_0x366049),{'verbose':_0x30bdab[_0x1d210a(0x1a6)]}),_0x3fa871=_0x3be673[_0x1d210a(0x164)];return console['error'](_0x1d210a(0x87)+_0x3fa871[_0x1d210a(0x21f)]+_0x1d210a(0x113)+_0x3fa871[_0x1d210a(0x191)]+'\x27'),(_0x30bdab['json']||_0x30bdab[_0x1d210a(0x1d8)])&&await handleSingleObjectOutput(_0x3fa871,_0x30bdab),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(_0x4d6956){const _0x318b2f=a46_0x591dc6,_0x291eca=Math[_0x318b2f(0x1df)](_0x4d6956/0x3e8),_0x1d2032=Math[_0x318b2f(0x1df)](_0x291eca/0x3c),_0x118473=Math[_0x318b2f(0x1df)](_0x1d2032/0x3c),_0x4d3966=Math['floor'](_0x118473/0x18);if(_0x4d3966>0x0){const _0x19e9fd=_0x118473%0x18;return _0x19e9fd>0x0?_0x4d3966+'d\x20'+_0x19e9fd+'h':_0x4d3966+'d';}else{if(_0x118473>0x0){const _0x50f46e=_0x1d2032%0x3c;return _0x50f46e>0x0?_0x118473+'h\x20'+_0x50f46e+'m':_0x118473+'h';}else{if(_0x1d2032>0x0){const _0x32fad8=_0x291eca%0x3c;return _0x32fad8>0x0?_0x1d2032+'m\x20'+_0x32fad8+'s':_0x1d2032+'m';}else return _0x291eca+'s';}}}function formatTimestamp(_0x164b2b,_0x477106){const _0x42959c=a46_0x591dc6,_0x4d7de0=new Date(_0x164b2b),_0x401497=String(_0x4d7de0['getHours']())['padStart'](0x2,'0'),_0x52b2a6=String(_0x4d7de0['getMinutes']())[_0x42959c(0xed)](0x2,'0'),_0x1c9773=_0x401497+':'+_0x52b2a6,_0x1ed625=_0x4d7de0[_0x42959c(0x11c)]()===_0x477106[_0x42959c(0x11c)]()&&_0x4d7de0[_0x42959c(0xb5)]()===_0x477106['getMonth']()&&_0x4d7de0[_0x42959c(0x89)]()===_0x477106['getDate']();if(_0x1ed625)return _0x1c9773;else{const _0x549d49=String(_0x4d7de0[_0x42959c(0xb5)]()+0x1)[_0x42959c(0xed)](0x2,'0'),_0x70420e=String(_0x4d7de0['getDate']())[_0x42959c(0xed)](0x2,'0');return _0x549d49+'-'+_0x70420e+'\x20'+_0x1c9773;}}function formatDate(_0x484673){const _0x171ad2=a46_0x591dc6,_0x223867=_0x484673[_0x171ad2(0x11c)](),_0x5549f2=String(_0x484673[_0x171ad2(0xb5)]()+0x1)['padStart'](0x2,'0'),_0xb24153=String(_0x484673['getDate']())[_0x171ad2(0xed)](0x2,'0');return _0x223867+'-'+_0x5549f2+'-'+_0xb24153;}function getTaskStateIcon(_0x412f1f){const _0x1ab5a7={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x1ab5a7[_0x412f1f]||'⚪';}function getBarChar(_0x23db8d){const _0x5c8c42=a46_0x591dc6;return _0x23db8d===_0x5c8c42(0xb3)||_0x23db8d===_0x5c8c42(0x85)?'×':'─';}function getBarColor(_0x129267){const _0x205c27=a46_0x591dc6,_0x21d1a6={'success':a46_0x1f96c9[_0x205c27(0x17f)],'error':a46_0x1f96c9['red'],'group_error':a46_0x1f96c9[_0x205c27(0xb9)],'running':a46_0x1f96c9[_0x205c27(0x122)],'blocked':a46_0x1f96c9['yellow'],'planned':a46_0x1f96c9[_0x205c27(0x192)],'canceling':a46_0x1f96c9[_0x205c27(0x15c)]};return _0x21d1a6[_0x129267]||a46_0x1f96c9[_0x205c27(0x120)];}function parseTaskName(_0x269d39){const _0x2fd023=a46_0x591dc6;let _0x1b0857=_0x269d39['replace'](/^\++/,'');const _0x33ec6d=_0x1b0857[_0x2fd023(0x1a4)]('+'),_0x11c9a7=_0x33ec6d[_0x2fd023(0x1ff)]>0x1?_0x33ec6d['length']-0x2:0x0,_0x500725=_0x33ec6d[_0x33ec6d['length']-0x1]||_0x1b0857;return{'level':_0x11c9a7,'name':'+'+_0x500725};}function truncateTaskName(_0x3d993b,_0x50853d){const _0xbb01bf=a46_0x591dc6,_0x2d3636=stringWidth(_0x3d993b);if(_0x2d3636<=_0x50853d)return _0x3d993b;let _0x434bae=_0x3d993b;while(stringWidth(_0x434bae+'…')>_0x50853d&&_0x434bae[_0xbb01bf(0x1ff)]>0x0){_0x434bae=_0x434bae[_0xbb01bf(0x130)](0x0,-0x1);}return _0x434bae+'…';}function calculateTimeScale(_0x357a78,_0x44569c){const _0xc60444=a46_0x591dc6;return{'startTime':_0x357a78[_0xc60444(0x1f9)],'endTime':_0x357a78[_0xc60444(0x177)],'durationMs':_0x357a78[_0xc60444(0x22c)],'msPerChar':_0x357a78[_0xc60444(0x22c)]/_0x44569c};}function timeToPosition(_0x3f457d,_0x93e0a0,_0x357df8){const _0x41e1db=a46_0x591dc6,_0x48d351=_0x3f457d-_0x93e0a0[_0x41e1db(0x136)],_0x22eeaa=Math[_0x41e1db(0x1df)](_0x48d351/_0x93e0a0[_0x41e1db(0xc4)]);return Math[_0x41e1db(0x13e)](0x0,Math[_0x41e1db(0x80)](_0x22eeaa,_0x357df8));}function renderTimeAxis(_0x45b9b8,_0x500a03){const _0x57eeb3=a46_0x591dc6,_0x9cdb9f=Math[_0x57eeb3(0x80)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x57eeb3(0x13e)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x57eeb3(0x1df)](_0x500a03/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x4858d1=_0x45b9b8['durationMs']/(_0x9cdb9f-0x1),_0x437d36=new Date(_0x45b9b8[_0x57eeb3(0x136)]),_0x3770fc=[];for(let _0x52ad37=0x0;_0x52ad37<_0x9cdb9f;_0x52ad37++){const _0x563aa5=_0x45b9b8[_0x57eeb3(0x136)]+_0x52ad37*_0x4858d1,_0x239119=timeToPosition(_0x563aa5,_0x45b9b8,_0x500a03),_0x33af50=formatTimestamp(_0x563aa5,_0x437d36);_0x3770fc[_0x57eeb3(0x1dd)]({'pos':_0x239119,'text':_0x33af50});}const _0x522c5d=new Array(_0x500a03)['fill']('\x20');let _0xd56e35=-0x1;for(const {pos:_0x46cc30,text:_0x45f942}of _0x3770fc){let _0x3b0c61=Math['max'](0x0,_0x46cc30-Math[_0x57eeb3(0x1df)](_0x45f942[_0x57eeb3(0x1ff)]/0x2));_0x3b0c61<=_0xd56e35+TIMELINE_CONFIG[_0x57eeb3(0x17b)]&&(_0x3b0c61=_0xd56e35+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x3b0c61+_0x45f942[_0x57eeb3(0x1ff)]>_0x500a03&&(_0x3b0c61=_0x500a03-_0x45f942['length']);if(_0x3b0c61>=0x0&&_0x3b0c61+_0x45f942[_0x57eeb3(0x1ff)]<=_0x500a03&&_0x3b0c61>_0xd56e35){for(let _0x122703=0x0;_0x122703<_0x45f942['length'];_0x122703++){_0x522c5d[_0x3b0c61+_0x122703]=_0x45f942[_0x122703];}_0xd56e35=_0x3b0c61+_0x45f942[_0x57eeb3(0x1ff)]-0x1;}}return _0x522c5d[_0x57eeb3(0x84)]('');}function renderTaskRow(_0x2a25ca,_0x2c3506,_0x5a7754,_0x41a5a9){const _0x4e8606=a46_0x591dc6,{level:_0x3edb52,name:_0x2a36ca}=parseTaskName(_0x2a25ca[_0x4e8606(0xc9)]),_0x378c78='\x20'[_0x4e8606(0x20d)](_0x3edb52),_0x2d8919=_0x2a25ca[_0x4e8606(0x1cc)]?'('+formatElapsed(_0x2a25ca[_0x4e8606(0x1cc)][_0x4e8606(0x22c)])+')':'',_0x2a3981=stringWidth(_0x2d8919),_0x2efba8=_0x3edb52*0x1,_0x57480e=_0x41a5a9-_0x2efba8-_0x2a3981-0x1,_0x18a197=truncateTaskName(_0x2a36ca,_0x57480e),_0x41905e=_0x378c78+_0x18a197,_0x2755bd=stringWidth(_0x41905e),_0x464669=_0x41a5a9-_0x2755bd-_0x2a3981,_0x3be83f=_0x41905e+'\x20'[_0x4e8606(0x20d)](Math[_0x4e8606(0x13e)](0x1,_0x464669))+a46_0x1f96c9['dim'](_0x2d8919),_0x18c578=getTaskStateIcon(_0x2a25ca['state']),_0x39318f=new Array(_0x5a7754)[_0x4e8606(0x187)]('\x20');if(_0x2a25ca[_0x4e8606(0x1cc)]){const _0x4ba5ec=timeToPosition(_0x2a25ca[_0x4e8606(0x1cc)][_0x4e8606(0x1f9)],_0x2c3506,_0x5a7754),_0x59b05b=timeToPosition(_0x2a25ca[_0x4e8606(0x1cc)]['end'],_0x2c3506,_0x5a7754),_0x35f798=getBarChar(_0x2a25ca[_0x4e8606(0xb2)]),_0x216068=Math['max'](_0x4ba5ec+0x1,_0x59b05b);for(let _0x20c21f=_0x4ba5ec;_0x20c21f<Math[_0x4e8606(0x80)](_0x216068,_0x5a7754);_0x20c21f++){_0x39318f[_0x20c21f]=_0x35f798;}}const _0xa0edbd=getBarColor(_0x2a25ca[_0x4e8606(0xb2)]),_0x2a0926=_0x39318f[_0x4e8606(0x112)](_0x52a672=>_0x52a672==='\x20'?'\x20':_0xa0edbd(_0x52a672))['join']('');return _0x18c578+'\x20'+_0x3be83f+'│'+_0x2a0926+'│';}function calculateStats(_0x36e205){const _0x4b01d4=a46_0x591dc6,_0x1b08f0={'total':_0x36e205[_0x4b01d4(0x1ff)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x1bc202 of _0x36e205){if(_0x1bc202['state']===_0x4b01d4(0xb1))_0x1b08f0[_0x4b01d4(0xb1)]++;else{if(_0x1bc202[_0x4b01d4(0xb2)]===_0x4b01d4(0xb3)||_0x1bc202[_0x4b01d4(0xb2)]==='group_error')_0x1b08f0[_0x4b01d4(0xb3)]++;else _0x1bc202[_0x4b01d4(0xb2)]===_0x4b01d4(0x185)?_0x1b08f0[_0x4b01d4(0x185)]++:_0x1b08f0['pending']++;}}return _0x1b08f0;}function formatStats(_0x3f57ec){const _0x2984b9=a46_0x591dc6;return['Total:\x20'+_0x3f57ec[_0x2984b9(0x1ca)],'✅\x20'+_0x3f57ec[_0x2984b9(0xb1)],'❌\x20'+_0x3f57ec[_0x2984b9(0xb3)],'🔄\x20'+_0x3f57ec[_0x2984b9(0x185)],'⏳\x20'+_0x3f57ec[_0x2984b9(0x1c9)]][_0x2984b9(0x84)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a46_0x591dc6(0x1c2);['description']=a46_0x591dc6(0x168);async['execute'](_0x52c25c){const _0x15b007=a46_0x591dc6,{options:_0x2e2c31,args:_0x478a02,tdx:_0x1a2613}=_0x52c25c;let _0x3c2189,_0x5403b2,_0x5327fe=![];if(_0x478a02[0x0]){if(_0x478a02[0x0][_0x15b007(0x18c)]('.')){const _0x259f0f=this[_0x15b007(0x1e1)](_0x478a02,_0x2e2c31);if(!_0x259f0f)return 0x1;_0x3c2189=_0x259f0f[_0x15b007(0x191)],_0x5403b2=_0x259f0f[_0x15b007(0x12d)];}else{_0x5403b2=_0x478a02[0x0],_0x3c2189=_0x2e2c31[_0x15b007(0x12c)];if(!_0x3c2189)return console[_0x15b007(0xb3)](a46_0x1f96c9['red'](_0x15b007(0x1a9)),_0x15b007(0x153)),0x1;_0x5327fe=!![];}}else{const _0x1e8ecc=this['parseProjectWorkflowPattern'](_0x478a02,_0x2e2c31);if(!_0x1e8ecc)return 0x1;_0x3c2189=_0x1e8ecc[_0x15b007(0x191)],_0x5403b2=_0x1e8ecc[_0x15b007(0x12d)];}if(_0x2e2c31[_0x15b007(0x1a6)]){if(_0x3c2189&&_0x5403b2)console[_0x15b007(0xb3)]('Filter:\x20'+_0x3c2189+'.'+_0x5403b2);else _0x3c2189&&console['error'](_0x15b007(0x204)+_0x3c2189);}const _0x355a97=_0x2e2c31[_0x15b007(0x1c8)],_0x40ec71=_0x2e2c31[_0x15b007(0xee)];if(_0x355a97){_0x40ec71&&console[_0x15b007(0xb3)](a46_0x1f96c9[_0x15b007(0x15c)](_0x15b007(0xd1)),_0x15b007(0xdf));const _0x1dcf97=_0x2e2c31[_0x15b007(0x227)];return _0x1dcf97?await this[_0x15b007(0xce)](_0x52c25c,_0x355a97):await this[_0x15b007(0xf3)](_0x52c25c,_0x355a97,_0x2e2c31),0x0;}if(_0x40ec71){const _0x572cdc=await withSpinner(_0x15b007(0xe8),()=>_0x1a2613['workflow']['sessions']({'projectName':_0x3c2189,'workflowName':_0x5403b2,'limit':0x64}),{'verbose':_0x2e2c31[_0x15b007(0x1a6)]}),_0x45f22e=_0x572cdc[_0x15b007(0x164)][_0x15b007(0x1a2)](_0x29b14b=>_0x29b14b['id']===_0x40ec71);if(!_0x45f22e)return console[_0x15b007(0xb3)](a46_0x1f96c9[_0x15b007(0xb9)]('Error:'),_0x15b007(0x20f)+_0x40ec71),0x1;if(!_0x45f22e['lastAttempt']?.['id'])return console[_0x15b007(0xb3)](a46_0x1f96c9['red'](_0x15b007(0x1a9)),_0x15b007(0x162)+_0x40ec71+_0x15b007(0xfc)),0x1;const _0x5e132b=_0x45f22e['lastAttempt']['id'];_0x2e2c31['verbose']&&console[_0x15b007(0xb3)](_0x15b007(0xb4)+_0x5e132b+'\x20from\x20session\x20'+_0x40ec71);const _0x45b306=_0x2e2c31[_0x15b007(0x227)];return _0x45b306?await this['pollTimeline'](_0x52c25c,_0x5e132b):await this[_0x15b007(0xf3)](_0x52c25c,_0x5e132b,_0x2e2c31),0x0;}const _0x3beada=await withSpinner(_0x15b007(0xa6),()=>_0x1a2613[_0x15b007(0x1f4)][_0x15b007(0x1be)]({'projectName':_0x3c2189,'workflowName':_0x5403b2,'limit':_0x2e2c31[_0x15b007(0xa1)]||0x32}),{'verbose':_0x2e2c31[_0x15b007(0x1a6)]}),_0x538402=_0x3beada[_0x15b007(0x164)];if(_0x538402[_0x15b007(0x1ff)]===0x0){if(_0x3c2189&&_0x5403b2)console[_0x15b007(0xb3)](_0x15b007(0x1b0)+_0x3c2189+'.'+_0x5403b2);else _0x3c2189?console[_0x15b007(0xb3)](_0x15b007(0x181)+_0x3c2189):(console['error'](_0x15b007(0xbe)),console['error'](a46_0x1f96c9['dim'](_0x15b007(0x8c))));return 0x0;}_0x538402[_0x15b007(0xf9)]((_0x1c2c30,_0xd15ae)=>{const _0x53fb43=_0x15b007,_0xc858d0=_0x1c2c30[_0x53fb43(0x1a5)]||'',_0x3a309e=_0xd15ae[_0x53fb43(0x1a5)]||'';return _0x3a309e['localeCompare'](_0xc858d0);});if(_0x2e2c31[_0x15b007(0x1fb)]||_0x2e2c31[_0x15b007(0x1d8)])return await handleSDKOutput(_0x538402,_0x2e2c31),0x0;let _0x56c8b5;if(_0x5327fe){const _0x56c17e=_0x538402[0x0];if(!_0x56c17e[_0x15b007(0xae)]?.['id'])return console['error']('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x56c8b5=_0x56c17e[_0x15b007(0xae)]['id'],_0x2e2c31[_0x15b007(0x1a6)]&&console[_0x15b007(0xb3)](_0x15b007(0x16a)+_0x56c17e['sessionTime']);}else{const _0x2f545c=_0x538402['map'](_0x51315c=>{const _0x846fa3=_0x15b007,_0x1fb9ea=getAttemptStatusDisplay(_0x51315c[_0x846fa3(0xae)]);return{'title':_0x51315c[_0x846fa3(0x1f6)]?.[_0x846fa3(0xc9)]+'.'+_0x51315c[_0x846fa3(0x1f4)]?.[_0x846fa3(0xc9)]+_0x846fa3(0xff)+_0x51315c[_0x846fa3(0x1a5)]+'\x20'+_0x1fb9ea[_0x846fa3(0xf5)],'value':_0x51315c[_0x846fa3(0xae)]?.['id']||'','description':_0x1fb9ea[_0x846fa3(0x220)]};}),_0x3e74c1=await a46_0x1147d5({'type':'select','name':_0x15b007(0x1c8),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x2f545c[_0x15b007(0x214)](_0x568ed9=>_0x568ed9['value']!=='')});if(!_0x3e74c1['attemptId'])return 0x0;_0x56c8b5=_0x3e74c1['attemptId'];}const _0x2eb482=_0x2e2c31[_0x15b007(0x227)];return _0x2eb482?await this[_0x15b007(0xce)](_0x52c25c,_0x56c8b5):await this['renderSingleTimeline'](_0x52c25c,_0x56c8b5,_0x2e2c31),0x0;}async[a46_0x591dc6(0xf3)](_0x257268,_0x54a38d,_0x36b4b9){const _0x4bd3e8=a46_0x591dc6,{tdx:_0x1166b0}=_0x257268;let _0x2928a3,_0x43160d;try{[_0x2928a3,_0x43160d]=await Promise[_0x4bd3e8(0x88)]([_0x1166b0[_0x4bd3e8(0x1f4)]['attempt'](_0x54a38d),_0x1166b0[_0x4bd3e8(0x1f4)][_0x4bd3e8(0x14a)](_0x54a38d,![])]);}catch(_0x57bec1){console[_0x4bd3e8(0xb3)](a46_0x1f96c9[_0x4bd3e8(0xb9)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x36b4b9[_0x4bd3e8(0x1a6)]&&console['error'](_0x57bec1);throw _0x57bec1;}if(_0x36b4b9[_0x4bd3e8(0x1fb)]||_0x36b4b9['jsonl']){const _0x19744a=this[_0x4bd3e8(0x142)](_0x2928a3,_0x43160d);await handleSDKOutput([_0x19744a],_0x36b4b9);return;}const _0x348055=_0x1166b0[_0x4bd3e8(0x19c)][_0x4bd3e8(0x1fa)],_0xd1752c=this[_0x4bd3e8(0xa2)](_0x2928a3,_0x43160d,_0x348055);console['log'](_0xd1752c);}async[a46_0x591dc6(0xce)](_0x3067aa,_0x4b4253){const _0x23f49d=a46_0x591dc6,{tdx:_0x5acc37}=_0x3067aa,_0x3f9b1d=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x42ce4d=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x99f558=0x0;while(_0x99f558<_0x42ce4d){process[_0x23f49d(0xf4)][_0x23f49d(0xe9)]&&process[_0x23f49d(0xf4)][_0x23f49d(0xeb)]('\x1bc');let _0x7a9d12,_0x35ab1e;try{[_0x7a9d12,_0x35ab1e]=await Promise['all']([_0x5acc37[_0x23f49d(0x1f4)][_0x23f49d(0x95)](_0x4b4253),_0x5acc37[_0x23f49d(0x1f4)][_0x23f49d(0x14a)](_0x4b4253,![])]);}catch(_0x4c21aa){console[_0x23f49d(0xb3)](a46_0x1f96c9[_0x23f49d(0xb9)](_0x23f49d(0x156)));_0x99f558>0x0&&console[_0x23f49d(0xb3)](a46_0x1f96c9[_0x23f49d(0x192)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x99f558));throw _0x4c21aa;}const _0x2d5460=_0x5acc37['context'][_0x23f49d(0x1fa)],_0x18d4ba=this[_0x23f49d(0xa2)](_0x7a9d12,_0x35ab1e,_0x2d5460);console['log'](_0x18d4ba);const _0x2de901=_0x7a9d12[_0x23f49d(0xe2)]&&_0x35ab1e['every'](_0x47531a=>_0x47531a[_0x23f49d(0xb2)]!==_0x23f49d(0x185)&&_0x47531a['state']!=='planned');if(_0x2de901){console[_0x23f49d(0xb3)](a46_0x1f96c9[_0x23f49d(0x17f)](_0x23f49d(0xd0)));break;}console[_0x23f49d(0xb3)](a46_0x1f96c9[_0x23f49d(0x192)](_0x23f49d(0x210)+_0x99f558*0x2+_0x23f49d(0xbb))),await new Promise(_0x440ce3=>setTimeout(_0x440ce3,_0x3f9b1d)),_0x99f558++;}_0x99f558>=_0x42ce4d&&console[_0x23f49d(0xb3)](a46_0x1f96c9['yellow'](_0x23f49d(0x173)));}[a46_0x591dc6(0xa2)](_0x4f5973,_0x5a9bf1,_0x4926e9){const _0xa85c74=a46_0x591dc6,_0x2165e1=[],_0x53d95e=TIMELINE_CONFIG[_0xa85c74(0x16b)],_0x1a870b=0x5,_0x2a6e02=process[_0xa85c74(0xf4)][_0xa85c74(0x1ae)]||0x78,_0x5acf47=_0x2a6e02-_0x53d95e-_0x1a870b,_0x258584=Math[_0xa85c74(0x13e)](TIMELINE_CONFIG[_0xa85c74(0x14e)],Math['min'](_0x5acf47,TIMELINE_CONFIG[_0xa85c74(0x110)])),_0x31eae7=new Date(_0x4f5973[_0xa85c74(0x154)])[_0xa85c74(0xa4)](),_0x4ebc04=_0x4f5973[_0xa85c74(0x152)]?new Date(_0x4f5973[_0xa85c74(0x152)])['getTime']():Date[_0xa85c74(0x20b)](),_0x53f2bf={'start':_0x31eae7,'end':_0x4ebc04,'duration':_0x4ebc04-_0x31eae7},_0x1a74d5=new Map(),_0x5d1fea=[];for(const _0x18dd83 of _0x5a9bf1){if(_0x18dd83['startedAt']){const _0x1e62de=new Date(_0x18dd83[_0xa85c74(0x1f2)])['getTime'](),_0x55ce1e=_0x18dd83['updatedAt']?new Date(_0x18dd83[_0xa85c74(0x1f3)])[_0xa85c74(0xa4)]():Date[_0xa85c74(0x20b)](),_0x21c64a={'start':_0x1e62de,'end':_0x55ce1e,'duration':_0x55ce1e-_0x1e62de};_0x1a74d5[_0xa85c74(0x1f8)](_0x18dd83['id'],_0x21c64a),_0x5d1fea['push']({'name':_0x18dd83[_0xa85c74(0x1f0)],'state':_0x18dd83[_0xa85c74(0xb2)]||'unknown','window':_0x21c64a});}else _0x5d1fea[_0xa85c74(0x1dd)]({'name':_0x18dd83[_0xa85c74(0x1f0)],'state':_0x18dd83[_0xa85c74(0xb2)]||_0xa85c74(0x16d),'window':undefined});}_0x5d1fea['sort']((_0x417744,_0x223d6b)=>{const _0x2fe4e7=_0xa85c74;if(!_0x417744[_0x2fe4e7(0x1cc)])return 0x1;if(!_0x223d6b[_0x2fe4e7(0x1cc)])return-0x1;return _0x417744[_0x2fe4e7(0x1cc)]['start']-_0x223d6b['window'][_0x2fe4e7(0x1f9)];});const _0x523b76=_0x5d1fea[_0xa85c74(0x1ff)],_0x5cbcc9=_0x523b76>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x5cbcc9&&_0x5d1fea[_0xa85c74(0x207)](TIMELINE_CONFIG[_0xa85c74(0x139)]);const _0x2c43ab=calculateTimeScale(_0x53f2bf,_0x258584),_0x9ed2a8=_0x4f5973[_0xa85c74(0xe2)]?_0x4f5973[_0xa85c74(0xb1)]?a46_0x1f96c9[_0xa85c74(0x17f)](_0xa85c74(0xb1)):a46_0x1f96c9[_0xa85c74(0xb9)](_0xa85c74(0xb3)):a46_0x1f96c9[_0xa85c74(0x122)]('running'),_0x4a8cb4=_0x4f5973[_0xa85c74(0x1f6)]?.['id'],_0x51f3da=_0x4f5973[_0xa85c74(0xee)];let _0x2a5eed;if(_0x4a8cb4&&_0x51f3da){const _0x3abe28=getWorkflowAttemptUrl(_0x4926e9,_0x4a8cb4,_0x51f3da,_0x4f5973['id']);_0x2a5eed=hyperlink(a46_0x1f96c9[_0xa85c74(0x192)](_0x4f5973['id']),_0x3abe28);}else _0x2a5eed=a46_0x1f96c9[_0xa85c74(0x192)](_0x4f5973['id']);_0x2165e1[_0xa85c74(0x1dd)](_0xa85c74(0x86)+_0x2a5eed+_0xa85c74(0xff)+_0x9ed2a8+_0xa85c74(0xff)+formatElapsed(_0x53f2bf[_0xa85c74(0x22c)]));if(_0x5d1fea['length']>0x0){const _0x11f384=renderTimeAxis(_0x2c43ab,_0x258584),_0x5093ab=new Date(_0x53f2bf[_0xa85c74(0x1f9)]),_0x6781f5=formatDate(_0x5093ab),_0x90687a=TIMELINE_CONFIG[_0xa85c74(0x1dc)]+TIMELINE_CONFIG[_0xa85c74(0x1e3)]+_0x53d95e,_0x578a70=_0x6781f5[_0xa85c74(0xed)](_0x90687a),_0x56e8f9=a46_0x1f96c9[_0xa85c74(0x192)](_0x578a70);_0x2165e1[_0xa85c74(0x1dd)](_0x56e8f9+'\x20'+_0x11f384);for(const _0x5572f9 of _0x5d1fea){_0x2165e1[_0xa85c74(0x1dd)](renderTaskRow(_0x5572f9,_0x2c43ab,_0x258584,_0x53d95e));}const _0x1040d4=calculateStats(_0x5d1fea);_0x2165e1[_0xa85c74(0x1dd)](formatStats(_0x1040d4)),_0x5cbcc9&&_0x2165e1[_0xa85c74(0x1dd)](a46_0x1f96c9['yellow'](_0xa85c74(0x134)+TIMELINE_CONFIG[_0xa85c74(0x139)]+'\x20of\x20'+_0x523b76+'\x20tasks')),_0x2165e1[_0xa85c74(0x1dd)](''),_0x2165e1[_0xa85c74(0x1dd)](a46_0x1f96c9['dim']('💡\x20Tip:\x20Use\x20')+(_0xa85c74(0x14b)+_0x4f5973['id']+_0xa85c74(0x121))+a46_0x1f96c9[_0xa85c74(0x192)](_0xa85c74(0x143)));}else _0x2165e1['push'](_0xa85c74(0xb6));return _0x2165e1[_0xa85c74(0x84)]('\x0a');}['buildTimelineData'](_0x660512,_0x9fc5bf){const _0x302563=a46_0x591dc6,_0x1fb1b4=new Date(_0x660512[_0x302563(0x154)])[_0x302563(0xa4)](),_0xa2484a=_0x660512[_0x302563(0x152)]?new Date(_0x660512[_0x302563(0x152)])[_0x302563(0xa4)]():Date[_0x302563(0x20b)](),_0x37bac6=_0xa2484a-_0x1fb1b4,_0x182e12=[];for(const _0x42185b of _0x9fc5bf){if(_0x42185b[_0x302563(0x1f2)]){const _0x2a3dbf=new Date(_0x42185b[_0x302563(0x1f2)])[_0x302563(0xa4)](),_0x47c554=_0x42185b['updatedAt']?new Date(_0x42185b[_0x302563(0x1f3)])[_0x302563(0xa4)]():Date[_0x302563(0x20b)]();_0x182e12['push']({'name':_0x42185b[_0x302563(0x1f0)],'state':_0x42185b[_0x302563(0xb2)]||'unknown','window':{'start':_0x2a3dbf,'end':_0x47c554,'duration':_0x47c554-_0x2a3dbf}});}else _0x182e12['push']({'name':_0x42185b[_0x302563(0x1f0)],'state':_0x42185b[_0x302563(0xb2)]||_0x302563(0x16d),'window':undefined});}const _0x4c0cb6=calculateStats(_0x182e12);return{'attempt':{'id':_0x660512['id'],'status':_0x660512[_0x302563(0xe2)]?_0x660512['success']?_0x302563(0xb1):_0x302563(0xb3):_0x302563(0x185),'createdAt':_0x660512['createdAt'],'finishedAt':_0x660512[_0x302563(0x152)],'duration_ms':_0x37bac6},'tasks':_0x182e12[_0x302563(0x112)](_0x3416ae=>({'name':_0x3416ae[_0x302563(0xc9)],'state':_0x3416ae[_0x302563(0xb2)],'startedAt':_0x3416ae['window']?new Date(_0x3416ae[_0x302563(0x1cc)][_0x302563(0x1f9)])['toISOString']():null,'updatedAt':_0x3416ae['window']?new Date(_0x3416ae[_0x302563(0x1cc)][_0x302563(0x177)])[_0x302563(0x102)]():null,'duration_ms':_0x3416ae[_0x302563(0x1cc)]?.[_0x302563(0x22c)]||null})),'stats':_0x4c0cb6};}}
1
+ const a46_0x350b3f=a46_0x13d0;(function(_0x507edc,_0x5a72bd){const _0x40530e=a46_0x13d0,_0x2a23fe=_0x507edc();while(!![]){try{const _0x20595d=-parseInt(_0x40530e(0x16e))/0x1*(parseInt(_0x40530e(0x96))/0x2)+parseInt(_0x40530e(0x10e))/0x3*(-parseInt(_0x40530e(0x14e))/0x4)+parseInt(_0x40530e(0x22b))/0x5+-parseInt(_0x40530e(0x149))/0x6+parseInt(_0x40530e(0x8e))/0x7+-parseInt(_0x40530e(0x178))/0x8+parseInt(_0x40530e(0x1f8))/0x9;if(_0x20595d===_0x5a72bd)break;else _0x2a23fe['push'](_0x2a23fe['shift']());}catch(_0x9e4411){_0x2a23fe['push'](_0x2a23fe['shift']());}}}(a46_0x5827,0x19902));import a46_0x41c3a5 from'chalk';import{existsSync}from'fs';import a46_0x418c9f 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 a46_0x443862 from'prompts';function getAttemptStatusDisplay(_0x1c8120){const _0x12ebee=a46_0x13d0;if(!_0x1c8120)return{'icon':'⏳','text':''};const {done:_0x36607b,success:_0x3f1133,cancelRequested:_0xd6d7db}=_0x1c8120;if(!_0x36607b)return _0xd6d7db?{'icon':'🛑','text':a46_0x41c3a5['yellow'](_0x12ebee(0x1c9))}:{'icon':'🔄','text':a46_0x41c3a5[_0x12ebee(0x211)](_0x12ebee(0x108))};if(_0x3f1133)return{'icon':'✅','text':a46_0x41c3a5[_0x12ebee(0x103)](_0x12ebee(0x1a1))};return{'icon':'❌','text':a46_0x41c3a5['red'](_0x12ebee(0xe6))};}export class WorkflowBaseCommand extends BaseCommand{[a46_0x350b3f(0x20c)](_0x2b531b,_0x4e32a7,_0x35f08d=0x0){const _0x2af8c5=a46_0x350b3f;return _0x2b531b[_0x35f08d]||_0x4e32a7[_0x2af8c5(0x151)];}[a46_0x350b3f(0x17c)](_0x477b3c,_0x9d1d65,_0x195351=0x0){const _0x598ccb=a46_0x350b3f,_0x3a6291=this[_0x598ccb(0x20c)](_0x477b3c,_0x9d1d65,_0x195351);if(!_0x3a6291)return console[_0x598ccb(0xe6)](a46_0x41c3a5[_0x598ccb(0xb4)](_0x598ccb(0xe5)),_0x598ccb(0x120)),console['error'](a46_0x41c3a5[_0x598ccb(0x1c2)](_0x598ccb(0xf5))),null;return _0x3a6291;}[a46_0x350b3f(0x199)](_0xfe206,_0x666338){const _0xf547e9=a46_0x350b3f;if(_0xfe206[0x0]){const _0x3047c4=_0xfe206[0x0][_0xf547e9(0xa4)]('.');if(_0x3047c4[_0xf547e9(0xbe)]===0x1)return{'projectName':_0x3047c4[0x0],'workflowName':undefined};else return _0x3047c4[_0xf547e9(0xbe)]===0x2?{'projectName':_0x3047c4[0x0],'workflowName':_0x3047c4[0x1]}:(console[_0xf547e9(0xe6)](a46_0x41c3a5[_0xf547e9(0xb4)](_0xf547e9(0xe5)),_0xf547e9(0xaa)),null);}return{'projectName':_0x666338[_0xf547e9(0x151)],'workflowName':undefined};}['resolveProjectDir'](_0x2cb68a,_0x492710,_0x85f93a=0x0){const _0x5296e6=a46_0x350b3f;if(_0x2cb68a[_0x85f93a])return _0x2cb68a[_0x85f93a];if(_0x492710[_0x5296e6(0x151)]){const _0x165ea2=a46_0x418c9f[_0x5296e6(0x99)](process[_0x5296e6(0x11d)](),_0x5296e6(0x235),_0x492710[_0x5296e6(0x151)]);if(existsSync(a46_0x418c9f[_0x5296e6(0x99)](_0x165ea2,_0x5296e6(0x1c0))))return _0x165ea2;}return undefined;}async[a46_0x350b3f(0x1a7)](_0xbb52fc,_0x1eb494,_0x27c00c){const _0x544f7d=a46_0x350b3f;try{const _0x3dad10=await _0xbb52fc[_0x544f7d(0xa9)][_0x544f7d(0x235)](_0x1eb494,{'limit':0x1});if(_0x3dad10[_0x544f7d(0xbe)]>0x0){const _0x4524aa=_0x3dad10[0x0]['id'],_0x1310ab=getWorkflowUrl(_0x27c00c,_0x4524aa);console[_0x544f7d(0xe6)](_0x544f7d(0x1ce)+a46_0x41c3a5[_0x544f7d(0x1a0)](_0x1310ab));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x172);[a46_0x350b3f(0x125)]=a46_0x350b3f(0x21e);async[a46_0x350b3f(0x17f)](_0x5351cd){const _0x14cca4=a46_0x350b3f,{options:_0x40c693,args:_0x4cbf2c,tdx:_0x1342cb}=_0x5351cd,_0xdf7d0b=_0x4cbf2c[0x0],_0x50b5ae=_0x40c693[_0x14cca4(0x231)];if(_0x50b5ae)return saveSessionContext({'workflow_project':undefined},_0x40c693[_0x14cca4(0x21d)]),console[_0x14cca4(0x15d)](a46_0x41c3a5['green'](_0x14cca4(0x1fc))),0x0;if(!_0xdf7d0b)return console[_0x14cca4(0xe6)](a46_0x41c3a5[_0x14cca4(0xb4)]('Error:'),_0x14cca4(0x120)),console[_0x14cca4(0xe6)](a46_0x41c3a5[_0x14cca4(0x1c2)](_0x14cca4(0x1ba))),console[_0x14cca4(0xe6)](a46_0x41c3a5['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x5c4dd6=await withSpinner(_0x14cca4(0x206)+_0xdf7d0b+_0x14cca4(0x156),()=>_0x1342cb[_0x14cca4(0xa9)][_0x14cca4(0x18c)](_0xdf7d0b),{'verbose':_0x40c693[_0x14cca4(0x15f)]}),{name:_0x3e4b47}=_0x5c4dd6[_0x14cca4(0xa2)];return saveSessionContext({'workflow_project':_0x3e4b47},_0x40c693[_0x14cca4(0x21d)]),console['log'](a46_0x41c3a5[_0x14cca4(0x103)](_0x14cca4(0x1de)+a46_0x41c3a5[_0x14cca4(0x1a0)](_0x3e4b47))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x93);[a46_0x350b3f(0x125)]=a46_0x350b3f(0x1ec);async[a46_0x350b3f(0x17f)](_0x47e18a){const _0x11ee04=a46_0x350b3f,{options:_0x401966,args:_0x455e21,tdx:_0x88ff13}=_0x47e18a,_0xcab743=_0x455e21[0x0];_0x401966['verbose']&&_0xcab743&&console[_0x11ee04(0xe6)](_0x11ee04(0x16a)+_0xcab743);const _0x3dd380=await withSpinner(_0x11ee04(0x167),()=>_0x88ff13[_0x11ee04(0xa9)][_0x11ee04(0xcb)](_0xcab743,{'limit':_0x401966[_0x11ee04(0x188)]}),{'verbose':_0x401966[_0x11ee04(0x15f)]});let _0x3fd9c1=_0x3dd380[_0x11ee04(0xa2)];_0x3fd9c1[_0x11ee04(0x14d)]((_0x5eb2dc,_0x208a29)=>_0x5eb2dc[_0x11ee04(0xea)]['localeCompare'](_0x208a29[_0x11ee04(0xea)]));const _0x5dc6c2=_0x401966['limit']||0x64,_0x5dd630=_0x3fd9c1[_0x11ee04(0xbe)]>=_0x5dc6c2?a46_0x41c3a5[_0x11ee04(0x1c2)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x11ee04(0xe6)]('✔\x20Found\x20'+_0x3fd9c1[_0x11ee04(0xbe)]+'\x20project'+(_0x3fd9c1[_0x11ee04(0xbe)]!==0x1?'s':'')+_0x5dd630);if(_0x401966['format']===_0x11ee04(0x227)||_0x401966['format']===_0x11ee04(0x128)||_0x401966['format']===_0x11ee04(0x1d2))await handleSDKOutput(_0x3fd9c1,_0x401966);else{if(_0x3fd9c1['length']===0x0)_0xcab743?console[_0x11ee04(0x15d)]('No\x20projects\x20match\x20pattern:\x20'+_0xcab743):console[_0x11ee04(0x15d)](_0x11ee04(0x1b2));else{const _0x7f9f4b=_0x3fd9c1[_0x11ee04(0x123)](_0x3a9b7f=>{const _0x90aad9=_0x11ee04,_0x581c2c=_0x3a9b7f['metadata']?.[_0x90aad9(0x14f)](_0x103dc3=>_0x103dc3['key']==='sys'),_0x289b75=_0x581c2c?a46_0x41c3a5['dim'](_0x90aad9(0x138)):'';return _0x90aad9(0x15b)+_0x3a9b7f[_0x90aad9(0xea)]+_0x289b75;});await writeOutput(_0x7f9f4b[_0x11ee04(0x99)]('\x0a'),_0x401966[_0x11ee04(0x121)],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']='workflow:workflows';[a46_0x350b3f(0x125)]=a46_0x350b3f(0x155);async[a46_0x350b3f(0x17f)](_0x13ae7d){const _0x65b05d=a46_0x350b3f,{options:_0x4ece25,args:_0x5c5a6a,tdx:_0xfb5755}=_0x13ae7d,_0x3c0224=this[_0x65b05d(0x20c)](_0x5c5a6a,_0x4ece25);_0x4ece25[_0x65b05d(0x15f)]&&_0x3c0224&&console[_0x65b05d(0xe6)]('Project\x20filter:\x20'+_0x3c0224);const _0x57469c=await withSpinner(_0x65b05d(0x1e5),()=>_0xfb5755[_0x65b05d(0xa9)][_0x65b05d(0x235)](_0x3c0224,{'limit':_0x4ece25[_0x65b05d(0x188)]}),{'verbose':_0x4ece25[_0x65b05d(0x15f)]});let _0x42e135=_0x57469c['data'];_0x42e135[_0x65b05d(0x14d)]((_0x5245be,_0x45cb6e)=>{const _0x257936=_0x65b05d,_0x3fcfe4=_0x5245be['name'][_0x257936(0x21c)](_0x45cb6e[_0x257936(0xea)]);if(_0x3fcfe4!==0x0)return _0x3fcfe4;return(_0x5245be['project']?.[_0x257936(0xea)]||'')[_0x257936(0x21c)](_0x45cb6e[_0x257936(0x229)]?.[_0x257936(0xea)]||'');});const _0x5cda4c=_0x4ece25[_0x65b05d(0x188)]||0x64,_0x3fec8e=_0x42e135[_0x65b05d(0xbe)]>=_0x5cda4c?a46_0x41c3a5[_0x65b05d(0x1c2)](_0x65b05d(0x1cf)):'';console[_0x65b05d(0xe6)](_0x65b05d(0x122)+_0x42e135[_0x65b05d(0xbe)]+_0x65b05d(0x163)+(_0x42e135[_0x65b05d(0xbe)]!==0x1?'s':'')+_0x3fec8e);if(_0x4ece25[_0x65b05d(0x193)]===_0x65b05d(0x227)||_0x4ece25['format']==='jsonl'||_0x4ece25['format']===_0x65b05d(0x1d2))await handleSDKOutput(_0x42e135,_0x4ece25);else{if(_0x42e135['length']===0x0)_0x3c0224?console[_0x65b05d(0x15d)](_0x65b05d(0x223)+_0x3c0224):console[_0x65b05d(0x15d)](_0x65b05d(0x115));else{const _0x5e731e=_0x4ece25['site'],_0x5b0720=_0x42e135['map'](_0x5873a2=>{const _0x42fb13=_0x65b05d,_0x5f53d2=a46_0x41c3a5['dim']('#'+_0x5873a2['id']),_0x5cc38a=hyperlink(_0x5f53d2,getWorkflowUrl(_0x5e731e,_0x5873a2['id'])),_0x172971=_0x5873a2['project']?.['name']?a46_0x41c3a5[_0x42fb13(0x1c2)]('\x20('+_0x5873a2['project'][_0x42fb13(0xea)]+')'):'';return'📋\x20'+_0x5cc38a+'\x20'+_0x5873a2[_0x42fb13(0xea)]+_0x172971;});await writeOutput(_0x5b0720[_0x65b05d(0x99)]('\x0a'),_0x4ece25[_0x65b05d(0x121)],_0x65b05d(0x189));}}return 0x0;}}function a46_0x13d0(_0x31b560,_0x972f29){_0x31b560=_0x31b560-0x8c;const _0x5827d8=a46_0x5827();let _0x13d02d=_0x5827d8[_0x31b560];return _0x13d02d;}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x1fa);[a46_0x350b3f(0x125)]='List\x20workflow\x20execution\x20sessions';async[a46_0x350b3f(0x17f)](_0x4d554b){const _0x4fde3d=a46_0x350b3f,{options:_0x3649cc,args:_0xf22f67,tdx:_0x273b15}=_0x4d554b,_0x124dfa=this[_0x4fde3d(0x199)](_0xf22f67,_0x3649cc);if(!_0x124dfa)return 0x1;const {projectName:_0x5aa1ad,workflowName:_0x4959f5}=_0x124dfa;if(_0x3649cc['verbose']){if(_0x5aa1ad&&_0x4959f5)console[_0x4fde3d(0xe6)](_0x4fde3d(0x124)+_0x5aa1ad+'.'+_0x4959f5);else _0x5aa1ad&&console[_0x4fde3d(0xe6)](_0x4fde3d(0x1d1)+_0x5aa1ad);const _0xc589e3=_0x3649cc[_0x4fde3d(0xb6)];_0xc589e3&&console['error'](_0x4fde3d(0x13c)+_0xc589e3);}let _0x161118=0x28;if(process['stdout'][_0x4fde3d(0x1f6)]&&!_0x3649cc['output']&&!_0x3649cc[_0x4fde3d(0x193)]){const _0x2eba49=process[_0x4fde3d(0xe1)]['rows']||0x28;_0x161118=Math[_0x4fde3d(0xe2)](0x14,Math[_0x4fde3d(0x171)](_0x2eba49*0x2/0x3));}const _0x1b8674=_0x3649cc[_0x4fde3d(0x188)]||_0x161118,_0x515476=await withSpinner(_0x4fde3d(0x196),()=>_0x273b15[_0x4fde3d(0xa9)][_0x4fde3d(0xae)]({'projectName':_0x5aa1ad,'workflowName':_0x4959f5,'status':_0x3649cc['status'],'fromTime':_0x3649cc[_0x4fde3d(0xf0)],'toTime':_0x3649cc['to'],'limit':_0x1b8674}),{'verbose':_0x3649cc['verbose']}),_0x526380=_0x515476['data'];_0x526380[_0x4fde3d(0x14d)]((_0xd52fb2,_0x3c1eae)=>{const _0x2b99db=_0x4fde3d,_0x4b4724=_0xd52fb2[_0x2b99db(0x1b7)]||'',_0x346ff5=_0x3c1eae[_0x2b99db(0x1b7)]||'';return _0x346ff5[_0x2b99db(0x21c)](_0x4b4724);});_0x526380['length']>=_0x1b8674?console[_0x4fde3d(0xe6)](_0x4fde3d(0x157)+_0x526380[_0x4fde3d(0xbe)]+_0x4fde3d(0xd1)+a46_0x41c3a5['dim'](_0x4fde3d(0xee))):console['error'](_0x4fde3d(0x122)+_0x526380[_0x4fde3d(0xbe)]+_0x4fde3d(0x226)+(_0x526380[_0x4fde3d(0xbe)]!==0x1?'s':''));if(_0x3649cc[_0x4fde3d(0x193)]===_0x4fde3d(0x227)||_0x3649cc['format']===_0x4fde3d(0x128)||_0x3649cc[_0x4fde3d(0x193)]===_0x4fde3d(0x1d2))await handleSDKOutput(_0x526380,_0x3649cc);else{if(!process[_0x4fde3d(0xe1)]['isTTY']||_0x3649cc[_0x4fde3d(0x121)]){if(_0x526380[_0x4fde3d(0xbe)]===0x0){if(_0x5aa1ad&&_0x4959f5)console['log'](_0x4fde3d(0x102)+_0x5aa1ad+'.'+_0x4959f5);else _0x5aa1ad?console['log']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x5aa1ad):console[_0x4fde3d(0x15d)](_0x4fde3d(0x195));}else{const _0x18237b=_0x3649cc['site'],_0x578956=this['renderSessionsTimeline'](_0x526380,_0x18237b);_0x3649cc['output']?await writeOutput(_0x578956,_0x3649cc[_0x4fde3d(0x121)],_0x4fde3d(0x189)):console[_0x4fde3d(0x15d)](_0x578956);}!_0x5aa1ad&&(console['error'](''),console[_0x4fde3d(0xe6)](a46_0x41c3a5['dim'](_0x4fde3d(0x1ad))),console['error'](a46_0x41c3a5[_0x4fde3d(0x1c2)](_0x4fde3d(0x144))+'or'+a46_0x41c3a5[_0x4fde3d(0x1c2)](_0x4fde3d(0x213))));}else{if(_0x526380[_0x4fde3d(0xbe)]===0x0){if(_0x5aa1ad&&_0x4959f5)console['log'](_0x4fde3d(0x102)+_0x5aa1ad+'.'+_0x4959f5);else _0x5aa1ad?console['log'](_0x4fde3d(0xc0)+_0x5aa1ad):console[_0x4fde3d(0x15d)](_0x4fde3d(0x195));}else await this[_0x4fde3d(0x101)](_0x526380,_0x4d554b,_0x5aa1ad);}}return 0x0;}['renderSessionsTimeline'](_0xd5c562,_0x467e78){const _0x3c58b0=a46_0x350b3f,_0x43ac0e=[],_0x1874ff=new Map();let _0x40ab4e=Infinity,_0x505731=-Infinity;for(const _0x518dcf of _0xd5c562){if(_0x518dcf['lastAttempt']?.['createdAt']){const _0x3c778d=new Date(_0x518dcf[_0x3c58b0(0xd7)][_0x3c58b0(0xfa)])[_0x3c58b0(0x10f)](),_0xe32bca=_0x518dcf[_0x3c58b0(0xd7)]['finishedAt']?new Date(_0x518dcf['lastAttempt'][_0x3c58b0(0x180)])[_0x3c58b0(0x10f)]():Date[_0x3c58b0(0x186)](),_0x35b1bf=_0x518dcf[_0x3c58b0(0x229)]?.[_0x3c58b0(0xea)]||_0x3c58b0(0x15e);!_0x1874ff['has'](_0x35b1bf)&&_0x1874ff[_0x3c58b0(0x14c)](_0x35b1bf,[]),_0x1874ff[_0x3c58b0(0x194)](_0x35b1bf)['push']({'session':_0x518dcf,'startTime':_0x3c778d,'endTime':_0xe32bca,'duration':_0xe32bca-_0x3c778d}),_0x40ab4e=Math[_0x3c58b0(0x214)](_0x40ab4e,_0x3c778d),_0x505731=Math[_0x3c58b0(0xe2)](_0x505731,_0xe32bca);}}if(_0x1874ff[_0x3c58b0(0x19a)]===0x0)return _0x3c58b0(0x1d8);const _0x151c3b=process[_0x3c58b0(0xe1)][_0x3c58b0(0x141)]||0x78,_0x3d8a29=0x1e,_0x55d526=0x32,_0xeb236e=0x4,_0x15401f=Math[_0x3c58b0(0x214)](_0x55d526,Math[_0x3c58b0(0xe2)](_0x3d8a29,Math[_0x3c58b0(0x171)](_0x151c3b*0.3))),_0x21c4d9=_0x151c3b-_0x15401f-TIMELINE_CONFIG[_0x3c58b0(0xec)]-0x3-_0xeb236e,_0x131a9b=_0x505731-_0x40ab4e,_0x55e466=_0x131a9b/_0x15401f,_0x3fcce9=renderTimeAxis({'startTime':_0x40ab4e,'endTime':_0x505731,'durationMs':_0x131a9b,'msPerChar':_0x55e466},_0x15401f),_0x8b35ac=[];for(const _0x3a59e8 of _0x1874ff[_0x3c58b0(0x1fe)]()){_0x8b35ac[_0x3c58b0(0x17e)](..._0x3a59e8);}_0x8b35ac[_0x3c58b0(0x14d)]((_0x1d8258,_0x52f6a6)=>_0x52f6a6[_0x3c58b0(0x1b4)]-_0x1d8258['startTime']);const _0x3f2f90=new Date(_0x40ab4e),_0x54119a=formatDate(_0x3f2f90),_0x20e897=_0xeb236e+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x3c58b0(0x146)]+_0x21c4d9,_0x424b72='\x20'[_0x3c58b0(0x15a)](_0x20e897-_0x54119a[_0x3c58b0(0xbe)]),_0x3ab657=_0x424b72+a46_0x41c3a5[_0x3c58b0(0x1c2)](_0x54119a)+'\x20'+_0x3fcce9;_0x43ac0e[_0x3c58b0(0x17e)](_0x3ab657);const _0x256297=0x16;let _0x4e0864=0x0;for(const _0x2a6fc1 of _0x8b35ac){const _0x593957=_0x2a6fc1[_0x3c58b0(0x21d)]['project']?.[_0x3c58b0(0xea)]||'?',_0x5a008b=Math[_0x3c58b0(0x214)](stringWidth(_0x593957),_0x256297);_0x4e0864=Math[_0x3c58b0(0xe2)](_0x4e0864,_0x5a008b);}for(const _0x274f6f of _0x8b35ac){const {session:_0xdc64b5,startTime:_0x51f207,endTime:_0x1777be,duration:_0x3ffaf8}=_0x274f6f,_0x2c1d3b=_0xdc64b5[_0x3c58b0(0x229)]?.['id'],_0x21fcb9=_0xdc64b5['id'],_0x461eb9=_0xdc64b5[_0x3c58b0(0x229)]?.[_0x3c58b0(0xea)]||'?',_0x5a09c4=_0xdc64b5[_0x3c58b0(0xa9)]?.[_0x3c58b0(0xea)]||'?';let _0x52ee23,_0x33a5d0;if(_0xdc64b5[_0x3c58b0(0xd7)]){const _0x1816d4=_0xdc64b5['lastAttempt'];!_0x1816d4['done']?(_0x52ee23=_0x1816d4[_0x3c58b0(0x198)]?'🛑':'🔄',_0x33a5d0=_0x1816d4['cancelRequested']?a46_0x41c3a5[_0x3c58b0(0x222)]:a46_0x41c3a5[_0x3c58b0(0x211)]):(_0x52ee23=_0x1816d4[_0x3c58b0(0x1a1)]?'✅':'❌',_0x33a5d0=_0x1816d4[_0x3c58b0(0x1a1)]?a46_0x41c3a5[_0x3c58b0(0x103)]:a46_0x41c3a5[_0x3c58b0(0xb4)]);}else _0x52ee23='⏳',_0x33a5d0=a46_0x41c3a5[_0x3c58b0(0x1c2)];const _0x54f07f='#'+_0x21fcb9,_0x1e7c6a=_0x2c1d3b?hyperlink(_0x54f07f,getWorkflowSessionUrl(_0x467e78,_0x2c1d3b,_0x21fcb9)):_0x54f07f;let _0x36c526=_0x461eb9;stringWidth(_0x461eb9)>_0x256297&&(_0x36c526=_0x461eb9['slice'](0x0,_0x256297-0x1)+'…');const _0x2c0570=a46_0x41c3a5[_0x3c58b0(0x1c2)](_0x36c526),_0x332c31=stringWidth(_0x36c526),_0x353d8d='\x20'[_0x3c58b0(0x15a)](_0x4e0864-stringWidth(_0x36c526)+0x2),_0x57c427='('+formatElapsed(_0x3ffaf8)+')',_0x10b54b=stringWidth(_0x57c427),_0x430326=stringWidth(_0x54f07f),_0x2adae0=_0x430326+0x1+_0x332c31+_0x353d8d[_0x3c58b0(0xbe)],_0x592eae=_0x21c4d9-_0x2adae0-_0x10b54b-0x1-0x8;let _0x5a5aa8=_0x5a09c4;stringWidth(_0x5a5aa8)>_0x592eae&&(_0x5a5aa8=_0x5a5aa8[_0x3c58b0(0x109)](0x0,_0x592eae-0x1)+'…');const _0x49abeb=_0x1e7c6a+'\x20'+_0x2c0570+_0x353d8d+_0x5a5aa8,_0x326c92=stringWidth(_0x49abeb),_0x21a9e5=_0x21c4d9-_0x326c92-_0x10b54b,_0x1b6a9f=_0x49abeb+'\x20'[_0x3c58b0(0x15a)](Math[_0x3c58b0(0xe2)](0x1,_0x21a9e5))+a46_0x41c3a5['dim'](_0x57c427),_0x38e7fb=Math[_0x3c58b0(0x171)]((_0x51f207-_0x40ab4e)/_0x55e466),_0x5559da=Math[_0x3c58b0(0x171)]((_0x1777be-_0x40ab4e)/_0x55e466),_0x4fd88d=Math['max'](_0x38e7fb+0x1,_0x5559da),_0x4a7c41=new Array(_0x15401f)[_0x3c58b0(0x1c3)]('\x20');for(let _0x459627=_0x38e7fb;_0x459627<Math[_0x3c58b0(0x214)](_0x4fd88d,_0x15401f);_0x459627++){_0x4a7c41[_0x459627]='─';}const _0xa1e97a=_0x4a7c41[_0x3c58b0(0x123)](_0x3f6df1=>_0x3f6df1==='\x20'?'\x20':_0x33a5d0(_0x3f6df1))[_0x3c58b0(0x99)]('');_0x43ac0e[_0x3c58b0(0x17e)](_0x52ee23+'\x20'+_0x1b6a9f+'│'+_0xa1e97a+'│');}return _0x43ac0e['join']('\x0a');}async[a46_0x350b3f(0x101)](_0xc6e57,_0x3b02b1,_0x443391){const _0x357726=a46_0x350b3f,{options:_0x2adaa2,tdx:_0x323554}=_0x3b02b1,_0x540571=_0x2adaa2[_0x357726(0xd5)],{timelineRows:_0xeff5a3,timeAxisHeader:_0xbd6d66}=this['generateSessionTimelineRows'](_0xc6e57,_0x540571),_0x263fde=_0xeff5a3[_0x357726(0x233)](_0x6c1aab=>_0x6c1aab[_0x357726(0x1f3)]);if(_0x263fde[_0x357726(0xbe)]===0x0){const _0x52af85=this['renderSessionsTimeline'](_0xc6e57,_0x540571);console[_0x357726(0x15d)](_0x52af85);!_0x443391&&(console[_0x357726(0xe6)](''),console[_0x357726(0xe6)](a46_0x41c3a5[_0x357726(0x1c2)](_0x357726(0x1ad))),console[_0x357726(0xe6)](a46_0x41c3a5['dim'](_0x357726(0x144))+'or'+a46_0x41c3a5[_0x357726(0x1c2)](_0x357726(0x213))));return;}_0xbd6d66&&console['log'](_0xbd6d66);const _0x27c8f8=_0xeff5a3[_0x357726(0x233)](_0x4a8e4f=>_0x4a8e4f['attemptId'])[_0x357726(0x123)](_0x244181=>({'title':_0x244181[_0x357726(0x22f)],'value':_0x244181[_0x357726(0x1f3)]})),_0x15b894=process[_0x357726(0xe1)]['rows']||0x3c,_0x2c39b7=Math[_0x357726(0xe2)](0x28,Math[_0x357726(0x171)](_0x15b894*0x2/0x3)),_0x4d024b=await a46_0x443862({'type':_0x357726(0x1ee),'name':_0x357726(0x1f3),'message':_0x357726(0x10b),'choices':_0x27c8f8,'initial':-0x1,'limit':_0x2c39b7,'clearFirst':!![],'fallback':{'title':_0x357726(0x1e7),'value':null},'suggest':(_0x14fe3e,_0x3224fd)=>{const _0x2cb5e3=_0x357726;if(!_0x14fe3e)return Promise['resolve'](_0x3224fd);const _0x11a304=_0x3224fd[_0x2cb5e3(0x233)](_0x15cd33=>{const _0x1135a3=_0x2cb5e3,_0x32e45c=_0x15cd33;return _0x32e45c[_0x1135a3(0xb3)][_0x1135a3(0x1b1)]()['includes'](_0x14fe3e['toLowerCase']());});return Promise['resolve'](_0x11a304);}}),_0x46d0e3=()=>{const _0x19d823=_0x357726;process['stdout']['write']('\x1b[1A\x1b[2K'),process[_0x19d823(0xe1)]['write'](_0x19d823(0x10c)),process[_0x19d823(0xe1)][_0x19d823(0x1a6)](_0x19d823(0x10c));},_0x57ad09=_0x4d024b&&_0x4d024b[_0x357726(0x1f3)]&&_0x4d024b['attemptId']!==null&&_0x4d024b[_0x357726(0x1f3)]['trim']()!=='';if(!_0x57ad09){_0x46d0e3(),console[_0x357726(0x15d)](a46_0x41c3a5[_0x357726(0x1c2)](_0x357726(0x1ed)));return;}_0x46d0e3();const _0x562beb=_0xc6e57[_0x357726(0x12c)](_0xa290d4=>_0xa290d4[_0x357726(0xd7)]?.['id']===_0x4d024b[_0x357726(0x1f3)]);if(_0x562beb){const _0x76e19f=_0x562beb[_0x357726(0x229)]?.['name']||'?',_0x70f1f5=_0x562beb[_0x357726(0xa9)]?.[_0x357726(0xea)]||'?';console[_0x357726(0x15d)]('Project:\x20'+a46_0x41c3a5[_0x357726(0x1c2)](_0x76e19f)+',\x20Workflow:\x20'+a46_0x41c3a5[_0x357726(0x1c2)](_0x70f1f5));}const _0x1422f9=new WorkflowTimelineCommand();await _0x1422f9[_0x357726(0x17f)]({'args':[],'options':{..._0x2adaa2,'attemptId':_0x4d024b[_0x357726(0x1f3)]},'tdx':_0x323554});}[a46_0x350b3f(0x153)](_0x2a8ecf,_0x2371e7){const _0x20449f=a46_0x350b3f,_0x4793cd=new Map();for(const _0x9942a1 of _0x2a8ecf){_0x9942a1['id']&&_0x9942a1[_0x20449f(0xd7)]?.['id']&&_0x4793cd[_0x20449f(0x14c)](_0x9942a1['id'],_0x9942a1[_0x20449f(0xd7)]['id']);}const _0x2f87e2=[];let _0x24b0da='';const _0xe2ab40=this[_0x20449f(0xe0)](_0x2a8ecf,_0x2371e7),_0x5a7fb3=_0xe2ab40[_0x20449f(0xa4)]('\x0a');for(const _0x3e2754 of _0x5a7fb3){if(_0x3e2754[_0x20449f(0x218)](_0x20449f(0x1c5))||_0x3e2754[_0x20449f(0x179)](/^\s+\d{4}-\d{2}-\d{2}/))_0x24b0da=_0x3e2754;else{if(_0x3e2754[_0x20449f(0x179)](/^[✅❌🔄🛑⏳]/)){const _0x73457f=_0x3e2754[_0x20449f(0x179)](/#(\d+)/),_0x316bc2=_0x73457f?_0x73457f[0x1]:null,_0x346560=_0x316bc2?_0x4793cd[_0x20449f(0x194)](_0x316bc2)||null:null,_0x593c56=_0x2a8ecf[_0x20449f(0x12c)](_0x4828cd=>_0x4828cd['id']===_0x316bc2),_0x189c53=_0x593c56?.[_0x20449f(0x229)]?.[_0x20449f(0xea)]||'';_0x2f87e2[_0x20449f(0x17e)]({'displayLine':_0x3e2754,'attemptId':_0x346560,'projectName':_0x189c53});}}}return{'timelineRows':_0x2f87e2,'timeAxisHeader':_0x24b0da};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0xdc);[a46_0x350b3f(0x125)]=a46_0x350b3f(0xd8);async[a46_0x350b3f(0x17f)](_0x25a94a){const _0x178c3c=a46_0x350b3f,{options:_0x917981,args:_0x2986f9,tdx:_0x3024dc}=_0x25a94a,_0x50eef1=this[_0x178c3c(0x199)](_0x2986f9,_0x917981);if(!_0x50eef1)return 0x1;const {projectName:_0x3f6cbb,workflowName:_0x9ffcfb}=_0x50eef1,_0x5a72d2=_0x917981['includeRetried'];if(_0x917981[_0x178c3c(0x15f)]){if(_0x3f6cbb&&_0x9ffcfb)console[_0x178c3c(0xe6)](_0x178c3c(0x124)+_0x3f6cbb+'.'+_0x9ffcfb);else _0x3f6cbb&&console[_0x178c3c(0xe6)](_0x178c3c(0x1d1)+_0x3f6cbb);_0x5a72d2&&console[_0x178c3c(0xe6)]('Include\x20retried:\x20yes');}const _0x5fad61=await withSpinner(_0x178c3c(0xc5),()=>_0x3024dc[_0x178c3c(0xa9)][_0x178c3c(0x1b9)]({'projectName':_0x3f6cbb,'workflowName':_0x9ffcfb,'includeRetried':_0x5a72d2,'limit':_0x917981[_0x178c3c(0x188)]}),{'verbose':_0x917981[_0x178c3c(0x15f)]}),_0x246e34=_0x5fad61[_0x178c3c(0xa2)],_0x100acc=_0x917981[_0x178c3c(0x188)]||0x64,_0x488e1d=_0x246e34[_0x178c3c(0xbe)]>=_0x100acc?a46_0x41c3a5['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error'](_0x178c3c(0x122)+_0x246e34[_0x178c3c(0xbe)]+_0x178c3c(0xd3)+(_0x246e34[_0x178c3c(0xbe)]!==0x1?'s':'')+_0x488e1d);if(_0x917981[_0x178c3c(0x193)]===_0x178c3c(0x227)||_0x917981[_0x178c3c(0x193)]===_0x178c3c(0x128)||_0x917981[_0x178c3c(0x193)]===_0x178c3c(0x1d2))await handleSDKOutput(_0x246e34,_0x917981);else{if(_0x246e34[_0x178c3c(0xbe)]===0x0){if(_0x3f6cbb&&_0x9ffcfb)console[_0x178c3c(0x15d)](_0x178c3c(0x127)+_0x3f6cbb+'.'+_0x9ffcfb);else _0x3f6cbb?console[_0x178c3c(0x15d)](_0x178c3c(0xd0)+_0x3f6cbb):console[_0x178c3c(0x15d)]('No\x20attempts\x20found');}else{const _0x83cbaa=_0x917981[_0x178c3c(0xd5)],_0x3446ff=_0x246e34['map'](_0x1938af=>{const _0x3fc6d5=_0x178c3c,_0x391594=a46_0x41c3a5[_0x3fc6d5(0x1c2)]('#'+_0x1938af['id']),_0x5ed3ce=_0x1938af[_0x3fc6d5(0x229)]?.['id'],_0x4c286e=_0x1938af[_0x3fc6d5(0xfb)]||_0x1938af['sessionId'],_0x18eb37=_0x5ed3ce&&_0x4c286e?hyperlink(_0x391594,getWorkflowAttemptUrl(_0x83cbaa,_0x5ed3ce,_0x4c286e,_0x1938af['id'])):_0x391594,{icon:_0x32827b,text:_0x26c472}=getAttemptStatusDisplay(_0x1938af),_0x39e557=(_0x1938af[_0x3fc6d5(0x229)]?.[_0x3fc6d5(0xea)]||'?')+'.'+(_0x1938af[_0x3fc6d5(0xa9)]?.[_0x3fc6d5(0xea)]||'?'),_0x17ce53=_0x1938af[_0x3fc6d5(0x1b7)]?a46_0x41c3a5['dim'](_0x1938af[_0x3fc6d5(0x1b7)]):'';return(_0x18eb37+'\x20'+_0x32827b+(_0x26c472?'\x20'+_0x26c472:'')+'\x20'+_0x39e557+'\x20'+_0x17ce53)[_0x3fc6d5(0x1bc)]();});await writeOutput(_0x3446ff[_0x178c3c(0x99)]('\x0a'),_0x917981[_0x178c3c(0x121)],_0x178c3c(0x189));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0xaf);[a46_0x350b3f(0x125)]=a46_0x350b3f(0x1c8);async[a46_0x350b3f(0x17f)](_0x4f362e){const _0x56c86e=a46_0x350b3f,{options:_0x1c6300,args:_0x412e6e,tdx:_0x183410}=_0x4f362e,_0x31b15b=_0x412e6e[0x0];if(!_0x31b15b)return console[_0x56c86e(0xe6)](_0x56c86e(0xc6)),0x1;_0x1c6300[_0x56c86e(0x15f)]&&console[_0x56c86e(0xe6)](_0x56c86e(0x183)+_0x31b15b);const _0x4d0ac8=await withSpinner('Getting\x20attempt\x20details...',()=>_0x183410[_0x56c86e(0xa9)][_0x56c86e(0x1f2)](_0x31b15b),{'verbose':_0x1c6300[_0x56c86e(0x15f)]}),_0x4dc6d4=_0x4d0ac8[_0x56c86e(0xa2)];let _0x486eb8;!_0x4dc6d4[_0x56c86e(0x13a)]?_0x486eb8=_0x4dc6d4[_0x56c86e(0x198)]?'canceling':_0x56c86e(0x108):_0x486eb8=_0x4dc6d4[_0x56c86e(0x1a1)]?_0x56c86e(0x1a1):'error';let _0x46151a;if(_0x4dc6d4[_0x56c86e(0xfa)]&&_0x4dc6d4[_0x56c86e(0x180)]){const _0x18e8e9=new Date(_0x4dc6d4[_0x56c86e(0xfa)])[_0x56c86e(0x10f)](),_0xa90f4b=new Date(_0x4dc6d4[_0x56c86e(0x180)])[_0x56c86e(0x10f)]();_0x46151a=Math[_0x56c86e(0xb8)]((_0xa90f4b-_0x18e8e9)/0x3e8);}const _0x4116aa={'attempt_id':_0x4dc6d4['id'],'status':_0x486eb8,..._0x4dc6d4['index']!==undefined&&{'index':_0x4dc6d4[_0x56c86e(0xcd)]},..._0x4dc6d4[_0x56c86e(0x229)]&&{'project':_0x4dc6d4[_0x56c86e(0x229)][_0x56c86e(0xea)]},..._0x4dc6d4['workflow']&&{'workflow':_0x4dc6d4[_0x56c86e(0xa9)][_0x56c86e(0xea)]},..._0x4dc6d4[_0x56c86e(0x12b)]&&{'session_id':_0x4dc6d4[_0x56c86e(0x12b)]},..._0x4dc6d4[_0x56c86e(0x1b7)]&&{'session_time':_0x4dc6d4['sessionTime']},..._0x4dc6d4[_0x56c86e(0x1d0)]&&{'retry_attempt':_0x4dc6d4[_0x56c86e(0x1d0)]},..._0x46151a!==undefined&&{'duration_sec':_0x46151a},..._0x4dc6d4[_0x56c86e(0xfa)]&&{'created_at':_0x4dc6d4['createdAt']},..._0x4dc6d4[_0x56c86e(0x180)]&&{'finished_at':_0x4dc6d4[_0x56c86e(0x180)]},...Object[_0x56c86e(0x212)](_0x4dc6d4[_0x56c86e(0x12d)])[_0x56c86e(0xbe)]>0x0&&{'params':_0x4dc6d4[_0x56c86e(0x12d)]}};return await handleSingleObjectOutput(_0x4116aa,_0x1c6300),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x18b);[a46_0x350b3f(0x125)]=a46_0x350b3f(0x1d7);async[a46_0x350b3f(0x17f)](_0x52f2ad){const _0x111a3e=a46_0x350b3f,{options:_0x33ee4c,args:_0x57af41,tdx:_0x2dc435}=_0x52f2ad,_0x1c5abf=_0x57af41[0x0];if(!_0x1c5abf)return console[_0x111a3e(0xe6)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x461467=_0x33ee4c[_0x111a3e(0x1ca)];_0x33ee4c[_0x111a3e(0x15f)]&&(console[_0x111a3e(0xe6)](_0x111a3e(0x183)+_0x1c5abf),_0x461467&&console['error'](_0x111a3e(0x15c)));const _0x11f9eb=await withSpinner(_0x111a3e(0x158),()=>_0x2dc435[_0x111a3e(0xa9)][_0x111a3e(0x11e)](_0x1c5abf,_0x461467||![]),{'verbose':_0x33ee4c['verbose']}),_0x179f71=_0x11f9eb[_0x111a3e(0xa2)];return console['error'](_0x111a3e(0x122)+_0x179f71[_0x111a3e(0xbe)]+_0x111a3e(0x100)+(_0x179f71[_0x111a3e(0xbe)]!==0x1?'s':'')),await handleSDKOutput(_0x179f71,_0x33ee4c),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x133);[a46_0x350b3f(0x125)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a46_0x350b3f(0x17f)](_0x3dbad3){const _0xf89fbc=a46_0x350b3f,{options:_0x38e9f4,args:_0x390ab6,tdx:_0x257906}=_0x3dbad3,_0x1c164a=_0x390ab6[0x0];let _0x43b5ae=_0x390ab6[0x1];if(!_0x1c164a)return console['error'](_0xf89fbc(0xc6)),0x1;_0x38e9f4['verbose']&&(console[_0xf89fbc(0xe6)]('Attempt\x20ID:\x20'+_0x1c164a),_0x43b5ae&&console['error'](_0xf89fbc(0x152)+_0x43b5ae));const _0x20c93d=await withSpinner(_0xf89fbc(0x18e),()=>_0x257906[_0xf89fbc(0xa9)][_0xf89fbc(0x205)](_0x1c164a,_0x43b5ae),{'verbose':_0x38e9f4['verbose']}),_0xc9a22f=_0x20c93d[_0xf89fbc(0xa2)];if(_0xc9a22f[_0xf89fbc(0xbe)]===0x0)return console['error'](_0xf89fbc(0x142)),0x0;if(!_0x43b5ae&&(_0x38e9f4[_0xf89fbc(0x227)]||_0x38e9f4[_0xf89fbc(0x193)]))return await handleSDKOutput(_0xc9a22f,_0x38e9f4),0x0;if(!_0x43b5ae){const _0x2671f4=_0xc9a22f[_0xf89fbc(0x123)](_0xd5f8e4=>({'title':_0xd5f8e4[_0xf89fbc(0x20b)]+'\x20('+formatBytes(_0xd5f8e4[_0xf89fbc(0x116)])+')','value':_0xd5f8e4[_0xf89fbc(0x20b)]})),_0x5986e9=await a46_0x443862({'type':_0xf89fbc(0x9c),'name':_0xf89fbc(0xa5),'message':_0xf89fbc(0x1d3),'choices':_0x2671f4});if(!_0x5986e9[_0xf89fbc(0xa5)])return console[_0xf89fbc(0xe6)](_0xf89fbc(0x1ed)),0x0;_0x43b5ae=_0x5986e9[_0xf89fbc(0xa5)];}const _0x388285=await withSpinner(_0xf89fbc(0xf7),()=>_0x257906[_0xf89fbc(0xa9)][_0xf89fbc(0x92)](_0x1c164a,_0x43b5ae),{'verbose':_0x38e9f4['verbose']}),_0x40b030=_0x388285[_0xf89fbc(0xa2)];return _0x40b030?console['log'](_0x40b030):console['error'](_0xf89fbc(0x12e)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x1c1);[a46_0x350b3f(0x125)]=a46_0x350b3f(0x174);async[a46_0x350b3f(0x17f)](_0x5e3407){const _0x5bc4ec=a46_0x350b3f,{options:_0x2f2af8,args:_0x3fbace,tdx:_0x26d0d7}=_0x5e3407,_0x8ea867=_0x3fbace[0x0];if(!_0x8ea867)return console['error'](_0x5bc4ec(0xc6)),0x1;const _0x21cb1a=_0x2f2af8[_0x5bc4ec(0xc3)];_0x2f2af8[_0x5bc4ec(0x15f)]&&(console['error'](_0x5bc4ec(0x183)+_0x8ea867),_0x21cb1a&&console[_0x5bc4ec(0xe6)](_0x5bc4ec(0xb9)+_0x21cb1a));if(!_0x2f2af8[_0x5bc4ec(0x1bd)]){if(!isInteractive())return console[_0x5bc4ec(0xe6)](a46_0x41c3a5['red']('\x0aError:'),_0x5bc4ec(0x1f0)),console[_0x5bc4ec(0xe6)](a46_0x41c3a5['dim'](_0x5bc4ec(0x220))),0x1;const _0x121bbc=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x8ea867+'?');if(!_0x121bbc)return console['error'](a46_0x41c3a5['yellow'](_0x5bc4ec(0x1ed))),0x1;}const _0x106c4a=await withSpinner('Killing\x20attempt...',()=>_0x26d0d7[_0x5bc4ec(0xa9)]['kill'](_0x8ea867,_0x21cb1a),{'verbose':_0x2f2af8[_0x5bc4ec(0x15f)]}),_0x274973=_0x106c4a['data'];return console['error']('✔\x20'+_0x274973),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x113);['description']=a46_0x350b3f(0x21a);async[a46_0x350b3f(0x17f)](_0x95dbe9){const _0x374129=a46_0x350b3f,{options:_0x4053c2,args:_0x4bd6ae,tdx:_0x161000}=_0x95dbe9,_0x5c5e11=_0x4bd6ae[0x0];if(!_0x5c5e11)return console[_0x374129(0xe6)](_0x374129(0xd2)),console[_0x374129(0xe6)](_0x374129(0xb5)),0x1;let _0x2f61dd=![],_0xadec1c=_0x5c5e11;if(_0x5c5e11[_0x374129(0x218)]('session:'))_0x2f61dd=!![],_0xadec1c=_0x5c5e11[_0x374129(0x90)](0x8);else{if(_0x5c5e11['startsWith'](_0x374129(0x20d)))_0x2f61dd=![],_0xadec1c=_0x5c5e11[_0x374129(0x90)](0x8);else return console[_0x374129(0xe6)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x374129(0xe6)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x119a2a=_0x4053c2[_0x374129(0xed)],_0x30c81f=_0x4053c2[_0x374129(0x130)],_0x18ca0b=_0x4053c2[_0x374129(0x12d)],_0x1ea9ac=_0x4053c2[_0x374129(0x9a)];_0x4053c2['verbose']&&(console['error'](_0x374129(0x1cd)+(_0x2f61dd?'session':_0x374129(0x1f2))+'\x20'+_0xadec1c),_0x119a2a&&console[_0x374129(0xe6)]('From\x20task:\x20'+_0x119a2a),_0x30c81f&&console[_0x374129(0xe6)]('Resume\x20from:\x20'+_0x30c81f),_0x18ca0b&&console[_0x374129(0xe6)](_0x374129(0xa1)+_0x18ca0b),_0x1ea9ac&&console[_0x374129(0xe6)]('Force:\x20yes'));let _0xce25a2;if(_0x18ca0b)try{if(_0x18ca0b[_0x374129(0x218)]('@')){const _0x3a1033=await import(_0x374129(0x1cb)),_0x38c37c=_0x18ca0b['substring'](0x1),_0x3cdeb8=await _0x3a1033[_0x374129(0x1e2)](_0x38c37c,_0x374129(0x1b6));_0xce25a2=JSON['parse'](_0x3cdeb8);}else _0xce25a2=JSON[_0x374129(0x14b)](_0x18ca0b);}catch{return console[_0x374129(0xe6)](_0x374129(0x1e9)),0x1;}if(!_0x4053c2[_0x374129(0x1bd)]){if(!isInteractive())return console[_0x374129(0xe6)](a46_0x41c3a5[_0x374129(0xb4)](_0x374129(0x140)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x374129(0xe6)](a46_0x41c3a5[_0x374129(0x1c2)](_0x374129(0x220))),0x1;const _0x3e298a=await confirmKey(_0x374129(0x192)+(_0x2f61dd?'session':'attempt')+'\x20'+_0xadec1c+'?');if(!_0x3e298a)return console[_0x374129(0xe6)](a46_0x41c3a5[_0x374129(0x222)](_0x374129(0x1ed))),0x1;}let _0x488ddd;_0x2f61dd?_0x488ddd=await withSpinner(_0x374129(0x1d6),()=>_0x161000[_0x374129(0xa9)][_0x374129(0x1fd)](_0xadec1c,{'fromTask':_0x119a2a,'retryParams':_0xce25a2}),{'verbose':_0x4053c2['verbose']}):_0x488ddd=await withSpinner(_0x374129(0x209),()=>_0x161000['workflow']['retryAttempt'](_0xadec1c,{'resumeFrom':_0x30c81f,'retryParams':_0xce25a2,'force':_0x1ea9ac}),{'verbose':_0x4053c2[_0x374129(0x15f)]});const _0x243daf=_0x488ddd[_0x374129(0xa2)];return console[_0x374129(0xe6)](_0x374129(0x162)),console['error'](_0x374129(0xd4)+_0x243daf[_0x374129(0x1f3)]),console[_0x374129(0xe6)](_0x374129(0x131)+_0x243daf['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a46_0x350b3f(0x20a);[a46_0x350b3f(0x125)]=a46_0x350b3f(0xf3);async[a46_0x350b3f(0x17f)](_0x46a911){const _0x213723=a46_0x350b3f,{options:_0x1db938,args:_0x17eda6,tdx:_0x54749f}=_0x46a911;let _0x5c2d59=_0x17eda6[0x0];if(!_0x5c2d59){const _0xf6fbf2=this['resolveProject']([],_0x1db938),_0x21c95b=await withSpinner(_0x213723(0x160),()=>_0x54749f[_0x213723(0xa9)]['workflows'](_0xf6fbf2,{'limit':_0x1db938[_0x213723(0x188)]}),{'verbose':_0x1db938[_0x213723(0x15f)]}),_0x383ccf=_0x21c95b['data'];if(_0x383ccf[_0x213723(0xbe)]===0x0)return console[_0x213723(0xe6)](_0x213723(0x115)),!_0xf6fbf2&&console[_0x213723(0xe6)](a46_0x41c3a5['dim'](_0x213723(0xf5))),0x1;const _0x593293=_0x383ccf[_0x213723(0x123)](_0x1942a9=>({'title':_0x1942a9[_0x213723(0x229)]?.[_0x213723(0xea)]+'.'+_0x1942a9[_0x213723(0xea)],'value':_0x1942a9[_0x213723(0x229)]?.[_0x213723(0xea)]+'.'+_0x1942a9['name'],'description':_0x1942a9[_0x213723(0x1c4)]?_0x213723(0x11b)+_0x1942a9[_0x213723(0x1c4)]:undefined})),_0x475349=await a46_0x443862({'type':'select','name':_0x213723(0xa9),'message':_0x213723(0xdd),'choices':_0x593293});if(!_0x475349[_0x213723(0xa9)])return 0x1;_0x5c2d59=_0x475349[_0x213723(0xa9)];}if(!_0x5c2d59[_0x213723(0x17b)]('.')){const _0x9af016=this[_0x213723(0x20c)]([],_0x1db938);if(_0x9af016)_0x5c2d59=_0x9af016+'.'+_0x5c2d59;else return console['error'](a46_0x41c3a5['red'](_0x213723(0xe5)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x213723(0xe6)](a46_0x41c3a5[_0x213723(0x1c2)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x1c8a25=_0x1db938['param'],_0x5eda08=_0x1db938[_0x213723(0x1b7)],_0x228a56={};if(_0x1c8a25&&Array['isArray'](_0x1c8a25))for(const _0x1597a7 of _0x1c8a25){const _0x4879ad=_0x1597a7[_0x213723(0x111)]('=');if(_0x4879ad===-0x1)return console[_0x213723(0xe6)](_0x213723(0xde)+_0x1597a7),console['error'](_0x213723(0xbd)),0x1;const _0x26f995=_0x1597a7['substring'](0x0,_0x4879ad),_0x756301=_0x1597a7[_0x213723(0x90)](_0x4879ad+0x1);try{_0x228a56[_0x26f995]=JSON[_0x213723(0x14b)](_0x756301);}catch{_0x228a56[_0x26f995]=_0x756301;}}_0x1db938[_0x213723(0x15f)]&&(console[_0x213723(0xe6)]('Workflow:\x20'+_0x5c2d59),Object['keys'](_0x228a56)[_0x213723(0xbe)]>0x0&&console[_0x213723(0xe6)](_0x213723(0x13b)+JSON['stringify'](_0x228a56)),_0x5eda08&&console['error']('Session\x20time:\x20'+_0x5eda08));const _0x20a88e=await withSpinner(_0x213723(0x150),()=>_0x54749f['workflow']['run'](_0x5c2d59,_0x228a56,{'sessionTime':_0x5eda08}),{'verbose':_0x1db938[_0x213723(0x15f)]}),_0x58019d=_0x20a88e[_0x213723(0xa2)];console[_0x213723(0xe6)](_0x213723(0xc9)),console[_0x213723(0xe6)](_0x213723(0xca)+_0x58019d['id']),console[_0x213723(0xe6)](_0x213723(0x131)+_0x58019d[_0x213723(0x12b)]),console[_0x213723(0xe6)]('\x20\x20Project:\x20'+_0x58019d['project']?.[_0x213723(0xea)]),console[_0x213723(0xe6)]('\x20\x20Workflow:\x20'+_0x58019d[_0x213723(0xa9)]?.['name']);if(_0x58019d[_0x213723(0x229)]?.['id']&&_0x58019d[_0x213723(0x12b)]&&_0x58019d['id']){const _0x484a2b=_0x1db938[_0x213723(0xd5)],_0x2de6e3=getConsoleUrl(_0x484a2b,_0x213723(0xb0)+_0x58019d[_0x213723(0x229)]['id']+'/sessions/'+_0x58019d['sessionId']+'/attempt/'+_0x58019d['id']);console[_0x213723(0xe6)](_0x213723(0x1ce)+a46_0x41c3a5[_0x213723(0x1a0)](_0x2de6e3));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x1a9);[a46_0x350b3f(0x125)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a46_0x350b3f(0x17f)](_0x499bbe){const _0x47237f=a46_0x350b3f,{options:_0x4a45a3,args:_0x39dec1,tdx:_0x15aad6}=_0x499bbe,_0x354bf2=_0x39dec1[0x0],_0x5afdd0=_0x39dec1[0x1]||'.';if(!_0x354bf2)return console[_0x47237f(0xe6)](_0x47237f(0x236)),console[_0x47237f(0xe6)](_0x47237f(0x166)),0x1;const _0x2f063e=_0x4a45a3[_0x47237f(0x1c4)];_0x4a45a3[_0x47237f(0x15f)]&&(console[_0x47237f(0xe6)](_0x47237f(0x208)+_0x354bf2),console['error'](_0x47237f(0x182)+_0x5afdd0),_0x2f063e&&console['error']('Revision:\x20'+_0x2f063e));const _0x394c1e=await withSpinner(_0x47237f(0x185)+_0x354bf2+_0x47237f(0x1f1),()=>_0x15aad6[_0x47237f(0xa9)]['download'](_0x354bf2,_0x5afdd0,{'revision':_0x2f063e}),{'verbose':_0x4a45a3[_0x47237f(0x15f)]}),_0x10059e=_0x394c1e[_0x47237f(0xa2)];return console[_0x47237f(0xe6)](_0x47237f(0x1bb)+_0x10059e['projectName']),console[_0x47237f(0xe6)](_0x47237f(0x1af)+_0x10059e[_0x47237f(0x1c4)]),console[_0x47237f(0xe6)]('\x20\x20Files\x20extracted:\x20'+_0x10059e['filesExtracted']),console[_0x47237f(0xe6)](_0x47237f(0x106)+_0x5afdd0+'/'+_0x10059e[_0x47237f(0x1dc)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a46_0x350b3f(0x1bf);[a46_0x350b3f(0x125)]=a46_0x350b3f(0xf4);async[a46_0x350b3f(0x17f)](_0x151b4d){const _0x3ad330=a46_0x350b3f,{options:_0xa0cdd9,args:_0x10ff1c,tdx:_0x211d72}=_0x151b4d;let _0x38533e='.',_0x164e23=_0xa0cdd9['name'];if(_0x10ff1c[0x0]){const {promises:_0x2fc68d}=await import('fs');try{const _0x20310b=await _0x2fc68d[_0x3ad330(0xad)](_0x10ff1c[0x0]);if(_0x20310b[_0x3ad330(0x91)]())_0x38533e=_0x10ff1c[0x0];else return console[_0x3ad330(0xe6)]('Error:\x20'+_0x10ff1c[0x0]+_0x3ad330(0x1e1)),0x1;}catch{_0x164e23=_0x10ff1c[0x0],_0x38533e='.';}}const _0x11aa99=_0xa0cdd9[_0x3ad330(0x1c4)],_0x339c68=_0xa0cdd9[_0x3ad330(0x22e)];_0xa0cdd9[_0x3ad330(0x15f)]&&(console[_0x3ad330(0xe6)]('Project\x20directory:\x20'+_0x38533e),_0x164e23&&console[_0x3ad330(0xe6)](_0x3ad330(0xa0)+_0x164e23),_0x11aa99&&console['error']('Revision:\x20'+_0x11aa99),_0x339c68&&console[_0x3ad330(0xe6)]('Validation:\x20skipped'));const _0x5affaf=await withSpinner(_0x3ad330(0x11f),()=>_0x211d72[_0x3ad330(0xa9)]['push'](_0x38533e,{'projectName':_0x164e23,'revision':_0x11aa99,'skipValidation':_0x339c68}),{'verbose':_0xa0cdd9[_0x3ad330(0x15f)]}),_0xe94802=_0x5affaf[_0x3ad330(0xa2)];return console[_0x3ad330(0xe6)]('✔\x20Pushed\x20'+_0xe94802[_0x3ad330(0x1dc)]),console[_0x3ad330(0xe6)](_0x3ad330(0x1aa)+_0xe94802[_0x3ad330(0x1fb)]),console[_0x3ad330(0xe6)](_0x3ad330(0x1af)+_0xe94802[_0x3ad330(0x1c4)]),await this[_0x3ad330(0x1a7)](_0x211d72,_0xe94802['projectName'],_0xa0cdd9[_0x3ad330(0xd5)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x104);[a46_0x350b3f(0x125)]=a46_0x350b3f(0xf2);async[a46_0x350b3f(0x17f)](_0x2c9398){const _0x2dc910=a46_0x350b3f,{options:_0x34a44e,args:_0x39f987,tdx:_0x3f4a1f}=_0x2c9398,_0x488c11=_0x39f987[0x0],_0x137753=_0x39f987[0x1];if(!_0x488c11)return console[_0x2dc910(0xe6)](a46_0x41c3a5[_0x2dc910(0xb4)](_0x2dc910(0xe5)),_0x2dc910(0x120)),console[_0x2dc910(0xe6)](a46_0x41c3a5['dim']('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x593abf=_0x34a44e[_0x2dc910(0x1c4)];_0x34a44e[_0x2dc910(0x15f)]&&(console['error'](_0x2dc910(0x208)+_0x488c11),_0x137753&&console['error'](_0x2dc910(0x1e4)+_0x137753),_0x593abf&&console[_0x2dc910(0xe6)]('Revision:\x20'+_0x593abf),_0x34a44e[_0x2dc910(0x12a)]&&console[_0x2dc910(0xe6)](_0x2dc910(0x1a2)));const _0x52dec7=await withSpinner(_0x2dc910(0x19e)+_0x488c11+'...',()=>_0x3f4a1f[_0x2dc910(0xa9)][_0x2dc910(0xdb)](_0x488c11,{'targetDir':_0x137753,'revision':_0x593abf}),{'verbose':_0x34a44e[_0x2dc910(0x15f)]}),_0x13627b=_0x52dec7[_0x2dc910(0xa2)];_0x13627b[_0x2dc910(0x210)]?console[_0x2dc910(0xe6)](_0x2dc910(0x16b)+_0x13627b[_0x2dc910(0x1dc)]):console[_0x2dc910(0xe6)](_0x2dc910(0xd9)+_0x13627b['projectName']);console['error']('\x20\x20Revision:\x20'+_0x13627b[_0x2dc910(0x1c4)]),console[_0x2dc910(0xe6)](_0x2dc910(0x19c)+(a46_0x418c9f[_0x2dc910(0xcc)](process['cwd'](),_0x13627b[_0x2dc910(0x11c)])||'.')),console[_0x2dc910(0xe6)]('\x20\x20Changes:\x20'+a46_0x41c3a5[_0x2dc910(0x103)]('+'+_0x13627b[_0x2dc910(0x221)][_0x2dc910(0x11a)]+'\x20new')+',\x20'+(a46_0x41c3a5['yellow']('~'+_0x13627b[_0x2dc910(0x221)][_0x2dc910(0x1be)]+_0x2dc910(0x177))+',\x20')+(a46_0x41c3a5[_0x2dc910(0xb4)]('-'+_0x13627b[_0x2dc910(0x221)][_0x2dc910(0xab)]+_0x2dc910(0xeb))+',\x20')+(''+a46_0x41c3a5[_0x2dc910(0x1c2)](_0x13627b[_0x2dc910(0x221)][_0x2dc910(0x1f5)]+'\x20unchanged')));for(const _0x5e1fa0 of _0x13627b['changes']){_0x5e1fa0[_0x2dc910(0x176)]==='modified'&&_0x5e1fa0['diff']&&(console[_0x2dc910(0xe6)]('\x0a'+a46_0x41c3a5[_0x2dc910(0x1a0)](_0x2dc910(0x147)+_0x5e1fa0[_0x2dc910(0xf1)])),console[_0x2dc910(0xe6)](_0x5e1fa0[_0x2dc910(0xf6)]));}if(!_0x13627b[_0x2dc910(0x9e)])return saveSessionContext({'workflow_project':_0x13627b[_0x2dc910(0x1dc)]},_0x34a44e[_0x2dc910(0x21d)]),console[_0x2dc910(0xe6)](a46_0x41c3a5[_0x2dc910(0x103)]('\x0a✔\x20Already\x20up\x20to\x20date')),console['error'](a46_0x41c3a5[_0x2dc910(0x1c2)](_0x2dc910(0xc2)+_0x13627b['projectName'])),0x0;if(_0x34a44e[_0x2dc910(0x12a)])return console[_0x2dc910(0xe6)](a46_0x41c3a5['yellow']('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x34a44e[_0x2dc910(0x1bd)]){if(!isInteractive())return console[_0x2dc910(0xe6)](a46_0x41c3a5[_0x2dc910(0xb4)](_0x2dc910(0x140)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a46_0x41c3a5[_0x2dc910(0x1c2)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1b662f=await confirmKey(_0x2dc910(0xfe));if(!_0x1b662f)return console[_0x2dc910(0xe6)](a46_0x41c3a5[_0x2dc910(0x222)](_0x2dc910(0x1ed)),_0x2dc910(0xc7)),0x1;}await withSpinner(_0x2dc910(0xc4),()=>_0x3f4a1f[_0x2dc910(0xa9)][_0x2dc910(0x97)](_0x13627b,{'revision':_0x593abf}),{'verbose':_0x34a44e['verbose']}),saveSessionContext({'workflow_project':_0x13627b[_0x2dc910(0x1dc)]},_0x34a44e['session']),console[_0x2dc910(0xe6)](a46_0x41c3a5[_0x2dc910(0x103)](_0x2dc910(0xb1)));const _0x1d86ae=a46_0x418c9f[_0x2dc910(0xcc)](process[_0x2dc910(0x11d)](),_0x13627b[_0x2dc910(0x11c)])||'.';return console[_0x2dc910(0xe6)](a46_0x41c3a5['dim'](_0x2dc910(0x106)+_0x1d86ae)),console[_0x2dc910(0xe6)](a46_0x41c3a5['dim'](_0x2dc910(0xc2)+_0x13627b['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0xb2);['description']=a46_0x350b3f(0x1e0);async[a46_0x350b3f(0x17f)](_0x4c6c0d){const _0x59e048=a46_0x350b3f,{options:_0x414d95,args:_0xdc0471,tdx:_0x2e31cb}=_0x4c6c0d,_0x37fa5a=this[_0x59e048(0x10a)](_0xdc0471,_0x414d95),_0x354d15=_0x414d95[_0x59e048(0x1c4)],_0x7f4f3f=_0x414d95[_0x59e048(0x22e)];_0x414d95['verbose']&&(_0x37fa5a&&console[_0x59e048(0xe6)](_0x59e048(0x1e3)+_0x37fa5a),_0x354d15&&console['error'](_0x59e048(0x1c6)+_0x354d15),_0x414d95['dryRun']&&console[_0x59e048(0xe6)]('Dry\x20run:\x20yes'),_0x7f4f3f&&console[_0x59e048(0xe6)](_0x59e048(0xef)));let _0x517c22;try{_0x517c22=await withSpinner(_0x59e048(0x184),()=>_0x2e31cb['workflow'][_0x59e048(0x22c)]({'sourceDir':_0x37fa5a,'revision':_0x354d15,'skipValidation':_0x7f4f3f}),{'verbose':_0x414d95[_0x59e048(0x15f)]});}catch(_0x3c1a2c){if(_0x3c1a2c instanceof Error&&_0x3c1a2c['message'][_0x59e048(0x17b)](_0x59e048(0x204)))return console[_0x59e048(0xe6)](a46_0x41c3a5['red'](_0x59e048(0xe5)),_0x59e048(0x16c)),_0x414d95[_0x59e048(0x151)]?console[_0x59e048(0xe6)](a46_0x41c3a5[_0x59e048(0x1c2)](_0x59e048(0xbf)+_0x414d95[_0x59e048(0x151)]+_0x59e048(0x1f9)+_0x414d95[_0x59e048(0x151)]+'\x27')):console['error'](a46_0x41c3a5[_0x59e048(0x1c2)](_0x59e048(0x197))),0x1;throw _0x3c1a2c;}const _0x30255b=_0x517c22[_0x59e048(0xa2)];console['error'](_0x59e048(0x154)+_0x30255b['projectName']),console[_0x59e048(0xe6)](_0x59e048(0x18d)+_0x30255b['sourceDir']),console[_0x59e048(0xe6)](_0x59e048(0x1af)+_0x30255b['revision']),console[_0x59e048(0xe6)]('\x20\x20Changes:\x20'+a46_0x41c3a5[_0x59e048(0x103)]('+'+_0x30255b[_0x59e048(0x221)]['new']+_0x59e048(0x19d))+',\x20'+(a46_0x41c3a5[_0x59e048(0x222)]('~'+_0x30255b[_0x59e048(0x221)][_0x59e048(0x1be)]+'\x20modified')+',\x20')+(a46_0x41c3a5[_0x59e048(0xb4)]('-'+_0x30255b['summary']['deleted']+_0x59e048(0xeb))+',\x20')+(''+a46_0x41c3a5[_0x59e048(0x1c2)](_0x30255b[_0x59e048(0x221)][_0x59e048(0x1f5)]+_0x59e048(0xe9))));for(const _0x523862 of _0x30255b[_0x59e048(0x18f)]){_0x523862[_0x59e048(0x176)]===_0x59e048(0x1be)&&_0x523862[_0x59e048(0xf6)]&&(console[_0x59e048(0xe6)]('\x0a'+a46_0x41c3a5['cyan'](_0x59e048(0x147)+_0x523862['path'])),console[_0x59e048(0xe6)](_0x523862[_0x59e048(0xf6)]));}if(!_0x30255b[_0x59e048(0x9e)])return console[_0x59e048(0xe6)](a46_0x41c3a5[_0x59e048(0x103)](_0x59e048(0x134))),await this[_0x59e048(0x1a7)](_0x2e31cb,_0x30255b['projectName'],_0x414d95['site']),0x0;if(_0x414d95[_0x59e048(0x12a)])return console['error'](a46_0x41c3a5['yellow'](_0x59e048(0x200))),0x0;if(!_0x414d95[_0x59e048(0x1bd)]){if(!isInteractive())return console[_0x59e048(0xe6)](a46_0x41c3a5[_0x59e048(0xb4)](_0x59e048(0x140)),_0x59e048(0x1f0)),console['error'](a46_0x41c3a5[_0x59e048(0x1c2)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x564c23=await confirmKey(_0x59e048(0x132));if(!_0x564c23)return console[_0x59e048(0xe6)](a46_0x41c3a5[_0x59e048(0x222)](_0x59e048(0x1ed)),_0x59e048(0x1db)),0x1;}const _0x3b8329=await withSpinner('Pushing\x20project...',()=>_0x2e31cb[_0x59e048(0xa9)]['executePushProject'](_0x30255b),{'verbose':_0x414d95['verbose']}),_0x5a775c=_0x3b8329['data'];return console[_0x59e048(0xe6)](a46_0x41c3a5[_0x59e048(0x103)](_0x59e048(0x234))),console[_0x59e048(0xe6)](_0x59e048(0x1aa)+_0x5a775c[_0x59e048(0x1fb)]),console[_0x59e048(0xe6)](_0x59e048(0x1af)+_0x5a775c[_0x59e048(0x1c4)]),await this[_0x59e048(0x1a7)](_0x2e31cb,_0x5a775c[_0x59e048(0x1dc)],_0x414d95[_0x59e048(0xd5)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a46_0x350b3f(0xea)]='workflow:clone';[a46_0x350b3f(0x125)]=a46_0x350b3f(0x1e6);async[a46_0x350b3f(0x17f)](_0x3d95e5){const _0x1c7e7a=a46_0x350b3f,{options:_0x2ae6f5,args:_0x350734,tdx:_0x3e970e}=_0x3d95e5,_0x1c33e8=this[_0x1c7e7a(0x10a)](_0x350734,_0x2ae6f5),_0x1a3e87=_0x2ae6f5[_0x1c7e7a(0xea)],_0x538da9=_0x2ae6f5[_0x1c7e7a(0x1c4)],_0x24615c=_0x2ae6f5[_0x1c7e7a(0x22e)];if(!_0x1c33e8)return console[_0x1c7e7a(0xe6)](a46_0x41c3a5[_0x1c7e7a(0xb4)]('Error:'),_0x1c7e7a(0xb7)),console[_0x1c7e7a(0xe6)](a46_0x41c3a5[_0x1c7e7a(0x1c2)](_0x1c7e7a(0x20f))),console[_0x1c7e7a(0xe6)](a46_0x41c3a5[_0x1c7e7a(0x1c2)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x1a3e87)return console['error'](a46_0x41c3a5[_0x1c7e7a(0xb4)](_0x1c7e7a(0xe5)),_0x1c7e7a(0x114)),console['error'](a46_0x41c3a5[_0x1c7e7a(0x1c2)](_0x1c7e7a(0x20f))),0x1;_0x2ae6f5['verbose']&&(console[_0x1c7e7a(0xe6)]('Source\x20directory:\x20'+_0x1c33e8),console['error'](_0x1c7e7a(0x21f)+_0x1a3e87),_0x538da9&&console['error'](_0x1c7e7a(0x1c6)+_0x538da9),_0x2ae6f5[_0x1c7e7a(0x12a)]&&console['error'](_0x1c7e7a(0x1a2)),_0x24615c&&console[_0x1c7e7a(0xe6)](_0x1c7e7a(0xef)));const _0x694e82=await withSpinner(_0x1c7e7a(0xa6),()=>_0x3e970e['workflow'][_0x1c7e7a(0x94)](_0x1c33e8,_0x1a3e87,{'revision':_0x538da9,'skipValidation':_0x24615c}),{'verbose':_0x2ae6f5[_0x1c7e7a(0x15f)]}),_0x4da8cf=_0x694e82[_0x1c7e7a(0xa2)];console[_0x1c7e7a(0xe6)]('Source:\x20'+_0x4da8cf[_0x1c7e7a(0x9d)]);_0x4da8cf['sourceProjectName']&&console[_0x1c7e7a(0xe6)](_0x1c7e7a(0xfc)+_0x4da8cf[_0x1c7e7a(0xa3)]);console[_0x1c7e7a(0xe6)](_0x1c7e7a(0x21f)+_0x4da8cf[_0x1c7e7a(0x1b8)]),console['error']('Revision:\x20'+_0x4da8cf['revision']),console[_0x1c7e7a(0xe6)](_0x1c7e7a(0x18a)+_0x4da8cf['fileCount']);_0x4da8cf[_0x1c7e7a(0xc8)]&&(console[_0x1c7e7a(0xe6)](a46_0x41c3a5['yellow'](_0x1c7e7a(0xc1)+_0x4da8cf[_0x1c7e7a(0x1b8)]+_0x1c7e7a(0x98)+_0x4da8cf['existingProjectId']+')')),console[_0x1c7e7a(0xe6)](a46_0x41c3a5[_0x1c7e7a(0x222)](_0x1c7e7a(0x105))));if(_0x2ae6f5[_0x1c7e7a(0x12a)])return console[_0x1c7e7a(0xe6)](a46_0x41c3a5[_0x1c7e7a(0x222)](_0x1c7e7a(0x161))),0x0;if(!_0x2ae6f5[_0x1c7e7a(0x1bd)]){if(!isInteractive())return console['error'](a46_0x41c3a5[_0x1c7e7a(0xb4)](_0x1c7e7a(0x140)),_0x1c7e7a(0x1f0)),console['error'](a46_0x41c3a5[_0x1c7e7a(0x1c2)](_0x1c7e7a(0x220))),0x1;const _0x3fb250=_0x4da8cf[_0x1c7e7a(0xa3)]||a46_0x418c9f[_0x1c7e7a(0x1a5)](_0x1c33e8),_0x2cf288=_0x4da8cf['targetExists']?_0x1c7e7a(0x148)+_0x1a3e87+'\x22\x20with\x20new\x20revision?':_0x1c7e7a(0x20e)+_0x3fb250+_0x1c7e7a(0xbc)+_0x1a3e87+'\x22?',_0x1e3c31=await confirmKey(_0x2cf288);if(!_0x1e3c31)return console[_0x1c7e7a(0xe6)](a46_0x41c3a5[_0x1c7e7a(0x222)]('Cancelled')),0x1;}const _0x17b286=await withSpinner(_0x4da8cf[_0x1c7e7a(0xc8)]?_0x1c7e7a(0x169)+_0x1a3e87+_0x1c7e7a(0x1f1):_0x1c7e7a(0xf8)+_0x1a3e87+_0x1c7e7a(0x1f1),()=>_0x3e970e[_0x1c7e7a(0xa9)]['executeCloneProject'](_0x4da8cf),{'verbose':_0x2ae6f5[_0x1c7e7a(0x15f)]}),_0x43a99b=_0x17b286[_0x1c7e7a(0xa2)];return console[_0x1c7e7a(0xe6)](a46_0x41c3a5['green'](_0x4da8cf[_0x1c7e7a(0xc8)]?_0x1c7e7a(0x1da):_0x1c7e7a(0x118))),console[_0x1c7e7a(0xe6)](_0x1c7e7a(0x217)+_0x43a99b[_0x1c7e7a(0x1b8)]),console[_0x1c7e7a(0xe6)]('\x20\x20Project\x20ID:\x20'+_0x43a99b[_0x1c7e7a(0x1df)]),console['error'](_0x1c7e7a(0x1af)+_0x43a99b[_0x1c7e7a(0x1c4)]),await this[_0x1c7e7a(0x1a7)](_0x3e970e,_0x43a99b[_0x1c7e7a(0x1b8)],_0x2ae6f5['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a46_0x350b3f(0x1f7);[a46_0x350b3f(0x125)]=a46_0x350b3f(0xdf);async['execute'](_0x3f33cd){const _0x51db34=a46_0x350b3f,{options:_0x2dd941,args:_0x3bd392,tdx:_0x14ed28}=_0x3f33cd,_0xc97be6=_0x3bd392[0x0];if(!_0xc97be6)return console['error'](_0x51db34(0x1ae)),console['error'](_0x51db34(0x1b5)),0x1;_0x2dd941[_0x51db34(0x15f)]&&console[_0x51db34(0xe6)](_0x51db34(0x208)+_0xc97be6);if(!_0x2dd941['yes']){if(!isInteractive())return console[_0x51db34(0xe6)](a46_0x41c3a5[_0x51db34(0xb4)](_0x51db34(0x140)),_0x51db34(0x1f0)),console[_0x51db34(0xe6)](a46_0x41c3a5[_0x51db34(0x1c2)](_0x51db34(0x220))),0x1;const _0x56015a=await confirmKey(_0x51db34(0x1dd)+_0xc97be6+_0x51db34(0x1d4));if(!_0x56015a)return console[_0x51db34(0xe6)](a46_0x41c3a5[_0x51db34(0x222)](_0x51db34(0x1ed))),0x1;}const _0x2a113f=await withSpinner('Deleting\x20project\x20'+_0xc97be6+_0x51db34(0x1f1),()=>_0x14ed28[_0x51db34(0xa9)][_0x51db34(0x9b)](_0xc97be6),{'verbose':_0x2dd941[_0x51db34(0x15f)]}),_0x15295c=_0x2a113f[_0x51db34(0xa2)];return console[_0x51db34(0xe6)]('✔\x20Deleted\x20project\x20'+_0x15295c[_0x51db34(0x1dc)]),console[_0x51db34(0xe6)](_0x51db34(0x1aa)+_0x15295c[_0x51db34(0x1fb)]),0x0;}}export function parseKeyValue(_0x44094c){const _0x236fed=a46_0x350b3f,_0x361feb=_0x44094c[_0x236fed(0x111)]('=');if(_0x361feb===-0x1)throw new Error(_0x236fed(0xba)+_0x44094c+_0x236fed(0xe3));const _0x3362f2=_0x44094c[_0x236fed(0x90)](0x0,_0x361feb),_0x291c3e=_0x44094c['substring'](_0x361feb+0x1);if(!_0x3362f2)throw new Error(_0x236fed(0x159));return{'key':_0x3362f2,'value':_0x291c3e};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x1ea);[a46_0x350b3f(0x125)]=a46_0x350b3f(0x170);async['execute'](_0x25517e){const _0x7b1938=a46_0x350b3f,{options:_0xa14e79,args:_0x5f33c1,tdx:_0x371cc6}=_0x25517e,_0x45ca6f=this[_0x7b1938(0x17c)](_0x5f33c1,_0xa14e79);if(!_0x45ca6f)return 0x1;_0xa14e79[_0x7b1938(0x15f)]&&console[_0x7b1938(0xe6)](_0x7b1938(0x208)+_0x45ca6f);const _0x4afeed=await withSpinner('Listing\x20secrets...',()=>_0x371cc6[_0x7b1938(0xa9)][_0x7b1938(0xa8)](_0x45ca6f),{'verbose':_0xa14e79[_0x7b1938(0x15f)]}),{secrets:_0x29298c}=_0x4afeed[_0x7b1938(0xa2)];return console[_0x7b1938(0xe6)]('✔\x20Found\x20'+_0x29298c[_0x7b1938(0xbe)]+_0x7b1938(0x230)+(_0x29298c[_0x7b1938(0xbe)]!==0x1?'s':'')),await handleSDKOutput(_0x29298c,_0xa14e79),0x0;}}function a46_0x5827(){const _0x370af4=['end','createdAt','session_id','Source\x20project:\x20','\x0a✔\x20Attempt\x20complete','\x0aApply\x20these\x20changes?','getFullYear','\x20task','navigateSessionsInteractive','No\x20sessions\x20found\x20for:\x20','green','workflow:pull','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x20\x20Location:\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','running','slice','resolveProjectDir','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x1b[1A\x1b[2K','pending','126AFVYbq','getTime','workflow:secrets:set','indexOf','\x20-\x20','workflow:retry','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','No\x20workflows\x20found','fileSize','message','✔\x20Clone\x20complete','\x0aFailed\x20to\x20fetch\x20attempt\x20data','new','revision:\x20','targetDir','cwd','tasks','Pushing\x20workflow\x20project...','Project\x20name\x20is\x20required','output','✔\x20Found\x20','map','Filter:\x20','description','fullName','No\x20attempts\x20found\x20for:\x20','jsonl','MAX_TIMELINE_WIDTH','dryRun','sessionId','find','params','No\x20log\x20content\x20found','\x20to\x20see\x20detailed\x20logs','resumeFrom','\x20\x20Session\x20ID:\x20','\x0aPush\x20these\x20changes?','workflow:logs','\x0a✔\x20No\x20changes\x20to\x20push','buildTimelineData','icon','getDate','\x20(system)','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','done','Parameters:\x20','Status:\x20','setSecret','\x20of\x20','replace','\x0aError:','columns','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Attempt:\x20','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','ICON_SPACING','---\x20','\x0aUpdate\x20existing\x20project\x20\x22','716484osBHwG','MAX_LABEL_COUNT','parse','set','sort','956EWbvhP','some','Starting\x20workflow\x20run...','workflowProject','Task\x20name:\x20','generateSessionTimelineRows','✔\x20Project:\x20','List\x20workflows','\x27...','✔\x20Showing\x20','Getting\x20attempt\x20tasks...','Key\x20cannot\x20be\x20empty','repeat','📁\x20','Including\x20subtasks:\x20yes','log','(unknown)','verbose','Loading\x20workflows...','\x0aDry\x20run\x20-\x20no\x20project\x20created','✔\x20Retry\x20started','\x20workflow','Session\x20','\x20has\x20no\x20attempts','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Listing\x20workflow\x20projects...','ICON_WIDTH','Updating\x20','Pattern:\x20','→\x20New\x20project:\x20','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','\x20from\x20session\x20','108KCWCol','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','floor','workflow:use','\x27\x20from\x20project\x20\x27','Kill\x20a\x20running\x20attempt','renderTimeline','type','\x20modified','175872oyUCHU','match','\x20tasks','includes','requireProject','✔\x20Secret\x20\x27','push','execute','finishedAt','padStart','Output\x20directory:\x20','Attempt\x20ID:\x20','Analyzing\x20changes...','Downloading\x20project\x20','now','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','limit','list','Files\x20to\x20upload:\x20','workflow:tasks','resolveProjectId','\x20\x20Source:\x20','Fetching\x20log\x20files...','changes','every','state','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','format','get','No\x20sessions\x20found','Listing\x20workflow\x20sessions...','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','cancelRequested','parseProjectWorkflowPattern','size','duration','\x20\x20Target:\x20','\x20new','Pulling\x20project\x20','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','cyan','success','Dry\x20run:\x20yes','startedAt','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','basename','write','showWorkflowConsoleUrl','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','workflow:download','\x20\x20Project\x20ID:\x20','splice','Auto-selected\x20latest\x20session:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20\x20Revision:\x20','workflow:timeline','toLowerCase','No\x20workflow\x20projects\x20found','MAX_TASKS_DISPLAY','startTime','Usage:\x20workflow:delete\x20<project-name-or-id>','utf-8','sessionTime','newProjectName','attempts','Usage:\x20tdx\x20wf\x20use\x20<project>','✔\x20Downloaded\x20','trimEnd','yes','modified','workflow:upload','tdx.json','workflow:kill','dim','fill','revision','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Revision:\x20','getMonth','Show\x20specific\x20attempt\x20details','canceling','includeSubtasks','fs/promises','Loading\x20session...','Target:\x20','\x20\x20Console:\x20','\x20(use\x20--limit\x20to\x20show\x20more)','retryAttemptName','Filter:\x20project=','table','Select\x20a\x20task\x20to\x20view\x20logs:','\x22?\x20This\x20cannot\x20be\x20undone.','window','Retrying\x20session...','Show\x20tasks\x20for\x20an\x20attempt','No\x20sessions\x20with\x20timing\x20information','white','✔\x20Project\x20updated','-\x20nothing\x20pushed','projectName','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','✔\x20Workflow\x20project\x20set\x20to:\x20','newProjectId','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','\x20is\x20not\x20a\x20directory','readFile','Source\x20directory:\x20','Target\x20directory:\x20','Listing\x20workflows...','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','No\x20matching\x20sessions\x20found','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','workflow:secrets:list','Deleting\x20secret...','List\x20all\x20workflow\x20projects','Cancelled','autocomplete','key','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','...','attempt','attemptId','getHours','unchanged','isTTY','workflow:delete','1548342FzgFEC','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','workflow:sessions','projectId','✔\x20Workflow\x20project\x20context\x20cleared.','retrySession','values','context','\x0aDry\x20run\x20-\x20nothing\x20pushed','Session\x20not\x20found:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Error:\x20Secret\x20key\x20is\x20required','No\x20workflow\x20tdx.json\x20found','logFiles','Resolving\x20project\x20\x27','💡\x20Tip:\x20Use\x20','Project:\x20','Retrying\x20attempt...','workflow:run','taskName','resolveProject','attempt:','\x0aClone\x20\x22','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','isNewProject','blue','keys','\x20\x20tdx\x20wf\x20use\x20<project>','min','Latest\x20session\x20has\x20no\x20attempt','value','\x20\x20Project:\x20','startsWith','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Retry\x20a\x20session\x20or\x20attempt','updatedAt','localeCompare','session','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','New\x20project\x20name:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','summary','yellow','No\x20workflows\x20found\x20in\x20project:\x20','Loading\x20sessions...','deleteSecret','\x20session','json','tdx\x20wf\x20attempt\x20','project','POLL_INTERVAL_MS','1002070pAqZpY','preparePushProject','planned','skipValidation','displayLine','\x20secret','clear','unknown','filter','✔\x20Push\x20complete','workflows','Error:\x20Project\x20name\x20is\x20required','msPerChar','Key:\x20','139902SETuuw','toISOString','substring','isDirectory','logs','workflow:projects','prepareCloneProject','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','2524TWBLuV','applyPullProject','\x22\x20already\x20exists\x20(ID:\x20','join','force','delete','select','sourceDir','hasChanges','\x20logs','Project\x20name:\x20','Params:\x20','data','sourceProjectName','split','task','Analyzing\x20project...','Warning:','listSecrets','workflow','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','deleted','group_error','stat','sessions','workflow:attempt','/app/workflows/','✔\x20Pull\x20complete','workflow:push','title','red','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','status','Source\x20directory\x20is\x20required','round','Reason:\x20','Invalid\x20format:\x20','follow','\x22\x20to\x20new\x20project\x20\x22','Expected\x20format:\x20--param\x20key=value','length','Tip:\x20cd\x20to\x20workflows/','No\x20sessions\x20found\x20in\x20project:\x20','\x0a⚠\x20Project\x20\x22','\x20\x20Session\x20context\x20set\x20to:\x20','reason','Writing\x20files...','Listing\x20workflow\x20attempts...','Error:\x20Attempt\x20ID\x20is\x20required','-\x20no\x20files\x20written','targetExists','✔\x20Workflow\x20run\x20started','\x20\x20Attempt\x20ID:\x20','projects','relative','index','MIN_TIMELINE_WIDTH','start','No\x20attempts\x20found\x20in\x20project:\x20','\x20sessions\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x20attempt','\x20\x20New\x20attempt\x20ID:\x20','site','renderSingleTimeline','lastAttempt','List\x20workflow\x20attempts','→\x20Project:\x20','LABEL_MIN_SPACING','pullProject','workflow:attempts','Select\x20a\x20workflow\x20to\x20run','Error:\x20Invalid\x20parameter\x20format:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','renderSessionsTimeline','stdout','max','.\x20Expected\x20format:\x20KEY=VALUE','workflowName','Error:','error','all','pollTimeline','\x20unchanged','name','\x20deleted','GUTTER','fromTask','(use\x20--limit\x20to\x20see\x20more)','Validation:\x20skipped','from','path','Pull\x20workflow\x20project\x20to\x20local\x20folder','Start\x20a\x20workflow\x20run','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','diff','Downloading\x20logs...','Cloning\x20to\x20'];a46_0x5827=function(){return _0x370af4;};return a46_0x5827();}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x110);[a46_0x350b3f(0x125)]=a46_0x350b3f(0x187);async['execute'](_0x5c2ce4){const _0x4b775a=a46_0x350b3f,{options:_0x1f68d3,args:_0x375dcc,tdx:_0x4def85}=_0x5c2ce4;let _0x28d628,_0x2c12a8;if(_0x375dcc[_0x4b775a(0xbe)]>=0x2)_0x28d628=_0x375dcc[0x0],_0x2c12a8=_0x375dcc[0x1];else{if(_0x375dcc[_0x4b775a(0xbe)]===0x1&&_0x1f68d3[_0x4b775a(0x151)])_0x28d628=_0x1f68d3['workflowProject'],_0x2c12a8=_0x375dcc[0x0];else return _0x375dcc['length']===0x1?(console[_0x4b775a(0xe6)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x4b775a(0xe6)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x4b775a(0xe6)]('Error:\x20KEY=VALUE\x20is\x20required'),console[_0x4b775a(0xe6)](_0x4b775a(0x19f)),0x1);}let _0x4de5cd,_0x1c5fa8;try{({key:_0x4de5cd,value:_0x1c5fa8}=parseKeyValue(_0x2c12a8));}catch(_0x340c86){return _0x340c86 instanceof Error&&console[_0x4b775a(0xe6)](a46_0x41c3a5[_0x4b775a(0xb4)](_0x4b775a(0xe5)),_0x340c86[_0x4b775a(0x117)]),0x1;}_0x1f68d3[_0x4b775a(0x15f)]&&(console[_0x4b775a(0xe6)](_0x4b775a(0x208)+_0x28d628),console['error'](_0x4b775a(0x8d)+_0x4de5cd));const _0x5f5653=await withSpinner('Setting\x20secret...',()=>_0x4def85[_0x4b775a(0xa9)][_0x4b775a(0x13d)](_0x28d628,_0x4de5cd,_0x1c5fa8),{'verbose':_0x1f68d3[_0x4b775a(0x15f)]}),_0x1e0231=_0x5f5653[_0x4b775a(0xa2)];return console[_0x4b775a(0xe6)](_0x4b775a(0x17d)+_0x1e0231['key']+_0x4b775a(0x107)+_0x1e0231[_0x4b775a(0x1dc)]+'\x27'),(_0x1f68d3[_0x4b775a(0x227)]||_0x1f68d3[_0x4b775a(0x128)])&&await handleSingleObjectOutput(_0x1e0231,_0x1f68d3),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a46_0x350b3f(0xea)]='workflow:secrets:delete';['description']=a46_0x350b3f(0x95);async[a46_0x350b3f(0x17f)](_0x485b47){const _0x597ed9=a46_0x350b3f,{options:_0x11d9ce,args:_0x47c711,tdx:_0x4a7b88}=_0x485b47;let _0xba5040,_0x3ba92c;if(_0x47c711[_0x597ed9(0xbe)]>=0x2)_0xba5040=_0x47c711[0x0],_0x3ba92c=_0x47c711[0x1];else{if(_0x47c711[_0x597ed9(0xbe)]===0x1&&_0x11d9ce['workflowProject'])_0xba5040=_0x11d9ce[_0x597ed9(0x151)],_0x3ba92c=_0x47c711[0x0];else return _0x47c711[_0x597ed9(0xbe)]===0x1?(console[_0x597ed9(0xe6)](_0x597ed9(0x236)),console[_0x597ed9(0xe6)](_0x597ed9(0xf5)),0x1):(console[_0x597ed9(0xe6)](_0x597ed9(0x203)),console[_0x597ed9(0xe6)](_0x597ed9(0x202)),0x1);}_0x11d9ce['verbose']&&(console[_0x597ed9(0xe6)](_0x597ed9(0x208)+_0xba5040),console[_0x597ed9(0xe6)]('Key:\x20'+_0x3ba92c));if(!_0x11d9ce[_0x597ed9(0x1bd)]){if(!isInteractive())return console[_0x597ed9(0xe6)](a46_0x41c3a5['red'](_0x597ed9(0x140)),_0x597ed9(0x1f0)),console[_0x597ed9(0xe6)](a46_0x41c3a5[_0x597ed9(0x1c2)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3506e6=await confirmKey(_0x597ed9(0x1a4)+_0x3ba92c+_0x597ed9(0x173)+_0xba5040+'\x27?');if(!_0x3506e6)return console[_0x597ed9(0xe6)](a46_0x41c3a5[_0x597ed9(0x222)]('Cancelled')),0x1;}const _0x500162=await withSpinner(_0x597ed9(0x1eb),()=>_0x4a7b88[_0x597ed9(0xa9)][_0x597ed9(0x225)](_0xba5040,_0x3ba92c),{'verbose':_0x11d9ce[_0x597ed9(0x15f)]}),_0x2f2d50=_0x500162[_0x597ed9(0xa2)];return console['error'](_0x597ed9(0x17d)+_0x2f2d50[_0x597ed9(0x1ef)]+_0x597ed9(0x139)+_0x2f2d50[_0x597ed9(0x1dc)]+'\x27'),(_0x11d9ce[_0x597ed9(0x227)]||_0x11d9ce[_0x597ed9(0x128)])&&await handleSingleObjectOutput(_0x2f2d50,_0x11d9ce),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(_0x480696){const _0x19a265=a46_0x350b3f,_0x3a7a4b=Math[_0x19a265(0x171)](_0x480696/0x3e8),_0x859c7d=Math[_0x19a265(0x171)](_0x3a7a4b/0x3c),_0x58cde5=Math['floor'](_0x859c7d/0x3c),_0x225da8=Math[_0x19a265(0x171)](_0x58cde5/0x18);if(_0x225da8>0x0){const _0x234682=_0x58cde5%0x18;return _0x234682>0x0?_0x225da8+'d\x20'+_0x234682+'h':_0x225da8+'d';}else{if(_0x58cde5>0x0){const _0x1520bc=_0x859c7d%0x3c;return _0x1520bc>0x0?_0x58cde5+'h\x20'+_0x1520bc+'m':_0x58cde5+'h';}else{if(_0x859c7d>0x0){const _0x1333c2=_0x3a7a4b%0x3c;return _0x1333c2>0x0?_0x859c7d+'m\x20'+_0x1333c2+'s':_0x859c7d+'m';}else return _0x3a7a4b+'s';}}}function formatTimestamp(_0x4e1161,_0x111783){const _0x4108f6=a46_0x350b3f,_0x4c7afa=new Date(_0x4e1161),_0x51cd11=String(_0x4c7afa[_0x4108f6(0x1f4)]())[_0x4108f6(0x181)](0x2,'0'),_0x153d21=String(_0x4c7afa['getMinutes']())[_0x4108f6(0x181)](0x2,'0'),_0x4fc7ce=_0x51cd11+':'+_0x153d21,_0xa9d2e4=_0x4c7afa[_0x4108f6(0xff)]()===_0x111783[_0x4108f6(0xff)]()&&_0x4c7afa[_0x4108f6(0x1c7)]()===_0x111783['getMonth']()&&_0x4c7afa[_0x4108f6(0x137)]()===_0x111783['getDate']();if(_0xa9d2e4)return _0x4fc7ce;else{const _0x2aad80=String(_0x4c7afa['getMonth']()+0x1)[_0x4108f6(0x181)](0x2,'0'),_0x163982=String(_0x4c7afa['getDate']())[_0x4108f6(0x181)](0x2,'0');return _0x2aad80+'-'+_0x163982+'\x20'+_0x4fc7ce;}}function formatDate(_0x13cc82){const _0x2ca1a=a46_0x350b3f,_0x58d4ec=_0x13cc82[_0x2ca1a(0xff)](),_0x111ff2=String(_0x13cc82[_0x2ca1a(0x1c7)]()+0x1)['padStart'](0x2,'0'),_0x50be66=String(_0x13cc82[_0x2ca1a(0x137)]())[_0x2ca1a(0x181)](0x2,'0');return _0x58d4ec+'-'+_0x111ff2+'-'+_0x50be66;}function getTaskStateIcon(_0x650d00){const _0xf06e8b={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0xf06e8b[_0x650d00]||'⚪';}function getBarChar(_0x34593c){const _0x12106c=a46_0x350b3f;return _0x34593c===_0x12106c(0xe6)||_0x34593c===_0x12106c(0xac)?'×':'─';}function getBarColor(_0x5e3d5b){const _0x4c8d36=a46_0x350b3f,_0x12e83f={'success':a46_0x41c3a5['green'],'error':a46_0x41c3a5[_0x4c8d36(0xb4)],'group_error':a46_0x41c3a5[_0x4c8d36(0xb4)],'running':a46_0x41c3a5[_0x4c8d36(0x211)],'blocked':a46_0x41c3a5[_0x4c8d36(0x222)],'planned':a46_0x41c3a5[_0x4c8d36(0x1c2)],'canceling':a46_0x41c3a5[_0x4c8d36(0x222)]};return _0x12e83f[_0x5e3d5b]||a46_0x41c3a5[_0x4c8d36(0x1d9)];}function parseTaskName(_0x1aad21){const _0x4b7dfe=a46_0x350b3f;let _0x1e0c4d=_0x1aad21[_0x4b7dfe(0x13f)](/^\++/,'');const _0x3c3a75=_0x1e0c4d[_0x4b7dfe(0xa4)]('+'),_0x37664e=_0x3c3a75[_0x4b7dfe(0xbe)]>0x1?_0x3c3a75[_0x4b7dfe(0xbe)]-0x2:0x0,_0x4b4319=_0x3c3a75[_0x3c3a75[_0x4b7dfe(0xbe)]-0x1]||_0x1e0c4d;return{'level':_0x37664e,'name':'+'+_0x4b4319};}function truncateTaskName(_0x10e62a,_0x59ad72){const _0xb5a89c=a46_0x350b3f,_0x240fe5=stringWidth(_0x10e62a);if(_0x240fe5<=_0x59ad72)return _0x10e62a;let _0x5d1c97=_0x10e62a;while(stringWidth(_0x5d1c97+'…')>_0x59ad72&&_0x5d1c97[_0xb5a89c(0xbe)]>0x0){_0x5d1c97=_0x5d1c97[_0xb5a89c(0x109)](0x0,-0x1);}return _0x5d1c97+'…';}function calculateTimeScale(_0x5867e0,_0x1d4aff){const _0x225bd7=a46_0x350b3f;return{'startTime':_0x5867e0[_0x225bd7(0xcf)],'endTime':_0x5867e0[_0x225bd7(0xf9)],'durationMs':_0x5867e0[_0x225bd7(0x19b)],'msPerChar':_0x5867e0[_0x225bd7(0x19b)]/_0x1d4aff};}function timeToPosition(_0x44faf6,_0x4de2d3,_0x471d3b){const _0x179028=a46_0x350b3f,_0x415726=_0x44faf6-_0x4de2d3[_0x179028(0x1b4)],_0x5751f1=Math[_0x179028(0x171)](_0x415726/_0x4de2d3[_0x179028(0x8c)]);return Math['max'](0x0,Math[_0x179028(0x214)](_0x5751f1,_0x471d3b));}function renderTimeAxis(_0x55993f,_0x17620e){const _0x289898=a46_0x350b3f,_0x5882cb=Math[_0x289898(0x214)](TIMELINE_CONFIG[_0x289898(0x14a)],Math[_0x289898(0xe2)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x289898(0x171)](_0x17620e/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x11ba4d=_0x55993f['durationMs']/(_0x5882cb-0x1),_0x907a2=new Date(_0x55993f['startTime']),_0x12c55c=[];for(let _0xffd6dc=0x0;_0xffd6dc<_0x5882cb;_0xffd6dc++){const _0x1f1a06=_0x55993f[_0x289898(0x1b4)]+_0xffd6dc*_0x11ba4d,_0x1a8bb2=timeToPosition(_0x1f1a06,_0x55993f,_0x17620e),_0x5e4e1a=formatTimestamp(_0x1f1a06,_0x907a2);_0x12c55c['push']({'pos':_0x1a8bb2,'text':_0x5e4e1a});}const _0x490341=new Array(_0x17620e)[_0x289898(0x1c3)]('\x20');let _0xc4700b=-0x1;for(const {pos:_0x28c50,text:_0x3f99d6}of _0x12c55c){let _0x39fc8a=Math[_0x289898(0xe2)](0x0,_0x28c50-Math[_0x289898(0x171)](_0x3f99d6[_0x289898(0xbe)]/0x2));_0x39fc8a<=_0xc4700b+TIMELINE_CONFIG[_0x289898(0xda)]&&(_0x39fc8a=_0xc4700b+TIMELINE_CONFIG[_0x289898(0xda)]+0x1);_0x39fc8a+_0x3f99d6['length']>_0x17620e&&(_0x39fc8a=_0x17620e-_0x3f99d6[_0x289898(0xbe)]);if(_0x39fc8a>=0x0&&_0x39fc8a+_0x3f99d6[_0x289898(0xbe)]<=_0x17620e&&_0x39fc8a>_0xc4700b){for(let _0x30d9ca=0x0;_0x30d9ca<_0x3f99d6[_0x289898(0xbe)];_0x30d9ca++){_0x490341[_0x39fc8a+_0x30d9ca]=_0x3f99d6[_0x30d9ca];}_0xc4700b=_0x39fc8a+_0x3f99d6['length']-0x1;}}return _0x490341[_0x289898(0x99)]('');}function renderTaskRow(_0x193342,_0x1626a6,_0x25c161,_0x3c8586){const _0x2cacb0=a46_0x350b3f,{level:_0x4b065e,name:_0x917e68}=parseTaskName(_0x193342[_0x2cacb0(0xea)]),_0xb73f2f='\x20'[_0x2cacb0(0x15a)](_0x4b065e),_0x4b5547=_0x193342[_0x2cacb0(0x1d5)]?'('+formatElapsed(_0x193342[_0x2cacb0(0x1d5)][_0x2cacb0(0x19b)])+')':'',_0x3bb081=stringWidth(_0x4b5547),_0x3ba765=_0x4b065e*0x1,_0x2b4b2e=_0x3c8586-_0x3ba765-_0x3bb081-0x1,_0x115b4c=truncateTaskName(_0x917e68,_0x2b4b2e),_0x4af005=_0xb73f2f+_0x115b4c,_0x4e4571=stringWidth(_0x4af005),_0x4af125=_0x3c8586-_0x4e4571-_0x3bb081,_0x375294=_0x4af005+'\x20'[_0x2cacb0(0x15a)](Math[_0x2cacb0(0xe2)](0x1,_0x4af125))+a46_0x41c3a5['dim'](_0x4b5547),_0x540ec2=getTaskStateIcon(_0x193342['state']),_0x282861=new Array(_0x25c161)[_0x2cacb0(0x1c3)]('\x20');if(_0x193342[_0x2cacb0(0x1d5)]){const _0x7dac00=timeToPosition(_0x193342['window']['start'],_0x1626a6,_0x25c161),_0x4d8a2a=timeToPosition(_0x193342[_0x2cacb0(0x1d5)][_0x2cacb0(0xf9)],_0x1626a6,_0x25c161),_0x3e964e=getBarChar(_0x193342[_0x2cacb0(0x191)]),_0x22fe42=Math[_0x2cacb0(0xe2)](_0x7dac00+0x1,_0x4d8a2a);for(let _0x566051=_0x7dac00;_0x566051<Math['min'](_0x22fe42,_0x25c161);_0x566051++){_0x282861[_0x566051]=_0x3e964e;}}const _0x552aff=getBarColor(_0x193342[_0x2cacb0(0x191)]),_0x512a4e=_0x282861[_0x2cacb0(0x123)](_0x413a38=>_0x413a38==='\x20'?'\x20':_0x552aff(_0x413a38))[_0x2cacb0(0x99)]('');return _0x540ec2+'\x20'+_0x375294+'│'+_0x512a4e+'│';}function calculateStats(_0x3f1b33){const _0x23469b=a46_0x350b3f,_0x413bec={'total':_0x3f1b33[_0x23469b(0xbe)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x1b2a36 of _0x3f1b33){if(_0x1b2a36[_0x23469b(0x191)]===_0x23469b(0x1a1))_0x413bec[_0x23469b(0x1a1)]++;else{if(_0x1b2a36[_0x23469b(0x191)]===_0x23469b(0xe6)||_0x1b2a36[_0x23469b(0x191)]===_0x23469b(0xac))_0x413bec[_0x23469b(0xe6)]++;else _0x1b2a36[_0x23469b(0x191)]===_0x23469b(0x108)?_0x413bec[_0x23469b(0x108)]++:_0x413bec[_0x23469b(0x10d)]++;}}return _0x413bec;}function formatStats(_0x58876e){const _0x441a6d=a46_0x350b3f;return['Total:\x20'+_0x58876e['total'],'✅\x20'+_0x58876e[_0x441a6d(0x1a1)],'❌\x20'+_0x58876e[_0x441a6d(0xe6)],'🔄\x20'+_0x58876e[_0x441a6d(0x108)],'⏳\x20'+_0x58876e[_0x441a6d(0x10d)]][_0x441a6d(0x99)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a46_0x350b3f(0xea)]=a46_0x350b3f(0x1b0);[a46_0x350b3f(0x125)]=a46_0x350b3f(0x145);async[a46_0x350b3f(0x17f)](_0x57718c){const _0x475f63=a46_0x350b3f,{options:_0x2bc946,args:_0x5af896,tdx:_0x2b9949}=_0x57718c;let _0x3ec38a,_0x3321c2,_0x5f467f=![];if(_0x5af896[0x0]){if(_0x5af896[0x0][_0x475f63(0x17b)]('.')){const _0x3b9a1e=this[_0x475f63(0x199)](_0x5af896,_0x2bc946);if(!_0x3b9a1e)return 0x1;_0x3ec38a=_0x3b9a1e[_0x475f63(0x1dc)],_0x3321c2=_0x3b9a1e['workflowName'];}else{_0x3321c2=_0x5af896[0x0],_0x3ec38a=_0x2bc946[_0x475f63(0x151)];if(!_0x3ec38a)return console[_0x475f63(0xe6)](a46_0x41c3a5[_0x475f63(0xb4)]('Error:'),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x5f467f=!![];}}else{const _0x1e2db1=this[_0x475f63(0x199)](_0x5af896,_0x2bc946);if(!_0x1e2db1)return 0x1;_0x3ec38a=_0x1e2db1[_0x475f63(0x1dc)],_0x3321c2=_0x1e2db1[_0x475f63(0xe4)];}if(_0x2bc946['verbose']){if(_0x3ec38a&&_0x3321c2)console['error'](_0x475f63(0x124)+_0x3ec38a+'.'+_0x3321c2);else _0x3ec38a&&console['error'](_0x475f63(0x1d1)+_0x3ec38a);}const _0x51d06b=_0x2bc946[_0x475f63(0x1f3)],_0x585c66=_0x2bc946[_0x475f63(0x12b)];if(_0x51d06b){_0x585c66&&console['error'](a46_0x41c3a5[_0x475f63(0x222)](_0x475f63(0xa7)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x2fd286=_0x2bc946['follow'];return _0x2fd286?await this[_0x475f63(0xe8)](_0x57718c,_0x51d06b):await this[_0x475f63(0xd6)](_0x57718c,_0x51d06b,_0x2bc946),0x0;}if(_0x585c66){const _0x1d4ab4=await withSpinner(_0x475f63(0x1cc),()=>_0x2b9949[_0x475f63(0xa9)][_0x475f63(0xae)]({'projectName':_0x3ec38a,'workflowName':_0x3321c2,'limit':0x64}),{'verbose':_0x2bc946[_0x475f63(0x15f)]}),_0x5af832=_0x1d4ab4[_0x475f63(0xa2)][_0x475f63(0x12c)](_0x27f54a=>_0x27f54a['id']===_0x585c66);if(!_0x5af832)return console[_0x475f63(0xe6)](a46_0x41c3a5[_0x475f63(0xb4)](_0x475f63(0xe5)),_0x475f63(0x201)+_0x585c66),0x1;if(!_0x5af832[_0x475f63(0xd7)]?.['id'])return console[_0x475f63(0xe6)](a46_0x41c3a5[_0x475f63(0xb4)]('Error:'),_0x475f63(0x164)+_0x585c66+_0x475f63(0x165)),0x1;const _0x178b51=_0x5af832[_0x475f63(0xd7)]['id'];_0x2bc946[_0x475f63(0x15f)]&&console[_0x475f63(0xe6)]('Using\x20attempt\x20'+_0x178b51+_0x475f63(0x16d)+_0x585c66);const _0x2e9fa5=_0x2bc946[_0x475f63(0xbb)];return _0x2e9fa5?await this['pollTimeline'](_0x57718c,_0x178b51):await this[_0x475f63(0xd6)](_0x57718c,_0x178b51,_0x2bc946),0x0;}const _0x135444=await withSpinner(_0x475f63(0x224),()=>_0x2b9949['workflow'][_0x475f63(0xae)]({'projectName':_0x3ec38a,'workflowName':_0x3321c2,'limit':_0x2bc946[_0x475f63(0x188)]||0x32}),{'verbose':_0x2bc946['verbose']}),_0x5e4344=_0x135444['data'];if(_0x5e4344[_0x475f63(0xbe)]===0x0){if(_0x3ec38a&&_0x3321c2)console[_0x475f63(0xe6)](_0x475f63(0x102)+_0x3ec38a+'.'+_0x3321c2);else _0x3ec38a?console[_0x475f63(0xe6)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x3ec38a):(console[_0x475f63(0xe6)]('No\x20workflow\x20sessions\x20found'),console[_0x475f63(0xe6)](a46_0x41c3a5[_0x475f63(0x1c2)](_0x475f63(0x16f))));return 0x0;}_0x5e4344['sort']((_0x5534ca,_0x10abfc)=>{const _0x3936e3=_0x475f63,_0x586ef1=_0x5534ca[_0x3936e3(0x1b7)]||'',_0x21514e=_0x10abfc[_0x3936e3(0x1b7)]||'';return _0x21514e[_0x3936e3(0x21c)](_0x586ef1);});if(_0x2bc946[_0x475f63(0x227)]||_0x2bc946['jsonl'])return await handleSDKOutput(_0x5e4344,_0x2bc946),0x0;let _0xa1cd2d;if(_0x5f467f){const _0x19c39e=_0x5e4344[0x0];if(!_0x19c39e[_0x475f63(0xd7)]?.['id'])return console['error'](_0x475f63(0x215)),0x0;_0xa1cd2d=_0x19c39e[_0x475f63(0xd7)]['id'],_0x2bc946['verbose']&&console[_0x475f63(0xe6)](_0x475f63(0x1ac)+_0x19c39e[_0x475f63(0x1b7)]);}else{const _0x24b305=_0x5e4344[_0x475f63(0x123)](_0x217c0e=>{const _0x3bab11=_0x475f63,_0x499806=getAttemptStatusDisplay(_0x217c0e['lastAttempt']);return{'title':_0x217c0e['project']?.['name']+'.'+_0x217c0e[_0x3bab11(0xa9)]?.[_0x3bab11(0xea)]+'\x20-\x20'+_0x217c0e[_0x3bab11(0x1b7)]+'\x20'+_0x499806[_0x3bab11(0x136)],'value':_0x217c0e[_0x3bab11(0xd7)]?.['id']||'','description':_0x499806['text']};}),_0x28c592=await a46_0x443862({'type':_0x475f63(0x9c),'name':_0x475f63(0x1f3),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x24b305[_0x475f63(0x233)](_0x1bcbe7=>_0x1bcbe7[_0x475f63(0x216)]!=='')});if(!_0x28c592[_0x475f63(0x1f3)])return 0x0;_0xa1cd2d=_0x28c592[_0x475f63(0x1f3)];}const _0x2e9ece=_0x2bc946['follow'];return _0x2e9ece?await this['pollTimeline'](_0x57718c,_0xa1cd2d):await this[_0x475f63(0xd6)](_0x57718c,_0xa1cd2d,_0x2bc946),0x0;}async[a46_0x350b3f(0xd6)](_0x19f54c,_0x3f4fb5,_0x2a9047){const _0x3777e7=a46_0x350b3f,{tdx:_0x2af65c}=_0x19f54c;let _0x30cca1,_0x5c7f0a;try{[_0x30cca1,_0x5c7f0a]=await Promise[_0x3777e7(0xe7)]([_0x2af65c[_0x3777e7(0xa9)]['attempt'](_0x3f4fb5),_0x2af65c[_0x3777e7(0xa9)]['tasks'](_0x3f4fb5,![])]);}catch(_0x4ba3ad){console['error'](a46_0x41c3a5[_0x3777e7(0xb4)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x2a9047['verbose']&&console[_0x3777e7(0xe6)](_0x4ba3ad);throw _0x4ba3ad;}if(_0x2a9047[_0x3777e7(0x227)]||_0x2a9047[_0x3777e7(0x128)]){const _0x5a6605=this[_0x3777e7(0x135)](_0x30cca1,_0x5c7f0a);await handleSDKOutput([_0x5a6605],_0x2a9047);return;}const _0x3beefe=_0x2af65c['context']['site'],_0x1b6440=this[_0x3777e7(0x175)](_0x30cca1,_0x5c7f0a,_0x3beefe);console['log'](_0x1b6440);}async[a46_0x350b3f(0xe8)](_0x2dec6a,_0x4af781){const _0x3db3fe=a46_0x350b3f,{tdx:_0x48b160}=_0x2dec6a,_0x351c56=TIMELINE_CONFIG[_0x3db3fe(0x22a)],_0x4b329b=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x206101=0x0;while(_0x206101<_0x4b329b){process['stdout'][_0x3db3fe(0x1f6)]&&process[_0x3db3fe(0xe1)][_0x3db3fe(0x1a6)]('\x1bc');let _0x4f64cd,_0x175168;try{[_0x4f64cd,_0x175168]=await Promise['all']([_0x48b160['workflow'][_0x3db3fe(0x1f2)](_0x4af781),_0x48b160[_0x3db3fe(0xa9)][_0x3db3fe(0x11e)](_0x4af781,![])]);}catch(_0x1e580e){console['error'](a46_0x41c3a5[_0x3db3fe(0xb4)](_0x3db3fe(0x119)));_0x206101>0x0&&console[_0x3db3fe(0xe6)](a46_0x41c3a5[_0x3db3fe(0x1c2)](_0x3db3fe(0x1e8)+_0x206101));throw _0x1e580e;}const _0x5e8d7e=_0x48b160[_0x3db3fe(0x1ff)][_0x3db3fe(0xd5)],_0x8422a9=this['renderTimeline'](_0x4f64cd,_0x175168,_0x5e8d7e);console[_0x3db3fe(0x15d)](_0x8422a9);const _0x45bb7d=_0x4f64cd[_0x3db3fe(0x13a)]&&_0x175168[_0x3db3fe(0x190)](_0x129e8d=>_0x129e8d[_0x3db3fe(0x191)]!==_0x3db3fe(0x108)&&_0x129e8d[_0x3db3fe(0x191)]!==_0x3db3fe(0x22d));if(_0x45bb7d){console[_0x3db3fe(0xe6)](a46_0x41c3a5[_0x3db3fe(0x103)](_0x3db3fe(0xfd)));break;}console[_0x3db3fe(0xe6)](a46_0x41c3a5[_0x3db3fe(0x1c2)]('\x0aPolling...\x20('+_0x206101*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x36c44c=>setTimeout(_0x36c44c,_0x351c56)),_0x206101++;}_0x206101>=_0x4b329b&&console[_0x3db3fe(0xe6)](a46_0x41c3a5[_0x3db3fe(0x222)](_0x3db3fe(0x219)));}[a46_0x350b3f(0x175)](_0x2b9f5a,_0x426297,_0x22168d){const _0x446a49=a46_0x350b3f,_0x67cd22=[],_0x8259b9=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x284be7=0x5,_0x5f1556=process[_0x446a49(0xe1)][_0x446a49(0x141)]||0x78,_0x3c856a=_0x5f1556-_0x8259b9-_0x284be7,_0x416bae=Math['max'](TIMELINE_CONFIG[_0x446a49(0xce)],Math[_0x446a49(0x214)](_0x3c856a,TIMELINE_CONFIG[_0x446a49(0x129)])),_0x345df8=new Date(_0x2b9f5a[_0x446a49(0xfa)])[_0x446a49(0x10f)](),_0xc673f8=_0x2b9f5a['finishedAt']?new Date(_0x2b9f5a[_0x446a49(0x180)])[_0x446a49(0x10f)]():Date[_0x446a49(0x186)](),_0x21f556={'start':_0x345df8,'end':_0xc673f8,'duration':_0xc673f8-_0x345df8},_0x2542b0=new Map(),_0x138a2c=[];for(const _0x58c964 of _0x426297){if(_0x58c964[_0x446a49(0x1a3)]){const _0xbc2614=new Date(_0x58c964['startedAt'])[_0x446a49(0x10f)](),_0x4a3eb3=_0x58c964['updatedAt']?new Date(_0x58c964[_0x446a49(0x21b)])['getTime']():Date[_0x446a49(0x186)](),_0x23d286={'start':_0xbc2614,'end':_0x4a3eb3,'duration':_0x4a3eb3-_0xbc2614};_0x2542b0[_0x446a49(0x14c)](_0x58c964['id'],_0x23d286),_0x138a2c[_0x446a49(0x17e)]({'name':_0x58c964['fullName'],'state':_0x58c964[_0x446a49(0x191)]||_0x446a49(0x232),'window':_0x23d286});}else _0x138a2c[_0x446a49(0x17e)]({'name':_0x58c964[_0x446a49(0x126)],'state':_0x58c964[_0x446a49(0x191)]||'planned','window':undefined});}_0x138a2c['sort']((_0x27ac18,_0x544235)=>{const _0x461942=_0x446a49;if(!_0x27ac18[_0x461942(0x1d5)])return 0x1;if(!_0x544235[_0x461942(0x1d5)])return-0x1;return _0x27ac18[_0x461942(0x1d5)][_0x461942(0xcf)]-_0x544235[_0x461942(0x1d5)]['start'];});const _0x51fed1=_0x138a2c['length'],_0x14d12f=_0x51fed1>TIMELINE_CONFIG[_0x446a49(0x1b3)];_0x14d12f&&_0x138a2c[_0x446a49(0x1ab)](TIMELINE_CONFIG[_0x446a49(0x1b3)]);const _0x2a8d54=calculateTimeScale(_0x21f556,_0x416bae),_0x33e23e=_0x2b9f5a[_0x446a49(0x13a)]?_0x2b9f5a[_0x446a49(0x1a1)]?a46_0x41c3a5['green'](_0x446a49(0x1a1)):a46_0x41c3a5[_0x446a49(0xb4)](_0x446a49(0xe6)):a46_0x41c3a5[_0x446a49(0x211)](_0x446a49(0x108)),_0x5a8d7b=_0x2b9f5a['project']?.['id'],_0x1dc64f=_0x2b9f5a['sessionId'];let _0x3fd730;if(_0x5a8d7b&&_0x1dc64f){const _0x25aca5=getWorkflowAttemptUrl(_0x22168d,_0x5a8d7b,_0x1dc64f,_0x2b9f5a['id']);_0x3fd730=hyperlink(a46_0x41c3a5[_0x446a49(0x1c2)](_0x2b9f5a['id']),_0x25aca5);}else _0x3fd730=a46_0x41c3a5['dim'](_0x2b9f5a['id']);_0x67cd22[_0x446a49(0x17e)](_0x446a49(0x143)+_0x3fd730+_0x446a49(0x112)+_0x33e23e+'\x20-\x20'+formatElapsed(_0x21f556[_0x446a49(0x19b)]));if(_0x138a2c[_0x446a49(0xbe)]>0x0){const _0x322006=renderTimeAxis(_0x2a8d54,_0x416bae),_0x1e0fed=new Date(_0x21f556[_0x446a49(0xcf)]),_0x47db7e=formatDate(_0x1e0fed),_0x431b4e=TIMELINE_CONFIG[_0x446a49(0x168)]+TIMELINE_CONFIG['ICON_SPACING']+_0x8259b9,_0x2b9276=_0x47db7e['padStart'](_0x431b4e),_0x2e63d6=a46_0x41c3a5[_0x446a49(0x1c2)](_0x2b9276);_0x67cd22[_0x446a49(0x17e)](_0x2e63d6+'\x20'+_0x322006);for(const _0x1c5cad of _0x138a2c){_0x67cd22[_0x446a49(0x17e)](renderTaskRow(_0x1c5cad,_0x2a8d54,_0x416bae,_0x8259b9));}const _0xdc899a=calculateStats(_0x138a2c);_0x67cd22[_0x446a49(0x17e)](formatStats(_0xdc899a)),_0x14d12f&&_0x67cd22[_0x446a49(0x17e)](a46_0x41c3a5[_0x446a49(0x222)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x446a49(0x1b3)]+_0x446a49(0x13e)+_0x51fed1+_0x446a49(0x17a))),_0x67cd22[_0x446a49(0x17e)](''),_0x67cd22[_0x446a49(0x17e)](a46_0x41c3a5[_0x446a49(0x1c2)](_0x446a49(0x207))+(_0x446a49(0x228)+_0x2b9f5a['id']+_0x446a49(0x9f))+a46_0x41c3a5[_0x446a49(0x1c2)](_0x446a49(0x12f)));}else _0x67cd22[_0x446a49(0x17e)](_0x446a49(0x1a8));return _0x67cd22[_0x446a49(0x99)]('\x0a');}['buildTimelineData'](_0x1b9eb6,_0x34c994){const _0x35ed85=a46_0x350b3f,_0x486f2d=new Date(_0x1b9eb6[_0x35ed85(0xfa)])[_0x35ed85(0x10f)](),_0x2ef187=_0x1b9eb6[_0x35ed85(0x180)]?new Date(_0x1b9eb6[_0x35ed85(0x180)])[_0x35ed85(0x10f)]():Date[_0x35ed85(0x186)](),_0x39a81a=_0x2ef187-_0x486f2d,_0x270f44=[];for(const _0x30795f of _0x34c994){if(_0x30795f[_0x35ed85(0x1a3)]){const _0x187da9=new Date(_0x30795f['startedAt'])[_0x35ed85(0x10f)](),_0x2adcfa=_0x30795f[_0x35ed85(0x21b)]?new Date(_0x30795f[_0x35ed85(0x21b)])[_0x35ed85(0x10f)]():Date[_0x35ed85(0x186)]();_0x270f44['push']({'name':_0x30795f[_0x35ed85(0x126)],'state':_0x30795f[_0x35ed85(0x191)]||_0x35ed85(0x232),'window':{'start':_0x187da9,'end':_0x2adcfa,'duration':_0x2adcfa-_0x187da9}});}else _0x270f44['push']({'name':_0x30795f[_0x35ed85(0x126)],'state':_0x30795f['state']||_0x35ed85(0x22d),'window':undefined});}const _0x50cefc=calculateStats(_0x270f44);return{'attempt':{'id':_0x1b9eb6['id'],'status':_0x1b9eb6[_0x35ed85(0x13a)]?_0x1b9eb6[_0x35ed85(0x1a1)]?_0x35ed85(0x1a1):_0x35ed85(0xe6):'running','createdAt':_0x1b9eb6[_0x35ed85(0xfa)],'finishedAt':_0x1b9eb6[_0x35ed85(0x180)],'duration_ms':_0x39a81a},'tasks':_0x270f44[_0x35ed85(0x123)](_0x57e412=>({'name':_0x57e412[_0x35ed85(0xea)],'state':_0x57e412['state'],'startedAt':_0x57e412[_0x35ed85(0x1d5)]?new Date(_0x57e412[_0x35ed85(0x1d5)][_0x35ed85(0xcf)])[_0x35ed85(0x8f)]():null,'updatedAt':_0x57e412[_0x35ed85(0x1d5)]?new Date(_0x57e412[_0x35ed85(0x1d5)][_0x35ed85(0xf9)])[_0x35ed85(0x8f)]():null,'duration_ms':_0x57e412[_0x35ed85(0x1d5)]?.[_0x35ed85(0x19b)]||null})),'stats':_0x50cefc};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x424ea5,_0x519599){const _0xa5bf93=a47_0x586f,_0x3675d7=_0x424ea5();while(!![]){try{const _0x33b6cf=-parseInt(_0xa5bf93(0x1bc))/0x1+parseInt(_0xa5bf93(0x1c2))/0x2+parseInt(_0xa5bf93(0x1b6))/0x3+parseInt(_0xa5bf93(0x1ba))/0x4+parseInt(_0xa5bf93(0x1c0))/0x5*(-parseInt(_0xa5bf93(0x1b9))/0x6)+-parseInt(_0xa5bf93(0x1c1))/0x7*(parseInt(_0xa5bf93(0x1c3))/0x8)+parseInt(_0xa5bf93(0x1b5))/0x9*(parseInt(_0xa5bf93(0x1bb))/0xa);if(_0x33b6cf===_0x519599)break;else _0x3675d7['push'](_0x3675d7['shift']());}catch(_0x1e2831){_0x3675d7['push'](_0x3675d7['shift']());}}}(a47_0x25f4,0x5cd37));import{platform}from'os';import{getAPIKey}from'./config.js';function a47_0x25f4(){const _0x333394=['7MktvEb','345584sRQJeN','4265232TtWvga','replace','version','9xuQIwZ','146934iAQLoV','length','Authorization','594DQUrOH','2230108sysduZ','13134120YZRWWr','653848qbPMRe','TD1\x20','X-Trino-User',';\x20node/','26540zinarU'];a47_0x25f4=function(){return _0x333394;};return a47_0x25f4();}import{getVersion}from'./version.js';function a47_0x586f(_0x490ce1,_0x45ffe5){_0x490ce1=_0x490ce1-0x1b5;const _0x25f492=a47_0x25f4();let _0x586f51=_0x25f492[_0x490ce1];return _0x586f51;}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x39ed53=a47_0x586f,_0x567768=getVersion(),_0x6d8b26=platform(),_0x2ba524=process[_0x39ed53(0x1c5)][_0x39ed53(0x1c4)]('v','');return'tdx/'+_0x567768+'\x20('+_0x6d8b26+_0x39ed53(0x1bf)+_0x2ba524+')';}export function getAuthHeaders(_0x26a40e,_0x4755a7){const _0x1cab8e=a47_0x586f,_0x3ec9dc=getVersion(),_0x5cc67e={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x3ec9dc};return _0x4755a7&&(_0x5cc67e[_0x1cab8e(0x1b8)]=_0x1cab8e(0x1bd)+_0x4755a7),_0x5cc67e;}export function toHeaderRecord(_0x52f249){const _0x18a1ef={};for(const [_0x4bb0c0,_0x3d0612]of Object['entries'](_0x52f249)){_0x3d0612!==undefined&&(_0x18a1ef[_0x4bb0c0]=_0x3d0612);}return _0x18a1ef;}export function getTrinoHeaders(_0x4fbb1e,_0x42ef0f){const _0x363788=a47_0x586f,_0x3dccd7=getAuthHeaders(_0x4fbb1e,_0x42ef0f),_0x233e24=toHeaderRecord(_0x3dccd7);return delete _0x233e24[_0x363788(0x1b8)],_0x42ef0f&&(_0x233e24[_0x363788(0x1be)]=_0x42ef0f),_0x233e24;}export function hasAPIKey(_0x22027d){const _0x2a9ce5=a47_0x586f,_0x587a98=getAPIKey();return _0x587a98!==undefined&&_0x587a98[_0x2a9ce5(0x1b7)]>0x0;}
1
+ (function(_0x4eb2ab,_0x5d78c5){const _0x27635e=a47_0x51ac,_0x55e926=_0x4eb2ab();while(!![]){try{const _0x2eee4e=parseInt(_0x27635e(0x12f))/0x1+-parseInt(_0x27635e(0x13e))/0x2*(parseInt(_0x27635e(0x13c))/0x3)+-parseInt(_0x27635e(0x139))/0x4*(parseInt(_0x27635e(0x12e))/0x5)+parseInt(_0x27635e(0x134))/0x6*(-parseInt(_0x27635e(0x13f))/0x7)+parseInt(_0x27635e(0x13b))/0x8+-parseInt(_0x27635e(0x135))/0x9+parseInt(_0x27635e(0x131))/0xa;if(_0x2eee4e===_0x5d78c5)break;else _0x55e926['push'](_0x55e926['shift']());}catch(_0x4c9dbe){_0x55e926['push'](_0x55e926['shift']());}}}(a47_0x12b5,0x4e6aa));function a47_0x51ac(_0x1fa445,_0x2dc7f9){_0x1fa445=_0x1fa445-0x12e;const _0x12b549=a47_0x12b5();let _0x51ac59=_0x12b549[_0x1fa445];return _0x51ac59;}import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';function a47_0x12b5(){const _0x560dc5=['547172dDyzaQ','X-Trino-User','4738736HrdAFo','3774dYIvaC','Authorization','292mwWPBq','1921724hHuffC','20pzUscs','614878eUYZAv','tdx','6810380yQzQkL','entries','version','12OGKHem','2584440rGikPO','tdx/','replace','length'];a47_0x12b5=function(){return _0x560dc5;};return a47_0x12b5();}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x2f1f38=a47_0x51ac,_0x2a9e91=getVersion(),_0x4459e9=platform(),_0xb31621=process[_0x2f1f38(0x133)][_0x2f1f38(0x137)]('v','');return _0x2f1f38(0x136)+_0x2a9e91+'\x20('+_0x4459e9+';\x20node/'+_0xb31621+')';}export function getAuthHeaders(_0x309474,_0x1014c0){const _0x158541=a47_0x51ac,_0xf7e852=getVersion(),_0x58a6de={'User-Agent':getUserAgent(),'X-TD-Client':_0x158541(0x130),'X-TD-Client-Version':_0xf7e852};return _0x1014c0&&(_0x58a6de[_0x158541(0x13d)]='TD1\x20'+_0x1014c0),_0x58a6de;}export function toHeaderRecord(_0x18f8a2){const _0x258b22=a47_0x51ac,_0x4d03cb={};for(const [_0x458dd8,_0x2559bf]of Object[_0x258b22(0x132)](_0x18f8a2)){_0x2559bf!==undefined&&(_0x4d03cb[_0x458dd8]=_0x2559bf);}return _0x4d03cb;}export function getTrinoHeaders(_0x4abb8c,_0xb739f1){const _0x423dd8=a47_0x51ac,_0x257dc4=getAuthHeaders(_0x4abb8c,_0xb739f1),_0x5e9ba3=toHeaderRecord(_0x257dc4);return delete _0x5e9ba3[_0x423dd8(0x13d)],_0xb739f1&&(_0x5e9ba3[_0x423dd8(0x13a)]=_0xb739f1),_0x5e9ba3;}export function hasAPIKey(_0x5b965c){const _0x122403=a47_0x51ac,_0x42d580=getAPIKey();return _0x42d580!==undefined&&_0x42d580[_0x122403(0x138)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x5d9691,_0x3dfbb6){const _0x50a2f0=a48_0x3619,_0x473bb1=_0x5d9691();while(!![]){try{const _0x3b0b04=-parseInt(_0x50a2f0(0x1fa))/0x1*(parseInt(_0x50a2f0(0x217))/0x2)+parseInt(_0x50a2f0(0x203))/0x3+parseInt(_0x50a2f0(0x1f9))/0x4+-parseInt(_0x50a2f0(0x1ff))/0x5+-parseInt(_0x50a2f0(0x1f7))/0x6*(parseInt(_0x50a2f0(0x1e7))/0x7)+-parseInt(_0x50a2f0(0x1f0))/0x8+-parseInt(_0x50a2f0(0x228))/0x9*(-parseInt(_0x50a2f0(0x225))/0xa);if(_0x3b0b04===_0x3dfbb6)break;else _0x473bb1['push'](_0x473bb1['shift']());}catch(_0x4bafe8){_0x473bb1['push'](_0x473bb1['shift']());}}}(a48_0x545c,0x80060));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';function a48_0x3619(_0x449206,_0x40f1fb){_0x449206=_0x449206-0x1e6;const _0x545c5a=a48_0x545c();let _0x361995=_0x545c5a[_0x449206];return _0x361995;}import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a48_0x530eb2 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x1cc330){const _0x3faccc=a48_0x3619;return _0x1cc330[_0x3faccc(0x206)]===_0x3faccc(0x20f)||_0x1cc330[_0x3faccc(0x206)]==='jsonl'||_0x1cc330['format']===_0x3faccc(0x210)||_0x1cc330[_0x3faccc(0x206)]===_0x3faccc(0x209)||_0x1cc330['json']===!![]||_0x1cc330[_0x3faccc(0x21f)]===!![]||_0x1cc330['tsv']===!![]||_0x1cc330[_0x3faccc(0x209)]===!![];}export function parseOutputOptions(_0x47df49){const _0x13d141=a48_0x3619;return{'format':_0x47df49['format']||_0x13d141(0x209),'output':_0x47df49[_0x13d141(0x21d)]||'','limit':_0x47df49[_0x13d141(0x226)],'color':_0x47df49[_0x13d141(0x208)],'noColor':_0x47df49['noColor']};}function convertSDKResultToQueryResult(_0x421979){const _0x158bae=a48_0x3619,_0x26b754=[];if(_0x421979[_0x158bae(0x229)]>0x0){const _0x44d395=_0x421979[0x0];for(const [_0x6b0cdd,_0x128136]of Object[_0x158bae(0x205)](_0x44d395)){let _0x41a8bb='varchar';if(typeof _0x128136===_0x158bae(0x1fc))_0x41a8bb=Number['isInteger'](_0x128136)?'bigint':_0x158bae(0x20d);else{if(typeof _0x128136===_0x158bae(0x218))_0x41a8bb='boolean';else _0x128136===null&&(_0x41a8bb=_0x158bae(0x20b));}_0x26b754['push']({'name':_0x6b0cdd,'type':_0x41a8bb});}}return{'queryId':_0x158bae(0x219),'columns':_0x26b754,'data':_0x421979,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x421979['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x411f6c,_0x3cf290){const _0x13545a=convertSDKResultToQueryResult(_0x411f6c);return formatQueryOutput(_0x13545a,_0x3cf290);}export async function formatQueryOutput(_0x1bb8ba,_0xc0e5a2){const _0x256b52=a48_0x3619,{format:_0x33eec8,limit:_0x53c65c,output:_0x80c100,color:_0x3e4506,noColor:_0x3e81cf}=_0xc0e5a2,_0x16d5d6=Boolean(_0x80c100)&&!_0x3e4506,_0x12d80f={'color':_0x3e4506,'noColor':_0x3e81cf||_0x16d5d6};if(_0x33eec8==='table'){const _0x297c3f=shouldUseLess(_0x33eec8,_0x80c100);return formatAsTable(_0x1bb8ba,_0x53c65c,_0x297c3f,_0x12d80f);}else{if(_0x33eec8===_0x256b52(0x20f))return formatAsJSON(_0x1bb8ba,_0x12d80f);else return _0x33eec8===_0x256b52(0x21f)?formatAsJSONL(_0x1bb8ba,_0x12d80f):formatQueryResult(_0x1bb8ba,_0x33eec8);}}function shouldUseLess(_0x38ef59,_0xd24ad2){const _0x161b05=a48_0x3619;return(_0x38ef59===_0x161b05(0x209)||_0x38ef59===_0x161b05(0x224))&&process[_0x161b05(0x202)][_0x161b05(0x222)]&&!_0xd24ad2;}export function resolveOutputOptions(_0x159a60){const _0x2264f4=a48_0x3619,_0x138ac1=resolveOutputFormat(_0x159a60['format'],_0x159a60[_0x2264f4(0x21d)],_0x2264f4(0x209));let _0x5da469=typeof _0x159a60[_0x2264f4(0x226)]==='number'?_0x159a60[_0x2264f4(0x226)]:parseInt(_0x159a60[_0x2264f4(0x226)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x3157f2=_0x159a60[_0x2264f4(0x21d)]||'';return shouldUseLess(_0x138ac1,_0x3157f2)&&(_0x5da469=Infinity),{'format':_0x138ac1,'output':_0x3157f2,'limit':_0x5da469,'color':_0x159a60[_0x2264f4(0x208)],'noColor':_0x159a60[_0x2264f4(0x1ed)]};}function a48_0x545c(){const _0x716c5b=['push','isTTY','cmdout','list','3277190PoZnjD','limit','debug','36HAIvgs','length','rule','less','273xQrvgD','log','yellow','padEnd','stdin','keys','noColor','[Object]','bold','4650024zkEDTd','Results\x20saved\x20to\x20','filter','blue','end','stringify','spawn','63102jkKydx','[params]','1611640ULPigk','427678ktQvaX','No\x20data','number','pipe','─┴─','921015hSZmMG','join','[error]','stdout','1241685FKWGpc','trim','entries','format','split','color','table','inherit','varchar','max','double','red','json','tsv','resolve','object','stderr','close','forEach','repeat','2eTONTW','boolean','sdk-result','error','[query]','write','output','magenta','jsonl','map'];a48_0x545c=function(){return _0x716c5b;};return a48_0x545c();}export function writeOutput(_0x3dd3a4,_0x555d42,_0x44b73a){const _0xfa75d6=a48_0x3619;return _0x555d42?(writeFileSync(_0x555d42,_0x3dd3a4),console['error'](_0xfa75d6(0x1f1)+_0x555d42),Promise[_0xfa75d6(0x211)]()):shouldUseLess(_0x44b73a||'','')?new Promise(_0x384393=>{const _0x3920c2=_0xfa75d6,_0x3ee8f4=spawn(_0x3920c2(0x1e6),['-FXRSn'],{'stdio':[_0x3920c2(0x1fd),_0x3920c2(0x20a),'inherit']});let _0x1fc492=![];_0x3ee8f4['on']('error',()=>{!_0x1fc492&&(_0x1fc492=!![],console['log'](_0x3dd3a4),_0x384393());}),_0x3ee8f4['on'](_0x3920c2(0x214),()=>{!_0x1fc492&&(_0x1fc492=!![],_0x384393());}),_0x3ee8f4['on'](_0x3920c2(0x1f6),()=>{const _0x5ebb5b=_0x3920c2;!_0x1fc492&&_0x3ee8f4[_0x5ebb5b(0x1eb)]&&(_0x3ee8f4['stdin']['on'](_0x5ebb5b(0x21a),()=>{}),_0x3ee8f4[_0x5ebb5b(0x1eb)][_0x5ebb5b(0x21c)](_0x3dd3a4),_0x3ee8f4[_0x5ebb5b(0x1eb)][_0x5ebb5b(0x1f4)]());}),!_0x3ee8f4['stdin']&&(!_0x1fc492&&(_0x1fc492=!![],console[_0x3920c2(0x1e8)](_0x3dd3a4),_0x384393()));}):(console[_0xfa75d6(0x1e8)](_0x3dd3a4),Promise[_0xfa75d6(0x211)]());}export async function handleSDKOutput(_0x22f0ac,_0x5df2c2){const _0x3b8cd6=a48_0x3619,_0x3dc570=resolveOutputOptions(_0x5df2c2),_0x565aa4=await formatSDKOutput(_0x22f0ac,_0x3dc570);await writeOutput(_0x565aa4,_0x3dc570[_0x3b8cd6(0x21d)]||undefined,_0x3dc570['format']);}export async function handleQueryOutput(_0x479b95,_0x3cbc59){const _0x21c32f=a48_0x3619,_0x19cf32=resolveOutputOptions(_0x3cbc59),_0x133b55=await formatQueryOutput(_0x479b95,_0x19cf32);await writeOutput(_0x133b55,_0x19cf32[_0x21c32f(0x21d)]||undefined,_0x19cf32[_0x21c32f(0x206)]);}async function formatSingleObject(_0xeaad34,_0x56b197){const _0x4b26e1=a48_0x3619,{format:_0x5eefd9,color:_0x1b077e,noColor:_0x5eead2}=_0x56b197,_0x1b7766={'color':_0x1b077e,'noColor':_0x5eead2};if(_0x5eefd9===_0x4b26e1(0x20f)){if(shouldUseColor(_0x1b7766))return colorizeJSON(_0xeaad34,_0x1b7766);return JSON['stringify'](_0xeaad34,null,0x2);}else{if(_0x5eefd9===_0x4b26e1(0x21f)){if(shouldUseColor(_0x1b7766))return colorizeJSONCompact(_0xeaad34,_0x1b7766);return JSON[_0x4b26e1(0x1f5)](_0xeaad34);}else{if(_0x5eefd9===_0x4b26e1(0x210))return Object[_0x4b26e1(0x205)](_0xeaad34)[_0x4b26e1(0x220)](([_0x35bd30,_0x49aa2e])=>_0x35bd30+'\x09'+_0x49aa2e)[_0x4b26e1(0x200)]('\x0a');else{const _0x44eb46=Object[_0x4b26e1(0x205)](_0xeaad34);if(_0x44eb46[_0x4b26e1(0x229)]===0x0)return _0x4b26e1(0x1fb);const _0x310f87=_0xeaad34['debug'],_0x38dc67=_0xeaad34['query'],_0x12f103=_0xeaad34['params'],_0x385709=_0xeaad34['rule'],_0x51b6e8=_0x38dc67?typeof _0x38dc67==='string'?_0x38dc67:JSON[_0x4b26e1(0x1f5)](_0x38dc67,null,0x2):undefined,_0x405aee=_0x12f103&&Object[_0x4b26e1(0x1ec)](_0x12f103)[_0x4b26e1(0x229)]>0x0?JSON[_0x4b26e1(0x1f5)](_0x12f103,null,0x2):undefined,_0xc45e33=_0x385709&&Object[_0x4b26e1(0x1ec)](_0x385709)['length']>0x0?JSON[_0x4b26e1(0x1f5)](_0x385709,null,0x2):undefined,_0x2ef7ab=_0x44eb46[_0x4b26e1(0x1f2)](([_0xb00059])=>_0xb00059!==_0x4b26e1(0x227)&&_0xb00059!=='query'&&_0xb00059!=='params'&&_0xb00059!==_0x4b26e1(0x22a)),_0x11b557=Math[_0x4b26e1(0x20c)](..._0x2ef7ab['map'](([_0x5ed54b])=>_0x5ed54b[_0x4b26e1(0x229)])),_0x2fb5c1=Math['max'](..._0x2ef7ab[_0x4b26e1(0x220)](([,_0x4a2329])=>{const _0x17cfe1=_0x4b26e1;try{const _0x13e058=_0x4a2329===null||_0x4a2329===undefined?'':typeof _0x4a2329==='object'?JSON[_0x17cfe1(0x1f5)](_0x4a2329):String(_0x4a2329),_0x43144a=_0x13e058[_0x17cfe1(0x207)]('\x0a');return Math[_0x17cfe1(0x20c)](..._0x43144a[_0x17cfe1(0x220)](_0x74501c=>_0x74501c[_0x17cfe1(0x229)]),0x0);}catch{return 0x0;}}),0x14),_0xdc505c=[];_0xdc505c['push'](colorBorder('┌─'+'─'[_0x4b26e1(0x216)](_0x11b557)+'─┬─'+'─'[_0x4b26e1(0x216)](_0x2fb5c1)+'─┐',_0x1b7766)),_0x2ef7ab[_0x4b26e1(0x215)](([_0x8e29ce,_0x6371e4])=>{const _0x311ab0=_0x4b26e1;let _0x67b9c6;try{_0x67b9c6=_0x6371e4===null||_0x6371e4===undefined?'':typeof _0x6371e4===_0x311ab0(0x212)?JSON[_0x311ab0(0x1f5)](_0x6371e4):String(_0x6371e4);}catch{_0x67b9c6=_0x311ab0(0x1ee);}const _0x1bdf23=_0x8e29ce[_0x311ab0(0x1ea)](_0x11b557),_0x5b704f=_0x67b9c6['split']('\x0a');_0x5b704f[_0x311ab0(0x215)]((_0xc71323,_0x5e33c1)=>{const _0x3a597f=_0x311ab0,_0x72cffc=colorBorder('│',_0x1b7766);_0x5e33c1===0x0?_0xdc505c[_0x3a597f(0x221)](_0x72cffc+'\x20'+_0x1bdf23+'\x20'+_0x72cffc+'\x20'+_0xc71323[_0x3a597f(0x1ea)](_0x2fb5c1)+'\x20'+_0x72cffc):_0xdc505c['push'](_0x72cffc+'\x20'+'\x20'[_0x3a597f(0x216)](_0x11b557)+'\x20'+_0x72cffc+'\x20'+_0xc71323[_0x3a597f(0x1ea)](_0x2fb5c1)+'\x20'+_0x72cffc);});}),_0xdc505c[_0x4b26e1(0x221)](colorBorder('└─'+'─'[_0x4b26e1(0x216)](_0x11b557)+_0x4b26e1(0x1fe)+'─'[_0x4b26e1(0x216)](_0x2fb5c1)+'─┘',_0x1b7766));_0x51b6e8&&(_0xdc505c['push'](''),_0xdc505c['push'](String(a48_0x530eb2[_0x4b26e1(0x1e9)][_0x4b26e1(0x1ef)](_0x4b26e1(0x21b)))),_0xdc505c[_0x4b26e1(0x221)](_0x51b6e8));_0x405aee&&(_0xdc505c[_0x4b26e1(0x221)](''),_0xdc505c[_0x4b26e1(0x221)](String(a48_0x530eb2[_0x4b26e1(0x1f3)][_0x4b26e1(0x1ef)](_0x4b26e1(0x1f8)))),_0xdc505c[_0x4b26e1(0x221)](_0x405aee));_0xc45e33&&(_0xdc505c[_0x4b26e1(0x221)](''),_0xdc505c[_0x4b26e1(0x221)](String(a48_0x530eb2[_0x4b26e1(0x21e)]['bold']('[rule]'))),_0xdc505c[_0x4b26e1(0x221)](_0xc45e33));if(_0x310f87){if(_0x310f87['stderr']){_0xdc505c['push'](''),_0xdc505c[_0x4b26e1(0x221)](String(a48_0x530eb2[_0x4b26e1(0x20e)][_0x4b26e1(0x1ef)](_0x4b26e1(0x201))));const _0x2f9768=_0x310f87[_0x4b26e1(0x213)][_0x4b26e1(0x207)]('\x0a');_0x2f9768['forEach'](_0x1d0c78=>{const _0x470a3a=_0x4b26e1;_0x1d0c78[_0x470a3a(0x204)]()&&_0xdc505c[_0x470a3a(0x221)](_0x1d0c78);});}if(_0x310f87[_0x4b26e1(0x223)]){_0xdc505c['push'](''),_0xdc505c['push'](String(a48_0x530eb2['cyan']['bold']('[logs]')));const _0x3a96e2=_0x310f87[_0x4b26e1(0x223)][_0x4b26e1(0x207)]('\x0a');_0x3a96e2[_0x4b26e1(0x215)](_0x70239b=>{const _0x429099=_0x4b26e1;_0x70239b[_0x429099(0x204)]()&&_0xdc505c['push'](_0x70239b);});}}return _0xdc505c[_0x4b26e1(0x200)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x1dc3a7,_0x3f3b9e){const _0xb40dc2=a48_0x3619;if(_0x3f3b9e['format']==='table'){await handleSDKOutput([_0x1dc3a7],_0x3f3b9e);return;}const _0xe5b0a7=resolveOutputOptions(_0x3f3b9e),_0x5a7eb1=await formatSingleObject(_0x1dc3a7,_0xe5b0a7);await writeOutput(_0x5a7eb1,_0xe5b0a7[_0xb40dc2(0x21d)]||undefined,_0xe5b0a7[_0xb40dc2(0x206)]);}
1
+ (function(_0x4fa05a,_0x31210f){const _0x5bb9b3=a48_0x532e,_0x2c1a3c=_0x4fa05a();while(!![]){try{const _0x2ce56c=-parseInt(_0x5bb9b3(0x1c0))/0x1+-parseInt(_0x5bb9b3(0x1d7))/0x2*(parseInt(_0x5bb9b3(0x1db))/0x3)+-parseInt(_0x5bb9b3(0x1d1))/0x4+parseInt(_0x5bb9b3(0x1d0))/0x5*(-parseInt(_0x5bb9b3(0x1e1))/0x6)+-parseInt(_0x5bb9b3(0x1e2))/0x7*(parseInt(_0x5bb9b3(0x1cc))/0x8)+parseInt(_0x5bb9b3(0x1b2))/0x9*(parseInt(_0x5bb9b3(0x1a6))/0xa)+parseInt(_0x5bb9b3(0x1c5))/0xb;if(_0x2ce56c===_0x31210f)break;else _0x2c1a3c['push'](_0x2c1a3c['shift']());}catch(_0x5de1c7){_0x2c1a3c['push'](_0x2c1a3c['shift']());}}}(a48_0x1165,0xeb909));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 a48_0x52a5df from'chalk';function a48_0x1165(){const _0x298c60=['3890AasbKP','table','spawn','color','─┴─','stringify','limit','string','cmdout','varchar','isTTY','debug','17937XBhhHh','close','entries','error','trim','[Object]','log','inherit','max','length','[query]','[params]','red','[logs]','1398733itRQLo','boolean','format','noColor','list','67750353bMwFhj','bold','sdk-result','stderr','filter','object','rule','56HRdGet','stdout','pipe','double','15GldPrd','5429024CaASGK','output','push','query','params','stdin','3074654xbzGMA','number','bigint','json','3ktQCDA','-FXRSn','keys','Results\x20saved\x20to\x20','yellow','padEnd','836202ahsCBK','1258110NWizOt','tsv','jsonl','FINISHED','resolve','repeat','map','─┬─','forEach','split','[error]','join'];a48_0x1165=function(){return _0x298c60;};return a48_0x1165();}import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x43023c){const _0x523437=a48_0x532e;return _0x43023c[_0x523437(0x1c2)]===_0x523437(0x1da)||_0x43023c['format']===_0x523437(0x1e4)||_0x43023c['format']===_0x523437(0x1e3)||_0x43023c[_0x523437(0x1c2)]==='table'||_0x43023c[_0x523437(0x1da)]===!![]||_0x43023c['jsonl']===!![]||_0x43023c['tsv']===!![]||_0x43023c[_0x523437(0x1a7)]===!![];}export function parseOutputOptions(_0xa16147){const _0x12ed74=a48_0x532e;return{'format':_0xa16147[_0x12ed74(0x1c2)]||_0x12ed74(0x1a7),'output':_0xa16147[_0x12ed74(0x1d2)]||'','limit':_0xa16147[_0x12ed74(0x1ac)],'color':_0xa16147[_0x12ed74(0x1a9)],'noColor':_0xa16147[_0x12ed74(0x1c3)]};}function convertSDKResultToQueryResult(_0x34ab16){const _0x3521cb=a48_0x532e,_0x41304c=[];if(_0x34ab16[_0x3521cb(0x1bb)]>0x0){const _0x3a7316=_0x34ab16[0x0];for(const [_0x552056,_0x1dbb56]of Object[_0x3521cb(0x1b4)](_0x3a7316)){let _0x1572d2=_0x3521cb(0x1af);if(typeof _0x1dbb56===_0x3521cb(0x1d8))_0x1572d2=Number['isInteger'](_0x1dbb56)?_0x3521cb(0x1d9):_0x3521cb(0x1cf);else{if(typeof _0x1dbb56===_0x3521cb(0x1c1))_0x1572d2=_0x3521cb(0x1c1);else _0x1dbb56===null&&(_0x1572d2='varchar');}_0x41304c['push']({'name':_0x552056,'type':_0x1572d2});}}return{'queryId':_0x3521cb(0x1c7),'columns':_0x41304c,'data':_0x34ab16,'stats':{'state':_0x3521cb(0x1e5),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x34ab16['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x3f327e,_0x4042d1){const _0x4aba83=convertSDKResultToQueryResult(_0x3f327e);return formatQueryOutput(_0x4aba83,_0x4042d1);}export async function formatQueryOutput(_0x5bb614,_0x2e9a1a){const _0x3c59ca=a48_0x532e,{format:_0x2b939f,limit:_0x2e7c11,output:_0x4d1b7b,color:_0x34a2f9,noColor:_0x1305bf}=_0x2e9a1a,_0xf5f41e=Boolean(_0x4d1b7b)&&!_0x34a2f9,_0x4adda4={'color':_0x34a2f9,'noColor':_0x1305bf||_0xf5f41e};if(_0x2b939f===_0x3c59ca(0x1a7)){const _0x5b0375=shouldUseLess(_0x2b939f,_0x4d1b7b);return formatAsTable(_0x5bb614,_0x2e7c11,_0x5b0375,_0x4adda4);}else{if(_0x2b939f===_0x3c59ca(0x1da))return formatAsJSON(_0x5bb614,_0x4adda4);else return _0x2b939f==='jsonl'?formatAsJSONL(_0x5bb614,_0x4adda4):formatQueryResult(_0x5bb614,_0x2b939f);}}function a48_0x532e(_0x551dd8,_0x190c7b){_0x551dd8=_0x551dd8-0x1a1;const _0x11654c=a48_0x1165();let _0x532e67=_0x11654c[_0x551dd8];return _0x532e67;}function shouldUseLess(_0x4e3e96,_0x277bc9){const _0x309225=a48_0x532e;return(_0x4e3e96==='table'||_0x4e3e96===_0x309225(0x1c4))&&process[_0x309225(0x1cd)][_0x309225(0x1b0)]&&!_0x277bc9;}export function resolveOutputOptions(_0x573b3e){const _0x1a461c=a48_0x532e,_0x54c14e=resolveOutputFormat(_0x573b3e['format'],_0x573b3e[_0x1a461c(0x1d2)],_0x1a461c(0x1a7));let _0x589f23=typeof _0x573b3e[_0x1a461c(0x1ac)]===_0x1a461c(0x1d8)?_0x573b3e[_0x1a461c(0x1ac)]:parseInt(_0x573b3e[_0x1a461c(0x1ac)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x179d5a=_0x573b3e[_0x1a461c(0x1d2)]||'';return shouldUseLess(_0x54c14e,_0x179d5a)&&(_0x589f23=Infinity),{'format':_0x54c14e,'output':_0x179d5a,'limit':_0x589f23,'color':_0x573b3e[_0x1a461c(0x1a9)],'noColor':_0x573b3e[_0x1a461c(0x1c3)]};}export function writeOutput(_0x2d906e,_0x307a2e,_0x36b242){const _0x50caf2=a48_0x532e;return _0x307a2e?(writeFileSync(_0x307a2e,_0x2d906e),console[_0x50caf2(0x1b5)](_0x50caf2(0x1de)+_0x307a2e),Promise['resolve']()):shouldUseLess(_0x36b242||'','')?new Promise(_0x393e38=>{const _0xa8fb97=_0x50caf2,_0x4fc946=spawn('less',[_0xa8fb97(0x1dc)],{'stdio':[_0xa8fb97(0x1ce),'inherit',_0xa8fb97(0x1b9)]});let _0x2a47df=![];_0x4fc946['on']('error',()=>{const _0x152fe8=_0xa8fb97;!_0x2a47df&&(_0x2a47df=!![],console[_0x152fe8(0x1b8)](_0x2d906e),_0x393e38());}),_0x4fc946['on'](_0xa8fb97(0x1b3),()=>{!_0x2a47df&&(_0x2a47df=!![],_0x393e38());}),_0x4fc946['on'](_0xa8fb97(0x1a8),()=>{const _0x383502=_0xa8fb97;!_0x2a47df&&_0x4fc946['stdin']&&(_0x4fc946[_0x383502(0x1d6)]['on']('error',()=>{}),_0x4fc946[_0x383502(0x1d6)]['write'](_0x2d906e),_0x4fc946[_0x383502(0x1d6)]['end']());}),!_0x4fc946[_0xa8fb97(0x1d6)]&&(!_0x2a47df&&(_0x2a47df=!![],console[_0xa8fb97(0x1b8)](_0x2d906e),_0x393e38()));}):(console['log'](_0x2d906e),Promise[_0x50caf2(0x1e6)]());}export async function handleSDKOutput(_0x225886,_0x385aa0){const _0x429da6=a48_0x532e,_0x102f6a=resolveOutputOptions(_0x385aa0),_0x4a3a61=await formatSDKOutput(_0x225886,_0x102f6a);await writeOutput(_0x4a3a61,_0x102f6a['output']||undefined,_0x102f6a[_0x429da6(0x1c2)]);}export async function handleQueryOutput(_0x34efe4,_0x43c026){const _0x2218aa=a48_0x532e,_0x5a7319=resolveOutputOptions(_0x43c026),_0x2be868=await formatQueryOutput(_0x34efe4,_0x5a7319);await writeOutput(_0x2be868,_0x5a7319[_0x2218aa(0x1d2)]||undefined,_0x5a7319[_0x2218aa(0x1c2)]);}async function formatSingleObject(_0x41142c,_0x538e36){const _0x23180f=a48_0x532e,{format:_0x4bfa53,color:_0x55e129,noColor:_0x1459e3}=_0x538e36,_0x4f1fc4={'color':_0x55e129,'noColor':_0x1459e3};if(_0x4bfa53===_0x23180f(0x1da)){if(shouldUseColor(_0x4f1fc4))return colorizeJSON(_0x41142c,_0x4f1fc4);return JSON['stringify'](_0x41142c,null,0x2);}else{if(_0x4bfa53===_0x23180f(0x1e4)){if(shouldUseColor(_0x4f1fc4))return colorizeJSONCompact(_0x41142c,_0x4f1fc4);return JSON['stringify'](_0x41142c);}else{if(_0x4bfa53===_0x23180f(0x1e3))return Object[_0x23180f(0x1b4)](_0x41142c)[_0x23180f(0x1e8)](([_0x225002,_0x2cdbc9])=>_0x225002+'\x09'+_0x2cdbc9)[_0x23180f(0x1a5)]('\x0a');else{const _0x2d6357=Object['entries'](_0x41142c);if(_0x2d6357[_0x23180f(0x1bb)]===0x0)return'No\x20data';const _0x181fd7=_0x41142c[_0x23180f(0x1b1)],_0xc1e61f=_0x41142c[_0x23180f(0x1d4)],_0x3d9496=_0x41142c[_0x23180f(0x1d5)],_0x4b5d34=_0x41142c[_0x23180f(0x1cb)],_0x558041=_0xc1e61f?typeof _0xc1e61f===_0x23180f(0x1ad)?_0xc1e61f:JSON['stringify'](_0xc1e61f,null,0x2):undefined,_0x23cdcf=_0x3d9496&&Object['keys'](_0x3d9496)[_0x23180f(0x1bb)]>0x0?JSON[_0x23180f(0x1ab)](_0x3d9496,null,0x2):undefined,_0x3342fd=_0x4b5d34&&Object[_0x23180f(0x1dd)](_0x4b5d34)['length']>0x0?JSON[_0x23180f(0x1ab)](_0x4b5d34,null,0x2):undefined,_0xa8037c=_0x2d6357[_0x23180f(0x1c9)](([_0x15c95d])=>_0x15c95d!==_0x23180f(0x1b1)&&_0x15c95d!==_0x23180f(0x1d4)&&_0x15c95d!=='params'&&_0x15c95d!==_0x23180f(0x1cb)),_0x2230ee=Math[_0x23180f(0x1ba)](..._0xa8037c['map'](([_0xf11fb])=>_0xf11fb[_0x23180f(0x1bb)])),_0x2ea220=Math[_0x23180f(0x1ba)](..._0xa8037c['map'](([,_0x50dcee])=>{const _0x360706=_0x23180f;try{const _0x56ae6c=_0x50dcee===null||_0x50dcee===undefined?'':typeof _0x50dcee===_0x360706(0x1ca)?JSON[_0x360706(0x1ab)](_0x50dcee):String(_0x50dcee),_0x4e76a2=_0x56ae6c[_0x360706(0x1a3)]('\x0a');return Math[_0x360706(0x1ba)](..._0x4e76a2[_0x360706(0x1e8)](_0x26e96a=>_0x26e96a[_0x360706(0x1bb)]),0x0);}catch{return 0x0;}}),0x14),_0x4970ed=[];_0x4970ed[_0x23180f(0x1d3)](colorBorder('┌─'+'─'[_0x23180f(0x1e7)](_0x2230ee)+_0x23180f(0x1a1)+'─'[_0x23180f(0x1e7)](_0x2ea220)+'─┐',_0x4f1fc4)),_0xa8037c[_0x23180f(0x1a2)](([_0x4d9a04,_0x250d91])=>{const _0x5d9244=_0x23180f;let _0x305ea7;try{_0x305ea7=_0x250d91===null||_0x250d91===undefined?'':typeof _0x250d91===_0x5d9244(0x1ca)?JSON[_0x5d9244(0x1ab)](_0x250d91):String(_0x250d91);}catch{_0x305ea7=_0x5d9244(0x1b7);}const _0xbea50a=_0x4d9a04[_0x5d9244(0x1e0)](_0x2230ee),_0x2bfcaf=_0x305ea7[_0x5d9244(0x1a3)]('\x0a');_0x2bfcaf[_0x5d9244(0x1a2)]((_0x53ebb1,_0x14095b)=>{const _0x3f2d2=_0x5d9244,_0x1fa758=colorBorder('│',_0x4f1fc4);_0x14095b===0x0?_0x4970ed['push'](_0x1fa758+'\x20'+_0xbea50a+'\x20'+_0x1fa758+'\x20'+_0x53ebb1[_0x3f2d2(0x1e0)](_0x2ea220)+'\x20'+_0x1fa758):_0x4970ed[_0x3f2d2(0x1d3)](_0x1fa758+'\x20'+'\x20'[_0x3f2d2(0x1e7)](_0x2230ee)+'\x20'+_0x1fa758+'\x20'+_0x53ebb1['padEnd'](_0x2ea220)+'\x20'+_0x1fa758);});}),_0x4970ed[_0x23180f(0x1d3)](colorBorder('└─'+'─'[_0x23180f(0x1e7)](_0x2230ee)+_0x23180f(0x1aa)+'─'[_0x23180f(0x1e7)](_0x2ea220)+'─┘',_0x4f1fc4));_0x558041&&(_0x4970ed[_0x23180f(0x1d3)](''),_0x4970ed[_0x23180f(0x1d3)](String(a48_0x52a5df[_0x23180f(0x1df)][_0x23180f(0x1c6)](_0x23180f(0x1bc)))),_0x4970ed[_0x23180f(0x1d3)](_0x558041));_0x23cdcf&&(_0x4970ed['push'](''),_0x4970ed[_0x23180f(0x1d3)](String(a48_0x52a5df['blue'][_0x23180f(0x1c6)](_0x23180f(0x1bd)))),_0x4970ed[_0x23180f(0x1d3)](_0x23cdcf));_0x3342fd&&(_0x4970ed[_0x23180f(0x1d3)](''),_0x4970ed[_0x23180f(0x1d3)](String(a48_0x52a5df['magenta'][_0x23180f(0x1c6)]('[rule]'))),_0x4970ed[_0x23180f(0x1d3)](_0x3342fd));if(_0x181fd7){if(_0x181fd7['stderr']){_0x4970ed[_0x23180f(0x1d3)](''),_0x4970ed[_0x23180f(0x1d3)](String(a48_0x52a5df[_0x23180f(0x1be)][_0x23180f(0x1c6)](_0x23180f(0x1a4))));const _0x3ea7a8=_0x181fd7[_0x23180f(0x1c8)][_0x23180f(0x1a3)]('\x0a');_0x3ea7a8[_0x23180f(0x1a2)](_0x5bab12=>{const _0x5d62cb=_0x23180f;_0x5bab12['trim']()&&_0x4970ed[_0x5d62cb(0x1d3)](_0x5bab12);});}if(_0x181fd7['cmdout']){_0x4970ed[_0x23180f(0x1d3)](''),_0x4970ed[_0x23180f(0x1d3)](String(a48_0x52a5df['cyan'][_0x23180f(0x1c6)](_0x23180f(0x1bf))));const _0x22c920=_0x181fd7[_0x23180f(0x1ae)][_0x23180f(0x1a3)]('\x0a');_0x22c920[_0x23180f(0x1a2)](_0x2fe82e=>{const _0x30d40b=_0x23180f;_0x2fe82e[_0x30d40b(0x1b6)]()&&_0x4970ed[_0x30d40b(0x1d3)](_0x2fe82e);});}}return _0x4970ed[_0x23180f(0x1a5)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x2a9d67,_0x1e6f41){const _0x4b13a1=a48_0x532e;if(_0x1e6f41[_0x4b13a1(0x1c2)]===_0x4b13a1(0x1a7)){await handleSDKOutput([_0x2a9d67],_0x1e6f41);return;}const _0x39df6b=resolveOutputOptions(_0x1e6f41),_0x373493=await formatSingleObject(_0x2a9d67,_0x39df6b);await writeOutput(_0x373493,_0x39df6b[_0x4b13a1(0x1d2)]||undefined,_0x39df6b[_0x4b13a1(0x1c2)]);}