@treasuredata/tdx 2026.8.2 → 2026.8.3

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 (247) 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/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/engage-template-pull-command.js +1 -1
  29. package/dist/commands/engage-template-push-command.js +1 -1
  30. package/dist/commands/engage-template-validate-command.js +1 -1
  31. package/dist/commands/job-command.js +1 -1
  32. package/dist/commands/journey-command.js +1 -1
  33. package/dist/commands/journey-validate-command.js +1 -1
  34. package/dist/commands/llm-command.js +1 -1
  35. package/dist/commands/mcp-command.js +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/policy-command.js +1 -1
  38. package/dist/commands/profile-command.js +1 -1
  39. package/dist/commands/profiles-command.js +1 -1
  40. package/dist/commands/query-command.js +1 -1
  41. package/dist/commands/schedule-command.js +1 -1
  42. package/dist/commands/segment-command.js +1 -1
  43. package/dist/commands/segment-create-command.js +1 -1
  44. package/dist/commands/segment-fields-command.js +1 -1
  45. package/dist/commands/segment-move-command.js +1 -1
  46. package/dist/commands/segment-pull-command.js +1 -1
  47. package/dist/commands/segment-push-command.js +1 -1
  48. package/dist/commands/segment-update-command.js +1 -1
  49. package/dist/commands/segment-use-command.js +1 -1
  50. package/dist/commands/segment-validate-command.js +1 -1
  51. package/dist/commands/segments.js +1 -1
  52. package/dist/commands/show.js +1 -1
  53. package/dist/commands/status-command.js +1 -1
  54. package/dist/commands/table-deleted.js +1 -1
  55. package/dist/commands/tables.js +1 -1
  56. package/dist/commands/unset-command.js +1 -1
  57. package/dist/commands/upgrade-command.js +1 -1
  58. package/dist/commands/use-command.js +1 -1
  59. package/dist/commands/user-command.js +1 -1
  60. package/dist/commands/work-command.js +1 -1
  61. package/dist/commands/workflow-command.js +1 -1
  62. package/dist/core/auth.js +1 -1
  63. package/dist/core/command-output.js +1 -1
  64. package/dist/core/config.js +1 -1
  65. package/dist/core/connection-cache.js +1 -1
  66. package/dist/core/constants.js +1 -1
  67. package/dist/core/credential-cache.js +1 -1
  68. package/dist/core/global-context.js +1 -1
  69. package/dist/core/keychain.js +1 -1
  70. package/dist/core/oauth-keychain.js +1 -1
  71. package/dist/core/oauth.js +1 -1
  72. package/dist/core/profile.js +1 -1
  73. package/dist/core/project-config.js +1 -1
  74. package/dist/core/session.js +1 -1
  75. package/dist/core/site-mismatch.js +1 -1
  76. package/dist/core/user-cache.js +1 -1
  77. package/dist/core/version.js +1 -1
  78. package/dist/index.js +1 -1
  79. package/dist/mcp/server.js +1 -1
  80. package/dist/mcp/tools/index.js +1 -1
  81. package/dist/mcp/tools/tdx-run.js +1 -1
  82. package/dist/mcp/tools/tdx-search.js +1 -1
  83. package/dist/mcp/tools/work-create-item.js +1 -1
  84. package/dist/mcp/utils.js +1 -1
  85. package/dist/proxy/claude-usage-tracker.js +1 -1
  86. package/dist/proxy/passthrough-server.js +1 -1
  87. package/dist/proxy/sse-usage-parser.js +1 -1
  88. package/dist/sdk/agent/agent-config.js +1 -1
  89. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  90. package/dist/sdk/agent/agent-yaml.js +1 -1
  91. package/dist/sdk/agent/test/evaluator.js +1 -1
  92. package/dist/sdk/agent/test/executor.js +1 -1
  93. package/dist/sdk/agent/test/index.js +1 -1
  94. package/dist/sdk/agent/test/output.js +1 -1
  95. package/dist/sdk/agent/test/parser.js +1 -1
  96. package/dist/sdk/agent/tool-target-registry.js +1 -1
  97. package/dist/sdk/api.js +1 -1
  98. package/dist/sdk/auth-token.js +1 -1
  99. package/dist/sdk/cas/cas-api-client.d.ts +9 -3
  100. package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
  101. package/dist/sdk/cas/cas-api-client.js +1 -1
  102. package/dist/sdk/cas/cas-api-client.js.map +1 -1
  103. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  104. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  105. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  106. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  107. package/dist/sdk/cas/index.d.ts +10 -0
  108. package/dist/sdk/cas/index.d.ts.map +1 -1
  109. package/dist/sdk/cas/index.js +1 -1
  110. package/dist/sdk/cas/index.js.map +1 -1
  111. package/dist/sdk/cas/pull-workflow.js +1 -1
  112. package/dist/sdk/cas/push-workflow.js +1 -1
  113. package/dist/sdk/cas/validate-files.js +1 -1
  114. package/dist/sdk/client/cdp-api-client.js +1 -1
  115. package/dist/sdk/client/delivery-api-client.js +1 -1
  116. package/dist/sdk/client/endpoints.js +1 -1
  117. package/dist/sdk/client/engage-api-client.js +1 -1
  118. package/dist/sdk/client/http-client.js +1 -1
  119. package/dist/sdk/client/llm-api-client.js +1 -1
  120. package/dist/sdk/client/oauth-refresh.js +1 -1
  121. package/dist/sdk/client/rate-limiter.js +1 -1
  122. package/dist/sdk/client/td-api-client.js +1 -1
  123. package/dist/sdk/client/trino-api-client.js +1 -1
  124. package/dist/sdk/client/workflow-client.js +1 -1
  125. package/dist/sdk/connection-validator.js +1 -1
  126. package/dist/sdk/connection.js +1 -1
  127. package/dist/sdk/delivery.js +1 -1
  128. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  129. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  130. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  131. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  132. package/dist/sdk/engage/campaign-pull.js +1 -1
  133. package/dist/sdk/engage/campaign-push.js +1 -1
  134. package/dist/sdk/engage/campaign-validator.js +1 -1
  135. package/dist/sdk/engage/campaign-yaml.js +1 -1
  136. package/dist/sdk/engage/template-pull.js +1 -1
  137. package/dist/sdk/engage/template-push.js +1 -1
  138. package/dist/sdk/engage/template-validator.js +1 -1
  139. package/dist/sdk/engage/template-yaml.js +1 -1
  140. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  141. package/dist/sdk/engage/types/campaign-def.js +1 -1
  142. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  143. package/dist/sdk/engage/types/template-schema.js +1 -1
  144. package/dist/sdk/engage.js +1 -1
  145. package/dist/sdk/errors.js +1 -1
  146. package/dist/sdk/index.js +1 -1
  147. package/dist/sdk/io/index.js +1 -1
  148. package/dist/sdk/io/node-filesystem.js +1 -1
  149. package/dist/sdk/job.js +1 -1
  150. package/dist/sdk/journey.js +1 -1
  151. package/dist/sdk/llm/chat-cache.js +1 -1
  152. package/dist/sdk/llm/index.js +1 -1
  153. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  154. package/dist/sdk/llm/model-factors.js +1 -1
  155. package/dist/sdk/llm/user-settings.js +1 -1
  156. package/dist/sdk/personalization.js +1 -1
  157. package/dist/sdk/policy.js +1 -1
  158. package/dist/sdk/query/deleted-table-validation.js +1 -1
  159. package/dist/sdk/query/index.js +1 -1
  160. package/dist/sdk/query/sql-parser.js +1 -1
  161. package/dist/sdk/realtime.js +1 -1
  162. package/dist/sdk/schedule.js +1 -1
  163. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  164. package/dist/sdk/segment/fields-display.js +1 -1
  165. package/dist/sdk/segment/file-discovery.js +1 -1
  166. package/dist/sdk/segment/journey-utils.js +1 -1
  167. package/dist/sdk/segment/journey-validator.js +1 -1
  168. package/dist/sdk/segment/journey-yaml.js +1 -1
  169. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  170. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  171. package/dist/sdk/segment/pull-workflow.js +1 -1
  172. package/dist/sdk/segment/push-recovery.js +1 -1
  173. package/dist/sdk/segment/push-workflow.js +1 -1
  174. package/dist/sdk/segment/resolution-context.js +1 -1
  175. package/dist/sdk/segment/segment-path-parser.js +1 -1
  176. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  177. package/dist/sdk/segment/segment-validator.js +1 -1
  178. package/dist/sdk/segment/target-resolution.js +1 -1
  179. package/dist/sdk/segment/tdx-config.js +1 -1
  180. package/dist/sdk/segment/types/activation-schema.js +1 -1
  181. package/dist/sdk/segment/types/journey-def.js +1 -1
  182. package/dist/sdk/segment/types/journey-schema.js +1 -1
  183. package/dist/sdk/segment/types/segment-def.js +1 -1
  184. package/dist/sdk/segment/types/segment-schema.js +1 -1
  185. package/dist/sdk/segment/validate-files.js +1 -1
  186. package/dist/sdk/segment/yaml-validator.js +1 -1
  187. package/dist/sdk/segment.js +1 -1
  188. package/dist/sdk/types/index.js +1 -1
  189. package/dist/sdk/types/progress.js +1 -1
  190. package/dist/sdk/types/workspace.js +1 -1
  191. package/dist/sdk/user.js +1 -1
  192. package/dist/sdk/util/format-detector.js +1 -1
  193. package/dist/sdk/util/formatters.js +1 -1
  194. package/dist/sdk/util/index.js +1 -1
  195. package/dist/sdk/util/paginate.js +1 -1
  196. package/dist/sdk/util/tree-formatter.js +1 -1
  197. package/dist/sdk/util/tree-search.js +1 -1
  198. package/dist/sdk/workflow/archive-validation.js +1 -1
  199. package/dist/sdk/workflow/clone-workflow.js +1 -1
  200. package/dist/sdk/workflow/index.js +1 -1
  201. package/dist/sdk/workflow/pull-workflow.js +1 -1
  202. package/dist/sdk/workflow/push-workflow.js +1 -1
  203. package/dist/sdk/workflow/task-graph.js +1 -1
  204. package/dist/sdk/workflow/tdx-config.js +1 -1
  205. package/dist/sdk/workflow/workflow-utils.js +1 -1
  206. package/dist/sdk/workspace/access-tracker.js +1 -1
  207. package/dist/sdk/workspace/frontmatter.js +1 -1
  208. package/dist/sdk/workspace/git.js +1 -1
  209. package/dist/sdk/workspace/index.js +1 -1
  210. package/dist/sdk/workspace/templates.js +1 -1
  211. package/dist/sdk/workspace/weekly.js +1 -1
  212. package/dist/sdk/workspace/wikilinks.js +1 -1
  213. package/dist/test-utils/command-runner.js +1 -1
  214. package/dist/test-utils/factories.js +1 -1
  215. package/dist/test-utils/fixtures.js +1 -1
  216. package/dist/test-utils/http-mock.js +1 -1
  217. package/dist/test-utils/index.js +1 -1
  218. package/dist/utils/async.js +1 -1
  219. package/dist/utils/claude-code-state.js +1 -1
  220. package/dist/utils/colors.js +1 -1
  221. package/dist/utils/diff.js +1 -1
  222. package/dist/utils/file-permissions.js +1 -1
  223. package/dist/utils/file-reader.js +1 -1
  224. package/dist/utils/github-releases.js +1 -1
  225. package/dist/utils/global-cache.js +1 -1
  226. package/dist/utils/json-loader.js +1 -1
  227. package/dist/utils/local-cache.js +1 -1
  228. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  229. package/dist/utils/logger/formatters/index.js +1 -1
  230. package/dist/utils/logger/handlers/console-handler.js +1 -1
  231. package/dist/utils/logger/handlers/file-handler.js +1 -1
  232. package/dist/utils/logger/handlers/index.js +1 -1
  233. package/dist/utils/logger/handlers/null-handler.js +1 -1
  234. package/dist/utils/logger/index.js +1 -1
  235. package/dist/utils/logger/logger.js +1 -1
  236. package/dist/utils/logger/types.js +1 -1
  237. package/dist/utils/option-validation.js +1 -1
  238. package/dist/utils/process.js +1 -1
  239. package/dist/utils/prompt.js +1 -1
  240. package/dist/utils/proxy-fetch.js +1 -1
  241. package/dist/utils/spinner.js +1 -1
  242. package/dist/utils/sse-parser.js +1 -1
  243. package/dist/utils/string-utils.js +1 -1
  244. package/dist/utils/table-ref-parser.js +1 -1
  245. package/dist/utils/tdx-logger.js +1 -1
  246. package/dist/utils/version-check.js +1 -1
  247. package/package.json +1 -1
@@ -1 +1 @@
1
- const a8_0x350b73=a8_0xbc01;(function(_0x37b57a,_0x4186fe){const _0x44cbec=a8_0xbc01,_0x4513f6=_0x37b57a();while(!![]){try{const _0x2144b0=parseInt(_0x44cbec(0x1ee))/0x1+-parseInt(_0x44cbec(0x247))/0x2+-parseInt(_0x44cbec(0x1f7))/0x3*(-parseInt(_0x44cbec(0x235))/0x4)+-parseInt(_0x44cbec(0x25f))/0x5*(parseInt(_0x44cbec(0x225))/0x6)+parseInt(_0x44cbec(0x222))/0x7*(parseInt(_0x44cbec(0x289))/0x8)+parseInt(_0x44cbec(0x268))/0x9+-parseInt(_0x44cbec(0x26c))/0xa*(parseInt(_0x44cbec(0x1f8))/0xb);if(_0x2144b0===_0x4186fe)break;else _0x4513f6['push'](_0x4513f6['shift']());}catch(_0x247eae){_0x4513f6['push'](_0x4513f6['shift']());}}}(a8_0x187d,0xd5356));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import a8_0x55a10f from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a8_0x1dbf09 from'path';import{confirmKey,isInteractive}from'../utils/prompt.js';import{collectYamlFiles,buildConnectionMaps}from'../sdk/cas/push-workflow.js';import{validateCasYamlFiles,isCasValidationResult,calculateCasValidationSummary}from'../sdk/cas/validate-files.js';function a8_0xbc01(_0x1b2157,_0x2fcfec){_0x1b2157=_0x1b2157-0x1da;const _0x187d0f=a8_0x187d();let _0xbc011b=_0x187d0f[_0x1b2157];return _0xbc011b;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';export class CASListCommand extends BaseCommand{[a8_0x350b73(0x27c)]='cas:list';[a8_0x350b73(0x28b)]='List\x20composable\x20audiences';async['execute'](_0x9e1303){const _0x3c1956=a8_0x350b73,{options:_0x2ec23c,tdx:_0x1092a8}=_0x9e1303,_0x41ffcc=await withProgressSpinner('Fetching\x20composable\x20audiences...',()=>_0x1092a8[_0x3c1956(0x209)][_0x3c1956(0x285)](),{'verbose':_0x2ec23c['verbose']}),_0x26b8f5=_0x41ffcc[_0x3c1956(0x25b)];if(isStructuredFormat(_0x2ec23c))return await handleSDKOutput(_0x26b8f5,_0x2ec23c),0x0;if(_0x26b8f5['length']===0x0)return console[_0x3c1956(0x1da)](a8_0x55a10f['dim'](_0x3c1956(0x1f3))),0x0;console[_0x3c1956(0x1da)](a8_0x55a10f[_0x3c1956(0x248)]('Found\x20'+_0x26b8f5[_0x3c1956(0x278)]+_0x3c1956(0x1db)));for(const _0x1e82a8 of _0x26b8f5){const _0x4fab86=_0x1e82a8['population']?a8_0x55a10f[_0x3c1956(0x233)]('\x20('+Number(_0x1e82a8[_0x3c1956(0x25e)])['toLocaleString']()+')'):'',_0x29bece=a8_0x55a10f[_0x3c1956(0x233)]('\x20'+_0x1e82a8[_0x3c1956(0x284)]+'.'+_0x1e82a8['masterTable']);console[_0x3c1956(0x1da)](_0x3c1956(0x25a)+_0x1e82a8['name']+_0x4fab86+_0x29bece),_0x1e82a8['description']&&console[_0x3c1956(0x1da)]('\x20\x20'+a8_0x55a10f[_0x3c1956(0x233)](_0x1e82a8[_0x3c1956(0x28b)]));}return 0x0;}}function a8_0x187d(){const _0x10fd90=['count','filter','updated','Directory\x20not\x20found:\x20','source','Not\x20found:\x20','absolutePath','Running\x20preview\x20for\x20\x27','length','renamedAttributeIds','\x0aSample\x20Rows\x20(','segments','name','errors','Cancelled.','\x20composable\x20segment\x20file(s)\x20not\x20validated','(dry\x20run\x20—\x20no\x20files\x20written)','\x20activation(s)','from','hasErrors','masterSchema','list','renamedBehaviors','cas:push','push','22832JCTJnM','Resolving\x20connections...','description','map','table','log','\x20composable\x20audiences','basename','Audience\x20name\x20required.','invalidCount','get','setPhase','--audience\x20<name>','success','\x20\x20Renamed\x20attribute:\x20\x22','folders','\x0a⚠\x20On\x20server\x20but\x20not\x20in\x20this\x20YAML:\x20','\x0a✔\x20Push\x20complete','\x20warning(s)\x20found','tdx\x20cas\x20desc\x20<name>','yes','warnings','\x20\x20Audience:\x20','yellow','status','770223YOhBAj','isNew','\x20error(s)','error','Would\x20create:\x20','No\x20composable\x20audiences\x20found.','Analyzing\x20CAS\x20YAML\x20files...','dir','composableAudience','42VuqCUc','3041907uSdnjI','renamedBehaviorIds','behavior(s)\x20','\x0a↻\x20Would\x20rename\x20attribute\x20\x22','bold','rows','\x20\x20Updated:\x20','\x0a↻\x20Would\x20rename\x20behavior\x20\x22','red','Usage:\x20tdx\x20cas\x20preview\x20<segment_name>\x20[--audience\x20<name>]','\x20\x20Renamed\x20behavior:\x20\x22','valid','cwd','\x22\x20→\x20\x22','relativePath','activations','Pushing\x20to\x20CAS\x20API...','cas','\x20folder(s)','schema','Wrote\x20','\x20—\x20','\x0aError:','session','audiences','renamedAttributes','behaviors','created','pull','reason','Write\x20files?','Pull\x20composable\x20audience\x20to\x20YAML\x20files','No\x20YAML\x20files\x20found\x20in:\x20','tdx\x20cas\x20pull\x20<name>','cas:preview','execute','\x27...','Push\x20YAML\x20files\x20to\x20CAS\x20API','tdx\x20cas\x20push\x20<path>','Count:\x20\x20','audienceName','dryRun','3129DlqtDA','names','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20cas\x20validate`\x20to\x20check\x20files\x20locally.','102TBmjdm','Audience:\x20','skippedCount','timeColumn','\x20and\x20','Use\x20','fromId','utf-8','attributes','\x20warning(s)','removedBehaviors','\x20file(s)\x20valid','underline','removedAttributes','dim','Context\x20set:\x20','326588rHTqIi','Validation\x20failed:\x20','Preview\x20composable\x20segment\x20query\x20on\x20CDW','counts','delete','result','cas:pull','warningCount','\x20segments,\x20','column','No\x20CAS\x20resources\x20found\x20in\x20YAML\x20files.','tdx\x20use\x20cas\x20<name>','connection','\x20(new)','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Aborted.','\x20\x20Created:\x20','Master\x20Table','1557228TcfsDp','green','relative','\x20\x20Renames\x20are\x20applied\x20by\x20recreating\x20the\x20attribute/behavior\x20server-side\x20—\x20its\x20id\x20will\x20change.','attribute(s)\x20','cyan','masterTable','toId','composable_audience','audienceDrift','\x20\x20Table:\x20\x20','files','\x20audience(s)','Fetching\x20audience\x20\x27','\x20or\x20set\x20context\x20with\x20','dirname','✔\x20All\x20','Pulling\x20composable\x20audience\x20\x27','\x20\x20Removed\x20(--delete):\x20','🧊\x20','data','Behaviors\x20(','masterKeyColumn','population','338285kNptss','No\x20composable\x20audience\x20specified.','cas:desc','\x20valid','tdx\x20cas\x20validate\x20<path>','Status:\x20','verbose','diff','\x0aValidation\x20failed:','6472926DImAxR','content','join','\x20file(s)\x20to\x20','40KAqnst','Source:\x20\x20\x20','Tip:\x20Run\x20`tdx\x20cas\x20pull\x20<name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20segment(s)'];a8_0x187d=function(){return _0x10fd90;};return a8_0x187d();}export class CASDescCommand extends BaseCommand{['name']=a8_0x350b73(0x261);['description']='Describe\x20a\x20composable\x20audience';async[a8_0x350b73(0x21b)](_0x359699){const _0x43aa77=a8_0x350b73,{options:_0x55f0e4,args:_0x53b902,tdx:_0x2dd1af}=_0x359699,_0x5e4163=_0x53b902[0x0]||_0x55f0e4[_0x43aa77(0x1f6)];if(!_0x5e4163)return console[_0x43aa77(0x1f1)](a8_0x55a10f[_0x43aa77(0x1ec)]('No\x20composable\x20audience\x20specified.')),console[_0x43aa77(0x1f1)](_0x43aa77(0x22a)+a8_0x55a10f[_0x43aa77(0x24c)](_0x43aa77(0x1e8))+_0x43aa77(0x255)+a8_0x55a10f[_0x43aa77(0x24c)](_0x43aa77(0x240))),0x1;const _0x2205fc=await withProgressSpinner(_0x43aa77(0x254)+_0x5e4163+_0x43aa77(0x21c),()=>_0x2dd1af['cas'][_0x43aa77(0x1df)](_0x5e4163),{'verbose':_0x55f0e4[_0x43aa77(0x265)]}),_0x4471a7=_0x2205fc['data'];if(isStructuredFormat(_0x55f0e4))return await handleSingleObjectOutput(_0x4471a7,_0x55f0e4),0x0;console[_0x43aa77(0x1da)](a8_0x55a10f[_0x43aa77(0x1fc)](_0x4471a7['name']));if(_0x4471a7[_0x43aa77(0x28b)])console['log'](a8_0x55a10f[_0x43aa77(0x233)](_0x4471a7[_0x43aa77(0x28b)]));console['log'](),console[_0x43aa77(0x1da)](a8_0x55a10f[_0x43aa77(0x231)](_0x43aa77(0x246))),console[_0x43aa77(0x1da)]('\x20\x20Schema:\x20'+_0x4471a7['masterSchema']),console[_0x43aa77(0x1da)](_0x43aa77(0x251)+_0x4471a7[_0x43aa77(0x24d)]),console['log']('\x20\x20Key:\x20\x20\x20\x20'+_0x4471a7[_0x43aa77(0x25d)]),console['log']();if(_0x4471a7[_0x43aa77(0x22d)]?.[_0x43aa77(0x278)]){console[_0x43aa77(0x1da)](a8_0x55a10f[_0x43aa77(0x231)]('Attributes\x20('+_0x4471a7[_0x43aa77(0x22d)][_0x43aa77(0x278)]+')'));for(const _0x1061c4 of _0x4471a7[_0x43aa77(0x22d)]){console['log']('\x20\x20'+a8_0x55a10f[_0x43aa77(0x1fc)](_0x1061c4[_0x43aa77(0x27c)])+_0x43aa77(0x20d)+_0x1061c4[_0x43aa77(0x20b)]+'.'+_0x1061c4['table']+'.'+_0x1061c4[_0x43aa77(0x23e)]+'\x20('+a8_0x55a10f['dim'](_0x1061c4['type'])+')');}console[_0x43aa77(0x1da)]();}if(_0x4471a7['behaviors']?.[_0x43aa77(0x278)]){console[_0x43aa77(0x1da)](a8_0x55a10f[_0x43aa77(0x231)](_0x43aa77(0x25c)+_0x4471a7[_0x43aa77(0x212)][_0x43aa77(0x278)]+')'));for(const _0x57d270 of _0x4471a7[_0x43aa77(0x212)]){const _0x444293=_0x57d270['timeColumn']?'\x20(time:\x20'+_0x57d270[_0x43aa77(0x228)]+')':'';console['log']('\x20\x20'+a8_0x55a10f['bold'](_0x57d270['name'])+'\x20—\x20'+_0x57d270[_0x43aa77(0x20b)]+'.'+_0x57d270[_0x43aa77(0x28d)]+_0x444293);}}return 0x0;}}export class CASPullCommand extends BaseCommand{[a8_0x350b73(0x27c)]=a8_0x350b73(0x23b);[a8_0x350b73(0x28b)]=a8_0x350b73(0x217);async[a8_0x350b73(0x21b)](_0x4eee88){const _0x1e43c5=a8_0x350b73,{options:_0x1f91d7,args:_0x9d2da4,tdx:_0x100058}=_0x4eee88,_0x5ba091=_0x1f91d7,_0x1be8e4=_0x9d2da4[0x0]||_0x1f91d7[_0x1e43c5(0x1f6)];if(!_0x1be8e4)return console[_0x1e43c5(0x1f1)](a8_0x55a10f[_0x1e43c5(0x1ec)](_0x1e43c5(0x260))),console[_0x1e43c5(0x1f1)]('Use\x20'+a8_0x55a10f[_0x1e43c5(0x24c)](_0x1e43c5(0x219))+_0x1e43c5(0x255)+a8_0x55a10f[_0x1e43c5(0x24c)](_0x1e43c5(0x240))),0x1;const _0x555cf1=_0x5ba091[_0x1e43c5(0x1f5)]||a8_0x1dbf09['join'](process[_0x1e43c5(0x204)](),_0x1e43c5(0x209),sanitizeFileName(_0x1be8e4)),_0x30d120=await withProgressSpinner(_0x1e43c5(0x258)+_0x1be8e4+_0x1e43c5(0x21c),_0x2fce9d=>_0x100058[_0x1e43c5(0x209)][_0x1e43c5(0x214)](_0x1be8e4,{'targetDir':_0x555cf1,'verbose':_0x5ba091[_0x1e43c5(0x265)],'progress':{'update':_0x21766d=>_0x2fce9d['setPhase'](_0x21766d)}}),{'verbose':_0x5ba091['verbose']}),_0x4fb91a=_0x30d120[_0x1e43c5(0x25b)],_0x369961=_0x4fb91a[_0x1e43c5(0x252)][_0x1e43c5(0x271)](_0x452fae=>_0x452fae[_0x1e43c5(0x1ef)]||_0x452fae['hasChanges']);saveSessionContext({'composable_audience':_0x4fb91a['audienceName']},_0x5ba091[_0x1e43c5(0x20f)]),console[_0x1e43c5(0x1da)](a8_0x55a10f[_0x1e43c5(0x248)](_0x1e43c5(0x234)+a8_0x55a10f[_0x1e43c5(0x233)](_0x1e43c5(0x24f))+'\x20=\x20'+a8_0x55a10f[_0x1e43c5(0x24c)](_0x4fb91a[_0x1e43c5(0x220)])));if(_0x369961[_0x1e43c5(0x278)]===0x0)return console[_0x1e43c5(0x1da)](a8_0x55a10f[_0x1e43c5(0x248)]('All\x20files\x20are\x20up\x20to\x20date.')),0x0;for(const _0x125bc9 of _0x369961){if(_0x125bc9['isNew'])console[_0x1e43c5(0x1da)](a8_0x55a10f[_0x1e43c5(0x248)]('+\x20'+_0x125bc9[_0x1e43c5(0x206)]+_0x1e43c5(0x242)));else _0x125bc9[_0x1e43c5(0x266)]&&(console[_0x1e43c5(0x1da)](a8_0x55a10f[_0x1e43c5(0x1ec)]('~\x20'+_0x125bc9['relativePath'])),console[_0x1e43c5(0x1da)](_0x125bc9[_0x1e43c5(0x266)]));}console[_0x1e43c5(0x1da)]('\x0a'+_0x369961[_0x1e43c5(0x278)]+'\x20file(s)\x20to\x20write\x20'+('('+_0x4fb91a['counts'][_0x1e43c5(0x27b)]+_0x1e43c5(0x23d)+_0x4fb91a[_0x1e43c5(0x238)]['activations']+'\x20activations)'));if(_0x5ba091[_0x1e43c5(0x221)])return console[_0x1e43c5(0x1da)](a8_0x55a10f[_0x1e43c5(0x233)](_0x1e43c5(0x280))),0x0;if(!_0x5ba091[_0x1e43c5(0x1e9)]&&isInteractive()){const _0xfcb45a=await confirmKey(_0x1e43c5(0x216));if(!_0xfcb45a)return console[_0x1e43c5(0x1da)](a8_0x55a10f[_0x1e43c5(0x233)](_0x1e43c5(0x27e))),0x0;}for(const _0x437cef of _0x369961){const _0x591121=a8_0x1dbf09[_0x1e43c5(0x256)](_0x437cef['absolutePath']);if(!existsSync(_0x591121))mkdirSync(_0x591121,{'recursive':!![]});writeFileSync(_0x437cef[_0x1e43c5(0x276)],_0x437cef[_0x1e43c5(0x269)],_0x1e43c5(0x22c));}return console[_0x1e43c5(0x1da)](a8_0x55a10f[_0x1e43c5(0x248)](_0x1e43c5(0x20c)+_0x369961[_0x1e43c5(0x278)]+_0x1e43c5(0x26b)+_0x555cf1)),0x0;}}export class CASPushCommand extends BaseCommand{[a8_0x350b73(0x27c)]=a8_0x350b73(0x287);[a8_0x350b73(0x28b)]=a8_0x350b73(0x21d);async[a8_0x350b73(0x21b)](_0x168af1){const _0x5ef54b=a8_0x350b73,{options:_0x45855,args:_0x2bc38f,tdx:_0x555e4b}=_0x168af1,_0x3aac27=_0x45855;let _0x6809ac=_0x2bc38f[0x0];!_0x6809ac&&_0x45855[_0x5ef54b(0x1f6)]&&(_0x6809ac=a8_0x1dbf09['join'](process['cwd'](),_0x5ef54b(0x209),sanitizeFileName(_0x45855[_0x5ef54b(0x1f6)])));if(!_0x6809ac)return console['error'](a8_0x55a10f[_0x5ef54b(0x1ec)]('No\x20composable\x20audience\x20specified.')),console[_0x5ef54b(0x1f1)]('Use\x20'+a8_0x55a10f[_0x5ef54b(0x24c)](_0x5ef54b(0x21e))+_0x5ef54b(0x255)+a8_0x55a10f[_0x5ef54b(0x24c)](_0x5ef54b(0x240))),0x1;if(!existsSync(_0x6809ac))return console[_0x5ef54b(0x1f1)](a8_0x55a10f['red'](_0x5ef54b(0x273)+_0x6809ac)),console[_0x5ef54b(0x1f1)](a8_0x55a10f[_0x5ef54b(0x233)](_0x5ef54b(0x26e))),0x1;const _0x53d3ff=_0x45855[_0x5ef54b(0x1f6)]||a8_0x1dbf09[_0x5ef54b(0x1dc)](_0x6809ac),_0x19314e=a8_0x1dbf09[_0x5ef54b(0x249)](process[_0x5ef54b(0x204)](),_0x6809ac)||'.';console['log'](_0x5ef54b(0x226)+a8_0x55a10f[_0x5ef54b(0x24c)](_0x53d3ff)),console[_0x5ef54b(0x1da)](_0x5ef54b(0x26d)+a8_0x55a10f[_0x5ef54b(0x233)](_0x19314e)),console['log']();const _0x1f9a48=collectYamlFiles(_0x6809ac);if(_0x1f9a48[_0x5ef54b(0x278)]===0x0)return console[_0x5ef54b(0x1f1)](a8_0x55a10f[_0x5ef54b(0x200)]('No\x20YAML\x20files\x20found\x20in:\x20'+_0x6809ac)),0x1;console['log']('Found\x20'+_0x1f9a48[_0x5ef54b(0x278)]+'\x20YAML\x20file(s)');const _0x45dcfa=await withProgressSpinner(_0x5ef54b(0x28a),()=>buildConnectionMaps(_0x555e4b[_0x5ef54b(0x241)]),{'verbose':_0x3aac27[_0x5ef54b(0x265)]}),_0x16cdd9=_0x45dcfa[_0x5ef54b(0x25b)],{nameToId:_0x430a18,nameToType:_0x1114a2,idToType:_0x252717}=_0x16cdd9,_0x24e4e7=validateCasYamlFiles(_0x1f9a48,_0x6809ac,{'connectionNameToType':_0x1114a2,'connectionIdToType':_0x252717,'connectionNameToId':_0x430a18}),_0x14d599=calculateCasValidationSummary(_0x24e4e7);if(_0x14d599[_0x5ef54b(0x283)]){console[_0x5ef54b(0x1f1)](a8_0x55a10f[_0x5ef54b(0x200)](_0x5ef54b(0x267)));for(const _0x355aa9 of _0x24e4e7){isCasValidationResult(_0x355aa9)&&!_0x355aa9[_0x5ef54b(0x23a)]['valid']&&(console['error']('\x0a'+_0x355aa9[_0x5ef54b(0x206)]+':\x20'+_0x355aa9[_0x5ef54b(0x23a)][_0x5ef54b(0x27d)][_0x5ef54b(0x278)]+_0x5ef54b(0x1f0)),console['error'](formatValidationResult(_0x355aa9[_0x5ef54b(0x23a)],_0x355aa9['source'],_0x355aa9['relativePath'])));}return console[_0x5ef54b(0x1f1)](a8_0x55a10f[_0x5ef54b(0x1ec)](_0x5ef54b(0x224))),0x1;}const _0x33f202=await withProgressSpinner(_0x5ef54b(0x1f4),_0x310915=>_0x555e4b[_0x5ef54b(0x209)][_0x5ef54b(0x288)](_0x1f9a48,{'dryRun':!![],'verbose':_0x3aac27[_0x5ef54b(0x265)],'deleteDrift':_0x3aac27[_0x5ef54b(0x239)],'connectionMaps':_0x16cdd9,'progress':{'update':_0x45b648=>_0x310915[_0x5ef54b(0x1e0)](_0x45b648)}}),{'verbose':_0x3aac27[_0x5ef54b(0x265)]}),_0x1b89d7=_0x33f202[_0x5ef54b(0x25b)],_0x371fd0=(_0x30dfc3,_0x4ec049)=>{const _0x135902=_0x5ef54b,_0x175a96=_0x30dfc3[_0x4ec049],_0x354e7b=[];if(_0x175a96['audiences'])_0x354e7b[_0x135902(0x288)](_0x175a96[_0x135902(0x210)]+_0x135902(0x253));if(_0x175a96[_0x135902(0x1e4)])_0x354e7b['push'](_0x175a96[_0x135902(0x1e4)]+_0x135902(0x20a));if(_0x175a96[_0x135902(0x27b)])_0x354e7b[_0x135902(0x288)](_0x175a96[_0x135902(0x27b)]+_0x135902(0x26f));if(_0x175a96['activations'])_0x354e7b[_0x135902(0x288)](_0x175a96[_0x135902(0x207)]+_0x135902(0x281));return _0x354e7b;},_0xa0c531=_0x371fd0(_0x1b89d7,_0x5ef54b(0x213)),_0x55f5b5=_0x371fd0(_0x1b89d7,_0x5ef54b(0x272)),_0x795a3f=_0x1b89d7[_0x5ef54b(0x213)][_0x5ef54b(0x210)]+_0x1b89d7['created'][_0x5ef54b(0x1e4)]+_0x1b89d7['created'][_0x5ef54b(0x27b)]+_0x1b89d7['created'][_0x5ef54b(0x207)]+_0x1b89d7[_0x5ef54b(0x272)][_0x5ef54b(0x210)]+_0x1b89d7[_0x5ef54b(0x272)]['folders']+_0x1b89d7[_0x5ef54b(0x272)][_0x5ef54b(0x27b)]+_0x1b89d7[_0x5ef54b(0x272)][_0x5ef54b(0x207)];if(_0x795a3f===0x0)return console[_0x5ef54b(0x1da)](a8_0x55a10f[_0x5ef54b(0x233)](_0x5ef54b(0x23f))),0x0;if(_0xa0c531['length']>0x0)console[_0x5ef54b(0x1da)](_0x5ef54b(0x1f2)+_0xa0c531[_0x5ef54b(0x26a)](',\x20'));if(_0x55f5b5[_0x5ef54b(0x278)]>0x0)console['log']('Would\x20update:\x20'+_0x55f5b5[_0x5ef54b(0x26a)](',\x20'));const _0x202d32=_0x1b89d7[_0x5ef54b(0x250)];if(_0x202d32&&(_0x202d32[_0x5ef54b(0x232)][_0x5ef54b(0x278)]||_0x202d32[_0x5ef54b(0x22f)]['length'])){const _0x2cb869=[];_0x202d32[_0x5ef54b(0x232)][_0x5ef54b(0x278)]&&_0x2cb869[_0x5ef54b(0x288)]('attribute(s)\x20'+_0x202d32['removedAttributes'][_0x5ef54b(0x26a)](',\x20')),_0x202d32[_0x5ef54b(0x22f)]['length']&&_0x2cb869[_0x5ef54b(0x288)](_0x5ef54b(0x1fa)+_0x202d32[_0x5ef54b(0x22f)][_0x5ef54b(0x26a)](',\x20')),console[_0x5ef54b(0x1da)](a8_0x55a10f[_0x5ef54b(0x200)](_0x5ef54b(0x1e5)+_0x2cb869[_0x5ef54b(0x26a)](_0x5ef54b(0x229))+'\x20—\x20a\x20real\x20push\x20will\x20refuse\x20unless\x20run\x20with\x20--delete.'));}if(_0x202d32&&(_0x202d32['renamedAttributes']['length']||_0x202d32[_0x5ef54b(0x286)][_0x5ef54b(0x278)])){for(const _0x332ea7 of _0x202d32[_0x5ef54b(0x211)]){console['log'](a8_0x55a10f[_0x5ef54b(0x1ec)](_0x5ef54b(0x1fb)+_0x332ea7['from']+'\x22\x20→\x20\x22'+_0x332ea7['to']+'\x22'));}for(const _0x2ef25e of _0x202d32[_0x5ef54b(0x286)]){console['log'](a8_0x55a10f[_0x5ef54b(0x1ec)](_0x5ef54b(0x1ff)+_0x2ef25e[_0x5ef54b(0x282)]+_0x5ef54b(0x205)+_0x2ef25e['to']+'\x22'));}console['log'](a8_0x55a10f['dim'](_0x5ef54b(0x24a)));}if(_0x3aac27[_0x5ef54b(0x221)])return console['log'](a8_0x55a10f['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;if(!_0x3aac27['yes']){if(!isInteractive())return console[_0x5ef54b(0x1f1)](a8_0x55a10f[_0x5ef54b(0x200)](_0x5ef54b(0x20e)),_0x5ef54b(0x243)),console['error'](a8_0x55a10f['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x492d09=await confirmKey('\x0aPush\x20'+_0x795a3f+'\x20change(s)?');if(!_0x492d09)return console[_0x5ef54b(0x1da)](a8_0x55a10f[_0x5ef54b(0x1ec)](_0x5ef54b(0x244))),0x1;}const _0x5efde1=await withProgressSpinner(_0x5ef54b(0x208),_0x5174ad=>_0x555e4b[_0x5ef54b(0x209)][_0x5ef54b(0x288)](_0x1f9a48,{'dryRun':![],'verbose':_0x3aac27[_0x5ef54b(0x265)],'deleteDrift':_0x3aac27['delete'],'progress':{'update':_0x3731d9=>_0x5174ad[_0x5ef54b(0x1e0)](_0x3731d9)}}),{'verbose':_0x3aac27[_0x5ef54b(0x265)]}),_0x493fb4=_0x5efde1[_0x5ef54b(0x25b)];console['log'](a8_0x55a10f[_0x5ef54b(0x248)](_0x5ef54b(0x1e6)));_0x493fb4[_0x5ef54b(0x220)]&&console[_0x5ef54b(0x1da)](_0x5ef54b(0x1eb)+a8_0x55a10f[_0x5ef54b(0x24c)](_0x493fb4[_0x5ef54b(0x220)]));const _0x25f2e4=_0x371fd0(_0x493fb4,'created'),_0x40bf34=_0x371fd0(_0x493fb4,_0x5ef54b(0x272));if(_0x25f2e4['length']>0x0)console['log'](_0x5ef54b(0x245)+_0x25f2e4[_0x5ef54b(0x26a)](',\x20'));if(_0x40bf34[_0x5ef54b(0x278)]>0x0)console[_0x5ef54b(0x1da)](_0x5ef54b(0x1fe)+_0x40bf34[_0x5ef54b(0x26a)](',\x20'));const _0x40c427=_0x493fb4[_0x5ef54b(0x250)];if(_0x40c427&&(_0x40c427[_0x5ef54b(0x232)][_0x5ef54b(0x278)]||_0x40c427[_0x5ef54b(0x22f)][_0x5ef54b(0x278)])){const _0x27e8fd=[];_0x40c427['removedAttributes'][_0x5ef54b(0x278)]&&_0x27e8fd[_0x5ef54b(0x288)](_0x5ef54b(0x24b)+_0x40c427[_0x5ef54b(0x232)][_0x5ef54b(0x26a)](',\x20')),_0x40c427[_0x5ef54b(0x22f)]['length']&&_0x27e8fd['push'](_0x5ef54b(0x1fa)+_0x40c427[_0x5ef54b(0x22f)][_0x5ef54b(0x26a)](',\x20')),console[_0x5ef54b(0x1da)](a8_0x55a10f[_0x5ef54b(0x200)](_0x5ef54b(0x259)+_0x27e8fd[_0x5ef54b(0x26a)]('\x20and\x20')));}for(const _0x3200f8 of _0x493fb4[_0x5ef54b(0x279)]??[]){console[_0x5ef54b(0x1da)](a8_0x55a10f[_0x5ef54b(0x1ec)](_0x5ef54b(0x1e3)+_0x3200f8[_0x5ef54b(0x282)]+'\x22\x20→\x20\x22'+_0x3200f8['to']+'\x22'+(_0x3200f8['fromId']&&_0x3200f8[_0x5ef54b(0x24e)]?'\x20(server\x20id\x20changed\x20'+_0x3200f8[_0x5ef54b(0x22b)]+'\x20→\x20'+_0x3200f8[_0x5ef54b(0x24e)]+')':'')));}for(const _0x24a513 of _0x493fb4[_0x5ef54b(0x1f9)]??[]){console[_0x5ef54b(0x1da)](a8_0x55a10f['yellow'](_0x5ef54b(0x202)+_0x24a513[_0x5ef54b(0x282)]+'\x22\x20→\x20\x22'+_0x24a513['to']+'\x22'+(_0x24a513[_0x5ef54b(0x22b)]&&_0x24a513['toId']?'\x20(server\x20id\x20changed\x20'+_0x24a513[_0x5ef54b(0x22b)]+'\x20→\x20'+_0x24a513[_0x5ef54b(0x24e)]+')':'')));}return 0x0;}}export class CASValidateCommand extends BaseCommand{[a8_0x350b73(0x27c)]='cas:validate';['description']='Validate\x20composable\x20audience\x20YAML\x20files\x20locally';async[a8_0x350b73(0x21b)](_0x134403){const _0x361467=a8_0x350b73,{options:_0xf6c376,args:_0x15926e,tdx:_0x4563c6}=_0x134403,_0x2364dc=_0xf6c376;let _0x5bc1be=_0x15926e[0x0];!_0x5bc1be&&_0xf6c376[_0x361467(0x1f6)]&&(_0x5bc1be=a8_0x1dbf09[_0x361467(0x26a)](process[_0x361467(0x204)](),_0x361467(0x209),sanitizeFileName(_0xf6c376['composableAudience'])));if(!_0x5bc1be)return console[_0x361467(0x1f1)](a8_0x55a10f[_0x361467(0x1ec)](_0x361467(0x260))),console[_0x361467(0x1f1)](_0x361467(0x22a)+a8_0x55a10f[_0x361467(0x24c)](_0x361467(0x263))+_0x361467(0x255)+a8_0x55a10f[_0x361467(0x24c)](_0x361467(0x240))),0x1;if(!existsSync(_0x5bc1be))return console['error'](a8_0x55a10f['red'](_0x361467(0x275)+_0x5bc1be)),0x1;const _0x295467=collectYamlFiles(_0x5bc1be);if(_0x295467[_0x361467(0x278)]===0x0)return console['error'](a8_0x55a10f[_0x361467(0x200)](_0x361467(0x218)+_0x5bc1be)),0x1;const _0x2549ff=await withProgressSpinner(_0x361467(0x28a),()=>buildConnectionMaps(_0x4563c6[_0x361467(0x241)]),{'verbose':_0x2364dc[_0x361467(0x265)]}),{nameToId:_0x212ee3,nameToType:_0x14dace,idToType:_0xe87c2f}=_0x2549ff[_0x361467(0x25b)],_0x329cb4=validateCasYamlFiles(_0x295467,_0x5bc1be,{'connectionNameToType':_0x14dace,'connectionIdToType':_0xe87c2f,'connectionNameToId':_0x212ee3}),_0x915ceb=calculateCasValidationSummary(_0x329cb4);for(const _0xc592f8 of _0x329cb4){if(!isCasValidationResult(_0xc592f8)){_0x2364dc[_0x361467(0x265)]&&console[_0x361467(0x1da)](a8_0x55a10f['dim']('⊘\x20'+_0xc592f8[_0x361467(0x206)]+':\x20skipped\x20('+_0xc592f8[_0x361467(0x215)]+')'));continue;}if(_0xc592f8[_0x361467(0x23a)][_0x361467(0x203)]&&_0xc592f8[_0x361467(0x23a)][_0x361467(0x1ea)][_0x361467(0x278)]===0x0)_0x2364dc['verbose']&&console[_0x361467(0x1da)](a8_0x55a10f[_0x361467(0x248)]('✔\x20'+_0xc592f8[_0x361467(0x206)]));else _0xc592f8['result'][_0x361467(0x203)]?(console[_0x361467(0x1da)](a8_0x55a10f['yellow']('⚠\x20'+_0xc592f8[_0x361467(0x206)])+a8_0x55a10f['dim'](':\x20'+_0xc592f8['result']['warnings'][_0x361467(0x278)]+_0x361467(0x22e))),console['log'](formatValidationResult(_0xc592f8['result'],_0xc592f8[_0x361467(0x274)],_0xc592f8[_0x361467(0x206)]))):(console[_0x361467(0x1da)](a8_0x55a10f[_0x361467(0x200)]('✖\x20'+_0xc592f8['relativePath'])+a8_0x55a10f[_0x361467(0x233)](':\x20'+_0xc592f8[_0x361467(0x23a)][_0x361467(0x27d)][_0x361467(0x278)]+_0x361467(0x1f0))),console['log'](formatValidationResult(_0xc592f8['result'],_0xc592f8[_0x361467(0x274)],_0xc592f8['relativePath'])));}console[_0x361467(0x1da)]('');if(_0x915ceb[_0x361467(0x283)])return console['log'](a8_0x55a10f[_0x361467(0x200)](_0x361467(0x236)+_0x915ceb[_0x361467(0x1de)]+'\x20file(s)\x20with\x20errors,\x20'+_0x915ceb['validCount']+_0x361467(0x262))),_0x915ceb[_0x361467(0x23c)]>0x0&&console[_0x361467(0x1da)](a8_0x55a10f['yellow'](_0x915ceb['warningCount']+'\x20warning(s)\x20found')),0x1;return console['log'](a8_0x55a10f['green'](_0x361467(0x257)+_0x915ceb['validCount']+_0x361467(0x230))),_0x915ceb[_0x361467(0x23c)]>0x0&&console[_0x361467(0x1da)](a8_0x55a10f[_0x361467(0x1ec)](_0x915ceb[_0x361467(0x23c)]+_0x361467(0x1e7))),_0x915ceb[_0x361467(0x227)]>0x0&&console[_0x361467(0x1da)](a8_0x55a10f[_0x361467(0x233)](_0x915ceb[_0x361467(0x227)]+_0x361467(0x27f))),0x0;}}export class CASPreviewCommand extends BaseCommand{[a8_0x350b73(0x27c)]=a8_0x350b73(0x21a);['description']=a8_0x350b73(0x237);async['execute'](_0x5537e5){const _0x247984=a8_0x350b73,{options:_0x422e42,args:_0x45575a,tdx:_0x1c3d2c}=_0x5537e5,_0x3b2471=_0x45575a[0x0],_0x1ed80d=_0x45575a[0x1]||_0x422e42[_0x247984(0x1f6)];if(!_0x3b2471)return console[_0x247984(0x1f1)](a8_0x55a10f[_0x247984(0x200)](_0x247984(0x201))),0x1;if(!_0x1ed80d)return console[_0x247984(0x1f1)](a8_0x55a10f['yellow'](_0x247984(0x1dd))),console[_0x247984(0x1f1)]('Use\x20'+a8_0x55a10f[_0x247984(0x24c)](_0x247984(0x1e1))+_0x247984(0x255)+a8_0x55a10f[_0x247984(0x24c)](_0x247984(0x240))),0x1;const _0x1cb33a=await withProgressSpinner(_0x247984(0x277)+_0x3b2471+_0x247984(0x21c),()=>_0x1c3d2c[_0x247984(0x209)]['preview'](_0x1ed80d,_0x3b2471),{'verbose':_0x422e42['verbose']}),{query:_0x36baf7,customers:_0x59e4da}=_0x1cb33a[_0x247984(0x25b)];if(isStructuredFormat(_0x422e42))return await handleSingleObjectOutput({'query':_0x36baf7,'customers':_0x59e4da},_0x422e42),0x0;const _0x3a7d9d=_0x36baf7[_0x247984(0x1ed)]===_0x247984(0x1e2)?a8_0x55a10f[_0x247984(0x248)]:a8_0x55a10f[_0x247984(0x1ec)];console[_0x247984(0x1da)](_0x247984(0x264)+_0x3a7d9d(_0x36baf7[_0x247984(0x1ed)])),console['log'](_0x247984(0x21f)+a8_0x55a10f[_0x247984(0x1fc)](String(_0x36baf7[_0x247984(0x270)])));_0x36baf7[_0x247984(0x1f1)]&&console[_0x247984(0x1da)]('Error:\x20\x20'+a8_0x55a10f[_0x247984(0x200)](_0x36baf7[_0x247984(0x1f1)]));if(_0x59e4da?.[_0x247984(0x223)]&&_0x59e4da?.[_0x247984(0x1fd)]){console[_0x247984(0x1da)](a8_0x55a10f[_0x247984(0x231)](_0x247984(0x27a)+_0x59e4da[_0x247984(0x1fd)][_0x247984(0x278)]+')'));const _0x38cdd8=_0x59e4da[_0x247984(0x1fd)][_0x247984(0x28c)](_0x51d7fa=>{const _0xbaf29d=_0x247984,_0x45bd64={};for(let _0x57ce01=0x0;_0x57ce01<_0x59e4da['names'][_0xbaf29d(0x278)];_0x57ce01++){_0x45bd64[_0x59e4da['names'][_0x57ce01]]=_0x51d7fa[_0x57ce01];}return _0x45bd64;});await handleSDKOutput(_0x38cdd8,_0x422e42);}return 0x0;}}
1
+ const a8_0x3ce05c=a8_0x8419;(function(_0x48b8dd,_0x35c503){const _0x24a07c=a8_0x8419,_0x2d3780=_0x48b8dd();while(!![]){try{const _0x5d9999=-parseInt(_0x24a07c(0x1d3))/0x1*(parseInt(_0x24a07c(0x1e2))/0x2)+-parseInt(_0x24a07c(0x1ce))/0x3*(-parseInt(_0x24a07c(0x175))/0x4)+parseInt(_0x24a07c(0x160))/0x5+-parseInt(_0x24a07c(0x18c))/0x6*(parseInt(_0x24a07c(0x140))/0x7)+parseInt(_0x24a07c(0x154))/0x8*(parseInt(_0x24a07c(0x191))/0x9)+parseInt(_0x24a07c(0x13c))/0xa*(-parseInt(_0x24a07c(0x15e))/0xb)+parseInt(_0x24a07c(0x1bb))/0xc;if(_0x5d9999===_0x35c503)break;else _0x2d3780['push'](_0x2d3780['shift']());}catch(_0x9b51ab){_0x2d3780['push'](_0x2d3780['shift']());}}}(a8_0x1c23,0xe63ef));function a8_0x1c23(){const _0x56584e=['Analyzing\x20CAS\x20YAML\x20files...','column','\x20\x20Audience:\x20','\x20—\x20a\x20real\x20push\x20will\x20refuse\x20unless\x20run\x20with\x20--delete.','updated','list','audiences','Preview\x20composable\x20segment\x20query\x20on\x20CDW','\x0a↻\x20Would\x20rename\x20attribute\x20\x22','names','Push\x20YAML\x20files\x20to\x20CAS\x20API','error','\x20YAML\x20file(s)','192gksDXv','\x20warning(s)\x20found','Behaviors\x20(','Master\x20Table','composableAudience','1206ldcjEp','invalidCount','Status:\x20','\x20segments,\x20','data','\x0aError:','\x20composable\x20audiences','Not\x20found:\x20','\x20\x20Renames\x20are\x20applied\x20by\x20recreating\x20the\x20attribute/behavior\x20server-side\x20—\x20its\x20id\x20will\x20change.','\x20\x20Renamed\x20attribute:\x20\x22','basename','cas:desc','\x20\x20Removed\x20(--delete):\x20','\x20(server\x20id\x20changed\x20','\x0aValidation\x20failed:','Attributes\x20(','No\x20composable\x20audiences\x20found.','timeColumn','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','cas:preview','\x20activations)','cwd','errors','execute','masterSchema','\x20\x20Created:\x20','hasErrors','description','files','\x20file(s)\x20with\x20errors,\x20','attribute(s)\x20','renamedAttributes','Validate\x20composable\x20audience\x20YAML\x20files\x20locally','Tip:\x20Run\x20`tdx\x20cas\x20pull\x20<name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Error:\x20\x20','Pushing\x20to\x20CAS\x20API...','table','cyan','from','log','utf-8','fromId','3991272vhWdNf','segments','Would\x20create:\x20','\x20warning(s)','attributes','count','\x27...','join','schema','\x22\x20→\x20\x22','delete','\x20or\x20set\x20context\x20with\x20','dirname','folders','name','Describe\x20a\x20composable\x20audience','length','🧊\x20','green','2787FCYuHG','renamedBehaviors','dir','\x20\x20Key:\x20\x20\x20\x20','absolutePath','736BhehJn','diff','yellow','audienceDrift','source','\x0a⚠\x20On\x20server\x20but\x20not\x20in\x20this\x20YAML:\x20','\x20—\x20','tdx\x20use\x20cas\x20<name>','\x0a↻\x20Would\x20rename\x20behavior\x20\x22','dryRun','\x0a✔\x20Push\x20complete','\x20→\x20','created','push','Found\x20','3952QkHOIz','underline','red','\x20error(s)','content','Usage:\x20tdx\x20cas\x20preview\x20<segment_name>\x20[--audience\x20<name>]','(dry\x20run\x20—\x20no\x20files\x20written)','Wrote\x20','rows','behaviors','--audience\x20<name>','tdx\x20cas\x20validate\x20<path>','\x20change(s)?','Fetching\x20audience\x20\x27','Directory\x20not\x20found:\x20','\x20\x20Schema:\x20','hasChanges','valid','bold','344030jbFeaR','skippedCount','cas:push','verbose','13160LMjKTQ','Aborted.','map','population','Write\x20files?','\x20file(s)\x20to\x20write\x20','\x20composable\x20segment\x20file(s)\x20not\x20validated','activations','counts','status','\x20file(s)\x20valid','audienceName','\x20file(s)\x20to\x20','get','\x20activation(s)','Context\x20set:\x20','pull','\x20(time:\x20','toId','result','83688gobtcX','setPhase','removedAttributes','masterTable','warnings','✔\x20All\x20','Validation\x20failed:\x20','\x20\x20Updated:\x20','\x20audience(s)','Would\x20update:\x20','451kXbJAt','Fetching\x20composable\x20audiences...','4486135NKYwgT','\x20(new)','reason','isNew','Use\x20','Resolving\x20connections...','connection','No\x20composable\x20audience\x20specified.','\x0aPush\x20','yes','cas:list','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','removedBehaviors','behavior(s)\x20','type','preview','warningCount','\x20\x20Renamed\x20behavior:\x20\x22','relativePath','\x20and\x20','dim','5324GlTEbY','Pulling\x20composable\x20audience\x20\x27','tdx\x20cas\x20desc\x20<name>','\x20valid','cas','validCount','Audience:\x20','renamedAttributeIds','renamedBehaviorIds','Source:\x20\x20\x20'];a8_0x1c23=function(){return _0x56584e;};return a8_0x1c23();}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import a8_0x49b07e from'chalk';function a8_0x8419(_0xf23dfb,_0xb7d07d){_0xf23dfb=_0xf23dfb-0x12d;const _0x1c23b9=a8_0x1c23();let _0x8419b3=_0x1c23b9[_0xf23dfb];return _0x8419b3;}import{existsSync,mkdirSync,writeFileSync}from'fs';import a8_0x2345f2 from'path';import{confirmKey,isInteractive}from'../utils/prompt.js';import{collectYamlFiles,buildConnectionMaps}from'../sdk/cas/push-workflow.js';import{validateCasYamlFiles,isCasValidationResult,calculateCasValidationSummary}from'../sdk/cas/validate-files.js';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';export class CASListCommand extends BaseCommand{[a8_0x3ce05c(0x1c9)]=a8_0x3ce05c(0x16a);['description']='List\x20composable\x20audiences';async[a8_0x3ce05c(0x1a8)](_0x3aeb9b){const _0x3489f9=a8_0x3ce05c,{options:_0x58ad3b,tdx:_0x525d41}=_0x3aeb9b,_0x54a74b=await withProgressSpinner(_0x3489f9(0x15f),()=>_0x525d41[_0x3489f9(0x179)][_0x3489f9(0x184)](),{'verbose':_0x58ad3b[_0x3489f9(0x13f)]}),_0x5b1271=_0x54a74b[_0x3489f9(0x195)];if(isStructuredFormat(_0x58ad3b))return await handleSDKOutput(_0x5b1271,_0x58ad3b),0x0;if(_0x5b1271[_0x3489f9(0x1cb)]===0x0)return console[_0x3489f9(0x1b8)](a8_0x49b07e[_0x3489f9(0x174)](_0x3489f9(0x1a1))),0x0;console[_0x3489f9(0x1b8)](a8_0x49b07e[_0x3489f9(0x1cd)](_0x3489f9(0x1e1)+_0x5b1271[_0x3489f9(0x1cb)]+_0x3489f9(0x197)));for(const _0x49f56a of _0x5b1271){const _0x18c3b2=_0x49f56a[_0x3489f9(0x143)]?a8_0x49b07e[_0x3489f9(0x174)]('\x20('+Number(_0x49f56a['population'])['toLocaleString']()+')'):'',_0x1a1e83=a8_0x49b07e[_0x3489f9(0x174)]('\x20'+_0x49f56a[_0x3489f9(0x1a9)]+'.'+_0x49f56a[_0x3489f9(0x157)]);console[_0x3489f9(0x1b8)](_0x3489f9(0x1cc)+_0x49f56a['name']+_0x18c3b2+_0x1a1e83),_0x49f56a['description']&&console['log']('\x20\x20'+a8_0x49b07e[_0x3489f9(0x174)](_0x49f56a[_0x3489f9(0x1ac)]));}return 0x0;}}export class CASDescCommand extends BaseCommand{[a8_0x3ce05c(0x1c9)]=a8_0x3ce05c(0x19c);[a8_0x3ce05c(0x1ac)]=a8_0x3ce05c(0x1ca);async['execute'](_0xe835ba){const _0x314a83=a8_0x3ce05c,{options:_0x570857,args:_0x534f2b,tdx:_0x24eab4}=_0xe835ba,_0x27d261=_0x534f2b[0x0]||_0x570857[_0x314a83(0x190)];if(!_0x27d261)return console['error'](a8_0x49b07e[_0x314a83(0x1d5)]('No\x20composable\x20audience\x20specified.')),console[_0x314a83(0x18a)]('Use\x20'+a8_0x49b07e[_0x314a83(0x1b6)](_0x314a83(0x177))+'\x20or\x20set\x20context\x20with\x20'+a8_0x49b07e['cyan']('tdx\x20use\x20cas\x20<name>')),0x1;const _0x16540d=await withProgressSpinner(_0x314a83(0x136)+_0x27d261+_0x314a83(0x1c1),()=>_0x24eab4['cas'][_0x314a83(0x14d)](_0x27d261),{'verbose':_0x570857[_0x314a83(0x13f)]}),_0x664c79=_0x16540d[_0x314a83(0x195)];if(isStructuredFormat(_0x570857))return await handleSingleObjectOutput(_0x664c79,_0x570857),0x0;console[_0x314a83(0x1b8)](a8_0x49b07e[_0x314a83(0x13b)](_0x664c79[_0x314a83(0x1c9)]));if(_0x664c79[_0x314a83(0x1ac)])console[_0x314a83(0x1b8)](a8_0x49b07e[_0x314a83(0x174)](_0x664c79['description']));console[_0x314a83(0x1b8)](),console[_0x314a83(0x1b8)](a8_0x49b07e['underline'](_0x314a83(0x18f))),console[_0x314a83(0x1b8)](_0x314a83(0x138)+_0x664c79[_0x314a83(0x1a9)]),console[_0x314a83(0x1b8)]('\x20\x20Table:\x20\x20'+_0x664c79[_0x314a83(0x157)]),console['log'](_0x314a83(0x1d1)+_0x664c79['masterKeyColumn']),console[_0x314a83(0x1b8)]();if(_0x664c79[_0x314a83(0x1bf)]?.[_0x314a83(0x1cb)]){console[_0x314a83(0x1b8)](a8_0x49b07e[_0x314a83(0x1e3)](_0x314a83(0x1a0)+_0x664c79['attributes']['length']+')'));for(const _0x1e5201 of _0x664c79[_0x314a83(0x1bf)]){console[_0x314a83(0x1b8)]('\x20\x20'+a8_0x49b07e[_0x314a83(0x13b)](_0x1e5201[_0x314a83(0x1c9)])+_0x314a83(0x1d9)+_0x1e5201[_0x314a83(0x1c3)]+'.'+_0x1e5201['table']+'.'+_0x1e5201[_0x314a83(0x180)]+'\x20('+a8_0x49b07e['dim'](_0x1e5201[_0x314a83(0x16e)])+')');}console['log']();}if(_0x664c79[_0x314a83(0x132)]?.['length']){console['log'](a8_0x49b07e[_0x314a83(0x1e3)](_0x314a83(0x18e)+_0x664c79[_0x314a83(0x132)]['length']+')'));for(const _0x3d6c1a of _0x664c79[_0x314a83(0x132)]){const _0x5659d7=_0x3d6c1a[_0x314a83(0x1a2)]?_0x314a83(0x151)+_0x3d6c1a['timeColumn']+')':'';console[_0x314a83(0x1b8)]('\x20\x20'+a8_0x49b07e['bold'](_0x3d6c1a[_0x314a83(0x1c9)])+_0x314a83(0x1d9)+_0x3d6c1a[_0x314a83(0x1c3)]+'.'+_0x3d6c1a[_0x314a83(0x1b5)]+_0x5659d7);}}return 0x0;}}export class CASPullCommand extends BaseCommand{[a8_0x3ce05c(0x1c9)]='cas:pull';[a8_0x3ce05c(0x1ac)]='Pull\x20composable\x20audience\x20to\x20YAML\x20files';async[a8_0x3ce05c(0x1a8)](_0x2b0a8f){const _0x24a6d6=a8_0x3ce05c,{options:_0x4ba8d1,args:_0x4b1677,tdx:_0x2180d3}=_0x2b0a8f,_0x1cfca5=_0x4ba8d1,_0x15f7d7=_0x4b1677[0x0]||_0x4ba8d1['composableAudience'];if(!_0x15f7d7)return console[_0x24a6d6(0x18a)](a8_0x49b07e[_0x24a6d6(0x1d5)]('No\x20composable\x20audience\x20specified.')),console['error']('Use\x20'+a8_0x49b07e[_0x24a6d6(0x1b6)]('tdx\x20cas\x20pull\x20<name>')+_0x24a6d6(0x1c6)+a8_0x49b07e[_0x24a6d6(0x1b6)](_0x24a6d6(0x1da))),0x1;const _0x555e21=_0x1cfca5[_0x24a6d6(0x1d0)]||a8_0x2345f2[_0x24a6d6(0x1c2)](process[_0x24a6d6(0x1a6)](),_0x24a6d6(0x179),sanitizeFileName(_0x15f7d7)),_0x369757=await withProgressSpinner(_0x24a6d6(0x176)+_0x15f7d7+_0x24a6d6(0x1c1),_0x493e86=>_0x2180d3[_0x24a6d6(0x179)][_0x24a6d6(0x150)](_0x15f7d7,{'targetDir':_0x555e21,'verbose':_0x1cfca5['verbose'],'progress':{'update':_0x5a4bbe=>_0x493e86['setPhase'](_0x5a4bbe)}}),{'verbose':_0x1cfca5['verbose']}),_0x1ef021=_0x369757[_0x24a6d6(0x195)],_0x272398=_0x1ef021[_0x24a6d6(0x1ad)]['filter'](_0x5a924a=>_0x5a924a[_0x24a6d6(0x163)]||_0x5a924a[_0x24a6d6(0x139)]);saveSessionContext({'composable_audience':_0x1ef021['audienceName']},_0x1cfca5['session']),console[_0x24a6d6(0x1b8)](a8_0x49b07e[_0x24a6d6(0x1cd)](_0x24a6d6(0x14f)+a8_0x49b07e[_0x24a6d6(0x174)]('composable_audience')+'\x20=\x20'+a8_0x49b07e[_0x24a6d6(0x1b6)](_0x1ef021[_0x24a6d6(0x14b)])));if(_0x272398[_0x24a6d6(0x1cb)]===0x0)return console[_0x24a6d6(0x1b8)](a8_0x49b07e[_0x24a6d6(0x1cd)]('All\x20files\x20are\x20up\x20to\x20date.')),0x0;for(const _0x45c854 of _0x272398){if(_0x45c854[_0x24a6d6(0x163)])console[_0x24a6d6(0x1b8)](a8_0x49b07e['green']('+\x20'+_0x45c854[_0x24a6d6(0x172)]+_0x24a6d6(0x161)));else _0x45c854['diff']&&(console['log'](a8_0x49b07e[_0x24a6d6(0x1d5)]('~\x20'+_0x45c854[_0x24a6d6(0x172)])),console[_0x24a6d6(0x1b8)](_0x45c854[_0x24a6d6(0x1d4)]));}console[_0x24a6d6(0x1b8)]('\x0a'+_0x272398[_0x24a6d6(0x1cb)]+_0x24a6d6(0x145)+('('+_0x1ef021['counts'][_0x24a6d6(0x1bc)]+_0x24a6d6(0x194)+_0x1ef021[_0x24a6d6(0x148)][_0x24a6d6(0x147)]+_0x24a6d6(0x1a5)));if(_0x1cfca5[_0x24a6d6(0x1dc)])return console[_0x24a6d6(0x1b8)](a8_0x49b07e[_0x24a6d6(0x174)](_0x24a6d6(0x12f))),0x0;if(!_0x1cfca5[_0x24a6d6(0x169)]&&isInteractive()){const _0x15c0ca=await confirmKey(_0x24a6d6(0x144));if(!_0x15c0ca)return console[_0x24a6d6(0x1b8)](a8_0x49b07e[_0x24a6d6(0x174)]('Cancelled.')),0x0;}for(const _0x148fb0 of _0x272398){const _0x4b5bfa=a8_0x2345f2[_0x24a6d6(0x1c7)](_0x148fb0[_0x24a6d6(0x1d2)]);if(!existsSync(_0x4b5bfa))mkdirSync(_0x4b5bfa,{'recursive':!![]});writeFileSync(_0x148fb0[_0x24a6d6(0x1d2)],_0x148fb0[_0x24a6d6(0x12d)],_0x24a6d6(0x1b9));}return console['log'](a8_0x49b07e[_0x24a6d6(0x1cd)](_0x24a6d6(0x130)+_0x272398[_0x24a6d6(0x1cb)]+_0x24a6d6(0x14c)+_0x555e21)),0x0;}}export class CASPushCommand extends BaseCommand{['name']=a8_0x3ce05c(0x13e);[a8_0x3ce05c(0x1ac)]=a8_0x3ce05c(0x189);async['execute'](_0x4d6b9b){const _0x90fae6=a8_0x3ce05c,{options:_0x2790ec,args:_0x83133c,tdx:_0x6da4d}=_0x4d6b9b,_0x146609=_0x2790ec;let _0x59fe8d=_0x83133c[0x0];!_0x59fe8d&&_0x2790ec[_0x90fae6(0x190)]&&(_0x59fe8d=a8_0x2345f2[_0x90fae6(0x1c2)](process[_0x90fae6(0x1a6)](),_0x90fae6(0x179),sanitizeFileName(_0x2790ec[_0x90fae6(0x190)])));if(!_0x59fe8d)return console[_0x90fae6(0x18a)](a8_0x49b07e[_0x90fae6(0x1d5)]('No\x20composable\x20audience\x20specified.')),console[_0x90fae6(0x18a)](_0x90fae6(0x164)+a8_0x49b07e[_0x90fae6(0x1b6)]('tdx\x20cas\x20push\x20<path>')+_0x90fae6(0x1c6)+a8_0x49b07e[_0x90fae6(0x1b6)]('tdx\x20use\x20cas\x20<name>')),0x1;if(!existsSync(_0x59fe8d))return console[_0x90fae6(0x18a)](a8_0x49b07e[_0x90fae6(0x1e4)](_0x90fae6(0x137)+_0x59fe8d)),console[_0x90fae6(0x18a)](a8_0x49b07e['dim'](_0x90fae6(0x1b2))),0x1;const _0x232717=_0x2790ec[_0x90fae6(0x190)]||a8_0x2345f2[_0x90fae6(0x19b)](_0x59fe8d),_0x2f47d7=a8_0x2345f2['relative'](process[_0x90fae6(0x1a6)](),_0x59fe8d)||'.';console[_0x90fae6(0x1b8)](_0x90fae6(0x17b)+a8_0x49b07e['cyan'](_0x232717)),console[_0x90fae6(0x1b8)](_0x90fae6(0x17e)+a8_0x49b07e['dim'](_0x2f47d7)),console[_0x90fae6(0x1b8)]();const _0x27ab10=collectYamlFiles(_0x59fe8d);if(_0x27ab10['length']===0x0)return console[_0x90fae6(0x18a)](a8_0x49b07e['red']('No\x20YAML\x20files\x20found\x20in:\x20'+_0x59fe8d)),0x1;console[_0x90fae6(0x1b8)](_0x90fae6(0x1e1)+_0x27ab10[_0x90fae6(0x1cb)]+_0x90fae6(0x18b));const _0x26f1ac=await withProgressSpinner(_0x90fae6(0x165),()=>buildConnectionMaps(_0x6da4d['connection']),{'verbose':_0x146609[_0x90fae6(0x13f)]}),_0x42bba4=_0x26f1ac[_0x90fae6(0x195)],{nameToId:_0x5e6197,nameToType:_0x28fb8e,idToType:_0xc1dc1}=_0x42bba4,_0x143a88=validateCasYamlFiles(_0x27ab10,_0x59fe8d,{'connectionNameToType':_0x28fb8e,'connectionIdToType':_0xc1dc1,'connectionNameToId':_0x5e6197}),_0x489cf7=calculateCasValidationSummary(_0x143a88);if(_0x489cf7[_0x90fae6(0x1ab)]){console[_0x90fae6(0x18a)](a8_0x49b07e['red'](_0x90fae6(0x19f)));for(const _0x5cd81a of _0x143a88){isCasValidationResult(_0x5cd81a)&&!_0x5cd81a['result'][_0x90fae6(0x13a)]&&(console['error']('\x0a'+_0x5cd81a['relativePath']+':\x20'+_0x5cd81a['result'][_0x90fae6(0x1a7)][_0x90fae6(0x1cb)]+_0x90fae6(0x1e5)),console[_0x90fae6(0x18a)](formatValidationResult(_0x5cd81a['result'],_0x5cd81a[_0x90fae6(0x1d7)],_0x5cd81a['relativePath'])));}return console[_0x90fae6(0x18a)](a8_0x49b07e[_0x90fae6(0x1d5)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20cas\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}const _0x31f62d=await withProgressSpinner(_0x90fae6(0x17f),_0x2fa867=>_0x6da4d[_0x90fae6(0x179)]['push'](_0x27ab10,{'dryRun':!![],'verbose':_0x146609[_0x90fae6(0x13f)],'deleteDrift':_0x146609[_0x90fae6(0x1c5)],'connectionMaps':_0x42bba4,'progress':{'update':_0x67602f=>_0x2fa867[_0x90fae6(0x155)](_0x67602f)}}),{'verbose':_0x146609['verbose']}),_0x3aa633=_0x31f62d[_0x90fae6(0x195)],_0x3d6ec7=(_0x2a98b1,_0x339fc9)=>{const _0x36689c=_0x90fae6,_0x6b1de2=_0x2a98b1[_0x339fc9],_0x5f280b=[];if(_0x6b1de2[_0x36689c(0x185)])_0x5f280b['push'](_0x6b1de2['audiences']+_0x36689c(0x15c));if(_0x6b1de2['folders'])_0x5f280b['push'](_0x6b1de2[_0x36689c(0x1c8)]+'\x20folder(s)');if(_0x6b1de2[_0x36689c(0x1bc)])_0x5f280b[_0x36689c(0x1e0)](_0x6b1de2[_0x36689c(0x1bc)]+'\x20segment(s)');if(_0x6b1de2[_0x36689c(0x147)])_0x5f280b[_0x36689c(0x1e0)](_0x6b1de2[_0x36689c(0x147)]+_0x36689c(0x14e));return _0x5f280b;},_0x5b2eae=_0x3d6ec7(_0x3aa633,'created'),_0x24f718=_0x3d6ec7(_0x3aa633,_0x90fae6(0x183)),_0x180033=_0x3aa633[_0x90fae6(0x1df)][_0x90fae6(0x185)]+_0x3aa633[_0x90fae6(0x1df)][_0x90fae6(0x1c8)]+_0x3aa633[_0x90fae6(0x1df)][_0x90fae6(0x1bc)]+_0x3aa633[_0x90fae6(0x1df)]['activations']+_0x3aa633[_0x90fae6(0x183)][_0x90fae6(0x185)]+_0x3aa633['updated'][_0x90fae6(0x1c8)]+_0x3aa633[_0x90fae6(0x183)]['segments']+_0x3aa633[_0x90fae6(0x183)][_0x90fae6(0x147)];if(_0x180033===0x0)return console[_0x90fae6(0x1b8)](a8_0x49b07e[_0x90fae6(0x174)]('No\x20CAS\x20resources\x20found\x20in\x20YAML\x20files.')),0x0;if(_0x5b2eae['length']>0x0)console['log'](_0x90fae6(0x1bd)+_0x5b2eae['join'](',\x20'));if(_0x24f718[_0x90fae6(0x1cb)]>0x0)console[_0x90fae6(0x1b8)](_0x90fae6(0x15d)+_0x24f718[_0x90fae6(0x1c2)](',\x20'));const _0x2737fd=_0x3aa633[_0x90fae6(0x1d6)];if(_0x2737fd&&(_0x2737fd[_0x90fae6(0x156)][_0x90fae6(0x1cb)]||_0x2737fd[_0x90fae6(0x16c)][_0x90fae6(0x1cb)])){const _0x2fe518=[];_0x2737fd[_0x90fae6(0x156)][_0x90fae6(0x1cb)]&&_0x2fe518['push'](_0x90fae6(0x1af)+_0x2737fd[_0x90fae6(0x156)][_0x90fae6(0x1c2)](',\x20')),_0x2737fd[_0x90fae6(0x16c)][_0x90fae6(0x1cb)]&&_0x2fe518['push'](_0x90fae6(0x16d)+_0x2737fd['removedBehaviors'][_0x90fae6(0x1c2)](',\x20')),console['log'](a8_0x49b07e[_0x90fae6(0x1e4)](_0x90fae6(0x1d8)+_0x2fe518['join'](_0x90fae6(0x173))+_0x90fae6(0x182)));}if(_0x2737fd&&(_0x2737fd[_0x90fae6(0x1b0)]['length']||_0x2737fd[_0x90fae6(0x1cf)]['length'])){for(const _0x1dfcad of _0x2737fd[_0x90fae6(0x1b0)]){console['log'](a8_0x49b07e['yellow'](_0x90fae6(0x187)+_0x1dfcad[_0x90fae6(0x1b7)]+_0x90fae6(0x1c4)+_0x1dfcad['to']+'\x22'));}for(const _0x2e0cca of _0x2737fd[_0x90fae6(0x1cf)]){console[_0x90fae6(0x1b8)](a8_0x49b07e[_0x90fae6(0x1d5)](_0x90fae6(0x1db)+_0x2e0cca[_0x90fae6(0x1b7)]+'\x22\x20→\x20\x22'+_0x2e0cca['to']+'\x22'));}console[_0x90fae6(0x1b8)](a8_0x49b07e[_0x90fae6(0x174)](_0x90fae6(0x199)));}if(_0x146609[_0x90fae6(0x1dc)])return console[_0x90fae6(0x1b8)](a8_0x49b07e['yellow'](_0x90fae6(0x1a3))),0x0;if(!_0x146609['yes']){if(!isInteractive())return console[_0x90fae6(0x18a)](a8_0x49b07e[_0x90fae6(0x1e4)](_0x90fae6(0x196)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x90fae6(0x18a)](a8_0x49b07e[_0x90fae6(0x174)](_0x90fae6(0x16b))),0x1;const _0x281b03=await confirmKey(_0x90fae6(0x168)+_0x180033+_0x90fae6(0x135));if(!_0x281b03)return console[_0x90fae6(0x1b8)](a8_0x49b07e['yellow'](_0x90fae6(0x141))),0x1;}const _0x2354b3=await withProgressSpinner(_0x90fae6(0x1b4),_0x89c4cd=>_0x6da4d[_0x90fae6(0x179)]['push'](_0x27ab10,{'dryRun':![],'verbose':_0x146609[_0x90fae6(0x13f)],'deleteDrift':_0x146609[_0x90fae6(0x1c5)],'progress':{'update':_0x1384d5=>_0x89c4cd[_0x90fae6(0x155)](_0x1384d5)}}),{'verbose':_0x146609[_0x90fae6(0x13f)]}),_0x2f6c07=_0x2354b3[_0x90fae6(0x195)];console[_0x90fae6(0x1b8)](a8_0x49b07e[_0x90fae6(0x1cd)](_0x90fae6(0x1dd)));_0x2f6c07[_0x90fae6(0x14b)]&&console[_0x90fae6(0x1b8)](_0x90fae6(0x181)+a8_0x49b07e['cyan'](_0x2f6c07[_0x90fae6(0x14b)]));const _0x731735=_0x3d6ec7(_0x2f6c07,_0x90fae6(0x1df)),_0x9a4f4e=_0x3d6ec7(_0x2f6c07,_0x90fae6(0x183));if(_0x731735[_0x90fae6(0x1cb)]>0x0)console[_0x90fae6(0x1b8)](_0x90fae6(0x1aa)+_0x731735[_0x90fae6(0x1c2)](',\x20'));if(_0x9a4f4e['length']>0x0)console[_0x90fae6(0x1b8)](_0x90fae6(0x15b)+_0x9a4f4e['join'](',\x20'));const _0x1cb312=_0x2f6c07[_0x90fae6(0x1d6)];if(_0x1cb312&&(_0x1cb312['removedAttributes'][_0x90fae6(0x1cb)]||_0x1cb312[_0x90fae6(0x16c)][_0x90fae6(0x1cb)])){const _0x831865=[];_0x1cb312[_0x90fae6(0x156)][_0x90fae6(0x1cb)]&&_0x831865[_0x90fae6(0x1e0)](_0x90fae6(0x1af)+_0x1cb312['removedAttributes'][_0x90fae6(0x1c2)](',\x20')),_0x1cb312['removedBehaviors'][_0x90fae6(0x1cb)]&&_0x831865[_0x90fae6(0x1e0)]('behavior(s)\x20'+_0x1cb312[_0x90fae6(0x16c)][_0x90fae6(0x1c2)](',\x20')),console[_0x90fae6(0x1b8)](a8_0x49b07e['red'](_0x90fae6(0x19d)+_0x831865['join'](_0x90fae6(0x173))));}for(const _0x3c09dc of _0x2f6c07[_0x90fae6(0x17c)]??[]){console[_0x90fae6(0x1b8)](a8_0x49b07e[_0x90fae6(0x1d5)](_0x90fae6(0x19a)+_0x3c09dc['from']+'\x22\x20→\x20\x22'+_0x3c09dc['to']+'\x22'+(_0x3c09dc[_0x90fae6(0x1ba)]&&_0x3c09dc['toId']?_0x90fae6(0x19e)+_0x3c09dc[_0x90fae6(0x1ba)]+_0x90fae6(0x1de)+_0x3c09dc[_0x90fae6(0x152)]+')':'')));}for(const _0x1eff74 of _0x2f6c07[_0x90fae6(0x17d)]??[]){console['log'](a8_0x49b07e[_0x90fae6(0x1d5)](_0x90fae6(0x171)+_0x1eff74[_0x90fae6(0x1b7)]+_0x90fae6(0x1c4)+_0x1eff74['to']+'\x22'+(_0x1eff74[_0x90fae6(0x1ba)]&&_0x1eff74['toId']?_0x90fae6(0x19e)+_0x1eff74[_0x90fae6(0x1ba)]+_0x90fae6(0x1de)+_0x1eff74[_0x90fae6(0x152)]+')':'')));}return 0x0;}}export class CASValidateCommand extends BaseCommand{[a8_0x3ce05c(0x1c9)]='cas:validate';[a8_0x3ce05c(0x1ac)]=a8_0x3ce05c(0x1b1);async['execute'](_0x278e69){const _0xc376e9=a8_0x3ce05c,{options:_0x30f206,args:_0x5abf47,tdx:_0x596b90}=_0x278e69,_0x4b1a32=_0x30f206;let _0x33c8f1=_0x5abf47[0x0];!_0x33c8f1&&_0x30f206[_0xc376e9(0x190)]&&(_0x33c8f1=a8_0x2345f2[_0xc376e9(0x1c2)](process[_0xc376e9(0x1a6)](),_0xc376e9(0x179),sanitizeFileName(_0x30f206[_0xc376e9(0x190)])));if(!_0x33c8f1)return console[_0xc376e9(0x18a)](a8_0x49b07e[_0xc376e9(0x1d5)](_0xc376e9(0x167))),console[_0xc376e9(0x18a)](_0xc376e9(0x164)+a8_0x49b07e[_0xc376e9(0x1b6)](_0xc376e9(0x134))+_0xc376e9(0x1c6)+a8_0x49b07e['cyan'](_0xc376e9(0x1da))),0x1;if(!existsSync(_0x33c8f1))return console[_0xc376e9(0x18a)](a8_0x49b07e[_0xc376e9(0x1e4)](_0xc376e9(0x198)+_0x33c8f1)),0x1;const _0x168f3b=collectYamlFiles(_0x33c8f1);if(_0x168f3b[_0xc376e9(0x1cb)]===0x0)return console[_0xc376e9(0x18a)](a8_0x49b07e[_0xc376e9(0x1e4)]('No\x20YAML\x20files\x20found\x20in:\x20'+_0x33c8f1)),0x1;const _0x3492e8=await withProgressSpinner(_0xc376e9(0x165),()=>buildConnectionMaps(_0x596b90[_0xc376e9(0x166)]),{'verbose':_0x4b1a32['verbose']}),{nameToId:_0x431569,nameToType:_0x5c6739,idToType:_0x53ff3f}=_0x3492e8[_0xc376e9(0x195)],_0x4f90b0=validateCasYamlFiles(_0x168f3b,_0x33c8f1,{'connectionNameToType':_0x5c6739,'connectionIdToType':_0x53ff3f,'connectionNameToId':_0x431569}),_0x459619=calculateCasValidationSummary(_0x4f90b0);for(const _0x4a1c55 of _0x4f90b0){if(!isCasValidationResult(_0x4a1c55)){_0x4b1a32[_0xc376e9(0x13f)]&&console['log'](a8_0x49b07e[_0xc376e9(0x174)]('⊘\x20'+_0x4a1c55[_0xc376e9(0x172)]+':\x20skipped\x20('+_0x4a1c55[_0xc376e9(0x162)]+')'));continue;}if(_0x4a1c55[_0xc376e9(0x153)][_0xc376e9(0x13a)]&&_0x4a1c55[_0xc376e9(0x153)][_0xc376e9(0x158)][_0xc376e9(0x1cb)]===0x0)_0x4b1a32[_0xc376e9(0x13f)]&&console[_0xc376e9(0x1b8)](a8_0x49b07e['green']('✔\x20'+_0x4a1c55[_0xc376e9(0x172)]));else _0x4a1c55[_0xc376e9(0x153)][_0xc376e9(0x13a)]?(console[_0xc376e9(0x1b8)](a8_0x49b07e['yellow']('⚠\x20'+_0x4a1c55[_0xc376e9(0x172)])+a8_0x49b07e[_0xc376e9(0x174)](':\x20'+_0x4a1c55[_0xc376e9(0x153)][_0xc376e9(0x158)][_0xc376e9(0x1cb)]+_0xc376e9(0x1be))),console[_0xc376e9(0x1b8)](formatValidationResult(_0x4a1c55['result'],_0x4a1c55[_0xc376e9(0x1d7)],_0x4a1c55[_0xc376e9(0x172)]))):(console[_0xc376e9(0x1b8)](a8_0x49b07e[_0xc376e9(0x1e4)]('✖\x20'+_0x4a1c55[_0xc376e9(0x172)])+a8_0x49b07e[_0xc376e9(0x174)](':\x20'+_0x4a1c55['result']['errors'][_0xc376e9(0x1cb)]+'\x20error(s)')),console[_0xc376e9(0x1b8)](formatValidationResult(_0x4a1c55[_0xc376e9(0x153)],_0x4a1c55['source'],_0x4a1c55['relativePath'])));}console[_0xc376e9(0x1b8)]('');if(_0x459619['hasErrors'])return console['log'](a8_0x49b07e[_0xc376e9(0x1e4)](_0xc376e9(0x15a)+_0x459619[_0xc376e9(0x192)]+_0xc376e9(0x1ae)+_0x459619[_0xc376e9(0x17a)]+_0xc376e9(0x178))),_0x459619[_0xc376e9(0x170)]>0x0&&console[_0xc376e9(0x1b8)](a8_0x49b07e['yellow'](_0x459619[_0xc376e9(0x170)]+_0xc376e9(0x18d))),0x1;return console[_0xc376e9(0x1b8)](a8_0x49b07e[_0xc376e9(0x1cd)](_0xc376e9(0x159)+_0x459619[_0xc376e9(0x17a)]+_0xc376e9(0x14a))),_0x459619['warningCount']>0x0&&console['log'](a8_0x49b07e[_0xc376e9(0x1d5)](_0x459619[_0xc376e9(0x170)]+'\x20warning(s)\x20found')),_0x459619[_0xc376e9(0x13d)]>0x0&&console[_0xc376e9(0x1b8)](a8_0x49b07e[_0xc376e9(0x174)](_0x459619[_0xc376e9(0x13d)]+_0xc376e9(0x146))),0x0;}}export class CASPreviewCommand extends BaseCommand{[a8_0x3ce05c(0x1c9)]=a8_0x3ce05c(0x1a4);[a8_0x3ce05c(0x1ac)]=a8_0x3ce05c(0x186);async['execute'](_0x12b3da){const _0x3ebf40=a8_0x3ce05c,{options:_0x5c9258,args:_0x2a0564,tdx:_0x17f6b2}=_0x12b3da,_0x467418=_0x2a0564[0x0],_0x5480a9=_0x2a0564[0x1]||_0x5c9258[_0x3ebf40(0x190)];if(!_0x467418)return console[_0x3ebf40(0x18a)](a8_0x49b07e['red'](_0x3ebf40(0x12e))),0x1;if(!_0x5480a9)return console[_0x3ebf40(0x18a)](a8_0x49b07e[_0x3ebf40(0x1d5)]('Audience\x20name\x20required.')),console['error']('Use\x20'+a8_0x49b07e[_0x3ebf40(0x1b6)](_0x3ebf40(0x133))+_0x3ebf40(0x1c6)+a8_0x49b07e[_0x3ebf40(0x1b6)](_0x3ebf40(0x1da))),0x1;const _0x54955c=await withProgressSpinner('Running\x20preview\x20for\x20\x27'+_0x467418+_0x3ebf40(0x1c1),()=>_0x17f6b2[_0x3ebf40(0x179)][_0x3ebf40(0x16f)](_0x5480a9,_0x467418),{'verbose':_0x5c9258[_0x3ebf40(0x13f)]}),{query:_0x36e5d,customers:_0x4bdecb}=_0x54955c[_0x3ebf40(0x195)];if(isStructuredFormat(_0x5c9258))return await handleSingleObjectOutput({'query':_0x36e5d,'customers':_0x4bdecb},_0x5c9258),0x0;const _0x2466c3=_0x36e5d[_0x3ebf40(0x149)]==='success'?a8_0x49b07e[_0x3ebf40(0x1cd)]:a8_0x49b07e[_0x3ebf40(0x1d5)];console[_0x3ebf40(0x1b8)](_0x3ebf40(0x193)+_0x2466c3(_0x36e5d[_0x3ebf40(0x149)])),console['log']('Count:\x20\x20'+a8_0x49b07e[_0x3ebf40(0x13b)](String(_0x36e5d[_0x3ebf40(0x1c0)])));_0x36e5d['error']&&console[_0x3ebf40(0x1b8)](_0x3ebf40(0x1b3)+a8_0x49b07e[_0x3ebf40(0x1e4)](_0x36e5d['error']));if(_0x4bdecb?.['names']&&_0x4bdecb?.[_0x3ebf40(0x131)]){console['log'](a8_0x49b07e['underline']('\x0aSample\x20Rows\x20('+_0x4bdecb[_0x3ebf40(0x131)][_0x3ebf40(0x1cb)]+')'));const _0x60a98b=_0x4bdecb[_0x3ebf40(0x131)][_0x3ebf40(0x142)](_0x51de04=>{const _0x4be542=_0x3ebf40,_0x121f24={};for(let _0x1a96ce=0x0;_0x1a96ce<_0x4bdecb[_0x4be542(0x188)][_0x4be542(0x1cb)];_0x1a96ce++){_0x121f24[_0x4bdecb['names'][_0x1a96ce]]=_0x51de04[_0x1a96ce];}return _0x121f24;});await handleSDKOutput(_0x60a98b,_0x5c9258);}return 0x0;}}
@@ -1 +1 @@
1
- const a9_0x4ab9b2=a9_0x3a12;(function(_0x47b534,_0x180402){const _0x42821c=a9_0x3a12,_0x4ffe28=_0x47b534();while(!![]){try{const _0x1990a3=parseInt(_0x42821c(0x1ef))/0x1*(parseInt(_0x42821c(0x1d3))/0x2)+parseInt(_0x42821c(0x1ee))/0x3*(-parseInt(_0x42821c(0x1ab))/0x4)+parseInt(_0x42821c(0x1ac))/0x5+parseInt(_0x42821c(0x1e8))/0x6+parseInt(_0x42821c(0x1d1))/0x7*(-parseInt(_0x42821c(0x1b8))/0x8)+parseInt(_0x42821c(0x202))/0x9*(-parseInt(_0x42821c(0x1cd))/0xa)+parseInt(_0x42821c(0x1d7))/0xb;if(_0x1990a3===_0x180402)break;else _0x4ffe28['push'](_0x4ffe28['shift']());}catch(_0x282438){_0x4ffe28['push'](_0x4ffe28['shift']());}}}(a9_0x336b,0xc5714));import a9_0x2d9aa8 from'path';import{existsSync,readFileSync,statSync}from'fs';import*as a9_0x3439ba from'yaml';import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';function a9_0x336b(){const _0x4a50cd=['executeDelete','Audience\x20name\x20required.','cyan','red','Resolving\x20audience\x20\x27','delete','\x20from\x20audience\x20','listSegments','dim','Bulk/directory\x20delete\x20is\x20not\x20supported\x20yet.','verbose','\x27...','segments','601830pptHHN','updated','population','Audience:\x20','5719DONfWB','Analyzing\x20segment\x20YAML...','2tnhAWr','parse','\x22?\x20This\x20cannot\x20be\x20undone.','green','69080HJiCQc','cwd','Pushing\x20segment\x20to\x20\x27','setPhase','resolveAudienceId','Or\x20set\x20context:\x20tdx\x20use\x20cas\x20<audience_name>','cas:sg:push','Deleting\x20segment\x20\x27','connection','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','data','\x22\x20from\x20audience\x20\x22','tdx\x20use\x20cas\x20<name>','\x20\x20Segment:\x20\x20','\x20doesn\x27t\x20look\x20like\x20a\x20composable\x20segment.','\x20as\x20YAML:\x20','\x20segment\x20in\x20audience\x20','815214DOuTvT','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x0a✔\x20Segment\x20','List\x20composable\x20segments\x20for\x20an\x20audience','dryRun','\x0a✔\x20Segment\x20deleted','3DgjhEE','1019414OtXwim','Source:\x20\x20\x20','push','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Usage:\x20tdx\x20cas\x20sg\x20push\x20<segment.yml>\x20[--audience\x20<name>]','length','Composable\x20segment\x20\x22','isDirectory','created','error','\x20or\x20set\x20context\x20with\x20','find','yellow','log','execute','\x20is\x20a\x20directory\x20—\x20tdx\x20cas\x20sg\x20push\x20takes\x20a\x20single\x20file.','Create\x20or\x20update\x20a\x20single\x20composable\x20child\x20segment','Aborted.','description','18HCdQpc','message','create','yes','369080LrxIwV','3408495XExzSW','\x22\x20not\x20found\x20under\x20audience\x20\x22','\x20this\x20segment?','\x0aDelete\x20segment\x20\x22','\x20segment','Create','--audience\x20<name>','name','cas','Use\x20','composableAudience','Update','8048EvXZfz','Resolving\x20connections...','Usage:\x20tdx\x20cas\x20sg\x20list\x20<audience_name>','utf-8','relative','deleteSegmentById','basename','\x0aError:'];a9_0x336b=function(){return _0x4a50cd;};return a9_0x336b();}function a9_0x3a12(_0x23aa08,_0x16c360){_0x23aa08=_0x23aa08-0x1a8;const _0x336b35=a9_0x336b();let _0x3a129c=_0x336b35[_0x23aa08];return _0x3a129c;}import{formatRows}from'../sdk/util/formatters.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{buildConnectionMaps}from'../sdk/cas/push-workflow.js';import{isComposableSegmentDef}from'../sdk/cas/cas-segment-yaml.js';import a9_0x1dec4c from'chalk';export class CASSegmentListCommand extends BaseCommand{[a9_0x4ab9b2(0x1b3)]='cas:sg:list';['description']=a9_0x4ab9b2(0x1eb);async[a9_0x4ab9b2(0x1fd)](_0x2c133b){const _0x5dbc47=a9_0x4ab9b2,{options:_0x3264a5,args:_0x5ab4bd,tdx:_0xed86d2}=_0x2c133b,_0x1acd15=_0x5ab4bd[0x0]||_0x3264a5[_0x5dbc47(0x1b6)];if(!_0x1acd15)return console[_0x5dbc47(0x1f8)](a9_0x1dec4c['red'](_0x5dbc47(0x1ba))),console[_0x5dbc47(0x1f8)](a9_0x1dec4c[_0x5dbc47(0x1c8)](_0x5dbc47(0x1dc))),0x1;const _0x546b5d=await withProgressSpinner('Fetching\x20segments\x20for\x20\x27'+_0x1acd15+_0x5dbc47(0x1cb),()=>_0xed86d2['cas']['listSegments'](_0x1acd15),{'verbose':_0x3264a5['verbose']}),_0x45ef84=_0x546b5d[_0x5dbc47(0x1e1)];if(isStructuredFormat(_0x3264a5))return await handleSDKOutput(_0x45ef84,_0x3264a5),0x0;console[_0x5dbc47(0x1fc)](a9_0x1dec4c[_0x5dbc47(0x1d6)]('Found\x20'+_0x45ef84['length']+_0x5dbc47(0x1b0)+(_0x45ef84[_0x5dbc47(0x1f4)]!==0x1?'s':'')));if(_0x45ef84[_0x5dbc47(0x1f4)]===0x0)return 0x0;for(const _0x39fe8d of _0x45ef84){const _0x163f63=_0x39fe8d[_0x5dbc47(0x1cf)]!=null?a9_0x1dec4c[_0x5dbc47(0x1c8)]('\x20('+formatRows(_0x39fe8d[_0x5dbc47(0x1cf)])+')'):'';console['log']('🎯\x20'+_0x39fe8d[_0x5dbc47(0x1b3)]+_0x163f63),_0x39fe8d[_0x5dbc47(0x201)]&&console['log']('\x20\x20'+a9_0x1dec4c[_0x5dbc47(0x1c8)](_0x39fe8d[_0x5dbc47(0x201)]));}return 0x0;}}export class CASSegmentPushCommand extends BaseCommand{['name']=a9_0x4ab9b2(0x1dd);['description']=a9_0x4ab9b2(0x1ff);async['execute'](_0x28bc6f){const _0x409188=a9_0x4ab9b2,{options:_0x78eb56,args:_0x6e6565,tdx:_0x5eaaf4}=_0x28bc6f,_0xf8a141=_0x78eb56,_0x432c45=_0x6e6565[0x0];if(!_0x432c45)return console[_0x409188(0x1f8)](a9_0x1dec4c['red'](_0x409188(0x1f3))),0x1;if(!existsSync(_0x432c45))return console[_0x409188(0x1f8)](a9_0x1dec4c[_0x409188(0x1c3)]('File\x20not\x20found:\x20'+_0x432c45)),0x1;if(statSync(_0x432c45)[_0x409188(0x1f6)]())return console['error'](a9_0x1dec4c[_0x409188(0x1c3)](_0x432c45+_0x409188(0x1fe))),_0xf8a141[_0x409188(0x1c5)]?console[_0x409188(0x1f8)](a9_0x1dec4c[_0x409188(0x1c8)](_0x409188(0x1c9))):console[_0x409188(0x1f8)](a9_0x1dec4c[_0x409188(0x1c8)]('Use\x20`tdx\x20cas\x20push\x20<dir>`\x20to\x20push\x20multiple\x20files\x20at\x20once.')),0x1;const _0x3bdb08=_0xf8a141['audience']||_0x78eb56[_0x409188(0x1b6)];if(!_0x3bdb08)return console[_0x409188(0x1f8)](a9_0x1dec4c[_0x409188(0x1fb)](_0x409188(0x1c1))),console['error'](_0x409188(0x1b5)+a9_0x1dec4c['cyan'](_0x409188(0x1b2))+_0x409188(0x1f9)+a9_0x1dec4c['cyan'](_0x409188(0x1e3))),0x1;console[_0x409188(0x1fc)](_0x409188(0x1d0)+a9_0x1dec4c[_0x409188(0x1c2)](_0x3bdb08)),console[_0x409188(0x1fc)](_0x409188(0x1f0)+a9_0x1dec4c[_0x409188(0x1c8)](a9_0x2d9aa8[_0x409188(0x1bc)](process[_0x409188(0x1d8)](),_0x432c45)||'.')),console['log']();let _0xed79e0;try{_0xed79e0=a9_0x3439ba[_0x409188(0x1d4)](readFileSync(_0x432c45,_0x409188(0x1bb)));}catch(_0x5b5d59){return console[_0x409188(0x1f8)](a9_0x1dec4c[_0x409188(0x1c3)]('Failed\x20to\x20parse\x20'+a9_0x2d9aa8['basename'](_0x432c45)+_0x409188(0x1e6)),_0x5b5d59 instanceof Error?_0x5b5d59[_0x409188(0x1a8)]:String(_0x5b5d59)),0x1;}if(!isComposableSegmentDef(_0xed79e0))return console[_0x409188(0x1f8)](a9_0x1dec4c[_0x409188(0x1c3)](a9_0x2d9aa8[_0x409188(0x1be)](_0x432c45)+_0x409188(0x1e5))),console[_0x409188(0x1f8)](a9_0x1dec4c[_0x409188(0x1fb)]('Composable\x20segment\x20YAML\x20requires\x20`type:\x20composable_segment`\x20at\x20the\x20top\x20level.')),0x1;if(_0xf8a141[_0x409188(0x1c5)])return this[_0x409188(0x1c0)](_0x28bc6f,_0x3bdb08,_0xed79e0[_0x409188(0x1b3)],_0xf8a141);const _0x268589=await withProgressSpinner(_0x409188(0x1b9),()=>buildConnectionMaps(_0x5eaaf4[_0x409188(0x1df)]),{'verbose':_0xf8a141[_0x409188(0x1ca)]}),_0x504628=_0x268589[_0x409188(0x1e1)],_0x12248d=await withProgressSpinner(_0x409188(0x1c4)+_0x3bdb08+_0x409188(0x1cb),()=>_0x5eaaf4[_0x409188(0x1b4)][_0x409188(0x1db)](_0x3bdb08),{'verbose':_0xf8a141['verbose']}),_0x4f0dad=_0x12248d[_0x409188(0x1e1)],_0x22b610=await withProgressSpinner(_0x409188(0x1d2),_0x3f0f7d=>_0x5eaaf4[_0x409188(0x1b4)][_0x409188(0x1f1)]([_0x432c45],{'dryRun':!![],'verbose':_0xf8a141['verbose'],'resolvedAudienceId':_0x4f0dad,'connectionMaps':_0x504628,'progress':{'update':_0x4918c4=>_0x3f0f7d['setPhase'](_0x4918c4)}}),{'verbose':_0xf8a141[_0x409188(0x1ca)]}),_0x401b36=_0x22b610[_0x409188(0x1e1)],_0x23d433=_0x401b36[_0x409188(0x1ce)][_0x409188(0x1cc)]>0x0,_0x29c0fe=_0x23d433?'update':_0x409188(0x1a9);console[_0x409188(0x1fc)]('Would\x20'+_0x29c0fe+_0x409188(0x1e7)+a9_0x1dec4c[_0x409188(0x1c2)](_0x3bdb08));if(_0xf8a141[_0x409188(0x1ec)])return console[_0x409188(0x1fc)](a9_0x1dec4c[_0x409188(0x1fb)](_0x409188(0x1e9))),0x0;if(!_0xf8a141[_0x409188(0x1aa)]){if(!isInteractive())return console['error'](a9_0x1dec4c['red'](_0x409188(0x1bf)),_0x409188(0x1e0)),console['error'](a9_0x1dec4c['dim'](_0x409188(0x1f2))),0x1;const _0x9e4a90=await confirmKey('\x0a'+(_0x23d433?_0x409188(0x1b7):_0x409188(0x1b1))+_0x409188(0x1ae));if(!_0x9e4a90)return console['log'](a9_0x1dec4c[_0x409188(0x1fb)](_0x409188(0x200))),0x1;}const _0x2c4b3c=await withProgressSpinner(_0x409188(0x1d9)+_0x3bdb08+_0x409188(0x1cb),_0x7b8c58=>_0x5eaaf4['cas'][_0x409188(0x1f1)]([_0x432c45],{'dryRun':![],'verbose':_0xf8a141[_0x409188(0x1ca)],'resolvedAudienceId':_0x4f0dad,'progress':{'update':_0xd5e4ae=>_0x7b8c58[_0x409188(0x1da)](_0xd5e4ae)}}),{'verbose':_0xf8a141['verbose']}),_0x390302=_0x2c4b3c[_0x409188(0x1e1)],_0xeafba=_0x390302[_0x409188(0x1f7)][_0x409188(0x1cc)]>0x0;return console[_0x409188(0x1fc)](a9_0x1dec4c[_0x409188(0x1d6)](_0x409188(0x1ea)+(_0xeafba?_0x409188(0x1f7):_0x409188(0x1ce)))),console[_0x409188(0x1fc)]('\x20\x20Audience:\x20'+a9_0x1dec4c[_0x409188(0x1c2)](_0x3bdb08)),0x0;}async[a9_0x4ab9b2(0x1c0)](_0x256ddb,_0x2c4ebc,_0x3ac96c,_0x2cb819){const _0x14a65e=a9_0x4ab9b2,{tdx:_0x390633}=_0x256ddb,_0x165a31=await withProgressSpinner('Fetching\x20segments\x20for\x20\x27'+_0x2c4ebc+_0x14a65e(0x1cb),()=>_0x390633[_0x14a65e(0x1b4)][_0x14a65e(0x1c7)](_0x2c4ebc),{'verbose':_0x2cb819[_0x14a65e(0x1ca)]}),_0x42864e=_0x165a31[_0x14a65e(0x1e1)][_0x14a65e(0x1fa)](_0x2d9a41=>_0x2d9a41[_0x14a65e(0x1b3)]===_0x3ac96c);if(!_0x42864e)return console[_0x14a65e(0x1f8)](a9_0x1dec4c[_0x14a65e(0x1c3)](_0x14a65e(0x1f5)+_0x3ac96c+_0x14a65e(0x1ad)+_0x2c4ebc+'\x22.')),console[_0x14a65e(0x1f8)](a9_0x1dec4c[_0x14a65e(0x1c8)]('Nothing\x20to\x20delete.')),0x1;console[_0x14a65e(0x1fc)]('Would\x20delete\x20segment\x20'+a9_0x1dec4c['red'](_0x3ac96c)+_0x14a65e(0x1c6)+a9_0x1dec4c['cyan'](_0x2c4ebc));if(_0x2cb819[_0x14a65e(0x1ec)])return console[_0x14a65e(0x1fc)](a9_0x1dec4c[_0x14a65e(0x1fb)](_0x14a65e(0x1e9))),0x0;if(!_0x2cb819['yes']){if(!isInteractive())return console[_0x14a65e(0x1f8)](a9_0x1dec4c[_0x14a65e(0x1c3)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x14a65e(0x1f8)](a9_0x1dec4c['dim'](_0x14a65e(0x1f2))),0x1;const _0x481f51=await confirmKey(_0x14a65e(0x1af)+_0x3ac96c+_0x14a65e(0x1e2)+_0x2c4ebc+_0x14a65e(0x1d5));if(!_0x481f51)return console[_0x14a65e(0x1fc)](a9_0x1dec4c[_0x14a65e(0x1fb)]('Aborted.')),0x1;}return await withProgressSpinner(_0x14a65e(0x1de)+_0x3ac96c+_0x14a65e(0x1cb),()=>_0x390633[_0x14a65e(0x1b4)][_0x14a65e(0x1bd)](_0x42864e['id']),{'verbose':_0x2cb819[_0x14a65e(0x1ca)]}),console['log'](a9_0x1dec4c['green'](_0x14a65e(0x1ed))),console[_0x14a65e(0x1fc)](_0x14a65e(0x1e4)+a9_0x1dec4c[_0x14a65e(0x1c2)](_0x3ac96c)),console[_0x14a65e(0x1fc)]('\x20\x20Audience:\x20'+a9_0x1dec4c[_0x14a65e(0x1c2)](_0x2c4ebc)),0x0;}}
1
+ const a9_0x5eb52b=a9_0xb683;(function(_0x491c27,_0x4915ab){const _0x48f77f=a9_0xb683,_0x1f6ea1=_0x491c27();while(!![]){try{const _0x57e9d0=parseInt(_0x48f77f(0x153))/0x1*(-parseInt(_0x48f77f(0x18c))/0x2)+-parseInt(_0x48f77f(0x142))/0x3*(-parseInt(_0x48f77f(0x181))/0x4)+parseInt(_0x48f77f(0x145))/0x5*(-parseInt(_0x48f77f(0x169))/0x6)+parseInt(_0x48f77f(0x180))/0x7*(-parseInt(_0x48f77f(0x162))/0x8)+parseInt(_0x48f77f(0x186))/0x9+parseInt(_0x48f77f(0x14e))/0xa+parseInt(_0x48f77f(0x16a))/0xb;if(_0x57e9d0===_0x4915ab)break;else _0x1f6ea1['push'](_0x1f6ea1['shift']());}catch(_0x426c10){_0x1f6ea1['push'](_0x1f6ea1['shift']());}}}(a9_0x118f,0xe1727));function a9_0x118f(){const _0x35e3dd=['name','Fetching\x20segments\x20for\x20\x27','length','resolveAudienceId','description','cwd','population','parse','Deleting\x20segment\x20\x27','File\x20not\x20found:\x20','verbose','\x20segment','388234eKkzPT','4nKjQkE','Create','\x0aDelete\x20segment\x20\x22','setPhase','\x20from\x20audience\x20','5262093EaVGwK','cyan','log','connection','Bulk/directory\x20delete\x20is\x20not\x20supported\x20yet.','\x20is\x20a\x20directory\x20—\x20tdx\x20cas\x20sg\x20push\x20takes\x20a\x20single\x20file.','1506112UrOOzM','Create\x20or\x20update\x20a\x20single\x20composable\x20child\x20segment','basename','relative','push','\x20\x20Audience:\x20','delete','data','Resolving\x20connections...','Would\x20','Usage:\x20tdx\x20cas\x20sg\x20list\x20<audience_name>','cas','\x20as\x20YAML:\x20','Use\x20`tdx\x20cas\x20push\x20<dir>`\x20to\x20push\x20multiple\x20files\x20at\x20once.','red','2499909KkpyPX','Usage:\x20tdx\x20cas\x20sg\x20push\x20<segment.yml>\x20[--audience\x20<name>]','yes','6245oLSBcn','yellow','updated','dim','Audience\x20name\x20required.','Nothing\x20to\x20delete.','\x0a✔\x20Segment\x20deleted','green','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','15448750wuDwHY','dryRun','\x20this\x20segment?','Aborted.','error','1FOKpTY','Use\x20','cas:sg:push','\x27...','find','isDirectory','created','Audience:\x20','Source:\x20\x20\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20doesn\x27t\x20look\x20like\x20a\x20composable\x20segment.','segments','\x22\x20from\x20audience\x20\x22','audience','\x20or\x20set\x20context\x20with\x20','168XMfnly','composableAudience','execute','Composable\x20segment\x20YAML\x20requires\x20`type:\x20composable_segment`\x20at\x20the\x20top\x20level.','Or\x20set\x20context:\x20tdx\x20use\x20cas\x20<audience_name>','\x22\x20not\x20found\x20under\x20audience\x20\x22','\x0aError:','3564jWtTvO','6822640JwViAb','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Pushing\x20segment\x20to\x20\x27','Composable\x20segment\x20\x22','listSegments','\x20segment\x20in\x20audience\x20','List\x20composable\x20segments\x20for\x20an\x20audience','executeDelete','\x20\x20Segment:\x20\x20','Would\x20delete\x20segment\x20'];a9_0x118f=function(){return _0x35e3dd;};return a9_0x118f();}import a9_0x296ec0 from'path';import{existsSync,readFileSync,statSync}from'fs';import*as a9_0x266a82 from'yaml';import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{formatRows}from'../sdk/util/formatters.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a9_0xb683(_0xdae64e,_0x2f1743){_0xdae64e=_0xdae64e-0x136;const _0x118f09=a9_0x118f();let _0xb68332=_0x118f09[_0xdae64e];return _0xb68332;}import{buildConnectionMaps}from'../sdk/cas/push-workflow.js';import{isComposableSegmentDef}from'../sdk/cas/cas-segment-yaml.js';import a9_0x148b41 from'chalk';export class CASSegmentListCommand extends BaseCommand{[a9_0x5eb52b(0x174)]='cas:sg:list';[a9_0x5eb52b(0x178)]=a9_0x5eb52b(0x170);async[a9_0x5eb52b(0x164)](_0x5d439b){const _0x244a0a=a9_0x5eb52b,{options:_0x47a5b9,args:_0x28500e,tdx:_0xfaecb8}=_0x5d439b,_0x12f0df=_0x28500e[0x0]||_0x47a5b9[_0x244a0a(0x163)];if(!_0x12f0df)return console[_0x244a0a(0x152)](a9_0x148b41[_0x244a0a(0x141)](_0x244a0a(0x13d))),console[_0x244a0a(0x152)](a9_0x148b41[_0x244a0a(0x148)](_0x244a0a(0x166))),0x1;const _0x4a7e85=await withProgressSpinner('Fetching\x20segments\x20for\x20\x27'+_0x12f0df+_0x244a0a(0x156),()=>_0xfaecb8[_0x244a0a(0x13e)][_0x244a0a(0x16e)](_0x12f0df),{'verbose':_0x47a5b9[_0x244a0a(0x17e)]}),_0x7de3f4=_0x4a7e85[_0x244a0a(0x13a)];if(isStructuredFormat(_0x47a5b9))return await handleSDKOutput(_0x7de3f4,_0x47a5b9),0x0;console[_0x244a0a(0x188)](a9_0x148b41[_0x244a0a(0x14c)]('Found\x20'+_0x7de3f4[_0x244a0a(0x176)]+_0x244a0a(0x17f)+(_0x7de3f4[_0x244a0a(0x176)]!==0x1?'s':'')));if(_0x7de3f4[_0x244a0a(0x176)]===0x0)return 0x0;for(const _0x38d8e1 of _0x7de3f4){const _0x32c95e=_0x38d8e1[_0x244a0a(0x17a)]!=null?a9_0x148b41[_0x244a0a(0x148)]('\x20('+formatRows(_0x38d8e1[_0x244a0a(0x17a)])+')'):'';console[_0x244a0a(0x188)]('🎯\x20'+_0x38d8e1['name']+_0x32c95e),_0x38d8e1[_0x244a0a(0x178)]&&console['log']('\x20\x20'+a9_0x148b41[_0x244a0a(0x148)](_0x38d8e1[_0x244a0a(0x178)]));}return 0x0;}}export class CASSegmentPushCommand extends BaseCommand{[a9_0x5eb52b(0x174)]=a9_0x5eb52b(0x155);[a9_0x5eb52b(0x178)]=a9_0x5eb52b(0x18d);async['execute'](_0x4a9a05){const _0x4e9fff=a9_0x5eb52b,{options:_0x558bee,args:_0x5b8903,tdx:_0x313541}=_0x4a9a05,_0x1ae695=_0x558bee,_0x54d952=_0x5b8903[0x0];if(!_0x54d952)return console[_0x4e9fff(0x152)](a9_0x148b41['red'](_0x4e9fff(0x143))),0x1;if(!existsSync(_0x54d952))return console[_0x4e9fff(0x152)](a9_0x148b41[_0x4e9fff(0x141)](_0x4e9fff(0x17d)+_0x54d952)),0x1;if(statSync(_0x54d952)[_0x4e9fff(0x158)]())return console['error'](a9_0x148b41[_0x4e9fff(0x141)](_0x54d952+_0x4e9fff(0x18b))),_0x1ae695[_0x4e9fff(0x139)]?console['error'](a9_0x148b41['dim'](_0x4e9fff(0x18a))):console[_0x4e9fff(0x152)](a9_0x148b41['dim'](_0x4e9fff(0x140))),0x1;const _0x5eb9f7=_0x1ae695[_0x4e9fff(0x160)]||_0x558bee[_0x4e9fff(0x163)];if(!_0x5eb9f7)return console[_0x4e9fff(0x152)](a9_0x148b41[_0x4e9fff(0x146)](_0x4e9fff(0x149))),console[_0x4e9fff(0x152)](_0x4e9fff(0x154)+a9_0x148b41[_0x4e9fff(0x187)]('--audience\x20<name>')+_0x4e9fff(0x161)+a9_0x148b41[_0x4e9fff(0x187)]('tdx\x20use\x20cas\x20<name>')),0x1;console['log'](_0x4e9fff(0x15a)+a9_0x148b41[_0x4e9fff(0x187)](_0x5eb9f7)),console[_0x4e9fff(0x188)](_0x4e9fff(0x15b)+a9_0x148b41[_0x4e9fff(0x148)](a9_0x296ec0[_0x4e9fff(0x136)](process[_0x4e9fff(0x179)](),_0x54d952)||'.')),console['log']();let _0x352913;try{_0x352913=a9_0x266a82[_0x4e9fff(0x17b)](readFileSync(_0x54d952,'utf-8'));}catch(_0x71deb9){return console['error'](a9_0x148b41['red']('Failed\x20to\x20parse\x20'+a9_0x296ec0[_0x4e9fff(0x18e)](_0x54d952)+_0x4e9fff(0x13f)),_0x71deb9 instanceof Error?_0x71deb9['message']:String(_0x71deb9)),0x1;}if(!isComposableSegmentDef(_0x352913))return console[_0x4e9fff(0x152)](a9_0x148b41[_0x4e9fff(0x141)](a9_0x296ec0[_0x4e9fff(0x18e)](_0x54d952)+_0x4e9fff(0x15d))),console['error'](a9_0x148b41[_0x4e9fff(0x146)](_0x4e9fff(0x165))),0x1;if(_0x1ae695[_0x4e9fff(0x139)])return this[_0x4e9fff(0x171)](_0x4a9a05,_0x5eb9f7,_0x352913[_0x4e9fff(0x174)],_0x1ae695);const _0x15f664=await withProgressSpinner(_0x4e9fff(0x13b),()=>buildConnectionMaps(_0x313541[_0x4e9fff(0x189)]),{'verbose':_0x1ae695[_0x4e9fff(0x17e)]}),_0x78dc8d=_0x15f664['data'],_0xc84f51=await withProgressSpinner('Resolving\x20audience\x20\x27'+_0x5eb9f7+_0x4e9fff(0x156),()=>_0x313541[_0x4e9fff(0x13e)][_0x4e9fff(0x177)](_0x5eb9f7),{'verbose':_0x1ae695[_0x4e9fff(0x17e)]}),_0x4568cc=_0xc84f51[_0x4e9fff(0x13a)],_0x456bd2=await withProgressSpinner('Analyzing\x20segment\x20YAML...',_0x10631e=>_0x313541[_0x4e9fff(0x13e)][_0x4e9fff(0x137)]([_0x54d952],{'dryRun':!![],'verbose':_0x1ae695['verbose'],'resolvedAudienceId':_0x4568cc,'connectionMaps':_0x78dc8d,'progress':{'update':_0x45abb2=>_0x10631e[_0x4e9fff(0x184)](_0x45abb2)}}),{'verbose':_0x1ae695[_0x4e9fff(0x17e)]}),_0x49cc35=_0x456bd2[_0x4e9fff(0x13a)],_0x2ae546=_0x49cc35[_0x4e9fff(0x147)][_0x4e9fff(0x15e)]>0x0,_0x5e2269=_0x2ae546?'update':'create';console[_0x4e9fff(0x188)](_0x4e9fff(0x13c)+_0x5e2269+_0x4e9fff(0x16f)+a9_0x148b41['cyan'](_0x5eb9f7));if(_0x1ae695[_0x4e9fff(0x14f)])return console[_0x4e9fff(0x188)](a9_0x148b41[_0x4e9fff(0x146)](_0x4e9fff(0x15c))),0x0;if(!_0x1ae695[_0x4e9fff(0x144)]){if(!isInteractive())return console[_0x4e9fff(0x152)](a9_0x148b41[_0x4e9fff(0x141)](_0x4e9fff(0x168)),_0x4e9fff(0x14d)),console[_0x4e9fff(0x152)](a9_0x148b41[_0x4e9fff(0x148)](_0x4e9fff(0x16b))),0x1;const _0x3f02a5=await confirmKey('\x0a'+(_0x2ae546?'Update':_0x4e9fff(0x182))+_0x4e9fff(0x150));if(!_0x3f02a5)return console[_0x4e9fff(0x188)](a9_0x148b41[_0x4e9fff(0x146)](_0x4e9fff(0x151))),0x1;}const _0x5cd706=await withProgressSpinner(_0x4e9fff(0x16c)+_0x5eb9f7+_0x4e9fff(0x156),_0x4e5df0=>_0x313541[_0x4e9fff(0x13e)][_0x4e9fff(0x137)]([_0x54d952],{'dryRun':![],'verbose':_0x1ae695[_0x4e9fff(0x17e)],'resolvedAudienceId':_0x4568cc,'progress':{'update':_0x1d5818=>_0x4e5df0[_0x4e9fff(0x184)](_0x1d5818)}}),{'verbose':_0x1ae695[_0x4e9fff(0x17e)]}),_0xa01fec=_0x5cd706[_0x4e9fff(0x13a)],_0x2acb15=_0xa01fec[_0x4e9fff(0x159)][_0x4e9fff(0x15e)]>0x0;return console['log'](a9_0x148b41[_0x4e9fff(0x14c)]('\x0a✔\x20Segment\x20'+(_0x2acb15?'created':_0x4e9fff(0x147)))),console['log']('\x20\x20Audience:\x20'+a9_0x148b41[_0x4e9fff(0x187)](_0x5eb9f7)),0x0;}async['executeDelete'](_0x3d3d4b,_0x15b911,_0x1ae067,_0x17a1d6){const _0x24c0fa=a9_0x5eb52b,{tdx:_0x490968}=_0x3d3d4b,_0x2b95fc=await withProgressSpinner(_0x24c0fa(0x175)+_0x15b911+_0x24c0fa(0x156),()=>_0x490968['cas'][_0x24c0fa(0x16e)](_0x15b911),{'verbose':_0x17a1d6[_0x24c0fa(0x17e)]}),_0x516d8b=_0x2b95fc[_0x24c0fa(0x13a)][_0x24c0fa(0x157)](_0x2751d2=>_0x2751d2[_0x24c0fa(0x174)]===_0x1ae067);if(!_0x516d8b)return console[_0x24c0fa(0x152)](a9_0x148b41[_0x24c0fa(0x141)](_0x24c0fa(0x16d)+_0x1ae067+_0x24c0fa(0x167)+_0x15b911+'\x22.')),console[_0x24c0fa(0x152)](a9_0x148b41[_0x24c0fa(0x148)](_0x24c0fa(0x14a))),0x1;console[_0x24c0fa(0x188)](_0x24c0fa(0x173)+a9_0x148b41['red'](_0x1ae067)+_0x24c0fa(0x185)+a9_0x148b41[_0x24c0fa(0x187)](_0x15b911));if(_0x17a1d6['dryRun'])return console[_0x24c0fa(0x188)](a9_0x148b41[_0x24c0fa(0x146)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;if(!_0x17a1d6['yes']){if(!isInteractive())return console[_0x24c0fa(0x152)](a9_0x148b41[_0x24c0fa(0x141)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x24c0fa(0x152)](a9_0x148b41[_0x24c0fa(0x148)](_0x24c0fa(0x16b))),0x1;const _0x20e727=await confirmKey(_0x24c0fa(0x183)+_0x1ae067+_0x24c0fa(0x15f)+_0x15b911+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x20e727)return console[_0x24c0fa(0x188)](a9_0x148b41[_0x24c0fa(0x146)](_0x24c0fa(0x151))),0x1;}return await withProgressSpinner(_0x24c0fa(0x17c)+_0x1ae067+_0x24c0fa(0x156),()=>_0x490968[_0x24c0fa(0x13e)]['deleteSegmentById'](_0x516d8b['id']),{'verbose':_0x17a1d6[_0x24c0fa(0x17e)]}),console[_0x24c0fa(0x188)](a9_0x148b41['green'](_0x24c0fa(0x14b))),console[_0x24c0fa(0x188)](_0x24c0fa(0x172)+a9_0x148b41[_0x24c0fa(0x187)](_0x1ae067)),console[_0x24c0fa(0x188)](_0x24c0fa(0x138)+a9_0x148b41[_0x24c0fa(0x187)](_0x15b911)),0x0;}}
@@ -1 +1 @@
1
- function a10_0x2d71(){const _0x49c5a0=['llmAgent','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','6482460iEXOTV','targetFunction','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','18733797cthPsy','startChat','Getting\x20default\x20agent...','streamChatJsonl','tool_result','claude-4.5-haiku','execute','functionName','write','type','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','code','error','includes','description','7494318RIZkuY','options','Continuing\x20chat:\x20','streamChat','content','Create\x20a\x20new\x20chat\x20session','metadata','event','agent','\x0aStack\x20trace:','Error:\x20','2219463EeUCyg','chat','agentId','CHAT_NOT_FOUND','stack','targetKnowledgeBase','message','5vCNWlD','log','data','tool','stream','stringify','resolveAgentId','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','Error:\x20Chat\x20session\x20\x27','404','verbose','getOrCreateDefaultAgent','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','\x27\x20not\x20found','session\x20context','site','slice','\x0aError:\x20','projectId','new','\x27...','1373407jjOpDw','name','llm','tool_call','chatId','getDefaultAgent','Chat\x20session:\x20','cause','696778jpGmpN','args','context','Resolving\x20agent\x20\x27','8gQPagH','3432068pblsIk','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','handleChatEvent','validate','Using\x20cached\x20default\x20agent:\x20'];a10_0x2d71=function(){return _0x49c5a0;};return a10_0x2d71();}const a10_0x132b85=a10_0x5628;(function(_0xff4201,_0x56f2b8){const _0x2a2762=a10_0x5628,_0x2ff0ea=_0xff4201();while(!![]){try{const _0x400e52=parseInt(_0x2a2762(0x10a))/0x1+-parseInt(_0x2a2762(0x10f))/0x2+-parseInt(_0x2a2762(0x133))/0x3+-parseInt(_0x2a2762(0x116))/0x4*(-parseInt(_0x2a2762(0x13a))/0x5)+-parseInt(_0x2a2762(0x128))/0x6+-parseInt(_0x2a2762(0x14f))/0x7*(-parseInt(_0x2a2762(0x10e))/0x8)+parseInt(_0x2a2762(0x119))/0x9;if(_0x400e52===_0x56f2b8)break;else _0x2ff0ea['push'](_0x2ff0ea['shift']());}catch(_0x26be4a){_0x2ff0ea['push'](_0x2ff0ea['shift']());}}}(a10_0x2d71,0xd956b));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function a10_0x5628(_0x25fc97,_0xa621fd){_0x25fc97=_0x25fc97-0x104;const _0x2d71ff=a10_0x2d71();let _0x562856=_0x2d71ff[_0x25fc97];return _0x562856;}import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x133464,_0xa4e44d){const _0x26b5c1=a10_0x5628;if(_0x133464 instanceof SDKError)console['error'](_0x26b5c1(0x132)+_0x133464[_0x26b5c1(0x139)]),_0xa4e44d[_0x26b5c1(0x144)]&&(_0x133464['cause']&&console[_0x26b5c1(0x125)]('\x20\x20Cause:\x20'+_0x133464[_0x26b5c1(0x109)]),_0x133464[_0x26b5c1(0x137)]&&(console['error'](_0x26b5c1(0x131)),console[_0x26b5c1(0x125)](_0x133464[_0x26b5c1(0x137)])));else throw _0x133464;}async function resolveAgentId(_0x33bc64,_0x46dfb1,_0x3affe6,_0xe7f4,_0x5ad407){const _0x5d985b=a10_0x5628,_0x5140a9=_0x46dfb1||_0x3affe6;if(_0x5140a9){const {projectName:_0x120b8f,agentName:_0xc12370}=parseAgentRef(_0x5140a9),_0x297e70=_0xc12370||_0x5140a9,_0x3136c9=_0xc12370?_0x120b8f:_0xe7f4;if(!_0x3136c9)throw new Error(_0x5d985b(0x141));if(_0x5ad407){const _0x1388f1=_0x46dfb1?'--agent\x20flag':_0x5d985b(0x148);console['error']('Using\x20agent\x20from\x20'+_0x1388f1+':\x20'+_0x3136c9+'/'+_0x297e70);}const _0x58bb32=await withSpinner('Resolving\x20project\x20\x27'+_0x3136c9+_0x5d985b(0x14e),()=>_0x33bc64[_0x5d985b(0x104)]['resolveProjectId'](_0x3136c9),{'verbose':_0x5ad407}),_0x4ac5a3=await withSpinner(_0x5d985b(0x10d)+_0x297e70+_0x5d985b(0x14e),()=>_0x33bc64[_0x5d985b(0x104)][_0x5d985b(0x140)](_0x297e70,_0x58bb32['data']),{'verbose':_0x5ad407});return _0x4ac5a3['data'];}else{const _0xe22ced=_0x33bc64[_0x5d985b(0x104)][_0x5d985b(0x107)]();if(_0xe22ced)return _0x5ad407&&console['error'](_0x5d985b(0x113)+_0xe22ced[_0x5d985b(0x150)]),_0xe22ced['id'];const _0x1a3086=await withSpinner(_0x5d985b(0x11b),()=>_0x33bc64[_0x5d985b(0x104)][_0x5d985b(0x145)](_0x5d985b(0x11e),0x0),{'verbose':_0x5ad407});return _0x1a3086['data']['id'];}}export class ChatCommand extends BaseCommand{[a10_0x132b85(0x150)]=a10_0x132b85(0x134);[a10_0x132b85(0x127)]=a10_0x132b85(0x118);['validate'](_0x4559c9){const _0x3d2815=a10_0x132b85,_0x3d5fce=_0x4559c9[_0x3d2815(0x10b)]['join']('\x20');if(!_0x3d5fce)return _0x3d2815(0x115);return undefined;}async['streamChat'](_0x20e5fc,_0x403392,_0xd93b50,_0x5df7fb,_0x2c2f3d){const _0x59f9ee=a10_0x132b85;for await(const _0x271af6 of _0x20e5fc[_0x59f9ee(0x104)][_0x59f9ee(0x134)](_0x403392,{'agentId':_0xd93b50,'chatId':_0x5df7fb})){if(_0x271af6['type']===_0x59f9ee(0x12e)){const _0x161879=_0x271af6['data'][_0x59f9ee(0x106)];saveLastChatId(_0x161879),_0x2c2f3d&&console[_0x59f9ee(0x125)](_0x59f9ee(0x108)+_0x161879);}else _0x271af6['type']==='event'&&this[_0x59f9ee(0x111)](_0x271af6[_0x59f9ee(0x13c)]);}}async[a10_0x132b85(0x11c)](_0x51cd6b,_0xc0d93d,_0x2d0200,_0x126a57){const _0x10cee9=a10_0x132b85,_0x368507=_0x51cd6b[_0x10cee9(0x10c)][_0x10cee9(0x149)];let _0x4e77f9=![];for await(const _0x327aca of _0x51cd6b[_0x10cee9(0x104)]['chat'](_0xc0d93d,{'agentId':_0x2d0200,'chatId':_0x126a57})){if(_0x327aca[_0x10cee9(0x122)]===_0x10cee9(0x12e)){const _0x5016a7=_0x327aca['data'];saveLastChatId(_0x5016a7[_0x10cee9(0x106)]);const _0x29b6dc=_0x5016a7[_0x10cee9(0x14c)]&&_0x5016a7[_0x10cee9(0x135)]?getLLMConversationUrl(_0x368507,_0x5016a7['projectId'],_0x5016a7[_0x10cee9(0x135)],_0x5016a7[_0x10cee9(0x106)]):undefined;console[_0x10cee9(0x13b)](JSON[_0x10cee9(0x13f)]({'type':_0x10cee9(0x12e),'data':{'chatId':_0x5016a7[_0x10cee9(0x106)],'agentId':_0x5016a7[_0x10cee9(0x135)],'consoleUrl':_0x29b6dc}})),_0x4e77f9=!![];}else{if(_0x327aca[_0x10cee9(0x122)]===_0x10cee9(0x12f)){!_0x4e77f9&&_0x126a57&&(console['log'](JSON[_0x10cee9(0x13f)]({'type':_0x10cee9(0x12e),'data':{'chatId':_0x126a57}})),_0x4e77f9=!![]);const _0x37fecb=_0x327aca['data'];if(_0x10cee9(0x12c)in _0x37fecb)console[_0x10cee9(0x13b)](JSON['stringify']({'type':_0x10cee9(0x12c),'data':{'content':_0x37fecb[_0x10cee9(0x12c)]}}));else{if(_0x10cee9(0x105)in _0x37fecb){const _0x478557=_0x37fecb[_0x10cee9(0x105)];console[_0x10cee9(0x13b)](JSON[_0x10cee9(0x13f)]({'type':'tool_call','data':{'id':_0x478557['id'],'name':_0x478557[_0x10cee9(0x120)],'target':_0x478557[_0x10cee9(0x138)]?.[_0x10cee9(0x150)]||_0x478557['targetAgent']?.[_0x10cee9(0x150)]||_0x478557['targetWebSearchTool']?.[_0x10cee9(0x150)]||_0x478557[_0x10cee9(0x117)]}}));}else{if('tool'in _0x37fecb)console[_0x10cee9(0x13b)](JSON[_0x10cee9(0x13f)]({'type':_0x10cee9(0x11d),'data':{'id':_0x37fecb[_0x10cee9(0x13d)]['id'],'name':_0x37fecb[_0x10cee9(0x13d)]['functionName'],'result':typeof _0x37fecb[_0x10cee9(0x13d)]['content']==='string'?_0x37fecb[_0x10cee9(0x13d)][_0x10cee9(0x12c)][_0x10cee9(0x14a)](0x0,0x1f4):''}}));else'error'in _0x37fecb&&console[_0x10cee9(0x13b)](JSON[_0x10cee9(0x13f)]({'type':_0x10cee9(0x125),'data':{'error':_0x37fecb[_0x10cee9(0x125)]}}));}}}}}console[_0x10cee9(0x13b)](JSON[_0x10cee9(0x13f)]({'type':'done'}));}async[a10_0x132b85(0x11f)](_0x45a903){const _0x37c989=a10_0x132b85,{options:_0x50d5e1,args:_0x692201,tdx:_0x1a2b02}=_0x45a903,_0x52524b=_0x692201['join']('\x20'),_0x5b6c84=_0x50d5e1,_0x26baee=_0x5b6c84[_0x37c989(0x130)],_0x536df0=_0x5b6c84[_0x37c989(0x114)],_0x5acdcd=_0x5b6c84['llmProject'],_0x5dd686=_0x5b6c84[_0x37c989(0x14d)],_0x5ae181=_0x5b6c84['chatId'],_0xc993c6=_0x5b6c84[_0x37c989(0x13e)];if(_0x5dd686&&_0x5ae181)return console[_0x37c989(0x125)](_0x37c989(0x123)),0x1;try{let _0x80eebf,_0x29b1c4;if(_0x5ae181)_0x29b1c4=_0x5ae181;else!_0x5dd686&&(_0x29b1c4=loadLastChatId(),_0x29b1c4&&_0x50d5e1[_0x37c989(0x144)]&&console['error'](_0x37c989(0x12a)+_0x29b1c4));!_0x5ae181&&(_0x5dd686||!_0x29b1c4)&&(_0x80eebf=await resolveAgentId(_0x1a2b02,_0x26baee,_0x536df0,_0x5acdcd,_0x50d5e1['verbose']));const _0x5db310=_0xc993c6?(_0x5a3e60,_0x84caab,_0x15a836)=>this[_0x37c989(0x11c)](_0x1a2b02,_0x5a3e60,_0x84caab,_0x15a836):(_0x1b9006,_0x4257db,_0x57ddb0)=>this[_0x37c989(0x12b)](_0x1a2b02,_0x1b9006,_0x4257db,_0x57ddb0,_0x50d5e1[_0x37c989(0x144)]);try{await _0x5db310(_0x52524b,_0x80eebf,_0x29b1c4);}catch(_0x408822){const _0x527ed4=_0x408822 instanceof SDKError&&_0x408822[_0x37c989(0x124)]===ErrorCode[_0x37c989(0x136)]||_0x408822 instanceof Error&&_0x408822[_0x37c989(0x139)][_0x37c989(0x126)](_0x37c989(0x143));if(_0x527ed4&&_0x5ae181)return console['error'](_0x37c989(0x142)+_0x5ae181+_0x37c989(0x147)),0x1;if(_0x527ed4)_0x50d5e1[_0x37c989(0x144)]&&console['error'](_0x37c989(0x146)),!_0x80eebf&&(_0x80eebf=await resolveAgentId(_0x1a2b02,_0x26baee,_0x536df0,_0x5acdcd,_0x50d5e1['verbose'])),await _0x5db310(_0x52524b,_0x80eebf,undefined);else throw _0x408822;}return!_0xc993c6&&console['log'](),0x0;}catch(_0x584ce3){return console['error'](),handleSDKError(_0x584ce3,_0x50d5e1),0x1;}}[a10_0x132b85(0x111)](_0x7ff050){const _0x41ae80=a10_0x132b85;if(_0x41ae80(0x12c)in _0x7ff050)process['stdout'][_0x41ae80(0x121)](_0x7ff050['content']);else _0x41ae80(0x125)in _0x7ff050&&console[_0x41ae80(0x125)](_0x41ae80(0x14b)+_0x7ff050[_0x41ae80(0x125)]);}}export class ChatCreateCommand extends BaseCommand{[a10_0x132b85(0x150)]='chat-create';[a10_0x132b85(0x127)]=a10_0x132b85(0x12d);[a10_0x132b85(0x112)](_0x5e00ee){const _0x564c54=a10_0x132b85,_0x1996bb=_0x5e00ee[_0x564c54(0x129)],_0x4a68aa=_0x1996bb[_0x564c54(0x130)],_0x24b2fa=_0x1996bb[_0x564c54(0x114)];if(!_0x4a68aa&&!_0x24b2fa)return _0x564c54(0x110);return undefined;}async[a10_0x132b85(0x11f)](_0x44ec8f){const _0x18d4b4=a10_0x132b85,{options:_0x1752a7,tdx:_0x2f8218}=_0x44ec8f,_0x1b8685=_0x1752a7,_0x46fd28=_0x1b8685[_0x18d4b4(0x130)],_0x4ff34c=_0x1b8685['llmAgent'],_0x3ec529=_0x1b8685['llmProject'];try{const _0xef6551=await resolveAgentId(_0x2f8218,_0x46fd28,_0x4ff34c,_0x3ec529,_0x1752a7['verbose']),_0x5cecfc=await _0x2f8218[_0x18d4b4(0x104)][_0x18d4b4(0x11a)](_0xef6551);return saveLastChatId(_0x5cecfc['id']),console[_0x18d4b4(0x13b)](JSON[_0x18d4b4(0x13f)]({'chatId':_0x5cecfc['id'],'agentId':_0xef6551})),0x0;}catch(_0x5040c3){return handleSDKError(_0x5040c3,_0x1752a7),0x1;}}}
1
+ const a10_0x58d780=a10_0x42b8;function a10_0x5c40(){const _0x50dfa5=['includes','streamChat','targetKnowledgeBase','targetFunction','2332IHSROp','data','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','Resolving\x20agent\x20\x27','chatId','functionName','7xxLYAA','--agent\x20flag','221166aNakbd','handleChatEvent','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','agent','agentId','chat-create','CHAT_NOT_FOUND','done','verbose','llmProject','streamChatJsonl','join','Using\x20agent\x20from\x20','code','getOrCreateDefaultAgent','\x27...','121972yXjyPb','projectId','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','context','\x27\x20not\x20found','\x0aStack\x20trace:','tool_call','startChat','site','execute','chat','Chat\x20session:\x20','1246100etgeta','228664DIuCHO','cause','tool','validate','type','stream','args','name','Error:\x20Chat\x20session\x20\x27','event','content','6PtrvvL','\x20\x20Cause:\x20','targetAgent','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','slice','stringify','795765dhlknx','message','resolveProjectId','targetWebSearchTool','tool_result','1164Enksew','llmAgent','options','getDefaultAgent','claude-4.5-haiku','llm','stack','resolveAgentId','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','new','log','Using\x20cached\x20default\x20agent:\x20','stdout','error','metadata','string','1895913KHofrd'];a10_0x5c40=function(){return _0x50dfa5;};return a10_0x5c40();}(function(_0x53ed16,_0x3cfc03){const _0x3cc1c8=a10_0x42b8,_0x874e48=_0x53ed16();while(!![]){try{const _0x5e7404=-parseInt(_0x3cc1c8(0xc2))/0x1+parseInt(_0x3cc1c8(0xd2))/0x2+-parseInt(_0x3cc1c8(0xa4))/0x3*(parseInt(_0x3cc1c8(0xb9))/0x4)+parseInt(_0x3cc1c8(0x9f))/0x5*(parseInt(_0x3cc1c8(0xea))/0x6)+parseInt(_0x3cc1c8(0xc0))/0x7*(parseInt(_0x3cc1c8(0xdf))/0x8)+parseInt(_0x3cc1c8(0xb4))/0x9+parseInt(_0x3cc1c8(0xde))/0xa;if(_0x5e7404===_0x3cfc03)break;else _0x874e48['push'](_0x874e48['shift']());}catch(_0x272f0b){_0x874e48['push'](_0x874e48['shift']());}}}(a10_0x5c40,0x215ab));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function a10_0x42b8(_0x32b7f3,_0x180c1c){_0x32b7f3=_0x32b7f3-0x9f;const _0x5c40ca=a10_0x5c40();let _0x42b8d2=_0x5c40ca[_0x32b7f3];return _0x42b8d2;}function handleSDKError(_0x34dfe6,_0x5bb3ff){const _0xc45914=a10_0x42b8;if(_0x34dfe6 instanceof SDKError)console[_0xc45914(0xb1)]('Error:\x20'+_0x34dfe6[_0xc45914(0xa0)]),_0x5bb3ff[_0xc45914(0xca)]&&(_0x34dfe6[_0xc45914(0xe0)]&&console[_0xc45914(0xb1)](_0xc45914(0xeb)+_0x34dfe6[_0xc45914(0xe0)]),_0x34dfe6[_0xc45914(0xaa)]&&(console[_0xc45914(0xb1)](_0xc45914(0xd7)),console[_0xc45914(0xb1)](_0x34dfe6['stack'])));else throw _0x34dfe6;}async function resolveAgentId(_0x50ab21,_0x2d6f0f,_0x2473cb,_0x105327,_0x5aff10){const _0x265734=a10_0x42b8,_0x293d12=_0x2d6f0f||_0x2473cb;if(_0x293d12){const {projectName:_0x3c84c6,agentName:_0x4ad95c}=parseAgentRef(_0x293d12),_0xbcb9e9=_0x4ad95c||_0x293d12,_0x47e0f5=_0x4ad95c?_0x3c84c6:_0x105327;if(!_0x47e0f5)throw new Error(_0x265734(0xac));if(_0x5aff10){const _0x3b2172=_0x2d6f0f?_0x265734(0xc1):'session\x20context';console[_0x265734(0xb1)](_0x265734(0xce)+_0x3b2172+':\x20'+_0x47e0f5+'/'+_0xbcb9e9);}const _0xeb0cd7=await withSpinner('Resolving\x20project\x20\x27'+_0x47e0f5+_0x265734(0xd1),()=>_0x50ab21[_0x265734(0xa9)][_0x265734(0xa1)](_0x47e0f5),{'verbose':_0x5aff10}),_0x13b762=await withSpinner(_0x265734(0xbd)+_0xbcb9e9+_0x265734(0xd1),()=>_0x50ab21[_0x265734(0xa9)][_0x265734(0xab)](_0xbcb9e9,_0xeb0cd7[_0x265734(0xba)]),{'verbose':_0x5aff10});return _0x13b762['data'];}else{const _0x5dcaf5=_0x50ab21['llm'][_0x265734(0xa7)]();if(_0x5dcaf5)return _0x5aff10&&console[_0x265734(0xb1)](_0x265734(0xaf)+_0x5dcaf5[_0x265734(0xe6)]),_0x5dcaf5['id'];const _0x6f4a12=await withSpinner('Getting\x20default\x20agent...',()=>_0x50ab21[_0x265734(0xa9)][_0x265734(0xd0)](_0x265734(0xa8),0x0),{'verbose':_0x5aff10});return _0x6f4a12['data']['id'];}}export class ChatCommand extends BaseCommand{[a10_0x58d780(0xe6)]=a10_0x58d780(0xdc);['description']=a10_0x58d780(0xbc);[a10_0x58d780(0xe2)](_0x2b31d5){const _0x5e161c=a10_0x58d780,_0x363308=_0x2b31d5[_0x5e161c(0xe5)][_0x5e161c(0xcd)]('\x20');if(!_0x363308)return _0x5e161c(0xbb);return undefined;}async[a10_0x58d780(0xb6)](_0x5a1cde,_0x37cbdf,_0x1e4bb2,_0x787afa,_0x2841fd){const _0x1069f8=a10_0x58d780;for await(const _0x48e664 of _0x5a1cde[_0x1069f8(0xa9)][_0x1069f8(0xdc)](_0x37cbdf,{'agentId':_0x1e4bb2,'chatId':_0x787afa})){if(_0x48e664[_0x1069f8(0xe3)]===_0x1069f8(0xb2)){const _0x40ff30=_0x48e664['data'][_0x1069f8(0xbe)];saveLastChatId(_0x40ff30),_0x2841fd&&console[_0x1069f8(0xb1)](_0x1069f8(0xdd)+_0x40ff30);}else _0x48e664[_0x1069f8(0xe3)]===_0x1069f8(0xe8)&&this[_0x1069f8(0xc3)](_0x48e664[_0x1069f8(0xba)]);}}async['streamChatJsonl'](_0x50554c,_0x27d4f4,_0x5ad808,_0xe3f0a9){const _0x3e5771=a10_0x58d780,_0x12a887=_0x50554c[_0x3e5771(0xd5)][_0x3e5771(0xda)];let _0x4880e3=![];for await(const _0xbed70c of _0x50554c[_0x3e5771(0xa9)][_0x3e5771(0xdc)](_0x27d4f4,{'agentId':_0x5ad808,'chatId':_0xe3f0a9})){if(_0xbed70c[_0x3e5771(0xe3)]==='metadata'){const _0x355cea=_0xbed70c['data'];saveLastChatId(_0x355cea[_0x3e5771(0xbe)]);const _0x29e94c=_0x355cea[_0x3e5771(0xd3)]&&_0x355cea[_0x3e5771(0xc6)]?getLLMConversationUrl(_0x12a887,_0x355cea[_0x3e5771(0xd3)],_0x355cea[_0x3e5771(0xc6)],_0x355cea[_0x3e5771(0xbe)]):undefined;console['log'](JSON[_0x3e5771(0xef)]({'type':_0x3e5771(0xb2),'data':{'chatId':_0x355cea['chatId'],'agentId':_0x355cea[_0x3e5771(0xc6)],'consoleUrl':_0x29e94c}})),_0x4880e3=!![];}else{if(_0xbed70c[_0x3e5771(0xe3)]===_0x3e5771(0xe8)){!_0x4880e3&&_0xe3f0a9&&(console[_0x3e5771(0xae)](JSON[_0x3e5771(0xef)]({'type':_0x3e5771(0xb2),'data':{'chatId':_0xe3f0a9}})),_0x4880e3=!![]);const _0x3934be=_0xbed70c[_0x3e5771(0xba)];if(_0x3e5771(0xe9)in _0x3934be)console[_0x3e5771(0xae)](JSON[_0x3e5771(0xef)]({'type':_0x3e5771(0xe9),'data':{'content':_0x3934be[_0x3e5771(0xe9)]}}));else{if(_0x3e5771(0xd8)in _0x3934be){const _0x59fb42=_0x3934be['tool_call'];console[_0x3e5771(0xae)](JSON[_0x3e5771(0xef)]({'type':_0x3e5771(0xd8),'data':{'id':_0x59fb42['id'],'name':_0x59fb42['functionName'],'target':_0x59fb42[_0x3e5771(0xb7)]?.['name']||_0x59fb42[_0x3e5771(0xec)]?.['name']||_0x59fb42[_0x3e5771(0xa2)]?.[_0x3e5771(0xe6)]||_0x59fb42[_0x3e5771(0xb8)]}}));}else{if(_0x3e5771(0xe1)in _0x3934be)console['log'](JSON['stringify']({'type':_0x3e5771(0xa3),'data':{'id':_0x3934be[_0x3e5771(0xe1)]['id'],'name':_0x3934be[_0x3e5771(0xe1)][_0x3e5771(0xbf)],'result':typeof _0x3934be[_0x3e5771(0xe1)][_0x3e5771(0xe9)]===_0x3e5771(0xb3)?_0x3934be[_0x3e5771(0xe1)][_0x3e5771(0xe9)][_0x3e5771(0xee)](0x0,0x1f4):''}}));else _0x3e5771(0xb1)in _0x3934be&&console[_0x3e5771(0xae)](JSON[_0x3e5771(0xef)]({'type':_0x3e5771(0xb1),'data':{'error':_0x3934be[_0x3e5771(0xb1)]}}));}}}}}console[_0x3e5771(0xae)](JSON[_0x3e5771(0xef)]({'type':_0x3e5771(0xc9)}));}async['execute'](_0xcf184e){const _0x368a75=a10_0x58d780,{options:_0x22527f,args:_0x24a148,tdx:_0x36b6a1}=_0xcf184e,_0x55cb13=_0x24a148[_0x368a75(0xcd)]('\x20'),_0x16e0db=_0x22527f,_0x3185ca=_0x16e0db[_0x368a75(0xc5)],_0x4ea35a=_0x16e0db[_0x368a75(0xa5)],_0x5b6506=_0x16e0db['llmProject'],_0x198787=_0x16e0db[_0x368a75(0xad)],_0x5670fd=_0x16e0db['chatId'],_0x43e197=_0x16e0db[_0x368a75(0xe4)];if(_0x198787&&_0x5670fd)return console['error'](_0x368a75(0xd4)),0x1;try{let _0x186a0a,_0x445bd3;if(_0x5670fd)_0x445bd3=_0x5670fd;else!_0x198787&&(_0x445bd3=loadLastChatId(),_0x445bd3&&_0x22527f[_0x368a75(0xca)]&&console[_0x368a75(0xb1)]('Continuing\x20chat:\x20'+_0x445bd3));!_0x5670fd&&(_0x198787||!_0x445bd3)&&(_0x186a0a=await resolveAgentId(_0x36b6a1,_0x3185ca,_0x4ea35a,_0x5b6506,_0x22527f[_0x368a75(0xca)]));const _0xaacc66=_0x43e197?(_0x810b89,_0xfe778b,_0x205798)=>this[_0x368a75(0xcc)](_0x36b6a1,_0x810b89,_0xfe778b,_0x205798):(_0x1b368c,_0x38e1f0,_0x189706)=>this[_0x368a75(0xb6)](_0x36b6a1,_0x1b368c,_0x38e1f0,_0x189706,_0x22527f[_0x368a75(0xca)]);try{await _0xaacc66(_0x55cb13,_0x186a0a,_0x445bd3);}catch(_0x24e594){const _0x2376c4=_0x24e594 instanceof SDKError&&_0x24e594[_0x368a75(0xcf)]===ErrorCode[_0x368a75(0xc8)]||_0x24e594 instanceof Error&&_0x24e594[_0x368a75(0xa0)][_0x368a75(0xb5)]('404');if(_0x2376c4&&_0x5670fd)return console['error'](_0x368a75(0xe7)+_0x5670fd+_0x368a75(0xd6)),0x1;if(_0x2376c4)_0x22527f[_0x368a75(0xca)]&&console['error'](_0x368a75(0xc4)),!_0x186a0a&&(_0x186a0a=await resolveAgentId(_0x36b6a1,_0x3185ca,_0x4ea35a,_0x5b6506,_0x22527f[_0x368a75(0xca)])),await _0xaacc66(_0x55cb13,_0x186a0a,undefined);else throw _0x24e594;}return!_0x43e197&&console['log'](),0x0;}catch(_0x23eca8){return console['error'](),handleSDKError(_0x23eca8,_0x22527f),0x1;}}[a10_0x58d780(0xc3)](_0x36f2a9){const _0x4bb042=a10_0x58d780;if(_0x4bb042(0xe9)in _0x36f2a9)process[_0x4bb042(0xb0)]['write'](_0x36f2a9['content']);else'error'in _0x36f2a9&&console[_0x4bb042(0xb1)]('\x0aError:\x20'+_0x36f2a9[_0x4bb042(0xb1)]);}}export class ChatCreateCommand extends BaseCommand{['name']=a10_0x58d780(0xc7);['description']='Create\x20a\x20new\x20chat\x20session';['validate'](_0x4f4efc){const _0x1e4405=a10_0x58d780,_0x215615=_0x4f4efc[_0x1e4405(0xa6)],_0x262813=_0x215615[_0x1e4405(0xc5)],_0x7d0f4=_0x215615['llmAgent'];if(!_0x262813&&!_0x7d0f4)return _0x1e4405(0xed);return undefined;}async[a10_0x58d780(0xdb)](_0x1dba58){const _0x3ba923=a10_0x58d780,{options:_0x263872,tdx:_0x5ec811}=_0x1dba58,_0x4266bd=_0x263872,_0x4553a3=_0x4266bd[_0x3ba923(0xc5)],_0x2da2f3=_0x4266bd['llmAgent'],_0x1d39db=_0x4266bd[_0x3ba923(0xcb)];try{const _0x1d5493=await resolveAgentId(_0x5ec811,_0x4553a3,_0x2da2f3,_0x1d39db,_0x263872[_0x3ba923(0xca)]),_0x463be7=await _0x5ec811[_0x3ba923(0xa9)][_0x3ba923(0xd9)](_0x1d5493);return saveLastChatId(_0x463be7['id']),console[_0x3ba923(0xae)](JSON[_0x3ba923(0xef)]({'chatId':_0x463be7['id'],'agentId':_0x1d5493})),0x0;}catch(_0x1fb245){return handleSDKError(_0x1fb245,_0x263872),0x1;}}}
@@ -1 +1 @@
1
- function a11_0x3488(_0x5485e5,_0x366bca){_0x5485e5=_0x5485e5-0x190;const _0x5bf089=a11_0x5bf0();let _0x3488a1=_0x5bf089[_0x5485e5];return _0x3488a1;}const a11_0x4980cc=a11_0x3488;(function(_0x1ed095,_0x358203){const _0x49fb17=a11_0x3488,_0x226db6=_0x1ed095();while(!![]){try{const _0xa79d91=-parseInt(_0x49fb17(0x197))/0x1*(parseInt(_0x49fb17(0x24b))/0x2)+-parseInt(_0x49fb17(0x1c4))/0x3+-parseInt(_0x49fb17(0x238))/0x4*(-parseInt(_0x49fb17(0x1d9))/0x5)+-parseInt(_0x49fb17(0x20a))/0x6+parseInt(_0x49fb17(0x1e4))/0x7+parseInt(_0x49fb17(0x249))/0x8*(-parseInt(_0x49fb17(0x1ce))/0x9)+parseInt(_0x49fb17(0x1ea))/0xa*(parseInt(_0x49fb17(0x1eb))/0xb);if(_0xa79d91===_0x358203)break;else _0x226db6['push'](_0x226db6['shift']());}catch(_0x27f833){_0x226db6['push'](_0x226db6['shift']());}}}(a11_0x5bf0,0xee172));import{execFile}from'node:child_process';import{existsSync}from'node:fs';import{join}from'node:path';function a11_0x5bf0(){const _0x5269cd=['\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','missingMcpServers','includes','reset','INVALID_ARGUMENT','toString','claude-command','Authentication\x20required\x20for\x20TD\x20LLM\x20Proxy.\x20Run:\x20tdx\x20auth\x20setup','tdx\x20claude\x20statusline','missingPlugins','8CGMrbC','CLAUDE_CODE_USE_VERTEX','227748pFnPTa','claude_setup.json','match','major','Failed\x20to\x20install\x20plugin\x20\x27','apikey','--settings','warn','\x20is\x20too\x20old\x20(minimum:\x20','✓\x20Logging\x20to\x20','info','http','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','logger','filter','Configuring\x20marketplace\x20\x27','false','17DPQmFH','):\x20claude\x20','\x27\x20configured','marketplace','context','--transport','Claude\x20setup\x20plan:\x20','Command\x20output:\x20','--hard','mcp','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','Claude\x20Code\x20version\x20check\x20failed','isFinite','close','Checking\x20Claude\x20Code\x20version...','tdx-cli','debug','some','fail','\x20already\x20configured','Restored\x20default\x20td-skills\x20marketplace','cwds','\x27:\x20','join','Configuring\x20MCP\x20server\x20\x27','remove','Warning:\x20Failed\x20to\x20configure\x20','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','Failed\x20to\x20update\x20marketplace\x20\x27','td-skills\x20marketplace\x20dir\x20not\x20found,\x20skipping\x20release\x20tag\x20checkout','✓\x20Claude\x20Code\x20version\x20OK','Invalid\x20minimum\x20version\x20format:\x20','start','Failed\x20to\x20restore\x20MCP\x20server\x20\x27','passThroughServer','error','now','Command\x20spawn\x20error:\x20','--settings=','\x27\x20updated','site','Initializing...','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','\x20meets\x20minimum\x20requirement','claude','4681746jqenRa','log','CLAUDE_CODE_USE_BEDROCK','access_token','Failed\x20to\x20remove\x20outdated\x20MCP\x20server\x20\x27','Initializing\x20proxy\x20logger...','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','user','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','6884127zyefmf','\x27...','refresh_token','Installing\x20plugin\x20\x27','length','account_id','fetch','minor','\x20→\x20','refresh','stderr','212150jMAxhR','CLAUDE_CODE_NOT_FOUND','oauth','profile','map','Failed\x20to\x20spawn\x20claude\x20command:\x20','expires_at','✓\x20Plugin\x20\x27','Setup\x20failed','checkout','init','1147279ixZSFc','origin','port','marketplaces','get','--version','890INLbfn','519233zatfnx','\x27\x20to\x20','cwd','✓\x20TD\x20LLM\x20proxy\x20settings\x20prepared\x20for\x20this\x20session','read','localeCompare','skills','Claude\x20Code\x20CLI\x20not\x20found','--force','resume','fromEntries','releaseChannel','origin/main','TDX_PROFILE','tdx\x20--profile\x20','message','repoUrl','trim','MCP\x20server\x20\x27','Restore\x20also\x20failed:\x20','CLAUDE_CODE_UNSUPPORTED_VERSION','Executing:\x20claude\x20','getLogPath','url','logLevel','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','description','td-docs','data','git','\x27\x20URL\x20changed:\x20','2662398BQYGTu','catch','proxy','name','startsWith','command','code','✓\x20MCP\x20server\x20\x27','already\x20exists','td-skills\x20Plugins','text','ANTHROPIC_AUTH_TOKEN','exit','\x20claude\x20statusline','patch','ENOENT','ANTHROPIC_BASE_URL','unshift','--tags','td-skills','stringify','✓\x20Logs\x20saved\x20to\x20','INTERNAL','us01','...','http://127.0.0.1:','stop','Marketplace\x20\x27','green','sql-skills','transport','apiKey','Failed\x20to\x20add\x20new\x20URL,\x20restoring\x20previous\x20URL:\x20','plugin','already\x20configured','toISOString','Claude\x20Code\x20version\x20','add','main','inherit','red','Failed\x20to\x20remove\x20marketplace\x20\x27','cause','refreshedAt','workflow-skills','entries','124nQurYi','pluginIds','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','Command\x20failed\x20(exit\x20','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','\x27\x20installed'];a11_0x5bf0=function(){return _0x5269cd;};return a11_0x5bf0();}import{promisify}from'node:util';import a11_0x1b38ec from'chalk';import{BaseCommand}from'./command.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint,getConsoleUrl}from'../sdk/client/endpoints.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{findExecutable,crossSpawn}from'../utils/process.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo,loadReleaseChannel}from'../core/config.js';import{getVersion}from'../core/version.js';import{resolveReleaseTag}from'../utils/github-releases.js';import{createGlobalCache}from'../utils/global-cache.js';import{findMcpServerUrl,getClaudeConfigDir,isPluginInstalled,normalizeRepoUrl,readMarketplaceSourceUrl}from'../utils/claude-code-state.js';const execFileAsync=promisify(execFile),MIN_CLAUDE_VERSION='2.0.20';export function buildClaudeSettingsArgs(_0x305677){const _0x321877=a11_0x3488;return['--settings',JSON[_0x321877(0x21e)]({'statusLine':{'type':_0x321877(0x20f),'command':_0x305677?_0x321877(0x1f9)+_0x305677+_0x321877(0x217):_0x321877(0x247)}})];}export function buildClaudeLaunchArgs(_0x3a7f1c,_0x13256b){const _0x4732e6=a11_0x3488;if(_0x3a7f1c[_0x4732e6(0x241)](_0x4732e6(0x251))||_0x3a7f1c[_0x4732e6(0x1a8)](_0x41a2b0=>_0x41a2b0[_0x4732e6(0x20e)](_0x4732e6(0x1bd))))return[..._0x3a7f1c];return[..._0x3a7f1c,...buildClaudeSettingsArgs(_0x13256b)];}function handleInstallationError(_0x2578c6,_0x4d1243,_0x28c59e,_0x3854a9){const _0x2ffafa=a11_0x3488;errorContains(_0x2578c6,_0x2ffafa(0x212),'already\x20installed',_0x2ffafa(0x22c))?(_0x28c59e[_0x2ffafa(0x214)]='✓\x20'+_0x4d1243+_0x2ffafa(0x1aa),_0x3854a9?.['info'](_0x4d1243+_0x2ffafa(0x1aa)),_0x2578c6 instanceof SDKError&&_0x2578c6[_0x2ffafa(0x234)]&&_0x3854a9?.[_0x2ffafa(0x1a7)](_0x2ffafa(0x19e)+_0x2578c6[_0x2ffafa(0x234)]['message'])):(_0x28c59e['warn'](_0x2ffafa(0x1b1)+_0x4d1243),_0x3854a9?.['error'](_0x4d1243+'\x20configuration\x20failed',_0x2578c6));}export function parseVersion(_0x2571fe){const _0x2326cb=a11_0x3488,_0x19441b=_0x2571fe[_0x2326cb(0x1fc)]()[_0x2326cb(0x24d)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x19441b)return null;return{'major':parseInt(_0x19441b[0x1],0xa),'minor':parseInt(_0x19441b[0x2],0xa),'patch':parseInt(_0x19441b[0x3],0xa)};}export function compareVersions(_0x241f56,_0x55c6cb){const _0x335ea3=a11_0x3488;if(_0x241f56[_0x335ea3(0x24e)]!==_0x55c6cb[_0x335ea3(0x24e)])return _0x241f56[_0x335ea3(0x24e)]-_0x55c6cb[_0x335ea3(0x24e)];if(_0x241f56[_0x335ea3(0x1d5)]!==_0x55c6cb['minor'])return _0x241f56[_0x335ea3(0x1d5)]-_0x55c6cb[_0x335ea3(0x1d5)];return _0x241f56[_0x335ea3(0x218)]-_0x55c6cb['patch'];}async function checkClaudeVersion(_0x25116d,_0x172867){const _0x482797=a11_0x3488;_0x172867?.[_0x482797(0x1a7)](_0x482797(0x192)+_0x25116d+')');const _0x30dfd6=await executeClaudeCommand([_0x482797(0x1e9)],undefined,_0x172867),_0x119323=parseVersion(_0x30dfd6);if(!_0x119323){_0x172867?.[_0x482797(0x252)](_0x482797(0x1cb)+_0x30dfd6);return;}const _0x1b851c=_0x119323[_0x482797(0x24e)]+'.'+_0x119323[_0x482797(0x1d5)]+'.'+_0x119323[_0x482797(0x218)],_0x3cdfee=parseVersion(_0x25116d);if(!_0x3cdfee){_0x172867?.['warn'](_0x482797(0x1b6)+_0x25116d);return;}if(compareVersions(_0x119323,_0x3cdfee)<0x0){_0x172867?.[_0x482797(0x1ba)](_0x482797(0x22e)+_0x1b851c+_0x482797(0x253)+_0x25116d+')');throw new SDKError(ErrorCode[_0x482797(0x1ff)],'Claude\x20Code\x20version\x20'+_0x1b851c+_0x482797(0x1b2)+_0x25116d+'\x20or\x20later.',undefined,{'helpText':_0x482797(0x23a)});}_0x172867?.['debug'](_0x482797(0x22e)+_0x1b851c+_0x482797(0x1c2));}async function executeClaudeCommand(_0x2ed92e,_0x426ba9,_0x1f0b5f){const _0x2b0dc9=a11_0x3488;return _0x1f0b5f?.[_0x2b0dc9(0x190)](_0x2b0dc9(0x200)+_0x2ed92e[_0x2b0dc9(0x1ae)]('\x20')),new Promise((_0x41cf8b,_0x36525a)=>{const _0x18fc6a=_0x2b0dc9,_0x3e29bc=crossSpawn(_0x18fc6a(0x1c3),_0x2ed92e,{'stdio':'pipe'});let _0x2f631b='',_0x1f0ec2='';_0x3e29bc['stdout']?.['on'](_0x18fc6a(0x207),_0x66f564=>{const _0xbc7cdb=_0x18fc6a;_0x2f631b+=_0x66f564[_0xbc7cdb(0x244)]();}),_0x3e29bc[_0x18fc6a(0x1d8)]?.['on'](_0x18fc6a(0x207),_0x6462bd=>{const _0x309e71=_0x18fc6a;_0x1f0ec2+=_0x6462bd[_0x309e71(0x244)]();}),_0x3e29bc['on'](_0x18fc6a(0x1ba),_0x11cd92=>{const _0x3e1ea8=_0x18fc6a;_0x11cd92[_0x3e1ea8(0x210)]===_0x3e1ea8(0x219)?(_0x1f0b5f?.[_0x3e1ea8(0x1ba)]('Claude\x20Code\x20CLI\x20not\x20found'),_0x36525a(new SDKError(ErrorCode[_0x3e1ea8(0x1da)],_0x3e1ea8(0x1f2),_0x11cd92,{'helpText':_0x3e1ea8(0x1ca)}))):(_0x1f0b5f?.[_0x3e1ea8(0x1ba)](_0x3e1ea8(0x1bc)+_0x11cd92['message']),_0x36525a(new SDKError(ErrorCode[_0x3e1ea8(0x220)],_0x3e1ea8(0x1de)+_0x11cd92[_0x3e1ea8(0x1fa)],_0x11cd92)));}),_0x3e29bc['on'](_0x18fc6a(0x216),_0x4d2b97=>{const _0x470dd4=_0x18fc6a;if(_0x4d2b97===0x0)_0x41cf8b(_0x2f631b);else _0x426ba9?(_0x1f0b5f?.[_0x470dd4(0x1ba)](_0x470dd4(0x23b)+_0x4d2b97+_0x470dd4(0x198)+_0x2ed92e['join']('\x20')),_0x36525a(new SDKError(ErrorCode['INSTALLATION_FAILED'],_0x426ba9,new Error(_0x1f0ec2)))):_0x41cf8b('');});});}async function ensureMcpServer(_0x44299e,_0x9c80d7,_0xeabb74,_0x13ac90,_0x5ae941){const _0x526048=a11_0x3488;_0x13ac90[_0x526048(0x214)]=_0x526048(0x1af)+_0x44299e+_0x526048(0x1cf);const _0x3d2774=await executeClaudeCommand([_0x526048(0x1a0),_0x526048(0x1e8),_0x44299e],undefined,_0x5ae941);if(_0x3d2774){const _0x5e1413=_0x3d2774[_0x526048(0x24d)](/URL:\s*(\S+)/);if(_0x5e1413&&_0x5e1413[0x1]===_0x9c80d7){_0x13ac90[_0x526048(0x214)]='✓\x20MCP\x20server\x20\x27'+_0x44299e+_0x526048(0x199);return;}else{if(_0x5e1413){const _0x2a5480=_0x5e1413[0x1];_0x5ae941?.[_0x526048(0x190)](_0x526048(0x1fd)+_0x44299e+_0x526048(0x209)+_0x2a5480+_0x526048(0x1d6)+_0x9c80d7),_0x13ac90[_0x526048(0x214)]='Updating\x20MCP\x20server\x20\x27'+_0x44299e+'\x27\x20URL...',await executeClaudeCommand(['mcp','remove',_0x44299e],_0x526048(0x1c8)+_0x44299e+'\x27',_0x5ae941);try{await executeClaudeCommand([_0x526048(0x1a0),_0x526048(0x22f),_0x44299e,_0x9c80d7,_0x526048(0x19c),_0xeabb74],_0x526048(0x1c1)+_0x44299e+'\x27',_0x5ae941),_0x13ac90[_0x526048(0x214)]=_0x526048(0x211)+_0x44299e+_0x526048(0x1be);return;}catch(_0x5cbbe4){_0x5ae941?.[_0x526048(0x1ba)](_0x526048(0x22a)+_0x2a5480),await executeClaudeCommand(['mcp',_0x526048(0x22f),_0x44299e,_0x2a5480,'--transport',_0xeabb74],_0x526048(0x1b8)+_0x44299e+_0x526048(0x1ec)+_0x2a5480,_0x5ae941)[_0x526048(0x20b)](_0x2e279a=>_0x5ae941?.[_0x526048(0x1ba)](_0x526048(0x1fe)+_0x2e279a));throw _0x5cbbe4;}}}}await executeClaudeCommand(['mcp',_0x526048(0x22f),_0x44299e,_0x9c80d7,_0x526048(0x19c),_0xeabb74],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0x44299e+'\x27',_0x5ae941),_0x13ac90[_0x526048(0x214)]=_0x526048(0x211)+_0x44299e+'\x27\x20configured';}const TD_DOCS_MCP_URL='https://docs.treasure.ai/mcp';export const TD_MCP_SERVERS=[{'name':a11_0x4980cc(0x206),'url':TD_DOCS_MCP_URL,'transport':a11_0x4980cc(0x191)}];export const DEFAULT_TD_SKILLS_URL='https://github.com/treasure-data/td-skills';export function getTdSkillsRepoUrl(){const _0x8163ca=process.env.TDX_TD_SKILLS_REPO;if(_0x8163ca)return _0x8163ca;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x3e42ba,_0x5ed417){const _0x3aa059=a11_0x4980cc;try{const _0x42707a=await executeClaudeCommand([_0x3aa059(0x22b),_0x3aa059(0x19a),'list'],'Failed\x20to\x20list\x20marketplaces',_0x5ed417);if(!_0x42707a[_0x3aa059(0x241)](_0x3e42ba)){_0x5ed417?.[_0x3aa059(0x1a7)](_0x3aa059(0x225)+_0x3e42ba+_0x3aa059(0x23e));return;}await executeClaudeCommand([_0x3aa059(0x22b),_0x3aa059(0x19a),_0x3aa059(0x1b0),_0x3e42ba],_0x3aa059(0x233)+_0x3e42ba+'\x27',_0x5ed417),_0x5ed417?.[_0x3aa059(0x190)](_0x3aa059(0x225)+_0x3e42ba+'\x27\x20removed');}catch(_0x3f3304){_0x5ed417?.['warn'](_0x3aa059(0x233)+_0x3e42ba+_0x3aa059(0x1ad)+_0x3f3304);}}async function restoreDefaultTdSkillsMarketplace(_0x46d677){const _0x287e96=a11_0x4980cc;try{await removeMarketplace(_0x287e96(0x21d),_0x46d677),await executeClaudeCommand([_0x287e96(0x22b),_0x287e96(0x19a),_0x287e96(0x22f),DEFAULT_TD_SKILLS_URL],undefined,_0x46d677),_0x46d677?.[_0x287e96(0x190)](_0x287e96(0x1ab));}catch{}}async function ensureMarketplace(_0x4c9655,_0x394e62,_0x53c0e7,_0x4e6b09){const _0x650a2c=a11_0x4980cc;_0x53c0e7[_0x650a2c(0x214)]=_0x650a2c(0x195)+_0x4c9655+'\x27...',await executeClaudeCommand([_0x650a2c(0x22b),_0x650a2c(0x19a),_0x650a2c(0x22f),_0x394e62],'Failed\x20to\x20configure\x20marketplace\x20\x27'+_0x4c9655+'\x27',_0x4e6b09),_0x53c0e7[_0x650a2c(0x214)]='✓\x20Marketplace\x20\x27'+_0x4c9655+_0x650a2c(0x199);}async function updateMarketplace(_0x52d30b,_0x2ed9dd,_0x4a8694){const _0x359166=a11_0x4980cc;_0x2ed9dd[_0x359166(0x214)]='Updating\x20marketplace\x20\x27'+_0x52d30b+_0x359166(0x1cf),await executeClaudeCommand([_0x359166(0x22b),_0x359166(0x19a),'update',_0x52d30b],_0x359166(0x1b3)+_0x52d30b+'\x27',_0x4a8694),_0x2ed9dd['text']='✓\x20Marketplace\x20\x27'+_0x52d30b+'\x27\x20updated';}async function ensurePlugin(_0x243442,_0x3c966d,_0x34aa59,_0xb633d6){const _0x442254=a11_0x4980cc;_0x34aa59[_0x442254(0x214)]=_0x442254(0x1d1)+_0x243442+_0x442254(0x1cf),await executeClaudeCommand(['plugin','install',_0x243442+'@'+_0x3c966d],_0x442254(0x24f)+_0x243442+'\x27',_0xb633d6),_0x34aa59[_0x442254(0x214)]=_0x442254(0x1e0)+_0x243442+_0x442254(0x23d);}export const TD_SKILLS_PLUGINS=[a11_0x4980cc(0x227),a11_0x4980cc(0x236),'tdx-skills'];export const SETUP_TTL_MS=0xe*0x18*0x3c*0x3c*0x3e8;function isWithinTtl(_0x2b4935){const _0x41c31c=a11_0x4980cc;if(!_0x2b4935)return![];const _0x5aa598=Date[_0x41c31c(0x1bb)]()-new Date(_0x2b4935)['getTime']();return Number[_0x41c31c(0x1a3)](_0x5aa598)&&_0x5aa598>=0x0&&_0x5aa598<=SETUP_TTL_MS;}const setupCache=createGlobalCache(a11_0x4980cc(0x24c),a11_0x4980cc(0x245));function updateSetupCache(_0x1d47f6){const _0x1ab88d=a11_0x4980cc;try{setupCache['write']({...setupCache[_0x1ab88d(0x1ef)](),..._0x1d47f6});}catch{}}function isTdxUpgradeSinceSetup(){const _0x3c68ce=a11_0x4980cc;return setupCache[_0x3c68ce(0x1ef)]()?.['tdxVersion']!==getVersion();}export function recordSetupVersion(){updateSetupCache({'tdxVersion':getVersion()});}function isSkillsRefreshDue(_0x160df9,_0x253335){const _0x40aec4=a11_0x4980cc,_0x1db1dc=setupCache[_0x40aec4(0x1ef)]()?.[_0x40aec4(0x1f1)];if(!_0x1db1dc)return!![];if(_0x1db1dc[_0x40aec4(0x1fb)]!==_0x160df9||_0x1db1dc[_0x40aec4(0x1f6)]!==_0x253335||_0x1db1dc[_0x40aec4(0x239)]?.[_0x40aec4(0x1ae)](',')!==TD_SKILLS_PLUGINS[_0x40aec4(0x1ae)](','))return!![];return!isWithinTtl(_0x1db1dc[_0x40aec4(0x235)]);}export function recordSkillsRefresh(_0x46a89f,_0x21a893){const _0x46c790=a11_0x4980cc;updateSetupCache({'skills':{'refreshedAt':new Date()[_0x46c790(0x22d)](),'repoUrl':_0x46a89f,'releaseChannel':_0x21a893,'pluginIds':TD_SKILLS_PLUGINS}});}const MCP_SETUP_MAX_CWDS=0x64;function wasMcpConfiguredRecently(_0x407c0e,_0x2f93df){const _0x56831a=a11_0x4980cc,_0x3bcc0f=setupCache[_0x56831a(0x1ef)]()?.[_0x56831a(0x1a0)]?.[_0x407c0e['name']];if(_0x3bcc0f?.['url']!==_0x407c0e['url'])return![];return isWithinTtl(_0x3bcc0f[_0x56831a(0x1ac)]?.[_0x2f93df]);}export function recordMcpSetup(_0x49e244,_0x2d9cde){const _0x204492=a11_0x4980cc,_0x26ec0e=setupCache[_0x204492(0x1ef)]()?.[_0x204492(0x1a0)]??{},_0x13c40d=_0x26ec0e[_0x49e244[_0x204492(0x20d)]],_0x4bc3a3=_0x13c40d?.[_0x204492(0x202)]===_0x49e244['url']?_0x13c40d[_0x204492(0x1ac)]:{},_0x5bd13e=Object[_0x204492(0x237)]({..._0x4bc3a3,[_0x2d9cde]:new Date()[_0x204492(0x22d)]()})[_0x204492(0x194)](([,_0x5c78d9])=>isWithinTtl(_0x5c78d9))['sort'](([,_0x236571],[,_0x4e8667])=>_0x4e8667[_0x204492(0x1f0)](_0x236571))['slice'](0x0,MCP_SETUP_MAX_CWDS);updateSetupCache({'mcp':{..._0x26ec0e,[_0x49e244[_0x204492(0x20d)]]:{'url':_0x49e244['url'],'cwds':Object[_0x204492(0x1f5)](_0x5bd13e)}}});}export function hasSetupWork(_0x5b31d9){const _0x5cf2d0=a11_0x4980cc;return _0x5b31d9['missingMcpServers'][_0x5cf2d0(0x1d2)]>0x0||_0x5b31d9[_0x5cf2d0(0x19a)]||_0x5b31d9[_0x5cf2d0(0x248)][_0x5cf2d0(0x1d2)]>0x0||_0x5b31d9[_0x5cf2d0(0x1d7)];}export function planClaudeSetup(_0x519fb8,_0x4cceb5,_0x19682e){const _0x47916f=a11_0x4980cc;if(_0x19682e||isTdxUpgradeSinceSetup())return{'missingMcpServers':TD_MCP_SERVERS[_0x47916f(0x1dd)](_0x3ad3c2=>_0x3ad3c2[_0x47916f(0x20d)]),'marketplace':!![],'missingPlugins':[...TD_SKILLS_PLUGINS],'refresh':!![]};const _0x3973dd=readMarketplaceSourceUrl('td-skills')!==normalizeRepoUrl(_0x519fb8),_0x11740b=_0x3973dd?[...TD_SKILLS_PLUGINS]:TD_SKILLS_PLUGINS[_0x47916f(0x194)](_0x2b1a0a=>!isPluginInstalled(_0x2b1a0a,_0x47916f(0x21d))),_0x14f50c=_0x519fb8!==DEFAULT_TD_SKILLS_URL,_0x2292f6=process['cwd'](),_0x56ef46=TD_MCP_SERVERS['filter'](_0x32faa6=>findMcpServerUrl(_0x32faa6['name'],_0x2292f6)!==_0x32faa6[_0x47916f(0x202)]&&!wasMcpConfiguredRecently(_0x32faa6,_0x2292f6))[_0x47916f(0x1dd)](_0x104eb8=>_0x104eb8[_0x47916f(0x20d)]);return{'missingMcpServers':_0x56ef46,'marketplace':_0x3973dd,'missingPlugins':_0x11740b,'refresh':_0x3973dd||_0x11740b[_0x47916f(0x1d2)]>0x0||_0x14f50c||isSkillsRefreshDue(_0x519fb8,_0x4cceb5)};}async function checkoutReleaseTag(_0x46ee86,_0x48cd7f,_0x24b5f7){const _0x36080c=a11_0x4980cc,_0x23d77f=join(getClaudeConfigDir(),'plugins',_0x36080c(0x1e7),_0x36080c(0x21d));if(!existsSync(_0x23d77f)){_0x24b5f7?.[_0x36080c(0x1a7)](_0x36080c(0x1b4));return;}_0x48cd7f[_0x36080c(0x214)]='Checking\x20out\x20td-skills\x20'+_0x46ee86+_0x36080c(0x222),await execFileAsync(_0x36080c(0x208),[_0x36080c(0x1d4),_0x36080c(0x1e5),_0x36080c(0x21c),_0x36080c(0x1f3)],{'cwd':_0x23d77f});try{await execFileAsync(_0x36080c(0x208),['checkout',_0x36080c(0x230)],{'cwd':_0x23d77f});}catch{await execFileAsync(_0x36080c(0x208),[_0x36080c(0x1e2),'-b',_0x36080c(0x230),_0x36080c(0x1f7)],{'cwd':_0x23d77f});}await execFileAsync(_0x36080c(0x208),[_0x36080c(0x242),_0x36080c(0x19f),_0x46ee86],{'cwd':_0x23d77f}),_0x48cd7f[_0x36080c(0x214)]='✓\x20td-skills\x20checked\x20out\x20at\x20'+_0x46ee86,_0x24b5f7?.['info']('td-skills\x20checked\x20out\x20at\x20tag\x20'+_0x46ee86);}export class ClaudeCommand extends BaseCommand{[a11_0x4980cc(0x20d)]=a11_0x4980cc(0x1c3);[a11_0x4980cc(0x205)]=a11_0x4980cc(0x1cd);['passThroughServer'];[a11_0x4980cc(0x193)];[a11_0x4980cc(0x1e6)];async['setUpClaudeIntegration'](_0x4c3fb8,_0x2a12b6,_0x42975c){const _0x3c7052=a11_0x4980cc,_0x282344=loadReleaseChannel(),_0xa5780d=planClaudeSetup(_0x4c3fb8,_0x282344,_0x2a12b6);this[_0x3c7052(0x193)]?.[_0x3c7052(0x1a7)](_0x3c7052(0x19d)+JSON['stringify'](_0xa5780d));if(!hasSetupWork(_0xa5780d))return;try{_0x42975c['text']=_0x3c7052(0x1a5),await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x3c7052(0x193)]),_0x42975c[_0x3c7052(0x214)]=_0x3c7052(0x1b5);}catch(_0x2432dd){_0x42975c[_0x3c7052(0x1a9)](_0x3c7052(0x1a2));throw _0x2432dd;}let _0x43a171=!![];for(const _0x5203dd of TD_MCP_SERVERS['filter'](_0x40c37a=>_0xa5780d[_0x3c7052(0x240)][_0x3c7052(0x241)](_0x40c37a[_0x3c7052(0x20d)]))){try{await ensureMcpServer(_0x5203dd[_0x3c7052(0x20d)],_0x5203dd[_0x3c7052(0x202)],_0x5203dd[_0x3c7052(0x228)],_0x42975c,this['logger']),recordMcpSetup(_0x5203dd,process[_0x3c7052(0x1ed)]());}catch(_0xa725c0){_0x43a171=![],handleInstallationError(_0xa725c0,_0x3c7052(0x1fd)+_0x5203dd[_0x3c7052(0x20d)]+'\x27',_0x42975c,this['logger']);}}try{_0xa5780d[_0x3c7052(0x19a)]&&(await removeMarketplace(_0x3c7052(0x21d),this[_0x3c7052(0x193)]),await ensureMarketplace(_0x3c7052(0x21d),_0x4c3fb8,_0x42975c,this[_0x3c7052(0x193)]));_0xa5780d[_0x3c7052(0x1d7)]&&await updateMarketplace(_0x3c7052(0x21d),_0x42975c,this[_0x3c7052(0x193)]);for(const _0xd64392 of _0xa5780d['missingPlugins']){await ensurePlugin(_0xd64392,_0x3c7052(0x21d),_0x42975c,this[_0x3c7052(0x193)]);}if(_0xa5780d[_0x3c7052(0x1d7)])try{const _0x58640e=await resolveReleaseTag(_0x282344,'treasure-data',_0x3c7052(0x21d),_0x3c7052(0x1a6));_0x58640e&&await checkoutReleaseTag(_0x58640e,_0x42975c,this['logger']),recordSkillsRefresh(_0x4c3fb8,_0x282344);}catch(_0x4986ea){_0x43a171=![],this['logger']?.['warn']('Failed\x20to\x20apply\x20td-skills\x20release\x20channel:\x20'+_0x4986ea);}}catch(_0x4d6862){_0x43a171=![],handleInstallationError(_0x4d6862,_0x3c7052(0x213),_0x42975c,this[_0x3c7052(0x193)]);}_0x43a171&&recordSetupVersion();}async['execute'](_0x82db7a){const _0x4f83fd=a11_0x4980cc,{tdx:_0x4c20c8,options:_0x486173,args:_0x2d58ec}=_0x82db7a;let _0x14272c=![];try{const _0x3cd007=_0x486173,_0x1b1074=_0x3cd007[_0x4f83fd(0x20c)]===![],_0x11e615=_0x3cd007['continue']===!![],_0x1dc93d=_0x3cd007[_0x4f83fd(0x1f4)]===!![],_0x2e83bd=[..._0x2d58ec];if(_0x11e615)_0x2e83bd[_0x4f83fd(0x21b)]('-c');else _0x1dc93d&&_0x2e83bd[_0x4f83fd(0x21b)]('-r');const _0x2843c2=createCommandSpinner(_0x4f83fd(0x1c0),{'verbose':_0x486173['verbose']});_0x2843c2['start']();try{if(!_0x1b1074){const _0xa26139=_0x486173['profile'];try{const _0x243c75=await _0x4c20c8[_0x4f83fd(0x1cc)]['getCurrent']();_0x243c75[_0x4f83fd(0x1d3)]&&writeCachedAccountInfo(_0x486173['site']??_0x4f83fd(0x221),_0x243c75[_0x4f83fd(0x1d3)],_0xa26139);}catch{}_0x2843c2['text']=_0x4f83fd(0x1c9),this[_0x4f83fd(0x193)]=new TDXLogger(_0x486173[_0x4f83fd(0x203)],!![]),await this[_0x4f83fd(0x193)][_0x4f83fd(0x1e3)]();const _0x12d817=this[_0x4f83fd(0x193)][_0x4f83fd(0x201)]();_0x2843c2[_0x4f83fd(0x214)]=_0x4f83fd(0x254)+_0x12d817;const _0xaafe1f=getEndpoint(_0x486173[_0x4f83fd(0x1bf)],'llm-proxy');_0x2843c2[_0x4f83fd(0x214)]=_0x4f83fd(0x23c);let _0x4a77aa;const _0x3e5c59=await getOAuthTokens(_0xa26139);if(_0x3e5c59)_0x4a77aa={'type':_0x4f83fd(0x1db),'accessToken':_0x3e5c59[_0x4f83fd(0x1c7)],'refreshToken':_0x3e5c59[_0x4f83fd(0x1d0)],'expiresAt':_0x3e5c59[_0x4f83fd(0x1df)],'consoleUrl':getConsoleUrl(_0x486173[_0x4f83fd(0x1bf)])};else{if(_0x4c20c8['context'][_0x4f83fd(0x229)])_0x4a77aa={'type':_0x4f83fd(0x250),'apiKey':_0x4c20c8[_0x4f83fd(0x19b)]['apiKey']};else throw new SDKError(ErrorCode[_0x4f83fd(0x243)],_0x4f83fd(0x246));}this['passThroughServer']=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0xaafe1f,'auth':_0x4a77aa,'logger':this[_0x4f83fd(0x193)],'site':_0x486173[_0x4f83fd(0x1bf)]??_0x4f83fd(0x221),'profile':_0xa26139,'proxy':_0x4c20c8[_0x4f83fd(0x19b)][_0x4f83fd(0x20c)]}),await this[_0x4f83fd(0x1b9)][_0x4f83fd(0x1b7)](),this[_0x4f83fd(0x1e6)]=this[_0x4f83fd(0x1b9)][_0x4f83fd(0x1e6)],_0x2843c2[_0x4f83fd(0x214)]=_0x4f83fd(0x23f)+this['port']+'\x20→\x20'+_0xaafe1f,_0x2843c2[_0x4f83fd(0x214)]=_0x4f83fd(0x1ee);}else _0x2843c2['text']=_0x4f83fd(0x1a1);const _0x218964=getTdSkillsRepoUrl();_0x14272c=_0x218964!==DEFAULT_TD_SKILLS_URL,await this['setUpClaudeIntegration'](_0x218964,_0x3cd007['refresh']===!![],_0x2843c2),_0x2843c2[_0x4f83fd(0x224)]();}catch(_0x4e2af7){_0x2843c2['fail'](_0x4f83fd(0x1e1));throw _0x4e2af7;}const _0x17171d=await findExecutable(_0x4f83fd(0x1c3));if(!_0x17171d)throw new SDKError(ErrorCode[_0x4f83fd(0x1da)],_0x4f83fd(0x1f2),undefined,{'helpText':_0x4f83fd(0x1ca)});const _0x12f5fe=_0x1b1074?_0x2e83bd:buildClaudeLaunchArgs(_0x2e83bd,_0x4c20c8[_0x4f83fd(0x19b)][_0x4f83fd(0x1dc)]),_0x53e548={...process.env};!_0x1b1074&&(_0x53e548[_0x4f83fd(0x21a)]=_0x4f83fd(0x223)+this[_0x4f83fd(0x1e6)],_0x53e548[_0x4f83fd(0x215)]='tdx-managed-proxy',_0x53e548[_0x4f83fd(0x1c6)]=_0x4f83fd(0x196),_0x53e548[_0x4f83fd(0x24a)]=_0x4f83fd(0x196));_0x4c20c8['context']['profile']&&(_0x53e548[_0x4f83fd(0x1f8)]=_0x4c20c8[_0x4f83fd(0x19b)][_0x4f83fd(0x1dc)]);const _0xfcc4b0=crossSpawn(_0x17171d,_0x12f5fe,{'stdio':_0x4f83fd(0x231),'env':_0x53e548}),_0x47f044=await new Promise(_0x2f7f8e=>{const _0x59d79e=_0x4f83fd;_0xfcc4b0['on'](_0x59d79e(0x216),_0x2a2bc6=>{_0x2f7f8e(_0x2a2bc6||0x0);}),_0xfcc4b0['on'](_0x59d79e(0x1ba),_0x580488=>{const _0x3e9323=_0x59d79e;console['error'](a11_0x1b38ec[_0x3e9323(0x232)]('Failed\x20to\x20launch\x20Claude\x20Code:\x20'+_0x580488[_0x3e9323(0x1fa)])),_0x2f7f8e(0x1);});});_0x14272c&&await restoreDefaultTdSkillsMarketplace(this[_0x4f83fd(0x193)]);this[_0x4f83fd(0x1b9)]&&(await this[_0x4f83fd(0x1b9)][_0x4f83fd(0x224)](),console[_0x4f83fd(0x1c5)](a11_0x1b38ec[_0x4f83fd(0x226)](_0x4f83fd(0x204))));if(this[_0x4f83fd(0x193)]){await this[_0x4f83fd(0x193)][_0x4f83fd(0x1a4)]();const _0x5b0c18=this['logger'][_0x4f83fd(0x201)]();console[_0x4f83fd(0x1c5)](a11_0x1b38ec['green'](_0x4f83fd(0x21f)+_0x5b0c18));}return _0x47f044;}catch(_0x56d461){_0x14272c&&await restoreDefaultTdSkillsMarketplace(this[_0x4f83fd(0x193)]);this[_0x4f83fd(0x1b9)]&&await this[_0x4f83fd(0x1b9)]['stop']();this['logger']&&await this[_0x4f83fd(0x193)][_0x4f83fd(0x1a4)]();throw _0x56d461;}}}
1
+ const a11_0x515cfc=a11_0x32b6;(function(_0x5d5284,_0x3f6567){const _0x3e3acb=a11_0x32b6,_0x44e1ce=_0x5d5284();while(!![]){try{const _0x626de8=-parseInt(_0x3e3acb(0x1c7))/0x1*(parseInt(_0x3e3acb(0x26e))/0x2)+parseInt(_0x3e3acb(0x1c3))/0x3*(parseInt(_0x3e3acb(0x227))/0x4)+parseInt(_0x3e3acb(0x210))/0x5+-parseInt(_0x3e3acb(0x1cc))/0x6+parseInt(_0x3e3acb(0x1db))/0x7+parseInt(_0x3e3acb(0x264))/0x8+-parseInt(_0x3e3acb(0x26f))/0x9;if(_0x626de8===_0x3f6567)break;else _0x44e1ce['push'](_0x44e1ce['shift']());}catch(_0x287497){_0x44e1ce['push'](_0x44e1ce['shift']());}}}(a11_0x313a,0xe0264));import{execFile}from'node:child_process';function a11_0x32b6(_0x3c9cb0,_0x1fa1f3){_0x3c9cb0=_0x3c9cb0-0x1bf;const _0x313af9=a11_0x313a();let _0x32b633=_0x313af9[_0x3c9cb0];return _0x32b633;}import{existsSync}from'node:fs';import{join}from'node:path';import{promisify}from'node:util';import a11_0xea792e from'chalk';import{BaseCommand}from'./command.js';import{PassThroughProxyServer}from'../proxy/passthrough-server.js';import{TDXLogger}from'../utils/tdx-logger.js';import{getEndpoint,getConsoleUrl}from'../sdk/client/endpoints.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{findExecutable,crossSpawn}from'../utils/process.js';import{SDKError,ErrorCode,errorContains}from'../sdk/errors.js';import{createCommandSpinner}from'../utils/spinner.js';import{writeCachedAccountInfo,loadReleaseChannel}from'../core/config.js';import{getVersion}from'../core/version.js';import{resolveReleaseTag}from'../utils/github-releases.js';import{createGlobalCache}from'../utils/global-cache.js';import{findMcpServerUrl,getClaudeConfigDir,isPluginInstalled,normalizeRepoUrl,readMarketplaceSourceUrl}from'../utils/claude-code-state.js';const execFileAsync=promisify(execFile),MIN_CLAUDE_VERSION=a11_0x515cfc(0x27c);export function buildClaudeSettingsArgs(_0x3cbdaa){const _0x2b1ed0=a11_0x515cfc;return['--settings',JSON[_0x2b1ed0(0x1f2)]({'statusLine':{'type':_0x2b1ed0(0x1dd),'command':_0x3cbdaa?_0x2b1ed0(0x205)+_0x3cbdaa+_0x2b1ed0(0x208):_0x2b1ed0(0x212)}})];}export function buildClaudeLaunchArgs(_0x542949,_0x5950e8){const _0xa716d3=a11_0x515cfc;if(_0x542949['includes'](_0xa716d3(0x281))||_0x542949[_0xa716d3(0x1c8)](_0x895664=>_0x895664['startsWith'](_0xa716d3(0x1d8))))return[..._0x542949];return[..._0x542949,...buildClaudeSettingsArgs(_0x5950e8)];}function handleInstallationError(_0x3c7cc2,_0x418906,_0x5e67cd,_0x59e413){const _0x20f309=a11_0x515cfc;errorContains(_0x3c7cc2,'already\x20exists',_0x20f309(0x1d6),'already\x20configured')?(_0x5e67cd[_0x20f309(0x22e)]='✓\x20'+_0x418906+_0x20f309(0x263),_0x59e413?.[_0x20f309(0x261)](_0x418906+'\x20already\x20configured'),_0x3c7cc2 instanceof SDKError&&_0x3c7cc2[_0x20f309(0x20c)]&&_0x59e413?.[_0x20f309(0x22f)](_0x20f309(0x278)+_0x3c7cc2[_0x20f309(0x20c)][_0x20f309(0x1fb)])):(_0x5e67cd[_0x20f309(0x1d2)](_0x20f309(0x1cf)+_0x418906),_0x59e413?.[_0x20f309(0x224)](_0x418906+_0x20f309(0x222),_0x3c7cc2));}export function parseVersion(_0x34ad39){const _0x4b2e23=a11_0x515cfc,_0x8432ef=_0x34ad39[_0x4b2e23(0x217)]()[_0x4b2e23(0x270)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x8432ef)return null;return{'major':parseInt(_0x8432ef[0x1],0xa),'minor':parseInt(_0x8432ef[0x2],0xa),'patch':parseInt(_0x8432ef[0x3],0xa)};}export function compareVersions(_0x53f0a9,_0x59acf3){const _0x4ac42a=a11_0x515cfc;if(_0x53f0a9[_0x4ac42a(0x218)]!==_0x59acf3[_0x4ac42a(0x218)])return _0x53f0a9['major']-_0x59acf3[_0x4ac42a(0x218)];if(_0x53f0a9[_0x4ac42a(0x204)]!==_0x59acf3['minor'])return _0x53f0a9[_0x4ac42a(0x204)]-_0x59acf3['minor'];return _0x53f0a9[_0x4ac42a(0x1d5)]-_0x59acf3[_0x4ac42a(0x1d5)];}async function checkClaudeVersion(_0x2a1078,_0x538dde){const _0x1f1f68=a11_0x515cfc;_0x538dde?.[_0x1f1f68(0x22f)](_0x1f1f68(0x23c)+_0x2a1078+')');const _0x223f99=await executeClaudeCommand([_0x1f1f68(0x271)],undefined,_0x538dde),_0x55a1f6=parseVersion(_0x223f99);if(!_0x55a1f6){_0x538dde?.['warn'](_0x1f1f68(0x282)+_0x223f99);return;}const _0x2da4ab=_0x55a1f6[_0x1f1f68(0x218)]+'.'+_0x55a1f6[_0x1f1f68(0x204)]+'.'+_0x55a1f6[_0x1f1f68(0x1d5)],_0x44e776=parseVersion(_0x2a1078);if(!_0x44e776){_0x538dde?.['warn']('Invalid\x20minimum\x20version\x20format:\x20'+_0x2a1078);return;}if(compareVersions(_0x55a1f6,_0x44e776)<0x0){_0x538dde?.[_0x1f1f68(0x224)](_0x1f1f68(0x1df)+_0x2da4ab+_0x1f1f68(0x228)+_0x2a1078+')');throw new SDKError(ErrorCode[_0x1f1f68(0x249)],_0x1f1f68(0x1df)+_0x2da4ab+'\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20'+_0x2a1078+_0x1f1f68(0x25e),undefined,{'helpText':_0x1f1f68(0x24d)});}_0x538dde?.['debug']('Claude\x20Code\x20version\x20'+_0x2da4ab+_0x1f1f68(0x1e3));}async function executeClaudeCommand(_0x117600,_0x4e83c3,_0x5ad8ac){const _0x503a60=a11_0x515cfc;return _0x5ad8ac?.['info'](_0x503a60(0x1d4)+_0x117600[_0x503a60(0x21e)]('\x20')),new Promise((_0x2a3789,_0x4f2289)=>{const _0x5e0765=_0x503a60,_0x5d126a=crossSpawn(_0x5e0765(0x1eb),_0x117600,{'stdio':_0x5e0765(0x216)});let _0x18e41e='',_0x224104='';_0x5d126a[_0x5e0765(0x1de)]?.['on'](_0x5e0765(0x248),_0x464a11=>{_0x18e41e+=_0x464a11['toString']();}),_0x5d126a['stderr']?.['on'](_0x5e0765(0x248),_0x2ff764=>{const _0xa9126a=_0x5e0765;_0x224104+=_0x2ff764[_0xa9126a(0x1e6)]();}),_0x5d126a['on']('error',_0x78d858=>{const _0xeca55e=_0x5e0765;_0x78d858['code']===_0xeca55e(0x1f8)?(_0x5ad8ac?.[_0xeca55e(0x224)](_0xeca55e(0x1c5)),_0x4f2289(new SDKError(ErrorCode[_0xeca55e(0x201)],_0xeca55e(0x1c5),_0x78d858,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'}))):(_0x5ad8ac?.[_0xeca55e(0x224)](_0xeca55e(0x1fd)+_0x78d858['message']),_0x4f2289(new SDKError(ErrorCode[_0xeca55e(0x1e2)],_0xeca55e(0x257)+_0x78d858[_0xeca55e(0x1fb)],_0x78d858)));}),_0x5d126a['on'](_0x5e0765(0x280),_0x360230=>{const _0x5265e9=_0x5e0765;if(_0x360230===0x0)_0x2a3789(_0x18e41e);else _0x4e83c3?(_0x5ad8ac?.[_0x5265e9(0x224)](_0x5265e9(0x200)+_0x360230+_0x5265e9(0x268)+_0x117600[_0x5265e9(0x21e)]('\x20')),_0x4f2289(new SDKError(ErrorCode['INSTALLATION_FAILED'],_0x4e83c3,new Error(_0x224104)))):_0x2a3789('');});});}async function ensureMcpServer(_0x3dafa7,_0xdf7e0c,_0x1db2c4,_0x2c4d09,_0x226ee4){const _0x2e50eb=a11_0x515cfc;_0x2c4d09[_0x2e50eb(0x22e)]=_0x2e50eb(0x1f5)+_0x3dafa7+'\x27...';const _0x4e1c47=await executeClaudeCommand(['mcp','get',_0x3dafa7],undefined,_0x226ee4);if(_0x4e1c47){const _0x1c61cc=_0x4e1c47[_0x2e50eb(0x270)](/URL:\s*(\S+)/);if(_0x1c61cc&&_0x1c61cc[0x1]===_0xdf7e0c){_0x2c4d09[_0x2e50eb(0x22e)]='✓\x20MCP\x20server\x20\x27'+_0x3dafa7+_0x2e50eb(0x253);return;}else{if(_0x1c61cc){const _0x1fe90e=_0x1c61cc[0x1];_0x226ee4?.[_0x2e50eb(0x261)](_0x2e50eb(0x246)+_0x3dafa7+_0x2e50eb(0x24b)+_0x1fe90e+'\x20→\x20'+_0xdf7e0c),_0x2c4d09[_0x2e50eb(0x22e)]=_0x2e50eb(0x20b)+_0x3dafa7+_0x2e50eb(0x1f9),await executeClaudeCommand([_0x2e50eb(0x1f3),_0x2e50eb(0x247),_0x3dafa7],_0x2e50eb(0x1c1)+_0x3dafa7+'\x27',_0x226ee4);try{await executeClaudeCommand([_0x2e50eb(0x1f3),_0x2e50eb(0x275),_0x3dafa7,_0xdf7e0c,_0x2e50eb(0x1ea),_0x1db2c4],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0x3dafa7+'\x27',_0x226ee4),_0x2c4d09[_0x2e50eb(0x22e)]=_0x2e50eb(0x21d)+_0x3dafa7+_0x2e50eb(0x215);return;}catch(_0x464c37){_0x226ee4?.['error'](_0x2e50eb(0x267)+_0x1fe90e),await executeClaudeCommand([_0x2e50eb(0x1f3),'add',_0x3dafa7,_0x1fe90e,_0x2e50eb(0x1ea),_0x1db2c4],'Failed\x20to\x20restore\x20MCP\x20server\x20\x27'+_0x3dafa7+_0x2e50eb(0x25d)+_0x1fe90e,_0x226ee4)[_0x2e50eb(0x1e8)](_0x31c950=>_0x226ee4?.[_0x2e50eb(0x224)](_0x2e50eb(0x232)+_0x31c950));throw _0x464c37;}}}}await executeClaudeCommand([_0x2e50eb(0x1f3),_0x2e50eb(0x275),_0x3dafa7,_0xdf7e0c,_0x2e50eb(0x1ea),_0x1db2c4],_0x2e50eb(0x1c0)+_0x3dafa7+'\x27',_0x226ee4),_0x2c4d09['text']=_0x2e50eb(0x21d)+_0x3dafa7+_0x2e50eb(0x253);}const TD_DOCS_MCP_URL=a11_0x515cfc(0x213);export const TD_MCP_SERVERS=[{'name':a11_0x515cfc(0x256),'url':TD_DOCS_MCP_URL,'transport':a11_0x515cfc(0x1d0)}];export const DEFAULT_TD_SKILLS_URL=a11_0x515cfc(0x206);export function getTdSkillsRepoUrl(){const _0x301a55=process.env.TDX_TD_SKILLS_REPO;if(_0x301a55)return _0x301a55;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x44bd01,_0x5d70e5){const _0x194784=a11_0x515cfc;try{const _0x1206f9=await executeClaudeCommand([_0x194784(0x237),_0x194784(0x1f6),_0x194784(0x1d7)],'Failed\x20to\x20list\x20marketplaces',_0x5d70e5);if(!_0x1206f9['includes'](_0x44bd01)){_0x5d70e5?.[_0x194784(0x22f)](_0x194784(0x24e)+_0x44bd01+_0x194784(0x1e7));return;}await executeClaudeCommand([_0x194784(0x237),_0x194784(0x1f6),'remove',_0x44bd01],_0x194784(0x26c)+_0x44bd01+'\x27',_0x5d70e5),_0x5d70e5?.[_0x194784(0x261)](_0x194784(0x24e)+_0x44bd01+_0x194784(0x22c));}catch(_0x5c3d67){_0x5d70e5?.[_0x194784(0x1d2)](_0x194784(0x26c)+_0x44bd01+_0x194784(0x269)+_0x5c3d67);}}async function restoreDefaultTdSkillsMarketplace(_0x5d29af){const _0x4a39bd=a11_0x515cfc;try{await removeMarketplace('td-skills',_0x5d29af),await executeClaudeCommand([_0x4a39bd(0x237),'marketplace','add',DEFAULT_TD_SKILLS_URL],undefined,_0x5d29af),_0x5d29af?.[_0x4a39bd(0x261)]('Restored\x20default\x20td-skills\x20marketplace');}catch{}}async function ensureMarketplace(_0x403f5e,_0x265649,_0x30c1d8,_0x202aea){const _0x6bcf61=a11_0x515cfc;_0x30c1d8[_0x6bcf61(0x22e)]=_0x6bcf61(0x274)+_0x403f5e+_0x6bcf61(0x1c6),await executeClaudeCommand([_0x6bcf61(0x237),'marketplace','add',_0x265649],_0x6bcf61(0x231)+_0x403f5e+'\x27',_0x202aea),_0x30c1d8[_0x6bcf61(0x22e)]='✓\x20Marketplace\x20\x27'+_0x403f5e+_0x6bcf61(0x253);}async function updateMarketplace(_0x2d1dff,_0xa885f5,_0x168f6b){const _0x2e7014=a11_0x515cfc;_0xa885f5[_0x2e7014(0x22e)]='Updating\x20marketplace\x20\x27'+_0x2d1dff+_0x2e7014(0x1c6),await executeClaudeCommand(['plugin',_0x2e7014(0x1f6),_0x2e7014(0x279),_0x2d1dff],_0x2e7014(0x233)+_0x2d1dff+'\x27',_0x168f6b),_0xa885f5[_0x2e7014(0x22e)]=_0x2e7014(0x27b)+_0x2d1dff+_0x2e7014(0x215);}async function ensurePlugin(_0x10a220,_0x5c52c6,_0x5a4cf0,_0x365390){const _0x54106e=a11_0x515cfc;_0x5a4cf0[_0x54106e(0x22e)]=_0x54106e(0x209)+_0x10a220+_0x54106e(0x1c6),await executeClaudeCommand([_0x54106e(0x237),_0x54106e(0x1d1),_0x10a220+'@'+_0x5c52c6],_0x54106e(0x235)+_0x10a220+'\x27',_0x365390),_0x5a4cf0[_0x54106e(0x22e)]=_0x54106e(0x24f)+_0x10a220+_0x54106e(0x265);}export const TD_SKILLS_PLUGINS=['sql-skills',a11_0x515cfc(0x1ef),a11_0x515cfc(0x236)];export const SETUP_TTL_MS=0xe*0x18*0x3c*0x3c*0x3e8;function isWithinTtl(_0x37446b){const _0x3faeec=a11_0x515cfc;if(!_0x37446b)return![];const _0x5ca867=Date[_0x3faeec(0x20f)]()-new Date(_0x37446b)[_0x3faeec(0x1fc)]();return Number[_0x3faeec(0x23b)](_0x5ca867)&&_0x5ca867>=0x0&&_0x5ca867<=SETUP_TTL_MS;}const setupCache=createGlobalCache(a11_0x515cfc(0x1c9),a11_0x515cfc(0x255));function updateSetupCache(_0x4e1ee2){const _0x59c1c1=a11_0x515cfc;try{setupCache['write']({...setupCache[_0x59c1c1(0x24c)](),..._0x4e1ee2});}catch{}}function isTdxUpgradeSinceSetup(){const _0x3d3050=a11_0x515cfc;return setupCache[_0x3d3050(0x24c)]()?.[_0x3d3050(0x1dc)]!==getVersion();}export function recordSetupVersion(){updateSetupCache({'tdxVersion':getVersion()});}function isSkillsRefreshDue(_0x1bac20,_0x5e22af){const _0x10e594=a11_0x515cfc,_0x123121=setupCache[_0x10e594(0x24c)]()?.['skills'];if(!_0x123121)return!![];if(_0x123121[_0x10e594(0x23a)]!==_0x1bac20||_0x123121[_0x10e594(0x22a)]!==_0x5e22af||_0x123121[_0x10e594(0x1e0)]?.[_0x10e594(0x21e)](',')!==TD_SKILLS_PLUGINS[_0x10e594(0x21e)](','))return!![];return!isWithinTtl(_0x123121['refreshedAt']);}export function recordSkillsRefresh(_0xaea6,_0x191d50){const _0x298f4f=a11_0x515cfc;updateSetupCache({'skills':{'refreshedAt':new Date()[_0x298f4f(0x1fa)](),'repoUrl':_0xaea6,'releaseChannel':_0x191d50,'pluginIds':TD_SKILLS_PLUGINS}});}const MCP_SETUP_MAX_CWDS=0x64;function wasMcpConfiguredRecently(_0x3039e7,_0x1b4fa1){const _0x4206b0=a11_0x515cfc,_0x4ee03b=setupCache[_0x4206b0(0x24c)]()?.[_0x4206b0(0x1f3)]?.[_0x3039e7[_0x4206b0(0x23d)]];if(_0x4ee03b?.[_0x4206b0(0x1e4)]!==_0x3039e7[_0x4206b0(0x1e4)])return![];return isWithinTtl(_0x4ee03b[_0x4206b0(0x25a)]?.[_0x1b4fa1]);}function a11_0x313a(){const _0x34042d=['text','debug','description','Failed\x20to\x20configure\x20marketplace\x20\x27','Restore\x20also\x20failed:\x20','Failed\x20to\x20update\x20marketplace\x20\x27','...','Failed\x20to\x20install\x20plugin\x20\x27','tdx-skills','plugin','stop','http://127.0.0.1:','repoUrl','isFinite','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','name','getCurrent','filter','cwd','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','git','inherit','logger','INVALID_ARGUMENT','MCP\x20server\x20\x27','remove','data','CLAUDE_CODE_UNSUPPORTED_VERSION','✓\x20td-skills\x20checked\x20out\x20at\x20','\x27\x20URL\x20changed:\x20','read','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','Marketplace\x20\x27','✓\x20Plugin\x20\x27','td-skills','continue','--tags','\x27\x20configured','sort','claude-command','td-docs','Failed\x20to\x20spawn\x20claude\x20command:\x20','setUpClaudeIntegration','close','cwds','fromEntries','origin','\x27\x20to\x20','\x20or\x20later.','tdx-managed-proxy','td-skills\x20checked\x20out\x20at\x20tag\x20','info','TDX_PROFILE','\x20already\x20configured','7907232cwTxHy','\x27\x20installed','localeCompare','Failed\x20to\x20add\x20new\x20URL,\x20restoring\x20previous\x20URL:\x20','):\x20claude\x20','\x27:\x20','\x20→\x20','Authentication\x20required\x20for\x20TD\x20LLM\x20Proxy.\x20Run:\x20tdx\x20auth\x20setup','Failed\x20to\x20remove\x20marketplace\x20\x27','logLevel','694YuiaxW','11696526EySIXs','match','--version','Failed\x20to\x20launch\x20Claude\x20Code:\x20','td-skills\x20marketplace\x20dir\x20not\x20found,\x20skipping\x20release\x20tag\x20checkout','Configuring\x20marketplace\x20\x27','add','us01','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','Command\x20output:\x20','update','getLogPath','✓\x20Marketplace\x20\x27','2.0.20','oauth','port','plugins','exit','--settings','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','unshift','Failed\x20to\x20configure\x20MCP\x20server\x20\x27','Failed\x20to\x20remove\x20outdated\x20MCP\x20server\x20\x27','access_token','5003337BBVNfB','entries','Claude\x20Code\x20CLI\x20not\x20found','\x27...','656wGvqix','some','claude_setup.json','init','false','10192632NSUsLB','map','missingPlugins','Warning:\x20Failed\x20to\x20configure\x20','http','install','warn','CLAUDE_CODE_USE_BEDROCK','Executing:\x20claude\x20','patch','already\x20installed','list','--settings=','main','transport','2582167PkrPng','tdxVersion','command','stdout','Claude\x20Code\x20version\x20','pluginIds','Claude\x20Code\x20version\x20check\x20failed','INTERNAL','\x20meets\x20minimum\x20requirement','url','includes','toString','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','catch','resume','--transport','claude','verbose','context','missingMcpServers','workflow-skills','log','✓\x20Logs\x20saved\x20to\x20','stringify','mcp','account_id','Configuring\x20MCP\x20server\x20\x27','marketplace','site','ENOENT','\x27\x20URL...','toISOString','message','getTime','Command\x20spawn\x20error:\x20','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','proxy','Command\x20failed\x20(exit\x20','CLAUDE_CODE_NOT_FOUND','fetch','passThroughServer','minor','tdx\x20--profile\x20','https://github.com/treasure-data/td-skills','length','\x20claude\x20statusline','Installing\x20plugin\x20\x27','refresh_token','Updating\x20MCP\x20server\x20\x27','cause','refresh','marketplaces','now','5595350BuJCCd','--hard','tdx\x20claude\x20statusline','https://docs.treasure.ai/mcp','checkout','\x27\x20updated','pipe','trim','major','start','td-skills\x20Plugins','user','Setup\x20failed','✓\x20MCP\x20server\x20\x27','join','✓\x20Claude\x20Code\x20version\x20OK','Initializing...','--force','\x20configuration\x20failed','profile','error','fail','Initializing\x20proxy\x20logger...','4lSIqaP','\x20is\x20too\x20old\x20(minimum:\x20','✓\x20Logging\x20to\x20','releaseChannel','llm-proxy','\x27\x20removed','Failed\x20to\x20apply\x20td-skills\x20release\x20channel:\x20'];a11_0x313a=function(){return _0x34042d;};return a11_0x313a();}export function recordMcpSetup(_0x36f474,_0x2a0b48){const _0x35b701=a11_0x515cfc,_0x52b36d=setupCache[_0x35b701(0x24c)]()?.[_0x35b701(0x1f3)]??{},_0x4b222f=_0x52b36d[_0x36f474[_0x35b701(0x23d)]],_0xbcbc2=_0x4b222f?.[_0x35b701(0x1e4)]===_0x36f474[_0x35b701(0x1e4)]?_0x4b222f['cwds']:{},_0x431d95=Object[_0x35b701(0x1c4)]({..._0xbcbc2,[_0x2a0b48]:new Date()['toISOString']()})['filter'](([,_0x4b43d4])=>isWithinTtl(_0x4b43d4))[_0x35b701(0x254)](([,_0xc59c28],[,_0x1e24ab])=>_0x1e24ab[_0x35b701(0x266)](_0xc59c28))['slice'](0x0,MCP_SETUP_MAX_CWDS);updateSetupCache({'mcp':{..._0x52b36d,[_0x36f474[_0x35b701(0x23d)]]:{'url':_0x36f474[_0x35b701(0x1e4)],'cwds':Object[_0x35b701(0x25b)](_0x431d95)}}});}export function hasSetupWork(_0x4ef320){const _0x5d79f9=a11_0x515cfc;return _0x4ef320[_0x5d79f9(0x1ee)][_0x5d79f9(0x207)]>0x0||_0x4ef320[_0x5d79f9(0x1f6)]||_0x4ef320['missingPlugins'][_0x5d79f9(0x207)]>0x0||_0x4ef320[_0x5d79f9(0x20d)];}export function planClaudeSetup(_0x26f65b,_0x1141b1,_0x3d6110){const _0x4a64bb=a11_0x515cfc;if(_0x3d6110||isTdxUpgradeSinceSetup())return{'missingMcpServers':TD_MCP_SERVERS[_0x4a64bb(0x1cd)](_0x240e1c=>_0x240e1c[_0x4a64bb(0x23d)]),'marketplace':!![],'missingPlugins':[...TD_SKILLS_PLUGINS],'refresh':!![]};const _0x379d1b=readMarketplaceSourceUrl(_0x4a64bb(0x250))!==normalizeRepoUrl(_0x26f65b),_0x567e0a=_0x379d1b?[...TD_SKILLS_PLUGINS]:TD_SKILLS_PLUGINS[_0x4a64bb(0x23f)](_0x7f2ee5=>!isPluginInstalled(_0x7f2ee5,_0x4a64bb(0x250))),_0x49e413=_0x26f65b!==DEFAULT_TD_SKILLS_URL,_0x53829d=process['cwd'](),_0xcc8894=TD_MCP_SERVERS['filter'](_0x1e90ad=>findMcpServerUrl(_0x1e90ad[_0x4a64bb(0x23d)],_0x53829d)!==_0x1e90ad[_0x4a64bb(0x1e4)]&&!wasMcpConfiguredRecently(_0x1e90ad,_0x53829d))[_0x4a64bb(0x1cd)](_0x4b6d83=>_0x4b6d83[_0x4a64bb(0x23d)]);return{'missingMcpServers':_0xcc8894,'marketplace':_0x379d1b,'missingPlugins':_0x567e0a,'refresh':_0x379d1b||_0x567e0a[_0x4a64bb(0x207)]>0x0||_0x49e413||isSkillsRefreshDue(_0x26f65b,_0x1141b1)};}async function checkoutReleaseTag(_0x30ef2d,_0x2b4323,_0x3d2a19){const _0xaa214a=a11_0x515cfc,_0x1d87fe=join(getClaudeConfigDir(),_0xaa214a(0x27f),_0xaa214a(0x20e),_0xaa214a(0x250));if(!existsSync(_0x1d87fe)){_0x3d2a19?.[_0xaa214a(0x22f)](_0xaa214a(0x273));return;}_0x2b4323[_0xaa214a(0x22e)]='Checking\x20out\x20td-skills\x20'+_0x30ef2d+_0xaa214a(0x234),await execFileAsync(_0xaa214a(0x242),[_0xaa214a(0x202),_0xaa214a(0x25c),_0xaa214a(0x252),_0xaa214a(0x221)],{'cwd':_0x1d87fe});try{await execFileAsync(_0xaa214a(0x242),[_0xaa214a(0x214),_0xaa214a(0x1d9)],{'cwd':_0x1d87fe});}catch{await execFileAsync(_0xaa214a(0x242),['checkout','-b','main','origin/main'],{'cwd':_0x1d87fe});}await execFileAsync(_0xaa214a(0x242),['reset',_0xaa214a(0x211),_0x30ef2d],{'cwd':_0x1d87fe}),_0x2b4323[_0xaa214a(0x22e)]=_0xaa214a(0x24a)+_0x30ef2d,_0x3d2a19?.[_0xaa214a(0x261)](_0xaa214a(0x260)+_0x30ef2d);}export class ClaudeCommand extends BaseCommand{[a11_0x515cfc(0x23d)]=a11_0x515cfc(0x1eb);[a11_0x515cfc(0x230)]=a11_0x515cfc(0x1fe);[a11_0x515cfc(0x203)];[a11_0x515cfc(0x244)];['port'];async['setUpClaudeIntegration'](_0x2ae0d3,_0x1fc4bc,_0xf9a510){const _0xead80d=a11_0x515cfc,_0x48e741=loadReleaseChannel(),_0x596f02=planClaudeSetup(_0x2ae0d3,_0x48e741,_0x1fc4bc);this[_0xead80d(0x244)]?.[_0xead80d(0x22f)]('Claude\x20setup\x20plan:\x20'+JSON[_0xead80d(0x1f2)](_0x596f02));if(!hasSetupWork(_0x596f02))return;try{_0xf9a510[_0xead80d(0x22e)]='Checking\x20Claude\x20Code\x20version...',await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0xead80d(0x244)]),_0xf9a510[_0xead80d(0x22e)]=_0xead80d(0x21f);}catch(_0x463589){_0xf9a510['fail'](_0xead80d(0x1e1));throw _0x463589;}let _0x144c9f=!![];for(const _0x40edca of TD_MCP_SERVERS['filter'](_0x9e2bf2=>_0x596f02[_0xead80d(0x1ee)][_0xead80d(0x1e5)](_0x9e2bf2[_0xead80d(0x23d)]))){try{await ensureMcpServer(_0x40edca['name'],_0x40edca[_0xead80d(0x1e4)],_0x40edca[_0xead80d(0x1da)],_0xf9a510,this[_0xead80d(0x244)]),recordMcpSetup(_0x40edca,process[_0xead80d(0x240)]());}catch(_0x40cb6e){_0x144c9f=![],handleInstallationError(_0x40cb6e,_0xead80d(0x246)+_0x40edca[_0xead80d(0x23d)]+'\x27',_0xf9a510,this[_0xead80d(0x244)]);}}try{_0x596f02[_0xead80d(0x1f6)]&&(await removeMarketplace(_0xead80d(0x250),this[_0xead80d(0x244)]),await ensureMarketplace('td-skills',_0x2ae0d3,_0xf9a510,this[_0xead80d(0x244)]));_0x596f02[_0xead80d(0x20d)]&&await updateMarketplace(_0xead80d(0x250),_0xf9a510,this[_0xead80d(0x244)]);for(const _0x5a9357 of _0x596f02[_0xead80d(0x1ce)]){await ensurePlugin(_0x5a9357,_0xead80d(0x250),_0xf9a510,this[_0xead80d(0x244)]);}if(_0x596f02['refresh'])try{const _0x25b092=await resolveReleaseTag(_0x48e741,'treasure-data','td-skills','tdx-cli');_0x25b092&&await checkoutReleaseTag(_0x25b092,_0xf9a510,this[_0xead80d(0x244)]),recordSkillsRefresh(_0x2ae0d3,_0x48e741);}catch(_0x4e2978){_0x144c9f=![],this[_0xead80d(0x244)]?.['warn'](_0xead80d(0x22d)+_0x4e2978);}}catch(_0x477520){_0x144c9f=![],handleInstallationError(_0x477520,_0xead80d(0x21a),_0xf9a510,this['logger']);}_0x144c9f&&recordSetupVersion();}async['execute'](_0x552442){const _0xa6bf02=a11_0x515cfc,{tdx:_0x330cfb,options:_0xdf0692,args:_0x3230a8}=_0x552442;let _0x38edd2=![];try{const _0x164d76=_0xdf0692,_0x4f59b6=_0x164d76[_0xa6bf02(0x1ff)]===![],_0x27e1b7=_0x164d76[_0xa6bf02(0x251)]===!![],_0x4262ab=_0x164d76[_0xa6bf02(0x1e9)]===!![],_0x258b5a=[..._0x3230a8];if(_0x27e1b7)_0x258b5a[_0xa6bf02(0x1bf)]('-c');else _0x4262ab&&_0x258b5a[_0xa6bf02(0x1bf)]('-r');const _0x4be8e8=createCommandSpinner(_0xa6bf02(0x220),{'verbose':_0xdf0692[_0xa6bf02(0x1ec)]});_0x4be8e8[_0xa6bf02(0x219)]();try{if(!_0x4f59b6){const _0x17eafd=_0xdf0692[_0xa6bf02(0x223)];try{const _0x534232=await _0x330cfb[_0xa6bf02(0x21b)][_0xa6bf02(0x23e)]();_0x534232['account_id']&&writeCachedAccountInfo(_0xdf0692['site']??_0xa6bf02(0x276),_0x534232[_0xa6bf02(0x1f4)],_0x17eafd);}catch{}_0x4be8e8[_0xa6bf02(0x22e)]=_0xa6bf02(0x226),this[_0xa6bf02(0x244)]=new TDXLogger(_0xdf0692[_0xa6bf02(0x26d)],!![]),await this[_0xa6bf02(0x244)][_0xa6bf02(0x1ca)]();const _0x2d972c=this[_0xa6bf02(0x244)][_0xa6bf02(0x27a)]();_0x4be8e8[_0xa6bf02(0x22e)]=_0xa6bf02(0x229)+_0x2d972c;const _0x2446f5=getEndpoint(_0xdf0692[_0xa6bf02(0x1f7)],_0xa6bf02(0x22b));_0x4be8e8['text']=_0xa6bf02(0x283);let _0x4b727b;const _0x59245a=await getOAuthTokens(_0x17eafd);if(_0x59245a)_0x4b727b={'type':_0xa6bf02(0x27d),'accessToken':_0x59245a[_0xa6bf02(0x1c2)],'refreshToken':_0x59245a[_0xa6bf02(0x20a)],'expiresAt':_0x59245a['expires_at'],'consoleUrl':getConsoleUrl(_0xdf0692[_0xa6bf02(0x1f7)])};else{if(_0x330cfb[_0xa6bf02(0x1ed)]['apiKey'])_0x4b727b={'type':'apikey','apiKey':_0x330cfb[_0xa6bf02(0x1ed)]['apiKey']};else throw new SDKError(ErrorCode[_0xa6bf02(0x245)],_0xa6bf02(0x26b));}this[_0xa6bf02(0x203)]=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x2446f5,'auth':_0x4b727b,'logger':this['logger'],'site':_0xdf0692[_0xa6bf02(0x1f7)]??_0xa6bf02(0x276),'profile':_0x17eafd,'proxy':_0x330cfb['context'][_0xa6bf02(0x1ff)]}),await this[_0xa6bf02(0x203)][_0xa6bf02(0x219)](),this[_0xa6bf02(0x27e)]=this[_0xa6bf02(0x203)][_0xa6bf02(0x27e)],_0x4be8e8['text']='✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20'+this['port']+_0xa6bf02(0x26a)+_0x2446f5,_0x4be8e8[_0xa6bf02(0x22e)]='✓\x20TD\x20LLM\x20proxy\x20settings\x20prepared\x20for\x20this\x20session';}else _0x4be8e8[_0xa6bf02(0x22e)]='Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)';const _0x4d6582=getTdSkillsRepoUrl();_0x38edd2=_0x4d6582!==DEFAULT_TD_SKILLS_URL,await this[_0xa6bf02(0x258)](_0x4d6582,_0x164d76[_0xa6bf02(0x20d)]===!![],_0x4be8e8),_0x4be8e8[_0xa6bf02(0x238)]();}catch(_0x44a116){_0x4be8e8[_0xa6bf02(0x225)](_0xa6bf02(0x21c));throw _0x44a116;}const _0x362940=await findExecutable('claude');if(!_0x362940)throw new SDKError(ErrorCode[_0xa6bf02(0x201)],'Claude\x20Code\x20CLI\x20not\x20found',undefined,{'helpText':_0xa6bf02(0x241)});const _0x2fb816=_0x4f59b6?_0x258b5a:buildClaudeLaunchArgs(_0x258b5a,_0x330cfb[_0xa6bf02(0x1ed)][_0xa6bf02(0x223)]),_0x3fb41a={...process.env};!_0x4f59b6&&(_0x3fb41a['ANTHROPIC_BASE_URL']=_0xa6bf02(0x239)+this[_0xa6bf02(0x27e)],_0x3fb41a['ANTHROPIC_AUTH_TOKEN']=_0xa6bf02(0x25f),_0x3fb41a[_0xa6bf02(0x1d3)]=_0xa6bf02(0x1cb),_0x3fb41a['CLAUDE_CODE_USE_VERTEX']=_0xa6bf02(0x1cb));_0x330cfb[_0xa6bf02(0x1ed)][_0xa6bf02(0x223)]&&(_0x3fb41a[_0xa6bf02(0x262)]=_0x330cfb[_0xa6bf02(0x1ed)][_0xa6bf02(0x223)]);const _0xebd3de=crossSpawn(_0x362940,_0x2fb816,{'stdio':_0xa6bf02(0x243),'env':_0x3fb41a}),_0x3c4b17=await new Promise(_0x1b5ef6=>{const _0x1160b3=_0xa6bf02;_0xebd3de['on'](_0x1160b3(0x280),_0x531090=>{_0x1b5ef6(_0x531090||0x0);}),_0xebd3de['on']('error',_0x3eb976=>{const _0xd8e9ca=_0x1160b3;console['error'](a11_0xea792e['red'](_0xd8e9ca(0x272)+_0x3eb976['message'])),_0x1b5ef6(0x1);});});_0x38edd2&&await restoreDefaultTdSkillsMarketplace(this['logger']);this[_0xa6bf02(0x203)]&&(await this[_0xa6bf02(0x203)][_0xa6bf02(0x238)](),console[_0xa6bf02(0x1f0)](a11_0xea792e['green'](_0xa6bf02(0x277))));if(this[_0xa6bf02(0x244)]){await this[_0xa6bf02(0x244)]['close']();const _0xcdcd75=this[_0xa6bf02(0x244)]['getLogPath']();console[_0xa6bf02(0x1f0)](a11_0xea792e['green'](_0xa6bf02(0x1f1)+_0xcdcd75));}return _0x3c4b17;}catch(_0x558a6e){_0x38edd2&&await restoreDefaultTdSkillsMarketplace(this[_0xa6bf02(0x244)]);this['passThroughServer']&&await this[_0xa6bf02(0x203)][_0xa6bf02(0x238)]();this[_0xa6bf02(0x244)]&&await this[_0xa6bf02(0x244)][_0xa6bf02(0x259)]();throw _0x558a6e;}}}
@@ -1 +1 @@
1
- const a12_0x2f54d7=a12_0x4d86;(function(_0x392a4b,_0x3bb045){const _0xfb0ae=a12_0x4d86,_0x410ceb=_0x392a4b();while(!![]){try{const _0x5209b7=parseInt(_0xfb0ae(0x1a1))/0x1+parseInt(_0xfb0ae(0x1aa))/0x2+parseInt(_0xfb0ae(0x1bd))/0x3+parseInt(_0xfb0ae(0x1b1))/0x4+parseInt(_0xfb0ae(0x1ba))/0x5*(-parseInt(_0xfb0ae(0x1bf))/0x6)+parseInt(_0xfb0ae(0x1a6))/0x7*(-parseInt(_0xfb0ae(0x1c4))/0x8)+-parseInt(_0xfb0ae(0x1ad))/0x9*(parseInt(_0xfb0ae(0x1c2))/0xa);if(_0x5209b7===_0x3bb045)break;else _0x410ceb['push'](_0x410ceb['shift']());}catch(_0x22cebb){_0x410ceb['push'](_0x410ceb['shift']());}}}(a12_0x39da,0xe2f1d));function a12_0x4d86(_0x447def,_0x3d3a3d){_0x447def=_0x447def-0x19d;const _0x39da98=a12_0x39da();let _0x4d86e2=_0x39da98[_0x447def];return _0x4d86e2;}import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x409cba=0x64){return new Promise(_0x1effbf=>{const _0x42f5b4=a12_0x4d86;let _0x27bbd9='',_0x20d8dd=![];const _0x4d61fa=createInterface({'input':process[_0x42f5b4(0x1b2)],'terminal':![]}),_0xd17fce=_0x2639b1=>{const _0x244331=_0x42f5b4;if(_0x20d8dd)return;_0x20d8dd=!![],clearTimeout(_0x51d519),_0x4d61fa[_0x244331(0x1b9)](),_0x1effbf(_0x2639b1);},_0x51d519=setTimeout(()=>{_0xd17fce(null);},_0x409cba);_0x4d61fa['on'](_0x42f5b4(0x19d),_0x1212fe=>{_0x27bbd9+=_0x1212fe;}),_0x4d61fa['on'](_0x42f5b4(0x1b9),()=>{const _0x1f528e=_0x42f5b4;if(_0x20d8dd)return;try{const _0x41bb9a=JSON[_0x1f528e(0x1a2)](_0x27bbd9);_0xd17fce(_0x41bb9a);}catch{_0xd17fce(null);}});});}function formatCredits(_0x3e6857){const _0x5729ec=a12_0x4d86;return _0x3e6857[_0x5729ec(0x1c8)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a12_0x2f54d7(0x1a9)]=a12_0x2f54d7(0x1b8);[a12_0x2f54d7(0x1be)]=a12_0x2f54d7(0x19e);async[a12_0x2f54d7(0x1a8)](_0xc2223d){const _0x374601=a12_0x2f54d7;try{const _0x4e87a9=await readStdinJson();if(!_0x4e87a9?.[_0x374601(0x1bb)])return console[_0x374601(0x1b5)](_0x374601(0x1ac)),0x0;const _0x47a2d5=_0x4e87a9[_0x374601(0x1bb)],_0x3d390a=_0x4e87a9['model']?.['id']||'',_0x41c40d=_0x4e87a9[_0x374601(0x1b4)]||_0xc2223d[_0x374601(0x1af)][_0x374601(0x1b4)],_0x2f2359=await getUsageStats(_0x47a2d5,_0x41c40d),_0x33ef3c=[],_0x49d17f=readCachedAccountInfo(_0x41c40d),_0x5ced81=_0x49d17f?'tdx\x20'+_0x49d17f[_0x374601(0x1a3)]+':'+_0x49d17f[_0x374601(0x1a7)]:'tdx',_0x23fa91=_0x3d390a?getModelDisplayName(_0x3d390a):_0x374601(0x1b6);_0x33ef3c['push'](_0x374601(0x1ae)+_0x5ced81+_0x374601(0x1b3)+_0x23fa91);const _0x14ee84=formatCredits(_0x2f2359['sessionCredits']),_0x3f98f9=formatCredits(_0x2f2359[_0x374601(0x1a0)]),_0x1adf0c=formatCredits(_0x2f2359[_0x374601(0x1c5)]);_0x33ef3c[_0x374601(0x1c3)]('🪙\x20credit:\x20'+_0x14ee84+'\x20session\x20/\x20'+_0x3f98f9+_0x374601(0x1c1)+_0x1adf0c+_0x374601(0x1a4));const _0x16f707=_0x4e87a9[_0x374601(0x1b7)],_0x119fc9=_0x16f707?.[_0x374601(0x1c7)];if(_0x119fc9&&_0x16f707?.[_0x374601(0x1a5)]!=null){const _0x5daeba=_0x119fc9[_0x374601(0x1ab)]+_0x119fc9[_0x374601(0x19f)]+_0x119fc9[_0x374601(0x1bc)],_0xb6f049=formatTokenCount(_0x5daeba),_0x32df68=Math['round'](_0x16f707[_0x374601(0x1a5)]);_0x33ef3c[_0x374601(0x1c3)](_0x374601(0x1b0)+_0xb6f049+'\x20('+_0x32df68+'%)');}return console['log'](_0x33ef3c[_0x374601(0x1c6)](_0x374601(0x1c0))),0x0;}catch{return console[_0x374601(0x1b5)]('💎\x20tdx\x20-\x20Claude'),0x0;}}}function a12_0x39da(){const _0x248461=['3795560KSDgqH','push','8ihZeoJ','monthCredits','join','current_usage','toFixed','line','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','cache_creation_input_tokens','todayCredits','187388YLnEoC','parse','site','\x20month','used_percentage','810103arnBEG','accountId','execute','name','2601668SpJRof','input_tokens','💎\x20tdx\x20-\x20Claude','45mlJkaJ','💎\x20','options','🧠\x20','5049076uqWFnm','stdin','\x20-\x20','profile','log','Claude','context_window','statusline','close','75490GHoCSy','session_id','cache_read_input_tokens','1619511VTilzR','description','138xUiCGt','\x20|\x20','\x20today\x20/\x20'];a12_0x39da=function(){return _0x248461;};return a12_0x39da();}
1
+ const a12_0x295b63=a12_0x5ab6;(function(_0xbc708d,_0x35c45d){const _0x458782=a12_0x5ab6,_0x9ca975=_0xbc708d();while(!![]){try{const _0x306b66=-parseInt(_0x458782(0x1b6))/0x1*(-parseInt(_0x458782(0x1b8))/0x2)+-parseInt(_0x458782(0x1c6))/0x3+-parseInt(_0x458782(0x1c3))/0x4+-parseInt(_0x458782(0x1b7))/0x5*(-parseInt(_0x458782(0x1d4))/0x6)+-parseInt(_0x458782(0x1c7))/0x7+parseInt(_0x458782(0x1ca))/0x8*(-parseInt(_0x458782(0x1c1))/0x9)+parseInt(_0x458782(0x1c4))/0xa*(parseInt(_0x458782(0x1ac))/0xb);if(_0x306b66===_0x35c45d)break;else _0x9ca975['push'](_0x9ca975['shift']());}catch(_0x4e7df2){_0x9ca975['push'](_0x9ca975['shift']());}}}(a12_0x3c93,0xd7156));import{createInterface}from'node:readline';import{BaseCommand}from'./command.js';import{getUsageStats}from'../proxy/claude-usage-tracker.js';function a12_0x3c93(){const _0x5b3fcf=['\x20session\x20/\x20','🧠\x20','todayCredits','cache_creation_input_tokens','name','used_percentage','3035244wFCSkl','\x20|\x20','💎\x20','601546zVxtee','parse','profile','close','session_id','execute','round','accountId','monthCredits','\x20month','1350255DHjbro','5PPIFpc','2zlbykV','log','line','statusline','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','context_window','tdx\x20','model','join','9sOuWEF','Claude','4822412wAMnWR','550ihAXBM','push','3865797FQcAkb','9852017UUvJXV','💎\x20tdx\x20-\x20Claude','toFixed','649952yyDXjX','input_tokens','options','tdx'];a12_0x3c93=function(){return _0x5b3fcf;};return a12_0x3c93();}function a12_0x5ab6(_0xad8c64,_0x41eb7e){_0xad8c64=_0xad8c64-0x1ab;const _0x3c9301=a12_0x3c93();let _0x5ab6ff=_0x3c9301[_0xad8c64];return _0x5ab6ff;}import{readCachedAccountInfo}from'../core/config.js';import{getModelDisplayName,formatTokenCount}from'../sdk/llm/model-factors.js';async function readStdinJson(_0x490b02=0x64){return new Promise(_0x250ee9=>{const _0x2eb1ea=a12_0x5ab6;let _0x3ecdac='',_0x1b9dca=![];const _0x4c3554=createInterface({'input':process['stdin'],'terminal':![]}),_0xa3ba09=_0x51419f=>{if(_0x1b9dca)return;_0x1b9dca=!![],clearTimeout(_0xd3fa4f),_0x4c3554['close'](),_0x250ee9(_0x51419f);},_0xd3fa4f=setTimeout(()=>{_0xa3ba09(null);},_0x490b02);_0x4c3554['on'](_0x2eb1ea(0x1ba),_0x56b084=>{_0x3ecdac+=_0x56b084;}),_0x4c3554['on'](_0x2eb1ea(0x1af),()=>{const _0x2e1e70=_0x2eb1ea;if(_0x1b9dca)return;try{const _0x2cc2fe=JSON[_0x2e1e70(0x1ad)](_0x3ecdac);_0xa3ba09(_0x2cc2fe);}catch{_0xa3ba09(null);}});});}function formatCredits(_0x107e41){const _0x24879e=a12_0x5ab6;return _0x107e41[_0x24879e(0x1c9)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{[a12_0x295b63(0x1d2)]=a12_0x295b63(0x1bb);['description']=a12_0x295b63(0x1bc);async[a12_0x295b63(0x1b1)](_0x11c4c5){const _0x2e526f=a12_0x295b63;try{const _0x2d8dfe=await readStdinJson();if(!_0x2d8dfe?.[_0x2e526f(0x1b0)])return console[_0x2e526f(0x1b9)](_0x2e526f(0x1c8)),0x0;const _0x3b1964=_0x2d8dfe[_0x2e526f(0x1b0)],_0x40b15e=_0x2d8dfe[_0x2e526f(0x1bf)]?.['id']||'',_0x6b1f8f=_0x2d8dfe[_0x2e526f(0x1ae)]||_0x11c4c5[_0x2e526f(0x1cc)][_0x2e526f(0x1ae)],_0x421b52=await getUsageStats(_0x3b1964,_0x6b1f8f),_0x44397d=[],_0x4ba889=readCachedAccountInfo(_0x6b1f8f),_0x46723=_0x4ba889?_0x2e526f(0x1be)+_0x4ba889['site']+':'+_0x4ba889[_0x2e526f(0x1b3)]:_0x2e526f(0x1cd),_0x3b3a97=_0x40b15e?getModelDisplayName(_0x40b15e):_0x2e526f(0x1c2);_0x44397d[_0x2e526f(0x1c5)](_0x2e526f(0x1ab)+_0x46723+'\x20-\x20'+_0x3b3a97);const _0xd432d8=formatCredits(_0x421b52['sessionCredits']),_0x42bc55=formatCredits(_0x421b52[_0x2e526f(0x1d0)]),_0x50ad57=formatCredits(_0x421b52[_0x2e526f(0x1b4)]);_0x44397d[_0x2e526f(0x1c5)]('🪙\x20credit:\x20'+_0xd432d8+_0x2e526f(0x1ce)+_0x42bc55+'\x20today\x20/\x20'+_0x50ad57+_0x2e526f(0x1b5));const _0x39a827=_0x2d8dfe[_0x2e526f(0x1bd)],_0x18e145=_0x39a827?.['current_usage'];if(_0x18e145&&_0x39a827?.[_0x2e526f(0x1d3)]!=null){const _0x26085c=_0x18e145[_0x2e526f(0x1cb)]+_0x18e145[_0x2e526f(0x1d1)]+_0x18e145['cache_read_input_tokens'],_0x92a406=formatTokenCount(_0x26085c),_0x3004ae=Math[_0x2e526f(0x1b2)](_0x39a827[_0x2e526f(0x1d3)]);_0x44397d['push'](_0x2e526f(0x1cf)+_0x92a406+'\x20('+_0x3004ae+'%)');}return console['log'](_0x44397d[_0x2e526f(0x1c0)](_0x2e526f(0x1d5))),0x0;}catch{return console[_0x2e526f(0x1b9)]('💎\x20tdx\x20-\x20Claude'),0x0;}}}
@@ -1 +1 @@
1
- function a13_0x1b9a(){const _0x220904=['\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','Unknown\x20error','cyan','log','all','lastUsedAt','numeric','totalCredits','Error:\x20','format','26hNrBFo','11lReCfP','\x20\x20Month:\x20\x20\x20','usage','\x20\x20Total:\x20\x20\x20','82936bxeLpM','profile','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','Last\x20Used','2-digit','never','max','padEnd','9eTohvw','jsonl','outputTable','\x20credits','toFixed','error','Requests','credits','entryCount','4KCgZBm','773245jfFgLw','yesterday','monthCredits','12eQvMXv','toLocaleDateString','en-US','Source','toLocaleTimeString','default','dim','description','todayCredits','Profile','29569TuCJsX','execute','Usage\x20by\x20Source','padStart','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','short','message','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','Month','source','bold','Today','outputStructured','\x20\x20Today:\x20\x20\x20','48cgnaBt','(default)','round','780084SpzESW','200270hOwUJk','1532296wqqPoe','en-CA','17509154QewLXF','repeat','map','getTime','json','name'];a13_0x1b9a=function(){return _0x220904;};return a13_0x1b9a();}const a13_0x27f4be=a13_0x196d;(function(_0x3951eb,_0x4f49ce){const _0x3a6b7e=a13_0x196d,_0x376591=_0x3951eb();while(!![]){try{const _0x49b243=-parseInt(_0x3a6b7e(0xfe))/0x1*(parseInt(_0x3a6b7e(0xda))/0x2)+-parseInt(_0x3a6b7e(0x10f))/0x3+parseInt(_0x3a6b7e(0xf0))/0x4*(-parseInt(_0x3a6b7e(0xf1))/0x5)+-parseInt(_0x3a6b7e(0x10c))/0x6*(parseInt(_0x3a6b7e(0xdf))/0x7)+-parseInt(_0x3a6b7e(0x111))/0x8*(parseInt(_0x3a6b7e(0xe7))/0x9)+parseInt(_0x3a6b7e(0x110))/0xa*(parseInt(_0x3a6b7e(0xdb))/0xb)+parseInt(_0x3a6b7e(0xf4))/0xc*(parseInt(_0x3a6b7e(0x113))/0xd);if(_0x49b243===_0x4f49ce)break;else _0x376591['push'](_0x376591['shift']());}catch(_0x42788a){_0x376591['push'](_0x376591['shift']());}}}(a13_0x1b9a,0x44b92));import a13_0x2df3a4 from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function formatCredits(_0x16154a){const _0x4a44a1=a13_0x196d;return _0x16154a[_0x4a44a1(0xeb)](0x2);}function formatLastUsed(_0x448997){const _0x275523=a13_0x196d;if(!_0x448997)return _0x275523(0xe4);const _0x4774ca=new Date(_0x448997),_0x2e1497=new Date(),_0x16fac8=_0x4774ca['toLocaleDateString'](_0x275523(0x112)),_0x9b1f4a=_0x2e1497[_0x275523(0xf5)](_0x275523(0x112));if(_0x16fac8===_0x9b1f4a)return'today\x20'+_0x4774ca[_0x275523(0xf8)](_0x275523(0xf6),{'hour':_0x275523(0xe3),'minute':_0x275523(0xe3)});const _0x532eed=new Date(_0x16fac8),_0x2252f6=new Date(_0x9b1f4a),_0x28147d=Math[_0x275523(0x10e)]((_0x2252f6[_0x275523(0x116)]()-_0x532eed[_0x275523(0x116)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x28147d===0x1)return _0x275523(0xf2);else return _0x28147d>0x1&&_0x28147d<0x7?_0x28147d+'\x20days\x20ago':_0x4774ca['toLocaleDateString'](_0x275523(0xf6),{'month':_0x275523(0x103),'day':_0x275523(0xd6)});}function a13_0x196d(_0x176c0d,_0x581056){_0x176c0d=_0x176c0d-0xd6;const _0x1b9a16=a13_0x1b9a();let _0x196d50=_0x1b9a16[_0x176c0d];return _0x196d50;}export class ClaudeUsageCommand extends BaseCommand{[a13_0x27f4be(0x118)]=a13_0x27f4be(0xdd);[a13_0x27f4be(0xfb)]=a13_0x27f4be(0xe1);async[a13_0x27f4be(0xff)](_0x944a25){const _0x17836d=a13_0x27f4be,{options:_0x46b728}=_0x944a25,_0x5841bb=_0x46b728[_0x17836d(0xd9)]===_0x17836d(0x117)||_0x46b728[_0x17836d(0xd9)]===_0x17836d(0xe8)||_0x46b728[_0x17836d(0x117)];try{const [_0x1a5a98,_0x59eaa7,_0x2a9b94]=await Promise[_0x17836d(0x11d)]([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x5841bb?await this[_0x17836d(0x10a)](_0x1a5a98,_0x59eaa7,_0x2a9b94,_0x46b728):this[_0x17836d(0xe9)](_0x1a5a98,_0x59eaa7,_0x2a9b94),0x0;}catch(_0x416717){const _0x4cd7fe=_0x416717 instanceof Error?_0x416717[_0x17836d(0x104)]:_0x17836d(0x11a);return console[_0x17836d(0xec)](a13_0x2df3a4['red'](_0x17836d(0xd8)+_0x4cd7fe)),0x1;}}async['outputStructured'](_0x2f7a97,_0x5ca39c,_0x503c7a,_0x39cde0){const _0xd2dec=a13_0x27f4be,_0x3a46dd={'summary':{'todayCredits':_0x503c7a['todayCredits'],'monthCredits':_0x503c7a[_0xd2dec(0xf3)],'totalCredits':_0x503c7a[_0xd2dec(0xd7)],'profileCount':_0x503c7a['profileCount']},'profiles':_0x2f7a97[_0xd2dec(0x115)](_0x287698=>({'profile':_0x287698['profile'],'credits':_0x287698[_0xd2dec(0xee)],'requests':_0x287698[_0xd2dec(0xef)],'lastUsedAt':_0x287698[_0xd2dec(0x11e)]})),'sources':_0x5ca39c[_0xd2dec(0x115)](_0x4fbc25=>({'source':_0x4fbc25[_0xd2dec(0x107)],'credits':_0x4fbc25['credits'],'todayCredits':_0x4fbc25['todayCredits'],'monthCredits':_0x4fbc25[_0xd2dec(0xf3)],'requests':_0x4fbc25['entryCount']}))};await handleSDKOutput([_0x3a46dd],_0x39cde0);}[a13_0x27f4be(0xe9)](_0x43b8fe,_0x53f975,_0x5d9614){const _0x452dc6=a13_0x27f4be;console[_0x452dc6(0x11c)](a13_0x2df3a4[_0x452dc6(0x108)](_0x452dc6(0x119))),console['log'](a13_0x2df3a4[_0x452dc6(0xfa)]('─'['repeat'](0x32))),console[_0x452dc6(0x11c)](_0x452dc6(0x10b)+a13_0x2df3a4['cyan'](formatCredits(_0x5d9614[_0x452dc6(0xfc)]))+'\x20credits'),console['log'](_0x452dc6(0xdc)+a13_0x2df3a4[_0x452dc6(0x11b)](formatCredits(_0x5d9614[_0x452dc6(0xf3)]))+_0x452dc6(0xea)),console['log'](_0x452dc6(0xde)+a13_0x2df3a4['cyan'](formatCredits(_0x5d9614[_0x452dc6(0xd7)]))+_0x452dc6(0xea)),console[_0x452dc6(0x11c)]();if(_0x53f975['length']>0x0){console[_0x452dc6(0x11c)](a13_0x2df3a4['bold'](_0x452dc6(0x100))),console[_0x452dc6(0x11c)](a13_0x2df3a4[_0x452dc6(0xfa)]('─'[_0x452dc6(0x114)](0x3c)));const _0x49e064=0xc,_0x2c4edb=0xa,_0x5aadec=0xa,_0x4dba3f=0xa;console[_0x452dc6(0x11c)]('\x20\x20'+_0x452dc6(0xf7)[_0x452dc6(0xe6)](_0x49e064)+'\x20\x20'+'Total'[_0x452dc6(0x101)](_0x2c4edb)+'\x20\x20'+_0x452dc6(0x109)[_0x452dc6(0x101)](_0x5aadec)+'\x20\x20'+_0x452dc6(0x106)['padStart'](_0x4dba3f));for(const _0x4e1ce7 of _0x53f975){console[_0x452dc6(0x11c)]('\x20\x20'+_0x4e1ce7['source'][_0x452dc6(0xe6)](_0x49e064)+'\x20\x20'+a13_0x2df3a4[_0x452dc6(0x11b)](formatCredits(_0x4e1ce7[_0x452dc6(0xee)])[_0x452dc6(0x101)](_0x2c4edb))+'\x20\x20'+formatCredits(_0x4e1ce7[_0x452dc6(0xfc)])['padStart'](_0x5aadec)+'\x20\x20'+formatCredits(_0x4e1ce7[_0x452dc6(0xf3)])[_0x452dc6(0x101)](_0x4dba3f));}console['log']();}if(_0x43b8fe['length']===0x0){console[_0x452dc6(0x11c)](a13_0x2df3a4[_0x452dc6(0xfa)](_0x452dc6(0x105))),console['log'](a13_0x2df3a4[_0x452dc6(0xfa)](_0x452dc6(0x102)));return;}console[_0x452dc6(0x11c)](a13_0x2df3a4[_0x452dc6(0x108)]('Usage\x20by\x20Profile')),console['log'](a13_0x2df3a4[_0x452dc6(0xfa)]('─'[_0x452dc6(0x114)](0x3c)));const _0x5ba2ed=Math[_0x452dc6(0xe5)](0xc,..._0x43b8fe[_0x452dc6(0x115)](_0x266bb9=>_0x266bb9[_0x452dc6(0xe0)]==='default'?_0x452dc6(0x10d)['length']:_0x266bb9[_0x452dc6(0xe0)]['length'])),_0x183618=0xa,_0x4776b5=0xa;console[_0x452dc6(0x11c)]('\x20\x20'+_0x452dc6(0xfd)[_0x452dc6(0xe6)](_0x5ba2ed)+'\x20\x20'+'Credits'[_0x452dc6(0x101)](_0x183618)+'\x20\x20'+_0x452dc6(0xed)[_0x452dc6(0x101)](_0x4776b5)+'\x20\x20'+_0x452dc6(0xe2));for(const _0x14fffb of _0x43b8fe){const _0x34f940=_0x14fffb[_0x452dc6(0xe0)]===_0x452dc6(0xf9)?_0x452dc6(0x10d):_0x14fffb[_0x452dc6(0xe0)],_0x3729d6=_0x34f940[_0x452dc6(0xe6)](_0x5ba2ed),_0x2cc901=_0x14fffb[_0x452dc6(0xe0)]===_0x452dc6(0xf9)?a13_0x2df3a4[_0x452dc6(0xfa)](_0x3729d6):_0x3729d6;console[_0x452dc6(0x11c)]('\x20\x20'+_0x2cc901+'\x20\x20'+a13_0x2df3a4[_0x452dc6(0x11b)](formatCredits(_0x14fffb['credits'])['padStart'](_0x183618))+'\x20\x20'+String(_0x14fffb[_0x452dc6(0xef)])[_0x452dc6(0x101)](_0x4776b5)+'\x20\x20'+a13_0x2df3a4[_0x452dc6(0xfa)](formatLastUsed(_0x14fffb[_0x452dc6(0x11e)])));}console[_0x452dc6(0x11c)](),console[_0x452dc6(0x11c)](a13_0x2df3a4[_0x452dc6(0xfa)]('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console[_0x452dc6(0x11c)]();}}
1
+ const a13_0x503f3b=a13_0x116e;(function(_0x28a04c,_0x53d497){const _0x38fbe9=a13_0x116e,_0x446ce6=_0x28a04c();while(!![]){try{const _0x1beb43=parseInt(_0x38fbe9(0xaa))/0x1+-parseInt(_0x38fbe9(0xab))/0x2*(parseInt(_0x38fbe9(0xbf))/0x3)+-parseInt(_0x38fbe9(0x8b))/0x4*(-parseInt(_0x38fbe9(0xb6))/0x5)+parseInt(_0x38fbe9(0xa7))/0x6*(-parseInt(_0x38fbe9(0xc7))/0x7)+-parseInt(_0x38fbe9(0xcd))/0x8+-parseInt(_0x38fbe9(0xad))/0x9+-parseInt(_0x38fbe9(0x95))/0xa*(-parseInt(_0x38fbe9(0xb4))/0xb);if(_0x1beb43===_0x53d497)break;else _0x446ce6['push'](_0x446ce6['shift']());}catch(_0x20d964){_0x446ce6['push'](_0x446ce6['shift']());}}}(a13_0x2c68,0x96564));import a13_0x48b99a from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function a13_0x116e(_0x3588ce,_0x550682){_0x3588ce=_0x3588ce-0x8b;const _0x2c6837=a13_0x2c68();let _0x116e43=_0x2c6837[_0x3588ce];return _0x116e43;}function formatCredits(_0x504e5f){const _0x29389e=a13_0x116e;return _0x504e5f[_0x29389e(0xa6)](0x2);}function formatLastUsed(_0x3116c7){const _0x5f49d6=a13_0x116e;if(!_0x3116c7)return _0x5f49d6(0xc8);const _0x5eb987=new Date(_0x3116c7),_0x34f16c=new Date(),_0x31c1fb=_0x5eb987[_0x5f49d6(0xb9)]('en-CA'),_0x2fb398=_0x34f16c[_0x5f49d6(0xb9)]('en-CA');if(_0x31c1fb===_0x2fb398)return'today\x20'+_0x5eb987[_0x5f49d6(0x94)](_0x5f49d6(0xac),{'hour':_0x5f49d6(0x9d),'minute':_0x5f49d6(0x9d)});const _0x35a35c=new Date(_0x31c1fb),_0x1665c7=new Date(_0x2fb398),_0x7d26f8=Math[_0x5f49d6(0xa8)]((_0x1665c7['getTime']()-_0x35a35c[_0x5f49d6(0xc3)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x7d26f8===0x1)return _0x5f49d6(0xa9);else return _0x7d26f8>0x1&&_0x7d26f8<0x7?_0x7d26f8+_0x5f49d6(0x93):_0x5eb987[_0x5f49d6(0xb9)]('en-US',{'month':'short','day':_0x5f49d6(0x92)});}function a13_0x2c68(){const _0x31fa60=['toFixed','458298eCYdUG','round','yesterday','502750dqXHWm','62278lEokyl','en-US','248643KZCeQM','cyan','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','red','dim','source','default','11FLBboC','entryCount','555yiOBiU','Month','lastUsedAt','toLocaleDateString','Usage\x20by\x20Source','bold','log','profile','Unknown\x20error','33hfruCv','\x20credits','\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a','credits','getTime','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','Error:\x20','length','56SPcysZ','never','todayCredits','(default)','monthCredits','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','504128imgctG','padEnd','outputStructured','\x20\x20Today:\x20\x20\x20','32108VfXcXG','outputTable','Profile','message','Source','jsonl','Today','numeric','\x20days\x20ago','toLocaleTimeString','2662690oyuFae','\x20\x20Month:\x20\x20\x20','\x20\x20Total:\x20\x20\x20','padStart','error','Total','totalCredits','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','2-digit','repeat','usage','name','format','max','json','map','Credits'];a13_0x2c68=function(){return _0x31fa60;};return a13_0x2c68();}export class ClaudeUsageCommand extends BaseCommand{[a13_0x503f3b(0xa0)]=a13_0x503f3b(0x9f);['description']=a13_0x503f3b(0xcc);async['execute'](_0x1bb94e){const _0x3fbc04=a13_0x503f3b,{options:_0x2f0eff}=_0x1bb94e,_0x554e01=_0x2f0eff[_0x3fbc04(0xa1)]===_0x3fbc04(0xa3)||_0x2f0eff['format']===_0x3fbc04(0x90)||_0x2f0eff[_0x3fbc04(0xa3)];try{const [_0x13aaf8,_0x5510b5,_0x58d0da]=await Promise['all']([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x554e01?await this[_0x3fbc04(0xcf)](_0x13aaf8,_0x5510b5,_0x58d0da,_0x2f0eff):this['outputTable'](_0x13aaf8,_0x5510b5,_0x58d0da),0x0;}catch(_0x32d4a7){const _0x3a4a06=_0x32d4a7 instanceof Error?_0x32d4a7[_0x3fbc04(0x8e)]:_0x3fbc04(0xbe);return console[_0x3fbc04(0x99)](a13_0x48b99a[_0x3fbc04(0xb0)](_0x3fbc04(0xc5)+_0x3a4a06)),0x1;}}async['outputStructured'](_0xbc5508,_0x11f886,_0x5d850e,_0x197922){const _0x5c1af2=a13_0x503f3b,_0x442356={'summary':{'todayCredits':_0x5d850e[_0x5c1af2(0xc9)],'monthCredits':_0x5d850e['monthCredits'],'totalCredits':_0x5d850e[_0x5c1af2(0x9b)],'profileCount':_0x5d850e['profileCount']},'profiles':_0xbc5508[_0x5c1af2(0xa4)](_0x871373=>({'profile':_0x871373[_0x5c1af2(0xbd)],'credits':_0x871373['credits'],'requests':_0x871373[_0x5c1af2(0xb5)],'lastUsedAt':_0x871373[_0x5c1af2(0xb8)]})),'sources':_0x11f886[_0x5c1af2(0xa4)](_0x45f619=>({'source':_0x45f619[_0x5c1af2(0xb2)],'credits':_0x45f619[_0x5c1af2(0xc2)],'todayCredits':_0x45f619['todayCredits'],'monthCredits':_0x45f619[_0x5c1af2(0xcb)],'requests':_0x45f619[_0x5c1af2(0xb5)]}))};await handleSDKOutput([_0x442356],_0x197922);}[a13_0x503f3b(0x8c)](_0x438869,_0x30ecaa,_0x2cf74c){const _0x1de8ed=a13_0x503f3b;console['log'](a13_0x48b99a[_0x1de8ed(0xbb)](_0x1de8ed(0xaf))),console[_0x1de8ed(0xbc)](a13_0x48b99a[_0x1de8ed(0xb1)]('─'[_0x1de8ed(0x9e)](0x32))),console[_0x1de8ed(0xbc)](_0x1de8ed(0xd0)+a13_0x48b99a['cyan'](formatCredits(_0x2cf74c[_0x1de8ed(0xc9)]))+_0x1de8ed(0xc0)),console['log'](_0x1de8ed(0x96)+a13_0x48b99a[_0x1de8ed(0xae)](formatCredits(_0x2cf74c[_0x1de8ed(0xcb)]))+_0x1de8ed(0xc0)),console[_0x1de8ed(0xbc)](_0x1de8ed(0x97)+a13_0x48b99a[_0x1de8ed(0xae)](formatCredits(_0x2cf74c[_0x1de8ed(0x9b)]))+_0x1de8ed(0xc0)),console[_0x1de8ed(0xbc)]();if(_0x30ecaa[_0x1de8ed(0xc6)]>0x0){console[_0x1de8ed(0xbc)](a13_0x48b99a['bold'](_0x1de8ed(0xba))),console[_0x1de8ed(0xbc)](a13_0x48b99a[_0x1de8ed(0xb1)]('─'[_0x1de8ed(0x9e)](0x3c)));const _0x5de4f7=0xc,_0x205e76=0xa,_0x4a148e=0xa,_0x2da1e6=0xa;console['log']('\x20\x20'+_0x1de8ed(0x8f)[_0x1de8ed(0xce)](_0x5de4f7)+'\x20\x20'+_0x1de8ed(0x9a)[_0x1de8ed(0x98)](_0x205e76)+'\x20\x20'+_0x1de8ed(0x91)[_0x1de8ed(0x98)](_0x4a148e)+'\x20\x20'+_0x1de8ed(0xb7)[_0x1de8ed(0x98)](_0x2da1e6));for(const _0x2e48ba of _0x30ecaa){console[_0x1de8ed(0xbc)]('\x20\x20'+_0x2e48ba['source']['padEnd'](_0x5de4f7)+'\x20\x20'+a13_0x48b99a[_0x1de8ed(0xae)](formatCredits(_0x2e48ba[_0x1de8ed(0xc2)])[_0x1de8ed(0x98)](_0x205e76))+'\x20\x20'+formatCredits(_0x2e48ba[_0x1de8ed(0xc9)])['padStart'](_0x4a148e)+'\x20\x20'+formatCredits(_0x2e48ba[_0x1de8ed(0xcb)])[_0x1de8ed(0x98)](_0x2da1e6));}console[_0x1de8ed(0xbc)]();}if(_0x438869[_0x1de8ed(0xc6)]===0x0){console[_0x1de8ed(0xbc)](a13_0x48b99a[_0x1de8ed(0xb1)](_0x1de8ed(0xc4))),console['log'](a13_0x48b99a[_0x1de8ed(0xb1)](_0x1de8ed(0xc1)));return;}console[_0x1de8ed(0xbc)](a13_0x48b99a[_0x1de8ed(0xbb)]('Usage\x20by\x20Profile')),console[_0x1de8ed(0xbc)](a13_0x48b99a['dim']('─'['repeat'](0x3c)));const _0xb0ff94=Math[_0x1de8ed(0xa2)](0xc,..._0x438869['map'](_0x1856ef=>_0x1856ef[_0x1de8ed(0xbd)]===_0x1de8ed(0xb3)?_0x1de8ed(0xca)[_0x1de8ed(0xc6)]:_0x1856ef[_0x1de8ed(0xbd)][_0x1de8ed(0xc6)])),_0x3aad2d=0xa,_0x3df1f3=0xa;console[_0x1de8ed(0xbc)]('\x20\x20'+_0x1de8ed(0x8d)[_0x1de8ed(0xce)](_0xb0ff94)+'\x20\x20'+_0x1de8ed(0xa5)[_0x1de8ed(0x98)](_0x3aad2d)+'\x20\x20'+'Requests'[_0x1de8ed(0x98)](_0x3df1f3)+'\x20\x20'+'Last\x20Used');for(const _0x33185f of _0x438869){const _0xa8b926=_0x33185f[_0x1de8ed(0xbd)]===_0x1de8ed(0xb3)?_0x1de8ed(0xca):_0x33185f['profile'],_0x8bf13b=_0xa8b926[_0x1de8ed(0xce)](_0xb0ff94),_0x4a582b=_0x33185f[_0x1de8ed(0xbd)]===_0x1de8ed(0xb3)?a13_0x48b99a[_0x1de8ed(0xb1)](_0x8bf13b):_0x8bf13b;console[_0x1de8ed(0xbc)]('\x20\x20'+_0x4a582b+'\x20\x20'+a13_0x48b99a['cyan'](formatCredits(_0x33185f['credits'])['padStart'](_0x3aad2d))+'\x20\x20'+String(_0x33185f['entryCount'])[_0x1de8ed(0x98)](_0x3df1f3)+'\x20\x20'+a13_0x48b99a[_0x1de8ed(0xb1)](formatLastUsed(_0x33185f['lastUsedAt'])));}console['log'](),console[_0x1de8ed(0xbc)](a13_0x48b99a[_0x1de8ed(0xb1)](_0x1de8ed(0x9c))),console[_0x1de8ed(0xbc)]();}}
@@ -1 +1 @@
1
- const a14_0x2da86d=a14_0x215f;(function(_0x4cd198,_0x150753){const _0x4e602e=a14_0x215f,_0x4d22d4=_0x4cd198();while(!![]){try{const _0x81208f=parseInt(_0x4e602e(0x161))/0x1+-parseInt(_0x4e602e(0x159))/0x2*(-parseInt(_0x4e602e(0x16e))/0x3)+-parseInt(_0x4e602e(0x180))/0x4*(-parseInt(_0x4e602e(0x163))/0x5)+-parseInt(_0x4e602e(0x162))/0x6+-parseInt(_0x4e602e(0x176))/0x7+-parseInt(_0x4e602e(0x187))/0x8*(parseInt(_0x4e602e(0x173))/0x9)+parseInt(_0x4e602e(0x16f))/0xa;if(_0x81208f===_0x150753)break;else _0x4d22d4['push'](_0x4d22d4['shift']());}catch(_0x51f589){_0x4d22d4['push'](_0x4d22d4['shift']());}}}(a14_0xa0ba,0xe0c6b));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory,ErrorCode}from'../sdk/errors.js';import{Logger}from'../utils/logger/index.js';import a14_0x488373 from'chalk';export function printSDKError(_0x10955c){const _0x1b8e7d=a14_0x215f;_0x10955c['code']===ErrorCode[_0x1b8e7d(0x170)]?(console[_0x1b8e7d(0x171)](a14_0x488373['red'](_0x1b8e7d(0x169)+_0x10955c[_0x1b8e7d(0x165)])),console[_0x1b8e7d(0x171)](a14_0x488373[_0x1b8e7d(0x17b)](_0x1b8e7d(0x17d)))):console['error'](a14_0x488373[_0x1b8e7d(0x17e)](_0x1b8e7d(0x169)+_0x10955c['message'])),_0x10955c[_0x1b8e7d(0x177)]&&console['error'](a14_0x488373[_0x1b8e7d(0x166)](_0x10955c['helpText']));}export function printAuthError(_0x52beb8,_0x177eb8=![],_0x10a184){const _0x17e18f=a14_0x215f,_0x4ba7ed=_0x52beb8[_0x17e18f(0x185)]?.[_0x17e18f(0x16b)]||_0x52beb8[_0x17e18f(0x165)];console[_0x17e18f(0x171)](a14_0x488373[_0x17e18f(0x17e)](_0x17e18f(0x17c))),console[_0x17e18f(0x171)](a14_0x488373['red'](_0x17e18f(0x172)+_0x4ba7ed));if(_0x177eb8){const _0x332507=_0x10a184?'\x20--profile\x20'+_0x10a184:'';console[_0x17e18f(0x171)]('\x0a'+a14_0x488373[_0x17e18f(0x17b)]('To\x20set\x20up\x20authentication:')),console[_0x17e18f(0x171)]('\x20\x20'+a14_0x488373[_0x17e18f(0x182)](_0x17e18f(0x15f)+_0x332507)+'\x0a'),console[_0x17e18f(0x171)](''+a14_0x488373[_0x17e18f(0x17b)](_0x17e18f(0x155))),console[_0x17e18f(0x171)]('\x20\x20'+a14_0x488373[_0x17e18f(0x182)](_0x17e18f(0x156)+_0x332507));}}export class BaseCommand{[a14_0x2da86d(0x178)](_0xde0533){const _0x4b80d6=a14_0x2da86d,{options:_0x47233d}=_0xde0533,_0x5d8dce=_0x47233d[_0x4b80d6(0x168)];if(_0x5d8dce!==undefined){const _0x2353c0=typeof _0x5d8dce===_0x4b80d6(0x15e)?_0x5d8dce:parseInt(_0x5d8dce,0xa);if(isNaN(_0x2353c0))return _0x4b80d6(0x16d)+_0x5d8dce+'.\x20Must\x20be\x20a\x20number.';const _0x3358bf=validateLimitOption(_0x2353c0);if(!_0x3358bf[_0x4b80d6(0x16a)])return _0x3358bf['error'];_0xde0533['options']['limit']=_0x3358bf['value'];}return undefined;}['validate'](_0x3205d4){return undefined;}async[a14_0x2da86d(0x16c)](_0x452e80){const _0x52f26a=a14_0x2da86d;try{const _0x10b5b2=this[_0x52f26a(0x178)](_0x452e80);if(_0x10b5b2)return console[_0x52f26a(0x171)]('Error:\x20'+_0x10b5b2),0x1;const _0x4e125a=this['validate'](_0x452e80);if(_0x4e125a){const _0x2a62c1=/^\s*(Usage|Note|Warning|Error):/i[_0x52f26a(0x184)](_0x4e125a);return _0x2a62c1?console['error'](_0x4e125a):console[_0x52f26a(0x171)](_0x52f26a(0x169)+_0x4e125a),0x1;}const _0x3cadcf=await this[_0x52f26a(0x15b)](_0x452e80);return _0x3cadcf??0x0;}catch(_0x1cc9c3){if(_0x1cc9c3 instanceof Error){if(_0x1cc9c3 instanceof HTTPClientError&&_0x1cc9c3[_0x52f26a(0x175)]===0x191){const _0x5527e6=_0x452e80[_0x52f26a(0x15a)][_0x52f26a(0x160)];printAuthError(_0x1cc9c3,!![],_0x5527e6);if(_0x1cc9c3[_0x52f26a(0x154)]){const _0x3f1099=Logger['of'](_0x52f26a(0x157));_0x3f1099['debug'](_0x52f26a(0x167)),_0x3f1099['debug'](_0x1cc9c3[_0x52f26a(0x154)]);}return 0x1;}_0x1cc9c3 instanceof SDKError?printSDKError(_0x1cc9c3):console[_0x52f26a(0x171)](a14_0x488373['red'](_0x52f26a(0x169)+_0x1cc9c3[_0x52f26a(0x165)]));const _0xc4968e=_0x1cc9c3 instanceof SDKError&&_0x1cc9c3[_0x52f26a(0x17a)]===ErrorCategory['USER_ERROR'];_0x1cc9c3[_0x52f26a(0x154)]&&!_0xc4968e&&console[_0x52f26a(0x171)](_0x52f26a(0x164)+_0x1cc9c3[_0x52f26a(0x154)]);}else console[_0x52f26a(0x171)](_0x52f26a(0x169)+String(_0x1cc9c3));return 0x1;}}}function a14_0x215f(_0x3ce3a0,_0x593c2a){_0x3ce3a0=_0x3ce3a0-0x154;const _0xa0baf4=a14_0xa0ba();let _0x215fea=_0xa0baf4[_0x3ce3a0];return _0x215fea;}export class CommandRegistry{[a14_0x2da86d(0x174)]=new Map();[a14_0x2da86d(0x181)](_0x4bd34b){const _0x388f9f=a14_0x2da86d;if(this[_0x388f9f(0x174)][_0x388f9f(0x17f)](_0x4bd34b[_0x388f9f(0x186)]))throw new Error('Command\x20\x27'+_0x4bd34b[_0x388f9f(0x186)]+'\x27\x20is\x20already\x20registered');this[_0x388f9f(0x174)][_0x388f9f(0x179)](_0x4bd34b[_0x388f9f(0x186)],_0x4bd34b);}[a14_0x2da86d(0x15d)](_0x3152e2){const _0x3f5f32=a14_0x2da86d;return this['commands'][_0x3f5f32(0x15d)](_0x3152e2);}[a14_0x2da86d(0x158)](){const _0x2199d0=a14_0x2da86d;return Array[_0x2199d0(0x183)](this[_0x2199d0(0x174)][_0x2199d0(0x15c)]());}[a14_0x2da86d(0x17f)](_0x1519df){const _0x114500=a14_0x2da86d;return this[_0x114500(0x174)][_0x114500(0x17f)](_0x1519df);}}function a14_0xa0ba(){const _0x4467a3=['error','Reason:\x20','4041027oRmqFS','commands','status','1419824gCLnuv','helpText','validateGlobalOptions','set','category','dim','Authentication\x20failed','\x20\x20→\x20Please\x20contact\x20your\x20admin\x20to\x20request\x20the\x20required\x20permission.','red','has','2273080CdiFua','register','cyan','from','test','problemDetails','name','16XvjYHi','stack','To\x20check\x20your\x20current\x20auth\x20status:','tdx\x20auth','command','getAll','1330Dopinx','options','execute','values','get','number','tdx\x20auth\x20setup','profile','553633vXAgYr','4517862ApNWNS','15EPCQnv','\x0aStack\x20trace:\x0a','message','yellow','Authentication\x20error\x20stack\x20trace:','limit','Error:\x20','isValid','detail','run','Invalid\x20limit\x20value:\x20','2247ZIbcnY','179700UTgtmQ','PERMISSION_DENIED'];a14_0xa0ba=function(){return _0x4467a3;};return a14_0xa0ba();}export const registry=new CommandRegistry();
1
+ const a14_0x45e0d5=a14_0x45d1;(function(_0x3268f1,_0x4fafb4){const _0x1f0c5c=a14_0x45d1,_0x5a3e0e=_0x3268f1();while(!![]){try{const _0x8434f9=-parseInt(_0x1f0c5c(0xed))/0x1+-parseInt(_0x1f0c5c(0xf6))/0x2*(parseInt(_0x1f0c5c(0xf5))/0x3)+parseInt(_0x1f0c5c(0xd9))/0x4+-parseInt(_0x1f0c5c(0xea))/0x5+-parseInt(_0x1f0c5c(0xdd))/0x6*(-parseInt(_0x1f0c5c(0xe7))/0x7)+parseInt(_0x1f0c5c(0xf0))/0x8+parseInt(_0x1f0c5c(0xde))/0x9*(parseInt(_0x1f0c5c(0xd6))/0xa);if(_0x8434f9===_0x4fafb4)break;else _0x5a3e0e['push'](_0x5a3e0e['shift']());}catch(_0x5d9735){_0x5a3e0e['push'](_0x5a3e0e['shift']());}}}(a14_0x1f3c,0x8bfb2));import{validateLimitOption}from'../utils/option-validation.js';function a14_0x1f3c(){const _0x190a70=['Authentication\x20error\x20stack\x20trace:','number','isValid','values','error','options','Authentication\x20failed','250OIaxGQ','message','category','829160YRTViN','status','code','validateGlobalOptions','186jZZKBJ','92403fIvafK','debug','\x20\x20→\x20Please\x20contact\x20your\x20admin\x20to\x20request\x20the\x20required\x20permission.','helpText','commands','problemDetails','stack','\x27\x20is\x20already\x20registered','Error:\x20','202461ZEYSHz','cyan','\x0aStack\x20trace:\x0a','1371715JQTrnF','get','red','512650JLkxiM','Reason:\x20','execute','3418232MxDoUO','Invalid\x20limit\x20value:\x20','limit','yellow','tdx\x20auth\x20setup','641253wvfPgi','4wgYPNU','\x20--profile\x20','value','dim','name','Command\x20\x27','detail','run','register','from','.\x20Must\x20be\x20a\x20number.','has','command'];a14_0x1f3c=function(){return _0x190a70;};return a14_0x1f3c();}import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory,ErrorCode}from'../sdk/errors.js';import{Logger}from'../utils/logger/index.js';import a14_0x1ad512 from'chalk';export function printSDKError(_0x39734a){const _0x49917b=a14_0x45d1;_0x39734a[_0x49917b(0xdb)]===ErrorCode['PERMISSION_DENIED']?(console['error'](a14_0x1ad512[_0x49917b(0xec)](_0x49917b(0xe6)+_0x39734a['message'])),console[_0x49917b(0xd3)](a14_0x1ad512[_0x49917b(0xf9)](_0x49917b(0xe0)))):console['error'](a14_0x1ad512[_0x49917b(0xec)](_0x49917b(0xe6)+_0x39734a[_0x49917b(0xd7)])),_0x39734a[_0x49917b(0xe1)]&&console[_0x49917b(0xd3)](a14_0x1ad512[_0x49917b(0xf3)](_0x39734a['helpText']));}function a14_0x45d1(_0x4d9584,_0x3e97f6){_0x4d9584=_0x4d9584-0xd2;const _0x1f3c08=a14_0x1f3c();let _0x45d193=_0x1f3c08[_0x4d9584];return _0x45d193;}export function printAuthError(_0x31c0bd,_0x372fd7=![],_0x4c697a){const _0x263942=a14_0x45d1,_0x10d9fc=_0x31c0bd[_0x263942(0xe3)]?.[_0x263942(0xfc)]||_0x31c0bd[_0x263942(0xd7)];console[_0x263942(0xd3)](a14_0x1ad512['red'](_0x263942(0xd5))),console[_0x263942(0xd3)](a14_0x1ad512['red'](_0x263942(0xee)+_0x10d9fc));if(_0x372fd7){const _0x40632f=_0x4c697a?_0x263942(0xf7)+_0x4c697a:'';console[_0x263942(0xd3)]('\x0a'+a14_0x1ad512[_0x263942(0xf9)]('To\x20set\x20up\x20authentication:')),console['error']('\x20\x20'+a14_0x1ad512['cyan'](_0x263942(0xf4)+_0x40632f)+'\x0a'),console['error'](''+a14_0x1ad512['dim']('To\x20check\x20your\x20current\x20auth\x20status:')),console[_0x263942(0xd3)]('\x20\x20'+a14_0x1ad512[_0x263942(0xe8)]('tdx\x20auth'+_0x40632f));}}export class BaseCommand{[a14_0x45e0d5(0xdc)](_0x5e96c5){const _0x51f7dd=a14_0x45e0d5,{options:_0x52179f}=_0x5e96c5,_0x362c1d=_0x52179f[_0x51f7dd(0xf2)];if(_0x362c1d!==undefined){const _0x4efc24=typeof _0x362c1d===_0x51f7dd(0x104)?_0x362c1d:parseInt(_0x362c1d,0xa);if(isNaN(_0x4efc24))return _0x51f7dd(0xf1)+_0x362c1d+_0x51f7dd(0x100);const _0x18ac62=validateLimitOption(_0x4efc24);if(!_0x18ac62[_0x51f7dd(0x105)])return _0x18ac62[_0x51f7dd(0xd3)];_0x5e96c5[_0x51f7dd(0xd4)]['limit']=_0x18ac62[_0x51f7dd(0xf8)];}return undefined;}['validate'](_0x57e401){return undefined;}async[a14_0x45e0d5(0xfd)](_0x5227a4){const _0x133aec=a14_0x45e0d5;try{const _0x1d2a74=this[_0x133aec(0xdc)](_0x5227a4);if(_0x1d2a74)return console[_0x133aec(0xd3)](_0x133aec(0xe6)+_0x1d2a74),0x1;const _0x3c513d=this['validate'](_0x5227a4);if(_0x3c513d){const _0x2f9c09=/^\s*(Usage|Note|Warning|Error):/i['test'](_0x3c513d);return _0x2f9c09?console[_0x133aec(0xd3)](_0x3c513d):console[_0x133aec(0xd3)](_0x133aec(0xe6)+_0x3c513d),0x1;}const _0x8e87b7=await this[_0x133aec(0xef)](_0x5227a4);return _0x8e87b7??0x0;}catch(_0x3a5da6){if(_0x3a5da6 instanceof Error){if(_0x3a5da6 instanceof HTTPClientError&&_0x3a5da6[_0x133aec(0xda)]===0x191){const _0x2ce85a=_0x5227a4[_0x133aec(0xd4)]['profile'];printAuthError(_0x3a5da6,!![],_0x2ce85a);if(_0x3a5da6[_0x133aec(0xe4)]){const _0x304741=Logger['of'](_0x133aec(0x102));_0x304741[_0x133aec(0xdf)](_0x133aec(0x103)),_0x304741[_0x133aec(0xdf)](_0x3a5da6['stack']);}return 0x1;}_0x3a5da6 instanceof SDKError?printSDKError(_0x3a5da6):console[_0x133aec(0xd3)](a14_0x1ad512['red'](_0x133aec(0xe6)+_0x3a5da6[_0x133aec(0xd7)]));const _0x4bd058=_0x3a5da6 instanceof SDKError&&_0x3a5da6[_0x133aec(0xd8)]===ErrorCategory['USER_ERROR'];_0x3a5da6[_0x133aec(0xe4)]&&!_0x4bd058&&console[_0x133aec(0xd3)](_0x133aec(0xe9)+_0x3a5da6['stack']);}else console[_0x133aec(0xd3)](_0x133aec(0xe6)+String(_0x3a5da6));return 0x1;}}}export class CommandRegistry{['commands']=new Map();[a14_0x45e0d5(0xfe)](_0x52fb1d){const _0x1fb908=a14_0x45e0d5;if(this[_0x1fb908(0xe2)][_0x1fb908(0x101)](_0x52fb1d['name']))throw new Error(_0x1fb908(0xfb)+_0x52fb1d['name']+_0x1fb908(0xe5));this['commands']['set'](_0x52fb1d[_0x1fb908(0xfa)],_0x52fb1d);}[a14_0x45e0d5(0xeb)](_0x2635f3){const _0x1207f2=a14_0x45e0d5;return this[_0x1207f2(0xe2)][_0x1207f2(0xeb)](_0x2635f3);}['getAll'](){const _0xc3208a=a14_0x45e0d5;return Array[_0xc3208a(0xff)](this['commands'][_0xc3208a(0xd2)]());}['has'](_0x50a4cc){const _0x3f8cff=a14_0x45e0d5;return this[_0x3f8cff(0xe2)][_0x3f8cff(0x101)](_0x50a4cc);}}export const registry=new CommandRegistry();