@treasuredata/tdx 2026.6.4 → 2026.7.0

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 (270) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.d.ts.map +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/command.js.map +1 -1
  21. package/dist/commands/connection-command.js +1 -1
  22. package/dist/commands/databases.d.ts.map +1 -1
  23. package/dist/commands/databases.js +1 -1
  24. package/dist/commands/databases.js.map +1 -1
  25. package/dist/commands/delivery-command.js +1 -1
  26. package/dist/commands/describe.js +1 -1
  27. package/dist/commands/engage-campaign-pull-command.js +1 -1
  28. package/dist/commands/engage-campaign-push-command.js +1 -1
  29. package/dist/commands/engage-campaign-validate-command.js +1 -1
  30. package/dist/commands/engage-command.js +1 -1
  31. package/dist/commands/engage-template-pull-command.js +1 -1
  32. package/dist/commands/engage-template-push-command.js +1 -1
  33. package/dist/commands/engage-template-validate-command.js +1 -1
  34. package/dist/commands/job-command.js +1 -1
  35. package/dist/commands/journey-command.js +1 -1
  36. package/dist/commands/journey-command.js.map +1 -1
  37. package/dist/commands/journey-validate-command.js +1 -1
  38. package/dist/commands/llm-command.js +1 -1
  39. package/dist/commands/mcp-command.js +1 -1
  40. package/dist/commands/parent-segment-command.js +1 -1
  41. package/dist/commands/policy-command.js +1 -1
  42. package/dist/commands/profile-command.js +1 -1
  43. package/dist/commands/profiles-command.js +1 -1
  44. package/dist/commands/query-command.js +1 -1
  45. package/dist/commands/schedule-command.js +1 -1
  46. package/dist/commands/segment-command.js +1 -1
  47. package/dist/commands/segment-create-command.js +1 -1
  48. package/dist/commands/segment-fields-command.js +1 -1
  49. package/dist/commands/segment-move-command.d.ts +26 -0
  50. package/dist/commands/segment-move-command.d.ts.map +1 -0
  51. package/dist/commands/segment-move-command.js +1 -0
  52. package/dist/commands/segment-move-command.js.map +1 -0
  53. package/dist/commands/segment-pull-command.js +1 -1
  54. package/dist/commands/segment-push-command.js +1 -1
  55. package/dist/commands/segment-update-command.js +1 -1
  56. package/dist/commands/segment-use-command.js +1 -1
  57. package/dist/commands/segment-validate-command.js +1 -1
  58. package/dist/commands/segments.d.ts +9 -0
  59. package/dist/commands/segments.d.ts.map +1 -1
  60. package/dist/commands/segments.js +1 -1
  61. package/dist/commands/segments.js.map +1 -1
  62. package/dist/commands/show.js +1 -1
  63. package/dist/commands/status-command.js +1 -1
  64. package/dist/commands/table-deleted.js +1 -1
  65. package/dist/commands/tables.js +1 -1
  66. package/dist/commands/unset-command.js +1 -1
  67. package/dist/commands/upgrade-command.js +1 -1
  68. package/dist/commands/use-command.js +1 -1
  69. package/dist/commands/user-command.js +1 -1
  70. package/dist/commands/work-command.js +1 -1
  71. package/dist/commands/workflow-command.js +1 -1
  72. package/dist/core/auth.js +1 -1
  73. package/dist/core/command-output.d.ts.map +1 -1
  74. package/dist/core/command-output.js +1 -1
  75. package/dist/core/command-output.js.map +1 -1
  76. package/dist/core/config.js +1 -1
  77. package/dist/core/connection-cache.js +1 -1
  78. package/dist/core/constants.js +1 -1
  79. package/dist/core/credential-cache.js +1 -1
  80. package/dist/core/global-context.js +1 -1
  81. package/dist/core/keychain.js +1 -1
  82. package/dist/core/oauth-keychain.js +1 -1
  83. package/dist/core/oauth.js +1 -1
  84. package/dist/core/profile.js +1 -1
  85. package/dist/core/project-config.js +1 -1
  86. package/dist/core/session.js +1 -1
  87. package/dist/core/user-cache.js +1 -1
  88. package/dist/core/version.js +1 -1
  89. package/dist/index.js +1 -1
  90. package/dist/mcp/server.js +1 -1
  91. package/dist/mcp/tools/index.js +1 -1
  92. package/dist/mcp/tools/tdx-run.js +1 -1
  93. package/dist/mcp/tools/tdx-search.js +1 -1
  94. package/dist/mcp/tools/work-create-item.js +1 -1
  95. package/dist/mcp/utils.js +1 -1
  96. package/dist/proxy/claude-usage-tracker.js +1 -1
  97. package/dist/proxy/passthrough-server.js +1 -1
  98. package/dist/proxy/sse-usage-parser.js +1 -1
  99. package/dist/sdk/agent/agent-config.js +1 -1
  100. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  101. package/dist/sdk/agent/agent-yaml.js +1 -1
  102. package/dist/sdk/agent/test/evaluator.js +1 -1
  103. package/dist/sdk/agent/test/executor.js +1 -1
  104. package/dist/sdk/agent/test/index.js +1 -1
  105. package/dist/sdk/agent/test/output.js +1 -1
  106. package/dist/sdk/agent/test/parser.js +1 -1
  107. package/dist/sdk/agent/tool-target-registry.js +1 -1
  108. package/dist/sdk/api.js +1 -1
  109. package/dist/sdk/cas/cas-api-client.js +1 -1
  110. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  111. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  112. package/dist/sdk/cas/index.js +1 -1
  113. package/dist/sdk/cas/pull-workflow.js +1 -1
  114. package/dist/sdk/cas/push-workflow.js +1 -1
  115. package/dist/sdk/client/cdp-api-client.d.ts +18 -0
  116. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  117. package/dist/sdk/client/cdp-api-client.js +1 -1
  118. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  119. package/dist/sdk/client/delivery-api-client.js +1 -1
  120. package/dist/sdk/client/endpoints.js +1 -1
  121. package/dist/sdk/client/engage-api-client.js +1 -1
  122. package/dist/sdk/client/http-client.js +1 -1
  123. package/dist/sdk/client/llm-api-client.js +1 -1
  124. package/dist/sdk/client/oauth-refresh.js +1 -1
  125. package/dist/sdk/client/rate-limiter.js +1 -1
  126. package/dist/sdk/client/td-api-client.js +1 -1
  127. package/dist/sdk/client/trino-api-client.js +1 -1
  128. package/dist/sdk/client/workflow-client.js +1 -1
  129. package/dist/sdk/connection-validator.js +1 -1
  130. package/dist/sdk/connection.js +1 -1
  131. package/dist/sdk/delivery.js +1 -1
  132. package/dist/sdk/engage/campaign-pull.js +1 -1
  133. package/dist/sdk/engage/campaign-push.js +1 -1
  134. package/dist/sdk/engage/campaign-validator.js +1 -1
  135. package/dist/sdk/engage/campaign-yaml.js +1 -1
  136. package/dist/sdk/engage/template-pull.js +1 -1
  137. package/dist/sdk/engage/template-push.js +1 -1
  138. package/dist/sdk/engage/template-validator.js +1 -1
  139. package/dist/sdk/engage/template-yaml.js +1 -1
  140. package/dist/sdk/engage/types/campaign-def.js +1 -1
  141. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  142. package/dist/sdk/engage/types/template-schema.js +1 -1
  143. package/dist/sdk/engage.js +1 -1
  144. package/dist/sdk/errors.js +1 -1
  145. package/dist/sdk/index.d.ts +1 -1
  146. package/dist/sdk/index.d.ts.map +1 -1
  147. package/dist/sdk/index.js +1 -1
  148. package/dist/sdk/index.js.map +1 -1
  149. package/dist/sdk/io/index.js +1 -1
  150. package/dist/sdk/io/node-filesystem.js +1 -1
  151. package/dist/sdk/job.js +1 -1
  152. package/dist/sdk/journey.js +1 -1
  153. package/dist/sdk/llm/chat-cache.js +1 -1
  154. package/dist/sdk/llm/index.js +1 -1
  155. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  156. package/dist/sdk/llm/model-factors.js +1 -1
  157. package/dist/sdk/llm/user-settings.js +1 -1
  158. package/dist/sdk/personalization.js +1 -1
  159. package/dist/sdk/policy.js +1 -1
  160. package/dist/sdk/query/deleted-table-validation.js +1 -1
  161. package/dist/sdk/query/index.js +1 -1
  162. package/dist/sdk/query/sql-parser.js +1 -1
  163. package/dist/sdk/realtime.js +1 -1
  164. package/dist/sdk/schedule.js +1 -1
  165. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  166. package/dist/sdk/segment/fields-display.js +1 -1
  167. package/dist/sdk/segment/file-discovery.js +1 -1
  168. package/dist/sdk/segment/journey-utils.js +1 -1
  169. package/dist/sdk/segment/journey-validator.js +1 -1
  170. package/dist/sdk/segment/journey-yaml.d.ts +6 -2
  171. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  172. package/dist/sdk/segment/journey-yaml.js +1 -1
  173. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  174. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  175. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  176. package/dist/sdk/segment/pull-workflow.js +1 -1
  177. package/dist/sdk/segment/push-recovery.js +1 -1
  178. package/dist/sdk/segment/push-workflow.js +1 -1
  179. package/dist/sdk/segment/push-workflow.js.map +1 -1
  180. package/dist/sdk/segment/resolution-context.js +1 -1
  181. package/dist/sdk/segment/segment-path-parser.d.ts.map +1 -1
  182. package/dist/sdk/segment/segment-path-parser.js +1 -1
  183. package/dist/sdk/segment/segment-path-parser.js.map +1 -1
  184. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  185. package/dist/sdk/segment/segment-validator.js +1 -1
  186. package/dist/sdk/segment/target-resolution.js +1 -1
  187. package/dist/sdk/segment/tdx-config.js +1 -1
  188. package/dist/sdk/segment/types/activation-schema.js +1 -1
  189. package/dist/sdk/segment/types/journey-def.js +1 -1
  190. package/dist/sdk/segment/types/journey-schema.js +1 -1
  191. package/dist/sdk/segment/types/segment-def.js +1 -1
  192. package/dist/sdk/segment/types/segment-schema.js +1 -1
  193. package/dist/sdk/segment/validate-files.d.ts +2 -5
  194. package/dist/sdk/segment/validate-files.d.ts.map +1 -1
  195. package/dist/sdk/segment/validate-files.js +1 -1
  196. package/dist/sdk/segment/validate-files.js.map +1 -1
  197. package/dist/sdk/segment/yaml-validator.js +1 -1
  198. package/dist/sdk/segment.d.ts +83 -2
  199. package/dist/sdk/segment.d.ts.map +1 -1
  200. package/dist/sdk/segment.js +1 -1
  201. package/dist/sdk/segment.js.map +1 -1
  202. package/dist/sdk/types/cdp.d.ts +36 -0
  203. package/dist/sdk/types/cdp.d.ts.map +1 -1
  204. package/dist/sdk/types/index.d.ts +1 -1
  205. package/dist/sdk/types/index.d.ts.map +1 -1
  206. package/dist/sdk/types/index.js +1 -1
  207. package/dist/sdk/types/index.js.map +1 -1
  208. package/dist/sdk/types/progress.js +1 -1
  209. package/dist/sdk/types/workspace.js +1 -1
  210. package/dist/sdk/user.js +1 -1
  211. package/dist/sdk/util/format-detector.js +1 -1
  212. package/dist/sdk/util/formatters.js +1 -1
  213. package/dist/sdk/util/index.js +1 -1
  214. package/dist/sdk/util/paginate.js +1 -1
  215. package/dist/sdk/util/tree-formatter.js +1 -1
  216. package/dist/sdk/util/tree-search.d.ts +35 -0
  217. package/dist/sdk/util/tree-search.d.ts.map +1 -0
  218. package/dist/sdk/util/tree-search.js +1 -0
  219. package/dist/sdk/util/tree-search.js.map +1 -0
  220. package/dist/sdk/workflow/archive-validation.js +1 -1
  221. package/dist/sdk/workflow/clone-workflow.js +1 -1
  222. package/dist/sdk/workflow/index.js +1 -1
  223. package/dist/sdk/workflow/pull-workflow.js +1 -1
  224. package/dist/sdk/workflow/push-workflow.js +1 -1
  225. package/dist/sdk/workflow/task-graph.js +1 -1
  226. package/dist/sdk/workflow/tdx-config.js +1 -1
  227. package/dist/sdk/workflow/workflow-utils.js +1 -1
  228. package/dist/sdk/workspace/access-tracker.js +1 -1
  229. package/dist/sdk/workspace/frontmatter.js +1 -1
  230. package/dist/sdk/workspace/git.js +1 -1
  231. package/dist/sdk/workspace/index.js +1 -1
  232. package/dist/sdk/workspace/templates.js +1 -1
  233. package/dist/sdk/workspace/weekly.js +1 -1
  234. package/dist/sdk/workspace/wikilinks.js +1 -1
  235. package/dist/test-utils/command-runner.js +1 -1
  236. package/dist/test-utils/factories.js +1 -1
  237. package/dist/test-utils/fixtures.js +1 -1
  238. package/dist/test-utils/http-mock.js +1 -1
  239. package/dist/test-utils/index.js +1 -1
  240. package/dist/utils/async.js +1 -1
  241. package/dist/utils/colors.js +1 -1
  242. package/dist/utils/diff.js +1 -1
  243. package/dist/utils/file-permissions.js +1 -1
  244. package/dist/utils/file-reader.js +1 -1
  245. package/dist/utils/github-releases.js +1 -1
  246. package/dist/utils/global-cache.js +1 -1
  247. package/dist/utils/json-loader.js +1 -1
  248. package/dist/utils/local-cache.js +1 -1
  249. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  250. package/dist/utils/logger/formatters/index.js +1 -1
  251. package/dist/utils/logger/handlers/console-handler.js +1 -1
  252. package/dist/utils/logger/handlers/file-handler.js +1 -1
  253. package/dist/utils/logger/handlers/index.js +1 -1
  254. package/dist/utils/logger/handlers/null-handler.js +1 -1
  255. package/dist/utils/logger/index.js +1 -1
  256. package/dist/utils/logger/logger.js +1 -1
  257. package/dist/utils/logger/types.js +1 -1
  258. package/dist/utils/option-validation.js +1 -1
  259. package/dist/utils/process.d.ts +6 -0
  260. package/dist/utils/process.d.ts.map +1 -1
  261. package/dist/utils/process.js +1 -1
  262. package/dist/utils/process.js.map +1 -1
  263. package/dist/utils/prompt.js +1 -1
  264. package/dist/utils/spinner.js +1 -1
  265. package/dist/utils/sse-parser.js +1 -1
  266. package/dist/utils/string-utils.js +1 -1
  267. package/dist/utils/table-ref-parser.js +1 -1
  268. package/dist/utils/tdx-logger.js +1 -1
  269. package/dist/utils/version-check.js +1 -1
  270. package/package.json +1 -1
@@ -1 +1 @@
1
- const a54_0x8d1ae5=a54_0x5085;(function(_0x198e6a,_0xd5bffd){const _0x5c7920=a54_0x5085,_0x234c37=_0x198e6a();while(!![]){try{const _0x50fe9b=-parseInt(_0x5c7920(0x12b))/0x1*(parseInt(_0x5c7920(0x148))/0x2)+-parseInt(_0x5c7920(0x11d))/0x3+parseInt(_0x5c7920(0x153))/0x4+-parseInt(_0x5c7920(0x12e))/0x5*(parseInt(_0x5c7920(0x10c))/0x6)+-parseInt(_0x5c7920(0x117))/0x7*(-parseInt(_0x5c7920(0x15f))/0x8)+-parseInt(_0x5c7920(0x149))/0x9*(parseInt(_0x5c7920(0x15b))/0xa)+parseInt(_0x5c7920(0x140))/0xb*(parseInt(_0x5c7920(0xfb))/0xc);if(_0x50fe9b===_0xd5bffd)break;else _0x234c37['push'](_0x234c37['shift']());}catch(_0x5dedb1){_0x234c37['push'](_0x234c37['shift']());}}}(a54_0x337e,0xf2d5f));import{getChalk}from'../utils/colors.js';const chalk=getChalk();function a54_0x337e(){const _0x5bcc68=['getSummary','resolvedKind','workflow','readDocument','note','6568124HZRwPV','todo','frontmatter','values','initAt','resolveWikiLinks','dim','trim','19030dJpPOF','log','\x20[[','yellow','392owBSPa','displayText','goals','resolvedPath','basename','createDocument','critical','progress','Workspace\x20initialized\x20in\x20current\x20directory','init','12IUWPWo','join','flatMap','red','in_progress','design_review','Created:','fileName','high','Tasks','green','name','Failed\x20to\x20open\x20editor:\x20','\x20\x20←\x20','void','length','medium','2848614UxEsDL','workspacePath','status','No\x20workspace\x20found.','done','Workspace\x20initialized:','priority','filePath','\x20to\x20create\x20one,\x20or\x20navigate\x20to\x20a\x20directory\x20containing\x20tdx.json.','Invalid\x20kind:\x20','tags','119343onwUkA','getTasksByStatus','Goals','round','taskCounts','inherit','3407124mmtXsk','Backlinks','\x20\x20(empty)','isArray','review','repeat','getBacklinks','cwd','kind','white','backlog','planning','github','gray','3bqMXAa','exit','item','20pWcFEe','body','guide','title','Invalid\x20status:\x20','tdx\x20work\x20init\x20<name>','slug','template','has','path','blue','Links\x20for:\x20','days','cyan','Workspace:\x20','No\x20outgoing\x20wiki-links','.\x20Valid:\x20','all','37407469QvVwJu','entries','error','reduce','\x20Run\x20','No\x20incoming\x20backlinks','Outgoing','No\x20tasks\x20yet.\x20Create\x20one\x20with:\x20tdx\x20work\x20new\x20<title>','870878CTJCvu','2565hqbsVv','bold','magenta','Document\x20not\x20found:\x20','low'];a54_0x337e=function(){return _0x5bcc68;};return a54_0x337e();}function a54_0x5085(_0x17f2b0,_0x212c95){_0x17f2b0=_0x17f2b0-0xf3;const _0x337e1c=a54_0x337e();let _0x5085f1=_0x337e1c[_0x17f2b0];return _0x5085f1;}import{execFileSync}from'node:child_process';import a54_0x407cd2 from'node:path';import{WorkspaceSDK,resolveWorkspacePath,normalizeTags}from'../sdk/workspace/index.js';import{STATUS_PHASES,ALL_STATUSES}from'../sdk/types/workspace.js';function buildStaleFilter(_0x464354){const _0x1c4ce2=a54_0x5085;if(_0x464354[_0x1c4ce2(0x13f)])return{'includeStale':!![]};if(_0x464354[_0x1c4ce2(0x13a)])return{'updatedWithin':parseInt(_0x464354[_0x1c4ce2(0x13a)],0xa)};return undefined;}const VALID_KINDS=new Set([a54_0x8d1ae5(0x12d),'goal',a54_0x8d1ae5(0x130),a54_0x8d1ae5(0x152),'reference',a54_0x8d1ae5(0x150),a54_0x8d1ae5(0x135)]),VALID_PRIORITIES=new Set([a54_0x8d1ae5(0xf7),a54_0x8d1ae5(0x103),'medium',a54_0x8d1ae5(0x14d)]),VALID_STATUSES=new Set(ALL_STATUSES);function getSDK(){const _0x4b52f1=a54_0x8d1ae5,_0x4160bd=resolveWorkspacePath();return!_0x4160bd&&(console[_0x4b52f1(0x142)](chalk[_0x4b52f1(0xfe)](_0x4b52f1(0x10f))+_0x4b52f1(0x144)+chalk[_0x4b52f1(0x13b)](_0x4b52f1(0x133))+_0x4b52f1(0x114)),process['exit'](0x1)),new WorkspaceSDK(_0x4160bd);}function priorityDot(_0x5dd14a){const _0x22046=a54_0x8d1ae5;switch(_0x5dd14a){case _0x22046(0xf7):return chalk['red']('●');case _0x22046(0x103):return chalk[_0x22046(0x15e)]('●');case _0x22046(0x10b):return chalk[_0x22046(0x138)]('●');case _0x22046(0x14d):return chalk[_0x22046(0x12a)]('●');default:return chalk['blue']('●');}}function statusColor(_0x548f2f){const _0x920d84=a54_0x8d1ae5;switch(_0x548f2f){case _0x920d84(0x110):return chalk[_0x920d84(0x105)](_0x548f2f);case _0x920d84(0x109):return chalk[_0x920d84(0x12a)](_0x548f2f);case _0x920d84(0xff):return chalk[_0x920d84(0x13b)](_0x548f2f);case _0x920d84(0x121):return chalk[_0x920d84(0x14b)](_0x548f2f);case _0x920d84(0x128):case _0x920d84(0x100):return chalk[_0x920d84(0x15e)](_0x548f2f);case _0x920d84(0x154):return chalk[_0x920d84(0x126)](_0x548f2f);case _0x920d84(0x127):return chalk[_0x920d84(0x159)](_0x548f2f);default:return _0x548f2f;}}export async function workSummaryAction(_0x78b2a3){const _0x14209f=a54_0x8d1ae5,_0x3fc0f5=getSDK(),_0x308afe=buildStaleFilter(_0x78b2a3),_0x45e17f=_0x3fc0f5[_0x14209f(0x14e)](_0x308afe);console[_0x14209f(0x15c)](chalk[_0x14209f(0x14a)](_0x14209f(0x13c)+_0x45e17f[_0x14209f(0x106)])),console[_0x14209f(0x15c)](chalk[_0x14209f(0x159)](_0x45e17f[_0x14209f(0x137)])),console[_0x14209f(0x15c)]();const _0x45e747=Object[_0x14209f(0x156)](_0x45e17f[_0x14209f(0x11b)])[_0x14209f(0x143)]((_0x17627f,_0x34dda8)=>_0x17627f+_0x34dda8,0x0);if(_0x45e747===0x0)console[_0x14209f(0x15c)](chalk[_0x14209f(0x159)](_0x14209f(0x147)));else{console[_0x14209f(0x15c)](chalk[_0x14209f(0x14a)](_0x14209f(0x104)));for(const [_0x2ec04d,_0x4040ac]of Object[_0x14209f(0x141)](_0x45e17f['taskCounts'])){_0x4040ac>0x0&&console[_0x14209f(0x15c)]('\x20\x20'+statusColor(_0x2ec04d)+':\x20'+_0x4040ac);}console[_0x14209f(0x15c)]();}if(_0x45e17f[_0x14209f(0xf3)]['length']>0x0){console[_0x14209f(0x15c)](chalk[_0x14209f(0x14a)](_0x14209f(0x119)));for(const _0x5e916e of _0x45e17f[_0x14209f(0xf3)]){const _0x456d18=progressBar(_0x5e916e[_0x14209f(0xf8)]);console[_0x14209f(0x15c)]('\x20\x20'+_0x5e916e[_0x14209f(0x131)]+'\x20'+_0x456d18+'\x20'+_0x5e916e[_0x14209f(0xf8)]+'%');}}}function progressBar(_0x489829){const _0x239654=a54_0x8d1ae5,_0x519c09=0x14,_0xd1a221=Math[_0x239654(0x11a)](_0x489829/0x64*_0x519c09),_0x56364f=_0x519c09-_0xd1a221;return chalk[_0x239654(0x105)]('█'[_0x239654(0x122)](_0xd1a221))+chalk[_0x239654(0x159)]('░'[_0x239654(0x122)](_0x56364f));}export async function workInitAction(_0x2ee923,_0x325327){const _0x3acb56=a54_0x8d1ae5,_0x32bb3a=_0x2ee923||a54_0x407cd2[_0x3acb56(0xf5)](process[_0x3acb56(0x124)]());if(_0x325327[_0x3acb56(0x129)]){const _0x324b7e=WorkspaceSDK[_0x3acb56(0x157)](_0x32bb3a,{'github':_0x325327[_0x3acb56(0x129)]});console[_0x3acb56(0x15c)](chalk[_0x3acb56(0x105)](_0x3acb56(0x111))+'\x20'+_0x324b7e[_0x3acb56(0x10d)]),console[_0x3acb56(0x15c)](chalk['dim']('Linked\x20to\x20GitHub:\x20'+_0x325327[_0x3acb56(0x129)]));}else{if(_0x2ee923){const _0x28256c=WorkspaceSDK[_0x3acb56(0x157)](_0x2ee923);console[_0x3acb56(0x15c)](chalk[_0x3acb56(0x105)](_0x3acb56(0x111))+'\x20'+_0x28256c[_0x3acb56(0x10d)]);}else{const _0x322900=new WorkspaceSDK(process[_0x3acb56(0x124)]());_0x322900[_0x3acb56(0xfa)](_0x32bb3a),console[_0x3acb56(0x15c)](chalk['green'](_0x3acb56(0xf9)));}}}export async function workNewAction(_0x43176f,_0x1c6dc4){const _0x373279=a54_0x8d1ae5,_0x5b6a21=getSDK(),_0x3c097f=_0x1c6dc4[_0x373279(0x125)]||_0x373279(0x12d);!VALID_KINDS['has'](_0x3c097f)&&(console[_0x373279(0x142)](chalk['red'](_0x373279(0x115)+_0x3c097f+_0x373279(0x13e)+[...VALID_KINDS][_0x373279(0xfc)](',\x20'))),process[_0x373279(0x12c)](0x1));_0x1c6dc4[_0x373279(0x112)]&&!VALID_PRIORITIES[_0x373279(0x136)](_0x1c6dc4['priority'])&&(console[_0x373279(0x142)](chalk[_0x373279(0xfe)]('Invalid\x20priority:\x20'+_0x1c6dc4[_0x373279(0x112)]+_0x373279(0x13e)+[...VALID_PRIORITIES]['join'](',\x20'))),process[_0x373279(0x12c)](0x1));_0x1c6dc4[_0x373279(0x10e)]&&!VALID_STATUSES[_0x373279(0x136)](_0x1c6dc4[_0x373279(0x10e)])&&(console[_0x373279(0x142)](chalk['red'](_0x373279(0x132)+_0x1c6dc4[_0x373279(0x10e)]+_0x373279(0x13e)+[...VALID_STATUSES]['join'](',\x20'))),process[_0x373279(0x12c)](0x1));const _0x220f93=_0x1c6dc4[_0x373279(0x116)]?_0x1c6dc4[_0x373279(0x116)]['split'](',')['map'](_0x55773b=>_0x55773b[_0x373279(0x15a)]()):undefined,_0x436eb8=_0x5b6a21[_0x373279(0xf6)]({'title':_0x43176f,'kind':_0x3c097f,'tags':_0x220f93,'priority':_0x1c6dc4[_0x373279(0x112)],'body':_0x1c6dc4[_0x373279(0x12f)],'template':_0x1c6dc4[_0x373279(0x135)],'status':_0x1c6dc4['status'],'assignee':_0x1c6dc4['assignee']});console[_0x373279(0x15c)](chalk['green'](_0x373279(0x101))+'\x20'+_0x436eb8[_0x373279(0x102)]),console[_0x373279(0x15c)](chalk[_0x373279(0x159)](_0x436eb8['filePath']));}export async function workMoveAction(_0x16f5f7,_0x15989e){const _0x1205c7=a54_0x8d1ae5;!VALID_STATUSES[_0x1205c7(0x136)](_0x15989e)&&(console[_0x1205c7(0x142)](chalk[_0x1205c7(0xfe)](_0x1205c7(0x132)+_0x15989e+'.\x20Valid:\x20'+[...VALID_STATUSES][_0x1205c7(0xfc)](',\x20'))),process[_0x1205c7(0x12c)](0x1));const _0x516d3b=getSDK(),_0x45682e=_0x516d3b['moveTask'](_0x16f5f7,_0x15989e);!_0x45682e&&(console[_0x1205c7(0x142)](chalk[_0x1205c7(0xfe)]('Document\x20not\x20found:\x20'+_0x16f5f7)),process[_0x1205c7(0x12c)](0x1));const _0x55bf4a=_0x45682e[_0x1205c7(0x155)]['title']||_0x45682e[_0x1205c7(0x102)];console['log'](chalk['green']('Moved:')+('\x20'+_0x55bf4a+'\x20→\x20'+statusColor(_0x15989e)));}export async function workBoardAction(_0x1f5326){const _0x4d241a=a54_0x8d1ae5,_0x1284b8=getSDK(),_0x2535b2=buildStaleFilter(_0x1f5326),{grouped:_0x44a3b9}=_0x1284b8[_0x4d241a(0x118)](_0x2535b2);for(const [_0x4900d4,_0x293c06]of Object[_0x4d241a(0x141)](STATUS_PHASES)){const _0x21976a=_0x293c06[_0x4d241a(0xfd)](_0x37fa2e=>_0x44a3b9[_0x37fa2e]||[]);console['log'](chalk['bold']['underline'](_0x4900d4)+chalk[_0x4d241a(0x159)]('\x20('+_0x21976a[_0x4d241a(0x10a)]+')'));if(_0x21976a[_0x4d241a(0x10a)]===0x0)console[_0x4d241a(0x15c)](chalk[_0x4d241a(0x159)](_0x4d241a(0x11f)));else for(const _0x34a83c of _0x21976a){const _0x2e14ad=_0x34a83c[_0x4d241a(0x155)],_0x52f2be=priorityDot(_0x2e14ad[_0x4d241a(0x112)]),_0x53151a=_0x2e14ad['title']||_0x34a83c['fileName'],_0x4c57d3=normalizeTags(_0x2e14ad[_0x4d241a(0x116)]),_0x4159e9=_0x4c57d3[_0x4d241a(0x10a)]?chalk[_0x4d241a(0x159)]('\x20['+_0x4c57d3['join'](',\x20')+']'):'',_0x3270bb=chalk[_0x4d241a(0x159)]('('+_0x2e14ad[_0x4d241a(0x10e)]+')');console[_0x4d241a(0x15c)]('\x20\x20'+_0x52f2be+'\x20'+_0x53151a+'\x20'+_0x3270bb+_0x4159e9);}console['log']();}}export async function workShowAction(_0x5f007b){const _0x183d94=a54_0x8d1ae5,_0x399067=getSDK(),_0x274266=_0x399067[_0x183d94(0x151)](_0x5f007b);!_0x274266&&(console['error'](chalk[_0x183d94(0xfe)]('Document\x20not\x20found:\x20'+_0x5f007b)),process[_0x183d94(0x12c)](0x1));console['log'](chalk[_0x183d94(0x14a)](_0x274266['frontmatter'][_0x183d94(0x131)]||_0x274266[_0x183d94(0x102)])),console[_0x183d94(0x15c)](chalk[_0x183d94(0x159)](_0x274266[_0x183d94(0x113)])),console['log']();const _0x255186=_0x274266[_0x183d94(0x155)];for(const [_0x30d5ec,_0x242e67]of Object[_0x183d94(0x141)](_0x255186)){if(_0x30d5ec===_0x183d94(0x131))continue;if(_0x242e67===undefined||_0x242e67===null)continue;const _0x421a45=Array[_0x183d94(0x120)](_0x242e67)?_0x242e67[_0x183d94(0xfc)](',\x20'):String(_0x242e67);console[_0x183d94(0x15c)]('\x20\x20'+chalk['cyan'](_0x30d5ec)+':\x20'+_0x421a45);}console[_0x183d94(0x15c)]();_0x274266[_0x183d94(0x12f)]['trim']()&&(console[_0x183d94(0x15c)](_0x274266[_0x183d94(0x12f)]['trim']()),console[_0x183d94(0x15c)]());const _0x5e5e36=_0x399067[_0x183d94(0x158)](_0x274266[_0x183d94(0x12f)]);if(_0x5e5e36[_0x183d94(0x10a)]>0x0){console[_0x183d94(0x15c)](chalk[_0x183d94(0x14a)]('Wiki-links'));for(const _0x3e46c4 of _0x5e5e36){const _0x499f2d=_0x3e46c4[_0x183d94(0xf4)]?chalk[_0x183d94(0x105)]('✓'):chalk['red']('✗'),_0x5a3d17=_0x3e46c4[_0x183d94(0x160)]||_0x3e46c4[_0x183d94(0x134)];console['log']('\x20\x20'+_0x499f2d+_0x183d94(0x15d)+_0x5a3d17+']]');}console[_0x183d94(0x15c)]();}const _0x2322e5=_0x399067[_0x183d94(0x123)](_0x274266[_0x183d94(0x102)]);if(_0x2322e5['length']>0x0){console[_0x183d94(0x15c)](chalk[_0x183d94(0x14a)](_0x183d94(0x11e)));for(const _0x29237c of _0x2322e5){console['log'](_0x183d94(0x108)+_0x29237c[_0x183d94(0x131)]+'\x20'+chalk['dim']('('+_0x29237c[_0x183d94(0x125)]+')'));}}}export async function workLinksAction(_0x13d6de){const _0x2239fa=a54_0x8d1ae5,_0x3b14aa=getSDK(),_0x5ae703=_0x3b14aa['readDocument'](_0x13d6de);!_0x5ae703&&(console[_0x2239fa(0x142)](chalk[_0x2239fa(0xfe)](_0x2239fa(0x14c)+_0x13d6de)),process[_0x2239fa(0x12c)](0x1));const _0x48ff30=_0x5ae703[_0x2239fa(0x155)][_0x2239fa(0x131)]||_0x5ae703[_0x2239fa(0x102)];console[_0x2239fa(0x15c)](chalk[_0x2239fa(0x14a)](_0x2239fa(0x139)+_0x48ff30)),console[_0x2239fa(0x15c)]();const _0x36d22f=_0x3b14aa[_0x2239fa(0x158)](_0x5ae703[_0x2239fa(0x12f)]);if(_0x36d22f[_0x2239fa(0x10a)]>0x0){console['log'](chalk[_0x2239fa(0x14a)](_0x2239fa(0x146)));for(const _0x6e10fe of _0x36d22f){const _0x5dfa28=_0x6e10fe[_0x2239fa(0xf4)]?chalk[_0x2239fa(0x105)]('✓'):chalk[_0x2239fa(0xfe)]('✗'),_0x937b60=_0x6e10fe[_0x2239fa(0x160)]||_0x6e10fe[_0x2239fa(0x134)],_0x448a63=_0x6e10fe[_0x2239fa(0x14f)]?chalk['dim']('\x20('+_0x6e10fe['resolvedKind']+')'):'';console[_0x2239fa(0x15c)]('\x20\x20'+_0x5dfa28+'\x20[['+_0x937b60+']]'+_0x448a63);}}else console[_0x2239fa(0x15c)](chalk[_0x2239fa(0x159)](_0x2239fa(0x13d)));console['log']();const _0x4994b3=_0x3b14aa[_0x2239fa(0x123)](_0x5ae703['fileName']);if(_0x4994b3[_0x2239fa(0x10a)]>0x0){console['log'](chalk[_0x2239fa(0x14a)]('Incoming'));for(const _0x1de995 of _0x4994b3){console[_0x2239fa(0x15c)]('\x20\x20←\x20'+_0x1de995['title']+'\x20'+chalk[_0x2239fa(0x159)]('('+_0x1de995[_0x2239fa(0x125)]+')'));}}else console[_0x2239fa(0x15c)](chalk[_0x2239fa(0x159)](_0x2239fa(0x145)));}export async function workOpenAction(_0xc47153){const _0x27f727=a54_0x8d1ae5,_0x5016d8=getSDK(),_0x34c8f0=_0x5016d8[_0x27f727(0x151)](_0xc47153);!_0x34c8f0&&(console[_0x27f727(0x142)](chalk[_0x27f727(0xfe)]('Document\x20not\x20found:\x20'+_0xc47153)),process[_0x27f727(0x12c)](0x1));const _0x51a834=process.env.EDITOR||'vi';try{execFileSync(_0x51a834,[_0x34c8f0[_0x27f727(0x113)]],{'stdio':_0x27f727(0x11c)});}catch{console[_0x27f727(0x142)](chalk[_0x27f727(0xfe)](_0x27f727(0x107)+_0x51a834)),process[_0x27f727(0x12c)](0x1);}}
1
+ const a55_0x347ad1=a55_0x558d;(function(_0x4875fa,_0x253ff0){const _0x1f0004=a55_0x558d,_0xe9ecf9=_0x4875fa();while(!![]){try{const _0x28df0e=-parseInt(_0x1f0004(0xe0))/0x1+parseInt(_0x1f0004(0xc9))/0x2+parseInt(_0x1f0004(0x91))/0x3+-parseInt(_0x1f0004(0x93))/0x4*(-parseInt(_0x1f0004(0xb3))/0x5)+-parseInt(_0x1f0004(0x8c))/0x6*(-parseInt(_0x1f0004(0xa0))/0x7)+parseInt(_0x1f0004(0xb5))/0x8+-parseInt(_0x1f0004(0x85))/0x9*(parseInt(_0x1f0004(0xc2))/0xa);if(_0x28df0e===_0x253ff0)break;else _0xe9ecf9['push'](_0xe9ecf9['shift']());}catch(_0xc9be80){_0xe9ecf9['push'](_0xe9ecf9['shift']());}}}(a55_0x5c89,0xa2b80));function a55_0x5c89(){const _0xcd0599=['flatMap','tags','backlog','Failed\x20to\x20open\x20editor:\x20','10VorVdM','filePath','days','No\x20tasks\x20yet.\x20Create\x20one\x20with:\x20tdx\x20work\x20new\x20<title>','error','critical','Invalid\x20kind:\x20','1937386mpVffx','entries','github','isArray','resolvedPath','\x20→\x20','priority','displayText','frontmatter','trim','Invalid\x20status:\x20','white','blue','initAt','slug','map','\x20to\x20create\x20one,\x20or\x20navigate\x20to\x20a\x20directory\x20containing\x20tdx.json.','medium','fileName','gray','join','magenta','resolvedKind','40566YciavE','.\x20Valid:\x20','body','red','status','todo','low','No\x20workspace\x20found.','void','goals','exit','template','Links\x20for:\x20','21657843ODyzIn','inherit','cwd','assignee','getSummary','\x20[[','values','6CGkTBy','bold','\x20\x20←\x20','title','review','455751IIvSzz','init','8ZAwuhR','design_review','repeat','guide','workflow','round','cyan','name','Wiki-links','underline','getTasksByStatus','Workspace\x20initialized\x20in\x20current\x20directory','Workspace\x20initialized:','4937345oIIryj','No\x20outgoing\x20wiki-links','createDocument','reduce','Created:','has','item','dim','Incoming','Document\x20not\x20found:\x20','Moved:','Backlinks','getBacklinks','done','readDocument','progress','log','length','in_progress','1804910AJWJco','resolveWikiLinks','4524640rQXHwR','yellow','No\x20incoming\x20backlinks','\x20\x20(empty)','basename','tdx\x20work\x20init\x20<name>','workspacePath','green','kind'];a55_0x5c89=function(){return _0xcd0599;};return a55_0x5c89();}import{getChalk}from'../utils/colors.js';const chalk=getChalk();import{execFileSync}from'node:child_process';import a55_0xf1f5bf from'node:path';function a55_0x558d(_0x34d1c1,_0x340acb){_0x34d1c1=_0x34d1c1-0x85;const _0x5c89b5=a55_0x5c89();let _0x558d06=_0x5c89b5[_0x34d1c1];return _0x558d06;}import{WorkspaceSDK,resolveWorkspacePath,normalizeTags}from'../sdk/workspace/index.js';import{STATUS_PHASES,ALL_STATUSES}from'../sdk/types/workspace.js';function buildStaleFilter(_0xc37bd9){const _0x392eb9=a55_0x558d;if(_0xc37bd9['all'])return{'includeStale':!![]};if(_0xc37bd9['days'])return{'updatedWithin':parseInt(_0xc37bd9[_0x392eb9(0xc4)],0xa)};return undefined;}const VALID_KINDS=new Set([a55_0x347ad1(0xa6),'goal',a55_0x347ad1(0x96),'note','reference',a55_0x347ad1(0x97),a55_0x347ad1(0xeb)]),VALID_PRIORITIES=new Set([a55_0x347ad1(0xc7),'high',a55_0x347ad1(0xda),a55_0x347ad1(0xe6)]),VALID_STATUSES=new Set(ALL_STATUSES);function getSDK(){const _0x3edfd0=a55_0x347ad1,_0x32dfdc=resolveWorkspacePath();return!_0x32dfdc&&(console['error'](chalk[_0x3edfd0(0xe3)](_0x3edfd0(0xe7))+'\x20Run\x20'+chalk[_0x3edfd0(0x99)](_0x3edfd0(0xba))+_0x3edfd0(0xd9)),process[_0x3edfd0(0xea)](0x1)),new WorkspaceSDK(_0x32dfdc);}function priorityDot(_0xb7d3a9){const _0x3b36bc=a55_0x347ad1;switch(_0xb7d3a9){case'critical':return chalk[_0x3b36bc(0xe3)]('●');case'high':return chalk['yellow']('●');case _0x3b36bc(0xda):return chalk[_0x3b36bc(0xd5)]('●');case _0x3b36bc(0xe6):return chalk[_0x3b36bc(0xdc)]('●');default:return chalk[_0x3b36bc(0xd5)]('●');}}function statusColor(_0x572478){const _0x2cce43=a55_0x347ad1;switch(_0x572478){case _0x2cce43(0xad):return chalk[_0x2cce43(0xbc)](_0x572478);case _0x2cce43(0xe8):return chalk[_0x2cce43(0xdc)](_0x572478);case _0x2cce43(0xb2):return chalk[_0x2cce43(0x99)](_0x572478);case _0x2cce43(0x90):return chalk[_0x2cce43(0xde)](_0x572478);case'planning':case _0x2cce43(0x94):return chalk[_0x2cce43(0xb6)](_0x572478);case _0x2cce43(0xe5):return chalk[_0x2cce43(0xd4)](_0x572478);case _0x2cce43(0xc0):return chalk['dim'](_0x572478);default:return _0x572478;}}export async function workSummaryAction(_0x4e2e60){const _0x9c667=a55_0x347ad1,_0x43d923=getSDK(),_0x5a4116=buildStaleFilter(_0x4e2e60),_0x134417=_0x43d923[_0x9c667(0x89)](_0x5a4116);console[_0x9c667(0xb0)](chalk[_0x9c667(0x8d)]('Workspace:\x20'+_0x134417[_0x9c667(0x9a)])),console[_0x9c667(0xb0)](chalk['dim'](_0x134417['path'])),console['log']();const _0x1bc91f=Object[_0x9c667(0x8b)](_0x134417['taskCounts'])[_0x9c667(0xa3)]((_0x2b7fb0,_0x50c968)=>_0x2b7fb0+_0x50c968,0x0);if(_0x1bc91f===0x0)console[_0x9c667(0xb0)](chalk['dim'](_0x9c667(0xc5)));else{console[_0x9c667(0xb0)](chalk[_0x9c667(0x8d)]('Tasks'));for(const [_0x3f659a,_0x4dd4a3]of Object['entries'](_0x134417['taskCounts'])){_0x4dd4a3>0x0&&console[_0x9c667(0xb0)]('\x20\x20'+statusColor(_0x3f659a)+':\x20'+_0x4dd4a3);}console[_0x9c667(0xb0)]();}if(_0x134417[_0x9c667(0xe9)]['length']>0x0){console[_0x9c667(0xb0)](chalk[_0x9c667(0x8d)]('Goals'));for(const _0x4f4039 of _0x134417[_0x9c667(0xe9)]){const _0x2ef037=progressBar(_0x4f4039[_0x9c667(0xaf)]);console[_0x9c667(0xb0)]('\x20\x20'+_0x4f4039[_0x9c667(0x8f)]+'\x20'+_0x2ef037+'\x20'+_0x4f4039[_0x9c667(0xaf)]+'%');}}}function progressBar(_0x451087){const _0x1c93ec=a55_0x347ad1,_0x669c69=0x14,_0x59adf8=Math[_0x1c93ec(0x98)](_0x451087/0x64*_0x669c69),_0x3dd3e8=_0x669c69-_0x59adf8;return chalk[_0x1c93ec(0xbc)]('█'[_0x1c93ec(0x95)](_0x59adf8))+chalk[_0x1c93ec(0xa7)]('░'[_0x1c93ec(0x95)](_0x3dd3e8));}export async function workInitAction(_0x3c84cf,_0x324bab){const _0x31714d=a55_0x347ad1,_0x2f3d90=_0x3c84cf||a55_0xf1f5bf[_0x31714d(0xb9)](process[_0x31714d(0x87)]());if(_0x324bab[_0x31714d(0xcb)]){const _0x5218d7=WorkspaceSDK[_0x31714d(0xd6)](_0x2f3d90,{'github':_0x324bab['github']});console['log'](chalk[_0x31714d(0xbc)](_0x31714d(0x9f))+'\x20'+_0x5218d7[_0x31714d(0xbb)]),console[_0x31714d(0xb0)](chalk['dim']('Linked\x20to\x20GitHub:\x20'+_0x324bab[_0x31714d(0xcb)]));}else{if(_0x3c84cf){const _0x2f9447=WorkspaceSDK[_0x31714d(0xd6)](_0x3c84cf);console[_0x31714d(0xb0)](chalk[_0x31714d(0xbc)]('Workspace\x20initialized:')+'\x20'+_0x2f9447[_0x31714d(0xbb)]);}else{const _0x3a39b7=new WorkspaceSDK(process[_0x31714d(0x87)]());_0x3a39b7[_0x31714d(0x92)](_0x2f3d90),console[_0x31714d(0xb0)](chalk[_0x31714d(0xbc)](_0x31714d(0x9e)));}}}export async function workNewAction(_0x49cede,_0x481c77){const _0x51585f=a55_0x347ad1,_0x2d2a3d=getSDK(),_0xea776=_0x481c77[_0x51585f(0xbd)]||_0x51585f(0xa6);!VALID_KINDS[_0x51585f(0xa5)](_0xea776)&&(console[_0x51585f(0xc6)](chalk['red'](_0x51585f(0xc8)+_0xea776+_0x51585f(0xe1)+[...VALID_KINDS][_0x51585f(0xdd)](',\x20'))),process[_0x51585f(0xea)](0x1));_0x481c77[_0x51585f(0xcf)]&&!VALID_PRIORITIES['has'](_0x481c77['priority'])&&(console[_0x51585f(0xc6)](chalk[_0x51585f(0xe3)]('Invalid\x20priority:\x20'+_0x481c77['priority']+'.\x20Valid:\x20'+[...VALID_PRIORITIES]['join'](',\x20'))),process[_0x51585f(0xea)](0x1));_0x481c77[_0x51585f(0xe4)]&&!VALID_STATUSES[_0x51585f(0xa5)](_0x481c77[_0x51585f(0xe4)])&&(console[_0x51585f(0xc6)](chalk[_0x51585f(0xe3)](_0x51585f(0xd3)+_0x481c77[_0x51585f(0xe4)]+_0x51585f(0xe1)+[...VALID_STATUSES][_0x51585f(0xdd)](',\x20'))),process['exit'](0x1));const _0x220c97=_0x481c77[_0x51585f(0xbf)]?_0x481c77[_0x51585f(0xbf)]['split'](',')[_0x51585f(0xd8)](_0x49574d=>_0x49574d['trim']()):undefined,_0x1a2bb0=_0x2d2a3d[_0x51585f(0xa2)]({'title':_0x49cede,'kind':_0xea776,'tags':_0x220c97,'priority':_0x481c77[_0x51585f(0xcf)],'body':_0x481c77['body'],'template':_0x481c77[_0x51585f(0xeb)],'status':_0x481c77['status'],'assignee':_0x481c77[_0x51585f(0x88)]});console[_0x51585f(0xb0)](chalk['green'](_0x51585f(0xa4))+'\x20'+_0x1a2bb0[_0x51585f(0xdb)]),console[_0x51585f(0xb0)](chalk[_0x51585f(0xa7)](_0x1a2bb0[_0x51585f(0xc3)]));}export async function workMoveAction(_0x22bbcd,_0x372884){const _0x5d4bbc=a55_0x347ad1;!VALID_STATUSES[_0x5d4bbc(0xa5)](_0x372884)&&(console[_0x5d4bbc(0xc6)](chalk[_0x5d4bbc(0xe3)](_0x5d4bbc(0xd3)+_0x372884+_0x5d4bbc(0xe1)+[...VALID_STATUSES]['join'](',\x20'))),process[_0x5d4bbc(0xea)](0x1));const _0x5ab213=getSDK(),_0x143e59=_0x5ab213['moveTask'](_0x22bbcd,_0x372884);!_0x143e59&&(console['error'](chalk[_0x5d4bbc(0xe3)](_0x5d4bbc(0xa9)+_0x22bbcd)),process[_0x5d4bbc(0xea)](0x1));const _0x2444b8=_0x143e59['frontmatter'][_0x5d4bbc(0x8f)]||_0x143e59[_0x5d4bbc(0xdb)];console['log'](chalk[_0x5d4bbc(0xbc)](_0x5d4bbc(0xaa))+('\x20'+_0x2444b8+_0x5d4bbc(0xce)+statusColor(_0x372884)));}export async function workBoardAction(_0x19f344){const _0xc142c8=a55_0x347ad1,_0x1dbc64=getSDK(),_0x6910=buildStaleFilter(_0x19f344),{grouped:_0x5d27e1}=_0x1dbc64[_0xc142c8(0x9d)](_0x6910);for(const [_0x5d37fb,_0x51cf9d]of Object[_0xc142c8(0xca)](STATUS_PHASES)){const _0x364868=_0x51cf9d[_0xc142c8(0xbe)](_0x2f9c51=>_0x5d27e1[_0x2f9c51]||[]);console[_0xc142c8(0xb0)](chalk[_0xc142c8(0x8d)][_0xc142c8(0x9c)](_0x5d37fb)+chalk['dim']('\x20('+_0x364868['length']+')'));if(_0x364868[_0xc142c8(0xb1)]===0x0)console[_0xc142c8(0xb0)](chalk['dim'](_0xc142c8(0xb8)));else for(const _0x15ae41 of _0x364868){const _0x303b92=_0x15ae41[_0xc142c8(0xd1)],_0x4d0266=priorityDot(_0x303b92[_0xc142c8(0xcf)]),_0x2f9085=_0x303b92['title']||_0x15ae41[_0xc142c8(0xdb)],_0x4296fc=normalizeTags(_0x303b92[_0xc142c8(0xbf)]),_0x206a0d=_0x4296fc['length']?chalk[_0xc142c8(0xa7)]('\x20['+_0x4296fc[_0xc142c8(0xdd)](',\x20')+']'):'',_0x4629c4=chalk['dim']('('+_0x303b92[_0xc142c8(0xe4)]+')');console['log']('\x20\x20'+_0x4d0266+'\x20'+_0x2f9085+'\x20'+_0x4629c4+_0x206a0d);}console[_0xc142c8(0xb0)]();}}export async function workShowAction(_0x3b0f1e){const _0x26a462=a55_0x347ad1,_0x10b47e=getSDK(),_0x2bce21=_0x10b47e[_0x26a462(0xae)](_0x3b0f1e);!_0x2bce21&&(console['error'](chalk[_0x26a462(0xe3)](_0x26a462(0xa9)+_0x3b0f1e)),process[_0x26a462(0xea)](0x1));console[_0x26a462(0xb0)](chalk[_0x26a462(0x8d)](_0x2bce21[_0x26a462(0xd1)]['title']||_0x2bce21[_0x26a462(0xdb)])),console['log'](chalk[_0x26a462(0xa7)](_0x2bce21[_0x26a462(0xc3)])),console[_0x26a462(0xb0)]();const _0x35f52a=_0x2bce21[_0x26a462(0xd1)];for(const [_0x54b0d0,_0x1c7663]of Object[_0x26a462(0xca)](_0x35f52a)){if(_0x54b0d0===_0x26a462(0x8f))continue;if(_0x1c7663===undefined||_0x1c7663===null)continue;const _0x3afa7e=Array[_0x26a462(0xcc)](_0x1c7663)?_0x1c7663[_0x26a462(0xdd)](',\x20'):String(_0x1c7663);console[_0x26a462(0xb0)]('\x20\x20'+chalk[_0x26a462(0x99)](_0x54b0d0)+':\x20'+_0x3afa7e);}console['log']();_0x2bce21[_0x26a462(0xe2)][_0x26a462(0xd2)]()&&(console[_0x26a462(0xb0)](_0x2bce21[_0x26a462(0xe2)][_0x26a462(0xd2)]()),console[_0x26a462(0xb0)]());const _0x1e0d3a=_0x10b47e['resolveWikiLinks'](_0x2bce21[_0x26a462(0xe2)]);if(_0x1e0d3a[_0x26a462(0xb1)]>0x0){console['log'](chalk[_0x26a462(0x8d)](_0x26a462(0x9b)));for(const _0x2af0b5 of _0x1e0d3a){const _0x53bd89=_0x2af0b5['resolvedPath']?chalk[_0x26a462(0xbc)]('✓'):chalk['red']('✗'),_0x5687d0=_0x2af0b5['displayText']||_0x2af0b5[_0x26a462(0xd7)];console[_0x26a462(0xb0)]('\x20\x20'+_0x53bd89+_0x26a462(0x8a)+_0x5687d0+']]');}console[_0x26a462(0xb0)]();}const _0x410a11=_0x10b47e[_0x26a462(0xac)](_0x2bce21[_0x26a462(0xdb)]);if(_0x410a11[_0x26a462(0xb1)]>0x0){console[_0x26a462(0xb0)](chalk[_0x26a462(0x8d)](_0x26a462(0xab)));for(const _0x16817b of _0x410a11){console[_0x26a462(0xb0)]('\x20\x20←\x20'+_0x16817b['title']+'\x20'+chalk[_0x26a462(0xa7)]('('+_0x16817b[_0x26a462(0xbd)]+')'));}}}export async function workLinksAction(_0x31ca0f){const _0x29cf17=a55_0x347ad1,_0x352b9e=getSDK(),_0x450586=_0x352b9e['readDocument'](_0x31ca0f);!_0x450586&&(console[_0x29cf17(0xc6)](chalk[_0x29cf17(0xe3)](_0x29cf17(0xa9)+_0x31ca0f)),process[_0x29cf17(0xea)](0x1));const _0xfe060d=_0x450586['frontmatter']['title']||_0x450586[_0x29cf17(0xdb)];console['log'](chalk[_0x29cf17(0x8d)](_0x29cf17(0xec)+_0xfe060d)),console['log']();const _0x3b2a90=_0x352b9e[_0x29cf17(0xb4)](_0x450586[_0x29cf17(0xe2)]);if(_0x3b2a90[_0x29cf17(0xb1)]>0x0){console[_0x29cf17(0xb0)](chalk['bold']('Outgoing'));for(const _0x2a31b3 of _0x3b2a90){const _0x25222c=_0x2a31b3[_0x29cf17(0xcd)]?chalk['green']('✓'):chalk['red']('✗'),_0x52e57f=_0x2a31b3[_0x29cf17(0xd0)]||_0x2a31b3[_0x29cf17(0xd7)],_0x5ad312=_0x2a31b3[_0x29cf17(0xdf)]?chalk[_0x29cf17(0xa7)]('\x20('+_0x2a31b3[_0x29cf17(0xdf)]+')'):'';console[_0x29cf17(0xb0)]('\x20\x20'+_0x25222c+_0x29cf17(0x8a)+_0x52e57f+']]'+_0x5ad312);}}else console[_0x29cf17(0xb0)](chalk[_0x29cf17(0xa7)](_0x29cf17(0xa1)));console[_0x29cf17(0xb0)]();const _0x54d10d=_0x352b9e[_0x29cf17(0xac)](_0x450586[_0x29cf17(0xdb)]);if(_0x54d10d['length']>0x0){console[_0x29cf17(0xb0)](chalk[_0x29cf17(0x8d)](_0x29cf17(0xa8)));for(const _0x46af4f of _0x54d10d){console['log'](_0x29cf17(0x8e)+_0x46af4f[_0x29cf17(0x8f)]+'\x20'+chalk['dim']('('+_0x46af4f[_0x29cf17(0xbd)]+')'));}}else console[_0x29cf17(0xb0)](chalk[_0x29cf17(0xa7)](_0x29cf17(0xb7)));}export async function workOpenAction(_0x2d7913){const _0x1bc6da=a55_0x347ad1,_0x6eff3a=getSDK(),_0x3ad75d=_0x6eff3a[_0x1bc6da(0xae)](_0x2d7913);!_0x3ad75d&&(console[_0x1bc6da(0xc6)](chalk[_0x1bc6da(0xe3)](_0x1bc6da(0xa9)+_0x2d7913)),process[_0x1bc6da(0xea)](0x1));const _0x3e136c=process.env.EDITOR||'vi';try{execFileSync(_0x3e136c,[_0x3ad75d['filePath']],{'stdio':_0x1bc6da(0x86)});}catch{console[_0x1bc6da(0xc6)](chalk['red'](_0x1bc6da(0xc1)+_0x3e136c)),process[_0x1bc6da(0xea)](0x1);}}
@@ -1 +1 @@
1
- const a55_0x5029cc=a55_0x5cbb;(function(_0x50a2b9,_0x5b0b85){const _0x2b57cf=a55_0x5cbb,_0x4c6662=_0x50a2b9();while(!![]){try{const _0x5822ae=-parseInt(_0x2b57cf(0xcf))/0x1+-parseInt(_0x2b57cf(0x1f7))/0x2*(parseInt(_0x2b57cf(0x182))/0x3)+parseInt(_0x2b57cf(0x21c))/0x4+parseInt(_0x2b57cf(0x265))/0x5+parseInt(_0x2b57cf(0x143))/0x6+-parseInt(_0x2b57cf(0x131))/0x7*(parseInt(_0x2b57cf(0x22d))/0x8)+parseInt(_0x2b57cf(0xa5))/0x9;if(_0x5822ae===_0x5b0b85)break;else _0x4c6662['push'](_0x4c6662['shift']());}catch(_0x232a1b){_0x4c6662['push'](_0x4c6662['shift']());}}}(a55_0x4d42,0x4d280));import a55_0x47a174 from'chalk';import{existsSync}from'fs';import a55_0x4d0954 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import{parseTaskGraph,formatTaskGraph,summarizeTaskGraph,formatWarningSummary}from'../sdk/workflow/task-graph.js';import a55_0x110a93 from'prompts';function getAttemptStatusDisplay(_0x4bf490){const _0x537d00=a55_0x5cbb;if(!_0x4bf490)return{'icon':'⏳','text':''};const {done:_0x4d234f,success:_0x56deb8,cancelRequested:_0x4263a8}=_0x4bf490;if(!_0x4d234f)return _0x4263a8?{'icon':'🛑','text':a55_0x47a174[_0x537d00(0x175)](_0x537d00(0x185))}:{'icon':'🔄','text':a55_0x47a174[_0x537d00(0x117)](_0x537d00(0x97))};if(_0x56deb8)return{'icon':'✅','text':a55_0x47a174[_0x537d00(0x1de)](_0x537d00(0x1ca))};return{'icon':'❌','text':a55_0x47a174[_0x537d00(0x25a)](_0x537d00(0x19c))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x29696e,_0x1ea2d2,_0xa02e17=0x0){const _0x1466a3=a55_0x5cbb;return _0x29696e[_0xa02e17]||_0x1ea2d2[_0x1466a3(0x149)];}[a55_0x5029cc(0x1e3)](_0x4a351f,_0x427b80,_0xc2c97e=0x0){const _0x325b58=a55_0x5029cc,_0x5ade24=this[_0x325b58(0xd7)](_0x4a351f,_0x427b80,_0xc2c97e);if(!_0x5ade24)return console[_0x325b58(0x19c)](a55_0x47a174['red']('Error:'),_0x325b58(0xfa)),console['error'](a55_0x47a174['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x5ade24;}[a55_0x5029cc(0x1e1)](_0x3281d4,_0x2a5c73){const _0x4360fc=a55_0x5029cc;if(_0x3281d4[0x0]){const _0x54473d=_0x3281d4[0x0][_0x4360fc(0x12e)]('.');if(_0x54473d[_0x4360fc(0x1d7)]===0x1)return{'projectName':_0x54473d[0x0],'workflowName':undefined};else return _0x54473d[_0x4360fc(0x1d7)]===0x2?{'projectName':_0x54473d[0x0],'workflowName':_0x54473d[0x1]}:(console[_0x4360fc(0x19c)](a55_0x47a174[_0x4360fc(0x25a)](_0x4360fc(0x25b)),_0x4360fc(0x181)),null);}return{'projectName':_0x2a5c73[_0x4360fc(0x149)],'workflowName':undefined};}[a55_0x5029cc(0x13e)](_0x2c6bc3,_0x37ac53,_0xefcafc=0x0){const _0x33fe2f=a55_0x5029cc;if(_0x2c6bc3[_0xefcafc])return _0x2c6bc3[_0xefcafc];if(_0x37ac53[_0x33fe2f(0x149)]){const _0x3bf7f2=a55_0x4d0954[_0x33fe2f(0x1a6)](process[_0x33fe2f(0x20b)](),_0x33fe2f(0x204),_0x37ac53[_0x33fe2f(0x149)]);if(existsSync(a55_0x4d0954[_0x33fe2f(0x1a6)](_0x3bf7f2,_0x33fe2f(0xa7))))return _0x3bf7f2;}return undefined;}async[a55_0x5029cc(0xd3)](_0x1b31a5,_0x23931f,_0x1168ad){const _0x2aedbb=a55_0x5029cc;try{const _0x44f023=await _0x1b31a5[_0x2aedbb(0x1f9)][_0x2aedbb(0x204)](_0x23931f,{'limit':0x1});if(_0x44f023['length']>0x0){const _0x3310ea=_0x44f023[0x0]['id'],_0x72b4b3=getWorkflowUrl(_0x1168ad,_0x3310ea);console[_0x2aedbb(0x19c)](_0x2aedbb(0x1fb)+a55_0x47a174['cyan'](_0x72b4b3));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a55_0x5029cc(0x1c3);['description']='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a55_0x5029cc(0x196)](_0x2339a3){const _0x5a16f6=a55_0x5029cc,{options:_0x17aa7a,args:_0xd44a66,tdx:_0x1d6057}=_0x2339a3,_0x1c5c15=_0xd44a66[0x0],_0x1885df=_0x17aa7a[_0x5a16f6(0x189)];if(_0x1885df)return saveSessionContext({'workflow_project':undefined},_0x17aa7a[_0x5a16f6(0x1a2)]),console[_0x5a16f6(0x241)](a55_0x47a174[_0x5a16f6(0x1de)](_0x5a16f6(0x128))),0x0;if(!_0x1c5c15)return console['error'](a55_0x47a174['red'](_0x5a16f6(0x25b)),_0x5a16f6(0xfa)),console['error'](a55_0x47a174['dim'](_0x5a16f6(0x191))),console[_0x5a16f6(0x19c)](a55_0x47a174[_0x5a16f6(0x225)](_0x5a16f6(0x247))),0x1;const _0x33d826=await withSpinner(_0x5a16f6(0xe3)+_0x1c5c15+_0x5a16f6(0xf3),()=>_0x1d6057[_0x5a16f6(0x1f9)][_0x5a16f6(0x203)](_0x1c5c15),{'verbose':_0x17aa7a[_0x5a16f6(0x1af)]}),{name:_0x1e38a5}=_0x33d826[_0x5a16f6(0x1a8)];return saveSessionContext({'workflow_project':_0x1e38a5},_0x17aa7a[_0x5a16f6(0x1a2)]),console[_0x5a16f6(0x241)](a55_0x47a174[_0x5a16f6(0x1de)](_0x5a16f6(0x18d)+a55_0x47a174[_0x5a16f6(0x138)](_0x1e38a5))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a55_0x5029cc(0x260)]=a55_0x5029cc(0x222);[a55_0x5029cc(0x1ee)]=a55_0x5029cc(0x25c);async['execute'](_0x3fd2ca){const _0x4e6b28=a55_0x5029cc,{options:_0x5afb1b,args:_0x50ebc2,tdx:_0x5086a9}=_0x3fd2ca,_0x4a5827=_0x50ebc2[0x0];_0x5afb1b[_0x4e6b28(0x1af)]&&_0x4a5827&&console[_0x4e6b28(0x19c)](_0x4e6b28(0x142)+_0x4a5827);const _0x1e9ce0=await withSpinner(_0x4e6b28(0xbc),()=>_0x5086a9[_0x4e6b28(0x1f9)][_0x4e6b28(0xb9)](_0x4a5827,{'limit':_0x5afb1b[_0x4e6b28(0x1ec)]}),{'verbose':_0x5afb1b[_0x4e6b28(0x1af)]});let _0x334d80=_0x1e9ce0['data'];_0x334d80[_0x4e6b28(0xba)]((_0x69255c,_0x138c4c)=>_0x69255c['name'][_0x4e6b28(0xa8)](_0x138c4c[_0x4e6b28(0x260)]));const _0x53df40=_0x5afb1b[_0x4e6b28(0x1ec)]&&_0x334d80[_0x4e6b28(0x1d7)]>=_0x5afb1b[_0x4e6b28(0x1ec)]?a55_0x47a174[_0x4e6b28(0x225)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x4e6b28(0x19c)](_0x4e6b28(0xd4)+_0x334d80[_0x4e6b28(0x1d7)]+'\x20project'+(_0x334d80[_0x4e6b28(0x1d7)]!==0x1?'s':'')+_0x53df40);if(_0x5afb1b[_0x4e6b28(0xd1)]===_0x4e6b28(0xce)||_0x5afb1b[_0x4e6b28(0xd1)]===_0x4e6b28(0xf9)||_0x5afb1b[_0x4e6b28(0xd1)]==='table')await handleSDKOutput(_0x334d80,_0x5afb1b);else{if(_0x334d80[_0x4e6b28(0x1d7)]===0x0)_0x4a5827?console[_0x4e6b28(0x241)](_0x4e6b28(0xe1)+_0x4a5827):console['log'](_0x4e6b28(0x232));else{const _0x44b855=_0x334d80[_0x4e6b28(0x14d)](_0x2d9df6=>{const _0x97d7e3=_0x4e6b28,_0x963bc=_0x2d9df6[_0x97d7e3(0xcc)]?.[_0x97d7e3(0x22e)](_0x1b1641=>_0x1b1641[_0x97d7e3(0x114)]===_0x97d7e3(0x1ea)),_0x3fea7a=_0x963bc?a55_0x47a174[_0x97d7e3(0x225)](_0x97d7e3(0x19b)):'';return _0x97d7e3(0x254)+_0x2d9df6[_0x97d7e3(0x260)]+_0x3fea7a;});await writeOutput(_0x44b855[_0x4e6b28(0x1a6)]('\x0a'),_0x5afb1b[_0x4e6b28(0x1e7)],_0x4e6b28(0x210));}}return 0x0;}}function a55_0x4d42(){const _0x25b87f=['\x20(disabled)','Usage:\x20tdx\x20wf\x20use\x20<project>','sourceProjectName','No\x20sessions\x20with\x20timing\x20information','resolve','\x20\x20Next\x20run:\x20','execute','📋\x20','stringify','✔\x20Showing\x20','Invalid\x20format:\x20','\x20(system)','error','Params:\x20','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Status:\x20','\x20logs','session','follow','Disabling\x20schedule\x20#','\x20has\x20no\x20attempts','join','changes','data','all','LABEL_WIDTH_DIVISOR','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','sourceDir','indexOf','\x20\x20Session\x20context\x20set\x20to:\x20','verbose','slice','white','Cloning\x20to\x20','Total:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','ICON_WIDTH','attempts','unchanged','Writing\x20files...','workflow:run','\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)','existingProjectId','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','projectName','targetDir','padStart','project','from','workflow:use','No\x20sessions\x20found','\x20disabled\x20(','workflow:attempts','splice','No\x20sessions\x20found\x20in\x20project:\x20','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','success','Killing\x20attempt...','Task\x20graph:','\x20\x20Project\x20ID:\x20','No\x20schedules\x20found','resumeFrom','preparePushProject','MAX_TASKS_DISPLAY','\x20tasks','✔\x20Workflow\x20run\x20started','Retrying\x20session...','getHours','\x20task','length','Parameters:','Schedule\x20ID\x20is\x20required','unknown','Deleting\x20project\x20','getSchedule','params','green','find','targetExists','parseProjectWorkflowPattern','renderTimeline','requireProject','\x20secret','MAX_LABEL_COUNT','getWorkflow','output','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','sys','trimEnd','limit','workflow:attempt','description','No\x20attempts\x20found\x20in\x20project:\x20','Workflow:','Force:\x20yes','\x0aFailed\x20to\x20fetch\x20attempt\x20data','\x20modified','hasChanges','Listing\x20workflow\x20attempts...','workflow:secrets:list','250qetTFX','finishedAt','workflow','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','\x20\x20Console:\x20','From\x20task:\x20','Fetching\x20schedule\x20#','relative','\x0aError:','✔\x20Pushed\x20','projectId','✔\x20Pull\x20complete','resolveProjectId','workflows','Getting\x20attempt\x20tasks...','message','retryAttemptName','workflow:secrets:delete','Workflow:\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','cwd','Fetching\x20log\x20files...','table','workflow:pull','.\x20Expected\x20format:\x20KEY=VALUE','list','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','icon','No\x20sessions\x20found\x20for:\x20','modified','\x20\x20Location:\x20','\x20\x20New\x20attempt\x20ID:\x20','context','Key:\x20','Select\x20a\x20task\x20to\x20view\x20logs:','duration','✔\x20Downloaded\x20','1207952yyNvmr','workflow:schedule:disable','session:','nextRunTime','workflow:kill','push','workflow:projects','displayLine','autocomplete','dim','min','⚠\x20Showing\x20first\x20','Validation:\x20skipped','List\x20workflows','Auto-selected\x20latest\x20session:\x20','\x20unchanged','getTime','744WbQkZj','some','replace','\x20sessions\x20','planned','No\x20workflow\x20projects\x20found','/sessions/','...','select','Error:\x20Attempt\x20ID\x20is\x20required','\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.','Session\x20time:\x20','📅\x20#','Target\x20directory:\x20','Error:\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','index','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20AI','fileCount','/app/workflows/','log','enableSchedule','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','No\x20workflow\x20sessions\x20found','getMonth','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Using\x20attempt\x20','revision:\x20','task','Project:\x20','session_id','Pull\x20workflow\x20project\x20to\x20local\x20folder','---\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','fullName','\x20\x20Session\x20ID:\x20','\x20workflow','\x0aDry\x20run\x20-\x20nothing\x20pushed','📁\x20','startTime','Include\x20retried:\x20yes','stat','✔\x20Push\x20complete','attemptId','red','Error:','List\x20all\x20workflow\x20projects','fileSize','Source\x20directory\x20is\x20required','executeDryRun','name','size','yes','ICON_SPACING','\x20(use\x20--limit\x20to\x20show\x20more)','1136705iwWdbq','Disable\x20a\x20workflow\x20schedule','\x20attempt','\x20\x20Files\x20extracted:\x20','\x20\x20Revision:\x20','🔄\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','List\x20workflow\x20attempts','retryAttempt','revision','isNewProject','kill','Failed\x20to\x20fetch\x20attempt\x20data','LABEL_MIN_SPACING','basename','Pushing\x20workflow\x20project...','✔\x20Schedule\x20found','Source\x20directory:\x20','status','\x20of\x20','\x0aClone\x20\x22','MIN_LABEL_COUNT','Attempt\x20ID:\x20','fs/promises','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Filter:\x20','parse','running','disabledAt','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','site','MAX_POLL_ITERATIONS','start','\x20\x20Source:\x20','workflow:schedule:enable','force','getMinutes','Listing\x20secrets...','Error:\x20Secret\x20key\x20is\x20required','text','No\x20workflow\x20tdx.json\x20found','6777702baGvOX','dryRun','tdx.json','localeCompare','lastAttempt','bold','repeat','floor','sessions','Loading\x20session...','filter','Error:\x20Invalid\x20parameter\x20format:\x20','workflow:retry','end','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x20enabled\x20(','keys','Kill\x20a\x20running\x20attempt','\x20secrets...','projects','sort','Retry\x20a\x20session\x20or\x20attempt','Listing\x20workflow\x20projects...','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','✔\x20Project\x20updated','Listing\x20schedules...','Deleting\x20secret...','tasks','write','\x22\x20already\x20exists\x20(ID:\x20','Revision:\x20','rows','Pushing\x20project...','attempt:','\x0aApply\x20these\x20changes?','→\x20Project:\x20','Source\x20project:\x20','Resume\x20from:\x20','metadata','attempt','json','462107KqpzPU','Project\x20filter:\x20','format','workflow:tasks','showWorkflowConsoleUrl','✔\x20Found\x20','(unknown)','nextTime','resolveProject','listProjectSchedules','reason','pending','isDirectory','(use\x20--limit\x20to\x20see\x20more)',',\x20Workflow:\x20','done','includes','\x20\x20tdx\x20wf\x20use\x20<project>','No\x20projects\x20match\x20pattern:\x20','listSecrets','Resolving\x20project\x20\x27','Select\x20a\x20workflow\x20to\x20run','toISOString','✔\x20Secret\x20\x27','Filter:\x20project=','Setting\x20','startedAt','Downloading\x20logs...','renderSingleTimeline','Attempt:\x20','/attempt/','includeSubtasks','Starting\x20workflow\x20run...','\x20next:\x20','sessionTime','\x20new','\x27...','every','round','newProjectName','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','workflow:workflows','jsonl','Project\x20name\x20is\x20required','\x0a⚠\x20Project\x20\x22','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','skipValidation','get','delete','path','\x20\x20Workflow:\x20','retrySession','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Key\x20cannot\x20be\x20empty','Retrying\x20attempt...','generateSessionTimelineRows','Analyzing\x20changes...','-\x20no\x20files\x20written','title','\x20-\x20','stdout','→\x20New\x20project:\x20','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','match','Usage:\x20tdx\x20wf\x20schedule\x20list\x20[project[.workflow]]\x20|\x20--schedule-id\x20<id>','applyPullProject','key','\x0aPush\x20these\x20changes?','Expected\x20format:\x20--param\x20key=value','blue','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','max','type','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Dry\x20run:\x20yes','getFullYear','value','state','Updating\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Latest\x20session\x20has\x20no\x20attempt','createdAt','taskName','\x20(use\x20a\x20larger\x20--limit\x20to\x20show\x20more)','\x20from\x20session\x20','columns','✔\x20Workflow\x20project\x20context\x20cleared.','\x22\x20to\x20new\x20project\x20\x22','summary','workflow:sessions','download','TASK_NAME_WIDTH','split','\x20\x20Project:\x20','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','33999qYFGcr','Error:\x20Invalid\x20JSON\x20in\x20--params','updatedAt','No\x20attempts\x20found','\x20\x20Target:\x20','new','workflow:schedules','cyan','✔\x20Schedule\x20#','pollTimeline','workflowName','Project\x20directory:\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','resolveProjectDir','now','group_error','Pulling\x20project\x20','Pattern:\x20','2946348WANAcG','startsWith','navigateSessionsInteractive','\x20\x20Attempt\x20ID:\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','\x20deleted','workflowProject','Usage:\x20workflow:delete\x20<project-name-or-id>','✔\x20Retry\x20started','No\x20attempts\x20found\x20for:\x20','map','\x27\x20from\x20project\x20\x27','Show\x20specific\x20attempt\x20details','workflow:download','Listing\x20workflows...','logs','cancelRequested','pullProject','List\x20workflow\x20execution\x20sessions','fill','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','utf-8','Select\x20a\x20session\x20to\x20view\x20timeline:','isTTY','workflow:upload','workflow:secrets:set','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','executeCloneProject','buildTimelineData','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','New\x20project\x20name:\x20','toLowerCase','Cancelled','includeRetried','tdx\x20wf\x20attempt\x20','set','MAX_TIMELINE_WIDTH','has','total','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Warning:','Secrets\x20to\x20set:\x20','readFile','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','deleted','workflow:delete','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Error:\x20Project\x20name\x20is\x20required','Reason:\x20','renderSessionsTimeline','yellow','executePushProject','MIN_TIMELINE_WIDTH','\x1b[1A\x1b[2K','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20AI','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','Loading\x20sessions...','substring','workflow:timeline','config','Downloading\x20project\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','13047VObMsp','Source:\x20','sessionId','canceling','\x0aUpdate\x20existing\x20project\x20\x22','Tip:\x20cd\x20to\x20workflows/','window','clear','values','--schedule-id\x20cannot\x20be\x20combined\x20with\x20a\x20project.workflow\x20filter','diff','✔\x20Workflow\x20project\x20set\x20to:\x20','-\x20nothing\x20pushed','getDate'];a55_0x4d42=function(){return _0x25b87f;};return a55_0x4d42();}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a55_0x5029cc(0x260)]=a55_0x5029cc(0xf8);[a55_0x5029cc(0x1ee)]=a55_0x5029cc(0x229);async[a55_0x5029cc(0x196)](_0x54b656){const _0x475807=a55_0x5029cc,{options:_0x5dd604,args:_0x14b8dd,tdx:_0x278bf4}=_0x54b656,_0x968bba=this['resolveProject'](_0x14b8dd,_0x5dd604);_0x5dd604[_0x475807(0x1af)]&&_0x968bba&&console[_0x475807(0x19c)](_0x475807(0xd0)+_0x968bba);const _0x1b965e=await withSpinner(_0x475807(0x151),()=>_0x278bf4[_0x475807(0x1f9)][_0x475807(0x204)](_0x968bba,{'limit':_0x5dd604[_0x475807(0x1ec)]}),{'verbose':_0x5dd604['verbose']});let _0x253541=_0x1b965e[_0x475807(0x1a8)];_0x253541[_0x475807(0xba)]((_0x127f5a,_0x1aa919)=>{const _0x2f5765=_0x475807,_0x9af58e=_0x127f5a[_0x2f5765(0x260)][_0x2f5765(0xa8)](_0x1aa919[_0x2f5765(0x260)]);if(_0x9af58e!==0x0)return _0x9af58e;return(_0x127f5a[_0x2f5765(0x1c1)]?.[_0x2f5765(0x260)]||'')[_0x2f5765(0xa8)](_0x1aa919[_0x2f5765(0x1c1)]?.[_0x2f5765(0x260)]||'');});const _0x34bd01=_0x5dd604[_0x475807(0x1ec)]&&_0x253541[_0x475807(0x1d7)]>=_0x5dd604['limit']?a55_0x47a174['dim'](_0x475807(0x264)):'';console[_0x475807(0x19c)](_0x475807(0xd4)+_0x253541[_0x475807(0x1d7)]+_0x475807(0x252)+(_0x253541[_0x475807(0x1d7)]!==0x1?'s':'')+_0x34bd01);if(_0x5dd604[_0x475807(0xd1)]===_0x475807(0xce)||_0x5dd604[_0x475807(0xd1)]===_0x475807(0xf9)||_0x5dd604[_0x475807(0xd1)]===_0x475807(0x20d))await handleSDKOutput(_0x253541,_0x5dd604);else{if(_0x253541[_0x475807(0x1d7)]===0x0)_0x968bba?console['log']('No\x20workflows\x20found\x20in\x20project:\x20'+_0x968bba):console[_0x475807(0x241)]('No\x20workflows\x20found');else{const _0x57354a=_0x5dd604[_0x475807(0x9a)],_0x5d2b71=_0x253541[_0x475807(0x14d)](_0x451232=>{const _0x3bdd09=_0x475807,_0x38d8c0=a55_0x47a174[_0x3bdd09(0x225)]('#'+_0x451232['id']),_0x12de19=hyperlink(_0x38d8c0,getWorkflowUrl(_0x57354a,_0x451232['id'])),_0x2d3466=_0x451232[_0x3bdd09(0x1c1)]?.[_0x3bdd09(0x260)]?a55_0x47a174['dim']('\x20('+_0x451232[_0x3bdd09(0x1c1)]['name']+')'):'';return _0x3bdd09(0x197)+_0x12de19+'\x20'+_0x451232[_0x3bdd09(0x260)]+_0x2d3466;});await writeOutput(_0x5d2b71[_0x475807(0x1a6)]('\x0a'),_0x5dd604[_0x475807(0x1e7)],_0x475807(0x210));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a55_0x5029cc(0x260)]=a55_0x5029cc(0x12b);[a55_0x5029cc(0x1ee)]=a55_0x5029cc(0x155);async[a55_0x5029cc(0x196)](_0x343d9d){const _0x55caed=a55_0x5029cc,{options:_0x158bbe,args:_0xe60897,tdx:_0x307f2e}=_0x343d9d,_0x2b4ce0=this[_0x55caed(0x1e1)](_0xe60897,_0x158bbe);if(!_0x2b4ce0)return 0x1;const {projectName:_0x3f0461,workflowName:_0x17b5eb}=_0x2b4ce0;if(_0x158bbe[_0x55caed(0x1af)]){if(_0x3f0461&&_0x17b5eb)console[_0x55caed(0x19c)](_0x55caed(0x95)+_0x3f0461+'.'+_0x17b5eb);else _0x3f0461&&console[_0x55caed(0x19c)](_0x55caed(0xe7)+_0x3f0461);const _0x4fc0cf=_0x158bbe['status'];_0x4fc0cf&&console[_0x55caed(0x19c)](_0x55caed(0x1a0)+_0x4fc0cf);}let _0x258a64=0x28;if(process[_0x55caed(0x10d)][_0x55caed(0x15a)]&&!_0x158bbe['output']&&!_0x158bbe[_0x55caed(0xd1)]){const _0x2e7cc8=process[_0x55caed(0x10d)][_0x55caed(0xc5)]||0x28;_0x258a64=Math['max'](0x14,Math['floor'](_0x2e7cc8*0x2/0x3));}const _0x5f1876=_0x158bbe[_0x55caed(0x1ec)]||_0x258a64,_0x578055=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x307f2e[_0x55caed(0x1f9)][_0x55caed(0xad)]({'projectName':_0x3f0461,'workflowName':_0x17b5eb,'status':_0x158bbe[_0x55caed(0x8e)],'fromTime':_0x158bbe[_0x55caed(0x1c2)],'toTime':_0x158bbe['to'],'limit':_0x5f1876}),{'verbose':_0x158bbe[_0x55caed(0x1af)]}),_0x252848=_0x578055[_0x55caed(0x1a8)];_0x252848[_0x55caed(0xba)]((_0x447175,_0x651474)=>{const _0x412bba=_0x55caed,_0x1fca41=_0x447175['sessionTime']||'',_0x5583f5=_0x651474['sessionTime']||'';return _0x5583f5[_0x412bba(0xa8)](_0x1fca41);});_0x252848['length']>=_0x5f1876?console[_0x55caed(0x19c)](_0x55caed(0x199)+_0x252848[_0x55caed(0x1d7)]+_0x55caed(0x230)+a55_0x47a174[_0x55caed(0x225)](_0x55caed(0xdc))):console[_0x55caed(0x19c)](_0x55caed(0xd4)+_0x252848[_0x55caed(0x1d7)]+'\x20session'+(_0x252848[_0x55caed(0x1d7)]!==0x1?'s':''));if(_0x158bbe['format']===_0x55caed(0xce)||_0x158bbe[_0x55caed(0xd1)]===_0x55caed(0xf9)||_0x158bbe['format']==='table')await handleSDKOutput(_0x252848,_0x158bbe);else{if(!process[_0x55caed(0x10d)][_0x55caed(0x15a)]||_0x158bbe['output']){if(_0x252848[_0x55caed(0x1d7)]===0x0){if(_0x3f0461&&_0x17b5eb)console[_0x55caed(0x241)](_0x55caed(0x213)+_0x3f0461+'.'+_0x17b5eb);else _0x3f0461?console[_0x55caed(0x241)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x3f0461):console[_0x55caed(0x241)](_0x55caed(0x1c4));}else{const _0x1397b0=_0x158bbe['site'],_0x5f2a44=this[_0x55caed(0x174)](_0x252848,_0x1397b0);_0x158bbe[_0x55caed(0x1e7)]?await writeOutput(_0x5f2a44,_0x158bbe[_0x55caed(0x1e7)],_0x55caed(0x210)):console[_0x55caed(0x241)](_0x5f2a44);}!_0x3f0461&&(console[_0x55caed(0x19c)](''),console['error'](a55_0x47a174[_0x55caed(0x225)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x55caed(0x19c)](a55_0x47a174['dim'](_0x55caed(0x110))+'or'+a55_0x47a174[_0x55caed(0x225)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x252848['length']===0x0){if(_0x3f0461&&_0x17b5eb)console[_0x55caed(0x241)](_0x55caed(0x213)+_0x3f0461+'.'+_0x17b5eb);else _0x3f0461?console[_0x55caed(0x241)](_0x55caed(0x1c8)+_0x3f0461):console['log'](_0x55caed(0x1c4));}else await this[_0x55caed(0x145)](_0x252848,_0x343d9d,_0x3f0461);}}return 0x0;}[a55_0x5029cc(0x174)](_0x27654e,_0x2b1e84){const _0x1b9896=a55_0x5029cc,_0x32c06a=[],_0x4ef837=new Map();let _0xbd3678=Infinity,_0x500dd6=-Infinity;for(const _0x420b4e of _0x27654e){if(_0x420b4e[_0x1b9896(0xa9)]?.['createdAt']){const _0x563ba3=new Date(_0x420b4e['lastAttempt'][_0x1b9896(0x123)])[_0x1b9896(0x22c)](),_0xf881ac=_0x420b4e['lastAttempt'][_0x1b9896(0x1f8)]?new Date(_0x420b4e[_0x1b9896(0xa9)][_0x1b9896(0x1f8)])['getTime']():Date[_0x1b9896(0x13f)](),_0x398174=_0x420b4e[_0x1b9896(0x1c1)]?.[_0x1b9896(0x260)]||'(unknown)';!_0x4ef837[_0x1b9896(0x168)](_0x398174)&&_0x4ef837[_0x1b9896(0x166)](_0x398174,[]),_0x4ef837['get'](_0x398174)[_0x1b9896(0x221)]({'session':_0x420b4e,'startTime':_0x563ba3,'endTime':_0xf881ac,'duration':_0xf881ac-_0x563ba3}),_0xbd3678=Math['min'](_0xbd3678,_0x563ba3),_0x500dd6=Math[_0x1b9896(0x119)](_0x500dd6,_0xf881ac);}}if(_0x4ef837[_0x1b9896(0x261)]===0x0)return _0x1b9896(0x193);const _0x1d4997=process[_0x1b9896(0x10d)][_0x1b9896(0x127)]||0x78,_0x2ee07c=0x1e,_0x35ca5e=0x32,_0x4abb4c=0x4,_0x232cfa=Math[_0x1b9896(0x226)](_0x35ca5e,Math[_0x1b9896(0x119)](_0x2ee07c,Math['floor'](_0x1d4997*0.3))),_0x3985b0=_0x1d4997-_0x232cfa-TIMELINE_CONFIG['GUTTER']-0x3-_0x4abb4c,_0x49971e=_0x500dd6-_0xbd3678,_0x4bd963=_0x49971e/_0x232cfa,_0x346e72=renderTimeAxis({'startTime':_0xbd3678,'endTime':_0x500dd6,'durationMs':_0x49971e,'msPerChar':_0x4bd963},_0x232cfa),_0x1bd091=[];for(const _0x48e9d6 of _0x4ef837[_0x1b9896(0x18a)]()){_0x1bd091[_0x1b9896(0x221)](..._0x48e9d6);}_0x1bd091['sort']((_0x4c8114,_0x22caea)=>_0x22caea[_0x1b9896(0x255)]-_0x4c8114[_0x1b9896(0x255)]);const _0x385b8d=new Date(_0xbd3678),_0x598c2e=formatDate(_0x385b8d),_0x2fd4a7=_0x4abb4c+TIMELINE_CONFIG[_0x1b9896(0x1b5)]+TIMELINE_CONFIG['ICON_SPACING']+_0x3985b0,_0x3beb2e='\x20'[_0x1b9896(0xab)](_0x2fd4a7-_0x598c2e[_0x1b9896(0x1d7)]),_0x3090bd=_0x3beb2e+a55_0x47a174['dim'](_0x598c2e)+'\x20'+_0x346e72;_0x32c06a[_0x1b9896(0x221)](_0x3090bd);const _0x530493=0x16;let _0x5d6808=0x0;for(const _0xef7126 of _0x1bd091){const _0x23b3ca=_0xef7126[_0x1b9896(0x1a2)][_0x1b9896(0x1c1)]?.['name']||'?',_0x210ecc=Math[_0x1b9896(0x226)](stringWidth(_0x23b3ca),_0x530493);_0x5d6808=Math[_0x1b9896(0x119)](_0x5d6808,_0x210ecc);}for(const _0x32dc2b of _0x1bd091){const {session:_0x1329fb,startTime:_0x178fbe,endTime:_0x1f8308,duration:_0x1561bf}=_0x32dc2b,_0x11c4d4=_0x1329fb[_0x1b9896(0x1c1)]?.['id'],_0x3d859a=_0x1329fb['id'],_0x25fbb9=_0x1329fb[_0x1b9896(0x1c1)]?.[_0x1b9896(0x260)]||'?',_0x3d8ba1=_0x1329fb[_0x1b9896(0x1f9)]?.[_0x1b9896(0x260)]||'?';let _0xe31015,_0x415f2d;if(_0x1329fb['lastAttempt']){const _0x33ce99=_0x1329fb[_0x1b9896(0xa9)];!_0x33ce99[_0x1b9896(0xde)]?(_0xe31015=_0x33ce99[_0x1b9896(0x153)]?'🛑':'🔄',_0x415f2d=_0x33ce99['cancelRequested']?a55_0x47a174[_0x1b9896(0x175)]:a55_0x47a174[_0x1b9896(0x117)]):(_0xe31015=_0x33ce99[_0x1b9896(0x1ca)]?'✅':'❌',_0x415f2d=_0x33ce99[_0x1b9896(0x1ca)]?a55_0x47a174[_0x1b9896(0x1de)]:a55_0x47a174[_0x1b9896(0x25a)]);}else _0xe31015='⏳',_0x415f2d=a55_0x47a174[_0x1b9896(0x225)];const _0x565942='#'+_0x3d859a,_0x13f3d3=_0x11c4d4?hyperlink(_0x565942,getWorkflowSessionUrl(_0x2b1e84,_0x11c4d4,_0x3d859a)):_0x565942;let _0x5d770b=_0x25fbb9;stringWidth(_0x25fbb9)>_0x530493&&(_0x5d770b=_0x25fbb9[_0x1b9896(0x1b0)](0x0,_0x530493-0x1)+'…');const _0x549e3a=a55_0x47a174['dim'](_0x5d770b),_0x3fbe28=stringWidth(_0x5d770b),_0x326272='\x20'[_0x1b9896(0xab)](_0x5d6808-stringWidth(_0x5d770b)+0x2),_0x5e030c='('+formatElapsed(_0x1561bf)+')',_0x3eeb6a=stringWidth(_0x5e030c),_0x5772b4=stringWidth(_0x565942),_0x37ce29=_0x5772b4+0x1+_0x3fbe28+_0x326272[_0x1b9896(0x1d7)],_0x1822ef=_0x3985b0-_0x37ce29-_0x3eeb6a-0x1-0x8;let _0x98388d=_0x3d8ba1;stringWidth(_0x98388d)>_0x1822ef&&(_0x98388d=_0x98388d[_0x1b9896(0x1b0)](0x0,_0x1822ef-0x1)+'…');const _0x6593da=_0x13f3d3+'\x20'+_0x549e3a+_0x326272+_0x98388d,_0x3a0b6c=stringWidth(_0x6593da),_0x43ad36=_0x3985b0-_0x3a0b6c-_0x3eeb6a,_0x1b4a43=_0x6593da+'\x20'[_0x1b9896(0xab)](Math['max'](0x1,_0x43ad36))+a55_0x47a174['dim'](_0x5e030c),_0x524e37=Math[_0x1b9896(0xac)]((_0x178fbe-_0xbd3678)/_0x4bd963),_0x25f5e8=Math[_0x1b9896(0xac)]((_0x1f8308-_0xbd3678)/_0x4bd963),_0x52a8a4=Math[_0x1b9896(0x119)](_0x524e37+0x1,_0x25f5e8),_0x1bd354=new Array(_0x232cfa)[_0x1b9896(0x156)]('\x20');for(let _0xc9defd=_0x524e37;_0xc9defd<Math[_0x1b9896(0x226)](_0x52a8a4,_0x232cfa);_0xc9defd++){_0x1bd354[_0xc9defd]='─';}const _0x26f14a=_0x1bd354[_0x1b9896(0x14d)](_0x6915a5=>_0x6915a5==='\x20'?'\x20':_0x415f2d(_0x6915a5))[_0x1b9896(0x1a6)]('');_0x32c06a[_0x1b9896(0x221)](_0xe31015+'\x20'+_0x1b4a43+'│'+_0x26f14a+'│');}return _0x32c06a[_0x1b9896(0x1a6)]('\x0a');}async[a55_0x5029cc(0x145)](_0x4a7d54,_0x34c98a,_0x117498){const _0x5a0f00=a55_0x5029cc,{options:_0x369db1,tdx:_0x1412af}=_0x34c98a,_0x1ae477=_0x369db1['site'],{timelineRows:_0x57ef70,timeAxisHeader:_0x1a6890}=this['generateSessionTimelineRows'](_0x4a7d54,_0x1ae477),_0x3be1a8=_0x57ef70['filter'](_0x1b71f8=>_0x1b71f8[_0x5a0f00(0x259)]);if(_0x3be1a8['length']===0x0){const _0xe73db=this['renderSessionsTimeline'](_0x4a7d54,_0x1ae477);console[_0x5a0f00(0x241)](_0xe73db);!_0x117498&&(console[_0x5a0f00(0x19c)](''),console[_0x5a0f00(0x19c)](a55_0x47a174[_0x5a0f00(0x225)](_0x5a0f00(0xbd))),console[_0x5a0f00(0x19c)](a55_0x47a174[_0x5a0f00(0x225)](_0x5a0f00(0x110))+'or'+a55_0x47a174['dim'](_0x5a0f00(0xe0))));return;}_0x1a6890&&console[_0x5a0f00(0x241)](_0x1a6890);const _0x57585a=_0x57ef70[_0x5a0f00(0xaf)](_0x33b74a=>_0x33b74a[_0x5a0f00(0x259)])[_0x5a0f00(0x14d)](_0x7aac89=>({'title':_0x7aac89[_0x5a0f00(0x223)],'value':_0x7aac89[_0x5a0f00(0x259)]})),_0xec5390=process[_0x5a0f00(0x10d)][_0x5a0f00(0xc5)]||0x3c,_0x55c8b3=Math['max'](0x28,Math[_0x5a0f00(0xac)](_0xec5390*0x2/0x3)),_0x142439=await a55_0x110a93({'type':_0x5a0f00(0x224),'name':_0x5a0f00(0x259),'message':_0x5a0f00(0x26b),'choices':_0x57585a,'initial':-0x1,'limit':_0x55c8b3,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x56301c,_0x431ffb)=>{const _0x4b92d0=_0x5a0f00;if(!_0x56301c)return Promise[_0x4b92d0(0x194)](_0x431ffb);const _0x527c13=_0x431ffb['filter'](_0x2b3e63=>{const _0x5df0be=_0x4b92d0,_0x383640=_0x2b3e63;return _0x383640[_0x5df0be(0x10b)]['toLowerCase']()['includes'](_0x56301c[_0x5df0be(0x162)]());});return Promise[_0x4b92d0(0x194)](_0x527c13);}}),_0x43d14e=()=>{const _0x3680cd=_0x5a0f00;process[_0x3680cd(0x10d)][_0x3680cd(0xc2)](_0x3680cd(0x178)),process[_0x3680cd(0x10d)][_0x3680cd(0xc2)](_0x3680cd(0x178)),process['stdout'][_0x3680cd(0xc2)]('\x1b[1A\x1b[2K');},_0x1d6bd1=_0x142439&&_0x142439[_0x5a0f00(0x259)]&&_0x142439[_0x5a0f00(0x259)]!==null&&_0x142439[_0x5a0f00(0x259)]['trim']()!=='';if(!_0x1d6bd1){_0x43d14e(),console[_0x5a0f00(0x241)](a55_0x47a174[_0x5a0f00(0x225)](_0x5a0f00(0x163)));return;}_0x43d14e();const _0x50042c=_0x4a7d54[_0x5a0f00(0x1df)](_0x3a93a4=>_0x3a93a4[_0x5a0f00(0xa9)]?.['id']===_0x142439[_0x5a0f00(0x259)]);if(_0x50042c){const _0x5975e1=_0x50042c[_0x5a0f00(0x1c1)]?.[_0x5a0f00(0x260)]||'?',_0x537b34=_0x50042c[_0x5a0f00(0x1f9)]?.['name']||'?';console[_0x5a0f00(0x241)](_0x5a0f00(0x24b)+a55_0x47a174[_0x5a0f00(0x225)](_0x5975e1)+_0x5a0f00(0xdd)+a55_0x47a174[_0x5a0f00(0x225)](_0x537b34));}const _0x4350a4=new WorkflowTimelineCommand();await _0x4350a4[_0x5a0f00(0x196)]({'args':[],'options':{..._0x369db1,'attemptId':_0x142439[_0x5a0f00(0x259)]},'tdx':_0x1412af});}[a55_0x5029cc(0x108)](_0x48e121,_0x23fc26){const _0x1a1a88=a55_0x5029cc,_0xd77d2=new Map();for(const _0x2f25dc of _0x48e121){_0x2f25dc['id']&&_0x2f25dc['lastAttempt']?.['id']&&_0xd77d2['set'](_0x2f25dc['id'],_0x2f25dc['lastAttempt']['id']);}const _0x3bdd3f=[];let _0x1d7bea='';const _0x4b238c=this['renderSessionsTimeline'](_0x48e121,_0x23fc26),_0x1406b3=_0x4b238c[_0x1a1a88(0x12e)]('\x0a');for(const _0x585c5e of _0x1406b3){if(_0x585c5e[_0x1a1a88(0x144)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x585c5e[_0x1a1a88(0x111)](/^\s+\d{4}-\d{2}-\d{2}/))_0x1d7bea=_0x585c5e;else{if(_0x585c5e['match'](/^[✅❌🔄🛑⏳]/)){const _0x239a17=_0x585c5e['match'](/#(\d+)/),_0x39b589=_0x239a17?_0x239a17[0x1]:null,_0xf1c38c=_0x39b589?_0xd77d2[_0x1a1a88(0xfe)](_0x39b589)||null:null,_0x1a9409=_0x48e121[_0x1a1a88(0x1df)](_0x3967c5=>_0x3967c5['id']===_0x39b589),_0x559aa5=_0x1a9409?.[_0x1a1a88(0x1c1)]?.[_0x1a1a88(0x260)]||'';_0x3bdd3f[_0x1a1a88(0x221)]({'displayLine':_0x585c5e,'attemptId':_0xf1c38c,'projectName':_0x559aa5});}}}return{'timelineRows':_0x3bdd3f,'timeAxisHeader':_0x1d7bea};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a55_0x5029cc(0x260)]=a55_0x5029cc(0x1c6);['description']=a55_0x5029cc(0x26c);async[a55_0x5029cc(0x196)](_0x2d5043){const _0x20f5ab=a55_0x5029cc,{options:_0x2b3bde,args:_0x58ed8b,tdx:_0x5164c1}=_0x2d5043,_0x257ffd=this['parseProjectWorkflowPattern'](_0x58ed8b,_0x2b3bde);if(!_0x257ffd)return 0x1;const {projectName:_0x4916cb,workflowName:_0x4152c2}=_0x257ffd,_0x121ef8=_0x2b3bde[_0x20f5ab(0x164)];if(_0x2b3bde[_0x20f5ab(0x1af)]){if(_0x4916cb&&_0x4152c2)console[_0x20f5ab(0x19c)](_0x20f5ab(0x95)+_0x4916cb+'.'+_0x4152c2);else _0x4916cb&&console[_0x20f5ab(0x19c)](_0x20f5ab(0xe7)+_0x4916cb);_0x121ef8&&console[_0x20f5ab(0x19c)](_0x20f5ab(0x256));}const _0x3b2bca=await withSpinner(_0x20f5ab(0x1f5),()=>_0x5164c1['workflow'][_0x20f5ab(0x1b6)]({'projectName':_0x4916cb,'workflowName':_0x4152c2,'includeRetried':_0x121ef8,'limit':_0x2b3bde[_0x20f5ab(0x1ec)]}),{'verbose':_0x2b3bde['verbose']}),_0x52b85e=_0x3b2bca[_0x20f5ab(0x1a8)],_0x27871a=_0x2b3bde['limit']||0x64,_0x124e79=_0x52b85e[_0x20f5ab(0x1d7)]>=_0x27871a?a55_0x47a174[_0x20f5ab(0x225)](_0x20f5ab(0x264)):'';console[_0x20f5ab(0x19c)](_0x20f5ab(0xd4)+_0x52b85e[_0x20f5ab(0x1d7)]+_0x20f5ab(0x267)+(_0x52b85e['length']!==0x1?'s':'')+_0x124e79);if(_0x2b3bde['format']==='json'||_0x2b3bde['format']===_0x20f5ab(0xf9)||_0x2b3bde[_0x20f5ab(0xd1)]===_0x20f5ab(0x20d))await handleSDKOutput(_0x52b85e,_0x2b3bde);else{if(_0x52b85e[_0x20f5ab(0x1d7)]===0x0){if(_0x4916cb&&_0x4152c2)console[_0x20f5ab(0x241)](_0x20f5ab(0x14c)+_0x4916cb+'.'+_0x4152c2);else _0x4916cb?console[_0x20f5ab(0x241)](_0x20f5ab(0x1ef)+_0x4916cb):console[_0x20f5ab(0x241)](_0x20f5ab(0x134));}else{const _0x3177b9=_0x2b3bde[_0x20f5ab(0x9a)],_0x21fdd0=_0x52b85e['map'](_0x65614b=>{const _0xd1dd4c=_0x20f5ab,_0x50209d=a55_0x47a174[_0xd1dd4c(0x225)]('#'+_0x65614b['id']),_0x1a23dd=_0x65614b[_0xd1dd4c(0x1c1)]?.['id'],_0x4e1b6b=_0x65614b[_0xd1dd4c(0x24c)]||_0x65614b['sessionId'],_0x95ebd5=_0x1a23dd&&_0x4e1b6b?hyperlink(_0x50209d,getWorkflowAttemptUrl(_0x3177b9,_0x1a23dd,_0x4e1b6b,_0x65614b['id'])):_0x50209d,{icon:_0x4f29fa,text:_0x3bed7b}=getAttemptStatusDisplay(_0x65614b),_0x547ef7=(_0x65614b[_0xd1dd4c(0x1c1)]?.['name']||'?')+'.'+(_0x65614b[_0xd1dd4c(0x1f9)]?.[_0xd1dd4c(0x260)]||'?'),_0x14d525=_0x65614b['sessionTime']?a55_0x47a174['dim'](_0x65614b['sessionTime']):'';return(_0x95ebd5+'\x20'+_0x4f29fa+(_0x3bed7b?'\x20'+_0x3bed7b:'')+'\x20'+_0x547ef7+'\x20'+_0x14d525)[_0xd1dd4c(0x1eb)]();});await writeOutput(_0x21fdd0[_0x20f5ab(0x1a6)]('\x0a'),_0x2b3bde[_0x20f5ab(0x1e7)],_0x20f5ab(0x210));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a55_0x5029cc(0x1ed);['description']=a55_0x5029cc(0x14f);async[a55_0x5029cc(0x196)](_0x50d556){const _0x43e893=a55_0x5029cc,{options:_0x2dd690,args:_0x4590de,tdx:_0x46fe33}=_0x50d556,_0x56b1f3=_0x4590de[0x0];if(!_0x56b1f3)return console[_0x43e893(0x19c)](_0x43e893(0x236)),0x1;_0x2dd690[_0x43e893(0x1af)]&&console[_0x43e893(0x19c)](_0x43e893(0x92)+_0x56b1f3);const _0x33279f=await withSpinner('Getting\x20attempt\x20details...',()=>_0x46fe33['workflow']['attempt'](_0x56b1f3),{'verbose':_0x2dd690[_0x43e893(0x1af)]}),_0x13ab76=_0x33279f['data'];let _0xc9ca16;!_0x13ab76[_0x43e893(0xde)]?_0xc9ca16=_0x13ab76[_0x43e893(0x153)]?_0x43e893(0x185):_0x43e893(0x97):_0xc9ca16=_0x13ab76[_0x43e893(0x1ca)]?'success':'error';let _0x230f63;if(_0x13ab76[_0x43e893(0x123)]&&_0x13ab76[_0x43e893(0x1f8)]){const _0x49a903=new Date(_0x13ab76['createdAt'])[_0x43e893(0x22c)](),_0x4b38df=new Date(_0x13ab76[_0x43e893(0x1f8)])[_0x43e893(0x22c)]();_0x230f63=Math[_0x43e893(0xf5)]((_0x4b38df-_0x49a903)/0x3e8);}const _0x5bbe07={'attempt_id':_0x13ab76['id'],'status':_0xc9ca16,..._0x13ab76[_0x43e893(0x23d)]!==undefined&&{'index':_0x13ab76['index']},..._0x13ab76[_0x43e893(0x1c1)]&&{'project':_0x13ab76[_0x43e893(0x1c1)][_0x43e893(0x260)]},..._0x13ab76['workflow']&&{'workflow':_0x13ab76[_0x43e893(0x1f9)][_0x43e893(0x260)]},..._0x13ab76['sessionId']&&{'session_id':_0x13ab76['sessionId']},..._0x13ab76[_0x43e893(0xf1)]&&{'session_time':_0x13ab76[_0x43e893(0xf1)]},..._0x13ab76[_0x43e893(0x207)]&&{'retry_attempt':_0x13ab76['retryAttemptName']},..._0x230f63!==undefined&&{'duration_sec':_0x230f63},..._0x13ab76['createdAt']&&{'created_at':_0x13ab76['createdAt']},..._0x13ab76[_0x43e893(0x1f8)]&&{'finished_at':_0x13ab76[_0x43e893(0x1f8)]},...Object[_0x43e893(0xb6)](_0x13ab76[_0x43e893(0x1dd)])[_0x43e893(0x1d7)]>0x0&&{'params':_0x13ab76[_0x43e893(0x1dd)]}};return await handleSingleObjectOutput(_0x5bbe07,_0x2dd690),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a55_0x5029cc(0xd2);[a55_0x5029cc(0x1ee)]='Show\x20tasks\x20for\x20an\x20attempt';async[a55_0x5029cc(0x196)](_0x6108be){const _0x444424=a55_0x5029cc,{options:_0x8d628f,args:_0x1ca4b8,tdx:_0x2c1622}=_0x6108be,_0x226640=_0x1ca4b8[0x0];if(!_0x226640)return console[_0x444424(0x19c)](_0x444424(0x236)),0x1;const _0x59a577=_0x8d628f[_0x444424(0xee)];_0x8d628f['verbose']&&(console['error'](_0x444424(0x92)+_0x226640),_0x59a577&&console[_0x444424(0x19c)]('Including\x20subtasks:\x20yes'));const _0x42601a=await withSpinner(_0x444424(0x205),()=>_0x2c1622[_0x444424(0x1f9)][_0x444424(0xc1)](_0x226640,_0x59a577||![]),{'verbose':_0x8d628f[_0x444424(0x1af)]}),_0x14189b=_0x42601a[_0x444424(0x1a8)];return console[_0x444424(0x19c)](_0x444424(0xd4)+_0x14189b[_0x444424(0x1d7)]+_0x444424(0x1d6)+(_0x14189b[_0x444424(0x1d7)]!==0x1?'s':'')),await handleSDKOutput(_0x14189b,_0x8d628f),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a55_0x5029cc(0x260)]='workflow:logs';['description']=a55_0x5029cc(0x104);async[a55_0x5029cc(0x196)](_0x29e0ca){const _0x1f5dfd=a55_0x5029cc,{options:_0x2b43f5,args:_0x4e80de,tdx:_0x35fbcc}=_0x29e0ca,_0x1bb715=_0x4e80de[0x0];let _0x4aa4a7=_0x4e80de[0x1];if(!_0x1bb715)return console[_0x1f5dfd(0x19c)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x2b43f5[_0x1f5dfd(0x1af)]&&(console[_0x1f5dfd(0x19c)](_0x1f5dfd(0x92)+_0x1bb715),_0x4aa4a7&&console['error']('Task\x20name:\x20'+_0x4aa4a7));const _0x2f7da5=await withSpinner(_0x1f5dfd(0x20c),()=>_0x35fbcc['workflow']['logFiles'](_0x1bb715,_0x4aa4a7),{'verbose':_0x2b43f5[_0x1f5dfd(0x1af)]}),_0x192ea2=_0x2f7da5[_0x1f5dfd(0x1a8)];if(_0x192ea2['length']===0x0)return console['error'](_0x1f5dfd(0x19f)),0x0;if(!_0x4aa4a7&&(_0x2b43f5[_0x1f5dfd(0xce)]||_0x2b43f5['format']))return await handleSDKOutput(_0x192ea2,_0x2b43f5),0x0;if(!_0x4aa4a7){const _0x24d9b8=_0x192ea2[_0x1f5dfd(0x14d)](_0x1df35e=>({'title':_0x1df35e[_0x1f5dfd(0x124)]+'\x20('+formatBytes(_0x1df35e[_0x1f5dfd(0x25d)])+')','value':_0x1df35e[_0x1f5dfd(0x124)]})),_0x486174=await a55_0x110a93({'type':_0x1f5dfd(0x235),'name':_0x1f5dfd(0x24a),'message':_0x1f5dfd(0x219),'choices':_0x24d9b8});if(!_0x486174['task'])return console[_0x1f5dfd(0x19c)](_0x1f5dfd(0x163)),0x0;_0x4aa4a7=_0x486174[_0x1f5dfd(0x24a)];}const _0x5f58e7=await withSpinner(_0x1f5dfd(0xea),()=>_0x35fbcc[_0x1f5dfd(0x1f9)][_0x1f5dfd(0x152)](_0x1bb715,_0x4aa4a7),{'verbose':_0x2b43f5['verbose']}),_0x2ef2ff=_0x5f58e7['data'];return _0x2ef2ff?console[_0x1f5dfd(0x241)](_0x2ef2ff):console[_0x1f5dfd(0x19c)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a55_0x5029cc(0x260)]=a55_0x5029cc(0x220);[a55_0x5029cc(0x1ee)]=a55_0x5029cc(0xb7);async[a55_0x5029cc(0x196)](_0x42aca8){const _0x3dbce2=a55_0x5029cc,{options:_0x1c3c9c,args:_0x3524d3,tdx:_0x210d3a}=_0x42aca8,_0x5ef957=_0x3524d3[0x0];if(!_0x5ef957)return console[_0x3dbce2(0x19c)](_0x3dbce2(0x236)),0x1;const _0x2bc9f7=_0x1c3c9c[_0x3dbce2(0xd9)];_0x1c3c9c[_0x3dbce2(0x1af)]&&(console[_0x3dbce2(0x19c)](_0x3dbce2(0x92)+_0x5ef957),_0x2bc9f7&&console[_0x3dbce2(0x19c)](_0x3dbce2(0x173)+_0x2bc9f7));if(!_0x1c3c9c['yes']){if(!isInteractive())return console[_0x3dbce2(0x19c)](a55_0x47a174[_0x3dbce2(0x25a)](_0x3dbce2(0x1ff)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a55_0x47a174[_0x3dbce2(0x225)](_0x3dbce2(0x24f))),0x1;const _0x517b41=await confirmKey(_0x3dbce2(0x171)+_0x5ef957+'?');if(!_0x517b41)return console[_0x3dbce2(0x19c)](a55_0x47a174['yellow']('Cancelled')),0x1;}const _0x167779=await withSpinner(_0x3dbce2(0x1cb),()=>_0x210d3a['workflow'][_0x3dbce2(0x270)](_0x5ef957,_0x2bc9f7),{'verbose':_0x1c3c9c[_0x3dbce2(0x1af)]}),_0xcf5dc4=_0x167779['data'];return console[_0x3dbce2(0x19c)]('✔\x20'+_0xcf5dc4),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a55_0x5029cc(0x260)]=a55_0x5029cc(0xb1);[a55_0x5029cc(0x1ee)]=a55_0x5029cc(0xbb);async[a55_0x5029cc(0x196)](_0x15fc86){const _0x478d08=a55_0x5029cc,{options:_0x1f5469,args:_0x36aadf,tdx:_0x4f4425}=_0x15fc86,_0x55b196=_0x36aadf[0x0];if(!_0x55b196)return console[_0x478d08(0x19c)](_0x478d08(0x121)),console[_0x478d08(0x19c)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x4f5e02=![],_0x47ac40=_0x55b196;if(_0x55b196[_0x478d08(0x144)](_0x478d08(0x21e)))_0x4f5e02=!![],_0x47ac40=_0x55b196[_0x478d08(0x17d)](0x8);else{if(_0x55b196[_0x478d08(0x144)](_0x478d08(0xc7)))_0x4f5e02=![],_0x47ac40=_0x55b196[_0x478d08(0x17d)](0x8);else return console[_0x478d08(0x19c)](_0x478d08(0xb4)),console[_0x478d08(0x19c)](_0x478d08(0x1bd)),0x1;}const _0x404813=_0x1f5469['fromTask'],_0x87f14=_0x1f5469[_0x478d08(0x1cf)],_0x55ef05=_0x1f5469[_0x478d08(0x1dd)],_0x1e491f=_0x1f5469[_0x478d08(0x9f)];_0x1f5469[_0x478d08(0x1af)]&&(console[_0x478d08(0x19c)]('Target:\x20'+(_0x4f5e02?_0x478d08(0x1a2):'attempt')+'\x20'+_0x47ac40),_0x404813&&console['error'](_0x478d08(0x1fc)+_0x404813),_0x87f14&&console[_0x478d08(0x19c)](_0x478d08(0xcb)+_0x87f14),_0x55ef05&&console[_0x478d08(0x19c)](_0x478d08(0x19d)+_0x55ef05),_0x1e491f&&console[_0x478d08(0x19c)](_0x478d08(0x1f1)));let _0x4d7a33;if(_0x55ef05)try{if(_0x55ef05[_0x478d08(0x144)]('@')){const _0x5c7a6d=await import(_0x478d08(0x93)),_0x171f70=_0x55ef05[_0x478d08(0x17d)](0x1),_0xab503f=await _0x5c7a6d[_0x478d08(0x16d)](_0x171f70,_0x478d08(0x158));_0x4d7a33=JSON[_0x478d08(0x96)](_0xab503f);}else _0x4d7a33=JSON[_0x478d08(0x96)](_0x55ef05);}catch{return console[_0x478d08(0x19c)](_0x478d08(0x132)),0x1;}if(!_0x1f5469[_0x478d08(0x262)]){if(!isInteractive())return console['error'](a55_0x47a174[_0x478d08(0x25a)](_0x478d08(0x1ff)),_0x478d08(0xb3)),console[_0x478d08(0x19c)](a55_0x47a174[_0x478d08(0x225)](_0x478d08(0x24f))),0x1;const _0x61e705=await confirmKey(_0x478d08(0x99)+(_0x4f5e02?'session':_0x478d08(0xcd))+'\x20'+_0x47ac40+'?');if(!_0x61e705)return console[_0x478d08(0x19c)](a55_0x47a174['yellow'](_0x478d08(0x163))),0x1;}let _0x103087;_0x4f5e02?_0x103087=await withSpinner(_0x478d08(0x1d4),()=>_0x4f4425[_0x478d08(0x1f9)][_0x478d08(0x102)](_0x47ac40,{'fromTask':_0x404813,'retryParams':_0x4d7a33}),{'verbose':_0x1f5469[_0x478d08(0x1af)]}):_0x103087=await withSpinner(_0x478d08(0x107),()=>_0x4f4425[_0x478d08(0x1f9)][_0x478d08(0x26d)](_0x47ac40,{'resumeFrom':_0x87f14,'retryParams':_0x4d7a33,'force':_0x1e491f}),{'verbose':_0x1f5469[_0x478d08(0x1af)]});const _0x31b04d=_0x103087[_0x478d08(0x1a8)];return console[_0x478d08(0x19c)](_0x478d08(0x14b)),console[_0x478d08(0x19c)](_0x478d08(0x216)+_0x31b04d[_0x478d08(0x259)]),console['error'](_0x478d08(0x251)+_0x31b04d['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a55_0x5029cc(0x260)]=a55_0x5029cc(0x1b9);[a55_0x5029cc(0x1ee)]='Start\x20a\x20workflow\x20run';async[a55_0x5029cc(0x196)](_0x1a1b47){const _0x14714a=a55_0x5029cc,{options:_0x38efbf,args:_0x5c693c,tdx:_0x4ff4f9}=_0x1a1b47;let _0xe0a92e=_0x5c693c[0x0];if(!_0xe0a92e){const _0x1c534b=this['resolveProject']([],_0x38efbf),_0x27339f=await withSpinner('Loading\x20workflows...',()=>_0x4ff4f9[_0x14714a(0x1f9)][_0x14714a(0x204)](_0x1c534b,{'limit':_0x38efbf[_0x14714a(0x1ec)]}),{'verbose':_0x38efbf[_0x14714a(0x1af)]}),_0x2658b2=_0x27339f[_0x14714a(0x1a8)];if(_0x2658b2[_0x14714a(0x1d7)]===0x0)return console[_0x14714a(0x19c)]('No\x20workflows\x20found'),!_0x1c534b&&console[_0x14714a(0x19c)](a55_0x47a174[_0x14714a(0x225)](_0x14714a(0x1e9))),0x1;const _0x533e03=_0x2658b2[_0x14714a(0x14d)](_0x53a5d5=>({'title':_0x53a5d5[_0x14714a(0x1c1)]?.['name']+'.'+_0x53a5d5['name'],'value':_0x53a5d5[_0x14714a(0x1c1)]?.[_0x14714a(0x260)]+'.'+_0x53a5d5['name'],'description':_0x53a5d5[_0x14714a(0x26e)]?_0x14714a(0x249)+_0x53a5d5['revision']:undefined})),_0x1f9e3e=await a55_0x110a93({'type':'select','name':_0x14714a(0x1f9),'message':_0x14714a(0xe4),'choices':_0x533e03});if(!_0x1f9e3e[_0x14714a(0x1f9)])return 0x1;_0xe0a92e=_0x1f9e3e[_0x14714a(0x1f9)];}if(!_0xe0a92e[_0x14714a(0xdf)]('.')){const _0x364526=this['resolveProject']([],_0x38efbf);if(_0x364526)_0xe0a92e=_0x364526+'.'+_0xe0a92e;else return console[_0x14714a(0x19c)](a55_0x47a174['red'](_0x14714a(0x25b)),_0x14714a(0x1bc)),console[_0x14714a(0x19c)](a55_0x47a174[_0x14714a(0x225)](_0x14714a(0x1e9))),0x1;}const _0x3df1ea=_0x38efbf['param'],_0xbfeb29=_0x38efbf['sessionTime'],_0x117e82={};if(_0x3df1ea&&Array['isArray'](_0x3df1ea))for(const _0x3edddc of _0x3df1ea){const _0x40685e=_0x3edddc['indexOf']('=');if(_0x40685e===-0x1)return console['error'](_0x14714a(0xb0)+_0x3edddc),console[_0x14714a(0x19c)](_0x14714a(0x116)),0x1;const _0x33aa5c=_0x3edddc['substring'](0x0,_0x40685e),_0x3740eb=_0x3edddc[_0x14714a(0x17d)](_0x40685e+0x1);try{_0x117e82[_0x33aa5c]=JSON[_0x14714a(0x96)](_0x3740eb);}catch{_0x117e82[_0x33aa5c]=_0x3740eb;}}_0x38efbf[_0x14714a(0x1af)]&&(console['error'](_0x14714a(0x209)+_0xe0a92e),Object[_0x14714a(0xb6)](_0x117e82)[_0x14714a(0x1d7)]>0x0&&console[_0x14714a(0x19c)]('Parameters:\x20'+JSON[_0x14714a(0x198)](_0x117e82)),_0xbfeb29&&console[_0x14714a(0x19c)](_0x14714a(0x238)+_0xbfeb29));if(_0x38efbf[_0x14714a(0xa6)])return await this[_0x14714a(0x25f)](_0x1a1b47,_0xe0a92e,_0x117e82,_0xbfeb29);const _0x4f78b3=await withSpinner(_0x14714a(0xef),()=>_0x4ff4f9[_0x14714a(0x1f9)]['run'](_0xe0a92e,_0x117e82,{'sessionTime':_0xbfeb29}),{'verbose':_0x38efbf[_0x14714a(0x1af)]}),_0x1cd4a1=_0x4f78b3[_0x14714a(0x1a8)];console['error'](_0x14714a(0x1d3)),console[_0x14714a(0x19c)](_0x14714a(0x146)+_0x1cd4a1['id']),console[_0x14714a(0x19c)](_0x14714a(0x251)+_0x1cd4a1[_0x14714a(0x184)]),console[_0x14714a(0x19c)](_0x14714a(0x12f)+_0x1cd4a1[_0x14714a(0x1c1)]?.[_0x14714a(0x260)]),console[_0x14714a(0x19c)](_0x14714a(0x101)+_0x1cd4a1[_0x14714a(0x1f9)]?.[_0x14714a(0x260)]);if(_0x1cd4a1[_0x14714a(0x1c1)]?.['id']&&_0x1cd4a1['sessionId']&&_0x1cd4a1['id']){const _0x8712b4=_0x38efbf[_0x14714a(0x9a)],_0xa1bbe6=getConsoleUrl(_0x8712b4,_0x14714a(0x240)+_0x1cd4a1['project']['id']+_0x14714a(0x233)+_0x1cd4a1[_0x14714a(0x184)]+_0x14714a(0xed)+_0x1cd4a1['id']);console['error'](_0x14714a(0x1fb)+a55_0x47a174[_0x14714a(0x138)](_0xa1bbe6));}return 0x0;}async[a55_0x5029cc(0x25f)](_0x1b4cc5,_0x39e713,_0xe9d359,_0x21f643){const _0x214bb7=a55_0x5029cc,{options:_0x32e0f4,tdx:_0x43fc92}=_0x1b4cc5,_0xca7a7e=await withSpinner('Fetching\x20workflow\x20'+_0x39e713+_0x214bb7(0x234),()=>_0x43fc92[_0x214bb7(0x1f9)][_0x214bb7(0x1e6)](_0x39e713),{'verbose':_0x32e0f4['verbose']}),_0x1dc070=_0xca7a7e[_0x214bb7(0x1a8)],_0x4baaef=_0x21f643??new Date()[_0x214bb7(0xe5)]();console['log'](a55_0x47a174[_0x214bb7(0xaa)](_0x214bb7(0x1f0)),_0x39e713),console[_0x214bb7(0x241)](a55_0x47a174[_0x214bb7(0xaa)]('Session\x20time:'),_0x4baaef),console['log'](a55_0x47a174['bold'](_0x214bb7(0x1d8)),JSON['stringify'](_0xe9d359)),console[_0x214bb7(0x241)](''),console[_0x214bb7(0x241)](a55_0x47a174[_0x214bb7(0xaa)](_0x214bb7(0x1cc)));const _0xe08b91=parseTaskGraph(_0x1dc070[_0x214bb7(0x17f)]??null);if(_0xe08b91['length']===0x0)console[_0x214bb7(0x241)](a55_0x47a174['dim'](_0x214bb7(0x1ba)));else for(const _0x54a7fe of formatTaskGraph(_0xe08b91)){console[_0x214bb7(0x241)](_0x54a7fe);}const _0x28ef99=summarizeTaskGraph(_0xe08b91),_0x1072de=formatWarningSummary(_0x28ef99);return _0x1072de&&(console['log'](''),console['log'](a55_0x47a174[_0x214bb7(0x175)](_0x1072de))),console[_0x214bb7(0x241)](a55_0x47a174[_0x214bb7(0x175)](_0x214bb7(0x237))),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a55_0x5029cc(0x260)]=a55_0x5029cc(0x150);[a55_0x5029cc(0x1ee)]='Download\x20workflow\x20project\x20from\x20Treasure\x20AI';async[a55_0x5029cc(0x196)](_0x46ecd3){const _0xcd37a6=a55_0x5029cc,{options:_0x3039a2,args:_0x41f9af,tdx:_0x390b92}=_0x46ecd3,_0x202ca2=_0x41f9af[0x0],_0x354e00=_0x41f9af[0x1]||'.';if(!_0x202ca2)return console[_0xcd37a6(0x19c)]('Error:\x20Project\x20name\x20is\x20required'),console[_0xcd37a6(0x19c)](_0xcd37a6(0x1b4)),0x1;const _0x240e08=_0x3039a2[_0xcd37a6(0x26e)];_0x3039a2[_0xcd37a6(0x1af)]&&(console[_0xcd37a6(0x19c)]('Project:\x20'+_0x202ca2),console['error']('Output\x20directory:\x20'+_0x354e00),_0x240e08&&console[_0xcd37a6(0x19c)]('Revision:\x20'+_0x240e08));const _0x55896d=await withSpinner(_0xcd37a6(0x180)+_0x202ca2+_0xcd37a6(0x234),()=>_0x390b92[_0xcd37a6(0x1f9)][_0xcd37a6(0x12c)](_0x202ca2,_0x354e00,{'revision':_0x240e08}),{'verbose':_0x3039a2[_0xcd37a6(0x1af)]}),_0x40c383=_0x55896d['data'];return console[_0xcd37a6(0x19c)](_0xcd37a6(0x21b)+_0x40c383['projectName']),console[_0xcd37a6(0x19c)](_0xcd37a6(0x269)+_0x40c383['revision']),console[_0xcd37a6(0x19c)](_0xcd37a6(0x268)+_0x40c383['filesExtracted']),console[_0xcd37a6(0x19c)]('\x20\x20Location:\x20'+_0x354e00+'/'+_0x40c383['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a55_0x5029cc(0x260)]=a55_0x5029cc(0x15b);[a55_0x5029cc(0x1ee)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20AI\x20(digdag-style)';async[a55_0x5029cc(0x196)](_0x3d615e){const _0x2e6ce7=a55_0x5029cc,{options:_0x1f75b7,args:_0x1f56e1,tdx:_0x17cbf6}=_0x3d615e;let _0x1f9359='.',_0x508eba=_0x1f75b7['name'];if(_0x1f56e1[0x0]){const {promises:_0x586016}=await import('fs');try{const _0x184948=await _0x586016[_0x2e6ce7(0x257)](_0x1f56e1[0x0]);if(_0x184948[_0x2e6ce7(0xdb)]())_0x1f9359=_0x1f56e1[0x0];else return console[_0x2e6ce7(0x19c)](_0x2e6ce7(0x23b)+_0x1f56e1[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x508eba=_0x1f56e1[0x0],_0x1f9359='.';}}const _0x30d115=_0x1f75b7[_0x2e6ce7(0x26e)],_0x3dcc17=_0x1f75b7[_0x2e6ce7(0xfd)];_0x1f75b7[_0x2e6ce7(0x1af)]&&(console[_0x2e6ce7(0x19c)](_0x2e6ce7(0x13c)+_0x1f9359),_0x508eba&&console['error']('Project\x20name:\x20'+_0x508eba),_0x30d115&&console[_0x2e6ce7(0x19c)](_0x2e6ce7(0xc4)+_0x30d115),_0x3dcc17&&console[_0x2e6ce7(0x19c)]('Validation:\x20skipped'));const _0x31ea7f=await withSpinner(_0x2e6ce7(0x8b),()=>_0x17cbf6[_0x2e6ce7(0x1f9)][_0x2e6ce7(0x221)](_0x1f9359,{'projectName':_0x508eba,'revision':_0x30d115,'skipValidation':_0x3dcc17}),{'verbose':_0x1f75b7[_0x2e6ce7(0x1af)]}),_0x3c4d83=_0x31ea7f[_0x2e6ce7(0x1a8)];return console[_0x2e6ce7(0x19c)](_0x2e6ce7(0x200)+_0x3c4d83['projectName']),console[_0x2e6ce7(0x19c)](_0x2e6ce7(0x1cd)+_0x3c4d83[_0x2e6ce7(0x201)]),console[_0x2e6ce7(0x19c)]('\x20\x20Revision:\x20'+_0x3c4d83[_0x2e6ce7(0x26e)]),await this[_0x2e6ce7(0xd3)](_0x17cbf6,_0x3c4d83[_0x2e6ce7(0x1be)],_0x1f75b7[_0x2e6ce7(0x9a)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a55_0x5029cc(0x20e);[a55_0x5029cc(0x1ee)]=a55_0x5029cc(0x24d);async[a55_0x5029cc(0x196)](_0x592239){const _0x3015f3=a55_0x5029cc,{options:_0x2e0004,args:_0x112fdd,tdx:_0x588042}=_0x592239,_0x3c2427=_0x112fdd[0x0],_0x232c17=_0x112fdd[0x1];if(!_0x3c2427)return console[_0x3015f3(0x19c)](a55_0x47a174['red'](_0x3015f3(0x25b)),'Project\x20name\x20is\x20required'),console[_0x3015f3(0x19c)](a55_0x47a174[_0x3015f3(0x225)](_0x3015f3(0xfc))),0x1;const _0x19c1a4=_0x2e0004['revision'];_0x2e0004[_0x3015f3(0x1af)]&&(console[_0x3015f3(0x19c)](_0x3015f3(0x24b)+_0x3c2427),_0x232c17&&console[_0x3015f3(0x19c)](_0x3015f3(0x23a)+_0x232c17),_0x19c1a4&&console[_0x3015f3(0x19c)](_0x3015f3(0xc4)+_0x19c1a4),_0x2e0004['dryRun']&&console['error'](_0x3015f3(0x11c)));const _0x2c5241=await withSpinner(_0x3015f3(0x141)+_0x3c2427+_0x3015f3(0x234),()=>_0x588042[_0x3015f3(0x1f9)][_0x3015f3(0x154)](_0x3c2427,{'targetDir':_0x232c17,'revision':_0x19c1a4}),{'verbose':_0x2e0004['verbose']}),_0x35813c=_0x2c5241['data'];_0x35813c[_0x3015f3(0x26f)]?console[_0x3015f3(0x19c)](_0x3015f3(0x10e)+_0x35813c[_0x3015f3(0x1be)]):console[_0x3015f3(0x19c)](_0x3015f3(0xc9)+_0x35813c[_0x3015f3(0x1be)]);console[_0x3015f3(0x19c)]('\x20\x20Revision:\x20'+_0x35813c[_0x3015f3(0x26e)]),console['error'](_0x3015f3(0x135)+(a55_0x4d0954[_0x3015f3(0x1fe)](process['cwd'](),_0x35813c[_0x3015f3(0x1bf)])||'.')),console['error']('\x20\x20Changes:\x20'+a55_0x47a174[_0x3015f3(0x1de)]('+'+_0x35813c[_0x3015f3(0x12a)][_0x3015f3(0x136)]+_0x3015f3(0xf2))+',\x20'+(a55_0x47a174[_0x3015f3(0x175)]('~'+_0x35813c[_0x3015f3(0x12a)][_0x3015f3(0x214)]+_0x3015f3(0x1f3))+',\x20')+(a55_0x47a174['red']('-'+_0x35813c['summary'][_0x3015f3(0x16f)]+'\x20deleted')+',\x20')+(''+a55_0x47a174[_0x3015f3(0x225)](_0x35813c[_0x3015f3(0x12a)][_0x3015f3(0x1b7)]+_0x3015f3(0x22b))));for(const _0x4a6ea5 of _0x35813c[_0x3015f3(0x1a7)]){_0x4a6ea5[_0x3015f3(0x11a)]===_0x3015f3(0x214)&&_0x4a6ea5[_0x3015f3(0x18c)]&&(console[_0x3015f3(0x19c)]('\x0a'+a55_0x47a174[_0x3015f3(0x138)](_0x3015f3(0x24e)+_0x4a6ea5[_0x3015f3(0x100)])),console['error'](_0x4a6ea5['diff']));}if(!_0x35813c[_0x3015f3(0x1f4)])return saveSessionContext({'workflow_project':_0x35813c[_0x3015f3(0x1be)]},_0x2e0004['session']),console[_0x3015f3(0x19c)](a55_0x47a174[_0x3015f3(0x1de)]('\x0a✔\x20Already\x20up\x20to\x20date')),console['error'](a55_0x47a174[_0x3015f3(0x225)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x35813c[_0x3015f3(0x1be)])),0x0;if(_0x2e0004[_0x3015f3(0xa6)])return console[_0x3015f3(0x19c)](a55_0x47a174['yellow'](_0x3015f3(0x13d))),0x0;if(!_0x2e0004['yes']){if(!isInteractive())return console[_0x3015f3(0x19c)](a55_0x47a174[_0x3015f3(0x25a)]('\x0aError:'),_0x3015f3(0xb3)),console[_0x3015f3(0x19c)](a55_0x47a174['dim'](_0x3015f3(0x24f))),0x1;const _0x4c2e10=await confirmKey(_0x3015f3(0xc8));if(!_0x4c2e10)return console[_0x3015f3(0x19c)](a55_0x47a174['yellow']('Cancelled'),_0x3015f3(0x10a)),0x1;}await withSpinner(_0x3015f3(0x1b8),()=>_0x588042[_0x3015f3(0x1f9)][_0x3015f3(0x113)](_0x35813c,{'revision':_0x19c1a4}),{'verbose':_0x2e0004[_0x3015f3(0x1af)]}),saveSessionContext({'workflow_project':_0x35813c[_0x3015f3(0x1be)]},_0x2e0004[_0x3015f3(0x1a2)]),console[_0x3015f3(0x19c)](a55_0x47a174[_0x3015f3(0x1de)](_0x3015f3(0x202)));const _0x235633=a55_0x4d0954[_0x3015f3(0x1fe)](process[_0x3015f3(0x20b)](),_0x35813c[_0x3015f3(0x1bf)])||'.';return console['error'](a55_0x47a174[_0x3015f3(0x225)](_0x3015f3(0x215)+_0x235633)),console['error'](a55_0x47a174[_0x3015f3(0x225)](_0x3015f3(0x1ae)+_0x35813c[_0x3015f3(0x1be)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a55_0x5029cc(0x260)]='workflow:push';[a55_0x5029cc(0x1ee)]=a55_0x5029cc(0x23e);async['execute'](_0x4b29ad){const _0x12932c=a55_0x5029cc,{options:_0x1edfe5,args:_0x555083,tdx:_0x2981fc}=_0x4b29ad,_0x1f4bd2=this[_0x12932c(0x13e)](_0x555083,_0x1edfe5),_0x361655=_0x1edfe5,{revision:_0x902a4c,skipValidation:_0x4d3a4a,backfill:_0x52123a}=_0x361655,_0x2bbee3=_0x52123a===undefined?undefined:!_0x52123a;_0x1edfe5['verbose']&&(_0x1f4bd2&&console['error'](_0x12932c(0x8d)+_0x1f4bd2),_0x902a4c&&console['error'](_0x12932c(0xc4)+_0x902a4c),_0x1edfe5['dryRun']&&console['error'](_0x12932c(0x11c)),_0x4d3a4a&&console['error'](_0x12932c(0x228)),_0x52123a&&console[_0x12932c(0x19c)]('Schedule:\x20backfill\x20runs\x20enabled\x20(--backfill)'));let _0x260d83;try{_0x260d83=await withSpinner(_0x12932c(0x109),()=>_0x2981fc['workflow'][_0x12932c(0x1d0)]({'sourceDir':_0x1f4bd2,'revision':_0x902a4c,'skipValidation':_0x4d3a4a,'skipSchedule':_0x2bbee3}),{'verbose':_0x1edfe5[_0x12932c(0x1af)]});}catch(_0x5337ca){if(_0x5337ca instanceof Error&&_0x5337ca[_0x12932c(0x206)][_0x12932c(0xdf)](_0x12932c(0xa4)))return console[_0x12932c(0x19c)](a55_0x47a174[_0x12932c(0x25a)](_0x12932c(0x25b)),_0x12932c(0x157)),_0x1edfe5[_0x12932c(0x149)]?console[_0x12932c(0x19c)](a55_0x47a174['dim'](_0x12932c(0x187)+_0x1edfe5[_0x12932c(0x149)]+_0x12932c(0x179)+_0x1edfe5[_0x12932c(0x149)]+'\x27')):console[_0x12932c(0x19c)](a55_0x47a174['dim']('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x5337ca;}const _0x3fca9f=_0x260d83[_0x12932c(0x1a8)];console['error']('✔\x20Project:\x20'+_0x3fca9f[_0x12932c(0x1be)]),console[_0x12932c(0x19c)](_0x12932c(0x9d)+_0x3fca9f[_0x12932c(0x1ac)]),console[_0x12932c(0x19c)](_0x12932c(0x269)+_0x3fca9f['revision']),console[_0x12932c(0x19c)]('\x20\x20Changes:\x20'+a55_0x47a174[_0x12932c(0x1de)]('+'+_0x3fca9f[_0x12932c(0x12a)][_0x12932c(0x136)]+_0x12932c(0xf2))+',\x20'+(a55_0x47a174[_0x12932c(0x175)]('~'+_0x3fca9f[_0x12932c(0x12a)][_0x12932c(0x214)]+_0x12932c(0x1f3))+',\x20')+(a55_0x47a174[_0x12932c(0x25a)]('-'+_0x3fca9f['summary'][_0x12932c(0x16f)]+_0x12932c(0x148))+',\x20')+(''+a55_0x47a174['dim'](_0x3fca9f[_0x12932c(0x12a)][_0x12932c(0x1b7)]+'\x20unchanged')));for(const _0x2789d1 of _0x3fca9f['changes']){_0x2789d1[_0x12932c(0x11a)]==='modified'&&_0x2789d1[_0x12932c(0x18c)]&&(console['error']('\x0a'+a55_0x47a174[_0x12932c(0x138)](_0x12932c(0x24e)+_0x2789d1[_0x12932c(0x100)])),console[_0x12932c(0x19c)](_0x2789d1[_0x12932c(0x18c)]));}if(!_0x3fca9f[_0x12932c(0x1f4)])return console[_0x12932c(0x19c)](a55_0x47a174[_0x12932c(0x1de)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x12932c(0xd3)](_0x2981fc,_0x3fca9f[_0x12932c(0x1be)],_0x1edfe5['site']),0x0;if(_0x1edfe5[_0x12932c(0xa6)])return console[_0x12932c(0x19c)](a55_0x47a174[_0x12932c(0x175)](_0x12932c(0x253))),0x0;if(!_0x1edfe5['yes']){if(!isInteractive())return console[_0x12932c(0x19c)](a55_0x47a174[_0x12932c(0x25a)](_0x12932c(0x1ff)),_0x12932c(0xb3)),console[_0x12932c(0x19c)](a55_0x47a174['dim'](_0x12932c(0x24f))),0x1;const _0x5ccc83=await confirmKey(_0x12932c(0x115));if(!_0x5ccc83)return console[_0x12932c(0x19c)](a55_0x47a174[_0x12932c(0x175)](_0x12932c(0x163)),_0x12932c(0x18e)),0x1;}const _0x480832=await withSpinner(_0x12932c(0xc6),()=>_0x2981fc[_0x12932c(0x1f9)][_0x12932c(0x176)](_0x3fca9f),{'verbose':_0x1edfe5[_0x12932c(0x1af)]}),_0x293216=_0x480832[_0x12932c(0x1a8)];return console[_0x12932c(0x19c)](a55_0x47a174[_0x12932c(0x1de)](_0x12932c(0x258))),console[_0x12932c(0x19c)](_0x12932c(0x1cd)+_0x293216['projectId']),console['error'](_0x12932c(0x269)+_0x293216[_0x12932c(0x26e)]),await this[_0x12932c(0xd3)](_0x2981fc,_0x293216[_0x12932c(0x1be)],_0x1edfe5['site']),0x0;}}function a55_0x5cbb(_0x52dc05,_0x32fc32){_0x52dc05=_0x52dc05-0x8b;const _0x4d42d7=a55_0x4d42();let _0x5cbb1a=_0x4d42d7[_0x52dc05];return _0x5cbb1a;}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a55_0x5029cc(0x260)]='workflow:clone';[a55_0x5029cc(0x1ee)]=a55_0x5029cc(0x10f);async[a55_0x5029cc(0x196)](_0x220685){const _0x22fa2a=a55_0x5029cc,{options:_0x4d07e6,args:_0x33e23f,tdx:_0x5a657d}=_0x220685,_0x302d8c=this[_0x22fa2a(0x13e)](_0x33e23f,_0x4d07e6),_0x48b35a=_0x4d07e6[_0x22fa2a(0x260)],_0x4277c4=_0x4d07e6['revision'],_0x4279df=_0x4d07e6[_0x22fa2a(0xfd)];if(!_0x302d8c)return console['error'](a55_0x47a174[_0x22fa2a(0x25a)](_0x22fa2a(0x25b)),_0x22fa2a(0x25e)),console[_0x22fa2a(0x19c)](a55_0x47a174['dim'](_0x22fa2a(0x147))),console['error'](a55_0x47a174['dim'](_0x22fa2a(0x1fa))),0x1;if(!_0x48b35a)return console[_0x22fa2a(0x19c)](a55_0x47a174[_0x22fa2a(0x25a)](_0x22fa2a(0x25b)),_0x22fa2a(0x19e)),console[_0x22fa2a(0x19c)](a55_0x47a174['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x4d07e6[_0x22fa2a(0x1af)]&&(console['error'](_0x22fa2a(0x8d)+_0x302d8c),console['error']('New\x20project\x20name:\x20'+_0x48b35a),_0x4277c4&&console['error'](_0x22fa2a(0xc4)+_0x4277c4),_0x4d07e6[_0x22fa2a(0xa6)]&&console['error'](_0x22fa2a(0x11c)),_0x4279df&&console[_0x22fa2a(0x19c)](_0x22fa2a(0x228)));const _0x3b90d9=await withSpinner('Analyzing\x20project...',()=>_0x5a657d['workflow']['prepareCloneProject'](_0x302d8c,_0x48b35a,{'revision':_0x4277c4,'skipValidation':_0x4279df}),{'verbose':_0x4d07e6[_0x22fa2a(0x1af)]}),_0x3e1e90=_0x3b90d9[_0x22fa2a(0x1a8)];console['error'](_0x22fa2a(0x183)+_0x3e1e90[_0x22fa2a(0x1ac)]);_0x3e1e90['sourceProjectName']&&console[_0x22fa2a(0x19c)](_0x22fa2a(0xca)+_0x3e1e90[_0x22fa2a(0x192)]);console['error'](_0x22fa2a(0x161)+_0x3e1e90[_0x22fa2a(0xf6)]),console[_0x22fa2a(0x19c)]('Revision:\x20'+_0x3e1e90[_0x22fa2a(0x26e)]),console['error']('Files\x20to\x20upload:\x20'+_0x3e1e90[_0x22fa2a(0x23f)]);_0x3e1e90[_0x22fa2a(0x1e0)]&&(console[_0x22fa2a(0x19c)](a55_0x47a174[_0x22fa2a(0x175)](_0x22fa2a(0xfb)+_0x3e1e90['newProjectName']+_0x22fa2a(0xc3)+_0x3e1e90[_0x22fa2a(0x1bb)]+')')),console[_0x22fa2a(0x19c)](a55_0x47a174['yellow'](_0x22fa2a(0x211))));if(_0x4d07e6[_0x22fa2a(0xa6)])return console[_0x22fa2a(0x19c)](a55_0x47a174[_0x22fa2a(0x175)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x4d07e6['yes']){if(!isInteractive())return console[_0x22fa2a(0x19c)](a55_0x47a174[_0x22fa2a(0x25a)]('\x0aError:'),_0x22fa2a(0xb3)),console[_0x22fa2a(0x19c)](a55_0x47a174[_0x22fa2a(0x225)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x284ea9=_0x3e1e90['sourceProjectName']||a55_0x4d0954[_0x22fa2a(0x273)](_0x302d8c),_0x535d70=_0x3e1e90[_0x22fa2a(0x1e0)]?_0x22fa2a(0x186)+_0x48b35a+'\x22\x20with\x20new\x20revision?':_0x22fa2a(0x90)+_0x284ea9+_0x22fa2a(0x129)+_0x48b35a+'\x22?',_0x381a27=await confirmKey(_0x535d70);if(!_0x381a27)return console['error'](a55_0x47a174[_0x22fa2a(0x175)]('Cancelled')),0x1;}const _0x129849=await withSpinner(_0x3e1e90[_0x22fa2a(0x1e0)]?_0x22fa2a(0x120)+_0x48b35a+'...':_0x22fa2a(0x1b2)+_0x48b35a+_0x22fa2a(0x234),()=>_0x5a657d[_0x22fa2a(0x1f9)][_0x22fa2a(0x15e)](_0x3e1e90),{'verbose':_0x4d07e6['verbose']}),_0x1a006b=_0x129849[_0x22fa2a(0x1a8)];return console[_0x22fa2a(0x19c)](a55_0x47a174[_0x22fa2a(0x1de)](_0x3e1e90[_0x22fa2a(0x1e0)]?_0x22fa2a(0xbe):'✔\x20Clone\x20complete')),console[_0x22fa2a(0x19c)](_0x22fa2a(0x12f)+_0x1a006b[_0x22fa2a(0xf6)]),console[_0x22fa2a(0x19c)]('\x20\x20Project\x20ID:\x20'+_0x1a006b['newProjectId']),console['error'](_0x22fa2a(0x269)+_0x1a006b['revision']),await this[_0x22fa2a(0xd3)](_0x5a657d,_0x1a006b[_0x22fa2a(0xf6)],_0x4d07e6[_0x22fa2a(0x9a)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a55_0x5029cc(0x260)]=a55_0x5029cc(0x170);[a55_0x5029cc(0x1ee)]=a55_0x5029cc(0x17a);async[a55_0x5029cc(0x196)](_0x3eac70){const _0x28388b=a55_0x5029cc,{options:_0x4f8b07,args:_0x3fea73,tdx:_0x466226}=_0x3eac70,_0x317a57=_0x3fea73[0x0];if(!_0x317a57)return console[_0x28388b(0x19c)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x28388b(0x19c)](_0x28388b(0x14a)),0x1;_0x4f8b07[_0x28388b(0x1af)]&&console['error'](_0x28388b(0x24b)+_0x317a57);if(!_0x4f8b07[_0x28388b(0x262)]){if(!isInteractive())return console['error'](a55_0x47a174[_0x28388b(0x25a)]('\x0aError:'),_0x28388b(0xb3)),console[_0x28388b(0x19c)](a55_0x47a174[_0x28388b(0x225)](_0x28388b(0x24f))),0x1;const _0x3b013a=await confirmKey(_0x28388b(0x11b)+_0x317a57+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x3b013a)return console[_0x28388b(0x19c)](a55_0x47a174['yellow'](_0x28388b(0x163))),0x1;}const _0x134ab9=await withSpinner(_0x28388b(0x1db)+_0x317a57+_0x28388b(0x234),()=>_0x466226[_0x28388b(0x1f9)][_0x28388b(0xff)](_0x317a57),{'verbose':_0x4f8b07[_0x28388b(0x1af)]}),_0x4524dd=_0x134ab9[_0x28388b(0x1a8)];return console['error']('✔\x20Deleted\x20project\x20'+_0x4524dd[_0x28388b(0x1be)]),console[_0x28388b(0x19c)]('\x20\x20Project\x20ID:\x20'+_0x4524dd[_0x28388b(0x201)]),0x0;}}export function parseKeyValue(_0xb0660f){const _0x3f578a=a55_0x5029cc,_0x4c68b6=_0xb0660f[_0x3f578a(0x1ad)]('=');if(_0x4c68b6===-0x1)throw new Error(_0x3f578a(0x19a)+_0xb0660f+_0x3f578a(0x20f));const _0x4c04ba=_0xb0660f['substring'](0x0,_0x4c68b6),_0x3d9d73=_0xb0660f[_0x3f578a(0x17d)](_0x4c68b6+0x1);if(!_0x4c04ba)throw new Error(_0x3f578a(0x106));return{'key':_0x4c04ba,'value':_0x3d9d73};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a55_0x5029cc(0x260)]=a55_0x5029cc(0x1f6);['description']=a55_0x5029cc(0x160);async[a55_0x5029cc(0x196)](_0x4b9e20){const _0xcfef84=a55_0x5029cc,{options:_0x11cf6c,args:_0x76dd07,tdx:_0x3177bb}=_0x4b9e20,_0x25b01e=this[_0xcfef84(0x1e3)](_0x76dd07,_0x11cf6c);if(!_0x25b01e)return 0x1;_0x11cf6c[_0xcfef84(0x1af)]&&console[_0xcfef84(0x19c)](_0xcfef84(0x24b)+_0x25b01e);const _0x497b0e=await withSpinner(_0xcfef84(0xa1),()=>_0x3177bb[_0xcfef84(0x1f9)][_0xcfef84(0xe2)](_0x25b01e),{'verbose':_0x11cf6c['verbose']}),{secrets:_0x3f0811}=_0x497b0e[_0xcfef84(0x1a8)];return console[_0xcfef84(0x19c)]('✔\x20Found\x20'+_0x3f0811[_0xcfef84(0x1d7)]+_0xcfef84(0x1e4)+(_0x3f0811['length']!==0x1?'s':'')),await handleSDKOutput(_0x3f0811,_0x11cf6c),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a55_0x5029cc(0x260)]=a55_0x5029cc(0x15c);[a55_0x5029cc(0x1ee)]=a55_0x5029cc(0x103);async['execute'](_0x1ba151){const _0x257cc3=a55_0x5029cc,{options:_0x1dc692,args:_0x879ca3,tdx:_0x274d02}=_0x1ba151;let _0x5d55ed,_0x29e766;if(_0x879ca3[_0x257cc3(0x1d7)]>=0x1&&!_0x879ca3[0x0][_0x257cc3(0xdf)]('='))_0x5d55ed=_0x879ca3[0x0],_0x29e766=_0x879ca3[_0x257cc3(0x1b0)](0x1);else{if(_0x879ca3[_0x257cc3(0x1d7)]>=0x1&&_0x1dc692[_0x257cc3(0x149)])_0x5d55ed=_0x1dc692['workflowProject'],_0x29e766=_0x879ca3;else return _0x879ca3['length']>=0x1?(console['error']('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x257cc3(0x1e9)),0x1):(console[_0x257cc3(0x19c)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x257cc3(0x19c)](_0x257cc3(0x105)),0x1);}if(_0x29e766[_0x257cc3(0x1d7)]===0x0)return console['error'](_0x257cc3(0x1c9)),console[_0x257cc3(0x19c)](_0x257cc3(0x105)),0x1;const _0x2b1270={};try{for(const _0x4906dc of _0x29e766){const {key:_0x44f827,value:_0x4ae683}=parseKeyValue(_0x4906dc);_0x2b1270[_0x44f827]=_0x4ae683;}}catch(_0x3b33b8){return _0x3b33b8 instanceof Error&&console[_0x257cc3(0x19c)](a55_0x47a174[_0x257cc3(0x25a)]('Error:'),_0x3b33b8[_0x257cc3(0x206)]),0x1;}const _0x561b8c=Object['keys'](_0x2b1270);_0x1dc692[_0x257cc3(0x1af)]&&(console[_0x257cc3(0x19c)](_0x257cc3(0x24b)+_0x5d55ed),console[_0x257cc3(0x19c)](_0x257cc3(0x16c)+_0x561b8c[_0x257cc3(0x1a6)](',\x20')));const _0x5cc22b=await withSpinner(_0x561b8c[_0x257cc3(0x1d7)]===0x1?'Setting\x20secret...':_0x257cc3(0xe8)+_0x561b8c[_0x257cc3(0x1d7)]+_0x257cc3(0xb8),()=>_0x274d02['workflow']['setSecrets'](_0x5d55ed,_0x2b1270),{'verbose':_0x1dc692['verbose']}),_0x3b5174=_0x5cc22b[_0x257cc3(0x1a8)];return console['error'](_0x561b8c[_0x257cc3(0x1d7)]===0x1?_0x257cc3(0xe6)+_0x3b5174['keys'][0x0]+_0x257cc3(0x23c)+_0x3b5174[_0x257cc3(0x1be)]+'\x27':'✔\x20'+_0x3b5174[_0x257cc3(0xb6)][_0x257cc3(0x1d7)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x3b5174[_0x257cc3(0x1be)]+'\x27'),(_0x1dc692[_0x257cc3(0xce)]||_0x1dc692[_0x257cc3(0xf9)])&&await handleSingleObjectOutput(_0x3b5174,_0x1dc692),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a55_0x5029cc(0x208);['description']=a55_0x5029cc(0x16e);async['execute'](_0x20fc9d){const _0xaa19a=a55_0x5029cc,{options:_0x22aede,args:_0x5db66d,tdx:_0x57aee9}=_0x20fc9d;let _0x39a498,_0x33da18;if(_0x5db66d[_0xaa19a(0x1d7)]>=0x2)_0x39a498=_0x5db66d[0x0],_0x33da18=_0x5db66d[0x1];else{if(_0x5db66d[_0xaa19a(0x1d7)]===0x1&&_0x22aede[_0xaa19a(0x149)])_0x39a498=_0x22aede['workflowProject'],_0x33da18=_0x5db66d[0x0];else return _0x5db66d['length']===0x1?(console[_0xaa19a(0x19c)](_0xaa19a(0x172)),console[_0xaa19a(0x19c)](_0xaa19a(0x1e9)),0x1):(console[_0xaa19a(0x19c)](_0xaa19a(0xa2)),console['error'](_0xaa19a(0x1ab)),0x1);}_0x22aede[_0xaa19a(0x1af)]&&(console[_0xaa19a(0x19c)](_0xaa19a(0x24b)+_0x39a498),console['error'](_0xaa19a(0x218)+_0x33da18));if(!_0x22aede[_0xaa19a(0x262)]){if(!isInteractive())return console['error'](a55_0x47a174[_0xaa19a(0x25a)](_0xaa19a(0x1ff)),_0xaa19a(0xb3)),console[_0xaa19a(0x19c)](a55_0x47a174[_0xaa19a(0x225)](_0xaa19a(0x24f))),0x1;const _0x24c9c8=await confirmKey(_0xaa19a(0x243)+_0x33da18+_0xaa19a(0x14e)+_0x39a498+'\x27?');if(!_0x24c9c8)return console[_0xaa19a(0x19c)](a55_0x47a174[_0xaa19a(0x175)](_0xaa19a(0x163))),0x1;}const _0x9f1ca9=await withSpinner(_0xaa19a(0xc0),()=>_0x57aee9['workflow']['deleteSecret'](_0x39a498,_0x33da18),{'verbose':_0x22aede[_0xaa19a(0x1af)]}),_0x1f4152=_0x9f1ca9[_0xaa19a(0x1a8)];return console[_0xaa19a(0x19c)](_0xaa19a(0xe6)+_0x1f4152[_0xaa19a(0x114)]+_0xaa19a(0x94)+_0x1f4152[_0xaa19a(0x1be)]+'\x27'),(_0x22aede['json']||_0x22aede[_0xaa19a(0xf9)])&&await handleSingleObjectOutput(_0x1f4152,_0x22aede),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(_0x3558d7){const _0x1e8bc4=a55_0x5029cc,_0x518c4d=Math[_0x1e8bc4(0xac)](_0x3558d7/0x3e8),_0x85a067=Math[_0x1e8bc4(0xac)](_0x518c4d/0x3c),_0x476e44=Math['floor'](_0x85a067/0x3c),_0x256c0a=Math[_0x1e8bc4(0xac)](_0x476e44/0x18);if(_0x256c0a>0x0){const _0x1ed80c=_0x476e44%0x18;return _0x1ed80c>0x0?_0x256c0a+'d\x20'+_0x1ed80c+'h':_0x256c0a+'d';}else{if(_0x476e44>0x0){const _0x1ba45f=_0x85a067%0x3c;return _0x1ba45f>0x0?_0x476e44+'h\x20'+_0x1ba45f+'m':_0x476e44+'h';}else{if(_0x85a067>0x0){const _0x33e2d7=_0x518c4d%0x3c;return _0x33e2d7>0x0?_0x85a067+'m\x20'+_0x33e2d7+'s':_0x85a067+'m';}else return _0x518c4d+'s';}}}function formatTimestamp(_0x9193fd,_0x5cb471){const _0x3c543f=a55_0x5029cc,_0x50c364=new Date(_0x9193fd),_0x5c8cfb=String(_0x50c364[_0x3c543f(0x1d5)]())[_0x3c543f(0x1c0)](0x2,'0'),_0x52eb20=String(_0x50c364[_0x3c543f(0xa0)]())[_0x3c543f(0x1c0)](0x2,'0'),_0x5cda2e=_0x5c8cfb+':'+_0x52eb20,_0x487d3a=_0x50c364[_0x3c543f(0x11d)]()===_0x5cb471[_0x3c543f(0x11d)]()&&_0x50c364[_0x3c543f(0x245)]()===_0x5cb471['getMonth']()&&_0x50c364['getDate']()===_0x5cb471[_0x3c543f(0x18f)]();if(_0x487d3a)return _0x5cda2e;else{const _0x55394a=String(_0x50c364[_0x3c543f(0x245)]()+0x1)['padStart'](0x2,'0'),_0x2acc70=String(_0x50c364[_0x3c543f(0x18f)]())[_0x3c543f(0x1c0)](0x2,'0');return _0x55394a+'-'+_0x2acc70+'\x20'+_0x5cda2e;}}function formatDate(_0x443583){const _0x334b9e=a55_0x5029cc,_0x3fde10=_0x443583['getFullYear'](),_0x3717d0=String(_0x443583['getMonth']()+0x1)[_0x334b9e(0x1c0)](0x2,'0'),_0x5853f9=String(_0x443583[_0x334b9e(0x18f)]())[_0x334b9e(0x1c0)](0x2,'0');return _0x3fde10+'-'+_0x3717d0+'-'+_0x5853f9;}function getTaskStateIcon(_0x511ef2){const _0x1905b1={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x1905b1[_0x511ef2]||'⚪';}function getBarChar(_0x18dace){const _0x23a78e=a55_0x5029cc;return _0x18dace===_0x23a78e(0x19c)||_0x18dace===_0x23a78e(0x140)?'×':'─';}function getBarColor(_0x23d02e){const _0x4046cd=a55_0x5029cc,_0x1213ec={'success':a55_0x47a174[_0x4046cd(0x1de)],'error':a55_0x47a174[_0x4046cd(0x25a)],'group_error':a55_0x47a174['red'],'running':a55_0x47a174['blue'],'blocked':a55_0x47a174[_0x4046cd(0x175)],'planned':a55_0x47a174[_0x4046cd(0x225)],'canceling':a55_0x47a174[_0x4046cd(0x175)]};return _0x1213ec[_0x23d02e]||a55_0x47a174[_0x4046cd(0x1b1)];}function parseTaskName(_0x252d83){const _0x5d881d=a55_0x5029cc;let _0x15c5e5=_0x252d83[_0x5d881d(0x22f)](/^\++/,'');const _0x29f144=_0x15c5e5['split']('+'),_0x38879c=_0x29f144[_0x5d881d(0x1d7)]>0x1?_0x29f144['length']-0x2:0x0,_0x367b77=_0x29f144[_0x29f144['length']-0x1]||_0x15c5e5;return{'level':_0x38879c,'name':'+'+_0x367b77};}function truncateTaskName(_0x5bf110,_0x5cc51f){const _0x2dcf09=a55_0x5029cc,_0x14df40=stringWidth(_0x5bf110);if(_0x14df40<=_0x5cc51f)return _0x5bf110;let _0x20132f=_0x5bf110;while(stringWidth(_0x20132f+'…')>_0x5cc51f&&_0x20132f[_0x2dcf09(0x1d7)]>0x0){_0x20132f=_0x20132f[_0x2dcf09(0x1b0)](0x0,-0x1);}return _0x20132f+'…';}function calculateTimeScale(_0x3aadf7,_0x5c278f){const _0x23094a=a55_0x5029cc;return{'startTime':_0x3aadf7[_0x23094a(0x9c)],'endTime':_0x3aadf7[_0x23094a(0xb2)],'durationMs':_0x3aadf7[_0x23094a(0x21a)],'msPerChar':_0x3aadf7[_0x23094a(0x21a)]/_0x5c278f};}function timeToPosition(_0x2d103c,_0x57cd14,_0x3b0503){const _0x478c2e=a55_0x5029cc,_0x429224=_0x2d103c-_0x57cd14[_0x478c2e(0x255)],_0x4519d2=Math['floor'](_0x429224/_0x57cd14['msPerChar']);return Math[_0x478c2e(0x119)](0x0,Math['min'](_0x4519d2,_0x3b0503));}function renderTimeAxis(_0x854754,_0x3b012f){const _0xd8d4df=a55_0x5029cc,_0x591ef3=Math[_0xd8d4df(0x226)](TIMELINE_CONFIG[_0xd8d4df(0x1e5)],Math['max'](TIMELINE_CONFIG[_0xd8d4df(0x91)],Math[_0xd8d4df(0xac)](_0x3b012f/TIMELINE_CONFIG[_0xd8d4df(0x1aa)]))),_0x39ba21=_0x854754['durationMs']/(_0x591ef3-0x1),_0x896d5d=new Date(_0x854754[_0xd8d4df(0x255)]),_0x5a75b3=[];for(let _0x1d6ec5=0x0;_0x1d6ec5<_0x591ef3;_0x1d6ec5++){const _0x2a6074=_0x854754[_0xd8d4df(0x255)]+_0x1d6ec5*_0x39ba21,_0xbbaab9=timeToPosition(_0x2a6074,_0x854754,_0x3b012f),_0x3bf48f=formatTimestamp(_0x2a6074,_0x896d5d);_0x5a75b3[_0xd8d4df(0x221)]({'pos':_0xbbaab9,'text':_0x3bf48f});}const _0x5da7aa=new Array(_0x3b012f)[_0xd8d4df(0x156)]('\x20');let _0x2d18a6=-0x1;for(const {pos:_0xf9c7a0,text:_0x3b3a7c}of _0x5a75b3){let _0x32dfaa=Math[_0xd8d4df(0x119)](0x0,_0xf9c7a0-Math[_0xd8d4df(0xac)](_0x3b3a7c[_0xd8d4df(0x1d7)]/0x2));_0x32dfaa<=_0x2d18a6+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x32dfaa=_0x2d18a6+TIMELINE_CONFIG[_0xd8d4df(0x272)]+0x1);_0x32dfaa+_0x3b3a7c[_0xd8d4df(0x1d7)]>_0x3b012f&&(_0x32dfaa=_0x3b012f-_0x3b3a7c[_0xd8d4df(0x1d7)]);if(_0x32dfaa>=0x0&&_0x32dfaa+_0x3b3a7c['length']<=_0x3b012f&&_0x32dfaa>_0x2d18a6){for(let _0x58256e=0x0;_0x58256e<_0x3b3a7c[_0xd8d4df(0x1d7)];_0x58256e++){_0x5da7aa[_0x32dfaa+_0x58256e]=_0x3b3a7c[_0x58256e];}_0x2d18a6=_0x32dfaa+_0x3b3a7c[_0xd8d4df(0x1d7)]-0x1;}}return _0x5da7aa[_0xd8d4df(0x1a6)]('');}function renderTaskRow(_0x16f4cb,_0x2b7253,_0x1c567c,_0xb33ac){const _0x25325e=a55_0x5029cc,{level:_0xf787a7,name:_0x4863a9}=parseTaskName(_0x16f4cb[_0x25325e(0x260)]),_0x1aa46a='\x20'[_0x25325e(0xab)](_0xf787a7),_0x5b4252=_0x16f4cb[_0x25325e(0x188)]?'('+formatElapsed(_0x16f4cb[_0x25325e(0x188)][_0x25325e(0x21a)])+')':'',_0x26b53b=stringWidth(_0x5b4252),_0xefafa0=_0xf787a7*0x1,_0x1890fd=_0xb33ac-_0xefafa0-_0x26b53b-0x1,_0x435d21=truncateTaskName(_0x4863a9,_0x1890fd),_0x152c2f=_0x1aa46a+_0x435d21,_0x20e729=stringWidth(_0x152c2f),_0x6b0d3b=_0xb33ac-_0x20e729-_0x26b53b,_0x14dcd8=_0x152c2f+'\x20'['repeat'](Math[_0x25325e(0x119)](0x1,_0x6b0d3b))+a55_0x47a174[_0x25325e(0x225)](_0x5b4252),_0x5331ee=getTaskStateIcon(_0x16f4cb[_0x25325e(0x11f)]),_0x33bc56=new Array(_0x1c567c)[_0x25325e(0x156)]('\x20');if(_0x16f4cb[_0x25325e(0x188)]){const _0x5f5df9=timeToPosition(_0x16f4cb[_0x25325e(0x188)][_0x25325e(0x9c)],_0x2b7253,_0x1c567c),_0x1d2dad=timeToPosition(_0x16f4cb['window'][_0x25325e(0xb2)],_0x2b7253,_0x1c567c),_0x42ac2b=getBarChar(_0x16f4cb[_0x25325e(0x11f)]),_0x4335be=Math['max'](_0x5f5df9+0x1,_0x1d2dad);for(let _0x55df1f=_0x5f5df9;_0x55df1f<Math[_0x25325e(0x226)](_0x4335be,_0x1c567c);_0x55df1f++){_0x33bc56[_0x55df1f]=_0x42ac2b;}}const _0x4c3d20=getBarColor(_0x16f4cb[_0x25325e(0x11f)]),_0x15154f=_0x33bc56[_0x25325e(0x14d)](_0x1844de=>_0x1844de==='\x20'?'\x20':_0x4c3d20(_0x1844de))[_0x25325e(0x1a6)]('');return _0x5331ee+'\x20'+_0x14dcd8+'│'+_0x15154f+'│';}function calculateStats(_0x192cdf){const _0x178f91=a55_0x5029cc,_0x441599={'total':_0x192cdf[_0x178f91(0x1d7)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x1665a7 of _0x192cdf){if(_0x1665a7[_0x178f91(0x11f)]===_0x178f91(0x1ca))_0x441599[_0x178f91(0x1ca)]++;else{if(_0x1665a7[_0x178f91(0x11f)]==='error'||_0x1665a7[_0x178f91(0x11f)]===_0x178f91(0x140))_0x441599[_0x178f91(0x19c)]++;else _0x1665a7['state']===_0x178f91(0x97)?_0x441599[_0x178f91(0x97)]++:_0x441599[_0x178f91(0xda)]++;}}return _0x441599;}function formatStats(_0x13d4ef){const _0x4bfcd8=a55_0x5029cc;return[_0x4bfcd8(0x1b3)+_0x13d4ef[_0x4bfcd8(0x169)],'✅\x20'+_0x13d4ef[_0x4bfcd8(0x1ca)],'❌\x20'+_0x13d4ef[_0x4bfcd8(0x19c)],_0x4bfcd8(0x26a)+_0x13d4ef[_0x4bfcd8(0x97)],'⏳\x20'+_0x13d4ef[_0x4bfcd8(0xda)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a55_0x5029cc(0x260)]=a55_0x5029cc(0x17e);[a55_0x5029cc(0x1ee)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a55_0x5029cc(0x196)](_0x1e6e4c){const _0x3842c9=a55_0x5029cc,{options:_0x2e4d94,args:_0x3f6c9c,tdx:_0x3715c1}=_0x1e6e4c;let _0x3856d8,_0x3ae24b,_0x2dd3d2=![];if(_0x3f6c9c[0x0]){if(_0x3f6c9c[0x0]['includes']('.')){const _0x5792a4=this[_0x3842c9(0x1e1)](_0x3f6c9c,_0x2e4d94);if(!_0x5792a4)return 0x1;_0x3856d8=_0x5792a4[_0x3842c9(0x1be)],_0x3ae24b=_0x5792a4['workflowName'];}else{_0x3ae24b=_0x3f6c9c[0x0],_0x3856d8=_0x2e4d94[_0x3842c9(0x149)];if(!_0x3856d8)return console[_0x3842c9(0x19c)](a55_0x47a174['red'](_0x3842c9(0x25b)),_0x3842c9(0x1e8)),0x1;_0x2dd3d2=!![];}}else{const _0x5d8ee3=this[_0x3842c9(0x1e1)](_0x3f6c9c,_0x2e4d94);if(!_0x5d8ee3)return 0x1;_0x3856d8=_0x5d8ee3[_0x3842c9(0x1be)],_0x3ae24b=_0x5d8ee3[_0x3842c9(0x13b)];}if(_0x2e4d94['verbose']){if(_0x3856d8&&_0x3ae24b)console[_0x3842c9(0x19c)](_0x3842c9(0x95)+_0x3856d8+'.'+_0x3ae24b);else _0x3856d8&&console[_0x3842c9(0x19c)](_0x3842c9(0xe7)+_0x3856d8);}const _0x5e9b2f=_0x2e4d94[_0x3842c9(0x259)],_0x4e2bd=_0x2e4d94[_0x3842c9(0x184)];if(_0x5e9b2f){_0x4e2bd&&console['error'](a55_0x47a174[_0x3842c9(0x175)](_0x3842c9(0x16b)),_0x3842c9(0xf7));const _0x54a271=_0x2e4d94['follow'];return _0x54a271?await this[_0x3842c9(0x13a)](_0x1e6e4c,_0x5e9b2f):await this[_0x3842c9(0xeb)](_0x1e6e4c,_0x5e9b2f,_0x2e4d94),0x0;}if(_0x4e2bd){const _0x1eb546=await withSpinner(_0x3842c9(0xae),()=>_0x3715c1['workflow']['sessions']({'projectName':_0x3856d8,'workflowName':_0x3ae24b,'limit':0x64}),{'verbose':_0x2e4d94['verbose']}),_0x536d53=_0x1eb546[_0x3842c9(0x1a8)][_0x3842c9(0x1df)](_0x5ad801=>_0x5ad801['id']===_0x4e2bd);if(!_0x536d53)return console[_0x3842c9(0x19c)](a55_0x47a174[_0x3842c9(0x25a)](_0x3842c9(0x25b)),'Session\x20not\x20found:\x20'+_0x4e2bd),0x1;if(!_0x536d53['lastAttempt']?.['id'])return console[_0x3842c9(0x19c)](a55_0x47a174[_0x3842c9(0x25a)](_0x3842c9(0x25b)),'Session\x20'+_0x4e2bd+_0x3842c9(0x1a5)),0x1;const _0x29ec52=_0x536d53[_0x3842c9(0xa9)]['id'];_0x2e4d94[_0x3842c9(0x1af)]&&console[_0x3842c9(0x19c)](_0x3842c9(0x248)+_0x29ec52+_0x3842c9(0x126)+_0x4e2bd);const _0x2e821d=_0x2e4d94[_0x3842c9(0x1a3)];return _0x2e821d?await this[_0x3842c9(0x13a)](_0x1e6e4c,_0x29ec52):await this[_0x3842c9(0xeb)](_0x1e6e4c,_0x29ec52,_0x2e4d94),0x0;}const _0x22cfd3=await withSpinner(_0x3842c9(0x17c),()=>_0x3715c1[_0x3842c9(0x1f9)][_0x3842c9(0xad)]({'projectName':_0x3856d8,'workflowName':_0x3ae24b,'limit':_0x2e4d94[_0x3842c9(0x1ec)]||0x32}),{'verbose':_0x2e4d94[_0x3842c9(0x1af)]}),_0x288073=_0x22cfd3['data'];if(_0x288073[_0x3842c9(0x1d7)]===0x0){if(_0x3856d8&&_0x3ae24b)console[_0x3842c9(0x19c)]('No\x20sessions\x20found\x20for:\x20'+_0x3856d8+'.'+_0x3ae24b);else _0x3856d8?console['error'](_0x3842c9(0x1c8)+_0x3856d8):(console[_0x3842c9(0x19c)](_0x3842c9(0x244)),console[_0x3842c9(0x19c)](a55_0x47a174[_0x3842c9(0x225)](_0x3842c9(0x246))));return 0x0;}_0x288073['sort']((_0x1e04f1,_0x1ca5be)=>{const _0x234f19=_0x3842c9,_0x297e56=_0x1e04f1[_0x234f19(0xf1)]||'',_0x10cca5=_0x1ca5be[_0x234f19(0xf1)]||'';return _0x10cca5[_0x234f19(0xa8)](_0x297e56);});if(_0x2e4d94['json']||_0x2e4d94['jsonl'])return await handleSDKOutput(_0x288073,_0x2e4d94),0x0;let _0x4c6047;if(_0x2dd3d2){const _0x50f383=_0x288073[0x0];if(!_0x50f383[_0x3842c9(0xa9)]?.['id'])return console['error'](_0x3842c9(0x122)),0x0;_0x4c6047=_0x50f383['lastAttempt']['id'],_0x2e4d94['verbose']&&console['error'](_0x3842c9(0x22a)+_0x50f383['sessionTime']);}else{const _0x3db6e5=_0x288073[_0x3842c9(0x14d)](_0xaafcf7=>{const _0x59412d=_0x3842c9,_0x452cd0=getAttemptStatusDisplay(_0xaafcf7[_0x59412d(0xa9)]);return{'title':_0xaafcf7[_0x59412d(0x1c1)]?.[_0x59412d(0x260)]+'.'+_0xaafcf7[_0x59412d(0x1f9)]?.[_0x59412d(0x260)]+_0x59412d(0x10c)+_0xaafcf7[_0x59412d(0xf1)]+'\x20'+_0x452cd0[_0x59412d(0x212)],'value':_0xaafcf7[_0x59412d(0xa9)]?.['id']||'','description':_0x452cd0[_0x59412d(0xa3)]};}),_0x567d64=await a55_0x110a93({'type':_0x3842c9(0x235),'name':'attemptId','message':_0x3842c9(0x159),'choices':_0x3db6e5[_0x3842c9(0xaf)](_0x4aab77=>_0x4aab77[_0x3842c9(0x11e)]!=='')});if(!_0x567d64['attemptId'])return 0x0;_0x4c6047=_0x567d64['attemptId'];}const _0x2d0531=_0x2e4d94[_0x3842c9(0x1a3)];return _0x2d0531?await this[_0x3842c9(0x13a)](_0x1e6e4c,_0x4c6047):await this[_0x3842c9(0xeb)](_0x1e6e4c,_0x4c6047,_0x2e4d94),0x0;}async[a55_0x5029cc(0xeb)](_0x3267c1,_0x2dbdea,_0x2fb1d5){const _0x2c23f4=a55_0x5029cc,{tdx:_0x3e07fc}=_0x3267c1;let _0xe5e158,_0x1b9008;try{[_0xe5e158,_0x1b9008]=await Promise['all']([_0x3e07fc[_0x2c23f4(0x1f9)][_0x2c23f4(0xcd)](_0x2dbdea),_0x3e07fc[_0x2c23f4(0x1f9)]['tasks'](_0x2dbdea,![])]);}catch(_0x3aaa9c){console[_0x2c23f4(0x19c)](a55_0x47a174[_0x2c23f4(0x25a)](_0x2c23f4(0x271)));_0x2fb1d5[_0x2c23f4(0x1af)]&&console[_0x2c23f4(0x19c)](_0x3aaa9c);throw _0x3aaa9c;}if(_0x2fb1d5['json']||_0x2fb1d5['jsonl']){const _0x88a371=this[_0x2c23f4(0x15f)](_0xe5e158,_0x1b9008);await handleSDKOutput([_0x88a371],_0x2fb1d5);return;}const _0x38be37=_0x3e07fc[_0x2c23f4(0x217)][_0x2c23f4(0x9a)],_0x4b116d=this[_0x2c23f4(0x1e2)](_0xe5e158,_0x1b9008,_0x38be37);console[_0x2c23f4(0x241)](_0x4b116d);}async[a55_0x5029cc(0x13a)](_0xdd6a45,_0x515c0b){const _0x429efd=a55_0x5029cc,{tdx:_0xe65221}=_0xdd6a45,_0x21f70d=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x211999=TIMELINE_CONFIG[_0x429efd(0x9b)];let _0x5307ff=0x0;while(_0x5307ff<_0x211999){process[_0x429efd(0x10d)][_0x429efd(0x15a)]&&process['stdout'][_0x429efd(0xc2)]('\x1bc');let _0x56b425,_0x71eeff;try{[_0x56b425,_0x71eeff]=await Promise[_0x429efd(0x1a9)]([_0xe65221[_0x429efd(0x1f9)][_0x429efd(0xcd)](_0x515c0b),_0xe65221[_0x429efd(0x1f9)][_0x429efd(0xc1)](_0x515c0b,![])]);}catch(_0x3866ed){console[_0x429efd(0x19c)](a55_0x47a174['red'](_0x429efd(0x1f2)));_0x5307ff>0x0&&console['error'](a55_0x47a174[_0x429efd(0x225)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x5307ff));throw _0x3866ed;}const _0xe043b2=_0xe65221[_0x429efd(0x217)][_0x429efd(0x9a)],_0x28fca6=this[_0x429efd(0x1e2)](_0x56b425,_0x71eeff,_0xe043b2);console['log'](_0x28fca6);const _0x5cc128=_0x56b425[_0x429efd(0xde)]&&_0x71eeff[_0x429efd(0xf4)](_0x38f171=>_0x38f171[_0x429efd(0x11f)]!==_0x429efd(0x97)&&_0x38f171[_0x429efd(0x11f)]!==_0x429efd(0x231));if(_0x5cc128){console['error'](a55_0x47a174['green']('\x0a✔\x20Attempt\x20complete'));break;}console[_0x429efd(0x19c)](a55_0x47a174[_0x429efd(0x225)]('\x0aPolling...\x20('+_0x5307ff*0x2+_0x429efd(0x20a))),await new Promise(_0x2956a9=>setTimeout(_0x2956a9,_0x21f70d)),_0x5307ff++;}_0x5307ff>=_0x211999&&console[_0x429efd(0x19c)](a55_0x47a174[_0x429efd(0x175)](_0x429efd(0x130)));}[a55_0x5029cc(0x1e2)](_0x15f0fa,_0x1d9c93,_0x210cd7){const _0x2e7d66=a55_0x5029cc,_0x49ab7c=[],_0x304e09=TIMELINE_CONFIG[_0x2e7d66(0x12d)],_0xfad827=0x5,_0x310725=process[_0x2e7d66(0x10d)][_0x2e7d66(0x127)]||0x78,_0x43e850=_0x310725-_0x304e09-_0xfad827,_0x2d9928=Math[_0x2e7d66(0x119)](TIMELINE_CONFIG[_0x2e7d66(0x177)],Math['min'](_0x43e850,TIMELINE_CONFIG[_0x2e7d66(0x167)])),_0x47de81=new Date(_0x15f0fa['createdAt'])['getTime'](),_0x5df674=_0x15f0fa['finishedAt']?new Date(_0x15f0fa[_0x2e7d66(0x1f8)])[_0x2e7d66(0x22c)]():Date[_0x2e7d66(0x13f)](),_0x2230ad={'start':_0x47de81,'end':_0x5df674,'duration':_0x5df674-_0x47de81},_0x2a56d7=new Map(),_0x23f1c4=[];for(const _0x155eb6 of _0x1d9c93){if(_0x155eb6[_0x2e7d66(0xe9)]){const _0x3e8fd4=new Date(_0x155eb6[_0x2e7d66(0xe9)])[_0x2e7d66(0x22c)](),_0x29fc2b=_0x155eb6['updatedAt']?new Date(_0x155eb6[_0x2e7d66(0x133)])[_0x2e7d66(0x22c)]():Date[_0x2e7d66(0x13f)](),_0x334321={'start':_0x3e8fd4,'end':_0x29fc2b,'duration':_0x29fc2b-_0x3e8fd4};_0x2a56d7[_0x2e7d66(0x166)](_0x155eb6['id'],_0x334321),_0x23f1c4[_0x2e7d66(0x221)]({'name':_0x155eb6[_0x2e7d66(0x250)],'state':_0x155eb6[_0x2e7d66(0x11f)]||_0x2e7d66(0x1da),'window':_0x334321});}else _0x23f1c4[_0x2e7d66(0x221)]({'name':_0x155eb6[_0x2e7d66(0x250)],'state':_0x155eb6[_0x2e7d66(0x11f)]||'planned','window':undefined});}_0x23f1c4['sort']((_0x5f4ffc,_0x466094)=>{const _0x2d4d84=_0x2e7d66;if(!_0x5f4ffc[_0x2d4d84(0x188)])return 0x1;if(!_0x466094[_0x2d4d84(0x188)])return-0x1;return _0x5f4ffc[_0x2d4d84(0x188)][_0x2d4d84(0x9c)]-_0x466094[_0x2d4d84(0x188)]['start'];});const _0x4bf00c=_0x23f1c4[_0x2e7d66(0x1d7)],_0x89b9be=_0x4bf00c>TIMELINE_CONFIG[_0x2e7d66(0x1d1)];_0x89b9be&&_0x23f1c4[_0x2e7d66(0x1c7)](TIMELINE_CONFIG[_0x2e7d66(0x1d1)]);const _0xb990db=calculateTimeScale(_0x2230ad,_0x2d9928),_0xec4ac1=_0x15f0fa[_0x2e7d66(0xde)]?_0x15f0fa[_0x2e7d66(0x1ca)]?a55_0x47a174['green'](_0x2e7d66(0x1ca)):a55_0x47a174['red']('error'):a55_0x47a174[_0x2e7d66(0x117)]('running'),_0x26ad81=_0x15f0fa['project']?.['id'],_0x40aacc=_0x15f0fa[_0x2e7d66(0x184)];let _0x22a02e;if(_0x26ad81&&_0x40aacc){const _0x44a677=getWorkflowAttemptUrl(_0x210cd7,_0x26ad81,_0x40aacc,_0x15f0fa['id']);_0x22a02e=hyperlink(a55_0x47a174['dim'](_0x15f0fa['id']),_0x44a677);}else _0x22a02e=a55_0x47a174[_0x2e7d66(0x225)](_0x15f0fa['id']);_0x49ab7c[_0x2e7d66(0x221)](_0x2e7d66(0xec)+_0x22a02e+_0x2e7d66(0x10c)+_0xec4ac1+_0x2e7d66(0x10c)+formatElapsed(_0x2230ad[_0x2e7d66(0x21a)]));if(_0x23f1c4['length']>0x0){const _0x4bb84b=renderTimeAxis(_0xb990db,_0x2d9928),_0x41ac09=new Date(_0x2230ad[_0x2e7d66(0x9c)]),_0x1b1022=formatDate(_0x41ac09),_0x2f3450=TIMELINE_CONFIG[_0x2e7d66(0x1b5)]+TIMELINE_CONFIG[_0x2e7d66(0x263)]+_0x304e09,_0x376b83=_0x1b1022[_0x2e7d66(0x1c0)](_0x2f3450),_0x14f0c4=a55_0x47a174[_0x2e7d66(0x225)](_0x376b83);_0x49ab7c[_0x2e7d66(0x221)](_0x14f0c4+'\x20'+_0x4bb84b);for(const _0x4434cc of _0x23f1c4){_0x49ab7c['push'](renderTaskRow(_0x4434cc,_0xb990db,_0x2d9928,_0x304e09));}const _0x4ff873=calculateStats(_0x23f1c4);_0x49ab7c[_0x2e7d66(0x221)](formatStats(_0x4ff873)),_0x89b9be&&_0x49ab7c[_0x2e7d66(0x221)](a55_0x47a174[_0x2e7d66(0x175)](_0x2e7d66(0x227)+TIMELINE_CONFIG[_0x2e7d66(0x1d1)]+_0x2e7d66(0x8f)+_0x4bf00c+_0x2e7d66(0x1d2))),_0x49ab7c[_0x2e7d66(0x221)](''),_0x49ab7c[_0x2e7d66(0x221)](a55_0x47a174[_0x2e7d66(0x225)]('💡\x20Tip:\x20Use\x20')+(_0x2e7d66(0x165)+_0x15f0fa['id']+_0x2e7d66(0x1a1))+a55_0x47a174[_0x2e7d66(0x225)]('\x20to\x20see\x20detailed\x20logs'));}else _0x49ab7c[_0x2e7d66(0x221)](_0x2e7d66(0x16a));return _0x49ab7c[_0x2e7d66(0x1a6)]('\x0a');}[a55_0x5029cc(0x15f)](_0x57806d,_0x56aff1){const _0x26327e=a55_0x5029cc,_0x47bba0=new Date(_0x57806d['createdAt'])[_0x26327e(0x22c)](),_0x58d487=_0x57806d[_0x26327e(0x1f8)]?new Date(_0x57806d[_0x26327e(0x1f8)])[_0x26327e(0x22c)]():Date['now'](),_0xded79c=_0x58d487-_0x47bba0,_0x2c2f74=[];for(const _0x3fa0e7 of _0x56aff1){if(_0x3fa0e7['startedAt']){const _0x518c12=new Date(_0x3fa0e7[_0x26327e(0xe9)])[_0x26327e(0x22c)](),_0x21b9fa=_0x3fa0e7[_0x26327e(0x133)]?new Date(_0x3fa0e7[_0x26327e(0x133)])[_0x26327e(0x22c)]():Date[_0x26327e(0x13f)]();_0x2c2f74[_0x26327e(0x221)]({'name':_0x3fa0e7[_0x26327e(0x250)],'state':_0x3fa0e7['state']||_0x26327e(0x1da),'window':{'start':_0x518c12,'end':_0x21b9fa,'duration':_0x21b9fa-_0x518c12}});}else _0x2c2f74['push']({'name':_0x3fa0e7[_0x26327e(0x250)],'state':_0x3fa0e7[_0x26327e(0x11f)]||_0x26327e(0x231),'window':undefined});}const _0x373eda=calculateStats(_0x2c2f74);return{'attempt':{'id':_0x57806d['id'],'status':_0x57806d[_0x26327e(0xde)]?_0x57806d['success']?_0x26327e(0x1ca):_0x26327e(0x19c):'running','createdAt':_0x57806d[_0x26327e(0x123)],'finishedAt':_0x57806d[_0x26327e(0x1f8)],'duration_ms':_0xded79c},'tasks':_0x2c2f74[_0x26327e(0x14d)](_0x4a117b=>({'name':_0x4a117b[_0x26327e(0x260)],'state':_0x4a117b[_0x26327e(0x11f)],'startedAt':_0x4a117b['window']?new Date(_0x4a117b[_0x26327e(0x188)]['start'])[_0x26327e(0xe5)]():null,'updatedAt':_0x4a117b[_0x26327e(0x188)]?new Date(_0x4a117b[_0x26327e(0x188)][_0x26327e(0xb2)])[_0x26327e(0xe5)]():null,'duration_ms':_0x4a117b[_0x26327e(0x188)]?.[_0x26327e(0x21a)]||null})),'stats':_0x373eda};}}function formatScheduleLine(_0x3f6626){const _0x52ff5c=a55_0x5029cc,_0x4b43e0=_0x3f6626[_0x52ff5c(0x98)]?a55_0x47a174[_0x52ff5c(0x175)](_0x52ff5c(0x190)):'',_0x10ac7a=_0x3f6626[_0x52ff5c(0x1c1)]?.[_0x52ff5c(0x260)]?a55_0x47a174[_0x52ff5c(0x225)]('\x20['+_0x3f6626['project'][_0x52ff5c(0x260)]+']'):'',_0x322eb5=_0x3f6626[_0x52ff5c(0x21f)]?a55_0x47a174[_0x52ff5c(0x225)](_0x52ff5c(0xf0)+new Date(_0x3f6626[_0x52ff5c(0x21f)])['toLocaleString']()):'';return _0x52ff5c(0x239)+_0x3f6626['id']+'\x20'+(_0x3f6626[_0x52ff5c(0x1f9)]?.[_0x52ff5c(0x260)]||_0x52ff5c(0xd5))+_0x10ac7a+_0x4b43e0+_0x322eb5;}export class WorkflowSchedulesCommand extends WorkflowBaseCommand{[a55_0x5029cc(0x260)]=a55_0x5029cc(0x137);['description']='List\x20workflow\x20schedules';async[a55_0x5029cc(0x196)](_0x25ad92){const _0x5bcdc6=a55_0x5029cc,{options:_0x8bfbed,args:_0x276132,tdx:_0x46db9e}=_0x25ad92,{scheduleId:_0x58611c}=_0x8bfbed;if(_0x58611c&&_0x276132[0x0])return console['error'](a55_0x47a174[_0x5bcdc6(0x25a)]('Error:'),_0x5bcdc6(0x18b)),console[_0x5bcdc6(0x19c)](a55_0x47a174[_0x5bcdc6(0x225)](_0x5bcdc6(0x112))),0x1;if(_0x58611c){const _0x19eda0=await withSpinner(_0x5bcdc6(0x1fd)+_0x58611c+_0x5bcdc6(0x234),()=>_0x46db9e[_0x5bcdc6(0x1f9)][_0x5bcdc6(0x1dc)](_0x58611c),{'verbose':_0x8bfbed[_0x5bcdc6(0x1af)]}),_0x2dea8f=_0x19eda0['data'];return isStructuredFormat(_0x8bfbed)?await handleSingleObjectOutput(_0x2dea8f,_0x8bfbed):(console[_0x5bcdc6(0x19c)](_0x5bcdc6(0x8c)),console[_0x5bcdc6(0x241)](formatScheduleLine(_0x2dea8f))),0x0;}const _0x3bbd8c=this[_0x5bcdc6(0x1e1)](_0x276132,_0x8bfbed);if(!_0x3bbd8c)return 0x1;const {projectName:_0x2f331e,workflowName:_0x295a43}=_0x3bbd8c,_0x494c58=_0x2f331e?'\x27'+_0x2f331e+(_0x295a43?'.'+_0x295a43:'')+'\x27':undefined,_0x10ce23=await withSpinner(_0x494c58?'Listing\x20schedules\x20for\x20'+_0x494c58+_0x5bcdc6(0x234):_0x5bcdc6(0xbf),()=>_0x2f331e?_0x46db9e[_0x5bcdc6(0x1f9)][_0x5bcdc6(0xd8)](_0x2f331e,{'workflow':_0x295a43,'limit':_0x8bfbed[_0x5bcdc6(0x1ec)]}):_0x46db9e[_0x5bcdc6(0x1f9)]['listSchedules']({'limit':_0x8bfbed[_0x5bcdc6(0x1ec)]}),{'verbose':_0x8bfbed[_0x5bcdc6(0x1af)]}),_0x2fafc3=_0x10ce23[_0x5bcdc6(0x1a8)],_0x55b74b=_0x8bfbed[_0x5bcdc6(0x1ec)]&&_0x2fafc3[_0x5bcdc6(0x1d7)]>=_0x8bfbed[_0x5bcdc6(0x1ec)]?a55_0x47a174[_0x5bcdc6(0x225)](_0x5bcdc6(0x125)):'';console[_0x5bcdc6(0x19c)](_0x5bcdc6(0xd4)+_0x2fafc3[_0x5bcdc6(0x1d7)]+'\x20schedule'+(_0x2fafc3[_0x5bcdc6(0x1d7)]!==0x1?'s':'')+_0x55b74b);if(isStructuredFormat(_0x8bfbed))await handleSDKOutput(_0x2fafc3,_0x8bfbed);else{if(_0x2fafc3[_0x5bcdc6(0x1d7)]===0x0)console['log'](_0x5bcdc6(0x1ce));else for(const _0x168169 of _0x2fafc3){console[_0x5bcdc6(0x241)](formatScheduleLine(_0x168169));}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{['name']=a55_0x5029cc(0x9e);['description']='Enable\x20a\x20workflow\x20schedule';async[a55_0x5029cc(0x196)](_0x7871cc){const _0x210485=a55_0x5029cc,{options:_0x1de12a,args:_0x19601d,tdx:_0x8e8c79}=_0x7871cc,_0x14fb16=_0x19601d[0x0];if(!_0x14fb16)return console[_0x210485(0x19c)](a55_0x47a174[_0x210485(0x25a)](_0x210485(0x25b)),_0x210485(0x1d9)),console[_0x210485(0x19c)](a55_0x47a174[_0x210485(0x225)](_0x210485(0x118))),console[_0x210485(0x19c)](a55_0x47a174['dim'](_0x210485(0x17b))),0x1;const {backfill:_0x1b1429,nextTime:_0x196152}=_0x1de12a,_0x312fcf={};if(_0x1b1429!==undefined)_0x312fcf['skipSchedule']=!_0x1b1429;if(_0x196152!==undefined)_0x312fcf[_0x210485(0xd6)]=_0x196152;const _0x4710dd=await withSpinner('Enabling\x20schedule\x20#'+_0x14fb16+_0x210485(0x234),()=>_0x8e8c79[_0x210485(0x1f9)][_0x210485(0x242)](_0x14fb16,_0x312fcf),{'verbose':_0x1de12a[_0x210485(0x1af)]}),_0x32f6ef=_0x4710dd[_0x210485(0x1a8)];return isStructuredFormat(_0x1de12a)?await handleSingleObjectOutput(_0x32f6ef,_0x1de12a):(console['log'](_0x210485(0x139)+_0x14fb16+_0x210485(0xb5)+(_0x32f6ef['workflow']?.['name']||_0x210485(0x1da))+')'),_0x32f6ef['nextRunTime']&&console['log'](a55_0x47a174[_0x210485(0x225)](_0x210485(0x195)+new Date(_0x32f6ef['nextRunTime'])['toLocaleString']()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a55_0x5029cc(0x260)]=a55_0x5029cc(0x21d);[a55_0x5029cc(0x1ee)]=a55_0x5029cc(0x266);async['execute'](_0x1cf17b){const _0x1cd0fe=a55_0x5029cc,{options:_0xf5de9f,args:_0x4a3582,tdx:_0x3468d7}=_0x1cf17b,_0xc1245f=_0x4a3582[0x0];if(!_0xc1245f)return console[_0x1cd0fe(0x19c)](a55_0x47a174[_0x1cd0fe(0x25a)]('Error:'),_0x1cd0fe(0x1d9)),console[_0x1cd0fe(0x19c)](a55_0x47a174[_0x1cd0fe(0x225)](_0x1cd0fe(0x15d))),console['error'](a55_0x47a174[_0x1cd0fe(0x225)](_0x1cd0fe(0x17b))),0x1;const _0x70df5=await withSpinner(_0x1cd0fe(0x1a4)+_0xc1245f+_0x1cd0fe(0x234),()=>_0x3468d7[_0x1cd0fe(0x1f9)]['disableSchedule'](_0xc1245f),{'verbose':_0xf5de9f[_0x1cd0fe(0x1af)]}),_0x36e56f=_0x70df5[_0x1cd0fe(0x1a8)];return isStructuredFormat(_0xf5de9f)?await handleSingleObjectOutput(_0x36e56f,_0xf5de9f):console['log'](_0x1cd0fe(0x139)+_0xc1245f+_0x1cd0fe(0x1c5)+(_0x36e56f[_0x1cd0fe(0x1f9)]?.[_0x1cd0fe(0x260)]||_0x1cd0fe(0x1da))+')'),0x0;}}
1
+ const a56_0x2e361e=a56_0x527f;(function(_0x14fd4b,_0x3968eb){const _0x36c51b=a56_0x527f,_0x4933c9=_0x14fd4b();while(!![]){try{const _0x1990a3=parseInt(_0x36c51b(0x144))/0x1*(parseInt(_0x36c51b(0x193))/0x2)+-parseInt(_0x36c51b(0x234))/0x3*(parseInt(_0x36c51b(0x18b))/0x4)+-parseInt(_0x36c51b(0x1b4))/0x5*(parseInt(_0x36c51b(0xec))/0x6)+parseInt(_0x36c51b(0x1a1))/0x7+-parseInt(_0x36c51b(0x15a))/0x8+parseInt(_0x36c51b(0x1f3))/0x9+-parseInt(_0x36c51b(0x1dc))/0xa*(-parseInt(_0x36c51b(0x8d))/0xb);if(_0x1990a3===_0x3968eb)break;else _0x4933c9['push'](_0x4933c9['shift']());}catch(_0xd43574){_0x4933c9['push'](_0x4933c9['shift']());}}}(a56_0x1371,0x66c50));import a56_0x515cb3 from'chalk';import{existsSync}from'fs';import a56_0x2b37fe from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import{parseTaskGraph,formatTaskGraph,summarizeTaskGraph,formatWarningSummary}from'../sdk/workflow/task-graph.js';import a56_0x31c40f from'prompts';function getAttemptStatusDisplay(_0x31f7c9){const _0xa6a98d=a56_0x527f;if(!_0x31f7c9)return{'icon':'⏳','text':''};const {done:_0x3fa8ae,success:_0x5ca18b,cancelRequested:_0x51c557}=_0x31f7c9;if(!_0x3fa8ae)return _0x51c557?{'icon':'🛑','text':a56_0x515cb3[_0xa6a98d(0x12c)]('canceling')}:{'icon':'🔄','text':a56_0x515cb3[_0xa6a98d(0x11a)](_0xa6a98d(0x185))};if(_0x5ca18b)return{'icon':'✅','text':a56_0x515cb3[_0xa6a98d(0x13b)](_0xa6a98d(0x22b))};return{'icon':'❌','text':a56_0x515cb3[_0xa6a98d(0x254)](_0xa6a98d(0x184))};}export class WorkflowBaseCommand extends BaseCommand{[a56_0x2e361e(0x14f)](_0x166878,_0x5ec753,_0x4a129e=0x0){const _0x56f7c4=a56_0x2e361e;return _0x166878[_0x4a129e]||_0x5ec753[_0x56f7c4(0x178)];}[a56_0x2e361e(0xdf)](_0x675aa5,_0x1a43cd,_0x430de9=0x0){const _0x3f1425=a56_0x2e361e,_0x5834d4=this[_0x3f1425(0x14f)](_0x675aa5,_0x1a43cd,_0x430de9);if(!_0x5834d4)return console[_0x3f1425(0x184)](a56_0x515cb3[_0x3f1425(0x254)](_0x3f1425(0x9e)),_0x3f1425(0x149)),console[_0x3f1425(0x184)](a56_0x515cb3[_0x3f1425(0x103)](_0x3f1425(0x239))),null;return _0x5834d4;}[a56_0x2e361e(0x96)](_0x130ba1,_0xb25a1b){const _0x235f5e=a56_0x2e361e;if(_0x130ba1[0x0]){const _0x146a40=_0x130ba1[0x0]['split']('.');if(_0x146a40[_0x235f5e(0x1c6)]===0x1)return{'projectName':_0x146a40[0x0],'workflowName':undefined};else return _0x146a40[_0x235f5e(0x1c6)]===0x2?{'projectName':_0x146a40[0x0],'workflowName':_0x146a40[0x1]}:(console[_0x235f5e(0x184)](a56_0x515cb3['red'](_0x235f5e(0x9e)),_0x235f5e(0xb3)),null);}return{'projectName':_0xb25a1b[_0x235f5e(0x178)],'workflowName':undefined};}['resolveProjectDir'](_0x17c7fe,_0x28df7c,_0x25c7be=0x0){const _0x5a53fc=a56_0x2e361e;if(_0x17c7fe[_0x25c7be])return _0x17c7fe[_0x25c7be];if(_0x28df7c[_0x5a53fc(0x178)]){const _0x1676c9=a56_0x2b37fe['join'](process[_0x5a53fc(0x241)](),'workflows',_0x28df7c[_0x5a53fc(0x178)]);if(existsSync(a56_0x2b37fe[_0x5a53fc(0x122)](_0x1676c9,_0x5a53fc(0x1cc))))return _0x1676c9;}return undefined;}async[a56_0x2e361e(0x176)](_0x24fb65,_0xd1b0bd,_0x233344){const _0x1abf48=a56_0x2e361e;try{const _0x480b4a=await _0x24fb65['workflow'][_0x1abf48(0x258)](_0xd1b0bd,{'limit':0x1});if(_0x480b4a[_0x1abf48(0x1c6)]>0x0){const _0x4c5887=_0x480b4a[0x0]['id'],_0x5acf27=getWorkflowUrl(_0x233344,_0x4c5887);console[_0x1abf48(0x184)](_0x1abf48(0x1be)+a56_0x515cb3[_0x1abf48(0x17a)](_0x5acf27));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']='workflow:use';[a56_0x2e361e(0x109)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a56_0x2e361e(0xf9)](_0x35665c){const _0x43c504=a56_0x2e361e,{options:_0x498934,args:_0x17cc34,tdx:_0x391006}=_0x35665c,_0x4103be=_0x17cc34[0x0],_0x57815f=_0x498934[_0x43c504(0xae)];if(_0x57815f)return saveSessionContext({'workflow_project':undefined},_0x498934['session']),console['log'](a56_0x515cb3[_0x43c504(0x13b)](_0x43c504(0x16d))),0x0;if(!_0x4103be)return console[_0x43c504(0x184)](a56_0x515cb3[_0x43c504(0x254)]('Error:'),_0x43c504(0x149)),console['error'](a56_0x515cb3[_0x43c504(0x103)](_0x43c504(0x173))),console[_0x43c504(0x184)](a56_0x515cb3[_0x43c504(0x103)](_0x43c504(0x9a))),0x1;const _0x47553d=await withSpinner(_0x43c504(0x189)+_0x4103be+_0x43c504(0x20c),()=>_0x391006[_0x43c504(0x128)][_0x43c504(0xe5)](_0x4103be),{'verbose':_0x498934[_0x43c504(0x236)]}),{name:_0x3b4a94}=_0x47553d[_0x43c504(0x169)];return saveSessionContext({'workflow_project':_0x3b4a94},_0x498934[_0x43c504(0x219)]),console[_0x43c504(0x15b)](a56_0x515cb3['green'](_0x43c504(0x1bb)+a56_0x515cb3[_0x43c504(0x17a)](_0x3b4a94))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a56_0x2e361e(0x1f9)]=a56_0x2e361e(0x1da);[a56_0x2e361e(0x109)]=a56_0x2e361e(0x224);async[a56_0x2e361e(0xf9)](_0x92a08){const _0x357d8c=a56_0x2e361e,{options:_0x5b952b,args:_0x3e1f06,tdx:_0x37531d}=_0x92a08,_0x55a631=_0x3e1f06[0x0];_0x5b952b[_0x357d8c(0x236)]&&_0x55a631&&console[_0x357d8c(0x184)](_0x357d8c(0x218)+_0x55a631);const _0x4a1854=await withSpinner(_0x357d8c(0x214),()=>_0x37531d[_0x357d8c(0x128)][_0x357d8c(0x1dd)](_0x55a631,{'limit':_0x5b952b[_0x357d8c(0xac)]}),{'verbose':_0x5b952b[_0x357d8c(0x236)]});let _0xcdae06=_0x4a1854[_0x357d8c(0x169)];_0xcdae06[_0x357d8c(0x17f)]((_0x572233,_0x3aae27)=>_0x572233[_0x357d8c(0x1f9)]['localeCompare'](_0x3aae27[_0x357d8c(0x1f9)]));const _0x377576=_0x5b952b[_0x357d8c(0xac)]&&_0xcdae06['length']>=_0x5b952b[_0x357d8c(0xac)]?a56_0x515cb3['dim'](_0x357d8c(0xc6)):'';console['error'](_0x357d8c(0x1a0)+_0xcdae06['length']+_0x357d8c(0x15e)+(_0xcdae06['length']!==0x1?'s':'')+_0x377576);if(_0x5b952b[_0x357d8c(0xef)]===_0x357d8c(0x1b7)||_0x5b952b['format']===_0x357d8c(0x186)||_0x5b952b[_0x357d8c(0xef)]==='table')await handleSDKOutput(_0xcdae06,_0x5b952b);else{if(_0xcdae06['length']===0x0)_0x55a631?console['log'](_0x357d8c(0xca)+_0x55a631):console[_0x357d8c(0x15b)]('No\x20workflow\x20projects\x20found');else{const _0x404326=_0xcdae06[_0x357d8c(0xbb)](_0x2d640d=>{const _0x4171c1=_0x357d8c,_0x593aad=_0x2d640d['metadata']?.[_0x4171c1(0xe4)](_0x1d5309=>_0x1d5309[_0x4171c1(0xd7)]===_0x4171c1(0x1d3)),_0x2ce760=_0x593aad?a56_0x515cb3[_0x4171c1(0x103)](_0x4171c1(0x1e2)):'';return'📁\x20'+_0x2d640d['name']+_0x2ce760;});await writeOutput(_0x404326[_0x357d8c(0x122)]('\x0a'),_0x5b952b[_0x357d8c(0x23b)],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a56_0x2e361e(0x1f9)]=a56_0x2e361e(0x117);[a56_0x2e361e(0x109)]=a56_0x2e361e(0xf4);async['execute'](_0x4007d7){const _0x24b2b4=a56_0x2e361e,{options:_0x321e95,args:_0xd9d271,tdx:_0x4a3e3f}=_0x4007d7,_0x7ef8f3=this[_0x24b2b4(0x14f)](_0xd9d271,_0x321e95);_0x321e95[_0x24b2b4(0x236)]&&_0x7ef8f3&&console[_0x24b2b4(0x184)]('Project\x20filter:\x20'+_0x7ef8f3);const _0x520ac5=await withSpinner(_0x24b2b4(0xf3),()=>_0x4a3e3f[_0x24b2b4(0x128)]['workflows'](_0x7ef8f3,{'limit':_0x321e95[_0x24b2b4(0xac)]}),{'verbose':_0x321e95[_0x24b2b4(0x236)]});let _0x25b168=_0x520ac5[_0x24b2b4(0x169)];_0x25b168[_0x24b2b4(0x17f)]((_0x20c8b5,_0x5d90c4)=>{const _0x136c4b=_0x24b2b4,_0x13cc14=_0x20c8b5[_0x136c4b(0x1f9)][_0x136c4b(0x1e9)](_0x5d90c4[_0x136c4b(0x1f9)]);if(_0x13cc14!==0x0)return _0x13cc14;return(_0x20c8b5[_0x136c4b(0x155)]?.[_0x136c4b(0x1f9)]||'')[_0x136c4b(0x1e9)](_0x5d90c4['project']?.[_0x136c4b(0x1f9)]||'');});const _0x318eff=_0x321e95['limit']&&_0x25b168[_0x24b2b4(0x1c6)]>=_0x321e95[_0x24b2b4(0xac)]?a56_0x515cb3[_0x24b2b4(0x103)](_0x24b2b4(0xc6)):'';console[_0x24b2b4(0x184)](_0x24b2b4(0x1a0)+_0x25b168[_0x24b2b4(0x1c6)]+'\x20workflow'+(_0x25b168[_0x24b2b4(0x1c6)]!==0x1?'s':'')+_0x318eff);if(_0x321e95[_0x24b2b4(0xef)]===_0x24b2b4(0x1b7)||_0x321e95['format']===_0x24b2b4(0x186)||_0x321e95[_0x24b2b4(0xef)]==='table')await handleSDKOutput(_0x25b168,_0x321e95);else{if(_0x25b168[_0x24b2b4(0x1c6)]===0x0)_0x7ef8f3?console['log'](_0x24b2b4(0xed)+_0x7ef8f3):console[_0x24b2b4(0x15b)](_0x24b2b4(0x1c4));else{const _0x2c6e9f=_0x321e95[_0x24b2b4(0x174)],_0x4f8afb=_0x25b168['map'](_0x2187db=>{const _0x4ddf02=_0x24b2b4,_0x2968b4=a56_0x515cb3['dim']('#'+_0x2187db['id']),_0x5375ab=hyperlink(_0x2968b4,getWorkflowUrl(_0x2c6e9f,_0x2187db['id'])),_0x1f2805=_0x2187db[_0x4ddf02(0x155)]?.[_0x4ddf02(0x1f9)]?a56_0x515cb3[_0x4ddf02(0x103)]('\x20('+_0x2187db[_0x4ddf02(0x155)][_0x4ddf02(0x1f9)]+')'):'';return _0x4ddf02(0x1d5)+_0x5375ab+'\x20'+_0x2187db[_0x4ddf02(0x1f9)]+_0x1f2805;});await writeOutput(_0x4f8afb['join']('\x0a'),_0x321e95['output'],_0x24b2b4(0x1d4));}}return 0x0;}}function a56_0x1371(){const _0x4b2b7a=['canceling','stringify','Select\x20a\x20session\x20to\x20view\x20timeline:','\x0aDry\x20run\x20-\x20no\x20project\x20created','config','done','getMinutes','\x20task','Validation:\x20skipped','workflow:workflows','\x0aDry\x20run\x20-\x20nothing\x20pushed','skipValidation','blue','value','end','resolveProjectDir','\x20of\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Filter:\x20project=','Disable\x20a\x20workflow\x20schedule','join','.\x20Expected\x20format:\x20KEY=VALUE','Error:\x20','Workflow:\x20','No\x20sessions\x20found','columns','workflow','\x20next:\x20','renderTimeline','No\x20schedules\x20found','yellow','attempt:','disabledAt','Force:\x20yes','context','Error:\x20Project\x20name\x20is\x20required','List\x20workflow\x20schedules','\x20session','fs/promises','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','\x20secrets\x20set\x20for\x20project\x20\x27','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Setting\x20secret...','green','Fetching\x20schedule\x20#','workflow:attempts','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','isDirectory','From\x20task:\x20','\x20\x20Location:\x20','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','113SeOBkF','toLocaleString',',\x20Workflow:\x20','Error:\x20Invalid\x20parameter\x20format:\x20','✔\x20Showing\x20','Project\x20name\x20is\x20required','getSchedule','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x0aError:','Dry\x20run:\x20yes','MAX_TASKS_DISPLAY','resolveProject','\x20sessions\x20','slice','skipSchedule','\x20attempt','No\x20log\x20content\x20found','project','type','ICON_SPACING','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','\x20\x20New\x20attempt\x20ID:\x20','3536864oifZAv','log','Warning:','MIN_LABEL_COUNT','\x20project','No\x20sessions\x20with\x20timing\x20information','\x20schedule','✔\x20Schedule\x20found','now','Using\x20attempt\x20','targetExists','Expected\x20format:\x20--param\x20key=value','buildTimelineData','fill','Failed\x20to\x20fetch\x20attempt\x20data','data','listSchedules','\x20\x20Files\x20extracted:\x20','Secrets\x20to\x20set:\x20','✔\x20Workflow\x20project\x20context\x20cleared.','attemptId','lastAttempt','reason','No\x20attempts\x20found\x20for:\x20','executeDryRun','Usage:\x20tdx\x20wf\x20use\x20<project>','site','\x22\x20with\x20new\x20revision?','showWorkflowConsoleUrl','getDate','workflowProject','logs','cyan','\x1b[1A\x1b[2K','pollTimeline','Show\x20tasks\x20for\x20an\x20attempt','--schedule-id\x20cannot\x20be\x20combined\x20with\x20a\x20project.workflow\x20filter','sort','\x20\x20Session\x20context\x20set\x20to:\x20','toLowerCase','setSecrets','\x20\x20Session\x20ID:\x20','error','running','jsonl','✔\x20Secret\x20\x27','retryAttemptName','Resolving\x20project\x20\x27','stdout','12XSaghb','Resume\x20from:\x20','Listing\x20secrets...','Project:\x20','Status:\x20','Source:\x20','Error:\x20Secret\x20key\x20is\x20required','indexOf','8198oppzyp','Deleting\x20project\x20','✔\x20Workflow\x20run\x20started','Retrying\x20attempt...','✔\x20Retry\x20started','Include\x20retried:\x20yes','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','fileCount','Download\x20workflow\x20project\x20from\x20Treasure\x20AI','\x20(use\x20a\x20larger\x20--limit\x20to\x20show\x20more)','/sessions/','workflow:push','\x20is\x20not\x20a\x20directory','✔\x20Found\x20','2874872lnJhFp','Usage:\x20tdx\x20wf\x20schedule\x20list\x20[project[.workflow]]\x20|\x20--schedule-id\x20<id>','hasChanges','kill','status','\x20has\x20no\x20attempts','Output\x20directory:\x20','find','workflow:attempt','workflow:pull','fullName','Loading\x20session...','sessionId','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','workflow:secrets:list','workflow:schedule:enable','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Filter:\x20','tdx\x20wf\x20attempt\x20','125OkqESX','Start\x20a\x20workflow\x20run','workflow:retry','json','navigateSessionsInteractive','Target\x20directory:\x20','unknown','✔\x20Workflow\x20project\x20set\x20to:\x20','Retry\x20a\x20session\x20or\x20attempt','Error:\x20Attempt\x20ID\x20is\x20required','\x20\x20Console:\x20','group_error','deleted','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','\x22\x20to\x20new\x20project\x20\x22','\x0a✔\x20No\x20changes\x20to\x20push','No\x20workflows\x20found','index','length','\x20new','tasks','Disabling\x20schedule\x20#','changes','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','tdx.json','download','getTime','white','Project\x20directory:\x20','newProjectName','\x20\x20Project:\x20','sys','list','📋\x20','task','\x0a✔\x20Attempt\x20complete','\x20deleted','Downloading\x20logs...','workflow:projects','all','10pjRsjz','projects','nextRunTime','\x20secret','getFullYear','displayLine','\x20(system)','deleteSecret','floor','✔\x20Downloaded\x20','pending','get','\x20\x20Attempt\x20ID:\x20','localeCompare','pullProject','write','\x20disabled\x20(','filesExtracted','max','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','basename','getHours','has','3442428eeEIKK','executePushProject','LABEL_MIN_SPACING','\x20(disabled)','⚠\x20Showing\x20first\x20','targetDir','name','filter','finishedAt','delete','💡\x20Tip:\x20Use\x20','getMonth','Pulling\x20project\x20','executeCloneProject','table','min','Session\x20time:','Including\x20subtasks:\x20yes','Killing\x20attempt...','\x20\x20tdx\x20wf\x20use\x20<project>','includes','push','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','diff','Attempt\x20ID:\x20','\x27...','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','durationMs','taskName','Source\x20directory:\x20','Writing\x20files...','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Deleting\x20secret...','Listing\x20workflow\x20projects...','Task\x20graph:','Pushing\x20project...','path','Pattern:\x20','session','✔\x20Project:\x20','sourceDir','Downloading\x20project\x20','total','Key:\x20','enableSchedule','Select\x20a\x20task\x20to\x20view\x20logs:','startTime','startedAt','🔄\x20','List\x20all\x20workflow\x20projects','Session\x20not\x20found:\x20','set','attempt','workflow:logs','renderSingleTimeline','List\x20workflow\x20execution\x20sessions','success','Retrying\x20session...','isArray','state','\x0aUpdate\x20existing\x20project\x20\x22','Workflow:','\x20unchanged','start','Error:\x20Invalid\x20JSON\x20in\x20--params','61428nAbKWd','Tip:\x20cd\x20to\x20workflows/','verbose','✔\x20Clone\x20complete','unchanged','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Files\x20to\x20upload:\x20','output','listProjectSchedules','session:','Revision:\x20','relative','\x0aClone\x20\x22','cwd','newProjectId','resumeFrom','GUTTER','workflowName','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','\x0aDry\x20run\x20-\x20no\x20files\x20written','No\x20sessions\x20found\x20for:\x20','Kill\x20a\x20running\x20attempt','Invalid\x20format:\x20','summary','\x0a⚠\x20Project\x20\x22','Enabling\x20schedule\x20#','createdAt','session_id','toISOString','follow','-\x20nothing\x20pushed','red','workflow:timeline','Schedule:\x20backfill\x20runs\x20enabled\x20(--backfill)','Cloning\x20to\x20','workflows','\x20\x20Revision:\x20','workflow:secrets:set','\x20\x20Changes:\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','generateSessionTimelineRows','sessions','MAX_POLL_ITERATIONS','No\x20workflow\x20tdx.json\x20found','3497505QtgFHi','Total:\x20','(unknown)','select','isTTY','Project\x20name:\x20','\x20\x20Workflow:\x20','Show\x20specific\x20attempt\x20details','sessionTime','parseProjectWorkflowPattern','match','prepareCloneProject','planned','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','sourceProjectName','\x20secrets...','Error:','msPerChar','Getting\x20attempt\x20tasks...','run','rows','startsWith','Analyzing\x20changes...','updatedAt','No\x20sessions\x20found\x20in\x20project:\x20','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','No\x20attempts\x20found','size','---\x20','Parameters:\x20','limit','Starting\x20workflow\x20run...','clear','every','window','Enable\x20a\x20workflow\x20schedule','projectId','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','trim','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','No\x20matching\x20sessions\x20found','duration','Show\x20logs\x20for\x20a\x20workflow\x20attempt','ICON_WIDTH','force','map','\x20\x20Source:\x20','revision:\x20','Reason:\x20','parse','icon','new','List\x20workflow\x20attempts','params','dryRun','bold','\x20(use\x20--limit\x20to\x20show\x20more)','✔\x20Schedule\x20#','stat','/app/workflows/','No\x20projects\x20match\x20pattern:\x20','Target:\x20','replace','workflow:clone','...','workflow:schedules','fileSize','Listing\x20schedules\x20for\x20','→\x20New\x20project:\x20','utf-8','applyPullProject','keys','(use\x20--limit\x20to\x20see\x20more)','key','round','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','No\x20attempts\x20found\x20in\x20project:\x20','fromTask','LABEL_WIDTH_DIVISOR','workflow:secrets:delete','/attempt/','requireProject','readFile','renderSessionsTimeline','modified','Loading\x20workflows...','some','resolveProjectId','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','New\x20project\x20name:\x20','Analyzing\x20project...','Cancelled','substring','listSecrets','155964Wbvlbc','No\x20workflows\x20found\x20in\x20project:\x20','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','format','→\x20Project:\x20','yes','Session\x20','Listing\x20workflows...','List\x20workflows','existingProjectId','\x20\x20Project\x20ID:\x20','POLL_INTERVAL_MS','projectName','execute','\x0a✔\x20Already\x20up\x20to\x20date','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','padStart','\x0aPush\x20these\x20changes?','\x20from\x20session\x20','📅\x20#','✔\x20Pull\x20complete','revision','nextTime','dim','disableSchedule','workflow:schedule:disable','Schedule\x20ID\x20is\x20required','\x20-\x20','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','description','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','resolve','repeat','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.'];a56_0x1371=function(){return _0x4b2b7a;};return a56_0x1371();}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']='workflow:sessions';[a56_0x2e361e(0x109)]=a56_0x2e361e(0x22a);async['execute'](_0x339f9b){const _0x500eaf=a56_0x2e361e,{options:_0x2ce8e4,args:_0xda959,tdx:_0x5f49a2}=_0x339f9b,_0x56b33e=this[_0x500eaf(0x96)](_0xda959,_0x2ce8e4);if(!_0x56b33e)return 0x1;const {projectName:_0x15db7e,workflowName:_0x334b15}=_0x56b33e;if(_0x2ce8e4[_0x500eaf(0x236)]){if(_0x15db7e&&_0x334b15)console[_0x500eaf(0x184)](_0x500eaf(0x1b2)+_0x15db7e+'.'+_0x334b15);else _0x15db7e&&console[_0x500eaf(0x184)](_0x500eaf(0x120)+_0x15db7e);const _0xd642bb=_0x2ce8e4[_0x500eaf(0x1a5)];_0xd642bb&&console[_0x500eaf(0x184)](_0x500eaf(0x18f)+_0xd642bb);}let _0x53a0ca=0x28;if(process['stdout'][_0x500eaf(0x91)]&&!_0x2ce8e4[_0x500eaf(0x23b)]&&!_0x2ce8e4[_0x500eaf(0xef)]){const _0x605b24=process[_0x500eaf(0x18a)][_0x500eaf(0xa2)]||0x28;_0x53a0ca=Math['max'](0x14,Math[_0x500eaf(0x1e4)](_0x605b24*0x2/0x3));}const _0x59f025=_0x2ce8e4[_0x500eaf(0xac)]||_0x53a0ca,_0x1cbb19=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x5f49a2[_0x500eaf(0x128)]['sessions']({'projectName':_0x15db7e,'workflowName':_0x334b15,'status':_0x2ce8e4[_0x500eaf(0x1a5)],'fromTime':_0x2ce8e4['from'],'toTime':_0x2ce8e4['to'],'limit':_0x59f025}),{'verbose':_0x2ce8e4[_0x500eaf(0x236)]}),_0x24e267=_0x1cbb19[_0x500eaf(0x169)];_0x24e267[_0x500eaf(0x17f)]((_0x3275f3,_0x42cf2c)=>{const _0x2fd06e=_0x500eaf,_0x39a19e=_0x3275f3[_0x2fd06e(0x95)]||'',_0x2cbbf0=_0x42cf2c['sessionTime']||'';return _0x2cbbf0[_0x2fd06e(0x1e9)](_0x39a19e);});_0x24e267[_0x500eaf(0x1c6)]>=_0x59f025?console[_0x500eaf(0x184)](_0x500eaf(0x148)+_0x24e267[_0x500eaf(0x1c6)]+_0x500eaf(0x150)+a56_0x515cb3['dim'](_0x500eaf(0xd6))):console['error'](_0x500eaf(0x1a0)+_0x24e267[_0x500eaf(0x1c6)]+_0x500eaf(0x133)+(_0x24e267['length']!==0x1?'s':''));if(_0x2ce8e4[_0x500eaf(0xef)]==='json'||_0x2ce8e4[_0x500eaf(0xef)]==='jsonl'||_0x2ce8e4[_0x500eaf(0xef)]===_0x500eaf(0x201))await handleSDKOutput(_0x24e267,_0x2ce8e4);else{if(!process[_0x500eaf(0x18a)][_0x500eaf(0x91)]||_0x2ce8e4[_0x500eaf(0x23b)]){if(_0x24e267[_0x500eaf(0x1c6)]===0x0){if(_0x15db7e&&_0x334b15)console[_0x500eaf(0x15b)](_0x500eaf(0x249)+_0x15db7e+'.'+_0x334b15);else _0x15db7e?console[_0x500eaf(0x15b)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x15db7e):console[_0x500eaf(0x15b)](_0x500eaf(0x126));}else{const _0x7d8c23=_0x2ce8e4[_0x500eaf(0x174)],_0x180a5d=this[_0x500eaf(0xe1)](_0x24e267,_0x7d8c23);_0x2ce8e4[_0x500eaf(0x23b)]?await writeOutput(_0x180a5d,_0x2ce8e4[_0x500eaf(0x23b)],_0x500eaf(0x1d4)):console[_0x500eaf(0x15b)](_0x180a5d);}!_0x15db7e&&(console[_0x500eaf(0x184)](''),console[_0x500eaf(0x184)](a56_0x515cb3['dim'](_0x500eaf(0x209))),console[_0x500eaf(0x184)](a56_0x515cb3['dim'](_0x500eaf(0xa7))+'or'+a56_0x515cb3[_0x500eaf(0x103)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x24e267[_0x500eaf(0x1c6)]===0x0){if(_0x15db7e&&_0x334b15)console[_0x500eaf(0x15b)](_0x500eaf(0x249)+_0x15db7e+'.'+_0x334b15);else _0x15db7e?console[_0x500eaf(0x15b)](_0x500eaf(0xa6)+_0x15db7e):console['log'](_0x500eaf(0x126));}else await this[_0x500eaf(0x1b8)](_0x24e267,_0x339f9b,_0x15db7e);}}return 0x0;}[a56_0x2e361e(0xe1)](_0x1c5373,_0x4fcdb9){const _0x260b5f=a56_0x2e361e,_0x134fb3=[],_0x494243=new Map();let _0x17fcea=Infinity,_0x29b244=-Infinity;for(const _0x576dec of _0x1c5373){if(_0x576dec['lastAttempt']?.['createdAt']){const _0x2827c2=new Date(_0x576dec['lastAttempt']['createdAt'])[_0x260b5f(0x1ce)](),_0x1ea5b3=_0x576dec['lastAttempt'][_0x260b5f(0x1fb)]?new Date(_0x576dec[_0x260b5f(0x16f)][_0x260b5f(0x1fb)])[_0x260b5f(0x1ce)]():Date[_0x260b5f(0x162)](),_0x7bc7d0=_0x576dec[_0x260b5f(0x155)]?.[_0x260b5f(0x1f9)]||_0x260b5f(0x8f);!_0x494243[_0x260b5f(0x1f2)](_0x7bc7d0)&&_0x494243[_0x260b5f(0x226)](_0x7bc7d0,[]),_0x494243[_0x260b5f(0x1e7)](_0x7bc7d0)['push']({'session':_0x576dec,'startTime':_0x2827c2,'endTime':_0x1ea5b3,'duration':_0x1ea5b3-_0x2827c2}),_0x17fcea=Math[_0x260b5f(0x202)](_0x17fcea,_0x2827c2),_0x29b244=Math[_0x260b5f(0x1ee)](_0x29b244,_0x1ea5b3);}}if(_0x494243[_0x260b5f(0xa9)]===0x0)return _0x260b5f(0x15f);const _0x2feca1=process[_0x260b5f(0x18a)][_0x260b5f(0x127)]||0x78,_0x265a35=0x1e,_0x2e8660=0x32,_0x4bc12b=0x4,_0x33d1f1=Math[_0x260b5f(0x202)](_0x2e8660,Math[_0x260b5f(0x1ee)](_0x265a35,Math[_0x260b5f(0x1e4)](_0x2feca1*0.3))),_0x3d145f=_0x2feca1-_0x33d1f1-TIMELINE_CONFIG[_0x260b5f(0x244)]-0x3-_0x4bc12b,_0x2d8327=_0x29b244-_0x17fcea,_0x25010e=_0x2d8327/_0x33d1f1,_0x1e99c8=renderTimeAxis({'startTime':_0x17fcea,'endTime':_0x29b244,'durationMs':_0x2d8327,'msPerChar':_0x25010e},_0x33d1f1),_0x4a6dfe=[];for(const _0x4d4be1 of _0x494243['values']()){_0x4a6dfe['push'](..._0x4d4be1);}_0x4a6dfe[_0x260b5f(0x17f)]((_0x5c1559,_0x363e90)=>_0x363e90[_0x260b5f(0x221)]-_0x5c1559[_0x260b5f(0x221)]);const _0x5cdb45=new Date(_0x17fcea),_0x3e8b55=formatDate(_0x5cdb45),_0x56272a=_0x4bc12b+TIMELINE_CONFIG[_0x260b5f(0xb9)]+TIMELINE_CONFIG[_0x260b5f(0x157)]+_0x3d145f,_0xd2758b='\x20'[_0x260b5f(0x10c)](_0x56272a-_0x3e8b55[_0x260b5f(0x1c6)]),_0x551a71=_0xd2758b+a56_0x515cb3[_0x260b5f(0x103)](_0x3e8b55)+'\x20'+_0x1e99c8;_0x134fb3['push'](_0x551a71);const _0x1d4516=0x16;let _0xc255b3=0x0;for(const _0x38b90b of _0x4a6dfe){const _0x5eb570=_0x38b90b[_0x260b5f(0x219)][_0x260b5f(0x155)]?.[_0x260b5f(0x1f9)]||'?',_0xbf539b=Math['min'](stringWidth(_0x5eb570),_0x1d4516);_0xc255b3=Math[_0x260b5f(0x1ee)](_0xc255b3,_0xbf539b);}for(const _0x2953fc of _0x4a6dfe){const {session:_0x2460c0,startTime:_0x255788,endTime:_0x3f7179,duration:_0xe659c4}=_0x2953fc,_0x43901e=_0x2460c0['project']?.['id'],_0x35d46d=_0x2460c0['id'],_0x3c20f6=_0x2460c0[_0x260b5f(0x155)]?.[_0x260b5f(0x1f9)]||'?',_0x91a106=_0x2460c0[_0x260b5f(0x128)]?.[_0x260b5f(0x1f9)]||'?';let _0x3adb99,_0x3f5109;if(_0x2460c0[_0x260b5f(0x16f)]){const _0x30b4cf=_0x2460c0[_0x260b5f(0x16f)];!_0x30b4cf[_0x260b5f(0x113)]?(_0x3adb99=_0x30b4cf['cancelRequested']?'🛑':'🔄',_0x3f5109=_0x30b4cf['cancelRequested']?a56_0x515cb3[_0x260b5f(0x12c)]:a56_0x515cb3[_0x260b5f(0x11a)]):(_0x3adb99=_0x30b4cf[_0x260b5f(0x22b)]?'✅':'❌',_0x3f5109=_0x30b4cf[_0x260b5f(0x22b)]?a56_0x515cb3[_0x260b5f(0x13b)]:a56_0x515cb3[_0x260b5f(0x254)]);}else _0x3adb99='⏳',_0x3f5109=a56_0x515cb3[_0x260b5f(0x103)];const _0x396e74='#'+_0x35d46d,_0x1f4b36=_0x43901e?hyperlink(_0x396e74,getWorkflowSessionUrl(_0x4fcdb9,_0x43901e,_0x35d46d)):_0x396e74;let _0x58884b=_0x3c20f6;stringWidth(_0x3c20f6)>_0x1d4516&&(_0x58884b=_0x3c20f6[_0x260b5f(0x151)](0x0,_0x1d4516-0x1)+'…');const _0x23f9ec=a56_0x515cb3[_0x260b5f(0x103)](_0x58884b),_0xe0ba4b=stringWidth(_0x58884b),_0x2053d9='\x20'[_0x260b5f(0x10c)](_0xc255b3-stringWidth(_0x58884b)+0x2),_0x72133='('+formatElapsed(_0xe659c4)+')',_0x4c6dff=stringWidth(_0x72133),_0x492527=stringWidth(_0x396e74),_0x43e34b=_0x492527+0x1+_0xe0ba4b+_0x2053d9['length'],_0x389859=_0x3d145f-_0x43e34b-_0x4c6dff-0x1-0x8;let _0x11c816=_0x91a106;stringWidth(_0x11c816)>_0x389859&&(_0x11c816=_0x11c816[_0x260b5f(0x151)](0x0,_0x389859-0x1)+'…');const _0x3749b8=_0x1f4b36+'\x20'+_0x23f9ec+_0x2053d9+_0x11c816,_0x22f48b=stringWidth(_0x3749b8),_0x153a9d=_0x3d145f-_0x22f48b-_0x4c6dff,_0x4fcbf7=_0x3749b8+'\x20'[_0x260b5f(0x10c)](Math['max'](0x1,_0x153a9d))+a56_0x515cb3[_0x260b5f(0x103)](_0x72133),_0xc17969=Math[_0x260b5f(0x1e4)]((_0x255788-_0x17fcea)/_0x25010e),_0xf9cad=Math[_0x260b5f(0x1e4)]((_0x3f7179-_0x17fcea)/_0x25010e),_0x332484=Math[_0x260b5f(0x1ee)](_0xc17969+0x1,_0xf9cad),_0x8b1181=new Array(_0x33d1f1)['fill']('\x20');for(let _0x396172=_0xc17969;_0x396172<Math[_0x260b5f(0x202)](_0x332484,_0x33d1f1);_0x396172++){_0x8b1181[_0x396172]='─';}const _0xc134=_0x8b1181[_0x260b5f(0xbb)](_0x154578=>_0x154578==='\x20'?'\x20':_0x3f5109(_0x154578))[_0x260b5f(0x122)]('');_0x134fb3[_0x260b5f(0x208)](_0x3adb99+'\x20'+_0x4fcbf7+'│'+_0xc134+'│');}return _0x134fb3[_0x260b5f(0x122)]('\x0a');}async[a56_0x2e361e(0x1b8)](_0x387bd9,_0x181a14,_0x12712b){const _0xdb7753=a56_0x2e361e,{options:_0x194382,tdx:_0x10f0a2}=_0x181a14,_0x92d30c=_0x194382[_0xdb7753(0x174)],{timelineRows:_0xc2a356,timeAxisHeader:_0x5423e7}=this[_0xdb7753(0x89)](_0x387bd9,_0x92d30c),_0x5ecab1=_0xc2a356[_0xdb7753(0x1fa)](_0xac116=>_0xac116[_0xdb7753(0x16e)]);if(_0x5ecab1['length']===0x0){const _0x1f9888=this[_0xdb7753(0xe1)](_0x387bd9,_0x92d30c);console[_0xdb7753(0x15b)](_0x1f9888);!_0x12712b&&(console[_0xdb7753(0x184)](''),console[_0xdb7753(0x184)](a56_0x515cb3[_0xdb7753(0x103)](_0xdb7753(0x209))),console['error'](a56_0x515cb3['dim'](_0xdb7753(0xa7))+'or'+a56_0x515cb3[_0xdb7753(0x103)](_0xdb7753(0x206))));return;}_0x5423e7&&console[_0xdb7753(0x15b)](_0x5423e7);const _0xb6e7c8=_0xc2a356[_0xdb7753(0x1fa)](_0x8674b8=>_0x8674b8[_0xdb7753(0x16e)])['map'](_0x42511b=>({'title':_0x42511b[_0xdb7753(0x1e1)],'value':_0x42511b[_0xdb7753(0x16e)]})),_0xb312f9=process[_0xdb7753(0x18a)]['rows']||0x3c,_0x1b03f9=Math[_0xdb7753(0x1ee)](0x28,Math[_0xdb7753(0x1e4)](_0xb312f9*0x2/0x3)),_0x131882=await a56_0x31c40f({'type':'autocomplete','name':_0xdb7753(0x16e),'message':_0xdb7753(0x212),'choices':_0xb6e7c8,'initial':-0x1,'limit':_0x1b03f9,'clearFirst':!![],'fallback':{'title':_0xdb7753(0xb6),'value':null},'suggest':(_0x5e7a5d,_0x459c34)=>{const _0x2cec3d=_0xdb7753;if(!_0x5e7a5d)return Promise[_0x2cec3d(0x10b)](_0x459c34);const _0xccbe76=_0x459c34[_0x2cec3d(0x1fa)](_0x5556fa=>{const _0x386157=_0x2cec3d,_0x3f468b=_0x5556fa;return _0x3f468b['title'][_0x386157(0x181)]()[_0x386157(0x207)](_0x5e7a5d[_0x386157(0x181)]());});return Promise[_0x2cec3d(0x10b)](_0xccbe76);}}),_0x9a87b7=()=>{const _0x5c9ca2=_0xdb7753;process[_0x5c9ca2(0x18a)][_0x5c9ca2(0x1eb)](_0x5c9ca2(0x17b)),process[_0x5c9ca2(0x18a)][_0x5c9ca2(0x1eb)](_0x5c9ca2(0x17b)),process[_0x5c9ca2(0x18a)]['write'](_0x5c9ca2(0x17b));},_0x15c7ce=_0x131882&&_0x131882[_0xdb7753(0x16e)]&&_0x131882[_0xdb7753(0x16e)]!==null&&_0x131882['attemptId'][_0xdb7753(0xb4)]()!=='';if(!_0x15c7ce){_0x9a87b7(),console[_0xdb7753(0x15b)](a56_0x515cb3[_0xdb7753(0x103)](_0xdb7753(0xe9)));return;}_0x9a87b7();const _0x4859a9=_0x387bd9[_0xdb7753(0x1a8)](_0x21a854=>_0x21a854[_0xdb7753(0x16f)]?.['id']===_0x131882[_0xdb7753(0x16e)]);if(_0x4859a9){const _0x385945=_0x4859a9['project']?.[_0xdb7753(0x1f9)]||'?',_0x5cf12f=_0x4859a9[_0xdb7753(0x128)]?.[_0xdb7753(0x1f9)]||'?';console['log'](_0xdb7753(0x18e)+a56_0x515cb3['dim'](_0x385945)+_0xdb7753(0x146)+a56_0x515cb3[_0xdb7753(0x103)](_0x5cf12f));}const _0x3bbf91=new WorkflowTimelineCommand();await _0x3bbf91[_0xdb7753(0xf9)]({'args':[],'options':{..._0x194382,'attemptId':_0x131882['attemptId']},'tdx':_0x10f0a2});}[a56_0x2e361e(0x89)](_0x5bcedc,_0x1730f7){const _0x5a4b0d=a56_0x2e361e,_0x4f6f33=new Map();for(const _0x1a650c of _0x5bcedc){_0x1a650c['id']&&_0x1a650c[_0x5a4b0d(0x16f)]?.['id']&&_0x4f6f33[_0x5a4b0d(0x226)](_0x1a650c['id'],_0x1a650c['lastAttempt']['id']);}const _0x211b9e=[];let _0x1485c6='';const _0x1167bc=this[_0x5a4b0d(0xe1)](_0x5bcedc,_0x1730f7),_0x4eed2b=_0x1167bc['split']('\x0a');for(const _0x3d006e of _0x4eed2b){if(_0x3d006e[_0x5a4b0d(0xa3)](_0x5a4b0d(0x9b))||_0x3d006e[_0x5a4b0d(0x97)](/^\s+\d{4}-\d{2}-\d{2}/))_0x1485c6=_0x3d006e;else{if(_0x3d006e['match'](/^[✅❌🔄🛑⏳]/)){const _0x2ca49e=_0x3d006e[_0x5a4b0d(0x97)](/#(\d+)/),_0x2c6990=_0x2ca49e?_0x2ca49e[0x1]:null,_0x4b34d5=_0x2c6990?_0x4f6f33['get'](_0x2c6990)||null:null,_0x340849=_0x5bcedc['find'](_0x4e486a=>_0x4e486a['id']===_0x2c6990),_0x2e9286=_0x340849?.[_0x5a4b0d(0x155)]?.['name']||'';_0x211b9e[_0x5a4b0d(0x208)]({'displayLine':_0x3d006e,'attemptId':_0x4b34d5,'projectName':_0x2e9286});}}}return{'timelineRows':_0x211b9e,'timeAxisHeader':_0x1485c6};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a56_0x2e361e(0x1f9)]=a56_0x2e361e(0x13d);[a56_0x2e361e(0x109)]=a56_0x2e361e(0xc2);async['execute'](_0x47dc14){const _0x402534=a56_0x2e361e,{options:_0x5cf8de,args:_0x10619f,tdx:_0x35c08f}=_0x47dc14,_0x5ea5f6=this[_0x402534(0x96)](_0x10619f,_0x5cf8de);if(!_0x5ea5f6)return 0x1;const {projectName:_0x26cb45,workflowName:_0x55c814}=_0x5ea5f6,_0x314d64=_0x5cf8de['includeRetried'];if(_0x5cf8de[_0x402534(0x236)]){if(_0x26cb45&&_0x55c814)console['error'](_0x402534(0x1b2)+_0x26cb45+'.'+_0x55c814);else _0x26cb45&&console[_0x402534(0x184)](_0x402534(0x120)+_0x26cb45);_0x314d64&&console[_0x402534(0x184)](_0x402534(0x198));}const _0x51f848=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x35c08f[_0x402534(0x128)]['attempts']({'projectName':_0x26cb45,'workflowName':_0x55c814,'includeRetried':_0x314d64,'limit':_0x5cf8de[_0x402534(0xac)]}),{'verbose':_0x5cf8de[_0x402534(0x236)]}),_0x3c3c39=_0x51f848[_0x402534(0x169)],_0x3b6d8d=_0x5cf8de[_0x402534(0xac)]||0x64,_0x5c843d=_0x3c3c39[_0x402534(0x1c6)]>=_0x3b6d8d?a56_0x515cb3[_0x402534(0x103)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x402534(0x184)](_0x402534(0x1a0)+_0x3c3c39[_0x402534(0x1c6)]+_0x402534(0x153)+(_0x3c3c39['length']!==0x1?'s':'')+_0x5c843d);if(_0x5cf8de['format']==='json'||_0x5cf8de[_0x402534(0xef)]==='jsonl'||_0x5cf8de['format']===_0x402534(0x201))await handleSDKOutput(_0x3c3c39,_0x5cf8de);else{if(_0x3c3c39['length']===0x0){if(_0x26cb45&&_0x55c814)console[_0x402534(0x15b)](_0x402534(0x171)+_0x26cb45+'.'+_0x55c814);else _0x26cb45?console[_0x402534(0x15b)](_0x402534(0xda)+_0x26cb45):console[_0x402534(0x15b)](_0x402534(0xa8));}else{const _0x3fc323=_0x5cf8de['site'],_0x1fc200=_0x3c3c39[_0x402534(0xbb)](_0x223191=>{const _0x44ad58=_0x402534,_0x4a8dcd=a56_0x515cb3[_0x44ad58(0x103)]('#'+_0x223191['id']),_0x1233c5=_0x223191['project']?.['id'],_0x151c18=_0x223191[_0x44ad58(0x250)]||_0x223191[_0x44ad58(0x1ad)],_0x22f663=_0x1233c5&&_0x151c18?hyperlink(_0x4a8dcd,getWorkflowAttemptUrl(_0x3fc323,_0x1233c5,_0x151c18,_0x223191['id'])):_0x4a8dcd,{icon:_0x56d300,text:_0x446938}=getAttemptStatusDisplay(_0x223191),_0x582cfb=(_0x223191['project']?.[_0x44ad58(0x1f9)]||'?')+'.'+(_0x223191[_0x44ad58(0x128)]?.['name']||'?'),_0x28c0ac=_0x223191['sessionTime']?a56_0x515cb3[_0x44ad58(0x103)](_0x223191[_0x44ad58(0x95)]):'';return(_0x22f663+'\x20'+_0x56d300+(_0x446938?'\x20'+_0x446938:'')+'\x20'+_0x582cfb+'\x20'+_0x28c0ac)['trimEnd']();});await writeOutput(_0x1fc200[_0x402534(0x122)]('\x0a'),_0x5cf8de[_0x402534(0x23b)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a56_0x2e361e(0x1f9)]=a56_0x2e361e(0x1a9);[a56_0x2e361e(0x109)]=a56_0x2e361e(0x94);async[a56_0x2e361e(0xf9)](_0x2c6185){const _0x17431a=a56_0x2e361e,{options:_0x44c988,args:_0x49faa3,tdx:_0x2c6e74}=_0x2c6185,_0x1142ea=_0x49faa3[0x0];if(!_0x1142ea)return console[_0x17431a(0x184)](_0x17431a(0x1bd)),0x1;_0x44c988[_0x17431a(0x236)]&&console[_0x17431a(0x184)](_0x17431a(0x20b)+_0x1142ea);const _0x1ef972=await withSpinner('Getting\x20attempt\x20details...',()=>_0x2c6e74[_0x17431a(0x128)][_0x17431a(0x227)](_0x1142ea),{'verbose':_0x44c988['verbose']}),_0x1b8d0d=_0x1ef972['data'];let _0x1f76fc;!_0x1b8d0d[_0x17431a(0x113)]?_0x1f76fc=_0x1b8d0d['cancelRequested']?_0x17431a(0x10e):_0x17431a(0x185):_0x1f76fc=_0x1b8d0d['success']?_0x17431a(0x22b):_0x17431a(0x184);let _0xf4e97a;if(_0x1b8d0d[_0x17431a(0x24f)]&&_0x1b8d0d[_0x17431a(0x1fb)]){const _0x755fce=new Date(_0x1b8d0d[_0x17431a(0x24f)])[_0x17431a(0x1ce)](),_0x44d4f9=new Date(_0x1b8d0d[_0x17431a(0x1fb)])[_0x17431a(0x1ce)]();_0xf4e97a=Math[_0x17431a(0xd8)]((_0x44d4f9-_0x755fce)/0x3e8);}const _0x1a86eb={'attempt_id':_0x1b8d0d['id'],'status':_0x1f76fc,..._0x1b8d0d['index']!==undefined&&{'index':_0x1b8d0d[_0x17431a(0x1c5)]},..._0x1b8d0d[_0x17431a(0x155)]&&{'project':_0x1b8d0d[_0x17431a(0x155)]['name']},..._0x1b8d0d[_0x17431a(0x128)]&&{'workflow':_0x1b8d0d[_0x17431a(0x128)]['name']},..._0x1b8d0d[_0x17431a(0x1ad)]&&{'session_id':_0x1b8d0d[_0x17431a(0x1ad)]},..._0x1b8d0d[_0x17431a(0x95)]&&{'session_time':_0x1b8d0d[_0x17431a(0x95)]},..._0x1b8d0d['retryAttemptName']&&{'retry_attempt':_0x1b8d0d[_0x17431a(0x188)]},..._0xf4e97a!==undefined&&{'duration_sec':_0xf4e97a},..._0x1b8d0d[_0x17431a(0x24f)]&&{'created_at':_0x1b8d0d[_0x17431a(0x24f)]},..._0x1b8d0d[_0x17431a(0x1fb)]&&{'finished_at':_0x1b8d0d['finishedAt']},...Object[_0x17431a(0xd5)](_0x1b8d0d['params'])['length']>0x0&&{'params':_0x1b8d0d['params']}};return await handleSingleObjectOutput(_0x1a86eb,_0x44c988),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a56_0x2e361e(0x1f9)]='workflow:tasks';['description']=a56_0x2e361e(0x17d);async[a56_0x2e361e(0xf9)](_0x579908){const _0x7c92fe=a56_0x2e361e,{options:_0x43427d,args:_0x4ee464,tdx:_0x275ac9}=_0x579908,_0x240c2d=_0x4ee464[0x0];if(!_0x240c2d)return console[_0x7c92fe(0x184)](_0x7c92fe(0x1bd)),0x1;const _0x5a2c96=_0x43427d['includeSubtasks'];_0x43427d[_0x7c92fe(0x236)]&&(console[_0x7c92fe(0x184)]('Attempt\x20ID:\x20'+_0x240c2d),_0x5a2c96&&console[_0x7c92fe(0x184)](_0x7c92fe(0x204)));const _0x2529d4=await withSpinner(_0x7c92fe(0xa0),()=>_0x275ac9[_0x7c92fe(0x128)][_0x7c92fe(0x1c8)](_0x240c2d,_0x5a2c96||![]),{'verbose':_0x43427d['verbose']}),_0x52e255=_0x2529d4[_0x7c92fe(0x169)];return console['error'](_0x7c92fe(0x1a0)+_0x52e255[_0x7c92fe(0x1c6)]+_0x7c92fe(0x115)+(_0x52e255[_0x7c92fe(0x1c6)]!==0x1?'s':'')),await handleSDKOutput(_0x52e255,_0x43427d),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a56_0x2e361e(0x1f9)]=a56_0x2e361e(0x228);[a56_0x2e361e(0x109)]=a56_0x2e361e(0xb8);async[a56_0x2e361e(0xf9)](_0x498c11){const _0x3d24c3=a56_0x2e361e,{options:_0x25f8ea,args:_0x376d01,tdx:_0x14a2c8}=_0x498c11,_0x22f901=_0x376d01[0x0];let _0x43dd7e=_0x376d01[0x1];if(!_0x22f901)return console[_0x3d24c3(0x184)](_0x3d24c3(0x1bd)),0x1;_0x25f8ea[_0x3d24c3(0x236)]&&(console[_0x3d24c3(0x184)](_0x3d24c3(0x20b)+_0x22f901),_0x43dd7e&&console['error']('Task\x20name:\x20'+_0x43dd7e));const _0x5c37c8=await withSpinner('Fetching\x20log\x20files...',()=>_0x14a2c8['workflow']['logFiles'](_0x22f901,_0x43dd7e),{'verbose':_0x25f8ea[_0x3d24c3(0x236)]}),_0x1096f8=_0x5c37c8[_0x3d24c3(0x169)];if(_0x1096f8[_0x3d24c3(0x1c6)]===0x0)return console[_0x3d24c3(0x184)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x43dd7e&&(_0x25f8ea[_0x3d24c3(0x1b7)]||_0x25f8ea['format']))return await handleSDKOutput(_0x1096f8,_0x25f8ea),0x0;if(!_0x43dd7e){const _0x1c2b2c=_0x1096f8[_0x3d24c3(0xbb)](_0x19b1ef=>({'title':_0x19b1ef[_0x3d24c3(0x20f)]+'\x20('+formatBytes(_0x19b1ef[_0x3d24c3(0xd0)])+')','value':_0x19b1ef['taskName']})),_0x5d7ce4=await a56_0x31c40f({'type':_0x3d24c3(0x90),'name':_0x3d24c3(0x1d6),'message':_0x3d24c3(0x220),'choices':_0x1c2b2c});if(!_0x5d7ce4[_0x3d24c3(0x1d6)])return console[_0x3d24c3(0x184)](_0x3d24c3(0xe9)),0x0;_0x43dd7e=_0x5d7ce4[_0x3d24c3(0x1d6)];}const _0x6bbf00=await withSpinner(_0x3d24c3(0x1d9),()=>_0x14a2c8[_0x3d24c3(0x128)][_0x3d24c3(0x179)](_0x22f901,_0x43dd7e),{'verbose':_0x25f8ea['verbose']}),_0x3d11ed=_0x6bbf00[_0x3d24c3(0x169)];return _0x3d11ed?console[_0x3d24c3(0x15b)](_0x3d11ed):console[_0x3d24c3(0x184)](_0x3d24c3(0x154)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a56_0x2e361e(0x1f9)]='workflow:kill';[a56_0x2e361e(0x109)]=a56_0x2e361e(0x24a);async[a56_0x2e361e(0xf9)](_0x25e7ce){const _0x4f8e10=a56_0x2e361e,{options:_0x5998fe,args:_0x98f321,tdx:_0xfd2cc5}=_0x25e7ce,_0x57dc2c=_0x98f321[0x0];if(!_0x57dc2c)return console[_0x4f8e10(0x184)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x43de89=_0x5998fe[_0x4f8e10(0x170)];_0x5998fe[_0x4f8e10(0x236)]&&(console[_0x4f8e10(0x184)](_0x4f8e10(0x20b)+_0x57dc2c),_0x43de89&&console[_0x4f8e10(0x184)](_0x4f8e10(0xbe)+_0x43de89));if(!_0x5998fe['yes']){if(!isInteractive())return console[_0x4f8e10(0x184)](a56_0x515cb3[_0x4f8e10(0x254)](_0x4f8e10(0x14c)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4f8e10(0x184)](a56_0x515cb3['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x62d82=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x57dc2c+'?');if(!_0x62d82)return console[_0x4f8e10(0x184)](a56_0x515cb3[_0x4f8e10(0x12c)](_0x4f8e10(0xe9))),0x1;}const _0x2cb903=await withSpinner(_0x4f8e10(0x205),()=>_0xfd2cc5[_0x4f8e10(0x128)][_0x4f8e10(0x1a4)](_0x57dc2c,_0x43de89),{'verbose':_0x5998fe[_0x4f8e10(0x236)]}),_0x224ca8=_0x2cb903[_0x4f8e10(0x169)];return console[_0x4f8e10(0x184)]('✔\x20'+_0x224ca8),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a56_0x2e361e(0x1b6);[a56_0x2e361e(0x109)]=a56_0x2e361e(0x1bc);async[a56_0x2e361e(0xf9)](_0x475a48){const _0x47e85d=a56_0x2e361e,{options:_0x3844ec,args:_0x5e621a,tdx:_0x3af003}=_0x475a48,_0x383c66=_0x5e621a[0x0];if(!_0x383c66)return console[_0x47e85d(0x184)](_0x47e85d(0x88)),console[_0x47e85d(0x184)](_0x47e85d(0x139)),0x1;let _0x2f816e=![],_0x1ae512=_0x383c66;if(_0x383c66[_0x47e85d(0xa3)](_0x47e85d(0x23d)))_0x2f816e=!![],_0x1ae512=_0x383c66['substring'](0x8);else{if(_0x383c66[_0x47e85d(0xa3)](_0x47e85d(0x12d)))_0x2f816e=![],_0x1ae512=_0x383c66[_0x47e85d(0xea)](0x8);else return console[_0x47e85d(0x184)](_0x47e85d(0x246)),console[_0x47e85d(0x184)](_0x47e85d(0x139)),0x1;}const _0x14ff5a=_0x3844ec[_0x47e85d(0xdb)],_0x28c4fa=_0x3844ec[_0x47e85d(0x243)],_0x11a6ba=_0x3844ec[_0x47e85d(0xc3)],_0x16813c=_0x3844ec[_0x47e85d(0xba)];_0x3844ec[_0x47e85d(0x236)]&&(console[_0x47e85d(0x184)](_0x47e85d(0xcb)+(_0x2f816e?'session':_0x47e85d(0x227))+'\x20'+_0x1ae512),_0x14ff5a&&console[_0x47e85d(0x184)](_0x47e85d(0x140)+_0x14ff5a),_0x28c4fa&&console[_0x47e85d(0x184)](_0x47e85d(0x18c)+_0x28c4fa),_0x11a6ba&&console[_0x47e85d(0x184)]('Params:\x20'+_0x11a6ba),_0x16813c&&console['error'](_0x47e85d(0x12f)));let _0x861f25;if(_0x11a6ba)try{if(_0x11a6ba['startsWith']('@')){const _0x135f5d=await import(_0x47e85d(0x134)),_0x34af2a=_0x11a6ba[_0x47e85d(0xea)](0x1),_0x3549ce=await _0x135f5d[_0x47e85d(0xe0)](_0x34af2a,_0x47e85d(0xd3));_0x861f25=JSON[_0x47e85d(0xbf)](_0x3549ce);}else _0x861f25=JSON[_0x47e85d(0xbf)](_0x11a6ba);}catch{return console[_0x47e85d(0x184)](_0x47e85d(0x233)),0x1;}if(!_0x3844ec['yes']){if(!isInteractive())return console[_0x47e85d(0x184)](a56_0x515cb3[_0x47e85d(0x254)](_0x47e85d(0x14c)),_0x47e85d(0x135)),console['error'](a56_0x515cb3[_0x47e85d(0x103)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3296eb=await confirmKey(_0x47e85d(0x1ef)+(_0x2f816e?'session':_0x47e85d(0x227))+'\x20'+_0x1ae512+'?');if(!_0x3296eb)return console['error'](a56_0x515cb3[_0x47e85d(0x12c)](_0x47e85d(0xe9))),0x1;}let _0x3caf79;_0x2f816e?_0x3caf79=await withSpinner(_0x47e85d(0x22c),()=>_0x3af003[_0x47e85d(0x128)]['retrySession'](_0x1ae512,{'fromTask':_0x14ff5a,'retryParams':_0x861f25}),{'verbose':_0x3844ec[_0x47e85d(0x236)]}):_0x3caf79=await withSpinner(_0x47e85d(0x196),()=>_0x3af003[_0x47e85d(0x128)]['retryAttempt'](_0x1ae512,{'resumeFrom':_0x28c4fa,'retryParams':_0x861f25,'force':_0x16813c}),{'verbose':_0x3844ec[_0x47e85d(0x236)]});const _0xc8c522=_0x3caf79[_0x47e85d(0x169)];return console[_0x47e85d(0x184)](_0x47e85d(0x197)),console['error'](_0x47e85d(0x159)+_0xc8c522[_0x47e85d(0x16e)]),console[_0x47e85d(0x184)](_0x47e85d(0x183)+_0xc8c522[_0x47e85d(0x1ad)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a56_0x2e361e(0x1f9)]='workflow:run';[a56_0x2e361e(0x109)]=a56_0x2e361e(0x1b5);async[a56_0x2e361e(0xf9)](_0x309132){const _0x8942ab=a56_0x2e361e,{options:_0x21f505,args:_0x52aee9,tdx:_0x147d77}=_0x309132;let _0x4956d3=_0x52aee9[0x0];if(!_0x4956d3){const _0x15c972=this['resolveProject']([],_0x21f505),_0xf26a0d=await withSpinner(_0x8942ab(0xe3),()=>_0x147d77[_0x8942ab(0x128)][_0x8942ab(0x258)](_0x15c972,{'limit':_0x21f505[_0x8942ab(0xac)]}),{'verbose':_0x21f505[_0x8942ab(0x236)]}),_0x4afc5a=_0xf26a0d[_0x8942ab(0x169)];if(_0x4afc5a[_0x8942ab(0x1c6)]===0x0)return console[_0x8942ab(0x184)](_0x8942ab(0x1c4)),!_0x15c972&&console[_0x8942ab(0x184)](a56_0x515cb3['dim'](_0x8942ab(0x239))),0x1;const _0x4425f0=_0x4afc5a['map'](_0x58f5a8=>({'title':_0x58f5a8['project']?.[_0x8942ab(0x1f9)]+'.'+_0x58f5a8[_0x8942ab(0x1f9)],'value':_0x58f5a8[_0x8942ab(0x155)]?.[_0x8942ab(0x1f9)]+'.'+_0x58f5a8['name'],'description':_0x58f5a8['revision']?_0x8942ab(0xbd)+_0x58f5a8[_0x8942ab(0x101)]:undefined})),_0x1806d0=await a56_0x31c40f({'type':_0x8942ab(0x90),'name':_0x8942ab(0x128),'message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x4425f0});if(!_0x1806d0['workflow'])return 0x1;_0x4956d3=_0x1806d0[_0x8942ab(0x128)];}if(!_0x4956d3[_0x8942ab(0x207)]('.')){const _0x1cf5d6=this['resolveProject']([],_0x21f505);if(_0x1cf5d6)_0x4956d3=_0x1cf5d6+'.'+_0x4956d3;else return console['error'](a56_0x515cb3[_0x8942ab(0x254)](_0x8942ab(0x9e)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x8942ab(0x184)](a56_0x515cb3[_0x8942ab(0x103)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x276519=_0x21f505['param'],_0x4cfa62=_0x21f505[_0x8942ab(0x95)],_0x366e04={};if(_0x276519&&Array[_0x8942ab(0x22d)](_0x276519))for(const _0x1fe5d8 of _0x276519){const _0x840174=_0x1fe5d8[_0x8942ab(0x192)]('=');if(_0x840174===-0x1)return console[_0x8942ab(0x184)](_0x8942ab(0x147)+_0x1fe5d8),console[_0x8942ab(0x184)](_0x8942ab(0x165)),0x1;const _0x11e14a=_0x1fe5d8[_0x8942ab(0xea)](0x0,_0x840174),_0x241d2f=_0x1fe5d8['substring'](_0x840174+0x1);try{_0x366e04[_0x11e14a]=JSON[_0x8942ab(0xbf)](_0x241d2f);}catch{_0x366e04[_0x11e14a]=_0x241d2f;}}_0x21f505['verbose']&&(console[_0x8942ab(0x184)](_0x8942ab(0x125)+_0x4956d3),Object[_0x8942ab(0xd5)](_0x366e04)[_0x8942ab(0x1c6)]>0x0&&console[_0x8942ab(0x184)](_0x8942ab(0xab)+JSON[_0x8942ab(0x10f)](_0x366e04)),_0x4cfa62&&console[_0x8942ab(0x184)]('Session\x20time:\x20'+_0x4cfa62));if(_0x21f505[_0x8942ab(0xc4)])return await this[_0x8942ab(0x172)](_0x309132,_0x4956d3,_0x366e04,_0x4cfa62);const _0x5c0c15=await withSpinner(_0x8942ab(0xad),()=>_0x147d77[_0x8942ab(0x128)][_0x8942ab(0xa1)](_0x4956d3,_0x366e04,{'sessionTime':_0x4cfa62}),{'verbose':_0x21f505[_0x8942ab(0x236)]}),_0x167e83=_0x5c0c15[_0x8942ab(0x169)];console[_0x8942ab(0x184)](_0x8942ab(0x195)),console['error'](_0x8942ab(0x1e8)+_0x167e83['id']),console['error']('\x20\x20Session\x20ID:\x20'+_0x167e83[_0x8942ab(0x1ad)]),console[_0x8942ab(0x184)](_0x8942ab(0x1d2)+_0x167e83[_0x8942ab(0x155)]?.[_0x8942ab(0x1f9)]),console['error'](_0x8942ab(0x93)+_0x167e83[_0x8942ab(0x128)]?.[_0x8942ab(0x1f9)]);if(_0x167e83['project']?.['id']&&_0x167e83[_0x8942ab(0x1ad)]&&_0x167e83['id']){const _0x15f0a5=_0x21f505[_0x8942ab(0x174)],_0x237957=getConsoleUrl(_0x15f0a5,_0x8942ab(0xc9)+_0x167e83[_0x8942ab(0x155)]['id']+_0x8942ab(0x19d)+_0x167e83[_0x8942ab(0x1ad)]+_0x8942ab(0xde)+_0x167e83['id']);console['error'](_0x8942ab(0x1be)+a56_0x515cb3[_0x8942ab(0x17a)](_0x237957));}return 0x0;}async[a56_0x2e361e(0x172)](_0x18eae5,_0x13f158,_0x478940,_0x259e8b){const _0xe8d751=a56_0x2e361e,{options:_0xddf67d,tdx:_0x326e3b}=_0x18eae5,_0x4fc07c=await withSpinner('Fetching\x20workflow\x20'+_0x13f158+'...',()=>_0x326e3b[_0xe8d751(0x128)]['getWorkflow'](_0x13f158),{'verbose':_0xddf67d[_0xe8d751(0x236)]}),_0x22a991=_0x4fc07c['data'],_0x2866b7=_0x259e8b??new Date()['toISOString']();console[_0xe8d751(0x15b)](a56_0x515cb3[_0xe8d751(0xc5)](_0xe8d751(0x230)),_0x13f158),console[_0xe8d751(0x15b)](a56_0x515cb3[_0xe8d751(0xc5)](_0xe8d751(0x203)),_0x2866b7),console[_0xe8d751(0x15b)](a56_0x515cb3[_0xe8d751(0xc5)]('Parameters:'),JSON[_0xe8d751(0x10f)](_0x478940)),console[_0xe8d751(0x15b)](''),console[_0xe8d751(0x15b)](a56_0x515cb3['bold'](_0xe8d751(0x215)));const _0x3440c8=parseTaskGraph(_0x22a991[_0xe8d751(0x112)]??null);if(_0x3440c8[_0xe8d751(0x1c6)]===0x0)console[_0xe8d751(0x15b)](a56_0x515cb3[_0xe8d751(0x103)]('\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)'));else for(const _0x11cd6c of formatTaskGraph(_0x3440c8)){console[_0xe8d751(0x15b)](_0x11cd6c);}const _0x15bdc0=summarizeTaskGraph(_0x3440c8),_0x20b624=formatWarningSummary(_0x15bdc0);return _0x20b624&&(console[_0xe8d751(0x15b)](''),console[_0xe8d751(0x15b)](a56_0x515cb3[_0xe8d751(0x12c)](_0x20b624))),console[_0xe8d751(0x15b)](a56_0x515cb3[_0xe8d751(0x12c)]('\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.')),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a56_0x2e361e(0x1f9)]='workflow:download';['description']=a56_0x2e361e(0x19b);async[a56_0x2e361e(0xf9)](_0x4935c5){const _0x10b63e=a56_0x2e361e,{options:_0x10f342,args:_0x55b156,tdx:_0x486cbd}=_0x4935c5,_0x3cd016=_0x55b156[0x0],_0x463425=_0x55b156[0x1]||'.';if(!_0x3cd016)return console['error'](_0x10b63e(0x131)),console[_0x10b63e(0x184)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x33fc20=_0x10f342[_0x10b63e(0x101)];_0x10f342[_0x10b63e(0x236)]&&(console[_0x10b63e(0x184)]('Project:\x20'+_0x3cd016),console[_0x10b63e(0x184)](_0x10b63e(0x1a7)+_0x463425),_0x33fc20&&console[_0x10b63e(0x184)](_0x10b63e(0x23e)+_0x33fc20));const _0x2b1d69=await withSpinner(_0x10b63e(0x21c)+_0x3cd016+_0x10b63e(0xce),()=>_0x486cbd[_0x10b63e(0x128)][_0x10b63e(0x1cd)](_0x3cd016,_0x463425,{'revision':_0x33fc20}),{'verbose':_0x10f342[_0x10b63e(0x236)]}),_0x15bcd9=_0x2b1d69[_0x10b63e(0x169)];return console['error'](_0x10b63e(0x1e5)+_0x15bcd9[_0x10b63e(0xf8)]),console[_0x10b63e(0x184)]('\x20\x20Revision:\x20'+_0x15bcd9[_0x10b63e(0x101)]),console[_0x10b63e(0x184)](_0x10b63e(0x16b)+_0x15bcd9[_0x10b63e(0x1ed)]),console[_0x10b63e(0x184)](_0x10b63e(0x141)+_0x463425+'/'+_0x15bcd9[_0x10b63e(0xf8)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a56_0x2e361e(0x1f9)]='workflow:upload';[a56_0x2e361e(0x109)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20AI\x20(digdag-style)';async[a56_0x2e361e(0xf9)](_0x1dff63){const _0x283c28=a56_0x2e361e,{options:_0xc49200,args:_0x58595a,tdx:_0x131077}=_0x1dff63;let _0x278a04='.',_0x398302=_0xc49200[_0x283c28(0x1f9)];if(_0x58595a[0x0]){const {promises:_0x2da7ff}=await import('fs');try{const _0x1c3f1c=await _0x2da7ff[_0x283c28(0xc8)](_0x58595a[0x0]);if(_0x1c3f1c[_0x283c28(0x13f)]())_0x278a04=_0x58595a[0x0];else return console['error'](_0x283c28(0x124)+_0x58595a[0x0]+_0x283c28(0x19f)),0x1;}catch{_0x398302=_0x58595a[0x0],_0x278a04='.';}}const _0x12a950=_0xc49200['revision'],_0xfdbde9=_0xc49200[_0x283c28(0x119)];_0xc49200['verbose']&&(console[_0x283c28(0x184)](_0x283c28(0x1d0)+_0x278a04),_0x398302&&console[_0x283c28(0x184)](_0x283c28(0x92)+_0x398302),_0x12a950&&console[_0x283c28(0x184)](_0x283c28(0x23e)+_0x12a950),_0xfdbde9&&console[_0x283c28(0x184)](_0x283c28(0x116)));const _0x3fbb9a=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x131077[_0x283c28(0x128)][_0x283c28(0x208)](_0x278a04,{'projectName':_0x398302,'revision':_0x12a950,'skipValidation':_0xfdbde9}),{'verbose':_0xc49200[_0x283c28(0x236)]}),_0x484fde=_0x3fbb9a[_0x283c28(0x169)];return console[_0x283c28(0x184)]('✔\x20Pushed\x20'+_0x484fde[_0x283c28(0xf8)]),console[_0x283c28(0x184)](_0x283c28(0xf6)+_0x484fde['projectId']),console[_0x283c28(0x184)](_0x283c28(0x85)+_0x484fde[_0x283c28(0x101)]),await this[_0x283c28(0x176)](_0x131077,_0x484fde[_0x283c28(0xf8)],_0xc49200['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a56_0x2e361e(0x1f9)]=a56_0x2e361e(0x1aa);[a56_0x2e361e(0x109)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a56_0x2e361e(0xf9)](_0x2ee692){const _0x4001d1=a56_0x2e361e,{options:_0x19188c,args:_0x144254,tdx:_0x1121c7}=_0x2ee692,_0x1f7195=_0x144254[0x0],_0x2d33b6=_0x144254[0x1];if(!_0x1f7195)return console['error'](a56_0x515cb3['red']('Error:'),'Project\x20name\x20is\x20required'),console['error'](a56_0x515cb3[_0x4001d1(0x103)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0xb65b19=_0x19188c['revision'];_0x19188c['verbose']&&(console[_0x4001d1(0x184)](_0x4001d1(0x18e)+_0x1f7195),_0x2d33b6&&console[_0x4001d1(0x184)](_0x4001d1(0x1b9)+_0x2d33b6),_0xb65b19&&console['error'](_0x4001d1(0x23e)+_0xb65b19),_0x19188c[_0x4001d1(0xc4)]&&console['error']('Dry\x20run:\x20yes'));const _0x283ea1=await withSpinner(_0x4001d1(0x1ff)+_0x1f7195+'...',()=>_0x1121c7['workflow'][_0x4001d1(0x1ea)](_0x1f7195,{'targetDir':_0x2d33b6,'revision':_0xb65b19}),{'verbose':_0x19188c[_0x4001d1(0x236)]}),_0x4c6c21=_0x283ea1[_0x4001d1(0x169)];_0x4c6c21['isNewProject']?console['error'](_0x4001d1(0xd2)+_0x4c6c21[_0x4001d1(0xf8)]):console[_0x4001d1(0x184)](_0x4001d1(0xf0)+_0x4c6c21[_0x4001d1(0xf8)]);console['error']('\x20\x20Revision:\x20'+_0x4c6c21[_0x4001d1(0x101)]),console['error']('\x20\x20Target:\x20'+(a56_0x2b37fe[_0x4001d1(0x23f)](process[_0x4001d1(0x241)](),_0x4c6c21[_0x4001d1(0x1f8)])||'.')),console[_0x4001d1(0x184)](_0x4001d1(0x87)+a56_0x515cb3[_0x4001d1(0x13b)]('+'+_0x4c6c21[_0x4001d1(0x24c)][_0x4001d1(0xc1)]+_0x4001d1(0x1c7))+',\x20'+(a56_0x515cb3[_0x4001d1(0x12c)]('~'+_0x4c6c21[_0x4001d1(0x24c)][_0x4001d1(0xe2)]+'\x20modified')+',\x20')+(a56_0x515cb3[_0x4001d1(0x254)]('-'+_0x4c6c21[_0x4001d1(0x24c)][_0x4001d1(0x1c0)]+_0x4001d1(0x1d8))+',\x20')+(''+a56_0x515cb3[_0x4001d1(0x103)](_0x4c6c21[_0x4001d1(0x24c)]['unchanged']+_0x4001d1(0x231))));for(const _0x11bd49 of _0x4c6c21['changes']){_0x11bd49[_0x4001d1(0x156)]===_0x4001d1(0xe2)&&_0x11bd49[_0x4001d1(0x20a)]&&(console[_0x4001d1(0x184)]('\x0a'+a56_0x515cb3[_0x4001d1(0x17a)]('---\x20'+_0x11bd49[_0x4001d1(0x217)])),console[_0x4001d1(0x184)](_0x11bd49[_0x4001d1(0x20a)]));}if(!_0x4c6c21[_0x4001d1(0x1a3)])return saveSessionContext({'workflow_project':_0x4c6c21['projectName']},_0x19188c['session']),console[_0x4001d1(0x184)](a56_0x515cb3['green'](_0x4001d1(0xfa))),console['error'](a56_0x515cb3[_0x4001d1(0x103)](_0x4001d1(0x180)+_0x4c6c21['projectName'])),0x0;if(_0x19188c[_0x4001d1(0xc4)])return console[_0x4001d1(0x184)](a56_0x515cb3[_0x4001d1(0x12c)](_0x4001d1(0x248))),0x0;if(!_0x19188c[_0x4001d1(0xf1)]){if(!isInteractive())return console['error'](a56_0x515cb3[_0x4001d1(0x254)](_0x4001d1(0x14c)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4001d1(0x184)](a56_0x515cb3[_0x4001d1(0x103)](_0x4001d1(0x143))),0x1;const _0x4c7ed6=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x4c7ed6)return console[_0x4001d1(0x184)](a56_0x515cb3[_0x4001d1(0x12c)](_0x4001d1(0xe9)),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x4001d1(0x211),()=>_0x1121c7['workflow'][_0x4001d1(0xd4)](_0x4c6c21,{'revision':_0xb65b19}),{'verbose':_0x19188c['verbose']}),saveSessionContext({'workflow_project':_0x4c6c21['projectName']},_0x19188c[_0x4001d1(0x219)]),console[_0x4001d1(0x184)](a56_0x515cb3['green'](_0x4001d1(0x100)));const _0x408bb1=a56_0x2b37fe['relative'](process['cwd'](),_0x4c6c21[_0x4001d1(0x1f8)])||'.';return console[_0x4001d1(0x184)](a56_0x515cb3[_0x4001d1(0x103)](_0x4001d1(0x141)+_0x408bb1)),console[_0x4001d1(0x184)](a56_0x515cb3['dim'](_0x4001d1(0x180)+_0x4c6c21['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a56_0x2e361e(0x19e);[a56_0x2e361e(0x109)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20AI';async['execute'](_0x5dc05c){const _0xa9d246=a56_0x2e361e,{options:_0x2a6dc6,args:_0x48c474,tdx:_0x4b5569}=_0x5dc05c,_0x3e2992=this[_0xa9d246(0x11d)](_0x48c474,_0x2a6dc6),_0x57f7f0=_0x2a6dc6,{revision:_0x20ced2,skipValidation:_0xc4947,backfill:_0x551876}=_0x57f7f0,_0x19ac49=_0x551876===undefined?undefined:!_0x551876;_0x2a6dc6['verbose']&&(_0x3e2992&&console[_0xa9d246(0x184)](_0xa9d246(0x210)+_0x3e2992),_0x20ced2&&console[_0xa9d246(0x184)](_0xa9d246(0x23e)+_0x20ced2),_0x2a6dc6[_0xa9d246(0xc4)]&&console[_0xa9d246(0x184)](_0xa9d246(0x14d)),_0xc4947&&console[_0xa9d246(0x184)](_0xa9d246(0x116)),_0x551876&&console[_0xa9d246(0x184)](_0xa9d246(0x256)));let _0x45f1f1;try{_0x45f1f1=await withSpinner(_0xa9d246(0xa4),()=>_0x4b5569[_0xa9d246(0x128)]['preparePushProject']({'sourceDir':_0x3e2992,'revision':_0x20ced2,'skipValidation':_0xc4947,'skipSchedule':_0x19ac49}),{'verbose':_0x2a6dc6[_0xa9d246(0x236)]});}catch(_0x34f3f5){if(_0x34f3f5 instanceof Error&&_0x34f3f5['message'][_0xa9d246(0x207)](_0xa9d246(0x8c)))return console[_0xa9d246(0x184)](a56_0x515cb3[_0xa9d246(0x254)](_0xa9d246(0x9e)),_0xa9d246(0x1b1)),_0x2a6dc6[_0xa9d246(0x178)]?console['error'](a56_0x515cb3[_0xa9d246(0x103)](_0xa9d246(0x235)+_0x2a6dc6[_0xa9d246(0x178)]+_0xa9d246(0x1cb)+_0x2a6dc6[_0xa9d246(0x178)]+'\x27')):console['error'](a56_0x515cb3['dim']('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x34f3f5;}const _0x2d0c37=_0x45f1f1[_0xa9d246(0x169)];console[_0xa9d246(0x184)](_0xa9d246(0x21a)+_0x2d0c37[_0xa9d246(0xf8)]),console[_0xa9d246(0x184)](_0xa9d246(0xbc)+_0x2d0c37['sourceDir']),console[_0xa9d246(0x184)]('\x20\x20Revision:\x20'+_0x2d0c37['revision']),console[_0xa9d246(0x184)](_0xa9d246(0x87)+a56_0x515cb3[_0xa9d246(0x13b)]('+'+_0x2d0c37['summary'][_0xa9d246(0xc1)]+_0xa9d246(0x1c7))+',\x20'+(a56_0x515cb3[_0xa9d246(0x12c)]('~'+_0x2d0c37[_0xa9d246(0x24c)][_0xa9d246(0xe2)]+'\x20modified')+',\x20')+(a56_0x515cb3[_0xa9d246(0x254)]('-'+_0x2d0c37[_0xa9d246(0x24c)]['deleted']+'\x20deleted')+',\x20')+(''+a56_0x515cb3[_0xa9d246(0x103)](_0x2d0c37[_0xa9d246(0x24c)][_0xa9d246(0x238)]+_0xa9d246(0x231))));for(const _0x1a56a3 of _0x2d0c37[_0xa9d246(0x1ca)]){_0x1a56a3[_0xa9d246(0x156)]===_0xa9d246(0xe2)&&_0x1a56a3[_0xa9d246(0x20a)]&&(console[_0xa9d246(0x184)]('\x0a'+a56_0x515cb3['cyan'](_0xa9d246(0xaa)+_0x1a56a3[_0xa9d246(0x217)])),console[_0xa9d246(0x184)](_0x1a56a3[_0xa9d246(0x20a)]));}if(!_0x2d0c37['hasChanges'])return console['error'](a56_0x515cb3[_0xa9d246(0x13b)](_0xa9d246(0x1c3))),await this['showWorkflowConsoleUrl'](_0x4b5569,_0x2d0c37[_0xa9d246(0xf8)],_0x2a6dc6['site']),0x0;if(_0x2a6dc6[_0xa9d246(0xc4)])return console[_0xa9d246(0x184)](a56_0x515cb3[_0xa9d246(0x12c)](_0xa9d246(0x118))),0x0;if(!_0x2a6dc6[_0xa9d246(0xf1)]){if(!isInteractive())return console[_0xa9d246(0x184)](a56_0x515cb3[_0xa9d246(0x254)](_0xa9d246(0x14c)),_0xa9d246(0x135)),console[_0xa9d246(0x184)](a56_0x515cb3['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3132d1=await confirmKey(_0xa9d246(0xfd));if(!_0x3132d1)return console['error'](a56_0x515cb3[_0xa9d246(0x12c)](_0xa9d246(0xe9)),_0xa9d246(0x253)),0x1;}const _0x34f42f=await withSpinner(_0xa9d246(0x216),()=>_0x4b5569[_0xa9d246(0x128)][_0xa9d246(0x1f4)](_0x2d0c37),{'verbose':_0x2a6dc6[_0xa9d246(0x236)]}),_0x4bb3a3=_0x34f42f[_0xa9d246(0x169)];return console['error'](a56_0x515cb3[_0xa9d246(0x13b)]('✔\x20Push\x20complete')),console[_0xa9d246(0x184)]('\x20\x20Project\x20ID:\x20'+_0x4bb3a3[_0xa9d246(0xb2)]),console['error']('\x20\x20Revision:\x20'+_0x4bb3a3[_0xa9d246(0x101)]),await this[_0xa9d246(0x176)](_0x4b5569,_0x4bb3a3[_0xa9d246(0xf8)],_0x2a6dc6[_0xa9d246(0x174)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a56_0x2e361e(0x1f9)]=a56_0x2e361e(0xcd);[a56_0x2e361e(0x109)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async['execute'](_0xf2558a){const _0x407ebe=a56_0x2e361e,{options:_0x336ca3,args:_0x13593b,tdx:_0x344b73}=_0xf2558a,_0x431411=this[_0x407ebe(0x11d)](_0x13593b,_0x336ca3),_0x9db786=_0x336ca3[_0x407ebe(0x1f9)],_0x3264c9=_0x336ca3[_0x407ebe(0x101)],_0x3aba34=_0x336ca3['skipValidation'];if(!_0x431411)return console[_0x407ebe(0x184)](a56_0x515cb3['red'](_0x407ebe(0x9e)),'Source\x20directory\x20is\x20required'),console[_0x407ebe(0x184)](a56_0x515cb3[_0x407ebe(0x103)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x407ebe(0x184)](a56_0x515cb3[_0x407ebe(0x103)](_0x407ebe(0x137))),0x1;if(!_0x9db786)return console['error'](a56_0x515cb3['red'](_0x407ebe(0x9e)),_0x407ebe(0x108)),console['error'](a56_0x515cb3[_0x407ebe(0x103)](_0x407ebe(0x136))),0x1;_0x336ca3[_0x407ebe(0x236)]&&(console[_0x407ebe(0x184)](_0x407ebe(0x210)+_0x431411),console['error'](_0x407ebe(0xe7)+_0x9db786),_0x3264c9&&console[_0x407ebe(0x184)](_0x407ebe(0x23e)+_0x3264c9),_0x336ca3[_0x407ebe(0xc4)]&&console[_0x407ebe(0x184)]('Dry\x20run:\x20yes'),_0x3aba34&&console[_0x407ebe(0x184)]('Validation:\x20skipped'));const _0x214fc2=await withSpinner(_0x407ebe(0xe8),()=>_0x344b73[_0x407ebe(0x128)][_0x407ebe(0x98)](_0x431411,_0x9db786,{'revision':_0x3264c9,'skipValidation':_0x3aba34}),{'verbose':_0x336ca3[_0x407ebe(0x236)]}),_0x382317=_0x214fc2[_0x407ebe(0x169)];console[_0x407ebe(0x184)](_0x407ebe(0x190)+_0x382317[_0x407ebe(0x21b)]);_0x382317[_0x407ebe(0x9c)]&&console[_0x407ebe(0x184)]('Source\x20project:\x20'+_0x382317[_0x407ebe(0x9c)]);console[_0x407ebe(0x184)](_0x407ebe(0xe7)+_0x382317['newProjectName']),console[_0x407ebe(0x184)](_0x407ebe(0x23e)+_0x382317[_0x407ebe(0x101)]),console[_0x407ebe(0x184)](_0x407ebe(0x23a)+_0x382317[_0x407ebe(0x19a)]);_0x382317[_0x407ebe(0x164)]&&(console[_0x407ebe(0x184)](a56_0x515cb3['yellow'](_0x407ebe(0x24d)+_0x382317[_0x407ebe(0x1d1)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x382317[_0x407ebe(0xf5)]+')')),console['error'](a56_0x515cb3[_0x407ebe(0x12c)](_0x407ebe(0x10d))));if(_0x336ca3[_0x407ebe(0xc4)])return console[_0x407ebe(0x184)](a56_0x515cb3['yellow'](_0x407ebe(0x111))),0x0;if(!_0x336ca3[_0x407ebe(0xf1)]){if(!isInteractive())return console[_0x407ebe(0x184)](a56_0x515cb3[_0x407ebe(0x254)](_0x407ebe(0x14c)),_0x407ebe(0x135)),console[_0x407ebe(0x184)](a56_0x515cb3[_0x407ebe(0x103)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4e6257=_0x382317['sourceProjectName']||a56_0x2b37fe[_0x407ebe(0x1f0)](_0x431411),_0x46f8aa=_0x382317[_0x407ebe(0x164)]?_0x407ebe(0x22f)+_0x9db786+_0x407ebe(0x175):_0x407ebe(0x240)+_0x4e6257+_0x407ebe(0x1c2)+_0x9db786+'\x22?',_0x2d94e1=await confirmKey(_0x46f8aa);if(!_0x2d94e1)return console[_0x407ebe(0x184)](a56_0x515cb3[_0x407ebe(0x12c)](_0x407ebe(0xe9))),0x1;}const _0x1badfc=await withSpinner(_0x382317[_0x407ebe(0x164)]?'Updating\x20'+_0x9db786+'...':_0x407ebe(0x257)+_0x9db786+_0x407ebe(0xce),()=>_0x344b73[_0x407ebe(0x128)][_0x407ebe(0x200)](_0x382317),{'verbose':_0x336ca3['verbose']}),_0x1c5ca0=_0x1badfc[_0x407ebe(0x169)];return console[_0x407ebe(0x184)](a56_0x515cb3[_0x407ebe(0x13b)](_0x382317['targetExists']?'✔\x20Project\x20updated':_0x407ebe(0x237))),console['error'](_0x407ebe(0x1d2)+_0x1c5ca0[_0x407ebe(0x1d1)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x1c5ca0[_0x407ebe(0x242)]),console['error'](_0x407ebe(0x85)+_0x1c5ca0[_0x407ebe(0x101)]),await this[_0x407ebe(0x176)](_0x344b73,_0x1c5ca0[_0x407ebe(0x1d1)],_0x336ca3[_0x407ebe(0x174)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a56_0x2e361e(0x1f9)]='workflow:delete';[a56_0x2e361e(0x109)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20AI';async[a56_0x2e361e(0xf9)](_0x181028){const _0x4c8c62=a56_0x2e361e,{options:_0x5acaaa,args:_0x4b13b6,tdx:_0x372f50}=_0x181028,_0x2d8346=_0x4b13b6[0x0];if(!_0x2d8346)return console[_0x4c8c62(0x184)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x4c8c62(0x184)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x5acaaa[_0x4c8c62(0x236)]&&console[_0x4c8c62(0x184)](_0x4c8c62(0x18e)+_0x2d8346);if(!_0x5acaaa[_0x4c8c62(0xf1)]){if(!isInteractive())return console[_0x4c8c62(0x184)](a56_0x515cb3[_0x4c8c62(0x254)](_0x4c8c62(0x14c)),_0x4c8c62(0x135)),console[_0x4c8c62(0x184)](a56_0x515cb3[_0x4c8c62(0x103)](_0x4c8c62(0x143))),0x1;const _0x45f35b=await confirmKey(_0x4c8c62(0x11f)+_0x2d8346+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x45f35b)return console[_0x4c8c62(0x184)](a56_0x515cb3[_0x4c8c62(0x12c)](_0x4c8c62(0xe9))),0x1;}const _0x352508=await withSpinner(_0x4c8c62(0x194)+_0x2d8346+_0x4c8c62(0xce),()=>_0x372f50[_0x4c8c62(0x128)][_0x4c8c62(0x1fc)](_0x2d8346),{'verbose':_0x5acaaa[_0x4c8c62(0x236)]}),_0x35d841=_0x352508[_0x4c8c62(0x169)];return console[_0x4c8c62(0x184)]('✔\x20Deleted\x20project\x20'+_0x35d841[_0x4c8c62(0xf8)]),console[_0x4c8c62(0x184)](_0x4c8c62(0xf6)+_0x35d841[_0x4c8c62(0xb2)]),0x0;}}export function parseKeyValue(_0xf13a18){const _0x5e2ac0=a56_0x2e361e,_0x46926d=_0xf13a18[_0x5e2ac0(0x192)]('=');if(_0x46926d===-0x1)throw new Error(_0x5e2ac0(0x24b)+_0xf13a18+_0x5e2ac0(0x123));const _0x2b1673=_0xf13a18[_0x5e2ac0(0xea)](0x0,_0x46926d),_0xd6f7b6=_0xf13a18['substring'](_0x46926d+0x1);if(!_0x2b1673)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x2b1673,'value':_0xd6f7b6};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a56_0x2e361e(0x1af);['description']='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a56_0x2e361e(0xf9)](_0x54e2d7){const _0x2ecbf3=a56_0x2e361e,{options:_0xf4eeb6,args:_0x1e8c96,tdx:_0x32f1e7}=_0x54e2d7,_0x4ee462=this[_0x2ecbf3(0xdf)](_0x1e8c96,_0xf4eeb6);if(!_0x4ee462)return 0x1;_0xf4eeb6[_0x2ecbf3(0x236)]&&console[_0x2ecbf3(0x184)](_0x2ecbf3(0x18e)+_0x4ee462);const _0x3fb03d=await withSpinner(_0x2ecbf3(0x18d),()=>_0x32f1e7[_0x2ecbf3(0x128)][_0x2ecbf3(0xeb)](_0x4ee462),{'verbose':_0xf4eeb6[_0x2ecbf3(0x236)]}),{secrets:_0x470380}=_0x3fb03d['data'];return console[_0x2ecbf3(0x184)]('✔\x20Found\x20'+_0x470380[_0x2ecbf3(0x1c6)]+_0x2ecbf3(0x1df)+(_0x470380[_0x2ecbf3(0x1c6)]!==0x1?'s':'')),await handleSDKOutput(_0x470380,_0xf4eeb6),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a56_0x2e361e(0x1f9)]=a56_0x2e361e(0x86);[a56_0x2e361e(0x109)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a56_0x2e361e(0xf9)](_0x4e23b2){const _0x307d13=a56_0x2e361e,{options:_0x17e967,args:_0x2210ab,tdx:_0x595449}=_0x4e23b2;let _0x38441b,_0x33d86b;if(_0x2210ab[_0x307d13(0x1c6)]>=0x1&&!_0x2210ab[0x0]['includes']('='))_0x38441b=_0x2210ab[0x0],_0x33d86b=_0x2210ab[_0x307d13(0x151)](0x1);else{if(_0x2210ab[_0x307d13(0x1c6)]>=0x1&&_0x17e967['workflowProject'])_0x38441b=_0x17e967[_0x307d13(0x178)],_0x33d86b=_0x2210ab;else return _0x2210ab[_0x307d13(0x1c6)]>=0x1?(console[_0x307d13(0x184)](_0x307d13(0x131)),console[_0x307d13(0x184)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x307d13(0x184)](_0x307d13(0x1c1)),console[_0x307d13(0x184)](_0x307d13(0x142)),0x1);}if(_0x33d86b[_0x307d13(0x1c6)]===0x0)return console[_0x307d13(0x184)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x307d13(0x184)](_0x307d13(0x142)),0x1;const _0x1806d5={};try{for(const _0x31d9d7 of _0x33d86b){const {key:_0x5a0ff8,value:_0x30fc1c}=parseKeyValue(_0x31d9d7);_0x1806d5[_0x5a0ff8]=_0x30fc1c;}}catch(_0x2f4d6a){return _0x2f4d6a instanceof Error&&console[_0x307d13(0x184)](a56_0x515cb3[_0x307d13(0x254)](_0x307d13(0x9e)),_0x2f4d6a['message']),0x1;}const _0x137770=Object['keys'](_0x1806d5);_0x17e967[_0x307d13(0x236)]&&(console[_0x307d13(0x184)](_0x307d13(0x18e)+_0x38441b),console[_0x307d13(0x184)](_0x307d13(0x16c)+_0x137770[_0x307d13(0x122)](',\x20')));const _0x38a4c2=await withSpinner(_0x137770[_0x307d13(0x1c6)]===0x1?_0x307d13(0x13a):'Setting\x20'+_0x137770[_0x307d13(0x1c6)]+_0x307d13(0x9d),()=>_0x595449['workflow'][_0x307d13(0x182)](_0x38441b,_0x1806d5),{'verbose':_0x17e967['verbose']}),_0x51b101=_0x38a4c2[_0x307d13(0x169)];return console[_0x307d13(0x184)](_0x137770[_0x307d13(0x1c6)]===0x1?_0x307d13(0x187)+_0x51b101[_0x307d13(0xd5)][0x0]+_0x307d13(0x199)+_0x51b101[_0x307d13(0xf8)]+'\x27':'✔\x20'+_0x51b101[_0x307d13(0xd5)]['length']+_0x307d13(0x138)+_0x51b101[_0x307d13(0xf8)]+'\x27'),(_0x17e967[_0x307d13(0x1b7)]||_0x17e967[_0x307d13(0x186)])&&await handleSingleObjectOutput(_0x51b101,_0x17e967),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a56_0x2e361e(0x1f9)]=a56_0x2e361e(0xdd);['description']=a56_0x2e361e(0x158);async[a56_0x2e361e(0xf9)](_0x38b684){const _0x5cc759=a56_0x2e361e,{options:_0x1724a7,args:_0x1a40df,tdx:_0xae43a2}=_0x38b684;let _0x153add,_0x3b5ce0;if(_0x1a40df[_0x5cc759(0x1c6)]>=0x2)_0x153add=_0x1a40df[0x0],_0x3b5ce0=_0x1a40df[0x1];else{if(_0x1a40df[_0x5cc759(0x1c6)]===0x1&&_0x1724a7[_0x5cc759(0x178)])_0x153add=_0x1724a7[_0x5cc759(0x178)],_0x3b5ce0=_0x1a40df[0x0];else return _0x1a40df[_0x5cc759(0x1c6)]===0x1?(console[_0x5cc759(0x184)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x5cc759(0x184)](_0x5cc759(0x239)),0x1):(console[_0x5cc759(0x184)](_0x5cc759(0x191)),console['error'](_0x5cc759(0x247)),0x1);}_0x1724a7['verbose']&&(console[_0x5cc759(0x184)](_0x5cc759(0x18e)+_0x153add),console[_0x5cc759(0x184)](_0x5cc759(0x21e)+_0x3b5ce0));if(!_0x1724a7[_0x5cc759(0xf1)]){if(!isInteractive())return console[_0x5cc759(0x184)](a56_0x515cb3[_0x5cc759(0x254)](_0x5cc759(0x14c)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5cc759(0x184)](a56_0x515cb3[_0x5cc759(0x103)](_0x5cc759(0x143))),0x1;const _0x590823=await confirmKey(_0x5cc759(0x1ae)+_0x3b5ce0+'\x27\x20from\x20project\x20\x27'+_0x153add+'\x27?');if(!_0x590823)return console[_0x5cc759(0x184)](a56_0x515cb3[_0x5cc759(0x12c)]('Cancelled')),0x1;}const _0x17f087=await withSpinner(_0x5cc759(0x213),()=>_0xae43a2[_0x5cc759(0x128)][_0x5cc759(0x1e3)](_0x153add,_0x3b5ce0),{'verbose':_0x1724a7[_0x5cc759(0x236)]}),_0x4ab4ef=_0x17f087[_0x5cc759(0x169)];return console[_0x5cc759(0x184)](_0x5cc759(0x187)+_0x4ab4ef[_0x5cc759(0xd7)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x4ab4ef[_0x5cc759(0xf8)]+'\x27'),(_0x1724a7['json']||_0x1724a7[_0x5cc759(0x186)])&&await handleSingleObjectOutput(_0x4ab4ef,_0x1724a7),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(_0xc7f234){const _0x573054=a56_0x2e361e,_0x39f45f=Math[_0x573054(0x1e4)](_0xc7f234/0x3e8),_0x2fa53b=Math[_0x573054(0x1e4)](_0x39f45f/0x3c),_0x2579b5=Math[_0x573054(0x1e4)](_0x2fa53b/0x3c),_0x61da12=Math[_0x573054(0x1e4)](_0x2579b5/0x18);if(_0x61da12>0x0){const _0x5b8947=_0x2579b5%0x18;return _0x5b8947>0x0?_0x61da12+'d\x20'+_0x5b8947+'h':_0x61da12+'d';}else{if(_0x2579b5>0x0){const _0x362884=_0x2fa53b%0x3c;return _0x362884>0x0?_0x2579b5+'h\x20'+_0x362884+'m':_0x2579b5+'h';}else{if(_0x2fa53b>0x0){const _0x46e4e9=_0x39f45f%0x3c;return _0x46e4e9>0x0?_0x2fa53b+'m\x20'+_0x46e4e9+'s':_0x2fa53b+'m';}else return _0x39f45f+'s';}}}function formatTimestamp(_0x39bcd0,_0x340532){const _0x3135c9=a56_0x2e361e,_0x354b28=new Date(_0x39bcd0),_0xc98f2b=String(_0x354b28[_0x3135c9(0x1f1)]())[_0x3135c9(0xfc)](0x2,'0'),_0x32a5de=String(_0x354b28[_0x3135c9(0x114)]())[_0x3135c9(0xfc)](0x2,'0'),_0x49c57b=_0xc98f2b+':'+_0x32a5de,_0x3dede5=_0x354b28[_0x3135c9(0x1e0)]()===_0x340532[_0x3135c9(0x1e0)]()&&_0x354b28[_0x3135c9(0x1fe)]()===_0x340532[_0x3135c9(0x1fe)]()&&_0x354b28[_0x3135c9(0x177)]()===_0x340532[_0x3135c9(0x177)]();if(_0x3dede5)return _0x49c57b;else{const _0x21b766=String(_0x354b28[_0x3135c9(0x1fe)]()+0x1)[_0x3135c9(0xfc)](0x2,'0'),_0x2a0fbc=String(_0x354b28[_0x3135c9(0x177)]())[_0x3135c9(0xfc)](0x2,'0');return _0x21b766+'-'+_0x2a0fbc+'\x20'+_0x49c57b;}}function formatDate(_0x5989c9){const _0x16b510=a56_0x2e361e,_0x2978cd=_0x5989c9['getFullYear'](),_0x3df563=String(_0x5989c9[_0x16b510(0x1fe)]()+0x1)[_0x16b510(0xfc)](0x2,'0'),_0x18e93c=String(_0x5989c9[_0x16b510(0x177)]())[_0x16b510(0xfc)](0x2,'0');return _0x2978cd+'-'+_0x3df563+'-'+_0x18e93c;}function getTaskStateIcon(_0x1aceb4){const _0x4f51f6={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x4f51f6[_0x1aceb4]||'⚪';}function getBarChar(_0xa4816d){const _0x42fe29=a56_0x2e361e;return _0xa4816d===_0x42fe29(0x184)||_0xa4816d===_0x42fe29(0x1bf)?'×':'─';}function getBarColor(_0x3ccbd9){const _0x59b029=a56_0x2e361e,_0x2fc4c1={'success':a56_0x515cb3[_0x59b029(0x13b)],'error':a56_0x515cb3[_0x59b029(0x254)],'group_error':a56_0x515cb3['red'],'running':a56_0x515cb3[_0x59b029(0x11a)],'blocked':a56_0x515cb3[_0x59b029(0x12c)],'planned':a56_0x515cb3[_0x59b029(0x103)],'canceling':a56_0x515cb3[_0x59b029(0x12c)]};return _0x2fc4c1[_0x3ccbd9]||a56_0x515cb3[_0x59b029(0x1cf)];}function parseTaskName(_0x49fcfc){const _0xaca91c=a56_0x2e361e;let _0x14107e=_0x49fcfc[_0xaca91c(0xcc)](/^\++/,'');const _0x17da80=_0x14107e['split']('+'),_0x4c311=_0x17da80[_0xaca91c(0x1c6)]>0x1?_0x17da80[_0xaca91c(0x1c6)]-0x2:0x0,_0x2ec898=_0x17da80[_0x17da80[_0xaca91c(0x1c6)]-0x1]||_0x14107e;return{'level':_0x4c311,'name':'+'+_0x2ec898};}function truncateTaskName(_0x253e9a,_0x4f3325){const _0x4e246f=a56_0x2e361e,_0x1100a7=stringWidth(_0x253e9a);if(_0x1100a7<=_0x4f3325)return _0x253e9a;let _0x11cc95=_0x253e9a;while(stringWidth(_0x11cc95+'…')>_0x4f3325&&_0x11cc95[_0x4e246f(0x1c6)]>0x0){_0x11cc95=_0x11cc95['slice'](0x0,-0x1);}return _0x11cc95+'…';}function a56_0x527f(_0x554459,_0x434968){_0x554459=_0x554459-0x85;const _0x137171=a56_0x1371();let _0x527f36=_0x137171[_0x554459];return _0x527f36;}function calculateTimeScale(_0xd418,_0x3f6a88){const _0x53e3ab=a56_0x2e361e;return{'startTime':_0xd418['start'],'endTime':_0xd418[_0x53e3ab(0x11c)],'durationMs':_0xd418[_0x53e3ab(0xb7)],'msPerChar':_0xd418[_0x53e3ab(0xb7)]/_0x3f6a88};}function timeToPosition(_0xc4f7b7,_0x22d895,_0x1b94fa){const _0x427b48=a56_0x2e361e,_0x40fdc5=_0xc4f7b7-_0x22d895['startTime'],_0x5e7fd9=Math[_0x427b48(0x1e4)](_0x40fdc5/_0x22d895[_0x427b48(0x9f)]);return Math[_0x427b48(0x1ee)](0x0,Math['min'](_0x5e7fd9,_0x1b94fa));}function renderTimeAxis(_0xb96fcc,_0x48865f){const _0x1da3bb=a56_0x2e361e,_0x54575d=Math[_0x1da3bb(0x202)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math['max'](TIMELINE_CONFIG[_0x1da3bb(0x15d)],Math[_0x1da3bb(0x1e4)](_0x48865f/TIMELINE_CONFIG[_0x1da3bb(0xdc)]))),_0x59361e=_0xb96fcc[_0x1da3bb(0x20e)]/(_0x54575d-0x1),_0x33e5d0=new Date(_0xb96fcc[_0x1da3bb(0x221)]),_0x3647ef=[];for(let _0xdab4a0=0x0;_0xdab4a0<_0x54575d;_0xdab4a0++){const _0x589c8a=_0xb96fcc[_0x1da3bb(0x221)]+_0xdab4a0*_0x59361e,_0x1e8aa0=timeToPosition(_0x589c8a,_0xb96fcc,_0x48865f),_0x2964bd=formatTimestamp(_0x589c8a,_0x33e5d0);_0x3647ef[_0x1da3bb(0x208)]({'pos':_0x1e8aa0,'text':_0x2964bd});}const _0x27efd7=new Array(_0x48865f)[_0x1da3bb(0x167)]('\x20');let _0x1198de=-0x1;for(const {pos:_0x42be67,text:_0x3ceaef}of _0x3647ef){let _0x54f32d=Math[_0x1da3bb(0x1ee)](0x0,_0x42be67-Math[_0x1da3bb(0x1e4)](_0x3ceaef[_0x1da3bb(0x1c6)]/0x2));_0x54f32d<=_0x1198de+TIMELINE_CONFIG[_0x1da3bb(0x1f5)]&&(_0x54f32d=_0x1198de+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x54f32d+_0x3ceaef[_0x1da3bb(0x1c6)]>_0x48865f&&(_0x54f32d=_0x48865f-_0x3ceaef['length']);if(_0x54f32d>=0x0&&_0x54f32d+_0x3ceaef[_0x1da3bb(0x1c6)]<=_0x48865f&&_0x54f32d>_0x1198de){for(let _0x310001=0x0;_0x310001<_0x3ceaef[_0x1da3bb(0x1c6)];_0x310001++){_0x27efd7[_0x54f32d+_0x310001]=_0x3ceaef[_0x310001];}_0x1198de=_0x54f32d+_0x3ceaef['length']-0x1;}}return _0x27efd7[_0x1da3bb(0x122)]('');}function renderTaskRow(_0xccbaf,_0x13e368,_0x122f8d,_0x52c386){const _0x2bea1a=a56_0x2e361e,{level:_0x18562c,name:_0x3d40a2}=parseTaskName(_0xccbaf[_0x2bea1a(0x1f9)]),_0x248b14='\x20'['repeat'](_0x18562c),_0x1b60a4=_0xccbaf[_0x2bea1a(0xb0)]?'('+formatElapsed(_0xccbaf[_0x2bea1a(0xb0)]['duration'])+')':'',_0x3ef2d2=stringWidth(_0x1b60a4),_0x2dc205=_0x18562c*0x1,_0x334ac2=_0x52c386-_0x2dc205-_0x3ef2d2-0x1,_0x2207d3=truncateTaskName(_0x3d40a2,_0x334ac2),_0x5be194=_0x248b14+_0x2207d3,_0x4ecaa2=stringWidth(_0x5be194),_0xb787a3=_0x52c386-_0x4ecaa2-_0x3ef2d2,_0x1c0893=_0x5be194+'\x20'[_0x2bea1a(0x10c)](Math[_0x2bea1a(0x1ee)](0x1,_0xb787a3))+a56_0x515cb3['dim'](_0x1b60a4),_0x20e1f9=getTaskStateIcon(_0xccbaf[_0x2bea1a(0x22e)]),_0x58f3ab=new Array(_0x122f8d)[_0x2bea1a(0x167)]('\x20');if(_0xccbaf['window']){const _0xf549e8=timeToPosition(_0xccbaf['window']['start'],_0x13e368,_0x122f8d),_0x86d1dd=timeToPosition(_0xccbaf['window'][_0x2bea1a(0x11c)],_0x13e368,_0x122f8d),_0x4d26f5=getBarChar(_0xccbaf[_0x2bea1a(0x22e)]),_0x1fe298=Math[_0x2bea1a(0x1ee)](_0xf549e8+0x1,_0x86d1dd);for(let _0x2cb1a7=_0xf549e8;_0x2cb1a7<Math[_0x2bea1a(0x202)](_0x1fe298,_0x122f8d);_0x2cb1a7++){_0x58f3ab[_0x2cb1a7]=_0x4d26f5;}}const _0x9e2279=getBarColor(_0xccbaf[_0x2bea1a(0x22e)]),_0x470fe8=_0x58f3ab[_0x2bea1a(0xbb)](_0x466a88=>_0x466a88==='\x20'?'\x20':_0x9e2279(_0x466a88))[_0x2bea1a(0x122)]('');return _0x20e1f9+'\x20'+_0x1c0893+'│'+_0x470fe8+'│';}function calculateStats(_0x4ac9f7){const _0x121b6c=a56_0x2e361e,_0x1d7e03={'total':_0x4ac9f7['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0xbbd1da of _0x4ac9f7){if(_0xbbd1da[_0x121b6c(0x22e)]==='success')_0x1d7e03['success']++;else{if(_0xbbd1da['state']===_0x121b6c(0x184)||_0xbbd1da[_0x121b6c(0x22e)]===_0x121b6c(0x1bf))_0x1d7e03[_0x121b6c(0x184)]++;else _0xbbd1da['state']===_0x121b6c(0x185)?_0x1d7e03[_0x121b6c(0x185)]++:_0x1d7e03[_0x121b6c(0x1e6)]++;}}return _0x1d7e03;}function formatStats(_0x1e5e9a){const _0x27c8b7=a56_0x2e361e;return[_0x27c8b7(0x8e)+_0x1e5e9a[_0x27c8b7(0x21d)],'✅\x20'+_0x1e5e9a[_0x27c8b7(0x22b)],'❌\x20'+_0x1e5e9a['error'],_0x27c8b7(0x223)+_0x1e5e9a['running'],'⏳\x20'+_0x1e5e9a[_0x27c8b7(0x1e6)]][_0x27c8b7(0x122)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a56_0x2e361e(0x1f9)]=a56_0x2e361e(0x255);['description']=a56_0x2e361e(0xd9);async['execute'](_0x4a49ce){const _0xec94d5=a56_0x2e361e,{options:_0xe28db7,args:_0x3df069,tdx:_0x2e68b1}=_0x4a49ce;let _0x2ee631,_0x1946d2,_0x545360=![];if(_0x3df069[0x0]){if(_0x3df069[0x0]['includes']('.')){const _0x20aab0=this[_0xec94d5(0x96)](_0x3df069,_0xe28db7);if(!_0x20aab0)return 0x1;_0x2ee631=_0x20aab0['projectName'],_0x1946d2=_0x20aab0[_0xec94d5(0x245)];}else{_0x1946d2=_0x3df069[0x0],_0x2ee631=_0xe28db7[_0xec94d5(0x178)];if(!_0x2ee631)return console[_0xec94d5(0x184)](a56_0x515cb3['red'](_0xec94d5(0x9e)),_0xec94d5(0x20d)),0x1;_0x545360=!![];}}else{const _0x32686c=this[_0xec94d5(0x96)](_0x3df069,_0xe28db7);if(!_0x32686c)return 0x1;_0x2ee631=_0x32686c['projectName'],_0x1946d2=_0x32686c['workflowName'];}if(_0xe28db7[_0xec94d5(0x236)]){if(_0x2ee631&&_0x1946d2)console[_0xec94d5(0x184)](_0xec94d5(0x1b2)+_0x2ee631+'.'+_0x1946d2);else _0x2ee631&&console[_0xec94d5(0x184)](_0xec94d5(0x120)+_0x2ee631);}const _0x32c061=_0xe28db7['attemptId'],_0x384eb0=_0xe28db7[_0xec94d5(0x1ad)];if(_0x32c061){_0x384eb0&&console[_0xec94d5(0x184)](a56_0x515cb3[_0xec94d5(0x12c)](_0xec94d5(0x15c)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x2ad741=_0xe28db7['follow'];return _0x2ad741?await this[_0xec94d5(0x17c)](_0x4a49ce,_0x32c061):await this[_0xec94d5(0x229)](_0x4a49ce,_0x32c061,_0xe28db7),0x0;}if(_0x384eb0){const _0x56b0c7=await withSpinner(_0xec94d5(0x1ac),()=>_0x2e68b1[_0xec94d5(0x128)]['sessions']({'projectName':_0x2ee631,'workflowName':_0x1946d2,'limit':0x64}),{'verbose':_0xe28db7[_0xec94d5(0x236)]}),_0x40c58d=_0x56b0c7[_0xec94d5(0x169)][_0xec94d5(0x1a8)](_0x40faa2=>_0x40faa2['id']===_0x384eb0);if(!_0x40c58d)return console[_0xec94d5(0x184)](a56_0x515cb3['red'](_0xec94d5(0x9e)),_0xec94d5(0x225)+_0x384eb0),0x1;if(!_0x40c58d['lastAttempt']?.['id'])return console[_0xec94d5(0x184)](a56_0x515cb3[_0xec94d5(0x254)](_0xec94d5(0x9e)),_0xec94d5(0xf2)+_0x384eb0+_0xec94d5(0x1a6)),0x1;const _0x49bdb7=_0x40c58d[_0xec94d5(0x16f)]['id'];_0xe28db7[_0xec94d5(0x236)]&&console[_0xec94d5(0x184)](_0xec94d5(0x163)+_0x49bdb7+_0xec94d5(0xfe)+_0x384eb0);const _0x1faa93=_0xe28db7['follow'];return _0x1faa93?await this[_0xec94d5(0x17c)](_0x4a49ce,_0x49bdb7):await this[_0xec94d5(0x229)](_0x4a49ce,_0x49bdb7,_0xe28db7),0x0;}const _0x351c05=await withSpinner('Loading\x20sessions...',()=>_0x2e68b1[_0xec94d5(0x128)][_0xec94d5(0x8a)]({'projectName':_0x2ee631,'workflowName':_0x1946d2,'limit':_0xe28db7[_0xec94d5(0xac)]||0x32}),{'verbose':_0xe28db7[_0xec94d5(0x236)]}),_0x36040a=_0x351c05[_0xec94d5(0x169)];if(_0x36040a[_0xec94d5(0x1c6)]===0x0){if(_0x2ee631&&_0x1946d2)console['error']('No\x20sessions\x20found\x20for:\x20'+_0x2ee631+'.'+_0x1946d2);else _0x2ee631?console[_0xec94d5(0x184)](_0xec94d5(0xa6)+_0x2ee631):(console[_0xec94d5(0x184)]('No\x20workflow\x20sessions\x20found'),console[_0xec94d5(0x184)](a56_0x515cb3[_0xec94d5(0x103)](_0xec94d5(0xfb))));return 0x0;}_0x36040a[_0xec94d5(0x17f)]((_0x1986bc,_0x3cc01d)=>{const _0x4fd343=_0xec94d5,_0x41c9f3=_0x1986bc[_0x4fd343(0x95)]||'',_0x3cde6e=_0x3cc01d[_0x4fd343(0x95)]||'';return _0x3cde6e[_0x4fd343(0x1e9)](_0x41c9f3);});if(_0xe28db7[_0xec94d5(0x1b7)]||_0xe28db7[_0xec94d5(0x186)])return await handleSDKOutput(_0x36040a,_0xe28db7),0x0;let _0x6da167;if(_0x545360){const _0x34d371=_0x36040a[0x0];if(!_0x34d371[_0xec94d5(0x16f)]?.['id'])return console[_0xec94d5(0x184)]('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x6da167=_0x34d371[_0xec94d5(0x16f)]['id'],_0xe28db7[_0xec94d5(0x236)]&&console[_0xec94d5(0x184)]('Auto-selected\x20latest\x20session:\x20'+_0x34d371[_0xec94d5(0x95)]);}else{const _0x5dbf4f=_0x36040a[_0xec94d5(0xbb)](_0x20480b=>{const _0x1ceea3=_0xec94d5,_0x34f91d=getAttemptStatusDisplay(_0x20480b[_0x1ceea3(0x16f)]);return{'title':_0x20480b[_0x1ceea3(0x155)]?.[_0x1ceea3(0x1f9)]+'.'+_0x20480b[_0x1ceea3(0x128)]?.['name']+_0x1ceea3(0x107)+_0x20480b['sessionTime']+'\x20'+_0x34f91d[_0x1ceea3(0xc0)],'value':_0x20480b['lastAttempt']?.['id']||'','description':_0x34f91d['text']};}),_0x180636=await a56_0x31c40f({'type':'select','name':_0xec94d5(0x16e),'message':_0xec94d5(0x110),'choices':_0x5dbf4f[_0xec94d5(0x1fa)](_0x542cd7=>_0x542cd7[_0xec94d5(0x11b)]!=='')});if(!_0x180636['attemptId'])return 0x0;_0x6da167=_0x180636[_0xec94d5(0x16e)];}const _0x4c6f87=_0xe28db7[_0xec94d5(0x252)];return _0x4c6f87?await this[_0xec94d5(0x17c)](_0x4a49ce,_0x6da167):await this[_0xec94d5(0x229)](_0x4a49ce,_0x6da167,_0xe28db7),0x0;}async[a56_0x2e361e(0x229)](_0x5b9d1d,_0x4d02a0,_0x151297){const _0x519748=a56_0x2e361e,{tdx:_0x2618f3}=_0x5b9d1d;let _0xc45cb9,_0x2b9e55;try{[_0xc45cb9,_0x2b9e55]=await Promise[_0x519748(0x1db)]([_0x2618f3['workflow']['attempt'](_0x4d02a0),_0x2618f3['workflow']['tasks'](_0x4d02a0,![])]);}catch(_0x154308){console['error'](a56_0x515cb3[_0x519748(0x254)](_0x519748(0x168)));_0x151297[_0x519748(0x236)]&&console[_0x519748(0x184)](_0x154308);throw _0x154308;}if(_0x151297['json']||_0x151297['jsonl']){const _0x1de0e1=this[_0x519748(0x166)](_0xc45cb9,_0x2b9e55);await handleSDKOutput([_0x1de0e1],_0x151297);return;}const _0x3e1e96=_0x2618f3[_0x519748(0x130)][_0x519748(0x174)],_0x468a0d=this[_0x519748(0x12a)](_0xc45cb9,_0x2b9e55,_0x3e1e96);console['log'](_0x468a0d);}async[a56_0x2e361e(0x17c)](_0x164bca,_0x2c8f6f){const _0x3a3d49=a56_0x2e361e,{tdx:_0x99e63b}=_0x164bca,_0x365eeb=TIMELINE_CONFIG[_0x3a3d49(0xf7)],_0x4cc498=TIMELINE_CONFIG[_0x3a3d49(0x8b)];let _0x2e75ec=0x0;while(_0x2e75ec<_0x4cc498){process[_0x3a3d49(0x18a)][_0x3a3d49(0x91)]&&process['stdout']['write']('\x1bc');let _0x515f4d,_0x18457b;try{[_0x515f4d,_0x18457b]=await Promise[_0x3a3d49(0x1db)]([_0x99e63b[_0x3a3d49(0x128)]['attempt'](_0x2c8f6f),_0x99e63b[_0x3a3d49(0x128)][_0x3a3d49(0x1c8)](_0x2c8f6f,![])]);}catch(_0x4f37fc){console[_0x3a3d49(0x184)](a56_0x515cb3[_0x3a3d49(0x254)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x2e75ec>0x0&&console[_0x3a3d49(0x184)](a56_0x515cb3[_0x3a3d49(0x103)](_0x3a3d49(0x14b)+_0x2e75ec));throw _0x4f37fc;}const _0x17098b=_0x99e63b[_0x3a3d49(0x130)][_0x3a3d49(0x174)],_0xdc80b3=this['renderTimeline'](_0x515f4d,_0x18457b,_0x17098b);console[_0x3a3d49(0x15b)](_0xdc80b3);const _0x43b7fa=_0x515f4d['done']&&_0x18457b[_0x3a3d49(0xaf)](_0x18b13a=>_0x18b13a['state']!==_0x3a3d49(0x185)&&_0x18b13a[_0x3a3d49(0x22e)]!==_0x3a3d49(0x99));if(_0x43b7fa){console[_0x3a3d49(0x184)](a56_0x515cb3['green'](_0x3a3d49(0x1d7)));break;}console['error'](a56_0x515cb3[_0x3a3d49(0x103)]('\x0aPolling...\x20('+_0x2e75ec*0x2+_0x3a3d49(0xb5))),await new Promise(_0x29453f=>setTimeout(_0x29453f,_0x365eeb)),_0x2e75ec++;}_0x2e75ec>=_0x4cc498&&console[_0x3a3d49(0x184)](a56_0x515cb3[_0x3a3d49(0x12c)](_0x3a3d49(0xe6)));}[a56_0x2e361e(0x12a)](_0x23dd7c,_0x433ebd,_0x5932bd){const _0x2e6695=a56_0x2e361e,_0x5e126c=[],_0x5c9ed1=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x1620c1=0x5,_0x191c53=process[_0x2e6695(0x18a)][_0x2e6695(0x127)]||0x78,_0x23a20e=_0x191c53-_0x5c9ed1-_0x1620c1,_0x26e4c9=Math[_0x2e6695(0x1ee)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math[_0x2e6695(0x202)](_0x23a20e,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x4850f8=new Date(_0x23dd7c['createdAt'])[_0x2e6695(0x1ce)](),_0x42fb7b=_0x23dd7c[_0x2e6695(0x1fb)]?new Date(_0x23dd7c[_0x2e6695(0x1fb)])[_0x2e6695(0x1ce)]():Date[_0x2e6695(0x162)](),_0x773deb={'start':_0x4850f8,'end':_0x42fb7b,'duration':_0x42fb7b-_0x4850f8},_0x2ad189=new Map(),_0x3415f9=[];for(const _0x473beb of _0x433ebd){if(_0x473beb['startedAt']){const _0x16aa54=new Date(_0x473beb[_0x2e6695(0x222)])['getTime'](),_0x293597=_0x473beb[_0x2e6695(0xa5)]?new Date(_0x473beb[_0x2e6695(0xa5)])[_0x2e6695(0x1ce)]():Date[_0x2e6695(0x162)](),_0x3ab420={'start':_0x16aa54,'end':_0x293597,'duration':_0x293597-_0x16aa54};_0x2ad189[_0x2e6695(0x226)](_0x473beb['id'],_0x3ab420),_0x3415f9[_0x2e6695(0x208)]({'name':_0x473beb[_0x2e6695(0x1ab)],'state':_0x473beb['state']||_0x2e6695(0x1ba),'window':_0x3ab420});}else _0x3415f9['push']({'name':_0x473beb[_0x2e6695(0x1ab)],'state':_0x473beb[_0x2e6695(0x22e)]||'planned','window':undefined});}_0x3415f9['sort']((_0x110988,_0x4bea5e)=>{const _0x4e78dd=_0x2e6695;if(!_0x110988[_0x4e78dd(0xb0)])return 0x1;if(!_0x4bea5e['window'])return-0x1;return _0x110988[_0x4e78dd(0xb0)][_0x4e78dd(0x232)]-_0x4bea5e[_0x4e78dd(0xb0)][_0x4e78dd(0x232)];});const _0x49edc8=_0x3415f9[_0x2e6695(0x1c6)],_0x35909b=_0x49edc8>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x35909b&&_0x3415f9['splice'](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x54d3d9=calculateTimeScale(_0x773deb,_0x26e4c9),_0x54ba0f=_0x23dd7c[_0x2e6695(0x113)]?_0x23dd7c['success']?a56_0x515cb3['green'](_0x2e6695(0x22b)):a56_0x515cb3[_0x2e6695(0x254)](_0x2e6695(0x184)):a56_0x515cb3[_0x2e6695(0x11a)]('running'),_0x5d3025=_0x23dd7c[_0x2e6695(0x155)]?.['id'],_0x594894=_0x23dd7c[_0x2e6695(0x1ad)];let _0x51488b;if(_0x5d3025&&_0x594894){const _0x525ff8=getWorkflowAttemptUrl(_0x5932bd,_0x5d3025,_0x594894,_0x23dd7c['id']);_0x51488b=hyperlink(a56_0x515cb3[_0x2e6695(0x103)](_0x23dd7c['id']),_0x525ff8);}else _0x51488b=a56_0x515cb3[_0x2e6695(0x103)](_0x23dd7c['id']);_0x5e126c['push']('Attempt:\x20'+_0x51488b+_0x2e6695(0x107)+_0x54ba0f+_0x2e6695(0x107)+formatElapsed(_0x773deb['duration']));if(_0x3415f9['length']>0x0){const _0x560751=renderTimeAxis(_0x54d3d9,_0x26e4c9),_0xc2f3bf=new Date(_0x773deb[_0x2e6695(0x232)]),_0x5f4999=formatDate(_0xc2f3bf),_0xcde173=TIMELINE_CONFIG[_0x2e6695(0xb9)]+TIMELINE_CONFIG[_0x2e6695(0x157)]+_0x5c9ed1,_0x5b2e18=_0x5f4999['padStart'](_0xcde173),_0x537e27=a56_0x515cb3[_0x2e6695(0x103)](_0x5b2e18);_0x5e126c[_0x2e6695(0x208)](_0x537e27+'\x20'+_0x560751);for(const _0x271eb7 of _0x3415f9){_0x5e126c[_0x2e6695(0x208)](renderTaskRow(_0x271eb7,_0x54d3d9,_0x26e4c9,_0x5c9ed1));}const _0x1387a5=calculateStats(_0x3415f9);_0x5e126c[_0x2e6695(0x208)](formatStats(_0x1387a5)),_0x35909b&&_0x5e126c[_0x2e6695(0x208)](a56_0x515cb3[_0x2e6695(0x12c)](_0x2e6695(0x1f7)+TIMELINE_CONFIG[_0x2e6695(0x14e)]+_0x2e6695(0x11e)+_0x49edc8+'\x20tasks')),_0x5e126c['push'](''),_0x5e126c[_0x2e6695(0x208)](a56_0x515cb3[_0x2e6695(0x103)](_0x2e6695(0x1fd))+(_0x2e6695(0x1b3)+_0x23dd7c['id']+'\x20logs')+a56_0x515cb3[_0x2e6695(0x103)]('\x20to\x20see\x20detailed\x20logs'));}else _0x5e126c[_0x2e6695(0x208)](_0x2e6695(0x13e));return _0x5e126c[_0x2e6695(0x122)]('\x0a');}[a56_0x2e361e(0x166)](_0xb1e669,_0x13160a){const _0x5abb50=a56_0x2e361e,_0x450d59=new Date(_0xb1e669[_0x5abb50(0x24f)])[_0x5abb50(0x1ce)](),_0x9da5dd=_0xb1e669[_0x5abb50(0x1fb)]?new Date(_0xb1e669[_0x5abb50(0x1fb)])[_0x5abb50(0x1ce)]():Date[_0x5abb50(0x162)](),_0x7265ce=_0x9da5dd-_0x450d59,_0x482111=[];for(const _0x5622a6 of _0x13160a){if(_0x5622a6[_0x5abb50(0x222)]){const _0x3ac82e=new Date(_0x5622a6[_0x5abb50(0x222)])[_0x5abb50(0x1ce)](),_0x1b5e44=_0x5622a6[_0x5abb50(0xa5)]?new Date(_0x5622a6[_0x5abb50(0xa5)])['getTime']():Date[_0x5abb50(0x162)]();_0x482111[_0x5abb50(0x208)]({'name':_0x5622a6[_0x5abb50(0x1ab)],'state':_0x5622a6['state']||'unknown','window':{'start':_0x3ac82e,'end':_0x1b5e44,'duration':_0x1b5e44-_0x3ac82e}});}else _0x482111['push']({'name':_0x5622a6[_0x5abb50(0x1ab)],'state':_0x5622a6['state']||_0x5abb50(0x99),'window':undefined});}const _0x316576=calculateStats(_0x482111);return{'attempt':{'id':_0xb1e669['id'],'status':_0xb1e669['done']?_0xb1e669[_0x5abb50(0x22b)]?_0x5abb50(0x22b):'error':_0x5abb50(0x185),'createdAt':_0xb1e669['createdAt'],'finishedAt':_0xb1e669[_0x5abb50(0x1fb)],'duration_ms':_0x7265ce},'tasks':_0x482111[_0x5abb50(0xbb)](_0x3a821d=>({'name':_0x3a821d[_0x5abb50(0x1f9)],'state':_0x3a821d[_0x5abb50(0x22e)],'startedAt':_0x3a821d[_0x5abb50(0xb0)]?new Date(_0x3a821d[_0x5abb50(0xb0)][_0x5abb50(0x232)])[_0x5abb50(0x251)]():null,'updatedAt':_0x3a821d[_0x5abb50(0xb0)]?new Date(_0x3a821d[_0x5abb50(0xb0)][_0x5abb50(0x11c)])[_0x5abb50(0x251)]():null,'duration_ms':_0x3a821d['window']?.['duration']||null})),'stats':_0x316576};}}function formatScheduleLine(_0x11cf93){const _0x526f63=a56_0x2e361e,_0x4024d9=_0x11cf93[_0x526f63(0x12e)]?a56_0x515cb3[_0x526f63(0x12c)](_0x526f63(0x1f6)):'',_0x468bb2=_0x11cf93[_0x526f63(0x155)]?.[_0x526f63(0x1f9)]?a56_0x515cb3['dim']('\x20['+_0x11cf93[_0x526f63(0x155)][_0x526f63(0x1f9)]+']'):'',_0xa68368=_0x11cf93[_0x526f63(0x1de)]?a56_0x515cb3['dim'](_0x526f63(0x129)+new Date(_0x11cf93[_0x526f63(0x1de)])[_0x526f63(0x145)]()):'';return _0x526f63(0xff)+_0x11cf93['id']+'\x20'+(_0x11cf93[_0x526f63(0x128)]?.[_0x526f63(0x1f9)]||_0x526f63(0x8f))+_0x468bb2+_0x4024d9+_0xa68368;}export class WorkflowSchedulesCommand extends WorkflowBaseCommand{[a56_0x2e361e(0x1f9)]=a56_0x2e361e(0xcf);[a56_0x2e361e(0x109)]=a56_0x2e361e(0x132);async[a56_0x2e361e(0xf9)](_0x2b803e){const _0x10c2c9=a56_0x2e361e,{options:_0x3e72db,args:_0x54766d,tdx:_0x1aa81b}=_0x2b803e,{scheduleId:_0x4136}=_0x3e72db;if(_0x4136&&_0x54766d[0x0])return console[_0x10c2c9(0x184)](a56_0x515cb3[_0x10c2c9(0x254)](_0x10c2c9(0x9e)),_0x10c2c9(0x17e)),console[_0x10c2c9(0x184)](a56_0x515cb3[_0x10c2c9(0x103)](_0x10c2c9(0x1a2))),0x1;if(_0x4136){const _0x4f44e9=await withSpinner(_0x10c2c9(0x13c)+_0x4136+'...',()=>_0x1aa81b['workflow'][_0x10c2c9(0x14a)](_0x4136),{'verbose':_0x3e72db[_0x10c2c9(0x236)]}),_0x5c2cbe=_0x4f44e9[_0x10c2c9(0x169)];return isStructuredFormat(_0x3e72db)?await handleSingleObjectOutput(_0x5c2cbe,_0x3e72db):(console['error'](_0x10c2c9(0x161)),console[_0x10c2c9(0x15b)](formatScheduleLine(_0x5c2cbe))),0x0;}const _0x3c33bc=this['parseProjectWorkflowPattern'](_0x54766d,_0x3e72db);if(!_0x3c33bc)return 0x1;const {projectName:_0x5a8ffd,workflowName:_0x56d990}=_0x3c33bc,_0x285d42=_0x5a8ffd?'\x27'+_0x5a8ffd+(_0x56d990?'.'+_0x56d990:'')+'\x27':undefined,_0x7fc77a=await withSpinner(_0x285d42?_0x10c2c9(0xd1)+_0x285d42+'...':'Listing\x20schedules...',()=>_0x5a8ffd?_0x1aa81b[_0x10c2c9(0x128)][_0x10c2c9(0x23c)](_0x5a8ffd,{'workflow':_0x56d990,'limit':_0x3e72db[_0x10c2c9(0xac)]}):_0x1aa81b['workflow'][_0x10c2c9(0x16a)]({'limit':_0x3e72db[_0x10c2c9(0xac)]}),{'verbose':_0x3e72db[_0x10c2c9(0x236)]}),_0x3cd99b=_0x7fc77a['data'],_0x3a4537=_0x3e72db['limit']&&_0x3cd99b['length']>=_0x3e72db[_0x10c2c9(0xac)]?a56_0x515cb3['dim'](_0x10c2c9(0x19c)):'';console['error'](_0x10c2c9(0x1a0)+_0x3cd99b['length']+_0x10c2c9(0x160)+(_0x3cd99b['length']!==0x1?'s':'')+_0x3a4537);if(isStructuredFormat(_0x3e72db))await handleSDKOutput(_0x3cd99b,_0x3e72db);else{if(_0x3cd99b[_0x10c2c9(0x1c6)]===0x0)console[_0x10c2c9(0x15b)](_0x10c2c9(0x12b));else for(const _0x546c1f of _0x3cd99b){console['log'](formatScheduleLine(_0x546c1f));}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a56_0x2e361e(0x1f9)]=a56_0x2e361e(0x1b0);[a56_0x2e361e(0x109)]=a56_0x2e361e(0xb1);async[a56_0x2e361e(0xf9)](_0x164c9f){const _0x143262=a56_0x2e361e,{options:_0x2233f8,args:_0x34b467,tdx:_0x3d608d}=_0x164c9f,_0x208719=_0x34b467[0x0];if(!_0x208719)return console[_0x143262(0x184)](a56_0x515cb3['red']('Error:'),'Schedule\x20ID\x20is\x20required'),console[_0x143262(0x184)](a56_0x515cb3['dim']('Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>')),console[_0x143262(0x184)](a56_0x515cb3[_0x143262(0x103)](_0x143262(0x10a))),0x1;const {backfill:_0x1bfa8b,nextTime:_0x49480c}=_0x2233f8,_0x2a9112={};if(_0x1bfa8b!==undefined)_0x2a9112[_0x143262(0x152)]=!_0x1bfa8b;if(_0x49480c!==undefined)_0x2a9112[_0x143262(0x102)]=_0x49480c;const _0x21f6d6=await withSpinner(_0x143262(0x24e)+_0x208719+_0x143262(0xce),()=>_0x3d608d[_0x143262(0x128)][_0x143262(0x21f)](_0x208719,_0x2a9112),{'verbose':_0x2233f8['verbose']}),_0x4b1fde=_0x21f6d6[_0x143262(0x169)];return isStructuredFormat(_0x2233f8)?await handleSingleObjectOutput(_0x4b1fde,_0x2233f8):(console[_0x143262(0x15b)](_0x143262(0xc7)+_0x208719+'\x20enabled\x20('+(_0x4b1fde[_0x143262(0x128)]?.[_0x143262(0x1f9)]||_0x143262(0x1ba))+')'),_0x4b1fde[_0x143262(0x1de)]&&console[_0x143262(0x15b)](a56_0x515cb3[_0x143262(0x103)]('\x20\x20Next\x20run:\x20'+new Date(_0x4b1fde[_0x143262(0x1de)])[_0x143262(0x145)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a56_0x2e361e(0x1f9)]=a56_0x2e361e(0x105);[a56_0x2e361e(0x109)]=a56_0x2e361e(0x121);async[a56_0x2e361e(0xf9)](_0x183504){const _0x3fe8bc=a56_0x2e361e,{options:_0x339f72,args:_0x4089c1,tdx:_0x4dab2a}=_0x183504,_0x2be147=_0x4089c1[0x0];if(!_0x2be147)return console[_0x3fe8bc(0x184)](a56_0x515cb3[_0x3fe8bc(0x254)](_0x3fe8bc(0x9e)),_0x3fe8bc(0x106)),console[_0x3fe8bc(0x184)](a56_0x515cb3[_0x3fe8bc(0x103)](_0x3fe8bc(0xee))),console[_0x3fe8bc(0x184)](a56_0x515cb3[_0x3fe8bc(0x103)](_0x3fe8bc(0x10a))),0x1;const _0x592c00=await withSpinner(_0x3fe8bc(0x1c9)+_0x2be147+_0x3fe8bc(0xce),()=>_0x4dab2a[_0x3fe8bc(0x128)][_0x3fe8bc(0x104)](_0x2be147),{'verbose':_0x339f72['verbose']}),_0x3820df=_0x592c00['data'];return isStructuredFormat(_0x339f72)?await handleSingleObjectOutput(_0x3820df,_0x339f72):console[_0x3fe8bc(0x15b)](_0x3fe8bc(0xc7)+_0x2be147+_0x3fe8bc(0x1ec)+(_0x3820df[_0x3fe8bc(0x128)]?.[_0x3fe8bc(0x1f9)]||_0x3fe8bc(0x1ba))+')'),0x0;}}