@treasuredata/tdx 2026.3.28 → 2026.3.29

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 (203) 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/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/policy.js +1 -1
  127. package/dist/sdk/query/index.js +1 -1
  128. package/dist/sdk/query/sql-parser.js +1 -1
  129. package/dist/sdk/realtime.js +1 -1
  130. package/dist/sdk/schedule.js +1 -1
  131. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  132. package/dist/sdk/segment/fields-display.js +1 -1
  133. package/dist/sdk/segment/file-discovery.js +1 -1
  134. package/dist/sdk/segment/journey-utils.js +1 -1
  135. package/dist/sdk/segment/journey-validator.js +1 -1
  136. package/dist/sdk/segment/journey-yaml.js +1 -1
  137. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  138. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  139. package/dist/sdk/segment/pull-workflow.js +1 -1
  140. package/dist/sdk/segment/push-recovery.js +1 -1
  141. package/dist/sdk/segment/push-workflow.js +1 -1
  142. package/dist/sdk/segment/resolution-context.js +1 -1
  143. package/dist/sdk/segment/segment-path-parser.js +1 -1
  144. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  145. package/dist/sdk/segment/segment-validator.js +1 -1
  146. package/dist/sdk/segment/target-resolution.js +1 -1
  147. package/dist/sdk/segment/tdx-config.js +1 -1
  148. package/dist/sdk/segment/types/activation-schema.js +1 -1
  149. package/dist/sdk/segment/types/journey-def.js +1 -1
  150. package/dist/sdk/segment/types/journey-schema.js +1 -1
  151. package/dist/sdk/segment/types/segment-def.js +1 -1
  152. package/dist/sdk/segment/types/segment-schema.js +1 -1
  153. package/dist/sdk/segment/validate-files.js +1 -1
  154. package/dist/sdk/segment/yaml-validator.js +1 -1
  155. package/dist/sdk/segment.js +1 -1
  156. package/dist/sdk/types/index.js +1 -1
  157. package/dist/sdk/types/progress.js +1 -1
  158. package/dist/sdk/user.js +1 -1
  159. package/dist/sdk/util/format-detector.js +1 -1
  160. package/dist/sdk/util/formatters.js +1 -1
  161. package/dist/sdk/util/index.js +1 -1
  162. package/dist/sdk/util/paginate.js +1 -1
  163. package/dist/sdk/util/tree-formatter.js +1 -1
  164. package/dist/sdk/workflow/archive-validation.js +1 -1
  165. package/dist/sdk/workflow/clone-workflow.js +1 -1
  166. package/dist/sdk/workflow/index.js +1 -1
  167. package/dist/sdk/workflow/pull-workflow.js +1 -1
  168. package/dist/sdk/workflow/push-workflow.js +1 -1
  169. package/dist/sdk/workflow/tdx-config.js +1 -1
  170. package/dist/sdk/workflow/workflow-utils.js +1 -1
  171. package/dist/test-utils/command-runner.js +1 -1
  172. package/dist/test-utils/factories.js +1 -1
  173. package/dist/test-utils/fixtures.js +1 -1
  174. package/dist/test-utils/http-mock.js +1 -1
  175. package/dist/test-utils/index.js +1 -1
  176. package/dist/utils/async.js +1 -1
  177. package/dist/utils/colors.js +1 -1
  178. package/dist/utils/diff.js +1 -1
  179. package/dist/utils/file-permissions.js +1 -1
  180. package/dist/utils/file-reader.js +1 -1
  181. package/dist/utils/github-releases.js +1 -1
  182. package/dist/utils/global-cache.js +1 -1
  183. package/dist/utils/json-loader.js +1 -1
  184. package/dist/utils/local-cache.js +1 -1
  185. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  186. package/dist/utils/logger/formatters/index.js +1 -1
  187. package/dist/utils/logger/handlers/console-handler.js +1 -1
  188. package/dist/utils/logger/handlers/file-handler.js +1 -1
  189. package/dist/utils/logger/handlers/index.js +1 -1
  190. package/dist/utils/logger/handlers/null-handler.js +1 -1
  191. package/dist/utils/logger/index.js +1 -1
  192. package/dist/utils/logger/logger.js +1 -1
  193. package/dist/utils/logger/types.js +1 -1
  194. package/dist/utils/option-validation.js +1 -1
  195. package/dist/utils/process.js +1 -1
  196. package/dist/utils/prompt.js +1 -1
  197. package/dist/utils/spinner.js +1 -1
  198. package/dist/utils/sse-parser.js +1 -1
  199. package/dist/utils/string-utils.js +1 -1
  200. package/dist/utils/table-ref-parser.js +1 -1
  201. package/dist/utils/tdx-logger.js +1 -1
  202. package/dist/utils/version-check.js +1 -1
  203. package/package.json +1 -1
@@ -1 +1 @@
1
- const a26_0x1da60b=a26_0x538c;(function(_0x4aa070,_0x468d31){const _0xaf3346=a26_0x538c,_0x532055=_0x4aa070();while(!![]){try{const _0x309218=parseInt(_0xaf3346(0x1dd))/0x1+-parseInt(_0xaf3346(0x2b3))/0x2+-parseInt(_0xaf3346(0x1d4))/0x3*(parseInt(_0xaf3346(0x242))/0x4)+-parseInt(_0xaf3346(0x238))/0x5+parseInt(_0xaf3346(0x2a5))/0x6+-parseInt(_0xaf3346(0x1ea))/0x7+parseInt(_0xaf3346(0x207))/0x8*(parseInt(_0xaf3346(0x20f))/0x9);if(_0x309218===_0x468d31)break;else _0x532055['push'](_0x532055['shift']());}catch(_0x50dda2){_0x532055['push'](_0x532055['shift']());}}}(a26_0x27bc,0x2ca77));import a26_0xd062a4 from'chalk';import a26_0x51d0c5 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';function a26_0x538c(_0x54734f,_0x2e4d0){_0x54734f=_0x54734f-0x1bf;const _0x27bc12=a26_0x27bc();let _0x538c6e=_0x27bc12[_0x54734f];return _0x538c6e;}import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';function a26_0x27bc(){const _0x17a8b6=['length','split','state','\x20journey','\x22\x20not\x20found','\x20changed\x20files','site','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','3204AEDeGg','(completed)','description','utf-8','all','Creating\x20new\x20version...','goal','journeyStages','journeyName','\x20journey\x20files\x20to\x20','parent_segment','completed','\x20unchanged\x20files','journey:pull','dryRun','sort','(root)','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','web','file','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','getTrafficData','size','completionRate','Error:\x20--version\x20option\x20is\x20required','columns','resolveSegment','no_parent','journey:view','\x20\x20Journey\x20ID:\x20','/j/da/je','replace','map','segmentPushCommand','history','Listing\x20journey\x20versions...','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20Statistics\x20not\x20available','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','connector_config','\x22\x20resumed','🗺️\x20','\x27\x20not\x20found\x20in\x20','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','milestoneSize','\x20not\x20found.\x20Available:\x20','...','Table:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','table','message','Error:\x20Parent\x20segment\x20context\x20required','✔\x20Found\x20','folderId','getStatistics','Warning:\x20Could\x20not\x20resolve\x20activation\x20','\x20details...','createdAt','Cancelled','Fetching\x20','then','reentryMode','activation','getColumnMapping','toLowerCase','yes','-\x20no\x20files\x20written','📁\x20','journey:version:create','stages','relative','tdx.json','includeHistory','\x20->\x20','targetDir','parentName','name','resolveJourneyId','updatedAt','Resolving\x20version...','Target\x20directory:\x20','journey:activations','conversion','cyan','format','hasPeriod','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Resolved\x20YAML\x20file:\x20','repeat','isNew','content','(paused)','listJourneysFromParentSegment','getJourney','Warning:\x20Could\x20not\x20resolve\x20segment\x20','\x20journeys','1243470nDPPyC','args','error','Folder\x20path:\x20','parentSegment','/j/da','log','from','jsonl','values','Parent\x20segment:\x20','\x20(ID:\x20','/app/ps/','set','666960kMUavP','createVersion','journey:pause','execute','\x5c$&','join','Target\x20file:\x20','versionNumber','completeMilestoneRate','folders','helpText','limit','get','add','database','Options:','setPhase','stage','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','links','renderStats','yellow','\x0aError:','has','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Pausing\x20journey...','buildIdToEmailMap','getActivation','getSegment','\x0aChanges\x20to\x20\x27','(draft)','✔\x20Pulled\x20','Database:\x20','Resolving\x20parent\x20segment...','push','\x20Opening\x20','localeCompare','resourceName','archived','654ySGAVt','green','Getting\x20column\x20mapping...','session','listActivationsFlat','entries','absolutePath','Resolving\x20journey...','kind','213289IgvomU','journeyBundleId','Getting\x20version\x20','\x20(draft)\x20—\x20\x22','Found\x20','journeyBundleName','includeStats','resolveParentId','resume','✔\x20Context\x20set:\x20','rule','journey','listVersions','69811AvRuoO','hasChanges','No\x20statistics\x20available\x20for\x20journey:\x20','verbose','journey:columns','Pattern:\x20','Getting\x20journey\x20details...','No\x20journeys\x20found','journey:version:view','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','segments','buildIdToNameMap','List\x20all\x20versions\x20of\x20a\x20journey','journey:resume','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','find','segmentName','stringify','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','\x20\x20-\x20','cwd','base','json','View\x20a\x20specific\x20version\x20of\x20a\x20journey','data','\x20\x20Name:\x20','filter','segment','\x20(rule\x20match)','8XaaQVM','Show\x20journey\x20details','type','root\x20folder','activation_','\x20new\x20files','/e/','\x20\x20Folder\x20path:\x20','3295719EXICqx','(archived)','diff','Write\x20','red','Getting\x20journey\x20statistics...','dim','pause','getParentFull','✔\x20Journey\x20\x22','Journey\x20name:\x20','\x20=\x20','folderPath','relativePath','Input:\x20','filePath','\x20version','exitOrJumpRate','Available\x20stages:\x20','Error:\x20Invalid\x20version\x20number:\x20','\x20activation','journeyId','Fetching\x20parent\x20segment...','Listing\x20journey\x20activations...','nodes','options','version','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Fetching\x20users\x20and\x20connections...','journey:traffic','Error:\x20Stage\x20\x22','audienceId','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','exitOrJumpSize','activationParams','attributes','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','listFolders','journey:stats','enteredSize','428755NQTKSw','Show\x20journey\x20statistics'];a26_0x27bc=function(){return _0x17a8b6;};return a26_0x27bc();}import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x27cbba){const _0x500af9=a26_0x538c;return!_0x27cbba&&(console[_0x500af9(0x2a7)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x500af9(0x2a7)](_0x500af9(0x241))),!!_0x27cbba;}function withJsonFormat(_0x60aba){const _0x363721=a26_0x538c;if(!_0x60aba[_0x363721(0x297)]&&!_0x60aba[_0x363721(0x200)]&&!_0x60aba[_0x363721(0x2ad)]&&!_0x60aba['tsv'])return{..._0x60aba,'format':_0x363721(0x200),'json':!![]};return _0x60aba;}function formatJourneyState(_0x5961c6){const _0x99e850=a26_0x538c;switch(_0x5961c6){case'launched':return a26_0xd062a4['green']('(running)');case'draft':return a26_0xd062a4[_0x99e850(0x215)](_0x99e850(0x1cb));case'paused':return a26_0xd062a4['yellow'](_0x99e850(0x2a0));case _0x99e850(0x24d):return a26_0xd062a4['blue'](_0x99e850(0x243));case _0x99e850(0x1d3):return a26_0xd062a4['dim'](_0x99e850(0x210));default:return'('+_0x5961c6+')';}}function formatJourneyItem(_0x30742e,_0x317477='',_0x56fcc4){const _0x5934c5=a26_0x538c,_0x260fb3=formatJourneyState(_0x30742e[_0x5934c5(0x23c)]),_0x4af024=_0x56fcc4?hyperlink(_0x30742e['journeyBundleName'],_0x56fcc4):_0x30742e[_0x5934c5(0x1e2)];return _0x317477+_0x5934c5(0x26c)+_0x4af024+'\x20'+_0x260fb3;}function escapeRegex(_0x573d25){const _0x21d993=a26_0x538c;return _0x573d25[_0x21d993(0x262)](/[.*+?^${}()|[\]\\]/g,_0x21d993(0x2b7));}function globToRegex(_0x455a05){const _0x279f77=a26_0x538c,_0x5a0e35=_0x455a05[_0x279f77(0x23b)]('*')[_0x279f77(0x263)](escapeRegex);return new RegExp(_0x5a0e35['join']('.*'),'i');}function buildRuleToNameMapping(_0x22e232){const _0x50d965=a26_0x538c,_0x5aff44=new Map();if(_0x22e232[_0x50d965(0x1f4)])for(const [_0x26d537,_0x99bc6d]of Object[_0x50d965(0x1d9)](_0x22e232['segments'])){if(_0x99bc6d[_0x50d965(0x1e7)]){const _0x417853=serializeRule(_0x99bc6d['rule']),_0x222de8=_0x5aff44[_0x50d965(0x2bf)](_0x417853);_0x222de8?_0x222de8['push'](_0x26d537):_0x5aff44[_0x50d965(0x2b2)](_0x417853,[_0x26d537]);}}return _0x5aff44;}async function resolveJourneyIdFromInput(_0x36bed5,_0x31c46e,_0x311304){const _0x4ab8d4=a26_0x538c,_0x5fda9d=await resolveJourneyTarget(_0x36bed5,_0x31c46e[_0x4ab8d4(0x2a9)],_0x31c46e[_0x4ab8d4(0x1ed)]),_0x215557=_0x5fda9d['parentSegment'];if(!_0x215557)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4ab8d4(0x22b));const _0x16f431=await withSpinner(_0x4ab8d4(0x1ce),()=>_0x311304[_0x4ab8d4(0x205)][_0x4ab8d4(0x1e4)](_0x215557),{'verbose':_0x31c46e[_0x4ab8d4(0x1ed)]}),_0x3138b2=_0x16f431[_0x4ab8d4(0x202)],_0x35ec7d=await withSpinner(_0x4ab8d4(0x1db),()=>_0x311304[_0x4ab8d4(0x1e8)][_0x4ab8d4(0x290)](_0x3138b2,_0x5fda9d[_0x4ab8d4(0x24a)]),{'verbose':_0x31c46e[_0x4ab8d4(0x1ed)]});return{'journeyId':_0x35ec7d[_0x4ab8d4(0x202)],'journeyName':_0x5fda9d['journeyName'],'parentSegmentId':_0x3138b2};}async function resolveJourneyTarget(_0x209bf5,_0x54c871,_0x4dc035){const _0x2cda9e=a26_0x538c;if(isYamlFilePath(_0x209bf5))try{const _0x1908de=await resolveYamlFilePath(_0x209bf5);return _0x4dc035&&(console[_0x2cda9e(0x2a7)](_0x2cda9e(0x29c)+_0x209bf5),console[_0x2cda9e(0x2a7)]('\x20\x20Parent\x20segment:\x20'+_0x1908de[_0x2cda9e(0x2a9)]),console['error'](_0x2cda9e(0x203)+_0x1908de['segmentName']),console[_0x2cda9e(0x2a7)](_0x2cda9e(0x20e)+(_0x1908de['folderPath']||_0x2cda9e(0x252)))),{'journeyName':_0x1908de[_0x2cda9e(0x1fa)],'parentSegment':_0x1908de[_0x2cda9e(0x2a9)],'resolved':_0x1908de};}catch(_0x7f6fa){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2cda9e(0x1f8)+_0x7f6fa['message']);}if(!_0x54c871)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2cda9e(0x253));return{'journeyName':_0x209bf5,'parentSegment':_0x54c871};}export class JourneyListCommand extends BaseCommand{[a26_0x1da60b(0x28f)]='journey:list';['description']='List\x20journeys\x20in\x20current\x20context';async['execute'](_0x12ade7){const _0x2eef2c=a26_0x1da60b,{options:_0x515740,args:_0xc31ff9,tdx:_0x4a62f7}=_0x12ade7,_0x1794dc=_0xc31ff9[0x0],_0x5d27dc=_0x515740[_0x2eef2c(0x2a9)];if(!_0x5d27dc)return console['error'](_0x2eef2c(0x276)),console[_0x2eef2c(0x2a7)](_0x2eef2c(0x1f3)),0x1;const _0x52b2e2=await withSpinner(_0x2eef2c(0x1ce),()=>_0x4a62f7[_0x2eef2c(0x205)][_0x2eef2c(0x1e4)](_0x5d27dc),{'verbose':_0x515740['verbose']}),_0x3c40bb=_0x52b2e2['data'];_0x515740[_0x2eef2c(0x1ed)]&&(console[_0x2eef2c(0x2a7)](_0x2eef2c(0x2af)+_0x5d27dc+_0x2eef2c(0x2b0)+_0x3c40bb+')'),_0x1794dc&&console['error'](_0x2eef2c(0x1ef)+_0x1794dc));const _0x2e90ec=await withSpinner(_0x2eef2c(0x225),()=>_0x4a62f7[_0x2eef2c(0x205)][_0x2eef2c(0x217)](_0x3c40bb),{'verbose':_0x515740[_0x2eef2c(0x1ed)]}),_0x4c0121=_0x2e90ec[_0x2eef2c(0x202)],_0x40b9c3=_0x4c0121['rootFolderId'],_0x314d1d=await withSpinner('Listing\x20journeys...',()=>_0x4a62f7[_0x2eef2c(0x1e8)]['listJourneysWithFolders'](_0x3c40bb,_0x40b9c3),{'verbose':_0x515740['verbose']});let _0x1548f6=_0x314d1d[_0x2eef2c(0x202)]['journeys'];const _0x4e91e5=_0x314d1d[_0x2eef2c(0x202)][_0x2eef2c(0x2bc)],_0x32639b=new Map();for(const _0x5088b4 of _0x4e91e5){_0x32639b['set'](_0x5088b4['id'],_0x5088b4['name']);}if(_0x1794dc){const _0x4bd5c8=globToRegex(_0x1794dc);_0x1548f6=_0x1548f6[_0x2eef2c(0x204)](_0xf2b2e8=>_0x4bd5c8['test'](_0xf2b2e8['journeyBundleName']));}console[_0x2eef2c(0x2a7)](_0x2eef2c(0x277)+_0x1548f6[_0x2eef2c(0x23a)]+_0x2eef2c(0x23d)+(_0x1548f6[_0x2eef2c(0x23a)]!==0x1?'s':''));const _0x36d05d=_0x1d980d=>{const _0x3777af=_0x2eef2c;return getConsoleNextUrl(_0x515740[_0x3777af(0x240)],_0x3777af(0x2b1)+_0x3c40bb+_0x3777af(0x20d)+_0x1d980d+_0x3777af(0x2aa));};if(_0x515740['format']==='table')await handleSDKOutput(_0x1548f6,_0x515740);else{if(_0x515740[_0x2eef2c(0x297)]==='json'){const _0x254a88=_0x1548f6['map'](_0x27606c=>({..._0x27606c,'url':_0x36d05d(_0x27606c['id'])}));await handleSDKOutput(_0x254a88,_0x515740);}else{console['log']('['+_0x5d27dc+']');const _0x13ace7=new Map(),_0x46f0db=[];for(const _0xa1a313 of _0x1548f6){if(!_0xa1a313[_0x2eef2c(0x278)]||_0xa1a313[_0x2eef2c(0x278)]===_0x40b9c3)_0x46f0db[_0x2eef2c(0x1cf)](_0xa1a313);else{const _0x561431=_0x13ace7[_0x2eef2c(0x2bf)](_0xa1a313[_0x2eef2c(0x278)])||[];_0x561431[_0x2eef2c(0x1cf)](_0xa1a313),_0x13ace7[_0x2eef2c(0x2b2)](_0xa1a313[_0x2eef2c(0x278)],_0x561431);}}const _0x469b29=(_0xc5400,_0x5e42e3)=>_0xc5400[_0x2eef2c(0x1e2)][_0x2eef2c(0x1d1)](_0x5e42e3[_0x2eef2c(0x1e2)],undefined,{'sensitivity':'base'});_0x46f0db[_0x2eef2c(0x251)](_0x469b29);for(const _0x4c82f6 of _0x46f0db){console[_0x2eef2c(0x2ab)](formatJourneyItem(_0x4c82f6,'',_0x36d05d(_0x4c82f6['id'])));}const _0x3de02d=[..._0x13ace7[_0x2eef2c(0x1d9)]()][_0x2eef2c(0x251)]((_0x7644dc,_0x3d003d)=>{const _0xce276c=_0x2eef2c,_0x10334c=_0x32639b[_0xce276c(0x2bf)](_0x7644dc[0x0])||_0x7644dc[0x0],_0xe36461=_0x32639b['get'](_0x3d003d[0x0])||_0x3d003d[0x0];return _0x10334c[_0xce276c(0x1d1)](_0xe36461,undefined,{'sensitivity':_0xce276c(0x1ff)});});for(const [_0x312f5b,_0x30acd0]of _0x3de02d){const _0x35a753=_0x32639b[_0x2eef2c(0x2bf)](_0x312f5b)||_0x312f5b;console[_0x2eef2c(0x2ab)](_0x2eef2c(0x286)+_0x35a753),_0x30acd0[_0x2eef2c(0x251)](_0x469b29);for(const _0x5cba68 of _0x30acd0){console['log'](formatJourneyItem(_0x5cba68,'\x20\x20',_0x36d05d(_0x5cba68['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a26_0x1da60b(0x28f)]=a26_0x1da60b(0x25f);[a26_0x1da60b(0x244)]=a26_0x1da60b(0x208);async['execute'](_0x588c23){const _0x51d149=a26_0x1da60b,{options:_0x1a2d41,args:_0x4e2cc6,tdx:_0x2a06fb}=_0x588c23,_0x14b762=_0x4e2cc6[0x0];if(!_0x14b762)return console[_0x51d149(0x2a7)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x51d149(0x2a7)](_0x51d149(0x1bf)),console[_0x51d149(0x2a7)](_0x51d149(0x2c2)),console[_0x51d149(0x2a7)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x1a2d41[_0x51d149(0x1ed)]&&console[_0x51d149(0x2a7)](_0x51d149(0x21d)+_0x14b762);const {journeyId:_0xcb158,parentSegmentId:_0xe1126}=await resolveJourneyIdFromInput(_0x14b762,_0x1a2d41,_0x2a06fb);if(_0x1a2d41[_0x51d149(0x255)]){const _0x21bb07=getConsoleNextUrl(_0x1a2d41[_0x51d149(0x240)],_0x51d149(0x2b1)+_0xe1126+_0x51d149(0x20d)+_0xcb158+_0x51d149(0x261));return console[_0x51d149(0x2a7)](a26_0xd062a4[_0x51d149(0x1d5)]('✔')+_0x51d149(0x1d0)+a26_0xd062a4['cyan'](_0x21bb07)),openBrowser(_0x21bb07),0x0;}const _0x4f5f95=await withSpinner(_0x51d149(0x1f0),()=>_0x2a06fb[_0x51d149(0x1e8)][_0x51d149(0x2a2)](_0xcb158),{'verbose':_0x1a2d41[_0x51d149(0x1ed)]}),_0x3b8390=_0x4f5f95[_0x51d149(0x202)],_0x1a4a67=_0x1a2d41[_0x51d149(0x1e3)];let _0x1f9980;if(_0x1a4a67)try{const _0x55ea80=await withSpinner(_0x51d149(0x214),()=>_0x2a06fb[_0x51d149(0x1e8)]['getStatistics'](_0xcb158),{'verbose':_0x1a2d41[_0x51d149(0x1ed)]});_0x1f9980=_0x55ea80[_0x51d149(0x202)];}catch{_0x1a2d41[_0x51d149(0x1ed)]&&console[_0x51d149(0x2a7)](_0x51d149(0x268));}const _0x41508b=getConsoleNextUrl(_0x1a2d41[_0x51d149(0x240)],_0x51d149(0x2b1)+_0xe1126+_0x51d149(0x20d)+_0xcb158+_0x51d149(0x261)),_0x1f00fb={'id':_0x3b8390['id'],'name':_0x3b8390[_0x51d149(0x233)][_0x51d149(0x28f)],'description':_0x3b8390[_0x51d149(0x233)][_0x51d149(0x244)],'state':_0x3b8390[_0x51d149(0x233)]['state'],'paused':_0x3b8390[_0x51d149(0x233)]['paused'],'reentry_mode':_0x3b8390[_0x51d149(0x233)][_0x51d149(0x280)],'stages':_0x3b8390['attributes'][_0x51d149(0x249)]?.[_0x51d149(0x23a)]||0x0,..._0x3b8390[_0x51d149(0x233)][_0x51d149(0x248)]&&{'goal':_0x3b8390[_0x51d149(0x233)]['goal'][_0x51d149(0x28f)]},..._0x1f9980&&{'statistics':{'size':_0x1f9980['size'],'entered':_0x1f9980[_0x51d149(0x237)],'goal_achieved':_0x1f9980['goalSize'],'completion_rate':_0x1f9980[_0x51d149(0x25a)],'exit_or_jump':_0x1f9980[_0x51d149(0x231)],'exit_or_jump_rate':_0x1f9980['exitOrJumpRate'],'stages':_0x1f9980[_0x51d149(0x288)]}},'url':_0x41508b};return await handleSingleObjectOutput(_0x1f00fb,_0x1a2d41),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a26_0x1da60b(0x28f)]=a26_0x1da60b(0x236);[a26_0x1da60b(0x244)]=a26_0x1da60b(0x239);async[a26_0x1da60b(0x2b6)](_0x354385){const _0x14cd16=a26_0x1da60b,{options:_0x10209c,args:_0x25b8ae,tdx:_0x4479d4}=_0x354385,_0x1cb422=_0x25b8ae[0x0];if(!requireNameOrPath(_0x1cb422))return 0x1;_0x10209c[_0x14cd16(0x1ed)]&&console[_0x14cd16(0x2a7)](_0x14cd16(0x21d)+_0x1cb422);const _0xecf8fd=_0x10209c,_0xa85cc4=_0xecf8fd[_0x14cd16(0x2ac)],_0x5a564d=_0xecf8fd['to'],_0x285ef5=_0xecf8fd[_0x14cd16(0x28b)],_0x48e756=_0xecf8fd[_0x14cd16(0x2c4)];_0x285ef5&&!_0xa85cc4&&!_0x5a564d&&console[_0x14cd16(0x2a7)](_0x14cd16(0x1c5));const _0x6b97bf=_0x285ef5?withJsonFormat(_0x10209c):_0x10209c,{journeyId:_0x7c8fa6,journeyName:_0x340173}=await resolveJourneyIdFromInput(_0x1cb422,_0x6b97bf,_0x4479d4),_0x14d568=_0xa85cc4||_0x5a564d?{'from':_0xa85cc4,'to':_0x5a564d}:undefined,_0x4cd2b2=await withSpinner(_0x14cd16(0x214),()=>Promise[_0x14cd16(0x246)]([_0x4479d4[_0x14cd16(0x1e8)][_0x14cd16(0x2a2)](_0x7c8fa6),_0x4479d4[_0x14cd16(0x1e8)][_0x14cd16(0x279)](_0x7c8fa6,_0x14d568)]),{'verbose':_0x6b97bf[_0x14cd16(0x1ed)]}),[_0x5f2d64,_0x30dda1]=_0x4cd2b2[_0x14cd16(0x202)];if(!_0x30dda1||_0x30dda1[_0x14cd16(0x224)]===null)return console[_0x14cd16(0x2a7)](_0x14cd16(0x1ec)+_0x340173),console[_0x14cd16(0x2a7)](_0x14cd16(0x29b)),0x0;const _0x5311f2=buildStageNameMap(_0x5f2d64),_0x4eb591=!!(_0x14d568&&_0x30dda1[_0x14cd16(0x265)]?.[_0x14cd16(0x23a)]),_0x566f6b={'stageNameMap':_0x5311f2,'hasPeriod':_0x4eb591,'includeHistory':!!_0x285ef5};if(_0x48e756&&_0x30dda1['stages']){const _0x2da0d3=_0x30dda1[_0x14cd16(0x288)][_0x14cd16(0x1f9)](_0x414e1b=>{const _0x5589b5=_0x14cd16,_0x13dd00=_0x5311f2['get'](_0x414e1b['id'])??'';return _0x13dd00['toLowerCase']()===_0x48e756[_0x5589b5(0x283)]();});if(_0x2da0d3)return await handleSingleObjectOutput(formatStageStats(_0x2da0d3,_0x566f6b),_0x6b97bf),0x0;const _0x5b6aa0=_0x30dda1['stages']['map'](_0x4871f8=>_0x5311f2[_0x14cd16(0x2bf)](_0x4871f8['id'])??_0x4871f8['id']);return console['error'](_0x14cd16(0x22e)+_0x48e756+_0x14cd16(0x23e)),console['error'](_0x14cd16(0x221)+_0x5b6aa0[_0x14cd16(0x2b8)](',\x20')),0x1;}const _0x48e0a8=_0x30dda1['stages']?.[_0x14cd16(0x263)](_0x56e322=>formatStageStats(_0x56e322,_0x566f6b)),_0x2783e6=assembleJourneyStats(_0x30dda1,{'from':_0xa85cc4,'to':_0x5a564d,'includeHistory':_0x285ef5});return await this[_0x14cd16(0x1c1)](_0x2783e6,_0x48e0a8??[],_0x6b97bf),0x0;}async[a26_0x1da60b(0x1c1)](_0x30c85c,_0x49d2c4,_0x5ac0b0){const _0x59182f=a26_0x1da60b,_0x4833e4=_0x5ac0b0[_0x59182f(0x297)]===_0x59182f(0x200)||_0x5ac0b0[_0x59182f(0x297)]===_0x59182f(0x2ad)||_0x5ac0b0[_0x59182f(0x200)]||_0x5ac0b0[_0x59182f(0x2ad)];if(_0x4833e4){_0x30c85c['stages']=_0x49d2c4,await handleSingleObjectOutput(_0x30c85c,_0x5ac0b0);return;}await handleSingleObjectOutput(_0x30c85c,_0x5ac0b0);for(const _0x18e0c9 of _0x49d2c4){console[_0x59182f(0x2ab)](''),console[_0x59182f(0x2ab)](String(a26_0xd062a4[_0x59182f(0x296)]['bold']('['+_0x18e0c9[_0x59182f(0x28f)]+']'))+a26_0xd062a4[_0x59182f(0x215)]('\x20'+_0x18e0c9['id']));const {id:_0x2d8551,name:_0x414094,..._0x28c9cf}=_0x18e0c9;await handleSingleObjectOutput(_0x28c9cf,_0x5ac0b0);}}}export class JourneyTrafficCommand extends BaseCommand{['name']=a26_0x1da60b(0x22d);[a26_0x1da60b(0x244)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a26_0x1da60b(0x2b6)](_0x89504d){const _0x1c5970=a26_0x1da60b,{options:_0x34a59d,args:_0x12a149,tdx:_0x5171cf}=_0x89504d,_0xdadbd5=_0x12a149[0x0];if(!requireNameOrPath(_0xdadbd5))return 0x1;_0x34a59d[_0x1c5970(0x1ed)]&&console[_0x1c5970(0x2a7)](_0x1c5970(0x21d)+_0xdadbd5);const _0x3fd03c=_0x34a59d,_0x42f6a4=_0x3fd03c[_0x1c5970(0x209)],_0x227ce7=_0x3fd03c[_0x1c5970(0x2ac)],_0x3bea35=_0x3fd03c['to'],_0x2c2977=_0x3fd03c[_0x1c5970(0x2be)];if(_0x42f6a4&&_0x42f6a4!==_0x1c5970(0x295)&&_0x42f6a4!==_0x1c5970(0x281))return console[_0x1c5970(0x2a7)]('Error:\x20Invalid\x20--type\x20\x22'+_0x42f6a4+_0x1c5970(0x257)),0x1;const _0x2f73ac=withJsonFormat(_0x34a59d),{journeyId:_0x42b530,journeyName:_0x2aeddf}=await resolveJourneyIdFromInput(_0xdadbd5,_0x2f73ac,_0x5171cf),_0x3dd98b={'type':_0x42f6a4,'from':_0x227ce7,'to':_0x3bea35,'limit':_0x2c2977},_0x4125cd=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x5171cf[_0x1c5970(0x1e8)][_0x1c5970(0x258)](_0x42b530,_0x3dd98b),{'verbose':_0x2f73ac[_0x1c5970(0x1ed)]}),_0x3e9cdc=_0x4125cd[_0x1c5970(0x202)],_0x3239d9=_0x3e9cdc['conversion']&&(_0x3e9cdc[_0x1c5970(0x295)][_0x1c5970(0x227)][_0x1c5970(0x23a)]>0x0||_0x3e9cdc[_0x1c5970(0x295)][_0x1c5970(0x1c0)][_0x1c5970(0x23a)]>0x0),_0x5f59cd=_0x3e9cdc['activation']&&_0x3e9cdc[_0x1c5970(0x281)][_0x1c5970(0x23a)]>0x0;if(!_0x3239d9&&!_0x5f59cd)return console[_0x1c5970(0x2a7)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x2aeddf),console[_0x1c5970(0x2a7)]('Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),_0x227ce7&&_0x3bea35&&console['error']('If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).'),0x0;return await handleSingleObjectOutput(_0x3e9cdc,_0x2f73ac),0x0;}}function formatStageStats(_0x15e64f,_0x2a1c4f){const _0x58c6c4=a26_0x1da60b,_0x410af5=_0x2a1c4f['hasPeriod']&&_0x15e64f['history']?.[_0x58c6c4(0x23a)]?aggregateStageHistory(_0x15e64f[_0x58c6c4(0x265)]):{'size':_0x15e64f['size'],'entered':_0x15e64f[_0x58c6c4(0x237)],'milestone':_0x15e64f[_0x58c6c4(0x26f)],'milestone_rate':_0x15e64f[_0x58c6c4(0x2bb)],'exit_or_jump':_0x15e64f[_0x58c6c4(0x231)],'exit_or_jump_rate':_0x15e64f[_0x58c6c4(0x220)]},_0x23a258={'id':_0x15e64f['id'],'name':_0x2a1c4f['stageNameMap'][_0x58c6c4(0x2bf)](_0x15e64f['id'])??_0x15e64f['id'],..._0x410af5};return _0x2a1c4f[_0x58c6c4(0x298)]&&_0x2a1c4f[_0x58c6c4(0x28b)]&&_0x15e64f['history']&&(_0x23a258[_0x58c6c4(0x265)]=_0x15e64f[_0x58c6c4(0x265)]),_0x23a258;}export class JourneyPauseCommand extends BaseCommand{[a26_0x1da60b(0x28f)]=a26_0x1da60b(0x2b5);[a26_0x1da60b(0x244)]='Pause\x20a\x20running\x20journey';async[a26_0x1da60b(0x2b6)](_0x565bf3){const _0x523a88=a26_0x1da60b,{options:_0x1e6274,args:_0x4f7537,tdx:_0x3b5262}=_0x565bf3,_0x401e51=_0x4f7537[0x0];if(!requireNameOrPath(_0x401e51))return 0x1;_0x1e6274[_0x523a88(0x1ed)]&&console['error'](_0x523a88(0x21d)+_0x401e51);const {journeyId:_0x2af260,journeyName:_0xcdfcc1}=await resolveJourneyIdFromInput(_0x401e51,_0x1e6274,_0x3b5262);if(!_0x1e6274[_0x523a88(0x284)]){const _0x2d7176=await confirm(_0x523a88(0x22a)+_0xcdfcc1+'\x22?');if(!_0x2d7176)return console['error']('Cancelled'),0x0;}const _0x5bc326=await withSpinner(_0x523a88(0x1c6),()=>_0x3b5262[_0x523a88(0x1e8)][_0x523a88(0x216)](_0x2af260),{'verbose':_0x1e6274['verbose']}),_0x526ab4=_0x5bc326[_0x523a88(0x202)];return console[_0x523a88(0x2a7)](_0x523a88(0x218)+_0x526ab4[_0x523a88(0x233)][_0x523a88(0x28f)]+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a26_0x1da60b(0x28f)]=a26_0x1da60b(0x1f7);[a26_0x1da60b(0x244)]='Resume\x20a\x20paused\x20journey';async[a26_0x1da60b(0x2b6)](_0x373b4b){const _0x1b4be3=a26_0x1da60b,{options:_0x38a4be,args:_0x3e86eb,tdx:_0x1c7821}=_0x373b4b,_0x286b75=_0x3e86eb[0x0];if(!requireNameOrPath(_0x286b75))return 0x1;_0x38a4be[_0x1b4be3(0x1ed)]&&console['error'](_0x1b4be3(0x21d)+_0x286b75);const {journeyId:_0x5eac6a,journeyName:_0x1c071f}=await resolveJourneyIdFromInput(_0x286b75,_0x38a4be,_0x1c7821);if(!_0x38a4be[_0x1b4be3(0x284)]){const _0x32a3a0=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x1c071f+'\x22?');if(!_0x32a3a0)return console[_0x1b4be3(0x2a7)]('Cancelled'),0x0;}const _0x1b9a32=await withSpinner('Resuming\x20journey...',()=>_0x1c7821[_0x1b4be3(0x1e8)][_0x1b4be3(0x1e5)](_0x5eac6a),{'verbose':_0x38a4be[_0x1b4be3(0x1ed)]}),_0x51a948=_0x1b9a32[_0x1b4be3(0x202)];return console[_0x1b4be3(0x2a7)](_0x1b4be3(0x218)+_0x51a948[_0x1b4be3(0x233)]['name']+_0x1b4be3(0x26b)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a26_0x1da60b(0x24f);['description']='Export\x20journey(s)\x20as\x20YAML\x20files';async[a26_0x1da60b(0x2b6)](_0x32dc2f){const _0xf81733=a26_0x1da60b,{options:_0x1e4cc0,args:_0x478f45,tdx:_0x495e60}=_0x32dc2f,_0x1c419e=_0x1e4cc0,_0x879a51=_0x478f45[0x0],_0x3f684d=_0x879a51&&isYamlFilePath(_0x879a51),_0x134b07=await resolveTarget({'arg':_0x3f684d?_0x879a51:undefined,'contextParent':_0x1e4cc0[_0xf81733(0x2a9)],'cwd':process[_0xf81733(0x1fe)]()});if(!isSuccessfulResolution(_0x134b07))return _0x134b07['errorCode']===_0xf81733(0x25e)?(console[_0xf81733(0x2a7)](a26_0xd062a4[_0xf81733(0x1c2)](_0xf81733(0x234))),console[_0xf81733(0x2a7)](_0xf81733(0x299)),console[_0xf81733(0x2a7)](_0xf81733(0x269)),console[_0xf81733(0x2a7)](_0xf81733(0x29a)),console['error'](_0xf81733(0x2c5))):(console['error'](a26_0xd062a4['red']('Error:\x20'+_0x134b07[_0xf81733(0x275)]+'\x0a')),_0x134b07['helpText']&&console[_0xf81733(0x2a7)](a26_0xd062a4[_0xf81733(0x296)](_0x134b07[_0xf81733(0x2bd)]))),0x1;let _0x27fed6=_0x3f684d?undefined:_0x879a51,_0x8996bd,_0x47fe78;_0x134b07[_0xf81733(0x209)]===_0xf81733(0x256)&&(_0x27fed6=_0x134b07[_0xf81733(0x1d2)],_0x8996bd=_0x134b07[_0xf81733(0x21e)],_0x47fe78=_0x134b07[_0xf81733(0x21b)]);const _0x29fb18=_0x134b07[_0xf81733(0x28e)],_0x5740b3=_0x134b07[_0xf81733(0x28d)];_0x1c419e[_0xf81733(0x1ed)]&&(console[_0xf81733(0x2a7)](_0xf81733(0x2af)+_0x29fb18),console[_0xf81733(0x2a7)](_0xf81733(0x293)+_0x5740b3),_0x27fed6&&console[_0xf81733(0x2a7)](_0xf81733(0x219)+_0x27fed6),_0x8996bd&&console[_0xf81733(0x2a7)](_0xf81733(0x2b9)+_0x8996bd),_0x47fe78&&console[_0xf81733(0x2a7)](_0xf81733(0x2a8)+_0x47fe78));const _0x35635d=await withSpinner(_0xf81733(0x1ce),()=>_0x495e60['segment'][_0xf81733(0x1e4)](_0x29fb18),{'verbose':_0x1e4cc0[_0xf81733(0x1ed)]}),_0x5ba275=_0x35635d[_0xf81733(0x202)],{journeys:_0x1ee253,folders:_0x84972e}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x4bc823=_0xf81733,[_0x5d9ab9,_0x498ff5]=await Promise[_0x4bc823(0x246)]([_0x495e60[_0x4bc823(0x1e8)][_0x4bc823(0x2a1)](_0x5ba275,undefined,{'includeAllVersions':!![]}),_0x495e60['segment'][_0x4bc823(0x235)](_0x5ba275)]);return{'journeys':_0x5d9ab9,'folders':_0x498ff5};},{'verbose':_0x1e4cc0['verbose']})[_0xf81733(0x27f)](_0x102efa=>_0x102efa[_0xf81733(0x202)]);let _0x5f3eb7=_0x1ee253;const _0x3f5fc2=buildFolderIdToPathMap(_0x84972e);if(_0x27fed6){const _0x558437=_0x5f3eb7[_0xf81733(0x204)](_0x20c3c3=>_0x20c3c3[_0xf81733(0x1e2)][_0xf81733(0x283)]()===_0x27fed6['toLowerCase']());if(_0x558437['length']===0x0)return console['error']('Error:\x20Journey\x20not\x20found:\x20'+_0x27fed6),console[_0xf81733(0x2a7)](_0xf81733(0x254)),0x1;_0x5f3eb7=_0x558437;}if(_0x47fe78!==undefined){const _0x32074b=_0x5f3eb7['filter'](_0xbbfe18=>{const _0x52fcfc=_0xf81733,_0x32f5ee=_0xbbfe18[_0x52fcfc(0x278)]?_0x3f5fc2['get'](_0xbbfe18[_0x52fcfc(0x278)])||'':'';return _0x32f5ee===_0x47fe78;});if(_0x32074b[_0xf81733(0x23a)]===0x0&&_0x5f3eb7[_0xf81733(0x23a)]>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x27fed6+_0xf81733(0x26d)+(_0x47fe78||_0xf81733(0x20a))),console[_0xf81733(0x2a7)](_0xf81733(0x26e));for(const _0x5f46a2 of _0x5f3eb7){const _0x2f156c=_0x5f46a2['folderId']?_0x3f5fc2[_0xf81733(0x2bf)](_0x5f46a2[_0xf81733(0x278)])||'':'';console['error'](_0xf81733(0x1fd)+(_0x2f156c||_0xf81733(0x252))+'/'+_0x5f46a2[_0xf81733(0x1e2)]);}return 0x1;}_0x5f3eb7=_0x32074b;}if(_0x5f3eb7['length']===0x0)return console[_0xf81733(0x2a7)](_0xf81733(0x1f1)),0x0;const _0x184e2d=new Map();for(const _0x41ddfd of _0x5f3eb7){const _0x3dfa6c=_0x41ddfd['journeyBundleId'];!_0x184e2d[_0xf81733(0x1c4)](_0x3dfa6c)&&_0x184e2d['set'](_0x3dfa6c,[]),_0x184e2d[_0xf81733(0x2bf)](_0x3dfa6c)[_0xf81733(0x1cf)](_0x41ddfd);}for(const _0x87e39a of _0x184e2d[_0xf81733(0x2ae)]()){_0x87e39a[_0xf81733(0x251)]((_0x79a17f,_0x5cf6dc)=>(_0x79a17f[_0xf81733(0x2ba)]||0x0)-(_0x5cf6dc[_0xf81733(0x2ba)]||0x0));}const _0x3a58fb=[],{idToEmailMap:_0x6895cb,connectionIdToNameMap:_0x12eb01}=await withSpinner(_0xf81733(0x22c),async()=>{const _0x108cc7=_0xf81733,[_0x2e8dc9,_0x1b011a]=await Promise[_0x108cc7(0x246)]([_0x495e60['user'][_0x108cc7(0x1c7)](),_0x495e60['connection'][_0x108cc7(0x1f5)]()]);return{'idToEmailMap':_0x2e8dc9,'connectionIdToNameMap':_0x1b011a};},{'verbose':_0x1e4cc0[_0xf81733(0x1ed)]})[_0xf81733(0x27f)](_0xd18a38=>_0xd18a38[_0xf81733(0x202)]);for(const _0x5acdf6 of _0x184e2d[_0xf81733(0x2ae)]()){const _0x6b8c35=_0x5acdf6[0x0][_0xf81733(0x1e2)],_0xad770c=_0x5acdf6[0x0][_0xf81733(0x278)],_0x520279=_0xad770c?_0x3f5fc2['get'](_0xad770c)||'':'',_0x21afde=_0x520279?a26_0x51d0c5['join'](_0x5740b3,_0x520279):_0x5740b3,_0x1b2441=_0x8996bd||a26_0x51d0c5['join'](_0x21afde,sanitizeFileName(_0x6b8c35)+'.yml');let _0x4b901e,_0x2d83bd;if(existsSync(_0x1b2441))try{const _0x37c001=readFileSync(_0x1b2441,_0xf81733(0x245)),_0x5658cd=parseYamlString(_0x37c001);_0x2d83bd=_0x5658cd,_0x4b901e=buildRuleToNameMapping(_0x5658cd),_0x1c419e[_0xf81733(0x1ed)]&&_0x4b901e[_0xf81733(0x259)]>0x0&&console['error'](_0xf81733(0x1e1)+_0x4b901e[_0xf81733(0x259)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x6b8c35);}catch(_0x5990e2){_0x1c419e[_0xf81733(0x1ed)]&&console[_0xf81733(0x2a7)](_0xf81733(0x230)+_0x5990e2['message']);}const _0x39fed9=[],_0x977b52=new Set(),_0x3dc72b=new Map(),_0x70326b=new Map(),_0x30f985=new Set(),_0xc2692b=new Map(),_0x2fcf6b=new Map(),_0x418d3e=createJumpTargetCache();await withProgressSpinner(_0xf81733(0x27e)+_0x6b8c35+_0xf81733(0x271),async _0x320a8b=>{const _0xde9e66=_0xf81733;for(const _0x8cfe32 of _0x5acdf6){const _0x1ebf89=_0x5acdf6['length']>0x1?_0x8cfe32['journeyBundleName']+'\x20v'+(_0x8cfe32[_0xde9e66(0x2ba)]||0x1):_0x8cfe32['journeyBundleName'];_0x320a8b[_0xde9e66(0x2c3)]('Fetching\x20'+_0x1ebf89);const _0xcac894=await _0x495e60[_0xde9e66(0x1e8)][_0xde9e66(0x2a2)](_0x8cfe32['id']),_0x4106b5=_0xcac894[_0xde9e66(0x233)]?.[_0xde9e66(0x22f)],_0x5797fd={'resolveSegment':async _0x22a46c=>{const _0x5cf94e=_0xde9e66;if(!_0x4106b5)return{'name':_0x22a46c,'isJourneyLocal':![]};const _0x445dd5=_0x3dc72b[_0x5cf94e(0x2bf)](_0x22a46c);if(_0x445dd5)return _0x445dd5;try{const _0x285305=await _0x495e60[_0x5cf94e(0x205)][_0x5cf94e(0x1c9)](_0x4106b5,_0x22a46c),_0x32bb22=_0x285305[_0x5cf94e(0x1dc)]===SEGMENT_KIND_JOURNEY;let _0x3d2023,_0xd1d91a=_0x285305[_0x5cf94e(0x28f)];if(_0x32bb22&&_0x285305[_0x5cf94e(0x1e7)]){const _0x4c0824=await segmentResponseToDef(_0x285305,{'resolveSegmentName':async _0x351b67=>{const _0x1b0213=_0x5cf94e,_0x269a64=_0x3dc72b[_0x1b0213(0x2bf)](_0x351b67);if(_0x269a64)return _0x269a64[_0x1b0213(0x28f)];const _0x2a87c2=await _0x5797fd[_0x1b0213(0x25d)](_0x351b67);return _0x2a87c2[_0x1b0213(0x28f)];}}),_0x1cd387=_0x4c0824['rule'];_0x3d2023={'description':_0x285305[_0x5cf94e(0x244)],'rule':_0x1cd387};const _0x7f4e3c=serializeRule(_0x1cd387),_0x363adc=_0x70326b['get'](_0x7f4e3c);if(_0x363adc)_0xd1d91a=_0x363adc,_0x3d2023=undefined,_0x1c419e[_0x5cf94e(0x1ed)]&&console[_0x5cf94e(0x2a7)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x285305[_0x5cf94e(0x28f)]+_0x5cf94e(0x28c)+_0x363adc);else{let _0x505348=![];if(_0x4b901e){const _0x454fc0=_0x4b901e[_0x5cf94e(0x2bf)](_0x7f4e3c);if(_0x454fc0){const _0x428bb9=_0x454fc0['find'](_0x16dec7=>!_0x977b52[_0x5cf94e(0x1c4)](_0x16dec7));_0x428bb9&&(_0xd1d91a=_0x428bb9,_0x977b52[_0x5cf94e(0x2c0)](_0x428bb9),_0x70326b['set'](_0x7f4e3c,_0x428bb9),_0x505348=!![],_0x1c419e[_0x5cf94e(0x1ed)]&&console[_0x5cf94e(0x2a7)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x428bb9+_0x5cf94e(0x206)));}}if(!_0x505348){const _0x971a0b=generateJourneyLocalName(_0x285305['name']);_0x971a0b&&(_0xd1d91a=_0x971a0b);let _0x508461=_0xd1d91a,_0x4549a8=0x2;while(_0x977b52[_0x5cf94e(0x1c4)](_0x508461)){_0x508461=_0xd1d91a+'_'+_0x4549a8,_0x4549a8++;}_0x977b52['add'](_0x508461),_0x70326b[_0x5cf94e(0x2b2)](_0x7f4e3c,_0x508461),_0xd1d91a=_0x508461;}}}const _0xac46d={'name':_0xd1d91a,'isJourneyLocal':_0x32bb22,'definition':_0x3d2023};return _0x3dc72b[_0x5cf94e(0x2b2)](_0x22a46c,_0xac46d),_0xac46d;}catch(_0x18434b){return _0x1e4cc0[_0x5cf94e(0x1ed)]&&console[_0x5cf94e(0x2a7)](_0x5cf94e(0x2a3)+_0x22a46c+':\x20'+_0x18434b['message']),{'name':_0x22a46c,'isJourneyLocal':![]};}},'resolveActivation':async _0x5554b6=>{const _0x52f9f0=_0xde9e66,_0x596f1f=_0xc2692b[_0x52f9f0(0x2bf)](_0x5554b6);if(_0x596f1f)return _0x596f1f;try{const _0x5294e7=await _0x495e60[_0x52f9f0(0x1e8)][_0x52f9f0(0x1c8)](_0x8cfe32['id'],_0x5554b6),_0x30a2ed=journeyActivationStepToYaml(_0x5294e7,_0x6895cb,_0x12eb01),_0x2943bd=JSON[_0x52f9f0(0x1fb)]({'name':_0x30a2ed[_0x52f9f0(0x28f)],'connection':_0x30a2ed['connection'],'connector_config':_0x30a2ed[_0x52f9f0(0x26a)]}),_0x151835=_0x2fcf6b['get'](_0x2943bd);if(_0x151835){const _0x54dc75={'name':_0x151835,'isJourneyLocal':!![],'definition':_0x30a2ed};return _0xc2692b[_0x52f9f0(0x2b2)](_0x5554b6,_0x54dc75),_0x54dc75;}const _0x3428d9=_0x5294e7[_0x52f9f0(0x233)][_0x52f9f0(0x232)][_0x52f9f0(0x28f)]||_0x5554b6,_0x435c43=sanitizeYamlKey(_0x3428d9)||_0x52f9f0(0x20b)+_0x5554b6;let _0x69dd19=_0x435c43,_0x44e1d6=0x2;while(_0x30f985['has'](_0x69dd19)){_0x69dd19=_0x435c43+'_'+_0x44e1d6,_0x44e1d6++;}_0x30f985['add'](_0x69dd19),_0x2fcf6b['set'](_0x2943bd,_0x69dd19);const _0xe6f692={'name':_0x69dd19,'isJourneyLocal':!![],'definition':_0x30a2ed};return _0xc2692b[_0x52f9f0(0x2b2)](_0x5554b6,_0xe6f692),_0xe6f692;}catch(_0x26e6b6){return _0x1e4cc0[_0x52f9f0(0x1ed)]&&console[_0x52f9f0(0x2a7)](_0x52f9f0(0x27a)+_0x5554b6+':\x20'+_0x26e6b6[_0x52f9f0(0x275)]),{'name':_0x5554b6,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x5331a7,_0xfb0ae5)=>{const _0xadca4d=_0xde9e66;return resolveJumpTarget(_0x5331a7,_0xfb0ae5,_0x418d3e,_0x2a2062=>_0x495e60[_0xadca4d(0x1e8)][_0xadca4d(0x2a2)](_0x2a2062));}},_0x5a5bb8=await journeyResponseToDef(_0xcac894,_0x5797fd);_0x39fed9[_0xde9e66(0x1cf)]({'item':_0x8cfe32,'yaml':_0x5a5bb8});}},{'verbose':_0x1e4cc0[_0xf81733(0x1ed)]});const _0x17f966=await _0x495e60[_0xf81733(0x1e8)]['getLatestJourneyId'](_0x5acdf6[0x0][_0xf81733(0x1de)]),_0x253844=buildMergedJourneyDef(_0x39fed9,_0x4b901e,_0x17f966),_0x2ca230=normalizeJourneyDef(_0x253844,_0x2d83bd),_0xdb3908=toYamlString(_0x2ca230),_0x582911=_0x8996bd||a26_0x51d0c5[_0xf81733(0x2b8)](_0x21afde,sanitizeFileName(_0x6b8c35)+'.yml');!_0x8996bd&&_0x520279&&!existsSync(_0x21afde)&&mkdirSync(_0x21afde,{'recursive':!![]});const _0xa4f824=a26_0x51d0c5[_0xf81733(0x289)](process[_0xf81733(0x1fe)](),_0x582911);if(existsSync(_0x582911)){const _0x1e5819=readFileSync(_0x582911,_0xf81733(0x245)),_0x1f5ced=generateDiff(_0x1e5819,_0xdb3908),_0x16dfba=hasChanges(_0x1f5ced);_0x3a58fb['push']({'relativePath':_0xa4f824,'absolutePath':_0x582911,'content':_0xdb3908,'isNew':![],'hasChanges':_0x16dfba,'diff':_0x16dfba?formatDiffWithColors(_0x1f5ced):undefined});}else _0x3a58fb[_0xf81733(0x1cf)]({'relativePath':_0xa4f824,'absolutePath':_0x582911,'content':_0xdb3908,'isNew':!![],'hasChanges':![]});}const _0x4a6b60=_0x3a58fb[_0xf81733(0x204)](_0x4d7778=>_0x4d7778[_0xf81733(0x29e)]),_0x697fb9=_0x3a58fb[_0xf81733(0x204)](_0x440c11=>!_0x440c11[_0xf81733(0x29e)]&&_0x440c11['hasChanges']),_0x34a6c2=_0x3a58fb[_0xf81733(0x204)](_0x2d763e=>!_0x2d763e['isNew']&&!_0x2d763e[_0xf81733(0x1eb)]),_0x4c5a26=_0x5f3eb7[_0xf81733(0x23a)],_0x5787d0=_0x184e2d[_0xf81733(0x259)],_0x30a1ab=_0x4c5a26>_0x5787d0?'\x20('+_0x4c5a26+'\x20versions)':'';console[_0xf81733(0x2a7)]('\x0aPull\x20summary:'),console[_0xf81733(0x2a7)]('\x20\x20'+a26_0xd062a4[_0xf81733(0x296)](_0x5787d0+_0xf81733(0x2a4))+a26_0xd062a4[_0xf81733(0x215)](_0x30a1ab)),console[_0xf81733(0x2a7)]('\x20\x20'+a26_0xd062a4[_0xf81733(0x1d5)]('+\x20'+_0x4a6b60[_0xf81733(0x23a)]+_0xf81733(0x20c))),console[_0xf81733(0x2a7)]('\x20\x20'+a26_0xd062a4['yellow']('~\x20'+_0x697fb9['length']+_0xf81733(0x23f))),console['error']('\x20\x20'+a26_0xd062a4['dim']('=\x20'+_0x34a6c2[_0xf81733(0x23a)]+_0xf81733(0x24e))),console['error']('\x20\x20Target:\x20'+a26_0xd062a4[_0xf81733(0x296)](_0x5740b3)+'\x0a');if(_0x697fb9['length']>0x0)for(const _0x563024 of _0x697fb9){console[_0xf81733(0x2a7)](_0xf81733(0x1ca)+_0x563024[_0xf81733(0x21c)]+'\x27:'),console[_0xf81733(0x2a7)]('─'[_0xf81733(0x29d)](0x3c)),console[_0xf81733(0x2a7)](_0x563024[_0xf81733(0x211)]),console['error']('─'[_0xf81733(0x29d)](0x3c));}if(_0x1c419e[_0xf81733(0x250)])return console['error'](a26_0xd062a4['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x4a6b60[_0xf81733(0x23a)]===0x0&&_0x697fb9[_0xf81733(0x23a)]===0x0)return console[_0xf81733(0x2a7)](a26_0xd062a4['green'](_0xf81733(0x267))),saveSessionContext({'parent_segment':_0x29fb18},_0x1c419e[_0xf81733(0x1d7)]),console[_0xf81733(0x2a7)](a26_0xd062a4['green'](_0xf81733(0x1e6)+a26_0xd062a4[_0xf81733(0x215)](_0xf81733(0x24c))+_0xf81733(0x21a)+a26_0xd062a4[_0xf81733(0x296)](_0x29fb18))),0x0;if(!_0x1c419e[_0xf81733(0x284)]&&(_0x4a6b60[_0xf81733(0x23a)]>0x0||_0x697fb9[_0xf81733(0x23a)]>0x0)){if(!isInteractive())return console['error'](a26_0xd062a4[_0xf81733(0x213)](_0xf81733(0x1c3)),_0xf81733(0x273)),console[_0xf81733(0x2a7)](a26_0xd062a4['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x359ea3=await confirmKey(_0xf81733(0x212)+(_0x4a6b60['length']+_0x697fb9[_0xf81733(0x23a)])+'\x20files?');if(!_0x359ea3)return console['error'](a26_0xd062a4[_0xf81733(0x1c2)]('Aborted.'),_0xf81733(0x285)),0x1;}!existsSync(_0x5740b3)&&mkdirSync(_0x5740b3,{'recursive':!![]});const _0x4343dd=a26_0x51d0c5[_0xf81733(0x2b8)](_0x5740b3,_0xf81733(0x28a));writeFileSync(_0x4343dd,createTdxConfigContent(_0x29fb18),_0xf81733(0x245));for(const _0x2a92bd of _0x3a58fb){(_0x2a92bd[_0xf81733(0x29e)]||_0x2a92bd[_0xf81733(0x1eb)])&&writeFileSync(_0x2a92bd[_0xf81733(0x1da)],_0x2a92bd[_0xf81733(0x29f)],'utf-8');}return console[_0xf81733(0x2a7)](a26_0xd062a4[_0xf81733(0x1d5)](_0xf81733(0x1cc)+(_0x4a6b60[_0xf81733(0x23a)]+_0x697fb9['length'])+_0xf81733(0x24b)+_0x5740b3)),saveSessionContext({'parent_segment':_0x29fb18},_0x1c419e[_0xf81733(0x1d7)]),console[_0xf81733(0x2a7)](a26_0xd062a4['green']('✔\x20Context\x20set:\x20'+a26_0xd062a4[_0xf81733(0x215)](_0xf81733(0x24c))+_0xf81733(0x21a)+a26_0xd062a4[_0xf81733(0x296)](_0x29fb18))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a26_0x1da60b(0x28f)]=a26_0x1da60b(0x1ee);[a26_0x1da60b(0x244)]='Show\x20journey\x20table\x20column\x20mapping';async[a26_0x1da60b(0x2b6)](_0x5bf541){const _0x12fb51=a26_0x1da60b,{options:_0x4dac20,args:_0x5a9a98,tdx:_0x2d1572}=_0x5bf541,_0x69e872=_0x5a9a98[0x0];if(!requireNameOrPath(_0x69e872))return 0x1;_0x4dac20['verbose']&&console['error'](_0x12fb51(0x21d)+_0x69e872);const {journeyId:_0x2ea4f1}=await resolveJourneyIdFromInput(_0x69e872,_0x4dac20,_0x2d1572),_0x48e5e9=await withSpinner(_0x12fb51(0x1d6),()=>_0x2d1572['journey'][_0x12fb51(0x282)](_0x2ea4f1),{'verbose':_0x4dac20[_0x12fb51(0x1ed)]}),_0x249db4=_0x48e5e9[_0x12fb51(0x202)];return console[_0x12fb51(0x2ab)](_0x12fb51(0x1cd)+_0x249db4[_0x12fb51(0x2c1)]),console[_0x12fb51(0x2ab)](_0x12fb51(0x272)+_0x249db4[_0x12fb51(0x274)]),await handleSDKOutput(_0x249db4[_0x12fb51(0x25c)],_0x4dac20),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a26_0x1da60b(0x294);[a26_0x1da60b(0x244)]='List\x20activations\x20for\x20a\x20journey';async[a26_0x1da60b(0x2b6)](_0x245a9d){const _0x4dcd3a=a26_0x1da60b,{options:_0x4a92ed,args:_0x388abb,tdx:_0x2ae830}=_0x245a9d,_0x11748a=_0x388abb[0x0];if(!requireNameOrPath(_0x11748a))return 0x1;_0x4a92ed['verbose']&&console[_0x4dcd3a(0x2a7)](_0x4dcd3a(0x21d)+_0x11748a);const {journeyId:_0x1f89b3}=await resolveJourneyIdFromInput(_0x11748a,_0x4a92ed,_0x2ae830),_0x52f255=await withSpinner(_0x4dcd3a(0x226),()=>_0x2ae830[_0x4dcd3a(0x1e8)][_0x4dcd3a(0x1d8)](_0x1f89b3),{'verbose':_0x4a92ed[_0x4dcd3a(0x1ed)]}),_0x5f057a=_0x52f255[_0x4dcd3a(0x202)];return console['error'](_0x4dcd3a(0x1e1)+_0x5f057a[_0x4dcd3a(0x23a)]+_0x4dcd3a(0x223)+(_0x5f057a[_0x4dcd3a(0x23a)]!==0x1?'s':'')),await handleSDKOutput(_0x5f057a,_0x4a92ed),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']='journey:push';[a26_0x1da60b(0x244)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';[a26_0x1da60b(0x264)]=new SegmentPushCommand();async['execute'](_0x1b2620){const _0x23d0ca=a26_0x1da60b,_0x14a548=_0x1b2620[_0x23d0ca(0x2a6)][0x0];let _0x5483c7;if(_0x14a548){const _0x103c0a=await resolveTarget({'arg':_0x14a548,'contextParent':_0x1b2620[_0x23d0ca(0x228)][_0x23d0ca(0x2a9)],'cwd':process[_0x23d0ca(0x1fe)]()});isSuccessfulResolution(_0x103c0a)&&_0x103c0a[_0x23d0ca(0x209)]===_0x23d0ca(0x256)&&(_0x5483c7=_0x103c0a[_0x23d0ca(0x21e)]);}const _0xfabb91={..._0x1b2620,'options':{..._0x1b2620[_0x23d0ca(0x228)],'journeysOnly':!![],..._0x5483c7&&{'singleFilePath':_0x5483c7}}};return this[_0x23d0ca(0x264)][_0x23d0ca(0x2b6)](_0xfabb91);}}export class JourneyVersionsCommand extends BaseCommand{[a26_0x1da60b(0x28f)]='journey:versions';['description']=a26_0x1da60b(0x1f6);async[a26_0x1da60b(0x2b6)](_0x45473a){const _0x54b691=a26_0x1da60b,{options:_0x12a868,args:_0x7af581,tdx:_0x44a07c}=_0x45473a,_0x2c00b0=_0x7af581[0x0];if(!requireNameOrPath(_0x2c00b0))return 0x1;if(_0x12a868[_0x54b691(0x1ed)])console['error'](_0x54b691(0x21d)+_0x2c00b0);const {journeyId:_0x4614b6}=await resolveJourneyIdFromInput(_0x2c00b0,_0x12a868,_0x44a07c),_0x3bc3e4=await withSpinner(_0x54b691(0x266),()=>_0x44a07c['journey']['listVersions'](_0x4614b6),{'verbose':_0x12a868['verbose']}),{bundleName:_0x4f7dbf,versions:_0x251693,latestJourneyId:_0xf963fa}=_0x3bc3e4[_0x54b691(0x202)];console[_0x54b691(0x2a7)](_0x4f7dbf+':\x20'+_0x251693[_0x54b691(0x23a)]+_0x54b691(0x21f)+(_0x251693['length']!==0x1?'s':''));const _0x4bbfdf=_0x251693['map'](_0x25b261=>({'version':_0x25b261[_0x54b691(0x2ba)],'journey_id':_0x25b261['journeyId'],'name':_0x25b261['name'],'state':_0x25b261[_0x54b691(0x23c)],'paused':_0x25b261['paused'],'latest':_0x25b261['journeyId']===_0xf963fa,'created_at':_0x25b261[_0x54b691(0x27c)]}));return await handleSDKOutput(_0x4bbfdf,_0x12a868),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a26_0x1da60b(0x287);['description']=a26_0x1da60b(0x1fc);async[a26_0x1da60b(0x2b6)](_0x5dab6e){const _0x2c1586=a26_0x1da60b,{options:_0x264909,args:_0x5a48da,tdx:_0xd61d90}=_0x5dab6e,_0x5a8238=_0x5a48da[0x0];if(!requireNameOrPath(_0x5a8238))return 0x1;if(_0x264909[_0x2c1586(0x1ed)])console[_0x2c1586(0x2a7)](_0x2c1586(0x21d)+_0x5a8238);const {journeyId:_0x7ef9c2,journeyName:_0x5a3536}=await resolveJourneyIdFromInput(_0x5a8238,_0x264909,_0xd61d90);if(!_0x264909['yes']){const _0x388232=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x5a3536+'\x22?');if(!_0x388232)return console[_0x2c1586(0x2a7)](_0x2c1586(0x27d)),0x0;}const _0x272044=await withSpinner(_0x2c1586(0x247),()=>_0xd61d90[_0x2c1586(0x1e8)][_0x2c1586(0x2b4)](_0x7ef9c2),{'verbose':_0x264909['verbose']}),_0x41c6fb=_0x272044[_0x2c1586(0x202)];return console[_0x2c1586(0x2a7)](a26_0xd062a4[_0x2c1586(0x1d5)]('✔')+'\x20Created\x20v'+_0x41c6fb[_0x2c1586(0x233)][_0x2c1586(0x2ba)]+_0x2c1586(0x1e0)+_0x41c6fb[_0x2c1586(0x233)][_0x2c1586(0x28f)]+'\x22'),console[_0x2c1586(0x2a7)](_0x2c1586(0x260)+_0x41c6fb['id']),await handleSingleObjectOutput({'id':_0x41c6fb['id'],'name':_0x41c6fb[_0x2c1586(0x233)][_0x2c1586(0x28f)],'version':_0x41c6fb[_0x2c1586(0x233)][_0x2c1586(0x2ba)],'state':_0x41c6fb[_0x2c1586(0x233)][_0x2c1586(0x23c)],'bundle_id':_0x41c6fb[_0x2c1586(0x233)][_0x2c1586(0x1de)],'created_at':_0x41c6fb[_0x2c1586(0x233)]['createdAt']},_0x264909),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a26_0x1da60b(0x28f)]=a26_0x1da60b(0x1f2);[a26_0x1da60b(0x244)]=a26_0x1da60b(0x201);async[a26_0x1da60b(0x2b6)](_0x180ad4){const _0xc6a135=a26_0x1da60b,{options:_0x1ed380,args:_0x5e1387,tdx:_0x2fafe5}=_0x180ad4,_0x2dc60c=_0x5e1387[0x0];if(!requireNameOrPath(_0x2dc60c))return 0x1;const _0x5e0ff1=_0x1ed380[_0xc6a135(0x229)];if(!_0x5e0ff1)return console[_0xc6a135(0x2a7)](_0xc6a135(0x25b)),console[_0xc6a135(0x2a7)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x2e92ca=parseInt(_0x5e0ff1,0xa);if(isNaN(_0x2e92ca)||_0x2e92ca<0x1)return console['error'](_0xc6a135(0x222)+_0x5e0ff1),0x1;if(_0x1ed380[_0xc6a135(0x1ed)])console['error'](_0xc6a135(0x21d)+_0x2dc60c+',\x20version:\x20'+_0x2e92ca);const {journeyId:_0x15ba72,parentSegmentId:_0x5db754}=await resolveJourneyIdFromInput(_0x2dc60c,_0x1ed380,_0x2fafe5),_0x215d01=await withSpinner(_0xc6a135(0x292),()=>_0x2fafe5['journey'][_0xc6a135(0x1e9)](_0x15ba72),{'verbose':_0x1ed380['verbose']}),{versions:_0x5619e2,latestJourneyId:_0x33d817}=_0x215d01['data'],_0x4734f8=_0x5619e2['find'](_0x3a3acd=>_0x3a3acd[_0xc6a135(0x2ba)]===_0x2e92ca);if(!_0x4734f8){const _0x422c3c=_0x5619e2[_0xc6a135(0x263)](_0x40bfec=>'v'+_0x40bfec[_0xc6a135(0x2ba)])[_0xc6a135(0x2b8)](',\x20');return console[_0xc6a135(0x2a7)]('Error:\x20Version\x20'+_0x2e92ca+_0xc6a135(0x270)+_0x422c3c),0x1;}const _0x23e94c=await withSpinner(_0xc6a135(0x1df)+_0x2e92ca+_0xc6a135(0x27b),()=>_0x2fafe5[_0xc6a135(0x1e8)][_0xc6a135(0x2a2)](_0x4734f8[_0xc6a135(0x224)]),{'verbose':_0x1ed380['verbose']}),_0x2ccf=_0x23e94c[_0xc6a135(0x202)],_0x5cf9bd=getConsoleNextUrl(_0x1ed380[_0xc6a135(0x240)],'/app/ps/'+_0x5db754+'/e/'+_0x4734f8[_0xc6a135(0x224)]+_0xc6a135(0x261));return await handleSingleObjectOutput({'id':_0x2ccf['id'],'name':_0x2ccf['attributes'][_0xc6a135(0x28f)],'version':_0x2ccf[_0xc6a135(0x233)][_0xc6a135(0x2ba)],'description':_0x2ccf[_0xc6a135(0x233)][_0xc6a135(0x244)],'state':_0x2ccf['attributes']['state'],'paused':_0x2ccf[_0xc6a135(0x233)]['paused'],'reentry_mode':_0x2ccf[_0xc6a135(0x233)]['reentryMode'],'stages':_0x2ccf[_0xc6a135(0x233)][_0xc6a135(0x249)]?.[_0xc6a135(0x23a)]||0x0,..._0x2ccf[_0xc6a135(0x233)]['goal']&&{'goal':_0x2ccf[_0xc6a135(0x233)][_0xc6a135(0x248)]['name']},'latest':_0x4734f8[_0xc6a135(0x224)]===_0x33d817,'created_at':_0x2ccf['attributes']['createdAt'],'updated_at':_0x2ccf[_0xc6a135(0x233)][_0xc6a135(0x291)],'url':_0x5cf9bd},_0x1ed380),0x0;}}
1
+ const a26_0x1f2943=a26_0x3384;(function(_0x490af1,_0x36545f){const _0x5c1d36=a26_0x3384,_0x2b97bc=_0x490af1();while(!![]){try{const _0x4c5f26=-parseInt(_0x5c1d36(0xb4))/0x1*(-parseInt(_0x5c1d36(0x169))/0x2)+-parseInt(_0x5c1d36(0x178))/0x3+parseInt(_0x5c1d36(0xac))/0x4+-parseInt(_0x5c1d36(0x16d))/0x5+parseInt(_0x5c1d36(0xce))/0x6+-parseInt(_0x5c1d36(0x10f))/0x7*(parseInt(_0x5c1d36(0x93))/0x8)+-parseInt(_0x5c1d36(0xf1))/0x9;if(_0x4c5f26===_0x36545f)break;else _0x2b97bc['push'](_0x2b97bc['shift']());}catch(_0x29187a){_0x2b97bc['push'](_0x2b97bc['shift']());}}}(a26_0x36a7,0xb16cd));import a26_0x54538f from'chalk';function a26_0x36a7(){const _0x425f09=['Target\x20directory:\x20','links','\x22\x20resumed','targetDir','Table:\x20','\x0aChanges\x20to\x20\x27','Error:\x20Invalid\x20--type\x20\x22','activation','7GhKGJY','List\x20journeys\x20in\x20current\x20context','helpText','includeHistory','✔\x20Context\x20set:\x20','completed','bold','tdx.json','Listing\x20journey\x20versions...','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','\x20new\x20files','dim','\x20version','listFolders','createdAt','✔\x20Pulled\x20','map','Resuming\x20journey...','stringify','journey:pull','List\x20activations\x20for\x20a\x20journey','journey:resume','exitOrJumpRate','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','activation_','/app/ps/','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','List\x20all\x20versions\x20of\x20a\x20journey','versionNumber','database','relative','Error:\x20Stage\x20\x22','execute','connector_config','\x20\x20Journey\x20ID:\x20','\x20Created\x20v','Getting\x20column\x20mapping...','listJourneysWithFolders','getActivation','Database:\x20','green','/j/da','Getting\x20journey\x20statistics...','session','✔\x20Journey\x20\x22','listVersions','Warning:\x20Could\x20not\x20resolve\x20segment\x20','relativePath','error','version','filter','exitOrJumpSize','INVALID_ARGUMENT','base','getLatestJourneyId','sort','length','state','reentryMode','values','jsonl','replace','dryRun','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','\x20(draft)\x20—\x20\x22','renderStats','pause','conversion','message','/j/da/je','Resolving\x20journey...','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','errorCode','description','kind','join','format','Fetching\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','(paused)','journeyId','filePath','buildIdToEmailMap','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','paused','Listing\x20journey\x20activations...','\x20\x20Consolidating\x20duplicate\x20segment:\x20','✔\x20Found\x20','\x20journey','690346ahbNtD','journeyBundleId','site','goalSize','5371825dIFoHm','blue','Pattern:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','no_parent','updatedAt','Show\x20journey\x20details','folderId','completionRate','Pause\x20a\x20running\x20journey','attributes','1525770GftyuU','folders','No\x20journeys\x20found','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','📁\x20','segments','utf-8','.yml','\x20\x20Parent\x20segment:\x20','diff','split','all','goal','folderPath','(root)','resolveParentId','args','setPhase','launched','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20journeys','json','parentSegment','audienceId','\x20journey\x20files\x20to\x20','rule','draft','hasChanges','Write\x20','\x20(ID:\x20','user','milestoneSize','Cancelled','history','repeat','journeyStages','\x20\x20Name:\x20','set','4557488LsEjQc','journey','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Getting\x20journey\x20details...','\x20\x20Preserving\x20local\x20segment\x20name:\x20','getParentFull','listJourneysFromParentSegment','localeCompare','journey:activations','Journey\x20name:\x20','table','push','\x20not\x20found.\x20Available:\x20','/e/','\x0aPull\x20summary:','No\x20statistics\x20available\x20for\x20journey:\x20','options',',\x20version:\x20','has','getStatistics','\x20\x20Statistics\x20not\x20available','\x20\x20Target:\x20','Fetching\x20journeys\x20and\x20folders...','Resolving\x20parent\x20segment...','Error:\x20Journey\x20\x27','5395340rbkFDM','Options:','cwd','Listing\x20journeys...','Folder\x20path:\x20','Export\x20journey(s)\x20as\x20YAML\x20files','test','yes','2IlGcPR','verbose','journey:push','cyan','size','file','journeys','getJourney','type','completeMilestoneRate','get','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','enteredSize','\x20\x20-\x20','\x20=\x20','log','(completed)','then','parent_segment','Parent\x20segment:\x20','from','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','includeStats','journey:stats','journey:versions','yellow','7060818CmiKkf','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Input:\x20','resolveSegment','activationParams','entries','(archived)','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20Opening\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Found\x20','stages','Show\x20journey\x20statistics','getSegment','resolveJourneyId','getColumnMapping','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','journey:columns','Getting\x20version\x20','connection','journey:version:view','isNew','find','journeyBundleName','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','journey:view','Fetching\x20users\x20and\x20connections...','listActivationsFlat','Pausing\x20journey...','content','🗺️\x20','segment','\x20changed\x20files','web','3029490tLOgOw','journey:pause','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','-\x20no\x20files\x20written','createVersion','name','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','toLowerCase','hasPeriod','stageNameMap','data','\x20files?','Error:\x20--version\x20option\x20is\x20required','segmentName','Getting\x20journey\x20traffic\x20data...','\x20->\x20','\x22\x20paused','Error:\x20','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','\x20\x20Folder\x20path:\x20','add','(draft)'];a26_0x36a7=function(){return _0x425f09;};return a26_0x36a7();}import a26_0x4622ae from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x58dd8b){const _0x28d469=a26_0x3384;return!_0x58dd8b&&(console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x28d469(0x13f)](_0x28d469(0x126))),!!_0x58dd8b;}function withJsonFormat(_0x364ac8){const _0x3e81b6=a26_0x3384;if(!_0x364ac8['format']&&!_0x364ac8[_0x3e81b6(0x82)]&&!_0x364ac8[_0x3e81b6(0x14b)]&&!_0x364ac8['tsv'])return{..._0x364ac8,'format':_0x3e81b6(0x82),'json':!![]};return _0x364ac8;}function formatJourneyState(_0x428333){const _0x436f30=a26_0x3384;switch(_0x428333){case _0x436f30(0x7e):return a26_0x54538f['green']('(running)');case _0x436f30(0x87):return a26_0x54538f['dim'](_0x436f30(0x106));case _0x436f30(0x164):return a26_0x54538f[_0x436f30(0xcd)](_0x436f30(0x15e));case _0x436f30(0x114):return a26_0x54538f[_0x436f30(0x16e)](_0x436f30(0xc4));case'archived':return a26_0x54538f['dim'](_0x436f30(0xd4));default:return'('+_0x428333+')';}}function formatJourneyItem(_0x302838,_0x137d5f='',_0x3eeabf){const _0x1f3d4e=a26_0x3384,_0x1b858e=formatJourneyState(_0x302838[_0x1f3d4e(0x148)]),_0x59d457=_0x3eeabf?hyperlink(_0x302838['journeyBundleName'],_0x3eeabf):_0x302838['journeyBundleName'];return _0x137d5f+_0x1f3d4e(0xed)+_0x59d457+'\x20'+_0x1b858e;}function escapeRegex(_0x382f60){const _0x3bbf44=a26_0x3384;return _0x382f60[_0x3bbf44(0x14c)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x27f732){const _0xe42a4f=a26_0x3384,_0x5d4cd6=_0x27f732[_0xe42a4f(0x182)]('*')[_0xe42a4f(0x11f)](escapeRegex);return new RegExp(_0x5d4cd6['join']('.*'),'i');}function buildRuleToNameMapping(_0x1cdee6){const _0x29ddc7=a26_0x3384,_0x105560=new Map();if(_0x1cdee6['segments'])for(const [_0xe96b88,_0x5d0b62]of Object[_0x29ddc7(0xd3)](_0x1cdee6[_0x29ddc7(0x17d)])){if(_0x5d0b62['rule']){const _0x8bb198=serializeRule(_0x5d0b62[_0x29ddc7(0x86)]),_0x4b5e6b=_0x105560[_0x29ddc7(0xbe)](_0x8bb198);_0x4b5e6b?_0x4b5e6b[_0x29ddc7(0x9e)](_0xe96b88):_0x105560[_0x29ddc7(0x92)](_0x8bb198,[_0xe96b88]);}}return _0x105560;}async function resolveJourneyIdFromInput(_0x5ad562,_0x37b563,_0x232015){const _0x32c0a2=a26_0x3384,_0x62a615=await resolveJourneyTarget(_0x5ad562,_0x37b563[_0x32c0a2(0x83)],_0x37b563[_0x32c0a2(0xb5)]),_0x963a0e=_0x62a615[_0x32c0a2(0x83)];if(!_0x963a0e)throw new SDKError(ErrorCode[_0x32c0a2(0x143)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x5dc434=await withSpinner(_0x32c0a2(0xaa),()=>_0x232015['segment'][_0x32c0a2(0x7b)](_0x963a0e),{'verbose':_0x37b563[_0x32c0a2(0xb5)]}),_0x4a600b=_0x5dc434[_0x32c0a2(0xfb)],_0x3ad48b=await withSpinner(_0x32c0a2(0x155),()=>_0x232015[_0x32c0a2(0x94)][_0x32c0a2(0xdc)](_0x4a600b,_0x62a615['journeyName']),{'verbose':_0x37b563['verbose']});return{'journeyId':_0x3ad48b[_0x32c0a2(0xfb)],'journeyName':_0x62a615['journeyName'],'parentSegmentId':_0x4a600b};}async function resolveJourneyTarget(_0x240206,_0x4b6c0f,_0xc2405){const _0x3b814c=a26_0x3384;if(isYamlFilePath(_0x240206))try{const _0x3498bc=await resolveYamlFilePath(_0x240206);return _0xc2405&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0x240206),console[_0x3b814c(0x13f)](_0x3b814c(0x180)+_0x3498bc['parentSegment']),console[_0x3b814c(0x13f)](_0x3b814c(0x91)+_0x3498bc[_0x3b814c(0xfe)]),console[_0x3b814c(0x13f)](_0x3b814c(0x104)+(_0x3498bc[_0x3b814c(0x79)]||_0x3b814c(0x7a)))),{'journeyName':_0x3498bc[_0x3b814c(0xfe)],'parentSegment':_0x3498bc[_0x3b814c(0x83)],'resolved':_0x3498bc};}catch(_0x496baf){throw new SDKError(ErrorCode[_0x3b814c(0x143)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x496baf[_0x3b814c(0x153)]);}if(!_0x4b6c0f)throw new SDKError(ErrorCode[_0x3b814c(0x143)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x240206,'parentSegment':_0x4b6c0f};}export class JourneyListCommand extends BaseCommand{[a26_0x1f2943(0xf6)]='journey:list';[a26_0x1f2943(0x158)]=a26_0x1f2943(0x110);async[a26_0x1f2943(0x12f)](_0x938723){const _0x4cfe59=a26_0x1f2943,{options:_0x41ba82,args:_0xb77569,tdx:_0x4c5a13}=_0x938723,_0x36ac8=_0xb77569[0x0],_0x13b9f6=_0x41ba82[_0x4cfe59(0x83)];if(!_0x13b9f6)return console[_0x4cfe59(0x13f)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x4cfe59(0x13f)](_0x4cfe59(0x129)),0x1;const _0xb3f1b7=await withSpinner(_0x4cfe59(0xaa),()=>_0x4c5a13[_0x4cfe59(0xee)]['resolveParentId'](_0x13b9f6),{'verbose':_0x41ba82[_0x4cfe59(0xb5)]}),_0x5857f5=_0xb3f1b7[_0x4cfe59(0xfb)];_0x41ba82[_0x4cfe59(0xb5)]&&(console[_0x4cfe59(0x13f)]('Parent\x20segment:\x20'+_0x13b9f6+_0x4cfe59(0x8a)+_0x5857f5+')'),_0x36ac8&&console[_0x4cfe59(0x13f)](_0x4cfe59(0x16f)+_0x36ac8));const _0x5ebfef=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x4c5a13['segment'][_0x4cfe59(0x98)](_0x5857f5),{'verbose':_0x41ba82[_0x4cfe59(0xb5)]}),_0x1585dd=_0x5ebfef[_0x4cfe59(0xfb)],_0x436b92=_0x1585dd['rootFolderId'],_0x4ce539=await withSpinner(_0x4cfe59(0xaf),()=>_0x4c5a13[_0x4cfe59(0x94)][_0x4cfe59(0x134)](_0x5857f5,_0x436b92),{'verbose':_0x41ba82[_0x4cfe59(0xb5)]});let _0x573b6b=_0x4ce539[_0x4cfe59(0xfb)][_0x4cfe59(0xba)];const _0x55fd71=_0x4ce539['data'][_0x4cfe59(0x179)],_0x5a72ff=new Map();for(const _0x4a9ad6 of _0x55fd71){_0x5a72ff[_0x4cfe59(0x92)](_0x4a9ad6['id'],_0x4a9ad6[_0x4cfe59(0xf6)]);}if(_0x36ac8){const _0x1341d5=globToRegex(_0x36ac8);_0x573b6b=_0x573b6b[_0x4cfe59(0x141)](_0x3c4069=>_0x1341d5[_0x4cfe59(0xb2)](_0x3c4069[_0x4cfe59(0xe6)]));}console['error'](_0x4cfe59(0x167)+_0x573b6b[_0x4cfe59(0x147)]+_0x4cfe59(0x168)+(_0x573b6b[_0x4cfe59(0x147)]!==0x1?'s':''));const _0x17b9a6=_0x27a837=>{const _0x3d27b5=_0x4cfe59;return getConsoleNextUrl(_0x41ba82['site'],_0x3d27b5(0x128)+_0x5857f5+_0x3d27b5(0xa0)+_0x27a837+_0x3d27b5(0x138));};if(_0x41ba82[_0x4cfe59(0x15b)]===_0x4cfe59(0x9d))await handleSDKOutput(_0x573b6b,_0x41ba82);else{if(_0x41ba82[_0x4cfe59(0x15b)]===_0x4cfe59(0x82)){const _0xfe3ad1=_0x573b6b[_0x4cfe59(0x11f)](_0x2e5bbd=>({..._0x2e5bbd,'url':_0x17b9a6(_0x2e5bbd['id'])}));await handleSDKOutput(_0xfe3ad1,_0x41ba82);}else{console[_0x4cfe59(0xc3)]('['+_0x13b9f6+']');const _0x338851=new Map(),_0x1f2b6a=[];for(const _0x485f12 of _0x573b6b){if(!_0x485f12[_0x4cfe59(0x174)]||_0x485f12[_0x4cfe59(0x174)]===_0x436b92)_0x1f2b6a[_0x4cfe59(0x9e)](_0x485f12);else{const _0x358d38=_0x338851['get'](_0x485f12[_0x4cfe59(0x174)])||[];_0x358d38[_0x4cfe59(0x9e)](_0x485f12),_0x338851[_0x4cfe59(0x92)](_0x485f12[_0x4cfe59(0x174)],_0x358d38);}}const _0x41ef1e=(_0x19cc19,_0x20d7a4)=>_0x19cc19['journeyBundleName'][_0x4cfe59(0x9a)](_0x20d7a4[_0x4cfe59(0xe6)],undefined,{'sensitivity':_0x4cfe59(0x144)});_0x1f2b6a['sort'](_0x41ef1e);for(const _0x436c3e of _0x1f2b6a){console[_0x4cfe59(0xc3)](formatJourneyItem(_0x436c3e,'',_0x17b9a6(_0x436c3e['id'])));}const _0x2c040e=[..._0x338851['entries']()][_0x4cfe59(0x146)]((_0x29bd26,_0x108d57)=>{const _0x108177=_0x4cfe59,_0x3f0028=_0x5a72ff[_0x108177(0xbe)](_0x29bd26[0x0])||_0x29bd26[0x0],_0x293409=_0x5a72ff[_0x108177(0xbe)](_0x108d57[0x0])||_0x108d57[0x0];return _0x3f0028[_0x108177(0x9a)](_0x293409,undefined,{'sensitivity':'base'});});for(const [_0x37a20f,_0x419f9d]of _0x2c040e){const _0x5f8c0e=_0x5a72ff[_0x4cfe59(0xbe)](_0x37a20f)||_0x37a20f;console['log'](_0x4cfe59(0x17c)+_0x5f8c0e),_0x419f9d[_0x4cfe59(0x146)](_0x41ef1e);for(const _0x14371b of _0x419f9d){console[_0x4cfe59(0xc3)](formatJourneyItem(_0x14371b,'\x20\x20',_0x17b9a6(_0x14371b['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a26_0x1f2943(0xe8);[a26_0x1f2943(0x158)]=a26_0x1f2943(0x173);async[a26_0x1f2943(0x12f)](_0x56fe4c){const _0x306e00=a26_0x1f2943,{options:_0x6a1b7,args:_0x30dd53,tdx:_0x474580}=_0x56fe4c,_0x2195e0=_0x30dd53[0x0];if(!_0x2195e0)return console[_0x306e00(0x13f)](_0x306e00(0xdf)),console[_0x306e00(0x13f)](_0x306e00(0x103)),console[_0x306e00(0x13f)](_0x306e00(0xad)),console[_0x306e00(0x13f)](_0x306e00(0x17b)),0x1;_0x6a1b7[_0x306e00(0xb5)]&&console[_0x306e00(0x13f)]('Input:\x20'+_0x2195e0);const {journeyId:_0x23cd91,parentSegmentId:_0x5a6c58}=await resolveJourneyIdFromInput(_0x2195e0,_0x6a1b7,_0x474580);if(_0x6a1b7[_0x306e00(0xf0)]){const _0x5ecc32=getConsoleNextUrl(_0x6a1b7[_0x306e00(0x16b)],_0x306e00(0x128)+_0x5a6c58+_0x306e00(0xa0)+_0x23cd91+_0x306e00(0x154));return console[_0x306e00(0x13f)](a26_0x54538f[_0x306e00(0x137)]('✔')+_0x306e00(0xd6)+a26_0x54538f['cyan'](_0x5ecc32)),openBrowser(_0x5ecc32),0x0;}const _0x497e04=await withSpinner(_0x306e00(0x96),()=>_0x474580['journey'][_0x306e00(0xbb)](_0x23cd91),{'verbose':_0x6a1b7[_0x306e00(0xb5)]}),_0x54a6f0=_0x497e04[_0x306e00(0xfb)],_0x48add6=_0x6a1b7[_0x306e00(0xca)];let _0x1b7d02;if(_0x48add6)try{const _0x29691c=await withSpinner(_0x306e00(0x139),()=>_0x474580[_0x306e00(0x94)]['getStatistics'](_0x23cd91),{'verbose':_0x6a1b7['verbose']});_0x1b7d02=_0x29691c['data'];}catch{_0x6a1b7[_0x306e00(0xb5)]&&console[_0x306e00(0x13f)](_0x306e00(0xa7));}const _0x49f681=getConsoleNextUrl(_0x6a1b7[_0x306e00(0x16b)],_0x306e00(0x128)+_0x5a6c58+_0x306e00(0xa0)+_0x23cd91+_0x306e00(0x154)),_0x1a0079={'id':_0x54a6f0['id'],'name':_0x54a6f0[_0x306e00(0x177)][_0x306e00(0xf6)],'description':_0x54a6f0[_0x306e00(0x177)][_0x306e00(0x158)],'state':_0x54a6f0[_0x306e00(0x177)][_0x306e00(0x148)],'paused':_0x54a6f0[_0x306e00(0x177)][_0x306e00(0x164)],'reentry_mode':_0x54a6f0['attributes'][_0x306e00(0x149)],'stages':_0x54a6f0[_0x306e00(0x177)][_0x306e00(0x90)]?.[_0x306e00(0x147)]||0x0,..._0x54a6f0[_0x306e00(0x177)][_0x306e00(0x78)]&&{'goal':_0x54a6f0['attributes'][_0x306e00(0x78)]['name']},..._0x1b7d02&&{'statistics':{'size':_0x1b7d02[_0x306e00(0xb8)],'entered':_0x1b7d02[_0x306e00(0xc0)],'goal_achieved':_0x1b7d02[_0x306e00(0x16c)],'completion_rate':_0x1b7d02[_0x306e00(0x175)],'exit_or_jump':_0x1b7d02[_0x306e00(0x142)],'exit_or_jump_rate':_0x1b7d02[_0x306e00(0x125)],'stages':_0x1b7d02[_0x306e00(0xd9)]}},'url':_0x49f681};return await handleSingleObjectOutput(_0x1a0079,_0x6a1b7),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a26_0x1f2943(0xf6)]=a26_0x1f2943(0xcb);[a26_0x1f2943(0x158)]=a26_0x1f2943(0xda);async[a26_0x1f2943(0x12f)](_0x113108){const _0xd8fb71=a26_0x1f2943,{options:_0xda035e,args:_0x569ced,tdx:_0xde8bcd}=_0x113108,_0xe068f3=_0x569ced[0x0];if(!requireNameOrPath(_0xe068f3))return 0x1;_0xda035e[_0xd8fb71(0xb5)]&&console[_0xd8fb71(0x13f)](_0xd8fb71(0xd0)+_0xe068f3);const _0x1b5896=_0xda035e,_0x23d891=_0x1b5896[_0xd8fb71(0xc8)],_0x5bfb81=_0x1b5896['to'],_0x4aeb5f=_0x1b5896[_0xd8fb71(0x112)],_0x21817e=_0x1b5896['stage'];_0x4aeb5f&&!_0x23d891&&!_0x5bfb81&&console[_0xd8fb71(0x13f)](_0xd8fb71(0xcf));const _0x302ed1=_0x4aeb5f?withJsonFormat(_0xda035e):_0xda035e,{journeyId:_0x392356,journeyName:_0x1eba9b}=await resolveJourneyIdFromInput(_0xe068f3,_0x302ed1,_0xde8bcd),_0xdb6932=_0x23d891||_0x5bfb81?{'from':_0x23d891,'to':_0x5bfb81}:undefined,_0x15540f=await withSpinner(_0xd8fb71(0x139),()=>Promise['all']([_0xde8bcd[_0xd8fb71(0x94)][_0xd8fb71(0xbb)](_0x392356),_0xde8bcd[_0xd8fb71(0x94)][_0xd8fb71(0xa6)](_0x392356,_0xdb6932)]),{'verbose':_0x302ed1[_0xd8fb71(0xb5)]}),[_0xc1bb74,_0x174127]=_0x15540f['data'];if(!_0x174127||_0x174127[_0xd8fb71(0x15f)]===null)return console[_0xd8fb71(0x13f)](_0xd8fb71(0xa2)+_0x1eba9b),console[_0xd8fb71(0x13f)](_0xd8fb71(0xc9)),0x0;const _0xe7314d=buildStageNameMap(_0xc1bb74),_0x258c54=!!(_0xdb6932&&_0x174127['history']?.[_0xd8fb71(0x147)]),_0x3d0357={'stageNameMap':_0xe7314d,'hasPeriod':_0x258c54,'includeHistory':!!_0x4aeb5f};if(_0x21817e&&_0x174127[_0xd8fb71(0xd9)]){const _0x13e399=_0x174127[_0xd8fb71(0xd9)]['find'](_0xd9bcf2=>{const _0x4dcf36=_0xd8fb71,_0x5ad380=_0xe7314d[_0x4dcf36(0xbe)](_0xd9bcf2['id'])??'';return _0x5ad380[_0x4dcf36(0xf8)]()===_0x21817e[_0x4dcf36(0xf8)]();});if(_0x13e399)return await handleSingleObjectOutput(formatStageStats(_0x13e399,_0x3d0357),_0x302ed1),0x0;const _0x4eee59=_0x174127[_0xd8fb71(0xd9)][_0xd8fb71(0x11f)](_0xebf1fe=>_0xe7314d[_0xd8fb71(0xbe)](_0xebf1fe['id'])??_0xebf1fe['id']);return console[_0xd8fb71(0x13f)](_0xd8fb71(0x12e)+_0x21817e+'\x22\x20not\x20found'),console['error']('Available\x20stages:\x20'+_0x4eee59[_0xd8fb71(0x15a)](',\x20')),0x1;}const _0x19a4bc=_0x174127['stages']?.['map'](_0x4153f4=>formatStageStats(_0x4153f4,_0x3d0357)),_0x218578=assembleJourneyStats(_0x174127,{'from':_0x23d891,'to':_0x5bfb81,'includeHistory':_0x4aeb5f});return await this[_0xd8fb71(0x150)](_0x218578,_0x19a4bc??[],_0x302ed1),0x0;}async[a26_0x1f2943(0x150)](_0x114115,_0x2d2402,_0x6b8cbe){const _0x1332a5=a26_0x1f2943,_0x2a20ee=_0x6b8cbe['format']==='json'||_0x6b8cbe[_0x1332a5(0x15b)]===_0x1332a5(0x14b)||_0x6b8cbe[_0x1332a5(0x82)]||_0x6b8cbe[_0x1332a5(0x14b)];if(_0x2a20ee){_0x114115[_0x1332a5(0xd9)]=_0x2d2402,await handleSingleObjectOutput(_0x114115,_0x6b8cbe);return;}await handleSingleObjectOutput(_0x114115,_0x6b8cbe);for(const _0x56ea0c of _0x2d2402){console[_0x1332a5(0xc3)](''),console[_0x1332a5(0xc3)](String(a26_0x54538f[_0x1332a5(0xb7)][_0x1332a5(0x115)]('['+_0x56ea0c[_0x1332a5(0xf6)]+']'))+a26_0x54538f[_0x1332a5(0x11a)]('\x20'+_0x56ea0c['id']));const {id:_0x389438,name:_0x84f0f5,..._0x1f93be}=_0x56ea0c;await handleSingleObjectOutput(_0x1f93be,_0x6b8cbe);}}}export class JourneyTrafficCommand extends BaseCommand{[a26_0x1f2943(0xf6)]='journey:traffic';[a26_0x1f2943(0x158)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async['execute'](_0x59a5fa){const _0x5600ea=a26_0x1f2943,{options:_0x3cfc37,args:_0x6cba6a,tdx:_0x4b33c1}=_0x59a5fa,_0x147f49=_0x6cba6a[0x0];if(!requireNameOrPath(_0x147f49))return 0x1;_0x3cfc37['verbose']&&console[_0x5600ea(0x13f)](_0x5600ea(0xd0)+_0x147f49);const _0x5cdbf5=_0x3cfc37,_0x26e660=_0x5cdbf5[_0x5600ea(0xbc)],_0x3536cc=_0x5cdbf5[_0x5600ea(0xc8)],_0x1f1791=_0x5cdbf5['to'],_0x31f1aa=_0x5cdbf5['limit'];if(_0x26e660&&_0x26e660!=='conversion'&&_0x26e660!=='activation')return console[_0x5600ea(0x13f)](_0x5600ea(0x10d)+_0x26e660+_0x5600ea(0x162)),0x1;const _0x2020d7=withJsonFormat(_0x3cfc37),{journeyId:_0x1957ed,journeyName:_0x49c515}=await resolveJourneyIdFromInput(_0x147f49,_0x2020d7,_0x4b33c1),_0x4d37d7={'type':_0x26e660,'from':_0x3536cc,'to':_0x1f1791,'limit':_0x31f1aa},_0x14635b=await withSpinner(_0x5600ea(0xff),()=>_0x4b33c1[_0x5600ea(0x94)]['getTrafficData'](_0x1957ed,_0x4d37d7),{'verbose':_0x2020d7[_0x5600ea(0xb5)]}),_0x5f547a=_0x14635b[_0x5600ea(0xfb)],_0x2ebd7b=_0x5f547a['conversion']&&(_0x5f547a['conversion']['nodes'][_0x5600ea(0x147)]>0x0||_0x5f547a[_0x5600ea(0x152)][_0x5600ea(0x108)][_0x5600ea(0x147)]>0x0),_0x512a79=_0x5f547a[_0x5600ea(0x10e)]&&_0x5f547a[_0x5600ea(0x10e)][_0x5600ea(0x147)]>0x0;if(!_0x2ebd7b&&!_0x512a79)return console[_0x5600ea(0x13f)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x49c515),console['error'](_0x5600ea(0xd5)),_0x3536cc&&_0x1f1791&&console['error'](_0x5600ea(0xf3)),0x0;return await handleSingleObjectOutput(_0x5f547a,_0x2020d7),0x0;}}function formatStageStats(_0x395ea4,_0x3aacd6){const _0x52d784=a26_0x1f2943,_0x135540=_0x3aacd6['hasPeriod']&&_0x395ea4[_0x52d784(0x8e)]?.['length']?aggregateStageHistory(_0x395ea4[_0x52d784(0x8e)]):{'size':_0x395ea4[_0x52d784(0xb8)],'entered':_0x395ea4[_0x52d784(0xc0)],'milestone':_0x395ea4[_0x52d784(0x8c)],'milestone_rate':_0x395ea4[_0x52d784(0xbd)],'exit_or_jump':_0x395ea4[_0x52d784(0x142)],'exit_or_jump_rate':_0x395ea4['exitOrJumpRate']},_0x5263c4={'id':_0x395ea4['id'],'name':_0x3aacd6[_0x52d784(0xfa)][_0x52d784(0xbe)](_0x395ea4['id'])??_0x395ea4['id'],..._0x135540};return _0x3aacd6[_0x52d784(0xf9)]&&_0x3aacd6[_0x52d784(0x112)]&&_0x395ea4['history']&&(_0x5263c4['history']=_0x395ea4[_0x52d784(0x8e)]),_0x5263c4;}function a26_0x3384(_0x30ed0b,_0x47e5dd){_0x30ed0b=_0x30ed0b-0x77;const _0x36a720=a26_0x36a7();let _0x3384a3=_0x36a720[_0x30ed0b];return _0x3384a3;}export class JourneyPauseCommand extends BaseCommand{[a26_0x1f2943(0xf6)]=a26_0x1f2943(0xf2);['description']=a26_0x1f2943(0x176);async[a26_0x1f2943(0x12f)](_0x36d3e1){const _0x3b505a=a26_0x1f2943,{options:_0x4495f8,args:_0x2e003b,tdx:_0x5485af}=_0x36d3e1,_0x2a9e62=_0x2e003b[0x0];if(!requireNameOrPath(_0x2a9e62))return 0x1;_0x4495f8[_0x3b505a(0xb5)]&&console[_0x3b505a(0x13f)](_0x3b505a(0xd0)+_0x2a9e62);const {journeyId:_0x4e850c,journeyName:_0x42b3b5}=await resolveJourneyIdFromInput(_0x2a9e62,_0x4495f8,_0x5485af);if(!_0x4495f8[_0x3b505a(0xb3)]){const _0x277966=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x42b3b5+'\x22?');if(!_0x277966)return console['error'](_0x3b505a(0x8d)),0x0;}const _0x59a40a=await withSpinner(_0x3b505a(0xeb),()=>_0x5485af[_0x3b505a(0x94)][_0x3b505a(0x151)](_0x4e850c),{'verbose':_0x4495f8[_0x3b505a(0xb5)]}),_0x135261=_0x59a40a[_0x3b505a(0xfb)];return console[_0x3b505a(0x13f)](_0x3b505a(0x13b)+_0x135261[_0x3b505a(0x177)]['name']+_0x3b505a(0x101)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a26_0x1f2943(0xf6)]=a26_0x1f2943(0x124);['description']='Resume\x20a\x20paused\x20journey';async[a26_0x1f2943(0x12f)](_0x1ce487){const _0x82492=a26_0x1f2943,{options:_0x3ad323,args:_0x219cfc,tdx:_0x329f81}=_0x1ce487,_0x5861d7=_0x219cfc[0x0];if(!requireNameOrPath(_0x5861d7))return 0x1;_0x3ad323[_0x82492(0xb5)]&&console[_0x82492(0x13f)](_0x82492(0xd0)+_0x5861d7);const {journeyId:_0x4e9380,journeyName:_0x5b78d1}=await resolveJourneyIdFromInput(_0x5861d7,_0x3ad323,_0x329f81);if(!_0x3ad323[_0x82492(0xb3)]){const _0x5c5938=await confirm(_0x82492(0xd7)+_0x5b78d1+'\x22?');if(!_0x5c5938)return console[_0x82492(0x13f)](_0x82492(0x8d)),0x0;}const _0x5d4834=await withSpinner(_0x82492(0x120),()=>_0x329f81[_0x82492(0x94)]['resume'](_0x4e9380),{'verbose':_0x3ad323[_0x82492(0xb5)]}),_0x4fa2af=_0x5d4834[_0x82492(0xfb)];return console[_0x82492(0x13f)](_0x82492(0x13b)+_0x4fa2af[_0x82492(0x177)]['name']+_0x82492(0x109)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a26_0x1f2943(0x122);[a26_0x1f2943(0x158)]=a26_0x1f2943(0xb1);async['execute'](_0x5d8cc9){const _0x2c4252=a26_0x1f2943,{options:_0x227d72,args:_0x2fd729,tdx:_0xbb16ab}=_0x5d8cc9,_0x15f85e=_0x227d72,_0x34c47b=_0x2fd729[0x0],_0x5547b1=_0x34c47b&&isYamlFilePath(_0x34c47b),_0x2b8f94=await resolveTarget({'arg':_0x5547b1?_0x34c47b:undefined,'contextParent':_0x227d72[_0x2c4252(0x83)],'cwd':process[_0x2c4252(0xae)]()});if(!isSuccessfulResolution(_0x2b8f94))return _0x2b8f94[_0x2c4252(0x157)]===_0x2c4252(0x171)?(console[_0x2c4252(0x13f)](a26_0x54538f['yellow'](_0x2c4252(0xe7))),console[_0x2c4252(0x13f)](_0x2c4252(0x7f)),console[_0x2c4252(0x13f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console['error'](_0x2c4252(0x170)),console['error'](_0x2c4252(0x80))):(console[_0x2c4252(0x13f)](a26_0x54538f['red'](_0x2c4252(0x102)+_0x2b8f94[_0x2c4252(0x153)]+'\x0a')),_0x2b8f94['helpText']&&console[_0x2c4252(0x13f)](a26_0x54538f[_0x2c4252(0xb7)](_0x2b8f94[_0x2c4252(0x111)]))),0x1;let _0x25b557=_0x5547b1?undefined:_0x34c47b,_0x254944,_0x305d86;_0x2b8f94['type']===_0x2c4252(0xb9)&&(_0x25b557=_0x2b8f94['resourceName'],_0x254944=_0x2b8f94[_0x2c4252(0x160)],_0x305d86=_0x2b8f94[_0x2c4252(0x79)]);const _0x2f8ce1=_0x2b8f94['parentName'],_0x3ad230=_0x2b8f94[_0x2c4252(0x10a)];_0x15f85e[_0x2c4252(0xb5)]&&(console['error'](_0x2c4252(0xc7)+_0x2f8ce1),console['error'](_0x2c4252(0x107)+_0x3ad230),_0x25b557&&console['error'](_0x2c4252(0x9c)+_0x25b557),_0x254944&&console[_0x2c4252(0x13f)]('Target\x20file:\x20'+_0x254944),_0x305d86&&console[_0x2c4252(0x13f)](_0x2c4252(0xb0)+_0x305d86));const _0x3ae003=await withSpinner(_0x2c4252(0xaa),()=>_0xbb16ab[_0x2c4252(0xee)]['resolveParentId'](_0x2f8ce1),{'verbose':_0x227d72[_0x2c4252(0xb5)]}),_0x53efb3=_0x3ae003[_0x2c4252(0xfb)],{journeys:_0x510b0f,folders:_0x1ac91e}=await withSpinner(_0x2c4252(0xa9),async()=>{const _0x35ee20=_0x2c4252,[_0x5ee3d0,_0x4cf9ce]=await Promise[_0x35ee20(0x77)]([_0xbb16ab['journey'][_0x35ee20(0x99)](_0x53efb3,undefined,{'includeAllVersions':!![]}),_0xbb16ab[_0x35ee20(0xee)][_0x35ee20(0x11c)](_0x53efb3)]);return{'journeys':_0x5ee3d0,'folders':_0x4cf9ce};},{'verbose':_0x227d72[_0x2c4252(0xb5)]})[_0x2c4252(0xc5)](_0x4085ba=>_0x4085ba['data']);let _0x3a0c31=_0x510b0f;const _0x1c6983=buildFolderIdToPathMap(_0x1ac91e);if(_0x25b557){const _0x2f32e8=_0x3a0c31[_0x2c4252(0x141)](_0x5799d7=>_0x5799d7[_0x2c4252(0xe6)][_0x2c4252(0xf8)]()===_0x25b557[_0x2c4252(0xf8)]());if(_0x2f32e8[_0x2c4252(0x147)]===0x0)return console[_0x2c4252(0x13f)]('Error:\x20Journey\x20not\x20found:\x20'+_0x25b557),console[_0x2c4252(0x13f)](_0x2c4252(0x118)),0x1;_0x3a0c31=_0x2f32e8;}if(_0x305d86!==undefined){const _0x134158=_0x3a0c31[_0x2c4252(0x141)](_0x1332af=>{const _0x5cddbc=_0x2c4252,_0x118f87=_0x1332af['folderId']?_0x1c6983[_0x5cddbc(0xbe)](_0x1332af[_0x5cddbc(0x174)])||'':'';return _0x118f87===_0x305d86;});if(_0x134158[_0x2c4252(0x147)]===0x0&&_0x3a0c31[_0x2c4252(0x147)]>0x0){console[_0x2c4252(0x13f)](_0x2c4252(0xab)+_0x25b557+'\x27\x20not\x20found\x20in\x20'+(_0x305d86||'root\x20folder')),console['error']('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x1b2842 of _0x3a0c31){const _0x1fa1aa=_0x1b2842['folderId']?_0x1c6983[_0x2c4252(0xbe)](_0x1b2842['folderId'])||'':'';console[_0x2c4252(0x13f)](_0x2c4252(0xc1)+(_0x1fa1aa||_0x2c4252(0x7a))+'/'+_0x1b2842[_0x2c4252(0xe6)]);}return 0x1;}_0x3a0c31=_0x134158;}if(_0x3a0c31[_0x2c4252(0x147)]===0x0)return console[_0x2c4252(0x13f)](_0x2c4252(0x17a)),0x0;const _0xe4f056=new Map();for(const _0x50dc3d of _0x3a0c31){const _0xc2089c=_0x50dc3d[_0x2c4252(0x16a)];!_0xe4f056[_0x2c4252(0xa5)](_0xc2089c)&&_0xe4f056['set'](_0xc2089c,[]),_0xe4f056['get'](_0xc2089c)[_0x2c4252(0x9e)](_0x50dc3d);}for(const _0x5d44b6 of _0xe4f056['values']()){_0x5d44b6['sort']((_0x2891c7,_0x4d67ed)=>(_0x2891c7['versionNumber']||0x0)-(_0x4d67ed[_0x2c4252(0x12b)]||0x0));}const _0x222755=[],{idToEmailMap:_0x42d0aa,connectionIdToNameMap:_0x34cf94}=await withSpinner(_0x2c4252(0xe9),async()=>{const _0x14927b=_0x2c4252,[_0x261a87,_0x469714]=await Promise[_0x14927b(0x77)]([_0xbb16ab[_0x14927b(0x8b)][_0x14927b(0x161)](),_0xbb16ab['connection']['buildIdToNameMap']()]);return{'idToEmailMap':_0x261a87,'connectionIdToNameMap':_0x469714};},{'verbose':_0x227d72[_0x2c4252(0xb5)]})[_0x2c4252(0xc5)](_0xd893fd=>_0xd893fd[_0x2c4252(0xfb)]);for(const _0x57932d of _0xe4f056[_0x2c4252(0x14a)]()){const _0x30f126=_0x57932d[0x0][_0x2c4252(0xe6)],_0x491a88=_0x57932d[0x0][_0x2c4252(0x174)],_0xb0fabe=_0x491a88?_0x1c6983[_0x2c4252(0xbe)](_0x491a88)||'':'',_0x1ca72e=_0xb0fabe?a26_0x4622ae[_0x2c4252(0x15a)](_0x3ad230,_0xb0fabe):_0x3ad230,_0x26eb41=_0x254944||a26_0x4622ae[_0x2c4252(0x15a)](_0x1ca72e,sanitizeFileName(_0x30f126)+'.yml');let _0x46b6d5,_0x355e25;if(existsSync(_0x26eb41))try{const _0x13905e=readFileSync(_0x26eb41,_0x2c4252(0x17e)),_0x131906=parseYamlString(_0x13905e);_0x355e25=_0x131906,_0x46b6d5=buildRuleToNameMapping(_0x131906),_0x15f85e[_0x2c4252(0xb5)]&&_0x46b6d5[_0x2c4252(0xb8)]>0x0&&console['error'](_0x2c4252(0xd8)+_0x46b6d5[_0x2c4252(0xb8)]+_0x2c4252(0x14e)+_0x30f126);}catch(_0xf59a54){_0x15f85e['verbose']&&console[_0x2c4252(0x13f)](_0x2c4252(0xf7)+_0xf59a54[_0x2c4252(0x153)]);}const _0x51f364=[],_0x3a7990=new Set(),_0x40ca5e=new Map(),_0x324b64=new Map(),_0xc56779=new Set(),_0x1a50ad=new Map(),_0x3f69fa=new Map(),_0x569968=createJumpTargetCache();await withProgressSpinner(_0x2c4252(0x15c)+_0x30f126+'...',async _0x2ca0a5=>{const _0x327dbb=_0x2c4252;for(const _0x1cf6bd of _0x57932d){const _0x3f5268=_0x57932d[_0x327dbb(0x147)]>0x1?_0x1cf6bd[_0x327dbb(0xe6)]+'\x20v'+(_0x1cf6bd[_0x327dbb(0x12b)]||0x1):_0x1cf6bd[_0x327dbb(0xe6)];_0x2ca0a5[_0x327dbb(0x7d)](_0x327dbb(0x15c)+_0x3f5268);const _0x82b6a3=await _0xbb16ab[_0x327dbb(0x94)]['getJourney'](_0x1cf6bd['id']),_0x1a706e=_0x82b6a3[_0x327dbb(0x177)]?.[_0x327dbb(0x84)],_0x4495ca={'resolveSegment':async _0x5971ca=>{const _0x2dee3b=_0x327dbb;if(!_0x1a706e)return{'name':_0x5971ca,'isJourneyLocal':![]};const _0x1625b1=_0x40ca5e[_0x2dee3b(0xbe)](_0x5971ca);if(_0x1625b1)return _0x1625b1;try{const _0xbb2834=await _0xbb16ab[_0x2dee3b(0xee)][_0x2dee3b(0xdb)](_0x1a706e,_0x5971ca),_0x33b57f=_0xbb2834[_0x2dee3b(0x159)]===SEGMENT_KIND_JOURNEY;let _0x235566,_0x4da10a=_0xbb2834[_0x2dee3b(0xf6)];if(_0x33b57f&&_0xbb2834[_0x2dee3b(0x86)]){const _0x2eda6b=await segmentResponseToDef(_0xbb2834,{'resolveSegmentName':async _0x48a190=>{const _0x35897c=_0x2dee3b,_0x436d76=_0x40ca5e[_0x35897c(0xbe)](_0x48a190);if(_0x436d76)return _0x436d76[_0x35897c(0xf6)];const _0x193623=await _0x4495ca[_0x35897c(0xd1)](_0x48a190);return _0x193623[_0x35897c(0xf6)];}}),_0x46bdf2=_0x2eda6b['rule'];_0x235566={'description':_0xbb2834[_0x2dee3b(0x158)],'rule':_0x46bdf2};const _0x3c423e=serializeRule(_0x46bdf2),_0x25a91d=_0x324b64['get'](_0x3c423e);if(_0x25a91d)_0x4da10a=_0x25a91d,_0x235566=undefined,_0x15f85e[_0x2dee3b(0xb5)]&&console['error'](_0x2dee3b(0x166)+_0xbb2834[_0x2dee3b(0xf6)]+_0x2dee3b(0x100)+_0x25a91d);else{let _0x14b740=![];if(_0x46b6d5){const _0x4354a1=_0x46b6d5[_0x2dee3b(0xbe)](_0x3c423e);if(_0x4354a1){const _0x9a5b38=_0x4354a1['find'](_0x53aa55=>!_0x3a7990[_0x2dee3b(0xa5)](_0x53aa55));_0x9a5b38&&(_0x4da10a=_0x9a5b38,_0x3a7990[_0x2dee3b(0x105)](_0x9a5b38),_0x324b64[_0x2dee3b(0x92)](_0x3c423e,_0x9a5b38),_0x14b740=!![],_0x15f85e[_0x2dee3b(0xb5)]&&console[_0x2dee3b(0x13f)](_0x2dee3b(0x97)+_0x9a5b38+'\x20(rule\x20match)'));}}if(!_0x14b740){const _0x4a5d07=generateJourneyLocalName(_0xbb2834['name']);_0x4a5d07&&(_0x4da10a=_0x4a5d07);let _0x311650=_0x4da10a,_0x178302=0x2;while(_0x3a7990[_0x2dee3b(0xa5)](_0x311650)){_0x311650=_0x4da10a+'_'+_0x178302,_0x178302++;}_0x3a7990['add'](_0x311650),_0x324b64['set'](_0x3c423e,_0x311650),_0x4da10a=_0x311650;}}}const _0x270b74={'name':_0x4da10a,'isJourneyLocal':_0x33b57f,'definition':_0x235566};return _0x40ca5e[_0x2dee3b(0x92)](_0x5971ca,_0x270b74),_0x270b74;}catch(_0xb50cca){return _0x227d72[_0x2dee3b(0xb5)]&&console['error'](_0x2dee3b(0x13d)+_0x5971ca+':\x20'+_0xb50cca[_0x2dee3b(0x153)]),{'name':_0x5971ca,'isJourneyLocal':![]};}},'resolveActivation':async _0x399910=>{const _0x114e01=_0x327dbb,_0xc33ec7=_0x1a50ad[_0x114e01(0xbe)](_0x399910);if(_0xc33ec7)return _0xc33ec7;try{const _0x1736ac=await _0xbb16ab[_0x114e01(0x94)][_0x114e01(0x135)](_0x1cf6bd['id'],_0x399910),_0x13f80b=journeyActivationStepToYaml(_0x1736ac,_0x42d0aa,_0x34cf94),_0x236db7=JSON[_0x114e01(0x121)]({'name':_0x13f80b[_0x114e01(0xf6)],'connection':_0x13f80b[_0x114e01(0xe2)],'connector_config':_0x13f80b[_0x114e01(0x130)]}),_0x8d7cbe=_0x3f69fa[_0x114e01(0xbe)](_0x236db7);if(_0x8d7cbe){const _0x4c9fb4={'name':_0x8d7cbe,'isJourneyLocal':!![],'definition':_0x13f80b};return _0x1a50ad['set'](_0x399910,_0x4c9fb4),_0x4c9fb4;}const _0x4ed2b8=_0x1736ac[_0x114e01(0x177)][_0x114e01(0xd2)][_0x114e01(0xf6)]||_0x399910,_0x5c6760=sanitizeYamlKey(_0x4ed2b8)||_0x114e01(0x127)+_0x399910;let _0x44fce4=_0x5c6760,_0x48ca67=0x2;while(_0xc56779[_0x114e01(0xa5)](_0x44fce4)){_0x44fce4=_0x5c6760+'_'+_0x48ca67,_0x48ca67++;}_0xc56779[_0x114e01(0x105)](_0x44fce4),_0x3f69fa[_0x114e01(0x92)](_0x236db7,_0x44fce4);const _0x4edac7={'name':_0x44fce4,'isJourneyLocal':!![],'definition':_0x13f80b};return _0x1a50ad[_0x114e01(0x92)](_0x399910,_0x4edac7),_0x4edac7;}catch(_0x1ace99){return _0x227d72[_0x114e01(0xb5)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x399910+':\x20'+_0x1ace99[_0x114e01(0x153)]),{'name':_0x399910,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x1eaf21,_0x3da0a8)=>{const _0x394bb4=_0x327dbb;return resolveJumpTarget(_0x1eaf21,_0x3da0a8,_0x569968,_0x26c085=>_0xbb16ab[_0x394bb4(0x94)][_0x394bb4(0xbb)](_0x26c085));}},_0xf5ffe9=await journeyResponseToDef(_0x82b6a3,_0x4495ca);_0x51f364[_0x327dbb(0x9e)]({'item':_0x1cf6bd,'yaml':_0xf5ffe9});}},{'verbose':_0x227d72[_0x2c4252(0xb5)]});const _0x150b37=await _0xbb16ab[_0x2c4252(0x94)][_0x2c4252(0x145)](_0x57932d[0x0][_0x2c4252(0x16a)]),_0x4fe69e=buildMergedJourneyDef(_0x51f364,_0x46b6d5,_0x150b37),_0x57eb71=normalizeJourneyDef(_0x4fe69e,_0x355e25),_0x4e0f63=toYamlString(_0x57eb71),_0x1f3491=_0x254944||a26_0x4622ae[_0x2c4252(0x15a)](_0x1ca72e,sanitizeFileName(_0x30f126)+_0x2c4252(0x17f));!_0x254944&&_0xb0fabe&&!existsSync(_0x1ca72e)&&mkdirSync(_0x1ca72e,{'recursive':!![]});const _0x1c4458=a26_0x4622ae[_0x2c4252(0x12d)](process[_0x2c4252(0xae)](),_0x1f3491);if(existsSync(_0x1f3491)){const _0x441fe5=readFileSync(_0x1f3491,'utf-8'),_0x2042b7=generateDiff(_0x441fe5,_0x4e0f63),_0x409b43=hasChanges(_0x2042b7);_0x222755[_0x2c4252(0x9e)]({'relativePath':_0x1c4458,'absolutePath':_0x1f3491,'content':_0x4e0f63,'isNew':![],'hasChanges':_0x409b43,'diff':_0x409b43?formatDiffWithColors(_0x2042b7):undefined});}else _0x222755[_0x2c4252(0x9e)]({'relativePath':_0x1c4458,'absolutePath':_0x1f3491,'content':_0x4e0f63,'isNew':!![],'hasChanges':![]});}const _0x2305a5=_0x222755['filter'](_0x4ee84a=>_0x4ee84a[_0x2c4252(0xe4)]),_0x6562d2=_0x222755[_0x2c4252(0x141)](_0x221224=>!_0x221224[_0x2c4252(0xe4)]&&_0x221224['hasChanges']),_0x2cc358=_0x222755['filter'](_0x282506=>!_0x282506['isNew']&&!_0x282506['hasChanges']),_0x57c0fb=_0x3a0c31[_0x2c4252(0x147)],_0x28e5dc=_0xe4f056[_0x2c4252(0xb8)],_0x308008=_0x57c0fb>_0x28e5dc?'\x20('+_0x57c0fb+'\x20versions)':'';console[_0x2c4252(0x13f)](_0x2c4252(0xa1)),console[_0x2c4252(0x13f)]('\x20\x20'+a26_0x54538f['cyan'](_0x28e5dc+_0x2c4252(0x81))+a26_0x54538f['dim'](_0x308008)),console[_0x2c4252(0x13f)]('\x20\x20'+a26_0x54538f[_0x2c4252(0x137)]('+\x20'+_0x2305a5['length']+_0x2c4252(0x119))),console[_0x2c4252(0x13f)]('\x20\x20'+a26_0x54538f['yellow']('~\x20'+_0x6562d2[_0x2c4252(0x147)]+_0x2c4252(0xef))),console['error']('\x20\x20'+a26_0x54538f[_0x2c4252(0x11a)]('=\x20'+_0x2cc358[_0x2c4252(0x147)]+'\x20unchanged\x20files')),console[_0x2c4252(0x13f)](_0x2c4252(0xa8)+a26_0x54538f[_0x2c4252(0xb7)](_0x3ad230)+'\x0a');if(_0x6562d2[_0x2c4252(0x147)]>0x0)for(const _0xa3d75c of _0x6562d2){console[_0x2c4252(0x13f)](_0x2c4252(0x10c)+_0xa3d75c[_0x2c4252(0x13e)]+'\x27:'),console['error']('─'[_0x2c4252(0x8f)](0x3c)),console['error'](_0xa3d75c[_0x2c4252(0x181)]),console['error']('─'[_0x2c4252(0x8f)](0x3c));}if(_0x15f85e[_0x2c4252(0x14d)])return console[_0x2c4252(0x13f)](a26_0x54538f[_0x2c4252(0xcd)](_0x2c4252(0xbf))),0x0;if(_0x2305a5[_0x2c4252(0x147)]===0x0&&_0x6562d2[_0x2c4252(0x147)]===0x0)return console[_0x2c4252(0x13f)](a26_0x54538f['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x2f8ce1},_0x15f85e['session']),console['error'](a26_0x54538f[_0x2c4252(0x137)](_0x2c4252(0x113)+a26_0x54538f[_0x2c4252(0x11a)](_0x2c4252(0xc6))+_0x2c4252(0xc2)+a26_0x54538f[_0x2c4252(0xb7)](_0x2f8ce1))),0x0;if(!_0x15f85e[_0x2c4252(0xb3)]&&(_0x2305a5['length']>0x0||_0x6562d2[_0x2c4252(0x147)]>0x0)){if(!isInteractive())return console['error'](a26_0x54538f['red']('\x0aError:'),_0x2c4252(0x95)),console[_0x2c4252(0x13f)](a26_0x54538f['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x39b51f=await confirmKey(_0x2c4252(0x89)+(_0x2305a5['length']+_0x6562d2[_0x2c4252(0x147)])+_0x2c4252(0xfc));if(!_0x39b51f)return console[_0x2c4252(0x13f)](a26_0x54538f[_0x2c4252(0xcd)]('Aborted.'),_0x2c4252(0xf4)),0x1;}!existsSync(_0x3ad230)&&mkdirSync(_0x3ad230,{'recursive':!![]});const _0x5d744a=a26_0x4622ae[_0x2c4252(0x15a)](_0x3ad230,_0x2c4252(0x116));writeFileSync(_0x5d744a,createTdxConfigContent(_0x2f8ce1),_0x2c4252(0x17e));for(const _0x301f38 of _0x222755){(_0x301f38[_0x2c4252(0xe4)]||_0x301f38[_0x2c4252(0x88)])&&writeFileSync(_0x301f38['absolutePath'],_0x301f38[_0x2c4252(0xec)],'utf-8');}return console[_0x2c4252(0x13f)](a26_0x54538f['green'](_0x2c4252(0x11e)+(_0x2305a5['length']+_0x6562d2[_0x2c4252(0x147)])+_0x2c4252(0x85)+_0x3ad230)),saveSessionContext({'parent_segment':_0x2f8ce1},_0x15f85e[_0x2c4252(0x13a)]),console[_0x2c4252(0x13f)](a26_0x54538f[_0x2c4252(0x137)]('✔\x20Context\x20set:\x20'+a26_0x54538f['dim'](_0x2c4252(0xc6))+'\x20=\x20'+a26_0x54538f['cyan'](_0x2f8ce1))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a26_0x1f2943(0xf6)]=a26_0x1f2943(0xe0);[a26_0x1f2943(0x158)]='Show\x20journey\x20table\x20column\x20mapping';async[a26_0x1f2943(0x12f)](_0x450ce8){const _0x5d697d=a26_0x1f2943,{options:_0x10fd74,args:_0x579a70,tdx:_0x2cea1c}=_0x450ce8,_0x4e1709=_0x579a70[0x0];if(!requireNameOrPath(_0x4e1709))return 0x1;_0x10fd74['verbose']&&console[_0x5d697d(0x13f)](_0x5d697d(0xd0)+_0x4e1709);const {journeyId:_0x2bdbff}=await resolveJourneyIdFromInput(_0x4e1709,_0x10fd74,_0x2cea1c),_0x43df7d=await withSpinner(_0x5d697d(0x133),()=>_0x2cea1c[_0x5d697d(0x94)][_0x5d697d(0xdd)](_0x2bdbff),{'verbose':_0x10fd74[_0x5d697d(0xb5)]}),_0x5f3545=_0x43df7d['data'];return console[_0x5d697d(0xc3)](_0x5d697d(0x136)+_0x5f3545[_0x5d697d(0x12c)]),console['log'](_0x5d697d(0x10b)+_0x5f3545[_0x5d697d(0x9d)]),await handleSDKOutput(_0x5f3545['columns'],_0x10fd74),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a26_0x1f2943(0x9b);['description']=a26_0x1f2943(0x123);async[a26_0x1f2943(0x12f)](_0x1cb9af){const _0x45fe7d=a26_0x1f2943,{options:_0x1bd901,args:_0x55cbf4,tdx:_0x511a33}=_0x1cb9af,_0x2a1a4a=_0x55cbf4[0x0];if(!requireNameOrPath(_0x2a1a4a))return 0x1;_0x1bd901['verbose']&&console[_0x45fe7d(0x13f)]('Input:\x20'+_0x2a1a4a);const {journeyId:_0xea7a5b}=await resolveJourneyIdFromInput(_0x2a1a4a,_0x1bd901,_0x511a33),_0x1d6eb4=await withSpinner(_0x45fe7d(0x165),()=>_0x511a33[_0x45fe7d(0x94)][_0x45fe7d(0xea)](_0xea7a5b),{'verbose':_0x1bd901[_0x45fe7d(0xb5)]}),_0x210d90=_0x1d6eb4[_0x45fe7d(0xfb)];return console[_0x45fe7d(0x13f)](_0x45fe7d(0xd8)+_0x210d90[_0x45fe7d(0x147)]+'\x20activation'+(_0x210d90[_0x45fe7d(0x147)]!==0x1?'s':'')),await handleSDKOutput(_0x210d90,_0x1bd901),0x0;}}export class JourneyPushCommand extends BaseCommand{[a26_0x1f2943(0xf6)]=a26_0x1f2943(0xb6);[a26_0x1f2943(0x158)]=a26_0x1f2943(0xde);['segmentPushCommand']=new SegmentPushCommand();async[a26_0x1f2943(0x12f)](_0x1b0fc4){const _0x5433e2=a26_0x1f2943,_0x209039=_0x1b0fc4[_0x5433e2(0x7c)][0x0];let _0x43103a;if(_0x209039){const _0x367672=await resolveTarget({'arg':_0x209039,'contextParent':_0x1b0fc4['options'][_0x5433e2(0x83)],'cwd':process['cwd']()});isSuccessfulResolution(_0x367672)&&_0x367672['type']==='file'&&(_0x43103a=_0x367672['filePath']);}const _0x3e48db={..._0x1b0fc4,'options':{..._0x1b0fc4[_0x5433e2(0xa3)],'journeysOnly':!![],..._0x43103a&&{'singleFilePath':_0x43103a}}};return this['segmentPushCommand'][_0x5433e2(0x12f)](_0x3e48db);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a26_0x1f2943(0xcc);[a26_0x1f2943(0x158)]=a26_0x1f2943(0x12a);async[a26_0x1f2943(0x12f)](_0x136192){const _0x8f297c=a26_0x1f2943,{options:_0xb7df9a,args:_0x547d17,tdx:_0x560aa0}=_0x136192,_0x587899=_0x547d17[0x0];if(!requireNameOrPath(_0x587899))return 0x1;if(_0xb7df9a[_0x8f297c(0xb5)])console[_0x8f297c(0x13f)](_0x8f297c(0xd0)+_0x587899);const {journeyId:_0x5262f7}=await resolveJourneyIdFromInput(_0x587899,_0xb7df9a,_0x560aa0),_0x5766bd=await withSpinner(_0x8f297c(0x117),()=>_0x560aa0['journey']['listVersions'](_0x5262f7),{'verbose':_0xb7df9a[_0x8f297c(0xb5)]}),{bundleName:_0x610a7f,versions:_0x4f2f1b,latestJourneyId:_0xadcee1}=_0x5766bd[_0x8f297c(0xfb)];console[_0x8f297c(0x13f)](_0x610a7f+':\x20'+_0x4f2f1b[_0x8f297c(0x147)]+_0x8f297c(0x11b)+(_0x4f2f1b[_0x8f297c(0x147)]!==0x1?'s':''));const _0x5d070a=_0x4f2f1b['map'](_0x36bd62=>({'version':_0x36bd62[_0x8f297c(0x12b)],'journey_id':_0x36bd62['journeyId'],'name':_0x36bd62[_0x8f297c(0xf6)],'state':_0x36bd62[_0x8f297c(0x148)],'paused':_0x36bd62[_0x8f297c(0x164)],'latest':_0x36bd62[_0x8f297c(0x15f)]===_0xadcee1,'created_at':_0x36bd62[_0x8f297c(0x11d)]}));return await handleSDKOutput(_0x5d070a,_0xb7df9a),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']='journey:version:create';[a26_0x1f2943(0x158)]=a26_0x1f2943(0x15d);async[a26_0x1f2943(0x12f)](_0x342d3e){const _0x447b0d=a26_0x1f2943,{options:_0x38fd30,args:_0x3d0d82,tdx:_0x35eda0}=_0x342d3e,_0x20f773=_0x3d0d82[0x0];if(!requireNameOrPath(_0x20f773))return 0x1;if(_0x38fd30[_0x447b0d(0xb5)])console['error'](_0x447b0d(0xd0)+_0x20f773);const {journeyId:_0xc6ad79,journeyName:_0x1d3118}=await resolveJourneyIdFromInput(_0x20f773,_0x38fd30,_0x35eda0);if(!_0x38fd30[_0x447b0d(0xb3)]){const _0x4f7bdf=await confirm(_0x447b0d(0x156)+_0x1d3118+'\x22?');if(!_0x4f7bdf)return console[_0x447b0d(0x13f)](_0x447b0d(0x8d)),0x0;}const _0x3acbf5=await withSpinner('Creating\x20new\x20version...',()=>_0x35eda0['journey'][_0x447b0d(0xf5)](_0xc6ad79),{'verbose':_0x38fd30['verbose']}),_0x779355=_0x3acbf5[_0x447b0d(0xfb)];return console[_0x447b0d(0x13f)](a26_0x54538f[_0x447b0d(0x137)]('✔')+_0x447b0d(0x132)+_0x779355[_0x447b0d(0x177)][_0x447b0d(0x12b)]+_0x447b0d(0x14f)+_0x779355[_0x447b0d(0x177)][_0x447b0d(0xf6)]+'\x22'),console[_0x447b0d(0x13f)](_0x447b0d(0x131)+_0x779355['id']),await handleSingleObjectOutput({'id':_0x779355['id'],'name':_0x779355[_0x447b0d(0x177)]['name'],'version':_0x779355[_0x447b0d(0x177)][_0x447b0d(0x12b)],'state':_0x779355['attributes'][_0x447b0d(0x148)],'bundle_id':_0x779355[_0x447b0d(0x177)]['journeyBundleId'],'created_at':_0x779355[_0x447b0d(0x177)][_0x447b0d(0x11d)]},_0x38fd30),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a26_0x1f2943(0xf6)]=a26_0x1f2943(0xe3);[a26_0x1f2943(0x158)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a26_0x1f2943(0x12f)](_0x5d5582){const _0x3bc503=a26_0x1f2943,{options:_0x1264a9,args:_0x974190,tdx:_0x2105d1}=_0x5d5582,_0x4233b2=_0x974190[0x0];if(!requireNameOrPath(_0x4233b2))return 0x1;const _0x4720af=_0x1264a9[_0x3bc503(0x140)];if(!_0x4720af)return console[_0x3bc503(0x13f)](_0x3bc503(0xfd)),console[_0x3bc503(0x13f)](_0x3bc503(0x163)),0x1;const _0x5d2693=parseInt(_0x4720af,0xa);if(isNaN(_0x5d2693)||_0x5d2693<0x1)return console[_0x3bc503(0x13f)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x4720af),0x1;if(_0x1264a9[_0x3bc503(0xb5)])console['error'](_0x3bc503(0xd0)+_0x4233b2+_0x3bc503(0xa4)+_0x5d2693);const {journeyId:_0x10f6ad,parentSegmentId:_0x6102f2}=await resolveJourneyIdFromInput(_0x4233b2,_0x1264a9,_0x2105d1),_0x5df5c3=await withSpinner('Resolving\x20version...',()=>_0x2105d1[_0x3bc503(0x94)][_0x3bc503(0x13c)](_0x10f6ad),{'verbose':_0x1264a9[_0x3bc503(0xb5)]}),{versions:_0x14c8bd,latestJourneyId:_0x1089dc}=_0x5df5c3[_0x3bc503(0xfb)],_0x3feff9=_0x14c8bd[_0x3bc503(0xe5)](_0x688f68=>_0x688f68[_0x3bc503(0x12b)]===_0x5d2693);if(!_0x3feff9){const _0x4f9acb=_0x14c8bd[_0x3bc503(0x11f)](_0x54b5e9=>'v'+_0x54b5e9['versionNumber'])[_0x3bc503(0x15a)](',\x20');return console['error']('Error:\x20Version\x20'+_0x5d2693+_0x3bc503(0x9f)+_0x4f9acb),0x1;}const _0x495e21=await withSpinner(_0x3bc503(0xe1)+_0x5d2693+'\x20details...',()=>_0x2105d1[_0x3bc503(0x94)]['getJourney'](_0x3feff9[_0x3bc503(0x15f)]),{'verbose':_0x1264a9[_0x3bc503(0xb5)]}),_0x174a4a=_0x495e21[_0x3bc503(0xfb)],_0x1af7be=getConsoleNextUrl(_0x1264a9[_0x3bc503(0x16b)],_0x3bc503(0x128)+_0x6102f2+_0x3bc503(0xa0)+_0x3feff9[_0x3bc503(0x15f)]+_0x3bc503(0x154));return await handleSingleObjectOutput({'id':_0x174a4a['id'],'name':_0x174a4a[_0x3bc503(0x177)][_0x3bc503(0xf6)],'version':_0x174a4a[_0x3bc503(0x177)][_0x3bc503(0x12b)],'description':_0x174a4a[_0x3bc503(0x177)][_0x3bc503(0x158)],'state':_0x174a4a['attributes'][_0x3bc503(0x148)],'paused':_0x174a4a[_0x3bc503(0x177)][_0x3bc503(0x164)],'reentry_mode':_0x174a4a[_0x3bc503(0x177)][_0x3bc503(0x149)],'stages':_0x174a4a[_0x3bc503(0x177)][_0x3bc503(0x90)]?.[_0x3bc503(0x147)]||0x0,..._0x174a4a['attributes'][_0x3bc503(0x78)]&&{'goal':_0x174a4a[_0x3bc503(0x177)][_0x3bc503(0x78)][_0x3bc503(0xf6)]},'latest':_0x3feff9['journeyId']===_0x1089dc,'created_at':_0x174a4a[_0x3bc503(0x177)][_0x3bc503(0x11d)],'updated_at':_0x174a4a['attributes'][_0x3bc503(0x172)],'url':_0x1af7be},_0x1264a9),0x0;}}
@@ -1 +1 @@
1
- const a27_0x5f09fe=a27_0x49a7;(function(_0x5acc1a,_0x5b1320){const _0x48161b=a27_0x49a7,_0x201a8d=_0x5acc1a();while(!![]){try{const _0x12318a=-parseInt(_0x48161b(0x1fa))/0x1+parseInt(_0x48161b(0x215))/0x2+-parseInt(_0x48161b(0x220))/0x3*(-parseInt(_0x48161b(0x1f6))/0x4)+-parseInt(_0x48161b(0x1f5))/0x5*(-parseInt(_0x48161b(0x203))/0x6)+-parseInt(_0x48161b(0x204))/0x7*(parseInt(_0x48161b(0x1f3))/0x8)+parseInt(_0x48161b(0x210))/0x9+parseInt(_0x48161b(0x211))/0xa;if(_0x12318a===_0x5b1320)break;else _0x201a8d['push'](_0x201a8d['shift']());}catch(_0x324f70){_0x201a8d['push'](_0x201a8d['shift']());}}}(a27_0x88cc,0x8ca4a));function a27_0x88cc(){const _0x155bba=['targetDir','\x20segment\x20file(s)\x20skipped','warningCount','No\x20journey\x20YAML\x20files\x20found\x20in\x20','description','log','error','Error:\x20Directory\x20not\x20found:\x20','\x20journey(s)\x20with\x20errors,\x20','cyan','Error:\x20','1513881cfDnMH','12340860cmxDEM','no_parent','\x20journey(s)\x20valid','errorCode','644754gLNHvm','endsWith','errors','verbose','message','red','execute','helpText','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','.yml','yellow','21bNrZJt','journey','valid','Validate\x20journey\x20YAML\x20files','warnings','validCount','reason','.yaml','dim','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','green','284936sjhxNT','length','15ssHByi','104476SCrrwk','\x20segment\x20file(s)\x20skipped)','\x20error(s)','\x20warning(s)','648945ObWkBF','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','relativePath','skippedCount','file','\x20warning(s)\x20found','\x20(skipped:\x20','invalidCount','\x20valid','843282uwLeHi','217byMpbz'];a27_0x88cc=function(){return _0x155bba;};return a27_0x88cc();}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a27_0x49a7(_0x3d1a64,_0xb96c49){_0x3d1a64=_0x3d1a64-0x1e9;const _0x88cc6d=a27_0x88cc();let _0x49a707=_0x88cc6d[_0x3d1a64];return _0x49a707;}import{existsSync}from'fs';import a27_0x48680f from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{['name']='journey:validate';[a27_0x5f09fe(0x209)]=a27_0x5f09fe(0x1ea);async[a27_0x5f09fe(0x21b)](_0x49fb51){const _0x4e6864=a27_0x5f09fe,{options:_0x4a59f6,args:_0x4fdee6}=_0x49fb51,_0x1fa650=_0x4a59f6,_0xe80205=await resolveTarget({'arg':_0x4fdee6[0x0],'contextParent':_0x4a59f6['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xe80205))return _0xe80205[_0x4e6864(0x214)]===_0x4e6864(0x212)?(console[_0x4e6864(0x20b)](a27_0x48680f[_0x4e6864(0x21f)](_0x4e6864(0x1f1))),console['error'](_0x4e6864(0x21d)),console[_0x4e6864(0x20b)](_0x4e6864(0x1fb)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x4e6864(0x20b)](a27_0x48680f[_0x4e6864(0x21a)](_0x4e6864(0x20f)+_0xe80205[_0x4e6864(0x219)]+'\x0a')),_0xe80205[_0x4e6864(0x21c)]&&console[_0x4e6864(0x20b)](a27_0x48680f[_0x4e6864(0x20e)](_0xe80205[_0x4e6864(0x21c)]))),0x1;const _0x226d02=_0xe80205[_0x4e6864(0x205)],_0x536bf1=_0xe80205['type']===_0x4e6864(0x1fe)?_0xe80205['filePath']:undefined;if(!_0x536bf1&&!existsSync(_0x226d02))return console['error'](a27_0x48680f[_0x4e6864(0x21a)](_0x4e6864(0x20c)+_0x226d02+'\x0a')),0x1;let _0x3ec696;if(_0x536bf1){if(!_0x536bf1[_0x4e6864(0x216)](_0x4e6864(0x21e))&&!_0x536bf1[_0x4e6864(0x216)](_0x4e6864(0x1ee)))return console[_0x4e6864(0x20b)](a27_0x48680f[_0x4e6864(0x21a)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x536bf1+'\x0a')),0x1;_0x3ec696=[_0x536bf1];}else _0x3ec696=findYamlFiles(_0x226d02);if(_0x3ec696[_0x4e6864(0x1f4)]===0x0)return console[_0x4e6864(0x20b)](a27_0x48680f[_0x4e6864(0x21a)](_0x4e6864(0x1f0)+_0x226d02+'\x0a')),0x1;const _0x5441d4=validateYamlFiles(_0x3ec696,_0x226d02,{'filterType':_0x4e6864(0x221)}),_0x5dcc79=calculateSummary(_0x5441d4),_0x4e2800=_0x5441d4['filter'](isValidationResult);if(_0x4e2800[_0x4e6864(0x1f4)]===0x0)return console[_0x4e6864(0x20b)](a27_0x48680f['yellow'](_0x4e6864(0x208)+_0x226d02+'\x0a')),_0x5dcc79[_0x4e6864(0x1fd)]>0x0&&console[_0x4e6864(0x20b)](a27_0x48680f[_0x4e6864(0x1ef)]('('+_0x5dcc79[_0x4e6864(0x1fd)]+_0x4e6864(0x1f7))),0x0;for(const _0x5e434c of _0x5441d4){if(!isValidationResult(_0x5e434c)){_0x1fa650[_0x4e6864(0x218)]&&console[_0x4e6864(0x20a)](a27_0x48680f[_0x4e6864(0x1ef)]('-\x20'+_0x5e434c[_0x4e6864(0x1fc)]+_0x4e6864(0x200)+_0x5e434c[_0x4e6864(0x1ed)]+')'));continue;}const {relativePath:_0x844eb0,source:_0x4db5bd,result:_0x56630c}=_0x5e434c;if(_0x56630c[_0x4e6864(0x1e9)]&&_0x56630c[_0x4e6864(0x1eb)][_0x4e6864(0x1f4)]===0x0)_0x1fa650[_0x4e6864(0x218)]&&console[_0x4e6864(0x20a)](a27_0x48680f[_0x4e6864(0x1f2)]('✔\x20'+_0x844eb0));else _0x56630c[_0x4e6864(0x1e9)]?(console[_0x4e6864(0x20a)](a27_0x48680f['yellow']('⚠\x20'+_0x844eb0+':\x20'+_0x56630c[_0x4e6864(0x1eb)][_0x4e6864(0x1f4)]+_0x4e6864(0x1f9))),console[_0x4e6864(0x20a)](formatValidationResult(_0x56630c,_0x4db5bd,_0x844eb0))):(console['log'](a27_0x48680f['red']('✖\x20'+_0x844eb0+':\x20'+_0x56630c[_0x4e6864(0x217)][_0x4e6864(0x1f4)]+_0x4e6864(0x1f8))),console[_0x4e6864(0x20a)](formatValidationResult(_0x56630c,_0x4db5bd,_0x844eb0)));}return console['log'](''),_0x5dcc79['hasErrors']?(console[_0x4e6864(0x20a)](a27_0x48680f[_0x4e6864(0x21a)]('Validation\x20failed:\x20'+_0x5dcc79[_0x4e6864(0x201)]+_0x4e6864(0x20d)+_0x5dcc79[_0x4e6864(0x1ec)]+_0x4e6864(0x202))),_0x5dcc79[_0x4e6864(0x207)]>0x0&&console[_0x4e6864(0x20a)](a27_0x48680f[_0x4e6864(0x21f)](_0x5dcc79[_0x4e6864(0x207)]+'\x20warning(s)\x20found')),_0x5dcc79['skippedCount']>0x0&&console[_0x4e6864(0x20a)](a27_0x48680f[_0x4e6864(0x1ef)](_0x5dcc79[_0x4e6864(0x1fd)]+_0x4e6864(0x206))),0x1):(console['log'](a27_0x48680f[_0x4e6864(0x1f2)]('✔\x20All\x20'+_0x5dcc79[_0x4e6864(0x1ec)]+_0x4e6864(0x213))),_0x5dcc79['warningCount']>0x0&&console[_0x4e6864(0x20a)](a27_0x48680f[_0x4e6864(0x21f)](_0x5dcc79['warningCount']+_0x4e6864(0x1ff))),_0x5dcc79[_0x4e6864(0x1fd)]>0x0&&console[_0x4e6864(0x20a)](a27_0x48680f['dim'](_0x5dcc79['skippedCount']+_0x4e6864(0x206))),0x0);}}
1
+ const a27_0x27b0ba=a27_0x240c;(function(_0x4a08d7,_0x46f704){const _0x4cdd40=a27_0x240c,_0x2d45f9=_0x4a08d7();while(!![]){try{const _0x4e9895=parseInt(_0x4cdd40(0x183))/0x1+-parseInt(_0x4cdd40(0x17f))/0x2+parseInt(_0x4cdd40(0x196))/0x3*(parseInt(_0x4cdd40(0x18e))/0x4)+-parseInt(_0x4cdd40(0x1a6))/0x5*(parseInt(_0x4cdd40(0x185))/0x6)+-parseInt(_0x4cdd40(0x1b2))/0x7*(parseInt(_0x4cdd40(0x1a5))/0x8)+-parseInt(_0x4cdd40(0x19a))/0x9*(parseInt(_0x4cdd40(0x194))/0xa)+parseInt(_0x4cdd40(0x189))/0xb*(parseInt(_0x4cdd40(0x1a2))/0xc);if(_0x4e9895===_0x46f704)break;else _0x2d45f9['push'](_0x2d45f9['shift']());}catch(_0x3e0b08){_0x2d45f9['push'](_0x2d45f9['shift']());}}}(a27_0x3cf1,0x50ab2));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a27_0x5a7ac9 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a27_0x240c(_0x5bd8d2,_0x570304){_0x5bd8d2=_0x5bd8d2-0x177;const _0x3cf186=a27_0x3cf1();let _0x240c28=_0x3cf186[_0x5bd8d2];return _0x240c28;}export class JourneyValidateCommand extends BaseCommand{[a27_0x27b0ba(0x17d)]='journey:validate';['description']=a27_0x27b0ba(0x1b1);async['execute'](_0x328335){const _0x43a977=a27_0x27b0ba,{options:_0xe636cd,args:_0x1fea56}=_0x328335,_0x2cf6b8=_0xe636cd,_0x5d385b=await resolveTarget({'arg':_0x1fea56[0x0],'contextParent':_0xe636cd[_0x43a977(0x18b)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5d385b))return _0x5d385b[_0x43a977(0x1b3)]===_0x43a977(0x18d)?(console[_0x43a977(0x1af)](a27_0x5a7ac9[_0x43a977(0x19e)](_0x43a977(0x17a))),console[_0x43a977(0x1af)](_0x43a977(0x1a9)),console[_0x43a977(0x1af)](_0x43a977(0x17c)),console[_0x43a977(0x1af)](_0x43a977(0x186))):(console['error'](a27_0x5a7ac9[_0x43a977(0x1ac)](_0x43a977(0x187)+_0x5d385b[_0x43a977(0x178)]+'\x0a')),_0x5d385b['helpText']&&console[_0x43a977(0x1af)](a27_0x5a7ac9[_0x43a977(0x1ad)](_0x5d385b[_0x43a977(0x197)]))),0x1;const _0x13c809=_0x5d385b[_0x43a977(0x1a0)],_0x39f710=_0x5d385b['type']===_0x43a977(0x182)?_0x5d385b[_0x43a977(0x1a4)]:undefined;if(!_0x39f710&&!existsSync(_0x13c809))return console[_0x43a977(0x1af)](a27_0x5a7ac9[_0x43a977(0x1ac)](_0x43a977(0x191)+_0x13c809+'\x0a')),0x1;let _0x372854;if(_0x39f710){if(!_0x39f710[_0x43a977(0x181)](_0x43a977(0x1b4))&&!_0x39f710[_0x43a977(0x181)](_0x43a977(0x179)))return console[_0x43a977(0x1af)](a27_0x5a7ac9[_0x43a977(0x1ac)](_0x43a977(0x17e)+_0x39f710+'\x0a')),0x1;_0x372854=[_0x39f710];}else _0x372854=findYamlFiles(_0x13c809);if(_0x372854[_0x43a977(0x195)]===0x0)return console[_0x43a977(0x1af)](a27_0x5a7ac9[_0x43a977(0x1ac)](_0x43a977(0x19f)+_0x13c809+'\x0a')),0x1;const _0x3132f6=validateYamlFiles(_0x372854,_0x13c809,{'filterType':_0x43a977(0x184)}),_0x3f7308=calculateSummary(_0x3132f6),_0x5d144d=_0x3132f6['filter'](isValidationResult);if(_0x5d144d[_0x43a977(0x195)]===0x0)return console[_0x43a977(0x1af)](a27_0x5a7ac9[_0x43a977(0x19e)](_0x43a977(0x1b0)+_0x13c809+'\x0a')),_0x3f7308[_0x43a977(0x18c)]>0x0&&console[_0x43a977(0x1af)](a27_0x5a7ac9['dim']('('+_0x3f7308['skippedCount']+_0x43a977(0x180))),0x0;for(const _0x409bd3 of _0x3132f6){if(!isValidationResult(_0x409bd3)){_0x2cf6b8['verbose']&&console['log'](a27_0x5a7ac9[_0x43a977(0x199)]('-\x20'+_0x409bd3['relativePath']+_0x43a977(0x1ab)+_0x409bd3[_0x43a977(0x18a)]+')'));continue;}const {relativePath:_0x5c5a32,source:_0x23675b,result:_0x1309f5}=_0x409bd3;if(_0x1309f5[_0x43a977(0x1a3)]&&_0x1309f5['warnings'][_0x43a977(0x195)]===0x0)_0x2cf6b8[_0x43a977(0x177)]&&console[_0x43a977(0x1a1)](a27_0x5a7ac9[_0x43a977(0x190)]('✔\x20'+_0x5c5a32));else _0x1309f5['valid']?(console['log'](a27_0x5a7ac9[_0x43a977(0x19e)]('⚠\x20'+_0x5c5a32+':\x20'+_0x1309f5[_0x43a977(0x19d)][_0x43a977(0x195)]+'\x20warning(s)')),console['log'](formatValidationResult(_0x1309f5,_0x23675b,_0x5c5a32))):(console[_0x43a977(0x1a1)](a27_0x5a7ac9[_0x43a977(0x1ac)]('✖\x20'+_0x5c5a32+':\x20'+_0x1309f5[_0x43a977(0x1aa)][_0x43a977(0x195)]+_0x43a977(0x18f))),console[_0x43a977(0x1a1)](formatValidationResult(_0x1309f5,_0x23675b,_0x5c5a32)));}return console[_0x43a977(0x1a1)](''),_0x3f7308[_0x43a977(0x192)]?(console[_0x43a977(0x1a1)](a27_0x5a7ac9[_0x43a977(0x1ac)](_0x43a977(0x1a8)+_0x3f7308['invalidCount']+_0x43a977(0x188)+_0x3f7308[_0x43a977(0x19c)]+_0x43a977(0x198))),_0x3f7308[_0x43a977(0x1ae)]>0x0&&console[_0x43a977(0x1a1)](a27_0x5a7ac9['yellow'](_0x3f7308[_0x43a977(0x1ae)]+_0x43a977(0x1a7))),_0x3f7308[_0x43a977(0x18c)]>0x0&&console['log'](a27_0x5a7ac9[_0x43a977(0x199)](_0x3f7308[_0x43a977(0x18c)]+_0x43a977(0x17b))),0x1):(console['log'](a27_0x5a7ac9[_0x43a977(0x190)](_0x43a977(0x19b)+_0x3f7308[_0x43a977(0x19c)]+_0x43a977(0x193))),_0x3f7308[_0x43a977(0x1ae)]>0x0&&console[_0x43a977(0x1a1)](a27_0x5a7ac9[_0x43a977(0x19e)](_0x3f7308[_0x43a977(0x1ae)]+_0x43a977(0x1a7))),_0x3f7308[_0x43a977(0x18c)]>0x0&&console[_0x43a977(0x1a1)](a27_0x5a7ac9[_0x43a977(0x199)](_0x3f7308[_0x43a977(0x18c)]+'\x20segment\x20file(s)\x20skipped')),0x0);}}function a27_0x3cf1(){const _0x194bce=['green','Error:\x20Directory\x20not\x20found:\x20','hasErrors','\x20journey(s)\x20valid','2790dluIcR','length','1580370ecssCa','helpText','\x20valid','dim','9855DNQIUa','✔\x20All\x20','validCount','warnings','yellow','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','targetDir','log','24YVbzNW','valid','filePath','9736QzQmtm','25QCywGc','\x20warning(s)\x20found','Validation\x20failed:\x20','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','errors','\x20(skipped:\x20','red','cyan','warningCount','error','No\x20journey\x20YAML\x20files\x20found\x20in\x20','Validate\x20journey\x20YAML\x20files','1687rGtVIq','errorCode','.yml','verbose','message','.yaml','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20segment\x20file(s)\x20skipped','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','name','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','1116696lhKhPs','\x20segment\x20file(s)\x20skipped)','endsWith','file','94126EzIdBT','journey','159276fMdkXu','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Error:\x20','\x20journey(s)\x20with\x20errors,\x20','5496601TMoUuK','reason','parentSegment','skippedCount','no_parent','4RqNJrK','\x20error(s)'];a27_0x3cf1=function(){return _0x194bce;};return a27_0x3cf1();}
@@ -1 +1 @@
1
- const a28_0x9865ec=a28_0x455a;(function(_0x4f0b4e,_0x42fb71){const _0x4ff4b1=a28_0x455a,_0x2336e7=_0x4f0b4e();while(!![]){try{const _0x5439fb=-parseInt(_0x4ff4b1(0x15a))/0x1*(parseInt(_0x4ff4b1(0x186))/0x2)+-parseInt(_0x4ff4b1(0x12c))/0x3+parseInt(_0x4ff4b1(0x127))/0x4*(-parseInt(_0x4ff4b1(0x155))/0x5)+parseInt(_0x4ff4b1(0x17e))/0x6*(-parseInt(_0x4ff4b1(0xd1))/0x7)+parseInt(_0x4ff4b1(0xf0))/0x8+parseInt(_0x4ff4b1(0x185))/0x9*(-parseInt(_0x4ff4b1(0x10d))/0xa)+-parseInt(_0x4ff4b1(0x131))/0xb*(-parseInt(_0x4ff4b1(0xf1))/0xc);if(_0x5439fb===_0x42fb71)break;else _0x2336e7['push'](_0x2336e7['shift']());}catch(_0x2d821f){_0x2336e7['push'](_0x2336e7['shift']());}}}(a28_0x9874,0x2877f));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{confirm}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import*as a28_0x4cac73 from'node:fs';function handleSDKError(_0x574411,_0x2b2e39){const _0x3c1056=a28_0x455a;if(_0x574411 instanceof SDKError)console['error'](_0x3c1056(0x135)+_0x574411[_0x3c1056(0xee)]),_0x2b2e39[_0x3c1056(0x170)]&&(_0x574411[_0x3c1056(0xfb)]&&console[_0x3c1056(0x100)](_0x3c1056(0x152)+_0x574411[_0x3c1056(0xfb)]),_0x574411[_0x3c1056(0x197)]&&(console[_0x3c1056(0x100)](_0x3c1056(0x125)),console[_0x3c1056(0x100)](_0x574411[_0x3c1056(0x197)])));else throw _0x574411;}function formatChatHistoryEntry(_0x1afe44,_0x243f4c){const _0x4d174e=a28_0x455a,_0x209d7f=getChalk(_0x243f4c),_0x1e9bfe=_0x209d7f[_0x4d174e(0x171)](_0x1afe44['at']);if(_0x4d174e(0xe3)in _0x1afe44){const _0x197f88=_0x209d7f['cyan'](_0x4d174e(0x15f));return _0x1e9bfe+'\x20'+_0x197f88+':\x20'+_0x1afe44[_0x4d174e(0xe3)];}if(_0x4d174e(0x16c)in _0x1afe44){const _0xa8b877=_0x209d7f[_0x4d174e(0x1a0)](_0x4d174e(0x13c));return _0x1e9bfe+'\x20'+_0xa8b877+':\x20'+_0x1afe44['content'];}if('tool_call'in _0x1afe44){const _0x2b4929=_0x209d7f[_0x4d174e(0x156)](_0x4d174e(0x17f)),{functionName:_0x847137,functionArguments:_0x31da8e,targetFunction:_0x38f265}=_0x1afe44[_0x4d174e(0x118)];let _0x158c2d=_0x1e9bfe+'\x20'+_0x2b4929+':\x20'+_0x209d7f[_0x4d174e(0x17d)](_0x847137);if(_0x31da8e&&Object[_0x4d174e(0xec)](_0x31da8e)['length']>0x0){const _0x4e5086=Object['entries'](_0x31da8e)[_0x4d174e(0x1a8)](([_0x3283aa,_0x520c44])=>_0x3283aa+'='+JSON[_0x4d174e(0x126)](_0x520c44))[_0x4d174e(0x19f)](',\x20');_0x158c2d+='('+_0x4e5086+')';}_0x38f265&&(_0x158c2d+=_0x209d7f[_0x4d174e(0x171)]('\x20['+_0x38f265+']'));let _0x115457='';if(_0x1afe44['tool_call'][_0x4d174e(0x160)])_0x115457=_0x4d174e(0xf6)+_0x1afe44[_0x4d174e(0x118)]['targetKnowledgeBase'][_0x4d174e(0x146)];else{if(_0x1afe44[_0x4d174e(0x118)][_0x4d174e(0x163)])_0x115457=_0x4d174e(0x198)+_0x1afe44[_0x4d174e(0x118)][_0x4d174e(0x163)]['name'];else{if(_0x1afe44[_0x4d174e(0x118)][_0x4d174e(0xf3)])_0x115457=_0x4d174e(0x1a3)+_0x1afe44[_0x4d174e(0x118)][_0x4d174e(0xf3)][_0x4d174e(0x146)];else _0x1afe44[_0x4d174e(0x118)][_0x4d174e(0x190)]&&(_0x115457=_0x4d174e(0x19b)+_0x1afe44[_0x4d174e(0x118)][_0x4d174e(0x190)][_0x4d174e(0x146)]);}}return _0x158c2d+_0x115457;}if(_0x4d174e(0x159)in _0x1afe44){const _0x347931=_0x209d7f[_0x4d174e(0x18c)](_0x4d174e(0x16e)),{functionName:_0x5f58a9,functionArguments:_0x765114,content:_0x1b1c4b,newChat:_0x531aa7}=_0x1afe44[_0x4d174e(0x159)];let _0x53c6a0=_0x1e9bfe+'\x20'+_0x347931+':\x20'+_0x209d7f[_0x4d174e(0x17d)](_0x5f58a9);if(_0x765114){const _0x46e321=typeof _0x765114==='string'?_0x765114:JSON[_0x4d174e(0x126)](_0x765114);_0x53c6a0+='('+_0x46e321+')';}return _0x1b1c4b&&(_0x53c6a0+='\x0a'+_0x209d7f[_0x4d174e(0x171)](_0x1b1c4b)),_0x531aa7&&(_0x53c6a0+=_0x209d7f[_0x4d174e(0x171)]('\x20→\x20chat:\x20'+_0x531aa7['id'])),_0x53c6a0;}if('output'in _0x1afe44){const _0x5ac943=_0x209d7f[_0x4d174e(0x13e)](_0x4d174e(0x137));return _0x1e9bfe+'\x20'+_0x5ac943+':\x20'+_0x1afe44['output']['name']+'\x20('+_0x1afe44['output'][_0x4d174e(0x16c)]['length']+'\x20bytes)';}if('image'in _0x1afe44){const _0x577197=_0x209d7f[_0x4d174e(0x13e)](_0x4d174e(0xf4)),{width:_0x6cb273,height:_0x441371,headerText:_0x5f0e70}=_0x1afe44[_0x4d174e(0x193)],_0x1f4eeb=_0x5f0e70?_0x4d174e(0x1a7)+_0x5f0e70:'';return _0x1e9bfe+'\x20'+_0x577197+':\x20'+_0x6cb273+'x'+_0x441371+_0x1f4eeb;}if(_0x4d174e(0x100)in _0x1afe44){const _0x103e1b=_0x209d7f[_0x4d174e(0xd2)](_0x4d174e(0x15d));return _0x1e9bfe+'\x20'+_0x103e1b+':\x20'+_0x1afe44['error'];}return _0x1e9bfe+'\x20'+_0x209d7f[_0x4d174e(0x171)](_0x4d174e(0x105))+':\x20'+JSON[_0x4d174e(0x126)](_0x1afe44);}async function executeChatHistoryCommand(_0x33b842,_0x463305){const _0x497056=a28_0x455a,{options:_0x4b8858,args:_0x2e7af3,tdx:_0x1bbb63}=_0x33b842,_0x1fb561=_0x2e7af3[0x0],_0x798896=_0x4b8858,_0x298b4d=_0x798896[_0x497056(0xdc)];try{if(_0x298b4d&&_0x1fb561)return console[_0x497056(0x100)](_0x497056(0x196)),console['error']('Usage:\x20'+_0x463305+'\x20--last'),0x1;if(!_0x1fb561&&!_0x298b4d&&_0x4b8858['format']!==undefined){const _0x1e3694=resolveLimit(_0x4b8858[_0x497056(0x153)],DEFAULT_LLM_LIMIT),_0x3b8d74=await withSpinner(_0x497056(0x12d),()=>_0x1bbb63[_0x497056(0x16d)]['chats'](_0x1e3694),{'verbose':_0x4b8858[_0x497056(0x170)]});return await handleSDKOutput(_0x3b8d74[_0x497056(0x173)],_0x4b8858),0x0;}const _0x26e814=await getChatIdOrSelect(_0x1bbb63,_0x4b8858,_0x298b4d,_0x1fb561);if(!_0x26e814)return 0x0;return await displayChatHistory(_0x26e814,_0x1bbb63,_0x4b8858),0x0;}catch(_0x56dc85){return handleSDKError(_0x56dc85,_0x4b8858),0x1;}}async function displayChatHistory(_0x54e6ea,_0x4f2482,_0x3a1e1b){const _0x21b227=a28_0x455a,_0x32d8ac=await withSpinner(_0x21b227(0xe4)+_0x54e6ea+_0x21b227(0xd4),()=>_0x4f2482[_0x21b227(0x16d)][_0x21b227(0x104)](_0x54e6ea),{'verbose':_0x3a1e1b[_0x21b227(0x170)]}),_0x29b389=_0x32d8ac['data'][_0x21b227(0x173)]??[];if(_0x29b389[_0x21b227(0xde)]===0x0){console[_0x21b227(0x11a)](_0x21b227(0x10b));return;}if(_0x3a1e1b[_0x21b227(0x18d)]!==undefined)await handleSDKOutput(_0x29b389,_0x3a1e1b);else{const _0x2d90b8=_0x29b389['map'](_0x3ab49e=>formatChatHistoryEntry(_0x3ab49e,_0x3a1e1b)),_0x45918f=_0x2d90b8[_0x21b227(0x19f)]('\x0a');await writeOutput(_0x45918f,_0x3a1e1b[_0x21b227(0x1a1)],'table');}}async function getChatIdOrSelect(_0x4de69f,_0x9b0141,_0x96c617,_0x5905fa){const _0x42d9f9=a28_0x455a;if(_0x5905fa)return _0x5905fa;if(_0x96c617){const _0x5dadf5=await withSpinner(_0x42d9f9(0x11e),()=>_0x4de69f[_0x42d9f9(0x16d)]['chats'](0x1),{'verbose':_0x9b0141[_0x42d9f9(0x170)]});if(_0x5dadf5[_0x42d9f9(0x173)][_0x42d9f9(0xde)]===0x0)return console['log'](_0x42d9f9(0xe7)),undefined;return _0x5dadf5[_0x42d9f9(0x173)][0x0]['id'];}const _0x159245=await selectChatInteractively(_0x4de69f,_0x9b0141);if(!_0x159245)return console[_0x42d9f9(0x11a)]('\x0aCancelled'),undefined;return _0x159245;}async function getProjectIdOrDefault(_0x35e108){const _0x5641b4=await getProjectWithName(_0x35e108);return _0x5641b4['id'];}async function getProjectWithName(_0x341517){const _0xe23ab5=a28_0x455a,{tdx:_0x3131f3,options:_0x316f94}=_0x341517,_0x1fd25a=_0x316f94[_0xe23ab5(0x18a)];if(_0x1fd25a){const _0x23e698=await withSpinner(_0xe23ab5(0x192)+_0x1fd25a+_0xe23ab5(0xd4),()=>_0x3131f3['llm'][_0xe23ab5(0xfc)](_0x1fd25a),{'verbose':_0x316f94[_0xe23ab5(0x170)]});return{'id':_0x23e698[_0xe23ab5(0x173)],'name':_0x1fd25a};}const _0x13aa11=_0x3131f3[_0xe23ab5(0x16d)][_0xe23ab5(0x15e)]();if(_0x13aa11){const _0x3034d9=await _0x3131f3['llm'][_0xe23ab5(0xf5)](),_0xe23a0=_0x3034d9[_0xe23ab5(0x129)](_0x1342c2=>_0x1342c2['id']===_0x13aa11);return{'id':_0x13aa11,'name':_0xe23a0?.['attributes'][_0xe23ab5(0x146)]||'Unknown'};}const _0x570735=await withSpinner('Getting\x20default\x20project...',()=>_0x3131f3[_0xe23ab5(0x16d)]['getOrCreateDefaultProject'](),{'verbose':_0x316f94[_0xe23ab5(0x170)]});return{'id':_0x570735['data']['id'],'name':_0x570735[_0xe23ab5(0x173)]['attributes'][_0xe23ab5(0x146)]};}function toLLMProjectInfo(_0x4e5bcc){const _0x52bbc4=a28_0x455a;return{'name':_0x4e5bcc[_0x52bbc4(0x1a6)]['name'],'description':_0x4e5bcc[_0x52bbc4(0x1a6)]['description'],'createdAt':_0x4e5bcc['attributes'][_0x52bbc4(0x175)],'updatedAt':_0x4e5bcc[_0x52bbc4(0x1a6)][_0x52bbc4(0xf8)]};}function toAgentInfo(_0x52c80e){const _0x216616=a28_0x455a;return{'name':_0x52c80e[_0x216616(0x1a6)][_0x216616(0x146)],'description':_0x52c80e[_0x216616(0x1a6)][_0x216616(0x14a)],'prompt':truncatePrompt(_0x52c80e[_0x216616(0x1a6)]['prompt']),'createdAt':_0x52c80e[_0x216616(0x1a6)][_0x216616(0x175)],'updatedAt':_0x52c80e[_0x216616(0x1a6)][_0x216616(0xf8)]};}function truncatePrompt(_0x1714e0){const _0x435d6d=a28_0x455a;if(!_0x1714e0)return undefined;const _0x5e502f=0x64;if(_0x1714e0[_0x435d6d(0xde)]<=_0x5e502f)return _0x1714e0;return _0x1714e0[_0x435d6d(0x12f)](0x0,_0x5e502f)+'...';}export class LLMModelsCommand extends BaseCommand{[a28_0x9865ec(0x146)]=a28_0x9865ec(0xe1);['description']='List\x20available\x20LLM\x20models';async['execute'](_0x355cd5){const _0x53d056=a28_0x9865ec,{options:_0x3d2c4d,tdx:_0x4330ec}=_0x355cd5;try{const _0x19208d=await withSpinner('Fetching\x20available\x20models...',()=>_0x4330ec[_0x53d056(0x16d)][_0x53d056(0x165)](),{'verbose':_0x3d2c4d[_0x53d056(0x170)]});return await handleSDKOutput(_0x19208d['data'],_0x3d2c4d),0x0;}catch(_0x54ac0b){return handleSDKError(_0x54ac0b,_0x3d2c4d),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a28_0x9865ec(0x146)]=a28_0x9865ec(0x12b);[a28_0x9865ec(0x14a)]='List\x20all\x20LLM\x20projects';async[a28_0x9865ec(0x19c)](_0x59bf62){const _0x1b7cd9=a28_0x9865ec,{options:_0x4db277,args:_0x10dd77,tdx:_0x469b46}=_0x59bf62,_0x374c58=getChalk(_0x4db277),_0x285607=_0x4db277[_0x1b7cd9(0xed)];try{const _0x2ad8e1=_0x10dd77[0x0],_0x1fd568=resolveLimit(_0x4db277[_0x1b7cd9(0x153)],DEFAULT_LLM_LIMIT),_0x5de223=await withSpinner(_0x1b7cd9(0x13f),()=>_0x469b46['llm'][_0x1b7cd9(0xf5)](_0x1fd568),{'verbose':_0x4db277['verbose']});let _0x472f7a=_0x5de223[_0x1b7cd9(0x173)];_0x2ad8e1&&(_0x472f7a=_0x5de223['data'][_0x1b7cd9(0x117)](_0x1749bc=>matchGlobPattern(_0x1749bc['attributes'][_0x1b7cd9(0x146)],_0x2ad8e1)));const _0x5c003f=_0x4db277[_0x1b7cd9(0x18d)]===_0x1b7cd9(0x1a2)||_0x4db277['format']==='jsonl'||_0x4db277[_0x1b7cd9(0x18d)]===_0x1b7cd9(0x119)||_0x4db277['format']==='tsv';if(_0x5c003f){const _0xa32c33=_0x472f7a[_0x1b7cd9(0x1a8)](_0x2a18cf=>({...toLLMProjectInfo(_0x2a18cf),'url':getLLMProjectUrl(_0x285607,_0x2a18cf['id'])}));await handleSDKOutput(_0xa32c33,_0x4db277);}else{const _0x590996=[];if(_0x472f7a[_0x1b7cd9(0xde)]===0x0)_0x590996[_0x1b7cd9(0x191)](_0x374c58[_0x1b7cd9(0x171)](_0x1b7cd9(0x134)));else{const _0x304e91=[..._0x472f7a][_0x1b7cd9(0x12a)]((_0x3a27de,_0x29ef13)=>_0x3a27de['attributes'][_0x1b7cd9(0x146)][_0x1b7cd9(0x13b)](_0x29ef13['attributes'][_0x1b7cd9(0x146)]));for(const _0x3911d7 of _0x304e91){const _0xce2c73=getLLMProjectUrl(_0x285607,_0x3911d7['id']),_0xa8f5cd=hyperlink(_0x3911d7[_0x1b7cd9(0x1a6)][_0x1b7cd9(0x146)],_0xce2c73);_0x590996[_0x1b7cd9(0x191)](_0x1b7cd9(0x180)+_0xa8f5cd);}_0x590996[_0x1b7cd9(0x191)](_0x374c58[_0x1b7cd9(0x171)](_0x472f7a[_0x1b7cd9(0xde)]+_0x1b7cd9(0x149)));}await writeOutput(_0x590996[_0x1b7cd9(0x19f)]('\x0a'),_0x4db277[_0x1b7cd9(0x1a1)],_0x1b7cd9(0x119));}return 0x0;}catch(_0x1b29dc){return handleSDKError(_0x1b29dc,_0x4db277),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a28_0x9865ec(0x146)]=a28_0x9865ec(0x184);[a28_0x9865ec(0x14a)]=a28_0x9865ec(0x111);async['execute'](_0x4776e5){const _0x4685b5=a28_0x9865ec,{options:_0x553a1d,args:_0xf1b2cc,tdx:_0x1917a7}=_0x4776e5,_0x51698b=getChalk(_0x553a1d),_0x46961c=_0x553a1d[_0x4685b5(0xed)];try{const _0x497abd=_0xf1b2cc[0x0];let _0x49a2b3=_0x497abd,_0x377f9b,_0xeebeba;if(_0x497abd&&_0x497abd[_0x4685b5(0x10e)]('/')){const _0x18f571=_0x497abd[_0x4685b5(0x154)]('/');if(_0x18f571['length']===0x2){const [_0xd78dd3,_0x389c98]=_0x18f571,_0x42b340=await _0x1917a7[_0x4685b5(0x16d)][_0x4685b5(0xf5)](),_0x398c96=_0x42b340['find'](_0x1b5f03=>_0x1b5f03[_0x4685b5(0x1a6)][_0x4685b5(0x146)][_0x4685b5(0xdf)]()===_0xd78dd3[_0x4685b5(0xdf)]());if(!_0x398c96)throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],'Project\x20not\x20found:\x20'+_0xd78dd3,undefined,{'helpText':_0x4685b5(0x18f)});_0x377f9b=_0x398c96['id'],_0xeebeba=_0x398c96['attributes'][_0x4685b5(0x146)],_0x49a2b3=_0x389c98;}else throw new SDKError(ErrorCode[_0x4685b5(0xff)],_0x4685b5(0x1ac)+_0x497abd,undefined,{'helpText':_0x4685b5(0x168)});}else{const _0x114b26=await getProjectWithName(_0x4776e5);_0x377f9b=_0x114b26['id'],_0xeebeba=_0x114b26[_0x4685b5(0x146)];}const _0x5bd3ae=await withSpinner('Fetching\x20agents...',()=>_0x1917a7[_0x4685b5(0x16d)][_0x4685b5(0x157)](_0x377f9b),{'verbose':_0x553a1d[_0x4685b5(0x170)]});let _0x14ff14=_0x5bd3ae[_0x4685b5(0x173)];_0x49a2b3&&(_0x14ff14=_0x5bd3ae['data']['filter'](_0x3db2d3=>matchGlobPattern(_0x3db2d3[_0x4685b5(0x1a6)]['name'],_0x49a2b3)));const _0x4721c0=_0x553a1d[_0x4685b5(0x18d)]===_0x4685b5(0x1a2)||_0x553a1d[_0x4685b5(0x18d)]==='jsonl'||_0x553a1d[_0x4685b5(0x18d)]===_0x4685b5(0x119)||_0x553a1d[_0x4685b5(0x18d)]===_0x4685b5(0x169);if(_0x4721c0){const _0x13ea72=_0x14ff14['map'](_0x5a6931=>({...toAgentInfo(_0x5a6931),'chatUrl':getLLMAgentChatUrl(_0x46961c,_0x377f9b,_0x5a6931['id'])}));await handleSDKOutput(_0x13ea72,_0x553a1d);}else{const _0x5e9440=[];_0x5e9440[_0x4685b5(0x191)](_0x51698b['dim']('['+_0xeebeba+']'));if(_0x14ff14[_0x4685b5(0xde)]===0x0)_0x5e9440[_0x4685b5(0x191)](_0x51698b['dim'](_0x4685b5(0x115)));else{const _0x3d8d96=[..._0x14ff14][_0x4685b5(0x12a)]((_0x201e00,_0x34322f)=>_0x201e00[_0x4685b5(0x1a6)][_0x4685b5(0x146)][_0x4685b5(0x13b)](_0x34322f[_0x4685b5(0x1a6)][_0x4685b5(0x146)]));for(const _0x49d34a of _0x3d8d96){const _0x4c6d52=getLLMAgentChatUrl(_0x46961c,_0x377f9b,_0x49d34a['id']),_0x170d36=hyperlink(_0x49d34a[_0x4685b5(0x1a6)][_0x4685b5(0x146)],_0x4c6d52);_0x5e9440[_0x4685b5(0x191)](_0x4685b5(0x15b)+_0x170d36);}_0x5e9440['push'](_0x51698b[_0x4685b5(0x171)](_0x14ff14[_0x4685b5(0xde)]+_0x4685b5(0x106)));}await writeOutput(_0x5e9440[_0x4685b5(0x19f)]('\x0a'),_0x553a1d[_0x4685b5(0x1a1)],_0x4685b5(0x119));}return 0x0;}catch(_0x320d67){return handleSDKError(_0x320d67,_0x553a1d),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a28_0x9865ec(0x146)]=a28_0x9865ec(0x151);[a28_0x9865ec(0x14a)]='Show\x20agent\x20details';async['execute'](_0x3903c6){const _0x48ddd1=a28_0x9865ec,{options:_0xd3fae6,args:_0x390aa5,tdx:_0x25bedb}=_0x3903c6;if(_0x390aa5[_0x48ddd1(0xde)]===0x0)return console[_0x48ddd1(0x100)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x48ddd1(0x100)]('Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>'),0x1;const _0x6766a8=_0x390aa5[0x0];try{const _0x269845=await getProjectIdOrDefault(_0x3903c6),_0x70c31b=await withSpinner(_0x48ddd1(0xeb)+_0x6766a8+_0x48ddd1(0xd4),()=>_0x25bedb[_0x48ddd1(0x16d)][_0x48ddd1(0x110)](_0x6766a8,_0x269845),{'verbose':_0xd3fae6[_0x48ddd1(0x170)]}),_0x4acb9b=await withSpinner(_0x48ddd1(0x181),()=>_0x25bedb[_0x48ddd1(0x16d)][_0x48ddd1(0x162)](_0x70c31b[_0x48ddd1(0x173)]),{'verbose':_0xd3fae6[_0x48ddd1(0x170)]});return await handleSDKOutput([_0x4acb9b[_0x48ddd1(0x173)]],_0xd3fae6),0x0;}catch(_0x344545){return handleSDKError(_0x344545,_0xd3fae6),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{['name']='llm:agent:create';[a28_0x9865ec(0x14a)]=a28_0x9865ec(0x11d);async[a28_0x9865ec(0x19c)](_0x403368){const _0x244402=a28_0x9865ec,{options:_0x4dc12c,args:_0x2043bb,tdx:_0x2031a9}=_0x403368;if(_0x2043bb[_0x244402(0xde)]===0x0)return console[_0x244402(0x100)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x244402(0x100)](_0x244402(0x167)),console[_0x244402(0x100)](_0x244402(0x109)),0x1;const _0x38d4de=_0x2043bb[0x0],_0x3a5743=_0x4dc12c,_0x344cf7=_0x3a5743[_0x244402(0x177)],_0x1cfd80=_0x3a5743[_0x244402(0x124)]||_0x244402(0x139),_0x2b518a=_0x3a5743['starterMessage'],_0xa4abce=_0x3a5743['maxToolIterations']?Number(_0x3a5743['maxToolIterations']):undefined,_0x592193=_0x3a5743[_0x244402(0x101)]?Number(_0x3a5743['temperature']):undefined;try{let _0x1ff5a4,_0x1103a6;if(_0x38d4de['includes']('/')){const _0x2e5c19=_0x38d4de[_0x244402(0x154)]('/');if(_0x2e5c19['length']===0x2){const [_0x33b981,_0x3b291d]=_0x2e5c19,_0x13d32b=await withSpinner(_0x244402(0x192)+_0x33b981+'\x27...',()=>_0x2031a9['llm']['resolveProjectId'](_0x33b981),{'verbose':_0x4dc12c[_0x244402(0x170)]});_0x1ff5a4=_0x13d32b['data'],_0x1103a6=_0x3b291d;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x244402(0x1ac)+_0x38d4de,undefined,{'helpText':_0x244402(0x168)});}else _0x1ff5a4=await getProjectIdOrDefault(_0x403368),_0x1103a6=_0x38d4de;const _0x2bc2c6=await withSpinner(_0x244402(0x194)+_0x1103a6+'\x27...',()=>_0x2031a9[_0x244402(0x16d)][_0x244402(0x1ab)]({'name':_0x1103a6,'projectId':_0x1ff5a4,'modelType':_0x1cfd80,'systemPrompt':_0x344cf7,'starterMessage':_0x2b518a,'maxToolIterations':_0xa4abce,'temperature':_0x592193}),{'verbose':_0x4dc12c[_0x244402(0x170)]});return console[_0x244402(0x11a)](_0x244402(0x19a)+_0x2bc2c6[_0x244402(0x173)]['id']),await handleSDKOutput([_0x2bc2c6[_0x244402(0x173)]],_0x4dc12c),0x0;}catch(_0x1e4858){return handleSDKError(_0x1e4858,_0x4dc12c),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{['name']='llm:agent:update';[a28_0x9865ec(0x14a)]=a28_0x9865ec(0x17c);async[a28_0x9865ec(0x19c)](_0x5532b6){const _0x25a4b8=a28_0x9865ec,{options:_0x56427,args:_0x49291c,tdx:_0xfe3422}=_0x5532b6;if(_0x49291c[_0x25a4b8(0xde)]===0x0)return console['error'](_0x25a4b8(0x122)),console[_0x25a4b8(0x100)](_0x25a4b8(0xda)),0x1;const _0x332a1e=_0x49291c[0x0],_0x5f1b3f=_0x56427,_0xe562da=_0x5f1b3f['name'],_0x3cdccc=_0x5f1b3f[_0x25a4b8(0x16b)],_0x4326c1=_0x5f1b3f[_0x25a4b8(0x14a)],_0x12ca9f=_0x5f1b3f[_0x25a4b8(0x178)];if(!_0xe562da&&!_0x3cdccc&&!_0x4326c1&&!_0x12ca9f)return console[_0x25a4b8(0x100)](_0x25a4b8(0xfd)),console['error'](_0x25a4b8(0x145)),0x1;try{const _0x175f33=await getProjectIdOrDefault(_0x5532b6),_0xd7e808=await withSpinner('Resolving\x20agent\x20\x27'+_0x332a1e+_0x25a4b8(0xd4),()=>_0xfe3422['llm'][_0x25a4b8(0x110)](_0x332a1e,_0x175f33),{'verbose':_0x56427['verbose']}),_0x5813d2=_0xd7e808[_0x25a4b8(0x173)],_0x4a432b=await withSpinner('Updating\x20agent...',()=>_0xfe3422['llm'][_0x25a4b8(0x1a4)](_0x5813d2,{'name':_0xe562da,'prompt':_0x3cdccc,'description':_0x4326c1,'starterMessage':_0x12ca9f}),{'verbose':_0x56427[_0x25a4b8(0x170)]});return console['log']('Agent\x20updated:\x20'+_0x4a432b['data']['id']),await handleSDKOutput([_0x4a432b['data']],_0x56427),0x0;}catch(_0x270526){return handleSDKError(_0x270526,_0x56427),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a28_0x9865ec(0x146)]=a28_0x9865ec(0x138);[a28_0x9865ec(0x14a)]=a28_0x9865ec(0x11c);async[a28_0x9865ec(0x19c)](_0x2395b5){const _0x31bb36=a28_0x9865ec,{options:_0x41b250,args:_0x3747e5,tdx:_0x201a98}=_0x2395b5;if(_0x3747e5[_0x31bb36(0xde)]===0x0)return console[_0x31bb36(0x100)](_0x31bb36(0x122)),console[_0x31bb36(0x100)](_0x31bb36(0x19e)),0x1;const _0x42e6b7=_0x3747e5[0x0];try{const _0x1f5530=await getProjectIdOrDefault(_0x2395b5),_0x489c08=await withSpinner(_0x31bb36(0xeb)+_0x42e6b7+_0x31bb36(0xd4),()=>_0x201a98[_0x31bb36(0x16d)]['resolveAgentId'](_0x42e6b7,_0x1f5530),{'verbose':_0x41b250[_0x31bb36(0x170)]}),_0x56d25d=_0x489c08[_0x31bb36(0x173)];return await withSpinner('Deleting\x20agent...',()=>_0x201a98[_0x31bb36(0x16d)][_0x31bb36(0xd5)](_0x56d25d),{'verbose':_0x41b250['verbose']}),console[_0x31bb36(0x11a)]('Agent\x20deleted:\x20'+_0x56d25d),0x0;}catch(_0x37fabd){return handleSDKError(_0x37fabd,_0x41b250),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a28_0x9865ec(0x146)]='llm:history';[a28_0x9865ec(0x14a)]=a28_0x9865ec(0x123);async[a28_0x9865ec(0x19c)](_0x19a221){const _0x4cd3d4=a28_0x9865ec;return executeChatHistoryCommand(_0x19a221,_0x4cd3d4(0x132));}}export class LLMUseCommand extends BaseCommand{[a28_0x9865ec(0x146)]=a28_0x9865ec(0x16a);[a28_0x9865ec(0x14a)]='Set\x20current\x20project\x20context';async['execute'](_0x2d5d50){const _0xa49b06=a28_0x9865ec,{options:_0x1ddd70,args:_0x2a6456,tdx:_0x3355c3}=_0x2d5d50;if(_0x2a6456[_0xa49b06(0xde)]===0x0)return console[_0xa49b06(0x100)](_0xa49b06(0x182)),console[_0xa49b06(0x100)](_0xa49b06(0x14e)),0x1;const _0x101f2a=_0x2a6456[0x0];try{await withSpinner(_0xa49b06(0x14f)+_0x101f2a+_0xa49b06(0xd4),()=>_0x3355c3[_0xa49b06(0x16d)][_0xa49b06(0x187)](_0x101f2a),{'verbose':_0x1ddd70[_0xa49b06(0x170)]}),saveSessionContext({'llm_project':_0x101f2a},_0x1ddd70[_0xa49b06(0xd8)]);const _0x3ae028=getChalk(_0x1ddd70);return console['log'](_0xa49b06(0x188)+_0x3ae028[_0xa49b06(0x1a0)](_0x101f2a)),0x0;}catch(_0x3d1ebe){return handleSDKError(_0x3d1ebe,_0x1ddd70),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a28_0x9865ec(0x146)]=a28_0x9865ec(0x14d);[a28_0x9865ec(0x14a)]=a28_0x9865ec(0xf7);async['execute'](_0x5babd2){const _0x36eb01=a28_0x9865ec,{options:_0x5e5fd4,args:_0x3eea8d,tdx:_0x5b16cc}=_0x5babd2;if(_0x3eea8d['length']===0x0)return console[_0x36eb01(0x100)](_0x36eb01(0x182)),console['error'](_0x36eb01(0x17a)),0x1;const _0x11ddd6=_0x3eea8d[0x0],_0x5372b7=_0x5e5fd4,_0x23d607=_0x5372b7['description'];try{const _0x192dec=await withSpinner(_0x36eb01(0x172)+_0x11ddd6+_0x36eb01(0xd4),()=>_0x5b16cc['llm']['createProject']({'name':_0x11ddd6,'description':_0x23d607}),{'verbose':_0x5e5fd4[_0x36eb01(0x170)]});console[_0x36eb01(0x11a)](_0x36eb01(0x13d)+_0x192dec[_0x36eb01(0x173)]['id']);const _0x47dace=toLLMProjectInfo(_0x192dec['data']);return await handleSDKOutput([_0x47dace],_0x5e5fd4),0x0;}catch(_0x396f83){return handleSDKError(_0x396f83,_0x5e5fd4),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a28_0x9865ec(0x146)]=a28_0x9865ec(0x10f);['description']='Delete\x20an\x20LLM\x20project';async['execute'](_0x36d8e3){const _0x2d205a=a28_0x9865ec,{options:_0x2c8c26,args:_0x2e6728,tdx:_0x113959}=_0x36d8e3;if(_0x2e6728[_0x2d205a(0xde)]===0x0)return console['error'](_0x2d205a(0x182)),console[_0x2d205a(0x100)]('Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>'),0x1;const _0x482720=_0x2e6728[0x0];try{return await withSpinner(_0x2d205a(0x10a)+_0x482720+'\x27...',()=>_0x113959[_0x2d205a(0x16d)][_0x2d205a(0x189)](_0x482720),{'verbose':_0x2c8c26[_0x2d205a(0x170)]}),console[_0x2d205a(0x11a)](_0x2d205a(0x103)+_0x482720),0x0;}catch(_0x5db571){return handleSDKError(_0x5db571,_0x2c8c26),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{['name']=a28_0x9865ec(0x14b);[a28_0x9865ec(0x14a)]=a28_0x9865ec(0x108);async[a28_0x9865ec(0x19c)](_0x577cdc){const _0x543b0e=a28_0x9865ec,{options:_0x610885,args:_0xc3f29a,tdx:_0x4aeba6}=_0x577cdc,_0x428d96=getChalk(_0x610885);console[_0x543b0e(0x11a)](_0x428d96[_0x543b0e(0x156)](_0x543b0e(0xdb))),console[_0x543b0e(0x11a)](_0x428d96['yellow']('\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.')),console[_0x543b0e(0x11a)](_0x428d96[_0x543b0e(0x171)](_0x543b0e(0x1a9))),console[_0x543b0e(0x11a)]();if(_0xc3f29a[_0x543b0e(0xde)]===0x0)return console['error'](_0x543b0e(0x182)),console['error']('Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]'),0x1;const _0x1fd879=_0xc3f29a[0x0],_0x102231=_0x610885,_0x71dcc1=_0x102231[_0x543b0e(0x1a1)],_0x9bb4fc=_0x102231['dryRun'];try{const _0x58f62e=_0x71dcc1||_0x1fd879+'.llm';if(a28_0x4cac73['existsSync'](_0x58f62e)&&!_0x9bb4fc){if(!_0x610885[_0x543b0e(0x14c)]){const _0x4307cf=await confirm(_0x543b0e(0xfe)+_0x58f62e+_0x543b0e(0x102));if(!_0x4307cf)return console[_0x543b0e(0x11a)](_0x543b0e(0xe0)),0x0;}a28_0x4cac73[_0x543b0e(0x130)](_0x58f62e,{'recursive':!![]});}const _0x3697d4=await withSpinner(_0x9bb4fc?_0x543b0e(0xd3)+_0x1fd879+_0x543b0e(0xd4):_0x543b0e(0x147)+_0x1fd879+'\x27...',()=>_0x4aeba6[_0x543b0e(0x16d)]['backupProject'](_0x1fd879,_0x71dcc1,{'dryRun':_0x9bb4fc}),{'verbose':_0x610885[_0x543b0e(0x170)]}),_0x32af74=_0x3697d4[_0x543b0e(0x173)];return _0x9bb4fc?console[_0x543b0e(0x11a)](_0x543b0e(0x1ad)+_0x32af74[_0x543b0e(0x15c)]):console[_0x543b0e(0x11a)]('Project\x20backed\x20up\x20to:\x20'+_0x32af74[_0x543b0e(0x15c)]),console['log'](_0x543b0e(0x140)+_0x32af74[_0x543b0e(0x19d)][_0x543b0e(0x157)]),console[_0x543b0e(0x11a)](_0x543b0e(0x18e)+_0x32af74['counts'][_0x543b0e(0x161)]),console[_0x543b0e(0x11a)](_0x543b0e(0x13a)+_0x32af74[_0x543b0e(0x19d)][_0x543b0e(0x174)]),console[_0x543b0e(0x11a)](_0x543b0e(0x114)+_0x32af74[_0x543b0e(0x19d)][_0x543b0e(0xe2)]),(_0x610885[_0x543b0e(0x18d)]===_0x543b0e(0x1a2)||_0x610885['format']==='jsonl')&&await handleSDKOutput([_0x32af74],_0x610885),0x0;}catch(_0x42d1bf){return handleSDKError(_0x42d1bf,_0x610885),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a28_0x9865ec(0x146)]='llm:project:restore';[a28_0x9865ec(0x14a)]=a28_0x9865ec(0x1b1);async['execute'](_0x3cd886){const _0x299bbe=a28_0x9865ec,{options:_0x464062,args:_0x3a9c84,tdx:_0x2c368b}=_0x3cd886,_0x147466=getChalk(_0x464062);console[_0x299bbe(0x11a)](_0x147466[_0x299bbe(0x156)](_0x299bbe(0x1aa))),console[_0x299bbe(0x11a)](_0x147466['yellow']('\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.')),console[_0x299bbe(0x11a)](_0x147466[_0x299bbe(0x171)](_0x299bbe(0x10c))),console[_0x299bbe(0x11a)](_0x147466[_0x299bbe(0x171)](_0x299bbe(0xd9))),console[_0x299bbe(0x11a)](_0x147466[_0x299bbe(0x171)]('\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22')),console[_0x299bbe(0x11a)]();if(_0x3a9c84[_0x299bbe(0xde)]===0x0)return console[_0x299bbe(0x100)](_0x299bbe(0x142)),console[_0x299bbe(0x100)](_0x299bbe(0xea)),0x1;const _0x2ef3bd=_0x3a9c84[0x0],_0x5f34f2=_0x464062,_0x19ebef=_0x5f34f2[_0x299bbe(0x146)],_0x46a188=_0x5f34f2[_0x299bbe(0x133)];try{if(!_0x46a188){const _0x3dcfea=_0x2c368b[_0x299bbe(0x16d)][_0x299bbe(0x158)](_0x2ef3bd),_0x1c0a78=_0x19ebef||_0x3dcfea['exportedFrom'][_0x299bbe(0x113)],_0x8fdf5a=await withSpinner(_0x299bbe(0x166),()=>_0x2c368b['llm'][_0x299bbe(0xf5)](),{'verbose':_0x464062[_0x299bbe(0x170)]}),_0x58ec10=_0x8fdf5a[_0x299bbe(0x173)][_0x299bbe(0x129)](_0x42571e=>_0x42571e[_0x299bbe(0x1a6)][_0x299bbe(0x146)]===_0x1c0a78);if(_0x58ec10&&!_0x464062[_0x299bbe(0x14c)]){const _0x7a77e9=await confirm(_0x299bbe(0x116)+_0x1c0a78+_0x299bbe(0x164));if(!_0x7a77e9)return console[_0x299bbe(0x11a)](_0x299bbe(0x183)),0x0;}}const _0x172e96=await withSpinner(_0x46a188?'Validating\x20backup\x20from\x20\x27'+_0x2ef3bd+_0x299bbe(0xd4):_0x299bbe(0xf9)+_0x2ef3bd+'\x27...',()=>_0x2c368b[_0x299bbe(0x16d)]['restoreProject'](_0x2ef3bd,{'name':_0x19ebef,'dryRun':_0x46a188}),{'verbose':_0x464062[_0x299bbe(0x170)]}),_0x51c0fb=_0x172e96['data'];return _0x51c0fb['sourceSite']&&console[_0x299bbe(0x11a)]('[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27'+_0x51c0fb[_0x299bbe(0x195)]+'\x27'),_0x46a188?console[_0x299bbe(0x11a)](_0x299bbe(0x1af)+_0x51c0fb['projectName']):console['log']('Project\x20restored:\x20'+_0x51c0fb[_0x299bbe(0x113)]+'\x20('+_0x51c0fb[_0x299bbe(0x17b)]+')'),console[_0x299bbe(0x11a)](_0x299bbe(0x140)+_0x51c0fb[_0x299bbe(0x19d)][_0x299bbe(0x157)]),console['log'](_0x299bbe(0x18e)+_0x51c0fb['counts'][_0x299bbe(0x161)]),console['log'](_0x299bbe(0x13a)+_0x51c0fb[_0x299bbe(0x19d)]['prompts']),console[_0x299bbe(0x11a)]('\x20\x20Integrations:\x20'+_0x51c0fb['counts'][_0x299bbe(0xe2)]),(_0x464062['format']===_0x299bbe(0x1a2)||_0x464062[_0x299bbe(0x18d)]===_0x299bbe(0x179))&&await handleSDKOutput([_0x51c0fb],_0x464062),0x0;}catch(_0x322bdb){return handleSDKError(_0x322bdb,_0x464062),0x1;}}}function a28_0x455a(_0x48061b,_0x27f25f){_0x48061b=_0x48061b-0xd1;const _0x9874b4=a28_0x9874();let _0x455adf=_0x9874b4[_0x48061b];return _0x455adf;}function a28_0x9874(){const _0x41e848=['log','m\x20ago','Delete\x20an\x20agent','Create\x20a\x20new\x20agent\x20in\x20current\x20project','Fetching\x20most\x20recent\x20chat...','Select\x20a\x20chat\x20session:','__load_more__','...','Error:\x20Agent\x20name\x20is\x20required','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','model','\x0aStack\x20trace:','stringify','904mqwVRa','just\x20now','find','sort','llm:projects','341214FsOuWx','Fetching\x20chat\x20sessions...','all','slice','rmSync','11DtSLUl','tdx\x20llm\x20history','dryRun','No\x20projects\x20found','Error:\x20','floor','[output]\x20','llm:agent:delete','claude-4.5-haiku','\x20\x20Prompts:\x20','localeCompare','[content]','Project\x20created:\x20','blue','Fetching\x20projects...','\x20\x20Agents:\x20','substring','Error:\x20Backup\x20folder\x20path\x20is\x20required','default','short','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','name','Backing\x20up\x20project\x20\x27','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','\x20project(s)','description','llm:project:backup','yes','llm:project:create','Usage:\x20tdx\x20llm\x20use\x20<project-name>','Setting\x20project\x20context\x20to\x20\x27','d\x20ago','llm:agent:show','\x20\x20Cause:\x20','limit','split','2545LKUedF','yellow','agents','getBackupMetadata','tool','1909ZyLGRt','🤖\x20','outputDir','[error]\x20\x20','getCurrentProject','[input]\x20\x20','targetKnowledgeBase','knowledgeBases','agent','targetAgent','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','models','Checking\x20for\x20existing\x20projects...','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','Use\x20format:\x20project-name/agent-name','tsv','llm:use','prompt','content','llm','[tool]\x20\x20\x20','get','verbose','dim','Creating\x20project\x20\x27','data','prompts','createdAt','h\x20ago','systemPrompt','starterMessage','jsonl','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','projectId','Update\x20an\x20existing\x20agent','bold','1763358rZvvqB','[tool_call]','⚒️\x20','Fetching\x20agent...','Error:\x20Project\x20name\x20is\x20required','Restore\x20cancelled.','llm:agents','9Behrhh','314SxCidb','setCurrentProject','Session\x20llm_project\x20set\x20to:\x20','deleteProject','llmProject','Fetching\x20chat\x20log\x20for\x20\x27','magenta','format','\x20\x20Knowledge\x20Bases:\x20','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','targetImageGenerator','push','Resolving\x20project\x20\x27','image','Creating\x20agent\x20\x27','sourceSite','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','stack','\x20->\x20Agent:','en-US','Agent\x20created:\x20','\x20->\x20ImageGen:','execute','counts','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','join','green','output','json','\x20->\x20WebSearch:','updateAgent','Error:\x20chat-id\x20is\x20required','attributes','\x20-\x20','map','\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.','createAgent','Invalid\x20path\x20syntax:\x20','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','agentId','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','cyan','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','7hPxkWQ','red','Analyzing\x20project\x20\x27','\x27...','deleteAgent','Load\x20more...','chatId','session','\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','last','Show\x20chat\x20log','length','toLowerCase','Backup\x20cancelled.','llm:models','integrations','input','Fetching\x20chat\x20history\x20for\x20\x27','chats','Usage:\x20TDX_EXPERIMENTAL=true\x20tdx\x20llm\x20log\x20<chat-id>','No\x20chat\x20sessions\x20found.','set','firstInputContent','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','Resolving\x20agent\x20\x27','keys','site','message','(no\x20message)','2258352rRFJzm','9064020qaqCwp','numeric','targetWebSearchTool','[image]\x20\x20','projects','\x20->\x20KB:','Create\x20a\x20new\x20LLM\x20project','updatedAt','Restoring\x20project\x20from\x20\x27','(no\x20agent)','cause','resolveProjectId','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','Output\x20directory\x20\x27','INVALID_ARGUMENT','error','temperature','\x27\x20already\x20exists.\x20Overwrite?','Project\x20deleted:\x20','history','[unknown]','\x20agent(s)','select','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','Deleting\x20project\x20\x27','No\x20messages\x20found\x20in\x20chat\x20history.','\x20\x20\x20Examples:','494920bRQgJV','includes','llm:project:delete','resolveAgentId','List\x20agents\x20in\x20current\x20project','toLocaleDateString','projectName','\x20\x20Integrations:\x20','No\x20agents\x20found','A\x20project\x20named\x20\x27','filter','tool_call','table'];a28_0x9874=function(){return _0x41e848;};return a28_0x9874();}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x26494f,_0x339e75){const _0x1bf52d=a28_0x9865ec,_0x1c6567=_0x339e75[_0x1bf52d(0x153)]||CHAT_SELECTOR_PAGE_SIZE;let _0x50b6ad=0x0,_0x433114=[];const _0x279009=(await import('prompts'))[_0x1bf52d(0x143)],_0x212b14=getChalk(_0x339e75);while(!![]){const _0x3fba68=await withSpinner(_0x1bf52d(0x12d),()=>_0x26494f[_0x1bf52d(0x16d)][_0x1bf52d(0xe5)](_0x1c6567+_0x50b6ad),{'verbose':_0x339e75[_0x1bf52d(0x170)]});_0x433114=_0x3fba68[_0x1bf52d(0x173)];const _0x37cad1=_0x433114[_0x1bf52d(0x12f)](_0x50b6ad,_0x50b6ad+_0x1c6567),_0x496aed=_0x433114[_0x1bf52d(0xde)]>_0x50b6ad+_0x1c6567,_0x5480e8=[...new Set(_0x37cad1['map'](_0x35d4c1=>_0x35d4c1[_0x1bf52d(0x1a6)][_0x1bf52d(0x1ae)])[_0x1bf52d(0x117)](_0x75bfb0=>_0x75bfb0!==undefined))],_0x541332=new Map();await Promise[_0x1bf52d(0x12e)](_0x5480e8[_0x1bf52d(0x1a8)](async _0x42e3ca=>{const _0x3a540f=_0x1bf52d;try{const _0x534989=await _0x26494f[_0x3a540f(0x16d)]['agent'](_0x42e3ca);_0x541332[_0x3a540f(0xe8)](_0x42e3ca,_0x534989['attributes'][_0x3a540f(0x146)]);}catch{_0x541332[_0x3a540f(0xe8)](_0x42e3ca,_0x42e3ca);}}));const _0x412179=_0x37cad1['map'](_0x8df9ae=>{const _0x3111b0=_0x1bf52d,_0xdd576c=_0x8df9ae['attributes'][_0x3111b0(0xe9)]||_0x3111b0(0xef),_0x4a8a3=_0xdd576c[_0x3111b0(0x154)]('\x0a')[0x0],_0x5d8b00=_0x4a8a3[_0x3111b0(0xde)]>0x50?_0x4a8a3[_0x3111b0(0x141)](0x0,0x4d)+_0x3111b0(0x121):_0x4a8a3,_0x21329e=_0x8df9ae[_0x3111b0(0x1a6)][_0x3111b0(0x1ae)]?_0x541332[_0x3111b0(0x16f)](_0x8df9ae['attributes'][_0x3111b0(0x1ae)])||_0x8df9ae['attributes'][_0x3111b0(0x1ae)]:_0x3111b0(0xfa),_0x1cc6f4=_0x8df9ae['attributes']['lastConversationAt']||_0x8df9ae[_0x3111b0(0x1a6)][_0x3111b0(0xf8)],_0x2fa58a=new Date(_0x1cc6f4),_0x5b6a0a=new Date(),_0x262303=_0x5b6a0a['getTime']()-_0x2fa58a['getTime'](),_0x50be16=Math[_0x3111b0(0x136)](_0x262303/0xea60),_0x174c61=Math[_0x3111b0(0x136)](_0x262303/0x36ee80),_0x243dad=Math[_0x3111b0(0x136)](_0x262303/0x5265c00);let _0x350dc9;if(_0x50be16<0x1)_0x350dc9=_0x3111b0(0x128);else{if(_0x50be16<0x3c)_0x350dc9=_0x50be16+_0x3111b0(0x11b);else{if(_0x174c61<0x18)_0x350dc9=_0x174c61+_0x3111b0(0x176);else _0x243dad<0x7?_0x350dc9=_0x243dad+_0x3111b0(0x150):_0x350dc9=_0x2fa58a[_0x3111b0(0x112)](_0x3111b0(0x199),{'month':_0x3111b0(0x144),'day':_0x3111b0(0xf2)});}}return{'title':_0x5d8b00+'\x20'+_0x212b14[_0x3111b0(0x171)]('['+_0x21329e+']\x20'+_0x350dc9),'value':_0x8df9ae['id']};});_0x496aed&&_0x412179['push']({'title':_0x212b14[_0x1bf52d(0x1b0)](_0x1bf52d(0xd6)),'value':_0x1bf52d(0x120)});const _0x3029f0=await _0x279009({'type':_0x1bf52d(0x107),'name':_0x1bf52d(0xd7),'message':_0x1bf52d(0x11f),'choices':_0x412179,'hint':'Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel'});if(!_0x3029f0[_0x1bf52d(0xd7)])return undefined;if(_0x3029f0['chatId']==='__load_more__'){_0x50b6ad+=_0x1c6567;continue;}return _0x3029f0['chatId'];}}export class ChatsCommand extends BaseCommand{[a28_0x9865ec(0x146)]=a28_0x9865ec(0xe5);[a28_0x9865ec(0x14a)]=a28_0x9865ec(0x148);async[a28_0x9865ec(0x19c)](_0x40ec9e){return executeChatHistoryCommand(_0x40ec9e,'tdx\x20chats');}}export class LLMLogCommand extends BaseCommand{[a28_0x9865ec(0x146)]='llm:log';[a28_0x9865ec(0x14a)]=a28_0x9865ec(0xdd);async[a28_0x9865ec(0x19c)](_0x21b260){const _0x49e9e0=a28_0x9865ec,{options:_0x5afb0a,args:_0x3a7c06,tdx:_0x3bb11f}=_0x21b260,_0x1a2bba=_0x3a7c06[0x0];if(!_0x1a2bba)return console[_0x49e9e0(0x100)](_0x49e9e0(0x1a5)),console[_0x49e9e0(0x100)](_0x49e9e0(0xe6)),0x1;const _0x53dbce=await withSpinner(_0x49e9e0(0x18b)+_0x1a2bba+'\x27...',()=>_0x3bb11f[_0x49e9e0(0x16d)]['getChatLog'](_0x1a2bba),{'verbose':_0x5afb0a[_0x49e9e0(0x170)]});return await handleSDKOutput(_0x53dbce['data'][_0x49e9e0(0x173)],_0x5afb0a),0x0;}}
1
+ const a28_0x99278d=a28_0x4ecf;(function(_0x1a0e1f,_0x145697){const _0x33645c=a28_0x4ecf,_0x3d3fde=_0x1a0e1f();while(!![]){try{const _0xe0bd04=-parseInt(_0x33645c(0x17d))/0x1+-parseInt(_0x33645c(0x11b))/0x2+-parseInt(_0x33645c(0x11f))/0x3*(parseInt(_0x33645c(0x13a))/0x4)+-parseInt(_0x33645c(0x124))/0x5*(parseInt(_0x33645c(0x197))/0x6)+parseInt(_0x33645c(0xe3))/0x7+-parseInt(_0x33645c(0x15f))/0x8+-parseInt(_0x33645c(0x120))/0x9*(-parseInt(_0x33645c(0x154))/0xa);if(_0xe0bd04===_0x145697)break;else _0x3d3fde['push'](_0x3d3fde['shift']());}catch(_0x22852e){_0x3d3fde['push'](_0x3d3fde['shift']());}}}(a28_0xeba0,0x5e198));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{confirm}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import*as a28_0x494372 from'node:fs';function handleSDKError(_0x4eddc8,_0x21f078){const _0x46622c=a28_0x4ecf;if(_0x4eddc8 instanceof SDKError)console[_0x46622c(0x1ab)](_0x46622c(0x142)+_0x4eddc8[_0x46622c(0xf7)]),_0x21f078[_0x46622c(0x108)]&&(_0x4eddc8[_0x46622c(0x119)]&&console[_0x46622c(0x1ab)](_0x46622c(0x10c)+_0x4eddc8[_0x46622c(0x119)]),_0x4eddc8[_0x46622c(0x179)]&&(console[_0x46622c(0x1ab)]('\x0aStack\x20trace:'),console['error'](_0x4eddc8[_0x46622c(0x179)])));else throw _0x4eddc8;}function formatChatHistoryEntry(_0x2b8557,_0xb95e34){const _0x3581c6=a28_0x4ecf,_0x3057f2=getChalk(_0xb95e34),_0x2dc2b6=_0x3057f2['dim'](_0x2b8557['at']);if(_0x3581c6(0xef)in _0x2b8557){const _0x18bb01=_0x3057f2['cyan'](_0x3581c6(0x1ba));return _0x2dc2b6+'\x20'+_0x18bb01+':\x20'+_0x2b8557[_0x3581c6(0xef)];}if('content'in _0x2b8557){const _0x18a7a5=_0x3057f2['green'](_0x3581c6(0x158));return _0x2dc2b6+'\x20'+_0x18a7a5+':\x20'+_0x2b8557['content'];}if(_0x3581c6(0x106)in _0x2b8557){const _0x5c8993=_0x3057f2[_0x3581c6(0x171)](_0x3581c6(0x15d)),{functionName:_0x3bd30e,functionArguments:_0x142a7a,targetFunction:_0x66139e}=_0x2b8557['tool_call'];let _0x413b68=_0x2dc2b6+'\x20'+_0x5c8993+':\x20'+_0x3057f2[_0x3581c6(0x14a)](_0x3bd30e);if(_0x142a7a&&Object[_0x3581c6(0x123)](_0x142a7a)[_0x3581c6(0xe6)]>0x0){const _0x256dab=Object[_0x3581c6(0xea)](_0x142a7a)['map'](([_0x2690ff,_0x5d6629])=>_0x2690ff+'='+JSON[_0x3581c6(0x18a)](_0x5d6629))[_0x3581c6(0x195)](',\x20');_0x413b68+='('+_0x256dab+')';}_0x66139e&&(_0x413b68+=_0x3057f2['dim']('\x20['+_0x66139e+']'));let _0x4f0e39='';if(_0x2b8557[_0x3581c6(0x106)]['targetKnowledgeBase'])_0x4f0e39=_0x3581c6(0x10e)+_0x2b8557['tool_call'][_0x3581c6(0x161)]['name'];else{if(_0x2b8557[_0x3581c6(0x106)][_0x3581c6(0x199)])_0x4f0e39=_0x3581c6(0xf8)+_0x2b8557[_0x3581c6(0x106)][_0x3581c6(0x199)][_0x3581c6(0xec)];else{if(_0x2b8557[_0x3581c6(0x106)][_0x3581c6(0x1a3)])_0x4f0e39=_0x3581c6(0xf3)+_0x2b8557[_0x3581c6(0x106)]['targetWebSearchTool'][_0x3581c6(0xec)];else _0x2b8557['tool_call'][_0x3581c6(0x12b)]&&(_0x4f0e39=_0x3581c6(0x12d)+_0x2b8557[_0x3581c6(0x106)][_0x3581c6(0x12b)][_0x3581c6(0xec)]);}}return _0x413b68+_0x4f0e39;}if(_0x3581c6(0x105)in _0x2b8557){const _0x2de5c5=_0x3057f2[_0x3581c6(0x145)](_0x3581c6(0xdf)),{functionName:_0x38cb50,functionArguments:_0x4d6164,content:_0xf5d0f6,newChat:_0x409743}=_0x2b8557[_0x3581c6(0x105)];let _0x581ba4=_0x2dc2b6+'\x20'+_0x2de5c5+':\x20'+_0x3057f2[_0x3581c6(0x14a)](_0x38cb50);if(_0x4d6164){const _0x521210=typeof _0x4d6164==='string'?_0x4d6164:JSON[_0x3581c6(0x18a)](_0x4d6164);_0x581ba4+='('+_0x521210+')';}return _0xf5d0f6&&(_0x581ba4+='\x0a'+_0x3057f2[_0x3581c6(0x18b)](_0xf5d0f6)),_0x409743&&(_0x581ba4+=_0x3057f2[_0x3581c6(0x18b)](_0x3581c6(0x16f)+_0x409743['id'])),_0x581ba4;}if(_0x3581c6(0x10a)in _0x2b8557){const _0x4bc098=_0x3057f2['blue'](_0x3581c6(0x1a1));return _0x2dc2b6+'\x20'+_0x4bc098+':\x20'+_0x2b8557[_0x3581c6(0x10a)][_0x3581c6(0xec)]+'\x20('+_0x2b8557[_0x3581c6(0x10a)][_0x3581c6(0x10f)][_0x3581c6(0xe6)]+'\x20bytes)';}if(_0x3581c6(0x128)in _0x2b8557){const _0x51040f=_0x3057f2[_0x3581c6(0xee)](_0x3581c6(0x1a2)),{width:_0x392f72,height:_0x50ebe7,headerText:_0x78854b}=_0x2b8557[_0x3581c6(0x128)],_0x58f1ae=_0x78854b?_0x3581c6(0x148)+_0x78854b:'';return _0x2dc2b6+'\x20'+_0x51040f+':\x20'+_0x392f72+'x'+_0x50ebe7+_0x58f1ae;}if(_0x3581c6(0x1ab)in _0x2b8557){const _0x46faca=_0x3057f2[_0x3581c6(0x16c)](_0x3581c6(0xe1));return _0x2dc2b6+'\x20'+_0x46faca+':\x20'+_0x2b8557[_0x3581c6(0x1ab)];}return _0x2dc2b6+'\x20'+_0x3057f2[_0x3581c6(0x18b)](_0x3581c6(0xf4))+':\x20'+JSON[_0x3581c6(0x18a)](_0x2b8557);}async function executeChatHistoryCommand(_0x495be1,_0x59ed69){const _0x510ddd=a28_0x4ecf,{options:_0x208ec3,args:_0x3b7eb0,tdx:_0x45e57e}=_0x495be1,_0x360385=_0x3b7eb0[0x0],_0x4ed114=_0x208ec3,_0x56b3b4=_0x4ed114['last'];try{if(_0x56b3b4&&_0x360385)return console[_0x510ddd(0x1ab)](_0x510ddd(0x19d)),console[_0x510ddd(0x1ab)](_0x510ddd(0x19b)+_0x59ed69+_0x510ddd(0x1a9)),0x1;if(!_0x360385&&!_0x56b3b4&&_0x208ec3['format']!==undefined){const _0x1228a8=resolveLimit(_0x208ec3[_0x510ddd(0x1be)],DEFAULT_LLM_LIMIT),_0x3685f7=await withSpinner(_0x510ddd(0x12a),()=>_0x45e57e[_0x510ddd(0x152)][_0x510ddd(0x191)](_0x1228a8),{'verbose':_0x208ec3['verbose']});return await handleSDKOutput(_0x3685f7[_0x510ddd(0x100)],_0x208ec3),0x0;}const _0x298f04=await getChatIdOrSelect(_0x45e57e,_0x208ec3,_0x56b3b4,_0x360385);if(!_0x298f04)return 0x0;return await displayChatHistory(_0x298f04,_0x45e57e,_0x208ec3),0x0;}catch(_0x285645){return handleSDKError(_0x285645,_0x208ec3),0x1;}}async function displayChatHistory(_0x3e7410,_0x28df9d,_0x40c1d5){const _0x37fc2c=a28_0x4ecf,_0x4c00b9=await withSpinner('Fetching\x20chat\x20history\x20for\x20\x27'+_0x3e7410+_0x37fc2c(0x133),()=>_0x28df9d[_0x37fc2c(0x152)][_0x37fc2c(0x1ac)](_0x3e7410),{'verbose':_0x40c1d5[_0x37fc2c(0x108)]}),_0x55b365=_0x4c00b9[_0x37fc2c(0x100)]['data']??[];if(_0x55b365[_0x37fc2c(0xe6)]===0x0){console[_0x37fc2c(0x166)](_0x37fc2c(0xe5));return;}if(_0x40c1d5[_0x37fc2c(0xfe)]!==undefined)await handleSDKOutput(_0x55b365,_0x40c1d5);else{const _0xe5c8aa=_0x55b365[_0x37fc2c(0x15e)](_0x47a616=>formatChatHistoryEntry(_0x47a616,_0x40c1d5)),_0x92c996=_0xe5c8aa[_0x37fc2c(0x195)]('\x0a');await writeOutput(_0x92c996,_0x40c1d5[_0x37fc2c(0x10a)],'table');}}async function getChatIdOrSelect(_0x57aeb3,_0x55680a,_0x415c07,_0x1a8f47){const _0x434a7a=a28_0x4ecf;if(_0x1a8f47)return _0x1a8f47;if(_0x415c07){const _0x576d58=await withSpinner('Fetching\x20most\x20recent\x20chat...',()=>_0x57aeb3[_0x434a7a(0x152)][_0x434a7a(0x191)](0x1),{'verbose':_0x55680a[_0x434a7a(0x108)]});if(_0x576d58[_0x434a7a(0x100)][_0x434a7a(0xe6)]===0x0)return console['log'](_0x434a7a(0x183)),undefined;return _0x576d58[_0x434a7a(0x100)][0x0]['id'];}const _0x2c56dc=await selectChatInteractively(_0x57aeb3,_0x55680a);if(!_0x2c56dc)return console[_0x434a7a(0x166)]('\x0aCancelled'),undefined;return _0x2c56dc;}async function getProjectIdOrDefault(_0x51e3e7){const _0x13af86=await getProjectWithName(_0x51e3e7);return _0x13af86['id'];}function a28_0xeba0(){const _0x3dab45=['Output\x20directory\x20\x27','deleteProject','\x20\x20Prompts:\x20','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','Session\x20llm_project\x20set\x20to:\x20','llmProject','List\x20all\x20LLM\x20projects','llm','\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/','365550mNHJtJ','llm:agents','backupProject','green','[content]','default','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','INVALID_ARGUMENT','table','[tool_call]','map','2585000ZNIGka','...','targetKnowledgeBase','toLowerCase','localeCompare','find','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.','log','Resolving\x20agent\x20\x27','Show\x20agent\x20details','en-US','rmSync','numeric','red','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','\x20\x20Agents:\x20','\x20→\x20chat:\x20','llm:log','yellow','List\x20agents\x20in\x20current\x20project','floor','Usage:\x20TDX_EXPERIMENTAL=true\x20tdx\x20llm\x20log\x20<chat-id>','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','systemPrompt','(no\x20message)','d\x20ago','stack','Project\x20created:\x20','restoreProject','claude-4.5-haiku','701967dDWXOP','updatedAt','filter','Deleting\x20agent...','\x20\x20Knowledge\x20Bases:\x20','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','No\x20chat\x20sessions\x20found.','just\x20now','llm:agent:create','llm:use','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','getCurrentProject','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','stringify','dim','Error:\x20Backup\x20folder\x20path\x20is\x20required','Backing\x20up\x20project\x20\x27','models','resolveAgentId','Project\x20restored:\x20','chats','jsonl','\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.','toLocaleDateString','join','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','6xOiFto','Invalid\x20path\x20syntax:\x20','targetAgent','getBackupMetadata','Usage:\x20','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','Fetching\x20projects...','getTime','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)','[output]\x20','[image]\x20\x20','targetWebSearchTool','execute','Agent\x20deleted:\x20','🤖\x20','\x20\x20\x20Examples:','getOrCreateDefaultProject','\x20--last','set','error','history','Error:\x20chat-id\x20is\x20required','agent','existsSync','temperature','Restoring\x20project\x20from\x20\x27','createdAt','includes','starterMessage','No\x20projects\x20found','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','Deleting\x20project\x20\x27','updateAgent','agents','[input]\x20\x20','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','tdx\x20chats','projectId','limit','llm:project:restore','[tool]\x20\x20\x20','lastConversationAt','[error]\x20\x20','Select\x20a\x20chat\x20session:','4816553hwsaec','Error:\x20Agent\x20name\x20is\x20required','No\x20messages\x20found\x20in\x20chat\x20history.','length','Fetching\x20agent...','projectName','counts','entries','Validating\x20backup\x20from\x20\x27','name','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','blue','input','Restore\x20cancelled.','exportedFrom','\x20\x20Integrations:\x20','\x20->\x20WebSearch:','[unknown]','\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents','sourceSite','message','\x20->\x20Agent:','prompt','Creating\x20agent\x20\x27','firstInputContent','llm:agent:show','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','format','model','data','integrations','knowledgeBases','projects','maxToolIterations','tool','tool_call','outputDir','verbose','deleteAgent','output','Fetching\x20agents...','\x20\x20Cause:\x20','Create\x20a\x20new\x20LLM\x20project','\x20->\x20KB:','content','tsv','resolveProjectId','prompts','Agent\x20updated:\x20','session','m\x20ago','Backup\x20cancelled.','Error:\x20Project\x20name\x20is\x20required','slice','cause','getChatLog','1201048QzntVa','Use\x20format:\x20project-name/agent-name','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','chatId','2161857SxPRQH','531gsdyWR','substring','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','keys','565785hGHdbD','llm:project:create','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]','image','List\x20available\x20LLM\x20models','Fetching\x20chat\x20sessions...','targetImageGenerator','attributes','\x20->\x20ImageGen:','get','description','⚒️\x20','agentId','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','\x27...','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','\x20project(s)','Usage:\x20tdx\x20llm\x20use\x20<project-name>','Set\x20current\x20project\x20context','Fetching\x20chat\x20log\x20for\x20\x27','split','4svpnEv','createProject','A\x20project\x20named\x20\x27','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','sort','Agent\x20created:\x20','Creating\x20project\x20\x27','json','Error:\x20','site','short','magenta','push','llm:project:delete','\x20-\x20','llm:projects','bold'];a28_0xeba0=function(){return _0x3dab45;};return a28_0xeba0();}function a28_0x4ecf(_0x2c4d0d,_0x28df3e){_0x2c4d0d=_0x2c4d0d-0xde;const _0xeba00=a28_0xeba0();let _0x4ecfd6=_0xeba00[_0x2c4d0d];return _0x4ecfd6;}async function getProjectWithName(_0x50a563){const _0x2bcd1c=a28_0x4ecf,{tdx:_0x4350d3,options:_0x26fc1d}=_0x50a563,_0x3f777f=_0x26fc1d[_0x2bcd1c(0x150)];if(_0x3f777f){const _0x3fa560=await withSpinner('Resolving\x20project\x20\x27'+_0x3f777f+'\x27...',()=>_0x4350d3[_0x2bcd1c(0x152)]['resolveProjectId'](_0x3f777f),{'verbose':_0x26fc1d[_0x2bcd1c(0x108)]});return{'id':_0x3fa560[_0x2bcd1c(0x100)],'name':_0x3f777f};}const _0x179edd=_0x4350d3['llm'][_0x2bcd1c(0x188)]();if(_0x179edd){const _0x187402=await _0x4350d3[_0x2bcd1c(0x152)][_0x2bcd1c(0x103)](),_0x261eef=_0x187402[_0x2bcd1c(0x164)](_0xda31cd=>_0xda31cd['id']===_0x179edd);return{'id':_0x179edd,'name':_0x261eef?.['attributes'][_0x2bcd1c(0xec)]||'Unknown'};}const _0x2aa7fd=await withSpinner('Getting\x20default\x20project...',()=>_0x4350d3[_0x2bcd1c(0x152)][_0x2bcd1c(0x1a8)](),{'verbose':_0x26fc1d[_0x2bcd1c(0x108)]});return{'id':_0x2aa7fd[_0x2bcd1c(0x100)]['id'],'name':_0x2aa7fd[_0x2bcd1c(0x100)][_0x2bcd1c(0x12c)]['name']};}function toLLMProjectInfo(_0x35deab){const _0x478c42=a28_0x4ecf;return{'name':_0x35deab[_0x478c42(0x12c)][_0x478c42(0xec)],'description':_0x35deab[_0x478c42(0x12c)][_0x478c42(0x12f)],'createdAt':_0x35deab['attributes']['createdAt'],'updatedAt':_0x35deab[_0x478c42(0x12c)]['updatedAt']};}function toAgentInfo(_0x166557){const _0x586436=a28_0x4ecf;return{'name':_0x166557[_0x586436(0x12c)]['name'],'description':_0x166557[_0x586436(0x12c)][_0x586436(0x12f)],'prompt':truncatePrompt(_0x166557['attributes'][_0x586436(0xf9)]),'createdAt':_0x166557[_0x586436(0x12c)][_0x586436(0x1b2)],'updatedAt':_0x166557[_0x586436(0x12c)][_0x586436(0x17e)]};}function truncatePrompt(_0xcedf13){const _0x341746=a28_0x4ecf;if(!_0xcedf13)return undefined;const _0x43d97d=0x64;if(_0xcedf13[_0x341746(0xe6)]<=_0x43d97d)return _0xcedf13;return _0xcedf13[_0x341746(0x118)](0x0,_0x43d97d)+_0x341746(0x160);}export class LLMModelsCommand extends BaseCommand{['name']='llm:models';[a28_0x99278d(0x12f)]=a28_0x99278d(0x129);async[a28_0x99278d(0x1a4)](_0x40bf8f){const _0x575727=a28_0x99278d,{options:_0x384413,tdx:_0x348943}=_0x40bf8f;try{const _0x74f4a0=await withSpinner('Fetching\x20available\x20models...',()=>_0x348943[_0x575727(0x152)][_0x575727(0x18e)](),{'verbose':_0x384413[_0x575727(0x108)]});return await handleSDKOutput(_0x74f4a0[_0x575727(0x100)],_0x384413),0x0;}catch(_0xc65f46){return handleSDKError(_0xc65f46,_0x384413),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a28_0x99278d(0xec)]=a28_0x99278d(0x149);['description']=a28_0x99278d(0x151);async[a28_0x99278d(0x1a4)](_0x45d0ae){const _0x237dfc=a28_0x99278d,{options:_0x3a15be,args:_0x7dd758,tdx:_0x4bc8c7}=_0x45d0ae,_0x50a27b=getChalk(_0x3a15be),_0xf83a04=_0x3a15be[_0x237dfc(0x143)];try{const _0x244335=_0x7dd758[0x0],_0x36f6c3=resolveLimit(_0x3a15be[_0x237dfc(0x1be)],DEFAULT_LLM_LIMIT),_0x3baead=await withSpinner(_0x237dfc(0x19e),()=>_0x4bc8c7['llm'][_0x237dfc(0x103)](_0x36f6c3),{'verbose':_0x3a15be[_0x237dfc(0x108)]});let _0x53ebd2=_0x3baead[_0x237dfc(0x100)];_0x244335&&(_0x53ebd2=_0x3baead['data'][_0x237dfc(0x17f)](_0x499a5c=>matchGlobPattern(_0x499a5c[_0x237dfc(0x12c)][_0x237dfc(0xec)],_0x244335)));const _0x189fc0=_0x3a15be[_0x237dfc(0xfe)]===_0x237dfc(0x141)||_0x3a15be[_0x237dfc(0xfe)]===_0x237dfc(0x192)||_0x3a15be[_0x237dfc(0xfe)]===_0x237dfc(0x15c)||_0x3a15be['format']===_0x237dfc(0x110);if(_0x189fc0){const _0x234ea6=_0x53ebd2[_0x237dfc(0x15e)](_0x11dd42=>({...toLLMProjectInfo(_0x11dd42),'url':getLLMProjectUrl(_0xf83a04,_0x11dd42['id'])}));await handleSDKOutput(_0x234ea6,_0x3a15be);}else{const _0x1d8e52=[];if(_0x53ebd2[_0x237dfc(0xe6)]===0x0)_0x1d8e52[_0x237dfc(0x146)](_0x50a27b['dim'](_0x237dfc(0x1b5)));else{const _0x1ee9c4=[..._0x53ebd2][_0x237dfc(0x13e)]((_0x331770,_0xa60fe9)=>_0x331770['attributes']['name'][_0x237dfc(0x163)](_0xa60fe9[_0x237dfc(0x12c)][_0x237dfc(0xec)]));for(const _0x551792 of _0x1ee9c4){const _0x3564d3=getLLMProjectUrl(_0xf83a04,_0x551792['id']),_0x252f6c=hyperlink(_0x551792[_0x237dfc(0x12c)]['name'],_0x3564d3);_0x1d8e52[_0x237dfc(0x146)](_0x237dfc(0x130)+_0x252f6c);}_0x1d8e52[_0x237dfc(0x146)](_0x50a27b[_0x237dfc(0x18b)](_0x53ebd2[_0x237dfc(0xe6)]+_0x237dfc(0x135)));}await writeOutput(_0x1d8e52['join']('\x0a'),_0x3a15be[_0x237dfc(0x10a)],_0x237dfc(0x15c));}return 0x0;}catch(_0x2ba888){return handleSDKError(_0x2ba888,_0x3a15be),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a28_0x99278d(0xec)]=a28_0x99278d(0x155);[a28_0x99278d(0x12f)]=a28_0x99278d(0x172);async[a28_0x99278d(0x1a4)](_0x1468cb){const _0x197a5f=a28_0x99278d,{options:_0x22ddaf,args:_0x2bb6bc,tdx:_0x29c71d}=_0x1468cb,_0x4fa843=getChalk(_0x22ddaf),_0x2fb5d4=_0x22ddaf[_0x197a5f(0x143)];try{const _0x1bde31=_0x2bb6bc[0x0];let _0x5a4508=_0x1bde31,_0x2e4299,_0x403e83;if(_0x1bde31&&_0x1bde31[_0x197a5f(0x1b3)]('/')){const _0x155356=_0x1bde31['split']('/');if(_0x155356[_0x197a5f(0xe6)]===0x2){const [_0x4cfcff,_0x58ec0d]=_0x155356,_0x4dc796=await _0x29c71d['llm'][_0x197a5f(0x103)](),_0x1016b5=_0x4dc796[_0x197a5f(0x164)](_0x46ad5e=>_0x46ad5e[_0x197a5f(0x12c)][_0x197a5f(0xec)][_0x197a5f(0x162)]()===_0x4cfcff[_0x197a5f(0x162)]());if(!_0x1016b5)throw new SDKError(ErrorCode['LLM_PROJECT_NOT_FOUND'],'Project\x20not\x20found:\x20'+_0x4cfcff,undefined,{'helpText':_0x197a5f(0x14e)});_0x2e4299=_0x1016b5['id'],_0x403e83=_0x1016b5[_0x197a5f(0x12c)][_0x197a5f(0xec)],_0x5a4508=_0x58ec0d;}else throw new SDKError(ErrorCode[_0x197a5f(0x15b)],_0x197a5f(0x198)+_0x1bde31,undefined,{'helpText':_0x197a5f(0x11c)});}else{const _0x5778dd=await getProjectWithName(_0x1468cb);_0x2e4299=_0x5778dd['id'],_0x403e83=_0x5778dd[_0x197a5f(0xec)];}const _0x5e5d30=await withSpinner(_0x197a5f(0x10b),()=>_0x29c71d[_0x197a5f(0x152)]['agents'](_0x2e4299),{'verbose':_0x22ddaf[_0x197a5f(0x108)]});let _0x5733f6=_0x5e5d30['data'];_0x5a4508&&(_0x5733f6=_0x5e5d30[_0x197a5f(0x100)][_0x197a5f(0x17f)](_0x37f4c5=>matchGlobPattern(_0x37f4c5['attributes']['name'],_0x5a4508)));const _0x4fa0c3=_0x22ddaf[_0x197a5f(0xfe)]===_0x197a5f(0x141)||_0x22ddaf['format']==='jsonl'||_0x22ddaf[_0x197a5f(0xfe)]===_0x197a5f(0x15c)||_0x22ddaf['format']==='tsv';if(_0x4fa0c3){const _0x56178d=_0x5733f6[_0x197a5f(0x15e)](_0x57afe4=>({...toAgentInfo(_0x57afe4),'chatUrl':getLLMAgentChatUrl(_0x2fb5d4,_0x2e4299,_0x57afe4['id'])}));await handleSDKOutput(_0x56178d,_0x22ddaf);}else{const _0x28e20d=[];_0x28e20d[_0x197a5f(0x146)](_0x4fa843[_0x197a5f(0x18b)]('['+_0x403e83+']'));if(_0x5733f6[_0x197a5f(0xe6)]===0x0)_0x28e20d[_0x197a5f(0x146)](_0x4fa843['dim']('No\x20agents\x20found'));else{const _0x4ee434=[..._0x5733f6]['sort']((_0x315df9,_0x1ce8db)=>_0x315df9['attributes'][_0x197a5f(0xec)]['localeCompare'](_0x1ce8db[_0x197a5f(0x12c)][_0x197a5f(0xec)]));for(const _0x4d5b59 of _0x4ee434){const _0x495072=getLLMAgentChatUrl(_0x2fb5d4,_0x2e4299,_0x4d5b59['id']),_0x488f86=hyperlink(_0x4d5b59[_0x197a5f(0x12c)][_0x197a5f(0xec)],_0x495072);_0x28e20d[_0x197a5f(0x146)](_0x197a5f(0x1a6)+_0x488f86);}_0x28e20d[_0x197a5f(0x146)](_0x4fa843[_0x197a5f(0x18b)](_0x5733f6['length']+'\x20agent(s)'));}await writeOutput(_0x28e20d[_0x197a5f(0x195)]('\x0a'),_0x22ddaf[_0x197a5f(0x10a)],'table');}return 0x0;}catch(_0x167acb){return handleSDKError(_0x167acb,_0x22ddaf),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{['name']=a28_0x99278d(0xfc);[a28_0x99278d(0x12f)]=a28_0x99278d(0x168);async[a28_0x99278d(0x1a4)](_0x4a5904){const _0x19d4b3=a28_0x99278d,{options:_0x3a3e03,args:_0x562ea5,tdx:_0x2024c5}=_0x4a5904;if(_0x562ea5[_0x19d4b3(0xe6)]===0x0)return console[_0x19d4b3(0x1ab)](_0x19d4b3(0xe4)),console[_0x19d4b3(0x1ab)](_0x19d4b3(0x1b6)),0x1;const _0x37d07b=_0x562ea5[0x0];try{const _0x302351=await getProjectIdOrDefault(_0x4a5904),_0x5f2d40=await withSpinner('Resolving\x20agent\x20\x27'+_0x37d07b+_0x19d4b3(0x133),()=>_0x2024c5[_0x19d4b3(0x152)][_0x19d4b3(0x18f)](_0x37d07b,_0x302351),{'verbose':_0x3a3e03[_0x19d4b3(0x108)]}),_0x37fb92=await withSpinner(_0x19d4b3(0xe7),()=>_0x2024c5[_0x19d4b3(0x152)][_0x19d4b3(0x1ae)](_0x5f2d40['data']),{'verbose':_0x3a3e03[_0x19d4b3(0x108)]});return await handleSDKOutput([_0x37fb92[_0x19d4b3(0x100)]],_0x3a3e03),0x0;}catch(_0x241b01){return handleSDKError(_0x241b01,_0x3a3e03),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a28_0x99278d(0xec)]=a28_0x99278d(0x185);[a28_0x99278d(0x12f)]='Create\x20a\x20new\x20agent\x20in\x20current\x20project';async['execute'](_0x14bd82){const _0x483999=a28_0x99278d,{options:_0x5c9255,args:_0x400842,tdx:_0x1d7d26}=_0x14bd82;if(_0x400842['length']===0x0)return console[_0x483999(0x1ab)](_0x483999(0xe4)),console[_0x483999(0x1ab)](_0x483999(0x196)),console[_0x483999(0x1ab)](_0x483999(0xfd)),0x1;const _0x2468c9=_0x400842[0x0],_0x5417ce=_0x5c9255,_0xf506c2=_0x5417ce[_0x483999(0x176)],_0xd3b53f=_0x5417ce[_0x483999(0xff)]||_0x483999(0x17c),_0x2a3c52=_0x5417ce[_0x483999(0x1b4)],_0x1c0b3b=_0x5417ce[_0x483999(0x104)]?Number(_0x5417ce[_0x483999(0x104)]):undefined,_0x230ab8=_0x5417ce[_0x483999(0x1b0)]?Number(_0x5417ce[_0x483999(0x1b0)]):undefined;try{let _0x405fb7,_0x3ec13c;if(_0x2468c9[_0x483999(0x1b3)]('/')){const _0x783b87=_0x2468c9[_0x483999(0x139)]('/');if(_0x783b87[_0x483999(0xe6)]===0x2){const [_0x37a49c,_0x735ea7]=_0x783b87,_0x45310f=await withSpinner('Resolving\x20project\x20\x27'+_0x37a49c+'\x27...',()=>_0x1d7d26[_0x483999(0x152)][_0x483999(0x111)](_0x37a49c),{'verbose':_0x5c9255['verbose']});_0x405fb7=_0x45310f[_0x483999(0x100)],_0x3ec13c=_0x735ea7;}else throw new SDKError(ErrorCode[_0x483999(0x15b)],_0x483999(0x198)+_0x2468c9,undefined,{'helpText':_0x483999(0x11c)});}else _0x405fb7=await getProjectIdOrDefault(_0x14bd82),_0x3ec13c=_0x2468c9;const _0x4d058b=await withSpinner(_0x483999(0xfa)+_0x3ec13c+_0x483999(0x133),()=>_0x1d7d26[_0x483999(0x152)]['createAgent']({'name':_0x3ec13c,'projectId':_0x405fb7,'modelType':_0xd3b53f,'systemPrompt':_0xf506c2,'starterMessage':_0x2a3c52,'maxToolIterations':_0x1c0b3b,'temperature':_0x230ab8}),{'verbose':_0x5c9255[_0x483999(0x108)]});return console['log'](_0x483999(0x13f)+_0x4d058b[_0x483999(0x100)]['id']),await handleSDKOutput([_0x4d058b[_0x483999(0x100)]],_0x5c9255),0x0;}catch(_0x2d5c4f){return handleSDKError(_0x2d5c4f,_0x5c9255),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a28_0x99278d(0xec)]='llm:agent:update';[a28_0x99278d(0x12f)]='Update\x20an\x20existing\x20agent';async['execute'](_0xc382b4){const _0x1a7e1f=a28_0x99278d,{options:_0x150bdb,args:_0x3aad4d,tdx:_0x398406}=_0xc382b4;if(_0x3aad4d[_0x1a7e1f(0xe6)]===0x0)return console[_0x1a7e1f(0x1ab)](_0x1a7e1f(0xe4)),console['error'](_0x1a7e1f(0x187)),0x1;const _0x27dbeb=_0x3aad4d[0x0],_0x1345e9=_0x150bdb,_0x3c7777=_0x1345e9[_0x1a7e1f(0xec)],_0x45c321=_0x1345e9[_0x1a7e1f(0xf9)],_0x48a063=_0x1345e9['description'],_0x111482=_0x1345e9[_0x1a7e1f(0x1b4)];if(!_0x3c7777&&!_0x45c321&&!_0x48a063&&!_0x111482)return console[_0x1a7e1f(0x1ab)](_0x1a7e1f(0x1bb)),console[_0x1a7e1f(0x1ab)](_0x1a7e1f(0x132)),0x1;try{const _0x21da9d=await getProjectIdOrDefault(_0xc382b4),_0x3618fb=await withSpinner(_0x1a7e1f(0x167)+_0x27dbeb+'\x27...',()=>_0x398406[_0x1a7e1f(0x152)]['resolveAgentId'](_0x27dbeb,_0x21da9d),{'verbose':_0x150bdb[_0x1a7e1f(0x108)]}),_0x6a4bf9=_0x3618fb[_0x1a7e1f(0x100)],_0xd9a7a5=await withSpinner('Updating\x20agent...',()=>_0x398406[_0x1a7e1f(0x152)][_0x1a7e1f(0x1b8)](_0x6a4bf9,{'name':_0x3c7777,'prompt':_0x45c321,'description':_0x48a063,'starterMessage':_0x111482}),{'verbose':_0x150bdb[_0x1a7e1f(0x108)]});return console['log'](_0x1a7e1f(0x113)+_0xd9a7a5[_0x1a7e1f(0x100)]['id']),await handleSDKOutput([_0xd9a7a5['data']],_0x150bdb),0x0;}catch(_0x40826d){return handleSDKError(_0x40826d,_0x150bdb),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a28_0x99278d(0xec)]='llm:agent:delete';[a28_0x99278d(0x12f)]='Delete\x20an\x20agent';async['execute'](_0x2d6776){const _0x34fe0b=a28_0x99278d,{options:_0x142a94,args:_0x1a1a17,tdx:_0x40667f}=_0x2d6776;if(_0x1a1a17['length']===0x0)return console[_0x34fe0b(0x1ab)](_0x34fe0b(0xe4)),console[_0x34fe0b(0x1ab)](_0x34fe0b(0x134)),0x1;const _0x5b5463=_0x1a1a17[0x0];try{const _0x5584ac=await getProjectIdOrDefault(_0x2d6776),_0x2c4f31=await withSpinner(_0x34fe0b(0x167)+_0x5b5463+_0x34fe0b(0x133),()=>_0x40667f[_0x34fe0b(0x152)][_0x34fe0b(0x18f)](_0x5b5463,_0x5584ac),{'verbose':_0x142a94[_0x34fe0b(0x108)]}),_0x5d0028=_0x2c4f31[_0x34fe0b(0x100)];return await withSpinner(_0x34fe0b(0x180),()=>_0x40667f[_0x34fe0b(0x152)][_0x34fe0b(0x109)](_0x5d0028),{'verbose':_0x142a94[_0x34fe0b(0x108)]}),console[_0x34fe0b(0x166)](_0x34fe0b(0x1a5)+_0x5d0028),0x0;}catch(_0x1716a9){return handleSDKError(_0x1716a9,_0x142a94),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a28_0x99278d(0xec)]='llm:history';[a28_0x99278d(0x12f)]=a28_0x99278d(0x122);async[a28_0x99278d(0x1a4)](_0x3b43b2){return executeChatHistoryCommand(_0x3b43b2,'tdx\x20llm\x20history');}}export class LLMUseCommand extends BaseCommand{['name']=a28_0x99278d(0x186);[a28_0x99278d(0x12f)]=a28_0x99278d(0x137);async[a28_0x99278d(0x1a4)](_0x2b5644){const _0x565035=a28_0x99278d,{options:_0x45eda0,args:_0x336436,tdx:_0x2af66d}=_0x2b5644;if(_0x336436[_0x565035(0xe6)]===0x0)return console[_0x565035(0x1ab)](_0x565035(0x117)),console['error'](_0x565035(0x136)),0x1;const _0x3d1531=_0x336436[0x0];try{await withSpinner('Setting\x20project\x20context\x20to\x20\x27'+_0x3d1531+_0x565035(0x133),()=>_0x2af66d['llm']['setCurrentProject'](_0x3d1531),{'verbose':_0x45eda0[_0x565035(0x108)]}),saveSessionContext({'llm_project':_0x3d1531},_0x45eda0[_0x565035(0x114)]);const _0x3f90e5=getChalk(_0x45eda0);return console[_0x565035(0x166)](_0x565035(0x14f)+_0x3f90e5[_0x565035(0x157)](_0x3d1531)),0x0;}catch(_0x1caa4a){return handleSDKError(_0x1caa4a,_0x45eda0),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a28_0x99278d(0xec)]=a28_0x99278d(0x125);[a28_0x99278d(0x12f)]=a28_0x99278d(0x10d);async['execute'](_0x2b2406){const _0x283eae=a28_0x99278d,{options:_0x32b126,args:_0x1bf757,tdx:_0x40bf63}=_0x2b2406;if(_0x1bf757['length']===0x0)return console[_0x283eae(0x1ab)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x283eae(0x1ab)](_0x283eae(0x127)),0x1;const _0x3d185c=_0x1bf757[0x0],_0x823132=_0x32b126,_0x3c1e89=_0x823132[_0x283eae(0x12f)];try{const _0x458431=await withSpinner(_0x283eae(0x140)+_0x3d185c+'\x27...',()=>_0x40bf63[_0x283eae(0x152)][_0x283eae(0x13b)]({'name':_0x3d185c,'description':_0x3c1e89}),{'verbose':_0x32b126['verbose']});console[_0x283eae(0x166)](_0x283eae(0x17a)+_0x458431[_0x283eae(0x100)]['id']);const _0x285efc=toLLMProjectInfo(_0x458431['data']);return await handleSDKOutput([_0x285efc],_0x32b126),0x0;}catch(_0x26f587){return handleSDKError(_0x26f587,_0x32b126),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a28_0x99278d(0xec)]=a28_0x99278d(0x147);['description']='Delete\x20an\x20LLM\x20project';async[a28_0x99278d(0x1a4)](_0xdd6649){const _0x6f6ea0=a28_0x99278d,{options:_0x398e27,args:_0x27467e,tdx:_0x5dbbc3}=_0xdd6649;if(_0x27467e['length']===0x0)return console[_0x6f6ea0(0x1ab)](_0x6f6ea0(0x117)),console[_0x6f6ea0(0x1ab)](_0x6f6ea0(0x182)),0x1;const _0x1c30ac=_0x27467e[0x0];try{return await withSpinner(_0x6f6ea0(0x1b7)+_0x1c30ac+'\x27...',()=>_0x5dbbc3['llm'][_0x6f6ea0(0x14c)](_0x1c30ac),{'verbose':_0x398e27[_0x6f6ea0(0x108)]}),console[_0x6f6ea0(0x166)]('Project\x20deleted:\x20'+_0x1c30ac),0x0;}catch(_0x208b18){return handleSDKError(_0x208b18,_0x398e27),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a28_0x99278d(0xec)]='llm:project:backup';[a28_0x99278d(0x12f)]=a28_0x99278d(0x1a0);async['execute'](_0x1b8527){const _0x45b6c8=a28_0x99278d,{options:_0x4bbd87,args:_0x58eab9,tdx:_0xdcfc38}=_0x1b8527,_0x25d1de=getChalk(_0x4bbd87);console[_0x45b6c8(0x166)](_0x25d1de[_0x45b6c8(0x171)](_0x45b6c8(0x16d))),console[_0x45b6c8(0x166)](_0x25d1de[_0x45b6c8(0x171)]('\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.')),console['log'](_0x25d1de[_0x45b6c8(0x18b)](_0x45b6c8(0xf5))),console[_0x45b6c8(0x166)]();if(_0x58eab9['length']===0x0)return console[_0x45b6c8(0x1ab)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x45b6c8(0x1ab)]('Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]'),0x1;const _0x9fa197=_0x58eab9[0x0],_0x38f268=_0x4bbd87,_0x26fbaf=_0x38f268[_0x45b6c8(0x10a)],_0x274b57=_0x38f268['dryRun'];try{const _0x227edf=_0x26fbaf||_0x9fa197+'.llm';if(a28_0x494372[_0x45b6c8(0x1af)](_0x227edf)&&!_0x274b57){if(!_0x4bbd87['yes']){const _0x129730=await confirm(_0x45b6c8(0x14b)+_0x227edf+'\x27\x20already\x20exists.\x20Overwrite?');if(!_0x129730)return console['log'](_0x45b6c8(0x116)),0x0;}a28_0x494372[_0x45b6c8(0x16a)](_0x227edf,{'recursive':!![]});}const _0x5a5a2b=await withSpinner(_0x274b57?'Analyzing\x20project\x20\x27'+_0x9fa197+_0x45b6c8(0x133):_0x45b6c8(0x18d)+_0x9fa197+_0x45b6c8(0x133),()=>_0xdcfc38[_0x45b6c8(0x152)][_0x45b6c8(0x156)](_0x9fa197,_0x26fbaf,{'dryRun':_0x274b57}),{'verbose':_0x4bbd87['verbose']}),_0x566950=_0x5a5a2b[_0x45b6c8(0x100)];return _0x274b57?console[_0x45b6c8(0x166)](_0x45b6c8(0x19c)+_0x566950[_0x45b6c8(0x107)]):console[_0x45b6c8(0x166)]('Project\x20backed\x20up\x20to:\x20'+_0x566950[_0x45b6c8(0x107)]),console[_0x45b6c8(0x166)]('\x20\x20Agents:\x20'+_0x566950[_0x45b6c8(0xe9)][_0x45b6c8(0x1b9)]),console[_0x45b6c8(0x166)](_0x45b6c8(0x181)+_0x566950['counts'][_0x45b6c8(0x102)]),console[_0x45b6c8(0x166)](_0x45b6c8(0x14d)+_0x566950[_0x45b6c8(0xe9)][_0x45b6c8(0x112)]),console[_0x45b6c8(0x166)](_0x45b6c8(0xf2)+_0x566950[_0x45b6c8(0xe9)][_0x45b6c8(0x101)]),(_0x4bbd87[_0x45b6c8(0xfe)]===_0x45b6c8(0x141)||_0x4bbd87[_0x45b6c8(0xfe)]===_0x45b6c8(0x192))&&await handleSDKOutput([_0x566950],_0x4bbd87),0x0;}catch(_0x46b20c){return handleSDKError(_0x46b20c,_0x4bbd87),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{['name']=a28_0x99278d(0xde);['description']=a28_0x99278d(0x175);async[a28_0x99278d(0x1a4)](_0x43b08e){const _0x483aae=a28_0x99278d,{options:_0xf8c55b,args:_0x11cb35,tdx:_0x128b7f}=_0x43b08e,_0x4a768c=getChalk(_0xf8c55b);console[_0x483aae(0x166)](_0x4a768c[_0x483aae(0x171)](_0x483aae(0x165))),console[_0x483aae(0x166)](_0x4a768c[_0x483aae(0x171)](_0x483aae(0x193))),console['log'](_0x4a768c[_0x483aae(0x18b)](_0x483aae(0x1a7))),console[_0x483aae(0x166)](_0x4a768c[_0x483aae(0x18b)](_0x483aae(0x153))),console[_0x483aae(0x166)](_0x4a768c['dim'](_0x483aae(0x189))),console['log']();if(_0x11cb35[_0x483aae(0xe6)]===0x0)return console[_0x483aae(0x1ab)](_0x483aae(0x18c)),console[_0x483aae(0x1ab)](_0x483aae(0x126)),0x1;const _0x20f8b8=_0x11cb35[0x0],_0x30f039=_0xf8c55b,_0x498a2f=_0x30f039['name'],_0x1706a8=_0x30f039['dryRun'];try{if(!_0x1706a8){const _0x4302ce=_0x128b7f[_0x483aae(0x152)][_0x483aae(0x19a)](_0x20f8b8),_0x1fde1a=_0x498a2f||_0x4302ce[_0x483aae(0xf1)]['projectName'],_0x19533d=await withSpinner('Checking\x20for\x20existing\x20projects...',()=>_0x128b7f[_0x483aae(0x152)]['projects'](),{'verbose':_0xf8c55b[_0x483aae(0x108)]}),_0x2ca184=_0x19533d[_0x483aae(0x100)][_0x483aae(0x164)](_0x18c06b=>_0x18c06b['attributes']['name']===_0x1fde1a);if(_0x2ca184&&!_0xf8c55b['yes']){const _0x3b09f0=await confirm(_0x483aae(0x13c)+_0x1fde1a+_0x483aae(0x15a));if(!_0x3b09f0)return console[_0x483aae(0x166)](_0x483aae(0xf0)),0x0;}}const _0x33132f=await withSpinner(_0x1706a8?_0x483aae(0xeb)+_0x20f8b8+_0x483aae(0x133):_0x483aae(0x1b1)+_0x20f8b8+'\x27...',()=>_0x128b7f[_0x483aae(0x152)][_0x483aae(0x17b)](_0x20f8b8,{'name':_0x498a2f,'dryRun':_0x1706a8}),{'verbose':_0xf8c55b[_0x483aae(0x108)]}),_0x3ce2b5=_0x33132f['data'];return _0x3ce2b5[_0x483aae(0xf6)]&&console['log']('[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27'+_0x3ce2b5['sourceSite']+'\x27'),_0x1706a8?console['log'](_0x483aae(0x13d)+_0x3ce2b5[_0x483aae(0xe8)]):console[_0x483aae(0x166)](_0x483aae(0x190)+_0x3ce2b5[_0x483aae(0xe8)]+'\x20('+_0x3ce2b5[_0x483aae(0x1bd)]+')'),console[_0x483aae(0x166)](_0x483aae(0x16e)+_0x3ce2b5[_0x483aae(0xe9)][_0x483aae(0x1b9)]),console[_0x483aae(0x166)](_0x483aae(0x181)+_0x3ce2b5[_0x483aae(0xe9)][_0x483aae(0x102)]),console['log'](_0x483aae(0x14d)+_0x3ce2b5[_0x483aae(0xe9)][_0x483aae(0x112)]),console[_0x483aae(0x166)](_0x483aae(0xf2)+_0x3ce2b5['counts']['integrations']),(_0xf8c55b[_0x483aae(0xfe)]===_0x483aae(0x141)||_0xf8c55b[_0x483aae(0xfe)]==='jsonl')&&await handleSDKOutput([_0x3ce2b5],_0xf8c55b),0x0;}catch(_0x2938bd){return handleSDKError(_0x2938bd,_0xf8c55b),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x1efa36,_0x357647){const _0x49661f=a28_0x99278d,_0x5bf029=_0x357647[_0x49661f(0x1be)]||CHAT_SELECTOR_PAGE_SIZE;let _0x4e24cd=0x0,_0x352b9b=[];const _0x1bb238=(await import('prompts'))[_0x49661f(0x159)],_0x113969=getChalk(_0x357647);while(!![]){const _0x27a331=await withSpinner(_0x49661f(0x12a),()=>_0x1efa36['llm'][_0x49661f(0x191)](_0x5bf029+_0x4e24cd),{'verbose':_0x357647[_0x49661f(0x108)]});_0x352b9b=_0x27a331[_0x49661f(0x100)];const _0x55a3d0=_0x352b9b[_0x49661f(0x118)](_0x4e24cd,_0x4e24cd+_0x5bf029),_0x450b52=_0x352b9b[_0x49661f(0xe6)]>_0x4e24cd+_0x5bf029,_0x528639=[...new Set(_0x55a3d0[_0x49661f(0x15e)](_0x34e3cb=>_0x34e3cb[_0x49661f(0x12c)][_0x49661f(0x131)])[_0x49661f(0x17f)](_0x400709=>_0x400709!==undefined))],_0x1b4eb1=new Map();await Promise['all'](_0x528639[_0x49661f(0x15e)](async _0x27cd06=>{const _0x307132=_0x49661f;try{const _0x4b7e8d=await _0x1efa36[_0x307132(0x152)][_0x307132(0x1ae)](_0x27cd06);_0x1b4eb1['set'](_0x27cd06,_0x4b7e8d[_0x307132(0x12c)]['name']);}catch{_0x1b4eb1[_0x307132(0x1aa)](_0x27cd06,_0x27cd06);}}));const _0x510aab=_0x55a3d0[_0x49661f(0x15e)](_0x35be3e=>{const _0x9b0d10=_0x49661f,_0x1bb8e5=_0x35be3e['attributes'][_0x9b0d10(0xfb)]||_0x9b0d10(0x177),_0x47c2ce=_0x1bb8e5['split']('\x0a')[0x0],_0x1f84c5=_0x47c2ce[_0x9b0d10(0xe6)]>0x50?_0x47c2ce[_0x9b0d10(0x121)](0x0,0x4d)+_0x9b0d10(0x160):_0x47c2ce,_0x836ed3=_0x35be3e[_0x9b0d10(0x12c)]['agentId']?_0x1b4eb1[_0x9b0d10(0x12e)](_0x35be3e['attributes'][_0x9b0d10(0x131)])||_0x35be3e[_0x9b0d10(0x12c)][_0x9b0d10(0x131)]:'(no\x20agent)',_0x295907=_0x35be3e[_0x9b0d10(0x12c)][_0x9b0d10(0xe0)]||_0x35be3e[_0x9b0d10(0x12c)][_0x9b0d10(0x17e)],_0x1c6dc0=new Date(_0x295907),_0x16e5ac=new Date(),_0x4aec7a=_0x16e5ac[_0x9b0d10(0x19f)]()-_0x1c6dc0['getTime'](),_0x1de080=Math['floor'](_0x4aec7a/0xea60),_0xe1fa03=Math[_0x9b0d10(0x173)](_0x4aec7a/0x36ee80),_0x3177a8=Math['floor'](_0x4aec7a/0x5265c00);let _0x1c92bf;if(_0x1de080<0x1)_0x1c92bf=_0x9b0d10(0x184);else{if(_0x1de080<0x3c)_0x1c92bf=_0x1de080+_0x9b0d10(0x115);else{if(_0xe1fa03<0x18)_0x1c92bf=_0xe1fa03+'h\x20ago';else _0x3177a8<0x7?_0x1c92bf=_0x3177a8+_0x9b0d10(0x178):_0x1c92bf=_0x1c6dc0[_0x9b0d10(0x194)](_0x9b0d10(0x169),{'month':_0x9b0d10(0x144),'day':_0x9b0d10(0x16b)});}}return{'title':_0x1f84c5+'\x20'+_0x113969[_0x9b0d10(0x18b)]('['+_0x836ed3+']\x20'+_0x1c92bf),'value':_0x35be3e['id']};});_0x450b52&&_0x510aab[_0x49661f(0x146)]({'title':_0x113969['cyan']('Load\x20more...'),'value':'__load_more__'});const _0x449dd9=await _0x1bb238({'type':'select','name':_0x49661f(0x11e),'message':_0x49661f(0xe2),'choices':_0x510aab,'hint':_0x49661f(0xed)});if(!_0x449dd9[_0x49661f(0x11e)])return undefined;if(_0x449dd9[_0x49661f(0x11e)]==='__load_more__'){_0x4e24cd+=_0x5bf029;continue;}return _0x449dd9[_0x49661f(0x11e)];}}export class ChatsCommand extends BaseCommand{[a28_0x99278d(0xec)]=a28_0x99278d(0x191);[a28_0x99278d(0x12f)]=a28_0x99278d(0x11d);async['execute'](_0x4d3ee4){const _0x4437e1=a28_0x99278d;return executeChatHistoryCommand(_0x4d3ee4,_0x4437e1(0x1bc));}}export class LLMLogCommand extends BaseCommand{[a28_0x99278d(0xec)]=a28_0x99278d(0x170);[a28_0x99278d(0x12f)]='Show\x20chat\x20log';async[a28_0x99278d(0x1a4)](_0xab67f0){const _0xdf3dda=a28_0x99278d,{options:_0x568a48,args:_0x38c148,tdx:_0xc7d1ac}=_0xab67f0,_0x2a571d=_0x38c148[0x0];if(!_0x2a571d)return console['error'](_0xdf3dda(0x1ad)),console['error'](_0xdf3dda(0x174)),0x1;const _0x449032=await withSpinner(_0xdf3dda(0x138)+_0x2a571d+'\x27...',()=>_0xc7d1ac[_0xdf3dda(0x152)][_0xdf3dda(0x11a)](_0x2a571d),{'verbose':_0x568a48[_0xdf3dda(0x108)]});return await handleSDKOutput(_0x449032[_0xdf3dda(0x100)]['data'],_0x568a48),0x0;}}
@@ -1 +1 @@
1
- function a29_0x90fb(_0x493e7c,_0x527f38){_0x493e7c=_0x493e7c-0xb5;const _0x5551d7=a29_0x5551();let _0x90fb04=_0x5551d7[_0x493e7c];return _0x90fb04;}const a29_0x948719=a29_0x90fb;(function(_0x47db7d,_0x5d8ce6){const _0x526ddc=a29_0x90fb,_0x357654=_0x47db7d();while(!![]){try{const _0x5df913=-parseInt(_0x526ddc(0xc2))/0x1*(-parseInt(_0x526ddc(0xce))/0x2)+parseInt(_0x526ddc(0xcb))/0x3*(-parseInt(_0x526ddc(0xba))/0x4)+-parseInt(_0x526ddc(0xcc))/0x5*(parseInt(_0x526ddc(0xcd))/0x6)+parseInt(_0x526ddc(0xc0))/0x7*(-parseInt(_0x526ddc(0xc4))/0x8)+parseInt(_0x526ddc(0xb7))/0x9+-parseInt(_0x526ddc(0xbe))/0xa*(-parseInt(_0x526ddc(0xc1))/0xb)+-parseInt(_0x526ddc(0xb5))/0xc;if(_0x5df913===_0x5d8ce6)break;else _0x357654['push'](_0x357654['shift']());}catch(_0x53b4c7){_0x357654['push'](_0x357654['shift']());}}}(a29_0x5551,0x548e8));import{BaseCommand}from'./command.js';export class MCPCommand extends BaseCommand{[a29_0x948719(0xca)]=a29_0x948719(0xc5);[a29_0x948719(0xb9)]=a29_0x948719(0xc9);async[a29_0x948719(0xbf)](_0x28688c){const _0x428438=a29_0x948719,{tdx:_0x53538f}=_0x28688c,_0x4450e7={};if(process.env.TDX_PROFILE)_0x4450e7[_0x428438(0xcf)]=process.env.TDX_PROFILE;else{if(process.env.TDX_API_KEY)_0x4450e7['TDX_API_KEY']=process.env.TDX_API_KEY,process.env.TDX_SITE&&(_0x4450e7['TDX_SITE']=process.env.TDX_SITE);else{if(_0x53538f[_0x428438(0xb6)][_0x428438(0xc6)])_0x4450e7[_0x428438(0xd0)]=_0x53538f[_0x428438(0xb6)]['accessToken'],_0x4450e7[_0x428438(0xd1)]=_0x53538f[_0x428438(0xb6)][_0x428438(0xbc)];else _0x53538f[_0x428438(0xb6)]['apiKey']&&(_0x4450e7[_0x428438(0xc8)]=_0x53538f[_0x428438(0xb6)][_0x428438(0xbb)],_0x4450e7[_0x428438(0xd1)]=_0x53538f[_0x428438(0xb6)][_0x428438(0xbc)]);}}_0x53538f['context'][_0x428438(0xb8)]&&(_0x4450e7[_0x428438(0xcf)]=_0x53538f[_0x428438(0xb6)][_0x428438(0xb8)]);try{const {startMCPServer:_0x1bddcf}=await import(_0x428438(0xc3));return await _0x1bddcf({'env':_0x4450e7}),0x0;}catch(_0x585361){const _0x2405e5=_0x585361 instanceof Error?_0x585361[_0x428438(0xc7)]:String(_0x585361);return console['error'](_0x428438(0xbd)+_0x2405e5),0x1;}}}function a29_0x5551(){const _0x972dd5=['1926QCUjWZ','TDX_PROFILE','TDX_ACCESS_TOKEN','TDX_SITE','4029396wMLwcB','context','6073299nEiOxj','profile','description','8KcRVFv','apiKey','site','MCP\x20server\x20error:\x20','3890LYiOgR','execute','98AirpXK','6127ZcrTlf','559nnBvQw','../mcp/server.js','338512PHNbXN','mcp','accessToken','message','TDX_API_KEY','Start\x20MCP\x20server\x20for\x20AI\x20tool\x20integration','name','45876VrmbMn','5ZSkeef','748164SWtfcQ'];a29_0x5551=function(){return _0x972dd5;};return a29_0x5551();}
1
+ const a29_0xec1a2d=a29_0x40ed;(function(_0x4fc688,_0x26c28a){const _0x55ac72=a29_0x40ed,_0x3fdb68=_0x4fc688();while(!![]){try{const _0xb612a8=-parseInt(_0x55ac72(0x185))/0x1+-parseInt(_0x55ac72(0x18d))/0x2+parseInt(_0x55ac72(0x18b))/0x3+parseInt(_0x55ac72(0x196))/0x4+parseInt(_0x55ac72(0x184))/0x5+-parseInt(_0x55ac72(0x18a))/0x6*(-parseInt(_0x55ac72(0x180))/0x7)+-parseInt(_0x55ac72(0x18f))/0x8;if(_0xb612a8===_0x26c28a)break;else _0x3fdb68['push'](_0x3fdb68['shift']());}catch(_0x26a3c4){_0x3fdb68['push'](_0x3fdb68['shift']());}}}(a29_0x5216,0x61ddb));import{BaseCommand}from'./command.js';function a29_0x40ed(_0x43aeb3,_0x4dc054){_0x43aeb3=_0x43aeb3-0x17f;const _0x521681=a29_0x5216();let _0x40edb4=_0x521681[_0x43aeb3];return _0x40edb4;}function a29_0x5216(){const _0x311ecc=['5072608nOJTwA','TDX_API_KEY','error','mcp','description','TDX_SITE','apiKey','2313312VKGCke','accessToken','Start\x20MCP\x20server\x20for\x20AI\x20tool\x20integration','241549jvCIed','name','context','MCP\x20server\x20error:\x20','3687950cCtMdb','120140PEOefJ','message','TDX_ACCESS_TOKEN','profile','TDX_PROFILE','36ZXczAM','481365ohWsfN','site','1056680QHNvCv','execute'];a29_0x5216=function(){return _0x311ecc;};return a29_0x5216();}export class MCPCommand extends BaseCommand{[a29_0xec1a2d(0x181)]=a29_0xec1a2d(0x192);[a29_0xec1a2d(0x193)]=a29_0xec1a2d(0x17f);async[a29_0xec1a2d(0x18e)](_0x498ed9){const _0x6a4007=a29_0xec1a2d,{tdx:_0x1c3a0e}=_0x498ed9,_0x160be2={};if(process.env.TDX_PROFILE)_0x160be2[_0x6a4007(0x189)]=process.env.TDX_PROFILE;else{if(process.env.TDX_API_KEY)_0x160be2[_0x6a4007(0x190)]=process.env.TDX_API_KEY,process.env.TDX_SITE&&(_0x160be2[_0x6a4007(0x194)]=process.env.TDX_SITE);else{if(_0x1c3a0e['context'][_0x6a4007(0x197)])_0x160be2[_0x6a4007(0x187)]=_0x1c3a0e[_0x6a4007(0x182)]['accessToken'],_0x160be2['TDX_SITE']=_0x1c3a0e[_0x6a4007(0x182)][_0x6a4007(0x18c)];else _0x1c3a0e['context'][_0x6a4007(0x195)]&&(_0x160be2['TDX_API_KEY']=_0x1c3a0e[_0x6a4007(0x182)]['apiKey'],_0x160be2['TDX_SITE']=_0x1c3a0e[_0x6a4007(0x182)][_0x6a4007(0x18c)]);}}_0x1c3a0e[_0x6a4007(0x182)]['profile']&&(_0x160be2[_0x6a4007(0x189)]=_0x1c3a0e[_0x6a4007(0x182)][_0x6a4007(0x188)]);try{const {startMCPServer:_0x5779aa}=await import('../mcp/server.js');return await _0x5779aa({'env':_0x160be2}),0x0;}catch(_0x3c6b10){const _0xf68103=_0x3c6b10 instanceof Error?_0x3c6b10[_0x6a4007(0x186)]:String(_0x3c6b10);return console[_0x6a4007(0x191)](_0x6a4007(0x183)+_0xf68103),0x1;}}}