@treasuredata/tdx 2026.4.0 → 2026.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x546e2c=a8_0x5f51;(function(_0x18de3f,_0x390c79){const _0x4635ed=a8_0x5f51,_0x4251ea=_0x18de3f();while(!![]){try{const _0x333c9d=parseInt(_0x4635ed(0x1dd))/0x1*(parseInt(_0x4635ed(0x188))/0x2)+parseInt(_0x4635ed(0x1b5))/0x3+-parseInt(_0x4635ed(0x186))/0x4+-parseInt(_0x4635ed(0x1e0))/0x5*(parseInt(_0x4635ed(0x1cc))/0x6)+parseInt(_0x4635ed(0x1bc))/0x7+-parseInt(_0x4635ed(0x187))/0x8+parseInt(_0x4635ed(0x1d4))/0x9*(parseInt(_0x4635ed(0x1b3))/0xa);if(_0x333c9d===_0x390c79)break;else _0x4251ea['push'](_0x4251ea['shift']());}catch(_0x8e7c79){_0x4251ea['push'](_0x4251ea['shift']());}}}(a8_0x464b,0x64997));import{BaseCommand}from'./command.js';function a8_0x464b(){const _0x34f958=['rows','Describe\x20a\x20composable\x20audience','type','cas:pull','dim','data','8173323RYbRVs','yellow','green','diff','Wrote\x20','No\x20composable\x20audience\x20specified.','dryRun','Count:\x20\x20','\x20composable\x20audiences','85VrGZeE','tdx\x20use\x20cas\x20<name>','bold','6355kCAGvB','Would\x20push:\x20','\x20(new)','Attributes\x20(','count','cas','name','cyan','list','(dry\x20run\x20—\x20no\x20files\x20written)','masterKeyColumn','\x20file(s)\x20to\x20','dirname','session','length','All\x20files\x20are\x20up\x20to\x20date.','execute','pull','counts','No\x20composable\x20audiences\x20found.','status','Cancelled.','isNew','activations','\x20(time:\x20','push','cas:list','cwd','underline','\x0a⚠\x20Experimental:\x20CAS\x20push\x20runs\x20in\x20dry-run\x20mode\x20only.\x20Push\x20support\x20is\x20not\x20yet\x20complete.','behaviors','Use\x20','Source:\x20\x20\x20','1739768sIJXUs','5672576uBrPAO','5098bELMXp','names','map','attributes','\x20audience(s)','Audience:\x20','Analyzing\x20CAS\x20YAML\x20files...','hasChanges','table','description','files','\x20—\x20','relative','Behaviors\x20(','Error:\x20\x20','content','composable_audience','cas:desc','join','column','relativePath','absolutePath','verbose','\x20activations)','Found\x20','masterSchema','Push\x20YAML\x20files\x20to\x20CAS\x20API','\x20activation(s)','\x27...','success','population','\x20segment(s)','segments','Usage:\x20tdx\x20cas\x20preview\x20<segment_name>\x20[--audience\x20<name>]','Directory\x20not\x20found:\x20','yes','\x0aSample\x20Rows\x20(','\x20=\x20','cas:preview','setPhase','get','tdx\x20cas\x20pull\x20<name>','schema','10LPROLM','error','1866555JYkPKq','audienceName','\x20or\x20set\x20context\x20with\x20','log','Running\x20preview\x20for\x20\x27','tdx\x20cas\x20desc\x20<name>','timeColumn','1750763KDqbuf','composableAudience','No\x20CAS\x20resources\x20found\x20in\x20YAML\x20files.','Pull\x20composable\x20audience\x20to\x20YAML\x20files','basename','red','Status:\x20','preview','toLocaleString','Pulling\x20composable\x20audience\x20\x27','--audience\x20<name>','Preview\x20composable\x20segment\x20query\x20on\x20CDW','tdx\x20cas\x20push\x20<path>','masterTable','Write\x20files?','Fetching\x20composable\x20audiences...','2082HPusHM','utf-8'];a8_0x464b=function(){return _0x34f958;};return a8_0x464b();}import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import a8_0x28861b from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a8_0x47576d from'path';import{confirmKey,isInteractive}from'../utils/prompt.js';import{collectYamlFiles}from'../sdk/cas/push-workflow.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';export class CASListCommand extends BaseCommand{[a8_0x546e2c(0x16b)]=a8_0x546e2c(0x17f);[a8_0x546e2c(0x191)]='List\x20composable\x20audiences';async[a8_0x546e2c(0x175)](_0x135e62){const _0x1bf024=a8_0x546e2c,{options:_0x1320e5,tdx:_0x2f0bf5}=_0x135e62,_0x32d169=await withProgressSpinner(_0x1bf024(0x1cb),()=>_0x2f0bf5['cas'][_0x1bf024(0x16d)](),{'verbose':_0x1320e5[_0x1bf024(0x19e)]}),_0xa1cfff=_0x32d169[_0x1bf024(0x1d3)];if(isStructuredFormat(_0x1320e5))return await handleSDKOutput(_0xa1cfff,_0x1320e5),0x0;if(_0xa1cfff[_0x1bf024(0x173)]===0x0)return console[_0x1bf024(0x1b8)](a8_0x28861b['dim'](_0x1bf024(0x178))),0x0;console[_0x1bf024(0x1b8)](a8_0x28861b[_0x1bf024(0x1d6)](_0x1bf024(0x1a0)+_0xa1cfff[_0x1bf024(0x173)]+_0x1bf024(0x1dc)));for(const _0x4e65f3 of _0xa1cfff){const _0x2d62dc=_0x4e65f3['population']?a8_0x28861b['dim']('\x20('+Number(_0x4e65f3[_0x1bf024(0x1a6)])[_0x1bf024(0x1c4)]()+')'):'',_0x515547=a8_0x28861b[_0x1bf024(0x1d2)]('\x20'+_0x4e65f3[_0x1bf024(0x1a1)]+'.'+_0x4e65f3[_0x1bf024(0x1c9)]);console[_0x1bf024(0x1b8)]('🧊\x20'+_0x4e65f3[_0x1bf024(0x16b)]+_0x2d62dc+_0x515547),_0x4e65f3['description']&&console['log']('\x20\x20'+a8_0x28861b[_0x1bf024(0x1d2)](_0x4e65f3[_0x1bf024(0x191)]));}return 0x0;}}export class CASDescCommand extends BaseCommand{[a8_0x546e2c(0x16b)]=a8_0x546e2c(0x199);[a8_0x546e2c(0x191)]=a8_0x546e2c(0x1cf);async['execute'](_0x4a6228){const _0x129203=a8_0x546e2c,{options:_0x397f17,args:_0x55edeb,tdx:_0x30bd98}=_0x4a6228,_0x259d87=_0x55edeb[0x0]||_0x397f17[_0x129203(0x1bd)];if(!_0x259d87)return console['error'](a8_0x28861b[_0x129203(0x1d5)](_0x129203(0x1d9))),console[_0x129203(0x1b4)](_0x129203(0x184)+a8_0x28861b[_0x129203(0x16c)](_0x129203(0x1ba))+_0x129203(0x1b7)+a8_0x28861b[_0x129203(0x16c)]('tdx\x20use\x20cas\x20<name>')),0x1;const _0x279047=await withProgressSpinner('Fetching\x20audience\x20\x27'+_0x259d87+_0x129203(0x1a4),()=>_0x30bd98[_0x129203(0x16a)][_0x129203(0x1b0)](_0x259d87),{'verbose':_0x397f17['verbose']}),_0x1da3ea=_0x279047[_0x129203(0x1d3)];if(isStructuredFormat(_0x397f17))return await handleSingleObjectOutput(_0x1da3ea,_0x397f17),0x0;console[_0x129203(0x1b8)](a8_0x28861b[_0x129203(0x1df)](_0x1da3ea[_0x129203(0x16b)]));if(_0x1da3ea['description'])console[_0x129203(0x1b8)](a8_0x28861b['dim'](_0x1da3ea[_0x129203(0x191)]));console['log'](),console[_0x129203(0x1b8)](a8_0x28861b[_0x129203(0x181)]('Master\x20Table')),console[_0x129203(0x1b8)]('\x20\x20Schema:\x20'+_0x1da3ea[_0x129203(0x1a1)]),console[_0x129203(0x1b8)]('\x20\x20Table:\x20\x20'+_0x1da3ea[_0x129203(0x1c9)]),console[_0x129203(0x1b8)]('\x20\x20Key:\x20\x20\x20\x20'+_0x1da3ea[_0x129203(0x16f)]),console[_0x129203(0x1b8)]();if(_0x1da3ea['attributes']?.[_0x129203(0x173)]){console[_0x129203(0x1b8)](a8_0x28861b[_0x129203(0x181)](_0x129203(0x168)+_0x1da3ea['attributes']['length']+')'));for(const _0x70c3a7 of _0x1da3ea[_0x129203(0x18b)]){console[_0x129203(0x1b8)]('\x20\x20'+a8_0x28861b['bold'](_0x70c3a7[_0x129203(0x16b)])+_0x129203(0x193)+_0x70c3a7['schema']+'.'+_0x70c3a7[_0x129203(0x190)]+'.'+_0x70c3a7[_0x129203(0x19b)]+'\x20('+a8_0x28861b[_0x129203(0x1d2)](_0x70c3a7[_0x129203(0x1d0)])+')');}console['log']();}if(_0x1da3ea[_0x129203(0x183)]?.[_0x129203(0x173)]){console[_0x129203(0x1b8)](a8_0x28861b['underline'](_0x129203(0x195)+_0x1da3ea['behaviors'][_0x129203(0x173)]+')'));for(const _0x4fff3e of _0x1da3ea[_0x129203(0x183)]){const _0x117b55=_0x4fff3e[_0x129203(0x1bb)]?_0x129203(0x17d)+_0x4fff3e[_0x129203(0x1bb)]+')':'';console['log']('\x20\x20'+a8_0x28861b['bold'](_0x4fff3e['name'])+_0x129203(0x193)+_0x4fff3e[_0x129203(0x1b2)]+'.'+_0x4fff3e[_0x129203(0x190)]+_0x117b55);}}return 0x0;}}export class CASPullCommand extends BaseCommand{['name']=a8_0x546e2c(0x1d1);[a8_0x546e2c(0x191)]=a8_0x546e2c(0x1bf);async['execute'](_0x1db6d4){const _0x66139a=a8_0x546e2c,{options:_0x1bd5a4,args:_0x47a9c6,tdx:_0x3bc068}=_0x1db6d4,_0x2744b1=_0x1bd5a4,_0x2182d3=_0x47a9c6[0x0]||_0x1bd5a4[_0x66139a(0x1bd)];if(!_0x2182d3)return console[_0x66139a(0x1b4)](a8_0x28861b[_0x66139a(0x1d5)](_0x66139a(0x1d9))),console[_0x66139a(0x1b4)](_0x66139a(0x184)+a8_0x28861b[_0x66139a(0x16c)](_0x66139a(0x1b1))+_0x66139a(0x1b7)+a8_0x28861b[_0x66139a(0x16c)](_0x66139a(0x1de))),0x1;const _0x2794a5=_0x2744b1['dir']||a8_0x47576d[_0x66139a(0x19a)](process[_0x66139a(0x180)](),'cas',sanitizeFileName(_0x2182d3)),_0x105138=await withProgressSpinner(_0x66139a(0x1c5)+_0x2182d3+_0x66139a(0x1a4),_0x537ebd=>_0x3bc068[_0x66139a(0x16a)][_0x66139a(0x176)](_0x2182d3,{'targetDir':_0x2794a5,'verbose':_0x2744b1[_0x66139a(0x19e)],'progress':{'update':_0x4bf6a0=>_0x537ebd[_0x66139a(0x1af)](_0x4bf6a0)}}),{'verbose':_0x2744b1[_0x66139a(0x19e)]}),_0x45194d=_0x105138[_0x66139a(0x1d3)],_0xed916a=_0x45194d[_0x66139a(0x192)]['filter'](_0xac66c5=>_0xac66c5['isNew']||_0xac66c5[_0x66139a(0x18f)]);saveSessionContext({'composable_audience':_0x45194d[_0x66139a(0x1b6)]},_0x2744b1[_0x66139a(0x172)]),console['log'](a8_0x28861b[_0x66139a(0x1d6)]('Context\x20set:\x20'+a8_0x28861b['dim'](_0x66139a(0x198))+_0x66139a(0x1ad)+a8_0x28861b[_0x66139a(0x16c)](_0x45194d[_0x66139a(0x1b6)])));if(_0xed916a[_0x66139a(0x173)]===0x0)return console['log'](a8_0x28861b[_0x66139a(0x1d6)](_0x66139a(0x174))),0x0;for(const _0xb086e7 of _0xed916a){if(_0xb086e7[_0x66139a(0x17b)])console['log'](a8_0x28861b[_0x66139a(0x1d6)]('+\x20'+_0xb086e7[_0x66139a(0x19c)]+_0x66139a(0x167)));else _0xb086e7['diff']&&(console[_0x66139a(0x1b8)](a8_0x28861b['yellow']('~\x20'+_0xb086e7[_0x66139a(0x19c)])),console[_0x66139a(0x1b8)](_0xb086e7[_0x66139a(0x1d7)]));}console[_0x66139a(0x1b8)]('\x0a'+_0xed916a['length']+'\x20file(s)\x20to\x20write\x20'+('('+_0x45194d[_0x66139a(0x177)]['segments']+'\x20segments,\x20'+_0x45194d['counts'][_0x66139a(0x17c)]+_0x66139a(0x19f)));if(_0x2744b1[_0x66139a(0x1da)])return console['log'](a8_0x28861b['dim'](_0x66139a(0x16e))),0x0;if(!_0x2744b1[_0x66139a(0x1ab)]&&isInteractive()){const _0x2c229b=await confirmKey(_0x66139a(0x1ca));if(!_0x2c229b)return console[_0x66139a(0x1b8)](a8_0x28861b[_0x66139a(0x1d2)](_0x66139a(0x17a))),0x0;}for(const _0x22d147 of _0xed916a){const _0x243e3a=a8_0x47576d[_0x66139a(0x171)](_0x22d147[_0x66139a(0x19d)]);if(!existsSync(_0x243e3a))mkdirSync(_0x243e3a,{'recursive':!![]});writeFileSync(_0x22d147[_0x66139a(0x19d)],_0x22d147[_0x66139a(0x197)],_0x66139a(0x1cd));}return console[_0x66139a(0x1b8)](a8_0x28861b[_0x66139a(0x1d6)](_0x66139a(0x1d8)+_0xed916a['length']+_0x66139a(0x170)+_0x2794a5)),0x0;}}export class CASPushCommand extends BaseCommand{[a8_0x546e2c(0x16b)]='cas:push';[a8_0x546e2c(0x191)]=a8_0x546e2c(0x1a2);async[a8_0x546e2c(0x175)](_0x527196){const _0x4eeb02=a8_0x546e2c,{options:_0x3b0a06,args:_0x2ff2d1,tdx:_0x3098ef}=_0x527196,_0x261531=_0x3b0a06;let _0x38c1bb=_0x2ff2d1[0x0];!_0x38c1bb&&_0x3b0a06[_0x4eeb02(0x1bd)]&&(_0x38c1bb=a8_0x47576d[_0x4eeb02(0x19a)](process['cwd'](),_0x4eeb02(0x16a),sanitizeFileName(_0x3b0a06[_0x4eeb02(0x1bd)])));if(!_0x38c1bb)return console['error'](a8_0x28861b['yellow']('No\x20composable\x20audience\x20specified.')),console[_0x4eeb02(0x1b4)](_0x4eeb02(0x184)+a8_0x28861b[_0x4eeb02(0x16c)](_0x4eeb02(0x1c8))+_0x4eeb02(0x1b7)+a8_0x28861b[_0x4eeb02(0x16c)](_0x4eeb02(0x1de))),0x1;if(!existsSync(_0x38c1bb))return console[_0x4eeb02(0x1b4)](a8_0x28861b['red'](_0x4eeb02(0x1aa)+_0x38c1bb)),console[_0x4eeb02(0x1b4)](a8_0x28861b[_0x4eeb02(0x1d2)]('Tip:\x20Run\x20`tdx\x20cas\x20pull\x20<name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x18a9d4=_0x3b0a06[_0x4eeb02(0x1bd)]||a8_0x47576d[_0x4eeb02(0x1c0)](_0x38c1bb),_0x29fb95=a8_0x47576d[_0x4eeb02(0x194)](process[_0x4eeb02(0x180)](),_0x38c1bb)||'.';console['log'](_0x4eeb02(0x18d)+a8_0x28861b[_0x4eeb02(0x16c)](_0x18a9d4)),console[_0x4eeb02(0x1b8)](_0x4eeb02(0x185)+a8_0x28861b[_0x4eeb02(0x1d2)](_0x29fb95)),console[_0x4eeb02(0x1b8)](a8_0x28861b[_0x4eeb02(0x1d5)](_0x4eeb02(0x182))),console[_0x4eeb02(0x1b8)]();const _0x4225a9=collectYamlFiles(_0x38c1bb);if(_0x4225a9[_0x4eeb02(0x173)]===0x0)return console[_0x4eeb02(0x1b4)](a8_0x28861b['red']('No\x20YAML\x20files\x20found\x20in:\x20'+_0x38c1bb)),0x1;console[_0x4eeb02(0x1b8)](_0x4eeb02(0x1a0)+_0x4225a9['length']+'\x20YAML\x20file(s)');const _0x54f123=await withProgressSpinner(_0x4eeb02(0x18e),_0x3ee1a2=>_0x3098ef[_0x4eeb02(0x16a)][_0x4eeb02(0x17e)](_0x4225a9,{'dryRun':!![],'verbose':_0x261531[_0x4eeb02(0x19e)],'progress':{'update':_0x1f1ab7=>_0x3ee1a2[_0x4eeb02(0x1af)](_0x1f1ab7)}}),{'verbose':_0x261531[_0x4eeb02(0x19e)]}),_0x1887ac=_0x54f123[_0x4eeb02(0x1d3)],{created:_0x2df2c3}=_0x1887ac,_0x1a8b04=[];if(_0x2df2c3['audiences'])_0x1a8b04[_0x4eeb02(0x17e)](_0x2df2c3['audiences']+_0x4eeb02(0x18c));if(_0x2df2c3[_0x4eeb02(0x1a8)])_0x1a8b04[_0x4eeb02(0x17e)](_0x2df2c3[_0x4eeb02(0x1a8)]+_0x4eeb02(0x1a7));if(_0x2df2c3[_0x4eeb02(0x17c)])_0x1a8b04[_0x4eeb02(0x17e)](_0x2df2c3[_0x4eeb02(0x17c)]+_0x4eeb02(0x1a3));return _0x1a8b04['length']===0x0?console[_0x4eeb02(0x1b8)](a8_0x28861b['dim'](_0x4eeb02(0x1be))):console[_0x4eeb02(0x1b8)](_0x4eeb02(0x1e1)+_0x1a8b04['join'](',\x20')),console[_0x4eeb02(0x1b8)](a8_0x28861b[_0x4eeb02(0x1d2)]('(dry\x20run\x20—\x20push\x20is\x20not\x20yet\x20implemented)')),0x0;}}function a8_0x5f51(_0x32b180,_0x1b72c9){_0x32b180=_0x32b180-0x167;const _0x464bcd=a8_0x464b();let _0x5f514a=_0x464bcd[_0x32b180];return _0x5f514a;}export class CASPreviewCommand extends BaseCommand{[a8_0x546e2c(0x16b)]=a8_0x546e2c(0x1ae);[a8_0x546e2c(0x191)]=a8_0x546e2c(0x1c7);async[a8_0x546e2c(0x175)](_0x5d32c3){const _0x43b8d7=a8_0x546e2c,{options:_0x3e60a4,args:_0x30b421,tdx:_0x4622f1}=_0x5d32c3,_0x1aee61=_0x30b421[0x0],_0x75cdf9=_0x30b421[0x1]||_0x3e60a4['composableAudience'];if(!_0x1aee61)return console['error'](a8_0x28861b['red'](_0x43b8d7(0x1a9))),0x1;if(!_0x75cdf9)return console[_0x43b8d7(0x1b4)](a8_0x28861b['yellow']('Audience\x20name\x20required.')),console[_0x43b8d7(0x1b4)]('Use\x20'+a8_0x28861b[_0x43b8d7(0x16c)](_0x43b8d7(0x1c6))+_0x43b8d7(0x1b7)+a8_0x28861b[_0x43b8d7(0x16c)]('tdx\x20use\x20cas\x20<name>')),0x1;const _0x26edc2=await withProgressSpinner(_0x43b8d7(0x1b9)+_0x1aee61+_0x43b8d7(0x1a4),()=>_0x4622f1[_0x43b8d7(0x16a)][_0x43b8d7(0x1c3)](_0x75cdf9,_0x1aee61),{'verbose':_0x3e60a4[_0x43b8d7(0x19e)]}),{query:_0x394566,customers:_0x40e1c0}=_0x26edc2[_0x43b8d7(0x1d3)];if(isStructuredFormat(_0x3e60a4))return await handleSingleObjectOutput({'query':_0x394566,'customers':_0x40e1c0},_0x3e60a4),0x0;const _0x158073=_0x394566['status']===_0x43b8d7(0x1a5)?a8_0x28861b[_0x43b8d7(0x1d6)]:a8_0x28861b[_0x43b8d7(0x1d5)];console['log'](_0x43b8d7(0x1c2)+_0x158073(_0x394566[_0x43b8d7(0x179)])),console['log'](_0x43b8d7(0x1db)+a8_0x28861b[_0x43b8d7(0x1df)](String(_0x394566[_0x43b8d7(0x169)])));_0x394566['error']&&console[_0x43b8d7(0x1b8)](_0x43b8d7(0x196)+a8_0x28861b[_0x43b8d7(0x1c1)](_0x394566[_0x43b8d7(0x1b4)]));if(_0x40e1c0?.['names']&&_0x40e1c0?.[_0x43b8d7(0x1ce)]){console['log'](a8_0x28861b[_0x43b8d7(0x181)](_0x43b8d7(0x1ac)+_0x40e1c0['rows'][_0x43b8d7(0x173)]+')'));const _0x248a3a=_0x40e1c0[_0x43b8d7(0x1ce)][_0x43b8d7(0x18a)](_0x4a0a07=>{const _0x560046=_0x43b8d7,_0x1997a9={};for(let _0x2faadb=0x0;_0x2faadb<_0x40e1c0['names'][_0x560046(0x173)];_0x2faadb++){_0x1997a9[_0x40e1c0[_0x560046(0x189)][_0x2faadb]]=_0x4a0a07[_0x2faadb];}return _0x1997a9;});await handleSDKOutput(_0x248a3a,_0x3e60a4);}return 0x0;}}
|
|
1
|
+
const a8_0x472286=a8_0x4875;(function(_0x2be727,_0x2dbfe5){const _0x56f922=a8_0x4875,_0x2ccb97=_0x2be727();while(!![]){try{const _0x26d0d6=-parseInt(_0x56f922(0x1b4))/0x1+parseInt(_0x56f922(0x1f5))/0x2+-parseInt(_0x56f922(0x1ff))/0x3*(parseInt(_0x56f922(0x1d8))/0x4)+-parseInt(_0x56f922(0x1c0))/0x5+parseInt(_0x56f922(0x1ba))/0x6+-parseInt(_0x56f922(0x1f2))/0x7+parseInt(_0x56f922(0x1aa))/0x8;if(_0x26d0d6===_0x2dbfe5)break;else _0x2ccb97['push'](_0x2ccb97['shift']());}catch(_0x48d448){_0x2ccb97['push'](_0x2ccb97['shift']());}}}(a8_0x2bf9,0x82732));function a8_0x4875(_0x161897,_0x3c42c8){_0x161897=_0x161897-0x1a1;const _0x2bf9c4=a8_0x2bf9();let _0x4875b6=_0x2bf9c4[_0x161897];return _0x4875b6;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import a8_0x264d0d from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a8_0x5544b6 from'path';import{confirmKey,isInteractive}from'../utils/prompt.js';import{collectYamlFiles}from'../sdk/cas/push-workflow.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';export class CASListCommand extends BaseCommand{[a8_0x472286(0x1e0)]='cas:list';[a8_0x472286(0x1d6)]='List\x20composable\x20audiences';async[a8_0x472286(0x1ab)](_0x1261f3){const _0x315204=a8_0x472286,{options:_0x4d9ab6,tdx:_0x232a33}=_0x1261f3,_0x20ee0c=await withProgressSpinner('Fetching\x20composable\x20audiences...',()=>_0x232a33[_0x315204(0x1cb)]['list'](),{'verbose':_0x4d9ab6['verbose']}),_0x1309df=_0x20ee0c[_0x315204(0x205)];if(isStructuredFormat(_0x4d9ab6))return await handleSDKOutput(_0x1309df,_0x4d9ab6),0x0;if(_0x1309df[_0x315204(0x1da)]===0x0)return console[_0x315204(0x1e5)](a8_0x264d0d[_0x315204(0x203)](_0x315204(0x1c6))),0x0;console[_0x315204(0x1e5)](a8_0x264d0d[_0x315204(0x1cf)]('Found\x20'+_0x1309df[_0x315204(0x1da)]+_0x315204(0x1d5)));for(const _0x5003f5 of _0x1309df){const _0x49474e=_0x5003f5[_0x315204(0x1e6)]?a8_0x264d0d[_0x315204(0x203)]('\x20('+Number(_0x5003f5[_0x315204(0x1e6)])[_0x315204(0x1ae)]()+')'):'',_0x2379f2=a8_0x264d0d[_0x315204(0x203)]('\x20'+_0x5003f5[_0x315204(0x1f7)]+'.'+_0x5003f5[_0x315204(0x1a3)]);console['log'](_0x315204(0x1fc)+_0x5003f5[_0x315204(0x1e0)]+_0x49474e+_0x2379f2),_0x5003f5[_0x315204(0x1d6)]&&console[_0x315204(0x1e5)]('\x20\x20'+a8_0x264d0d[_0x315204(0x203)](_0x5003f5[_0x315204(0x1d6)]));}return 0x0;}}export class CASDescCommand extends BaseCommand{[a8_0x472286(0x1e0)]=a8_0x472286(0x1a5);['description']=a8_0x472286(0x1eb);async['execute'](_0x5ceed4){const _0x1a1c8e=a8_0x472286,{options:_0x201e7d,args:_0x4ad892,tdx:_0x11eefa}=_0x5ceed4,_0x13f647=_0x4ad892[0x0]||_0x201e7d[_0x1a1c8e(0x1c8)];if(!_0x13f647)return console[_0x1a1c8e(0x20b)](a8_0x264d0d['yellow'](_0x1a1c8e(0x1b1))),console[_0x1a1c8e(0x20b)](_0x1a1c8e(0x20a)+a8_0x264d0d[_0x1a1c8e(0x1c4)](_0x1a1c8e(0x1a9))+'\x20or\x20set\x20context\x20with\x20'+a8_0x264d0d[_0x1a1c8e(0x1c4)](_0x1a1c8e(0x1f0))),0x1;const _0x51998d=await withProgressSpinner('Fetching\x20audience\x20\x27'+_0x13f647+_0x1a1c8e(0x1af),()=>_0x11eefa[_0x1a1c8e(0x1cb)][_0x1a1c8e(0x1bc)](_0x13f647),{'verbose':_0x201e7d[_0x1a1c8e(0x216)]}),_0x41c8f3=_0x51998d[_0x1a1c8e(0x205)];if(isStructuredFormat(_0x201e7d))return await handleSingleObjectOutput(_0x41c8f3,_0x201e7d),0x0;console['log'](a8_0x264d0d[_0x1a1c8e(0x1b2)](_0x41c8f3[_0x1a1c8e(0x1e0)]));if(_0x41c8f3[_0x1a1c8e(0x1d6)])console[_0x1a1c8e(0x1e5)](a8_0x264d0d[_0x1a1c8e(0x203)](_0x41c8f3[_0x1a1c8e(0x1d6)]));console['log'](),console['log'](a8_0x264d0d['underline']('Master\x20Table')),console[_0x1a1c8e(0x1e5)](_0x1a1c8e(0x1c7)+_0x41c8f3['masterSchema']),console[_0x1a1c8e(0x1e5)](_0x1a1c8e(0x1e7)+_0x41c8f3[_0x1a1c8e(0x1a3)]),console[_0x1a1c8e(0x1e5)](_0x1a1c8e(0x209)+_0x41c8f3[_0x1a1c8e(0x1b7)]),console[_0x1a1c8e(0x1e5)]();if(_0x41c8f3['attributes']?.['length']){console[_0x1a1c8e(0x1e5)](a8_0x264d0d[_0x1a1c8e(0x1bb)](_0x1a1c8e(0x208)+_0x41c8f3[_0x1a1c8e(0x1e2)][_0x1a1c8e(0x1da)]+')'));for(const _0x2ce1fc of _0x41c8f3[_0x1a1c8e(0x1e2)]){console[_0x1a1c8e(0x1e5)]('\x20\x20'+a8_0x264d0d[_0x1a1c8e(0x1b2)](_0x2ce1fc['name'])+_0x1a1c8e(0x20e)+_0x2ce1fc['schema']+'.'+_0x2ce1fc[_0x1a1c8e(0x1f6)]+'.'+_0x2ce1fc[_0x1a1c8e(0x1e8)]+'\x20('+a8_0x264d0d[_0x1a1c8e(0x203)](_0x2ce1fc[_0x1a1c8e(0x1c1)])+')');}console[_0x1a1c8e(0x1e5)]();}if(_0x41c8f3['behaviors']?.[_0x1a1c8e(0x1da)]){console[_0x1a1c8e(0x1e5)](a8_0x264d0d[_0x1a1c8e(0x1bb)](_0x1a1c8e(0x1ad)+_0x41c8f3[_0x1a1c8e(0x1e4)][_0x1a1c8e(0x1da)]+')'));for(const _0x1e2dc3 of _0x41c8f3[_0x1a1c8e(0x1e4)]){const _0x1110a1=_0x1e2dc3[_0x1a1c8e(0x1fa)]?_0x1a1c8e(0x1e9)+_0x1e2dc3[_0x1a1c8e(0x1fa)]+')':'';console[_0x1a1c8e(0x1e5)]('\x20\x20'+a8_0x264d0d['bold'](_0x1e2dc3[_0x1a1c8e(0x1e0)])+'\x20—\x20'+_0x1e2dc3[_0x1a1c8e(0x1e3)]+'.'+_0x1e2dc3[_0x1a1c8e(0x1f6)]+_0x1110a1);}}return 0x0;}}export class CASPullCommand extends BaseCommand{[a8_0x472286(0x1e0)]=a8_0x472286(0x1c5);[a8_0x472286(0x1d6)]=a8_0x472286(0x1b0);async[a8_0x472286(0x1ab)](_0x394d86){const _0x5ce811=a8_0x472286,{options:_0x45aa79,args:_0x28940c,tdx:_0x1230fa}=_0x394d86,_0x4c86a4=_0x45aa79,_0x3ef5d3=_0x28940c[0x0]||_0x45aa79['composableAudience'];if(!_0x3ef5d3)return console[_0x5ce811(0x20b)](a8_0x264d0d['yellow'](_0x5ce811(0x1b1))),console[_0x5ce811(0x20b)](_0x5ce811(0x20a)+a8_0x264d0d[_0x5ce811(0x1c4)](_0x5ce811(0x1dc))+_0x5ce811(0x1d0)+a8_0x264d0d['cyan'](_0x5ce811(0x1f0))),0x1;const _0x51478a=_0x4c86a4[_0x5ce811(0x1b3)]||a8_0x5544b6[_0x5ce811(0x1bf)](process[_0x5ce811(0x1ec)](),_0x5ce811(0x1cb),sanitizeFileName(_0x3ef5d3)),_0x33c828=await withProgressSpinner(_0x5ce811(0x1dd)+_0x3ef5d3+'\x27...',_0x5d2cf0=>_0x1230fa[_0x5ce811(0x1cb)][_0x5ce811(0x1d7)](_0x3ef5d3,{'targetDir':_0x51478a,'verbose':_0x4c86a4[_0x5ce811(0x216)],'progress':{'update':_0x2ad83c=>_0x5d2cf0[_0x5ce811(0x211)](_0x2ad83c)}}),{'verbose':_0x4c86a4['verbose']}),_0x4be326=_0x33c828['data'],_0x31852d=_0x4be326[_0x5ce811(0x214)][_0x5ce811(0x1bd)](_0x427aa0=>_0x427aa0[_0x5ce811(0x1a2)]||_0x427aa0[_0x5ce811(0x212)]);saveSessionContext({'composable_audience':_0x4be326[_0x5ce811(0x1ce)]},_0x4c86a4['session']),console['log'](a8_0x264d0d[_0x5ce811(0x1cf)]('Context\x20set:\x20'+a8_0x264d0d['dim']('composable_audience')+_0x5ce811(0x1a6)+a8_0x264d0d[_0x5ce811(0x1c4)](_0x4be326[_0x5ce811(0x1ce)])));if(_0x31852d['length']===0x0)return console[_0x5ce811(0x1e5)](a8_0x264d0d[_0x5ce811(0x1cf)](_0x5ce811(0x1fd))),0x0;for(const _0x1bfd4a of _0x31852d){if(_0x1bfd4a[_0x5ce811(0x1a2)])console[_0x5ce811(0x1e5)](a8_0x264d0d[_0x5ce811(0x1cf)]('+\x20'+_0x1bfd4a[_0x5ce811(0x1d4)]+_0x5ce811(0x1c2)));else _0x1bfd4a[_0x5ce811(0x213)]&&(console['log'](a8_0x264d0d['yellow']('~\x20'+_0x1bfd4a[_0x5ce811(0x1d4)])),console[_0x5ce811(0x1e5)](_0x1bfd4a[_0x5ce811(0x213)]));}console['log']('\x0a'+_0x31852d[_0x5ce811(0x1da)]+_0x5ce811(0x1ee)+('('+_0x4be326['counts']['segments']+_0x5ce811(0x1ea)+_0x4be326[_0x5ce811(0x1d2)][_0x5ce811(0x1b8)]+_0x5ce811(0x1de)));if(_0x4c86a4[_0x5ce811(0x210)])return console[_0x5ce811(0x1e5)](a8_0x264d0d[_0x5ce811(0x203)](_0x5ce811(0x1a1))),0x0;if(!_0x4c86a4[_0x5ce811(0x1a7)]&&isInteractive()){const _0x201d5c=await confirmKey(_0x5ce811(0x1f8));if(!_0x201d5c)return console['log'](a8_0x264d0d[_0x5ce811(0x203)](_0x5ce811(0x1f3))),0x0;}for(const _0x5288fd of _0x31852d){const _0x3e6db3=a8_0x5544b6[_0x5ce811(0x202)](_0x5288fd[_0x5ce811(0x1db)]);if(!existsSync(_0x3e6db3))mkdirSync(_0x3e6db3,{'recursive':!![]});writeFileSync(_0x5288fd['absolutePath'],_0x5288fd['content'],'utf-8');}return console[_0x5ce811(0x1e5)](a8_0x264d0d[_0x5ce811(0x1cf)](_0x5ce811(0x200)+_0x31852d[_0x5ce811(0x1da)]+_0x5ce811(0x1fb)+_0x51478a)),0x0;}}export class CASPushCommand extends BaseCommand{[a8_0x472286(0x1e0)]='cas:push';[a8_0x472286(0x1d6)]=a8_0x472286(0x1a4);async[a8_0x472286(0x1ab)](_0x4146a7){const _0x2f39fd=a8_0x472286,{options:_0x5a12b1,args:_0xd47103,tdx:_0x57c20f}=_0x4146a7,_0xedde56=_0x5a12b1;let _0x35e402=_0xd47103[0x0];!_0x35e402&&_0x5a12b1[_0x2f39fd(0x1c8)]&&(_0x35e402=a8_0x5544b6[_0x2f39fd(0x1bf)](process['cwd'](),'cas',sanitizeFileName(_0x5a12b1[_0x2f39fd(0x1c8)])));if(!_0x35e402)return console['error'](a8_0x264d0d[_0x2f39fd(0x1b6)](_0x2f39fd(0x1b1))),console[_0x2f39fd(0x20b)](_0x2f39fd(0x20a)+a8_0x264d0d[_0x2f39fd(0x1c4)](_0x2f39fd(0x1df))+_0x2f39fd(0x1d0)+a8_0x264d0d['cyan'](_0x2f39fd(0x1f0))),0x1;if(!existsSync(_0x35e402))return console['error'](a8_0x264d0d[_0x2f39fd(0x1c3)](_0x2f39fd(0x1f9)+_0x35e402)),console[_0x2f39fd(0x20b)](a8_0x264d0d[_0x2f39fd(0x203)]('Tip:\x20Run\x20`tdx\x20cas\x20pull\x20<name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x2f8617=_0x5a12b1['composableAudience']||a8_0x5544b6[_0x2f39fd(0x1d1)](_0x35e402),_0x12f482=a8_0x5544b6[_0x2f39fd(0x20d)](process[_0x2f39fd(0x1ec)](),_0x35e402)||'.';console['log']('Audience:\x20'+a8_0x264d0d[_0x2f39fd(0x1c4)](_0x2f8617)),console[_0x2f39fd(0x1e5)](_0x2f39fd(0x206)+a8_0x264d0d[_0x2f39fd(0x203)](_0x12f482)),console[_0x2f39fd(0x1e5)](a8_0x264d0d['yellow'](_0x2f39fd(0x1ed))),console[_0x2f39fd(0x1e5)]();const _0x3c6c7c=collectYamlFiles(_0x35e402);if(_0x3c6c7c[_0x2f39fd(0x1da)]===0x0)return console[_0x2f39fd(0x20b)](a8_0x264d0d[_0x2f39fd(0x1c3)]('No\x20YAML\x20files\x20found\x20in:\x20'+_0x35e402)),0x1;console[_0x2f39fd(0x1e5)](_0x2f39fd(0x1f4)+_0x3c6c7c[_0x2f39fd(0x1da)]+'\x20YAML\x20file(s)');const _0x47e1e9=await withProgressSpinner(_0x2f39fd(0x1f1),_0x159cff=>_0x57c20f[_0x2f39fd(0x1cb)][_0x2f39fd(0x215)](_0x3c6c7c,{'dryRun':!![],'verbose':_0xedde56[_0x2f39fd(0x216)],'progress':{'update':_0x494cbc=>_0x159cff[_0x2f39fd(0x211)](_0x494cbc)}}),{'verbose':_0xedde56[_0x2f39fd(0x216)]}),_0x770f24=_0x47e1e9[_0x2f39fd(0x205)],{created:_0x1d3c5a}=_0x770f24,_0x2f1161=[];if(_0x1d3c5a['audiences'])_0x2f1161[_0x2f39fd(0x215)](_0x1d3c5a[_0x2f39fd(0x1ef)]+_0x2f39fd(0x1b9));if(_0x1d3c5a[_0x2f39fd(0x1fe)])_0x2f1161[_0x2f39fd(0x215)](_0x1d3c5a[_0x2f39fd(0x1fe)]+_0x2f39fd(0x1b5));if(_0x1d3c5a[_0x2f39fd(0x1b8)])_0x2f1161[_0x2f39fd(0x215)](_0x1d3c5a[_0x2f39fd(0x1b8)]+_0x2f39fd(0x204));return _0x2f1161[_0x2f39fd(0x1da)]===0x0?console[_0x2f39fd(0x1e5)](a8_0x264d0d[_0x2f39fd(0x203)](_0x2f39fd(0x1ca))):console[_0x2f39fd(0x1e5)](_0x2f39fd(0x1c9)+_0x2f1161[_0x2f39fd(0x1bf)](',\x20')),console['log'](a8_0x264d0d[_0x2f39fd(0x203)]('(dry\x20run\x20—\x20push\x20is\x20not\x20yet\x20implemented)')),0x0;}}export class CASPreviewCommand extends BaseCommand{[a8_0x472286(0x1e0)]=a8_0x472286(0x1a8);[a8_0x472286(0x1d6)]=a8_0x472286(0x207);async[a8_0x472286(0x1ab)](_0x5368b6){const _0x32152e=a8_0x472286,{options:_0x1ba1d3,args:_0x252e60,tdx:_0x107b02}=_0x5368b6,_0x4aa8b8=_0x252e60[0x0],_0x3f015b=_0x252e60[0x1]||_0x1ba1d3[_0x32152e(0x1c8)];if(!_0x4aa8b8)return console[_0x32152e(0x20b)](a8_0x264d0d[_0x32152e(0x1c3)]('Usage:\x20tdx\x20cas\x20preview\x20<segment_name>\x20[--audience\x20<name>]')),0x1;if(!_0x3f015b)return console['error'](a8_0x264d0d[_0x32152e(0x1b6)](_0x32152e(0x1d9))),console['error'](_0x32152e(0x20a)+a8_0x264d0d['cyan']('--audience\x20<name>')+_0x32152e(0x1d0)+a8_0x264d0d[_0x32152e(0x1c4)](_0x32152e(0x1f0))),0x1;const _0x41c4b5=await withProgressSpinner(_0x32152e(0x201)+_0x4aa8b8+_0x32152e(0x1af),()=>_0x107b02['cas'][_0x32152e(0x20c)](_0x3f015b,_0x4aa8b8),{'verbose':_0x1ba1d3[_0x32152e(0x216)]}),{query:_0x38e78b,customers:_0x4423ed}=_0x41c4b5[_0x32152e(0x205)];if(isStructuredFormat(_0x1ba1d3))return await handleSingleObjectOutput({'query':_0x38e78b,'customers':_0x4423ed},_0x1ba1d3),0x0;const _0x3bd9e7=_0x38e78b[_0x32152e(0x1e1)]===_0x32152e(0x1cc)?a8_0x264d0d[_0x32152e(0x1cf)]:a8_0x264d0d[_0x32152e(0x1b6)];console[_0x32152e(0x1e5)]('Status:\x20'+_0x3bd9e7(_0x38e78b[_0x32152e(0x1e1)])),console[_0x32152e(0x1e5)](_0x32152e(0x1be)+a8_0x264d0d[_0x32152e(0x1b2)](String(_0x38e78b[_0x32152e(0x1ac)])));_0x38e78b['error']&&console[_0x32152e(0x1e5)]('Error:\x20\x20'+a8_0x264d0d[_0x32152e(0x1c3)](_0x38e78b[_0x32152e(0x20b)]));if(_0x4423ed?.[_0x32152e(0x1d3)]&&_0x4423ed?.[_0x32152e(0x1cd)]){console[_0x32152e(0x1e5)](a8_0x264d0d[_0x32152e(0x1bb)](_0x32152e(0x20f)+_0x4423ed[_0x32152e(0x1cd)][_0x32152e(0x1da)]+')'));const _0x4119f6=_0x4423ed['rows']['map'](_0x1413d0=>{const _0x1356c4=_0x32152e,_0x7e377d={};for(let _0x265925=0x0;_0x265925<_0x4423ed[_0x1356c4(0x1d3)][_0x1356c4(0x1da)];_0x265925++){_0x7e377d[_0x4423ed[_0x1356c4(0x1d3)][_0x265925]]=_0x1413d0[_0x265925];}return _0x7e377d;});await handleSDKOutput(_0x4119f6,_0x1ba1d3);}return 0x0;}}function a8_0x2bf9(){const _0x4578fd=['absolutePath','tdx\x20cas\x20pull\x20<name>','Pulling\x20composable\x20audience\x20\x27','\x20activations)','tdx\x20cas\x20push\x20<path>','name','status','attributes','schema','behaviors','log','population','\x20\x20Table:\x20\x20','column','\x20(time:\x20','\x20segments,\x20','Describe\x20a\x20composable\x20audience','cwd','\x0a⚠\x20Experimental:\x20CAS\x20push\x20runs\x20in\x20dry-run\x20mode\x20only.\x20Push\x20support\x20is\x20not\x20yet\x20complete.','\x20file(s)\x20to\x20write\x20','audiences','tdx\x20use\x20cas\x20<name>','Analyzing\x20CAS\x20YAML\x20files...','5939234iINQEk','Cancelled.','Found\x20','197968NjIbXY','table','masterSchema','Write\x20files?','Directory\x20not\x20found:\x20','timeColumn','\x20file(s)\x20to\x20','🧊\x20','All\x20files\x20are\x20up\x20to\x20date.','segments','427830DvNrxr','Wrote\x20','Running\x20preview\x20for\x20\x27','dirname','dim','\x20activation(s)','data','Source:\x20\x20\x20','Preview\x20composable\x20segment\x20query\x20on\x20CDW','Attributes\x20(','\x20\x20Key:\x20\x20\x20\x20','Use\x20','error','preview','relative','\x20—\x20','\x0aSample\x20Rows\x20(','dryRun','setPhase','hasChanges','diff','files','push','verbose','(dry\x20run\x20—\x20no\x20files\x20written)','isNew','masterTable','Push\x20YAML\x20files\x20to\x20CAS\x20API','cas:desc','\x20=\x20','yes','cas:preview','tdx\x20cas\x20desc\x20<name>','16748344aaYdxP','execute','count','Behaviors\x20(','toLocaleString','\x27...','Pull\x20composable\x20audience\x20to\x20YAML\x20files','No\x20composable\x20audience\x20specified.','bold','dir','439964BLPfHN','\x20segment(s)','yellow','masterKeyColumn','activations','\x20audience(s)','4824468uJEGpw','underline','get','filter','Count:\x20\x20','join','1590985bfUNZv','type','\x20(new)','red','cyan','cas:pull','No\x20composable\x20audiences\x20found.','\x20\x20Schema:\x20','composableAudience','Would\x20push:\x20','No\x20CAS\x20resources\x20found\x20in\x20YAML\x20files.','cas','success','rows','audienceName','green','\x20or\x20set\x20context\x20with\x20','basename','counts','names','relativePath','\x20composable\x20audiences','description','pull','24pUBQyF','Audience\x20name\x20required.','length'];a8_0x2bf9=function(){return _0x4578fd;};return a8_0x2bf9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a9_0x1e9085=a9_0x3319;(function(_0xc0555b,_0x4e0b35){const _0x2e319f=a9_0x3319,_0x59b597=_0xc0555b();while(!![]){try{const _0x2c016b=parseInt(_0x2e319f(0x1b2))/0x1+parseInt(_0x2e319f(0x1a4))/0x2*(-parseInt(_0x2e319f(0x1a6))/0x3)+parseInt(_0x2e319f(0x198))/0x4*(-parseInt(_0x2e319f(0x1a8))/0x5)+parseInt(_0x2e319f(0x1a3))/0x6*(-parseInt(_0x2e319f(0x1ad))/0x7)+parseInt(_0x2e319f(0x1ae))/0x8+-parseInt(_0x2e319f(0x1b1))/0x9*(-parseInt(_0x2e319f(0x1ab))/0xa)+parseInt(_0x2e319f(0x1a0))/0xb;if(_0x2c016b===_0x4e0b35)break;else _0x59b597['push'](_0x59b597['shift']());}catch(_0x48db3e){_0x59b597['push'](_0x59b597['shift']());}}}(a9_0x554b,0x671f6));function a9_0x3319(_0x125d5e,_0x3122b6){_0x125d5e=_0x125d5e-0x196;const _0x554bc0=a9_0x554b();let _0x33190c=_0x554bc0[_0x125d5e];return _0x33190c;}import{BaseCommand}from'./command.js';function a9_0x554b(){const _0x440d86=['\x20segment','length','469876zGRvmE','data','Usage:\x20tdx\x20cas\x20sg\x20list\x20<audience_name>','6Gcarfd','104502rlFIzC','🎯\x20','6OMsRGE','dim','661610JVALkx','composableAudience','verbose','2170RzVZvG','Fetching\x20segments\x20for\x20\x27','2280117fHFEpM','2588864XpoJKL','description','Or\x20set\x20context:\x20tdx\x20use\x20cas\x20<audience_name>','27288hWTfwb','92999VrRyNl','green','cas:sg:list','name','population','Found\x20','8UsTeLr','error','log','cas','listSegments','List\x20composable\x20segments\x20for\x20an\x20audience'];a9_0x554b=function(){return _0x440d86;};return a9_0x554b();}import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{formatRows}from'../sdk/util/formatters.js';import a9_0x48eabd from'chalk';export class CASSegmentListCommand extends BaseCommand{[a9_0x1e9085(0x1b5)]=a9_0x1e9085(0x1b4);[a9_0x1e9085(0x1af)]=a9_0x1e9085(0x19d);async['execute'](_0x3da15b){const _0x4d900e=a9_0x1e9085,{options:_0x52b991,args:_0x1b75e5,tdx:_0x47e757}=_0x3da15b,_0x556b81=_0x1b75e5[0x0]||_0x52b991[_0x4d900e(0x1a9)];if(!_0x556b81)return console[_0x4d900e(0x199)](a9_0x48eabd['red'](_0x4d900e(0x1a2))),console[_0x4d900e(0x199)](a9_0x48eabd[_0x4d900e(0x1a7)](_0x4d900e(0x1b0))),0x1;const _0x4f589f=await withProgressSpinner(_0x4d900e(0x1ac)+_0x556b81+'\x27...',()=>_0x47e757[_0x4d900e(0x19b)][_0x4d900e(0x19c)](_0x556b81),{'verbose':_0x52b991[_0x4d900e(0x1aa)]}),_0x5c5453=_0x4f589f[_0x4d900e(0x1a1)];if(isStructuredFormat(_0x52b991))return await handleSDKOutput(_0x5c5453,_0x52b991),0x0;console['log'](a9_0x48eabd[_0x4d900e(0x1b3)](_0x4d900e(0x197)+_0x5c5453[_0x4d900e(0x19f)]+_0x4d900e(0x19e)+(_0x5c5453['length']!==0x1?'s':'')));if(_0x5c5453['length']===0x0)return 0x0;for(const _0x286ccd of _0x5c5453){const _0x2595da=_0x286ccd[_0x4d900e(0x196)]!=null?a9_0x48eabd[_0x4d900e(0x1a7)]('\x20('+formatRows(_0x286ccd[_0x4d900e(0x196)])+')'):'';console[_0x4d900e(0x19a)](_0x4d900e(0x1a5)+_0x286ccd[_0x4d900e(0x1b5)]+_0x2595da),_0x286ccd[_0x4d900e(0x1af)]&&console[_0x4d900e(0x19a)]('\x20\x20'+a9_0x48eabd[_0x4d900e(0x1a7)](_0x286ccd[_0x4d900e(0x1af)]));}return 0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a10_0x4f59(_0x51af7e,_0x53eefb){_0x51af7e=_0x51af7e-0xdd;const _0x260230=a10_0x2602();let _0x4f59f8=_0x260230[_0x51af7e];return _0x4f59f8;}function a10_0x2602(){const _0x15739d=['startChat','claude-4.5-haiku','stream','error','content','Using\x20agent\x20from\x20','data','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','22urdtVY','llmProject','targetFunction','session\x20context','chat','targetAgent','530538MkVUbx','stdout','getDefaultAgent','Resolving\x20project\x20\x27','execute','options','targetKnowledgeBase','streamChatJsonl','projectId','Create\x20a\x20new\x20chat\x20session','tool','event','7005ssQQZJ','chatId','context','metadata','\x27\x20not\x20found','5881584ByuwWB','llmAgent','includes','114118GSBfuu','message','log','\x27...','code','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','CHAT_NOT_FOUND','join','agent','functionName','212pMKqXV','name','\x0aError:\x20','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','write','slice','verbose','5337048sCYwgQ','type','agentId','\x20\x20Cause:\x20','Using\x20cached\x20default\x20agent:\x20','stack','llm','tool_result','404','validate','resolveAgentId','site','description','chat-create','8293173NvidAF','Chat\x20session:\x20','streamChat','string','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','1423280QnlyUu','handleChatEvent','225CFTigm','Resolving\x20agent\x20\x27','stringify','getOrCreateDefaultAgent','tool_call','cause','--agent\x20flag'];a10_0x2602=function(){return _0x15739d;};return a10_0x2602();}const a10_0x23564b=a10_0x4f59;(function(_0x212080,_0x4b8505){const _0xb2e91a=a10_0x4f59,_0x3fd18d=_0x212080();while(!![]){try{const _0x4d92db=parseInt(_0xb2e91a(0xef))/0x1*(parseInt(_0xb2e91a(0x125))/0x2)+parseInt(_0xb2e91a(0x12b))/0x3+parseInt(_0xb2e91a(0xf9))/0x4*(parseInt(_0xb2e91a(0xe7))/0x5)+parseInt(_0xb2e91a(0x101))/0x6+parseInt(_0xb2e91a(0x10f))/0x7+parseInt(_0xb2e91a(0xec))/0x8+parseInt(_0xb2e91a(0x116))/0x9*(-parseInt(_0xb2e91a(0x114))/0xa);if(_0x4d92db===_0x4b8505)break;else _0x3fd18d['push'](_0x3fd18d['shift']());}catch(_0x11033a){_0x3fd18d['push'](_0x3fd18d['shift']());}}}(a10_0x2602,0xb8f8a));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 handleSDKError(_0x2b17f8,_0x5d5aea){const _0x43adcf=a10_0x4f59;if(_0x2b17f8 instanceof SDKError)console[_0x43adcf(0x120)]('Error:\x20'+_0x2b17f8[_0x43adcf(0xf0)]),_0x5d5aea[_0x43adcf(0x100)]&&(_0x2b17f8[_0x43adcf(0x11b)]&&console[_0x43adcf(0x120)](_0x43adcf(0x104)+_0x2b17f8['cause']),_0x2b17f8[_0x43adcf(0x106)]&&(console[_0x43adcf(0x120)]('\x0aStack\x20trace:'),console[_0x43adcf(0x120)](_0x2b17f8['stack'])));else throw _0x2b17f8;}async function resolveAgentId(_0x119a6d,_0x1c6466,_0x1e40f8,_0x44d187,_0x4d9952){const _0xa79ef6=a10_0x4f59,_0x53f2cf=_0x1c6466||_0x1e40f8;if(_0x53f2cf){const {projectName:_0x5bb334,agentName:_0x398a51}=parseAgentRef(_0x53f2cf),_0x2161ec=_0x398a51||_0x53f2cf,_0x4644f4=_0x398a51?_0x5bb334:_0x44d187;if(!_0x4644f4)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x4d9952){const _0x400630=_0x1c6466?_0xa79ef6(0x11c):_0xa79ef6(0x128);console['error'](_0xa79ef6(0x122)+_0x400630+':\x20'+_0x4644f4+'/'+_0x2161ec);}const _0x52f76d=await withSpinner(_0xa79ef6(0xde)+_0x4644f4+_0xa79ef6(0xf2),()=>_0x119a6d[_0xa79ef6(0x107)]['resolveProjectId'](_0x4644f4),{'verbose':_0x4d9952}),_0x3dd85=await withSpinner(_0xa79ef6(0x117)+_0x2161ec+_0xa79ef6(0xf2),()=>_0x119a6d['llm'][_0xa79ef6(0x10b)](_0x2161ec,_0x52f76d[_0xa79ef6(0x123)]),{'verbose':_0x4d9952});return _0x3dd85[_0xa79ef6(0x123)];}else{const _0x3c0ed2=_0x119a6d['llm'][_0xa79ef6(0xdd)]();if(_0x3c0ed2)return _0x4d9952&&console[_0xa79ef6(0x120)](_0xa79ef6(0x105)+_0x3c0ed2[_0xa79ef6(0xfa)]),_0x3c0ed2['id'];const _0x2e162c=await withSpinner('Getting\x20default\x20agent...',()=>_0x119a6d[_0xa79ef6(0x107)][_0xa79ef6(0x119)](_0xa79ef6(0x11e),0x0),{'verbose':_0x4d9952});return _0x2e162c[_0xa79ef6(0x123)]['id'];}}export class ChatCommand extends BaseCommand{['name']=a10_0x23564b(0x129);[a10_0x23564b(0x10d)]=a10_0x23564b(0x113);[a10_0x23564b(0x10a)](_0x5ded5c){const _0x4d974c=a10_0x23564b,_0x53b499=_0x5ded5c['args'][_0x4d974c(0xf6)]('\x20');if(!_0x53b499)return _0x4d974c(0xf4);return undefined;}async[a10_0x23564b(0x111)](_0x4009c3,_0x399e0d,_0x40e99c,_0x4e9407,_0x2eba82){const _0x32758a=a10_0x23564b;for await(const _0x10fe4f of _0x4009c3[_0x32758a(0x107)][_0x32758a(0x129)](_0x399e0d,{'agentId':_0x40e99c,'chatId':_0x4e9407})){if(_0x10fe4f[_0x32758a(0x102)]===_0x32758a(0xea)){const _0x1e4047=_0x10fe4f[_0x32758a(0x123)][_0x32758a(0xe8)];saveLastChatId(_0x1e4047),_0x2eba82&&console[_0x32758a(0x120)](_0x32758a(0x110)+_0x1e4047);}else _0x10fe4f[_0x32758a(0x102)]===_0x32758a(0xe6)&&this[_0x32758a(0x115)](_0x10fe4f[_0x32758a(0x123)]);}}async[a10_0x23564b(0xe2)](_0xfceeed,_0xe51a6b,_0x4b7439,_0x9208d1){const _0x28613c=a10_0x23564b,_0x3a3748=_0xfceeed[_0x28613c(0xe9)][_0x28613c(0x10c)];let _0x4a3cea=![];for await(const _0x59a746 of _0xfceeed[_0x28613c(0x107)][_0x28613c(0x129)](_0xe51a6b,{'agentId':_0x4b7439,'chatId':_0x9208d1})){if(_0x59a746[_0x28613c(0x102)]===_0x28613c(0xea)){const _0x5b9cf9=_0x59a746[_0x28613c(0x123)];saveLastChatId(_0x5b9cf9[_0x28613c(0xe8)]);const _0x10f3df=_0x5b9cf9[_0x28613c(0xe3)]&&_0x5b9cf9[_0x28613c(0x103)]?getLLMConversationUrl(_0x3a3748,_0x5b9cf9[_0x28613c(0xe3)],_0x5b9cf9[_0x28613c(0x103)],_0x5b9cf9[_0x28613c(0xe8)]):undefined;console[_0x28613c(0xf1)](JSON[_0x28613c(0x118)]({'type':_0x28613c(0xea),'data':{'chatId':_0x5b9cf9[_0x28613c(0xe8)],'agentId':_0x5b9cf9['agentId'],'consoleUrl':_0x10f3df}})),_0x4a3cea=!![];}else{if(_0x59a746[_0x28613c(0x102)]==='event'){!_0x4a3cea&&_0x9208d1&&(console[_0x28613c(0xf1)](JSON[_0x28613c(0x118)]({'type':_0x28613c(0xea),'data':{'chatId':_0x9208d1}})),_0x4a3cea=!![]);const _0x2e1d61=_0x59a746[_0x28613c(0x123)];if(_0x28613c(0x121)in _0x2e1d61)console[_0x28613c(0xf1)](JSON['stringify']({'type':_0x28613c(0x121),'data':{'content':_0x2e1d61[_0x28613c(0x121)]}}));else{if(_0x28613c(0x11a)in _0x2e1d61){const _0x39dc9d=_0x2e1d61[_0x28613c(0x11a)];console['log'](JSON[_0x28613c(0x118)]({'type':'tool_call','data':{'id':_0x39dc9d['id'],'name':_0x39dc9d[_0x28613c(0xf8)],'target':_0x39dc9d[_0x28613c(0xe1)]?.[_0x28613c(0xfa)]||_0x39dc9d[_0x28613c(0x12a)]?.[_0x28613c(0xfa)]||_0x39dc9d['targetWebSearchTool']?.['name']||_0x39dc9d[_0x28613c(0x127)]}}));}else{if('tool'in _0x2e1d61)console[_0x28613c(0xf1)](JSON[_0x28613c(0x118)]({'type':_0x28613c(0x108),'data':{'id':_0x2e1d61[_0x28613c(0xe5)]['id'],'name':_0x2e1d61['tool'][_0x28613c(0xf8)],'result':typeof _0x2e1d61[_0x28613c(0xe5)][_0x28613c(0x121)]===_0x28613c(0x112)?_0x2e1d61['tool'][_0x28613c(0x121)][_0x28613c(0xff)](0x0,0x1f4):''}}));else _0x28613c(0x120)in _0x2e1d61&&console['log'](JSON[_0x28613c(0x118)]({'type':'error','data':{'error':_0x2e1d61['error']}}));}}}}}console[_0x28613c(0xf1)](JSON[_0x28613c(0x118)]({'type':'done'}));}async[a10_0x23564b(0xdf)](_0x3f4915){const _0x25fd29=a10_0x23564b,{options:_0x118ece,args:_0x14b0cd,tdx:_0x46d2a6}=_0x3f4915,_0x4af556=_0x14b0cd[_0x25fd29(0xf6)]('\x20'),_0x52f7c9=_0x118ece,_0x499674=_0x52f7c9[_0x25fd29(0xf7)],_0x33258c=_0x52f7c9[_0x25fd29(0xed)],_0x5e212b=_0x52f7c9['llmProject'],_0x429747=_0x52f7c9['new'],_0x173af3=_0x52f7c9[_0x25fd29(0xe8)],_0x25a54d=_0x52f7c9[_0x25fd29(0x11f)];if(_0x429747&&_0x173af3)return console[_0x25fd29(0x120)](_0x25fd29(0xfc)),0x1;try{let _0x271612,_0x533aba;if(_0x173af3)_0x533aba=_0x173af3;else!_0x429747&&(_0x533aba=loadLastChatId(),_0x533aba&&_0x118ece[_0x25fd29(0x100)]&&console['error']('Continuing\x20chat:\x20'+_0x533aba));!_0x173af3&&(_0x429747||!_0x533aba)&&(_0x271612=await resolveAgentId(_0x46d2a6,_0x499674,_0x33258c,_0x5e212b,_0x118ece[_0x25fd29(0x100)]));const _0x199fbe=_0x25a54d?(_0x14291c,_0x8cd9a,_0x3db711)=>this['streamChatJsonl'](_0x46d2a6,_0x14291c,_0x8cd9a,_0x3db711):(_0x4047c0,_0x25b77a,_0x46f42a)=>this[_0x25fd29(0x111)](_0x46d2a6,_0x4047c0,_0x25b77a,_0x46f42a,_0x118ece[_0x25fd29(0x100)]);try{await _0x199fbe(_0x4af556,_0x271612,_0x533aba);}catch(_0x462698){const _0x16a461=_0x462698 instanceof SDKError&&_0x462698[_0x25fd29(0xf3)]===ErrorCode[_0x25fd29(0xf5)]||_0x462698 instanceof Error&&_0x462698[_0x25fd29(0xf0)][_0x25fd29(0xee)](_0x25fd29(0x109));if(_0x16a461&&_0x173af3)return console[_0x25fd29(0x120)]('Error:\x20Chat\x20session\x20\x27'+_0x173af3+_0x25fd29(0xeb)),0x1;if(_0x16a461)_0x118ece[_0x25fd29(0x100)]&&console[_0x25fd29(0x120)](_0x25fd29(0xfd)),!_0x271612&&(_0x271612=await resolveAgentId(_0x46d2a6,_0x499674,_0x33258c,_0x5e212b,_0x118ece['verbose'])),await _0x199fbe(_0x4af556,_0x271612,undefined);else throw _0x462698;}return!_0x25a54d&&console[_0x25fd29(0xf1)](),0x0;}catch(_0x4fe459){return console[_0x25fd29(0x120)](),handleSDKError(_0x4fe459,_0x118ece),0x1;}}[a10_0x23564b(0x115)](_0x5f2b30){const _0x368182=a10_0x23564b;if('content'in _0x5f2b30)process[_0x368182(0x12c)][_0x368182(0xfe)](_0x5f2b30['content']);else'error'in _0x5f2b30&&console[_0x368182(0x120)](_0x368182(0xfb)+_0x5f2b30['error']);}}export class ChatCreateCommand extends BaseCommand{[a10_0x23564b(0xfa)]=a10_0x23564b(0x10e);[a10_0x23564b(0x10d)]=a10_0x23564b(0xe4);['validate'](_0x22403f){const _0x58cca1=a10_0x23564b,_0x56651e=_0x22403f[_0x58cca1(0xe0)],_0x2cdb06=_0x56651e[_0x58cca1(0xf7)],_0x238f01=_0x56651e['llmAgent'];if(!_0x2cdb06&&!_0x238f01)return _0x58cca1(0x124);return undefined;}async[a10_0x23564b(0xdf)](_0x220cde){const _0x38a8ec=a10_0x23564b,{options:_0x10bb99,tdx:_0x1c0346}=_0x220cde,_0x1ec0b5=_0x10bb99,_0x3279f0=_0x1ec0b5[_0x38a8ec(0xf7)],_0x24619a=_0x1ec0b5[_0x38a8ec(0xed)],_0x55f9d8=_0x1ec0b5[_0x38a8ec(0x126)];try{const _0x4f34f3=await resolveAgentId(_0x1c0346,_0x3279f0,_0x24619a,_0x55f9d8,_0x10bb99[_0x38a8ec(0x100)]),_0x422430=await _0x1c0346[_0x38a8ec(0x107)][_0x38a8ec(0x11d)](_0x4f34f3);return saveLastChatId(_0x422430['id']),console[_0x38a8ec(0xf1)](JSON[_0x38a8ec(0x118)]({'chatId':_0x422430['id'],'agentId':_0x4f34f3})),0x0;}catch(_0x42888b){return handleSDKError(_0x42888b,_0x10bb99),0x1;}}}
|
|
1
|
+
const a10_0x4bd81e=a10_0x32a0;(function(_0x252705,_0x29a3e7){const _0x56aa27=a10_0x32a0,_0x564693=_0x252705();while(!![]){try{const _0x5597fe=-parseInt(_0x56aa27(0xa3))/0x1*(-parseInt(_0x56aa27(0xe9))/0x2)+-parseInt(_0x56aa27(0xbf))/0x3*(parseInt(_0x56aa27(0xd4))/0x4)+parseInt(_0x56aa27(0x9e))/0x5*(parseInt(_0x56aa27(0xde))/0x6)+-parseInt(_0x56aa27(0xd1))/0x7+-parseInt(_0x56aa27(0xe5))/0x8*(-parseInt(_0x56aa27(0xc0))/0x9)+-parseInt(_0x56aa27(0xe6))/0xa+parseInt(_0x56aa27(0xa0))/0xb;if(_0x5597fe===_0x29a3e7)break;else _0x564693['push'](_0x564693['shift']());}catch(_0x3b85e7){_0x564693['push'](_0x564693['shift']());}}}(a10_0x50f4,0x8805f));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 handleSDKError(_0x373650,_0x4946d5){const _0x237184=a10_0x32a0;if(_0x373650 instanceof SDKError)console[_0x237184(0xa4)](_0x237184(0xcb)+_0x373650[_0x237184(0xca)]),_0x4946d5['verbose']&&(_0x373650[_0x237184(0xbc)]&&console[_0x237184(0xa4)]('\x20\x20Cause:\x20'+_0x373650['cause']),_0x373650[_0x237184(0xa7)]&&(console['error'](_0x237184(0xc2)),console['error'](_0x373650[_0x237184(0xa7)])));else throw _0x373650;}async function resolveAgentId(_0x59685d,_0x5cb0e6,_0x47b979,_0x32edba,_0xdd5ef4){const _0x32911d=a10_0x32a0,_0x7612f2=_0x5cb0e6||_0x47b979;if(_0x7612f2){const {projectName:_0x2fbd7e,agentName:_0x546511}=parseAgentRef(_0x7612f2),_0x594d15=_0x546511||_0x7612f2,_0x432f63=_0x546511?_0x2fbd7e:_0x32edba;if(!_0x432f63)throw new Error(_0x32911d(0xdb));if(_0xdd5ef4){const _0x225582=_0x5cb0e6?_0x32911d(0xe8):_0x32911d(0xec);console[_0x32911d(0xa4)](_0x32911d(0xd0)+_0x225582+':\x20'+_0x432f63+'/'+_0x594d15);}const _0x21b80f=await withSpinner('Resolving\x20project\x20\x27'+_0x432f63+_0x32911d(0xe7),()=>_0x59685d[_0x32911d(0xb9)][_0x32911d(0xc1)](_0x432f63),{'verbose':_0xdd5ef4}),_0x5978d0=await withSpinner(_0x32911d(0x9f)+_0x594d15+_0x32911d(0xe7),()=>_0x59685d['llm'][_0x32911d(0xc8)](_0x594d15,_0x21b80f[_0x32911d(0xa8)]),{'verbose':_0xdd5ef4});return _0x5978d0[_0x32911d(0xa8)];}else{const _0x5be43a=_0x59685d[_0x32911d(0xb9)][_0x32911d(0xcf)]();if(_0x5be43a)return _0xdd5ef4&&console[_0x32911d(0xa4)]('Using\x20cached\x20default\x20agent:\x20'+_0x5be43a[_0x32911d(0xaf)]),_0x5be43a['id'];const _0x5e4dc9=await withSpinner(_0x32911d(0xd9),()=>_0x59685d[_0x32911d(0xb9)][_0x32911d(0xb8)](_0x32911d(0xd8),0x0),{'verbose':_0xdd5ef4});return _0x5e4dc9['data']['id'];}}function a10_0x32a0(_0x1c8b2c,_0x77acb6){_0x1c8b2c=_0x1c8b2c-0x99;const _0x50f42f=a10_0x50f4();let _0x32a0f1=_0x50f42f[_0x1c8b2c];return _0x32a0f1;}export class ChatCommand extends BaseCommand{[a10_0x4bd81e(0xaf)]=a10_0x4bd81e(0xb5);[a10_0x4bd81e(0xb1)]=a10_0x4bd81e(0xc6);[a10_0x4bd81e(0x99)](_0xea598d){const _0x83ec81=a10_0x4bd81e,_0x41cfcb=_0xea598d[_0x83ec81(0x9c)][_0x83ec81(0xcc)]('\x20');if(!_0x41cfcb)return _0x83ec81(0xe4);return undefined;}async[a10_0x4bd81e(0xa9)](_0x1768a9,_0x28751c,_0x30a033,_0x22e0f8,_0x7a6844){const _0xd936cb=a10_0x4bd81e;for await(const _0x252b64 of _0x1768a9[_0xd936cb(0xb9)][_0xd936cb(0xb5)](_0x28751c,{'agentId':_0x30a033,'chatId':_0x22e0f8})){if(_0x252b64[_0xd936cb(0xaa)]===_0xd936cb(0xac)){const _0xb4229a=_0x252b64['data']['chatId'];saveLastChatId(_0xb4229a),_0x7a6844&&console['error']('Chat\x20session:\x20'+_0xb4229a);}else _0x252b64[_0xd936cb(0xaa)]===_0xd936cb(0xa5)&&this[_0xd936cb(0xb3)](_0x252b64[_0xd936cb(0xa8)]);}}async['streamChatJsonl'](_0x2ebe08,_0xc54beb,_0x3065fa,_0x6f51e1){const _0x3038ff=a10_0x4bd81e,_0x1010b9=_0x2ebe08[_0x3038ff(0xdf)][_0x3038ff(0xc5)];let _0x1d6c03=![];for await(const _0x285771 of _0x2ebe08[_0x3038ff(0xb9)][_0x3038ff(0xb5)](_0xc54beb,{'agentId':_0x3065fa,'chatId':_0x6f51e1})){if(_0x285771[_0x3038ff(0xaa)]===_0x3038ff(0xac)){const _0x4ce2fb=_0x285771['data'];saveLastChatId(_0x4ce2fb[_0x3038ff(0xce)]);const _0x566f1d=_0x4ce2fb[_0x3038ff(0xd7)]&&_0x4ce2fb[_0x3038ff(0xd6)]?getLLMConversationUrl(_0x1010b9,_0x4ce2fb[_0x3038ff(0xd7)],_0x4ce2fb[_0x3038ff(0xd6)],_0x4ce2fb['chatId']):undefined;console['log'](JSON[_0x3038ff(0xad)]({'type':_0x3038ff(0xac),'data':{'chatId':_0x4ce2fb['chatId'],'agentId':_0x4ce2fb[_0x3038ff(0xd6)],'consoleUrl':_0x566f1d}})),_0x1d6c03=!![];}else{if(_0x285771[_0x3038ff(0xaa)]===_0x3038ff(0xa5)){!_0x1d6c03&&_0x6f51e1&&(console[_0x3038ff(0xb0)](JSON[_0x3038ff(0xad)]({'type':_0x3038ff(0xac),'data':{'chatId':_0x6f51e1}})),_0x1d6c03=!![]);const _0xa6211f=_0x285771['data'];if('content'in _0xa6211f)console[_0x3038ff(0xb0)](JSON[_0x3038ff(0xad)]({'type':_0x3038ff(0xab),'data':{'content':_0xa6211f[_0x3038ff(0xab)]}}));else{if(_0x3038ff(0xae)in _0xa6211f){const _0x1a4848=_0xa6211f[_0x3038ff(0xae)];console['log'](JSON[_0x3038ff(0xad)]({'type':_0x3038ff(0xae),'data':{'id':_0x1a4848['id'],'name':_0x1a4848['functionName'],'target':_0x1a4848[_0x3038ff(0xe1)]?.[_0x3038ff(0xaf)]||_0x1a4848[_0x3038ff(0xdd)]?.['name']||_0x1a4848[_0x3038ff(0xba)]?.[_0x3038ff(0xaf)]||_0x1a4848[_0x3038ff(0xc9)]}}));}else{if(_0x3038ff(0xcd)in _0xa6211f)console[_0x3038ff(0xb0)](JSON['stringify']({'type':_0x3038ff(0xe0),'data':{'id':_0xa6211f[_0x3038ff(0xcd)]['id'],'name':_0xa6211f['tool'][_0x3038ff(0xc3)],'result':typeof _0xa6211f[_0x3038ff(0xcd)][_0x3038ff(0xab)]===_0x3038ff(0xc7)?_0xa6211f[_0x3038ff(0xcd)]['content'][_0x3038ff(0xbb)](0x0,0x1f4):''}}));else _0x3038ff(0xa4)in _0xa6211f&&console[_0x3038ff(0xb0)](JSON['stringify']({'type':_0x3038ff(0xa4),'data':{'error':_0xa6211f[_0x3038ff(0xa4)]}}));}}}}}console[_0x3038ff(0xb0)](JSON[_0x3038ff(0xad)]({'type':_0x3038ff(0x9d)}));}async[a10_0x4bd81e(0xa6)](_0x3239aa){const _0x1729b3=a10_0x4bd81e,{options:_0x3bf641,args:_0x24bc3f,tdx:_0x5f31e2}=_0x3239aa,_0x518293=_0x24bc3f[_0x1729b3(0xcc)]('\x20'),_0x13fe0f=_0x3bf641,_0x5d7f5f=_0x13fe0f[_0x1729b3(0xb2)],_0x1c665a=_0x13fe0f[_0x1729b3(0xe3)],_0x81bd05=_0x13fe0f[_0x1729b3(0xa2)],_0x39a163=_0x13fe0f[_0x1729b3(0xea)],_0x1cb4da=_0x13fe0f[_0x1729b3(0xce)],_0x1021db=_0x13fe0f[_0x1729b3(0xbd)];if(_0x39a163&&_0x1cb4da)return console[_0x1729b3(0xa4)](_0x1729b3(0xb6)),0x1;try{let _0x206a62,_0x21877a;if(_0x1cb4da)_0x21877a=_0x1cb4da;else!_0x39a163&&(_0x21877a=loadLastChatId(),_0x21877a&&_0x3bf641[_0x1729b3(0xeb)]&&console[_0x1729b3(0xa4)](_0x1729b3(0xb7)+_0x21877a));!_0x1cb4da&&(_0x39a163||!_0x21877a)&&(_0x206a62=await resolveAgentId(_0x5f31e2,_0x5d7f5f,_0x1c665a,_0x81bd05,_0x3bf641['verbose']));const _0x70fb44=_0x1021db?(_0x348b51,_0x49befa,_0x6a4c3b)=>this[_0x1729b3(0x9a)](_0x5f31e2,_0x348b51,_0x49befa,_0x6a4c3b):(_0x3b2ac2,_0x1b4050,_0x5f28ca)=>this[_0x1729b3(0xa9)](_0x5f31e2,_0x3b2ac2,_0x1b4050,_0x5f28ca,_0x3bf641[_0x1729b3(0xeb)]);try{await _0x70fb44(_0x518293,_0x206a62,_0x21877a);}catch(_0x4aea6d){const _0xfe323a=_0x4aea6d instanceof SDKError&&_0x4aea6d['code']===ErrorCode[_0x1729b3(0xbe)]||_0x4aea6d instanceof Error&&_0x4aea6d[_0x1729b3(0xca)][_0x1729b3(0xd5)]('404');if(_0xfe323a&&_0x1cb4da)return console[_0x1729b3(0xa4)](_0x1729b3(0xc4)+_0x1cb4da+_0x1729b3(0xe2)),0x1;if(_0xfe323a)_0x3bf641[_0x1729b3(0xeb)]&&console[_0x1729b3(0xa4)](_0x1729b3(0xd2)),!_0x206a62&&(_0x206a62=await resolveAgentId(_0x5f31e2,_0x5d7f5f,_0x1c665a,_0x81bd05,_0x3bf641[_0x1729b3(0xeb)])),await _0x70fb44(_0x518293,_0x206a62,undefined);else throw _0x4aea6d;}return!_0x1021db&&console[_0x1729b3(0xb0)](),0x0;}catch(_0x51f7b2){return console['error'](),handleSDKError(_0x51f7b2,_0x3bf641),0x1;}}[a10_0x4bd81e(0xb3)](_0x1c6573){const _0x1860b5=a10_0x4bd81e;if('content'in _0x1c6573)process[_0x1860b5(0x9b)][_0x1860b5(0xdc)](_0x1c6573[_0x1860b5(0xab)]);else _0x1860b5(0xa4)in _0x1c6573&&console[_0x1860b5(0xa4)](_0x1860b5(0xa1)+_0x1c6573['error']);}}function a10_0x50f4(){const _0x322f9e=['8784jihgtJ','includes','agentId','projectId','claude-4.5-haiku','Getting\x20default\x20agent...','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','write','targetAgent','18vWTPdw','context','tool_result','targetKnowledgeBase','\x27\x20not\x20found','llmAgent','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','8uCkmog','767800dlIwBu','\x27...','--agent\x20flag','2Ivlvrr','new','verbose','session\x20context','validate','streamChatJsonl','stdout','args','done','1187005jXKdPD','Resolving\x20agent\x20\x27','1818795lCZvHJ','\x0aError:\x20','llmProject','374326TLBwiO','error','event','execute','stack','data','streamChat','type','content','metadata','stringify','tool_call','name','log','description','agent','handleChatEvent','options','chat','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','Continuing\x20chat:\x20','getOrCreateDefaultAgent','llm','targetWebSearchTool','slice','cause','stream','CHAT_NOT_FOUND','1212EXddbd','6360309neIPxU','resolveProjectId','\x0aStack\x20trace:','functionName','Error:\x20Chat\x20session\x20\x27','site','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','string','resolveAgentId','targetFunction','message','Error:\x20','join','tool','chatId','getDefaultAgent','Using\x20agent\x20from\x20','3062220EiTMmH','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','startChat'];a10_0x50f4=function(){return _0x322f9e;};return a10_0x50f4();}export class ChatCreateCommand extends BaseCommand{[a10_0x4bd81e(0xaf)]='chat-create';[a10_0x4bd81e(0xb1)]='Create\x20a\x20new\x20chat\x20session';['validate'](_0x5c9304){const _0x462958=a10_0x4bd81e,_0x4243b6=_0x5c9304[_0x462958(0xb4)],_0x5d08a5=_0x4243b6[_0x462958(0xb2)],_0x3bf338=_0x4243b6['llmAgent'];if(!_0x5d08a5&&!_0x3bf338)return _0x462958(0xda);return undefined;}async[a10_0x4bd81e(0xa6)](_0x23f5d2){const _0x4d02bf=a10_0x4bd81e,{options:_0x46554a,tdx:_0x5d04ec}=_0x23f5d2,_0x14d166=_0x46554a,_0x9f7bbe=_0x14d166[_0x4d02bf(0xb2)],_0x426fc5=_0x14d166['llmAgent'],_0x45b803=_0x14d166['llmProject'];try{const _0x5a50fb=await resolveAgentId(_0x5d04ec,_0x9f7bbe,_0x426fc5,_0x45b803,_0x46554a['verbose']),_0x383007=await _0x5d04ec['llm'][_0x4d02bf(0xd3)](_0x5a50fb);return saveLastChatId(_0x383007['id']),console[_0x4d02bf(0xb0)](JSON[_0x4d02bf(0xad)]({'chatId':_0x383007['id'],'agentId':_0x5a50fb})),0x0;}catch(_0x330f6e){return handleSDKError(_0x330f6e,_0x46554a),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a11_0x34064a=a11_0x731e;(function(_0x25f8e1,_0x34cb40){const _0x25f628=a11_0x731e,_0xc63a26=_0x25f8e1();while(!![]){try{const _0x571924=-parseInt(_0x25f628(0x18f))/0x1*(-parseInt(_0x25f628(0x1b4))/0x2)+-parseInt(_0x25f628(0x187))/0x3*(parseInt(_0x25f628(0x150))/0x4)+parseInt(_0x25f628(0x113))/0x5+parseInt(_0x25f628(0x139))/0x6*(-parseInt(_0x25f628(0x117))/0x7)+parseInt(_0x25f628(0x196))/0x8*(-parseInt(_0x25f628(0x1a8))/0x9)+-parseInt(_0x25f628(0x18b))/0xa+parseInt(_0x25f628(0x17f))/0xb;if(_0x571924===_0x34cb40)break;else _0xc63a26['push'](_0xc63a26['shift']());}catch(_0x139ad5){_0xc63a26['push'](_0xc63a26['shift']());}}}(a11_0xe9c6,0x8309b));import{readFile,writeFile,mkdir,unlink}from'node:fs/promises';import{execFile}from'node:child_process';import{existsSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';import{promisify}from'node:util';function a11_0xe9c6(){const _0x209e3c=['already\x20installed','324506qClnXF','treasure-data','✓\x20Settings\x20configured:\x20.claude/settings.local.json','Failed\x20to\x20install\x20plugin\x20\x27','✓\x20Plugin\x20\x27','green','access_token','proxy','Creating\x20.claude/settings.local.json...','Authentication\x20required\x20for\x20TD\x20LLM\x20Proxy.\x20Run:\x20tdx\x20auth\x20setup','http','http://127.0.0.1:','✓\x20td-skills\x20checked\x20out\x20at\x20','exit','\x27\x20configured','--transport','account_id','fail','toString','join','Failed\x20to\x20update\x20marketplace\x20\x27','\x20→\x20','warn','Failed\x20to\x20launch\x20Claude\x20Code:\x20','description','Command\x20failed\x20(exit\x20','CLAUDE_CODE_NOT_FOUND','verbose','Restored\x20default\x20td-skills\x20marketplace','tdx\x20--profile\x20','toISOString','tdx-cli','td-skills\x20checked\x20out\x20at\x20tag\x20','checkout','72qjWMnV','INTERNAL','CLAUDE_CODE_UNSUPPORTED_VERSION','ENOENT','plugin','git','✓\x20MCP\x20server\x20\x27','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped','workflow-skills','env','✓\x20Marketplace\x20\x27','plugins','parse','user','unshift','logLevel','✓\x20Settings\x20restored:\x20.claude/settings.local.json','major','execute','main','td-skills','settings.local.json','--hard','23936NxxSRv','text','add','close','patch','already\x20exists','cwd','td-docs','pid','name','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','Marketplace\x20\x27','.claude','stringify','apiKey','tdx-skills','ANTHROPIC_BASE_URL','debug','resume','https://github.com/treasure-data/td-skills','profile','Claude\x20Code\x20version\x20','cause','INVALID_ARGUMENT','already\x20configured','\x20already\x20configured','ANTHROPIC_MODEL','Updating\x20marketplace\x20\x27','Initializing...','getLogPath','false','claude','\x27\x20removed','init','Claude\x20Code\x20CLI\x20not\x20found','CLAUDE_CODE_USE_VERTEX','message','\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','minor','data','kill','passThroughServer','stderr','tdx\x20claude\x20statusline','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','✓\x20Claude\x20Code\x20version\x20OK','13473229BZlCtm','\x27:\x20','command','refresh_token','marketplaces','site','statusLine','Failed\x20to\x20configure\x20marketplace\x20\x27','537KulMwv','origin/main','includes','utf-8','3720140hjQWzG','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','oauth','Warning:\x20Failed\x20to\x20configure\x20','8465KCXuZL','stop','match','ANTHROPIC_AUTH_TOKEN','remove','marketplace','start','140584FMESLE','Command\x20output:\x20','expires_at','Starting\x20TD\x20LLM\x20pass-through\x20proxy...','Failed\x20to\x20remove\x20marketplace\x20\x27','✓\x20Logging\x20to\x20','\x27...','Configuring\x20MCP\x20server\x20\x27','code','--version','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','\x20or\x20later.','port','Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20','\x20claude\x20statusline','logger','context','Failed\x20to\x20spawn\x20claude\x20command:\x20','9SHSyri','Command\x20spawn\x20error:\x20','Invalid\x20minimum\x20version\x20format:\x20','CLAUDE_CODE_USE_BEDROCK','error','Checking\x20out\x20td-skills\x20','sql-skills','update','info','TD\x20Docs\x20MCP\x20Server','apikey','tdx-managed-proxy','190mIXSQM','Failed\x20to\x20list\x20marketplaces','✓\x20Logs\x20saved\x20to\x20','--tags','trim','originalSettings','log','continue','.tdx-settings-backup.json','https://docs.treasuredata.com/mcp','2623680nSTSYh','\x27\x20installed','llm-proxy'];a11_0xe9c6=function(){return _0x209e3c;};return a11_0xe9c6();}import a11_0x3b4894 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{resolveReleaseTag}from'../utils/github-releases.js';const execFileAsync=promisify(execFile),MIN_CLAUDE_VERSION='2.0.20',SETTINGS_BACKUP_FILENAME=a11_0x34064a(0x111);function a11_0x731e(_0x4f5fc8,_0x3ce742){_0x4f5fc8=_0x4f5fc8-0x10d;const _0xe9c6f0=a11_0xe9c6();let _0x731e03=_0xe9c6f0[_0x4f5fc8];return _0x731e03;}function isProcessRunning(_0x5c342b){const _0x3b2e0e=a11_0x34064a;try{return process[_0x3b2e0e(0x179)](_0x5c342b,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x3c3b0d,_0x1e79ea){const _0x193566=a11_0x34064a;if(!existsSync(_0x3c3b0d))return;try{const _0x24ff9b=await readFile(_0x3c3b0d,_0x193566(0x18a)),_0x498c6b=JSON[_0x193566(0x145)](_0x24ff9b),_0x51820a=_0x498c6b[_0x193566(0x142)]||{};for(const _0x5e1d04 of['ANTHROPIC_BASE_URL','ANTHROPIC_MODEL',_0x193566(0x192),_0x193566(0x1ab),'CLAUDE_CODE_USE_VERTEX']){_0x1e79ea[_0x5e1d04]!==undefined?_0x51820a[_0x5e1d04]=_0x1e79ea[_0x5e1d04]:delete _0x51820a[_0x5e1d04];}_0x1e79ea[_0x193566(0x185)]!==undefined?_0x498c6b[_0x193566(0x185)]=_0x1e79ea[_0x193566(0x185)]:delete _0x498c6b[_0x193566(0x185)],_0x498c6b[_0x193566(0x142)]=_0x51820a,await writeFile(_0x3c3b0d,JSON[_0x193566(0x15d)](_0x498c6b,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x9bf0ba){try{await unlink(_0x9bf0ba);}catch{}}async function recoverFromStaleBackup(_0x197e85,_0x143fa3){const _0x3c24c2=a11_0x34064a;if(!existsSync(_0x143fa3))return undefined;try{const _0x3c5d89=await readFile(_0x143fa3,_0x3c24c2(0x18a)),_0x52f6c9=JSON['parse'](_0x3c5d89);if(isProcessRunning(_0x52f6c9[_0x3c24c2(0x158)]))return{'liveSessionOriginals':_0x52f6c9[_0x3c24c2(0x10e)]};return await applyOriginalSettings(_0x197e85,_0x52f6c9[_0x3c24c2(0x10e)]),await safeUnlink(_0x143fa3),undefined;}catch{return await safeUnlink(_0x143fa3),undefined;}}function handleInstallationError(_0x6ccd79,_0x33ef23,_0x3afa48,_0x37eaef){const _0x57d14e=a11_0x34064a;errorContains(_0x6ccd79,_0x57d14e(0x155),_0x57d14e(0x116),_0x57d14e(0x168))?(_0x3afa48['text']='✓\x20'+_0x33ef23+_0x57d14e(0x169),_0x37eaef?.['info'](_0x33ef23+_0x57d14e(0x169)),_0x6ccd79 instanceof SDKError&&_0x6ccd79['cause']&&_0x37eaef?.[_0x57d14e(0x161)](_0x57d14e(0x197)+_0x6ccd79[_0x57d14e(0x166)][_0x57d14e(0x174)])):(_0x3afa48[_0x57d14e(0x12d)](_0x57d14e(0x18e)+_0x33ef23),_0x37eaef?.['error'](_0x33ef23+'\x20configuration\x20failed',_0x6ccd79));}export function parseVersion(_0x4b9037){const _0x2975fc=a11_0x34064a,_0x12b886=_0x4b9037[_0x2975fc(0x10d)]()[_0x2975fc(0x191)](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x12b886)return null;return{'major':parseInt(_0x12b886[0x1],0xa),'minor':parseInt(_0x12b886[0x2],0xa),'patch':parseInt(_0x12b886[0x3],0xa)};}export function compareVersions(_0xa61a96,_0x500256){const _0x339d35=a11_0x34064a;if(_0xa61a96[_0x339d35(0x14a)]!==_0x500256[_0x339d35(0x14a)])return _0xa61a96[_0x339d35(0x14a)]-_0x500256[_0x339d35(0x14a)];if(_0xa61a96[_0x339d35(0x177)]!==_0x500256[_0x339d35(0x177)])return _0xa61a96[_0x339d35(0x177)]-_0x500256[_0x339d35(0x177)];return _0xa61a96[_0x339d35(0x154)]-_0x500256['patch'];}async function checkClaudeVersion(_0x17ce7c,_0x599223){const _0x67353a=a11_0x34064a;_0x599223?.[_0x67353a(0x161)](_0x67353a(0x1a3)+_0x17ce7c+')');const _0x365838=await executeClaudeCommand([_0x67353a(0x19f)],undefined,_0x599223),_0x2b8ee1=parseVersion(_0x365838);if(!_0x2b8ee1){_0x599223?.['warn'](_0x67353a(0x15a)+_0x365838);return;}const _0x361c2=_0x2b8ee1[_0x67353a(0x14a)]+'.'+_0x2b8ee1[_0x67353a(0x177)]+'.'+_0x2b8ee1[_0x67353a(0x154)],_0x3ce81b=parseVersion(_0x17ce7c);if(!_0x3ce81b){_0x599223?.['warn'](_0x67353a(0x1aa)+_0x17ce7c);return;}if(compareVersions(_0x2b8ee1,_0x3ce81b)<0x0){_0x599223?.[_0x67353a(0x1ac)](_0x67353a(0x165)+_0x361c2+'\x20is\x20too\x20old\x20(minimum:\x20'+_0x17ce7c+')');throw new SDKError(ErrorCode[_0x67353a(0x13b)],'Claude\x20Code\x20version\x20'+_0x361c2+_0x67353a(0x176)+_0x17ce7c+_0x67353a(0x1a1),undefined,{'helpText':'Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code'});}_0x599223?.['debug']('Claude\x20Code\x20version\x20'+_0x361c2+'\x20meets\x20minimum\x20requirement');}async function executeClaudeCommand(_0x210f6e,_0x216107,_0x153b5d){const _0x442a0d=a11_0x34064a;return _0x153b5d?.['info']('Executing:\x20claude\x20'+_0x210f6e[_0x442a0d(0x12a)]('\x20')),new Promise((_0x513f2b,_0x58baf5)=>{const _0x59d376=_0x442a0d,_0x48c7dc=crossSpawn(_0x59d376(0x16f),_0x210f6e,{'stdio':'pipe'});let _0x2b4569='',_0x1b3d98='';_0x48c7dc['stdout']?.['on'](_0x59d376(0x178),_0x35d521=>{const _0x1ebf0a=_0x59d376;_0x2b4569+=_0x35d521[_0x1ebf0a(0x129)]();}),_0x48c7dc[_0x59d376(0x17b)]?.['on']('data',_0x3bdc50=>{_0x1b3d98+=_0x3bdc50['toString']();}),_0x48c7dc['on']('error',_0x1556fa=>{const _0x2a151d=_0x59d376;_0x1556fa[_0x2a151d(0x19e)]===_0x2a151d(0x13c)?(_0x153b5d?.['error'](_0x2a151d(0x172)),_0x58baf5(new SDKError(ErrorCode[_0x2a151d(0x131)],_0x2a151d(0x172),_0x1556fa,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'}))):(_0x153b5d?.[_0x2a151d(0x1ac)](_0x2a151d(0x1a9)+_0x1556fa[_0x2a151d(0x174)]),_0x58baf5(new SDKError(ErrorCode[_0x2a151d(0x13a)],_0x2a151d(0x1a7)+_0x1556fa[_0x2a151d(0x174)],_0x1556fa)));}),_0x48c7dc['on'](_0x59d376(0x124),_0x56299f=>{const _0x9892bc=_0x59d376;if(_0x56299f===0x0)_0x513f2b(_0x2b4569);else _0x216107?(_0x153b5d?.[_0x9892bc(0x1ac)](_0x9892bc(0x130)+_0x56299f+'):\x20claude\x20'+_0x210f6e['join']('\x20')),_0x58baf5(new SDKError(ErrorCode['INSTALLATION_FAILED'],_0x216107,new Error(_0x1b3d98)))):_0x513f2b('');});});}async function ensureMcpServer(_0x2d088c,_0x68282d,_0x425ee8,_0x38d0d2,_0x235aa9){const _0x38a731=a11_0x34064a;_0x38d0d2['text']=_0x38a731(0x19d)+_0x2d088c+'\x27...',await executeClaudeCommand(['mcp',_0x38a731(0x152),_0x2d088c,_0x68282d,_0x38a731(0x126),_0x425ee8],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0x2d088c+'\x27',_0x235aa9),_0x38d0d2[_0x38a731(0x151)]=_0x38a731(0x13f)+_0x2d088c+'\x27\x20configured';}export const DEFAULT_TD_SKILLS_URL=a11_0x34064a(0x163);export function getTdSkillsRepoUrl(){const _0x1ef6ce=process.env.TDX_TD_SKILLS_REPO;if(_0x1ef6ce)return _0x1ef6ce;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x349c05,_0x1849ba){const _0x2bb94b=a11_0x34064a;try{const _0x2a9987=await executeClaudeCommand([_0x2bb94b(0x13d),_0x2bb94b(0x194),'list'],_0x2bb94b(0x1b5),_0x1849ba);if(!_0x2a9987[_0x2bb94b(0x189)](_0x349c05)){_0x1849ba?.[_0x2bb94b(0x161)](_0x2bb94b(0x15b)+_0x349c05+_0x2bb94b(0x175));return;}await executeClaudeCommand([_0x2bb94b(0x13d),'marketplace',_0x2bb94b(0x193),_0x349c05],'Failed\x20to\x20remove\x20marketplace\x20\x27'+_0x349c05+'\x27',_0x1849ba),_0x1849ba?.['info'](_0x2bb94b(0x15b)+_0x349c05+_0x2bb94b(0x170));}catch(_0x55e814){_0x1849ba?.[_0x2bb94b(0x12d)](_0x2bb94b(0x19a)+_0x349c05+_0x2bb94b(0x180)+_0x55e814);}}async function restoreDefaultTdSkillsMarketplace(_0x25e0b9){const _0x171748=a11_0x34064a;try{await removeMarketplace(_0x171748(0x14d),_0x25e0b9),await executeClaudeCommand([_0x171748(0x13d),'marketplace',_0x171748(0x152),DEFAULT_TD_SKILLS_URL],undefined,_0x25e0b9),_0x25e0b9?.[_0x171748(0x1b0)](_0x171748(0x133));}catch{}}async function ensureMarketplace(_0x4bc100,_0x11bc9e,_0x1b0c95,_0x340400){const _0x40a239=a11_0x34064a;_0x1b0c95[_0x40a239(0x151)]='Configuring\x20marketplace\x20\x27'+_0x4bc100+_0x40a239(0x19c),await executeClaudeCommand([_0x40a239(0x13d),'marketplace',_0x40a239(0x152),_0x11bc9e],_0x40a239(0x186)+_0x4bc100+'\x27',_0x340400),_0x1b0c95['text']='✓\x20Marketplace\x20\x27'+_0x4bc100+_0x40a239(0x125);}async function updateMarketplace(_0x2af9a5,_0x28f0b2,_0x5cf584){const _0x328c52=a11_0x34064a;_0x28f0b2['text']=_0x328c52(0x16b)+_0x2af9a5+'\x27...',await executeClaudeCommand([_0x328c52(0x13d),'marketplace',_0x328c52(0x1af)],_0x328c52(0x12b)+_0x2af9a5+'\x27',_0x5cf584),_0x28f0b2[_0x328c52(0x151)]=_0x328c52(0x143)+_0x2af9a5+'\x27\x20updated';}async function ensurePlugin(_0x3c0e92,_0x2b859d,_0x1b185a,_0x36f61f){const _0x374a1b=a11_0x34064a;_0x1b185a[_0x374a1b(0x151)]='Installing\x20plugin\x20\x27'+_0x3c0e92+_0x374a1b(0x19c),await executeClaudeCommand([_0x374a1b(0x13d),'install',_0x3c0e92+'@'+_0x2b859d],_0x374a1b(0x11a)+_0x3c0e92+'\x27',_0x36f61f),_0x1b185a[_0x374a1b(0x151)]=_0x374a1b(0x11b)+_0x3c0e92+_0x374a1b(0x114);}function getClaudeConfigDir(){return process.env.CLAUDE_CONFIG_DIR||join(homedir(),'.claude');}async function checkoutReleaseTag(_0x266945,_0x35721d,_0x254f4a){const _0x5a2ba1=a11_0x34064a,_0x17c247=join(getClaudeConfigDir(),_0x5a2ba1(0x144),_0x5a2ba1(0x183),'td-skills');if(!existsSync(_0x17c247)){_0x254f4a?.[_0x5a2ba1(0x161)]('td-skills\x20marketplace\x20dir\x20not\x20found,\x20skipping\x20release\x20tag\x20checkout');return;}_0x35721d[_0x5a2ba1(0x151)]=_0x5a2ba1(0x1ad)+_0x266945+'...',await execFileAsync('git',['fetch','origin',_0x5a2ba1(0x1b7),'--force'],{'cwd':_0x17c247});try{await execFileAsync(_0x5a2ba1(0x13e),[_0x5a2ba1(0x138),_0x5a2ba1(0x14c)],{'cwd':_0x17c247});}catch{await execFileAsync(_0x5a2ba1(0x13e),[_0x5a2ba1(0x138),'-b',_0x5a2ba1(0x14c),_0x5a2ba1(0x188)],{'cwd':_0x17c247});}await execFileAsync(_0x5a2ba1(0x13e),['reset',_0x5a2ba1(0x14f),_0x266945],{'cwd':_0x17c247}),_0x35721d[_0x5a2ba1(0x151)]=_0x5a2ba1(0x123)+_0x266945,_0x254f4a?.[_0x5a2ba1(0x1b0)](_0x5a2ba1(0x137)+_0x266945);}async function createClaudeSettings(_0x212530,_0x4a48d5,_0x1bf1ee){const _0x320b47=a11_0x34064a,_0xf908db=join(process[_0x320b47(0x156)](),_0x320b47(0x15c)),_0x3fbe15=join(_0xf908db,_0x320b47(0x14e)),_0x232f03=join(_0xf908db,SETTINGS_BACKUP_FILENAME);await mkdir(_0xf908db,{'recursive':!![]});const _0x16d767=await recoverFromStaleBackup(_0x3fbe15,_0x232f03);let _0x4fccaa;if(_0x16d767)_0x4fccaa=_0x16d767['liveSessionOriginals'];else{let _0x2a9b81={};if(existsSync(_0x3fbe15))try{const _0x5d974a=await readFile(_0x3fbe15,_0x320b47(0x18a));_0x2a9b81=JSON[_0x320b47(0x145)](_0x5d974a);}catch{_0x2a9b81={};}const _0x141889=_0x2a9b81[_0x320b47(0x142)]||{};_0x4fccaa={'ANTHROPIC_BASE_URL':_0x141889[_0x320b47(0x160)],'ANTHROPIC_MODEL':_0x141889[_0x320b47(0x16a)],'ANTHROPIC_AUTH_TOKEN':_0x141889[_0x320b47(0x192)],'CLAUDE_CODE_USE_BEDROCK':_0x141889[_0x320b47(0x1ab)],'CLAUDE_CODE_USE_VERTEX':_0x141889[_0x320b47(0x173)],'statusLine':_0x2a9b81[_0x320b47(0x185)]};const _0x279ab2={'createdAt':new Date()[_0x320b47(0x135)](),'pid':process[_0x320b47(0x158)],'originalSettings':_0x4fccaa};await writeFile(_0x232f03,JSON[_0x320b47(0x15d)](_0x279ab2,null,0x2)+'\x0a');}let _0x410817={};if(existsSync(_0x3fbe15))try{const _0x4dc329=await readFile(_0x3fbe15,_0x320b47(0x18a));_0x410817=JSON[_0x320b47(0x145)](_0x4dc329);}catch{_0x410817={};}const _0x578c96=_0x410817[_0x320b47(0x142)]||{},_0x5925dd={..._0x410817,'env':{..._0x578c96,'ANTHROPIC_BASE_URL':_0x320b47(0x122)+_0x212530,..._0x4a48d5&&{'ANTHROPIC_MODEL':_0x4a48d5},'ANTHROPIC_AUTH_TOKEN':_0x320b47(0x1b3),'CLAUDE_CODE_USE_BEDROCK':'false','CLAUDE_CODE_USE_VERTEX':_0x320b47(0x16e)},'statusLine':{'type':_0x320b47(0x181),'command':_0x1bf1ee?_0x320b47(0x134)+_0x1bf1ee+_0x320b47(0x1a4):_0x320b47(0x17c)}};return await writeFile(_0x3fbe15,JSON[_0x320b47(0x15d)](_0x5925dd,null,0x2)+'\x0a'),_0x4fccaa;}async function restoreClaudeSettings(_0x2df18f){const _0xcf0ad3=a11_0x34064a,_0x1764c6=join(process[_0xcf0ad3(0x156)](),_0xcf0ad3(0x15c)),_0x2057c6=join(_0x1764c6,_0xcf0ad3(0x14e)),_0x661742=join(_0x1764c6,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x2057c6,_0x2df18f);try{if(existsSync(_0x661742)){const _0x38b809=await readFile(_0x661742,_0xcf0ad3(0x18a)),_0x4d78db=JSON[_0xcf0ad3(0x145)](_0x38b809);_0x4d78db[_0xcf0ad3(0x158)]===process[_0xcf0ad3(0x158)]&&await safeUnlink(_0x661742);}}catch{}}export class ClaudeCommand extends BaseCommand{[a11_0x34064a(0x159)]=a11_0x34064a(0x16f);[a11_0x34064a(0x12f)]=a11_0x34064a(0x18c);[a11_0x34064a(0x17a)];['originalSettings'];[a11_0x34064a(0x1a5)];[a11_0x34064a(0x1a2)];async[a11_0x34064a(0x14b)](_0x27fd3a){const _0x16ffcc=a11_0x34064a,{tdx:_0x257ba9,options:_0x28ffa5,args:_0x19bbb8}=_0x27fd3a;let _0x5262fd=![];try{const _0x3e9f43=_0x28ffa5,_0x19fe13=_0x3e9f43[_0x16ffcc(0x11e)]===![],_0x1bcc39=_0x3e9f43[_0x16ffcc(0x110)]===!![],_0x2f3358=_0x3e9f43[_0x16ffcc(0x162)]===!![],_0x45f101=[..._0x19bbb8];if(_0x1bcc39)_0x45f101[_0x16ffcc(0x147)]('-c');else _0x2f3358&&_0x45f101['unshift']('-r');const _0x45fbde=createCommandSpinner(_0x16ffcc(0x16c),{'verbose':_0x28ffa5[_0x16ffcc(0x132)]});_0x45fbde[_0x16ffcc(0x195)]();try{if(!_0x19fe13){const _0x3d64d3=_0x28ffa5[_0x16ffcc(0x164)];try{const _0x1726a9=await _0x257ba9[_0x16ffcc(0x146)]['getCurrent']();_0x1726a9[_0x16ffcc(0x127)]&&writeCachedAccountInfo(_0x28ffa5[_0x16ffcc(0x184)],_0x1726a9[_0x16ffcc(0x127)],_0x3d64d3);}catch{}_0x45fbde[_0x16ffcc(0x151)]='Initializing\x20proxy\x20logger...',this[_0x16ffcc(0x1a5)]=new TDXLogger(_0x28ffa5[_0x16ffcc(0x148)],!![]),await this[_0x16ffcc(0x1a5)][_0x16ffcc(0x171)]();const _0x5e4bbe=this[_0x16ffcc(0x1a5)]['getLogPath']();_0x45fbde[_0x16ffcc(0x151)]=_0x16ffcc(0x19b)+_0x5e4bbe;const _0x750049=getEndpoint(_0x28ffa5[_0x16ffcc(0x184)],_0x16ffcc(0x115));_0x45fbde['text']=_0x16ffcc(0x199);let _0x4be565;const _0x1683a9=await getOAuthTokens(_0x3d64d3);if(_0x1683a9)_0x4be565={'type':_0x16ffcc(0x18d),'accessToken':_0x1683a9[_0x16ffcc(0x11d)],'refreshToken':_0x1683a9[_0x16ffcc(0x182)],'expiresAt':_0x1683a9[_0x16ffcc(0x198)],'consoleUrl':getConsoleUrl(_0x28ffa5[_0x16ffcc(0x184)])};else{if(_0x257ba9[_0x16ffcc(0x1a6)]['apiKey'])_0x4be565={'type':_0x16ffcc(0x1b2),'apiKey':_0x257ba9[_0x16ffcc(0x1a6)][_0x16ffcc(0x15e)]};else throw new SDKError(ErrorCode[_0x16ffcc(0x167)],_0x16ffcc(0x120));}this[_0x16ffcc(0x17a)]=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x750049,'auth':_0x4be565,'logger':this['logger'],'site':_0x28ffa5[_0x16ffcc(0x184)],'profile':_0x3d64d3}),await this[_0x16ffcc(0x17a)][_0x16ffcc(0x195)](),this[_0x16ffcc(0x1a2)]=this['passThroughServer'][_0x16ffcc(0x1a2)],_0x45fbde[_0x16ffcc(0x151)]='✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20'+this[_0x16ffcc(0x1a2)]+_0x16ffcc(0x12c)+_0x750049,_0x45fbde[_0x16ffcc(0x151)]=_0x16ffcc(0x11f),this['originalSettings']=await createClaudeSettings(this[_0x16ffcc(0x1a2)],undefined,_0x3d64d3),_0x45fbde[_0x16ffcc(0x151)]=_0x16ffcc(0x119);}else _0x45fbde[_0x16ffcc(0x151)]=_0x16ffcc(0x17d);try{_0x45fbde['text']='Checking\x20Claude\x20Code\x20version...',await checkClaudeVersion(MIN_CLAUDE_VERSION,this[_0x16ffcc(0x1a5)]),_0x45fbde['text']=_0x16ffcc(0x17e);}catch(_0x1292c3){_0x45fbde[_0x16ffcc(0x128)]('Claude\x20Code\x20version\x20check\x20failed');throw _0x1292c3;}try{await ensureMcpServer(_0x16ffcc(0x157),_0x16ffcc(0x112),_0x16ffcc(0x121),_0x45fbde,this['logger']);}catch(_0x2fed70){handleInstallationError(_0x2fed70,_0x16ffcc(0x1b1),_0x45fbde,this['logger']);}try{const _0x28eb80=getTdSkillsRepoUrl();_0x5262fd=_0x28eb80!==DEFAULT_TD_SKILLS_URL;_0x5262fd&&await removeMarketplace(_0x16ffcc(0x14d),this[_0x16ffcc(0x1a5)]);await ensureMarketplace(_0x16ffcc(0x14d),_0x28eb80,_0x45fbde,this[_0x16ffcc(0x1a5)]),await updateMarketplace(_0x16ffcc(0x14d),_0x45fbde,this[_0x16ffcc(0x1a5)]),await ensurePlugin(_0x16ffcc(0x1ae),_0x16ffcc(0x14d),_0x45fbde,this[_0x16ffcc(0x1a5)]),await ensurePlugin(_0x16ffcc(0x141),'td-skills',_0x45fbde,this[_0x16ffcc(0x1a5)]),await ensurePlugin(_0x16ffcc(0x15f),_0x16ffcc(0x14d),_0x45fbde,this[_0x16ffcc(0x1a5)]);try{const _0x3a1e3c=loadReleaseChannel(),_0x28fb0b=await resolveReleaseTag(_0x3a1e3c,_0x16ffcc(0x118),_0x16ffcc(0x14d),_0x16ffcc(0x136));_0x28fb0b&&await checkoutReleaseTag(_0x28fb0b,_0x45fbde,this[_0x16ffcc(0x1a5)]);}catch(_0x1deab5){this[_0x16ffcc(0x1a5)]?.['warn']('Failed\x20to\x20apply\x20td-skills\x20release\x20channel:\x20'+_0x1deab5);}}catch(_0x2498ba){handleInstallationError(_0x2498ba,'td-skills\x20Plugins',_0x45fbde,this[_0x16ffcc(0x1a5)]);}_0x45fbde[_0x16ffcc(0x190)]();}catch(_0x28a7e7){_0x45fbde['fail']('Setup\x20failed');throw _0x28a7e7;}const _0x4a771c=await findExecutable(_0x16ffcc(0x16f));if(!_0x4a771c)throw new SDKError(ErrorCode['CLAUDE_CODE_NOT_FOUND'],_0x16ffcc(0x172),undefined,{'helpText':_0x16ffcc(0x1a0)});const _0x98b1f2={...process.env};!_0x19fe13&&(_0x98b1f2[_0x16ffcc(0x160)]=_0x16ffcc(0x122)+this['port'],_0x98b1f2['ANTHROPIC_AUTH_TOKEN']='tdx-managed-proxy',_0x98b1f2[_0x16ffcc(0x1ab)]=_0x16ffcc(0x16e),_0x98b1f2[_0x16ffcc(0x173)]=_0x16ffcc(0x16e));const _0x5cf5e7=crossSpawn(_0x4a771c,_0x45f101,{'stdio':'inherit','env':_0x98b1f2}),_0x1cbce8=await new Promise(_0x2b8ef5=>{const _0x57563d=_0x16ffcc;_0x5cf5e7['on'](_0x57563d(0x124),_0x7b6f25=>{_0x2b8ef5(_0x7b6f25||0x0);}),_0x5cf5e7['on']('error',_0x4f19c0=>{const _0x2e76e4=_0x57563d;console['error'](a11_0x3b4894['red'](_0x2e76e4(0x12e)+_0x4f19c0[_0x2e76e4(0x174)])),_0x2b8ef5(0x1);});});_0x5262fd&&await restoreDefaultTdSkillsMarketplace(this[_0x16ffcc(0x1a5)]);this[_0x16ffcc(0x17a)]&&(await this[_0x16ffcc(0x17a)][_0x16ffcc(0x190)](),console[_0x16ffcc(0x10f)](a11_0x3b4894[_0x16ffcc(0x11c)](_0x16ffcc(0x140))));if(this[_0x16ffcc(0x1a5)]){await this['logger']['close']();const _0x56961f=this[_0x16ffcc(0x1a5)][_0x16ffcc(0x16d)]();console[_0x16ffcc(0x10f)](a11_0x3b4894['green'](_0x16ffcc(0x1b6)+_0x56961f));}return this[_0x16ffcc(0x10e)]&&(await restoreClaudeSettings(this[_0x16ffcc(0x10e)]),console['log'](a11_0x3b4894[_0x16ffcc(0x11c)](_0x16ffcc(0x149)))),_0x1cbce8;}catch(_0x504bd9){_0x5262fd&&await restoreDefaultTdSkillsMarketplace(this['logger']);this['passThroughServer']&&await this[_0x16ffcc(0x17a)][_0x16ffcc(0x190)]();this['logger']&&await this[_0x16ffcc(0x1a5)][_0x16ffcc(0x153)]();this['originalSettings']&&await restoreClaudeSettings(this[_0x16ffcc(0x10e)]);throw _0x504bd9;}}}
|
|
1
|
+
const a11_0x9ce262=a11_0x1f6d;(function(_0x562d26,_0x141d93){const _0x30ac56=a11_0x1f6d,_0x48c3e7=_0x562d26();while(!![]){try{const _0x9212b3=parseInt(_0x30ac56(0x135))/0x1*(parseInt(_0x30ac56(0x134))/0x2)+-parseInt(_0x30ac56(0x147))/0x3*(-parseInt(_0x30ac56(0x132))/0x4)+parseInt(_0x30ac56(0x13d))/0x5*(-parseInt(_0x30ac56(0x139))/0x6)+-parseInt(_0x30ac56(0x11d))/0x7*(-parseInt(_0x30ac56(0xe2))/0x8)+parseInt(_0x30ac56(0x133))/0x9+-parseInt(_0x30ac56(0xff))/0xa+-parseInt(_0x30ac56(0x14a))/0xb;if(_0x9212b3===_0x141d93)break;else _0x48c3e7['push'](_0x48c3e7['shift']());}catch(_0x15d606){_0x48c3e7['push'](_0x48c3e7['shift']());}}}(a11_0x41de,0xe8248));import{readFile,writeFile,mkdir,unlink}from'node:fs/promises';import{execFile}from'node:child_process';import{existsSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';import{promisify}from'node:util';import a11_0x15e99e 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{resolveReleaseTag}from'../utils/github-releases.js';const execFileAsync=promisify(execFile),MIN_CLAUDE_VERSION=a11_0x9ce262(0xb9),SETTINGS_BACKUP_FILENAME=a11_0x9ce262(0xe3);function a11_0x41de(){const _0x442d21=['td-skills\x20checked\x20out\x20at\x20tag\x20','Initializing...','Checking\x20Claude\x20Code\x20version...','verbose','install','context','marketplaces','major','6402CKorRT','http://127.0.0.1:','✓\x20td-skills\x20checked\x20out\x20at\x20','11854436jqOcJI','cwd','access_token','oauth','patch','INTERNAL','utf-8','treasure-data','refresh_token','Failed\x20to\x20install\x20plugin\x20\x27','logger','workflow-skills','.claude','already\x20installed','Failed\x20to\x20configure\x20marketplace\x20\x27','plugin','proxy','\x27\x20configured','td-docs','CLAUDE_CODE_USE_VERTEX','log','Failed\x20to\x20spawn\x20claude\x20command:\x20','✓\x20Plugin\x20\x27','2.0.20','fail','--hard','Failed\x20to\x20apply\x20td-skills\x20release\x20channel:\x20','Configuring\x20MCP\x20server\x20\x27','td-skills','toString','minor','statusLine','pipe','main','toISOString','Command\x20output:\x20','getCurrent','CLAUDE_CODE_USE_BEDROCK','ANTHROPIC_MODEL','apikey','port','sql-skills','already\x20exists','originalSettings','name','user','CLAUDE_CODE_UNSUPPORTED_VERSION','execute','includes','logLevel','Claude\x20Code\x20CLI\x20not\x20found','stop','Installing\x20plugin\x20\x27','Restored\x20default\x20td-skills\x20marketplace','add','site','Failed\x20to\x20remove\x20marketplace\x20\x27','Claude\x20Code\x20version\x20','start','getLogPath','remove','✓\x20Logging\x20to\x20','false','...','899816QHRZWA','.tdx-settings-backup.json','td-skills\x20Plugins','unshift','ANTHROPIC_AUTH_TOKEN','data','Launch\x20Claude\x20Code\x20with\x20integrated\x20LLM\x20proxy','settings.local.json','td-skills\x20marketplace\x20dir\x20not\x20found,\x20skipping\x20release\x20tag\x20checkout','info','profile','stringify','inherit','✓\x20Settings\x20configured:\x20.claude/settings.local.json','✓\x20MCP\x20server\x20\x27','join','parse','Failed\x20to\x20update\x20marketplace\x20\x27','update','Executing:\x20claude\x20','claude','tdx-skills','apiKey','tdx\x20--profile\x20','text','already\x20configured','Configuring\x20marketplace\x20\x27','message','✓\x20TD\x20LLM\x20pass-through\x20proxy\x20running\x20on\x20port\x20','7339140NcXZBL','marketplace','✓\x20Marketplace\x20\x27','llm-proxy','CLAUDE_CODE_NOT_FOUND','Invalid\x20minimum\x20version\x20format:\x20','\x20claude\x20statusline','Warning:\x20Failed\x20to\x20configure\x20','Download\x20the\x20latest\x20version\x20from\x20https://claude.com/claude-code','\x20is\x20too\x20old\x20(minimum:\x20','error','Marketplace\x20\x27','https://github.com/treasure-data/td-skills','ENOENT','cause','Checking\x20out\x20td-skills\x20','exit','green','https://docs.treasuredata.com/mcp','fetch','command','warn','close','plugins','\x20does\x20not\x20support\x20required\x20features.\x20Please\x20upgrade\x20to\x20version\x20','--force','Updating\x20marketplace\x20\x27','checkout','Setup\x20failed','\x27\x20removed','21DxDpXV','trim','debug','origin/main','\x20already\x20configured','Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code','account_id','git','Claude\x20Code\x20version\x20check\x20failed','Could\x20not\x20parse\x20Claude\x20Code\x20version\x20from:\x20','\x20→\x20','tdx\x20claude\x20statusline','Skipping\x20TD\x20LLM\x20proxy\x20setup\x20(--no-proxy)','\x20or\x20later.','Authentication\x20required\x20for\x20TD\x20LLM\x20Proxy.\x20Run:\x20tdx\x20auth\x20setup','✓\x20Logs\x20saved\x20to\x20','tdx-managed-proxy','tdx-cli','\x27\x20updated','\x27...','resume','1884QpDHIU','6977547vMfPrB','946394MFHyFk','2TbDHUx','passThroughServer','pid','reset','6LsMOVK','description','\x27:\x20','--version','1508880LjcVzp','env'];a11_0x41de=function(){return _0x442d21;};return a11_0x41de();}function isProcessRunning(_0x575b98){try{return process['kill'](_0x575b98,0x0),!![];}catch{return![];}}async function applyOriginalSettings(_0x18f91c,_0x202cc8){const _0x4c7af1=a11_0x9ce262;if(!existsSync(_0x18f91c))return;try{const _0x2b8edb=await readFile(_0x18f91c,_0x4c7af1(0x150)),_0x535191=JSON[_0x4c7af1(0xf2)](_0x2b8edb),_0x5a7255=_0x535191['env']||{};for(const _0x19ad52 of['ANTHROPIC_BASE_URL','ANTHROPIC_MODEL',_0x4c7af1(0xe6),_0x4c7af1(0xc7),_0x4c7af1(0xb5)]){_0x202cc8[_0x19ad52]!==undefined?_0x5a7255[_0x19ad52]=_0x202cc8[_0x19ad52]:delete _0x5a7255[_0x19ad52];}_0x202cc8[_0x4c7af1(0xc1)]!==undefined?_0x535191['statusLine']=_0x202cc8[_0x4c7af1(0xc1)]:delete _0x535191[_0x4c7af1(0xc1)],_0x535191[_0x4c7af1(0x13e)]=_0x5a7255,await writeFile(_0x18f91c,JSON[_0x4c7af1(0xed)](_0x535191,null,0x2)+'\x0a');}catch{}}async function safeUnlink(_0x2288b4){try{await unlink(_0x2288b4);}catch{}}async function recoverFromStaleBackup(_0x22c2b2,_0x129a7c){const _0x109c66=a11_0x9ce262;if(!existsSync(_0x129a7c))return undefined;try{const _0x404d27=await readFile(_0x129a7c,_0x109c66(0x150)),_0x10c7a5=JSON[_0x109c66(0xf2)](_0x404d27);if(isProcessRunning(_0x10c7a5['pid']))return{'liveSessionOriginals':_0x10c7a5[_0x109c66(0xcd)]};return await applyOriginalSettings(_0x22c2b2,_0x10c7a5[_0x109c66(0xcd)]),await safeUnlink(_0x129a7c),undefined;}catch{return await safeUnlink(_0x129a7c),undefined;}}function handleInstallationError(_0x58ccd8,_0x5457b5,_0x3a05c4,_0x2d6683){const _0x491c5c=a11_0x9ce262;errorContains(_0x58ccd8,_0x491c5c(0xcc),_0x491c5c(0x157),_0x491c5c(0xfb))?(_0x3a05c4[_0x491c5c(0xfa)]='✓\x20'+_0x5457b5+_0x491c5c(0x121),_0x2d6683?.[_0x491c5c(0xeb)](_0x5457b5+_0x491c5c(0x121)),_0x58ccd8 instanceof SDKError&&_0x58ccd8[_0x491c5c(0x10d)]&&_0x2d6683?.[_0x491c5c(0x11f)](_0x491c5c(0xc5)+_0x58ccd8['cause']['message'])):(_0x3a05c4[_0x491c5c(0x114)](_0x491c5c(0x106)+_0x5457b5),_0x2d6683?.[_0x491c5c(0x109)](_0x5457b5+'\x20configuration\x20failed',_0x58ccd8));}export function parseVersion(_0x395e1f){const _0x496f5e=a11_0x9ce262,_0x4582a0=_0x395e1f[_0x496f5e(0x11e)]()['match'](/^v?(\d+)\.(\d+)\.(\d+)/);if(!_0x4582a0)return null;return{'major':parseInt(_0x4582a0[0x1],0xa),'minor':parseInt(_0x4582a0[0x2],0xa),'patch':parseInt(_0x4582a0[0x3],0xa)};}export function compareVersions(_0x1eede4,_0x566e32){const _0x19d16f=a11_0x9ce262;if(_0x1eede4[_0x19d16f(0x146)]!==_0x566e32['major'])return _0x1eede4[_0x19d16f(0x146)]-_0x566e32[_0x19d16f(0x146)];if(_0x1eede4[_0x19d16f(0xc0)]!==_0x566e32[_0x19d16f(0xc0)])return _0x1eede4[_0x19d16f(0xc0)]-_0x566e32['minor'];return _0x1eede4[_0x19d16f(0x14e)]-_0x566e32[_0x19d16f(0x14e)];}async function checkClaudeVersion(_0x56d66f,_0x142d12){const _0x5a642b=a11_0x9ce262;_0x142d12?.['debug']('Checking\x20Claude\x20Code\x20version\x20(minimum\x20required:\x20'+_0x56d66f+')');const _0x13a87d=await executeClaudeCommand([_0x5a642b(0x13c)],undefined,_0x142d12),_0x5b212e=parseVersion(_0x13a87d);if(!_0x5b212e){_0x142d12?.[_0x5a642b(0x114)](_0x5a642b(0x126)+_0x13a87d);return;}const _0x1ac23b=_0x5b212e['major']+'.'+_0x5b212e[_0x5a642b(0xc0)]+'.'+_0x5b212e['patch'],_0x26d9e2=parseVersion(_0x56d66f);if(!_0x26d9e2){_0x142d12?.['warn'](_0x5a642b(0x104)+_0x56d66f);return;}if(compareVersions(_0x5b212e,_0x26d9e2)<0x0){_0x142d12?.[_0x5a642b(0x109)](_0x5a642b(0xdb)+_0x1ac23b+_0x5a642b(0x108)+_0x56d66f+')');throw new SDKError(ErrorCode[_0x5a642b(0xd0)],'Claude\x20Code\x20version\x20'+_0x1ac23b+_0x5a642b(0x117)+_0x56d66f+_0x5a642b(0x12a),undefined,{'helpText':_0x5a642b(0x107)});}_0x142d12?.[_0x5a642b(0x11f)](_0x5a642b(0xdb)+_0x1ac23b+'\x20meets\x20minimum\x20requirement');}async function executeClaudeCommand(_0x4b86fd,_0x5e2486,_0x37ad09){const _0x2a9844=a11_0x9ce262;return _0x37ad09?.[_0x2a9844(0xeb)](_0x2a9844(0xf5)+_0x4b86fd[_0x2a9844(0xf1)]('\x20')),new Promise((_0x4d0254,_0x43eb7b)=>{const _0x20e437=_0x2a9844,_0x357da1=crossSpawn(_0x20e437(0xf6),_0x4b86fd,{'stdio':_0x20e437(0xc2)});let _0x44d1a8='',_0x4401a0='';_0x357da1['stdout']?.['on'](_0x20e437(0xe7),_0x4f18fb=>{const _0x307d20=_0x20e437;_0x44d1a8+=_0x4f18fb[_0x307d20(0xbf)]();}),_0x357da1['stderr']?.['on'](_0x20e437(0xe7),_0x14e759=>{const _0x1cb9b3=_0x20e437;_0x4401a0+=_0x14e759[_0x1cb9b3(0xbf)]();}),_0x357da1['on']('error',_0x3023ed=>{const _0x39fca2=_0x20e437;_0x3023ed['code']===_0x39fca2(0x10c)?(_0x37ad09?.[_0x39fca2(0x109)]('Claude\x20Code\x20CLI\x20not\x20found'),_0x43eb7b(new SDKError(ErrorCode[_0x39fca2(0x103)],_0x39fca2(0xd4),_0x3023ed,{'helpText':'Please\x20install\x20Claude\x20Code\x20from\x20https://claude.com/claude-code'}))):(_0x37ad09?.[_0x39fca2(0x109)]('Command\x20spawn\x20error:\x20'+_0x3023ed[_0x39fca2(0xfd)]),_0x43eb7b(new SDKError(ErrorCode[_0x39fca2(0x14f)],_0x39fca2(0xb7)+_0x3023ed[_0x39fca2(0xfd)],_0x3023ed)));}),_0x357da1['on'](_0x20e437(0x10f),_0x54ed59=>{const _0x490ec1=_0x20e437;if(_0x54ed59===0x0)_0x4d0254(_0x44d1a8);else _0x5e2486?(_0x37ad09?.[_0x490ec1(0x109)]('Command\x20failed\x20(exit\x20'+_0x54ed59+'):\x20claude\x20'+_0x4b86fd[_0x490ec1(0xf1)]('\x20')),_0x43eb7b(new SDKError(ErrorCode['INSTALLATION_FAILED'],_0x5e2486,new Error(_0x4401a0)))):_0x4d0254('');});});}async function ensureMcpServer(_0x2a7364,_0x220c84,_0x2429b9,_0x9adbbb,_0x369eac){const _0x2ab530=a11_0x9ce262;_0x9adbbb[_0x2ab530(0xfa)]=_0x2ab530(0xbd)+_0x2a7364+_0x2ab530(0x130),await executeClaudeCommand(['mcp','add',_0x2a7364,_0x220c84,'--transport',_0x2429b9],'Failed\x20to\x20configure\x20MCP\x20server\x20\x27'+_0x2a7364+'\x27',_0x369eac),_0x9adbbb[_0x2ab530(0xfa)]=_0x2ab530(0xf0)+_0x2a7364+_0x2ab530(0xb3);}export const DEFAULT_TD_SKILLS_URL=a11_0x9ce262(0x10b);export function getTdSkillsRepoUrl(){const _0x2232d1=process.env.TDX_TD_SKILLS_REPO;if(_0x2232d1)return _0x2232d1;return DEFAULT_TD_SKILLS_URL;}async function removeMarketplace(_0x3039b8,_0x1fabec){const _0x1bdbe2=a11_0x9ce262;try{const _0x435f7a=await executeClaudeCommand([_0x1bdbe2(0xb1),_0x1bdbe2(0x100),'list'],'Failed\x20to\x20list\x20marketplaces',_0x1fabec);if(!_0x435f7a[_0x1bdbe2(0xd2)](_0x3039b8)){_0x1fabec?.[_0x1bdbe2(0x11f)](_0x1bdbe2(0x10a)+_0x3039b8+'\x27\x20not\x20found\x20in\x20list,\x20skipping\x20removal');return;}await executeClaudeCommand([_0x1bdbe2(0xb1),_0x1bdbe2(0x100),_0x1bdbe2(0xde),_0x3039b8],_0x1bdbe2(0xda)+_0x3039b8+'\x27',_0x1fabec),_0x1fabec?.['info'](_0x1bdbe2(0x10a)+_0x3039b8+_0x1bdbe2(0x11c));}catch(_0x756856){_0x1fabec?.[_0x1bdbe2(0x114)](_0x1bdbe2(0xda)+_0x3039b8+_0x1bdbe2(0x13b)+_0x756856);}}async function restoreDefaultTdSkillsMarketplace(_0x1dbac1){const _0x58f2f4=a11_0x9ce262;try{await removeMarketplace(_0x58f2f4(0xbe),_0x1dbac1),await executeClaudeCommand([_0x58f2f4(0xb1),_0x58f2f4(0x100),_0x58f2f4(0xd8),DEFAULT_TD_SKILLS_URL],undefined,_0x1dbac1),_0x1dbac1?.[_0x58f2f4(0xeb)](_0x58f2f4(0xd7));}catch{}}async function ensureMarketplace(_0x37b6c5,_0x3c4915,_0x3af2e1,_0x1126f5){const _0x561277=a11_0x9ce262;_0x3af2e1[_0x561277(0xfa)]=_0x561277(0xfc)+_0x37b6c5+_0x561277(0x130),await executeClaudeCommand([_0x561277(0xb1),'marketplace',_0x561277(0xd8),_0x3c4915],_0x561277(0xb0)+_0x37b6c5+'\x27',_0x1126f5),_0x3af2e1[_0x561277(0xfa)]='✓\x20Marketplace\x20\x27'+_0x37b6c5+_0x561277(0xb3);}function a11_0x1f6d(_0x2971c6,_0xd21c9c){_0x2971c6=_0x2971c6-0xb0;const _0x41de1e=a11_0x41de();let _0x1f6dba=_0x41de1e[_0x2971c6];return _0x1f6dba;}async function updateMarketplace(_0x19376c,_0x3e5421,_0xdded07){const _0x324a5e=a11_0x9ce262;_0x3e5421['text']=_0x324a5e(0x119)+_0x19376c+_0x324a5e(0x130),await executeClaudeCommand(['plugin',_0x324a5e(0x100),_0x324a5e(0xf4)],_0x324a5e(0xf3)+_0x19376c+'\x27',_0xdded07),_0x3e5421['text']=_0x324a5e(0x101)+_0x19376c+_0x324a5e(0x12f);}async function ensurePlugin(_0x47d406,_0x32d4e4,_0x581179,_0x2c273a){const _0x3ad4bd=a11_0x9ce262;_0x581179['text']=_0x3ad4bd(0xd6)+_0x47d406+_0x3ad4bd(0x130),await executeClaudeCommand(['plugin',_0x3ad4bd(0x143),_0x47d406+'@'+_0x32d4e4],_0x3ad4bd(0x153)+_0x47d406+'\x27',_0x2c273a),_0x581179['text']=_0x3ad4bd(0xb8)+_0x47d406+'\x27\x20installed';}function getClaudeConfigDir(){const _0x3ec88d=a11_0x9ce262;return process.env.CLAUDE_CONFIG_DIR||join(homedir(),_0x3ec88d(0x156));}async function checkoutReleaseTag(_0xfd76d8,_0x48935d,_0x4b1853){const _0x509eb6=a11_0x9ce262,_0x17ac18=join(getClaudeConfigDir(),_0x509eb6(0x116),_0x509eb6(0x145),'td-skills');if(!existsSync(_0x17ac18)){_0x4b1853?.[_0x509eb6(0x11f)](_0x509eb6(0xea));return;}_0x48935d[_0x509eb6(0xfa)]=_0x509eb6(0x10e)+_0xfd76d8+_0x509eb6(0xe1),await execFileAsync(_0x509eb6(0x124),[_0x509eb6(0x112),'origin','--tags',_0x509eb6(0x118)],{'cwd':_0x17ac18});try{await execFileAsync('git',['checkout',_0x509eb6(0xc3)],{'cwd':_0x17ac18});}catch{await execFileAsync(_0x509eb6(0x124),[_0x509eb6(0x11a),'-b','main',_0x509eb6(0x120)],{'cwd':_0x17ac18});}await execFileAsync(_0x509eb6(0x124),[_0x509eb6(0x138),_0x509eb6(0xbb),_0xfd76d8],{'cwd':_0x17ac18}),_0x48935d['text']=_0x509eb6(0x149)+_0xfd76d8,_0x4b1853?.[_0x509eb6(0xeb)](_0x509eb6(0x13f)+_0xfd76d8);}async function createClaudeSettings(_0x12e429,_0x284edb,_0x2efb78){const _0x35c581=a11_0x9ce262,_0x3b78de=join(process[_0x35c581(0x14b)](),_0x35c581(0x156)),_0x5a2ea5=join(_0x3b78de,'settings.local.json'),_0x2415c9=join(_0x3b78de,SETTINGS_BACKUP_FILENAME);await mkdir(_0x3b78de,{'recursive':!![]});const _0x52968c=await recoverFromStaleBackup(_0x5a2ea5,_0x2415c9);let _0x24e45e;if(_0x52968c)_0x24e45e=_0x52968c['liveSessionOriginals'];else{let _0x912a5a={};if(existsSync(_0x5a2ea5))try{const _0x1c40a3=await readFile(_0x5a2ea5,_0x35c581(0x150));_0x912a5a=JSON[_0x35c581(0xf2)](_0x1c40a3);}catch{_0x912a5a={};}const _0x5918de=_0x912a5a[_0x35c581(0x13e)]||{};_0x24e45e={'ANTHROPIC_BASE_URL':_0x5918de['ANTHROPIC_BASE_URL'],'ANTHROPIC_MODEL':_0x5918de[_0x35c581(0xc8)],'ANTHROPIC_AUTH_TOKEN':_0x5918de[_0x35c581(0xe6)],'CLAUDE_CODE_USE_BEDROCK':_0x5918de['CLAUDE_CODE_USE_BEDROCK'],'CLAUDE_CODE_USE_VERTEX':_0x5918de[_0x35c581(0xb5)],'statusLine':_0x912a5a[_0x35c581(0xc1)]};const _0x223c77={'createdAt':new Date()[_0x35c581(0xc4)](),'pid':process[_0x35c581(0x137)],'originalSettings':_0x24e45e};await writeFile(_0x2415c9,JSON[_0x35c581(0xed)](_0x223c77,null,0x2)+'\x0a');}let _0x29f1d9={};if(existsSync(_0x5a2ea5))try{const _0x257a53=await readFile(_0x5a2ea5,_0x35c581(0x150));_0x29f1d9=JSON['parse'](_0x257a53);}catch{_0x29f1d9={};}const _0x303653=_0x29f1d9[_0x35c581(0x13e)]||{},_0x5c6f65={..._0x29f1d9,'env':{..._0x303653,'ANTHROPIC_BASE_URL':_0x35c581(0x148)+_0x12e429,..._0x284edb&&{'ANTHROPIC_MODEL':_0x284edb},'ANTHROPIC_AUTH_TOKEN':_0x35c581(0x12d),'CLAUDE_CODE_USE_BEDROCK':'false','CLAUDE_CODE_USE_VERTEX':_0x35c581(0xe0)},'statusLine':{'type':_0x35c581(0x113),'command':_0x2efb78?_0x35c581(0xf9)+_0x2efb78+_0x35c581(0x105):_0x35c581(0x128)}};return await writeFile(_0x5a2ea5,JSON[_0x35c581(0xed)](_0x5c6f65,null,0x2)+'\x0a'),_0x24e45e;}async function restoreClaudeSettings(_0x5404dc){const _0x20b69c=a11_0x9ce262,_0x4946c2=join(process[_0x20b69c(0x14b)](),_0x20b69c(0x156)),_0x5e34b0=join(_0x4946c2,_0x20b69c(0xe9)),_0x547f10=join(_0x4946c2,SETTINGS_BACKUP_FILENAME);await applyOriginalSettings(_0x5e34b0,_0x5404dc);try{if(existsSync(_0x547f10)){const _0x4d902c=await readFile(_0x547f10,_0x20b69c(0x150)),_0x5c9855=JSON[_0x20b69c(0xf2)](_0x4d902c);_0x5c9855[_0x20b69c(0x137)]===process[_0x20b69c(0x137)]&&await safeUnlink(_0x547f10);}}catch{}}export class ClaudeCommand extends BaseCommand{[a11_0x9ce262(0xce)]=a11_0x9ce262(0xf6);[a11_0x9ce262(0x13a)]=a11_0x9ce262(0xe8);['passThroughServer'];['originalSettings'];['logger'];[a11_0x9ce262(0xca)];async[a11_0x9ce262(0xd1)](_0x331d0d){const _0x4343d2=a11_0x9ce262,{tdx:_0x581de0,options:_0x11cfdb,args:_0x41f87c}=_0x331d0d;let _0x2248f2=![];try{const _0x589170=_0x11cfdb,_0xf2749c=_0x589170[_0x4343d2(0xb2)]===![],_0x5c296a=_0x589170['continue']===!![],_0xc4117d=_0x589170[_0x4343d2(0x131)]===!![],_0x27732d=[..._0x41f87c];if(_0x5c296a)_0x27732d[_0x4343d2(0xe5)]('-c');else _0xc4117d&&_0x27732d[_0x4343d2(0xe5)]('-r');const _0x16c757=createCommandSpinner(_0x4343d2(0x140),{'verbose':_0x11cfdb[_0x4343d2(0x142)]});_0x16c757[_0x4343d2(0xdc)]();try{if(!_0xf2749c){const _0x5b5be5=_0x11cfdb[_0x4343d2(0xec)];try{const _0x30035a=await _0x581de0[_0x4343d2(0xcf)][_0x4343d2(0xc6)]();_0x30035a['account_id']&&writeCachedAccountInfo(_0x11cfdb[_0x4343d2(0xd9)],_0x30035a[_0x4343d2(0x123)],_0x5b5be5);}catch{}_0x16c757[_0x4343d2(0xfa)]='Initializing\x20proxy\x20logger...',this[_0x4343d2(0x154)]=new TDXLogger(_0x11cfdb[_0x4343d2(0xd3)],!![]),await this[_0x4343d2(0x154)]['init']();const _0x572f07=this[_0x4343d2(0x154)][_0x4343d2(0xdd)]();_0x16c757[_0x4343d2(0xfa)]=_0x4343d2(0xdf)+_0x572f07;const _0x4be543=getEndpoint(_0x11cfdb['site'],_0x4343d2(0x102));_0x16c757[_0x4343d2(0xfa)]='Starting\x20TD\x20LLM\x20pass-through\x20proxy...';let _0x43543d;const _0x312499=await getOAuthTokens(_0x5b5be5);if(_0x312499)_0x43543d={'type':_0x4343d2(0x14d),'accessToken':_0x312499[_0x4343d2(0x14c)],'refreshToken':_0x312499[_0x4343d2(0x152)],'expiresAt':_0x312499['expires_at'],'consoleUrl':getConsoleUrl(_0x11cfdb['site'])};else{if(_0x581de0['context']['apiKey'])_0x43543d={'type':_0x4343d2(0xc9),'apiKey':_0x581de0[_0x4343d2(0x144)][_0x4343d2(0xf8)]};else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4343d2(0x12b));}this[_0x4343d2(0x136)]=new PassThroughProxyServer({'startPort':0xfa0,'llmProxyUrl':_0x4be543,'auth':_0x43543d,'logger':this[_0x4343d2(0x154)],'site':_0x11cfdb[_0x4343d2(0xd9)],'profile':_0x5b5be5}),await this['passThroughServer']['start'](),this[_0x4343d2(0xca)]=this[_0x4343d2(0x136)][_0x4343d2(0xca)],_0x16c757[_0x4343d2(0xfa)]=_0x4343d2(0xfe)+this[_0x4343d2(0xca)]+_0x4343d2(0x127)+_0x4be543,_0x16c757['text']='Creating\x20.claude/settings.local.json...',this[_0x4343d2(0xcd)]=await createClaudeSettings(this[_0x4343d2(0xca)],undefined,_0x5b5be5),_0x16c757['text']=_0x4343d2(0xef);}else _0x16c757[_0x4343d2(0xfa)]=_0x4343d2(0x129);try{_0x16c757[_0x4343d2(0xfa)]=_0x4343d2(0x141),await checkClaudeVersion(MIN_CLAUDE_VERSION,this['logger']),_0x16c757[_0x4343d2(0xfa)]='✓\x20Claude\x20Code\x20version\x20OK';}catch(_0x5d497e){_0x16c757[_0x4343d2(0xba)](_0x4343d2(0x125));throw _0x5d497e;}try{await ensureMcpServer(_0x4343d2(0xb4),_0x4343d2(0x111),'http',_0x16c757,this[_0x4343d2(0x154)]);}catch(_0x276abe){handleInstallationError(_0x276abe,'TD\x20Docs\x20MCP\x20Server',_0x16c757,this['logger']);}try{const _0x4fe5c0=getTdSkillsRepoUrl();_0x2248f2=_0x4fe5c0!==DEFAULT_TD_SKILLS_URL;_0x2248f2&&await removeMarketplace(_0x4343d2(0xbe),this[_0x4343d2(0x154)]);await ensureMarketplace('td-skills',_0x4fe5c0,_0x16c757,this['logger']),await updateMarketplace(_0x4343d2(0xbe),_0x16c757,this[_0x4343d2(0x154)]),await ensurePlugin(_0x4343d2(0xcb),_0x4343d2(0xbe),_0x16c757,this[_0x4343d2(0x154)]),await ensurePlugin(_0x4343d2(0x155),_0x4343d2(0xbe),_0x16c757,this['logger']),await ensurePlugin(_0x4343d2(0xf7),'td-skills',_0x16c757,this['logger']);try{const _0x4c7622=loadReleaseChannel(),_0x59b6a1=await resolveReleaseTag(_0x4c7622,_0x4343d2(0x151),_0x4343d2(0xbe),_0x4343d2(0x12e));_0x59b6a1&&await checkoutReleaseTag(_0x59b6a1,_0x16c757,this[_0x4343d2(0x154)]);}catch(_0x5875bf){this['logger']?.[_0x4343d2(0x114)](_0x4343d2(0xbc)+_0x5875bf);}}catch(_0x591047){handleInstallationError(_0x591047,_0x4343d2(0xe4),_0x16c757,this[_0x4343d2(0x154)]);}_0x16c757[_0x4343d2(0xd5)]();}catch(_0x71008f){_0x16c757[_0x4343d2(0xba)](_0x4343d2(0x11b));throw _0x71008f;}const _0x5854af=await findExecutable('claude');if(!_0x5854af)throw new SDKError(ErrorCode[_0x4343d2(0x103)],'Claude\x20Code\x20CLI\x20not\x20found',undefined,{'helpText':_0x4343d2(0x122)});const _0x10c525={...process.env};!_0xf2749c&&(_0x10c525['ANTHROPIC_BASE_URL']='http://127.0.0.1:'+this[_0x4343d2(0xca)],_0x10c525[_0x4343d2(0xe6)]='tdx-managed-proxy',_0x10c525[_0x4343d2(0xc7)]=_0x4343d2(0xe0),_0x10c525['CLAUDE_CODE_USE_VERTEX']=_0x4343d2(0xe0));const _0x4170db=crossSpawn(_0x5854af,_0x27732d,{'stdio':_0x4343d2(0xee),'env':_0x10c525}),_0x34823d=await new Promise(_0x1d22fa=>{const _0x7d76c9=_0x4343d2;_0x4170db['on'](_0x7d76c9(0x10f),_0x417eb8=>{_0x1d22fa(_0x417eb8||0x0);}),_0x4170db['on'](_0x7d76c9(0x109),_0x4f4f58=>{const _0x10209c=_0x7d76c9;console['error'](a11_0x15e99e['red']('Failed\x20to\x20launch\x20Claude\x20Code:\x20'+_0x4f4f58[_0x10209c(0xfd)])),_0x1d22fa(0x1);});});_0x2248f2&&await restoreDefaultTdSkillsMarketplace(this['logger']);this['passThroughServer']&&(await this[_0x4343d2(0x136)]['stop'](),console[_0x4343d2(0xb6)](a11_0x15e99e[_0x4343d2(0x110)]('✓\x20TD\x20LLM\x20pass-through\x20proxy\x20server\x20stopped')));if(this['logger']){await this[_0x4343d2(0x154)]['close']();const _0x3ee6af=this['logger'][_0x4343d2(0xdd)]();console['log'](a11_0x15e99e[_0x4343d2(0x110)](_0x4343d2(0x12c)+_0x3ee6af));}return this[_0x4343d2(0xcd)]&&(await restoreClaudeSettings(this[_0x4343d2(0xcd)]),console['log'](a11_0x15e99e[_0x4343d2(0x110)]('✓\x20Settings\x20restored:\x20.claude/settings.local.json'))),_0x34823d;}catch(_0x17e484){_0x2248f2&&await restoreDefaultTdSkillsMarketplace(this[_0x4343d2(0x154)]);this[_0x4343d2(0x136)]&&await this[_0x4343d2(0x136)][_0x4343d2(0xd5)]();this[_0x4343d2(0x154)]&&await this[_0x4343d2(0x154)][_0x4343d2(0x115)]();this[_0x4343d2(0xcd)]&&await restoreClaudeSettings(this[_0x4343d2(0xcd)]);throw _0x17e484;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a12_0x2b436b=a12_0x4b9b;(function(_0xa40241,_0x17a122){const _0x2261ac=a12_0x4b9b,_0x162c20=_0xa40241();while(!![]){try{const _0x4d37a7=-parseInt(_0x2261ac(0x1e6))/0x1+parseInt(_0x2261ac(0x1f4))/0x2+parseInt(_0x2261ac(0x1e3))/0x3*(-parseInt(_0x2261ac(0x1f3))/0x4)+-parseInt(_0x2261ac(0x1cc))/0x5*(parseInt(_0x2261ac(0x1d5))/0x6)+-parseInt(_0x2261ac(0x1ec))/0x7+-parseInt(_0x2261ac(0x1e4))/0x8*(-parseInt(_0x2261ac(0x1e1))/0x9)+parseInt(_0x2261ac(0x1e8))/0xa;if(_0x4d37a7===_0x17a122)break;else _0x162c20['push'](_0x162c20['shift']());}catch(_0x55088f){_0x162c20['push'](_0x162c20['shift']());}}}(a12_0x2ed0,0x9a787));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(_0x4bb9ab=0x64){return new Promise(_0x3748c7=>{const _0x4ea6f4=a12_0x4b9b;let _0x5cbcba='',_0xec2733=![];const _0x45a202=createInterface({'input':process['stdin'],'terminal':![]}),_0x418e90=_0x4a118b=>{const _0x4fc857=a12_0x4b9b;if(_0xec2733)return;_0xec2733=!![],clearTimeout(_0xc3dec0),_0x45a202[_0x4fc857(0x1df)](),_0x3748c7(_0x4a118b);},_0xc3dec0=setTimeout(()=>{_0x418e90(null);},_0x4bb9ab);_0x45a202['on'](_0x4ea6f4(0x1f0),_0x513e41=>{_0x5cbcba+=_0x513e41;}),_0x45a202['on'](_0x4ea6f4(0x1df),()=>{const _0x49153e=_0x4ea6f4;if(_0xec2733)return;try{const _0x4915ac=JSON[_0x49153e(0x1d8)](_0x5cbcba);_0x418e90(_0x4915ac);}catch{_0x418e90(null);}});});}function a12_0x2ed0(){const _0x58bfe6=['log','execute','push','\x20-\x20','description','site','close','Output\x20statusline\x20for\x20Claude\x20Code\x20(reads\x20JSON\x20from\x20stdin)','18HvVULw','tdx\x20','281058QGECPu','4940848LvWRbj','🪙\x20credit:\x20','1169404ooxJzz','Claude','19353110YsGjFw','\x20today\x20/\x20','sessionCredits','🧠\x20','3186785ANpWTj','profile','accountId','round','line','todayCredits','💎\x20tdx\x20-\x20Claude','44oJroLX','807048KvhGwQ','statusline','11265bGLqns','options','monthCredits','toFixed','tdx','cache_creation_input_tokens','session_id','context_window','\x20session\x20/\x20','762IATEHd','current_usage','join','parse'];a12_0x2ed0=function(){return _0x58bfe6;};return a12_0x2ed0();}function a12_0x4b9b(_0x38d559,_0x13a6f5){_0x38d559=_0x38d559-0x1cc;const _0x2ed0b8=a12_0x2ed0();let _0x4b9b00=_0x2ed0b8[_0x38d559];return _0x4b9b00;}function formatCredits(_0x57abc7){const _0x3d9581=a12_0x4b9b;return _0x57abc7[_0x3d9581(0x1cf)](0x2);}export class ClaudeStatuslineCommand extends BaseCommand{['name']=a12_0x2b436b(0x1f5);[a12_0x2b436b(0x1dd)]=a12_0x2b436b(0x1e0);async[a12_0x2b436b(0x1da)](_0x77c34b){const _0x2be021=a12_0x2b436b;try{const _0x548e16=await readStdinJson();if(!_0x548e16?.[_0x2be021(0x1d2)])return console[_0x2be021(0x1d9)](_0x2be021(0x1f2)),0x0;const _0x513f51=_0x548e16[_0x2be021(0x1d2)],_0x3ce898=_0x548e16['model']?.['id']||'',_0x2c9422=_0x548e16[_0x2be021(0x1ed)]||_0x77c34b[_0x2be021(0x1cd)]['profile'],_0x19fb27=await getUsageStats(_0x513f51,_0x2c9422),_0x368e94=[],_0x2eea56=readCachedAccountInfo(_0x2c9422),_0x32e656=_0x2eea56?_0x2be021(0x1e2)+_0x2eea56[_0x2be021(0x1de)]+':'+_0x2eea56[_0x2be021(0x1ee)]:_0x2be021(0x1d0),_0x3f1f55=_0x3ce898?getModelDisplayName(_0x3ce898):_0x2be021(0x1e7);_0x368e94['push']('💎\x20'+_0x32e656+_0x2be021(0x1dc)+_0x3f1f55);const _0xea26f3=formatCredits(_0x19fb27[_0x2be021(0x1ea)]),_0x1b082f=formatCredits(_0x19fb27[_0x2be021(0x1f1)]),_0x50312b=formatCredits(_0x19fb27[_0x2be021(0x1ce)]);_0x368e94[_0x2be021(0x1db)](_0x2be021(0x1e5)+_0xea26f3+_0x2be021(0x1d4)+_0x1b082f+_0x2be021(0x1e9)+_0x50312b+'\x20month');const _0x41e629=_0x548e16[_0x2be021(0x1d3)],_0x488aea=_0x41e629?.[_0x2be021(0x1d6)];if(_0x488aea&&_0x41e629?.['used_percentage']!=null){const _0x32fb2b=_0x488aea['input_tokens']+_0x488aea[_0x2be021(0x1d1)]+_0x488aea['cache_read_input_tokens'],_0x288581=formatTokenCount(_0x32fb2b),_0x23362e=Math[_0x2be021(0x1ef)](_0x41e629['used_percentage']);_0x368e94[_0x2be021(0x1db)](_0x2be021(0x1eb)+_0x288581+'\x20('+_0x23362e+'%)');}return console[_0x2be021(0x1d9)](_0x368e94[_0x2be021(0x1d7)]('\x20|\x20')),0x0;}catch{return console[_0x2be021(0x1d9)](_0x2be021(0x1f2)),0x0;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a13_0x39f6(){const _0x49cc18=['error','red','format','length','\x20days\x20ago','dim','default','toLocaleTimeString','\x20credits','numeric','entryCount','profile','totalCredits','515SJmddS','bold','outputTable','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','getTime','13330IDzTZf','4688FQyPrE','repeat','message','jsonl','execute','Today','Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.','lastUsedAt','round','1306752YJNuHl','1492760VsSCMM','\x20\x20Total:\x20\x20\x20','yesterday','332143bglJka','Last\x20Used','Total','(default)','description','15323tYpkvE','profileCount','monthCredits','today\x20','source','short','Usage\x20by\x20Source','map','todayCredits','Unknown\x20error','credits','8cYlJjF','Source','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','toLocaleDateString','log','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','toFixed','padStart','padEnd','\x20\x20Today:\x20\x20\x20','2-digit','1576674tPhcTx','4715109buQdtn','14fkZhxf','usage','\x20\x20Month:\x20\x20\x20','Error:\x20','en-US','name','Requests','json','cyan'];a13_0x39f6=function(){return _0x49cc18;};return a13_0x39f6();}const a13_0xbff46d=a13_0x576e;(function(_0x29beab,_0x365f4b){const _0x3214ec=a13_0x576e,_0x23bdf6=_0x29beab();while(!![]){try{const _0x3b58ba=-parseInt(_0x3214ec(0x1b1))/0x1+-parseInt(_0x3214ec(0x1f4))/0x2+parseInt(_0x3214ec(0x1cc))/0x3+-parseInt(_0x3214ec(0x1ea))/0x4*(-parseInt(_0x3214ec(0x1e4))/0x5)+parseInt(_0x3214ec(0x1f3))/0x6*(-parseInt(_0x3214ec(0x1ce))/0x7)+parseInt(_0x3214ec(0x1c1))/0x8*(-parseInt(_0x3214ec(0x1cd))/0x9)+-parseInt(_0x3214ec(0x1e9))/0xa*(-parseInt(_0x3214ec(0x1b6))/0xb);if(_0x3b58ba===_0x365f4b)break;else _0x23bdf6['push'](_0x23bdf6['shift']());}catch(_0x4d93b5){_0x23bdf6['push'](_0x23bdf6['shift']());}}}(a13_0x39f6,0x718ef));function a13_0x576e(_0x38e978,_0x5abca2){_0x38e978=_0x38e978-0x1af;const _0x39f6ef=a13_0x39f6();let _0x576edd=_0x39f6ef[_0x38e978];return _0x576edd;}import a13_0x1838e3 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(_0x924cea){const _0x3440fa=a13_0x576e;return _0x924cea[_0x3440fa(0x1c7)](0x2);}function formatLastUsed(_0x279a54){const _0x324772=a13_0x576e;if(!_0x279a54)return'never';const _0x5281af=new Date(_0x279a54),_0x479a88=new Date(),_0x1271d8=_0x5281af[_0x324772(0x1c4)]('en-CA'),_0x52494f=_0x479a88[_0x324772(0x1c4)]('en-CA');if(_0x1271d8===_0x52494f)return _0x324772(0x1b9)+_0x5281af[_0x324772(0x1de)](_0x324772(0x1d2),{'hour':'2-digit','minute':_0x324772(0x1cb)});const _0x45210e=new Date(_0x1271d8),_0x5ee2ce=new Date(_0x52494f),_0x5c0aa2=Math[_0x324772(0x1f2)]((_0x5ee2ce[_0x324772(0x1e8)]()-_0x45210e[_0x324772(0x1e8)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x5c0aa2===0x1)return _0x324772(0x1b0);else return _0x5c0aa2>0x1&&_0x5c0aa2<0x7?_0x5c0aa2+_0x324772(0x1db):_0x5281af['toLocaleDateString'](_0x324772(0x1d2),{'month':_0x324772(0x1bb),'day':_0x324772(0x1e0)});}export class ClaudeUsageCommand extends BaseCommand{[a13_0xbff46d(0x1d3)]=a13_0xbff46d(0x1cf);[a13_0xbff46d(0x1b5)]=a13_0xbff46d(0x1e7);async[a13_0xbff46d(0x1ee)](_0x1c9cda){const _0x1f7c51=a13_0xbff46d,{options:_0xca813}=_0x1c9cda,_0x33495b=_0xca813[_0x1f7c51(0x1d9)]===_0x1f7c51(0x1d5)||_0xca813[_0x1f7c51(0x1d9)]===_0x1f7c51(0x1ed)||_0xca813[_0x1f7c51(0x1d5)];try{const [_0x4a3543,_0x4d3c18,_0x286557]=await Promise['all']([getAllProfileStats(),getAllSourceStats(),getUsageSummary()]);return _0x33495b?await this['outputStructured'](_0x4a3543,_0x4d3c18,_0x286557,_0xca813):this['outputTable'](_0x4a3543,_0x4d3c18,_0x286557),0x0;}catch(_0x36f352){const _0x59a129=_0x36f352 instanceof Error?_0x36f352[_0x1f7c51(0x1ec)]:_0x1f7c51(0x1bf);return console[_0x1f7c51(0x1d7)](a13_0x1838e3[_0x1f7c51(0x1d8)](_0x1f7c51(0x1d1)+_0x59a129)),0x1;}}async['outputStructured'](_0x39b847,_0x5770d5,_0x389a5d,_0x20b614){const _0x25743b=a13_0xbff46d,_0x39ee52={'summary':{'todayCredits':_0x389a5d[_0x25743b(0x1be)],'monthCredits':_0x389a5d['monthCredits'],'totalCredits':_0x389a5d['totalCredits'],'profileCount':_0x389a5d[_0x25743b(0x1b7)]},'profiles':_0x39b847[_0x25743b(0x1bd)](_0x3143f8=>({'profile':_0x3143f8['profile'],'credits':_0x3143f8[_0x25743b(0x1c0)],'requests':_0x3143f8[_0x25743b(0x1e1)],'lastUsedAt':_0x3143f8[_0x25743b(0x1f1)]})),'sources':_0x5770d5[_0x25743b(0x1bd)](_0x31408b=>({'source':_0x31408b[_0x25743b(0x1ba)],'credits':_0x31408b[_0x25743b(0x1c0)],'todayCredits':_0x31408b[_0x25743b(0x1be)],'monthCredits':_0x31408b[_0x25743b(0x1b8)],'requests':_0x31408b[_0x25743b(0x1e1)]}))};await handleSDKOutput([_0x39ee52],_0x20b614);}[a13_0xbff46d(0x1e6)](_0x503e07,_0xfae17a,_0x3867a7){const _0x12b831=a13_0xbff46d;console['log'](a13_0x1838e3[_0x12b831(0x1e5)](_0x12b831(0x1c6))),console[_0x12b831(0x1c5)](a13_0x1838e3[_0x12b831(0x1dc)]('─'['repeat'](0x32))),console['log'](_0x12b831(0x1ca)+a13_0x1838e3[_0x12b831(0x1d6)](formatCredits(_0x3867a7[_0x12b831(0x1be)]))+_0x12b831(0x1df)),console[_0x12b831(0x1c5)](_0x12b831(0x1d0)+a13_0x1838e3[_0x12b831(0x1d6)](formatCredits(_0x3867a7[_0x12b831(0x1b8)]))+'\x20credits'),console[_0x12b831(0x1c5)](_0x12b831(0x1af)+a13_0x1838e3['cyan'](formatCredits(_0x3867a7[_0x12b831(0x1e3)]))+_0x12b831(0x1df)),console[_0x12b831(0x1c5)]();if(_0xfae17a['length']>0x0){console[_0x12b831(0x1c5)](a13_0x1838e3[_0x12b831(0x1e5)](_0x12b831(0x1bc))),console[_0x12b831(0x1c5)](a13_0x1838e3[_0x12b831(0x1dc)]('─'[_0x12b831(0x1eb)](0x3c)));const _0x5173a0=0xc,_0x420bd0=0xa,_0x3d5270=0xa,_0x460cb6=0xa;console[_0x12b831(0x1c5)]('\x20\x20'+_0x12b831(0x1c2)['padEnd'](_0x5173a0)+'\x20\x20'+_0x12b831(0x1b3)[_0x12b831(0x1c8)](_0x420bd0)+'\x20\x20'+_0x12b831(0x1ef)['padStart'](_0x3d5270)+'\x20\x20'+'Month'[_0x12b831(0x1c8)](_0x460cb6));for(const _0x2a3a7d of _0xfae17a){console[_0x12b831(0x1c5)]('\x20\x20'+_0x2a3a7d[_0x12b831(0x1ba)][_0x12b831(0x1c9)](_0x5173a0)+'\x20\x20'+a13_0x1838e3[_0x12b831(0x1d6)](formatCredits(_0x2a3a7d[_0x12b831(0x1c0)])['padStart'](_0x420bd0))+'\x20\x20'+formatCredits(_0x2a3a7d[_0x12b831(0x1be)])['padStart'](_0x3d5270)+'\x20\x20'+formatCredits(_0x2a3a7d['monthCredits'])[_0x12b831(0x1c8)](_0x460cb6));}console[_0x12b831(0x1c5)]();}if(_0x503e07[_0x12b831(0x1da)]===0x0){console[_0x12b831(0x1c5)](a13_0x1838e3[_0x12b831(0x1dc)](_0x12b831(0x1c3))),console[_0x12b831(0x1c5)](a13_0x1838e3[_0x12b831(0x1dc)]('\x20\x20Run\x20\x22tdx\x20claude\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a'));return;}console[_0x12b831(0x1c5)](a13_0x1838e3[_0x12b831(0x1e5)]('Usage\x20by\x20Profile')),console[_0x12b831(0x1c5)](a13_0x1838e3['dim']('─'[_0x12b831(0x1eb)](0x3c)));const _0xd89dcb=Math['max'](0xc,..._0x503e07[_0x12b831(0x1bd)](_0x48f538=>_0x48f538['profile']===_0x12b831(0x1dd)?_0x12b831(0x1b4)[_0x12b831(0x1da)]:_0x48f538['profile'][_0x12b831(0x1da)])),_0x2b6c46=0xa,_0x5e4376=0xa;console['log']('\x20\x20'+'Profile'['padEnd'](_0xd89dcb)+'\x20\x20'+'Credits'[_0x12b831(0x1c8)](_0x2b6c46)+'\x20\x20'+_0x12b831(0x1d4)['padStart'](_0x5e4376)+'\x20\x20'+_0x12b831(0x1b2));for(const _0x4e5fa1 of _0x503e07){const _0x3a8e75=_0x4e5fa1[_0x12b831(0x1e2)]===_0x12b831(0x1dd)?'(default)':_0x4e5fa1[_0x12b831(0x1e2)],_0x117063=_0x3a8e75['padEnd'](_0xd89dcb),_0xbe6d0f=_0x4e5fa1[_0x12b831(0x1e2)]===_0x12b831(0x1dd)?a13_0x1838e3[_0x12b831(0x1dc)](_0x117063):_0x117063;console['log']('\x20\x20'+_0xbe6d0f+'\x20\x20'+a13_0x1838e3[_0x12b831(0x1d6)](formatCredits(_0x4e5fa1[_0x12b831(0x1c0)])[_0x12b831(0x1c8)](_0x2b6c46))+'\x20\x20'+String(_0x4e5fa1[_0x12b831(0x1e1)])[_0x12b831(0x1c8)](_0x5e4376)+'\x20\x20'+a13_0x1838e3[_0x12b831(0x1dc)](formatLastUsed(_0x4e5fa1[_0x12b831(0x1f1)])));}console['log'](),console[_0x12b831(0x1c5)](a13_0x1838e3[_0x12b831(0x1dc)](_0x12b831(0x1f0))),console['log']();}}
|
package/dist/commands/command.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a14_0xab77d7=a14_0x2863;(function(_0x186103,_0x5c53d2){const _0x50b395=a14_0x2863,_0x2673d5=_0x186103();while(!![]){try{const _0x2cb747=-parseInt(_0x50b395(0x8e))/0x1+-parseInt(_0x50b395(0x7d))/0x2*(-parseInt(_0x50b395(0x89))/0x3)+-parseInt(_0x50b395(0x91))/0x4+-parseInt(_0x50b395(0x8c))/0x5*(-parseInt(_0x50b395(0x97))/0x6)+-parseInt(_0x50b395(0xa3))/0x7*(-parseInt(_0x50b395(0x9f))/0x8)+parseInt(_0x50b395(0xa6))/0x9*(parseInt(_0x50b395(0xaa))/0xa)+parseInt(_0x50b395(0x96))/0xb*(-parseInt(_0x50b395(0xa7))/0xc);if(_0x2cb747===_0x5c53d2)break;else _0x2673d5['push'](_0x2673d5['shift']());}catch(_0x486033){_0x2673d5['push'](_0x2673d5['shift']());}}}(a14_0x5f58,0xb682c));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import{Logger}from'../utils/logger/index.js';import a14_0x4a5e0f from'chalk';export function printAuthError(_0x1b3305,_0xcc1a59=![],_0x2419f1){const _0x2e265f=a14_0x2863,_0x2fe4c1=_0x1b3305['problemDetails']?.[_0x2e265f(0x82)]||_0x1b3305['message'];console[_0x2e265f(0x80)](a14_0x4a5e0f[_0x2e265f(0x8f)](_0x2e265f(0x94))),console[_0x2e265f(0x80)](a14_0x4a5e0f[_0x2e265f(0x8f)](_0x2e265f(0x9e)+_0x2fe4c1));if(_0xcc1a59){const _0x4d6afe=_0x2419f1?_0x2e265f(0xa4)+_0x2419f1:'';console[_0x2e265f(0x80)]('\x0a'+a14_0x4a5e0f['dim'](_0x2e265f(0x9a))),console['error']('\x20\x20'+a14_0x4a5e0f['cyan'](_0x2e265f(0x7f)+_0x4d6afe)+'\x0a'),console[_0x2e265f(0x80)](''+a14_0x4a5e0f['dim'](_0x2e265f(0x93))),console['error']('\x20\x20'+a14_0x4a5e0f[_0x2e265f(0x8b)](_0x2e265f(0xab)+_0x4d6afe));}}function a14_0x5f58(){const _0x2023f6=['error','debug','detail','\x0aStack\x20trace:\x0a','values','register','USER_ERROR','Command\x20\x27','options','198753rsOJTo','isValid','cyan','1678730yluyqx','from','239119xOmcLC','red','category','3195108ULnYVw','value','To\x20check\x20your\x20current\x20auth\x20status:','Authentication\x20failed','profile','33QOrMFS','12YNlPZI','set','test','To\x20set\x20up\x20authentication:','commands','name','execute','Reason:\x20','6128gxCLqy','helpText','stack','status','7567zmmyoh','\x20--profile\x20','yellow','297sjBLyd','7471836gzfmjH','number','command','251170JuOMSv','tdx\x20auth','message','Error:\x20','get','validate','has','validateGlobalOptions','40lvVMnk','limit','tdx\x20auth\x20setup'];a14_0x5f58=function(){return _0x2023f6;};return a14_0x5f58();}export class BaseCommand{[a14_0xab77d7(0x7c)](_0x521027){const _0x1b1fb9=a14_0xab77d7,{options:_0x492008}=_0x521027,_0x482dcc=_0x492008[_0x1b1fb9(0x7e)];if(_0x482dcc!==undefined){const _0x5e62cc=typeof _0x482dcc===_0x1b1fb9(0xa8)?_0x482dcc:parseInt(_0x482dcc,0xa);if(isNaN(_0x5e62cc))return'Invalid\x20limit\x20value:\x20'+_0x482dcc+'.\x20Must\x20be\x20a\x20number.';const _0x4f2ad1=validateLimitOption(_0x5e62cc);if(!_0x4f2ad1[_0x1b1fb9(0x8a)])return _0x4f2ad1[_0x1b1fb9(0x80)];_0x521027[_0x1b1fb9(0x88)][_0x1b1fb9(0x7e)]=_0x4f2ad1[_0x1b1fb9(0x92)];}return undefined;}[a14_0xab77d7(0x7a)](_0x2e4c80){return undefined;}async['run'](_0x10ef54){const _0x27aee3=a14_0xab77d7;try{const _0x253f23=this['validateGlobalOptions'](_0x10ef54);if(_0x253f23)return console['error'](_0x27aee3(0x78)+_0x253f23),0x1;const _0x4c2ee2=this[_0x27aee3(0x7a)](_0x10ef54);if(_0x4c2ee2){const _0x482071=/^\s*(Usage|Note|Warning|Error):/i[_0x27aee3(0x99)](_0x4c2ee2);return _0x482071?console[_0x27aee3(0x80)](_0x4c2ee2):console[_0x27aee3(0x80)](_0x27aee3(0x78)+_0x4c2ee2),0x1;}const _0x157a59=await this[_0x27aee3(0x9d)](_0x10ef54);return _0x157a59??0x0;}catch(_0x41c7f2){if(_0x41c7f2 instanceof Error){if(_0x41c7f2 instanceof HTTPClientError&&_0x41c7f2[_0x27aee3(0xa2)]===0x191){const _0xc61515=_0x10ef54[_0x27aee3(0x88)][_0x27aee3(0x95)];printAuthError(_0x41c7f2,!![],_0xc61515);if(_0x41c7f2[_0x27aee3(0xa1)]){const _0x2eebfc=Logger['of'](_0x27aee3(0xa9));_0x2eebfc[_0x27aee3(0x81)]('Authentication\x20error\x20stack\x20trace:'),_0x2eebfc['debug'](_0x41c7f2[_0x27aee3(0xa1)]);}return 0x1;}console[_0x27aee3(0x80)](a14_0x4a5e0f['red'](_0x27aee3(0x78)+_0x41c7f2[_0x27aee3(0x77)]));_0x41c7f2 instanceof SDKError&&_0x41c7f2[_0x27aee3(0xa0)]&&console[_0x27aee3(0x80)](a14_0x4a5e0f[_0x27aee3(0xa5)](_0x41c7f2['helpText']));const _0x181cb0=_0x41c7f2 instanceof SDKError&&_0x41c7f2[_0x27aee3(0x90)]===ErrorCategory[_0x27aee3(0x86)];_0x41c7f2['stack']&&!_0x181cb0&&console[_0x27aee3(0x80)](_0x27aee3(0x83)+_0x41c7f2['stack']);}else console[_0x27aee3(0x80)](_0x27aee3(0x78)+String(_0x41c7f2));return 0x1;}}}export class CommandRegistry{[a14_0xab77d7(0x9b)]=new Map();[a14_0xab77d7(0x85)](_0x2da3d3){const _0x5bf6b7=a14_0xab77d7;if(this['commands']['has'](_0x2da3d3[_0x5bf6b7(0x9c)]))throw new Error(_0x5bf6b7(0x87)+_0x2da3d3[_0x5bf6b7(0x9c)]+'\x27\x20is\x20already\x20registered');this[_0x5bf6b7(0x9b)][_0x5bf6b7(0x98)](_0x2da3d3[_0x5bf6b7(0x9c)],_0x2da3d3);}[a14_0xab77d7(0x79)](_0x5e6aae){const _0x3088fc=a14_0xab77d7;return this['commands'][_0x3088fc(0x79)](_0x5e6aae);}['getAll'](){const _0x3c85c3=a14_0xab77d7;return Array[_0x3c85c3(0x8d)](this[_0x3c85c3(0x9b)][_0x3c85c3(0x84)]());}[a14_0xab77d7(0x7b)](_0x2edb1a){const _0x5862a8=a14_0xab77d7;return this['commands'][_0x5862a8(0x7b)](_0x2edb1a);}}function a14_0x2863(_0x343dfb,_0xee446c){_0x343dfb=_0x343dfb-0x77;const _0x5f5879=a14_0x5f58();let _0x286309=_0x5f5879[_0x343dfb];return _0x286309;}export const registry=new CommandRegistry();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a15_0x3da3c8=a15_0xdc71;(function(_0x4419c2,_0x368ea3){const _0x17abdb=a15_0xdc71,_0x3d88a8=_0x4419c2();while(!![]){try{const _0x2a7486=parseInt(_0x17abdb(0x23a))/0x1+-parseInt(_0x17abdb(0x1d2))/0x2+-parseInt(_0x17abdb(0x208))/0x3+parseInt(_0x17abdb(0x1e2))/0x4*(-parseInt(_0x17abdb(0x219))/0x5)+parseInt(_0x17abdb(0x229))/0x6*(parseInt(_0x17abdb(0x1f2))/0x7)+parseInt(_0x17abdb(0x233))/0x8+parseInt(_0x17abdb(0x236))/0x9;if(_0x2a7486===_0x368ea3)break;else _0x3d88a8['push'](_0x3d88a8['shift']());}catch(_0x12129e){_0x3d88a8['push'](_0x3d88a8['shift']());}}}(a15_0x2b4b,0x35f33));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';function a15_0xdc71(_0x1ad4cb,_0xc167fc){_0x1ad4cb=_0x1ad4cb-0x1cc;const _0x2b4b64=a15_0x2b4b();let _0xdc71d1=_0x2b4b64[_0x1ad4cb];return _0xdc71d1;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import a15_0x1c6230 from'chalk';function normalizeSchemaForDisplay(_0x7b791b){const _0x7713d3=a15_0xdc71,_0x40ebce=_0x7b791b[_0x7713d3(0x1fb)]||[],_0x40d1ee=_0x40ebce[_0x7713d3(0x1d8)](_0x2c2c42=>_0x2c2c42[_0x7713d3(0x1e7)]==='legacy_settings'&&_0x2c2c42[_0x7713d3(0x218)]==='record'&&_0x2c2c42[_0x7713d3(0x1fb)]);if(_0x40d1ee?.[_0x7713d3(0x1fb)]){const _0x457215=_0x40ebce[_0x7713d3(0x217)](_0x30e79f=>_0x30e79f[_0x7713d3(0x1e7)]!==_0x7713d3(0x223)&&_0x30e79f[_0x7713d3(0x1e7)]!==_0x7713d3(0x222));return[..._0x457215,..._0x40d1ee[_0x7713d3(0x1fb)]];}return _0x40ebce[_0x7713d3(0x217)](_0x3eff9a=>_0x3eff9a[_0x7713d3(0x1e7)]!=='legacy');}function printSchemaFields(_0x2b4b88,_0x37e7f1){const _0x4ae24f=a15_0xdc71,_0x5057f6='\x20\x20'['repeat'](_0x37e7f1+0x1),_0x8b9ebf='\x20\x20'[_0x4ae24f(0x1da)](_0x37e7f1+0x2);for(const _0x169946 of _0x2b4b88){if(!_0x169946['name'])continue;const _0x3d5d09=_0x169946[_0x4ae24f(0x218)]==='record'&&_0x169946[_0x4ae24f(0x1fb)]&&_0x169946['properties'][_0x4ae24f(0x1e6)]>0x0&&_0x169946[_0x4ae24f(0x1e7)]!==_0x4ae24f(0x222);let _0x406259=''+_0x5057f6+a15_0x1c6230[_0x4ae24f(0x213)](_0x169946[_0x4ae24f(0x1e7)]);_0x169946[_0x4ae24f(0x1e8)]&&(_0x406259+=':\x20'+_0x169946[_0x4ae24f(0x1e8)]);if(_0x169946[_0x4ae24f(0x22a)])_0x406259+=a15_0x1c6230['dim']('\x20['+_0x169946[_0x4ae24f(0x22a)]+']');else _0x3d5d09&&(_0x406259+=a15_0x1c6230[_0x4ae24f(0x1f6)]('\x20[record]'));console[_0x4ae24f(0x1de)](_0x406259);_0x169946['description']&&console[_0x4ae24f(0x1de)](''+_0x8b9ebf+a15_0x1c6230[_0x4ae24f(0x1f6)](_0x169946[_0x4ae24f(0x200)]));if(_0x169946[_0x4ae24f(0x1ff)]){const _0x49151a=_0x169946[_0x4ae24f(0x1ff)][_0x4ae24f(0x214)](_0x23bf78=>typeof _0x23bf78===_0x4ae24f(0x1f5)&&_0x4ae24f(0x1f1)in _0x23bf78?_0x23bf78[_0x4ae24f(0x1f1)]:_0x23bf78)[_0x4ae24f(0x228)](',\x20');console[_0x4ae24f(0x1de)](_0x8b9ebf+'Options:\x20'+a15_0x1c6230['yellow'](_0x49151a));}_0x169946['default_value']!==undefined&&console[_0x4ae24f(0x1de)](_0x8b9ebf+_0x4ae24f(0x1fe)+a15_0x1c6230['blue'](String(_0x169946['default_value'])));if(_0x169946[_0x4ae24f(0x1fd)]!==undefined||_0x169946[_0x4ae24f(0x21b)]!==undefined){const _0x53f583=_0x169946[_0x4ae24f(0x1fd)]!==undefined&&_0x169946[_0x4ae24f(0x21b)]!==undefined?_0x169946[_0x4ae24f(0x1fd)]+_0x4ae24f(0x211)+_0x169946['maximum']:_0x169946[_0x4ae24f(0x1fd)]!==undefined?_0x4ae24f(0x1d9)+_0x169946[_0x4ae24f(0x1fd)]:_0x4ae24f(0x20c)+_0x169946[_0x4ae24f(0x21b)];console[_0x4ae24f(0x1de)](_0x8b9ebf+_0x4ae24f(0x237)+a15_0x1c6230[_0x4ae24f(0x20f)](_0x53f583));}if(_0x169946[_0x4ae24f(0x212)]){const _0x5c321f=Object['entries'](_0x169946[_0x4ae24f(0x212)])[_0x4ae24f(0x214)](([_0x163f99,_0x17a32e])=>_0x163f99+'='+JSON[_0x4ae24f(0x21e)](_0x17a32e))[_0x4ae24f(0x228)](',\x20');console[_0x4ae24f(0x1de)](''+_0x8b9ebf+a15_0x1c6230[_0x4ae24f(0x1f6)](_0x4ae24f(0x1e1)+_0x5c321f));}_0x3d5d09&&_0x169946[_0x4ae24f(0x1fb)]&&printSchemaFields(_0x169946[_0x4ae24f(0x1fb)],_0x37e7f1+0x1);}}export class ConnectionListCommand extends BaseCommand{[a15_0x3da3c8(0x1e7)]=a15_0x3da3c8(0x235);['description']=a15_0x3da3c8(0x239);async[a15_0x3da3c8(0x21d)](_0x1321fe){const _0x6d302c=a15_0x3da3c8,{options:_0x922e4,tdx:_0x19f496}=_0x1321fe;_0x922e4['verbose']&&console[_0x6d302c(0x206)](_0x6d302c(0x231)+_0x922e4[_0x6d302c(0x1fc)]);const _0x1b5572=resolveLimit(_0x922e4[_0x6d302c(0x20b)],DEFAULT_LISTING_LIMIT),_0x5e447a=await withSpinner(_0x6d302c(0x21c),()=>_0x19f496['connection'][_0x6d302c(0x22d)](),{'verbose':_0x922e4[_0x6d302c(0x221)]}),_0x330aa4=_0x5e447a['data'];console[_0x6d302c(0x206)](_0x6d302c(0x1ec)+_0x330aa4[_0x6d302c(0x1e6)]+_0x6d302c(0x1ef)+(_0x330aa4[_0x6d302c(0x1e6)]!==0x1?'s':''));if(isStructuredFormat(_0x922e4)){const _0x3ab43e=_0x330aa4[_0x6d302c(0x1d6)](0x0,_0x1b5572);await handleSDKOutput(_0x3ab43e,{..._0x922e4,'limit':_0x1b5572});}else{const _0x3f16e8=_0x330aa4['length']>0x0?Math[_0x6d302c(0x201)](..._0x330aa4[_0x6d302c(0x214)](_0x27fb7a=>_0x27fb7a[_0x6d302c(0x218)][_0x6d302c(0x1e6)])):0x0,_0x1ffd6a=[];for(const _0x1e57f5 of _0x330aa4){const _0xa92c39=a15_0x1c6230[_0x6d302c(0x1ee)](_0x1e57f5[_0x6d302c(0x218)]['padStart'](_0x3f16e8)),_0xc2e07c=_0x1e57f5['owner']?.[_0x6d302c(0x1e7)]?_0x6d302c(0x211)+a15_0x1c6230[_0x6d302c(0x1f6)](_0x1e57f5[_0x6d302c(0x225)][_0x6d302c(0x1e7)]):'';_0x1ffd6a[_0x6d302c(0x20a)](_0xa92c39+'\x20\x20'+_0x1e57f5['name']+_0xc2e07c);}await writeOutput(_0x1ffd6a[_0x6d302c(0x228)]('\x0a'),_0x922e4[_0x6d302c(0x234)],_0x6d302c(0x1e5));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a15_0x3da3c8(0x1e7)]=a15_0x3da3c8(0x1f8);['description']='Show\x20connection\x20details';[a15_0x3da3c8(0x1eb)](_0x2fb5a5){const _0x11230=a15_0x3da3c8,{args:_0x3fe45f}=_0x2fb5a5;if(!_0x3fe45f[0x0])return _0x11230(0x220);return undefined;}async[a15_0x3da3c8(0x21d)](_0x27ab99){const _0x125d17=a15_0x3da3c8,{options:_0x120fd6,args:_0x29095d,tdx:_0x10e367}=_0x27ab99,_0x4c36ee=_0x29095d[0x0];_0x120fd6[_0x125d17(0x221)]&&(console[_0x125d17(0x206)]('Site:\x20'+_0x120fd6['site']),console[_0x125d17(0x206)](_0x125d17(0x22e)+_0x4c36ee));const _0x56368c=await withSpinner(_0x125d17(0x23b)+_0x4c36ee+'\x27...',()=>_0x10e367[_0x125d17(0x1dd)][_0x125d17(0x238)](_0x4c36ee),{'verbose':_0x120fd6['verbose']}),_0x3dd964=_0x56368c['data'];return console[_0x125d17(0x206)](_0x125d17(0x20e)+_0x3dd964[_0x125d17(0x1e7)]),await handleSingleObjectOutput(_0x3dd964,_0x120fd6),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{[a15_0x3da3c8(0x1e7)]=a15_0x3da3c8(0x226);[a15_0x3da3c8(0x200)]=a15_0x3da3c8(0x1d5);[a15_0x3da3c8(0x1eb)](_0x155a26){const {args:_0x74b32b}=_0x155a26;if(!_0x74b32b[0x0])return'Usage:\x20tdx\x20connection\x20schema\x20<type-or-name>\x0a\x0aArguments:\x0a\x20\x20<type-or-name>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27pgsql\x27,\x20\x27s3\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20or\x20connection\x20name\x20(e.g.,\x20\x27my-salesforce-connection\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20schema\x20salesforce\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20By\x20connector\x20type\x0a\x20\x20tdx\x20connection\x20schema\x20my-s3-connection\x20\x20\x20\x20\x20#\x20By\x20connection\x20name\x0a\x20\x20tdx\x20connection\x20schema\x20pgsql\x0a\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.\x0aUse\x20\x27tdx\x20connection\x20list\x27\x20to\x20list\x20available\x20connections.';return undefined;}async[a15_0x3da3c8(0x21d)](_0x33716b){const _0x4681b7=a15_0x3da3c8,{options:_0x165cbe,args:_0x2cd7f6,tdx:_0x45b550}=_0x33716b,_0x5ab032=_0x2cd7f6[0x0];_0x165cbe['verbose']&&(console[_0x4681b7(0x206)](_0x4681b7(0x231)+_0x165cbe[_0x4681b7(0x1fc)]),console[_0x4681b7(0x206)](_0x4681b7(0x224)+_0x5ab032));let _0x56d87e=_0x5ab032,_0x290f11;try{const _0xde5b29=await _0x45b550[_0x4681b7(0x1dd)][_0x4681b7(0x216)](_0x5ab032);_0xde5b29&&(_0x56d87e=_0xde5b29[_0x4681b7(0x218)],_0x290f11=_0xde5b29[_0x4681b7(0x1e7)],_0x165cbe[_0x4681b7(0x221)]&&console[_0x4681b7(0x206)](_0x4681b7(0x230)+_0x5ab032+_0x4681b7(0x207)+_0x56d87e));}catch{_0x165cbe['verbose']&&console['error'](_0x4681b7(0x1d0)+_0x5ab032+_0x4681b7(0x23c));}const _0x19abe2=await withSpinner(_0x4681b7(0x232)+_0x56d87e+_0x4681b7(0x20d),()=>_0x45b550[_0x4681b7(0x1dd)][_0x4681b7(0x1f0)](_0x56d87e),{'verbose':_0x165cbe['verbose']}),_0x46942b=_0x19abe2[_0x4681b7(0x1d7)];_0x290f11?console[_0x4681b7(0x206)]('✔\x20Found\x20schema\x20for\x20connection\x20\x27'+_0x290f11+_0x4681b7(0x1f4)+_0x56d87e+')'):console[_0x4681b7(0x206)](_0x4681b7(0x1d1)+_0x56d87e);if(isStructuredFormat(_0x165cbe))await handleSingleObjectOutput(_0x46942b,_0x165cbe);else{const _0x4f8b3e=normalizeSchemaForDisplay(_0x46942b);_0x290f11?(console[_0x4681b7(0x1de)]('\x0aConnection:\x20'+a15_0x1c6230[_0x4681b7(0x1ee)](_0x290f11)),console[_0x4681b7(0x1de)](_0x4681b7(0x1e0)+a15_0x1c6230[_0x4681b7(0x1f6)](_0x56d87e))):console['log']('\x0aConnector:\x20'+a15_0x1c6230[_0x4681b7(0x1ee)](_0x56d87e)),_0x4f8b3e[_0x4681b7(0x1e6)]>0x0?(console[_0x4681b7(0x1de)](a15_0x1c6230['bold']('\x0aAvailable\x20fields:')),printSchemaFields(_0x4f8b3e,0x0)):console['log'](a15_0x1c6230[_0x4681b7(0x1f6)](_0x4681b7(0x1db)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a15_0x3da3c8(0x1e7)]=a15_0x3da3c8(0x210);[a15_0x3da3c8(0x200)]='List\x20available\x20connector\x20types';async[a15_0x3da3c8(0x21d)](_0x43929){const _0xe572b5=a15_0x3da3c8,{options:_0x3a613f,tdx:_0x4ae1fe}=_0x43929;_0x3a613f[_0xe572b5(0x221)]&&console['error'](_0xe572b5(0x231)+_0x3a613f[_0xe572b5(0x1fc)]);const _0x4b548a=await withSpinner(_0xe572b5(0x1f7),()=>_0x4ae1fe[_0xe572b5(0x1dd)][_0xe572b5(0x1ce)](),{'verbose':_0x3a613f['verbose']}),_0x714d78=_0x4b548a[_0xe572b5(0x1d7)][_0xe572b5(0x215)]((_0x35646d,_0x260a0d)=>_0x35646d['type'][_0xe572b5(0x22b)](_0x260a0d[_0xe572b5(0x218)]));console[_0xe572b5(0x206)]('✔\x20Found\x20'+_0x714d78[_0xe572b5(0x1e6)]+_0xe572b5(0x1f9)+(_0x714d78[_0xe572b5(0x1e6)]!==0x1?'s':''));if(isStructuredFormat(_0x3a613f))await handleSDKOutput(_0x714d78,_0x3a613f);else{const _0x562e8b=_0x714d78[_0xe572b5(0x1e6)]>0x0?Math[_0xe572b5(0x201)](..._0x714d78['map'](_0x240bf2=>_0x240bf2[_0xe572b5(0x218)][_0xe572b5(0x1e6)])):0x0,_0x145644=[];for(const _0x2d697c of _0x714d78){const _0x3e008e=a15_0x1c6230[_0xe572b5(0x1ee)](_0x2d697c[_0xe572b5(0x218)][_0xe572b5(0x21a)](_0x562e8b));_0x145644[_0xe572b5(0x20a)](_0x3e008e+'\x20\x20'+_0x2d697c[_0xe572b5(0x1e7)]);}await writeOutput(_0x145644['join']('\x0a'),_0x3a613f[_0xe572b5(0x234)],_0xe572b5(0x1e5));}return 0x0;}}export class ConnectionSettingsCommand extends BaseCommand{[a15_0x3da3c8(0x1e7)]=a15_0x3da3c8(0x1cd);[a15_0x3da3c8(0x200)]=a15_0x3da3c8(0x202);[a15_0x3da3c8(0x1eb)](_0x2d7ace){const {args:_0xf82b8d}=_0x2d7ace;if(!_0xf82b8d[0x0])return'Usage:\x20tdx\x20connection\x20settings\x20<type>\x0a\x0aArguments:\x0a\x20\x20<type>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27rest\x27,\x20\x27s3\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20settings\x20rest\x0a\x20\x20tdx\x20connection\x20settings\x20salesforce\x0a\x20\x20tdx\x20connection\x20settings\x20s3\x0a\x0aNote:\x20This\x20shows\x20settings\x20for\x20creating/configuring\x20a\x20connection.\x0aFor\x20activation\x20output\x20settings,\x20use\x20\x27tdx\x20connection\x20schema\x20<type>\x27.\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.';return undefined;}async[a15_0x3da3c8(0x21d)](_0x458efb){const _0x21727d=a15_0x3da3c8,{options:_0x28b068,args:_0x329163,tdx:_0x12a65e}=_0x458efb,_0x405059=_0x329163[0x0];_0x28b068[_0x21727d(0x221)]&&(console['error']('Site:\x20'+_0x28b068['site']),console[_0x21727d(0x206)](_0x21727d(0x1e4)+_0x405059));const _0x55fdc3=await withSpinner(_0x21727d(0x227)+_0x405059+_0x21727d(0x20d),()=>_0x12a65e[_0x21727d(0x1dd)]['getMetadata'](_0x405059),{'verbose':_0x28b068[_0x21727d(0x221)]}),_0x3e05a8=_0x55fdc3[_0x21727d(0x1d7)];console[_0x21727d(0x206)](_0x21727d(0x1dc)+_0x405059);if(isStructuredFormat(_0x28b068))await handleSingleObjectOutput(_0x3e05a8,_0x28b068);else{console[_0x21727d(0x1de)](_0x21727d(0x209)+a15_0x1c6230[_0x21727d(0x1ee)](_0x405059)),console[_0x21727d(0x1de)](_0x21727d(0x21f)+_0x3e05a8[_0x21727d(0x1e7)]);const _0x2ebe2c=_0x3e05a8[_0x21727d(0x1e3)]||[],_0x2824c4=_0x2ebe2c[_0x21727d(0x217)](_0x4a73c1=>_0x4a73c1[_0x21727d(0x1ea)]);_0x2824c4[_0x21727d(0x1e6)]>0x0&&(console[_0x21727d(0x1de)](a15_0x1c6230[_0x21727d(0x1d4)](_0x21727d(0x1cc))),printMetadataSettings(_0x2824c4));let _0x852f79=![];try{const _0x1e8f7a=await _0x12a65e[_0x21727d(0x1dd)][_0x21727d(0x1f0)](_0x405059),_0x2fa3ca=normalizeSchemaForDisplay(_0x1e8f7a);_0x2fa3ca[_0x21727d(0x1e6)]>0x0&&(console['log'](a15_0x1c6230[_0x21727d(0x1d4)](_0x21727d(0x203))),printSchemaFields(_0x2fa3ca,0x0),_0x852f79=!![]);}catch{const _0x35beb4=_0x2ebe2c[_0x21727d(0x217)](_0x3171ed=>!_0x3171ed[_0x21727d(0x1ea)]);_0x35beb4['length']>0x0&&(console[_0x21727d(0x1de)](a15_0x1c6230[_0x21727d(0x1d4)]('\x0aAvailable\x20fields:')),printMetadataSettings(_0x35beb4),_0x852f79=!![]);}!_0x852f79&&_0x28b068[_0x21727d(0x221)]&&console[_0x21727d(0x206)](a15_0x1c6230[_0x21727d(0x1f6)](_0x21727d(0x204))),_0x2824c4[_0x21727d(0x1e6)]===0x0&&console[_0x21727d(0x1de)](a15_0x1c6230[_0x21727d(0x1f6)](_0x21727d(0x1f3)));}return 0x0;}}function printMetadataSettings(_0x4fd021){const _0x5ed0fb=a15_0x3da3c8;for(const _0xfb7593 of _0x4fd021){if(!_0xfb7593[_0x5ed0fb(0x1e7)])continue;if(_0xfb7593[_0x5ed0fb(0x1cf)])continue;let _0x303529='\x20\x20'+a15_0x1c6230[_0x5ed0fb(0x213)](_0xfb7593['name']);_0xfb7593[_0x5ed0fb(0x205)]&&(_0x303529+=':\x20'+_0xfb7593[_0x5ed0fb(0x205)]);_0xfb7593[_0x5ed0fb(0x218)]&&(_0x303529+=a15_0x1c6230[_0x5ed0fb(0x1f6)]('\x20['+_0xfb7593[_0x5ed0fb(0x218)]+']'));console['log'](_0x303529);_0xfb7593[_0x5ed0fb(0x1ed)]&&console[_0x5ed0fb(0x1de)](_0x5ed0fb(0x1fa)+a15_0x1c6230[_0x5ed0fb(0x1f6)](_0xfb7593[_0x5ed0fb(0x1ed)]));if(_0xfb7593['options']){const _0x23ed93=_0xfb7593[_0x5ed0fb(0x22c)][_0x5ed0fb(0x214)](_0x1ff67e=>_0x1ff67e[_0x5ed0fb(0x1f1)])['join'](',\x20');console[_0x5ed0fb(0x1de)](_0x5ed0fb(0x1d3)+a15_0x1c6230[_0x5ed0fb(0x1df)](_0x23ed93));}_0xfb7593[_0x5ed0fb(0x1e9)]!==undefined&&_0xfb7593['default_value']!==null&&console[_0x5ed0fb(0x1de)]('\x20\x20\x20\x20Default:\x20'+a15_0x1c6230[_0x5ed0fb(0x20f)](String(_0xfb7593[_0x5ed0fb(0x1e9)])));if(_0xfb7593[_0x5ed0fb(0x212)]){const _0x218e0e=Object[_0x5ed0fb(0x22f)](_0xfb7593[_0x5ed0fb(0x212)])[_0x5ed0fb(0x214)](([_0x3fc8fb,_0x137056])=>_0x3fc8fb+'='+JSON['stringify'](_0x137056))[_0x5ed0fb(0x228)](',\x20');console[_0x5ed0fb(0x1de)](_0x5ed0fb(0x1fa)+a15_0x1c6230['dim'](_0x5ed0fb(0x1e1)+_0x218e0e));}}}function a15_0x2b4b(){const _0x143a42=['\x0aNo\x20fields\x20defined\x20in\x20schema','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','connection','log','yellow','Type:\x20','Show\x20when:\x20','4adIdcE','settings','Fetching\x20settings\x20for\x20connector\x20type:\x20','table','length','name','title','default_value','credential','validate','✔\x20Found\x20','hint','cyan','\x20connection','getOutputSchema','value','91ylcqqK','\x0aNo\x20credential\x20settings\x20defined','\x27\x20(type:\x20','object','dim','Listing\x20connector\x20types...','connection:show','\x20connector\x20type','\x20\x20\x20\x20','properties','site','minimum','Default:\x20','enumeration','description','max','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','\x0aAvailable\x20fields:','No\x20available\x20fields\x20for\x20this\x20connector','label','error','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','431478ukFqAN','\x0aConnector:\x20','push','limit','<=\x20','\x27...','✔\x20Found\x20connection:\x20','blue','connection:types','\x20-\x20','criteria','green','map','sort','findByName','filter','type','380825rMXIEk','padStart','maximum','Listing\x20connections...','execute','stringify','Name:\x20','Usage:\x20tdx\x20connection\x20show\x20<name>\x0a\x0aArguments:\x0a\x20\x20<name>\x20\x20\x20\x20Connection\x20name\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20show\x20my-s3-connection\x0a\x20\x20tdx\x20connection\x20show\x20\x22My\x20Salesforce\x20Connection\x22','verbose','legacy_settings','legacy','Resolving\x20connector\x20type\x20or\x20name:\x20','owner','connection:schema','Fetching\x20settings\x20for\x20\x27','join','116370XKDyoT','input','localeCompare','options','list','Looking\x20up\x20connection:\x20','entries','✔\x20Resolved\x20\x27','Site:\x20','Fetching\x20schema\x20for\x20\x27','147264GzUmQq','output','connection:list','1282788DTpeTn','Range:\x20','resolve','List\x20all\x20result\x20output\x20connections','136097RNGKhO','Fetching\x20connection\x20\x27','\x27\x20as\x20connector\x20type','\x0aCredential\x20settings:','connection:settings','listTypes','hidden','Treating\x20\x27','✔\x20Found\x20schema\x20for\x20connector\x20type:\x20','216404lGDtpC','\x20\x20\x20\x20Options:\x20','bold','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','slice','data','find','>=\x20','repeat'];a15_0x2b4b=function(){return _0x143a42;};return a15_0x2b4b();}
|
|
1
|
+
const a15_0x30d6cd=a15_0x467b;function a15_0x12ab(){const _0x296f08=['listTypes','limit','\x0aAvailable\x20fields:','connection:types','Name:\x20','description','\x27\x20as\x20connector\x20type','label','22363569jOaRtC','minimum','filter','push','criteria','426295nEUVYL','data','Usage:\x20tdx\x20connection\x20show\x20<name>\x0a\x0aArguments:\x0a\x20\x20<name>\x20\x20\x20\x20Connection\x20name\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20show\x20my-s3-connection\x0a\x20\x20tdx\x20connection\x20show\x20\x22My\x20Salesforce\x20Connection\x22','Show\x20connection-level\x20settings\x20(credentials,\x20authentication)','List\x20all\x20result\x20output\x20connections','length','find','getMetadata','1299693YnaFqD','join','green','Usage:\x20tdx\x20connection\x20schema\x20<type-or-name>\x0a\x0aArguments:\x0a\x20\x20<type-or-name>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27pgsql\x27,\x20\x27s3\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20or\x20connection\x20name\x20(e.g.,\x20\x27my-salesforce-connection\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20schema\x20salesforce\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20By\x20connector\x20type\x0a\x20\x20tdx\x20connection\x20schema\x20my-s3-connection\x20\x20\x20\x20\x20#\x20By\x20connection\x20name\x0a\x20\x20tdx\x20connection\x20schema\x20pgsql\x0a\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.\x0aUse\x20\x27tdx\x20connection\x20list\x27\x20to\x20list\x20available\x20connections.','✔\x20Found\x20settings\x20for\x20connector\x20type:\x20','\x27...','✔\x20Found\x20connection:\x20','16CBNfRb','value','verbose','legacy_settings','maximum','✔\x20Resolved\x20\x27','sort','settings','output','padStart','resolve','map','connection','\x0aCredential\x20settings:','cyan','\x20\x20\x20\x20Options:\x20','\x0aConnection:\x20','1183483pCxUql','connection:show','log','\x20\x20\x20\x20','legacy','Show\x20connector\x20output\x20schema\x20for\x20connector_config\x20validation','properties','connection:schema','Fetching\x20connection\x20\x27','Listing\x20connector\x20types...','type','\x0aNo\x20fields\x20defined\x20in\x20schema','23947lSzpJe','repeat','10eHbuiO','hint','error','Show\x20connection\x20details','\x20connector\x20type','Site:\x20','>=\x20','hidden','execute','\x0aNo\x20credential\x20settings\x20defined','Fetching\x20settings\x20for\x20connector\x20type:\x20','\x0aConnector:\x20','site','Resolving\x20connector\x20type\x20or\x20name:\x20','Fetching\x20schema\x20for\x20\x27','table','Options:\x20','blue','default_value','✔\x20Found\x20','44WCLiZd','connection:settings','\x20[record]','3348954WLhlwI','input','Treating\x20\x27','Listing\x20connections...','connection:list','name','dim','bold','validate','<=\x20','1230054luolbN','record','slice','yellow','max','entries','stringify','enumeration','\x20-\x20','\x27\x20as\x20connection\x20name\x20→\x20type:\x20','List\x20available\x20connector\x20types','credential'];a15_0x12ab=function(){return _0x296f08;};return a15_0x12ab();}(function(_0x2d3711,_0x261f9f){const _0x246cbf=a15_0x467b,_0x561e92=_0x2d3711();while(!![]){try{const _0x430aca=-parseInt(_0x246cbf(0x15b))/0x1+-parseInt(_0x246cbf(0x18a))/0x2+-parseInt(_0x246cbf(0x1ab))/0x3+-parseInt(_0x246cbf(0x17d))/0x4*(-parseInt(_0x246cbf(0x1a3))/0x5)+-parseInt(_0x246cbf(0x180))/0x6+-parseInt(_0x246cbf(0x167))/0x7*(parseInt(_0x246cbf(0x1b2))/0x8)+parseInt(_0x246cbf(0x19e))/0x9*(parseInt(_0x246cbf(0x169))/0xa);if(_0x430aca===_0x261f9f)break;else _0x561e92['push'](_0x561e92['shift']());}catch(_0x47f1c4){_0x561e92['push'](_0x561e92['shift']());}}}(a15_0x12ab,0x98d1c));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import a15_0x27c881 from'chalk';function normalizeSchemaForDisplay(_0x474af2){const _0x13620f=a15_0x467b,_0x39b3ab=_0x474af2[_0x13620f(0x161)]||[],_0x209299=_0x39b3ab[_0x13620f(0x1a9)](_0x126891=>_0x126891[_0x13620f(0x185)]===_0x13620f(0x1b5)&&_0x126891[_0x13620f(0x165)]===_0x13620f(0x18b)&&_0x126891[_0x13620f(0x161)]);if(_0x209299?.[_0x13620f(0x161)]){const _0x1b1008=_0x39b3ab['filter'](_0x3ee193=>_0x3ee193[_0x13620f(0x185)]!==_0x13620f(0x15f)&&_0x3ee193[_0x13620f(0x185)]!=='legacy_settings');return[..._0x1b1008,..._0x209299[_0x13620f(0x161)]];}return _0x39b3ab[_0x13620f(0x1a0)](_0xe836cd=>_0xe836cd['name']!==_0x13620f(0x15f));}function printSchemaFields(_0x53a7a1,_0x4505c7){const _0x1c0841=a15_0x467b,_0xac53d9='\x20\x20'[_0x1c0841(0x168)](_0x4505c7+0x1),_0x281928='\x20\x20'[_0x1c0841(0x168)](_0x4505c7+0x2);for(const _0x579761 of _0x53a7a1){if(!_0x579761[_0x1c0841(0x185)])continue;const _0x34acf0=_0x579761[_0x1c0841(0x165)]===_0x1c0841(0x18b)&&_0x579761[_0x1c0841(0x161)]&&_0x579761['properties'][_0x1c0841(0x1a8)]>0x0&&_0x579761[_0x1c0841(0x185)]!==_0x1c0841(0x1b5);let _0x40b3dd=''+_0xac53d9+a15_0x27c881[_0x1c0841(0x1ad)](_0x579761[_0x1c0841(0x185)]);_0x579761['title']&&(_0x40b3dd+=':\x20'+_0x579761['title']);if(_0x579761[_0x1c0841(0x181)])_0x40b3dd+=a15_0x27c881[_0x1c0841(0x186)]('\x20['+_0x579761[_0x1c0841(0x181)]+']');else _0x34acf0&&(_0x40b3dd+=a15_0x27c881[_0x1c0841(0x186)](_0x1c0841(0x17f)));console[_0x1c0841(0x15d)](_0x40b3dd);_0x579761[_0x1c0841(0x19b)]&&console[_0x1c0841(0x15d)](''+_0x281928+a15_0x27c881['dim'](_0x579761[_0x1c0841(0x19b)]));if(_0x579761['enumeration']){const _0x48b3f8=_0x579761[_0x1c0841(0x191)]['map'](_0x220f4f=>typeof _0x220f4f==='object'&&_0x1c0841(0x1b3)in _0x220f4f?_0x220f4f[_0x1c0841(0x1b3)]:_0x220f4f)[_0x1c0841(0x1ac)](',\x20');console[_0x1c0841(0x15d)](_0x281928+_0x1c0841(0x179)+a15_0x27c881[_0x1c0841(0x18d)](_0x48b3f8));}_0x579761[_0x1c0841(0x17b)]!==undefined&&console[_0x1c0841(0x15d)](_0x281928+'Default:\x20'+a15_0x27c881[_0x1c0841(0x17a)](String(_0x579761[_0x1c0841(0x17b)])));if(_0x579761['minimum']!==undefined||_0x579761[_0x1c0841(0x1b6)]!==undefined){const _0x1c70bd=_0x579761[_0x1c0841(0x19f)]!==undefined&&_0x579761[_0x1c0841(0x1b6)]!==undefined?_0x579761[_0x1c0841(0x19f)]+_0x1c0841(0x192)+_0x579761['maximum']:_0x579761[_0x1c0841(0x19f)]!==undefined?_0x1c0841(0x16f)+_0x579761[_0x1c0841(0x19f)]:_0x1c0841(0x189)+_0x579761['maximum'];console[_0x1c0841(0x15d)](_0x281928+'Range:\x20'+a15_0x27c881[_0x1c0841(0x17a)](_0x1c70bd));}if(_0x579761[_0x1c0841(0x1a2)]){const _0x13b3ba=Object[_0x1c0841(0x18f)](_0x579761[_0x1c0841(0x1a2)])[_0x1c0841(0x1bd)](([_0x201609,_0x29ae12])=>_0x201609+'='+JSON[_0x1c0841(0x190)](_0x29ae12))[_0x1c0841(0x1ac)](',\x20');console['log'](''+_0x281928+a15_0x27c881[_0x1c0841(0x186)]('Show\x20when:\x20'+_0x13b3ba));}_0x34acf0&&_0x579761[_0x1c0841(0x161)]&&printSchemaFields(_0x579761[_0x1c0841(0x161)],_0x4505c7+0x1);}}export class ConnectionListCommand extends BaseCommand{[a15_0x30d6cd(0x185)]=a15_0x30d6cd(0x184);['description']=a15_0x30d6cd(0x1a7);async[a15_0x30d6cd(0x171)](_0x1eb2d3){const _0x3e4af8=a15_0x30d6cd,{options:_0x454797,tdx:_0x19a53d}=_0x1eb2d3;_0x454797[_0x3e4af8(0x1b4)]&&console['error'](_0x3e4af8(0x16e)+_0x454797[_0x3e4af8(0x175)]);const _0x2d8418=resolveLimit(_0x454797[_0x3e4af8(0x197)],DEFAULT_LISTING_LIMIT),_0xbea80d=await withSpinner(_0x3e4af8(0x183),()=>_0x19a53d[_0x3e4af8(0x156)]['list'](),{'verbose':_0x454797[_0x3e4af8(0x1b4)]}),_0x3a0d42=_0xbea80d[_0x3e4af8(0x1a4)];console['error']('✔\x20Found\x20'+_0x3a0d42[_0x3e4af8(0x1a8)]+'\x20connection'+(_0x3a0d42[_0x3e4af8(0x1a8)]!==0x1?'s':''));if(isStructuredFormat(_0x454797)){const _0x220b24=_0x3a0d42[_0x3e4af8(0x18c)](0x0,_0x2d8418);await handleSDKOutput(_0x220b24,{..._0x454797,'limit':_0x2d8418});}else{const _0x2145ba=_0x3a0d42['length']>0x0?Math['max'](..._0x3a0d42[_0x3e4af8(0x1bd)](_0x4aa680=>_0x4aa680[_0x3e4af8(0x165)][_0x3e4af8(0x1a8)])):0x0,_0x303135=[];for(const _0x1384b9 of _0x3a0d42){const _0x2092d7=a15_0x27c881['cyan'](_0x1384b9['type'][_0x3e4af8(0x1bb)](_0x2145ba)),_0x25f54f=_0x1384b9['owner']?.['name']?_0x3e4af8(0x192)+a15_0x27c881[_0x3e4af8(0x186)](_0x1384b9['owner'][_0x3e4af8(0x185)]):'';_0x303135[_0x3e4af8(0x1a1)](_0x2092d7+'\x20\x20'+_0x1384b9[_0x3e4af8(0x185)]+_0x25f54f);}await writeOutput(_0x303135[_0x3e4af8(0x1ac)]('\x0a'),_0x454797['output'],_0x3e4af8(0x178));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{['name']=a15_0x30d6cd(0x15c);['description']=a15_0x30d6cd(0x16c);[a15_0x30d6cd(0x188)](_0xbeccf1){const _0x441eb5=a15_0x30d6cd,{args:_0x39f7ea}=_0xbeccf1;if(!_0x39f7ea[0x0])return _0x441eb5(0x1a5);return undefined;}async[a15_0x30d6cd(0x171)](_0x40c06f){const _0x9a8c4b=a15_0x30d6cd,{options:_0x5f1604,args:_0x5b069c,tdx:_0x1e44e3}=_0x40c06f,_0x5ca2f4=_0x5b069c[0x0];_0x5f1604[_0x9a8c4b(0x1b4)]&&(console[_0x9a8c4b(0x16b)]('Site:\x20'+_0x5f1604[_0x9a8c4b(0x175)]),console['error']('Looking\x20up\x20connection:\x20'+_0x5ca2f4));const _0x3156c9=await withSpinner(_0x9a8c4b(0x163)+_0x5ca2f4+_0x9a8c4b(0x1b0),()=>_0x1e44e3[_0x9a8c4b(0x156)][_0x9a8c4b(0x1bc)](_0x5ca2f4),{'verbose':_0x5f1604[_0x9a8c4b(0x1b4)]}),_0x39072a=_0x3156c9[_0x9a8c4b(0x1a4)];return console[_0x9a8c4b(0x16b)](_0x9a8c4b(0x1b1)+_0x39072a[_0x9a8c4b(0x185)]),await handleSingleObjectOutput(_0x39072a,_0x5f1604),0x0;}}export class ConnectionSchemaCommand extends BaseCommand{['name']=a15_0x30d6cd(0x162);[a15_0x30d6cd(0x19b)]=a15_0x30d6cd(0x160);[a15_0x30d6cd(0x188)](_0x4aeb15){const _0x4c3d81=a15_0x30d6cd,{args:_0x199694}=_0x4aeb15;if(!_0x199694[0x0])return _0x4c3d81(0x1ae);return undefined;}async[a15_0x30d6cd(0x171)](_0x4df1e7){const _0x3b607e=a15_0x30d6cd,{options:_0x5c60d1,args:_0x1d1d04,tdx:_0x551196}=_0x4df1e7,_0xc75fad=_0x1d1d04[0x0];_0x5c60d1[_0x3b607e(0x1b4)]&&(console[_0x3b607e(0x16b)](_0x3b607e(0x16e)+_0x5c60d1['site']),console['error'](_0x3b607e(0x176)+_0xc75fad));let _0x147f4c=_0xc75fad,_0x8ea97d;try{const _0x117642=await _0x551196[_0x3b607e(0x156)]['findByName'](_0xc75fad);_0x117642&&(_0x147f4c=_0x117642[_0x3b607e(0x165)],_0x8ea97d=_0x117642[_0x3b607e(0x185)],_0x5c60d1['verbose']&&console['error'](_0x3b607e(0x1b7)+_0xc75fad+_0x3b607e(0x193)+_0x147f4c));}catch{_0x5c60d1[_0x3b607e(0x1b4)]&&console[_0x3b607e(0x16b)](_0x3b607e(0x182)+_0xc75fad+_0x3b607e(0x19c));}const _0x5ead72=await withSpinner(_0x3b607e(0x177)+_0x147f4c+'\x27...',()=>_0x551196[_0x3b607e(0x156)]['getOutputSchema'](_0x147f4c),{'verbose':_0x5c60d1[_0x3b607e(0x1b4)]}),_0x419aa8=_0x5ead72['data'];_0x8ea97d?console['error']('✔\x20Found\x20schema\x20for\x20connection\x20\x27'+_0x8ea97d+'\x27\x20(type:\x20'+_0x147f4c+')'):console['error']('✔\x20Found\x20schema\x20for\x20connector\x20type:\x20'+_0x147f4c);if(isStructuredFormat(_0x5c60d1))await handleSingleObjectOutput(_0x419aa8,_0x5c60d1);else{const _0x4f5f09=normalizeSchemaForDisplay(_0x419aa8);_0x8ea97d?(console[_0x3b607e(0x15d)](_0x3b607e(0x15a)+a15_0x27c881[_0x3b607e(0x158)](_0x8ea97d)),console[_0x3b607e(0x15d)]('Type:\x20'+a15_0x27c881[_0x3b607e(0x186)](_0x147f4c))):console[_0x3b607e(0x15d)](_0x3b607e(0x174)+a15_0x27c881[_0x3b607e(0x158)](_0x147f4c)),_0x4f5f09[_0x3b607e(0x1a8)]>0x0?(console[_0x3b607e(0x15d)](a15_0x27c881['bold'](_0x3b607e(0x198))),printSchemaFields(_0x4f5f09,0x0)):console[_0x3b607e(0x15d)](a15_0x27c881['dim'](_0x3b607e(0x166)));}return 0x0;}}export class ConnectionTypesCommand extends BaseCommand{[a15_0x30d6cd(0x185)]=a15_0x30d6cd(0x199);['description']=a15_0x30d6cd(0x194);async[a15_0x30d6cd(0x171)](_0x11b432){const _0x375f01=a15_0x30d6cd,{options:_0xef71a1,tdx:_0x4a4423}=_0x11b432;_0xef71a1['verbose']&&console['error'](_0x375f01(0x16e)+_0xef71a1[_0x375f01(0x175)]);const _0xe74489=await withSpinner(_0x375f01(0x164),()=>_0x4a4423['connection'][_0x375f01(0x196)](),{'verbose':_0xef71a1[_0x375f01(0x1b4)]}),_0x291646=_0xe74489[_0x375f01(0x1a4)][_0x375f01(0x1b8)]((_0x45b567,_0x5580ca)=>_0x45b567[_0x375f01(0x165)]['localeCompare'](_0x5580ca[_0x375f01(0x165)]));console[_0x375f01(0x16b)](_0x375f01(0x17c)+_0x291646[_0x375f01(0x1a8)]+_0x375f01(0x16d)+(_0x291646['length']!==0x1?'s':''));if(isStructuredFormat(_0xef71a1))await handleSDKOutput(_0x291646,_0xef71a1);else{const _0x5b4e8f=_0x291646[_0x375f01(0x1a8)]>0x0?Math[_0x375f01(0x18e)](..._0x291646[_0x375f01(0x1bd)](_0x1f73d5=>_0x1f73d5[_0x375f01(0x165)][_0x375f01(0x1a8)])):0x0,_0x4c9d92=[];for(const _0x4b0925 of _0x291646){const _0xb13cc0=a15_0x27c881[_0x375f01(0x158)](_0x4b0925[_0x375f01(0x165)][_0x375f01(0x1bb)](_0x5b4e8f));_0x4c9d92['push'](_0xb13cc0+'\x20\x20'+_0x4b0925[_0x375f01(0x185)]);}await writeOutput(_0x4c9d92[_0x375f01(0x1ac)]('\x0a'),_0xef71a1[_0x375f01(0x1ba)],_0x375f01(0x178));}return 0x0;}}function a15_0x467b(_0x2ebf54,_0x3f949c){_0x2ebf54=_0x2ebf54-0x156;const _0x12ab87=a15_0x12ab();let _0x467bc0=_0x12ab87[_0x2ebf54];return _0x467bc0;}export class ConnectionSettingsCommand extends BaseCommand{[a15_0x30d6cd(0x185)]=a15_0x30d6cd(0x17e);[a15_0x30d6cd(0x19b)]=a15_0x30d6cd(0x1a6);['validate'](_0xecef03){const {args:_0x351cf3}=_0xecef03;if(!_0x351cf3[0x0])return'Usage:\x20tdx\x20connection\x20settings\x20<type>\x0a\x0aArguments:\x0a\x20\x20<type>\x20\x20\x20\x20Connector\x20type\x20(e.g.,\x20\x27salesforce\x27,\x20\x27rest\x27,\x20\x27s3\x27)\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20settings\x20rest\x0a\x20\x20tdx\x20connection\x20settings\x20salesforce\x0a\x20\x20tdx\x20connection\x20settings\x20s3\x0a\x0aNote:\x20This\x20shows\x20settings\x20for\x20creating/configuring\x20a\x20connection.\x0aFor\x20activation\x20output\x20settings,\x20use\x20\x27tdx\x20connection\x20schema\x20<type>\x27.\x0aUse\x20\x27tdx\x20connection\x20types\x27\x20to\x20list\x20available\x20connector\x20types.';return undefined;}async[a15_0x30d6cd(0x171)](_0x274441){const _0x148cfd=a15_0x30d6cd,{options:_0x4f2440,args:_0xc23b2,tdx:_0x317393}=_0x274441,_0x5513de=_0xc23b2[0x0];_0x4f2440['verbose']&&(console[_0x148cfd(0x16b)](_0x148cfd(0x16e)+_0x4f2440[_0x148cfd(0x175)]),console[_0x148cfd(0x16b)](_0x148cfd(0x173)+_0x5513de));const _0x35b2ee=await withSpinner('Fetching\x20settings\x20for\x20\x27'+_0x5513de+_0x148cfd(0x1b0),()=>_0x317393[_0x148cfd(0x156)][_0x148cfd(0x1aa)](_0x5513de),{'verbose':_0x4f2440['verbose']}),_0x38e1c8=_0x35b2ee[_0x148cfd(0x1a4)];console['error'](_0x148cfd(0x1af)+_0x5513de);if(isStructuredFormat(_0x4f2440))await handleSingleObjectOutput(_0x38e1c8,_0x4f2440);else{console[_0x148cfd(0x15d)](_0x148cfd(0x174)+a15_0x27c881[_0x148cfd(0x158)](_0x5513de)),console[_0x148cfd(0x15d)](_0x148cfd(0x19a)+_0x38e1c8[_0x148cfd(0x185)]);const _0x132efc=_0x38e1c8[_0x148cfd(0x1b9)]||[],_0x4af7fc=_0x132efc[_0x148cfd(0x1a0)](_0x4b09b4=>_0x4b09b4[_0x148cfd(0x195)]);_0x4af7fc[_0x148cfd(0x1a8)]>0x0&&(console[_0x148cfd(0x15d)](a15_0x27c881[_0x148cfd(0x187)](_0x148cfd(0x157))),printMetadataSettings(_0x4af7fc));let _0x1fc0bc=![];try{const _0x5f38c7=await _0x317393[_0x148cfd(0x156)]['getOutputSchema'](_0x5513de),_0x3c555b=normalizeSchemaForDisplay(_0x5f38c7);_0x3c555b['length']>0x0&&(console[_0x148cfd(0x15d)](a15_0x27c881['bold'](_0x148cfd(0x198))),printSchemaFields(_0x3c555b,0x0),_0x1fc0bc=!![]);}catch{const _0x254da9=_0x132efc[_0x148cfd(0x1a0)](_0x2f9267=>!_0x2f9267[_0x148cfd(0x195)]);_0x254da9[_0x148cfd(0x1a8)]>0x0&&(console[_0x148cfd(0x15d)](a15_0x27c881[_0x148cfd(0x187)](_0x148cfd(0x198))),printMetadataSettings(_0x254da9),_0x1fc0bc=!![]);}!_0x1fc0bc&&_0x4f2440[_0x148cfd(0x1b4)]&&console['error'](a15_0x27c881[_0x148cfd(0x186)]('No\x20available\x20fields\x20for\x20this\x20connector')),_0x4af7fc['length']===0x0&&console[_0x148cfd(0x15d)](a15_0x27c881[_0x148cfd(0x186)](_0x148cfd(0x172)));}return 0x0;}}function printMetadataSettings(_0x5942b2){const _0x4f3707=a15_0x30d6cd;for(const _0x46b1fa of _0x5942b2){if(!_0x46b1fa[_0x4f3707(0x185)])continue;if(_0x46b1fa[_0x4f3707(0x170)])continue;let _0x4ce7ac='\x20\x20'+a15_0x27c881['green'](_0x46b1fa[_0x4f3707(0x185)]);_0x46b1fa[_0x4f3707(0x19d)]&&(_0x4ce7ac+=':\x20'+_0x46b1fa['label']);_0x46b1fa[_0x4f3707(0x165)]&&(_0x4ce7ac+=a15_0x27c881[_0x4f3707(0x186)]('\x20['+_0x46b1fa[_0x4f3707(0x165)]+']'));console['log'](_0x4ce7ac);_0x46b1fa['hint']&&console[_0x4f3707(0x15d)]('\x20\x20\x20\x20'+a15_0x27c881['dim'](_0x46b1fa[_0x4f3707(0x16a)]));if(_0x46b1fa['options']){const _0x33b75c=_0x46b1fa['options']['map'](_0x498769=>_0x498769['value'])['join'](',\x20');console[_0x4f3707(0x15d)](_0x4f3707(0x159)+a15_0x27c881['yellow'](_0x33b75c));}_0x46b1fa[_0x4f3707(0x17b)]!==undefined&&_0x46b1fa[_0x4f3707(0x17b)]!==null&&console['log']('\x20\x20\x20\x20Default:\x20'+a15_0x27c881['blue'](String(_0x46b1fa[_0x4f3707(0x17b)])));if(_0x46b1fa['criteria']){const _0x2eb327=Object['entries'](_0x46b1fa[_0x4f3707(0x1a2)])[_0x4f3707(0x1bd)](([_0x12c438,_0x29c776])=>_0x12c438+'='+JSON[_0x4f3707(0x190)](_0x29c776))['join'](',\x20');console[_0x4f3707(0x15d)](_0x4f3707(0x15e)+a15_0x27c881['dim']('Show\x20when:\x20'+_0x2eb327));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a16_0x1e8f72=a16_0x442c;(function(_0x548844,_0x13c8cb){const _0x39dbcf=a16_0x442c,_0xf7a8b3=_0x548844();while(!![]){try{const _0x3bde8f=parseInt(_0x39dbcf(0x96))/0x1+-parseInt(_0x39dbcf(0x8e))/0x2*(-parseInt(_0x39dbcf(0x8d))/0x3)+-parseInt(_0x39dbcf(0x9d))/0x4+-parseInt(_0x39dbcf(0x87))/0x5+parseInt(_0x39dbcf(0x84))/0x6+-parseInt(_0x39dbcf(0x92))/0x7+-parseInt(_0x39dbcf(0x9f))/0x8;if(_0x3bde8f===_0x13c8cb)break;else _0xf7a8b3['push'](_0xf7a8b3['shift']());}catch(_0x252157){_0xf7a8b3['push'](_0xf7a8b3['shift']());}}}(a16_0x553c,0x85af0));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';function a16_0x553c(){const _0x508f2a=['Site:\x20','243838LkRMrx','Pattern:\x20','limit','site','700287kzqcii','length','\x20\x20Cause:\x20','Listing\x20databases...','verbose','database_name','query','2412068JfIsul','execute','656136CenvPF','Error:\x20','3105132Ywardf','data','cause','2491330vwAVHu','List\x20all\x20databases','message','listDatabases','error','\x20database','182631upCbbP','18GzVlxb','✔\x20Found\x20','📦\x20'];a16_0x553c=function(){return _0x508f2a;};return a16_0x553c();}function a16_0x442c(_0x1883b9,_0x3a9fad){_0x1883b9=_0x1883b9-0x83;const _0x553c8f=a16_0x553c();let _0x442cf5=_0x553c8f[_0x1883b9];return _0x442cf5;}export class DatabasesCommand extends BaseCommand{['name']='databases';['description']=a16_0x1e8f72(0x88);async[a16_0x1e8f72(0x9e)](_0x23fc87){const _0x19517a=a16_0x1e8f72,{options:_0x596bd5,args:_0x548acc,tdx:_0xe6197e}=_0x23fc87,_0x206152=_0x548acc[0x0];try{_0x596bd5[_0x19517a(0x9a)]&&(console['error'](_0x19517a(0x91)+_0x596bd5[_0x19517a(0x95)]),_0x206152&&console[_0x19517a(0x8b)](_0x19517a(0x93)+_0x206152));const _0x3c0a55=resolveLimit(_0x596bd5[_0x19517a(0x94)],DEFAULT_LISTING_LIMIT),_0x4ce4bd=await withSpinner(_0x19517a(0x99),()=>_0xe6197e[_0x19517a(0x9c)][_0x19517a(0x8a)](_0x206152,_0x3c0a55),{'verbose':_0x596bd5[_0x19517a(0x9a)]}),_0x30783a=_0x4ce4bd[_0x19517a(0x85)];console['error'](_0x19517a(0x8f)+_0x30783a[_0x19517a(0x97)]+_0x19517a(0x8c)+(_0x30783a[_0x19517a(0x97)]!==0x1?'s':''));if(isStructuredFormat(_0x596bd5))await handleSDKOutput(_0x30783a,{..._0x596bd5,'limit':_0x3c0a55});else for(const _0x41cb47 of _0x30783a){console['log'](_0x19517a(0x90)+_0x41cb47[_0x19517a(0x9b)]);}return 0x0;}catch(_0x243940){if(_0x243940 instanceof SDKError)return console[_0x19517a(0x8b)](_0x19517a(0x83)+_0x243940[_0x19517a(0x89)]),_0x243940[_0x19517a(0x86)]&&console['error'](_0x19517a(0x98)+_0x243940[_0x19517a(0x86)]),0x1;throw _0x243940;}}}
|