@treasuredata/tdx 0.13.0 → 0.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.d.ts +1 -1
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli-categories.js.map +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +1 -1
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands/activations.js +1 -1
  10. package/dist/commands/agent-command.js +1 -1
  11. package/dist/commands/api-command.js +1 -1
  12. package/dist/commands/auth-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-command.js +1 -1
  22. package/dist/commands/job-command.js +1 -1
  23. package/dist/commands/journey-command.d.ts +1 -0
  24. package/dist/commands/journey-command.d.ts.map +1 -1
  25. package/dist/commands/journey-command.js +1 -1
  26. package/dist/commands/journey-command.js.map +1 -1
  27. package/dist/commands/journey-validate-command.js +1 -1
  28. package/dist/commands/llm-command.d.ts.map +1 -1
  29. package/dist/commands/llm-command.js +1 -1
  30. package/dist/commands/llm-command.js.map +1 -1
  31. package/dist/commands/llm-proxy.js +1 -1
  32. package/dist/commands/parent-segment-command.d.ts.map +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js.map +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.d.ts.map +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js.map +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-push-command.js.map +1 -1
  46. package/dist/commands/segment-update-command.js +1 -1
  47. package/dist/commands/segment-use-command.js +1 -1
  48. package/dist/commands/segment-validate-command.js +1 -1
  49. package/dist/commands/segments.d.ts +1 -1
  50. package/dist/commands/segments.d.ts.map +1 -1
  51. package/dist/commands/segments.js +1 -1
  52. package/dist/commands/segments.js.map +1 -1
  53. package/dist/commands/show.js +1 -1
  54. package/dist/commands/tables.js +1 -1
  55. package/dist/commands/use-command.js +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/profile.js +1 -1
  67. package/dist/core/project-config.js +1 -1
  68. package/dist/core/session.js +1 -1
  69. package/dist/core/user-cache.js +1 -1
  70. package/dist/core/version.js +1 -1
  71. package/dist/index.js +1 -1
  72. package/dist/proxy/anthropic-adapter.js +1 -1
  73. package/dist/proxy/claude-usage-tracker.js +1 -1
  74. package/dist/proxy/context-signature.js +1 -1
  75. package/dist/proxy/conversation-utils.js +1 -1
  76. package/dist/proxy/server.js +1 -1
  77. package/dist/proxy/session-cache.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/api.js +1 -1
  82. package/dist/sdk/client/cdp-api-client.d.ts +13 -1
  83. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  84. package/dist/sdk/client/cdp-api-client.js +1 -1
  85. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  86. package/dist/sdk/client/endpoints.js +1 -1
  87. package/dist/sdk/client/engage-api-client.js +1 -1
  88. package/dist/sdk/client/http-client.js +1 -1
  89. package/dist/sdk/client/llm-api-client.js +1 -1
  90. package/dist/sdk/client/rate-limiter.js +1 -1
  91. package/dist/sdk/client/td-api-client.js +1 -1
  92. package/dist/sdk/client/trino-api-client.js +1 -1
  93. package/dist/sdk/client/workflow-client.js +1 -1
  94. package/dist/sdk/connection-validator.js +1 -1
  95. package/dist/sdk/connection.js +1 -1
  96. package/dist/sdk/engage.js +1 -1
  97. package/dist/sdk/errors.js +1 -1
  98. package/dist/sdk/index.js +1 -1
  99. package/dist/sdk/io/index.js +1 -1
  100. package/dist/sdk/io/node-filesystem.js +1 -1
  101. package/dist/sdk/job.js +1 -1
  102. package/dist/sdk/journey.d.ts +68 -17
  103. package/dist/sdk/journey.d.ts.map +1 -1
  104. package/dist/sdk/journey.js +1 -1
  105. package/dist/sdk/journey.js.map +1 -1
  106. package/dist/sdk/llm/chat-cache.js +1 -1
  107. package/dist/sdk/llm/index.js +1 -1
  108. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  109. package/dist/sdk/llm/model-aliases.js +1 -1
  110. package/dist/sdk/llm/model-factors.js +1 -1
  111. package/dist/sdk/query/index.js +1 -1
  112. package/dist/sdk/query/sql-parser.js +1 -1
  113. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  114. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  115. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  116. package/dist/sdk/segment/fields-display.js +1 -1
  117. package/dist/sdk/segment/file-discovery.js +1 -1
  118. package/dist/sdk/segment/journey-utils.d.ts +47 -3
  119. package/dist/sdk/segment/journey-utils.d.ts.map +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-utils.js.map +1 -1
  122. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  123. package/dist/sdk/segment/journey-yaml.js +1 -1
  124. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  125. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  126. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  127. package/dist/sdk/segment/pull-workflow.d.ts +2 -0
  128. package/dist/sdk/segment/pull-workflow.d.ts.map +1 -1
  129. package/dist/sdk/segment/pull-workflow.js +1 -1
  130. package/dist/sdk/segment/pull-workflow.js.map +1 -1
  131. package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
  132. package/dist/sdk/segment/push-workflow.js +1 -1
  133. package/dist/sdk/segment/push-workflow.js.map +1 -1
  134. package/dist/sdk/segment/resolution-context.js +1 -1
  135. package/dist/sdk/segment/segment-path-parser.js +1 -1
  136. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  137. package/dist/sdk/segment/target-resolution.js +1 -1
  138. package/dist/sdk/segment/tdx-config.js +1 -1
  139. package/dist/sdk/segment/validate-files.js +1 -1
  140. package/dist/sdk/segment/yaml-validator.js +1 -1
  141. package/dist/sdk/segment.d.ts +42 -11
  142. package/dist/sdk/segment.d.ts.map +1 -1
  143. package/dist/sdk/segment.js +1 -1
  144. package/dist/sdk/segment.js.map +1 -1
  145. package/dist/sdk/types/cdp.d.ts +71 -1
  146. package/dist/sdk/types/cdp.d.ts.map +1 -1
  147. package/dist/sdk/types/index.d.ts +1 -1
  148. package/dist/sdk/types/index.d.ts.map +1 -1
  149. package/dist/sdk/types/index.js +1 -1
  150. package/dist/sdk/types/index.js.map +1 -1
  151. package/dist/sdk/types/progress.js +1 -1
  152. package/dist/sdk/user.js +1 -1
  153. package/dist/sdk/util/format-detector.js +1 -1
  154. package/dist/sdk/util/formatters.js +1 -1
  155. package/dist/sdk/util/index.js +1 -1
  156. package/dist/sdk/util/tree-formatter.d.ts +3 -5
  157. package/dist/sdk/util/tree-formatter.d.ts.map +1 -1
  158. package/dist/sdk/util/tree-formatter.js +1 -1
  159. package/dist/sdk/util/tree-formatter.js.map +1 -1
  160. package/dist/sdk/workflow/clone-workflow.js +1 -1
  161. package/dist/sdk/workflow/index.js +1 -1
  162. package/dist/sdk/workflow/pull-workflow.js +1 -1
  163. package/dist/sdk/workflow/push-workflow.js +1 -1
  164. package/dist/sdk/workflow/tdx-config.js +1 -1
  165. package/dist/sdk/workflow/workflow-utils.js +1 -1
  166. package/dist/utils/async.js +1 -1
  167. package/dist/utils/colors.js +1 -1
  168. package/dist/utils/diff.js +1 -1
  169. package/dist/utils/file-permissions.js +1 -1
  170. package/dist/utils/json-loader.js +1 -1
  171. package/dist/utils/option-validation.js +1 -1
  172. package/dist/utils/port.js +1 -1
  173. package/dist/utils/process.js +1 -1
  174. package/dist/utils/prompt.js +1 -1
  175. package/dist/utils/spinner.js +1 -1
  176. package/dist/utils/sse-parser.js +1 -1
  177. package/dist/utils/string-utils.js +1 -1
  178. package/dist/utils/table-ref-parser.js +1 -1
  179. package/dist/utils/tdx-logger.js +1 -1
  180. package/dist/utils/version-check.js +1 -1
  181. package/package.json +1 -1
@@ -1 +1 @@
1
- const a37_0x7d6fdf=a37_0x1cb8;(function(_0x301967,_0x35fe91){const _0xb484f0=a37_0x1cb8,_0xc8b92d=_0x301967();while(!![]){try{const _0x32b206=parseInt(_0xb484f0(0x73))/0x1+-parseInt(_0xb484f0(0x77))/0x2+-parseInt(_0xb484f0(0x7e))/0x3+parseInt(_0xb484f0(0x7f))/0x4+parseInt(_0xb484f0(0x70))/0x5+parseInt(_0xb484f0(0x72))/0x6+-parseInt(_0xb484f0(0x71))/0x7;if(_0x32b206===_0x35fe91)break;else _0xc8b92d['push'](_0xc8b92d['shift']());}catch(_0x199add){_0xc8b92d['push'](_0xc8b92d['shift']());}}}(a37_0x5aee,0x66a1b));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a37_0x1cb8(_0x2128c0,_0x5656dc){_0x2128c0=_0x2128c0-0x66;const _0x5aee36=a37_0x5aee();let _0x1cb80e=_0x5aee36[_0x2128c0];return _0x1cb80e;}import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';function a37_0x5aee(){const _0xb230f3=['3669799HuPgHK','3610014NvvOKu','213754sORozB','List\x20all\x20users\x20in\x20the\x20account','data','\x20user','32180URduIe','Fetching\x20user\x20info...','Listing\x20users...','message','Show\x20current\x20user\x20information','user','getCurrent','191865kyWnAu','582620VDrDga','Error:\x20','description','name','user\x20list','execute','\x20\x20Cause:\x20','verbose','error','length','cause','318015gkdwDs'];a37_0x5aee=function(){return _0xb230f3;};return a37_0x5aee();}import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{['name']=a37_0x7d6fdf(0x7c);[a37_0x7d6fdf(0x67)]=a37_0x7d6fdf(0x7b);async[a37_0x7d6fdf(0x6a)](_0x33eab5){const _0x49551b=a37_0x7d6fdf,{options:_0x5a0ff8,tdx:_0x1abaf6}=_0x33eab5;try{const _0x3bf66d=await withSpinner(_0x49551b(0x78),()=>_0x1abaf6[_0x49551b(0x7c)][_0x49551b(0x7d)](),{'verbose':_0x5a0ff8[_0x49551b(0x6c)]}),_0x193eda=_0x3bf66d[_0x49551b(0x75)];return await handleSingleObjectOutput(_0x193eda,_0x5a0ff8),0x0;}catch(_0x1532a8){if(_0x1532a8 instanceof SDKError)return console['error'](_0x49551b(0x66)+_0x1532a8[_0x49551b(0x7a)]),_0x1532a8[_0x49551b(0x6f)]&&console[_0x49551b(0x6d)](_0x49551b(0x6b)+_0x1532a8['cause']),0x1;throw _0x1532a8;}}}export class UserListCommand extends BaseCommand{[a37_0x7d6fdf(0x68)]=a37_0x7d6fdf(0x69);[a37_0x7d6fdf(0x67)]=a37_0x7d6fdf(0x74);async['execute'](_0x1f3c66){const _0x367b89=a37_0x7d6fdf,{options:_0x2813f5,tdx:_0x4522e2}=_0x1f3c66;try{const _0x1f0099=await withSpinner(_0x367b89(0x79),()=>_0x4522e2[_0x367b89(0x7c)]['list'](),{'verbose':_0x2813f5[_0x367b89(0x6c)]}),_0x24d3f9=_0x1f0099['data'];return console['error']('✔\x20Found\x20'+_0x24d3f9[_0x367b89(0x6e)]+_0x367b89(0x76)+(_0x24d3f9[_0x367b89(0x6e)]!==0x1?'s':'')),await handleSDKOutput(_0x24d3f9,_0x2813f5),0x0;}catch(_0x460511){if(_0x460511 instanceof SDKError)return console['error']('Error:\x20'+_0x460511['message']),_0x460511[_0x367b89(0x6f)]&&console[_0x367b89(0x6d)](_0x367b89(0x6b)+_0x460511['cause']),0x1;throw _0x460511;}}}
1
+ const a37_0x47912e=a37_0x495b;(function(_0x37e50b,_0xb0416f){const _0x3830df=a37_0x495b,_0x187032=_0x37e50b();while(!![]){try{const _0x9d8d73=parseInt(_0x3830df(0x161))/0x1*(parseInt(_0x3830df(0x166))/0x2)+-parseInt(_0x3830df(0x163))/0x3+-parseInt(_0x3830df(0x176))/0x4*(-parseInt(_0x3830df(0x16b))/0x5)+-parseInt(_0x3830df(0x16a))/0x6*(-parseInt(_0x3830df(0x15f))/0x7)+-parseInt(_0x3830df(0x164))/0x8+-parseInt(_0x3830df(0x169))/0x9+-parseInt(_0x3830df(0x168))/0xa*(-parseInt(_0x3830df(0x177))/0xb);if(_0x9d8d73===_0xb0416f)break;else _0x187032['push'](_0x187032['shift']());}catch(_0x25eee1){_0x187032['push'](_0x187032['shift']());}}}(a37_0x3632,0x78e96));function a37_0x3632(){const _0x55925e=['verbose','293503SlxPob','length','235xhfTwk','Error:\x20','2943900xXfkHP','1516392LKnHxR','user','3130RQBbaw','name','16602810snjaOW','4666455uWzMIW','6FHosij','5vOuBrF','getCurrent','\x20\x20Cause:\x20','list','✔\x20Found\x20','Listing\x20users...','Fetching\x20user\x20info...','data','execute','List\x20all\x20users\x20in\x20the\x20account','\x20user','458452NTJsYJ','11nUPtiF','error','Show\x20current\x20user\x20information','description','user\x20list','message','cause'];a37_0x3632=function(){return _0x55925e;};return a37_0x3632();}import{BaseCommand}from'./command.js';function a37_0x495b(_0x404dce,_0x531b80){_0x404dce=_0x404dce-0x15c;const _0x36323b=a37_0x3632();let _0x495b8d=_0x36323b[_0x404dce];return _0x495b8d;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{[a37_0x47912e(0x167)]=a37_0x47912e(0x165);[a37_0x47912e(0x17a)]=a37_0x47912e(0x179);async[a37_0x47912e(0x173)](_0x41adb3){const _0x4ff216=a37_0x47912e,{options:_0x3d7cc5,tdx:_0x189b4a}=_0x41adb3;try{const _0x283440=await withSpinner(_0x4ff216(0x171),()=>_0x189b4a[_0x4ff216(0x165)][_0x4ff216(0x16c)](),{'verbose':_0x3d7cc5['verbose']}),_0xbf5566=_0x283440[_0x4ff216(0x172)];return await handleSingleObjectOutput(_0xbf5566,_0x3d7cc5),0x0;}catch(_0x2bb26e){if(_0x2bb26e instanceof SDKError)return console['error'](_0x4ff216(0x162)+_0x2bb26e['message']),_0x2bb26e['cause']&&console['error'](_0x4ff216(0x16d)+_0x2bb26e[_0x4ff216(0x15d)]),0x1;throw _0x2bb26e;}}}export class UserListCommand extends BaseCommand{[a37_0x47912e(0x167)]=a37_0x47912e(0x17b);[a37_0x47912e(0x17a)]=a37_0x47912e(0x174);async['execute'](_0xcd37f1){const _0x572e69=a37_0x47912e,{options:_0x258d91,tdx:_0x35b0b6}=_0xcd37f1;try{const _0x59d3d1=await withSpinner(_0x572e69(0x170),()=>_0x35b0b6[_0x572e69(0x165)][_0x572e69(0x16e)](),{'verbose':_0x258d91[_0x572e69(0x15e)]}),_0x235cbe=_0x59d3d1[_0x572e69(0x172)];return console[_0x572e69(0x178)](_0x572e69(0x16f)+_0x235cbe[_0x572e69(0x160)]+_0x572e69(0x175)+(_0x235cbe['length']!==0x1?'s':'')),await handleSDKOutput(_0x235cbe,_0x258d91),0x0;}catch(_0x52e9c5){if(_0x52e9c5 instanceof SDKError)return console[_0x572e69(0x178)]('Error:\x20'+_0x52e9c5[_0x572e69(0x15c)]),_0x52e9c5[_0x572e69(0x15d)]&&console['error']('\x20\x20Cause:\x20'+_0x52e9c5['cause']),0x1;throw _0x52e9c5;}}}
@@ -1 +1 @@
1
- const a38_0x3e0780=a38_0x544d;(function(_0xe2bedd,_0x418770){const _0x2d5290=a38_0x544d,_0x591bbb=_0xe2bedd();while(!![]){try{const _0x3e4d16=-parseInt(_0x2d5290(0x237))/0x1*(parseInt(_0x2d5290(0x1af))/0x2)+parseInt(_0x2d5290(0x1b8))/0x3+parseInt(_0x2d5290(0x1c5))/0x4+parseInt(_0x2d5290(0x19e))/0x5+-parseInt(_0x2d5290(0x208))/0x6+parseInt(_0x2d5290(0x253))/0x7*(-parseInt(_0x2d5290(0x206))/0x8)+parseInt(_0x2d5290(0x167))/0x9;if(_0x3e4d16===_0x418770)break;else _0x591bbb['push'](_0x591bbb['shift']());}catch(_0x46d91b){_0x591bbb['push'](_0x591bbb['shift']());}}}(a38_0x32b2,0x6998c));import a38_0x2eb555 from'chalk';import{existsSync}from'fs';import a38_0x4e4b26 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a38_0x454f8d from'prompts';function getAttemptStatusDisplay(_0x22aff1){const _0x1ecace=a38_0x544d;if(!_0x22aff1)return{'icon':'⏳','text':''};const {done:_0x202d34,success:_0x47e718,cancelRequested:_0x32aeac}=_0x22aff1;if(!_0x202d34)return _0x32aeac?{'icon':'🛑','text':a38_0x2eb555['yellow'](_0x1ecace(0x22a))}:{'icon':'🔄','text':a38_0x2eb555[_0x1ecace(0x223)]('running')};if(_0x47e718)return{'icon':'✅','text':a38_0x2eb555[_0x1ecace(0x290)](_0x1ecace(0x1b6))};return{'icon':'❌','text':a38_0x2eb555['red']('error')};}export class WorkflowBaseCommand extends BaseCommand{[a38_0x3e0780(0x1dc)](_0xe0f5e1,_0x18b633,_0x1585f6=0x0){const _0x343761=a38_0x3e0780;return _0xe0f5e1[_0x1585f6]||_0x18b633[_0x343761(0x23a)];}[a38_0x3e0780(0x1a8)](_0x2955ae,_0xfcfa4d,_0x399f9c=0x0){const _0x58d38c=a38_0x3e0780,_0x50aebb=this['resolveProject'](_0x2955ae,_0xfcfa4d,_0x399f9c);if(!_0x50aebb)return console[_0x58d38c(0x294)](a38_0x2eb555[_0x58d38c(0x1bf)](_0x58d38c(0x18a)),_0x58d38c(0x20c)),console[_0x58d38c(0x294)](a38_0x2eb555[_0x58d38c(0x1e8)](_0x58d38c(0x232))),null;return _0x50aebb;}[a38_0x3e0780(0x234)](_0x18ba62,_0x131717){const _0x459c82=a38_0x3e0780;if(_0x18ba62[0x0]){const _0x545483=_0x18ba62[0x0][_0x459c82(0x276)]('.');if(_0x545483['length']===0x1)return{'projectName':_0x545483[0x0],'workflowName':undefined};else return _0x545483[_0x459c82(0x239)]===0x2?{'projectName':_0x545483[0x0],'workflowName':_0x545483[0x1]}:(console['error'](a38_0x2eb555['red'](_0x459c82(0x18a)),_0x459c82(0x236)),null);}return{'projectName':_0x131717['workflowProject'],'workflowName':undefined};}[a38_0x3e0780(0x19f)](_0x11c257,_0x33603c,_0x1063a6=0x0){const _0x1cdef0=a38_0x3e0780;if(_0x11c257[_0x1063a6])return _0x11c257[_0x1063a6];if(_0x33603c[_0x1cdef0(0x23a)]){const _0x29f452=a38_0x4e4b26[_0x1cdef0(0x192)](process[_0x1cdef0(0x18d)](),_0x1cdef0(0x193),_0x33603c['workflowProject']);if(existsSync(a38_0x4e4b26[_0x1cdef0(0x192)](_0x29f452,_0x1cdef0(0x1c2))))return _0x29f452;}return undefined;}async[a38_0x3e0780(0x22d)](_0x422bbd,_0x243f9e,_0x28d7b4){const _0x10c7b3=a38_0x3e0780;try{const _0x1c3d49=await _0x422bbd[_0x10c7b3(0x27f)][_0x10c7b3(0x193)](_0x243f9e,{'limit':0x1});if(_0x1c3d49[_0x10c7b3(0x239)]>0x0){const _0x398082=_0x1c3d49[0x0]['id'],_0x1c9270=getWorkflowUrl(_0x28d7b4,_0x398082);console[_0x10c7b3(0x294)]('\x20\x20Console:\x20'+a38_0x2eb555[_0x10c7b3(0x1f1)](_0x1c9270));}}catch{}}}function a38_0x544d(_0x1f18ea,_0xaf45a3){_0x1f18ea=_0x1f18ea-0x15f;const _0x32b2ce=a38_0x32b2();let _0x544d68=_0x32b2ce[_0x1f18ea];return _0x544d68;}export class WorkflowUseCommand extends BaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x1a3);[a38_0x3e0780(0x1f5)]=a38_0x3e0780(0x1c3);async[a38_0x3e0780(0x21b)](_0x530da1){const _0x26984c=a38_0x3e0780,{options:_0x1a3153,args:_0x505714,tdx:_0x567323}=_0x530da1,_0x4a062b=_0x505714[0x0],_0x1f6082=_0x1a3153['clear'];if(_0x1f6082)return saveSessionContext({'workflow_project':undefined},_0x1a3153[_0x26984c(0x1c6)]),console[_0x26984c(0x16c)](a38_0x2eb555[_0x26984c(0x290)](_0x26984c(0x1cd))),0x0;if(!_0x4a062b)return console[_0x26984c(0x294)](a38_0x2eb555[_0x26984c(0x1bf)](_0x26984c(0x18a)),_0x26984c(0x20c)),console[_0x26984c(0x294)](a38_0x2eb555['dim'](_0x26984c(0x24a))),console['error'](a38_0x2eb555[_0x26984c(0x1e8)](_0x26984c(0x270))),0x1;const _0x113e6b=await withSpinner('Resolving\x20project\x20\x27'+_0x4a062b+_0x26984c(0x1a0),()=>_0x567323[_0x26984c(0x27f)][_0x26984c(0x17e)](_0x4a062b),{'verbose':_0x1a3153[_0x26984c(0x244)]}),{name:_0x431a1f}=_0x113e6b[_0x26984c(0x245)];return saveSessionContext({'workflow_project':_0x431a1f},_0x1a3153[_0x26984c(0x1c6)]),console[_0x26984c(0x16c)](a38_0x2eb555['green'](_0x26984c(0x1b4)+a38_0x2eb555[_0x26984c(0x1f1)](_0x431a1f))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x1a2);[a38_0x3e0780(0x1f5)]='List\x20all\x20workflow\x20projects';async[a38_0x3e0780(0x21b)](_0x3fd83b){const _0x51b7f1=a38_0x3e0780,{options:_0x1a0439,args:_0x92b799,tdx:_0x5dac2b}=_0x3fd83b,_0x16f896=_0x92b799[0x0];_0x1a0439[_0x51b7f1(0x244)]&&_0x16f896&&console[_0x51b7f1(0x294)](_0x51b7f1(0x26c)+_0x16f896);const _0x3068f3=await withSpinner(_0x51b7f1(0x203),()=>_0x5dac2b['workflow'][_0x51b7f1(0x1d8)](_0x16f896,{'limit':_0x1a0439[_0x51b7f1(0x1ab)]}),{'verbose':_0x1a0439[_0x51b7f1(0x244)]});let _0x200574=_0x3068f3[_0x51b7f1(0x245)];_0x200574['sort']((_0x558944,_0x1376ae)=>_0x558944[_0x51b7f1(0x170)][_0x51b7f1(0x24f)](_0x1376ae['name']));const _0x4cf206=_0x1a0439['limit']||0x64,_0x13bb40=_0x200574[_0x51b7f1(0x239)]>=_0x4cf206?a38_0x2eb555[_0x51b7f1(0x1e8)](_0x51b7f1(0x160)):'';console[_0x51b7f1(0x294)]('✔\x20Found\x20'+_0x200574[_0x51b7f1(0x239)]+_0x51b7f1(0x212)+(_0x200574['length']!==0x1?'s':'')+_0x13bb40);if(_0x1a0439[_0x51b7f1(0x266)]==='json'||_0x1a0439[_0x51b7f1(0x266)]==='jsonl'||_0x1a0439[_0x51b7f1(0x266)]===_0x51b7f1(0x1ec))await handleSDKOutput(_0x200574,_0x1a0439);else{if(_0x200574[_0x51b7f1(0x239)]===0x0)_0x16f896?console[_0x51b7f1(0x16c)](_0x51b7f1(0x20d)+_0x16f896):console['log'](_0x51b7f1(0x26a));else{const _0x588a10=_0x200574[_0x51b7f1(0x265)](_0x14aeb9=>{const _0xe2def9=_0x51b7f1,_0x2ad876=_0x14aeb9[_0xe2def9(0x1c1)]?.['some'](_0x23d630=>_0x23d630[_0xe2def9(0x1b5)]===_0xe2def9(0x280)),_0x5eb4ec=_0x2ad876?a38_0x2eb555[_0xe2def9(0x1e8)](_0xe2def9(0x1e4)):'';return _0xe2def9(0x235)+_0x14aeb9[_0xe2def9(0x170)]+_0x5eb4ec;});await writeOutput(_0x588a10[_0x51b7f1(0x192)]('\x0a'),_0x1a0439[_0x51b7f1(0x1f4)],_0x51b7f1(0x225));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a38_0x3e0780(0x170)]='workflow:workflows';[a38_0x3e0780(0x1f5)]=a38_0x3e0780(0x285);async[a38_0x3e0780(0x21b)](_0x184971){const _0x192bf4=a38_0x3e0780,{options:_0x180686,args:_0x121859,tdx:_0x4cf2ce}=_0x184971,_0x161fc0=this[_0x192bf4(0x1dc)](_0x121859,_0x180686);_0x180686[_0x192bf4(0x244)]&&_0x161fc0&&console['error'](_0x192bf4(0x178)+_0x161fc0);const _0x349c5f=await withSpinner('Listing\x20workflows...',()=>_0x4cf2ce[_0x192bf4(0x27f)][_0x192bf4(0x193)](_0x161fc0,{'limit':_0x180686[_0x192bf4(0x1ab)]}),{'verbose':_0x180686['verbose']});let _0x109c58=_0x349c5f['data'];_0x109c58[_0x192bf4(0x209)]((_0x340af5,_0x156b26)=>{const _0x337f07=_0x192bf4,_0x5468bf=_0x340af5[_0x337f07(0x170)][_0x337f07(0x24f)](_0x156b26['name']);if(_0x5468bf!==0x0)return _0x5468bf;return(_0x340af5['project']?.[_0x337f07(0x170)]||'')[_0x337f07(0x24f)](_0x156b26['project']?.[_0x337f07(0x170)]||'');});const _0x3e0840=_0x180686[_0x192bf4(0x1ab)]||0x64,_0x5ecb3c=_0x109c58['length']>=_0x3e0840?a38_0x2eb555[_0x192bf4(0x1e8)](_0x192bf4(0x160)):'';console[_0x192bf4(0x294)](_0x192bf4(0x17a)+_0x109c58[_0x192bf4(0x239)]+'\x20workflow'+(_0x109c58[_0x192bf4(0x239)]!==0x1?'s':'')+_0x5ecb3c);if(_0x180686['format']===_0x192bf4(0x1d2)||_0x180686['format']===_0x192bf4(0x1ae)||_0x180686[_0x192bf4(0x266)]===_0x192bf4(0x1ec))await handleSDKOutput(_0x109c58,_0x180686);else{if(_0x109c58[_0x192bf4(0x239)]===0x0)_0x161fc0?console['log'](_0x192bf4(0x214)+_0x161fc0):console[_0x192bf4(0x16c)](_0x192bf4(0x176));else{const _0x23b75d=_0x180686[_0x192bf4(0x217)],_0x5c6c0e=_0x109c58[_0x192bf4(0x265)](_0x36a92b=>{const _0x2ab788=_0x192bf4,_0x1e8648=a38_0x2eb555[_0x2ab788(0x1e8)]('#'+_0x36a92b['id']),_0x863c64=hyperlink(_0x1e8648,getWorkflowUrl(_0x23b75d,_0x36a92b['id'])),_0x36d683=_0x36a92b[_0x2ab788(0x240)]?.[_0x2ab788(0x170)]?a38_0x2eb555[_0x2ab788(0x1e8)]('\x20('+_0x36a92b[_0x2ab788(0x240)][_0x2ab788(0x170)]+')'):'';return _0x2ab788(0x271)+_0x863c64+'\x20'+_0x36a92b[_0x2ab788(0x170)]+_0x36d683;});await writeOutput(_0x5c6c0e[_0x192bf4(0x192)]('\x0a'),_0x180686['output'],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a38_0x3e0780(0x170)]='workflow:sessions';['description']=a38_0x3e0780(0x23c);async[a38_0x3e0780(0x21b)](_0x1f2dc6){const _0x4906da=a38_0x3e0780,{options:_0x1227c9,args:_0x108829,tdx:_0x201747}=_0x1f2dc6,_0x3c8dd4=this[_0x4906da(0x234)](_0x108829,_0x1227c9);if(!_0x3c8dd4)return 0x1;const {projectName:_0x4d6bce,workflowName:_0x2635d3}=_0x3c8dd4;if(_0x1227c9[_0x4906da(0x244)]){if(_0x4d6bce&&_0x2635d3)console['error'](_0x4906da(0x27c)+_0x4d6bce+'.'+_0x2635d3);else _0x4d6bce&&console[_0x4906da(0x294)](_0x4906da(0x20b)+_0x4d6bce);const _0x1a0fb0=_0x1227c9['status'];_0x1a0fb0&&console[_0x4906da(0x294)](_0x4906da(0x21d)+_0x1a0fb0);}const _0x294da1=await withSpinner(_0x4906da(0x221),()=>_0x201747['workflow'][_0x4906da(0x281)]({'projectName':_0x4d6bce,'workflowName':_0x2635d3,'status':_0x1227c9[_0x4906da(0x293)],'fromTime':_0x1227c9[_0x4906da(0x211)],'toTime':_0x1227c9['to'],'limit':_0x1227c9[_0x4906da(0x1ab)]}),{'verbose':_0x1227c9[_0x4906da(0x244)]}),_0x41e351=_0x294da1[_0x4906da(0x245)];_0x41e351[_0x4906da(0x209)]((_0x4e57e4,_0x1a661f)=>{const _0x43fc79=_0x4906da,_0x525d78=_0x4e57e4['sessionTime']||'',_0x336a8d=_0x1a661f['sessionTime']||'';return _0x336a8d[_0x43fc79(0x24f)](_0x525d78);});const _0x557360=_0x1227c9[_0x4906da(0x1ab)]||0x64,_0xfa9bd8=_0x41e351[_0x4906da(0x239)]>=_0x557360?a38_0x2eb555[_0x4906da(0x1e8)](_0x4906da(0x160)):'';console[_0x4906da(0x294)]('✔\x20Found\x20'+_0x41e351['length']+_0x4906da(0x238)+(_0x41e351['length']!==0x1?'s':'')+_0xfa9bd8);if(_0x1227c9[_0x4906da(0x266)]===_0x4906da(0x1d2)||_0x1227c9[_0x4906da(0x266)]===_0x4906da(0x1ae)||_0x1227c9[_0x4906da(0x266)]==='table')await handleSDKOutput(_0x41e351,_0x1227c9);else{if(_0x41e351['length']===0x0){if(_0x4d6bce&&_0x2635d3)console[_0x4906da(0x16c)](_0x4906da(0x286)+_0x4d6bce+'.'+_0x2635d3);else _0x4d6bce?console[_0x4906da(0x16c)](_0x4906da(0x1d1)+_0x4d6bce):console[_0x4906da(0x16c)](_0x4906da(0x202));}else{const _0x40666c=_0x1227c9[_0x4906da(0x217)],_0x78397c=_0x41e351[_0x4906da(0x265)](_0x255f45=>{const _0x1fde9b=_0x4906da,_0x26fb6f=a38_0x2eb555[_0x1fde9b(0x1e8)]('#'+_0x255f45['id']),_0x25d37b=_0x255f45[_0x1fde9b(0x240)]?.['id'],_0x3a3147=_0x25d37b?hyperlink(_0x26fb6f,getWorkflowSessionUrl(_0x40666c,_0x25d37b,_0x255f45['id'])):_0x26fb6f,{icon:_0x558164,text:_0x1966c8}=getAttemptStatusDisplay(_0x255f45[_0x1fde9b(0x195)]),_0x4b0d10=(_0x255f45['project']?.['name']||'?')+'.'+(_0x255f45['workflow']?.[_0x1fde9b(0x170)]||'?'),_0x33d963=_0x255f45[_0x1fde9b(0x16d)]?a38_0x2eb555[_0x1fde9b(0x1e8)](_0x255f45['sessionTime']):'';return(_0x3a3147+'\x20'+_0x558164+(_0x1966c8?'\x20'+_0x1966c8:'')+'\x20'+_0x4b0d10+'\x20'+_0x33d963)['trimEnd']();});await writeOutput(_0x78397c['join']('\x0a'),_0x1227c9[_0x4906da(0x1f4)],_0x4906da(0x225));}}return 0x0;}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a38_0x3e0780(0x27d);['description']='List\x20workflow\x20attempts';async[a38_0x3e0780(0x21b)](_0x18cd62){const _0x4376f9=a38_0x3e0780,{options:_0x1e957b,args:_0x2fd04d,tdx:_0x5bf720}=_0x18cd62,_0x52e26e=this[_0x4376f9(0x234)](_0x2fd04d,_0x1e957b);if(!_0x52e26e)return 0x1;const {projectName:_0x5c4241,workflowName:_0x95d4f3}=_0x52e26e,_0x1b5b88=_0x1e957b[_0x4376f9(0x1f9)];if(_0x1e957b[_0x4376f9(0x244)]){if(_0x5c4241&&_0x95d4f3)console['error']('Filter:\x20'+_0x5c4241+'.'+_0x95d4f3);else _0x5c4241&&console[_0x4376f9(0x294)]('Filter:\x20project='+_0x5c4241);_0x1b5b88&&console[_0x4376f9(0x294)](_0x4376f9(0x27a));}const _0x5b9318=await withSpinner(_0x4376f9(0x1ac),()=>_0x5bf720['workflow'][_0x4376f9(0x1e2)]({'projectName':_0x5c4241,'workflowName':_0x95d4f3,'includeRetried':_0x1b5b88,'limit':_0x1e957b['limit']}),{'verbose':_0x1e957b[_0x4376f9(0x244)]}),_0x7aeda=_0x5b9318[_0x4376f9(0x245)],_0x38231d=_0x1e957b['limit']||0x64,_0x45a7a6=_0x7aeda['length']>=_0x38231d?a38_0x2eb555[_0x4376f9(0x1e8)](_0x4376f9(0x160)):'';console[_0x4376f9(0x294)](_0x4376f9(0x17a)+_0x7aeda[_0x4376f9(0x239)]+_0x4376f9(0x200)+(_0x7aeda[_0x4376f9(0x239)]!==0x1?'s':'')+_0x45a7a6);if(_0x1e957b['format']==='json'||_0x1e957b['format']===_0x4376f9(0x1ae)||_0x1e957b[_0x4376f9(0x266)]===_0x4376f9(0x1ec))await handleSDKOutput(_0x7aeda,_0x1e957b);else{if(_0x7aeda[_0x4376f9(0x239)]===0x0){if(_0x5c4241&&_0x95d4f3)console['log'](_0x4376f9(0x28c)+_0x5c4241+'.'+_0x95d4f3);else _0x5c4241?console['log'](_0x4376f9(0x22e)+_0x5c4241):console[_0x4376f9(0x16c)](_0x4376f9(0x1b9));}else{const _0x195a83=_0x1e957b[_0x4376f9(0x217)],_0x3f4907=_0x7aeda['map'](_0x5c096c=>{const _0x448a58=_0x4376f9,_0x374bba=a38_0x2eb555['dim']('#'+_0x5c096c['id']),_0x15ee04=_0x5c096c[_0x448a58(0x240)]?.['id'],_0x10a66d=_0x5c096c[_0x448a58(0x161)]||_0x5c096c[_0x448a58(0x260)],_0x3aec35=_0x15ee04&&_0x10a66d?hyperlink(_0x374bba,getWorkflowAttemptUrl(_0x195a83,_0x15ee04,_0x10a66d,_0x5c096c['id'])):_0x374bba,{icon:_0x19ac7b,text:_0x4123a7}=getAttemptStatusDisplay(_0x5c096c),_0x453c86=(_0x5c096c['project']?.[_0x448a58(0x170)]||'?')+'.'+(_0x5c096c[_0x448a58(0x27f)]?.['name']||'?'),_0xd7f771=_0x5c096c['sessionTime']?a38_0x2eb555[_0x448a58(0x1e8)](_0x5c096c[_0x448a58(0x16d)]):'';return(_0x3aec35+'\x20'+_0x19ac7b+(_0x4123a7?'\x20'+_0x4123a7:'')+'\x20'+_0x453c86+'\x20'+_0xd7f771)[_0x448a58(0x28d)]();});await writeOutput(_0x3f4907[_0x4376f9(0x192)]('\x0a'),_0x1e957b[_0x4376f9(0x1f4)],_0x4376f9(0x225));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x25e);[a38_0x3e0780(0x1f5)]=a38_0x3e0780(0x25b);async[a38_0x3e0780(0x21b)](_0x4f343f){const _0xe9151e=a38_0x3e0780,{options:_0x4391c9,args:_0x19bdf7,tdx:_0x5a6725}=_0x4f343f,_0x5d27ef=_0x19bdf7[0x0];if(!_0x5d27ef)return console['error'](_0xe9151e(0x259)),0x1;_0x4391c9[_0xe9151e(0x244)]&&console[_0xe9151e(0x294)](_0xe9151e(0x166)+_0x5d27ef);const _0x6915ce=await withSpinner(_0xe9151e(0x1b2),()=>_0x5a6725[_0xe9151e(0x27f)][_0xe9151e(0x289)](_0x5d27ef),{'verbose':_0x4391c9[_0xe9151e(0x244)]}),_0x360ed0=_0x6915ce[_0xe9151e(0x245)];let _0xe0c5dd;!_0x360ed0[_0xe9151e(0x255)]?_0xe0c5dd=_0x360ed0[_0xe9151e(0x1de)]?'canceling':_0xe9151e(0x1f6):_0xe0c5dd=_0x360ed0['success']?_0xe9151e(0x1b6):_0xe9151e(0x294);let _0x118b0e;if(_0x360ed0[_0xe9151e(0x263)]&&_0x360ed0['finishedAt']){const _0x4c440c=new Date(_0x360ed0[_0xe9151e(0x263)])[_0xe9151e(0x1ad)](),_0x16e21b=new Date(_0x360ed0['finishedAt'])[_0xe9151e(0x1ad)]();_0x118b0e=Math[_0xe9151e(0x254)]((_0x16e21b-_0x4c440c)/0x3e8);}const _0xf0a304={'attempt_id':_0x360ed0['id'],'status':_0xe0c5dd,..._0x360ed0['index']!==undefined&&{'index':_0x360ed0[_0xe9151e(0x274)]},..._0x360ed0[_0xe9151e(0x240)]&&{'project':_0x360ed0['project'][_0xe9151e(0x170)]},..._0x360ed0[_0xe9151e(0x27f)]&&{'workflow':_0x360ed0[_0xe9151e(0x27f)]['name']},..._0x360ed0[_0xe9151e(0x260)]&&{'session_id':_0x360ed0[_0xe9151e(0x260)]},..._0x360ed0[_0xe9151e(0x16d)]&&{'session_time':_0x360ed0['sessionTime']},..._0x360ed0[_0xe9151e(0x15f)]&&{'retry_attempt':_0x360ed0[_0xe9151e(0x15f)]},..._0x118b0e!==undefined&&{'duration_sec':_0x118b0e},..._0x360ed0[_0xe9151e(0x263)]&&{'created_at':_0x360ed0[_0xe9151e(0x263)]},..._0x360ed0['finishedAt']&&{'finished_at':_0x360ed0['finishedAt']},...Object['keys'](_0x360ed0[_0xe9151e(0x1ba)])[_0xe9151e(0x239)]>0x0&&{'params':_0x360ed0[_0xe9151e(0x1ba)]}};return await handleSingleObjectOutput(_0xf0a304,_0x4391c9),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x1b7);['description']='Show\x20tasks\x20for\x20an\x20attempt';async[a38_0x3e0780(0x21b)](_0x58013d){const _0x2de131=a38_0x3e0780,{options:_0xa16590,args:_0x3bb54f,tdx:_0x361079}=_0x58013d,_0x87dc68=_0x3bb54f[0x0];if(!_0x87dc68)return console[_0x2de131(0x294)](_0x2de131(0x259)),0x1;const _0x38eac7=_0xa16590[_0x2de131(0x20f)];_0xa16590[_0x2de131(0x244)]&&(console['error'](_0x2de131(0x166)+_0x87dc68),_0x38eac7&&console[_0x2de131(0x294)]('Including\x20subtasks:\x20yes'));const _0x57a661=await withSpinner(_0x2de131(0x174),()=>_0x361079[_0x2de131(0x27f)][_0x2de131(0x230)](_0x87dc68,_0x38eac7||![]),{'verbose':_0xa16590[_0x2de131(0x244)]}),_0xd6f126=_0x57a661[_0x2de131(0x245)];return console['error'](_0x2de131(0x17a)+_0xd6f126[_0x2de131(0x239)]+_0x2de131(0x17f)+(_0xd6f126[_0x2de131(0x239)]!==0x1?'s':'')),await handleSDKOutput(_0xd6f126,_0xa16590),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a38_0x3e0780(0x1f0);[a38_0x3e0780(0x1f5)]=a38_0x3e0780(0x16a);async[a38_0x3e0780(0x21b)](_0x461fa2){const _0x3d3b5a=a38_0x3e0780,{options:_0x15274c,args:_0x5ee0b5,tdx:_0x13b679}=_0x461fa2,_0x5f562e=_0x5ee0b5[0x0];let _0x3ef5c5=_0x5ee0b5[0x1];if(!_0x5f562e)return console[_0x3d3b5a(0x294)](_0x3d3b5a(0x259)),0x1;_0x15274c[_0x3d3b5a(0x244)]&&(console[_0x3d3b5a(0x294)](_0x3d3b5a(0x166)+_0x5f562e),_0x3ef5c5&&console[_0x3d3b5a(0x294)](_0x3d3b5a(0x181)+_0x3ef5c5));const _0x4084d8=await withSpinner('Fetching\x20log\x20files...',()=>_0x13b679['workflow']['logFiles'](_0x5f562e,_0x3ef5c5),{'verbose':_0x15274c[_0x3d3b5a(0x244)]}),_0x4a4d64=_0x4084d8[_0x3d3b5a(0x245)];if(_0x4a4d64[_0x3d3b5a(0x239)]===0x0)return console[_0x3d3b5a(0x294)](_0x3d3b5a(0x21c)),0x0;if(!_0x3ef5c5&&(_0x15274c[_0x3d3b5a(0x1d2)]||_0x15274c['format']))return await handleSDKOutput(_0x4a4d64,_0x15274c),0x0;if(!_0x3ef5c5){const _0x10acd4=_0x4a4d64[_0x3d3b5a(0x265)](_0x39f314=>({'title':_0x39f314[_0x3d3b5a(0x21a)]+'\x20('+formatBytes(_0x39f314['fileSize'])+')','value':_0x39f314[_0x3d3b5a(0x21a)]})),_0x53941b=await a38_0x454f8d({'type':_0x3d3b5a(0x23f),'name':_0x3d3b5a(0x279),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x10acd4});if(!_0x53941b[_0x3d3b5a(0x279)])return console[_0x3d3b5a(0x294)]('Cancelled'),0x0;_0x3ef5c5=_0x53941b[_0x3d3b5a(0x279)];}const _0x4fac53=await withSpinner('Downloading\x20logs...',()=>_0x13b679[_0x3d3b5a(0x27f)]['logs'](_0x5f562e,_0x3ef5c5),{'verbose':_0x15274c[_0x3d3b5a(0x244)]}),_0x18ca13=_0x4fac53[_0x3d3b5a(0x245)];return _0x18ca13?console[_0x3d3b5a(0x16c)](_0x18ca13):console[_0x3d3b5a(0x294)](_0x3d3b5a(0x24e)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x1be);['description']=a38_0x3e0780(0x243);async[a38_0x3e0780(0x21b)](_0x36cf03){const _0x796b1e=a38_0x3e0780,{options:_0x20d7f5,args:_0x36d23f,tdx:_0x205940}=_0x36cf03,_0x3d0831=_0x36d23f[0x0];if(!_0x3d0831)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x2bf422=_0x20d7f5[_0x796b1e(0x1ca)];_0x20d7f5['verbose']&&(console[_0x796b1e(0x294)](_0x796b1e(0x166)+_0x3d0831),_0x2bf422&&console[_0x796b1e(0x294)]('Reason:\x20'+_0x2bf422));if(!_0x20d7f5[_0x796b1e(0x264)]){const _0x4af64f=await confirmKey(_0x796b1e(0x1ff)+_0x3d0831+'?');if(!_0x4af64f)return console['error'](_0x796b1e(0x250)),0x0;}const _0x58cd68=await withSpinner(_0x796b1e(0x26e),()=>_0x205940['workflow'][_0x796b1e(0x204)](_0x3d0831,_0x2bf422),{'verbose':_0x20d7f5[_0x796b1e(0x244)]}),_0x24500d=_0x58cd68[_0x796b1e(0x245)];return console[_0x796b1e(0x294)]('✔\x20'+_0x24500d),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x1c0);[a38_0x3e0780(0x1f5)]='Retry\x20a\x20session\x20or\x20attempt';async[a38_0x3e0780(0x21b)](_0x5f47fc){const _0x436d6d=a38_0x3e0780,{options:_0x439322,args:_0x5eec66,tdx:_0x4a9881}=_0x5f47fc,_0x49832d=_0x5eec66[0x0];if(!_0x49832d)return console['error'](_0x436d6d(0x1aa)),console[_0x436d6d(0x294)](_0x436d6d(0x19c)),0x1;let _0x4329a8=![],_0x2ff7af=_0x49832d;if(_0x49832d[_0x436d6d(0x1fe)]('session:'))_0x4329a8=!![],_0x2ff7af=_0x49832d[_0x436d6d(0x21e)](0x8);else{if(_0x49832d[_0x436d6d(0x1fe)](_0x436d6d(0x173)))_0x4329a8=![],_0x2ff7af=_0x49832d[_0x436d6d(0x21e)](0x8);else return console[_0x436d6d(0x294)](_0x436d6d(0x19b)),console[_0x436d6d(0x294)](_0x436d6d(0x19c)),0x1;}const _0x53b859=_0x439322[_0x436d6d(0x1e9)],_0x9c46ff=_0x439322[_0x436d6d(0x269)],_0x366bfc=_0x439322['params'],_0x50da28=_0x439322[_0x436d6d(0x1f7)];_0x439322['verbose']&&(console['error']('Target:\x20'+(_0x4329a8?'session':_0x436d6d(0x289))+'\x20'+_0x2ff7af),_0x53b859&&console[_0x436d6d(0x294)](_0x436d6d(0x28e)+_0x53b859),_0x9c46ff&&console[_0x436d6d(0x294)](_0x436d6d(0x262)+_0x9c46ff),_0x366bfc&&console[_0x436d6d(0x294)]('Params:\x20'+_0x366bfc),_0x50da28&&console[_0x436d6d(0x294)](_0x436d6d(0x1e5)));let _0x70f2ae;if(_0x366bfc)try{if(_0x366bfc[_0x436d6d(0x1fe)]('@')){const _0x56eacc=await import('fs/promises'),_0x1711f0=_0x366bfc[_0x436d6d(0x21e)](0x1),_0x51262d=await _0x56eacc[_0x436d6d(0x28f)](_0x1711f0,'utf-8');_0x70f2ae=JSON['parse'](_0x51262d);}else _0x70f2ae=JSON[_0x436d6d(0x1c4)](_0x366bfc);}catch{return console[_0x436d6d(0x294)](_0x436d6d(0x196)),0x1;}if(!_0x439322[_0x436d6d(0x264)]){const _0x29c2e6=await confirmKey(_0x436d6d(0x23d)+(_0x4329a8?_0x436d6d(0x1c6):_0x436d6d(0x289))+'\x20'+_0x2ff7af+'?');if(!_0x29c2e6)return console[_0x436d6d(0x294)]('Cancelled'),0x0;}let _0x3d4446;_0x4329a8?_0x3d4446=await withSpinner(_0x436d6d(0x249),()=>_0x4a9881[_0x436d6d(0x27f)][_0x436d6d(0x291)](_0x2ff7af,{'fromTask':_0x53b859,'retryParams':_0x70f2ae}),{'verbose':_0x439322['verbose']}):_0x3d4446=await withSpinner(_0x436d6d(0x187),()=>_0x4a9881[_0x436d6d(0x27f)]['retryAttempt'](_0x2ff7af,{'resumeFrom':_0x9c46ff,'retryParams':_0x70f2ae,'force':_0x50da28}),{'verbose':_0x439322[_0x436d6d(0x244)]});const _0x323ac1=_0x3d4446['data'];return console[_0x436d6d(0x294)](_0x436d6d(0x16b)),console['error'](_0x436d6d(0x26b)+_0x323ac1[_0x436d6d(0x21f)]),console[_0x436d6d(0x294)](_0x436d6d(0x283)+_0x323ac1[_0x436d6d(0x260)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x190);['description']=a38_0x3e0780(0x288);async[a38_0x3e0780(0x21b)](_0xeb535){const _0x3fb43c=a38_0x3e0780,{options:_0x58bfa5,args:_0x19bec2,tdx:_0x23eaf3}=_0xeb535;let _0x1aa0d6=_0x19bec2[0x0];if(!_0x1aa0d6){const _0x3f144a=this[_0x3fb43c(0x1dc)]([],_0x58bfa5),_0x1b4012=await withSpinner(_0x3fb43c(0x1ee),()=>_0x23eaf3[_0x3fb43c(0x27f)][_0x3fb43c(0x193)](_0x3f144a,{'limit':_0x58bfa5['limit']}),{'verbose':_0x58bfa5[_0x3fb43c(0x244)]}),_0x266dd1=_0x1b4012[_0x3fb43c(0x245)];if(_0x266dd1[_0x3fb43c(0x239)]===0x0)return console[_0x3fb43c(0x294)](_0x3fb43c(0x176)),!_0x3f144a&&console[_0x3fb43c(0x294)](a38_0x2eb555['dim'](_0x3fb43c(0x232))),0x1;const _0x21d4cf=_0x266dd1[_0x3fb43c(0x265)](_0x528218=>({'title':_0x528218[_0x3fb43c(0x240)]?.[_0x3fb43c(0x170)]+'.'+_0x528218['name'],'value':_0x528218[_0x3fb43c(0x240)]?.[_0x3fb43c(0x170)]+'.'+_0x528218[_0x3fb43c(0x170)],'description':_0x528218[_0x3fb43c(0x180)]?_0x3fb43c(0x222)+_0x528218['revision']:undefined})),_0x1e63ce=await a38_0x454f8d({'type':_0x3fb43c(0x23f),'name':'workflow','message':_0x3fb43c(0x268),'choices':_0x21d4cf});if(!_0x1e63ce[_0x3fb43c(0x27f)])return 0x1;_0x1aa0d6=_0x1e63ce[_0x3fb43c(0x27f)];}if(!_0x1aa0d6[_0x3fb43c(0x272)]('.')){const _0x8964b1=this['resolveProject']([],_0x58bfa5);if(_0x8964b1)_0x1aa0d6=_0x8964b1+'.'+_0x1aa0d6;else return console[_0x3fb43c(0x294)](a38_0x2eb555[_0x3fb43c(0x1bf)](_0x3fb43c(0x18a)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x3fb43c(0x294)](a38_0x2eb555[_0x3fb43c(0x1e8)](_0x3fb43c(0x232))),0x1;}const _0x52fd54=_0x58bfa5[_0x3fb43c(0x1e3)],_0x548cd6=_0x58bfa5[_0x3fb43c(0x16d)],_0xf87b7b={};if(_0x52fd54&&Array[_0x3fb43c(0x20a)](_0x52fd54))for(const _0xf23d8d of _0x52fd54){const _0x5c459b=_0xf23d8d[_0x3fb43c(0x25a)]('=');if(_0x5c459b===-0x1)return console[_0x3fb43c(0x294)](_0x3fb43c(0x258)+_0xf23d8d),console['error']('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x4e077e=_0xf23d8d[_0x3fb43c(0x21e)](0x0,_0x5c459b),_0x212f16=_0xf23d8d[_0x3fb43c(0x21e)](_0x5c459b+0x1);try{_0xf87b7b[_0x4e077e]=JSON[_0x3fb43c(0x1c4)](_0x212f16);}catch{_0xf87b7b[_0x4e077e]=_0x212f16;}}_0x58bfa5[_0x3fb43c(0x244)]&&(console[_0x3fb43c(0x294)](_0x3fb43c(0x1d4)+_0x1aa0d6),Object['keys'](_0xf87b7b)[_0x3fb43c(0x239)]>0x0&&console[_0x3fb43c(0x294)]('Parameters:\x20'+JSON[_0x3fb43c(0x1fa)](_0xf87b7b)),_0x548cd6&&console[_0x3fb43c(0x294)](_0x3fb43c(0x218)+_0x548cd6));const _0x5b9229=await withSpinner(_0x3fb43c(0x24b),()=>_0x23eaf3[_0x3fb43c(0x27f)]['run'](_0x1aa0d6,_0xf87b7b,{'sessionTime':_0x548cd6}),{'verbose':_0x58bfa5[_0x3fb43c(0x244)]}),_0x2db429=_0x5b9229[_0x3fb43c(0x245)];console['error'](_0x3fb43c(0x246)),console['error'](_0x3fb43c(0x247)+_0x2db429['id']),console[_0x3fb43c(0x294)](_0x3fb43c(0x283)+_0x2db429['sessionId']),console[_0x3fb43c(0x294)]('\x20\x20Project:\x20'+_0x2db429['project']?.[_0x3fb43c(0x170)]),console[_0x3fb43c(0x294)](_0x3fb43c(0x201)+_0x2db429['workflow']?.[_0x3fb43c(0x170)]);if(_0x2db429[_0x3fb43c(0x240)]?.['id']&&_0x2db429['sessionId']&&_0x2db429['id']){const _0x4ca85a=_0x58bfa5['site'],_0x1d4922=getConsoleUrl(_0x4ca85a,'/app/workflows/'+_0x2db429[_0x3fb43c(0x240)]['id']+_0x3fb43c(0x1bc)+_0x2db429[_0x3fb43c(0x260)]+_0x3fb43c(0x18f)+_0x2db429['id']);console['error'](_0x3fb43c(0x1a4)+a38_0x2eb555[_0x3fb43c(0x1f1)](_0x1d4922));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x172);['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a38_0x3e0780(0x21b)](_0x2a6e67){const _0x3725f3=a38_0x3e0780,{options:_0x8b21e4,args:_0xd9e36f,tdx:_0x37d866}=_0x2a6e67,_0x4adc59=_0xd9e36f[0x0],_0x3acdf4=_0xd9e36f[0x1]||'.';if(!_0x4adc59)return console[_0x3725f3(0x294)](_0x3725f3(0x1e7)),console['error']('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x9b3406=_0x8b21e4[_0x3725f3(0x180)];_0x8b21e4[_0x3725f3(0x244)]&&(console[_0x3725f3(0x294)](_0x3725f3(0x184)+_0x4adc59),console['error']('Output\x20directory:\x20'+_0x3acdf4),_0x9b3406&&console['error'](_0x3725f3(0x163)+_0x9b3406));const _0x5b5cdc=await withSpinner(_0x3725f3(0x1b1)+_0x4adc59+_0x3725f3(0x183),()=>_0x37d866[_0x3725f3(0x27f)][_0x3725f3(0x23e)](_0x4adc59,_0x3acdf4,{'revision':_0x9b3406}),{'verbose':_0x8b21e4[_0x3725f3(0x244)]}),_0x449ac3=_0x5b5cdc[_0x3725f3(0x245)];return console[_0x3725f3(0x294)](_0x3725f3(0x1a1)+_0x449ac3[_0x3725f3(0x241)]),console[_0x3725f3(0x294)](_0x3725f3(0x162)+_0x449ac3[_0x3725f3(0x180)]),console[_0x3725f3(0x294)]('\x20\x20Files\x20extracted:\x20'+_0x449ac3[_0x3725f3(0x18e)]),console[_0x3725f3(0x294)](_0x3725f3(0x1eb)+_0x3acdf4+'/'+_0x449ac3[_0x3725f3(0x241)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x1c8);[a38_0x3e0780(0x1f5)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async['execute'](_0x591667){const _0x540707=a38_0x3e0780,{options:_0x5e1b62,args:_0x577444,tdx:_0x4a23f7}=_0x591667;let _0x235f30='.',_0x382d1b=_0x5e1b62['name'];if(_0x577444[0x0]){const {promises:_0x10fd0f}=await import('fs');try{const _0x357686=await _0x10fd0f['stat'](_0x577444[0x0]);if(_0x357686['isDirectory']())_0x235f30=_0x577444[0x0];else return console['error'](_0x540707(0x1dd)+_0x577444[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x382d1b=_0x577444[0x0],_0x235f30='.';}}const _0x126038=_0x5e1b62[_0x540707(0x180)],_0x341056=_0x5e1b62[_0x540707(0x23b)];_0x5e1b62[_0x540707(0x244)]&&(console[_0x540707(0x294)](_0x540707(0x1e1)+_0x235f30),_0x382d1b&&console[_0x540707(0x294)](_0x540707(0x1a6)+_0x382d1b),_0x126038&&console['error']('Revision:\x20'+_0x126038),_0x341056&&console[_0x540707(0x294)](_0x540707(0x28b)));const _0x2fd605=await withSpinner(_0x540707(0x198),()=>_0x4a23f7[_0x540707(0x27f)][_0x540707(0x1b0)](_0x235f30,{'projectName':_0x382d1b,'revision':_0x126038,'skipValidation':_0x341056}),{'verbose':_0x5e1b62[_0x540707(0x244)]}),_0xd2359c=_0x2fd605[_0x540707(0x245)];return console['error'](_0x540707(0x278)+_0xd2359c['projectName']),console[_0x540707(0x294)](_0x540707(0x1df)+_0xd2359c[_0x540707(0x1d0)]),console['error'](_0x540707(0x162)+_0xd2359c['revision']),await this[_0x540707(0x22d)](_0x4a23f7,_0xd2359c[_0x540707(0x241)],_0x5e1b62[_0x540707(0x217)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a38_0x3e0780(0x170)]='workflow:pull';['description']=a38_0x3e0780(0x189);async['execute'](_0x376aeb){const _0x3e8022=a38_0x3e0780,{options:_0x5ae26f,args:_0x2219e7,tdx:_0x4a8308}=_0x376aeb,_0x224ec8=_0x2219e7[0x0],_0x2d2de8=_0x2219e7[0x1];if(!_0x224ec8)return console[_0x3e8022(0x294)](a38_0x2eb555[_0x3e8022(0x1bf)](_0x3e8022(0x18a)),_0x3e8022(0x20c)),console[_0x3e8022(0x294)](a38_0x2eb555[_0x3e8022(0x1e8)](_0x3e8022(0x16e))),0x1;const _0x4930f9=_0x5ae26f[_0x3e8022(0x180)];_0x5ae26f[_0x3e8022(0x244)]&&(console[_0x3e8022(0x294)](_0x3e8022(0x184)+_0x224ec8),_0x2d2de8&&console[_0x3e8022(0x294)](_0x3e8022(0x175)+_0x2d2de8),_0x4930f9&&console[_0x3e8022(0x294)]('Revision:\x20'+_0x4930f9),_0x5ae26f[_0x3e8022(0x251)]&&console[_0x3e8022(0x294)](_0x3e8022(0x1d6)));const _0x345bad=await withSpinner(_0x3e8022(0x229)+_0x224ec8+_0x3e8022(0x183),()=>_0x4a8308[_0x3e8022(0x27f)][_0x3e8022(0x194)](_0x224ec8,{'targetDir':_0x2d2de8,'revision':_0x4930f9}),{'verbose':_0x5ae26f[_0x3e8022(0x244)]}),_0x2778dd=_0x345bad['data'];_0x2778dd[_0x3e8022(0x177)]?console[_0x3e8022(0x294)](_0x3e8022(0x256)+_0x2778dd[_0x3e8022(0x241)]):console[_0x3e8022(0x294)](_0x3e8022(0x205)+_0x2778dd[_0x3e8022(0x241)]);console['error'](_0x3e8022(0x162)+_0x2778dd[_0x3e8022(0x180)]),console[_0x3e8022(0x294)](_0x3e8022(0x1f3)+(a38_0x4e4b26[_0x3e8022(0x267)](process[_0x3e8022(0x18d)](),_0x2778dd[_0x3e8022(0x231)])||'.')),console[_0x3e8022(0x294)]('\x20\x20Changes:\x20'+a38_0x2eb555[_0x3e8022(0x290)]('+'+_0x2778dd[_0x3e8022(0x284)][_0x3e8022(0x275)]+_0x3e8022(0x17c))+',\x20'+(a38_0x2eb555[_0x3e8022(0x252)]('~'+_0x2778dd[_0x3e8022(0x284)][_0x3e8022(0x1e6)]+_0x3e8022(0x1a5))+',\x20')+(a38_0x2eb555[_0x3e8022(0x1bf)]('-'+_0x2778dd[_0x3e8022(0x284)]['deleted']+_0x3e8022(0x1db))+',\x20')+(''+a38_0x2eb555[_0x3e8022(0x1e8)](_0x2778dd['summary'][_0x3e8022(0x1cb)]+'\x20unchanged')));for(const _0x476367 of _0x2778dd[_0x3e8022(0x191)]){_0x476367[_0x3e8022(0x1a7)]==='modified'&&_0x476367[_0x3e8022(0x257)]&&(console['error']('\x0a'+a38_0x2eb555['cyan'](_0x3e8022(0x1d9)+_0x476367[_0x3e8022(0x16f)])),console[_0x3e8022(0x294)](_0x476367['diff']));}if(!_0x2778dd[_0x3e8022(0x165)])return saveSessionContext({'workflow_project':_0x2778dd[_0x3e8022(0x241)]},_0x5ae26f[_0x3e8022(0x1c6)]),console['error'](a38_0x2eb555['green'](_0x3e8022(0x1c7))),console['error'](a38_0x2eb555[_0x3e8022(0x1e8)](_0x3e8022(0x18c)+_0x2778dd[_0x3e8022(0x241)])),0x0;if(_0x5ae26f[_0x3e8022(0x251)])return console[_0x3e8022(0x294)](a38_0x2eb555[_0x3e8022(0x252)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x5ae26f[_0x3e8022(0x264)]){const _0xe03f49=await confirmKey(_0x3e8022(0x1d5));if(!_0xe03f49)return console[_0x3e8022(0x294)](_0x3e8022(0x250)),0x0;}await withSpinner(_0x3e8022(0x1fc),()=>_0x4a8308[_0x3e8022(0x27f)][_0x3e8022(0x1d3)](_0x2778dd,{'revision':_0x4930f9}),{'verbose':_0x5ae26f[_0x3e8022(0x244)]}),saveSessionContext({'workflow_project':_0x2778dd['projectName']},_0x5ae26f[_0x3e8022(0x1c6)]),console[_0x3e8022(0x294)](a38_0x2eb555['green'](_0x3e8022(0x22b)));const _0x167b94=a38_0x4e4b26['relative'](process[_0x3e8022(0x18d)](),_0x2778dd[_0x3e8022(0x231)])||'.';return console[_0x3e8022(0x294)](a38_0x2eb555[_0x3e8022(0x1e8)](_0x3e8022(0x1eb)+_0x167b94)),console[_0x3e8022(0x294)](a38_0x2eb555[_0x3e8022(0x1e8)](_0x3e8022(0x18c)+_0x2778dd[_0x3e8022(0x241)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x277);[a38_0x3e0780(0x1f5)]=a38_0x3e0780(0x261);async[a38_0x3e0780(0x21b)](_0x2e72cf){const _0x2e3fc8=a38_0x3e0780,{options:_0x1fc362,args:_0x4873f7,tdx:_0x2038ba}=_0x2e72cf,_0x47dc2a=this[_0x2e3fc8(0x19f)](_0x4873f7,_0x1fc362),_0x158a28=_0x1fc362[_0x2e3fc8(0x180)],_0x36a5a4=_0x1fc362[_0x2e3fc8(0x23b)];_0x1fc362[_0x2e3fc8(0x244)]&&(_0x47dc2a&&console[_0x2e3fc8(0x294)](_0x2e3fc8(0x227)+_0x47dc2a),_0x158a28&&console[_0x2e3fc8(0x294)](_0x2e3fc8(0x163)+_0x158a28),_0x1fc362[_0x2e3fc8(0x251)]&&console[_0x2e3fc8(0x294)]('Dry\x20run:\x20yes'),_0x36a5a4&&console[_0x2e3fc8(0x294)](_0x2e3fc8(0x28b)));let _0x324d62;try{_0x324d62=await withSpinner(_0x2e3fc8(0x26f),()=>_0x2038ba['workflow'][_0x2e3fc8(0x1a9)]({'sourceDir':_0x47dc2a,'revision':_0x158a28,'skipValidation':_0x36a5a4}),{'verbose':_0x1fc362[_0x2e3fc8(0x244)]});}catch(_0x5e78ce){if(_0x5e78ce instanceof Error&&_0x5e78ce[_0x2e3fc8(0x197)][_0x2e3fc8(0x272)](_0x2e3fc8(0x1d7)))return console['error'](a38_0x2eb555['red']('Error:'),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x1fc362[_0x2e3fc8(0x23a)]?console['error'](a38_0x2eb555[_0x2e3fc8(0x1e8)](_0x2e3fc8(0x24d)+_0x1fc362['workflowProject']+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x1fc362['workflowProject']+'\x27')):console[_0x2e3fc8(0x294)](a38_0x2eb555[_0x2e3fc8(0x1e8)](_0x2e3fc8(0x1cf))),0x1;throw _0x5e78ce;}const _0x34b4de=_0x324d62[_0x2e3fc8(0x245)];console['error'](_0x2e3fc8(0x205)+_0x34b4de[_0x2e3fc8(0x241)]),console[_0x2e3fc8(0x294)](_0x2e3fc8(0x22c)+_0x34b4de['sourceDir']),console[_0x2e3fc8(0x294)](_0x2e3fc8(0x162)+_0x34b4de[_0x2e3fc8(0x180)]),console[_0x2e3fc8(0x294)]('\x20\x20Changes:\x20'+a38_0x2eb555[_0x2e3fc8(0x290)]('+'+_0x34b4de[_0x2e3fc8(0x284)][_0x2e3fc8(0x275)]+'\x20new')+',\x20'+(a38_0x2eb555[_0x2e3fc8(0x252)]('~'+_0x34b4de[_0x2e3fc8(0x284)][_0x2e3fc8(0x1e6)]+_0x2e3fc8(0x1a5))+',\x20')+(a38_0x2eb555['red']('-'+_0x34b4de['summary'][_0x2e3fc8(0x1ea)]+_0x2e3fc8(0x1db))+',\x20')+(''+a38_0x2eb555['dim'](_0x34b4de[_0x2e3fc8(0x284)][_0x2e3fc8(0x1cb)]+_0x2e3fc8(0x1ed))));for(const _0x211831 of _0x34b4de[_0x2e3fc8(0x191)]){_0x211831[_0x2e3fc8(0x1a7)]==='modified'&&_0x211831['diff']&&(console[_0x2e3fc8(0x294)]('\x0a'+a38_0x2eb555[_0x2e3fc8(0x1f1)](_0x2e3fc8(0x1d9)+_0x211831[_0x2e3fc8(0x16f)])),console[_0x2e3fc8(0x294)](_0x211831['diff']));}if(!_0x34b4de['hasChanges'])return console[_0x2e3fc8(0x294)](a38_0x2eb555[_0x2e3fc8(0x290)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x2e3fc8(0x22d)](_0x2038ba,_0x34b4de[_0x2e3fc8(0x241)],_0x1fc362['site']),0x0;if(_0x1fc362['dryRun'])return console[_0x2e3fc8(0x294)](a38_0x2eb555[_0x2e3fc8(0x252)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x1fc362['yes']){const _0x19f688=await confirmKey(_0x2e3fc8(0x1fb));if(!_0x19f688)return console[_0x2e3fc8(0x294)]('Cancelled'),0x0;}const _0x157700=await withSpinner('Pushing\x20project...',()=>_0x2038ba['workflow'][_0x2e3fc8(0x228)](_0x34b4de),{'verbose':_0x1fc362[_0x2e3fc8(0x244)]}),_0x2a0338=_0x157700[_0x2e3fc8(0x245)];return console['error'](a38_0x2eb555[_0x2e3fc8(0x290)](_0x2e3fc8(0x169))),console[_0x2e3fc8(0x294)]('\x20\x20Project\x20ID:\x20'+_0x2a0338['projectId']),console['error']('\x20\x20Revision:\x20'+_0x2a0338['revision']),await this['showWorkflowConsoleUrl'](_0x2038ba,_0x2a0338[_0x2e3fc8(0x241)],_0x1fc362['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x287);['description']='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a38_0x3e0780(0x21b)](_0x1b895b){const _0x2466b6=a38_0x3e0780,{options:_0x75dd56,args:_0x2f7554,tdx:_0x18959c}=_0x1b895b,_0x2bd1fc=this['resolveProjectDir'](_0x2f7554,_0x75dd56),_0x503ec2=_0x75dd56[_0x2466b6(0x170)],_0x2a70bc=_0x75dd56[_0x2466b6(0x180)],_0x5d5059=_0x75dd56[_0x2466b6(0x23b)];if(!_0x2bd1fc)return console[_0x2466b6(0x294)](a38_0x2eb555[_0x2466b6(0x1bf)](_0x2466b6(0x18a)),_0x2466b6(0x22f)),console[_0x2466b6(0x294)](a38_0x2eb555['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x2466b6(0x294)](a38_0x2eb555[_0x2466b6(0x1e8)](_0x2466b6(0x1c9))),0x1;if(!_0x503ec2)return console[_0x2466b6(0x294)](a38_0x2eb555[_0x2466b6(0x1bf)](_0x2466b6(0x18a)),_0x2466b6(0x215)),console[_0x2466b6(0x294)](a38_0x2eb555[_0x2466b6(0x1e8)](_0x2466b6(0x24c))),0x1;_0x75dd56[_0x2466b6(0x244)]&&(console[_0x2466b6(0x294)](_0x2466b6(0x227)+_0x2bd1fc),console[_0x2466b6(0x294)](_0x2466b6(0x17b)+_0x503ec2),_0x2a70bc&&console[_0x2466b6(0x294)]('Revision:\x20'+_0x2a70bc),_0x75dd56['dryRun']&&console[_0x2466b6(0x294)](_0x2466b6(0x1d6)),_0x5d5059&&console[_0x2466b6(0x294)]('Validation:\x20skipped'));const _0x1a1c31=await withSpinner(_0x2466b6(0x1e0),()=>_0x18959c[_0x2466b6(0x27f)][_0x2466b6(0x213)](_0x2bd1fc,_0x503ec2,{'revision':_0x2a70bc,'skipValidation':_0x5d5059}),{'verbose':_0x75dd56['verbose']}),_0xf98ef5=_0x1a1c31['data'];console[_0x2466b6(0x294)]('Source:\x20'+_0xf98ef5['sourceDir']);_0xf98ef5[_0x2466b6(0x1cc)]&&console['error'](_0x2466b6(0x1ce)+_0xf98ef5['sourceProjectName']);console[_0x2466b6(0x294)](_0x2466b6(0x17b)+_0xf98ef5[_0x2466b6(0x1da)]),console[_0x2466b6(0x294)](_0x2466b6(0x163)+_0xf98ef5['revision']),console['error'](_0x2466b6(0x182)+_0xf98ef5[_0x2466b6(0x25c)]);_0xf98ef5['targetExists']&&(console[_0x2466b6(0x294)](a38_0x2eb555[_0x2466b6(0x252)](_0x2466b6(0x292)+_0xf98ef5['newProjectName']+_0x2466b6(0x19a)+_0xf98ef5['existingProjectId']+')')),console[_0x2466b6(0x294)](a38_0x2eb555[_0x2466b6(0x252)](_0x2466b6(0x248))));if(_0x75dd56[_0x2466b6(0x251)])return console[_0x2466b6(0x294)](a38_0x2eb555[_0x2466b6(0x252)](_0x2466b6(0x1ef))),0x0;if(!_0x75dd56['yes']){const _0x115b43=_0xf98ef5[_0x2466b6(0x1cc)]||a38_0x4e4b26['basename'](_0x2bd1fc),_0x162438=_0xf98ef5['targetExists']?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x503ec2+_0x2466b6(0x179):_0x2466b6(0x1f2)+_0x115b43+_0x2466b6(0x20e)+_0x503ec2+'\x22?',_0xc0b5b=await confirmKey(_0x162438);if(!_0xc0b5b)return console['error'](_0x2466b6(0x250)),0x0;}const _0x5738dd=await withSpinner(_0xf98ef5[_0x2466b6(0x219)]?_0x2466b6(0x1fd)+_0x503ec2+'...':_0x2466b6(0x164)+_0x503ec2+_0x2466b6(0x183),()=>_0x18959c[_0x2466b6(0x27f)][_0x2466b6(0x27e)](_0xf98ef5),{'verbose':_0x75dd56[_0x2466b6(0x244)]}),_0x20bdc8=_0x5738dd[_0x2466b6(0x245)];return console[_0x2466b6(0x294)](a38_0x2eb555[_0x2466b6(0x290)](_0xf98ef5['targetExists']?'✔\x20Project\x20updated':_0x2466b6(0x17d))),console[_0x2466b6(0x294)](_0x2466b6(0x1bb)+_0x20bdc8[_0x2466b6(0x1da)]),console[_0x2466b6(0x294)](_0x2466b6(0x1df)+_0x20bdc8[_0x2466b6(0x171)]),console[_0x2466b6(0x294)](_0x2466b6(0x162)+_0x20bdc8[_0x2466b6(0x180)]),await this[_0x2466b6(0x22d)](_0x18959c,_0x20bdc8[_0x2466b6(0x1da)],_0x75dd56[_0x2466b6(0x217)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a38_0x3e0780(0x1f8);[a38_0x3e0780(0x1f5)]=a38_0x3e0780(0x220);async['execute'](_0x367f91){const _0x57cc9b=a38_0x3e0780,{options:_0x5def54,args:_0x3134bd,tdx:_0x17ade9}=_0x367f91,_0x3430c6=_0x3134bd[0x0];if(!_0x3430c6)return console[_0x57cc9b(0x294)](_0x57cc9b(0x188)),console[_0x57cc9b(0x294)](_0x57cc9b(0x19d)),0x1;_0x5def54['verbose']&&console['error'](_0x57cc9b(0x184)+_0x3430c6);if(!_0x5def54['yes']){const _0x36d3b5=await confirmKey(_0x57cc9b(0x282)+_0x3430c6+_0x57cc9b(0x18b));if(!_0x36d3b5)return console[_0x57cc9b(0x294)](_0x57cc9b(0x250)),0x0;}const _0x556038=await withSpinner('Deleting\x20project\x20'+_0x3430c6+_0x57cc9b(0x183),()=>_0x17ade9[_0x57cc9b(0x27f)]['delete'](_0x3430c6),{'verbose':_0x5def54[_0x57cc9b(0x244)]}),_0x4dc307=_0x556038['data'];return console[_0x57cc9b(0x294)](_0x57cc9b(0x168)+_0x4dc307[_0x57cc9b(0x241)]),console[_0x57cc9b(0x294)](_0x57cc9b(0x1df)+_0x4dc307[_0x57cc9b(0x1d0)]),0x0;}}function a38_0x32b2(){const _0x43885f=['Project\x20filter:\x20','\x22\x20with\x20new\x20revision?','✔\x20Found\x20','New\x20project\x20name:\x20','\x20new','✔\x20Clone\x20complete','resolveProjectId','\x20task','revision','Task\x20name:\x20','Files\x20to\x20upload:\x20','...','Project:\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Error:\x20KEY=VALUE\x20is\x20required','Retrying\x20attempt...','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Pull\x20workflow\x20project\x20to\x20local\x20folder','Error:','\x22?\x20This\x20cannot\x20be\x20undone.','\x20\x20Session\x20context\x20set\x20to:\x20','cwd','filesExtracted','/attempt/','workflow:run','changes','join','workflows','pullProject','lastAttempt','Error:\x20Invalid\x20JSON\x20in\x20--params','message','Pushing\x20workflow\x20project...','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x22\x20already\x20exists\x20(ID:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Usage:\x20workflow:delete\x20<project-name-or-id>','464955rTXAFK','resolveProjectDir','\x27...','✔\x20Downloaded\x20','workflow:projects','workflow:use','\x20\x20Console:\x20','\x20modified','Project\x20name:\x20','type','requireProject','preparePushProject','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','limit','Listing\x20workflow\x20attempts...','getTime','jsonl','23804iNzOTl','push','Downloading\x20project\x20','Getting\x20attempt\x20details...','workflow:secrets:delete','✔\x20Workflow\x20project\x20set\x20to:\x20','key','success','workflow:tasks','303135eSwjDQ','No\x20attempts\x20found','params','\x20\x20Project:\x20','/sessions/','listSecrets','workflow:kill','red','workflow:retry','metadata','tdx.json','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','parse','2967220UNafus','session','\x0a✔\x20Already\x20up\x20to\x20date','workflow:upload','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','reason','unchanged','sourceProjectName','✔\x20Workflow\x20project\x20context\x20cleared.','Source\x20project:\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','projectId','No\x20sessions\x20found\x20in\x20project:\x20','json','applyPullProject','Workflow:\x20','\x0aApply\x20these\x20changes?','Dry\x20run:\x20yes','No\x20workflow\x20tdx.json\x20found','projects','---\x20','newProjectName','\x20deleted','resolveProject','Error:\x20','cancelRequested','\x20\x20Project\x20ID:\x20','Analyzing\x20project...','Project\x20directory:\x20','attempts','param','\x20(system)','Force:\x20yes','modified','Error:\x20Project\x20name\x20is\x20required','dim','fromTask','deleted','\x20\x20Location:\x20','table','\x20unchanged','Loading\x20workflows...','\x0aDry\x20run\x20-\x20no\x20project\x20created','workflow:logs','cyan','\x0aClone\x20\x22','\x20\x20Target:\x20','output','description','running','force','workflow:delete','includeRetried','stringify','\x0aPush\x20these\x20changes?','Writing\x20files...','Updating\x20','startsWith','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x20attempt','\x20\x20Workflow:\x20','No\x20sessions\x20found','Listing\x20workflow\x20projects...','kill','✔\x20Project:\x20','8qvGfXu','workflow:secrets:set','362646BBlQbb','sort','isArray','Filter:\x20project=','Project\x20name\x20is\x20required','No\x20projects\x20match\x20pattern:\x20','\x22\x20to\x20new\x20project\x20\x22','includeSubtasks','Setting\x20secret...','from','\x20project','prepareCloneProject','No\x20workflows\x20found\x20in\x20project:\x20','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','site','Session\x20time:\x20','targetExists','taskName','execute','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Status:\x20','substring','attemptId','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Listing\x20workflow\x20sessions...','revision:\x20','blue','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','list','Listing\x20secrets...','Source\x20directory:\x20','executePushProject','Pulling\x20project\x20','canceling','✔\x20Pull\x20complete','\x20\x20Source:\x20','showWorkflowConsoleUrl','No\x20attempts\x20found\x20in\x20project:\x20','Source\x20directory\x20is\x20required','tasks','targetDir','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','workflow:secrets:list','parseProjectWorkflowPattern','📁\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','59TDQnje','\x20session','length','workflowProject','skipValidation','List\x20workflow\x20execution\x20sessions','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','download','select','project','projectName','✔\x20Secret\x20\x27','Kill\x20a\x20running\x20attempt','verbose','data','✔\x20Workflow\x20run\x20started','\x20\x20Attempt\x20ID:\x20','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','Retrying\x20session...','Usage:\x20tdx\x20wf\x20use\x20<project>','Starting\x20workflow\x20run...','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Tip:\x20cd\x20to\x20workflows/','No\x20log\x20content\x20found','localeCompare','Cancelled','dryRun','yellow','573601oFWHkm','round','done','✔\x20New\x20project:\x20','diff','Error:\x20Invalid\x20parameter\x20format:\x20','Error:\x20Attempt\x20ID\x20is\x20required','indexOf','Show\x20specific\x20attempt\x20details','fileCount','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','workflow:attempt','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','sessionId','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Resume\x20from:\x20','createdAt','yes','map','format','relative','Select\x20a\x20workflow\x20to\x20run','resumeFrom','No\x20workflow\x20projects\x20found','\x20\x20New\x20attempt\x20ID:\x20','Pattern:\x20','deleteSecret','Killing\x20attempt...','Analyzing\x20changes...','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','📋\x20','includes','Key:\x20','index','new','split','workflow:push','✔\x20Pushed\x20','task','Include\x20retried:\x20yes','\x20secret','Filter:\x20','workflow:attempts','executeCloneProject','workflow','sys','sessions','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x20\x20Session\x20ID:\x20','summary','List\x20workflows','No\x20sessions\x20found\x20for:\x20','workflow:clone','Start\x20a\x20workflow\x20run','attempt','setSecret','Validation:\x20skipped','No\x20attempts\x20found\x20for:\x20','trimEnd','From\x20task:\x20','readFile','green','retrySession','\x0a⚠\x20Project\x20\x22','status','error','retryAttemptName','\x20(use\x20--limit\x20to\x20show\x20more)','session_id','\x20\x20Revision:\x20','Revision:\x20','Cloning\x20to\x20','hasChanges','Attempt\x20ID:\x20','3071565pjmyWv','✔\x20Deleted\x20project\x20','✔\x20Push\x20complete','Show\x20logs\x20for\x20a\x20workflow\x20attempt','✔\x20Retry\x20started','log','sessionTime','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','path','name','newProjectId','workflow:download','attempt:','Getting\x20attempt\x20tasks...','Target\x20directory:\x20','No\x20workflows\x20found','isNewProject'];a38_0x32b2=function(){return _0x43885f;};return a38_0x32b2();}export function parseKeyValue(_0x42e6da){const _0x59d64c=a38_0x3e0780,_0x230504=_0x42e6da[_0x59d64c(0x25a)]('=');if(_0x230504===-0x1)throw new Error('Invalid\x20format:\x20'+_0x42e6da+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x6cb7da=_0x42e6da[_0x59d64c(0x21e)](0x0,_0x230504),_0x4b049f=_0x42e6da[_0x59d64c(0x21e)](_0x230504+0x1);if(!_0x6cb7da)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x6cb7da,'value':_0x4b049f};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x233);[a38_0x3e0780(0x1f5)]=a38_0x3e0780(0x216);async[a38_0x3e0780(0x21b)](_0x1e9e94){const _0x5deec8=a38_0x3e0780,{options:_0x2e744a,args:_0x17ef42,tdx:_0xe81020}=_0x1e9e94,_0x56460c=this[_0x5deec8(0x1a8)](_0x17ef42,_0x2e744a);if(!_0x56460c)return 0x1;_0x2e744a[_0x5deec8(0x244)]&&console[_0x5deec8(0x294)](_0x5deec8(0x184)+_0x56460c);const _0x5129ad=await withSpinner(_0x5deec8(0x226),()=>_0xe81020[_0x5deec8(0x27f)][_0x5deec8(0x1bd)](_0x56460c),{'verbose':_0x2e744a[_0x5deec8(0x244)]}),{secrets:_0x367da7}=_0x5129ad[_0x5deec8(0x245)];return console[_0x5deec8(0x294)](_0x5deec8(0x17a)+_0x367da7[_0x5deec8(0x239)]+_0x5deec8(0x27b)+(_0x367da7[_0x5deec8(0x239)]!==0x1?'s':'')),await handleSDKOutput(_0x367da7,_0x2e744a),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x207);[a38_0x3e0780(0x1f5)]=a38_0x3e0780(0x199);async[a38_0x3e0780(0x21b)](_0x3ad818){const _0xbb5958=a38_0x3e0780,{options:_0x434d78,args:_0x4422cc,tdx:_0x1c1c62}=_0x3ad818;let _0x194ae6,_0xc915c6;if(_0x4422cc[_0xbb5958(0x239)]>=0x2)_0x194ae6=_0x4422cc[0x0],_0xc915c6=_0x4422cc[0x1];else{if(_0x4422cc[_0xbb5958(0x239)]===0x1&&_0x434d78[_0xbb5958(0x23a)])_0x194ae6=_0x434d78['workflowProject'],_0xc915c6=_0x4422cc[0x0];else return _0x4422cc[_0xbb5958(0x239)]===0x1?(console[_0xbb5958(0x294)](_0xbb5958(0x1e7)),console[_0xbb5958(0x294)](_0xbb5958(0x232)),0x1):(console[_0xbb5958(0x294)](_0xbb5958(0x186)),console['error'](_0xbb5958(0x25f)),0x1);}let _0x1cd632,_0x2793e2;try{({key:_0x1cd632,value:_0x2793e2}=parseKeyValue(_0xc915c6));}catch(_0x229d13){return _0x229d13 instanceof Error&&console[_0xbb5958(0x294)](a38_0x2eb555[_0xbb5958(0x1bf)](_0xbb5958(0x18a)),_0x229d13[_0xbb5958(0x197)]),0x1;}_0x434d78[_0xbb5958(0x244)]&&(console[_0xbb5958(0x294)](_0xbb5958(0x184)+_0x194ae6),console[_0xbb5958(0x294)](_0xbb5958(0x273)+_0x1cd632));const _0x5eec15=await withSpinner(_0xbb5958(0x210),()=>_0x1c1c62[_0xbb5958(0x27f)][_0xbb5958(0x28a)](_0x194ae6,_0x1cd632,_0x2793e2),{'verbose':_0x434d78[_0xbb5958(0x244)]}),_0x2dd7ab=_0x5eec15['data'];return console[_0xbb5958(0x294)](_0xbb5958(0x242)+_0x2dd7ab['key']+_0xbb5958(0x185)+_0x2dd7ab['projectName']+'\x27'),(_0x434d78[_0xbb5958(0x1d2)]||_0x434d78[_0xbb5958(0x1ae)])&&await handleSingleObjectOutput(_0x2dd7ab,_0x434d78),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a38_0x3e0780(0x170)]=a38_0x3e0780(0x1b3);[a38_0x3e0780(0x1f5)]=a38_0x3e0780(0x224);async[a38_0x3e0780(0x21b)](_0x7380d0){const _0x144590=a38_0x3e0780,{options:_0x2f219f,args:_0x35d623,tdx:_0x20bed3}=_0x7380d0;let _0x20d6fa,_0x33c9cd;if(_0x35d623['length']>=0x2)_0x20d6fa=_0x35d623[0x0],_0x33c9cd=_0x35d623[0x1];else{if(_0x35d623[_0x144590(0x239)]===0x1&&_0x2f219f[_0x144590(0x23a)])_0x20d6fa=_0x2f219f[_0x144590(0x23a)],_0x33c9cd=_0x35d623[0x0];else return _0x35d623[_0x144590(0x239)]===0x1?(console['error'](_0x144590(0x1e7)),console[_0x144590(0x294)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x144590(0x294)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0x144590(0x294)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x2f219f[_0x144590(0x244)]&&(console[_0x144590(0x294)](_0x144590(0x184)+_0x20d6fa),console[_0x144590(0x294)]('Key:\x20'+_0x33c9cd));if(!_0x2f219f[_0x144590(0x264)]){const _0x458c46=await confirmKey(_0x144590(0x25d)+_0x33c9cd+'\x27\x20from\x20project\x20\x27'+_0x20d6fa+'\x27?');if(!_0x458c46)return console['error'](_0x144590(0x250)),0x0;}const _0x53438d=await withSpinner('Deleting\x20secret...',()=>_0x20bed3[_0x144590(0x27f)][_0x144590(0x26d)](_0x20d6fa,_0x33c9cd),{'verbose':_0x2f219f['verbose']}),_0x5ca577=_0x53438d[_0x144590(0x245)];return console['error'](_0x144590(0x242)+_0x5ca577[_0x144590(0x1b5)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x5ca577['projectName']+'\x27'),(_0x2f219f[_0x144590(0x1d2)]||_0x2f219f[_0x144590(0x1ae)])&&await handleSingleObjectOutput(_0x5ca577,_0x2f219f),0x0;}}
1
+ const a38_0x5464e8=a38_0x1d36;(function(_0x5defce,_0x4aa9f3){const _0xb2e61a=a38_0x1d36,_0x20f1b5=_0x5defce();while(!![]){try{const _0x3857c8=-parseInt(_0xb2e61a(0x172))/0x1*(parseInt(_0xb2e61a(0x268))/0x2)+parseInt(_0xb2e61a(0x1a6))/0x3+parseInt(_0xb2e61a(0x18a))/0x4+parseInt(_0xb2e61a(0x1e8))/0x5+parseInt(_0xb2e61a(0x19f))/0x6*(-parseInt(_0xb2e61a(0x1ae))/0x7)+-parseInt(_0xb2e61a(0x22c))/0x8*(parseInt(_0xb2e61a(0x19a))/0x9)+-parseInt(_0xb2e61a(0x242))/0xa*(-parseInt(_0xb2e61a(0x1dd))/0xb);if(_0x3857c8===_0x4aa9f3)break;else _0x20f1b5['push'](_0x20f1b5['shift']());}catch(_0x33dfb0){_0x20f1b5['push'](_0x20f1b5['shift']());}}}(a38_0x251d,0xd9943));import a38_0x1d49f6 from'chalk';import{existsSync}from'fs';import a38_0x5693a7 from'path';import{BaseCommand}from'./command.js';function a38_0x251d(){const _0x41f362=['\x20\x20Files\x20extracted:\x20','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','\x0aApply\x20these\x20changes?','kill','workflowProject','✔\x20Retry\x20started','resolveProject','Task\x20name:\x20','Files\x20to\x20upload:\x20','delete','\x20\x20Session\x20context\x20set\x20to:\x20','\x20\x20New\x20attempt\x20ID:\x20','cyan','format','workflow:tasks','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','No\x20sessions\x20found\x20in\x20project:\x20','readFile','workflow:secrets:set','Start\x20a\x20workflow\x20run','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x20workflow','resolveProjectDir','📁\x20','projectName','workflows','Include\x20retried:\x20yes','Including\x20subtasks:\x20yes','error','Source\x20project:\x20','execute','✔\x20Project\x20updated','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','isArray','attempt:','workflow:kill','Key\x20cannot\x20be\x20empty','applyPullProject','Pushing\x20workflow\x20project...','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','success','New\x20project\x20name:\x20','retryAttemptName','description','executeCloneProject','\x20session','\x20\x20Target:\x20','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Force:\x20yes','Validation:\x20skipped','includes','task','\x20secret','\x22\x20to\x20new\x20project\x20\x22','workflow:download','Show\x20specific\x20attempt\x20details','Pushing\x20project...','✔\x20Clone\x20complete','existingProjectId','diff','Usage:\x20tdx\x20wf\x20use\x20<project>','2LKIjfO','workflow:retry','Updating\x20','Parameters:\x20','\x20\x20Project:\x20','Fetching\x20log\x20files...','join','includeRetried','\x0aClone\x20\x22','revision:\x20','\x0aUpdate\x20existing\x20project\x20\x22','No\x20workflows\x20found\x20in\x20project:\x20','Source\x20directory\x20is\x20required','deleted','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','requireProject','isDirectory','\x20is\x20not\x20a\x20directory','canceling','Cloning\x20to\x20','new','params','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','workflow:use','7087860wuvQEA','some','Target\x20directory:\x20','sessionTime','workflow:secrets:list','Getting\x20attempt\x20details...','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','session','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Listing\x20workflow\x20sessions...','No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x22\x20already\x20exists\x20(ID:\x20','logFiles','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','attempt','\x20deleted','37593nqBhlF','running','Error:\x20Attempt\x20ID\x20is\x20required','session:','setSecret','6MHiyXP','site','Listing\x20workflow\x20projects...','Error:','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','session_id','retrySession','13641rMgRbK','newProjectId','retryAttempt','dryRun','Source\x20directory:\x20','Resolving\x20project\x20\x27','Params:\x20','✔\x20Project:\x20','3768205miINlP','message','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','projects','workflow:upload','Tip:\x20cd\x20to\x20workflows/','map','workflow:clone','localeCompare','cancelRequested','\x20modified','Deleting\x20secret...','list','\x22?\x20This\x20cannot\x20be\x20undone.','Listing\x20secrets...','status','\x0aDry\x20run\x20-\x20no\x20files\x20written','summary','fromTask','select','Error:\x20Invalid\x20parameter\x20format:\x20','No\x20workflow\x20tdx.json\x20found','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Cancelled','Attempt\x20ID:\x20','List\x20workflow\x20attempts','deleteSecret','Filter:\x20','Project\x20name\x20is\x20required','Starting\x20workflow\x20run...','newProjectName','---\x20','modified','projectId','Dry\x20run:\x20yes','Setting\x20secret...','project','workflow:pull','\x20\x20Session\x20ID:\x20','\x20attempt','taskName','resolveProjectId','\x20\x20Workflow:\x20','Retry\x20a\x20session\x20or\x20attempt','✔\x20Deleted\x20project\x20','fileCount','No\x20attempts\x20found\x20for:\x20','6010301lobslK','logs','No\x20log\x20content\x20found','workflow:push','Reason:\x20','data','sessions','Pattern:\x20','parse','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','workflow:attempt','505800mEylWk','from','Workflow:\x20','attemptId','\x0a⚠\x20Project\x20\x22','unchanged','sourceProjectName','log','json','No\x20attempts\x20found\x20in\x20project:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','jsonl','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','hasChanges','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','workflow:attempts','Writing\x20files...','cwd','No\x20sessions\x20found\x20for:\x20','key','Analyzing\x20project...','changes','\x0a✔\x20Already\x20up\x20to\x20date','\x20\x20Changes:\x20','\x27...','\x20\x20Source:\x20','limit','Kill\x20a\x20running\x20attempt','Target:\x20','preparePushProject','List\x20workflow\x20execution\x20sessions','\x20(use\x20--limit\x20to\x20show\x20more)','No\x20sessions\x20found','sourceDir','length','Revision:\x20','/attempt/','✔\x20Pull\x20complete','\x20new','revision','Error:\x20KEY=VALUE\x20is\x20required','skipValidation','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','parseProjectWorkflowPattern','done','sessionId','\x20\x20Location:\x20','isNewProject','green','✔\x20Found\x20','List\x20workflows','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','createdAt','yes','run','includeSubtasks','.\x20Expected\x20format:\x20KEY=VALUE','✔\x20Workflow\x20run\x20started','workflow:projects','finishedAt','From\x20task:\x20','Key:\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','lastAttempt','Error:\x20','workflow:sessions','\x20\x20Project\x20ID:\x20','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','1112HRihpk','\x20(system)','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','workflow','keys','No\x20projects\x20match\x20pattern:\x20','startsWith','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Listing\x20workflow\x20attempts...','\x27\x20from\x20project\x20\x27','Downloading\x20project\x20','trimEnd','round','✔\x20Downloaded\x20','Project\x20directory:\x20','filesExtracted','Deleting\x20project\x20','verbose','red','\x20unchanged','Select\x20a\x20task\x20to\x20view\x20logs:','type','10jmnrfu','indexOf','\x0aDry\x20run\x20-\x20no\x20project\x20created','Output\x20directory:\x20','showWorkflowConsoleUrl','\x22\x20with\x20new\x20revision?','reason','basename','No\x20attempts\x20found','Loading\x20workflows...','Getting\x20attempt\x20tasks...','index','Filter:\x20project=','Error:\x20Project\x20name\x20is\x20required','push','📋\x20','dim','\x20\x20Revision:\x20','Project\x20name:\x20','getTime','Error:\x20Invalid\x20JSON\x20in\x20--params','✔\x20Pushed\x20','stringify','\x20\x20Console:\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','tasks','✔\x20Workflow\x20project\x20context\x20cleared.','Status:\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','\x20task','...','substring','path','workflow:delete','Project\x20filter:\x20','name','List\x20all\x20workflow\x20projects','targetExists','413942XNnesT','workflow:secrets:delete','Project:\x20','Downloading\x20logs...','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','output','yellow','Listing\x20workflows...','No\x20workflows\x20found','relative','Resume\x20from:\x20','workflow:workflows','param','Analyzing\x20changes...','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','✔\x20Push\x20complete','table'];a38_0x251d=function(){return _0x41f362;};return a38_0x251d();}import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a38_0xbf1fde from'prompts';function getAttemptStatusDisplay(_0x451aac){const _0x5c6f1b=a38_0x1d36;if(!_0x451aac)return{'icon':'⏳','text':''};const {done:_0x2f3014,success:_0x4e7a7b,cancelRequested:_0x5c2c46}=_0x451aac;if(!_0x2f3014)return _0x5c2c46?{'icon':'🛑','text':a38_0x1d49f6['yellow']('canceling')}:{'icon':'🔄','text':a38_0x1d49f6['blue'](_0x5c6f1b(0x19b))};if(_0x4e7a7b)return{'icon':'✅','text':a38_0x1d49f6[_0x5c6f1b(0x218)](_0x5c6f1b(0x15d))};return{'icon':'❌','text':a38_0x1d49f6[_0x5c6f1b(0x23e)](_0x5c6f1b(0x295))};}export class WorkflowBaseCommand extends BaseCommand{[a38_0x5464e8(0x27f)](_0x592a9b,_0x5ba167,_0x588afd=0x0){const _0x57509b=a38_0x5464e8;return _0x592a9b[_0x588afd]||_0x5ba167[_0x57509b(0x27d)];}['requireProject'](_0x37e182,_0x2d3485,_0x1f9f3b=0x0){const _0xb6811c=a38_0x5464e8,_0x45779c=this[_0xb6811c(0x27f)](_0x37e182,_0x2d3485,_0x1f9f3b);if(!_0x45779c)return console[_0xb6811c(0x295)](a38_0x1d49f6[_0xb6811c(0x23e)](_0xb6811c(0x1a2)),_0xb6811c(0x1ca)),console[_0xb6811c(0x295)](a38_0x1d49f6[_0xb6811c(0x252)](_0xb6811c(0x1a3))),null;return _0x45779c;}[a38_0x5464e8(0x213)](_0x3a489d,_0x5a9f5d){const _0x664de4=a38_0x5464e8;if(_0x3a489d[0x0]){const _0x3696d9=_0x3a489d[0x0]['split']('.');if(_0x3696d9[_0x664de4(0x20a)]===0x1)return{'projectName':_0x3696d9[0x0],'workflowName':undefined};else return _0x3696d9[_0x664de4(0x20a)]===0x2?{'projectName':_0x3696d9[0x0],'workflowName':_0x3696d9[0x1]}:(console[_0x664de4(0x295)](a38_0x1d49f6[_0x664de4(0x23e)]('Error:'),_0x664de4(0x26c)),null);}return{'projectName':_0x5a9f5d[_0x664de4(0x27d)],'workflowName':undefined};}[a38_0x5464e8(0x28f)](_0x5949f3,_0x16dab9,_0x3d4469=0x0){const _0x44e001=a38_0x5464e8;if(_0x5949f3[_0x3d4469])return _0x5949f3[_0x3d4469];if(_0x16dab9['workflowProject']){const _0x48d555=a38_0x5693a7['join'](process[_0x44e001(0x1f9)](),'workflows',_0x16dab9[_0x44e001(0x27d)]);if(existsSync(a38_0x5693a7[_0x44e001(0x178)](_0x48d555,'tdx.json')))return _0x48d555;}return undefined;}async[a38_0x5464e8(0x246)](_0x5c8625,_0x266447,_0x46dd1d){const _0x2012d5=a38_0x5464e8;try{const _0xe0d010=await _0x5c8625[_0x2012d5(0x22f)][_0x2012d5(0x292)](_0x266447,{'limit':0x1});if(_0xe0d010['length']>0x0){const _0x254a97=_0xe0d010[0x0]['id'],_0x3aa6e9=getWorkflowUrl(_0x46dd1d,_0x254a97);console[_0x2012d5(0x295)](_0x2012d5(0x259)+a38_0x1d49f6['cyan'](_0x3aa6e9));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a38_0x5464e8(0x265)]=a38_0x5464e8(0x189);[a38_0x5464e8(0x160)]=a38_0x5464e8(0x21b);async['execute'](_0x238531){const _0x2baf34=a38_0x5464e8,{options:_0xef1dee,args:_0x42fc36,tdx:_0x54d07a}=_0x238531,_0x1da3c3=_0x42fc36[0x0],_0x3954f4=_0xef1dee['clear'];if(_0x3954f4)return saveSessionContext({'workflow_project':undefined},_0xef1dee[_0x2baf34(0x191)]),console[_0x2baf34(0x1ef)](a38_0x1d49f6[_0x2baf34(0x218)](_0x2baf34(0x25c))),0x0;if(!_0x1da3c3)return console[_0x2baf34(0x295)](a38_0x1d49f6[_0x2baf34(0x23e)](_0x2baf34(0x1a2)),_0x2baf34(0x1ca)),console[_0x2baf34(0x295)](a38_0x1d49f6[_0x2baf34(0x252)](_0x2baf34(0x171))),console[_0x2baf34(0x295)](a38_0x1d49f6['dim'](_0x2baf34(0x15c))),0x1;const _0x27c813=await withSpinner(_0x2baf34(0x1ab)+_0x1da3c3+_0x2baf34(0x200),()=>_0x54d07a[_0x2baf34(0x22f)][_0x2baf34(0x1d7)](_0x1da3c3),{'verbose':_0xef1dee[_0x2baf34(0x23d)]}),{name:_0x37424d}=_0x27c813[_0x2baf34(0x1e2)];return saveSessionContext({'workflow_project':_0x37424d},_0xef1dee['session']),console[_0x2baf34(0x1ef)](a38_0x1d49f6[_0x2baf34(0x218)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a38_0x1d49f6[_0x2baf34(0x285)](_0x37424d))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a38_0x5464e8(0x265)]=a38_0x5464e8(0x222);[a38_0x5464e8(0x160)]=a38_0x5464e8(0x266);async[a38_0x5464e8(0x153)](_0x359581){const _0x30f69c=a38_0x5464e8,{options:_0x2297ea,args:_0x5950c8,tdx:_0x46e92b}=_0x359581,_0x2de53a=_0x5950c8[0x0];_0x2297ea[_0x30f69c(0x23d)]&&_0x2de53a&&console[_0x30f69c(0x295)](_0x30f69c(0x1e4)+_0x2de53a);const _0xb001a2=await withSpinner(_0x30f69c(0x1a1),()=>_0x46e92b['workflow'][_0x30f69c(0x1b1)](_0x2de53a,{'limit':_0x2297ea['limit']}),{'verbose':_0x2297ea[_0x30f69c(0x23d)]});let _0x4239aa=_0xb001a2['data'];_0x4239aa['sort']((_0x519f40,_0x233772)=>_0x519f40[_0x30f69c(0x265)]['localeCompare'](_0x233772[_0x30f69c(0x265)]));const _0xe7adf3=_0x2297ea[_0x30f69c(0x202)]||0x64,_0x1e090c=_0x4239aa[_0x30f69c(0x20a)]>=_0xe7adf3?a38_0x1d49f6['dim'](_0x30f69c(0x207)):'';console[_0x30f69c(0x295)]('✔\x20Found\x20'+_0x4239aa[_0x30f69c(0x20a)]+'\x20project'+(_0x4239aa[_0x30f69c(0x20a)]!==0x1?'s':'')+_0x1e090c);if(_0x2297ea['format']===_0x30f69c(0x1f0)||_0x2297ea[_0x30f69c(0x286)]===_0x30f69c(0x1f3)||_0x2297ea[_0x30f69c(0x286)]===_0x30f69c(0x278))await handleSDKOutput(_0x4239aa,_0x2297ea);else{if(_0x4239aa[_0x30f69c(0x20a)]===0x0)_0x2de53a?console[_0x30f69c(0x1ef)](_0x30f69c(0x231)+_0x2de53a):console[_0x30f69c(0x1ef)]('No\x20workflow\x20projects\x20found');else{const _0x458397=_0x4239aa[_0x30f69c(0x1b4)](_0x20c655=>{const _0x153308=_0x30f69c,_0xb15462=_0x20c655['metadata']?.[_0x153308(0x18b)](_0x2c97fb=>_0x2c97fb[_0x153308(0x1fb)]==='sys'),_0x5491be=_0xb15462?a38_0x1d49f6[_0x153308(0x252)](_0x153308(0x22d)):'';return _0x153308(0x290)+_0x20c655[_0x153308(0x265)]+_0x5491be;});await writeOutput(_0x458397['join']('\x0a'),_0x2297ea[_0x30f69c(0x26d)],_0x30f69c(0x1ba));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a38_0x5464e8(0x265)]=a38_0x5464e8(0x273);[a38_0x5464e8(0x160)]=a38_0x5464e8(0x21a);async[a38_0x5464e8(0x153)](_0x16e1d4){const _0x1c9406=a38_0x5464e8,{options:_0x2d3c5c,args:_0x27c688,tdx:_0x31ddc2}=_0x16e1d4,_0x274315=this['resolveProject'](_0x27c688,_0x2d3c5c);_0x2d3c5c[_0x1c9406(0x23d)]&&_0x274315&&console['error'](_0x1c9406(0x264)+_0x274315);const _0x1eec83=await withSpinner(_0x1c9406(0x26f),()=>_0x31ddc2[_0x1c9406(0x22f)][_0x1c9406(0x292)](_0x274315,{'limit':_0x2d3c5c[_0x1c9406(0x202)]}),{'verbose':_0x2d3c5c['verbose']});let _0x3aba95=_0x1eec83[_0x1c9406(0x1e2)];_0x3aba95['sort']((_0x5d3105,_0x4e437d)=>{const _0x5e2fa5=_0x1c9406,_0x2b779e=_0x5d3105['name'][_0x5e2fa5(0x1b6)](_0x4e437d[_0x5e2fa5(0x265)]);if(_0x2b779e!==0x0)return _0x2b779e;return(_0x5d3105['project']?.['name']||'')[_0x5e2fa5(0x1b6)](_0x4e437d[_0x5e2fa5(0x1d2)]?.[_0x5e2fa5(0x265)]||'');});const _0x160cb6=_0x2d3c5c[_0x1c9406(0x202)]||0x64,_0x5ea20e=_0x3aba95[_0x1c9406(0x20a)]>=_0x160cb6?a38_0x1d49f6[_0x1c9406(0x252)](_0x1c9406(0x207)):'';console[_0x1c9406(0x295)](_0x1c9406(0x219)+_0x3aba95[_0x1c9406(0x20a)]+_0x1c9406(0x28e)+(_0x3aba95[_0x1c9406(0x20a)]!==0x1?'s':'')+_0x5ea20e);if(_0x2d3c5c[_0x1c9406(0x286)]===_0x1c9406(0x1f0)||_0x2d3c5c[_0x1c9406(0x286)]===_0x1c9406(0x1f3)||_0x2d3c5c['format']==='table')await handleSDKOutput(_0x3aba95,_0x2d3c5c);else{if(_0x3aba95[_0x1c9406(0x20a)]===0x0)_0x274315?console[_0x1c9406(0x1ef)](_0x1c9406(0x17d)+_0x274315):console[_0x1c9406(0x1ef)](_0x1c9406(0x270));else{const _0x44bd61=_0x2d3c5c[_0x1c9406(0x1a0)],_0x16365b=_0x3aba95['map'](_0x1dc228=>{const _0x3701f5=_0x1c9406,_0x2b3883=a38_0x1d49f6[_0x3701f5(0x252)]('#'+_0x1dc228['id']),_0x14fcb1=hyperlink(_0x2b3883,getWorkflowUrl(_0x44bd61,_0x1dc228['id'])),_0x3b905a=_0x1dc228[_0x3701f5(0x1d2)]?.[_0x3701f5(0x265)]?a38_0x1d49f6[_0x3701f5(0x252)]('\x20('+_0x1dc228[_0x3701f5(0x1d2)][_0x3701f5(0x265)]+')'):'';return _0x3701f5(0x251)+_0x14fcb1+'\x20'+_0x1dc228[_0x3701f5(0x265)]+_0x3b905a;});await writeOutput(_0x16365b['join']('\x0a'),_0x2d3c5c[_0x1c9406(0x26d)],_0x1c9406(0x1ba));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a38_0x5464e8(0x265)]=a38_0x5464e8(0x229);[a38_0x5464e8(0x160)]=a38_0x5464e8(0x206);async[a38_0x5464e8(0x153)](_0x1b7c74){const _0x4998c6=a38_0x5464e8,{options:_0x54c8fb,args:_0x158cd2,tdx:_0x22411a}=_0x1b7c74,_0x16c461=this[_0x4998c6(0x213)](_0x158cd2,_0x54c8fb);if(!_0x16c461)return 0x1;const {projectName:_0x3a9a68,workflowName:_0x21b201}=_0x16c461;if(_0x54c8fb[_0x4998c6(0x23d)]){if(_0x3a9a68&&_0x21b201)console[_0x4998c6(0x295)](_0x4998c6(0x1c9)+_0x3a9a68+'.'+_0x21b201);else _0x3a9a68&&console['error'](_0x4998c6(0x24e)+_0x3a9a68);const _0x12bc8f=_0x54c8fb[_0x4998c6(0x1bd)];_0x12bc8f&&console['error'](_0x4998c6(0x25d)+_0x12bc8f);}const _0x579304=await withSpinner(_0x4998c6(0x193),()=>_0x22411a[_0x4998c6(0x22f)][_0x4998c6(0x1e3)]({'projectName':_0x3a9a68,'workflowName':_0x21b201,'status':_0x54c8fb['status'],'fromTime':_0x54c8fb[_0x4998c6(0x1e9)],'toTime':_0x54c8fb['to'],'limit':_0x54c8fb[_0x4998c6(0x202)]}),{'verbose':_0x54c8fb[_0x4998c6(0x23d)]}),_0x5264e1=_0x579304['data'];_0x5264e1['sort']((_0x1665eb,_0x1add70)=>{const _0x1edba4=_0x4998c6,_0x1021a2=_0x1665eb[_0x1edba4(0x18d)]||'',_0xca4da3=_0x1add70[_0x1edba4(0x18d)]||'';return _0xca4da3['localeCompare'](_0x1021a2);});const _0x3776a1=_0x54c8fb[_0x4998c6(0x202)]||0x64,_0x23042a=_0x5264e1['length']>=_0x3776a1?a38_0x1d49f6['dim'](_0x4998c6(0x207)):'';console[_0x4998c6(0x295)](_0x4998c6(0x219)+_0x5264e1[_0x4998c6(0x20a)]+_0x4998c6(0x162)+(_0x5264e1['length']!==0x1?'s':'')+_0x23042a);if(_0x54c8fb['format']==='json'||_0x54c8fb[_0x4998c6(0x286)]===_0x4998c6(0x1f3)||_0x54c8fb['format']==='table')await handleSDKOutput(_0x5264e1,_0x54c8fb);else{if(_0x5264e1[_0x4998c6(0x20a)]===0x0){if(_0x3a9a68&&_0x21b201)console[_0x4998c6(0x1ef)](_0x4998c6(0x1fa)+_0x3a9a68+'.'+_0x21b201);else _0x3a9a68?console[_0x4998c6(0x1ef)](_0x4998c6(0x289)+_0x3a9a68):console['log'](_0x4998c6(0x208));}else{const _0x1ad9e3=_0x54c8fb['site'],_0x36aa61=_0x5264e1['map'](_0x6c5502=>{const _0x34af35=_0x4998c6,_0x391e4b=a38_0x1d49f6[_0x34af35(0x252)]('#'+_0x6c5502['id']),_0x3fbbc3=_0x6c5502['project']?.['id'],_0x144f3f=_0x3fbbc3?hyperlink(_0x391e4b,getWorkflowSessionUrl(_0x1ad9e3,_0x3fbbc3,_0x6c5502['id'])):_0x391e4b,{icon:_0x185cc0,text:_0xcd1826}=getAttemptStatusDisplay(_0x6c5502[_0x34af35(0x227)]),_0x123b97=(_0x6c5502[_0x34af35(0x1d2)]?.[_0x34af35(0x265)]||'?')+'.'+(_0x6c5502['workflow']?.[_0x34af35(0x265)]||'?'),_0x6b6f35=_0x6c5502[_0x34af35(0x18d)]?a38_0x1d49f6[_0x34af35(0x252)](_0x6c5502[_0x34af35(0x18d)]):'';return(_0x144f3f+'\x20'+_0x185cc0+(_0xcd1826?'\x20'+_0xcd1826:'')+'\x20'+_0x123b97+'\x20'+_0x6b6f35)[_0x34af35(0x237)]();});await writeOutput(_0x36aa61['join']('\x0a'),_0x54c8fb[_0x4998c6(0x26d)],_0x4998c6(0x1ba));}}return 0x0;}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a38_0x5464e8(0x265)]=a38_0x5464e8(0x1f7);[a38_0x5464e8(0x160)]=a38_0x5464e8(0x1c7);async[a38_0x5464e8(0x153)](_0x4df893){const _0x4a3393=a38_0x5464e8,{options:_0x42ad3b,args:_0x1bd2d9,tdx:_0x413ebb}=_0x4df893,_0x56f8e9=this[_0x4a3393(0x213)](_0x1bd2d9,_0x42ad3b);if(!_0x56f8e9)return 0x1;const {projectName:_0x54e17d,workflowName:_0x358b57}=_0x56f8e9,_0x5d8577=_0x42ad3b[_0x4a3393(0x179)];if(_0x42ad3b[_0x4a3393(0x23d)]){if(_0x54e17d&&_0x358b57)console[_0x4a3393(0x295)](_0x4a3393(0x1c9)+_0x54e17d+'.'+_0x358b57);else _0x54e17d&&console[_0x4a3393(0x295)](_0x4a3393(0x24e)+_0x54e17d);_0x5d8577&&console['error'](_0x4a3393(0x293));}const _0x192eef=await withSpinner(_0x4a3393(0x234),()=>_0x413ebb['workflow']['attempts']({'projectName':_0x54e17d,'workflowName':_0x358b57,'includeRetried':_0x5d8577,'limit':_0x42ad3b[_0x4a3393(0x202)]}),{'verbose':_0x42ad3b[_0x4a3393(0x23d)]}),_0x16d942=_0x192eef[_0x4a3393(0x1e2)],_0x49b271=_0x42ad3b[_0x4a3393(0x202)]||0x64,_0x341f8c=_0x16d942['length']>=_0x49b271?a38_0x1d49f6[_0x4a3393(0x252)](_0x4a3393(0x207)):'';console[_0x4a3393(0x295)](_0x4a3393(0x219)+_0x16d942[_0x4a3393(0x20a)]+_0x4a3393(0x1d5)+(_0x16d942['length']!==0x1?'s':'')+_0x341f8c);if(_0x42ad3b[_0x4a3393(0x286)]===_0x4a3393(0x1f0)||_0x42ad3b[_0x4a3393(0x286)]==='jsonl'||_0x42ad3b[_0x4a3393(0x286)]===_0x4a3393(0x278))await handleSDKOutput(_0x16d942,_0x42ad3b);else{if(_0x16d942[_0x4a3393(0x20a)]===0x0){if(_0x54e17d&&_0x358b57)console[_0x4a3393(0x1ef)](_0x4a3393(0x1dc)+_0x54e17d+'.'+_0x358b57);else _0x54e17d?console[_0x4a3393(0x1ef)](_0x4a3393(0x1f1)+_0x54e17d):console[_0x4a3393(0x1ef)](_0x4a3393(0x24a));}else{const _0x4c76ee=_0x42ad3b['site'],_0x4e99e5=_0x16d942[_0x4a3393(0x1b4)](_0x37b290=>{const _0x34cfad=_0x4a3393,_0x427c6c=a38_0x1d49f6['dim']('#'+_0x37b290['id']),_0x3122b7=_0x37b290['project']?.['id'],_0x4edddc=_0x37b290[_0x34cfad(0x1a4)]||_0x37b290[_0x34cfad(0x215)],_0x3091d4=_0x3122b7&&_0x4edddc?hyperlink(_0x427c6c,getWorkflowAttemptUrl(_0x4c76ee,_0x3122b7,_0x4edddc,_0x37b290['id'])):_0x427c6c,{icon:_0x2eae23,text:_0x43ffbd}=getAttemptStatusDisplay(_0x37b290),_0x4223b2=(_0x37b290[_0x34cfad(0x1d2)]?.[_0x34cfad(0x265)]||'?')+'.'+(_0x37b290[_0x34cfad(0x22f)]?.[_0x34cfad(0x265)]||'?'),_0x5212bf=_0x37b290['sessionTime']?a38_0x1d49f6['dim'](_0x37b290[_0x34cfad(0x18d)]):'';return(_0x3091d4+'\x20'+_0x2eae23+(_0x43ffbd?'\x20'+_0x43ffbd:'')+'\x20'+_0x4223b2+'\x20'+_0x5212bf)[_0x34cfad(0x237)]();});await writeOutput(_0x4e99e5[_0x4a3393(0x178)]('\x0a'),_0x42ad3b[_0x4a3393(0x26d)],_0x4a3393(0x1ba));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a38_0x5464e8(0x1e7);[a38_0x5464e8(0x160)]=a38_0x5464e8(0x16c);async[a38_0x5464e8(0x153)](_0x5bc8e2){const _0x1c5916=a38_0x5464e8,{options:_0x476ef9,args:_0x4df6d7,tdx:_0x31765f}=_0x5bc8e2,_0x590ec7=_0x4df6d7[0x0];if(!_0x590ec7)return console[_0x1c5916(0x295)](_0x1c5916(0x19c)),0x1;_0x476ef9[_0x1c5916(0x23d)]&&console[_0x1c5916(0x295)](_0x1c5916(0x1c6)+_0x590ec7);const _0x26cf8b=await withSpinner(_0x1c5916(0x18f),()=>_0x31765f[_0x1c5916(0x22f)][_0x1c5916(0x198)](_0x590ec7),{'verbose':_0x476ef9[_0x1c5916(0x23d)]}),_0x4fd400=_0x26cf8b[_0x1c5916(0x1e2)];let _0xe28ce4;!_0x4fd400[_0x1c5916(0x214)]?_0xe28ce4=_0x4fd400[_0x1c5916(0x1b7)]?_0x1c5916(0x184):_0x1c5916(0x19b):_0xe28ce4=_0x4fd400['success']?_0x1c5916(0x15d):_0x1c5916(0x295);let _0x5ccb72;if(_0x4fd400[_0x1c5916(0x21c)]&&_0x4fd400['finishedAt']){const _0x949ad=new Date(_0x4fd400[_0x1c5916(0x21c)])[_0x1c5916(0x255)](),_0x1be2bf=new Date(_0x4fd400[_0x1c5916(0x223)])[_0x1c5916(0x255)]();_0x5ccb72=Math[_0x1c5916(0x238)]((_0x1be2bf-_0x949ad)/0x3e8);}const _0x574d0a={'attempt_id':_0x4fd400['id'],'status':_0xe28ce4,..._0x4fd400[_0x1c5916(0x24d)]!==undefined&&{'index':_0x4fd400[_0x1c5916(0x24d)]},..._0x4fd400[_0x1c5916(0x1d2)]&&{'project':_0x4fd400[_0x1c5916(0x1d2)]['name']},..._0x4fd400[_0x1c5916(0x22f)]&&{'workflow':_0x4fd400['workflow'][_0x1c5916(0x265)]},..._0x4fd400[_0x1c5916(0x215)]&&{'session_id':_0x4fd400[_0x1c5916(0x215)]},..._0x4fd400[_0x1c5916(0x18d)]&&{'session_time':_0x4fd400[_0x1c5916(0x18d)]},..._0x4fd400[_0x1c5916(0x15f)]&&{'retry_attempt':_0x4fd400[_0x1c5916(0x15f)]},..._0x5ccb72!==undefined&&{'duration_sec':_0x5ccb72},..._0x4fd400['createdAt']&&{'created_at':_0x4fd400[_0x1c5916(0x21c)]},..._0x4fd400[_0x1c5916(0x223)]&&{'finished_at':_0x4fd400[_0x1c5916(0x223)]},...Object[_0x1c5916(0x230)](_0x4fd400[_0x1c5916(0x187)])[_0x1c5916(0x20a)]>0x0&&{'params':_0x4fd400[_0x1c5916(0x187)]}};return await handleSingleObjectOutput(_0x574d0a,_0x476ef9),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a38_0x5464e8(0x265)]=a38_0x5464e8(0x287);['description']='Show\x20tasks\x20for\x20an\x20attempt';async[a38_0x5464e8(0x153)](_0x31edea){const _0x511a99=a38_0x5464e8,{options:_0x522784,args:_0x27e2b5,tdx:_0x57e4ac}=_0x31edea,_0x21c1e0=_0x27e2b5[0x0];if(!_0x21c1e0)return console['error'](_0x511a99(0x19c)),0x1;const _0x25835c=_0x522784[_0x511a99(0x21f)];_0x522784['verbose']&&(console[_0x511a99(0x295)](_0x511a99(0x1c6)+_0x21c1e0),_0x25835c&&console[_0x511a99(0x295)](_0x511a99(0x294)));const _0x541665=await withSpinner(_0x511a99(0x24c),()=>_0x57e4ac[_0x511a99(0x22f)][_0x511a99(0x25b)](_0x21c1e0,_0x25835c||![]),{'verbose':_0x522784[_0x511a99(0x23d)]}),_0xbd7089=_0x541665['data'];return console[_0x511a99(0x295)](_0x511a99(0x219)+_0xbd7089['length']+_0x511a99(0x25f)+(_0xbd7089[_0x511a99(0x20a)]!==0x1?'s':'')),await handleSDKOutput(_0xbd7089,_0x522784),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']='workflow:logs';['description']='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a38_0x5464e8(0x153)](_0x42d75a){const _0x5e4491=a38_0x5464e8,{options:_0x900b3b,args:_0xdc4fb6,tdx:_0x459471}=_0x42d75a,_0x4de6ed=_0xdc4fb6[0x0];let _0x270427=_0xdc4fb6[0x1];if(!_0x4de6ed)return console[_0x5e4491(0x295)](_0x5e4491(0x19c)),0x1;_0x900b3b[_0x5e4491(0x23d)]&&(console[_0x5e4491(0x295)](_0x5e4491(0x1c6)+_0x4de6ed),_0x270427&&console[_0x5e4491(0x295)](_0x5e4491(0x280)+_0x270427));const _0x2e039f=await withSpinner(_0x5e4491(0x177),()=>_0x459471[_0x5e4491(0x22f)][_0x5e4491(0x196)](_0x4de6ed,_0x270427),{'verbose':_0x900b3b[_0x5e4491(0x23d)]}),_0x14c780=_0x2e039f[_0x5e4491(0x1e2)];if(_0x14c780[_0x5e4491(0x20a)]===0x0)return console[_0x5e4491(0x295)](_0x5e4491(0x194)),0x0;if(!_0x270427&&(_0x900b3b['json']||_0x900b3b[_0x5e4491(0x286)]))return await handleSDKOutput(_0x14c780,_0x900b3b),0x0;if(!_0x270427){const _0x28f055=_0x14c780[_0x5e4491(0x1b4)](_0x345bf6=>({'title':_0x345bf6[_0x5e4491(0x1d6)]+'\x20('+formatBytes(_0x345bf6['fileSize'])+')','value':_0x345bf6['taskName']})),_0x5bf196=await a38_0xbf1fde({'type':'select','name':'task','message':_0x5e4491(0x240),'choices':_0x28f055});if(!_0x5bf196[_0x5e4491(0x168)])return console[_0x5e4491(0x295)](_0x5e4491(0x1c5)),0x0;_0x270427=_0x5bf196['task'];}const _0x308f0e=await withSpinner(_0x5e4491(0x26b),()=>_0x459471['workflow'][_0x5e4491(0x1de)](_0x4de6ed,_0x270427),{'verbose':_0x900b3b[_0x5e4491(0x23d)]}),_0x5eabae=_0x308f0e['data'];return _0x5eabae?console[_0x5e4491(0x1ef)](_0x5eabae):console['error'](_0x5e4491(0x1df)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a38_0x5464e8(0x158);[a38_0x5464e8(0x160)]=a38_0x5464e8(0x203);async[a38_0x5464e8(0x153)](_0xf56ae7){const _0x53446d=a38_0x5464e8,{options:_0x27c88f,args:_0x1e4a2c,tdx:_0x35889e}=_0xf56ae7,_0x42ad6e=_0x1e4a2c[0x0];if(!_0x42ad6e)return console[_0x53446d(0x295)](_0x53446d(0x19c)),0x1;const _0x564d57=_0x27c88f[_0x53446d(0x248)];_0x27c88f[_0x53446d(0x23d)]&&(console[_0x53446d(0x295)](_0x53446d(0x1c6)+_0x42ad6e),_0x564d57&&console[_0x53446d(0x295)](_0x53446d(0x1e1)+_0x564d57));if(!_0x27c88f[_0x53446d(0x21d)]){const _0x25cae6=await confirmKey(_0x53446d(0x197)+_0x42ad6e+'?');if(!_0x25cae6)return console['error'](_0x53446d(0x1c5)),0x0;}const _0x423d07=await withSpinner('Killing\x20attempt...',()=>_0x35889e[_0x53446d(0x22f)][_0x53446d(0x27c)](_0x42ad6e,_0x564d57),{'verbose':_0x27c88f[_0x53446d(0x23d)]}),_0x25b9e6=_0x423d07[_0x53446d(0x1e2)];return console[_0x53446d(0x295)]('✔\x20'+_0x25b9e6),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a38_0x5464e8(0x265)]=a38_0x5464e8(0x173);[a38_0x5464e8(0x160)]=a38_0x5464e8(0x1d9);async[a38_0x5464e8(0x153)](_0x3a591d){const _0x337f65=a38_0x5464e8,{options:_0x1a50bb,args:_0x50959f,tdx:_0x59b292}=_0x3a591d,_0x3d69c5=_0x50959f[0x0];if(!_0x3d69c5)return console['error'](_0x337f65(0x226)),console[_0x337f65(0x295)](_0x337f65(0x1e6)),0x1;let _0x5f08c8=![],_0xeac479=_0x3d69c5;if(_0x3d69c5[_0x337f65(0x232)](_0x337f65(0x19d)))_0x5f08c8=!![],_0xeac479=_0x3d69c5[_0x337f65(0x261)](0x8);else{if(_0x3d69c5[_0x337f65(0x232)](_0x337f65(0x157)))_0x5f08c8=![],_0xeac479=_0x3d69c5['substring'](0x8);else return console[_0x337f65(0x295)](_0x337f65(0x233)),console['error'](_0x337f65(0x1e6)),0x1;}const _0x486c48=_0x1a50bb[_0x337f65(0x1c0)],_0x43ba99=_0x1a50bb['resumeFrom'],_0x10eca6=_0x1a50bb[_0x337f65(0x187)],_0x31b90a=_0x1a50bb['force'];_0x1a50bb[_0x337f65(0x23d)]&&(console[_0x337f65(0x295)](_0x337f65(0x204)+(_0x5f08c8?_0x337f65(0x191):_0x337f65(0x198))+'\x20'+_0xeac479),_0x486c48&&console[_0x337f65(0x295)](_0x337f65(0x224)+_0x486c48),_0x43ba99&&console[_0x337f65(0x295)](_0x337f65(0x272)+_0x43ba99),_0x10eca6&&console['error'](_0x337f65(0x1ac)+_0x10eca6),_0x31b90a&&console[_0x337f65(0x295)](_0x337f65(0x165)));let _0x2c1e5c;if(_0x10eca6)try{if(_0x10eca6[_0x337f65(0x232)]('@')){const _0x1b7e28=await import('fs/promises'),_0x474471=_0x10eca6[_0x337f65(0x261)](0x1),_0x661f10=await _0x1b7e28[_0x337f65(0x28a)](_0x474471,'utf-8');_0x2c1e5c=JSON[_0x337f65(0x1e5)](_0x661f10);}else _0x2c1e5c=JSON[_0x337f65(0x1e5)](_0x10eca6);}catch{return console[_0x337f65(0x295)](_0x337f65(0x256)),0x1;}if(!_0x1a50bb[_0x337f65(0x21d)]){const _0xbd3530=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x5f08c8?_0x337f65(0x191):'attempt')+'\x20'+_0xeac479+'?');if(!_0xbd3530)return console[_0x337f65(0x295)](_0x337f65(0x1c5)),0x0;}let _0x2ede86;_0x5f08c8?_0x2ede86=await withSpinner('Retrying\x20session...',()=>_0x59b292[_0x337f65(0x22f)][_0x337f65(0x1a5)](_0xeac479,{'fromTask':_0x486c48,'retryParams':_0x2c1e5c}),{'verbose':_0x1a50bb[_0x337f65(0x23d)]}):_0x2ede86=await withSpinner('Retrying\x20attempt...',()=>_0x59b292[_0x337f65(0x22f)][_0x337f65(0x1a8)](_0xeac479,{'resumeFrom':_0x43ba99,'retryParams':_0x2c1e5c,'force':_0x31b90a}),{'verbose':_0x1a50bb['verbose']});const _0x107f16=_0x2ede86[_0x337f65(0x1e2)];return console[_0x337f65(0x295)](_0x337f65(0x27e)),console['error'](_0x337f65(0x284)+_0x107f16[_0x337f65(0x1eb)]),console['error'](_0x337f65(0x1d4)+_0x107f16[_0x337f65(0x215)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a38_0x5464e8(0x265)]='workflow:run';['description']=a38_0x5464e8(0x28c);async['execute'](_0x422b3f){const _0x3185d5=a38_0x5464e8,{options:_0x15f5b4,args:_0x18b21f,tdx:_0x453c5e}=_0x422b3f;let _0x137256=_0x18b21f[0x0];if(!_0x137256){const _0x317ccd=this[_0x3185d5(0x27f)]([],_0x15f5b4),_0x2d312a=await withSpinner(_0x3185d5(0x24b),()=>_0x453c5e[_0x3185d5(0x22f)][_0x3185d5(0x292)](_0x317ccd,{'limit':_0x15f5b4['limit']}),{'verbose':_0x15f5b4[_0x3185d5(0x23d)]}),_0x50a0f2=_0x2d312a['data'];if(_0x50a0f2['length']===0x0)return console['error'](_0x3185d5(0x270)),!_0x317ccd&&console[_0x3185d5(0x295)](a38_0x1d49f6[_0x3185d5(0x252)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x5730d3=_0x50a0f2['map'](_0x4c92fb=>({'title':_0x4c92fb[_0x3185d5(0x1d2)]?.['name']+'.'+_0x4c92fb[_0x3185d5(0x265)],'value':_0x4c92fb[_0x3185d5(0x1d2)]?.[_0x3185d5(0x265)]+'.'+_0x4c92fb[_0x3185d5(0x265)],'description':_0x4c92fb[_0x3185d5(0x20f)]?_0x3185d5(0x17b)+_0x4c92fb[_0x3185d5(0x20f)]:undefined})),_0x5574a4=await a38_0xbf1fde({'type':_0x3185d5(0x1c1),'name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x5730d3});if(!_0x5574a4[_0x3185d5(0x22f)])return 0x1;_0x137256=_0x5574a4[_0x3185d5(0x22f)];}if(!_0x137256[_0x3185d5(0x167)]('.')){const _0x4ce2ec=this['resolveProject']([],_0x15f5b4);if(_0x4ce2ec)_0x137256=_0x4ce2ec+'.'+_0x137256;else return console[_0x3185d5(0x295)](a38_0x1d49f6[_0x3185d5(0x23e)](_0x3185d5(0x1a2)),_0x3185d5(0x212)),console['error'](a38_0x1d49f6[_0x3185d5(0x252)](_0x3185d5(0x1a3))),0x1;}const _0x261fff=_0x15f5b4[_0x3185d5(0x274)],_0x5302d5=_0x15f5b4[_0x3185d5(0x18d)],_0x11b544={};if(_0x261fff&&Array[_0x3185d5(0x156)](_0x261fff))for(const _0x5b9091 of _0x261fff){const _0xe79f52=_0x5b9091[_0x3185d5(0x243)]('=');if(_0xe79f52===-0x1)return console['error'](_0x3185d5(0x1c2)+_0x5b9091),console['error']('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x59a279=_0x5b9091[_0x3185d5(0x261)](0x0,_0xe79f52),_0x1ae34b=_0x5b9091[_0x3185d5(0x261)](_0xe79f52+0x1);try{_0x11b544[_0x59a279]=JSON[_0x3185d5(0x1e5)](_0x1ae34b);}catch{_0x11b544[_0x59a279]=_0x1ae34b;}}_0x15f5b4[_0x3185d5(0x23d)]&&(console[_0x3185d5(0x295)](_0x3185d5(0x1ea)+_0x137256),Object['keys'](_0x11b544)['length']>0x0&&console[_0x3185d5(0x295)](_0x3185d5(0x175)+JSON[_0x3185d5(0x258)](_0x11b544)),_0x5302d5&&console[_0x3185d5(0x295)]('Session\x20time:\x20'+_0x5302d5));const _0x5973fb=await withSpinner(_0x3185d5(0x1cb),()=>_0x453c5e['workflow'][_0x3185d5(0x21e)](_0x137256,_0x11b544,{'sessionTime':_0x5302d5}),{'verbose':_0x15f5b4[_0x3185d5(0x23d)]}),_0x1b8cb0=_0x5973fb[_0x3185d5(0x1e2)];console['error'](_0x3185d5(0x221)),console[_0x3185d5(0x295)]('\x20\x20Attempt\x20ID:\x20'+_0x1b8cb0['id']),console[_0x3185d5(0x295)](_0x3185d5(0x1d4)+_0x1b8cb0[_0x3185d5(0x215)]),console[_0x3185d5(0x295)](_0x3185d5(0x176)+_0x1b8cb0['project']?.[_0x3185d5(0x265)]),console[_0x3185d5(0x295)](_0x3185d5(0x1d8)+_0x1b8cb0['workflow']?.[_0x3185d5(0x265)]);if(_0x1b8cb0[_0x3185d5(0x1d2)]?.['id']&&_0x1b8cb0['sessionId']&&_0x1b8cb0['id']){const _0x200da9=_0x15f5b4[_0x3185d5(0x1a0)],_0x4e9397=getConsoleUrl(_0x200da9,'/app/workflows/'+_0x1b8cb0[_0x3185d5(0x1d2)]['id']+'/sessions/'+_0x1b8cb0['sessionId']+_0x3185d5(0x20c)+_0x1b8cb0['id']);console['error'](_0x3185d5(0x259)+a38_0x1d49f6[_0x3185d5(0x285)](_0x4e9397));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a38_0x5464e8(0x265)]=a38_0x5464e8(0x16b);[a38_0x5464e8(0x160)]=a38_0x5464e8(0x288);async['execute'](_0x3c6500){const _0x2f28a9=a38_0x5464e8,{options:_0x3c90ce,args:_0x2e55d9,tdx:_0x4ec387}=_0x3c6500,_0x104520=_0x2e55d9[0x0],_0x50450e=_0x2e55d9[0x1]||'.';if(!_0x104520)return console[_0x2f28a9(0x295)](_0x2f28a9(0x24f)),console[_0x2f28a9(0x295)](_0x2f28a9(0x192)),0x1;const _0x54c71c=_0x3c90ce['revision'];_0x3c90ce[_0x2f28a9(0x23d)]&&(console[_0x2f28a9(0x295)](_0x2f28a9(0x26a)+_0x104520),console[_0x2f28a9(0x295)](_0x2f28a9(0x245)+_0x50450e),_0x54c71c&&console['error'](_0x2f28a9(0x20b)+_0x54c71c));const _0x408cb5=await withSpinner(_0x2f28a9(0x236)+_0x104520+_0x2f28a9(0x260),()=>_0x4ec387[_0x2f28a9(0x22f)]['download'](_0x104520,_0x50450e,{'revision':_0x54c71c}),{'verbose':_0x3c90ce[_0x2f28a9(0x23d)]}),_0x3e0913=_0x408cb5[_0x2f28a9(0x1e2)];return console['error'](_0x2f28a9(0x239)+_0x3e0913['projectName']),console[_0x2f28a9(0x295)]('\x20\x20Revision:\x20'+_0x3e0913['revision']),console['error'](_0x2f28a9(0x279)+_0x3e0913[_0x2f28a9(0x23b)]),console['error'](_0x2f28a9(0x216)+_0x50450e+'/'+_0x3e0913[_0x2f28a9(0x291)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a38_0x5464e8(0x265)]=a38_0x5464e8(0x1b2);[a38_0x5464e8(0x160)]=a38_0x5464e8(0x22e);async[a38_0x5464e8(0x153)](_0x305ca0){const _0xc01817=a38_0x5464e8,{options:_0x593b01,args:_0x54c524,tdx:_0x4bb2b0}=_0x305ca0;let _0x1710c7='.',_0xfa75b0=_0x593b01['name'];if(_0x54c524[0x0]){const {promises:_0x4a5a8a}=await import('fs');try{const _0x3a25e0=await _0x4a5a8a['stat'](_0x54c524[0x0]);if(_0x3a25e0[_0xc01817(0x182)]())_0x1710c7=_0x54c524[0x0];else return console[_0xc01817(0x295)](_0xc01817(0x228)+_0x54c524[0x0]+_0xc01817(0x183)),0x1;}catch{_0xfa75b0=_0x54c524[0x0],_0x1710c7='.';}}const _0x505af6=_0x593b01[_0xc01817(0x20f)],_0x10dfac=_0x593b01[_0xc01817(0x211)];_0x593b01[_0xc01817(0x23d)]&&(console[_0xc01817(0x295)](_0xc01817(0x23a)+_0x1710c7),_0xfa75b0&&console[_0xc01817(0x295)](_0xc01817(0x254)+_0xfa75b0),_0x505af6&&console[_0xc01817(0x295)](_0xc01817(0x20b)+_0x505af6),_0x10dfac&&console[_0xc01817(0x295)]('Validation:\x20skipped'));const _0x22e634=await withSpinner(_0xc01817(0x15b),()=>_0x4bb2b0[_0xc01817(0x22f)][_0xc01817(0x250)](_0x1710c7,{'projectName':_0xfa75b0,'revision':_0x505af6,'skipValidation':_0x10dfac}),{'verbose':_0x593b01[_0xc01817(0x23d)]}),_0x4ae224=_0x22e634[_0xc01817(0x1e2)];return console['error'](_0xc01817(0x257)+_0x4ae224[_0xc01817(0x291)]),console[_0xc01817(0x295)]('\x20\x20Project\x20ID:\x20'+_0x4ae224[_0xc01817(0x1cf)]),console['error'](_0xc01817(0x253)+_0x4ae224[_0xc01817(0x20f)]),await this[_0xc01817(0x246)](_0x4bb2b0,_0x4ae224[_0xc01817(0x291)],_0x593b01[_0xc01817(0x1a0)]),0x0;}}function a38_0x1d36(_0x3f99f2,_0x3fb85c){_0x3f99f2=_0x3f99f2-0x153;const _0x251d48=a38_0x251d();let _0x1d3650=_0x251d48[_0x3f99f2];return _0x1d3650;}export class WorkflowPullCommand extends BaseCommand{[a38_0x5464e8(0x265)]=a38_0x5464e8(0x1d3);[a38_0x5464e8(0x160)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async['execute'](_0x46e776){const _0x5e2223=a38_0x5464e8,{options:_0x53c24c,args:_0x40e937,tdx:_0x5dcb83}=_0x46e776,_0x501a0f=_0x40e937[0x0],_0x28ac0c=_0x40e937[0x1];if(!_0x501a0f)return console[_0x5e2223(0x295)](a38_0x1d49f6['red'](_0x5e2223(0x1a2)),_0x5e2223(0x1ca)),console[_0x5e2223(0x295)](a38_0x1d49f6['dim'](_0x5e2223(0x1c4))),0x1;const _0x46caff=_0x53c24c[_0x5e2223(0x20f)];_0x53c24c['verbose']&&(console[_0x5e2223(0x295)](_0x5e2223(0x26a)+_0x501a0f),_0x28ac0c&&console[_0x5e2223(0x295)](_0x5e2223(0x18c)+_0x28ac0c),_0x46caff&&console['error']('Revision:\x20'+_0x46caff),_0x53c24c[_0x5e2223(0x1a9)]&&console[_0x5e2223(0x295)](_0x5e2223(0x1d0)));const _0x34c65a=await withSpinner('Pulling\x20project\x20'+_0x501a0f+_0x5e2223(0x260),()=>_0x5dcb83[_0x5e2223(0x22f)]['pullProject'](_0x501a0f,{'targetDir':_0x28ac0c,'revision':_0x46caff}),{'verbose':_0x53c24c['verbose']}),_0x3147dc=_0x34c65a[_0x5e2223(0x1e2)];_0x3147dc[_0x5e2223(0x217)]?console[_0x5e2223(0x295)]('✔\x20New\x20project:\x20'+_0x3147dc[_0x5e2223(0x291)]):console[_0x5e2223(0x295)](_0x5e2223(0x1ad)+_0x3147dc[_0x5e2223(0x291)]);console[_0x5e2223(0x295)](_0x5e2223(0x253)+_0x3147dc['revision']),console[_0x5e2223(0x295)](_0x5e2223(0x163)+(a38_0x5693a7[_0x5e2223(0x271)](process[_0x5e2223(0x1f9)](),_0x3147dc['targetDir'])||'.')),console['error'](_0x5e2223(0x1ff)+a38_0x1d49f6['green']('+'+_0x3147dc['summary'][_0x5e2223(0x186)]+_0x5e2223(0x20e))+',\x20'+(a38_0x1d49f6[_0x5e2223(0x26e)]('~'+_0x3147dc[_0x5e2223(0x1bf)]['modified']+_0x5e2223(0x1b8))+',\x20')+(a38_0x1d49f6['red']('-'+_0x3147dc[_0x5e2223(0x1bf)]['deleted']+'\x20deleted')+',\x20')+(''+a38_0x1d49f6[_0x5e2223(0x252)](_0x3147dc['summary']['unchanged']+_0x5e2223(0x23f))));for(const _0x5851f8 of _0x3147dc[_0x5e2223(0x1fd)]){_0x5851f8['type']===_0x5e2223(0x1ce)&&_0x5851f8[_0x5e2223(0x170)]&&(console['error']('\x0a'+a38_0x1d49f6[_0x5e2223(0x285)](_0x5e2223(0x1cd)+_0x5851f8[_0x5e2223(0x262)])),console['error'](_0x5851f8['diff']));}if(!_0x3147dc['hasChanges'])return saveSessionContext({'workflow_project':_0x3147dc['projectName']},_0x53c24c[_0x5e2223(0x191)]),console[_0x5e2223(0x295)](a38_0x1d49f6[_0x5e2223(0x218)](_0x5e2223(0x1fe))),console['error'](a38_0x1d49f6[_0x5e2223(0x252)](_0x5e2223(0x283)+_0x3147dc[_0x5e2223(0x291)])),0x0;if(_0x53c24c[_0x5e2223(0x1a9)])return console[_0x5e2223(0x295)](a38_0x1d49f6[_0x5e2223(0x26e)](_0x5e2223(0x1be))),0x0;if(!_0x53c24c[_0x5e2223(0x21d)]){const _0x2c43ec=await confirmKey(_0x5e2223(0x27b));if(!_0x2c43ec)return console[_0x5e2223(0x295)](_0x5e2223(0x1c5)),0x0;}await withSpinner(_0x5e2223(0x1f8),()=>_0x5dcb83[_0x5e2223(0x22f)][_0x5e2223(0x15a)](_0x3147dc,{'revision':_0x46caff}),{'verbose':_0x53c24c['verbose']}),saveSessionContext({'workflow_project':_0x3147dc[_0x5e2223(0x291)]},_0x53c24c[_0x5e2223(0x191)]),console[_0x5e2223(0x295)](a38_0x1d49f6[_0x5e2223(0x218)](_0x5e2223(0x20d)));const _0x474027=a38_0x5693a7['relative'](process['cwd'](),_0x3147dc['targetDir'])||'.';return console[_0x5e2223(0x295)](a38_0x1d49f6[_0x5e2223(0x252)]('\x20\x20Location:\x20'+_0x474027)),console[_0x5e2223(0x295)](a38_0x1d49f6['dim'](_0x5e2223(0x283)+_0x3147dc[_0x5e2223(0x291)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a38_0x5464e8(0x265)]=a38_0x5464e8(0x1e0);[a38_0x5464e8(0x160)]=a38_0x5464e8(0x190);async[a38_0x5464e8(0x153)](_0x1878fc){const _0x316126=a38_0x5464e8,{options:_0x442f99,args:_0x1af934,tdx:_0x3f7caa}=_0x1878fc,_0x4b5452=this[_0x316126(0x28f)](_0x1af934,_0x442f99),_0x47b200=_0x442f99[_0x316126(0x20f)],_0xc8a0c5=_0x442f99[_0x316126(0x211)];_0x442f99[_0x316126(0x23d)]&&(_0x4b5452&&console[_0x316126(0x295)](_0x316126(0x1aa)+_0x4b5452),_0x47b200&&console[_0x316126(0x295)](_0x316126(0x20b)+_0x47b200),_0x442f99[_0x316126(0x1a9)]&&console[_0x316126(0x295)](_0x316126(0x1d0)),_0xc8a0c5&&console['error'](_0x316126(0x166)));let _0x24a7a1;try{_0x24a7a1=await withSpinner(_0x316126(0x275),()=>_0x3f7caa[_0x316126(0x22f)][_0x316126(0x205)]({'sourceDir':_0x4b5452,'revision':_0x47b200,'skipValidation':_0xc8a0c5}),{'verbose':_0x442f99[_0x316126(0x23d)]});}catch(_0x135ac1){if(_0x135ac1 instanceof Error&&_0x135ac1['message'][_0x316126(0x167)](_0x316126(0x1c3)))return console[_0x316126(0x295)](a38_0x1d49f6[_0x316126(0x23e)](_0x316126(0x1a2)),_0x316126(0x22b)),_0x442f99[_0x316126(0x27d)]?console[_0x316126(0x295)](a38_0x1d49f6[_0x316126(0x252)](_0x316126(0x1b3)+_0x442f99[_0x316126(0x27d)]+_0x316126(0x27a)+_0x442f99[_0x316126(0x27d)]+'\x27')):console[_0x316126(0x295)](a38_0x1d49f6[_0x316126(0x252)](_0x316126(0x25a))),0x1;throw _0x135ac1;}const _0x38c7b7=_0x24a7a1[_0x316126(0x1e2)];console[_0x316126(0x295)](_0x316126(0x1ad)+_0x38c7b7[_0x316126(0x291)]),console[_0x316126(0x295)](_0x316126(0x201)+_0x38c7b7[_0x316126(0x209)]),console[_0x316126(0x295)](_0x316126(0x253)+_0x38c7b7[_0x316126(0x20f)]),console['error'](_0x316126(0x1ff)+a38_0x1d49f6[_0x316126(0x218)]('+'+_0x38c7b7[_0x316126(0x1bf)]['new']+_0x316126(0x20e))+',\x20'+(a38_0x1d49f6[_0x316126(0x26e)]('~'+_0x38c7b7[_0x316126(0x1bf)][_0x316126(0x1ce)]+_0x316126(0x1b8))+',\x20')+(a38_0x1d49f6[_0x316126(0x23e)]('-'+_0x38c7b7[_0x316126(0x1bf)][_0x316126(0x17f)]+_0x316126(0x199))+',\x20')+(''+a38_0x1d49f6[_0x316126(0x252)](_0x38c7b7[_0x316126(0x1bf)][_0x316126(0x1ed)]+_0x316126(0x23f))));for(const _0x8786de of _0x38c7b7[_0x316126(0x1fd)]){_0x8786de[_0x316126(0x241)]===_0x316126(0x1ce)&&_0x8786de['diff']&&(console[_0x316126(0x295)]('\x0a'+a38_0x1d49f6['cyan']('---\x20'+_0x8786de[_0x316126(0x262)])),console[_0x316126(0x295)](_0x8786de[_0x316126(0x170)]));}if(!_0x38c7b7[_0x316126(0x1f5)])return console[_0x316126(0x295)](a38_0x1d49f6['green']('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x316126(0x246)](_0x3f7caa,_0x38c7b7[_0x316126(0x291)],_0x442f99['site']),0x0;if(_0x442f99[_0x316126(0x1a9)])return console['error'](a38_0x1d49f6[_0x316126(0x26e)](_0x316126(0x25e))),0x0;if(!_0x442f99[_0x316126(0x21d)]){const _0x56c53b=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x56c53b)return console[_0x316126(0x295)](_0x316126(0x1c5)),0x0;}const _0x4e1d3d=await withSpinner(_0x316126(0x16d),()=>_0x3f7caa[_0x316126(0x22f)]['executePushProject'](_0x38c7b7),{'verbose':_0x442f99[_0x316126(0x23d)]}),_0x1d1f6e=_0x4e1d3d[_0x316126(0x1e2)];return console['error'](a38_0x1d49f6[_0x316126(0x218)](_0x316126(0x277))),console[_0x316126(0x295)](_0x316126(0x22a)+_0x1d1f6e[_0x316126(0x1cf)]),console[_0x316126(0x295)](_0x316126(0x253)+_0x1d1f6e['revision']),await this['showWorkflowConsoleUrl'](_0x3f7caa,_0x1d1f6e[_0x316126(0x291)],_0x442f99['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a38_0x5464e8(0x265)]=a38_0x5464e8(0x1b5);[a38_0x5464e8(0x160)]=a38_0x5464e8(0x155);async['execute'](_0x4f4158){const _0xf29c71=a38_0x5464e8,{options:_0x52b6dd,args:_0x303a96,tdx:_0x573512}=_0x4f4158,_0x3810b2=this['resolveProjectDir'](_0x303a96,_0x52b6dd),_0x31b2c7=_0x52b6dd[_0xf29c71(0x265)],_0x208ab3=_0x52b6dd[_0xf29c71(0x20f)],_0x1d57d3=_0x52b6dd[_0xf29c71(0x211)];if(!_0x3810b2)return console[_0xf29c71(0x295)](a38_0x1d49f6['red'](_0xf29c71(0x1a2)),_0xf29c71(0x17e)),console[_0xf29c71(0x295)](a38_0x1d49f6[_0xf29c71(0x252)](_0xf29c71(0x276))),console[_0xf29c71(0x295)](a38_0x1d49f6[_0xf29c71(0x252)](_0xf29c71(0x1f4))),0x1;if(!_0x31b2c7)return console[_0xf29c71(0x295)](a38_0x1d49f6[_0xf29c71(0x23e)](_0xf29c71(0x1a2)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console['error'](a38_0x1d49f6['dim'](_0xf29c71(0x276))),0x1;_0x52b6dd[_0xf29c71(0x23d)]&&(console[_0xf29c71(0x295)](_0xf29c71(0x1aa)+_0x3810b2),console[_0xf29c71(0x295)](_0xf29c71(0x15e)+_0x31b2c7),_0x208ab3&&console[_0xf29c71(0x295)](_0xf29c71(0x20b)+_0x208ab3),_0x52b6dd[_0xf29c71(0x1a9)]&&console[_0xf29c71(0x295)](_0xf29c71(0x1d0)),_0x1d57d3&&console[_0xf29c71(0x295)](_0xf29c71(0x166)));const _0x19be55=await withSpinner(_0xf29c71(0x1fc),()=>_0x573512[_0xf29c71(0x22f)]['prepareCloneProject'](_0x3810b2,_0x31b2c7,{'revision':_0x208ab3,'skipValidation':_0x1d57d3}),{'verbose':_0x52b6dd[_0xf29c71(0x23d)]}),_0x138185=_0x19be55[_0xf29c71(0x1e2)];console[_0xf29c71(0x295)]('Source:\x20'+_0x138185[_0xf29c71(0x209)]);_0x138185[_0xf29c71(0x1ee)]&&console[_0xf29c71(0x295)](_0xf29c71(0x296)+_0x138185[_0xf29c71(0x1ee)]);console[_0xf29c71(0x295)](_0xf29c71(0x15e)+_0x138185['newProjectName']),console[_0xf29c71(0x295)]('Revision:\x20'+_0x138185[_0xf29c71(0x20f)]),console[_0xf29c71(0x295)](_0xf29c71(0x281)+_0x138185[_0xf29c71(0x1db)]);_0x138185[_0xf29c71(0x267)]&&(console[_0xf29c71(0x295)](a38_0x1d49f6[_0xf29c71(0x26e)](_0xf29c71(0x1ec)+_0x138185[_0xf29c71(0x1cc)]+_0xf29c71(0x195)+_0x138185[_0xf29c71(0x16f)]+')')),console[_0xf29c71(0x295)](a38_0x1d49f6[_0xf29c71(0x26e)](_0xf29c71(0x28d))));if(_0x52b6dd[_0xf29c71(0x1a9)])return console['error'](a38_0x1d49f6[_0xf29c71(0x26e)](_0xf29c71(0x244))),0x0;if(!_0x52b6dd['yes']){const _0x429b96=_0x138185['sourceProjectName']||a38_0x5693a7[_0xf29c71(0x249)](_0x3810b2),_0x5619a1=_0x138185[_0xf29c71(0x267)]?_0xf29c71(0x17c)+_0x31b2c7+_0xf29c71(0x247):_0xf29c71(0x17a)+_0x429b96+_0xf29c71(0x16a)+_0x31b2c7+'\x22?',_0x49b8a3=await confirmKey(_0x5619a1);if(!_0x49b8a3)return console['error']('Cancelled'),0x0;}const _0x43bd12=await withSpinner(_0x138185[_0xf29c71(0x267)]?_0xf29c71(0x174)+_0x31b2c7+_0xf29c71(0x260):_0xf29c71(0x185)+_0x31b2c7+_0xf29c71(0x260),()=>_0x573512[_0xf29c71(0x22f)][_0xf29c71(0x161)](_0x138185),{'verbose':_0x52b6dd[_0xf29c71(0x23d)]}),_0x318a8e=_0x43bd12['data'];return console['error'](a38_0x1d49f6[_0xf29c71(0x218)](_0x138185[_0xf29c71(0x267)]?_0xf29c71(0x154):_0xf29c71(0x16e))),console[_0xf29c71(0x295)](_0xf29c71(0x176)+_0x318a8e[_0xf29c71(0x1cc)]),console[_0xf29c71(0x295)]('\x20\x20Project\x20ID:\x20'+_0x318a8e[_0xf29c71(0x1a7)]),console[_0xf29c71(0x295)](_0xf29c71(0x253)+_0x318a8e[_0xf29c71(0x20f)]),await this[_0xf29c71(0x246)](_0x573512,_0x318a8e[_0xf29c71(0x1cc)],_0x52b6dd[_0xf29c71(0x1a0)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a38_0x5464e8(0x265)]=a38_0x5464e8(0x263);[a38_0x5464e8(0x160)]=a38_0x5464e8(0x180);async[a38_0x5464e8(0x153)](_0x5d8613){const _0x551327=a38_0x5464e8,{options:_0xb152e1,args:_0x236d56,tdx:_0x5f350f}=_0x5d8613,_0xf87fa9=_0x236d56[0x0];if(!_0xf87fa9)return console[_0x551327(0x295)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x551327(0x295)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0xb152e1[_0x551327(0x23d)]&&console['error'](_0x551327(0x26a)+_0xf87fa9);if(!_0xb152e1[_0x551327(0x21d)]){const _0x4e75d3=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0xf87fa9+_0x551327(0x1bb));if(!_0x4e75d3)return console[_0x551327(0x295)]('Cancelled'),0x0;}const _0x1ee65a=await withSpinner(_0x551327(0x23c)+_0xf87fa9+'...',()=>_0x5f350f['workflow'][_0x551327(0x282)](_0xf87fa9),{'verbose':_0xb152e1[_0x551327(0x23d)]}),_0x427302=_0x1ee65a[_0x551327(0x1e2)];return console[_0x551327(0x295)](_0x551327(0x1da)+_0x427302['projectName']),console[_0x551327(0x295)](_0x551327(0x22a)+_0x427302['projectId']),0x0;}}export function parseKeyValue(_0x9749c7){const _0x5ce55a=a38_0x5464e8,_0x23339d=_0x9749c7['indexOf']('=');if(_0x23339d===-0x1)throw new Error('Invalid\x20format:\x20'+_0x9749c7+_0x5ce55a(0x220));const _0x3c52dd=_0x9749c7[_0x5ce55a(0x261)](0x0,_0x23339d),_0x45448b=_0x9749c7[_0x5ce55a(0x261)](_0x23339d+0x1);if(!_0x3c52dd)throw new Error(_0x5ce55a(0x159));return{'key':_0x3c52dd,'value':_0x45448b};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a38_0x5464e8(0x265)]=a38_0x5464e8(0x18e);['description']=a38_0x5464e8(0x164);async[a38_0x5464e8(0x153)](_0x1f6710){const _0x11d32f=a38_0x5464e8,{options:_0x46753e,args:_0x255735,tdx:_0x398702}=_0x1f6710,_0x6ce55f=this[_0x11d32f(0x181)](_0x255735,_0x46753e);if(!_0x6ce55f)return 0x1;_0x46753e[_0x11d32f(0x23d)]&&console['error']('Project:\x20'+_0x6ce55f);const _0x23d23=await withSpinner(_0x11d32f(0x1bc),()=>_0x398702[_0x11d32f(0x22f)]['listSecrets'](_0x6ce55f),{'verbose':_0x46753e[_0x11d32f(0x23d)]}),{secrets:_0xd3dc1b}=_0x23d23['data'];return console[_0x11d32f(0x295)](_0x11d32f(0x219)+_0xd3dc1b[_0x11d32f(0x20a)]+_0x11d32f(0x169)+(_0xd3dc1b[_0x11d32f(0x20a)]!==0x1?'s':'')),await handleSDKOutput(_0xd3dc1b,_0x46753e),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a38_0x5464e8(0x265)]=a38_0x5464e8(0x28b);[a38_0x5464e8(0x160)]=a38_0x5464e8(0x1f6);async[a38_0x5464e8(0x153)](_0x55aa16){const _0x257f16=a38_0x5464e8,{options:_0x249afd,args:_0x12f319,tdx:_0x33d958}=_0x55aa16;let _0x4897c1,_0x1b0b21;if(_0x12f319[_0x257f16(0x20a)]>=0x2)_0x4897c1=_0x12f319[0x0],_0x1b0b21=_0x12f319[0x1];else{if(_0x12f319[_0x257f16(0x20a)]===0x1&&_0x249afd[_0x257f16(0x27d)])_0x4897c1=_0x249afd[_0x257f16(0x27d)],_0x1b0b21=_0x12f319[0x0];else return _0x12f319[_0x257f16(0x20a)]===0x1?(console[_0x257f16(0x295)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x257f16(0x295)](_0x257f16(0x1a3)),0x1):(console[_0x257f16(0x295)](_0x257f16(0x210)),console['error'](_0x257f16(0x1b0)),0x1);}let _0x4b616c,_0x1a3409;try{({key:_0x4b616c,value:_0x1a3409}=parseKeyValue(_0x1b0b21));}catch(_0x32cbf0){return _0x32cbf0 instanceof Error&&console[_0x257f16(0x295)](a38_0x1d49f6[_0x257f16(0x23e)](_0x257f16(0x1a2)),_0x32cbf0[_0x257f16(0x1af)]),0x1;}_0x249afd['verbose']&&(console['error'](_0x257f16(0x26a)+_0x4897c1),console['error'](_0x257f16(0x225)+_0x4b616c));const _0x4b0da1=await withSpinner(_0x257f16(0x1d1),()=>_0x33d958[_0x257f16(0x22f)][_0x257f16(0x19e)](_0x4897c1,_0x4b616c,_0x1a3409),{'verbose':_0x249afd[_0x257f16(0x23d)]}),_0x1bf774=_0x4b0da1[_0x257f16(0x1e2)];return console[_0x257f16(0x295)]('✔\x20Secret\x20\x27'+_0x1bf774[_0x257f16(0x1fb)]+_0x257f16(0x188)+_0x1bf774['projectName']+'\x27'),(_0x249afd[_0x257f16(0x1f0)]||_0x249afd[_0x257f16(0x1f3)])&&await handleSingleObjectOutput(_0x1bf774,_0x249afd),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a38_0x5464e8(0x269);[a38_0x5464e8(0x160)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a38_0x5464e8(0x153)](_0x4f9e7b){const _0xb3dcd5=a38_0x5464e8,{options:_0x25fb25,args:_0x2e7e80,tdx:_0x5808d4}=_0x4f9e7b;let _0x307fc0,_0x47daea;if(_0x2e7e80[_0xb3dcd5(0x20a)]>=0x2)_0x307fc0=_0x2e7e80[0x0],_0x47daea=_0x2e7e80[0x1];else{if(_0x2e7e80['length']===0x1&&_0x25fb25[_0xb3dcd5(0x27d)])_0x307fc0=_0x25fb25[_0xb3dcd5(0x27d)],_0x47daea=_0x2e7e80[0x0];else return _0x2e7e80[_0xb3dcd5(0x20a)]===0x1?(console[_0xb3dcd5(0x295)]('Error:\x20Project\x20name\x20is\x20required'),console[_0xb3dcd5(0x295)](_0xb3dcd5(0x1a3)),0x1):(console['error']('Error:\x20Secret\x20key\x20is\x20required'),console[_0xb3dcd5(0x295)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x25fb25[_0xb3dcd5(0x23d)]&&(console[_0xb3dcd5(0x295)]('Project:\x20'+_0x307fc0),console[_0xb3dcd5(0x295)](_0xb3dcd5(0x225)+_0x47daea));if(!_0x25fb25['yes']){const _0x2c36cc=await confirmKey(_0xb3dcd5(0x1f2)+_0x47daea+_0xb3dcd5(0x235)+_0x307fc0+'\x27?');if(!_0x2c36cc)return console[_0xb3dcd5(0x295)](_0xb3dcd5(0x1c5)),0x0;}const _0x540887=await withSpinner(_0xb3dcd5(0x1b9),()=>_0x5808d4[_0xb3dcd5(0x22f)][_0xb3dcd5(0x1c8)](_0x307fc0,_0x47daea),{'verbose':_0x25fb25['verbose']}),_0x180961=_0x540887[_0xb3dcd5(0x1e2)];return console[_0xb3dcd5(0x295)]('✔\x20Secret\x20\x27'+_0x180961[_0xb3dcd5(0x1fb)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x180961['projectName']+'\x27'),(_0x25fb25[_0xb3dcd5(0x1f0)]||_0x25fb25['jsonl'])&&await handleSingleObjectOutput(_0x180961,_0x25fb25),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x5e9ff2,_0x107a2a){const _0x5d7c35=a39_0x452c,_0x639834=_0x5e9ff2();while(!![]){try{const _0x2dfe3c=-parseInt(_0x5d7c35(0xb3))/0x1+-parseInt(_0x5d7c35(0xa6))/0x2+parseInt(_0x5d7c35(0xad))/0x3*(-parseInt(_0x5d7c35(0xa4))/0x4)+-parseInt(_0x5d7c35(0xa5))/0x5*(parseInt(_0x5d7c35(0xab))/0x6)+parseInt(_0x5d7c35(0xaf))/0x7*(-parseInt(_0x5d7c35(0xb2))/0x8)+-parseInt(_0x5d7c35(0xaa))/0x9+parseInt(_0x5d7c35(0xb5))/0xa;if(_0x2dfe3c===_0x107a2a)break;else _0x639834['push'](_0x639834['shift']());}catch(_0x3bba8b){_0x639834['push'](_0x639834['shift']());}}}(a39_0x14e5,0xcfaa5));function a39_0x452c(_0x131986,_0x23d43f){_0x131986=_0x131986-0xa4;const _0x14e586=a39_0x14e5();let _0x452cc6=_0x14e586[_0x131986];return _0x452cc6;}import{platform}from'os';import{getAPIKey}from'./config.js';function a39_0x14e5(){const _0x3ca06e=['5621769gBJOrj','9966984pokrJt','Authorization','3938751YfvITy','tdx','28GtMFoN','TD1\x20',';\x20node/','1654552DZfqgg','1374191wHVsXe','version','78770260PeZAgm','replace','4zGyGIT','5CQEjog','2452480yeHMJr','length','entries','tdx/'];a39_0x14e5=function(){return _0x3ca06e;};return a39_0x14e5();}import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x30a394=a39_0x452c,_0x1e0450=getVersion(),_0x521e1b=platform(),_0x51a08d=process[_0x30a394(0xb4)][_0x30a394(0xb6)]('v','');return _0x30a394(0xa9)+_0x1e0450+'\x20('+_0x521e1b+_0x30a394(0xb1)+_0x51a08d+')';}export function getAuthHeaders(_0x285fbb,_0x21e277){const _0xf4877c=a39_0x452c,_0x4f738d=getVersion(),_0x5d837d={'User-Agent':getUserAgent(),'X-TD-Client':_0xf4877c(0xae),'X-TD-Client-Version':_0x4f738d};return _0x21e277&&(_0x5d837d[_0xf4877c(0xac)]=_0xf4877c(0xb0)+_0x21e277),_0x5d837d;}export function toHeaderRecord(_0x4b6b6a){const _0x16c6e4=a39_0x452c,_0x15661f={};for(const [_0x256218,_0x457ed9]of Object[_0x16c6e4(0xa8)](_0x4b6b6a)){_0x457ed9!==undefined&&(_0x15661f[_0x256218]=_0x457ed9);}return _0x15661f;}export function getTrinoHeaders(_0x3c6662,_0x5c7304){const _0x2daf0e=getAuthHeaders(_0x3c6662,_0x5c7304),_0x49dd24=toHeaderRecord(_0x2daf0e);return delete _0x49dd24['Authorization'],_0x5c7304&&(_0x49dd24['X-Trino-User']=_0x5c7304),_0x49dd24;}export function hasAPIKey(_0x1ee910){const _0x836fc3=a39_0x452c,_0x203569=getAPIKey(_0x1ee910);return _0x203569!==undefined&&_0x203569[_0x836fc3(0xa7)]>0x0;}
1
+ function a39_0x11ee(_0x3f72c3,_0x3d4ded){_0x3f72c3=_0x3f72c3-0x162;const _0x59f48a=a39_0x59f4();let _0x11eeb3=_0x59f48a[_0x3f72c3];return _0x11eeb3;}(function(_0xa8c19b,_0x1fa3f8){const _0x523f4f=a39_0x11ee,_0x4673e1=_0xa8c19b();while(!![]){try{const _0x2b9c6a=parseInt(_0x523f4f(0x16d))/0x1+parseInt(_0x523f4f(0x16f))/0x2+-parseInt(_0x523f4f(0x166))/0x3+parseInt(_0x523f4f(0x167))/0x4+parseInt(_0x523f4f(0x16e))/0x5+parseInt(_0x523f4f(0x165))/0x6+-parseInt(_0x523f4f(0x163))/0x7;if(_0x2b9c6a===_0x1fa3f8)break;else _0x4673e1['push'](_0x4673e1['shift']());}catch(_0x4a49ca){_0x4673e1['push'](_0x4673e1['shift']());}}}(a39_0x59f4,0x3a298));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x37d221=a39_0x11ee,_0x42fab2=getVersion(),_0xf5a4c3=platform(),_0x295260=process['version'][_0x37d221(0x162)]('v','');return _0x37d221(0x168)+_0x42fab2+'\x20('+_0xf5a4c3+_0x37d221(0x16c)+_0x295260+')';}export function getAuthHeaders(_0x2a7638,_0x7b525c){const _0x5047cc=a39_0x11ee,_0x3d6362=getVersion(),_0x4245ce={'User-Agent':getUserAgent(),'X-TD-Client':_0x5047cc(0x16a),'X-TD-Client-Version':_0x3d6362};return _0x7b525c&&(_0x4245ce['Authorization']=_0x5047cc(0x170)+_0x7b525c),_0x4245ce;}export function toHeaderRecord(_0x30f60c){const _0x312697=a39_0x11ee,_0x11aab3={};for(const [_0x535602,_0x3be858]of Object[_0x312697(0x16b)](_0x30f60c)){_0x3be858!==undefined&&(_0x11aab3[_0x535602]=_0x3be858);}return _0x11aab3;}export function getTrinoHeaders(_0x13d0bb,_0x563c52){const _0x548fee=a39_0x11ee,_0x2703d8=getAuthHeaders(_0x13d0bb,_0x563c52),_0xf598f7=toHeaderRecord(_0x2703d8);return delete _0xf598f7[_0x548fee(0x169)],_0x563c52&&(_0xf598f7['X-Trino-User']=_0x563c52),_0xf598f7;}function a39_0x59f4(){const _0x217da4=['length','2833482gBHfzE','302427nZcPmy','142036ckIgOi','tdx/','Authorization','tdx','entries',';\x20node/','146261mBySVN','1665805nbgAcI','752828YniYhj','TD1\x20','replace','7171857jShAgE'];a39_0x59f4=function(){return _0x217da4;};return a39_0x59f4();}export function hasAPIKey(_0x4920f6){const _0x12168d=a39_0x11ee,_0x46e028=getAPIKey(_0x4920f6);return _0x46e028!==undefined&&_0x46e028[_0x12168d(0x164)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x58fb27,_0x600087){const _0x12bf59=a40_0x4a90,_0x1e444a=_0x58fb27();while(!![]){try{const _0x1e0e44=-parseInt(_0x12bf59(0x1c7))/0x1*(-parseInt(_0x12bf59(0x18c))/0x2)+parseInt(_0x12bf59(0x1bd))/0x3*(-parseInt(_0x12bf59(0x1b6))/0x4)+parseInt(_0x12bf59(0x1a1))/0x5+-parseInt(_0x12bf59(0x18a))/0x6*(-parseInt(_0x12bf59(0x1b4))/0x7)+-parseInt(_0x12bf59(0x19c))/0x8*(-parseInt(_0x12bf59(0x1c3))/0x9)+-parseInt(_0x12bf59(0x181))/0xa+-parseInt(_0x12bf59(0x185))/0xb*(parseInt(_0x12bf59(0x1a4))/0xc);if(_0x1e0e44===_0x600087)break;else _0x1e444a['push'](_0x1e444a['shift']());}catch(_0x3c1c30){_0x1e444a['push'](_0x1e444a['shift']());}}}(a40_0x46cd,0x79c01));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';function a40_0x46cd(){const _0x4c4c29=['log','462685xCyMPP','length','cyan','1135932qUFSdR','table','stringify','forEach','blue','[error]','max','format','cmdout','query','params','rule','inherit','magenta','filter','repeat','2292521HYUvcG','[rule]','4xrvyaG','─┴─','double','push','resolve','debug','stdin','2458989PJZfou','number','bold','keys','-FXRSn','stderr','187092ZTFkUP','[logs]','entries','less','4cMEpNm','error','output','write','3392230FKoBvU','spawn','pipe','[params]','55ZEsGtm','padEnd','stdout','boolean','map','6SfbKcl','limit','398084ipdWlN','bigint','jsonl','No\x20data','close','─┬─','tsv','join','varchar','split','FINISHED','trim','end','isTTY','json','object','352CJmSOS','noColor','[query]','isInteger'];a40_0x46cd=function(){return _0x4c4c29;};return a40_0x46cd();}import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a40_0xfba5e4 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0xccc845){const _0x2eb2ed=a40_0x4a90;return _0xccc845[_0x2eb2ed(0x1ab)]==='json'||_0xccc845[_0x2eb2ed(0x1ab)]===_0x2eb2ed(0x18e)||_0xccc845[_0x2eb2ed(0x1ab)]==='tsv'||_0xccc845[_0x2eb2ed(0x1ab)]===_0x2eb2ed(0x1a5)||_0xccc845['json']===!![]||_0xccc845[_0x2eb2ed(0x18e)]===!![]||_0xccc845['tsv']===!![]||_0xccc845['table']===!![];}export function parseOutputOptions(_0x3e9165){const _0x34b22a=a40_0x4a90;return{'format':_0x3e9165[_0x34b22a(0x1ab)]||_0x34b22a(0x1a5),'output':_0x3e9165['output']||'','limit':_0x3e9165[_0x34b22a(0x18b)],'color':_0x3e9165['color'],'noColor':_0x3e9165[_0x34b22a(0x19d)]};}function convertSDKResultToQueryResult(_0x50e053){const _0x4d4957=a40_0x4a90,_0x339165=[];if(_0x50e053[_0x4d4957(0x1a2)]>0x0){const _0x41a9ce=_0x50e053[0x0];for(const [_0x47e0ce,_0x1fa3ed]of Object[_0x4d4957(0x1c5)](_0x41a9ce)){let _0x4b8db4=_0x4d4957(0x194);if(typeof _0x1fa3ed===_0x4d4957(0x1be))_0x4b8db4=Number[_0x4d4957(0x19f)](_0x1fa3ed)?_0x4d4957(0x18d):_0x4d4957(0x1b8);else{if(typeof _0x1fa3ed===_0x4d4957(0x188))_0x4b8db4='boolean';else _0x1fa3ed===null&&(_0x4b8db4=_0x4d4957(0x194));}_0x339165[_0x4d4957(0x1b9)]({'name':_0x47e0ce,'type':_0x4b8db4});}}return{'queryId':'sdk-result','columns':_0x339165,'data':_0x50e053,'stats':{'state':_0x4d4957(0x196),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x50e053[_0x4d4957(0x1a2)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x1e5b32,_0x6f1ee8){const _0x5092a7=convertSDKResultToQueryResult(_0x1e5b32);return formatQueryOutput(_0x5092a7,_0x6f1ee8);}export async function formatQueryOutput(_0x2b5602,_0x2da49a){const _0x23216d=a40_0x4a90,{format:_0x5c04ae,limit:_0x488149,output:_0x26862e,color:_0x1c8e29,noColor:_0x5f2efa}=_0x2da49a,_0x4882b8=Boolean(_0x26862e)&&!_0x1c8e29,_0x14fd6e={'color':_0x1c8e29,'noColor':_0x5f2efa||_0x4882b8};if(_0x5c04ae==='table'){const _0x3da5bb=shouldUseLess(_0x5c04ae,_0x26862e);return formatAsTable(_0x2b5602,_0x488149,_0x3da5bb,_0x14fd6e);}else{if(_0x5c04ae===_0x23216d(0x19a))return formatAsJSON(_0x2b5602,_0x14fd6e);else return _0x5c04ae==='jsonl'?formatAsJSONL(_0x2b5602,_0x14fd6e):formatQueryResult(_0x2b5602,_0x5c04ae);}}function a40_0x4a90(_0x257414,_0x4c5833){_0x257414=_0x257414-0x17e;const _0x46cd91=a40_0x46cd();let _0x4a902f=_0x46cd91[_0x257414];return _0x4a902f;}function shouldUseLess(_0x1ffa8d,_0x17001c){const _0x35eb34=a40_0x4a90;return(_0x1ffa8d===_0x35eb34(0x1a5)||_0x1ffa8d==='list')&&process[_0x35eb34(0x187)][_0x35eb34(0x199)]&&!_0x17001c;}export function resolveOutputOptions(_0x1ed141){const _0x5c8c79=a40_0x4a90,_0x4ca433=resolveOutputFormat(_0x1ed141[_0x5c8c79(0x1ab)],_0x1ed141[_0x5c8c79(0x17f)],_0x5c8c79(0x1a5));let _0x20ea39=typeof _0x1ed141[_0x5c8c79(0x18b)]===_0x5c8c79(0x1be)?_0x1ed141[_0x5c8c79(0x18b)]:parseInt(_0x1ed141[_0x5c8c79(0x18b)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x4f2985=_0x1ed141['output']||'';return shouldUseLess(_0x4ca433,_0x4f2985)&&(_0x20ea39=Infinity),{'format':_0x4ca433,'output':_0x4f2985,'limit':_0x20ea39,'color':_0x1ed141['color'],'noColor':_0x1ed141[_0x5c8c79(0x19d)]};}export function writeOutput(_0x4fa626,_0x329d97,_0x5dcb99){const _0x27c455=a40_0x4a90;return _0x329d97?(writeFileSync(_0x329d97,_0x4fa626),console[_0x27c455(0x17e)]('Results\x20saved\x20to\x20'+_0x329d97),Promise[_0x27c455(0x1ba)]()):shouldUseLess(_0x5dcb99||'','')?new Promise(_0x72fb45=>{const _0xde5916=_0x27c455,_0x491eb2=spawn(_0xde5916(0x1c6),[_0xde5916(0x1c1)],{'stdio':[_0xde5916(0x183),_0xde5916(0x1b0),_0xde5916(0x1b0)]});let _0x2b0eda=![];_0x491eb2['on']('error',()=>{const _0x278f89=_0xde5916;!_0x2b0eda&&(_0x2b0eda=!![],console[_0x278f89(0x1a0)](_0x4fa626),_0x72fb45());}),_0x491eb2['on'](_0xde5916(0x190),()=>{!_0x2b0eda&&(_0x2b0eda=!![],_0x72fb45());}),_0x491eb2['on'](_0xde5916(0x182),()=>{const _0x230e0d=_0xde5916;!_0x2b0eda&&_0x491eb2[_0x230e0d(0x1bc)]&&(_0x491eb2[_0x230e0d(0x1bc)]['on']('error',()=>{}),_0x491eb2[_0x230e0d(0x1bc)][_0x230e0d(0x180)](_0x4fa626),_0x491eb2[_0x230e0d(0x1bc)][_0x230e0d(0x198)]());}),!_0x491eb2[_0xde5916(0x1bc)]&&(!_0x2b0eda&&(_0x2b0eda=!![],console[_0xde5916(0x1a0)](_0x4fa626),_0x72fb45()));}):(console[_0x27c455(0x1a0)](_0x4fa626),Promise[_0x27c455(0x1ba)]());}export async function handleSDKOutput(_0x3e8c5d,_0x30211a){const _0x59b8ad=a40_0x4a90,_0x1c89e0=resolveOutputOptions(_0x30211a),_0x36ba6e=await formatSDKOutput(_0x3e8c5d,_0x1c89e0);await writeOutput(_0x36ba6e,_0x1c89e0[_0x59b8ad(0x17f)]||undefined,_0x1c89e0[_0x59b8ad(0x1ab)]);}export async function handleQueryOutput(_0x5a2069,_0x3e7af7){const _0x435464=a40_0x4a90,_0x3b623a=resolveOutputOptions(_0x3e7af7),_0x214b08=await formatQueryOutput(_0x5a2069,_0x3b623a);await writeOutput(_0x214b08,_0x3b623a[_0x435464(0x17f)]||undefined,_0x3b623a[_0x435464(0x1ab)]);}async function formatSingleObject(_0x4fb8c3,_0x3e932b){const _0x260e59=a40_0x4a90,{format:_0x4a1635,color:_0x17c9ba,noColor:_0x2664e6}=_0x3e932b,_0x4f461f={'color':_0x17c9ba,'noColor':_0x2664e6};if(_0x4a1635===_0x260e59(0x19a)){if(shouldUseColor(_0x4f461f))return colorizeJSON(_0x4fb8c3,_0x4f461f);return JSON[_0x260e59(0x1a6)](_0x4fb8c3,null,0x2);}else{if(_0x4a1635===_0x260e59(0x18e)){if(shouldUseColor(_0x4f461f))return colorizeJSONCompact(_0x4fb8c3,_0x4f461f);return JSON['stringify'](_0x4fb8c3);}else{if(_0x4a1635===_0x260e59(0x192))return Object[_0x260e59(0x1c5)](_0x4fb8c3)[_0x260e59(0x189)](([_0x594673,_0x3c88c7])=>_0x594673+'\x09'+_0x3c88c7)[_0x260e59(0x193)]('\x0a');else{const _0x4055ef=Object[_0x260e59(0x1c5)](_0x4fb8c3);if(_0x4055ef[_0x260e59(0x1a2)]===0x0)return _0x260e59(0x18f);const _0x3e2172=_0x4fb8c3['debug'],_0x441f44=_0x4fb8c3[_0x260e59(0x1ad)],_0x2f8ceb=_0x4fb8c3[_0x260e59(0x1ae)],_0x20c7c7=_0x4fb8c3[_0x260e59(0x1af)],_0x79f086=_0x441f44?typeof _0x441f44==='string'?_0x441f44:JSON['stringify'](_0x441f44,null,0x2):undefined,_0x2491ca=_0x2f8ceb&&Object[_0x260e59(0x1c0)](_0x2f8ceb)[_0x260e59(0x1a2)]>0x0?JSON['stringify'](_0x2f8ceb,null,0x2):undefined,_0x305586=_0x20c7c7&&Object[_0x260e59(0x1c0)](_0x20c7c7)['length']>0x0?JSON['stringify'](_0x20c7c7,null,0x2):undefined,_0x114783=_0x4055ef[_0x260e59(0x1b2)](([_0xed84d2])=>_0xed84d2!==_0x260e59(0x1bb)&&_0xed84d2!==_0x260e59(0x1ad)&&_0xed84d2!=='params'&&_0xed84d2!==_0x260e59(0x1af)),_0x5741d0=Math[_0x260e59(0x1aa)](..._0x114783[_0x260e59(0x189)](([_0x103857])=>_0x103857[_0x260e59(0x1a2)])),_0x4e4964=Math[_0x260e59(0x1aa)](..._0x114783[_0x260e59(0x189)](([,_0x2accf9])=>{const _0x2cf2ad=_0x260e59;try{const _0x50f2bb=_0x2accf9===null||_0x2accf9===undefined?'':typeof _0x2accf9==='object'?JSON['stringify'](_0x2accf9):String(_0x2accf9),_0x9d342c=_0x50f2bb[_0x2cf2ad(0x195)]('\x0a');return Math[_0x2cf2ad(0x1aa)](..._0x9d342c['map'](_0x477418=>_0x477418[_0x2cf2ad(0x1a2)]),0x0);}catch{return 0x0;}}),0x14),_0x2ceeb0=[];_0x2ceeb0[_0x260e59(0x1b9)](colorBorder('┌─'+'─'[_0x260e59(0x1b3)](_0x5741d0)+_0x260e59(0x191)+'─'[_0x260e59(0x1b3)](_0x4e4964)+'─┐',_0x4f461f)),_0x114783['forEach'](([_0x280caa,_0x2e44b7])=>{const _0x1923b8=_0x260e59;let _0x358313;try{_0x358313=_0x2e44b7===null||_0x2e44b7===undefined?'':typeof _0x2e44b7===_0x1923b8(0x19b)?JSON[_0x1923b8(0x1a6)](_0x2e44b7):String(_0x2e44b7);}catch{_0x358313='[Object]';}const _0x54a6be=_0x280caa['padEnd'](_0x5741d0),_0x3538ac=_0x358313[_0x1923b8(0x195)]('\x0a');_0x3538ac['forEach']((_0x359fd0,_0x218663)=>{const _0x3282f7=_0x1923b8,_0x17b7f9=colorBorder('│',_0x4f461f);_0x218663===0x0?_0x2ceeb0[_0x3282f7(0x1b9)](_0x17b7f9+'\x20'+_0x54a6be+'\x20'+_0x17b7f9+'\x20'+_0x359fd0[_0x3282f7(0x186)](_0x4e4964)+'\x20'+_0x17b7f9):_0x2ceeb0[_0x3282f7(0x1b9)](_0x17b7f9+'\x20'+'\x20'[_0x3282f7(0x1b3)](_0x5741d0)+'\x20'+_0x17b7f9+'\x20'+_0x359fd0[_0x3282f7(0x186)](_0x4e4964)+'\x20'+_0x17b7f9);});}),_0x2ceeb0[_0x260e59(0x1b9)](colorBorder('└─'+'─'[_0x260e59(0x1b3)](_0x5741d0)+_0x260e59(0x1b7)+'─'[_0x260e59(0x1b3)](_0x4e4964)+'─┘',_0x4f461f));_0x79f086&&(_0x2ceeb0[_0x260e59(0x1b9)](''),_0x2ceeb0[_0x260e59(0x1b9)](String(a40_0xfba5e4['yellow'][_0x260e59(0x1bf)](_0x260e59(0x19e)))),_0x2ceeb0['push'](_0x79f086));_0x2491ca&&(_0x2ceeb0[_0x260e59(0x1b9)](''),_0x2ceeb0['push'](String(a40_0xfba5e4[_0x260e59(0x1a8)][_0x260e59(0x1bf)](_0x260e59(0x184)))),_0x2ceeb0[_0x260e59(0x1b9)](_0x2491ca));_0x305586&&(_0x2ceeb0['push'](''),_0x2ceeb0['push'](String(a40_0xfba5e4[_0x260e59(0x1b1)][_0x260e59(0x1bf)](_0x260e59(0x1b5)))),_0x2ceeb0[_0x260e59(0x1b9)](_0x305586));if(_0x3e2172){if(_0x3e2172[_0x260e59(0x1c2)]){_0x2ceeb0['push'](''),_0x2ceeb0['push'](String(a40_0xfba5e4['red'][_0x260e59(0x1bf)](_0x260e59(0x1a9))));const _0x3d17b5=_0x3e2172[_0x260e59(0x1c2)][_0x260e59(0x195)]('\x0a');_0x3d17b5[_0x260e59(0x1a7)](_0x8ae640=>{const _0x7586e6=_0x260e59;_0x8ae640[_0x7586e6(0x197)]()&&_0x2ceeb0[_0x7586e6(0x1b9)](_0x8ae640);});}if(_0x3e2172[_0x260e59(0x1ac)]){_0x2ceeb0['push'](''),_0x2ceeb0['push'](String(a40_0xfba5e4[_0x260e59(0x1a3)][_0x260e59(0x1bf)](_0x260e59(0x1c4))));const _0x5ae845=_0x3e2172['cmdout'][_0x260e59(0x195)]('\x0a');_0x5ae845['forEach'](_0x190e70=>{const _0x2d3641=_0x260e59;_0x190e70[_0x2d3641(0x197)]()&&_0x2ceeb0[_0x2d3641(0x1b9)](_0x190e70);});}}return _0x2ceeb0['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x52e2b1,_0x1c355f){const _0x5d8bcf=a40_0x4a90;if(_0x1c355f[_0x5d8bcf(0x1ab)]==='table'){await handleSDKOutput([_0x52e2b1],_0x1c355f);return;}const _0x26c8e5=resolveOutputOptions(_0x1c355f),_0x4b88b1=await formatSingleObject(_0x52e2b1,_0x26c8e5);await writeOutput(_0x4b88b1,_0x26c8e5['output']||undefined,_0x26c8e5[_0x5d8bcf(0x1ab)]);}
1
+ function a40_0x2465(){const _0x163864=['noColor','query','string','padEnd','max','inherit','19924OloBMx','No\x20data','log','keys','-FXRSn','cmdout','list','resolve','122AKpmCg','3513486UoUCjJ','format','forEach','FINISHED','object','double','12609272lMoHWP','tsv','[query]','write','red','sdk-result','less','1772463NScGno','stderr','filter','error','jsonl','join','stringify','split','5lPEqgq','number','length','stdin','pipe','─┴─','Results\x20saved\x20to\x20','spawn','bold','output','varchar','5434868czqAhv','stdout','params','magenta','map','push','rule','yellow','limit','table','end','[params]','color','debug','repeat','173159wNsHKC','isInteger','16004295lTvrWj','[logs]','close','cyan'];a40_0x2465=function(){return _0x163864;};return a40_0x2465();}(function(_0x5c7152,_0x3dd816){const _0x3b23b3=a40_0x31f3,_0x29e8ff=_0x5c7152();while(!![]){try{const _0x5fc4ec=-parseInt(_0x3b23b3(0x15e))/0x1*(-parseInt(_0x3b23b3(0x166))/0x2)+parseInt(_0x3b23b3(0x130))/0x3+-parseInt(_0x3b23b3(0x143))/0x4+parseInt(_0x3b23b3(0x138))/0x5*(parseInt(_0x3b23b3(0x167))/0x6)+-parseInt(_0x3b23b3(0x152))/0x7+parseInt(_0x3b23b3(0x16d))/0x8+-parseInt(_0x3b23b3(0x154))/0x9;if(_0x5fc4ec===_0x3dd816)break;else _0x29e8ff['push'](_0x29e8ff['shift']());}catch(_0x599172){_0x29e8ff['push'](_0x29e8ff['shift']());}}}(a40_0x2465,0xc4d48));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a40_0x33f1f0 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x10c089){const _0x9ce18f=a40_0x31f3;return _0x10c089[_0x9ce18f(0x168)]==='json'||_0x10c089[_0x9ce18f(0x168)]==='jsonl'||_0x10c089[_0x9ce18f(0x168)]===_0x9ce18f(0x16e)||_0x10c089[_0x9ce18f(0x168)]==='table'||_0x10c089['json']===!![]||_0x10c089[_0x9ce18f(0x134)]===!![]||_0x10c089[_0x9ce18f(0x16e)]===!![]||_0x10c089[_0x9ce18f(0x14c)]===!![];}export function parseOutputOptions(_0x3e0497){const _0x5579f6=a40_0x31f3;return{'format':_0x3e0497[_0x5579f6(0x168)]||_0x5579f6(0x14c),'output':_0x3e0497['output']||'','limit':_0x3e0497[_0x5579f6(0x14b)],'color':_0x3e0497['color'],'noColor':_0x3e0497[_0x5579f6(0x158)]};}function convertSDKResultToQueryResult(_0x3dc598){const _0x53cd28=a40_0x31f3,_0x541157=[];if(_0x3dc598[_0x53cd28(0x13a)]>0x0){const _0x13ba21=_0x3dc598[0x0];for(const [_0x218330,_0x12a66e]of Object['entries'](_0x13ba21)){let _0x23db7c=_0x53cd28(0x142);if(typeof _0x12a66e===_0x53cd28(0x139))_0x23db7c=Number[_0x53cd28(0x153)](_0x12a66e)?'bigint':_0x53cd28(0x16c);else{if(typeof _0x12a66e==='boolean')_0x23db7c='boolean';else _0x12a66e===null&&(_0x23db7c=_0x53cd28(0x142));}_0x541157['push']({'name':_0x218330,'type':_0x23db7c});}}return{'queryId':_0x53cd28(0x12e),'columns':_0x541157,'data':_0x3dc598,'stats':{'state':_0x53cd28(0x16a),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3dc598['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x50f80e,_0x57e4c9){const _0x2e5181=convertSDKResultToQueryResult(_0x50f80e);return formatQueryOutput(_0x2e5181,_0x57e4c9);}export async function formatQueryOutput(_0x5cf5c8,_0x18708e){const _0x4ea18f=a40_0x31f3,{format:_0x128821,limit:_0x412d45,output:_0x533f60,color:_0x3b6bed,noColor:_0x3a285a}=_0x18708e,_0x323093=Boolean(_0x533f60)&&!_0x3b6bed,_0x1ebbe2={'color':_0x3b6bed,'noColor':_0x3a285a||_0x323093};if(_0x128821==='table'){const _0x362978=shouldUseLess(_0x128821,_0x533f60);return formatAsTable(_0x5cf5c8,_0x412d45,_0x362978,_0x1ebbe2);}else{if(_0x128821==='json')return formatAsJSON(_0x5cf5c8,_0x1ebbe2);else return _0x128821===_0x4ea18f(0x134)?formatAsJSONL(_0x5cf5c8,_0x1ebbe2):formatQueryResult(_0x5cf5c8,_0x128821);}}function shouldUseLess(_0x699e96,_0x509976){const _0x9c42e8=a40_0x31f3;return(_0x699e96===_0x9c42e8(0x14c)||_0x699e96===_0x9c42e8(0x164))&&process[_0x9c42e8(0x144)]['isTTY']&&!_0x509976;}function a40_0x31f3(_0x355356,_0x4cff26){_0x355356=_0x355356-0x12b;const _0x24650c=a40_0x2465();let _0x31f334=_0x24650c[_0x355356];return _0x31f334;}export function resolveOutputOptions(_0x1c6812){const _0x3c5f89=a40_0x31f3,_0x2efa3d=resolveOutputFormat(_0x1c6812[_0x3c5f89(0x168)],_0x1c6812[_0x3c5f89(0x141)],_0x3c5f89(0x14c));let _0x420f24=typeof _0x1c6812[_0x3c5f89(0x14b)]===_0x3c5f89(0x139)?_0x1c6812['limit']:parseInt(_0x1c6812[_0x3c5f89(0x14b)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x552dcc=_0x1c6812[_0x3c5f89(0x141)]||'';return shouldUseLess(_0x2efa3d,_0x552dcc)&&(_0x420f24=Infinity),{'format':_0x2efa3d,'output':_0x552dcc,'limit':_0x420f24,'color':_0x1c6812[_0x3c5f89(0x14f)],'noColor':_0x1c6812['noColor']};}export function writeOutput(_0x557bfe,_0x3084f7,_0x2f0fb1){const _0x218159=a40_0x31f3;return _0x3084f7?(writeFileSync(_0x3084f7,_0x557bfe),console[_0x218159(0x133)](_0x218159(0x13e)+_0x3084f7),Promise[_0x218159(0x165)]()):shouldUseLess(_0x2f0fb1||'','')?new Promise(_0x1fcd79=>{const _0xd55a7=_0x218159,_0x3ab5a5=spawn(_0xd55a7(0x12f),[_0xd55a7(0x162)],{'stdio':[_0xd55a7(0x13c),_0xd55a7(0x15d),_0xd55a7(0x15d)]});let _0x81c095=![];_0x3ab5a5['on'](_0xd55a7(0x133),()=>{const _0x190088=_0xd55a7;!_0x81c095&&(_0x81c095=!![],console[_0x190088(0x160)](_0x557bfe),_0x1fcd79());}),_0x3ab5a5['on'](_0xd55a7(0x156),()=>{!_0x81c095&&(_0x81c095=!![],_0x1fcd79());}),_0x3ab5a5['on'](_0xd55a7(0x13f),()=>{const _0x3387d6=_0xd55a7;!_0x81c095&&_0x3ab5a5['stdin']&&(_0x3ab5a5[_0x3387d6(0x13b)]['on'](_0x3387d6(0x133),()=>{}),_0x3ab5a5[_0x3387d6(0x13b)][_0x3387d6(0x12c)](_0x557bfe),_0x3ab5a5['stdin'][_0x3387d6(0x14d)]());}),!_0x3ab5a5[_0xd55a7(0x13b)]&&(!_0x81c095&&(_0x81c095=!![],console[_0xd55a7(0x160)](_0x557bfe),_0x1fcd79()));}):(console[_0x218159(0x160)](_0x557bfe),Promise[_0x218159(0x165)]());}export async function handleSDKOutput(_0x3e9954,_0x39619f){const _0x1c56d4=a40_0x31f3,_0x1db88d=resolveOutputOptions(_0x39619f),_0x4efe73=await formatSDKOutput(_0x3e9954,_0x1db88d);await writeOutput(_0x4efe73,_0x1db88d[_0x1c56d4(0x141)]||undefined,_0x1db88d[_0x1c56d4(0x168)]);}export async function handleQueryOutput(_0x2a078e,_0x243f01){const _0x4e4767=a40_0x31f3,_0x20ace=resolveOutputOptions(_0x243f01),_0x4bdb6c=await formatQueryOutput(_0x2a078e,_0x20ace);await writeOutput(_0x4bdb6c,_0x20ace[_0x4e4767(0x141)]||undefined,_0x20ace[_0x4e4767(0x168)]);}async function formatSingleObject(_0x449587,_0x337f15){const _0x596c52=a40_0x31f3,{format:_0x426437,color:_0x42c999,noColor:_0x4f2429}=_0x337f15,_0x178eda={'color':_0x42c999,'noColor':_0x4f2429};if(_0x426437==='json'){if(shouldUseColor(_0x178eda))return colorizeJSON(_0x449587,_0x178eda);return JSON[_0x596c52(0x136)](_0x449587,null,0x2);}else{if(_0x426437===_0x596c52(0x134)){if(shouldUseColor(_0x178eda))return colorizeJSONCompact(_0x449587,_0x178eda);return JSON[_0x596c52(0x136)](_0x449587);}else{if(_0x426437===_0x596c52(0x16e))return Object['entries'](_0x449587)[_0x596c52(0x147)](([_0x3211e9,_0x1ea26c])=>_0x3211e9+'\x09'+_0x1ea26c)[_0x596c52(0x135)]('\x0a');else{const _0x46cea4=Object['entries'](_0x449587);if(_0x46cea4['length']===0x0)return _0x596c52(0x15f);const _0x27a53e=_0x449587['debug'],_0x4b7e5d=_0x449587['query'],_0x571ef2=_0x449587[_0x596c52(0x145)],_0x4137a1=_0x449587[_0x596c52(0x149)],_0x226950=_0x4b7e5d?typeof _0x4b7e5d===_0x596c52(0x15a)?_0x4b7e5d:JSON[_0x596c52(0x136)](_0x4b7e5d,null,0x2):undefined,_0x4f2117=_0x571ef2&&Object[_0x596c52(0x161)](_0x571ef2)['length']>0x0?JSON['stringify'](_0x571ef2,null,0x2):undefined,_0x37cb2f=_0x4137a1&&Object['keys'](_0x4137a1)[_0x596c52(0x13a)]>0x0?JSON[_0x596c52(0x136)](_0x4137a1,null,0x2):undefined,_0x5e2934=_0x46cea4[_0x596c52(0x132)](([_0xdaf8f])=>_0xdaf8f!==_0x596c52(0x150)&&_0xdaf8f!==_0x596c52(0x159)&&_0xdaf8f!==_0x596c52(0x145)&&_0xdaf8f!==_0x596c52(0x149)),_0x251a3a=Math[_0x596c52(0x15c)](..._0x5e2934[_0x596c52(0x147)](([_0x5cb945])=>_0x5cb945[_0x596c52(0x13a)])),_0x3df356=Math[_0x596c52(0x15c)](..._0x5e2934[_0x596c52(0x147)](([,_0x599e65])=>{const _0x3bc35f=_0x596c52;try{const _0x2a84d3=_0x599e65===null||_0x599e65===undefined?'':typeof _0x599e65===_0x3bc35f(0x16b)?JSON[_0x3bc35f(0x136)](_0x599e65):String(_0x599e65),_0xf7dcd5=_0x2a84d3['split']('\x0a');return Math[_0x3bc35f(0x15c)](..._0xf7dcd5[_0x3bc35f(0x147)](_0x298a38=>_0x298a38[_0x3bc35f(0x13a)]),0x0);}catch{return 0x0;}}),0x14),_0x18e7d3=[];_0x18e7d3[_0x596c52(0x148)](colorBorder('┌─'+'─'[_0x596c52(0x151)](_0x251a3a)+'─┬─'+'─'[_0x596c52(0x151)](_0x3df356)+'─┐',_0x178eda)),_0x5e2934['forEach'](([_0x1644b2,_0x5b8e19])=>{const _0x38b6fd=_0x596c52;let _0x57b7ad;try{_0x57b7ad=_0x5b8e19===null||_0x5b8e19===undefined?'':typeof _0x5b8e19===_0x38b6fd(0x16b)?JSON[_0x38b6fd(0x136)](_0x5b8e19):String(_0x5b8e19);}catch{_0x57b7ad='[Object]';}const _0x4fd847=_0x1644b2[_0x38b6fd(0x15b)](_0x251a3a),_0x1e42bb=_0x57b7ad['split']('\x0a');_0x1e42bb[_0x38b6fd(0x169)]((_0x13190a,_0x3c80c6)=>{const _0x13f929=_0x38b6fd,_0x3c4f6d=colorBorder('│',_0x178eda);_0x3c80c6===0x0?_0x18e7d3[_0x13f929(0x148)](_0x3c4f6d+'\x20'+_0x4fd847+'\x20'+_0x3c4f6d+'\x20'+_0x13190a[_0x13f929(0x15b)](_0x3df356)+'\x20'+_0x3c4f6d):_0x18e7d3['push'](_0x3c4f6d+'\x20'+'\x20'['repeat'](_0x251a3a)+'\x20'+_0x3c4f6d+'\x20'+_0x13190a[_0x13f929(0x15b)](_0x3df356)+'\x20'+_0x3c4f6d);});}),_0x18e7d3[_0x596c52(0x148)](colorBorder('└─'+'─'[_0x596c52(0x151)](_0x251a3a)+_0x596c52(0x13d)+'─'[_0x596c52(0x151)](_0x3df356)+'─┘',_0x178eda));_0x226950&&(_0x18e7d3[_0x596c52(0x148)](''),_0x18e7d3[_0x596c52(0x148)](String(a40_0x33f1f0[_0x596c52(0x14a)]['bold'](_0x596c52(0x12b)))),_0x18e7d3['push'](_0x226950));_0x4f2117&&(_0x18e7d3[_0x596c52(0x148)](''),_0x18e7d3[_0x596c52(0x148)](String(a40_0x33f1f0['blue'][_0x596c52(0x140)](_0x596c52(0x14e)))),_0x18e7d3[_0x596c52(0x148)](_0x4f2117));_0x37cb2f&&(_0x18e7d3['push'](''),_0x18e7d3[_0x596c52(0x148)](String(a40_0x33f1f0[_0x596c52(0x146)]['bold']('[rule]'))),_0x18e7d3[_0x596c52(0x148)](_0x37cb2f));if(_0x27a53e){if(_0x27a53e[_0x596c52(0x131)]){_0x18e7d3[_0x596c52(0x148)](''),_0x18e7d3['push'](String(a40_0x33f1f0[_0x596c52(0x12d)][_0x596c52(0x140)]('[error]')));const _0x3c2881=_0x27a53e[_0x596c52(0x131)][_0x596c52(0x137)]('\x0a');_0x3c2881[_0x596c52(0x169)](_0x4c4a6b=>{const _0x149ef3=_0x596c52;_0x4c4a6b['trim']()&&_0x18e7d3[_0x149ef3(0x148)](_0x4c4a6b);});}if(_0x27a53e[_0x596c52(0x163)]){_0x18e7d3[_0x596c52(0x148)](''),_0x18e7d3['push'](String(a40_0x33f1f0[_0x596c52(0x157)][_0x596c52(0x140)](_0x596c52(0x155))));const _0x102b5b=_0x27a53e['cmdout'][_0x596c52(0x137)]('\x0a');_0x102b5b['forEach'](_0x36688a=>{const _0x49faf2=_0x596c52;_0x36688a['trim']()&&_0x18e7d3[_0x49faf2(0x148)](_0x36688a);});}}return _0x18e7d3['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x25c42c,_0x19934a){const _0x3609a5=a40_0x31f3;if(_0x19934a[_0x3609a5(0x168)]===_0x3609a5(0x14c)){await handleSDKOutput([_0x25c42c],_0x19934a);return;}const _0x1c53d2=resolveOutputOptions(_0x19934a),_0x2313bf=await formatSingleObject(_0x25c42c,_0x1c53d2);await writeOutput(_0x2313bf,_0x1c53d2[_0x3609a5(0x141)]||undefined,_0x1c53d2[_0x3609a5(0x168)]);}
@@ -1 +1 @@
1
- (function(_0x4d01ec,_0x4b576f){const _0x47def2=a41_0x40c2,_0x272ea7=_0x4d01ec();while(!![]){try{const _0x27f0cc=-parseInt(_0x47def2(0xf2))/0x1+-parseInt(_0x47def2(0xf3))/0x2+parseInt(_0x47def2(0xe6))/0x3+parseInt(_0x47def2(0xe0))/0x4*(parseInt(_0x47def2(0xb4))/0x5)+parseInt(_0x47def2(0xd2))/0x6+parseInt(_0x47def2(0xe7))/0x7*(parseInt(_0x47def2(0xe1))/0x8)+-parseInt(_0x47def2(0xcc))/0x9;if(_0x27f0cc===_0x4b576f)break;else _0x272ea7['push'](_0x272ea7['shift']());}catch(_0x423f2b){_0x272ea7['push'](_0x272ea7['shift']());}}}(a41_0x1edb,0x9a5f5));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a41_0x304a86 from'node:fs';function a41_0x1edb(){const _0x194a9c=['TDX_CONFIG_DIR','\x27,\x20defaulting\x20to\x20us01','llm_default_project','1860918wBXfdD','250663ElzOvy','llm_default_agent','keychain\x20(profile:\x20','parse','stg-jp01','source','split','ap02','eu01','existsSync','\x20env\x20var','650952HXnimG','1401726OobPGi','stg-ap03','trim','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','endsWith','env','profile','tdx','apiKey','ap03','name','site','dev-eu01','us01','.env.','legacy\x20.env\x20file\x20(profile:\x20','includes','slice','apiKeys','profiles','5coTpFt','yellow','.cache','utf-8','number','match','TD_API_KEY_','map','.json','Warning:\x20Failed\x20to\x20read\x20','TD_API_KEY\x20env\x20var\x20(deprecated)','stringify','toUpperCase','TDX_API_KEY','filter','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','Warning:\x20Unknown\x20site\x20\x27','accountId','account_info.','readFileSync','legacy\x20.env\x20file','llm_default_project.','TDX_API_KEY_','account_info.json','8091675xMSzyY','warn','toISOString','string','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','isDeprecated','6872202uECaaN','keychain','.config','replace','TD_API_KEY','projectId','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','entries','jp01','startsWith','TDX_CACHE_DIR','tdx.json','dev-us01','join','602732PuqaYg','216DWaKlx','stg-us01'];a41_0x1edb=function(){return _0x194a9c;};return a41_0x1edb();}import*as a41_0x54d3b4 from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a41_0x45e16c from'chalk';export function getConfigDir(){const _0x480393=a41_0x40c2;return process[_0x480393(0xf8)][_0x480393(0xe3)]||join(homedir(),_0x480393(0xd4),_0x480393(0xfa));}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x4549f5){const _0x4e8d8e=a41_0x40c2,_0x16c12b=getConfigDir();return _0x4549f5?a41_0x54d3b4['join'](_0x16c12b,_0x4e8d8e(0xae)+_0x4549f5):getConfigFile();}export function getCacheDir(){const _0x42ba1f=a41_0x40c2;return process[_0x42ba1f(0xf8)][_0x42ba1f(0xdc)]||join(homedir(),_0x42ba1f(0xb6),_0x42ba1f(0xfa));}export function getLLMProjectCacheFile(_0x31c991){const _0x204a6f=a41_0x40c2,_0x1d9118=_0x31c991?_0x204a6f(0xc9)+_0x31c991:_0x204a6f(0xe5);return join(getCacheDir(),_0x1d9118);}export function readCachedLLMProject(_0x8098){const _0xdab947=a41_0x40c2;try{const _0x184fc6=getLLMProjectCacheFile(_0x8098);if(!existsSync(_0x184fc6))return null;const _0x7ce120=readFileSync(_0x184fc6,_0xdab947(0xb7))[_0xdab947(0xf5)]();try{const _0x8c54a6=JSON['parse'](_0x7ce120);if(_0x8c54a6&&typeof _0x8c54a6['id']==='string'&&typeof _0x8c54a6['name']===_0xdab947(0xcf))return _0x8c54a6;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x5cdd83,_0x178c81,_0x2647c1){const _0x38fc84=a41_0x40c2;try{const _0x134921=getCacheDir(),_0xa8b8e5=getLLMProjectCacheFile(_0x2647c1);!existsSync(_0x134921)&&mkdirSync(_0x134921,{'recursive':!![]});const _0x488593={'name':_0x5cdd83,'id':_0x178c81};writeFileSync(_0xa8b8e5,JSON['stringify'](_0x488593),_0x38fc84(0xb7));}catch{}}export function getLLMAgentCacheFile(_0x2352b6){const _0x59ff9b=a41_0x40c2,_0x1abcec=_0x2352b6?'llm_default_agent.'+_0x2352b6:_0x59ff9b(0xe8);return join(getCacheDir(),_0x1abcec);}function a41_0x40c2(_0x133084,_0x3019e3){_0x133084=_0x133084-0xad;const _0x1edb36=a41_0x1edb();let _0x40c2fe=_0x1edb36[_0x133084];return _0x40c2fe;}export function readCachedLLMAgent(_0x56f3a2){const _0x157b0a=a41_0x40c2;try{const _0x578a3c=getLLMAgentCacheFile(_0x56f3a2);if(!existsSync(_0x578a3c))return null;const _0x5ca322=readFileSync(_0x578a3c,_0x157b0a(0xb7))[_0x157b0a(0xf5)]();try{const _0x2d3b19=JSON[_0x157b0a(0xea)](_0x5ca322);if(_0x2d3b19&&typeof _0x2d3b19['id']===_0x157b0a(0xcf)&&typeof _0x2d3b19[_0x157b0a(0xfd)]===_0x157b0a(0xcf)&&typeof _0x2d3b19[_0x157b0a(0xd7)]===_0x157b0a(0xcf))return _0x2d3b19;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x44756d,_0x42399c,_0x1e9dbb,_0x2e9052){const _0x582dbf=a41_0x40c2;try{const _0x2d99cb=getCacheDir(),_0x533826=getLLMAgentCacheFile(_0x2e9052);!existsSync(_0x2d99cb)&&mkdirSync(_0x2d99cb,{'recursive':!![]});const _0x143034={'name':_0x44756d,'id':_0x42399c,'projectId':_0x1e9dbb};writeFileSync(_0x533826,JSON['stringify'](_0x143034),_0x582dbf(0xb7));}catch{}}export function clearCachedLLMAgent(_0xc1e889){try{const _0x1ff9d6=getLLMAgentCacheFile(_0xc1e889);existsSync(_0x1ff9d6)&&unlinkSync(_0x1ff9d6);}catch{}}export function getAccountInfoCacheFile(_0x577a26){const _0x288fd3=a41_0x40c2,_0x415d83=_0x577a26?_0x288fd3(0xc6)+_0x577a26+_0x288fd3(0xbc):_0x288fd3(0xcb);return join(getCacheDir(),_0x415d83);}export function readCachedAccountInfo(_0x51672f){const _0x302444=a41_0x40c2;try{const _0x8fd14c=getAccountInfoCacheFile(_0x51672f);if(!existsSync(_0x8fd14c))return null;const _0x49a298=readFileSync(_0x8fd14c,_0x302444(0xb7))[_0x302444(0xf5)](),_0x4cd240=JSON[_0x302444(0xea)](_0x49a298);if(_0x4cd240&&typeof _0x4cd240[_0x302444(0xfe)]===_0x302444(0xcf)&&typeof _0x4cd240[_0x302444(0xc5)]===_0x302444(0xb8))return _0x4cd240;return null;}catch{return null;}}export function writeCachedAccountInfo(_0xc51068,_0x444bc3,_0x3464ae){const _0x13a3a5=a41_0x40c2;try{const _0x468eed=getCacheDir(),_0x4793fa=getAccountInfoCacheFile(_0x3464ae);!existsSync(_0x468eed)&&mkdirSync(_0x468eed,{'recursive':!![]});const _0x2b911d={'site':_0xc51068,'accountId':_0x444bc3,'cachedAt':new Date()[_0x13a3a5(0xce)]()};writeFileSync(_0x4793fa,JSON[_0x13a3a5(0xbf)](_0x2b911d),_0x13a3a5(0xb7));}catch{}}export function parseEnvFile(_0x2953ef){const _0x3249ea=a41_0x40c2,_0x16e9e2={};for(const _0xce8aa1 of _0x2953ef['split']('\x0a')){const _0xf37902=_0xce8aa1[_0x3249ea(0xf5)]();if(!_0xf37902||_0xf37902[_0x3249ea(0xdb)]('#'))continue;const _0x20edbc=_0xf37902[_0x3249ea(0xb9)](/^([^=]+)=(.*)$/);if(_0x20edbc){const _0x58496d=_0x20edbc[0x1][_0x3249ea(0xf5)]();let _0x438a58=_0x20edbc[0x2][_0x3249ea(0xf5)]();(_0x438a58[_0x3249ea(0xdb)]('\x22')&&_0x438a58[_0x3249ea(0xf7)]('\x22')||_0x438a58[_0x3249ea(0xdb)]('\x27')&&_0x438a58[_0x3249ea(0xf7)]('\x27'))&&(_0x438a58=_0x438a58[_0x3249ea(0xb1)](0x1,-0x1)),_0x16e9e2[_0x58496d]=_0x438a58;}}return _0x16e9e2;}export function readUserConfig(){const _0x1e1eaa=a41_0x40c2,_0x5deb04=getConfigFile();if(!existsSync(_0x5deb04))return{};try{const _0x636f37=readFileSync(_0x5deb04,_0x1e1eaa(0xb7));return parseEnvFile(_0x636f37);}catch(_0x2232ea){return console[_0x1e1eaa(0xcd)](_0x1e1eaa(0xd8)+_0x5deb04+':',_0x2232ea),{};}}export function resolveSite(_0x553248){const _0x454c74=a41_0x40c2,_0x13667a=[_0x454c74(0xad),'jp01',_0x454c74(0xef),'ap02',_0x454c74(0xfc),_0x454c74(0xde),_0x454c74(0xff),_0x454c74(0xe2),'stg-jp01',_0x454c74(0xf4)];if(_0x13667a[_0x454c74(0xb0)](_0x553248))return _0x553248;if(_0x553248 in SITE_ALIASES)return SITE_ALIASES[_0x553248];return console[_0x454c74(0xcd)](_0x454c74(0xc4)+_0x553248+_0x454c74(0xe4)),_0x454c74(0xad);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x123ccd,_0x172be3){const _0x54ec04=a41_0x40c2,_0x1b4d79=_0x172be3||getActiveProfileName();if(_0x1b4d79){const _0x4a2348=_0x54ec04(0xca)+normalizeProfileForEnvVar(_0x1b4d79);if(process['env'][_0x4a2348])return process['env'][_0x4a2348];}if(process['env'][_0x54ec04(0xc1)])return process['env'][_0x54ec04(0xc1)];if(process['env'][_0x54ec04(0xd6)])return process[_0x54ec04(0xf8)][_0x54ec04(0xd6)];const _0x2fcc56=_0x123ccd[_0x54ec04(0xc0)]()[_0x54ec04(0xd5)](/-/g,'_'),_0x5a82be='TD_API_KEY_'+_0x2fcc56;if(_0x1b4d79){const _0xe6e73f=loadProfileEnv(_0x1b4d79);if(_0xe6e73f){if(_0xe6e73f[_0x5a82be])return _0xe6e73f[_0x5a82be];if(_0xe6e73f[_0x54ec04(0xd6)])return _0xe6e73f['TD_API_KEY'];}}const _0x428eb4=loadUserConfigOnce();if(_0x428eb4[_0x5a82be])return _0x428eb4[_0x5a82be];if(_0x428eb4[_0x54ec04(0xd6)])return _0x428eb4['TD_API_KEY'];return undefined;}export function normalizeProfileForEnvVar(_0x3d6ed1){const _0x5c5ec2=a41_0x40c2;return _0x3d6ed1[_0x5c5ec2(0xc0)]()[_0x5c5ec2(0xd5)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x412488,_0x39df9e){const _0x3dff46=a41_0x40c2,_0xf47fc9=_0x39df9e||getActiveProfileName()||undefined;if(_0xf47fc9){const _0x3edc2c=_0x3dff46(0xca)+normalizeProfileForEnvVar(_0xf47fc9);if(process[_0x3dff46(0xf8)][_0x3edc2c])return{'apiKey':process[_0x3dff46(0xf8)][_0x3edc2c],'source':_0x3edc2c+_0x3dff46(0xf1),'isDeprecated':![]};const _0x263a96=getCachedCredential(_0x412488,_0xf47fc9);if(_0x263a96)return{'apiKey':_0x263a96,'source':_0x3dff46(0xe9)+_0xf47fc9+')','isDeprecated':![]};const _0x211a4f=await getKeychainAPIKey(_0xf47fc9);if(_0x211a4f)return setCachedCredential(_0x211a4f,_0x412488,_0xf47fc9),{'apiKey':_0x211a4f,'source':_0x3dff46(0xe9)+_0xf47fc9+')','isDeprecated':![]};}if(process['env'][_0x3dff46(0xc1)])return{'apiKey':process[_0x3dff46(0xf8)]['TDX_API_KEY'],'source':'TDX_API_KEY\x20env\x20var','isDeprecated':![]};if(!_0xf47fc9){const _0x310776=getCachedCredential(_0x412488,undefined);if(_0x310776)return{'apiKey':_0x310776,'source':_0x3dff46(0xd3),'isDeprecated':![]};const _0x433bc3=await getKeychainAPIKey(undefined);if(_0x433bc3)return setCachedCredential(_0x433bc3,_0x412488,undefined),{'apiKey':_0x433bc3,'source':_0x3dff46(0xd3),'isDeprecated':![]};}if(process[_0x3dff46(0xf8)]['TD_API_KEY'])return{'apiKey':process[_0x3dff46(0xf8)][_0x3dff46(0xd6)],'source':_0x3dff46(0xbe),'isDeprecated':!![]};const _0x109fb4=getLegacyEnvAPIKey(_0x412488,_0xf47fc9);if(_0x109fb4){const _0x371e3c=await isKeychainAvailable();if(_0x371e3c)try{await saveKeychainAPIKey(_0x109fb4,_0xf47fc9),setCachedCredential(_0x109fb4,_0x412488,_0xf47fc9);const _0x386aee=getConfigFilePath(_0xf47fc9);cleanupLegacyEnvFile(_0x386aee)&&console['warn'](a41_0x45e16c[_0x3dff46(0xb5)](_0x3dff46(0xf6)));}catch(_0x2e85f8){console[_0x3dff46(0xcd)](a41_0x45e16c[_0x3dff46(0xb5)](_0x3dff46(0xc3)+_0x2e85f8));}const _0x381ad0=_0xf47fc9?_0x3dff46(0xaf)+_0xf47fc9+')':_0x3dff46(0xc8);return{'apiKey':_0x109fb4,'source':_0x381ad0,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x2118b1,_0x1932f2,_0x41c725=!![]){const _0x4dbc5d=a41_0x40c2,_0x801354=await resolveAPIKeyAsync(_0x2118b1,_0x1932f2);if(!_0x801354)return undefined;if(_0x41c725&&_0x801354[_0x4dbc5d(0xd1)]&&_0x801354[_0x4dbc5d(0xec)][_0x4dbc5d(0xb0)](_0x4dbc5d(0xd6))){const _0x585ac9=_0x1932f2||getActiveProfileName()||undefined,_0x5dd2cd=_0x585ac9?_0x4dbc5d(0xca)+normalizeProfileForEnvVar(_0x585ac9):'TDX_API_KEY_<PROFILE>';console[_0x4dbc5d(0xcd)](a41_0x45e16c[_0x4dbc5d(0xb5)](_0x4dbc5d(0xd0)+('\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20'+_0x5dd2cd+').')));}return _0x801354[_0x4dbc5d(0xfb)];}function getLegacyEnvAPIKey(_0xfaffa9,_0x54ffbc){const _0x30cb1d=a41_0x40c2,_0xcbe187=_0xfaffa9[_0x30cb1d(0xc0)]()[_0x30cb1d(0xd5)](/-/g,'_'),_0x5054e7=_0x30cb1d(0xba)+_0xcbe187;if(_0x54ffbc){const _0xc95f2d=loadProfileEnv(_0x54ffbc);if(_0xc95f2d){if(_0xc95f2d[_0x5054e7])return _0xc95f2d[_0x5054e7];if(_0xc95f2d['TD_API_KEY'])return _0xc95f2d[_0x30cb1d(0xd6)];}}const _0x385e05=loadUserConfigOnce();if(_0x385e05[_0x5054e7])return _0x385e05[_0x5054e7];if(_0x385e05[_0x30cb1d(0xd6)])return _0x385e05[_0x30cb1d(0xd6)];return undefined;}function cleanupLegacyEnvFile(_0xe9d13d){const _0x109a53=a41_0x40c2;if(!existsSync(_0xe9d13d))return![];try{const _0xc8501d=readFileSync(_0xe9d13d,_0x109a53(0xb7)),_0x484649=_0xc8501d[_0x109a53(0xed)]('\x0a'),_0x7aae03=_0x484649[_0x109a53(0xc2)](_0x2e2fd8=>{const _0x284b29=_0x109a53,_0x59915c=_0x2e2fd8[_0x284b29(0xf5)]();if(!_0x59915c||_0x59915c[_0x284b29(0xdb)]('#'))return!![];const [_0x45d72c]=_0x59915c[_0x284b29(0xed)]('=');return!_0x45d72c['startsWith'](_0x284b29(0xd6));}),_0x58adc8=_0x7aae03['some'](_0x4e6c53=>{const _0xe9cbc=_0x109a53,_0x543fd7=_0x4e6c53[_0xe9cbc(0xf5)]();return _0x543fd7&&!_0x543fd7[_0xe9cbc(0xdb)]('#');});if(!_0x58adc8)return unlinkSync(_0xe9d13d),!![];return writeFileSync(_0xe9d13d,_0x7aae03[_0x109a53(0xdf)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x2b706e){const _0x4dcb96=a41_0x40c2,_0x383eec=a41_0x54d3b4[_0x4dcb96(0xdf)](getConfigDir(),_0x4dcb96(0xae)+_0x2b706e);if(a41_0x304a86[_0x4dcb96(0xf0)](_0x383eec)){validateSecureFilePermissions(_0x383eec);try{const _0x1720a9=a41_0x304a86[_0x4dcb96(0xc7)](_0x383eec,_0x4dcb96(0xb7));return parseEnvFile(_0x1720a9);}catch(_0x3c029d){console[_0x4dcb96(0xcd)]('Warning:\x20Failed\x20to\x20load\x20'+_0x383eec+':\x20'+_0x3c029d);}}const _0xf5aa84=a41_0x54d3b4[_0x4dcb96(0xdf)](getConfigDir(),_0x4dcb96(0xb3),_0x2b706e,'.env');if(a41_0x304a86[_0x4dcb96(0xf0)](_0xf5aa84)){validateSecureFilePermissions(_0xf5aa84);try{const _0x1231e0=a41_0x304a86[_0x4dcb96(0xc7)](_0xf5aa84,_0x4dcb96(0xb7));return parseEnvFile(_0x1231e0);}catch(_0x24f770){return console[_0x4dcb96(0xcd)]('Warning:\x20Failed\x20to\x20load\x20'+_0xf5aa84+':\x20'+_0x24f770),null;}}return null;}function getActiveProfileName(){const _0x38d401=a41_0x40c2,_0x518db6=a41_0x54d3b4['join'](getConfigDir(),_0x38d401(0xdd));if(!a41_0x304a86[_0x38d401(0xf0)](_0x518db6))return null;try{const _0x4a20eb=a41_0x304a86[_0x38d401(0xc7)](_0x518db6,'utf-8'),_0x1fcb7d=JSON['parse'](_0x4a20eb);return _0x1fcb7d[_0x38d401(0xf9)]||null;}catch{return null;}}export function saveAPIKey(_0x294658,_0x3e80de,_0x4f1d13){const _0x3333ec=a41_0x40c2,_0x2306eb=getConfigDir(),_0x22148e=getConfigFilePath(_0x4f1d13);!existsSync(_0x2306eb)&&mkdirSync(_0x2306eb,{'recursive':!![],'mode':0x1c0});let _0x387487={};if(existsSync(_0x22148e))try{const _0x5a6fbd=readFileSync(_0x22148e,_0x3333ec(0xb7));_0x387487=parseEnvFile(_0x5a6fbd);}catch(_0x239d43){console[_0x3333ec(0xcd)](_0x3333ec(0xbd)+_0x22148e+':',_0x239d43);}const _0x2c1bbd=_0x294658[_0x3333ec(0xc0)]()['replace'](/-/g,'_');_0x387487['TD_API_KEY_'+_0x2c1bbd]=_0x3e80de;const _0x2b1fe8=Object[_0x3333ec(0xd9)](_0x387487)[_0x3333ec(0xbb)](([_0x5a1d70,_0x32d143])=>_0x5a1d70+'='+_0x32d143);writeFileSync(_0x22148e,_0x2b1fe8[_0x3333ec(0xdf)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x1d6571,_0x2c3ad6,_0x561d36){const _0x46db06=a41_0x40c2;await saveKeychainAPIKey(_0x1d6571,_0x561d36),setCachedCredential(_0x1d6571,_0x2c3ad6,_0x561d36);const _0x272869=getConfigFilePath(_0x561d36);cleanupLegacyEnvFile(_0x272869)&&console[_0x46db06(0xcd)](a41_0x45e16c[_0x46db06(0xb5)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x5bf4f1=a41_0x40c2,_0x313582={'apiKeys':{},'defaultSite':_0x5bf4f1(0xad)},_0x491a29=['us01',_0x5bf4f1(0xda),'eu01',_0x5bf4f1(0xee),_0x5bf4f1(0xfc),_0x5bf4f1(0xde),_0x5bf4f1(0xff),_0x5bf4f1(0xe2),_0x5bf4f1(0xeb),_0x5bf4f1(0xf4)];for(const _0x523fcb of _0x491a29){const _0x5de419=getAPIKey(_0x523fcb);_0x5de419&&(_0x313582[_0x5bf4f1(0xb2)][_0x523fcb]=_0x5de419);}return _0x313582;}
1
+ (function(_0x399d4e,_0x47cf5c){const _0x14a61b=a41_0x3349,_0xf4c45a=_0x399d4e();while(!![]){try{const _0x3fc156=parseInt(_0x14a61b(0xcd))/0x1*(parseInt(_0x14a61b(0xc6))/0x2)+parseInt(_0x14a61b(0xc8))/0x3+parseInt(_0x14a61b(0xa6))/0x4+parseInt(_0x14a61b(0xa8))/0x5+-parseInt(_0x14a61b(0xad))/0x6+parseInt(_0x14a61b(0xb1))/0x7*(parseInt(_0x14a61b(0xe1))/0x8)+-parseInt(_0x14a61b(0xb8))/0x9;if(_0x3fc156===_0x47cf5c)break;else _0xf4c45a['push'](_0xf4c45a['shift']());}catch(_0x1e5be0){_0xf4c45a['push'](_0xf4c45a['shift']());}}}(a41_0x4afa,0xe9c1e));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a41_0x7870af from'node:fs';import*as a41_0x591ca6 from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';function a41_0x4afa(){const _0x2ece7f=['accountId','yellow','readFileSync','.env','parse','stg-jp01','Warning:\x20Failed\x20to\x20read\x20','apiKey','slice','replace','24WthDYT','llm_default_agent','stg-us01','eu01','legacy\x20.env\x20file','keychain','llm_default_agent.','entries','utf-8','number','profiles','.env.','profile','stringify','jp01','TDX_API_KEY_','source','llm_default_project','llm_default_project.','dev-us01','7256348bgdRpS','tdx','4343200ijULYI','dev-eu01','TD_API_KEY_','some','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','10654362qHNBzL','trim','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','toUpperCase','3676785dBJxaR','ap03','includes','TDX_CACHE_DIR','.cache','TDX_API_KEY\x20env\x20var','warn','23298786ELSYTB','TDX_CONFIG_DIR','stg-ap03','endsWith','TD_API_KEY','startsWith','tdx.json','account_info.json','TDX_API_KEY_<PROFILE>','site','\x27,\x20defaulting\x20to\x20us01','split','.json','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','760vBNOek','TDX_API_KEY','2526897rQNxlr','string','join','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','match','582JoSdWC','name','existsSync','env','map','apiKeys','Warning:\x20Unknown\x20site\x20\x27','projectId','legacy\x20.env\x20file\x20(profile:\x20','us01'];a41_0x4afa=function(){return _0x2ece7f;};return a41_0x4afa();}import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a41_0x28fdd5 from'chalk';function a41_0x3349(_0xe754b9,_0x56e610){_0xe754b9=_0xe754b9-0x9e;const _0x4afa5d=a41_0x4afa();let _0x334926=_0x4afa5d[_0xe754b9];return _0x334926;}export function getConfigDir(){const _0x221141=a41_0x3349;return process['env'][_0x221141(0xb9)]||join(homedir(),'.config','tdx');}export function getConfigFile(){const _0x51f217=a41_0x3349;return join(getConfigDir(),_0x51f217(0xda));}export function getConfigFilePath(_0x475c19){const _0x289bfd=a41_0x3349,_0x1e0464=getConfigDir();return _0x475c19?a41_0x591ca6[_0x289bfd(0xca)](_0x1e0464,_0x289bfd(0xec)+_0x475c19):getConfigFile();}export function getCacheDir(){const _0x2439ac=a41_0x3349;return process[_0x2439ac(0xd0)][_0x2439ac(0xb4)]||join(homedir(),_0x2439ac(0xb5),_0x2439ac(0xa7));}export function getLLMProjectCacheFile(_0x2b5da8){const _0x3425c0=a41_0x3349,_0xf2a348=_0x2b5da8?_0x3425c0(0xa4)+_0x2b5da8:_0x3425c0(0xa3);return join(getCacheDir(),_0xf2a348);}export function readCachedLLMProject(_0x310136){const _0x427567=a41_0x3349;try{const _0x39fa59=getLLMProjectCacheFile(_0x310136);if(!existsSync(_0x39fa59))return null;const _0x54cb8f=readFileSync(_0x39fa59,_0x427567(0xe9))[_0x427567(0xae)]();try{const _0x3409ea=JSON[_0x427567(0xdb)](_0x54cb8f);if(_0x3409ea&&typeof _0x3409ea['id']==='string'&&typeof _0x3409ea[_0x427567(0xce)]===_0x427567(0xc9))return _0x3409ea;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x31715a,_0x46073d,_0x377bbd){const _0x15f815=a41_0x3349;try{const _0x323a02=getCacheDir(),_0x5a7512=getLLMProjectCacheFile(_0x377bbd);!existsSync(_0x323a02)&&mkdirSync(_0x323a02,{'recursive':!![]});const _0x507d02={'name':_0x31715a,'id':_0x46073d};writeFileSync(_0x5a7512,JSON[_0x15f815(0x9f)](_0x507d02),_0x15f815(0xe9));}catch{}}export function getLLMAgentCacheFile(_0x381acd){const _0x3c0657=a41_0x3349,_0xf2449c=_0x381acd?_0x3c0657(0xe7)+_0x381acd:_0x3c0657(0xe2);return join(getCacheDir(),_0xf2449c);}export function readCachedLLMAgent(_0x175dbe){const _0x582b6b=a41_0x3349;try{const _0x7958b5=getLLMAgentCacheFile(_0x175dbe);if(!existsSync(_0x7958b5))return null;const _0x406ba9=readFileSync(_0x7958b5,_0x582b6b(0xe9))[_0x582b6b(0xae)]();try{const _0x1dd240=JSON[_0x582b6b(0xdb)](_0x406ba9);if(_0x1dd240&&typeof _0x1dd240['id']===_0x582b6b(0xc9)&&typeof _0x1dd240[_0x582b6b(0xce)]==='string'&&typeof _0x1dd240[_0x582b6b(0xd4)]===_0x582b6b(0xc9))return _0x1dd240;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x506f47,_0x2c2741,_0x2ae2d6,_0x3cfe62){const _0x149ce4=a41_0x3349;try{const _0x657bf1=getCacheDir(),_0x343730=getLLMAgentCacheFile(_0x3cfe62);!existsSync(_0x657bf1)&&mkdirSync(_0x657bf1,{'recursive':!![]});const _0x4cb664={'name':_0x506f47,'id':_0x2c2741,'projectId':_0x2ae2d6};writeFileSync(_0x343730,JSON['stringify'](_0x4cb664),_0x149ce4(0xe9));}catch{}}export function clearCachedLLMAgent(_0x1f8d2c){try{const _0x365400=getLLMAgentCacheFile(_0x1f8d2c);existsSync(_0x365400)&&unlinkSync(_0x365400);}catch{}}export function getAccountInfoCacheFile(_0x72d378){const _0xee7ce2=a41_0x3349,_0x14877a=_0x72d378?'account_info.'+_0x72d378+_0xee7ce2(0xc4):_0xee7ce2(0xbf);return join(getCacheDir(),_0x14877a);}export function readCachedAccountInfo(_0x586124){const _0x1372df=a41_0x3349;try{const _0x534147=getAccountInfoCacheFile(_0x586124);if(!existsSync(_0x534147))return null;const _0x2f626d=readFileSync(_0x534147,_0x1372df(0xe9))[_0x1372df(0xae)](),_0x224c3e=JSON[_0x1372df(0xdb)](_0x2f626d);if(_0x224c3e&&typeof _0x224c3e[_0x1372df(0xc1)]===_0x1372df(0xc9)&&typeof _0x224c3e[_0x1372df(0xd7)]===_0x1372df(0xea))return _0x224c3e;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x5a2be8,_0x35257f,_0x26a79){const _0x4ad71c=a41_0x3349;try{const _0x4c8882=getCacheDir(),_0x5c27bf=getAccountInfoCacheFile(_0x26a79);!existsSync(_0x4c8882)&&mkdirSync(_0x4c8882,{'recursive':!![]});const _0x331b53={'site':_0x5a2be8,'accountId':_0x35257f,'cachedAt':new Date()['toISOString']()};writeFileSync(_0x5c27bf,JSON[_0x4ad71c(0x9f)](_0x331b53),_0x4ad71c(0xe9));}catch{}}export function parseEnvFile(_0x536f34){const _0x357f49=a41_0x3349,_0x44f294={};for(const _0x5c289d of _0x536f34[_0x357f49(0xc3)]('\x0a')){const _0x17a6b7=_0x5c289d[_0x357f49(0xae)]();if(!_0x17a6b7||_0x17a6b7[_0x357f49(0xbd)]('#'))continue;const _0x1ec520=_0x17a6b7[_0x357f49(0xcc)](/^([^=]+)=(.*)$/);if(_0x1ec520){const _0x2361ec=_0x1ec520[0x1]['trim']();let _0x106a4e=_0x1ec520[0x2]['trim']();(_0x106a4e['startsWith']('\x22')&&_0x106a4e[_0x357f49(0xbb)]('\x22')||_0x106a4e[_0x357f49(0xbd)]('\x27')&&_0x106a4e['endsWith']('\x27'))&&(_0x106a4e=_0x106a4e[_0x357f49(0xdf)](0x1,-0x1)),_0x44f294[_0x2361ec]=_0x106a4e;}}return _0x44f294;}export function readUserConfig(){const _0x339992=a41_0x3349,_0x3ee4f0=getConfigFile();if(!existsSync(_0x3ee4f0))return{};try{const _0x3c1765=readFileSync(_0x3ee4f0,_0x339992(0xe9));return parseEnvFile(_0x3c1765);}catch(_0x2404cc){return console[_0x339992(0xb7)](_0x339992(0xcb)+_0x3ee4f0+':',_0x2404cc),{};}}export function resolveSite(_0x24c9bc){const _0x56ed69=a41_0x3349,_0x4ae006=[_0x56ed69(0xd6),_0x56ed69(0xa0),'eu01','ap02','ap03','dev-us01','dev-eu01',_0x56ed69(0xe3),_0x56ed69(0xdc),_0x56ed69(0xba)];if(_0x4ae006['includes'](_0x24c9bc))return _0x24c9bc;if(_0x24c9bc in SITE_ALIASES)return SITE_ALIASES[_0x24c9bc];return console['warn'](_0x56ed69(0xd3)+_0x24c9bc+_0x56ed69(0xc2)),_0x56ed69(0xd6);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x508b35,_0x5c66af){const _0x350358=a41_0x3349,_0x814151=_0x5c66af||getActiveProfileName();if(_0x814151){const _0xe12532=_0x350358(0xa1)+normalizeProfileForEnvVar(_0x814151);if(process[_0x350358(0xd0)][_0xe12532])return process[_0x350358(0xd0)][_0xe12532];}if(process[_0x350358(0xd0)][_0x350358(0xc7)])return process['env'][_0x350358(0xc7)];if(process['env'][_0x350358(0xbc)])return process[_0x350358(0xd0)]['TD_API_KEY'];const _0x12e410=_0x508b35[_0x350358(0xb0)]()[_0x350358(0xe0)](/-/g,'_'),_0x192fb5=_0x350358(0xaa)+_0x12e410;if(_0x814151){const _0x31deee=loadProfileEnv(_0x814151);if(_0x31deee){if(_0x31deee[_0x192fb5])return _0x31deee[_0x192fb5];if(_0x31deee[_0x350358(0xbc)])return _0x31deee[_0x350358(0xbc)];}}const _0x419c3e=loadUserConfigOnce();if(_0x419c3e[_0x192fb5])return _0x419c3e[_0x192fb5];if(_0x419c3e[_0x350358(0xbc)])return _0x419c3e[_0x350358(0xbc)];return undefined;}export function normalizeProfileForEnvVar(_0x4c75bf){const _0x454fa9=a41_0x3349;return _0x4c75bf[_0x454fa9(0xb0)]()[_0x454fa9(0xe0)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x933750,_0x587350){const _0x2331d6=a41_0x3349,_0x3e3ba5=_0x587350||getActiveProfileName()||undefined;if(_0x3e3ba5){const _0x16e0d4='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x3e3ba5);if(process[_0x2331d6(0xd0)][_0x16e0d4])return{'apiKey':process[_0x2331d6(0xd0)][_0x16e0d4],'source':_0x16e0d4+'\x20env\x20var','isDeprecated':![]};const _0x12761a=getCachedCredential(_0x933750,_0x3e3ba5);if(_0x12761a)return{'apiKey':_0x12761a,'source':'keychain\x20(profile:\x20'+_0x3e3ba5+')','isDeprecated':![]};const _0x40bf75=await getKeychainAPIKey(_0x3e3ba5);if(_0x40bf75)return setCachedCredential(_0x40bf75,_0x933750,_0x3e3ba5),{'apiKey':_0x40bf75,'source':'keychain\x20(profile:\x20'+_0x3e3ba5+')','isDeprecated':![]};}if(process['env'][_0x2331d6(0xc7)])return{'apiKey':process[_0x2331d6(0xd0)][_0x2331d6(0xc7)],'source':_0x2331d6(0xb6),'isDeprecated':![]};if(!_0x3e3ba5){const _0x2b3fdb=getCachedCredential(_0x933750,undefined);if(_0x2b3fdb)return{'apiKey':_0x2b3fdb,'source':_0x2331d6(0xe6),'isDeprecated':![]};const _0x463cd4=await getKeychainAPIKey(undefined);if(_0x463cd4)return setCachedCredential(_0x463cd4,_0x933750,undefined),{'apiKey':_0x463cd4,'source':_0x2331d6(0xe6),'isDeprecated':![]};}if(process['env'][_0x2331d6(0xbc)])return{'apiKey':process[_0x2331d6(0xd0)][_0x2331d6(0xbc)],'source':'TD_API_KEY\x20env\x20var\x20(deprecated)','isDeprecated':!![]};const _0x11d6bf=getLegacyEnvAPIKey(_0x933750,_0x3e3ba5);if(_0x11d6bf){const _0x142046=await isKeychainAvailable();if(_0x142046)try{await saveKeychainAPIKey(_0x11d6bf,_0x3e3ba5),setCachedCredential(_0x11d6bf,_0x933750,_0x3e3ba5);const _0x5a04a0=getConfigFilePath(_0x3e3ba5);cleanupLegacyEnvFile(_0x5a04a0)&&console['warn'](a41_0x28fdd5['yellow'](_0x2331d6(0xc5)));}catch(_0x4896ab){console[_0x2331d6(0xb7)](a41_0x28fdd5[_0x2331d6(0xd8)](_0x2331d6(0xaf)+_0x4896ab));}const _0x23afe8=_0x3e3ba5?_0x2331d6(0xd5)+_0x3e3ba5+')':_0x2331d6(0xe5);return{'apiKey':_0x11d6bf,'source':_0x23afe8,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x413352,_0x41e4f8,_0x3844ae=!![]){const _0xf9224b=a41_0x3349,_0x5464cd=await resolveAPIKeyAsync(_0x413352,_0x41e4f8);if(!_0x5464cd)return undefined;if(_0x3844ae&&_0x5464cd['isDeprecated']&&_0x5464cd[_0xf9224b(0xa2)][_0xf9224b(0xb3)]('TD_API_KEY')){const _0x53133d=_0x41e4f8||getActiveProfileName()||undefined,_0x248cbe=_0x53133d?_0xf9224b(0xa1)+normalizeProfileForEnvVar(_0x53133d):_0xf9224b(0xc0);console[_0xf9224b(0xb7)](a41_0x28fdd5[_0xf9224b(0xd8)](_0xf9224b(0xac)+('\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20'+_0x248cbe+').')));}return _0x5464cd[_0xf9224b(0xde)];}function getLegacyEnvAPIKey(_0x58d637,_0x375d3d){const _0x588088=a41_0x3349,_0x137ec9=_0x58d637[_0x588088(0xb0)]()[_0x588088(0xe0)](/-/g,'_'),_0x37db33='TD_API_KEY_'+_0x137ec9;if(_0x375d3d){const _0x2fee62=loadProfileEnv(_0x375d3d);if(_0x2fee62){if(_0x2fee62[_0x37db33])return _0x2fee62[_0x37db33];if(_0x2fee62[_0x588088(0xbc)])return _0x2fee62[_0x588088(0xbc)];}}const _0x3c9f1a=loadUserConfigOnce();if(_0x3c9f1a[_0x37db33])return _0x3c9f1a[_0x37db33];if(_0x3c9f1a[_0x588088(0xbc)])return _0x3c9f1a[_0x588088(0xbc)];return undefined;}function cleanupLegacyEnvFile(_0x4124bc){const _0x48f2b8=a41_0x3349;if(!existsSync(_0x4124bc))return![];try{const _0x31bbad=readFileSync(_0x4124bc,'utf-8'),_0x46d70f=_0x31bbad[_0x48f2b8(0xc3)]('\x0a'),_0x43f179=_0x46d70f['filter'](_0xad8c0d=>{const _0x1b2246=_0x48f2b8,_0x46416f=_0xad8c0d[_0x1b2246(0xae)]();if(!_0x46416f||_0x46416f[_0x1b2246(0xbd)]('#'))return!![];const [_0x3a6c05]=_0x46416f['split']('=');return!_0x3a6c05[_0x1b2246(0xbd)](_0x1b2246(0xbc));}),_0x28397b=_0x43f179[_0x48f2b8(0xab)](_0x3ab353=>{const _0x213094=_0x48f2b8,_0x29a40d=_0x3ab353[_0x213094(0xae)]();return _0x29a40d&&!_0x29a40d[_0x213094(0xbd)]('#');});if(!_0x28397b)return unlinkSync(_0x4124bc),!![];return writeFileSync(_0x4124bc,_0x43f179[_0x48f2b8(0xca)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x3cd4f0){const _0x33a705=a41_0x3349,_0x31323f=a41_0x591ca6[_0x33a705(0xca)](getConfigDir(),_0x33a705(0xec)+_0x3cd4f0);if(a41_0x7870af[_0x33a705(0xcf)](_0x31323f)){validateSecureFilePermissions(_0x31323f);try{const _0x2a9c60=a41_0x7870af[_0x33a705(0xd9)](_0x31323f,_0x33a705(0xe9));return parseEnvFile(_0x2a9c60);}catch(_0x22f559){console[_0x33a705(0xb7)]('Warning:\x20Failed\x20to\x20load\x20'+_0x31323f+':\x20'+_0x22f559);}}const _0x5e1391=a41_0x591ca6[_0x33a705(0xca)](getConfigDir(),_0x33a705(0xeb),_0x3cd4f0,_0x33a705(0xda));if(a41_0x7870af[_0x33a705(0xcf)](_0x5e1391)){validateSecureFilePermissions(_0x5e1391);try{const _0x2b8338=a41_0x7870af[_0x33a705(0xd9)](_0x5e1391,_0x33a705(0xe9));return parseEnvFile(_0x2b8338);}catch(_0x1b6ef6){return console[_0x33a705(0xb7)]('Warning:\x20Failed\x20to\x20load\x20'+_0x5e1391+':\x20'+_0x1b6ef6),null;}}return null;}function getActiveProfileName(){const _0x17c51b=a41_0x3349,_0xe77095=a41_0x591ca6['join'](getConfigDir(),_0x17c51b(0xbe));if(!a41_0x7870af[_0x17c51b(0xcf)](_0xe77095))return null;try{const _0x1cabe4=a41_0x7870af[_0x17c51b(0xd9)](_0xe77095,_0x17c51b(0xe9)),_0x12ec20=JSON[_0x17c51b(0xdb)](_0x1cabe4);return _0x12ec20[_0x17c51b(0x9e)]||null;}catch{return null;}}export function saveAPIKey(_0x384502,_0x184b78,_0x1d8e9b){const _0x16e1c5=a41_0x3349,_0x4dbad5=getConfigDir(),_0x453c87=getConfigFilePath(_0x1d8e9b);!existsSync(_0x4dbad5)&&mkdirSync(_0x4dbad5,{'recursive':!![],'mode':0x1c0});let _0x12bcac={};if(existsSync(_0x453c87))try{const _0xb1a347=readFileSync(_0x453c87,_0x16e1c5(0xe9));_0x12bcac=parseEnvFile(_0xb1a347);}catch(_0x84bf8b){console[_0x16e1c5(0xb7)](_0x16e1c5(0xdd)+_0x453c87+':',_0x84bf8b);}const _0x3e124c=_0x384502[_0x16e1c5(0xb0)]()[_0x16e1c5(0xe0)](/-/g,'_');_0x12bcac[_0x16e1c5(0xaa)+_0x3e124c]=_0x184b78;const _0x2aae7b=Object[_0x16e1c5(0xe8)](_0x12bcac)[_0x16e1c5(0xd1)](([_0x8c6e2b,_0x8cca65])=>_0x8c6e2b+'='+_0x8cca65);writeFileSync(_0x453c87,_0x2aae7b[_0x16e1c5(0xca)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x5ce00c,_0x233714,_0x2afa8f){const _0x4b06cd=a41_0x3349;await saveKeychainAPIKey(_0x5ce00c,_0x2afa8f),setCachedCredential(_0x5ce00c,_0x233714,_0x2afa8f);const _0x519290=getConfigFilePath(_0x2afa8f);cleanupLegacyEnvFile(_0x519290)&&console[_0x4b06cd(0xb7)](a41_0x28fdd5[_0x4b06cd(0xd8)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x547168=a41_0x3349,_0x24364d={'apiKeys':{},'defaultSite':'us01'},_0x395ce5=[_0x547168(0xd6),_0x547168(0xa0),_0x547168(0xe4),'ap02',_0x547168(0xb2),_0x547168(0xa5),_0x547168(0xa9),_0x547168(0xe3),'stg-jp01','stg-ap03'];for(const _0x951ece of _0x395ce5){const _0x4dcbcc=getAPIKey(_0x951ece);_0x4dcbcc&&(_0x24364d[_0x547168(0xd2)][_0x951ece]=_0x4dcbcc);}return _0x24364d;}
@@ -1 +1 @@
1
- (function(_0x2a6d14,_0x294f97){const _0x1363f0=a42_0x28ca,_0x3d17c4=_0x2a6d14();while(!![]){try{const _0x1b0a4e=-parseInt(_0x1363f0(0x163))/0x1+parseInt(_0x1363f0(0x158))/0x2*(-parseInt(_0x1363f0(0x15d))/0x3)+parseInt(_0x1363f0(0x161))/0x4*(parseInt(_0x1363f0(0x157))/0x5)+parseInt(_0x1363f0(0x162))/0x6+-parseInt(_0x1363f0(0x15e))/0x7*(parseInt(_0x1363f0(0x156))/0x8)+parseInt(_0x1363f0(0x166))/0x9*(-parseInt(_0x1363f0(0x165))/0xa)+parseInt(_0x1363f0(0x159))/0xb*(parseInt(_0x1363f0(0x15b))/0xc);if(_0x1b0a4e===_0x294f97)break;else _0x3d17c4['push'](_0x3d17c4['shift']());}catch(_0x116579){_0x3d17c4['push'](_0x3d17c4['shift']());}}}(a42_0x51be,0x88d0b));function a42_0x51be(){const _0xf596d7=['9YihdID','parse','utf-8','6312zkAEak','5305LSbGBT','34010rIOcOT','9361sRsMRX','now','26328TdDZGG','connections','33yPupZq','2177noGrTW','.json','connections-','476wymyfX','2283336eZvGhe','1024582JFRrIM','stringify','3564980nvpxGq'];a42_0x51be=function(){return _0xf596d7;};return a42_0x51be();}import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function getCacheFilePath(_0x32c150){const _0xbe247e=a42_0x28ca,_0xa6feb7=_0x32c150||'default';return join(getCacheDir(),_0xbe247e(0x160)+_0xa6feb7+_0xbe247e(0x15f));}function a42_0x28ca(_0x384e77,_0x422880){_0x384e77=_0x384e77-0x156;const _0x51be24=a42_0x51be();let _0x28cad5=_0x51be24[_0x384e77];return _0x28cad5;}export function loadCachedConnections(_0xf38b59){const _0x4fd026=a42_0x28ca,_0x38a770=getCacheFilePath(_0xf38b59);if(!existsSync(_0x38a770))return null;try{const _0x263e15=readFileSync(_0x38a770,_0x4fd026(0x168)),_0x49bcdd=JSON[_0x4fd026(0x167)](_0x263e15);return _0x49bcdd[_0x4fd026(0x15c)];}catch{return null;}}export function saveCachedConnections(_0x44be77,_0x3ee964){const _0x54f3fb=a42_0x28ca,_0x1d70c8=getCacheDir();!existsSync(_0x1d70c8)&&mkdirSync(_0x1d70c8,{'recursive':!![]});const _0x59ae81=getCacheFilePath(_0x44be77),_0x1ad863={'connections':_0x3ee964,'cachedAt':Date[_0x54f3fb(0x15a)]()};writeFileSync(_0x59ae81,JSON[_0x54f3fb(0x164)](_0x1ad863,null,0x2),_0x54f3fb(0x168));}export function clearConnectionCache(_0x5d67dd){const _0x330806=getCacheFilePath(_0x5d67dd);if(existsSync(_0x330806))try{unlinkSync(_0x330806);}catch{}}
1
+ (function(_0x20fd08,_0x2ef46c){const _0x1d99a3=a42_0x1848,_0x3f370d=_0x20fd08();while(!![]){try{const _0x382b54=parseInt(_0x1d99a3(0x156))/0x1*(parseInt(_0x1d99a3(0x151))/0x2)+-parseInt(_0x1d99a3(0x157))/0x3*(-parseInt(_0x1d99a3(0x159))/0x4)+parseInt(_0x1d99a3(0x153))/0x5+parseInt(_0x1d99a3(0x14d))/0x6*(parseInt(_0x1d99a3(0x14e))/0x7)+parseInt(_0x1d99a3(0x15d))/0x8+parseInt(_0x1d99a3(0x158))/0x9*(-parseInt(_0x1d99a3(0x15c))/0xa)+-parseInt(_0x1d99a3(0x14c))/0xb*(parseInt(_0x1d99a3(0x14f))/0xc);if(_0x382b54===_0x2ef46c)break;else _0x3f370d['push'](_0x3f370d['shift']());}catch(_0x345cc9){_0x3f370d['push'](_0x3f370d['shift']());}}}(a42_0x4e26,0x8f966));function a42_0x4e26(){const _0x22b2ed=['now','110014qgPyME','stringify','4457705TGQUcL','utf-8','connections','1feNjeK','3FKzUhH','2745SMipna','2287556vsRdod','.json','connections-','31940KBfFwO','43648clTrAS','parse','4125nDqpMO','6VQZXsL','862127ByYNPW','2712PHipmm'];a42_0x4e26=function(){return _0x22b2ed;};return a42_0x4e26();}import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function getCacheFilePath(_0x64b713){const _0x1fdbf1=a42_0x1848,_0x2a4a04=_0x64b713||'default';return join(getCacheDir(),_0x1fdbf1(0x15b)+_0x2a4a04+_0x1fdbf1(0x15a));}function a42_0x1848(_0x55ebd6,_0x5c8bd2){_0x55ebd6=_0x55ebd6-0x14c;const _0x4e26f1=a42_0x4e26();let _0x1848fa=_0x4e26f1[_0x55ebd6];return _0x1848fa;}export function loadCachedConnections(_0x100de8){const _0x3cd4c5=a42_0x1848,_0x104cea=getCacheFilePath(_0x100de8);if(!existsSync(_0x104cea))return null;try{const _0x255963=readFileSync(_0x104cea,_0x3cd4c5(0x154)),_0x25c0c3=JSON[_0x3cd4c5(0x15e)](_0x255963);return _0x25c0c3[_0x3cd4c5(0x155)];}catch{return null;}}export function saveCachedConnections(_0x452487,_0x549ed0){const _0x1eef21=a42_0x1848,_0x2f1ee8=getCacheDir();!existsSync(_0x2f1ee8)&&mkdirSync(_0x2f1ee8,{'recursive':!![]});const _0x164c97=getCacheFilePath(_0x452487),_0x28e2bd={'connections':_0x549ed0,'cachedAt':Date[_0x1eef21(0x150)]()};writeFileSync(_0x164c97,JSON[_0x1eef21(0x152)](_0x28e2bd,null,0x2),'utf-8');}export function clearConnectionCache(_0x3c9148){const _0x5c146f=getCacheFilePath(_0x3c9148);if(existsSync(_0x5c146f))try{unlinkSync(_0x5c146f);}catch{}}
@@ -1 +1 @@
1
- (function(_0x2096bf,_0x68d7be){const _0x56d4f0=a43_0x1856,_0x26bb9d=_0x2096bf();while(!![]){try{const _0x434f73=-parseInt(_0x56d4f0(0xe3))/0x1+parseInt(_0x56d4f0(0xd9))/0x2+parseInt(_0x56d4f0(0xe1))/0x3+parseInt(_0x56d4f0(0xda))/0x4*(parseInt(_0x56d4f0(0xdb))/0x5)+parseInt(_0x56d4f0(0xdf))/0x6*(parseInt(_0x56d4f0(0xdc))/0x7)+parseInt(_0x56d4f0(0xe0))/0x8*(parseInt(_0x56d4f0(0xe2))/0x9)+-parseInt(_0x56d4f0(0xde))/0xa;if(_0x434f73===_0x68d7be)break;else _0x26bb9d['push'](_0x26bb9d['shift']());}catch(_0x54cc02){_0x26bb9d['push'](_0x26bb9d['shift']());}}}(a43_0x4eb9,0x91e6d));export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;function a43_0x4eb9(){const _0x284030=['7kdEIjG','number','29414870DFizUX','3442794lPRxpc','80fRPatY','1579041DcyWPj','1021455fmBCtq','274063hdiKoJ','1818394Lazbfm','1268pRwKBP','10550HAHbEk'];a43_0x4eb9=function(){return _0x284030;};return a43_0x4eb9();}export const DEFAULT_LLM_LIMIT=0x32;function a43_0x1856(_0x1fedeb,_0x5c2def){_0x1fedeb=_0x1fedeb-0xd9;const _0x4eb949=a43_0x4eb9();let _0x185600=_0x4eb949[_0x1fedeb];return _0x185600;}export function resolveLimit(_0x4094c4,_0x3df645){const _0x2e96f9=a43_0x1856;if(_0x4094c4===undefined)return _0x3df645;if(typeof _0x4094c4===_0x2e96f9(0xdd))return _0x4094c4;return parseInt(_0x4094c4,0xa);}
1
+ (function(_0x293c14,_0x59cbdd){const _0x13129b=a43_0x51e0,_0x1d665c=_0x293c14();while(!![]){try{const _0x5a05f0=-parseInt(_0x13129b(0x121))/0x1+parseInt(_0x13129b(0x120))/0x2*(-parseInt(_0x13129b(0x11a))/0x3)+parseInt(_0x13129b(0x11d))/0x4+-parseInt(_0x13129b(0x11b))/0x5*(-parseInt(_0x13129b(0x11c))/0x6)+parseInt(_0x13129b(0x11f))/0x7*(parseInt(_0x13129b(0x119))/0x8)+-parseInt(_0x13129b(0x11e))/0x9+-parseInt(_0x13129b(0x118))/0xa;if(_0x5a05f0===_0x59cbdd)break;else _0x1d665c['push'](_0x1d665c['shift']());}catch(_0x3664ba){_0x1d665c['push'](_0x1d665c['shift']());}}}(a43_0x4ce6,0xcd811));function a43_0x51e0(_0x3cdfe9,_0x591344){_0x3cdfe9=_0x3cdfe9-0x117;const _0x4ce6ce=a43_0x4ce6();let _0x51e04c=_0x4ce6ce[_0x3cdfe9];return _0x51e04c;}export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x476d80,_0x17e9f8){const _0x50bff6=a43_0x51e0;if(_0x476d80===undefined)return _0x17e9f8;if(typeof _0x476d80===_0x50bff6(0x117))return _0x476d80;return parseInt(_0x476d80,0xa);}function a43_0x4ce6(){const _0x1c1824=['712mDcCmy','18237UdJPxy','5MzpTxi','8316078Mraycz','5155520lvYKnF','6476976RGqUjQ','40047xFrFmN','94MSpqQx','762933JwIbiB','number','5740070xZAzXU'];a43_0x4ce6=function(){return _0x1c1824;};return a43_0x4ce6();}
@@ -1 +1 @@
1
- (function(_0x2d292f,_0x1ed3cf){const _0x36eacd=a44_0x53ca,_0x5b0a66=_0x2d292f();while(!![]){try{const _0x463d39=parseInt(_0x36eacd(0x187))/0x1+parseInt(_0x36eacd(0x17d))/0x2*(parseInt(_0x36eacd(0x18b))/0x3)+parseInt(_0x36eacd(0x189))/0x4+-parseInt(_0x36eacd(0x17e))/0x5*(parseInt(_0x36eacd(0x186))/0x6)+parseInt(_0x36eacd(0x17f))/0x7*(-parseInt(_0x36eacd(0x180))/0x8)+-parseInt(_0x36eacd(0x181))/0x9+-parseInt(_0x36eacd(0x182))/0xa;if(_0x463d39===_0x1ed3cf)break;else _0x5b0a66['push'](_0x5b0a66['shift']());}catch(_0x50aa32){_0x5b0a66['push'](_0x5b0a66['shift']());}}}(a44_0x24fe,0xc2d78));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x9f406c,_0xea2d00){const _0x549bd7=a44_0x53ca,_0x28cb04=_0x9f406c||'__default_site__',_0x4e7787=_0xea2d00||_0x549bd7(0x184);return _0x28cb04+':'+_0x4e7787;}export function getCachedCredential(_0x147233,_0x977a21){const _0x91b68f=a44_0x53ca,_0x47304f=getCacheKey(_0x147233,_0x977a21),_0x4b2147=cache[_0x91b68f(0x18c)](_0x47304f);if(!_0x4b2147)return null;if(Date[_0x91b68f(0x183)]()-_0x4b2147[_0x91b68f(0x185)]>CACHE_TTL_MS)return cache['delete'](_0x47304f),null;return _0x4b2147['apiKey'];}function a44_0x53ca(_0x4a306f,_0x42455f){_0x4a306f=_0x4a306f-0x17d;const _0x24fe80=a44_0x24fe();let _0x53ca62=_0x24fe80[_0x4a306f];return _0x53ca62;}export function setCachedCredential(_0x53144b,_0x560901,_0x5b2eb3){const _0x3213fd=a44_0x53ca,_0x22af1e=getCacheKey(_0x560901,_0x5b2eb3);cache['set'](_0x22af1e,{'apiKey':_0x53144b,'loadedAt':Date[_0x3213fd(0x183)]()});}export function clearCredentialCache(){const _0x2f9139=a44_0x53ca;cache[_0x2f9139(0x188)]();}export function clearCachedCredential(_0x446eba,_0x5abafd){const _0x18b644=a44_0x53ca,_0xd484bd=getCacheKey(_0x446eba,_0x5abafd);cache[_0x18b644(0x18a)](_0xd484bd);}function a44_0x24fe(){const _0x183102=['3941352tbHOhC','9615290NUYaCI','now','__default_profile__','loadedAt','262452RoEqhj','1039439rTNDbE','clear','3703088EaGDED','delete','2695218TIddsP','get','2YDHBPy','5KAPgVV','2178211ODaAlB','16ojfdDu'];a44_0x24fe=function(){return _0x183102;};return a44_0x24fe();}
1
+ (function(_0xc6551e,_0x1c7509){const _0x1a8a7d=a44_0x417a,_0x540694=_0xc6551e();while(!![]){try{const _0x1f7bf2=parseInt(_0x1a8a7d(0x165))/0x1+parseInt(_0x1a8a7d(0x171))/0x2*(-parseInt(_0x1a8a7d(0x16e))/0x3)+-parseInt(_0x1a8a7d(0x16d))/0x4+parseInt(_0x1a8a7d(0x170))/0x5*(-parseInt(_0x1a8a7d(0x169))/0x6)+-parseInt(_0x1a8a7d(0x173))/0x7+parseInt(_0x1a8a7d(0x16a))/0x8+parseInt(_0x1a8a7d(0x174))/0x9*(parseInt(_0x1a8a7d(0x16c))/0xa);if(_0x1f7bf2===_0x1c7509)break;else _0x540694['push'](_0x540694['shift']());}catch(_0x528002){_0x540694['push'](_0x540694['shift']());}}}(a44_0x1e4e,0xa868b));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x42b7a5,_0x34520b){const _0x57f11e=a44_0x417a,_0x34fd60=_0x42b7a5||_0x57f11e(0x16b),_0x2a59c5=_0x34520b||_0x57f11e(0x166);return _0x34fd60+':'+_0x2a59c5;}export function getCachedCredential(_0x42de2c,_0x568a31){const _0x44665c=a44_0x417a,_0xb42448=getCacheKey(_0x42de2c,_0x568a31),_0x28e04f=cache[_0x44665c(0x175)](_0xb42448);if(!_0x28e04f)return null;if(Date['now']()-_0x28e04f[_0x44665c(0x172)]>CACHE_TTL_MS)return cache[_0x44665c(0x167)](_0xb42448),null;return _0x28e04f[_0x44665c(0x16f)];}function a44_0x1e4e(){const _0x54ec81=['set','1303038DUyETU','__default_profile__','delete','clear','6BAYHgb','6871824LnDBOC','__default_site__','423110xasSBQ','1178136vciZAa','1405875tAAXYa','apiKey','5361115BogTRV','2aSPSSP','loadedAt','5750773LKXFSU','252Xlqhgd','get'];a44_0x1e4e=function(){return _0x54ec81;};return a44_0x1e4e();}export function setCachedCredential(_0x25ff17,_0x53f9c4,_0x378033){const _0x2e37f1=a44_0x417a,_0x484df7=getCacheKey(_0x53f9c4,_0x378033);cache[_0x2e37f1(0x176)](_0x484df7,{'apiKey':_0x25ff17,'loadedAt':Date['now']()});}export function clearCredentialCache(){const _0x4a081d=a44_0x417a;cache[_0x4a081d(0x168)]();}function a44_0x417a(_0x25b795,_0xc38d2f){_0x25b795=_0x25b795-0x165;const _0x1e4e4d=a44_0x1e4e();let _0x417af9=_0x1e4e4d[_0x25b795];return _0x417af9;}export function clearCachedCredential(_0x293724,_0x513e67){const _0x2521a1=a44_0x417a,_0x44e0f0=getCacheKey(_0x293724,_0x513e67);cache[_0x2521a1(0x167)](_0x44e0f0);}