@treasuredata/tdx 2026.3.46 → 2026.3.47

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 (242) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-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/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-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/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/execute-items/TASK.md +62 -0
  182. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/execute-items/schedule.yaml +20 -0
  183. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/item-triage/TASK.md +106 -0
  184. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/item-triage/schedule.yaml +18 -0
  185. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/stale-item-cleanup/TASK.md +26 -0
  186. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/stale-item-cleanup/schedule.yaml +15 -0
  187. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/synthesize-knowledge/TASK.md +26 -0
  188. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/synthesize-knowledge/schedule.yaml +16 -0
  189. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/weekly-review/TASK.md +21 -0
  190. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/weekly-review/schedule.yaml +14 -0
  191. package/dist/sdk/workspace/builtin-schedules/execute-items/TASK.md +62 -0
  192. package/dist/sdk/workspace/builtin-schedules/execute-items/schedule.yaml +20 -0
  193. package/dist/sdk/workspace/builtin-schedules/item-triage/TASK.md +106 -0
  194. package/dist/sdk/workspace/builtin-schedules/item-triage/schedule.yaml +18 -0
  195. package/dist/sdk/workspace/builtin-schedules/stale-item-cleanup/TASK.md +26 -0
  196. package/dist/sdk/workspace/builtin-schedules/stale-item-cleanup/schedule.yaml +15 -0
  197. package/dist/sdk/workspace/builtin-schedules/synthesize-knowledge/TASK.md +26 -0
  198. package/dist/sdk/workspace/builtin-schedules/synthesize-knowledge/schedule.yaml +16 -0
  199. package/dist/sdk/workspace/builtin-schedules/weekly-review/TASK.md +21 -0
  200. package/dist/sdk/workspace/builtin-schedules/weekly-review/schedule.yaml +14 -0
  201. package/dist/sdk/workspace/frontmatter.js +1 -1
  202. package/dist/sdk/workspace/git.js +1 -1
  203. package/dist/sdk/workspace/index.d.ts +5 -1
  204. package/dist/sdk/workspace/index.d.ts.map +1 -1
  205. package/dist/sdk/workspace/index.js +1 -1
  206. package/dist/sdk/workspace/index.js.map +1 -1
  207. package/dist/sdk/workspace/templates.js +1 -1
  208. package/dist/sdk/workspace/weekly.js +1 -1
  209. package/dist/sdk/workspace/wikilinks.js +1 -1
  210. package/dist/test-utils/command-runner.js +1 -1
  211. package/dist/test-utils/factories.js +1 -1
  212. package/dist/test-utils/fixtures.js +1 -1
  213. package/dist/test-utils/http-mock.js +1 -1
  214. package/dist/test-utils/index.js +1 -1
  215. package/dist/utils/async.js +1 -1
  216. package/dist/utils/colors.js +1 -1
  217. package/dist/utils/diff.js +1 -1
  218. package/dist/utils/file-permissions.js +1 -1
  219. package/dist/utils/file-reader.js +1 -1
  220. package/dist/utils/github-releases.js +1 -1
  221. package/dist/utils/global-cache.js +1 -1
  222. package/dist/utils/json-loader.js +1 -1
  223. package/dist/utils/local-cache.js +1 -1
  224. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  225. package/dist/utils/logger/formatters/index.js +1 -1
  226. package/dist/utils/logger/handlers/console-handler.js +1 -1
  227. package/dist/utils/logger/handlers/file-handler.js +1 -1
  228. package/dist/utils/logger/handlers/index.js +1 -1
  229. package/dist/utils/logger/handlers/null-handler.js +1 -1
  230. package/dist/utils/logger/index.js +1 -1
  231. package/dist/utils/logger/logger.js +1 -1
  232. package/dist/utils/logger/types.js +1 -1
  233. package/dist/utils/option-validation.js +1 -1
  234. package/dist/utils/process.js +1 -1
  235. package/dist/utils/prompt.js +1 -1
  236. package/dist/utils/spinner.js +1 -1
  237. package/dist/utils/sse-parser.js +1 -1
  238. package/dist/utils/string-utils.js +1 -1
  239. package/dist/utils/table-ref-parser.js +1 -1
  240. package/dist/utils/tdx-logger.js +1 -1
  241. package/dist/utils/version-check.js +1 -1
  242. package/package.json +2 -2
@@ -1 +1 @@
1
- const a190_0x3d4244=a190_0x270e;(function(_0x363bdb,_0x4e8880){const _0xe1a1af=a190_0x270e,_0x59aa09=_0x363bdb();while(!![]){try{const _0xa62abd=-parseInt(_0xe1a1af(0xad))/0x1+-parseInt(_0xe1a1af(0xab))/0x2*(parseInt(_0xe1a1af(0xac))/0x3)+-parseInt(_0xe1a1af(0x9f))/0x4+-parseInt(_0xe1a1af(0xaa))/0x5*(-parseInt(_0xe1a1af(0x9b))/0x6)+-parseInt(_0xe1a1af(0x94))/0x7*(-parseInt(_0xe1a1af(0x99))/0x8)+-parseInt(_0xe1a1af(0x98))/0x9+parseInt(_0xe1a1af(0xa1))/0xa;if(_0xa62abd===_0x4e8880)break;else _0x59aa09['push'](_0x59aa09['shift']());}catch(_0x367c8d){_0x59aa09['push'](_0x59aa09['shift']());}}}(a190_0x2f96,0x71a16));import{SDKError,ErrorCode}from'../errors.js';const GZIP_MAGIC=Buffer[a190_0x3d4244(0x9e)]([0x1f,0x8b]),MIN_GZIP_SIZE=0x14;export function validateGzipArchive(_0x2446b8){const _0x35c9ea=a190_0x3d4244;if(_0x2446b8[_0x35c9ea(0xa0)]<MIN_GZIP_SIZE)return{'isValid':![],'size':_0x2446b8[_0x35c9ea(0xa0)],'error':{'message':'Downloaded\x20archive\x20is\x20too\x20small\x20('+_0x2446b8[_0x35c9ea(0xa0)]+'\x20bytes).\x20The\x20server\x20may\x20have\x20returned\x20an\x20error\x20or\x20empty\x20response.','preview':getContentPreview(_0x2446b8),'helpText':_0x35c9ea(0xa9)}};if(!_0x2446b8[_0x35c9ea(0xa3)](0x0,0x2)[_0x35c9ea(0x97)](GZIP_MAGIC)){const _0x17bd58=getContentPreview(_0x2446b8),_0x30a693=_0x17bd58?_0x35c9ea(0x96)+_0x17bd58:'';return{'isValid':![],'size':_0x2446b8[_0x35c9ea(0xa0)],'error':{'message':_0x35c9ea(0xa7)+_0x30a693,'preview':_0x17bd58,'helpText':_0x35c9ea(0xa2)}};}return{'isValid':!![],'size':_0x2446b8[_0x35c9ea(0xa0)]};}function a190_0x270e(_0x3e8d98,_0x2ea237){_0x3e8d98=_0x3e8d98-0x94;const _0x2f9609=a190_0x2f96();let _0x270ef3=_0x2f9609[_0x3e8d98];return _0x270ef3;}function getContentPreview(_0x1027fc){const _0x20aed1=a190_0x3d4244;if(_0x1027fc[_0x20aed1(0xa0)]===0x0)return _0x20aed1(0x95);const _0x456d76=_0x1027fc[_0x20aed1(0xa3)](0x0,0xc8)[_0x20aed1(0xa5)](_0x20aed1(0xae)),_0x3fd711=_0x456d76[_0x20aed1(0xa8)]('')['filter'](_0x14b5cc=>{const _0x312c07=_0x20aed1,_0x3c3a01=_0x14b5cc[_0x312c07(0xa6)](0x0);return _0x3c3a01>=0x20&&_0x3c3a01<0x7f||_0x3c3a01===0xa||_0x3c3a01===0xd||_0x3c3a01===0x9;})[_0x20aed1(0xa0)],_0x1d5021=_0x3fd711/_0x456d76[_0x20aed1(0xa0)];if(_0x1d5021>0.8){const _0x1b53e7=_0x456d76[_0x20aed1(0x9d)](0x0,0x64)[_0x20aed1(0xaf)]();return _0x1b53e7[_0x20aed1(0xa0)]<_0x456d76[_0x20aed1(0xaf)]()[_0x20aed1(0xa0)]?_0x1b53e7+'...':_0x1b53e7;}return undefined;}function a190_0x2f96(){const _0x7ba636=['7495000SAxmgB','The\x20server\x20may\x20have\x20returned\x20an\x20error\x20page\x20instead\x20of\x20the\x20archive.\x20Try\x20pushing\x20a\x20new\x20revision.','subarray','helpText','toString','charCodeAt','Downloaded\x20file\x20is\x20not\x20a\x20valid\x20gzip\x20archive.','split','Check\x20if\x20the\x20project\x20exists\x20and\x20has\x20been\x20pushed\x20at\x20least\x20once.','20SGwdhU','34QFvLKy','24987XPVrHz','742860jRbxLU','utf-8','trim','7MonHUP','(empty\x20response)','\x20Server\x20response\x20preview:\x20','equals','3973563MCZPFv','3760248ZehhQK','WORKFLOW_ARCHIVE_CORRUPTED','896712enbZHr','error','slice','from','103796nBPrmG','length'];a190_0x2f96=function(){return _0x7ba636;};return a190_0x2f96();}export function throwArchiveValidationError(_0x18fab4){const _0x4826d0=a190_0x3d4244;if(!_0x18fab4[_0x4826d0(0x9c)])throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],'Archive\x20validation\x20failed\x20with\x20unknown\x20error');throw new SDKError(ErrorCode[_0x4826d0(0x9a)],_0x18fab4[_0x4826d0(0x9c)]['message'],undefined,{'helpText':_0x18fab4['error'][_0x4826d0(0xa4)]});}
1
+ const a190_0x3995b3=a190_0xf559;function a190_0x46ed(){const _0x403b8d=['length','22oOeXqA','6862670TpBcma','from','31480fijWuC','equals','subarray','24kiMxMT','4jioRwZ','177zSvOqw','error','toString','2757944ohXBAc','...','59883gkNvlV','WORKFLOW_ARCHIVE_CORRUPTED','charCodeAt','1922944UllHyl','Archive\x20validation\x20failed\x20with\x20unknown\x20error','13532508rGOTTE','filter','trim','107430VlqXkF','The\x20server\x20may\x20have\x20returned\x20an\x20error\x20page\x20instead\x20of\x20the\x20archive.\x20Try\x20pushing\x20a\x20new\x20revision.','message'];a190_0x46ed=function(){return _0x403b8d;};return a190_0x46ed();}function a190_0xf559(_0x229874,_0x5d6328){_0x229874=_0x229874-0xa0;const _0x46ede1=a190_0x46ed();let _0xf55998=_0x46ede1[_0x229874];return _0xf55998;}(function(_0x536905,_0xfd41c5){const _0x4d0d3a=a190_0xf559,_0x3dfa7d=_0x536905();while(!![]){try{const _0x320ff0=parseInt(_0x4d0d3a(0xaf))/0x1*(-parseInt(_0x4d0d3a(0xa9))/0x2)+-parseInt(_0x4d0d3a(0xaa))/0x3*(-parseInt(_0x4d0d3a(0xa5))/0x4)+parseInt(_0x4d0d3a(0xb7))/0x5*(parseInt(_0x4d0d3a(0xa8))/0x6)+parseInt(_0x4d0d3a(0xad))/0x7+parseInt(_0x4d0d3a(0xb2))/0x8+-parseInt(_0x4d0d3a(0xb4))/0x9+-parseInt(_0x4d0d3a(0xa3))/0xa*(-parseInt(_0x4d0d3a(0xa2))/0xb);if(_0x320ff0===_0xfd41c5)break;else _0x3dfa7d['push'](_0x3dfa7d['shift']());}catch(_0x16eb7){_0x3dfa7d['push'](_0x3dfa7d['shift']());}}}(a190_0x46ed,0xe3f9e));import{SDKError,ErrorCode}from'../errors.js';const GZIP_MAGIC=Buffer[a190_0x3995b3(0xa4)]([0x1f,0x8b]),MIN_GZIP_SIZE=0x14;export function validateGzipArchive(_0x3a0fe6){const _0x285c11=a190_0x3995b3;if(_0x3a0fe6[_0x285c11(0xa1)]<MIN_GZIP_SIZE)return{'isValid':![],'size':_0x3a0fe6['length'],'error':{'message':'Downloaded\x20archive\x20is\x20too\x20small\x20('+_0x3a0fe6[_0x285c11(0xa1)]+'\x20bytes).\x20The\x20server\x20may\x20have\x20returned\x20an\x20error\x20or\x20empty\x20response.','preview':getContentPreview(_0x3a0fe6),'helpText':'Check\x20if\x20the\x20project\x20exists\x20and\x20has\x20been\x20pushed\x20at\x20least\x20once.'}};if(!_0x3a0fe6[_0x285c11(0xa7)](0x0,0x2)[_0x285c11(0xa6)](GZIP_MAGIC)){const _0x4d2987=getContentPreview(_0x3a0fe6),_0x3fda06=_0x4d2987?'\x20Server\x20response\x20preview:\x20'+_0x4d2987:'';return{'isValid':![],'size':_0x3a0fe6[_0x285c11(0xa1)],'error':{'message':'Downloaded\x20file\x20is\x20not\x20a\x20valid\x20gzip\x20archive.'+_0x3fda06,'preview':_0x4d2987,'helpText':_0x285c11(0xb8)}};}return{'isValid':!![],'size':_0x3a0fe6[_0x285c11(0xa1)]};}function getContentPreview(_0x2bdf26){const _0x373962=a190_0x3995b3;if(_0x2bdf26[_0x373962(0xa1)]===0x0)return'(empty\x20response)';const _0x4c395b=_0x2bdf26[_0x373962(0xa7)](0x0,0xc8)[_0x373962(0xac)]('utf-8'),_0x390e7b=_0x4c395b['split']('')[_0x373962(0xb5)](_0x5256d3=>{const _0x4075be=_0x373962,_0x28afdf=_0x5256d3[_0x4075be(0xb1)](0x0);return _0x28afdf>=0x20&&_0x28afdf<0x7f||_0x28afdf===0xa||_0x28afdf===0xd||_0x28afdf===0x9;})[_0x373962(0xa1)],_0x14f022=_0x390e7b/_0x4c395b[_0x373962(0xa1)];if(_0x14f022>0.8){const _0x232777=_0x4c395b['slice'](0x0,0x64)[_0x373962(0xb6)]();return _0x232777[_0x373962(0xa1)]<_0x4c395b['trim']()[_0x373962(0xa1)]?_0x232777+_0x373962(0xae):_0x232777;}return undefined;}export function throwArchiveValidationError(_0x13e3d3){const _0x193521=a190_0x3995b3;if(!_0x13e3d3[_0x193521(0xab)])throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0x193521(0xb3));throw new SDKError(ErrorCode[_0x193521(0xb0)],_0x13e3d3[_0x193521(0xab)][_0x193521(0xa0)],undefined,{'helpText':_0x13e3d3['error']['helpText']});}
@@ -1 +1 @@
1
- (function(_0x58878d,_0x5f53ab){const _0x57b31a=a191_0x3af3,_0x4a1b0c=_0x58878d();while(!![]){try{const _0x254e35=parseInt(_0x57b31a(0xc1))/0x1+parseInt(_0x57b31a(0xcb))/0x2+parseInt(_0x57b31a(0xc6))/0x3+-parseInt(_0x57b31a(0xc8))/0x4+parseInt(_0x57b31a(0xc2))/0x5*(-parseInt(_0x57b31a(0xc9))/0x6)+parseInt(_0x57b31a(0xbd))/0x7*(-parseInt(_0x57b31a(0xd5))/0x8)+-parseInt(_0x57b31a(0xdb))/0x9*(parseInt(_0x57b31a(0xcc))/0xa);if(_0x254e35===_0x5f53ab)break;else _0x4a1b0c['push'](_0x4a1b0c['shift']());}catch(_0x3c16c6){_0x4a1b0c['push'](_0x4a1b0c['shift']());}}}(a191_0x3f7e,0xa4db6));function a191_0x3af3(_0x2e91f4,_0x5a3177){_0x2e91f4=_0x2e91f4-0xba;const _0x3f7e01=a191_0x3f7e();let _0x3af32f=_0x3f7e01[_0x2e91f4];return _0x3af32f;}function a191_0x3f7e(){const _0x440de9=['tdx.json','Source\x20directory\x20not\x20found:\x20','15699951cxbRuB','push','tdx-wf-clone-','access','find','name','data','mkdtemp','6804eoqnEM','tmpdir','filter','readdir','978072LUkzvY','363465WfWSGX','listProjects','newProjectName','sourceProjectName','3632856Agapeq','archive.tar.gz','796992ofnKyf','18CKYzCM','\x20workflow\x20files\x20found\x20in\x20','1455400eYRJhI','10ZXWtsZ','join','uploadProjectArchive','revision','endsWith','length','tar','sourceDir','replace','656owdrru','resolve','No\x20','create'];a191_0x3f7e=function(){return _0x440de9;};return a191_0x3f7e();}import{promises as a191_0x57f256}from'fs';import a191_0x5d0682 from'path';import a191_0xf27202 from'os';import{tryFindWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';export async function prepareCloneWorkflow(_0x1f2424,_0x3de3b4,_0x1c1544,_0x32149a={}){const _0x106777=a191_0x3af3,{client:_0x4d9e0f}=_0x1f2424,_0x150b81=a191_0x5d0682[_0x106777(0xd6)](_0x3de3b4);try{await a191_0x57f256[_0x106777(0xde)](_0x150b81);}catch{throw new Error(_0x106777(0xda)+_0x3de3b4);}const _0x212afc=tryFindWorkflowTdxConfig(_0x150b81),_0x2e9d06=_0x212afc?.['config']['workflow_project'],_0xbce5f2=_0x32149a[_0x106777(0xcf)]||new Date()['toISOString']()[_0x106777(0xd4)](/[:.]/g,'-');if(!_0x32149a['skipValidation']){const _0x34fc5b=await a191_0x57f256[_0x106777(0xc0)](_0x150b81),_0x2ceefc=_0x34fc5b[_0x106777(0xbf)](_0x12f14e=>_0x12f14e[_0x106777(0xd0)](WORKFLOW_FILE_EXTENSION));if(_0x2ceefc[_0x106777(0xd1)]===0x0)throw new Error(_0x106777(0xd7)+WORKFLOW_FILE_EXTENSION+_0x106777(0xca)+_0x150b81);}const _0x55f129=await getProjectFiles(_0x150b81);let _0x31742d=![],_0x37dffa;try{const _0x3fbbe9=await _0x4d9e0f[_0x106777(0xc3)]({'name_pattern':_0x1c1544}),_0x129e17=_0x3fbbe9[_0x106777(0xbb)][_0x106777(0xdf)](_0x41602d=>_0x41602d['name']===_0x1c1544);_0x129e17&&(_0x31742d=!![],_0x37dffa=_0x129e17['id']);}catch{}return{'sourceDir':_0x150b81,'sourceProjectName':_0x2e9d06,'newProjectName':_0x1c1544,'revision':_0xbce5f2,'fileCount':_0x55f129['length'],'files':_0x55f129,'targetExists':_0x31742d,'existingProjectId':_0x37dffa};}export async function executeCloneWorkflow(_0x5e50b7,_0x409dfb){const _0x155c5e=a191_0x3af3,_0x4aa5ec=await import(_0x155c5e(0xd2)),{client:_0x43c56a}=_0x5e50b7,_0x26c2ab=await getProjectFiles(_0x409dfb['sourceDir']),_0x5800f0=await a191_0x57f256[_0x155c5e(0xbc)](a191_0x5d0682[_0x155c5e(0xcd)](a191_0xf27202[_0x155c5e(0xbe)](),_0x155c5e(0xdd))),_0x46d582=a191_0x5d0682['join'](_0x5800f0,_0x155c5e(0xc7));try{await _0x4aa5ec[_0x155c5e(0xd8)]({'file':_0x46d582,'gzip':!![],'cwd':_0x409dfb[_0x155c5e(0xd3)],'portable':!![]},_0x26c2ab);const _0x35fd41=await _0x43c56a[_0x155c5e(0xce)](_0x409dfb[_0x155c5e(0xc4)],_0x409dfb[_0x155c5e(0xcf)],_0x46d582);return{'sourceDir':_0x409dfb[_0x155c5e(0xd3)],'sourceProjectName':_0x409dfb[_0x155c5e(0xc5)],'newProjectName':_0x35fd41[_0x155c5e(0xba)],'newProjectId':_0x35fd41['id'],'revision':_0x35fd41[_0x155c5e(0xcf)],'fileCount':_0x26c2ab[_0x155c5e(0xd1)],'files':_0x26c2ab};}finally{await a191_0x57f256['rm'](_0x5800f0,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x557043,_0x14086b=''){const _0x101a92=a191_0x3af3,_0x2e23db=[],_0x314c49=await a191_0x57f256['readdir'](_0x557043,{'withFileTypes':!![]});for(const _0x1eb029 of _0x314c49){const _0xecfb81=_0x14086b?a191_0x5d0682[_0x101a92(0xcd)](_0x14086b,_0x1eb029[_0x101a92(0xba)]):_0x1eb029[_0x101a92(0xba)];if(_0x1eb029[_0x101a92(0xba)]===_0x101a92(0xd9))continue;if(!shouldIncludeInArchive(_0x1eb029[_0x101a92(0xba)]))continue;if(_0x1eb029['isDirectory']()){const _0x4954b5=await getProjectFiles(a191_0x5d0682[_0x101a92(0xcd)](_0x557043,_0x1eb029[_0x101a92(0xba)]),_0xecfb81);_0x2e23db[_0x101a92(0xdc)](..._0x4954b5);}else _0x2e23db[_0x101a92(0xdc)](_0xecfb81);}return _0x2e23db;}
1
+ (function(_0x64faaf,_0x270a67){const _0x22c0c9=a191_0x4337,_0x196fc5=_0x64faaf();while(!![]){try{const _0x16bd01=parseInt(_0x22c0c9(0x1cd))/0x1+-parseInt(_0x22c0c9(0x1ca))/0x2*(parseInt(_0x22c0c9(0x1bb))/0x3)+parseInt(_0x22c0c9(0x1d4))/0x4+parseInt(_0x22c0c9(0x1d1))/0x5*(-parseInt(_0x22c0c9(0x1dd))/0x6)+parseInt(_0x22c0c9(0x1d6))/0x7*(-parseInt(_0x22c0c9(0x1d5))/0x8)+-parseInt(_0x22c0c9(0x1d8))/0x9+-parseInt(_0x22c0c9(0x1d0))/0xa*(-parseInt(_0x22c0c9(0x1dc))/0xb);if(_0x16bd01===_0x270a67)break;else _0x196fc5['push'](_0x196fc5['shift']());}catch(_0xf655e2){_0x196fc5['push'](_0x196fc5['shift']());}}}(a191_0x559c,0xace48));function a191_0x559c(){const _0x3dc253=['join','11113335tmCpVy','workflow_project','resolve','mkdtemp','5832739wpNqcu','350904NugsvP','length','3462zFoaKb','replace','readdir','newProjectName','config','tmpdir','push','access','revision','filter','tdx-wf-clone-','tar','uploadProjectArchive','name','endsWith','1448OTOlwm','No\x20','\x20workflow\x20files\x20found\x20in\x20','759313dMewAR','data','sourceDir','40LKcvTi','10odOKnm','toISOString','find','5577424AkLscp','8bWNWZs','9654526PSWoMG'];a191_0x559c=function(){return _0x3dc253;};return a191_0x559c();}import{promises as a191_0x53026d}from'fs';import a191_0x11672b from'path';import a191_0x33eb7e from'os';import{tryFindWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';function a191_0x4337(_0x5ccda3,_0x31dc19){_0x5ccda3=_0x5ccda3-0x1ba;const _0x559c7b=a191_0x559c();let _0x433703=_0x559c7b[_0x5ccda3];return _0x433703;}export async function prepareCloneWorkflow(_0xd84a7e,_0x2322cd,_0x1c8edb,_0x9cf55d={}){const _0x394ba5=a191_0x4337,{client:_0x5f72d9}=_0xd84a7e,_0x4f1666=a191_0x11672b[_0x394ba5(0x1da)](_0x2322cd);try{await a191_0x53026d[_0x394ba5(0x1c2)](_0x4f1666);}catch{throw new Error('Source\x20directory\x20not\x20found:\x20'+_0x2322cd);}const _0x28db83=tryFindWorkflowTdxConfig(_0x4f1666),_0x47ac01=_0x28db83?.[_0x394ba5(0x1bf)][_0x394ba5(0x1d9)],_0x287bbd=_0x9cf55d[_0x394ba5(0x1c3)]||new Date()[_0x394ba5(0x1d2)]()[_0x394ba5(0x1bc)](/[:.]/g,'-');if(!_0x9cf55d['skipValidation']){const _0x197ab4=await a191_0x53026d['readdir'](_0x4f1666),_0x2d40f9=_0x197ab4[_0x394ba5(0x1c4)](_0x2efb87=>_0x2efb87[_0x394ba5(0x1c9)](WORKFLOW_FILE_EXTENSION));if(_0x2d40f9['length']===0x0)throw new Error(_0x394ba5(0x1cb)+WORKFLOW_FILE_EXTENSION+_0x394ba5(0x1cc)+_0x4f1666);}const _0x5e5844=await getProjectFiles(_0x4f1666);let _0x28a1b0=![],_0x1e9808;try{const _0x8f3dc0=await _0x5f72d9['listProjects']({'name_pattern':_0x1c8edb}),_0x161ccb=_0x8f3dc0[_0x394ba5(0x1ce)][_0x394ba5(0x1d3)](_0x5be161=>_0x5be161[_0x394ba5(0x1c8)]===_0x1c8edb);_0x161ccb&&(_0x28a1b0=!![],_0x1e9808=_0x161ccb['id']);}catch{}return{'sourceDir':_0x4f1666,'sourceProjectName':_0x47ac01,'newProjectName':_0x1c8edb,'revision':_0x287bbd,'fileCount':_0x5e5844[_0x394ba5(0x1ba)],'files':_0x5e5844,'targetExists':_0x28a1b0,'existingProjectId':_0x1e9808};}export async function executeCloneWorkflow(_0xb99668,_0x468af7){const _0xe3652f=a191_0x4337,_0x23fa02=await import(_0xe3652f(0x1c6)),{client:_0x5dfe6b}=_0xb99668,_0x2a0adb=await getProjectFiles(_0x468af7['sourceDir']),_0x3f2b0e=await a191_0x53026d[_0xe3652f(0x1db)](a191_0x11672b[_0xe3652f(0x1d7)](a191_0x33eb7e[_0xe3652f(0x1c0)](),_0xe3652f(0x1c5))),_0x564c1d=a191_0x11672b[_0xe3652f(0x1d7)](_0x3f2b0e,'archive.tar.gz');try{await _0x23fa02['create']({'file':_0x564c1d,'gzip':!![],'cwd':_0x468af7['sourceDir'],'portable':!![]},_0x2a0adb);const _0x491768=await _0x5dfe6b[_0xe3652f(0x1c7)](_0x468af7[_0xe3652f(0x1be)],_0x468af7['revision'],_0x564c1d);return{'sourceDir':_0x468af7[_0xe3652f(0x1cf)],'sourceProjectName':_0x468af7['sourceProjectName'],'newProjectName':_0x491768[_0xe3652f(0x1c8)],'newProjectId':_0x491768['id'],'revision':_0x491768['revision'],'fileCount':_0x2a0adb[_0xe3652f(0x1ba)],'files':_0x2a0adb};}finally{await a191_0x53026d['rm'](_0x3f2b0e,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x67e5f1,_0x37521f=''){const _0x3f9b2e=a191_0x4337,_0x33c3e8=[],_0x26e5a0=await a191_0x53026d[_0x3f9b2e(0x1bd)](_0x67e5f1,{'withFileTypes':!![]});for(const _0x21d873 of _0x26e5a0){const _0x14ca7b=_0x37521f?a191_0x11672b[_0x3f9b2e(0x1d7)](_0x37521f,_0x21d873['name']):_0x21d873['name'];if(_0x21d873[_0x3f9b2e(0x1c8)]==='tdx.json')continue;if(!shouldIncludeInArchive(_0x21d873['name']))continue;if(_0x21d873['isDirectory']()){const _0x479481=await getProjectFiles(a191_0x11672b[_0x3f9b2e(0x1d7)](_0x67e5f1,_0x21d873[_0x3f9b2e(0x1c8)]),_0x14ca7b);_0x33c3e8[_0x3f9b2e(0x1c1)](..._0x479481);}else _0x33c3e8[_0x3f9b2e(0x1c1)](_0x14ca7b);}return _0x33c3e8;}
@@ -1 +1 @@
1
- const a192_0xca0b3d=a192_0x24bb;(function(_0x4331f0,_0x2ed5b2){const _0x3955db=a192_0x24bb,_0x59f46b=_0x4331f0();while(!![]){try{const _0x272d93=-parseInt(_0x3955db(0x262))/0x1*(parseInt(_0x3955db(0x22a))/0x2)+-parseInt(_0x3955db(0x26b))/0x3+-parseInt(_0x3955db(0x24a))/0x4+parseInt(_0x3955db(0x245))/0x5*(-parseInt(_0x3955db(0x222))/0x6)+-parseInt(_0x3955db(0x1f4))/0x7+parseInt(_0x3955db(0x265))/0x8*(parseInt(_0x3955db(0x207))/0x9)+-parseInt(_0x3955db(0x228))/0xa*(-parseInt(_0x3955db(0x23b))/0xb);if(_0x272d93===_0x2ed5b2)break;else _0x59f46b['push'](_0x59f46b['shift']());}catch(_0x436921){_0x59f46b['push'](_0x59f46b['shift']());}}}(a192_0x5377,0x67c6e));function a192_0x5377(){const _0x40f60d=['3189025fzbcvW','sessionUuid','direct','pullProject','cancelRequested','join','tasks','create','status','workflowName','executePushProject','data','retryAttempt','length','retryAttemptName','Project\x20not\x20found:\x20','slice','mkdir','parentId','40086yDJYrh','timezone','setSecrets','last_id','deleteProject','No\x20','preparePushProject','toTime','fromTime','retryAt','sessionTime','bind','index','state','startAttempt','now','unlink','prepareCloneProject','applyPullProject','lastId','project','tar','executeCloneProject','name','find','path','stateParams','23046LHtdOR','substring','isGroup','killAttempt','listWorkflows','rawCount','10duzJwQ','revision','404ByvctX','done','extract','logs','\x20workflow\x20files\x20found\x20in\x20project\x20directory','readdir','listAttempts','arrayBuffer','scheduleFrom','listProjects','config','tdx-workflow-push-','basename','fullName','getProject','message','resolveProjectId','12325511oUSWcq','toISOString','deleteSecret','workflow','retrySession','Failed\x20to\x20download\x20log\x20file:\x20','limit','run','util','attempts','660ezhcIi','Invalid\x20workflow\x20format:\x20','workflows','isDirectory','delete','568948eCjptj','access','from','retryParams','uploadProjectArchive','projectName','isFile','attempt','sessionId','filter','storeParams','rejected','exportParams','sessions','utf-8','map','client','listSecrets','setSecret','listLogFiles','clearScheduleAll','.\x20Expected\x20\x22project.workflow\x22','skipValidation','Project\x20directory\x20not\x20found:\x20','821NGEqnz','Cannot\x20read\x20workflow\x20file:\x20','WORKFLOW_PROJECT_NOT_FOUND','1448vxZggP','Failed\x20to\x20set\x20secret','toString','zlib','.tar.gz','tmpdir','692817LQYaox','latest','clearSchedule','indexOf','NUMERIC_ID_PATTERN','resumeFrom','push','gunzip','kill'];a192_0x5377=function(){return _0x40f60d;};return a192_0x5377();}import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';import{MAX_PAGINATION_LIMIT}from'../util/paginate.js';async function paginateResults(_0x1e9215,_0x344f39,_0x146365=0x64){const _0xb63dae=a192_0x24bb,_0x1a26de=Math['min'](_0x344f39,MAX_PAGINATION_LIMIT),_0x1e6ec1=[];let _0x5a292a;while(_0x1e6ec1[_0xb63dae(0x201)]<_0x1a26de){const _0x28a5ba=await _0x1e9215(_0x146365,_0x5a292a),_0x34be42=_0x28a5ba[_0xb63dae(0x227)]??_0x28a5ba[_0xb63dae(0x1ff)][_0xb63dae(0x201)];if(_0x34be42===0x0)break;_0x1e6ec1['push'](..._0x28a5ba['data']);if(!_0x28a5ba[_0xb63dae(0x21a)]||_0x34be42<_0x146365)break;_0x5a292a=_0x28a5ba[_0xb63dae(0x21a)];}return _0x1e6ec1[_0xb63dae(0x204)](0x0,_0x1a26de);}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';function a192_0x24bb(_0xdd2bc1,_0x69ad9d){_0xdd2bc1=_0xdd2bc1-0x1ef;const _0x537703=a192_0x5377();let _0x24bb42=_0x537703[_0xdd2bc1];return _0x24bb42;}import{pullWorkflow,applyPullResult}from'./pull-workflow.js';import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static [a192_0xca0b3d(0x1ef)]=/^\d+$/;[a192_0xca0b3d(0x25a)];constructor(_0x30d132){const _0x5bd3a8=a192_0xca0b3d;this[_0x5bd3a8(0x25a)]=new WorkflowApiClient(_0x30d132);}async[a192_0xca0b3d(0x23a)](_0x24ef86){const _0x415276=a192_0xca0b3d;if(WorkflowSDK[_0x415276(0x1ef)]['test'](_0x24ef86)){const _0x3cb480=await this['client'][_0x415276(0x238)](_0x24ef86);return{'id':_0x3cb480['id'],'name':_0x3cb480['name']};}const _0x2119d6=await this[_0x415276(0x25a)][_0x415276(0x233)]({'name_pattern':_0x24ef86}),_0x534e36=_0x2119d6['data'][_0x415276(0x21f)](_0x580126=>_0x580126[_0x415276(0x21e)]===_0x24ef86);if(!_0x534e36)throw new SDKError(ErrorCode['WORKFLOW_PROJECT_NOT_FOUND'],_0x415276(0x203)+_0x24ef86);return{'id':_0x534e36['id'],'name':_0x534e36['name']};}async['projects'](_0x29498a,_0x2c5c7c){const _0x43b6ca=a192_0xca0b3d,_0x216a46=_0x2c5c7c?.[_0x43b6ca(0x241)]||0x64,_0x99c1b1=await paginateResults((_0x5f1480,_0x1815f3)=>this[_0x43b6ca(0x25a)]['listProjects']({'name_pattern':_0x29498a,'limit':_0x5f1480,'last_id':_0x1815f3??_0x2c5c7c?.[_0x43b6ca(0x20a)]}),_0x216a46);return _0x99c1b1['map'](_0x45498c=>({..._0x45498c,'project_id':_0x45498c['id'],'project_name':_0x45498c[_0x43b6ca(0x21e)]}));}async[a192_0xca0b3d(0x247)](_0x43d3e2,_0x3ffb7a){const _0x24418f=a192_0xca0b3d,_0x223c2f=_0x3ffb7a?.[_0x24418f(0x241)]||0x64,_0x1e738b=await paginateResults((_0x1d71f7,_0x5c9f7e)=>this[_0x24418f(0x25a)][_0x24418f(0x226)]({'project_name':_0x43d3e2,'limit':_0x1d71f7,'last_id':_0x5c9f7e??_0x3ffb7a?.['last_id']}),_0x223c2f);return _0x1e738b[_0x24418f(0x259)](_0x5f014e=>({'project_id':_0x5f014e['project']?.['id'],'project_name':_0x5f014e['project']?.[_0x24418f(0x21e)],'workflow_id':_0x5f014e['id'],'workflow_name':_0x5f014e[_0x24418f(0x21e)],'revision':_0x5f014e['revision'],'timezone':_0x5f014e[_0x24418f(0x208)],'config':_0x5f014e['config'],'id':_0x5f014e['id'],'name':_0x5f014e[_0x24418f(0x21e)],'project':_0x5f014e[_0x24418f(0x21b)]}));}async[a192_0xca0b3d(0x257)](_0x4adb38){const _0x27b6d6=a192_0xca0b3d;let _0x50e86c;if(_0x4adb38?.[_0x27b6d6(0x24f)]){let _0x550868,_0x233592=![];while(!_0x233592){const _0x3d1b26=await this[_0x27b6d6(0x25a)][_0x27b6d6(0x233)]({'limit':0x64,'last_id':_0x550868}),_0x47e9bd=_0x3d1b26['data'][_0x27b6d6(0x21f)](_0x230ec3=>_0x230ec3[_0x27b6d6(0x21e)]===_0x4adb38[_0x27b6d6(0x24f)]);if(_0x47e9bd){_0x50e86c=_0x47e9bd['id'],_0x233592=!![];break;}if(!_0x3d1b26['lastId']||_0x3d1b26[_0x27b6d6(0x1ff)][_0x27b6d6(0x201)]===0x0)break;_0x550868=_0x3d1b26['lastId'];}if(!_0x50e86c)throw new SDKError(ErrorCode[_0x27b6d6(0x264)],'Project\x20not\x20found:\x20'+_0x4adb38['projectName']);}const _0x2114b6=_0x4adb38?.['limit']||0x64,_0x203bd3=await paginateResults((_0x42dd5e,_0x2bc19b)=>this[_0x27b6d6(0x25a)]['listSessions']({'project_id':_0x50e86c,'project_name':_0x4adb38?.[_0x27b6d6(0x24f)],'workflow_name':_0x4adb38?.['workflowName'],'status':_0x4adb38?.[_0x27b6d6(0x1fc)],'from_time':_0x4adb38?.[_0x27b6d6(0x20f)],'to_time':_0x4adb38?.[_0x27b6d6(0x20e)],'limit':_0x42dd5e,'last_id':_0x2bc19b??_0x4adb38?.[_0x27b6d6(0x20a)]}),_0x2114b6);return _0x203bd3[_0x27b6d6(0x259)](_0x2a2ecd=>({'project_id':_0x2a2ecd[_0x27b6d6(0x21b)]?.['id'],'project_name':_0x2a2ecd[_0x27b6d6(0x21b)]?.[_0x27b6d6(0x21e)],'workflow_id':_0x2a2ecd[_0x27b6d6(0x23e)]?.['id'],'workflow_name':_0x2a2ecd[_0x27b6d6(0x23e)]?.[_0x27b6d6(0x21e)],'session_id':_0x2a2ecd['id'],'sessionUuid':_0x2a2ecd['sessionUuid'],'sessionTime':_0x2a2ecd[_0x27b6d6(0x211)],'lastAttempt':_0x2a2ecd['lastAttempt'],'id':_0x2a2ecd['id'],'project':_0x2a2ecd[_0x27b6d6(0x21b)],'workflow':_0x2a2ecd[_0x27b6d6(0x23e)]}));}async[a192_0xca0b3d(0x244)](_0x247a66){const _0x271dc0=a192_0xca0b3d,_0x594af0=_0x247a66?.[_0x271dc0(0x241)]||0x64,_0x16e20a=await paginateResults((_0x4e50a2,_0x504b36)=>this['client'][_0x271dc0(0x230)]({'project_name':_0x247a66?.[_0x271dc0(0x24f)],'workflow_name':_0x247a66?.[_0x271dc0(0x1fd)],'include_retried':_0x247a66?.['includeRetried'],'limit':_0x4e50a2,'last_id':_0x504b36??_0x247a66?.[_0x271dc0(0x20a)]}),_0x594af0);return _0x16e20a['map'](_0x40ce56=>({'project_id':_0x40ce56[_0x271dc0(0x21b)]?.['id'],'project_name':_0x40ce56[_0x271dc0(0x21b)]?.[_0x271dc0(0x21e)],'workflow_id':_0x40ce56[_0x271dc0(0x23e)]?.['id'],'workflow_name':_0x40ce56['workflow']?.[_0x271dc0(0x21e)],'session_id':_0x40ce56[_0x271dc0(0x252)],'sessionUuid':_0x40ce56[_0x271dc0(0x1f5)],'sessionTime':_0x40ce56[_0x271dc0(0x211)],'attempt_id':_0x40ce56['id'],'attempt_index':_0x40ce56[_0x271dc0(0x213)],'retryAttemptName':_0x40ce56[_0x271dc0(0x202)],'done':_0x40ce56[_0x271dc0(0x22b)],'success':_0x40ce56['success'],'cancelRequested':_0x40ce56[_0x271dc0(0x1f8)],'params':_0x40ce56['params'],'createdAt':_0x40ce56['createdAt'],'finishedAt':_0x40ce56['finishedAt'],'id':_0x40ce56['id'],'index':_0x40ce56[_0x271dc0(0x213)],'project':_0x40ce56[_0x271dc0(0x21b)],'workflow':_0x40ce56[_0x271dc0(0x23e)]}));}async[a192_0xca0b3d(0x251)](_0x542cb7){const _0x210c8f=await this['client']['getAttempt'](_0x542cb7);return _0x210c8f;}async[a192_0xca0b3d(0x1fa)](_0x57bbea,_0x200de7=![]){const _0x1da65f=a192_0xca0b3d,_0xfee292=await this[_0x1da65f(0x25a)]['getAttemptTasks'](_0x57bbea,_0x200de7);return _0xfee292[_0x1da65f(0x259)](_0x24af91=>({'task_id':_0x24af91['id'],'task_name':_0x24af91['fullName'],'parentId':_0x24af91[_0x1da65f(0x206)],'config':_0x24af91[_0x1da65f(0x234)],'upstreams':_0x24af91['upstreams'],'state':_0x24af91[_0x1da65f(0x214)],'exportParams':_0x24af91[_0x1da65f(0x256)],'storeParams':_0x24af91[_0x1da65f(0x254)],'stateParams':_0x24af91[_0x1da65f(0x221)],'updatedAt':_0x24af91['updatedAt'],'retryAt':_0x24af91[_0x1da65f(0x210)],'startedAt':_0x24af91['startedAt'],'error':_0x24af91['error'],'isGroup':_0x24af91[_0x1da65f(0x224)],'id':_0x24af91['id'],'fullName':_0x24af91[_0x1da65f(0x237)]}));}async['logFiles'](_0x4e7ab5,_0x330388){const _0x6b4af5=a192_0xca0b3d;return await this['client'][_0x6b4af5(0x25d)](_0x4e7ab5,_0x330388);}async[a192_0xca0b3d(0x22d)](_0x76677e,_0x3f27cc){const _0x56a8cd=a192_0xca0b3d,_0x4193a9=await import(_0x56a8cd(0x268)),{promisify:_0x36d3b6}=await import(_0x56a8cd(0x243)),_0x3d5e74=_0x36d3b6(_0x4193a9[_0x56a8cd(0x1f2)]),_0x538591=await this[_0x56a8cd(0x25a)][_0x56a8cd(0x25d)](_0x76677e,_0x3f27cc);if(_0x538591['length']===0x0)return'';const _0x355469=[];for(const _0x4d46e0 of _0x538591){if(!_0x4d46e0[_0x56a8cd(0x1f6)])continue;const _0x4287fb=await fetch(_0x4d46e0[_0x56a8cd(0x1f6)]);if(!_0x4287fb['ok'])throw new Error(_0x56a8cd(0x240)+_0x4287fb['status']);const _0x48a9be=Buffer[_0x56a8cd(0x24c)](await _0x4287fb[_0x56a8cd(0x231)]()),_0x39a7e6=await _0x3d5e74(_0x48a9be);_0x355469[_0x56a8cd(0x1f1)](_0x39a7e6[_0x56a8cd(0x267)](_0x56a8cd(0x258)));}return _0x355469[_0x56a8cd(0x1f9)]('\x0a');}async[a192_0xca0b3d(0x1f3)](_0x4eca3c,_0x508122){const _0x341b7e=a192_0xca0b3d,_0x5dc7d1=await this[_0x341b7e(0x25a)][_0x341b7e(0x225)](_0x4eca3c,_0x508122);return _0x5dc7d1?.[_0x341b7e(0x239)]??'Kill\x20request\x20accepted';}async[a192_0xca0b3d(0x23f)](_0x3395e9,_0x13a5ff){const _0x1b23f0=a192_0xca0b3d,_0x182a1a=await this[_0x1b23f0(0x25a)][_0x1b23f0(0x23f)](_0x3395e9,{'from_task':_0x13a5ff?.['fromTask'],'retry_params':_0x13a5ff?.['retryParams']});return{'attemptId':_0x182a1a['id'],'sessionId':_0x182a1a[_0x1b23f0(0x252)]};}async[a192_0xca0b3d(0x200)](_0x2ab36b,_0x2f5b34){const _0x1ecb8c=a192_0xca0b3d,_0x13121f=await this[_0x1ecb8c(0x25a)][_0x1ecb8c(0x200)](_0x2ab36b,{'resume_from':_0x2f5b34?.[_0x1ecb8c(0x1f0)],'retry_params':_0x2f5b34?.[_0x1ecb8c(0x24d)],'force':_0x2f5b34?.['force']});return{'attemptId':_0x13121f['id'],'sessionId':_0x13121f[_0x1ecb8c(0x252)]};}async[a192_0xca0b3d(0x242)](_0x52755c,_0x24cc43={},_0x1d6d90){const _0x1210e1=a192_0xca0b3d,_0x5439ce=_0x52755c[_0x1210e1(0x26e)]('.');let _0x3cd174,_0x442c97;if(_0x5439ce===-0x1)throw new Error('Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format');_0x3cd174=_0x52755c['substring'](0x0,_0x5439ce),_0x442c97=_0x52755c[_0x1210e1(0x223)](_0x5439ce+0x1);if(!_0x3cd174||!_0x442c97)throw new Error(_0x1210e1(0x246)+_0x52755c+_0x1210e1(0x25f));const _0x23ac8a=_0x1d6d90?.['sessionTime']||new Date()[_0x1210e1(0x23c)]();return await this[_0x1210e1(0x25a)][_0x1210e1(0x215)]({'projectName':_0x3cd174,'workflowName':_0x442c97,'sessionTime':_0x23ac8a,'params':_0x24cc43});}async['download'](_0x29b6ed,_0x4a5f13,_0x43516c){const _0x183e01=a192_0xca0b3d,{promises:_0x5dffac}=await import('fs'),_0x54f14e=await import(_0x183e01(0x220)),_0x26b85b=await import('os'),_0x4e02da=await import(_0x183e01(0x21c)),{id:_0x2f41c8,name:_0x58e69d}=await this[_0x183e01(0x23a)](_0x29b6ed),_0x5507de=_0x26b85b[_0x183e01(0x26a)](),_0x4fcbe5=_0x54f14e[_0x183e01(0x1f9)](_0x5507de,'tdx-workflow-'+_0x2f41c8+'-'+Date[_0x183e01(0x216)]()+'.tar.gz');try{await this[_0x183e01(0x25a)]['downloadProjectArchive'](_0x2f41c8,_0x4fcbe5,_0x43516c?.[_0x183e01(0x229)]);const _0x1f98aa=_0x54f14e[_0x183e01(0x1f9)](_0x4a5f13,_0x58e69d);await _0x5dffac[_0x183e01(0x205)](_0x1f98aa,{'recursive':!![]}),await _0x4e02da[_0x183e01(0x22c)]({'file':_0x4fcbe5,'cwd':_0x1f98aa,'gzip':!![]});const _0x231c40=async _0x331abc=>{const _0x132f6c=_0x183e01;let _0x5cccd0=0x0;const _0x248423=await _0x5dffac[_0x132f6c(0x22f)](_0x331abc,{'withFileTypes':!![]});for(const _0x1559b8 of _0x248423){const _0x1d0e9e=_0x54f14e[_0x132f6c(0x1f9)](_0x331abc,_0x1559b8['name']);if(_0x1559b8[_0x132f6c(0x250)]())_0x5cccd0++;else _0x1559b8[_0x132f6c(0x248)]()&&(_0x5cccd0+=await _0x231c40(_0x1d0e9e));}return _0x5cccd0;},_0xe5ef7c=await _0x231c40(_0x1f98aa);return{'projectName':_0x58e69d,'revision':_0x43516c?.[_0x183e01(0x229)]||_0x183e01(0x26c),'filesExtracted':_0xe5ef7c};}finally{try{await _0x5dffac[_0x183e01(0x217)](_0x4fcbe5);}catch{}}}async[a192_0xca0b3d(0x1f1)](_0xc21698,_0x4c019e){const _0x1a54ea=a192_0xca0b3d,{promises:_0x2d3c9f}=await import('fs'),_0x3375bb=await import(_0x1a54ea(0x220)),_0x56fde9=await import('tar'),_0x5cb1ed=_0x4c019e?.['projectName']||_0x3375bb[_0x1a54ea(0x236)](_0xc21698),_0x2ded03=_0x4c019e?.[_0x1a54ea(0x229)]||new Date()[_0x1a54ea(0x23c)]()['replace'](/[:.]/g,'-');try{await _0x2d3c9f[_0x1a54ea(0x24b)](_0xc21698);}catch{throw new Error(_0x1a54ea(0x261)+_0xc21698);}if(!_0x4c019e?.[_0x1a54ea(0x260)]){const _0x5473b4=await _0x2d3c9f['readdir'](_0xc21698),_0x3c4b41=_0x5473b4[_0x1a54ea(0x253)](_0x36f690=>_0x36f690['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0x3c4b41[_0x1a54ea(0x201)]===0x0)throw new Error(_0x1a54ea(0x20c)+WORKFLOW_FILE_EXTENSION+_0x1a54ea(0x22e));for(const _0x20e30d of _0x3c4b41){const _0x51f07c=_0x3375bb['join'](_0xc21698,_0x20e30d);try{await _0x2d3c9f[_0x1a54ea(0x24b)](_0x51f07c);}catch{throw new Error(_0x1a54ea(0x263)+_0x20e30d);}}}const _0x171fc7=async(_0x4f05f5,_0xb38494='')=>{const _0x1588d6=_0x1a54ea,_0xef0a60=await _0x2d3c9f['readdir'](_0x4f05f5,{'withFileTypes':!![]}),_0xfae939=[];for(const _0x1110a5 of _0xef0a60){const _0x387261=_0x3375bb['join'](_0xb38494,_0x1110a5[_0x1588d6(0x21e)]),_0xee4f14=_0x3375bb[_0x1588d6(0x1f9)](_0x4f05f5,_0x1110a5['name']);if(!shouldIncludeInArchive(_0x1110a5[_0x1588d6(0x21e)]))continue;_0x1110a5[_0x1588d6(0x248)]()?_0xfae939[_0x1588d6(0x1f1)](...await _0x171fc7(_0xee4f14,_0x387261)):_0xfae939[_0x1588d6(0x1f1)](_0x387261);}return _0xfae939;},_0x41bd20=await _0x171fc7(_0xc21698),_0x444063=await import('os'),_0x8b77e8=_0x444063[_0x1a54ea(0x26a)](),_0x454dc2=_0x3375bb['join'](_0x8b77e8,_0x1a54ea(0x235)+Date[_0x1a54ea(0x216)]()+_0x1a54ea(0x269));try{await _0x56fde9[_0x1a54ea(0x1fb)]({'file':_0x454dc2,'gzip':!![],'cwd':_0xc21698,'portable':!![]},_0x41bd20);const _0x4801b1=await this['client'][_0x1a54ea(0x24e)](_0x5cb1ed,_0x2ded03,_0x454dc2,{'scheduleFrom':_0x4c019e?.[_0x1a54ea(0x232)],'clearSchedule':_0x4c019e?.[_0x1a54ea(0x26d)],'clearScheduleAll':_0x4c019e?.[_0x1a54ea(0x25e)]});return{'projectId':_0x4801b1['id'],'projectName':_0x4801b1[_0x1a54ea(0x21e)],'revision':_0x4801b1['revision']};}finally{try{await _0x2d3c9f[_0x1a54ea(0x217)](_0x454dc2);}catch{}}}async[a192_0xca0b3d(0x249)](_0x5802cf){const _0x481003=a192_0xca0b3d,{id:_0x253f00}=await this[_0x481003(0x23a)](_0x5802cf),_0x41094=await this[_0x481003(0x25a)][_0x481003(0x20b)](_0x253f00);return{'projectId':_0x41094['id'],'projectName':_0x41094[_0x481003(0x21e)]};}async[a192_0xca0b3d(0x25b)](_0x29b6bd){const _0xba09d5=a192_0xca0b3d,{id:_0x4c6280,name:_0x4cf631}=await this[_0xba09d5(0x23a)](_0x29b6bd),_0x4ae791=await this[_0xba09d5(0x25a)]['listSecrets'](_0x4c6280);return{'projectName':_0x4cf631,'secrets':_0x4ae791};}async[a192_0xca0b3d(0x25c)](_0x4c417a,_0x563886,_0x4521ea){const _0x131c25=a192_0xca0b3d,{id:_0x50310f,name:_0x389a4a}=await this[_0x131c25(0x23a)](_0x4c417a);return await this[_0x131c25(0x25a)][_0x131c25(0x25c)](_0x50310f,_0x563886,_0x4521ea),{'projectName':_0x389a4a,'key':_0x563886};}async[a192_0xca0b3d(0x209)](_0x3f9ac3,_0x384d10){const _0x133c8c=a192_0xca0b3d,{id:_0x2b5435,name:_0x55b23e}=await this[_0x133c8c(0x23a)](_0x3f9ac3),_0x47ddca=Object['keys'](_0x384d10),_0x1f3cf5=await Promise['allSettled'](_0x47ddca[_0x133c8c(0x259)](_0x38d117=>this[_0x133c8c(0x25a)][_0x133c8c(0x25c)](_0x2b5435,_0x38d117,_0x384d10[_0x38d117]))),_0x191f22=_0x1f3cf5['map']((_0x1da35c,_0x1be2eb)=>_0x1da35c['status']===_0x133c8c(0x255)?_0x47ddca[_0x1be2eb]:null)['filter'](_0x1c32d9=>_0x1c32d9!==null);if(_0x191f22['length']>0x0)throw new SDKError(ErrorCode['WORKFLOW_SECRET_SET_FAILED'],_0x133c8c(0x266)+(_0x191f22[_0x133c8c(0x201)]>0x1?'s':'')+':\x20'+_0x191f22[_0x133c8c(0x1f9)](',\x20'));return{'projectName':_0x55b23e,'keys':_0x47ddca};}async['deleteSecret'](_0x13baad,_0x4a560e){const _0x18c8f0=a192_0xca0b3d,{id:_0x100e09,name:_0x330bd4}=await this[_0x18c8f0(0x23a)](_0x13baad);return await this['client'][_0x18c8f0(0x23d)](_0x100e09,_0x4a560e),{'projectName':_0x330bd4,'key':_0x4a560e};}async[a192_0xca0b3d(0x1f7)](_0x172ec6,_0x55ea28){const _0x35562b=a192_0xca0b3d;return pullWorkflow({'client':this['client'],'resolveProjectId':this[_0x35562b(0x23a)][_0x35562b(0x212)](this)},_0x172ec6,_0x55ea28);}async[a192_0xca0b3d(0x219)](_0x5db21a,_0x3f267f){const _0x14ac8b=a192_0xca0b3d;return applyPullResult({'client':this[_0x14ac8b(0x25a)],'resolveProjectId':this['resolveProjectId']['bind'](this)},_0x5db21a,_0x3f267f);}async[a192_0xca0b3d(0x20d)](_0x55b451){const _0x349ad3=a192_0xca0b3d;return preparePushWorkflow({'client':this['client'],'resolveProjectId':this[_0x349ad3(0x23a)][_0x349ad3(0x212)](this)},_0x55b451);}async[a192_0xca0b3d(0x1fe)](_0x482f94){const _0x1fe675=a192_0xca0b3d;return executePushWorkflow({'client':this[_0x1fe675(0x25a)],'resolveProjectId':this['resolveProjectId'][_0x1fe675(0x212)](this)},_0x482f94);}async[a192_0xca0b3d(0x218)](_0x5ae12d,_0x21ec07,_0x18507c){const _0x29b5e1=a192_0xca0b3d;return prepareCloneWorkflow({'client':this[_0x29b5e1(0x25a)]},_0x5ae12d,_0x21ec07,_0x18507c);}async[a192_0xca0b3d(0x21d)](_0x19f11b){const _0x341ef8=a192_0xca0b3d;return executeCloneWorkflow({'client':this[_0x341ef8(0x25a)]},_0x19f11b);}}
1
+ const a192_0x11144c=a192_0x1bda;(function(_0xa4392e,_0x206c86){const _0x55c73e=a192_0x1bda,_0x43d681=_0xa4392e();while(!![]){try{const _0xc7a6ff=-parseInt(_0x55c73e(0x166))/0x1+-parseInt(_0x55c73e(0x143))/0x2+-parseInt(_0x55c73e(0x144))/0x3*(-parseInt(_0x55c73e(0x198))/0x4)+parseInt(_0x55c73e(0x1bb))/0x5*(parseInt(_0x55c73e(0x196))/0x6)+parseInt(_0x55c73e(0x1b1))/0x7*(parseInt(_0x55c73e(0x18b))/0x8)+parseInt(_0x55c73e(0x199))/0x9+-parseInt(_0x55c73e(0x1ad))/0xa;if(_0xc7a6ff===_0x206c86)break;else _0x43d681['push'](_0x43d681['shift']());}catch(_0x954ff1){_0x43d681['push'](_0x43d681['shift']());}}}(a192_0xaccb,0xd5f58));import{WorkflowApiClient}from'../client/workflow-client.js';function a192_0x1bda(_0x364bfc,_0x56d91e){_0x364bfc=_0x364bfc-0x13f;const _0xaccbb=a192_0xaccb();let _0x1bda7c=_0xaccbb[_0x364bfc];return _0x1bda7c;}import{SDKError,ErrorCode}from'../errors.js';import{MAX_PAGINATION_LIMIT}from'../util/paginate.js';async function paginateResults(_0xc9dfb5,_0x471dbf,_0x1a1c31=0x64){const _0x1d3066=a192_0x1bda,_0x5cd081=Math[_0x1d3066(0x157)](_0x471dbf,MAX_PAGINATION_LIMIT),_0x8f1fc1=[];let _0x2a197b;while(_0x8f1fc1[_0x1d3066(0x17a)]<_0x5cd081){const _0x559a84=await _0xc9dfb5(_0x1a1c31,_0x2a197b),_0x110ab9=_0x559a84['rawCount']??_0x559a84[_0x1d3066(0x18a)][_0x1d3066(0x17a)];if(_0x110ab9===0x0)break;_0x8f1fc1[_0x1d3066(0x16e)](..._0x559a84['data']);if(!_0x559a84[_0x1d3066(0x15a)]||_0x110ab9<_0x1a1c31)break;_0x2a197b=_0x559a84[_0x1d3066(0x15a)];}return _0x8f1fc1[_0x1d3066(0x1bf)](0x0,_0x5cd081);}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';import{pullWorkflow,applyPullResult}from'./pull-workflow.js';import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';function a192_0xaccb(){const _0x315aae=['status','retryParams','tar','sessionUuid','direct','index','applyPullProject','utf-8','limit','min','sessions','startedAt','lastId','listProjects','zlib','attempts','listAttempts','name','unlink','getAttemptTasks','workflowName','last_id','toString','projects','543208yJbgHv','gunzip','error','clearScheduleAll','keys','prepareCloneProject','path','run','push','No\x20','Cannot\x20read\x20workflow\x20file:\x20','retryAttemptName','Project\x20not\x20found:\x20','fromTask','state','WORKFLOW_SECRET_SET_FAILED','.\x20Expected\x20\x22project.workflow\x22','tmpdir','filter','bind','length','cancelRequested','done','finishedAt','deleteSecret','downloadProjectArchive','replace','storeParams','download','listSecrets','updatedAt','util','sessionId','latest','revision','preparePushProject','data','16GFrgTf','tdx-workflow-','projectName','includeRetried','map','toISOString','test','parentId','timezone','Invalid\x20workflow\x20format:\x20','rejected','6971946wIemAX','createdAt','163324PzrLwM','5601546nCtsSM','indexOf','getProject','scheduleFrom','isDirectory','message','workflow','listWorkflows','find','config','kill','now','listLogFiles','readdir','logs','tasks','clearSchedule','force','resolveProjectId','Failed\x20to\x20download\x20log\x20file:\x20','6629830sKzcKo','substring','join','.tar.gz','3784403ZRPDWt','setSecret','Failed\x20to\x20set\x20secret','create','fullName','client','resumeFrom','project','listSessions','Kill\x20request\x20accepted','5YMfCiQ','deleteProject','toTime','NUMERIC_ID_PATTERN','slice','executePushProject','mkdir','arrayBuffer','WORKFLOW_PROJECT_NOT_FOUND','2627758dDttVQ','39sbkFiT','startAttempt','retrySession','basename','\x20workflow\x20files\x20found\x20in\x20project\x20directory','sessionTime','exportParams','workflows','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','pullProject'];a192_0xaccb=function(){return _0x315aae;};return a192_0xaccb();}export class WorkflowSDK{static [a192_0x11144c(0x1be)]=/^\d+$/;[a192_0x11144c(0x1b6)];constructor(_0x434b4f){const _0x38a134=a192_0x11144c;this[_0x38a134(0x1b6)]=new WorkflowApiClient(_0x434b4f);}async[a192_0x11144c(0x1ab)](_0x42a242){const _0x284db1=a192_0x11144c;if(WorkflowSDK[_0x284db1(0x1be)][_0x284db1(0x191)](_0x42a242)){const _0x188c5a=await this[_0x284db1(0x1b6)][_0x284db1(0x19b)](_0x42a242);return{'id':_0x188c5a['id'],'name':_0x188c5a[_0x284db1(0x15f)]};}const _0x19795e=await this['client'][_0x284db1(0x15b)]({'name_pattern':_0x42a242}),_0x3d9cd9=_0x19795e[_0x284db1(0x18a)]['find'](_0x460912=>_0x460912['name']===_0x42a242);if(!_0x3d9cd9)throw new SDKError(ErrorCode['WORKFLOW_PROJECT_NOT_FOUND'],_0x284db1(0x172)+_0x42a242);return{'id':_0x3d9cd9['id'],'name':_0x3d9cd9[_0x284db1(0x15f)]};}async[a192_0x11144c(0x165)](_0x58bdc9,_0x244950){const _0x3c8152=a192_0x11144c,_0x96d74b=_0x244950?.[_0x3c8152(0x156)]||0x64,_0xf73b82=await paginateResults((_0x1efeaa,_0x17b8a0)=>this[_0x3c8152(0x1b6)]['listProjects']({'name_pattern':_0x58bdc9,'limit':_0x1efeaa,'last_id':_0x17b8a0??_0x244950?.['last_id']}),_0x96d74b);return _0xf73b82['map'](_0xf55ed5=>({..._0xf55ed5,'project_id':_0xf55ed5['id'],'project_name':_0xf55ed5[_0x3c8152(0x15f)]}));}async[a192_0x11144c(0x14b)](_0x13f4db,_0x44cb21){const _0x1cef74=a192_0x11144c,_0x57c5ca=_0x44cb21?.[_0x1cef74(0x156)]||0x64,_0x1725c4=await paginateResults((_0x4533cc,_0x1ef1c0)=>this[_0x1cef74(0x1b6)][_0x1cef74(0x1a0)]({'project_name':_0x13f4db,'limit':_0x4533cc,'last_id':_0x1ef1c0??_0x44cb21?.[_0x1cef74(0x163)]}),_0x57c5ca);return _0x1725c4['map'](_0x391e9c=>({'project_id':_0x391e9c['project']?.['id'],'project_name':_0x391e9c['project']?.[_0x1cef74(0x15f)],'workflow_id':_0x391e9c['id'],'workflow_name':_0x391e9c[_0x1cef74(0x15f)],'revision':_0x391e9c[_0x1cef74(0x188)],'timezone':_0x391e9c[_0x1cef74(0x193)],'config':_0x391e9c[_0x1cef74(0x1a2)],'id':_0x391e9c['id'],'name':_0x391e9c[_0x1cef74(0x15f)],'project':_0x391e9c[_0x1cef74(0x1b8)]}));}async[a192_0x11144c(0x158)](_0x4836e5){const _0x42f835=a192_0x11144c;let _0x352d4f;if(_0x4836e5?.[_0x42f835(0x18d)]){let _0x198f0e,_0x1bc5e6=![];while(!_0x1bc5e6){const _0x1b7269=await this[_0x42f835(0x1b6)][_0x42f835(0x15b)]({'limit':0x64,'last_id':_0x198f0e}),_0x23f128=_0x1b7269[_0x42f835(0x18a)][_0x42f835(0x1a1)](_0x46bbdc=>_0x46bbdc[_0x42f835(0x15f)]===_0x4836e5['projectName']);if(_0x23f128){_0x352d4f=_0x23f128['id'],_0x1bc5e6=!![];break;}if(!_0x1b7269['lastId']||_0x1b7269[_0x42f835(0x18a)][_0x42f835(0x17a)]===0x0)break;_0x198f0e=_0x1b7269['lastId'];}if(!_0x352d4f)throw new SDKError(ErrorCode[_0x42f835(0x142)],_0x42f835(0x172)+_0x4836e5['projectName']);}const _0x2c8aa9=_0x4836e5?.['limit']||0x64,_0x39c793=await paginateResults((_0x1b4ce0,_0x327197)=>this[_0x42f835(0x1b6)][_0x42f835(0x1b9)]({'project_id':_0x352d4f,'project_name':_0x4836e5?.['projectName'],'workflow_name':_0x4836e5?.[_0x42f835(0x162)],'status':_0x4836e5?.[_0x42f835(0x14e)],'from_time':_0x4836e5?.['fromTime'],'to_time':_0x4836e5?.[_0x42f835(0x1bd)],'limit':_0x1b4ce0,'last_id':_0x327197??_0x4836e5?.[_0x42f835(0x163)]}),_0x2c8aa9);return _0x39c793['map'](_0x43fe22=>({'project_id':_0x43fe22['project']?.['id'],'project_name':_0x43fe22[_0x42f835(0x1b8)]?.[_0x42f835(0x15f)],'workflow_id':_0x43fe22[_0x42f835(0x19f)]?.['id'],'workflow_name':_0x43fe22[_0x42f835(0x19f)]?.['name'],'session_id':_0x43fe22['id'],'sessionUuid':_0x43fe22[_0x42f835(0x151)],'sessionTime':_0x43fe22['sessionTime'],'lastAttempt':_0x43fe22['lastAttempt'],'id':_0x43fe22['id'],'project':_0x43fe22[_0x42f835(0x1b8)],'workflow':_0x43fe22[_0x42f835(0x19f)]}));}async[a192_0x11144c(0x15d)](_0x57ba52){const _0x51dfdd=a192_0x11144c,_0x310254=_0x57ba52?.[_0x51dfdd(0x156)]||0x64,_0x57071b=await paginateResults((_0x246c22,_0x583c62)=>this['client'][_0x51dfdd(0x15e)]({'project_name':_0x57ba52?.[_0x51dfdd(0x18d)],'workflow_name':_0x57ba52?.[_0x51dfdd(0x162)],'include_retried':_0x57ba52?.[_0x51dfdd(0x18e)],'limit':_0x246c22,'last_id':_0x583c62??_0x57ba52?.[_0x51dfdd(0x163)]}),_0x310254);return _0x57071b[_0x51dfdd(0x18f)](_0x48bb96=>({'project_id':_0x48bb96[_0x51dfdd(0x1b8)]?.['id'],'project_name':_0x48bb96[_0x51dfdd(0x1b8)]?.[_0x51dfdd(0x15f)],'workflow_id':_0x48bb96['workflow']?.['id'],'workflow_name':_0x48bb96[_0x51dfdd(0x19f)]?.[_0x51dfdd(0x15f)],'session_id':_0x48bb96['sessionId'],'sessionUuid':_0x48bb96[_0x51dfdd(0x151)],'sessionTime':_0x48bb96['sessionTime'],'attempt_id':_0x48bb96['id'],'attempt_index':_0x48bb96[_0x51dfdd(0x153)],'retryAttemptName':_0x48bb96[_0x51dfdd(0x171)],'done':_0x48bb96[_0x51dfdd(0x17c)],'success':_0x48bb96['success'],'cancelRequested':_0x48bb96[_0x51dfdd(0x17b)],'params':_0x48bb96['params'],'createdAt':_0x48bb96[_0x51dfdd(0x197)],'finishedAt':_0x48bb96[_0x51dfdd(0x17d)],'id':_0x48bb96['id'],'index':_0x48bb96['index'],'project':_0x48bb96[_0x51dfdd(0x1b8)],'workflow':_0x48bb96['workflow']}));}async['attempt'](_0x4d87e2){const _0x3afe43=a192_0x11144c,_0x13fd58=await this[_0x3afe43(0x1b6)]['getAttempt'](_0x4d87e2);return _0x13fd58;}async[a192_0x11144c(0x1a8)](_0x50358a,_0x5c0449=![]){const _0x1e2755=a192_0x11144c,_0x58ba14=await this[_0x1e2755(0x1b6)][_0x1e2755(0x161)](_0x50358a,_0x5c0449);return _0x58ba14[_0x1e2755(0x18f)](_0x1d974d=>({'task_id':_0x1d974d['id'],'task_name':_0x1d974d[_0x1e2755(0x1b5)],'parentId':_0x1d974d[_0x1e2755(0x192)],'config':_0x1d974d[_0x1e2755(0x1a2)],'upstreams':_0x1d974d['upstreams'],'state':_0x1d974d[_0x1e2755(0x174)],'exportParams':_0x1d974d[_0x1e2755(0x14a)],'storeParams':_0x1d974d[_0x1e2755(0x181)],'stateParams':_0x1d974d['stateParams'],'updatedAt':_0x1d974d[_0x1e2755(0x184)],'retryAt':_0x1d974d['retryAt'],'startedAt':_0x1d974d[_0x1e2755(0x159)],'error':_0x1d974d[_0x1e2755(0x168)],'isGroup':_0x1d974d['isGroup'],'id':_0x1d974d['id'],'fullName':_0x1d974d[_0x1e2755(0x1b5)]}));}async['logFiles'](_0x42f142,_0x427852){const _0x2696b3=a192_0x11144c;return await this[_0x2696b3(0x1b6)]['listLogFiles'](_0x42f142,_0x427852);}async[a192_0x11144c(0x1a7)](_0x1ade06,_0x5da4e1){const _0x34d00d=a192_0x11144c,_0x2cab1e=await import(_0x34d00d(0x15c)),{promisify:_0x23efbb}=await import(_0x34d00d(0x185)),_0x3b4407=_0x23efbb(_0x2cab1e[_0x34d00d(0x167)]),_0x53e5bf=await this[_0x34d00d(0x1b6)][_0x34d00d(0x1a5)](_0x1ade06,_0x5da4e1);if(_0x53e5bf['length']===0x0)return'';const _0x1df9b1=[];for(const _0x22696a of _0x53e5bf){if(!_0x22696a[_0x34d00d(0x152)])continue;const _0x8db940=await fetch(_0x22696a[_0x34d00d(0x152)]);if(!_0x8db940['ok'])throw new Error(_0x34d00d(0x1ac)+_0x8db940[_0x34d00d(0x14e)]);const _0x47dff0=Buffer['from'](await _0x8db940[_0x34d00d(0x141)]()),_0x33c0d5=await _0x3b4407(_0x47dff0);_0x1df9b1[_0x34d00d(0x16e)](_0x33c0d5[_0x34d00d(0x164)](_0x34d00d(0x155)));}return _0x1df9b1[_0x34d00d(0x1af)]('\x0a');}async[a192_0x11144c(0x1a3)](_0x101f23,_0x44b853){const _0x177d3b=a192_0x11144c,_0xd68933=await this[_0x177d3b(0x1b6)]['killAttempt'](_0x101f23,_0x44b853);return _0xd68933?.[_0x177d3b(0x19e)]??_0x177d3b(0x1ba);}async['retrySession'](_0x238ea6,_0x16ab49){const _0x21f60b=a192_0x11144c,_0x4bc1e0=await this['client'][_0x21f60b(0x146)](_0x238ea6,{'from_task':_0x16ab49?.[_0x21f60b(0x173)],'retry_params':_0x16ab49?.[_0x21f60b(0x14f)]});return{'attemptId':_0x4bc1e0['id'],'sessionId':_0x4bc1e0[_0x21f60b(0x186)]};}async['retryAttempt'](_0x5f13e5,_0x3091f1){const _0x5965ba=a192_0x11144c,_0x32bd15=await this[_0x5965ba(0x1b6)]['retryAttempt'](_0x5f13e5,{'resume_from':_0x3091f1?.[_0x5965ba(0x1b7)],'retry_params':_0x3091f1?.[_0x5965ba(0x14f)],'force':_0x3091f1?.[_0x5965ba(0x1aa)]});return{'attemptId':_0x32bd15['id'],'sessionId':_0x32bd15['sessionId']};}async[a192_0x11144c(0x16d)](_0x31ecb2,_0x1163e1={},_0x362665){const _0x78d762=a192_0x11144c,_0x4e8334=_0x31ecb2[_0x78d762(0x19a)]('.');let _0x5dfe4f,_0xd67262;if(_0x4e8334===-0x1)throw new Error(_0x78d762(0x14c));_0x5dfe4f=_0x31ecb2['substring'](0x0,_0x4e8334),_0xd67262=_0x31ecb2[_0x78d762(0x1ae)](_0x4e8334+0x1);if(!_0x5dfe4f||!_0xd67262)throw new Error(_0x78d762(0x194)+_0x31ecb2+_0x78d762(0x176));const _0x3beb4b=_0x362665?.[_0x78d762(0x149)]||new Date()['toISOString']();return await this[_0x78d762(0x1b6)][_0x78d762(0x145)]({'projectName':_0x5dfe4f,'workflowName':_0xd67262,'sessionTime':_0x3beb4b,'params':_0x1163e1});}async[a192_0x11144c(0x182)](_0x239f17,_0x1cc8d1,_0x14179a){const _0x1bc783=a192_0x11144c,{promises:_0x1df84e}=await import('fs'),_0x390507=await import(_0x1bc783(0x16c)),_0x160f30=await import('os'),_0x50840e=await import(_0x1bc783(0x150)),{id:_0x2cec00,name:_0x2818d2}=await this[_0x1bc783(0x1ab)](_0x239f17),_0x46b494=_0x160f30[_0x1bc783(0x177)](),_0x36eb55=_0x390507[_0x1bc783(0x1af)](_0x46b494,_0x1bc783(0x18c)+_0x2cec00+'-'+Date['now']()+_0x1bc783(0x1b0));try{await this[_0x1bc783(0x1b6)][_0x1bc783(0x17f)](_0x2cec00,_0x36eb55,_0x14179a?.['revision']);const _0x2ae512=_0x390507['join'](_0x1cc8d1,_0x2818d2);await _0x1df84e[_0x1bc783(0x140)](_0x2ae512,{'recursive':!![]}),await _0x50840e['extract']({'file':_0x36eb55,'cwd':_0x2ae512,'gzip':!![]});const _0x180a2a=async _0x2e311d=>{const _0x1e4638=_0x1bc783;let _0x110172=0x0;const _0xdbcceb=await _0x1df84e['readdir'](_0x2e311d,{'withFileTypes':!![]});for(const _0x394b69 of _0xdbcceb){const _0x3f7152=_0x390507[_0x1e4638(0x1af)](_0x2e311d,_0x394b69[_0x1e4638(0x15f)]);if(_0x394b69['isFile']())_0x110172++;else _0x394b69[_0x1e4638(0x19d)]()&&(_0x110172+=await _0x180a2a(_0x3f7152));}return _0x110172;},_0x41da3e=await _0x180a2a(_0x2ae512);return{'projectName':_0x2818d2,'revision':_0x14179a?.[_0x1bc783(0x188)]||_0x1bc783(0x187),'filesExtracted':_0x41da3e};}finally{try{await _0x1df84e[_0x1bc783(0x160)](_0x36eb55);}catch{}}}async[a192_0x11144c(0x16e)](_0x407a88,_0xc99485){const _0x22689e=a192_0x11144c,{promises:_0x1fd390}=await import('fs'),_0x1345f5=await import(_0x22689e(0x16c)),_0x177bd9=await import(_0x22689e(0x150)),_0x32ac7e=_0xc99485?.[_0x22689e(0x18d)]||_0x1345f5[_0x22689e(0x147)](_0x407a88),_0x2a1e7e=_0xc99485?.[_0x22689e(0x188)]||new Date()[_0x22689e(0x190)]()[_0x22689e(0x180)](/[:.]/g,'-');try{await _0x1fd390['access'](_0x407a88);}catch{throw new Error('Project\x20directory\x20not\x20found:\x20'+_0x407a88);}if(!_0xc99485?.['skipValidation']){const _0xbeaa1d=await _0x1fd390[_0x22689e(0x1a6)](_0x407a88),_0x1e237a=_0xbeaa1d[_0x22689e(0x178)](_0xe0c46d=>_0xe0c46d['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0x1e237a[_0x22689e(0x17a)]===0x0)throw new Error(_0x22689e(0x16f)+WORKFLOW_FILE_EXTENSION+_0x22689e(0x148));for(const _0x40172c of _0x1e237a){const _0x37ccc6=_0x1345f5[_0x22689e(0x1af)](_0x407a88,_0x40172c);try{await _0x1fd390['access'](_0x37ccc6);}catch{throw new Error(_0x22689e(0x170)+_0x40172c);}}}const _0x400fd9=async(_0x2f38e8,_0x4285cf='')=>{const _0x1e199f=_0x22689e,_0x15faaa=await _0x1fd390[_0x1e199f(0x1a6)](_0x2f38e8,{'withFileTypes':!![]}),_0x45d266=[];for(const _0x244c74 of _0x15faaa){const _0x349f2e=_0x1345f5[_0x1e199f(0x1af)](_0x4285cf,_0x244c74['name']),_0x5f3f91=_0x1345f5[_0x1e199f(0x1af)](_0x2f38e8,_0x244c74[_0x1e199f(0x15f)]);if(!shouldIncludeInArchive(_0x244c74['name']))continue;_0x244c74['isDirectory']()?_0x45d266[_0x1e199f(0x16e)](...await _0x400fd9(_0x5f3f91,_0x349f2e)):_0x45d266[_0x1e199f(0x16e)](_0x349f2e);}return _0x45d266;},_0x420f6f=await _0x400fd9(_0x407a88),_0x2e5705=await import('os'),_0x409728=_0x2e5705['tmpdir'](),_0x4fa907=_0x1345f5[_0x22689e(0x1af)](_0x409728,'tdx-workflow-push-'+Date[_0x22689e(0x1a4)]()+_0x22689e(0x1b0));try{await _0x177bd9[_0x22689e(0x1b4)]({'file':_0x4fa907,'gzip':!![],'cwd':_0x407a88,'portable':!![]},_0x420f6f);const _0x4c61b5=await this[_0x22689e(0x1b6)]['uploadProjectArchive'](_0x32ac7e,_0x2a1e7e,_0x4fa907,{'scheduleFrom':_0xc99485?.[_0x22689e(0x19c)],'clearSchedule':_0xc99485?.[_0x22689e(0x1a9)],'clearScheduleAll':_0xc99485?.[_0x22689e(0x169)]});return{'projectId':_0x4c61b5['id'],'projectName':_0x4c61b5[_0x22689e(0x15f)],'revision':_0x4c61b5[_0x22689e(0x188)]};}finally{try{await _0x1fd390[_0x22689e(0x160)](_0x4fa907);}catch{}}}async['delete'](_0x4aa39c){const _0x3d9cee=a192_0x11144c,{id:_0x98557e}=await this[_0x3d9cee(0x1ab)](_0x4aa39c),_0x3bd7c4=await this[_0x3d9cee(0x1b6)][_0x3d9cee(0x1bc)](_0x98557e);return{'projectId':_0x3bd7c4['id'],'projectName':_0x3bd7c4['name']};}async[a192_0x11144c(0x183)](_0xb629ee){const _0x148525=a192_0x11144c,{id:_0x4d71c6,name:_0x164991}=await this[_0x148525(0x1ab)](_0xb629ee),_0x338941=await this[_0x148525(0x1b6)][_0x148525(0x183)](_0x4d71c6);return{'projectName':_0x164991,'secrets':_0x338941};}async[a192_0x11144c(0x1b2)](_0x241f5c,_0x2b41b9,_0x5eea6e){const _0x55d22c=a192_0x11144c,{id:_0x44c9bc,name:_0x32b21d}=await this[_0x55d22c(0x1ab)](_0x241f5c);return await this[_0x55d22c(0x1b6)][_0x55d22c(0x1b2)](_0x44c9bc,_0x2b41b9,_0x5eea6e),{'projectName':_0x32b21d,'key':_0x2b41b9};}async['setSecrets'](_0x102f52,_0x5a2c8e){const _0x2df6f4=a192_0x11144c,{id:_0x121bbc,name:_0x229457}=await this[_0x2df6f4(0x1ab)](_0x102f52),_0x2b590a=Object[_0x2df6f4(0x16a)](_0x5a2c8e),_0x2b4566=await Promise['allSettled'](_0x2b590a[_0x2df6f4(0x18f)](_0x825d1d=>this[_0x2df6f4(0x1b6)][_0x2df6f4(0x1b2)](_0x121bbc,_0x825d1d,_0x5a2c8e[_0x825d1d]))),_0x47ef98=_0x2b4566['map']((_0x7bf5e5,_0x1ad451)=>_0x7bf5e5[_0x2df6f4(0x14e)]===_0x2df6f4(0x195)?_0x2b590a[_0x1ad451]:null)[_0x2df6f4(0x178)](_0x5aeac9=>_0x5aeac9!==null);if(_0x47ef98[_0x2df6f4(0x17a)]>0x0)throw new SDKError(ErrorCode[_0x2df6f4(0x175)],_0x2df6f4(0x1b3)+(_0x47ef98['length']>0x1?'s':'')+':\x20'+_0x47ef98['join'](',\x20'));return{'projectName':_0x229457,'keys':_0x2b590a};}async['deleteSecret'](_0x12989c,_0x2d4c5e){const _0x273db6=a192_0x11144c,{id:_0xb9387b,name:_0x2a9e37}=await this[_0x273db6(0x1ab)](_0x12989c);return await this[_0x273db6(0x1b6)][_0x273db6(0x17e)](_0xb9387b,_0x2d4c5e),{'projectName':_0x2a9e37,'key':_0x2d4c5e};}async[a192_0x11144c(0x14d)](_0x537ec9,_0x1c0c9e){const _0x242ee1=a192_0x11144c;return pullWorkflow({'client':this[_0x242ee1(0x1b6)],'resolveProjectId':this[_0x242ee1(0x1ab)][_0x242ee1(0x179)](this)},_0x537ec9,_0x1c0c9e);}async[a192_0x11144c(0x154)](_0x4f4bd3,_0x18044f){const _0x51859c=a192_0x11144c;return applyPullResult({'client':this['client'],'resolveProjectId':this[_0x51859c(0x1ab)][_0x51859c(0x179)](this)},_0x4f4bd3,_0x18044f);}async[a192_0x11144c(0x189)](_0x5623d1){const _0x272d14=a192_0x11144c;return preparePushWorkflow({'client':this[_0x272d14(0x1b6)],'resolveProjectId':this[_0x272d14(0x1ab)][_0x272d14(0x179)](this)},_0x5623d1);}async[a192_0x11144c(0x13f)](_0x5e3f3a){const _0x1b69df=a192_0x11144c;return executePushWorkflow({'client':this[_0x1b69df(0x1b6)],'resolveProjectId':this[_0x1b69df(0x1ab)]['bind'](this)},_0x5e3f3a);}async[a192_0x11144c(0x16b)](_0x4aa420,_0x55eb73,_0x327bb0){return prepareCloneWorkflow({'client':this['client']},_0x4aa420,_0x55eb73,_0x327bb0);}async['executeCloneProject'](_0x49fdb0){const _0x47f251=a192_0x11144c;return executeCloneWorkflow({'client':this[_0x47f251(0x1b6)]},_0x49fdb0);}}
@@ -1 +1 @@
1
- (function(_0x709cdb,_0x40b76f){const _0x399e1d=a193_0x3902,_0x24d5d5=_0x709cdb();while(!![]){try{const _0x218cbd=parseInt(_0x399e1d(0x177))/0x1*(-parseInt(_0x399e1d(0x167))/0x2)+-parseInt(_0x399e1d(0x17b))/0x3+-parseInt(_0x399e1d(0x13f))/0x4*(parseInt(_0x399e1d(0x16e))/0x5)+-parseInt(_0x399e1d(0x164))/0x6*(parseInt(_0x399e1d(0x162))/0x7)+parseInt(_0x399e1d(0x166))/0x8*(-parseInt(_0x399e1d(0x16d))/0x9)+parseInt(_0x399e1d(0x172))/0xa+parseInt(_0x399e1d(0x163))/0xb*(parseInt(_0x399e1d(0x15d))/0xc);if(_0x218cbd===_0x40b76f)break;else _0x24d5d5['push'](_0x24d5d5['shift']());}catch(_0x478f88){_0x24d5d5['push'](_0x24d5d5['shift']());}}}(a193_0x46fe,0x8f232));import{existsSync,promises as a193_0x1e17c6}from'fs';import a193_0x298331 from'path';import a193_0xc049b7 from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';function a193_0x46fe(){const _0x19e93c=['catch','unchanged','9xxxqFi','5211785kQJJQn','mkdtemp','tdx-wf-apply-','type','8671360YIFzFZ','writeFile','zlib','stat','TAR_BAD_ARCHIVE','1DJMEKf','The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20','WORKFLOW_ARCHIVE_CORRUPTED','revision','1573314xpNeES','length','4RpviJW','baseDir','deleted','message','projectName','latest','Failed\x20to\x20extract\x20project\x20archive','downloadProjectArchive','includes','has','join','new','filter','push','size','readdir','utf-8','toISOString','The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.','readFile','isDirectory','targetDir','path','sort','localeCompare','name','mkdir','changes','\x20bytes)','tar','108HnBIFv','getProject','tdx.json','modified','projectId','191849MkYwkT','3155372wWMIxJ','204jaliXP','isNewProject','2350104zcEsuU','140236KHSwEz','\x20(archive\x20size:\x20','extract','extracted'];a193_0x46fe=function(){return _0x19e93c;};return a193_0x46fe();}import{getWorkflowProjectDir,createWorkflowTdxConfigContent,updateWorkflowTdxConfig}from'./tdx-config.js';import{SDKError,ErrorCode}from'../errors.js';function a193_0x3902(_0x6ef4cb,_0x15c1b2){_0x6ef4cb=_0x6ef4cb-0x13f;const _0x46fe83=a193_0x46fe();let _0x390232=_0x46fe83[_0x6ef4cb];return _0x390232;}export async function pullWorkflow(_0xb547fa,_0x28ad6a,_0x2e43e4={}){const _0x794d18=a193_0x3902,_0x5ef9a9=await import('tar'),{client:_0x15545d,resolveProjectId:_0x1fbba0}=_0xb547fa,{id:_0x1b3765,name:_0x5525aa}=await _0x1fbba0(_0x28ad6a),_0x503ba1=_0x2e43e4[_0x794d18(0x140)]||process['cwd'](),_0x1933f=_0x2e43e4[_0x794d18(0x154)]||getWorkflowProjectDir(_0x5525aa,_0x503ba1),_0x548ec1=a193_0x298331[_0x794d18(0x149)](_0x1933f,_0x794d18(0x15f)),_0x59e129=!existsSync(_0x548ec1),_0x27b6fb=await a193_0x1e17c6[_0x794d18(0x16f)](a193_0x298331[_0x794d18(0x149)](a193_0xc049b7['tmpdir'](),'tdx-wf-pull-')),_0x1bb8f7=a193_0x298331[_0x794d18(0x149)](_0x27b6fb,'archive.tar.gz'),_0x163a44=a193_0x298331[_0x794d18(0x149)](_0x27b6fb,_0x794d18(0x16a));try{await _0x15545d[_0x794d18(0x146)](_0x1b3765,_0x1bb8f7,_0x2e43e4[_0x794d18(0x17a)]),await a193_0x1e17c6['mkdir'](_0x163a44,{'recursive':!![]});try{await _0x5ef9a9[_0x794d18(0x169)]({'file':_0x1bb8f7,'cwd':_0x163a44,'gzip':!![]});}catch(_0x2ec263){const _0x1822e8=_0x2ec263 instanceof Error?_0x2ec263[_0x794d18(0x142)]:String(_0x2ec263);if(_0x1822e8[_0x794d18(0x147)](_0x794d18(0x176))||_0x1822e8[_0x794d18(0x147)](_0x794d18(0x174))){const _0x6acc38=await a193_0x1e17c6[_0x794d18(0x175)](_0x1bb8f7)['catch'](()=>null),_0x31ad05=_0x6acc38?_0x794d18(0x168)+_0x6acc38[_0x794d18(0x14d)]+_0x794d18(0x15b):'';throw new SDKError(ErrorCode[_0x794d18(0x179)],'Failed\x20to\x20extract\x20project\x20archive'+_0x31ad05+':\x20'+_0x1822e8,_0x2ec263,{'helpText':'The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20'+_0x794d18(0x151)});}throw _0x2ec263;}const _0x16ef04=await _0x15545d[_0x794d18(0x15e)](_0x1b3765),_0x582c2f=_0x2e43e4[_0x794d18(0x17a)]||_0x16ef04[_0x794d18(0x17a)]||_0x794d18(0x144),_0xf17c89=await calculateChanges(_0x1933f,_0x163a44,_0x59e129),_0x16637c={'new':_0xf17c89[_0x794d18(0x14b)](_0x57d2f7=>_0x57d2f7[_0x794d18(0x171)]===_0x794d18(0x14a))[_0x794d18(0x17c)],'modified':_0xf17c89[_0x794d18(0x14b)](_0x10fcc0=>_0x10fcc0['type']===_0x794d18(0x160))[_0x794d18(0x17c)],'deleted':_0xf17c89[_0x794d18(0x14b)](_0x23e2f6=>_0x23e2f6[_0x794d18(0x171)]===_0x794d18(0x141))[_0x794d18(0x17c)],'unchanged':_0xf17c89['filter'](_0x12be35=>_0x12be35[_0x794d18(0x171)]===_0x794d18(0x16c))['length']};return{'projectName':_0x5525aa,'projectId':_0x1b3765,'revision':_0x582c2f,'targetDir':_0x1933f,'changes':_0xf17c89,'summary':_0x16637c,'hasChanges':_0x16637c[_0x794d18(0x14a)]>0x0||_0x16637c[_0x794d18(0x160)]>0x0||_0x16637c[_0x794d18(0x141)]>0x0,'isNewProject':_0x59e129};}finally{await a193_0x1e17c6['rm'](_0x27b6fb,{'recursive':!![],'force':!![]});}}export async function applyPullResult(_0x4e5ac2,_0x1bc575,_0x296414={}){const _0x412375=a193_0x3902,_0x2286b3=await import(_0x412375(0x15c)),{client:_0x213b9}=_0x4e5ac2,_0xdb071=await a193_0x1e17c6[_0x412375(0x16f)](a193_0x298331[_0x412375(0x149)](a193_0xc049b7['tmpdir'](),_0x412375(0x170))),_0x75fcde=a193_0x298331[_0x412375(0x149)](_0xdb071,'archive.tar.gz');try{await _0x213b9[_0x412375(0x146)](_0x1bc575['projectId'],_0x75fcde,_0x296414[_0x412375(0x17a)]),await a193_0x1e17c6[_0x412375(0x159)](_0x1bc575[_0x412375(0x154)],{'recursive':!![]});for(const _0x471833 of _0x1bc575[_0x412375(0x15a)]){if(_0x471833[_0x412375(0x171)]===_0x412375(0x141)){const _0x4bac90=a193_0x298331['join'](_0x1bc575[_0x412375(0x154)],_0x471833[_0x412375(0x155)]);await a193_0x1e17c6['unlink'](_0x4bac90)['catch'](()=>{});}}try{await _0x2286b3[_0x412375(0x169)]({'file':_0x75fcde,'cwd':_0x1bc575[_0x412375(0x154)],'gzip':!![]});}catch(_0x4656c0){const _0x2b6e57=_0x4656c0 instanceof Error?_0x4656c0[_0x412375(0x142)]:String(_0x4656c0);if(_0x2b6e57[_0x412375(0x147)]('TAR_BAD_ARCHIVE')||_0x2b6e57[_0x412375(0x147)](_0x412375(0x174))){const _0x47d3d7=await a193_0x1e17c6[_0x412375(0x175)](_0x75fcde)[_0x412375(0x16b)](()=>null),_0x3ed934=_0x47d3d7?'\x20(archive\x20size:\x20'+_0x47d3d7[_0x412375(0x14d)]+_0x412375(0x15b):'';throw new SDKError(ErrorCode[_0x412375(0x179)],_0x412375(0x145)+_0x3ed934+':\x20'+_0x2b6e57,_0x4656c0,{'helpText':_0x412375(0x178)+_0x412375(0x151)});}throw _0x4656c0;}const _0x11614d=a193_0x298331['join'](_0x1bc575['targetDir'],_0x412375(0x15f));if(_0x1bc575[_0x412375(0x165)]){const _0x50d102=createWorkflowTdxConfigContent(_0x1bc575[_0x412375(0x143)],_0x1bc575[_0x412375(0x161)],_0x1bc575[_0x412375(0x17a)]);await a193_0x1e17c6[_0x412375(0x173)](_0x11614d,_0x50d102,_0x412375(0x14f));}else updateWorkflowTdxConfig(_0x11614d,{'last_pulled_revision':_0x1bc575['revision'],'last_pulled_at':new Date()[_0x412375(0x150)]()});}finally{await a193_0x1e17c6['rm'](_0xdb071,{'recursive':!![],'force':!![]});}}async function calculateChanges(_0x16aa35,_0x222c05,_0x4a470d){const _0x4397f4=a193_0x3902,_0x240cf1=[],_0x29a75a=await getAllFiles(_0x222c05),_0x3b5247=existsSync(_0x16aa35)?await getAllFiles(_0x16aa35):new Set();for(const _0x27a0b5 of _0x29a75a){const _0x158c44=a193_0x298331[_0x4397f4(0x149)](_0x16aa35,_0x27a0b5),_0x58fe0c=a193_0x298331[_0x4397f4(0x149)](_0x222c05,_0x27a0b5);if(_0x27a0b5===_0x4397f4(0x15f))continue;const _0x5473c1=await a193_0x1e17c6[_0x4397f4(0x152)](_0x58fe0c,'utf-8')['catch'](()=>null);if(_0x5473c1===null)continue;if(!existsSync(_0x158c44)||_0x4a470d)_0x240cf1[_0x4397f4(0x14c)]({'path':_0x27a0b5,'type':_0x4397f4(0x14a),'newContent':_0x5473c1});else{const _0x31f162=await a193_0x1e17c6[_0x4397f4(0x152)](_0x158c44,_0x4397f4(0x14f))[_0x4397f4(0x16b)](()=>null);if(_0x31f162===null)_0x240cf1[_0x4397f4(0x14c)]({'path':_0x27a0b5,'type':_0x4397f4(0x160),'newContent':_0x5473c1});else{if(_0x31f162!==_0x5473c1){const _0x15f9f9=generateDiff(_0x31f162,_0x5473c1),_0x377a01=hasChanges(_0x15f9f9)?formatDiffWithColors(_0x15f9f9):undefined;_0x240cf1[_0x4397f4(0x14c)]({'path':_0x27a0b5,'type':_0x4397f4(0x160),'oldContent':_0x31f162,'newContent':_0x5473c1,'diff':_0x377a01});}else _0x240cf1['push']({'path':_0x27a0b5,'type':'unchanged'});}}}if(!_0x4a470d)for(const _0x3afdb0 of _0x3b5247){if(_0x3afdb0===_0x4397f4(0x15f))continue;if(!_0x29a75a[_0x4397f4(0x148)](_0x3afdb0)){const _0x349ee9=a193_0x298331[_0x4397f4(0x149)](_0x16aa35,_0x3afdb0),_0x452b90=await a193_0x1e17c6[_0x4397f4(0x152)](_0x349ee9,_0x4397f4(0x14f))[_0x4397f4(0x16b)](()=>undefined);_0x240cf1[_0x4397f4(0x14c)]({'path':_0x3afdb0,'type':_0x4397f4(0x141),'oldContent':_0x452b90});}}return _0x240cf1[_0x4397f4(0x156)]((_0x44c564,_0x1757a3)=>_0x44c564[_0x4397f4(0x155)][_0x4397f4(0x157)](_0x1757a3[_0x4397f4(0x155)])),_0x240cf1;}async function getAllFiles(_0x393e26,_0xc7a0a3=''){const _0x3c75f1=a193_0x3902,_0x3bd742=new Set();if(!existsSync(_0x393e26))return _0x3bd742;const _0x2a8a0a=await a193_0x1e17c6[_0x3c75f1(0x14e)](_0x393e26,{'withFileTypes':!![]});for(const _0x1bc70d of _0x2a8a0a){const _0x3e3e55=_0xc7a0a3?a193_0x298331[_0x3c75f1(0x149)](_0xc7a0a3,_0x1bc70d[_0x3c75f1(0x158)]):_0x1bc70d[_0x3c75f1(0x158)];if(_0x1bc70d[_0x3c75f1(0x153)]()){const _0x446580=await getAllFiles(a193_0x298331[_0x3c75f1(0x149)](_0x393e26,_0x1bc70d[_0x3c75f1(0x158)]),_0x3e3e55);for(const _0x3a0f47 of _0x446580){_0x3bd742['add'](_0x3a0f47);}}else _0x3bd742['add'](_0x3e3e55);}return _0x3bd742;}
1
+ (function(_0x347a1e,_0x49bbb4){const _0x346f32=a193_0x1e7d,_0x39458a=_0x347a1e();while(!![]){try{const _0x55c2a8=parseInt(_0x346f32(0x173))/0x1+parseInt(_0x346f32(0x163))/0x2+parseInt(_0x346f32(0x181))/0x3+parseInt(_0x346f32(0x194))/0x4*(-parseInt(_0x346f32(0x172))/0x5)+-parseInt(_0x346f32(0x18a))/0x6+parseInt(_0x346f32(0x195))/0x7+-parseInt(_0x346f32(0x17c))/0x8;if(_0x55c2a8===_0x49bbb4)break;else _0x39458a['push'](_0x39458a['shift']());}catch(_0x176dff){_0x39458a['push'](_0x39458a['shift']());}}}(a193_0x4025,0x71033));function a193_0x4025(){const _0x5a8ba0=['message','stat','The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.','projectName','\x20(archive\x20size:\x20','size','tmpdir','utf-8','latest','archive.tar.gz','242395pXJlMq','265783nLOKMD','push','downloadProjectArchive','type','unchanged','changes','has','tdx.json','\x20bytes)','15113528yUQNEQ','getProject','catch','revision','modified','2376414VfAZUy','mkdir','TAR_BAD_ARCHIVE','add','targetDir','path','filter','includes','deleted','514230cWTLBu','join','baseDir','readdir','tdx-wf-pull-','tar','length','new','toISOString','isDirectory','4YPymri','4798857JLPYTg','zlib','readFile','mkdtemp','The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20','extract','Failed\x20to\x20extract\x20project\x20archive','projectId','1485604mDzcUo','extracted','name','cwd','writeFile'];a193_0x4025=function(){return _0x5a8ba0;};return a193_0x4025();}import{existsSync,promises as a193_0x405e34}from'fs';import a193_0x39c35a from'path';import a193_0x22b857 from'os';function a193_0x1e7d(_0x2d8c06,_0x45bc00){_0x2d8c06=_0x2d8c06-0x160;const _0x4025de=a193_0x4025();let _0x1e7d21=_0x4025de[_0x2d8c06];return _0x1e7d21;}import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{getWorkflowProjectDir,createWorkflowTdxConfigContent,updateWorkflowTdxConfig}from'./tdx-config.js';import{SDKError,ErrorCode}from'../errors.js';export async function pullWorkflow(_0x442e4a,_0x2a2068,_0x5c05f4={}){const _0x14be48=a193_0x1e7d,_0x3ec023=await import(_0x14be48(0x18f)),{client:_0x1b5957,resolveProjectId:_0x10256c}=_0x442e4a,{id:_0x11dbf1,name:_0x5ba09d}=await _0x10256c(_0x2a2068),_0x2ea803=_0x5c05f4[_0x14be48(0x18c)]||process[_0x14be48(0x166)](),_0x2c279d=_0x5c05f4['targetDir']||getWorkflowProjectDir(_0x5ba09d,_0x2ea803),_0x30a917=a193_0x39c35a['join'](_0x2c279d,_0x14be48(0x17a)),_0x4e8d82=!existsSync(_0x30a917),_0x4f0cc8=await a193_0x405e34[_0x14be48(0x198)](a193_0x39c35a[_0x14be48(0x18b)](a193_0x22b857[_0x14be48(0x16e)](),_0x14be48(0x18e))),_0x2726c7=a193_0x39c35a['join'](_0x4f0cc8,_0x14be48(0x171)),_0x47a7de=a193_0x39c35a[_0x14be48(0x18b)](_0x4f0cc8,_0x14be48(0x164));try{await _0x1b5957[_0x14be48(0x175)](_0x11dbf1,_0x2726c7,_0x5c05f4[_0x14be48(0x17f)]),await a193_0x405e34[_0x14be48(0x182)](_0x47a7de,{'recursive':!![]});try{await _0x3ec023['extract']({'file':_0x2726c7,'cwd':_0x47a7de,'gzip':!![]});}catch(_0x11f1cc){const _0x23c53a=_0x11f1cc instanceof Error?_0x11f1cc[_0x14be48(0x168)]:String(_0x11f1cc);if(_0x23c53a['includes'](_0x14be48(0x183))||_0x23c53a[_0x14be48(0x188)](_0x14be48(0x196))){const _0x68f216=await a193_0x405e34[_0x14be48(0x169)](_0x2726c7)[_0x14be48(0x17e)](()=>null),_0x4d492a=_0x68f216?'\x20(archive\x20size:\x20'+_0x68f216[_0x14be48(0x16d)]+_0x14be48(0x17b):'';throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0x14be48(0x161)+_0x4d492a+':\x20'+_0x23c53a,_0x11f1cc,{'helpText':_0x14be48(0x199)+_0x14be48(0x16a)});}throw _0x11f1cc;}const _0x594494=await _0x1b5957[_0x14be48(0x17d)](_0x11dbf1),_0x5e0985=_0x5c05f4[_0x14be48(0x17f)]||_0x594494[_0x14be48(0x17f)]||_0x14be48(0x170),_0xbb6bec=await calculateChanges(_0x2c279d,_0x47a7de,_0x4e8d82),_0x21f312={'new':_0xbb6bec[_0x14be48(0x187)](_0x2dd9c3=>_0x2dd9c3[_0x14be48(0x176)]===_0x14be48(0x191))[_0x14be48(0x190)],'modified':_0xbb6bec[_0x14be48(0x187)](_0x3089df=>_0x3089df['type']==='modified')[_0x14be48(0x190)],'deleted':_0xbb6bec[_0x14be48(0x187)](_0x49848d=>_0x49848d['type']===_0x14be48(0x189))[_0x14be48(0x190)],'unchanged':_0xbb6bec[_0x14be48(0x187)](_0x1579db=>_0x1579db['type']==='unchanged')[_0x14be48(0x190)]};return{'projectName':_0x5ba09d,'projectId':_0x11dbf1,'revision':_0x5e0985,'targetDir':_0x2c279d,'changes':_0xbb6bec,'summary':_0x21f312,'hasChanges':_0x21f312[_0x14be48(0x191)]>0x0||_0x21f312[_0x14be48(0x180)]>0x0||_0x21f312[_0x14be48(0x189)]>0x0,'isNewProject':_0x4e8d82};}finally{await a193_0x405e34['rm'](_0x4f0cc8,{'recursive':!![],'force':!![]});}}export async function applyPullResult(_0x333196,_0x4ef8d0,_0x26e902={}){const _0x3934b9=a193_0x1e7d,_0x4d5fa2=await import(_0x3934b9(0x18f)),{client:_0x1b40b4}=_0x333196,_0x41d49a=await a193_0x405e34[_0x3934b9(0x198)](a193_0x39c35a['join'](a193_0x22b857[_0x3934b9(0x16e)](),'tdx-wf-apply-')),_0xedebca=a193_0x39c35a[_0x3934b9(0x18b)](_0x41d49a,'archive.tar.gz');try{await _0x1b40b4['downloadProjectArchive'](_0x4ef8d0[_0x3934b9(0x162)],_0xedebca,_0x26e902['revision']),await a193_0x405e34[_0x3934b9(0x182)](_0x4ef8d0[_0x3934b9(0x185)],{'recursive':!![]});for(const _0x3c549d of _0x4ef8d0[_0x3934b9(0x178)]){if(_0x3c549d[_0x3934b9(0x176)]===_0x3934b9(0x189)){const _0x36c597=a193_0x39c35a[_0x3934b9(0x18b)](_0x4ef8d0['targetDir'],_0x3c549d[_0x3934b9(0x186)]);await a193_0x405e34['unlink'](_0x36c597)[_0x3934b9(0x17e)](()=>{});}}try{await _0x4d5fa2[_0x3934b9(0x160)]({'file':_0xedebca,'cwd':_0x4ef8d0[_0x3934b9(0x185)],'gzip':!![]});}catch(_0x143346){const _0x1d485a=_0x143346 instanceof Error?_0x143346[_0x3934b9(0x168)]:String(_0x143346);if(_0x1d485a[_0x3934b9(0x188)]('TAR_BAD_ARCHIVE')||_0x1d485a['includes']('zlib')){const _0x1d12df=await a193_0x405e34['stat'](_0xedebca)[_0x3934b9(0x17e)](()=>null),_0x19d3fd=_0x1d12df?_0x3934b9(0x16c)+_0x1d12df[_0x3934b9(0x16d)]+'\x20bytes)':'';throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0x3934b9(0x161)+_0x19d3fd+':\x20'+_0x1d485a,_0x143346,{'helpText':_0x3934b9(0x199)+_0x3934b9(0x16a)});}throw _0x143346;}const _0x4d6fa6=a193_0x39c35a[_0x3934b9(0x18b)](_0x4ef8d0[_0x3934b9(0x185)],_0x3934b9(0x17a));if(_0x4ef8d0['isNewProject']){const _0x3ad9d7=createWorkflowTdxConfigContent(_0x4ef8d0[_0x3934b9(0x16b)],_0x4ef8d0['projectId'],_0x4ef8d0[_0x3934b9(0x17f)]);await a193_0x405e34[_0x3934b9(0x167)](_0x4d6fa6,_0x3ad9d7,_0x3934b9(0x16f));}else updateWorkflowTdxConfig(_0x4d6fa6,{'last_pulled_revision':_0x4ef8d0['revision'],'last_pulled_at':new Date()[_0x3934b9(0x192)]()});}finally{await a193_0x405e34['rm'](_0x41d49a,{'recursive':!![],'force':!![]});}}async function calculateChanges(_0x1297ba,_0x1fc369,_0xf62731){const _0x2f61d3=a193_0x1e7d,_0x339234=[],_0x167ae6=await getAllFiles(_0x1fc369),_0x450f08=existsSync(_0x1297ba)?await getAllFiles(_0x1297ba):new Set();for(const _0x25f7e1 of _0x167ae6){const _0x20c372=a193_0x39c35a[_0x2f61d3(0x18b)](_0x1297ba,_0x25f7e1),_0x3c0985=a193_0x39c35a[_0x2f61d3(0x18b)](_0x1fc369,_0x25f7e1);if(_0x25f7e1===_0x2f61d3(0x17a))continue;const _0x2490a8=await a193_0x405e34['readFile'](_0x3c0985,_0x2f61d3(0x16f))[_0x2f61d3(0x17e)](()=>null);if(_0x2490a8===null)continue;if(!existsSync(_0x20c372)||_0xf62731)_0x339234[_0x2f61d3(0x174)]({'path':_0x25f7e1,'type':'new','newContent':_0x2490a8});else{const _0x55f701=await a193_0x405e34[_0x2f61d3(0x197)](_0x20c372,_0x2f61d3(0x16f))[_0x2f61d3(0x17e)](()=>null);if(_0x55f701===null)_0x339234[_0x2f61d3(0x174)]({'path':_0x25f7e1,'type':_0x2f61d3(0x180),'newContent':_0x2490a8});else{if(_0x55f701!==_0x2490a8){const _0x34f004=generateDiff(_0x55f701,_0x2490a8),_0x6ce537=hasChanges(_0x34f004)?formatDiffWithColors(_0x34f004):undefined;_0x339234[_0x2f61d3(0x174)]({'path':_0x25f7e1,'type':'modified','oldContent':_0x55f701,'newContent':_0x2490a8,'diff':_0x6ce537});}else _0x339234[_0x2f61d3(0x174)]({'path':_0x25f7e1,'type':_0x2f61d3(0x177)});}}}if(!_0xf62731)for(const _0xee672f of _0x450f08){if(_0xee672f==='tdx.json')continue;if(!_0x167ae6[_0x2f61d3(0x179)](_0xee672f)){const _0x3365a6=a193_0x39c35a[_0x2f61d3(0x18b)](_0x1297ba,_0xee672f),_0x44ccee=await a193_0x405e34['readFile'](_0x3365a6,_0x2f61d3(0x16f))[_0x2f61d3(0x17e)](()=>undefined);_0x339234[_0x2f61d3(0x174)]({'path':_0xee672f,'type':_0x2f61d3(0x189),'oldContent':_0x44ccee});}}return _0x339234['sort']((_0x271fec,_0x38bdec)=>_0x271fec[_0x2f61d3(0x186)]['localeCompare'](_0x38bdec[_0x2f61d3(0x186)])),_0x339234;}async function getAllFiles(_0x17f2ca,_0x2b30c4=''){const _0x512bea=a193_0x1e7d,_0x2c2e25=new Set();if(!existsSync(_0x17f2ca))return _0x2c2e25;const _0x2dfb9b=await a193_0x405e34[_0x512bea(0x18d)](_0x17f2ca,{'withFileTypes':!![]});for(const _0x28e758 of _0x2dfb9b){const _0x1ea983=_0x2b30c4?a193_0x39c35a[_0x512bea(0x18b)](_0x2b30c4,_0x28e758[_0x512bea(0x165)]):_0x28e758[_0x512bea(0x165)];if(_0x28e758[_0x512bea(0x193)]()){const _0xb753e9=await getAllFiles(a193_0x39c35a[_0x512bea(0x18b)](_0x17f2ca,_0x28e758[_0x512bea(0x165)]),_0x1ea983);for(const _0x344731 of _0xb753e9){_0x2c2e25[_0x512bea(0x184)](_0x344731);}}else _0x2c2e25[_0x512bea(0x184)](_0x1ea983);}return _0x2c2e25;}
@@ -1 +1 @@
1
- (function(_0x2ef7aa,_0x41e588){const _0x4cb7a3=a194_0x43e9,_0x18275c=_0x2ef7aa();while(!![]){try{const _0x56cbc4=-parseInt(_0x4cb7a3(0x13f))/0x1+parseInt(_0x4cb7a3(0x13a))/0x2+-parseInt(_0x4cb7a3(0x148))/0x3*(-parseInt(_0x4cb7a3(0x156))/0x4)+parseInt(_0x4cb7a3(0x13c))/0x5+parseInt(_0x4cb7a3(0x155))/0x6*(-parseInt(_0x4cb7a3(0x162))/0x7)+parseInt(_0x4cb7a3(0x15d))/0x8*(parseInt(_0x4cb7a3(0x164))/0x9)+parseInt(_0x4cb7a3(0x170))/0xa;if(_0x56cbc4===_0x41e588)break;else _0x18275c['push'](_0x18275c['shift']());}catch(_0x2bc696){_0x18275c['push'](_0x18275c['shift']());}}}(a194_0x3836,0x8b72f));import{promises as a194_0x205233}from'fs';import a194_0x11734f from'path';import a194_0x37e0b0 from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{findWorkflowTdxConfig,updateWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION,loadDigdagignore,createIgnoreInstance,addScopedPatterns,shouldIgnoreWithInstance}from'./workflow-utils.js';import{SDKError,ErrorCode}from'../errors.js';export async function preparePushWorkflow(_0x44d4d9,_0x1383a8={}){const _0x47bac6=a194_0x43e9,_0x3c9edc=await import('tar'),{client:_0x20f080,resolveProjectId:_0x5d1fff}=_0x44d4d9,_0x574b65=_0x1383a8[_0x47bac6(0x15c)]||process[_0x47bac6(0x137)](),_0x11742e=findWorkflowTdxConfig(_0x574b65),{config:_0xfbdba4,configDir:_0x36d0d4}=_0x11742e;let _0x3116a9,_0x5e572e=_0xfbdba4[_0x47bac6(0x142)];try{const _0x3a46be=await _0x5d1fff(_0xfbdba4[_0x47bac6(0x142)]);_0x3116a9=_0x3a46be['id'],_0x5e572e=_0x3a46be[_0x47bac6(0x16d)];}catch{_0x3116a9='';}const _0x58f8e7=_0x1383a8[_0x47bac6(0x14f)]||new Date()[_0x47bac6(0x135)]()[_0x47bac6(0x15a)](/[:.]/g,'-');if(!_0x1383a8[_0x47bac6(0x143)]){const _0x278ea1=await a194_0x205233[_0x47bac6(0x147)](_0x36d0d4),_0x44d1ef=_0x278ea1['filter'](_0x233024=>_0x233024[_0x47bac6(0x151)](WORKFLOW_FILE_EXTENSION));if(_0x44d1ef[_0x47bac6(0x141)]===0x0)throw new Error(_0x47bac6(0x13b)+WORKFLOW_FILE_EXTENSION+_0x47bac6(0x167)+_0x36d0d4);}const _0x4d999a=await getProjectFiles(_0x36d0d4);let _0x242da7;if(_0x3116a9){const _0x3be3a5=await a194_0x205233[_0x47bac6(0x168)](a194_0x11734f[_0x47bac6(0x13d)](a194_0x37e0b0['tmpdir'](),'tdx-wf-push-')),_0xd8b9f9=a194_0x11734f[_0x47bac6(0x13d)](_0x3be3a5,'archive.tar.gz'),_0x288ccc=a194_0x11734f['join'](_0x3be3a5,_0x47bac6(0x14a));try{await _0x20f080[_0x47bac6(0x15e)](_0x3116a9,_0xd8b9f9),await a194_0x205233['mkdir'](_0x288ccc,{'recursive':!![]});try{await _0x3c9edc[_0x47bac6(0x165)]({'file':_0xd8b9f9,'cwd':_0x288ccc,'gzip':!![]});}catch(_0x144274){const _0x1ffdb0=_0x144274 instanceof Error?_0x144274[_0x47bac6(0x16f)]:String(_0x144274);if(_0x1ffdb0[_0x47bac6(0x152)](_0x47bac6(0x13e))||_0x1ffdb0[_0x47bac6(0x152)](_0x47bac6(0x163))){const _0x45727a=await a194_0x205233[_0x47bac6(0x144)](_0xd8b9f9)[_0x47bac6(0x171)](()=>null),_0x23de2d=_0x45727a?_0x47bac6(0x15f)+_0x45727a[_0x47bac6(0x14c)]+_0x47bac6(0x154):'';throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],'Failed\x20to\x20extract\x20remote\x20project\x20archive\x20for\x20comparison'+_0x23de2d+':\x20'+_0x1ffdb0,_0x144274,{'helpText':_0x47bac6(0x139)});}throw _0x144274;}_0x242da7=await calculatePushChanges(_0x36d0d4,_0x288ccc,_0x4d999a);}finally{await a194_0x205233['rm'](_0x3be3a5,{'recursive':!![],'force':!![]});}}else{_0x242da7=[];for(const _0x3b1cce of _0x4d999a){const _0x1dd1eb=a194_0x11734f[_0x47bac6(0x13d)](_0x36d0d4,_0x3b1cce),_0x278e75=await a194_0x205233['readFile'](_0x1dd1eb,_0x47bac6(0x136))['catch'](()=>null);_0x242da7[_0x47bac6(0x14b)]({'path':_0x3b1cce,'type':_0x47bac6(0x16a),'newContent':_0x278e75||undefined});}}const _0x9aaf69={'new':_0x242da7[_0x47bac6(0x16c)](_0x4052e9=>_0x4052e9[_0x47bac6(0x150)]===_0x47bac6(0x16a))[_0x47bac6(0x141)],'modified':_0x242da7['filter'](_0x4b3675=>_0x4b3675[_0x47bac6(0x150)]===_0x47bac6(0x149))[_0x47bac6(0x141)],'deleted':_0x242da7[_0x47bac6(0x16c)](_0x528fdf=>_0x528fdf['type']===_0x47bac6(0x158))[_0x47bac6(0x141)],'unchanged':_0x242da7['filter'](_0x21e54e=>_0x21e54e[_0x47bac6(0x150)]==='unchanged')[_0x47bac6(0x141)]};return{'projectName':_0x5e572e,'projectId':_0x3116a9,'revision':_0x58f8e7,'sourceDir':_0x36d0d4,'changes':_0x242da7,'summary':_0x9aaf69,'hasChanges':_0x9aaf69['new']>0x0||_0x9aaf69[_0x47bac6(0x149)]>0x0||_0x9aaf69['deleted']>0x0,'configResult':_0x11742e};}export async function executePushWorkflow(_0x5bdc88,_0x29955e){const _0x10936e=a194_0x43e9,_0x20749d=await import(_0x10936e(0x14e)),{client:_0x1d20d5}=_0x5bdc88,_0x240501=await getProjectFiles(_0x29955e[_0x10936e(0x15c)]),_0x332ba4=await a194_0x205233[_0x10936e(0x168)](a194_0x11734f[_0x10936e(0x13d)](a194_0x37e0b0[_0x10936e(0x138)](),_0x10936e(0x140))),_0x405a37=a194_0x11734f[_0x10936e(0x13d)](_0x332ba4,'archive.tar.gz');try{await _0x20749d[_0x10936e(0x166)]({'file':_0x405a37,'gzip':!![],'cwd':_0x29955e[_0x10936e(0x15c)],'portable':!![]},_0x240501);const _0x55ae54=await _0x1d20d5[_0x10936e(0x161)](_0x29955e[_0x10936e(0x157)],_0x29955e['revision'],_0x405a37);return updateWorkflowTdxConfig(_0x29955e['configResult'][_0x10936e(0x145)],{'workflow_project_id':_0x55ae54['id'],'last_pushed_revision':_0x55ae54['revision'],'last_pushed_at':new Date()[_0x10936e(0x135)]()}),{'projectId':_0x55ae54['id'],'projectName':_0x55ae54[_0x10936e(0x16d)],'revision':_0x55ae54['revision']};}finally{await a194_0x205233['rm'](_0x332ba4,{'recursive':!![],'force':!![]});}}function a194_0x43e9(_0x53180f,_0x3b14c4){_0x53180f=_0x53180f-0x135;const _0x383644=a194_0x3836();let _0x43e9ef=_0x383644[_0x53180f];return _0x43e9ef;}async function getProjectFiles(_0x5754c2,_0x143faa=_0x5754c2,_0x2fd9ee='',_0x30bf5f=null){const _0x14cbd6=a194_0x43e9,_0x41f68c=[];if(_0x30bf5f===null){_0x30bf5f=createIgnoreInstance();const _0x4ecf12=await loadDigdagignore(_0x5754c2);_0x4ecf12&&_0x30bf5f[_0x14cbd6(0x146)](_0x4ecf12);}if(_0x2fd9ee!==''){const _0xd79cf4=await loadDigdagignore(_0x143faa);_0xd79cf4&&addScopedPatterns(_0x30bf5f,_0xd79cf4,_0x2fd9ee);}const _0x47a06c=await a194_0x205233['readdir'](_0x143faa,{'withFileTypes':!![]});for(const _0x1a386c of _0x47a06c){const _0xc46578=_0x2fd9ee?a194_0x11734f[_0x14cbd6(0x16b)]['join'](_0x2fd9ee,_0x1a386c[_0x14cbd6(0x16d)]):_0x1a386c[_0x14cbd6(0x16d)];if(_0x1a386c[_0x14cbd6(0x16d)]===_0x14cbd6(0x16e))continue;if(_0x1a386c['name']===_0x14cbd6(0x159))continue;if(!shouldIncludeInArchive(_0x1a386c[_0x14cbd6(0x16d)]))continue;if(shouldIgnoreWithInstance(_0x30bf5f,_0xc46578,_0x1a386c['isDirectory']()))continue;if(_0x1a386c[_0x14cbd6(0x160)]()){const _0x490235=await getProjectFiles(_0x5754c2,a194_0x11734f['join'](_0x143faa,_0x1a386c[_0x14cbd6(0x16d)]),_0xc46578,_0x30bf5f);_0x41f68c[_0x14cbd6(0x14b)](..._0x490235);}else _0x41f68c['push'](_0xc46578);}return _0x41f68c;}async function calculatePushChanges(_0x1298a1,_0x234f8b,_0x153cae){const _0x1de5c7=a194_0x43e9,_0x14584d=[],_0x1fa593=new Set(await getProjectFiles(_0x234f8b));for(const _0x3836a0 of _0x153cae){const _0x5c88cb=a194_0x11734f['join'](_0x1298a1,_0x3836a0),_0x5c911f=a194_0x11734f[_0x1de5c7(0x13d)](_0x234f8b,_0x3836a0),_0x549fff=await a194_0x205233[_0x1de5c7(0x172)](_0x5c88cb,_0x1de5c7(0x136))[_0x1de5c7(0x171)](()=>null);if(_0x549fff===null)continue;if(!_0x1fa593['has'](_0x3836a0))_0x14584d[_0x1de5c7(0x14b)]({'path':_0x3836a0,'type':_0x1de5c7(0x16a),'newContent':_0x549fff});else{const _0x5ce8ab=await a194_0x205233[_0x1de5c7(0x172)](_0x5c911f,_0x1de5c7(0x136))['catch'](()=>null);if(_0x5ce8ab===null)_0x14584d[_0x1de5c7(0x14b)]({'path':_0x3836a0,'type':'modified','newContent':_0x549fff});else{if(_0x5ce8ab!==_0x549fff){const _0x4c4291=generateDiff(_0x5ce8ab,_0x549fff),_0x2c114d=hasChanges(_0x4c4291)?formatDiffWithColors(_0x4c4291):undefined;_0x14584d[_0x1de5c7(0x14b)]({'path':_0x3836a0,'type':_0x1de5c7(0x149),'oldContent':_0x5ce8ab,'newContent':_0x549fff,'diff':_0x2c114d});}else _0x14584d[_0x1de5c7(0x14b)]({'path':_0x3836a0,'type':_0x1de5c7(0x15b)});}}}for(const _0x1dc5c5 of _0x1fa593){if(!_0x153cae['includes'](_0x1dc5c5)){const _0x18e681=a194_0x11734f['join'](_0x234f8b,_0x1dc5c5),_0x2b2c09=await a194_0x205233[_0x1de5c7(0x172)](_0x18e681,_0x1de5c7(0x136))['catch'](()=>undefined);_0x14584d[_0x1de5c7(0x14b)]({'path':_0x1dc5c5,'type':_0x1de5c7(0x158),'oldContent':_0x2b2c09});}}return _0x14584d[_0x1de5c7(0x153)]((_0x5124b5,_0x789bbe)=>_0x5124b5[_0x1de5c7(0x169)][_0x1de5c7(0x14d)](_0x789bbe[_0x1de5c7(0x169)])),_0x14584d;}function a194_0x3836(){const _0x18c801=['mkdtemp','path','new','posix','filter','name','tdx.json','message','5553630uCPSEi','catch','readFile','toISOString','utf-8','cwd','tmpdir','Use\x20\x27tdx\x20wf\x20upload\x27\x20to\x20force\x20push\x20without\x20comparison.','392128uygaes','No\x20','1403175Dmclsr','join','TAR_BAD_ARCHIVE','918744aNrpSc','tdx-wf-push-archive-','length','workflow_project','skipValidation','stat','configPath','add','readdir','25269wOKlUd','modified','extracted','push','size','localeCompare','tar','revision','type','endsWith','includes','sort','\x20bytes)','390nJzAiJ','172BtJanE','projectName','deleted','.digdagignore','replace','unchanged','sourceDir','8MqciQY','downloadProjectArchive','\x20(archive\x20size:\x20','isDirectory','uploadProjectArchive','90167cYaeRF','zlib','8396469EGNoCo','extract','create','\x20workflow\x20files\x20found\x20in\x20'];a194_0x3836=function(){return _0x18c801;};return a194_0x3836();}
1
+ function a194_0x4d6c(){const _0x3bfca5=['uploadProjectArchive','filter','configPath','includes','sort','.digdagignore','join','isDirectory','toISOString','tar','2027304ekttvk','mkdir','readdir','unchanged','sourceDir','729812ZtvNpm','skipValidation','modified','extract','tmpdir','mkdtemp','replace','length','8VnRtDS','name','localeCompare','new','\x20workflow\x20files\x20found\x20in\x20','has','No\x20','archive.tar.gz','endsWith','21808BvhEeb','push','\x20(archive\x20size:\x20','4935228fyHsBk','tdx-wf-push-archive-','readFile','message','type','workflow_project','33HolWbA','utf-8','deleted','Use\x20\x27tdx\x20wf\x20upload\x27\x20to\x20force\x20push\x20without\x20comparison.','add','configResult','revision','\x20bytes)','4429453biZjMg','size','tdx-wf-push-','13403090DCOrpm','path','catch','cwd','TAR_BAD_ARCHIVE','1475355FiOkxl','9eZolXG','downloadProjectArchive'];a194_0x4d6c=function(){return _0x3bfca5;};return a194_0x4d6c();}(function(_0x5bd6d4,_0x576e12){const _0xdbb766=a194_0x5c93,_0x948d59=_0x5bd6d4();while(!![]){try{const _0x18d0c1=-parseInt(_0xdbb766(0x133))/0x1+-parseInt(_0xdbb766(0x12e))/0x2+-parseInt(_0xdbb766(0x111))/0x3*(parseInt(_0xdbb766(0x108))/0x4)+-parseInt(_0xdbb766(0x121))/0x5+parseInt(_0xdbb766(0x10b))/0x6+-parseInt(_0xdbb766(0x119))/0x7*(-parseInt(_0xdbb766(0x13b))/0x8)+parseInt(_0xdbb766(0x122))/0x9*(parseInt(_0xdbb766(0x11c))/0xa);if(_0x18d0c1===_0x576e12)break;else _0x948d59['push'](_0x948d59['shift']());}catch(_0x5e9874){_0x948d59['push'](_0x948d59['shift']());}}}(a194_0x4d6c,0xaa31f));import{promises as a194_0x3af058}from'fs';import a194_0x136e47 from'path';import a194_0xf5ecd1 from'os';function a194_0x5c93(_0x199dcf,_0x30de91){_0x199dcf=_0x199dcf-0x107;const _0x4d6cea=a194_0x4d6c();let _0x5c9331=_0x4d6cea[_0x199dcf];return _0x5c9331;}import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{findWorkflowTdxConfig,updateWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION,loadDigdagignore,createIgnoreInstance,addScopedPatterns,shouldIgnoreWithInstance}from'./workflow-utils.js';import{SDKError,ErrorCode}from'../errors.js';export async function preparePushWorkflow(_0x39bee7,_0x3719f9={}){const _0x367f9e=a194_0x5c93,_0x53f4fe=await import(_0x367f9e(0x12d)),{client:_0x27c3db,resolveProjectId:_0xcb43c5}=_0x39bee7,_0x3957c9=_0x3719f9[_0x367f9e(0x132)]||process[_0x367f9e(0x11f)](),_0x4aebb1=findWorkflowTdxConfig(_0x3957c9),{config:_0x4a3daa,configDir:_0x1eb9f6}=_0x4aebb1;let _0x3f5be2,_0x50639a=_0x4a3daa[_0x367f9e(0x110)];try{const _0x38c991=await _0xcb43c5(_0x4a3daa[_0x367f9e(0x110)]);_0x3f5be2=_0x38c991['id'],_0x50639a=_0x38c991['name'];}catch{_0x3f5be2='';}const _0x30bd6b=_0x3719f9[_0x367f9e(0x117)]||new Date()['toISOString']()[_0x367f9e(0x139)](/[:.]/g,'-');if(!_0x3719f9[_0x367f9e(0x134)]){const _0x27b570=await a194_0x3af058[_0x367f9e(0x130)](_0x1eb9f6),_0x4777d6=_0x27b570[_0x367f9e(0x125)](_0x4ccdde=>_0x4ccdde[_0x367f9e(0x107)](WORKFLOW_FILE_EXTENSION));if(_0x4777d6[_0x367f9e(0x13a)]===0x0)throw new Error(_0x367f9e(0x141)+WORKFLOW_FILE_EXTENSION+_0x367f9e(0x13f)+_0x1eb9f6);}const _0x4dfc13=await getProjectFiles(_0x1eb9f6);let _0x5b1004;if(_0x3f5be2){const _0x2b1486=await a194_0x3af058[_0x367f9e(0x138)](a194_0x136e47[_0x367f9e(0x12a)](a194_0xf5ecd1[_0x367f9e(0x137)](),_0x367f9e(0x11b))),_0x23c193=a194_0x136e47[_0x367f9e(0x12a)](_0x2b1486,_0x367f9e(0x142)),_0x4be39d=a194_0x136e47[_0x367f9e(0x12a)](_0x2b1486,'extracted');try{await _0x27c3db[_0x367f9e(0x123)](_0x3f5be2,_0x23c193),await a194_0x3af058[_0x367f9e(0x12f)](_0x4be39d,{'recursive':!![]});try{await _0x53f4fe[_0x367f9e(0x136)]({'file':_0x23c193,'cwd':_0x4be39d,'gzip':!![]});}catch(_0x2571a8){const _0x5ea4e4=_0x2571a8 instanceof Error?_0x2571a8[_0x367f9e(0x10e)]:String(_0x2571a8);if(_0x5ea4e4[_0x367f9e(0x127)](_0x367f9e(0x120))||_0x5ea4e4[_0x367f9e(0x127)]('zlib')){const _0x56458f=await a194_0x3af058['stat'](_0x23c193)[_0x367f9e(0x11e)](()=>null),_0x4f426a=_0x56458f?_0x367f9e(0x10a)+_0x56458f[_0x367f9e(0x11a)]+_0x367f9e(0x118):'';throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],'Failed\x20to\x20extract\x20remote\x20project\x20archive\x20for\x20comparison'+_0x4f426a+':\x20'+_0x5ea4e4,_0x2571a8,{'helpText':_0x367f9e(0x114)});}throw _0x2571a8;}_0x5b1004=await calculatePushChanges(_0x1eb9f6,_0x4be39d,_0x4dfc13);}finally{await a194_0x3af058['rm'](_0x2b1486,{'recursive':!![],'force':!![]});}}else{_0x5b1004=[];for(const _0x4fbd6c of _0x4dfc13){const _0x463aa1=a194_0x136e47['join'](_0x1eb9f6,_0x4fbd6c),_0x5b3a15=await a194_0x3af058[_0x367f9e(0x10d)](_0x463aa1,_0x367f9e(0x112))[_0x367f9e(0x11e)](()=>null);_0x5b1004['push']({'path':_0x4fbd6c,'type':_0x367f9e(0x13e),'newContent':_0x5b3a15||undefined});}}const _0x7d0952={'new':_0x5b1004[_0x367f9e(0x125)](_0x10466c=>_0x10466c[_0x367f9e(0x10f)]===_0x367f9e(0x13e))[_0x367f9e(0x13a)],'modified':_0x5b1004[_0x367f9e(0x125)](_0x5b2abe=>_0x5b2abe[_0x367f9e(0x10f)]===_0x367f9e(0x135))[_0x367f9e(0x13a)],'deleted':_0x5b1004[_0x367f9e(0x125)](_0x1fd439=>_0x1fd439[_0x367f9e(0x10f)]==='deleted')[_0x367f9e(0x13a)],'unchanged':_0x5b1004[_0x367f9e(0x125)](_0x2bd73e=>_0x2bd73e[_0x367f9e(0x10f)]===_0x367f9e(0x131))[_0x367f9e(0x13a)]};return{'projectName':_0x50639a,'projectId':_0x3f5be2,'revision':_0x30bd6b,'sourceDir':_0x1eb9f6,'changes':_0x5b1004,'summary':_0x7d0952,'hasChanges':_0x7d0952[_0x367f9e(0x13e)]>0x0||_0x7d0952[_0x367f9e(0x135)]>0x0||_0x7d0952[_0x367f9e(0x113)]>0x0,'configResult':_0x4aebb1};}export async function executePushWorkflow(_0x183018,_0x477b08){const _0x393f25=a194_0x5c93,_0x5cbf18=await import(_0x393f25(0x12d)),{client:_0x43058e}=_0x183018,_0x4605d6=await getProjectFiles(_0x477b08[_0x393f25(0x132)]),_0x5f685d=await a194_0x3af058[_0x393f25(0x138)](a194_0x136e47[_0x393f25(0x12a)](a194_0xf5ecd1[_0x393f25(0x137)](),_0x393f25(0x10c))),_0x5b849=a194_0x136e47['join'](_0x5f685d,'archive.tar.gz');try{await _0x5cbf18['create']({'file':_0x5b849,'gzip':!![],'cwd':_0x477b08[_0x393f25(0x132)],'portable':!![]},_0x4605d6);const _0x25f6d7=await _0x43058e[_0x393f25(0x124)](_0x477b08['projectName'],_0x477b08['revision'],_0x5b849);return updateWorkflowTdxConfig(_0x477b08[_0x393f25(0x116)][_0x393f25(0x126)],{'workflow_project_id':_0x25f6d7['id'],'last_pushed_revision':_0x25f6d7[_0x393f25(0x117)],'last_pushed_at':new Date()[_0x393f25(0x12c)]()}),{'projectId':_0x25f6d7['id'],'projectName':_0x25f6d7['name'],'revision':_0x25f6d7[_0x393f25(0x117)]};}finally{await a194_0x3af058['rm'](_0x5f685d,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x27ec11,_0x20eedf=_0x27ec11,_0x796f91='',_0x4bf7b6=null){const _0x31358e=a194_0x5c93,_0x3ea70f=[];if(_0x4bf7b6===null){_0x4bf7b6=createIgnoreInstance();const _0x18daa4=await loadDigdagignore(_0x27ec11);_0x18daa4&&_0x4bf7b6[_0x31358e(0x115)](_0x18daa4);}if(_0x796f91!==''){const _0x3e3efc=await loadDigdagignore(_0x20eedf);_0x3e3efc&&addScopedPatterns(_0x4bf7b6,_0x3e3efc,_0x796f91);}const _0x173c5d=await a194_0x3af058['readdir'](_0x20eedf,{'withFileTypes':!![]});for(const _0x43f88e of _0x173c5d){const _0x48c358=_0x796f91?a194_0x136e47['posix']['join'](_0x796f91,_0x43f88e[_0x31358e(0x13c)]):_0x43f88e[_0x31358e(0x13c)];if(_0x43f88e['name']==='tdx.json')continue;if(_0x43f88e['name']===_0x31358e(0x129))continue;if(!shouldIncludeInArchive(_0x43f88e[_0x31358e(0x13c)]))continue;if(shouldIgnoreWithInstance(_0x4bf7b6,_0x48c358,_0x43f88e[_0x31358e(0x12b)]()))continue;if(_0x43f88e[_0x31358e(0x12b)]()){const _0x1254e1=await getProjectFiles(_0x27ec11,a194_0x136e47['join'](_0x20eedf,_0x43f88e[_0x31358e(0x13c)]),_0x48c358,_0x4bf7b6);_0x3ea70f['push'](..._0x1254e1);}else _0x3ea70f[_0x31358e(0x109)](_0x48c358);}return _0x3ea70f;}async function calculatePushChanges(_0x15a333,_0xb8bc5e,_0x225a6a){const _0x188dfd=a194_0x5c93,_0x1c15a9=[],_0x5a8fb4=new Set(await getProjectFiles(_0xb8bc5e));for(const _0x4152dd of _0x225a6a){const _0x5d7be7=a194_0x136e47[_0x188dfd(0x12a)](_0x15a333,_0x4152dd),_0x2b00fc=a194_0x136e47[_0x188dfd(0x12a)](_0xb8bc5e,_0x4152dd),_0x5a92ae=await a194_0x3af058[_0x188dfd(0x10d)](_0x5d7be7,_0x188dfd(0x112))[_0x188dfd(0x11e)](()=>null);if(_0x5a92ae===null)continue;if(!_0x5a8fb4[_0x188dfd(0x140)](_0x4152dd))_0x1c15a9[_0x188dfd(0x109)]({'path':_0x4152dd,'type':_0x188dfd(0x13e),'newContent':_0x5a92ae});else{const _0x1ce063=await a194_0x3af058[_0x188dfd(0x10d)](_0x2b00fc,_0x188dfd(0x112))[_0x188dfd(0x11e)](()=>null);if(_0x1ce063===null)_0x1c15a9['push']({'path':_0x4152dd,'type':_0x188dfd(0x135),'newContent':_0x5a92ae});else{if(_0x1ce063!==_0x5a92ae){const _0x3442da=generateDiff(_0x1ce063,_0x5a92ae),_0x2967ea=hasChanges(_0x3442da)?formatDiffWithColors(_0x3442da):undefined;_0x1c15a9[_0x188dfd(0x109)]({'path':_0x4152dd,'type':_0x188dfd(0x135),'oldContent':_0x1ce063,'newContent':_0x5a92ae,'diff':_0x2967ea});}else _0x1c15a9[_0x188dfd(0x109)]({'path':_0x4152dd,'type':_0x188dfd(0x131)});}}}for(const _0x5df151 of _0x5a8fb4){if(!_0x225a6a['includes'](_0x5df151)){const _0x58cb93=a194_0x136e47['join'](_0xb8bc5e,_0x5df151),_0x2da1c7=await a194_0x3af058['readFile'](_0x58cb93,_0x188dfd(0x112))[_0x188dfd(0x11e)](()=>undefined);_0x1c15a9['push']({'path':_0x5df151,'type':_0x188dfd(0x113),'oldContent':_0x2da1c7});}}return _0x1c15a9[_0x188dfd(0x128)]((_0x3acd3e,_0x329c0f)=>_0x3acd3e[_0x188dfd(0x11d)][_0x188dfd(0x13d)](_0x329c0f['path'])),_0x1c15a9;}
@@ -1 +1 @@
1
- const a195_0x2ac60b=a195_0x1089;(function(_0x2f764b,_0x36216b){const _0x160cbf=a195_0x1089,_0x2f79e2=_0x2f764b();while(!![]){try{const _0x597452=parseInt(_0x160cbf(0x14a))/0x1+parseInt(_0x160cbf(0x152))/0x2+-parseInt(_0x160cbf(0x165))/0x3+-parseInt(_0x160cbf(0x148))/0x4*(-parseInt(_0x160cbf(0x161))/0x5)+parseInt(_0x160cbf(0x15e))/0x6+-parseInt(_0x160cbf(0x162))/0x7*(-parseInt(_0x160cbf(0x15c))/0x8)+-parseInt(_0x160cbf(0x14f))/0x9;if(_0x597452===_0x36216b)break;else _0x2f79e2['push'](_0x2f79e2['shift']());}catch(_0x4d9079){_0x2f79e2['push'](_0x2f79e2['shift']());}}}(a195_0x2fd1,0x9f13c));function a195_0x1089(_0x303fa9,_0x2b2cbb){_0x303fa9=_0x303fa9-0x148;const _0x2fd12f=a195_0x2fd1();let _0x108906=_0x2fd12f[_0x303fa9];return _0x108906;}function a195_0x2fd1(){const _0x5c3a9c=['last_pushed_at','toISOString','last_pushed_revision','stringify','20752434rfxZmx','root','dirname','1204910HRtcmL','utf-8','string','resolve','Invalid\x20tdx.json:\x20expected\x20object','join','workflow_project','workflows','Invalid\x20JSON\x20in\x20','object','14480URltiK','last_pulled_at','5974416rbbDAz','parse','last_pulled_revision','60635DueRZn','3479uMKyao','cwd','workflow_project_id','1108161jHUYWQ','44HEHFCf','No\x20workflow\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','695635elGuDx'];a195_0x2fd1=function(){return _0x5c3a9c;};return a195_0x2fd1();}import{existsSync,readFileSync,writeFileSync}from'fs';import a195_0x4f32b1 from'path';const TDX_CONFIG_FILE='tdx.json',WORKFLOWS_DIR=a195_0x2ac60b(0x159);export function findWorkflowTdxConfigPath(_0x44f0fc=process[a195_0x2ac60b(0x163)]()){const _0xe2f90a=a195_0x2ac60b;let _0x557aa7=a195_0x4f32b1[_0xe2f90a(0x155)](_0x44f0fc);const _0x17015e=a195_0x4f32b1[_0xe2f90a(0x15f)](_0x557aa7)[_0xe2f90a(0x150)];while(_0x557aa7!==_0x17015e){const _0xc7c458=a195_0x4f32b1[_0xe2f90a(0x157)](_0x557aa7,TDX_CONFIG_FILE);if(existsSync(_0xc7c458))try{const _0x45eb5f=readFileSync(_0xc7c458,_0xe2f90a(0x153)),_0x18d62b=JSON['parse'](_0x45eb5f);if(_0x18d62b&&typeof _0x18d62b==='object'&&'workflow_project'in _0x18d62b)return _0xc7c458;}catch{}_0x557aa7=a195_0x4f32b1['dirname'](_0x557aa7);}return null;}export function loadWorkflowTdxConfig(_0x3d1c3f){const _0x83ac18=a195_0x2ac60b,_0xbfdd73=readFileSync(_0x3d1c3f,_0x83ac18(0x153));let _0x57f21a;try{_0x57f21a=JSON[_0x83ac18(0x15f)](_0xbfdd73);}catch{throw new Error(_0x83ac18(0x15a)+_0x3d1c3f);}if(!_0x57f21a||typeof _0x57f21a!==_0x83ac18(0x15b))throw new Error(_0x83ac18(0x156));const _0x3109b9=_0x57f21a;if(!_0x3109b9[_0x83ac18(0x158)]||typeof _0x3109b9[_0x83ac18(0x158)]!==_0x83ac18(0x154))throw new Error('Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27workflow_project\x27\x20field');return{'workflow_project':_0x3109b9[_0x83ac18(0x158)],'workflow_project_id':typeof _0x3109b9[_0x83ac18(0x164)]===_0x83ac18(0x154)?_0x3109b9['workflow_project_id']:undefined,'last_pulled_revision':typeof _0x3109b9[_0x83ac18(0x160)]==='string'?_0x3109b9[_0x83ac18(0x160)]:undefined,'last_pulled_at':typeof _0x3109b9[_0x83ac18(0x15d)]==='string'?_0x3109b9['last_pulled_at']:undefined,'last_pushed_revision':typeof _0x3109b9[_0x83ac18(0x14d)]==='string'?_0x3109b9['last_pushed_revision']:undefined,'last_pushed_at':typeof _0x3109b9[_0x83ac18(0x14b)]==='string'?_0x3109b9[_0x83ac18(0x14b)]:undefined};}export function findWorkflowTdxConfig(_0x6280da=process[a195_0x2ac60b(0x163)]()){const _0x21f2cb=a195_0x2ac60b,_0x396010=findWorkflowTdxConfigPath(_0x6280da);if(!_0x396010)throw new Error(_0x21f2cb(0x149));const _0x4727a5=loadWorkflowTdxConfig(_0x396010),_0x11b4bd=a195_0x4f32b1[_0x21f2cb(0x151)](_0x396010);return{'config':_0x4727a5,'configPath':_0x396010,'configDir':_0x11b4bd};}export function tryFindWorkflowTdxConfig(_0x5d0f36){try{return findWorkflowTdxConfig(_0x5d0f36);}catch{return null;}}export function getWorkflowProjectDir(_0x200fac,_0x250180=process['cwd']()){const _0x29cdb5=a195_0x2ac60b;return a195_0x4f32b1[_0x29cdb5(0x157)](_0x250180,WORKFLOWS_DIR,_0x200fac);}export function getWorkflowTdxConfigPath(_0xde8103,_0x7bafb9=process[a195_0x2ac60b(0x163)]()){const _0x3174b4=a195_0x2ac60b;return a195_0x4f32b1[_0x3174b4(0x157)](getWorkflowProjectDir(_0xde8103,_0x7bafb9),TDX_CONFIG_FILE);}export function createWorkflowTdxConfigContent(_0x5da2d5,_0x492a61,_0x24b7c4){const _0x41f07d=a195_0x2ac60b,_0x412a42={'workflow_project':_0x5da2d5,..._0x492a61&&{'workflow_project_id':_0x492a61},..._0x24b7c4&&{'last_pulled_revision':_0x24b7c4},'last_pulled_at':new Date()[_0x41f07d(0x14c)]()};return JSON[_0x41f07d(0x14e)](_0x412a42,null,0x2)+'\x0a';}export function saveWorkflowTdxConfig(_0x4b4f54,_0x55f59d){const _0x4523cc=a195_0x2ac60b,_0x366198=JSON[_0x4523cc(0x14e)](_0x55f59d,null,0x2)+'\x0a';writeFileSync(_0x4b4f54,_0x366198,_0x4523cc(0x153));}export function updateWorkflowTdxConfig(_0x40d13c,_0xbe1b71){const _0x85936c=loadWorkflowTdxConfig(_0x40d13c),_0x529e19={..._0x85936c,..._0xbe1b71};saveWorkflowTdxConfig(_0x40d13c,_0x529e19);}
1
+ const a195_0x54abd9=a195_0x18c4;(function(_0x3331f8,_0x5889ba){const _0x13aa56=a195_0x18c4,_0x13ad34=_0x3331f8();while(!![]){try{const _0x5cd570=-parseInt(_0x13aa56(0xc9))/0x1+parseInt(_0x13aa56(0xd2))/0x2+parseInt(_0x13aa56(0xcf))/0x3+-parseInt(_0x13aa56(0xc8))/0x4*(parseInt(_0x13aa56(0xd5))/0x5)+parseInt(_0x13aa56(0xc6))/0x6+parseInt(_0x13aa56(0xc2))/0x7*(-parseInt(_0x13aa56(0xca))/0x8)+-parseInt(_0x13aa56(0xd3))/0x9*(-parseInt(_0x13aa56(0xcb))/0xa);if(_0x5cd570===_0x5889ba)break;else _0x13ad34['push'](_0x13ad34['shift']());}catch(_0x41f01d){_0x13ad34['push'](_0x13ad34['shift']());}}}(a195_0x2008,0x25700));import{existsSync,readFileSync,writeFileSync}from'fs';import a195_0x4cba21 from'path';const TDX_CONFIG_FILE='tdx.json',WORKFLOWS_DIR=a195_0x54abd9(0xc7);export function findWorkflowTdxConfigPath(_0x2b5c14=process['cwd']()){const _0x3b4bda=a195_0x54abd9;let _0x2fddca=a195_0x4cba21[_0x3b4bda(0xbe)](_0x2b5c14);const _0x334a76=a195_0x4cba21[_0x3b4bda(0xbc)](_0x2fddca)[_0x3b4bda(0xd1)];while(_0x2fddca!==_0x334a76){const _0x132725=a195_0x4cba21['join'](_0x2fddca,TDX_CONFIG_FILE);if(existsSync(_0x132725))try{const _0x2121e0=readFileSync(_0x132725,_0x3b4bda(0xbf)),_0x35ebce=JSON[_0x3b4bda(0xbc)](_0x2121e0);if(_0x35ebce&&typeof _0x35ebce==='object'&&_0x3b4bda(0xd4)in _0x35ebce)return _0x132725;}catch{}_0x2fddca=a195_0x4cba21[_0x3b4bda(0xc3)](_0x2fddca);}return null;}export function loadWorkflowTdxConfig(_0x59e0c7){const _0x2d42ec=a195_0x54abd9,_0xe9349f=readFileSync(_0x59e0c7,_0x2d42ec(0xbf));let _0x520dd2;try{_0x520dd2=JSON[_0x2d42ec(0xbc)](_0xe9349f);}catch{throw new Error(_0x2d42ec(0xcd)+_0x59e0c7);}if(!_0x520dd2||typeof _0x520dd2!==_0x2d42ec(0xd7))throw new Error('Invalid\x20tdx.json:\x20expected\x20object');const _0x3f6f8f=_0x520dd2;if(!_0x3f6f8f['workflow_project']||typeof _0x3f6f8f['workflow_project']!==_0x2d42ec(0xcc))throw new Error('Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27workflow_project\x27\x20field');return{'workflow_project':_0x3f6f8f[_0x2d42ec(0xd4)],'workflow_project_id':typeof _0x3f6f8f[_0x2d42ec(0xbd)]===_0x2d42ec(0xcc)?_0x3f6f8f['workflow_project_id']:undefined,'last_pulled_revision':typeof _0x3f6f8f[_0x2d42ec(0xc1)]===_0x2d42ec(0xcc)?_0x3f6f8f[_0x2d42ec(0xc1)]:undefined,'last_pulled_at':typeof _0x3f6f8f[_0x2d42ec(0xd6)]===_0x2d42ec(0xcc)?_0x3f6f8f[_0x2d42ec(0xd6)]:undefined,'last_pushed_revision':typeof _0x3f6f8f[_0x2d42ec(0xce)]===_0x2d42ec(0xcc)?_0x3f6f8f['last_pushed_revision']:undefined,'last_pushed_at':typeof _0x3f6f8f[_0x2d42ec(0xd8)]==='string'?_0x3f6f8f[_0x2d42ec(0xd8)]:undefined};}export function findWorkflowTdxConfig(_0x4bddae=process['cwd']()){const _0x1bb090=a195_0x54abd9,_0x2a5797=findWorkflowTdxConfigPath(_0x4bddae);if(!_0x2a5797)throw new Error(_0x1bb090(0xc0));const _0x54c24e=loadWorkflowTdxConfig(_0x2a5797),_0x10a726=a195_0x4cba21['dirname'](_0x2a5797);return{'config':_0x54c24e,'configPath':_0x2a5797,'configDir':_0x10a726};}export function tryFindWorkflowTdxConfig(_0x205f43){try{return findWorkflowTdxConfig(_0x205f43);}catch{return null;}}export function getWorkflowProjectDir(_0x3a7231,_0x1ea8fe=process[a195_0x54abd9(0xc4)]()){const _0x35f09a=a195_0x54abd9;return a195_0x4cba21[_0x35f09a(0xd0)](_0x1ea8fe,WORKFLOWS_DIR,_0x3a7231);}export function getWorkflowTdxConfigPath(_0x2c1595,_0x23417a=process['cwd']()){const _0x5c1a4f=a195_0x54abd9;return a195_0x4cba21[_0x5c1a4f(0xd0)](getWorkflowProjectDir(_0x2c1595,_0x23417a),TDX_CONFIG_FILE);}export function createWorkflowTdxConfigContent(_0x4da000,_0x5306c8,_0x4480e2){const _0x3d7aa1=a195_0x54abd9,_0x5e0a3e={'workflow_project':_0x4da000,..._0x5306c8&&{'workflow_project_id':_0x5306c8},..._0x4480e2&&{'last_pulled_revision':_0x4480e2},'last_pulled_at':new Date()['toISOString']()};return JSON[_0x3d7aa1(0xc5)](_0x5e0a3e,null,0x2)+'\x0a';}function a195_0x2008(){const _0xcb366=['root','48994ugSApm','3879GuIrpW','workflow_project','2605PsYEZi','last_pulled_at','object','last_pushed_at','parse','workflow_project_id','resolve','utf-8','No\x20workflow\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','last_pulled_revision','518HzdeDN','dirname','cwd','stringify','1404132ZJxGzH','workflows','968DGMPVx','24035QalbZI','27560TxZANl','1990HiILef','string','Invalid\x20JSON\x20in\x20','last_pushed_revision','642309dqxDIB','join'];a195_0x2008=function(){return _0xcb366;};return a195_0x2008();}export function saveWorkflowTdxConfig(_0x40abfd,_0x137a53){const _0x4c511d=a195_0x54abd9,_0x44336c=JSON[_0x4c511d(0xc5)](_0x137a53,null,0x2)+'\x0a';writeFileSync(_0x40abfd,_0x44336c,_0x4c511d(0xbf));}function a195_0x18c4(_0x552b91,_0x1a7f92){_0x552b91=_0x552b91-0xbc;const _0x20081b=a195_0x2008();let _0x18c4d9=_0x20081b[_0x552b91];return _0x18c4d9;}export function updateWorkflowTdxConfig(_0x2d63cc,_0x47c69a){const _0x11c027=loadWorkflowTdxConfig(_0x2d63cc),_0xa488d0={..._0x11c027,..._0x47c69a};saveWorkflowTdxConfig(_0x2d63cc,_0xa488d0);}
@@ -1 +1 @@
1
- (function(_0x227748,_0x13772e){const _0x5481eb=a196_0x7dca,_0x13ec9a=_0x227748();while(!![]){try{const _0x4626b3=-parseInt(_0x5481eb(0x198))/0x1*(parseInt(_0x5481eb(0x18c))/0x2)+-parseInt(_0x5481eb(0x18e))/0x3*(parseInt(_0x5481eb(0x193))/0x4)+parseInt(_0x5481eb(0x195))/0x5+parseInt(_0x5481eb(0x19b))/0x6*(parseInt(_0x5481eb(0x192))/0x7)+parseInt(_0x5481eb(0x18f))/0x8+parseInt(_0x5481eb(0x196))/0x9*(parseInt(_0x5481eb(0x189))/0xa)+parseInt(_0x5481eb(0x197))/0xb;if(_0x4626b3===_0x13772e)break;else _0x13ec9a['push'](_0x13ec9a['shift']());}catch(_0x4a1290){_0x13ec9a['push'](_0x13ec9a['shift']());}}}(a196_0x4e5a,0x456d5));import{promises as a196_0x3b4700}from'fs';function a196_0x4e5a(){const _0x418986=['slice','7vUXyza','2065156zTsSXI','add','1270740vJhcwn','63tTmOdY','187099ebIaUc','481373fCajSm','filter','ignores','2332338MdyJma','length','Thumbs.db','.DS_Store','join','replace','endsWith','436610DUqQRW','startsWith','utf-8','2GmTcdZ','code','3RXhcCu','2532224vsPjuT','.digdagignore'];a196_0x4e5a=function(){return _0x418986;};return a196_0x4e5a();}import a196_0x253a21 from'path';import a196_0x58b1e5 from'ignore';export const WORKFLOW_FILE_EXTENSION='.dig';export function shouldIncludeInArchive(_0x3c758f){const _0x4cdfb1=a196_0x7dca;if(_0x3c758f==='.digdag')return!![];if(_0x3c758f[_0x4cdfb1(0x18a)]('.'))return![];if(_0x3c758f[_0x4cdfb1(0x188)]('~'))return![];if(_0x3c758f===_0x4cdfb1(0x19d)||_0x3c758f===_0x4cdfb1(0x185))return![];return!![];}export function parseDigdagignore(_0x92fa68){const _0x4f72b5=a196_0x7dca;return _0x92fa68['split']('\x0a')['map'](_0x3fb481=>_0x3fb481['trim']())[_0x4f72b5(0x199)](_0xbe50bd=>_0xbe50bd[_0x4f72b5(0x19c)]>0x0&&!_0xbe50bd['startsWith']('#'));}export async function loadDigdagignore(_0x32b9d6){const _0x5d87bd=a196_0x7dca,_0x27fc26=a196_0x253a21[_0x5d87bd(0x186)](_0x32b9d6,_0x5d87bd(0x190));try{const _0x1f0b42=await a196_0x3b4700['readFile'](_0x27fc26,_0x5d87bd(0x18b));return parseDigdagignore(_0x1f0b42);}catch(_0xfc8aa6){if(_0xfc8aa6[_0x5d87bd(0x18d)]==='ENOENT')return null;throw _0xfc8aa6;}}export function createIgnoreInstance(_0x2f5fde){const _0x411e6c=a196_0x58b1e5();return _0x2f5fde&&_0x2f5fde['length']>0x0&&_0x411e6c['add'](_0x2f5fde),_0x411e6c;}function a196_0x7dca(_0x19ac87,_0x22793e){_0x19ac87=_0x19ac87-0x185;const _0x4e5aa4=a196_0x4e5a();let _0x7dca32=_0x4e5aa4[_0x19ac87];return _0x7dca32;}export function addScopedPatterns(_0x1fa625,_0x59fcd0,_0x27bc6e){const _0xa1c899=a196_0x7dca,_0x2b9086=_0x59fcd0['map'](_0x40021a=>{const _0x467b97=a196_0x7dca;if(_0x40021a[_0x467b97(0x18a)]('!')){const _0x1246e7=_0x40021a[_0x467b97(0x191)](0x1);if(_0x1246e7['startsWith']('/'))return'!'+_0x27bc6e+_0x1246e7;return'!'+_0x27bc6e+'/'+_0x1246e7;}if(_0x40021a[_0x467b97(0x18a)]('/'))return''+_0x27bc6e+_0x40021a;return _0x27bc6e+'/'+_0x40021a;});return _0x1fa625[_0xa1c899(0x194)](_0x2b9086),_0x1fa625;}export function shouldIgnoreWithInstance(_0x4ceeca,_0x270446,_0x3865fa){const _0x241048=a196_0x7dca,_0x389d8f=_0x270446[_0x241048(0x187)](/\\/g,'/'),_0xfc7e3d=_0x3865fa?_0x389d8f+'/':_0x389d8f;return _0x4ceeca[_0x241048(0x19a)](_0xfc7e3d);}
1
+ (function(_0x5b2286,_0x1caf9f){const _0x543bdc=a196_0x32fd,_0x10ce31=_0x5b2286();while(!![]){try{const _0x5efcc6=-parseInt(_0x543bdc(0x102))/0x1*(-parseInt(_0x543bdc(0x10e))/0x2)+-parseInt(_0x543bdc(0x103))/0x3+-parseInt(_0x543bdc(0xff))/0x4*(parseInt(_0x543bdc(0xfb))/0x5)+-parseInt(_0x543bdc(0x113))/0x6+parseInt(_0x543bdc(0x104))/0x7*(parseInt(_0x543bdc(0x111))/0x8)+parseInt(_0x543bdc(0x115))/0x9+parseInt(_0x543bdc(0xfd))/0xa;if(_0x5efcc6===_0x1caf9f)break;else _0x10ce31['push'](_0x10ce31['shift']());}catch(_0x554024){_0x10ce31['push'](_0x10ce31['shift']());}}}(a196_0x2f8d,0xf2446));import{promises as a196_0x56d417}from'fs';import a196_0x484540 from'path';function a196_0x32fd(_0x4c1645,_0x440f60){_0x4c1645=_0x4c1645-0xf9;const _0x2f8d0d=a196_0x2f8d();let _0x32fdde=_0x2f8d0d[_0x4c1645];return _0x32fdde;}function a196_0x2f8d(){const _0x28b489=['2598712JEzVOX','split','3181284gmkmPa','Thumbs.db','3166812CPfmSC','ENOENT','.digdag','6770KQeHSz','filter','10918800RNaKlM','endsWith','1900fgLzgZ','slice','ignores','3lDuqrh','1565544NNqOjb','7bVjqLl','utf-8','trim','startsWith','map','readFile','.digdagignore','code','add','join','612634miBpGw','.DS_Store','length'];a196_0x2f8d=function(){return _0x28b489;};return a196_0x2f8d();}import a196_0x5be8ee from'ignore';export const WORKFLOW_FILE_EXTENSION='.dig';export function shouldIncludeInArchive(_0x380bf6){const _0xc2b7bb=a196_0x32fd;if(_0x380bf6===_0xc2b7bb(0xfa))return!![];if(_0x380bf6[_0xc2b7bb(0x107)]('.'))return![];if(_0x380bf6[_0xc2b7bb(0xfe)]('~'))return![];if(_0x380bf6===_0xc2b7bb(0x114)||_0x380bf6===_0xc2b7bb(0x10f))return![];return!![];}export function parseDigdagignore(_0x42d188){const _0x16be9b=a196_0x32fd;return _0x42d188[_0x16be9b(0x112)]('\x0a')[_0x16be9b(0x108)](_0x45cc95=>_0x45cc95[_0x16be9b(0x106)]())[_0x16be9b(0xfc)](_0x5cde00=>_0x5cde00['length']>0x0&&!_0x5cde00[_0x16be9b(0x107)]('#'));}export async function loadDigdagignore(_0xd08d21){const _0x3e286a=a196_0x32fd,_0x9aa6fe=a196_0x484540[_0x3e286a(0x10d)](_0xd08d21,_0x3e286a(0x10a));try{const _0x1413fc=await a196_0x56d417[_0x3e286a(0x109)](_0x9aa6fe,_0x3e286a(0x105));return parseDigdagignore(_0x1413fc);}catch(_0x197892){if(_0x197892[_0x3e286a(0x10b)]===_0x3e286a(0xf9))return null;throw _0x197892;}}export function createIgnoreInstance(_0x30213e){const _0xdfe59e=a196_0x32fd,_0x8e1718=a196_0x5be8ee();return _0x30213e&&_0x30213e[_0xdfe59e(0x110)]>0x0&&_0x8e1718['add'](_0x30213e),_0x8e1718;}export function addScopedPatterns(_0x4f639c,_0x6b0e1c,_0x43b500){const _0x84f9f4=a196_0x32fd,_0x50d66d=_0x6b0e1c['map'](_0x39164e=>{const _0x58c3d9=a196_0x32fd;if(_0x39164e[_0x58c3d9(0x107)]('!')){const _0x2587aa=_0x39164e[_0x58c3d9(0x100)](0x1);if(_0x2587aa[_0x58c3d9(0x107)]('/'))return'!'+_0x43b500+_0x2587aa;return'!'+_0x43b500+'/'+_0x2587aa;}if(_0x39164e[_0x58c3d9(0x107)]('/'))return''+_0x43b500+_0x39164e;return _0x43b500+'/'+_0x39164e;});return _0x4f639c[_0x84f9f4(0x10c)](_0x50d66d),_0x4f639c;}export function shouldIgnoreWithInstance(_0x7da2dd,_0x8038d9,_0xc33aa7){const _0x1dc1bd=a196_0x32fd,_0x3717bd=_0x8038d9['replace'](/\\/g,'/'),_0x1e4af7=_0xc33aa7?_0x3717bd+'/':_0x3717bd;return _0x7da2dd[_0x1dc1bd(0x101)](_0x1e4af7);}
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: execute-items
3
+ description: Execute prioritized items — work through the backlog to advance workspace goals
4
+ ---
5
+
6
+ # Execute Items
7
+
8
+ Pick up triaged items in priority order and do the actual work to advance workspace goals. This task runs after item-triage has organized, linked, and prioritized items.
9
+
10
+ ## Steps
11
+
12
+ 1. **Get current date/time**: Call `current_time` to get the exact current date and time.
13
+
14
+ 2. **Read all goals**: Use `Glob` to find `goals/*.md`. Read each active goal (status != done/void) and its linked items via [[wiki-links]].
15
+
16
+ 3. **Build execution queue**: Collect all items with status in: todo, planning, in_progress. Order by:
17
+ - Priority (critical > high > medium > low)
18
+ - Goal urgency (goals with due dates approaching first)
19
+ - Status progression (items already in_progress before todo)
20
+ - Dependencies (items mentioned as prerequisites in other items' body text — do prerequisites first)
21
+
22
+ 4. **Check accepted guides**: Search `guides/` for relevant conventions before starting work. Follow all `status: accepted` guides.
23
+
24
+ 5. **Execute items in order**: For each item in the queue:
25
+ - Read the item's full content to understand what needs to be done
26
+ - Move status forward: todo → planning → in_progress → review → done as appropriate
27
+ - **Do the actual work**: code changes, file edits, data queries, research — whatever the item describes
28
+ - If the item is blocked or requires human input, add a note in the item body explaining what's needed and skip to the next
29
+ - If an item is too large to complete in one run, break it into sub-items:
30
+ - Create new item files in `items/`
31
+ - Add [[wiki-links]] from the parent item
32
+ - Mark the parent as `planning` and work on the sub-items
33
+ - After completing an item, capture any learnings as a note in `notes/`
34
+
35
+ 6. **Write output**: Create `results/{run_id}/output.md` with:
36
+ - Items completed (moved to done/review)
37
+ - Items progressed (status advanced)
38
+ - Items broken into sub-items
39
+ - Items blocked (with reasons)
40
+ - Items not reached (ran out of turns)
41
+ - Key learnings or decisions made
42
+
43
+ 7. **Post to Slack**: Post a concise execution summary:
44
+ ```
45
+ :rocket: Item Execution — {date}
46
+
47
+ Completed: {count}
48
+ Progressed: {count}
49
+ Blocked: {count}
50
+ Not reached: {count}
51
+
52
+ {one-line highlight of most impactful completion}
53
+ ```
54
+
55
+ ## Notes
56
+
57
+ - Focus on making concrete progress, not just planning. Actually do the work described in each item.
58
+ - Never skip a critical/high priority item without documenting why in the item body.
59
+ - Time is limited. If running low on turns, prioritize completing in-progress items over starting new ones.
60
+ - Respect accepted guides — they define conventions and constraints for this workspace.
61
+ - When writing code or making changes, follow existing patterns in the workspace.
62
+ - This task is designed to run after `item-triage` has organized the backlog.
@@ -0,0 +1,20 @@
1
+ name: execute-items
2
+ schedule: "0 11 * * 1-5"
3
+ enabled: false
4
+ context:
5
+ max_turns: 30
6
+ timeout: 1800
7
+ autonomous: true
8
+ output:
9
+ note: true
10
+ note_tags: [execution, auto]
11
+ permissions:
12
+ allow:
13
+ - Write
14
+ - Edit
15
+ - Bash
16
+ - web_search
17
+ - current_time
18
+ - work_board
19
+ - slack_post_message
20
+ - slack_upload_file
@@ -0,0 +1,106 @@
1
+ ---
2
+ name: item-triage
3
+ description: Triage auto-generated items — link to goals, adjust priority, merge duplicates, void stale items
4
+ ---
5
+
6
+ # Item Triage
7
+
8
+ Review all items in the workspace, focusing on auto-generated items (`auto` tag). Link orphaned items to goals, adjust priorities, merge duplicates, and void stale or irrelevant items. Post a triage summary to Slack.
9
+
10
+ ## Steps
11
+
12
+ 1. **Get current date/time**: Call `current_time` to get the exact current date and time.
13
+
14
+ 2. **Read all goals**: Use `Glob` to find `goals/*.md`. Read each goal to understand:
15
+ - Goal title and objective
16
+ - Currently linked items (extract `[[wiki-links]]` from body)
17
+ - Goal's tags and theme
18
+
19
+ 3. **Read all items**: Use `Glob` to find `items/*.md`. Read each item's frontmatter and body. Build an inventory:
20
+ - title, status, priority, tags, created date
21
+ - Whether the item is linked from any goal (check against step 2)
22
+ - Whether the item has the `auto` tag (auto-generated by watch tasks)
23
+
24
+ 4. **Categorize items into triage buckets**:
25
+
26
+ **a. Orphaned items** (not linked from any goal):
27
+ - Determine which goal they best fit under based on tags and content
28
+ - Add wiki-link `[[item-slug]]` to the appropriate goal's Linked Items section
29
+ - If no goal fits, flag for human review
30
+
31
+ **b. Duplicate/overlapping items**:
32
+ - Compare titles and content of all items
33
+ - If two items cover the same topic (e.g., same competitor, same technology), merge into one:
34
+ - Keep the more detailed item
35
+ - Set the duplicate's status to `void` with note: "Merged into [[other-item]]"
36
+
37
+ **c. Stale auto-generated items** (auto tag + status:todo + created 14+ days ago):
38
+ - Check if the topic is still relevant (use web_search if needed for context)
39
+ - If no longer relevant: set status to `void` with reason
40
+ - If still relevant but untouched: bump priority or add a comment noting staleness
41
+
42
+ **d. Priority adjustment**:
43
+ - Auto-generated items default to `high` — reassess based on:
44
+ - Does this directly affect TD revenue or customers? → keep `high` or upgrade to `critical`
45
+ - Is this a "nice to know" or exploratory? → downgrade to `medium`
46
+ - Is this already being handled elsewhere? → downgrade to `low` or `void`
47
+
48
+ 5. **Execute triage actions**: For each item that needs changes:
49
+ - Update frontmatter (status, priority) via Edit
50
+ - Add goal links via Edit on goal files
51
+ - Set void items with a reason comment at the bottom
52
+
53
+ 6. **Write output**: Create `results/{run_id}/output.md` with:
54
+ - Executive summary (items triaged, actions taken)
55
+ - Table: | Item | Action | Reason |
56
+ - Orphaned items linked: | Item | Linked to Goal |
57
+ - Duplicates merged: | Kept | Voided |
58
+ - Stale items: | Item | Decision | Reason |
59
+ - Priority changes: | Item | Old Priority | New Priority | Reason |
60
+ - Items flagged for human review
61
+
62
+ 7. **Post to Slack**: Post a concise triage summary to the notification channel. Format:
63
+ ```
64
+ :broom: Item Triage — {date}
65
+
66
+ Items scanned: {total}
67
+ Orphaned → linked: {count}
68
+ Duplicates merged: {count}
69
+ Stale → voided: {count}
70
+ Priority adjusted: {count}
71
+ Needs human review: {count}
72
+
73
+ {one-line highlight if notable action taken}
74
+ ```
75
+
76
+ ## Error Handling
77
+
78
+ - If a goal file cannot be edited (permissions), log and continue with other goals.
79
+ - Never void items with `priority: critical` — flag for human review instead.
80
+ - Never void items that are `in_progress` — only triage `todo` and `backlog` items.
81
+ - If unsure about a triage decision, flag for human review rather than acting.
82
+
83
+ ## Data Files
84
+
85
+ - None persistent. Reads directly from workspace goals/ and items/.
86
+
87
+ ## Triage Rules
88
+
89
+ | Condition | Action |
90
+ |-----------|--------|
91
+ | `auto` tag + not linked to any goal | Link to best-matching goal |
92
+ | `auto` tag + `todo` + created 14+ days ago | Reassess relevance; void if stale |
93
+ | Two items with same topic/competitor/technology | Merge (keep detailed one, void other) |
94
+ | `auto` tag + `high` priority + exploratory content | Downgrade to `medium` |
95
+ | `auto` tag + directly revenue-impacting | Keep `high` or upgrade to `critical` |
96
+ | Any item + `todo` + 30+ days old | Flag for human review |
97
+ | Any item + unclear goal fit | Flag for human review |
98
+
99
+ ## Notes
100
+
101
+ - This task is the "cleanup crew" — it keeps the workspace organized as watch tasks generate items
102
+ - Be conservative: when in doubt, flag for human review rather than auto-voiding
103
+ - The most important action is linking orphaned items to goals — this ensures nothing falls through cracks
104
+ - Duplicate detection should consider semantic similarity, not just exact title match
105
+ - This task should run AFTER watch tasks have completed their daily runs
106
+ - Keep Slack messages concise — detailed triage log goes in output.md