@treasuredata/tdx 2026.3.53 → 2026.3.54
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
|
|
1
|
+
const a3_0xa7f428=a3_0x1062;(function(_0x1302c1,_0xeb4f5b){const _0x4b8229=a3_0x1062,_0x50ca65=_0x1302c1();while(!![]){try{const _0xd1f0b4=-parseInt(_0x4b8229(0x126))/0x1*(parseInt(_0x4b8229(0x130))/0x2)+-parseInt(_0x4b8229(0x127))/0x3*(parseInt(_0x4b8229(0x133))/0x4)+parseInt(_0x4b8229(0x137))/0x5*(-parseInt(_0x4b8229(0x11d))/0x6)+-parseInt(_0x4b8229(0x132))/0x7+-parseInt(_0x4b8229(0x120))/0x8*(-parseInt(_0x4b8229(0x12f))/0x9)+parseInt(_0x4b8229(0x129))/0xa+parseInt(_0x4b8229(0x136))/0xb;if(_0xd1f0b4===_0xeb4f5b)break;else _0x50ca65['push'](_0x50ca65['shift']());}catch(_0x9457e5){_0x50ca65['push'](_0x50ca65['shift']());}}}(a3_0x2844,0xc082f));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x2844(){const _0x1a016f=['10497210DeQppc','listActivations','activations','Error:\x20','error','length','18IEZPGR','14XDwCeg','data','1203167KZgFza','964ngFxBu','Resolved\x20parent\x20ID:\x20','resolveSegmentId','7757442WUaEra','2155rMtaSK','\x20\x20Cause:\x20','Resolved\x20child\x20ID:\x20','name','\x20activation','Resolving\x20parent\x20segment\x20\x27','message','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','site','\x27...','verbose','5430buIxRo','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','cause','5132392UOWjsi','Resolving\x20child\x20segment\x20\x27','Listing\x20activations\x20for\x20segment\x20\x27','Error:\x20Segment\x20name\x20is\x20required','description','segment','28073JIiRkS','18561XCOOVN','resolveParentId'];a3_0x2844=function(){return _0x1a016f;};return a3_0x2844();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x1062(_0x4c1f8b,_0x95ff5d){_0x4c1f8b=_0x4c1f8b-0x116;const _0x284412=a3_0x2844();let _0x10621d=_0x284412[_0x4c1f8b];return _0x10621d;}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0xa7f428(0x13a)]=a3_0xa7f428(0x12b);[a3_0xa7f428(0x124)]='List\x20activations\x20for\x20a\x20segment';async['execute'](_0x1b7ac7){const _0x1c65dc=a3_0xa7f428,{options:_0x57ab3c,args:_0x39d3ab,tdx:_0x2bc3af}=_0x1b7ac7;if(_0x39d3ab[_0x1c65dc(0x12e)]===0x0)return console[_0x1c65dc(0x12d)](_0x1c65dc(0x123)),console[_0x1c65dc(0x12d)](_0x1c65dc(0x119)),0x1;try{const {parentId:_0x42ce4c,childId:_0x235807}=parseSegmentRef(_0x39d3ab[0x0]);if(!_0x235807)return console[_0x1c65dc(0x12d)](_0x1c65dc(0x11e)),console[_0x1c65dc(0x12d)](_0x1c65dc(0x119)),0x1;_0x57ab3c[_0x1c65dc(0x11c)]&&(console['error']('Site:\x20'+_0x57ab3c[_0x1c65dc(0x11a)]),console[_0x1c65dc(0x12d)]('Parent\x20name:\x20'+_0x42ce4c),console[_0x1c65dc(0x12d)]('Child\x20name:\x20'+_0x235807));const _0x425a4b=await withSpinner(_0x1c65dc(0x117)+_0x42ce4c+_0x1c65dc(0x11b),()=>_0x2bc3af[_0x1c65dc(0x125)][_0x1c65dc(0x128)](_0x42ce4c),{'verbose':_0x57ab3c['verbose']}),_0x2e7f70=_0x425a4b[_0x1c65dc(0x131)];_0x57ab3c['verbose']&&console['error'](_0x1c65dc(0x134)+_0x2e7f70);const _0x275078=await withSpinner(_0x1c65dc(0x121)+_0x235807+_0x1c65dc(0x11b),()=>_0x2bc3af[_0x1c65dc(0x125)][_0x1c65dc(0x135)](_0x2e7f70,_0x235807),{'verbose':_0x57ab3c['verbose']}),_0x33a39f=_0x275078[_0x1c65dc(0x131)];_0x57ab3c[_0x1c65dc(0x11c)]&&console[_0x1c65dc(0x12d)](_0x1c65dc(0x139)+_0x33a39f);const _0xb264a3=await withSpinner(_0x1c65dc(0x122)+_0x235807+'\x27...',()=>_0x2bc3af[_0x1c65dc(0x125)][_0x1c65dc(0x12a)](_0x2e7f70,_0x33a39f),{'verbose':_0x57ab3c[_0x1c65dc(0x11c)]}),_0x2fb26b=_0xb264a3['data'];return console[_0x1c65dc(0x12d)]('✔\x20Found\x20'+_0x2fb26b[_0x1c65dc(0x12e)]+_0x1c65dc(0x116)+(_0x2fb26b['length']!==0x1?'s':'')),await handleSDKOutput(_0x2fb26b,_0x57ab3c),0x0;}catch(_0x3ff363){if(_0x3ff363 instanceof SDKError)return console[_0x1c65dc(0x12d)](_0x1c65dc(0x12c)+_0x3ff363[_0x1c65dc(0x118)]),_0x3ff363[_0x1c65dc(0x11f)]&&console[_0x1c65dc(0x12d)](_0x1c65dc(0x138)+_0x3ff363[_0x1c65dc(0x11f)]),0x1;throw _0x3ff363;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x5044ec=a4_0x2b0f;(function(_0x12b013,_0x50a683){const _0x2d4df7=a4_0x2b0f,_0x2e7ef9=_0x12b013();while(!![]){try{const _0x48eaf6=-parseInt(_0x2d4df7(0x1cb))/0x1*(-parseInt(_0x2d4df7(0x1f7))/0x2)+-parseInt(_0x2d4df7(0x157))/0x3+parseInt(_0x2d4df7(0x151))/0x4*(parseInt(_0x2d4df7(0x1ef))/0x5)+-parseInt(_0x2d4df7(0x155))/0x6+parseInt(_0x2d4df7(0x1d2))/0x7+parseInt(_0x2d4df7(0x15c))/0x8*(parseInt(_0x2d4df7(0x1a0))/0x9)+-parseInt(_0x2d4df7(0x17b))/0xa*(parseInt(_0x2d4df7(0x153))/0xb);if(_0x48eaf6===_0x50a683)break;else _0x2e7ef9['push'](_0x2e7ef9['shift']());}catch(_0x1875a9){_0x2e7ef9['push'](_0x2e7ef9['shift']());}}}(a4_0x4209,0x7525c));import a4_0x4a1a27 from'chalk';function a4_0x4209(){const _0x390ebc=['Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Using\x20local\x20project:\x20','\x22...','\x20new','isNew','agentName','updated','Output\x20path:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','no_context','Dry\x20run\x20-\x20no\x20changes\x20made','repeat','Would\x20clone:','Failed\x20to\x20push\x20agent:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20\x20Source:\x20','Writing\x20files...','\x20\x20tdx\x20agent\x20pull\x20','error','Source:\x20','\x20files?','source','1480lIdpkX','push','\x22\x20to\x20\x22','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','join','\x20changed','\x20resources\x20to\x20\x27','-\x20no\x20files\x20written','612902YiTuWx','Status:\x20','Analyzing\x20changes\x20to\x20push...','agents','\x20\x20Prompt\x20\x22','output','description','\x0aError:','\x20\x20Knowledge\x20Base\x20\x22','llm','Using\x20project:\x20','log','Cannot\x20clone\x20from\x20context\x20project\x20\x22','outputPath','9472oMlSWx','profile','47949MRinXM','cwd-config','3089250NfEZPf','Agent:\x20','847062jUiJYP','Project:\x20','\x20files\x20to\x20','\x20created','dirname','856kwBWDR','site','New\x20project\x20name\x20is\x20required','\x0aPush\x20summary\x20for\x20\x27','<new-name>','outputDir','\x20resources?','total','\x20\x20Experimental\x20Artifact\x20\x22','agent.yml','Errors:','green','newProjectName','red','\x20\x20Experimental\x20Artifacts:\x20','agent:push','Analyzing\x20project\x20\x22','action','MISSING_ARGUMENT','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','new','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','projectName','\x20\x20Agents:\x20','Using\x20project\x20from\x20','Summary:','✔\x20Context\x20set:\x20','\x22\x20from\x20project\x20\x22','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Integration\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','2220qwsYNc','unchanged','errors','llm_project','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','Pushing\x20agent\x20from\x20\x22','no_local_folder','\x20|\x20','llmProject','newProjectId','pushProject','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','utf-8','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','message','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','context','Cancelled','agent','-\x20nothing\x20pushed','integrations','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20\x20Prompts:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','prompts','hasChanges','Clone\x20\x22','pullAgent','\x0aChanges\x20to\x20agent\x20\x27','New\x20project\x20ID:\x20','Project\x20cloned\x20successfully','Agent\x20','Dry\x20run\x20-\x20no\x20files\x20written','Pushing\x20to\x20project...','\x22:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','yes','43731OJkGVf','Chat:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','arg-dir','Using\x20context\x20project:\x20','dim','pullProject','execute','New\x20project:\x20','tdx.json','experimentalKnowledgeBases','reason','projectId','\x0aChanges\x20to\x20prompt\x20\x27','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aWrite\x20','name','\x20=\x20','Project\x20cloned\x20with\x20errors','\x20\x20Knowledge\x20Bases:\x20','cyan','counts','parse','\x0aErrors\x20found:','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20--profile\x20','textKnowledgeBases','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','force','yellow','sourceProjectName','\x0aChanges\x20to\x20integration\x20\x27','agent:clone','diff','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x20\x20Agent\x20\x22','found','\x20successfully','experimentalArtifacts','cwd','Using\x20current\x20project:\x20','3NfOkSA','\x20\x20Text\x20Knowledge\x20Bases:\x20','gray','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x0aPull\x20summary\x20for\x20\x27','\x20\x20Integrations:\x20','Would\x20pull\x20agent:\x20','731983ocyIzV','\x20unchanged','agentId','\x20errors','knowledgeBases','created','session'];a4_0x4209=function(){return _0x390ebc;};return a4_0x4209();}import a4_0x5c7fd4 from'path';import{existsSync,readFileSync}from'fs';function a4_0x2b0f(_0x306be4,_0x54d2b9){_0x306be4=_0x306be4-0x150;const _0x4209e0=a4_0x4209();let _0x2b0f3d=_0x4209e0[_0x306be4];return _0x2b0f3d;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x41ab3e){const _0x16257b=a4_0x2b0f,_0x2e484c=[];if(_0x41ab3e[_0x16257b(0x163)]!==undefined)_0x2e484c[_0x16257b(0x1f0)](_0x41ab3e[_0x16257b(0x163)]+'\x20total');if(_0x41ab3e[_0x16257b(0x170)]!==undefined&&_0x41ab3e[_0x16257b(0x170)]>0x0)_0x2e484c[_0x16257b(0x1f0)](a4_0x4a1a27[_0x16257b(0x167)](_0x41ab3e[_0x16257b(0x170)]+_0x16257b(0x1dc)));if(_0x41ab3e[_0x16257b(0x1d7)]!==undefined&&_0x41ab3e['created']>0x0)_0x2e484c['push'](a4_0x4a1a27['green'](_0x41ab3e[_0x16257b(0x1d7)]+_0x16257b(0x15a)));if(_0x41ab3e[_0x16257b(0x1df)]!==undefined&&_0x41ab3e[_0x16257b(0x1df)]>0x0)_0x2e484c[_0x16257b(0x1f0)](a4_0x4a1a27[_0x16257b(0x1bd)](_0x41ab3e['updated']+'\x20updated'));if(_0x41ab3e[_0x16257b(0x17c)]!==undefined&&_0x41ab3e[_0x16257b(0x17c)]>0x0)_0x2e484c[_0x16257b(0x1f0)](a4_0x4a1a27[_0x16257b(0x1cd)](_0x41ab3e[_0x16257b(0x17c)]+_0x16257b(0x1d3)));if(_0x41ab3e[_0x16257b(0x17d)]!==undefined&&_0x41ab3e[_0x16257b(0x17d)]>0x0)_0x2e484c[_0x16257b(0x1f0)](a4_0x4a1a27[_0x16257b(0x169)](_0x41ab3e[_0x16257b(0x17d)]+_0x16257b(0x1d5)));return _0x2e484c[_0x16257b(0x1f3)](',\x20');}function displayDiffs(_0x11c84c,_0x274027,_0x5b4fac,_0x81a56,_0x164992,_0x375832,_0x193d99){const _0x1b4af5=a4_0x2b0f;for(const _0x459c68 of _0x11c84c){if(_0x459c68['diff']){const _0x4447d4=_0x459c68[_0x1b4af5(0x1de)]||_0x459c68[_0x1b4af5(0x1b0)];console[_0x1b4af5(0x202)](_0x1b4af5(0x197)+_0x4447d4+'\x27:'),console[_0x1b4af5(0x202)]('─'[_0x1b4af5(0x1e4)](0x3c)),console['log'](_0x459c68[_0x1b4af5(0x1c1)]),console['log']('─'[_0x1b4af5(0x1e4)](0x3c));}}for(const _0x501e5f of _0x274027){_0x501e5f[_0x1b4af5(0x1c1)]&&(console[_0x1b4af5(0x202)](_0x1b4af5(0x19e)+_0x501e5f[_0x1b4af5(0x1b0)]+'\x27:'),console[_0x1b4af5(0x202)]('─'[_0x1b4af5(0x1e4)](0x3c)),console['log'](_0x501e5f[_0x1b4af5(0x1c1)]),console['log']('─'[_0x1b4af5(0x1e4)](0x3c)));}for(const _0x42ec96 of _0x5b4fac){_0x42ec96[_0x1b4af5(0x1c1)]&&(console[_0x1b4af5(0x202)](_0x1b4af5(0x171)+_0x42ec96[_0x1b4af5(0x1b0)]+'\x27:'),console[_0x1b4af5(0x202)]('─'['repeat'](0x3c)),console['log'](_0x42ec96[_0x1b4af5(0x1c1)]),console[_0x1b4af5(0x202)]('─'['repeat'](0x3c)));}for(const _0x18ea81 of _0x81a56){_0x18ea81[_0x1b4af5(0x1c1)]&&(console[_0x1b4af5(0x202)](_0x1b4af5(0x1ad)+_0x18ea81[_0x1b4af5(0x1b0)]+'\x27:'),console[_0x1b4af5(0x202)]('─'[_0x1b4af5(0x1e4)](0x3c)),console[_0x1b4af5(0x202)](_0x18ea81[_0x1b4af5(0x1c1)]),console[_0x1b4af5(0x202)]('─'[_0x1b4af5(0x1e4)](0x3c)));}for(const _0x5e7fc6 of _0x164992){_0x5e7fc6[_0x1b4af5(0x1c1)]&&(console[_0x1b4af5(0x202)](_0x1b4af5(0x1bf)+_0x5e7fc6[_0x1b4af5(0x1b0)]+'\x27:'),console['log']('─'[_0x1b4af5(0x1e4)](0x3c)),console[_0x1b4af5(0x202)](_0x5e7fc6['diff']),console[_0x1b4af5(0x202)]('─'[_0x1b4af5(0x1e4)](0x3c)));}for(const _0x115dad of _0x375832){_0x115dad[_0x1b4af5(0x1c1)]&&(console[_0x1b4af5(0x202)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x115dad[_0x1b4af5(0x1b0)]+'\x27:'),console[_0x1b4af5(0x202)]('─'[_0x1b4af5(0x1e4)](0x3c)),console['log'](_0x115dad[_0x1b4af5(0x1c1)]),console['log']('─'[_0x1b4af5(0x1e4)](0x3c)));}for(const _0x5615c5 of _0x193d99){_0x5615c5[_0x1b4af5(0x1c1)]&&(console['log'](_0x1b4af5(0x186)+_0x5615c5[_0x1b4af5(0x1b0)]+'\x27:'),console[_0x1b4af5(0x202)]('─'[_0x1b4af5(0x1e4)](0x3c)),console[_0x1b4af5(0x202)](_0x5615c5[_0x1b4af5(0x1c1)]),console[_0x1b4af5(0x202)]('─'[_0x1b4af5(0x1e4)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x5044ec(0x1b0)]='agent:pull';[a4_0x5044ec(0x1fd)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x5044ec(0x1a7)](_0x5c9da2){const _0x5ddb03=a4_0x5044ec,{options:_0x339aff,args:_0x39bef9,tdx:_0x5009ce}=_0x5c9da2,_0x334185=_0x39bef9[0x0],_0x5087fe=_0x39bef9[0x1],_0x11f800=_0x339aff[_0x5ddb03(0x1fc)],_0x591ba8=_0x339aff['dryRun'],_0x2d5154=_0x339aff[_0x5ddb03(0x1bc)],_0x2d3392=_0x339aff['yes'],_0x15faab=_0x339aff['llmProject'],_0x46b704=_0x339aff[_0x5ddb03(0x18d)];let _0x5aef5e;if(_0x334185){const _0x177094=a4_0x5c7fd4[_0x5ddb03(0x1f3)](_0x334185,_0x5ddb03(0x1a9));if(existsSync(_0x177094))try{const _0x370cfb=JSON[_0x5ddb03(0x1b6)](readFileSync(_0x177094,_0x5ddb03(0x187)));_0x370cfb[_0x5ddb03(0x17e)]&&(_0x5aef5e={'llm_project':_0x370cfb[_0x5ddb03(0x17e)]});}catch{}}const _0x2b7716=findAgentConfigPath(process[_0x5ddb03(0x1c9)]());let _0x251bc7;if(_0x2b7716)try{const _0x4d02cf=JSON[_0x5ddb03(0x1b6)](readFileSync(_0x2b7716,_0x5ddb03(0x187)));_0x4d02cf[_0x5ddb03(0x17e)]&&(_0x251bc7={'llm_project':_0x4d02cf[_0x5ddb03(0x17e)]});}catch{}const _0x4720d8=resolveAgentPullArgs({'arg':_0x334185,'agentNameArg':_0x5087fe,'agentFlag':_0x46b704,'contextProject':_0x15faab,'argDirConfig':_0x5aef5e,'cwdConfigPath':_0x2b7716||undefined,'cwdConfig':_0x251bc7}),{projectNameOrId:_0x136cfd,targetAgentName:_0x2c4a96,existingOutputDir:_0x2d5db8,source:_0x584b9b}=_0x4720d8;if(_0x584b9b===_0x5ddb03(0x1a3))console[_0x5ddb03(0x202)](a4_0x4a1a27[_0x5ddb03(0x1a5)](_0x5ddb03(0x174)+a4_0x5c7fd4['join'](_0x334185,_0x5ddb03(0x1a9))+':\x20'+_0x136cfd));else{if(_0x584b9b===_0x5ddb03(0x154))console[_0x5ddb03(0x202)](a4_0x4a1a27['dim']('Using\x20project:\x20'+_0x136cfd));else _0x584b9b===_0x5ddb03(0x18b)&&console['log'](a4_0x4a1a27[_0x5ddb03(0x1a5)]('Using\x20project\x20from\x20context:\x20'+_0x136cfd));}if(!_0x136cfd)return _0x46b704?(console[_0x5ddb03(0x202)](a4_0x4a1a27[_0x5ddb03(0x1bd)](_0x5ddb03(0x1e7))),console[_0x5ddb03(0x202)](_0x5ddb03(0x16f)),console['log']('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console['log'](a4_0x4a1a27['yellow']('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x5ddb03(0x202)](_0x5ddb03(0x17f)),console[_0x5ddb03(0x202)](_0x5ddb03(0x190)),console['log'](_0x5ddb03(0x1c4)),console[_0x5ddb03(0x202)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console[_0x5ddb03(0x202)](_0x5ddb03(0x17a))),0x1;if(_0x2c4a96){const {data:_0x1032c8}=await withSpinner('Pulling\x20agent\x20\x22'+_0x2c4a96+_0x5ddb03(0x177)+_0x136cfd+_0x5ddb03(0x1db),()=>_0x5009ce[_0x5ddb03(0x200)][_0x5ddb03(0x196)](_0x136cfd,_0x2c4a96,_0x11f800,{'dryRun':_0x591ba8,'force':_0x2d5154}));if(_0x591ba8)return console[_0x5ddb03(0x202)](a4_0x4a1a27[_0x5ddb03(0x1bd)](_0x5ddb03(0x19b))),console['log'](_0x5ddb03(0x1d1)+_0x1032c8[_0x5ddb03(0x1de)]),console[_0x5ddb03(0x202)](_0x5ddb03(0x1e0)+_0x1032c8[_0x5ddb03(0x150)]),_0x1032c8[_0x5ddb03(0x1c1)]&&(console['log']('\x0aChanges:'),console[_0x5ddb03(0x202)]('─'[_0x5ddb03(0x1e4)](0x3c)),console[_0x5ddb03(0x202)](_0x1032c8[_0x5ddb03(0x1c1)]),console[_0x5ddb03(0x202)]('─'['repeat'](0x3c))),0x0;return console[_0x5ddb03(0x202)](a4_0x4a1a27[_0x5ddb03(0x167)]('Agent\x20pulled\x20successfully')),console[_0x5ddb03(0x202)](_0x5ddb03(0x156)+_0x1032c8['agentName']),console[_0x5ddb03(0x202)]('Output:\x20'+_0x1032c8[_0x5ddb03(0x150)]),console[_0x5ddb03(0x202)](_0x5ddb03(0x1f8)+(_0x1032c8[_0x5ddb03(0x1dd)]?a4_0x4a1a27[_0x5ddb03(0x167)](_0x5ddb03(0x170)):_0x1032c8[_0x5ddb03(0x194)]?a4_0x4a1a27['yellow']('updated'):a4_0x4a1a27[_0x5ddb03(0x1cd)](_0x5ddb03(0x17c)))),0x0;}const _0x10d4aa=_0x2d5db8||_0x11f800,{data:_0x139791}=await withSpinner(_0x5ddb03(0x16c)+_0x136cfd+_0x5ddb03(0x1db),()=>_0x5009ce['llm'][_0x5ddb03(0x1a6)](_0x136cfd,_0x10d4aa,{'dryRun':!![]})),_0x470f56=_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1fa)][_0x5ddb03(0x170)]+_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1d6)][_0x5ddb03(0x170)]+_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1ba)][_0x5ddb03(0x170)]+_0x139791['counts'][_0x5ddb03(0x193)][_0x5ddb03(0x170)]+_0x139791[_0x5ddb03(0x1b5)]['integrations'][_0x5ddb03(0x170)]+_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1aa)][_0x5ddb03(0x170)]+_0x139791['counts'][_0x5ddb03(0x1c8)][_0x5ddb03(0x170)],_0x58028d=_0x139791['counts']['agents'][_0x5ddb03(0x1df)]+_0x139791['counts'][_0x5ddb03(0x1d6)][_0x5ddb03(0x1df)]+_0x139791['counts'][_0x5ddb03(0x1ba)][_0x5ddb03(0x1df)]+_0x139791['counts'][_0x5ddb03(0x193)]['updated']+_0x139791['counts'][_0x5ddb03(0x18f)][_0x5ddb03(0x1df)]+_0x139791[_0x5ddb03(0x1b5)]['experimentalKnowledgeBases'][_0x5ddb03(0x1df)]+_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1c8)][_0x5ddb03(0x1df)],_0x850cd2=_0x139791['counts'][_0x5ddb03(0x1fa)][_0x5ddb03(0x17c)]+_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1d6)][_0x5ddb03(0x17c)]+_0x139791[_0x5ddb03(0x1b5)]['textKnowledgeBases']['unchanged']+_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x193)][_0x5ddb03(0x17c)]+_0x139791[_0x5ddb03(0x1b5)]['integrations']['unchanged']+_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1aa)][_0x5ddb03(0x17c)]+_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1c8)][_0x5ddb03(0x17c)];console['log'](_0x5ddb03(0x1cf)+_0x139791[_0x5ddb03(0x172)]+'\x27:'),console[_0x5ddb03(0x202)]('\x20\x20'+a4_0x4a1a27[_0x5ddb03(0x167)]('+\x20'+_0x470f56+_0x5ddb03(0x1dc))+_0x5ddb03(0x182)+a4_0x4a1a27[_0x5ddb03(0x1bd)]('~\x20'+_0x58028d+_0x5ddb03(0x1f4))+'\x20|\x20'+a4_0x4a1a27[_0x5ddb03(0x1a5)]('=\x20'+_0x850cd2+_0x5ddb03(0x1d3))),console[_0x5ddb03(0x202)]('\x20\x20Agents:\x20'+formatCountSummary(_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1fa)])),console[_0x5ddb03(0x202)](_0x5ddb03(0x1b3)+formatCountSummary(_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1d6)])),console[_0x5ddb03(0x202)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x1ba)])),console[_0x5ddb03(0x202)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x139791[_0x5ddb03(0x1b5)][_0x5ddb03(0x193)])),console['log'](_0x5ddb03(0x1d0)+formatCountSummary(_0x139791['counts'][_0x5ddb03(0x18f)]));const _0x529ccb=_0x139791['counts']['experimentalKnowledgeBases'][_0x5ddb03(0x163)]>0x0||_0x139791[_0x5ddb03(0x1b5)]['experimentalArtifacts']['total']>0x0;_0x529ccb&&(console[_0x5ddb03(0x202)](_0x5ddb03(0x1bb)+formatCountSummary(_0x139791['counts']['experimentalKnowledgeBases'])),console[_0x5ddb03(0x202)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x139791[_0x5ddb03(0x1b5)]['experimentalArtifacts'])));console[_0x5ddb03(0x202)]('\x20\x20Target:\x20'+a4_0x4a1a27['cyan'](_0x139791[_0x5ddb03(0x161)])),displayDiffs(_0x139791[_0x5ddb03(0x1fa)],_0x139791[_0x5ddb03(0x1d6)],_0x139791[_0x5ddb03(0x1ba)],_0x139791[_0x5ddb03(0x193)],_0x139791[_0x5ddb03(0x18f)],_0x139791[_0x5ddb03(0x1aa)],_0x139791[_0x5ddb03(0x1c8)]);if(_0x591ba8)return console[_0x5ddb03(0x202)](a4_0x4a1a27[_0x5ddb03(0x1bd)](_0x5ddb03(0x1e1))),0x0;if(_0x470f56===0x0&&_0x58028d===0x0)return console[_0x5ddb03(0x202)](a4_0x4a1a27[_0x5ddb03(0x167)](_0x5ddb03(0x1ae))),saveSessionContext({'llm_project':_0x139791[_0x5ddb03(0x172)]},_0x339aff[_0x5ddb03(0x1d8)]),console[_0x5ddb03(0x202)](a4_0x4a1a27[_0x5ddb03(0x167)]('✔\x20Context\x20set:\x20'+a4_0x4a1a27[_0x5ddb03(0x1a5)](_0x5ddb03(0x17e))+_0x5ddb03(0x1b1)+a4_0x4a1a27[_0x5ddb03(0x1b4)](_0x139791[_0x5ddb03(0x172)]))),0x0;if(!_0x2d3392&&!_0x2d5154){if(!isInteractive())return console[_0x5ddb03(0x1eb)](a4_0x4a1a27[_0x5ddb03(0x169)]('\x0aError:'),_0x5ddb03(0x1a2)),console['error'](a4_0x4a1a27[_0x5ddb03(0x1a5)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4d5726=await confirmKey(_0x5ddb03(0x1af)+(_0x470f56+_0x58028d)+_0x5ddb03(0x1ed));if(!_0x4d5726)return console['log'](a4_0x4a1a27[_0x5ddb03(0x1bd)]('Cancelled'),_0x5ddb03(0x1f6)),0x1;}const {data:_0x5c0a4b}=await withSpinner(_0x5ddb03(0x1e9),()=>_0x5009ce[_0x5ddb03(0x200)][_0x5ddb03(0x1a6)](_0x136cfd,_0x10d4aa,{'force':_0x2d5154}));return console[_0x5ddb03(0x202)](a4_0x4a1a27[_0x5ddb03(0x167)]('\x0a✔\x20Pulled\x20'+(_0x470f56+_0x58028d)+_0x5ddb03(0x159)+_0x5c0a4b[_0x5ddb03(0x161)])),saveSessionContext({'llm_project':_0x5c0a4b[_0x5ddb03(0x172)]},_0x339aff[_0x5ddb03(0x1d8)]),console['log'](a4_0x4a1a27[_0x5ddb03(0x167)](_0x5ddb03(0x176)+a4_0x4a1a27[_0x5ddb03(0x1a5)](_0x5ddb03(0x17e))+_0x5ddb03(0x1b1)+a4_0x4a1a27[_0x5ddb03(0x1b4)](_0x5c0a4b[_0x5ddb03(0x172)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x5044ec(0x1b0)]=a4_0x5044ec(0x1c0);[a4_0x5044ec(0x1fd)]=a4_0x5044ec(0x18a);async[a4_0x5044ec(0x1a7)](_0x10e981){const _0x2c3d7a=a4_0x5044ec,{options:_0x4ff4db,args:_0x570b02,tdx:_0x49997e}=_0x10e981,_0x44ebfd=_0x570b02[0x0],_0xbf99d8=_0x4ff4db[_0x2c3d7a(0x1b0)],_0x5f23da=_0x4ff4db['dryRun'],_0x55bb99=_0x4ff4db['yes'],_0x5c9904=_0x4ff4db['site'],_0x17d424=_0x4ff4db[_0x2c3d7a(0x183)];let _0xef6ca4;const _0x363be2=findAgentConfigPath(process[_0x2c3d7a(0x1c9)]());if(_0x44ebfd){const _0x4e1f74=a4_0x5c7fd4['join'](_0x44ebfd,_0x2c3d7a(0x1a9));existsSync(_0x4e1f74)?(_0xef6ca4=_0x44ebfd,console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x1a5)](_0x2c3d7a(0x1da)+_0x44ebfd))):_0xef6ca4=_0x44ebfd;}else{if(_0x363be2)_0xef6ca4=a4_0x5c7fd4[_0x2c3d7a(0x15b)](_0x363be2),console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x1a5)](_0x2c3d7a(0x1ca)+_0xef6ca4));else{if(_0x17d424){const _0x37c712=sanitizeForFilesystem(_0x17d424);let _0x342b28=_0x37c712,_0xe8b451=a4_0x5c7fd4['join'](process[_0x2c3d7a(0x1c9)](),_0x2c3d7a(0x1fa),_0x37c712,'tdx.json');if(!existsSync(_0xe8b451)){const _0x10cab0=normalizeName(_0x17d424),_0x44b4a9=a4_0x5c7fd4[_0x2c3d7a(0x1f3)](process['cwd'](),'agents',_0x10cab0,'tdx.json');existsSync(_0x44b4a9)&&(_0x342b28=_0x10cab0,_0xe8b451=_0x44b4a9);}if(existsSync(_0xe8b451))_0xef6ca4=a4_0x5c7fd4[_0x2c3d7a(0x15b)](_0xe8b451),console['log'](a4_0x4a1a27['dim'](_0x2c3d7a(0x1da)+_0xef6ca4));else{const _0x42c395=_0x4ff4db[_0x2c3d7a(0x152)];if(_0x42c395)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2c3d7a(0x203)+_0x17d424+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x2c3d7a(0x192)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x2c3d7a(0x1ea)+_0x17d424+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x342b28+'\x20--name\x20'+(_0xbf99d8||_0x2c3d7a(0x160))+_0x2c3d7a(0x1b9)+_0x42c395)});_0xef6ca4=_0x17d424,console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x1a5)](_0x2c3d7a(0x1a4)+_0x17d424));}}}}if(!_0xef6ca4)return console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x1bd)](_0x2c3d7a(0x188))),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x1c3)),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x1ce)),console[_0x2c3d7a(0x202)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x1f2)),0x1;if(!_0xbf99d8)throw new SDKError(ErrorCode[_0x2c3d7a(0x16e)],_0x2c3d7a(0x15e),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x55bb99&&!_0x5f23da){if(!isInteractive())return console[_0x2c3d7a(0x1eb)](a4_0x4a1a27['red']('\x0aError:'),_0x2c3d7a(0x1a2)),console[_0x2c3d7a(0x1eb)](a4_0x4a1a27['dim'](_0x2c3d7a(0x1d9))),0x1;const _0x5d3add=await confirmKey(_0x2c3d7a(0x195)+_0xef6ca4+'\x22\x20to\x20new\x20project\x20\x22'+_0xbf99d8+'\x22?');if(!_0x5d3add)return console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x1bd)](_0x2c3d7a(0x18c))),0x1;}const {data:_0x1b10c7}=await withSpinner('Cloning\x20\x22'+_0xef6ca4+_0x2c3d7a(0x1f1)+_0xbf99d8+_0x2c3d7a(0x1db),()=>_0x49997e[_0x2c3d7a(0x200)]['cloneProject'](_0xef6ca4,_0xbf99d8,{'dryRun':_0x5f23da}));if(_0x5f23da){console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x1bd)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x1ec)+_0x1b10c7[_0x2c3d7a(0x1be)]),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x1a8)+_0xbf99d8),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x1e5)),console['log'](_0x2c3d7a(0x173)+_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1fa)][_0x2c3d7a(0x1d7)]),console['log'](_0x2c3d7a(0x1b3)+_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1d6)][_0x2c3d7a(0x1d7)]),console[_0x2c3d7a(0x202)]('\x20\x20Prompts:\x20'+_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x193)][_0x2c3d7a(0x1d7)]);const _0xd4ba6b=_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1aa)][_0x2c3d7a(0x1d7)]>0x0||_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1c8)]['created']>0x0;return _0xd4ba6b&&(console[_0x2c3d7a(0x202)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x1b10c7['counts'][_0x2c3d7a(0x1aa)][_0x2c3d7a(0x1d7)]),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x16a)+_0x1b10c7[_0x2c3d7a(0x1b5)]['experimentalArtifacts'][_0x2c3d7a(0x1d7)])),0x0;}const _0x4b452b=_0x1b10c7['counts'][_0x2c3d7a(0x1fa)][_0x2c3d7a(0x17d)]>0x0||_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1d6)]['errors']>0x0||_0x1b10c7[_0x2c3d7a(0x1b5)]['prompts'][_0x2c3d7a(0x17d)]>0x0||_0x1b10c7[_0x2c3d7a(0x1b5)]['experimentalKnowledgeBases'][_0x2c3d7a(0x17d)]>0x0||_0x1b10c7['counts'][_0x2c3d7a(0x1c8)][_0x2c3d7a(0x17d)]>0x0;_0x4b452b?console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x1bd)](_0x2c3d7a(0x1b2))):console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x167)](_0x2c3d7a(0x199)));console[_0x2c3d7a(0x202)](_0x2c3d7a(0x1ec)+_0x1b10c7[_0x2c3d7a(0x1be)]),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x1a8)+_0x1b10c7[_0x2c3d7a(0x168)]),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x198)+_0x1b10c7[_0x2c3d7a(0x184)]),console[_0x2c3d7a(0x202)](),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x175)),console[_0x2c3d7a(0x202)](_0x2c3d7a(0x173)+formatCountSummary(_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1fa)])),console[_0x2c3d7a(0x202)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1b10c7['counts']['knowledgeBases'])),console['log'](_0x2c3d7a(0x191)+formatCountSummary(_0x1b10c7[_0x2c3d7a(0x1b5)]['prompts'])),console[_0x2c3d7a(0x202)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x18f)]));const _0x58799a=_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1aa)]['created']>0x0||_0x1b10c7['counts'][_0x2c3d7a(0x1aa)][_0x2c3d7a(0x1df)]>0x0||_0x1b10c7['counts']['experimentalKnowledgeBases'][_0x2c3d7a(0x17c)]>0x0||_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1c8)]['created']>0x0||_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1c8)][_0x2c3d7a(0x1df)]>0x0||_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1c8)][_0x2c3d7a(0x17c)]>0x0;_0x58799a&&(console[_0x2c3d7a(0x202)](_0x2c3d7a(0x1bb)+formatCountSummary(_0x1b10c7[_0x2c3d7a(0x1b5)]['experimentalKnowledgeBases'])),console[_0x2c3d7a(0x202)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1b10c7[_0x2c3d7a(0x1b5)][_0x2c3d7a(0x1c8)])));if(_0x4b452b){console['log'](),console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x169)](_0x2c3d7a(0x166)));for(const _0x332c9c of _0x1b10c7[_0x2c3d7a(0x1fa)]){_0x332c9c[_0x2c3d7a(0x16d)]==='error'&&console['log'](a4_0x4a1a27[_0x2c3d7a(0x169)]('\x20\x20Agent\x20\x22'+_0x332c9c[_0x2c3d7a(0x1de)]+_0x2c3d7a(0x19d)+_0x332c9c['error']));}for(const _0xb60ac5 of _0x1b10c7['knowledgeBases']){_0xb60ac5['action']===_0x2c3d7a(0x1eb)&&console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x169)](_0x2c3d7a(0x1ff)+_0xb60ac5[_0x2c3d7a(0x1b0)]+_0x2c3d7a(0x19d)+_0xb60ac5[_0x2c3d7a(0x1eb)]));}for(const _0x456f6f of _0x1b10c7[_0x2c3d7a(0x193)]){_0x456f6f[_0x2c3d7a(0x16d)]===_0x2c3d7a(0x1eb)&&console[_0x2c3d7a(0x202)](a4_0x4a1a27[_0x2c3d7a(0x169)]('\x20\x20Prompt\x20\x22'+_0x456f6f[_0x2c3d7a(0x1b0)]+_0x2c3d7a(0x19d)+_0x456f6f['error']));}for(const _0x6193ef of _0x1b10c7[_0x2c3d7a(0x18f)]){_0x6193ef['action']==='error'&&console['log'](a4_0x4a1a27[_0x2c3d7a(0x169)](_0x2c3d7a(0x179)+_0x6193ef[_0x2c3d7a(0x1b0)]+'\x22:\x20'+_0x6193ef[_0x2c3d7a(0x1eb)]));}for(const _0x2bce71 of _0x1b10c7[_0x2c3d7a(0x1aa)]){_0x2bce71[_0x2c3d7a(0x16d)]===_0x2c3d7a(0x1eb)&&console['log'](a4_0x4a1a27[_0x2c3d7a(0x169)](_0x2c3d7a(0x1b8)+_0x2bce71[_0x2c3d7a(0x1b0)]+_0x2c3d7a(0x19d)+_0x2bce71[_0x2c3d7a(0x1eb)]));}for(const _0x5b938b of _0x1b10c7[_0x2c3d7a(0x1c8)]){_0x5b938b[_0x2c3d7a(0x16d)]==='error'&&console['log'](a4_0x4a1a27[_0x2c3d7a(0x169)](_0x2c3d7a(0x164)+_0x5b938b[_0x2c3d7a(0x1b0)]+_0x2c3d7a(0x19d)+_0x5b938b[_0x2c3d7a(0x1eb)]));}return 0x1;}console[_0x2c3d7a(0x202)]();const _0x1729a8=getLLMProjectUrl(_0x5c9904,_0x1b10c7[_0x2c3d7a(0x184)]);return console['log'](_0x2c3d7a(0x158)+a4_0x4a1a27[_0x2c3d7a(0x1b4)](_0x1729a8)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x5044ec(0x1b0)]=a4_0x5044ec(0x16b);[a4_0x5044ec(0x1fd)]=a4_0x5044ec(0x1c2);async[a4_0x5044ec(0x1a7)](_0x32a8ae){const _0x39a7f2=a4_0x5044ec,{options:_0xede39d,args:_0x5d04e0,tdx:_0x1ed647}=_0x32a8ae;let _0x349e72=_0x5d04e0[0x0]||process[_0x39a7f2(0x1c9)]();const _0x44bec0=_0xede39d['dryRun'],_0x24476a=_0xede39d['force'],_0x20b32f=_0xede39d[_0x39a7f2(0x19f)],_0x2f3de8=_0xede39d[_0x39a7f2(0x15d)],_0x16f8ff=a4_0x5c7fd4['join'](_0x349e72,_0x39a7f2(0x165)),_0x1b514c=existsSync(_0x16f8ff);if(_0x1b514c){const {data:_0xd6a308}=await withSpinner(_0x39a7f2(0x180)+_0x349e72+_0x39a7f2(0x1db),()=>_0x1ed647['llm']['pushAgent'](_0x349e72,{'dryRun':_0x44bec0,'force':_0x24476a}));if(_0x44bec0)return console['log'](a4_0x4a1a27[_0x39a7f2(0x1bd)](_0x39a7f2(0x1e3))),console[_0x39a7f2(0x202)]('Would\x20push\x20agent:\x20'+_0xd6a308[_0x39a7f2(0x1de)]),0x0;if(_0xd6a308['action']===_0x39a7f2(0x1eb))return console[_0x39a7f2(0x202)](a4_0x4a1a27[_0x39a7f2(0x169)](_0x39a7f2(0x1e6)+_0xd6a308[_0x39a7f2(0x1eb)])),0x1;console['log'](a4_0x4a1a27[_0x39a7f2(0x167)](_0x39a7f2(0x19a)+_0xd6a308[_0x39a7f2(0x16d)]+_0x39a7f2(0x1c7))),console[_0x39a7f2(0x202)](_0x39a7f2(0x156)+_0xd6a308[_0x39a7f2(0x1de)]);if(_0xd6a308[_0x39a7f2(0x1d4)]&&_0xd6a308['projectId']){const _0x37e732=getLLMAgentChatUrl(_0x2f3de8,_0xd6a308['projectId'],_0xd6a308[_0x39a7f2(0x1d4)]);console[_0x39a7f2(0x202)](_0x39a7f2(0x1a1)+a4_0x4a1a27['cyan'](_0x37e732));}return 0x0;}const _0x2d6f4f=_0xede39d['llmProject'],_0xfbf4f9=resolveProjectFromContext(_0x349e72,_0x2d6f4f);if(_0xfbf4f9[_0x39a7f2(0x1c6)])_0x349e72=_0xfbf4f9['projectDir'],_0xfbf4f9[_0x39a7f2(0x1ee)]==='context'&&console[_0x39a7f2(0x202)](a4_0x4a1a27['dim'](_0x39a7f2(0x201)+_0x349e72));else{let _0x332af7='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0xfbf4f9[_0x39a7f2(0x1ab)]===_0x39a7f2(0x181)&&(_0x332af7=_0xfbf4f9[_0x39a7f2(0x189)]+_0x39a7f2(0x178)+_0xfbf4f9[_0x39a7f2(0x183)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xfbf4f9[_0x39a7f2(0x1ab)]===_0x39a7f2(0x1e2)?_0xfbf4f9[_0x39a7f2(0x189)]:'No\x20tdx.json\x20found\x20in\x20'+_0x349e72,undefined,{'helpText':_0x332af7});}const {data:_0x3f8f4f}=await withSpinner(_0x39a7f2(0x1f9),()=>_0x1ed647[_0x39a7f2(0x200)][_0x39a7f2(0x185)](_0x349e72,{'dryRun':!![]})),_0x5eec60=_0x3f8f4f['counts'][_0x39a7f2(0x1fa)][_0x39a7f2(0x17d)]>0x0;if(_0x5eec60){console['log'](a4_0x4a1a27[_0x39a7f2(0x169)](_0x39a7f2(0x1b7)));for(const _0x101b02 of _0x3f8f4f['agents']){_0x101b02['action']===_0x39a7f2(0x1eb)&&console['log'](a4_0x4a1a27['red'](_0x39a7f2(0x1c5)+_0x101b02['agentName']+_0x39a7f2(0x19d)+_0x101b02[_0x39a7f2(0x1eb)]));}return 0x1;}const _0x1ba934=_0x3f8f4f[_0x39a7f2(0x1b5)]['agents'][_0x39a7f2(0x1d7)]+_0x3f8f4f['counts'][_0x39a7f2(0x1d6)][_0x39a7f2(0x1d7)]+_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1ba)]['created']+_0x3f8f4f[_0x39a7f2(0x1b5)]['prompts'][_0x39a7f2(0x1d7)]+_0x3f8f4f[_0x39a7f2(0x1b5)]['integrations'][_0x39a7f2(0x1d7)]+_0x3f8f4f['counts'][_0x39a7f2(0x1aa)][_0x39a7f2(0x1d7)]+_0x3f8f4f[_0x39a7f2(0x1b5)]['experimentalArtifacts'][_0x39a7f2(0x1d7)],_0x4e7e65=_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1fa)][_0x39a7f2(0x1df)]+_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1d6)]['updated']+_0x3f8f4f['counts'][_0x39a7f2(0x1ba)][_0x39a7f2(0x1df)]+_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x193)][_0x39a7f2(0x1df)]+_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x18f)][_0x39a7f2(0x1df)]+_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1aa)][_0x39a7f2(0x1df)]+_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1c8)][_0x39a7f2(0x1df)],_0x561353=_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1fa)][_0x39a7f2(0x17c)]+_0x3f8f4f['counts']['knowledgeBases'][_0x39a7f2(0x17c)]+_0x3f8f4f['counts']['textKnowledgeBases'][_0x39a7f2(0x17c)]+_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x193)][_0x39a7f2(0x17c)]+_0x3f8f4f['counts'][_0x39a7f2(0x18f)][_0x39a7f2(0x17c)]+_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1aa)][_0x39a7f2(0x17c)]+_0x3f8f4f[_0x39a7f2(0x1b5)]['experimentalArtifacts'][_0x39a7f2(0x17c)];console[_0x39a7f2(0x202)](_0x39a7f2(0x15f)+_0x3f8f4f[_0x39a7f2(0x172)]+'\x27:'),console[_0x39a7f2(0x202)]('\x20\x20'+a4_0x4a1a27[_0x39a7f2(0x167)]('+\x20'+_0x1ba934+'\x20new')+_0x39a7f2(0x182)+a4_0x4a1a27[_0x39a7f2(0x1bd)]('~\x20'+_0x4e7e65+_0x39a7f2(0x1f4))+_0x39a7f2(0x182)+a4_0x4a1a27['dim']('=\x20'+_0x561353+_0x39a7f2(0x1d3))),console[_0x39a7f2(0x202)]('\x20\x20Agents:\x20'+formatCountSummary(_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1fa)])),console['log'](_0x39a7f2(0x1b3)+formatCountSummary(_0x3f8f4f[_0x39a7f2(0x1b5)]['knowledgeBases'])),console[_0x39a7f2(0x202)](_0x39a7f2(0x1cc)+formatCountSummary(_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1ba)])),console[_0x39a7f2(0x202)](_0x39a7f2(0x191)+formatCountSummary(_0x3f8f4f['counts'][_0x39a7f2(0x193)])),console[_0x39a7f2(0x202)](_0x39a7f2(0x1d0)+formatCountSummary(_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x18f)]));const _0xf5f2a7=_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1aa)][_0x39a7f2(0x1d7)]>0x0||_0x3f8f4f['counts'][_0x39a7f2(0x1aa)][_0x39a7f2(0x1df)]>0x0||_0x3f8f4f['counts'][_0x39a7f2(0x1aa)][_0x39a7f2(0x17c)]>0x0||_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1c8)][_0x39a7f2(0x1d7)]>0x0||_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1c8)][_0x39a7f2(0x1df)]>0x0||_0x3f8f4f[_0x39a7f2(0x1b5)][_0x39a7f2(0x1c8)]['unchanged']>0x0;_0xf5f2a7&&(console[_0x39a7f2(0x202)](_0x39a7f2(0x1bb)+formatCountSummary(_0x3f8f4f[_0x39a7f2(0x1b5)]['experimentalKnowledgeBases'])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x3f8f4f[_0x39a7f2(0x1b5)]['experimentalArtifacts'])));console[_0x39a7f2(0x202)](_0x39a7f2(0x1e8)+a4_0x4a1a27[_0x39a7f2(0x1b4)](_0x349e72)),displayDiffs(_0x3f8f4f[_0x39a7f2(0x1fa)],_0x3f8f4f['knowledgeBases'],_0x3f8f4f[_0x39a7f2(0x1ba)],_0x3f8f4f[_0x39a7f2(0x193)],_0x3f8f4f[_0x39a7f2(0x18f)],_0x3f8f4f[_0x39a7f2(0x1aa)],_0x3f8f4f[_0x39a7f2(0x1c8)]);if(_0x44bec0)return console['log'](a4_0x4a1a27[_0x39a7f2(0x1bd)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x1ba934===0x0&&_0x4e7e65===0x0){console[_0x39a7f2(0x202)](a4_0x4a1a27[_0x39a7f2(0x167)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x2c692e=getLLMProjectUrl(_0x2f3de8,_0x3f8f4f[_0x39a7f2(0x1ac)]);return console[_0x39a7f2(0x202)](_0x39a7f2(0x158)+a4_0x4a1a27['cyan'](_0x2c692e)),0x0;}if(!_0x20b32f&&!_0x24476a){if(!isInteractive())return console[_0x39a7f2(0x1eb)](a4_0x4a1a27[_0x39a7f2(0x169)](_0x39a7f2(0x1fe)),_0x39a7f2(0x1a2)),console[_0x39a7f2(0x1eb)](a4_0x4a1a27[_0x39a7f2(0x1a5)](_0x39a7f2(0x1d9))),0x1;const _0x1b2b6e=await confirmKey('\x0aPush\x20'+(_0x1ba934+_0x4e7e65)+_0x39a7f2(0x162));if(!_0x1b2b6e)return console[_0x39a7f2(0x202)](a4_0x4a1a27[_0x39a7f2(0x1bd)](_0x39a7f2(0x18c)),_0x39a7f2(0x18e)),0x1;}const {data:_0x2a6823}=await withSpinner(_0x39a7f2(0x19c),()=>_0x1ed647[_0x39a7f2(0x200)][_0x39a7f2(0x185)](_0x349e72,{'force':_0x24476a})),_0x4cddab=_0x2a6823[_0x39a7f2(0x1b5)][_0x39a7f2(0x1fa)][_0x39a7f2(0x17d)]>0x0||_0x2a6823[_0x39a7f2(0x1b5)]['knowledgeBases']['errors']>0x0||_0x2a6823[_0x39a7f2(0x1b5)][_0x39a7f2(0x1ba)][_0x39a7f2(0x17d)]>0x0||_0x2a6823['counts'][_0x39a7f2(0x193)][_0x39a7f2(0x17d)]>0x0;if(_0x4cddab){console['log'](a4_0x4a1a27[_0x39a7f2(0x1bd)]('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console[_0x39a7f2(0x202)](a4_0x4a1a27[_0x39a7f2(0x169)](_0x39a7f2(0x166)));for(const _0x1e121c of _0x2a6823[_0x39a7f2(0x1fa)]){_0x1e121c[_0x39a7f2(0x16d)]==='error'&&console[_0x39a7f2(0x202)](a4_0x4a1a27[_0x39a7f2(0x169)](_0x39a7f2(0x1c5)+_0x1e121c[_0x39a7f2(0x1de)]+'\x22:\x20'+_0x1e121c[_0x39a7f2(0x1eb)]));}for(const _0x41c345 of _0x2a6823['knowledgeBases']){_0x41c345[_0x39a7f2(0x16d)]===_0x39a7f2(0x1eb)&&console[_0x39a7f2(0x202)](a4_0x4a1a27['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x41c345[_0x39a7f2(0x1b0)]+_0x39a7f2(0x19d)+_0x41c345[_0x39a7f2(0x1eb)]));}for(const _0x50f3d1 of _0x2a6823['textKnowledgeBases']){_0x50f3d1[_0x39a7f2(0x16d)]===_0x39a7f2(0x1eb)&&console['log'](a4_0x4a1a27[_0x39a7f2(0x169)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x50f3d1['name']+_0x39a7f2(0x19d)+_0x50f3d1[_0x39a7f2(0x1eb)]));}for(const _0x3d4222 of _0x2a6823['prompts']){_0x3d4222[_0x39a7f2(0x16d)]===_0x39a7f2(0x1eb)&&console[_0x39a7f2(0x202)](a4_0x4a1a27[_0x39a7f2(0x169)](_0x39a7f2(0x1fb)+_0x3d4222[_0x39a7f2(0x1b0)]+_0x39a7f2(0x19d)+_0x3d4222[_0x39a7f2(0x1eb)]));}for(const _0xc0be95 of _0x2a6823[_0x39a7f2(0x18f)]){_0xc0be95[_0x39a7f2(0x16d)]==='error'&&console['log'](a4_0x4a1a27[_0x39a7f2(0x169)](_0x39a7f2(0x179)+_0xc0be95['name']+'\x22:\x20'+_0xc0be95[_0x39a7f2(0x1eb)]));}return 0x1;}console[_0x39a7f2(0x202)](a4_0x4a1a27[_0x39a7f2(0x167)]('\x0a✔\x20Pushed\x20'+(_0x1ba934+_0x4e7e65)+_0x39a7f2(0x1f5)+_0x2a6823[_0x39a7f2(0x172)]+'\x27'));const _0x52f245=getLLMProjectUrl(_0x2f3de8,_0x2a6823[_0x39a7f2(0x1ac)]);return console[_0x39a7f2(0x202)](_0x39a7f2(0x158)+a4_0x4a1a27['cyan'](_0x52f245)),0x0;}}
|
|
1
|
+
const a4_0x28911e=a4_0x3940;(function(_0x21ccb0,_0x9963c6){const _0x493163=a4_0x3940,_0x795dd7=_0x21ccb0();while(!![]){try{const _0x53e5c4=parseInt(_0x493163(0xae))/0x1*(-parseInt(_0x493163(0x12b))/0x2)+parseInt(_0x493163(0xab))/0x3*(parseInt(_0x493163(0xa9))/0x4)+-parseInt(_0x493163(0x13a))/0x5*(parseInt(_0x493163(0x7b))/0x6)+-parseInt(_0x493163(0xe7))/0x7*(parseInt(_0x493163(0xfa))/0x8)+-parseInt(_0x493163(0xd5))/0x9*(parseInt(_0x493163(0x8f))/0xa)+-parseInt(_0x493163(0xf3))/0xb+-parseInt(_0x493163(0xfd))/0xc*(-parseInt(_0x493163(0x9c))/0xd);if(_0x53e5c4===_0x9963c6)break;else _0x795dd7['push'](_0x795dd7['shift']());}catch(_0x286c46){_0x795dd7['push'](_0x795dd7['shift']());}}}(a4_0x25f4,0x96f90));import a4_0x211100 from'chalk';import a4_0x2361b2 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';function a4_0x3940(_0x4c6038,_0x300fa2){_0x4c6038=_0x4c6038-0x7a;const _0x25f4b0=a4_0x25f4();let _0x394047=_0x25f4b0[_0x4c6038];return _0x394047;}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function a4_0x25f4(){const _0x546fa6=['agent','\x0aWrite\x20','found','Using\x20current\x20project:\x20','projectId','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Failed\x20to\x20push\x20agent:\x20','Cloning\x20\x22','session','force','counts','\x20\x20tdx\x20agent\x20clone\x20agents/','repeat','name','yellow','\x0aPull\x20summary\x20for\x20\x27','unchanged','\x20created','agent:pull','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20updated','created','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','integrations','projectName','agent:push','\x22\x20to\x20\x22','agentId','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x0aChanges\x20to\x20agent\x20\x27','prompts','\x22\x20from\x20project\x20\x22','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Cancelled','profile','log','cyan','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','609198ZuayEP','Status:\x20','llm','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Using\x20project\x20from\x20','\x0aChanges\x20to\x20prompt\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20changed','\x20\x20Agent\x20\x22','\x20\x20Prompt\x20\x22','\x20\x20Target:\x20','Using\x20project:\x20','\x20\x20Source:\x20','yes','5fRdLSG','\x20unchanged','6324078FBKKVV','green','utf-8','\x20\x20Integrations:\x20','Dry\x20run\x20-\x20no\x20files\x20written','error','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','textKnowledgeBases','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Project\x20cloned\x20successfully','message','\x0a✔\x20Pushed\x20','cwd','\x22...','dirname','agents','llmProject','push','-\x20nothing\x20pushed','\x20\x20Experimental\x20Artifact\x20\x22','1090dlpJgR','Analyzing\x20project\x20\x22','errors','cwd-config','Pushing\x20agent\x20from\x20\x22','\x22\x20to\x20new\x20project\x20\x22','experimentalArtifacts','dryRun','agent.yml','MISSING_ARGUMENT','dim','pullAgent','\x20\x20Prompts:\x20','13ihSgYn','\x0aChanges:','hasChanges','gray','tdx.json','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','New\x20project:\x20','\x20\x20Knowledge\x20Base\x20\x22','cloneProject','context','\x20\x20Agents:\x20','Pulling\x20agent\x20\x22','164qzhhDO','New\x20project\x20ID:\x20','37137ulKmsz','reason','\x22:\x20','1eHHEYF','newProjectName','join','\x20\x20Experimental\x20Artifacts:\x20','Clone\x20\x22','\x0aErrors\x20found:','Writing\x20files...','\x20files\x20to\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20Integration\x20\x22','agent:clone','\x20resources?','new','\x20=\x20','knowledgeBases','experimentalKnowledgeBases','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','Agent:\x20','red','site','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','action','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','pullProject','description','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Output:\x20','no_context','\x0aError:','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','Project:\x20','\x20\x20Knowledge\x20Bases:\x20','output','\x20new','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Dry\x20run\x20-\x20no\x20changes\x20made','\x20\x20tdx\x20agent\x20pull\x20','outputPath','65295VzOoec','Using\x20local\x20project:\x20','diff','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','total','pushProject','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20\x20Text\x20Knowledge\x20Bases:\x20','newProjectId','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','\x22\x20to\x20a\x20different\x20profile','Analyzing\x20changes\x20to\x20push...','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','execute','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','✔\x20Context\x20set:\x20','agentName','Would\x20push\x20agent:\x20','4695481flKiWQ','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','\x0aChanges\x20to\x20integration\x20\x27','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20--profile\x20','Output\x20path:\x20','\x20successfully','Errors:','Source:\x20','New\x20project\x20name\x20is\x20required','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','updated','4226937MnjiBD','outputDir','-\x20no\x20files\x20written','parse','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20|\x20','\x20errors','8yWdbKh','llm_project','\x20files?','39783624cNsPsk','no_local_folder','<new-name>','Agent\x20','\x0aPush\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'];a4_0x25f4=function(){return _0x546fa6;};return a4_0x25f4();}function formatCountSummary(_0x5bbf01){const _0xf44ee=a4_0x3940,_0x55c584=[];if(_0x5bbf01[_0xf44ee(0xd9)]!==undefined)_0x55c584[_0xf44ee(0x8c)](_0x5bbf01['total']+'\x20total');if(_0x5bbf01[_0xf44ee(0xba)]!==undefined&&_0x5bbf01[_0xf44ee(0xba)]>0x0)_0x55c584[_0xf44ee(0x8c)](a4_0x211100['green'](_0x5bbf01['new']+_0xf44ee(0xd0)));if(_0x5bbf01[_0xf44ee(0x118)]!==undefined&&_0x5bbf01[_0xf44ee(0x118)]>0x0)_0x55c584[_0xf44ee(0x8c)](a4_0x211100['green'](_0x5bbf01['created']+_0xf44ee(0x114)));if(_0x5bbf01[_0xf44ee(0xf2)]!==undefined&&_0x5bbf01[_0xf44ee(0xf2)]>0x0)_0x55c584[_0xf44ee(0x8c)](a4_0x211100[_0xf44ee(0x111)](_0x5bbf01['updated']+_0xf44ee(0x117)));if(_0x5bbf01[_0xf44ee(0x113)]!==undefined&&_0x5bbf01['unchanged']>0x0)_0x55c584[_0xf44ee(0x8c)](a4_0x211100['gray'](_0x5bbf01[_0xf44ee(0x113)]+_0xf44ee(0x7a)));if(_0x5bbf01[_0xf44ee(0x91)]!==undefined&&_0x5bbf01[_0xf44ee(0x91)]>0x0)_0x55c584['push'](a4_0x211100[_0xf44ee(0xc0)](_0x5bbf01[_0xf44ee(0x91)]+_0xf44ee(0xf9)));return _0x55c584['join'](',\x20');}function displayDiffs(_0x5d7803,_0xa21344,_0x2b2c95,_0xa0079c,_0x1590db,_0x45df0f,_0x171b29){const _0x298574=a4_0x3940;for(const _0x96e788 of _0x5d7803){if(_0x96e788[_0x298574(0xd7)]){const _0xcd2cea=_0x96e788[_0x298574(0xe5)]||_0x96e788['name'];console[_0x298574(0x126)](_0x298574(0x120)+_0xcd2cea+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x298574(0x126)](_0x96e788[_0x298574(0xd7)]),console[_0x298574(0x126)]('─'[_0x298574(0x10f)](0x3c));}}for(const _0x533367 of _0xa21344){_0x533367['diff']&&(console[_0x298574(0x126)](_0x298574(0xdb)+_0x533367['name']+'\x27:'),console[_0x298574(0x126)]('─'[_0x298574(0x10f)](0x3c)),console[_0x298574(0x126)](_0x533367['diff']),console['log']('─'[_0x298574(0x10f)](0x3c)));}for(const _0x3a6bb7 of _0x2b2c95){_0x3a6bb7[_0x298574(0xd7)]&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x3a6bb7['name']+'\x27:'),console[_0x298574(0x126)]('─'[_0x298574(0x10f)](0x3c)),console['log'](_0x3a6bb7[_0x298574(0xd7)]),console[_0x298574(0x126)]('─'['repeat'](0x3c)));}for(const _0x4dc06f of _0xa0079c){_0x4dc06f['diff']&&(console[_0x298574(0x126)](_0x298574(0x131)+_0x4dc06f[_0x298574(0x110)]+'\x27:'),console[_0x298574(0x126)]('─'[_0x298574(0x10f)](0x3c)),console[_0x298574(0x126)](_0x4dc06f[_0x298574(0xd7)]),console[_0x298574(0x126)]('─'[_0x298574(0x10f)](0x3c)));}for(const _0x36038c of _0x1590db){_0x36038c[_0x298574(0xd7)]&&(console['log'](_0x298574(0xe9)+_0x36038c[_0x298574(0x110)]+'\x27:'),console[_0x298574(0x126)]('─'[_0x298574(0x10f)](0x3c)),console[_0x298574(0x126)](_0x36038c[_0x298574(0xd7)]),console[_0x298574(0x126)]('─'[_0x298574(0x10f)](0x3c)));}for(const _0x33b1b0 of _0x45df0f){_0x33b1b0['diff']&&(console['log'](_0x298574(0xf7)+_0x33b1b0[_0x298574(0x110)]+'\x27:'),console[_0x298574(0x126)]('─'[_0x298574(0x10f)](0x3c)),console[_0x298574(0x126)](_0x33b1b0[_0x298574(0xd7)]),console[_0x298574(0x126)]('─'['repeat'](0x3c)));}for(const _0x18eefa of _0x171b29){_0x18eefa[_0x298574(0xd7)]&&(console['log'](_0x298574(0x81)+_0x18eefa['name']+'\x27:'),console['log']('─'[_0x298574(0x10f)](0x3c)),console[_0x298574(0x126)](_0x18eefa[_0x298574(0xd7)]),console['log']('─'[_0x298574(0x10f)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x28911e(0x110)]=a4_0x28911e(0x115);[a4_0x28911e(0xc7)]=a4_0x28911e(0xe1);async[a4_0x28911e(0xe2)](_0x2b9fdc){const _0x88cacc=a4_0x28911e,{options:_0x605991,args:_0x1c6826,tdx:_0x591092}=_0x2b9fdc,_0x317663=_0x1c6826[0x0],_0x21a93f=_0x1c6826[0x1],_0x266b73=_0x605991[_0x88cacc(0xcf)],_0x45cff6=_0x605991[_0x88cacc(0x96)],_0x371a54=_0x605991[_0x88cacc(0x10c)],_0x3b20b0=_0x605991[_0x88cacc(0x139)],_0x29d46f=_0x605991[_0x88cacc(0x8b)],_0x4f9c52=_0x605991[_0x88cacc(0x103)];let _0x3bc16e;if(_0x317663){const _0xfc5e77=a4_0x2361b2['join'](_0x317663,'tdx.json');if(existsSync(_0xfc5e77))try{const _0x54479d=JSON[_0x88cacc(0xf6)](readFileSync(_0xfc5e77,_0x88cacc(0x7d)));_0x54479d[_0x88cacc(0xfb)]&&(_0x3bc16e={'llm_project':_0x54479d[_0x88cacc(0xfb)]});}catch{}}const _0x5f0088=findAgentConfigPath(process[_0x88cacc(0x87)]());let _0x221b56;if(_0x5f0088)try{const _0x1a6a08=JSON[_0x88cacc(0xf6)](readFileSync(_0x5f0088,_0x88cacc(0x7d)));_0x1a6a08['llm_project']&&(_0x221b56={'llm_project':_0x1a6a08[_0x88cacc(0xfb)]});}catch{}const _0x2384f4=resolveAgentPullArgs({'arg':_0x317663,'agentNameArg':_0x21a93f,'agentFlag':_0x4f9c52,'contextProject':_0x29d46f,'argDirConfig':_0x3bc16e,'cwdConfigPath':_0x5f0088||undefined,'cwdConfig':_0x221b56}),{projectNameOrId:_0x57673b,targetAgentName:_0x25382f,existingOutputDir:_0x460a50,source:_0x5060a3}=_0x2384f4;if(_0x5060a3==='arg-dir')console['log'](a4_0x211100[_0x88cacc(0x99)](_0x88cacc(0x130)+a4_0x2361b2[_0x88cacc(0xb0)](_0x317663,_0x88cacc(0xa0))+':\x20'+_0x57673b));else{if(_0x5060a3===_0x88cacc(0x92))console[_0x88cacc(0x126)](a4_0x211100['dim'](_0x88cacc(0x137)+_0x57673b));else _0x5060a3===_0x88cacc(0xa6)&&console[_0x88cacc(0x126)](a4_0x211100[_0x88cacc(0x99)]('Using\x20project\x20from\x20context:\x20'+_0x57673b));}if(!_0x57673b)return _0x4f9c52?(console[_0x88cacc(0x126)](a4_0x211100[_0x88cacc(0x111)](_0x88cacc(0xa1))),console[_0x88cacc(0x126)](_0x88cacc(0x12a)),console['log'](_0x88cacc(0x12e))):(console[_0x88cacc(0x126)](a4_0x211100[_0x88cacc(0x111)](_0x88cacc(0xf1))),console['log'](_0x88cacc(0xe8)),console[_0x88cacc(0x126)](_0x88cacc(0xe3)),console[_0x88cacc(0x126)](_0x88cacc(0xcc)),console[_0x88cacc(0x126)](_0x88cacc(0xbe)),console[_0x88cacc(0x126)](_0x88cacc(0x129))),0x1;if(_0x25382f){const {data:_0x27273c}=await withSpinner(_0x88cacc(0xa8)+_0x25382f+_0x88cacc(0x122)+_0x57673b+_0x88cacc(0x88),()=>_0x591092[_0x88cacc(0x12d)][_0x88cacc(0x9a)](_0x57673b,_0x25382f,_0x266b73,{'dryRun':_0x45cff6,'force':_0x371a54}));if(_0x45cff6)return console[_0x88cacc(0x126)](a4_0x211100['yellow'](_0x88cacc(0x7f))),console['log']('Would\x20pull\x20agent:\x20'+_0x27273c[_0x88cacc(0xe5)]),console['log'](_0x88cacc(0xec)+_0x27273c[_0x88cacc(0xd4)]),_0x27273c[_0x88cacc(0xd7)]&&(console[_0x88cacc(0x126)](_0x88cacc(0x9d)),console[_0x88cacc(0x126)]('─'[_0x88cacc(0x10f)](0x3c)),console[_0x88cacc(0x126)](_0x27273c[_0x88cacc(0xd7)]),console[_0x88cacc(0x126)]('─'[_0x88cacc(0x10f)](0x3c))),0x0;return console[_0x88cacc(0x126)](a4_0x211100[_0x88cacc(0x7c)]('Agent\x20pulled\x20successfully')),console['log'](_0x88cacc(0xbf)+_0x27273c[_0x88cacc(0xe5)]),console[_0x88cacc(0x126)](_0x88cacc(0xc9)+_0x27273c[_0x88cacc(0xd4)]),console['log'](_0x88cacc(0x12c)+(_0x27273c['isNew']?a4_0x211100[_0x88cacc(0x7c)](_0x88cacc(0xba)):_0x27273c[_0x88cacc(0x9e)]?a4_0x211100['yellow']('updated'):a4_0x211100[_0x88cacc(0x9f)]('unchanged'))),0x0;}const _0x46e25c=_0x460a50||_0x266b73,{data:_0x5c6b61}=await withSpinner(_0x88cacc(0x90)+_0x57673b+_0x88cacc(0x88),()=>_0x591092[_0x88cacc(0x12d)][_0x88cacc(0xc6)](_0x57673b,_0x46e25c,{'dryRun':!![]})),_0x4bedab=_0x5c6b61[_0x88cacc(0x10d)][_0x88cacc(0x8a)][_0x88cacc(0xba)]+_0x5c6b61[_0x88cacc(0x10d)]['knowledgeBases'][_0x88cacc(0xba)]+_0x5c6b61[_0x88cacc(0x10d)][_0x88cacc(0x82)][_0x88cacc(0xba)]+_0x5c6b61['counts'][_0x88cacc(0x121)][_0x88cacc(0xba)]+_0x5c6b61[_0x88cacc(0x10d)]['integrations'][_0x88cacc(0xba)]+_0x5c6b61[_0x88cacc(0x10d)][_0x88cacc(0xbd)][_0x88cacc(0xba)]+_0x5c6b61[_0x88cacc(0x10d)]['experimentalArtifacts'][_0x88cacc(0xba)],_0x59b6f7=_0x5c6b61[_0x88cacc(0x10d)][_0x88cacc(0x8a)][_0x88cacc(0xf2)]+_0x5c6b61[_0x88cacc(0x10d)][_0x88cacc(0xbc)]['updated']+_0x5c6b61['counts']['textKnowledgeBases']['updated']+_0x5c6b61[_0x88cacc(0x10d)][_0x88cacc(0x121)][_0x88cacc(0xf2)]+_0x5c6b61['counts'][_0x88cacc(0x11a)][_0x88cacc(0xf2)]+_0x5c6b61[_0x88cacc(0x10d)][_0x88cacc(0xbd)][_0x88cacc(0xf2)]+_0x5c6b61[_0x88cacc(0x10d)]['experimentalArtifacts'][_0x88cacc(0xf2)],_0x2ba109=_0x5c6b61[_0x88cacc(0x10d)][_0x88cacc(0x8a)][_0x88cacc(0x113)]+_0x5c6b61[_0x88cacc(0x10d)][_0x88cacc(0xbc)][_0x88cacc(0x113)]+_0x5c6b61['counts']['textKnowledgeBases'][_0x88cacc(0x113)]+_0x5c6b61[_0x88cacc(0x10d)][_0x88cacc(0x121)]['unchanged']+_0x5c6b61[_0x88cacc(0x10d)][_0x88cacc(0x11a)]['unchanged']+_0x5c6b61[_0x88cacc(0x10d)][_0x88cacc(0xbd)][_0x88cacc(0x113)]+_0x5c6b61[_0x88cacc(0x10d)][_0x88cacc(0x95)][_0x88cacc(0x113)];console[_0x88cacc(0x126)](_0x88cacc(0x112)+_0x5c6b61['projectName']+'\x27:'),console[_0x88cacc(0x126)]('\x20\x20'+a4_0x211100[_0x88cacc(0x7c)]('+\x20'+_0x4bedab+'\x20new')+_0x88cacc(0xf8)+a4_0x211100[_0x88cacc(0x111)]('~\x20'+_0x59b6f7+_0x88cacc(0x133))+'\x20|\x20'+a4_0x211100[_0x88cacc(0x99)]('=\x20'+_0x2ba109+_0x88cacc(0x7a))),console[_0x88cacc(0x126)](_0x88cacc(0xa7)+formatCountSummary(_0x5c6b61[_0x88cacc(0x10d)][_0x88cacc(0x8a)])),console[_0x88cacc(0x126)](_0x88cacc(0xce)+formatCountSummary(_0x5c6b61[_0x88cacc(0x10d)][_0x88cacc(0xbc)])),console[_0x88cacc(0x126)](_0x88cacc(0xdc)+formatCountSummary(_0x5c6b61[_0x88cacc(0x10d)]['textKnowledgeBases'])),console[_0x88cacc(0x126)](_0x88cacc(0x9b)+formatCountSummary(_0x5c6b61[_0x88cacc(0x10d)][_0x88cacc(0x121)])),console[_0x88cacc(0x126)](_0x88cacc(0x7e)+formatCountSummary(_0x5c6b61[_0x88cacc(0x10d)][_0x88cacc(0x11a)]));const _0x28abb6=_0x5c6b61['counts'][_0x88cacc(0xbd)][_0x88cacc(0xd9)]>0x0||_0x5c6b61[_0x88cacc(0x10d)]['experimentalArtifacts'][_0x88cacc(0xd9)]>0x0;_0x28abb6&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5c6b61['counts'][_0x88cacc(0xbd)])),console[_0x88cacc(0x126)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x5c6b61[_0x88cacc(0x10d)][_0x88cacc(0x95)])));console[_0x88cacc(0x126)](_0x88cacc(0x136)+a4_0x211100[_0x88cacc(0x127)](_0x5c6b61[_0x88cacc(0xf4)])),displayDiffs(_0x5c6b61[_0x88cacc(0x8a)],_0x5c6b61[_0x88cacc(0xbc)],_0x5c6b61[_0x88cacc(0x82)],_0x5c6b61[_0x88cacc(0x121)],_0x5c6b61[_0x88cacc(0x11a)],_0x5c6b61[_0x88cacc(0xbd)],_0x5c6b61[_0x88cacc(0x95)]);if(_0x45cff6)return console[_0x88cacc(0x126)](a4_0x211100['yellow'](_0x88cacc(0x119))),0x0;if(_0x4bedab===0x0&&_0x59b6f7===0x0)return console[_0x88cacc(0x126)](a4_0x211100[_0x88cacc(0x7c)](_0x88cacc(0xd8))),saveSessionContext({'llm_project':_0x5c6b61[_0x88cacc(0x11b)]},_0x605991[_0x88cacc(0x10b)]),console[_0x88cacc(0x126)](a4_0x211100['green'](_0x88cacc(0xe4)+a4_0x211100[_0x88cacc(0x99)](_0x88cacc(0xfb))+_0x88cacc(0xbb)+a4_0x211100[_0x88cacc(0x127)](_0x5c6b61[_0x88cacc(0x11b)]))),0x0;if(!_0x3b20b0&&!_0x371a54){if(!isInteractive())return console[_0x88cacc(0x80)](a4_0x211100[_0x88cacc(0xc0)](_0x88cacc(0xcb)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x88cacc(0x80)](a4_0x211100['dim'](_0x88cacc(0x132))),0x1;const _0x5ad6a7=await confirmKey(_0x88cacc(0x104)+(_0x4bedab+_0x59b6f7)+_0x88cacc(0xfc));if(!_0x5ad6a7)return console[_0x88cacc(0x126)](a4_0x211100[_0x88cacc(0x111)]('Cancelled'),_0x88cacc(0xf5)),0x1;}const {data:_0x2b8a74}=await withSpinner(_0x88cacc(0xb4),()=>_0x591092['llm'][_0x88cacc(0xc6)](_0x57673b,_0x46e25c,{'force':_0x371a54}));return console['log'](a4_0x211100['green']('\x0a✔\x20Pulled\x20'+(_0x4bedab+_0x59b6f7)+_0x88cacc(0xb5)+_0x2b8a74[_0x88cacc(0xf4)])),saveSessionContext({'llm_project':_0x2b8a74[_0x88cacc(0x11b)]},_0x605991['session']),console[_0x88cacc(0x126)](a4_0x211100[_0x88cacc(0x7c)](_0x88cacc(0xe4)+a4_0x211100[_0x88cacc(0x99)](_0x88cacc(0xfb))+_0x88cacc(0xbb)+a4_0x211100['cyan'](_0x2b8a74['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x28911e(0x110)]=a4_0x28911e(0xb8);[a4_0x28911e(0xc7)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x28911e(0xe2)](_0x3d74ef){const _0x387dce=a4_0x28911e,{options:_0x6d070a,args:_0x5e75e4,tdx:_0x2168bb}=_0x3d74ef,_0x261635=_0x5e75e4[0x0],_0x5a3ecd=_0x6d070a['name'],_0x2438a3=_0x6d070a[_0x387dce(0x96)],_0x44a51b=_0x6d070a['yes'],_0x663eb0=_0x6d070a[_0x387dce(0xc1)],_0x497f3f=_0x6d070a[_0x387dce(0x8b)];let _0x18d0cc;const _0x5d7e27=findAgentConfigPath(process[_0x387dce(0x87)]());if(_0x261635){const _0x4a0ff4=a4_0x2361b2[_0x387dce(0xb0)](_0x261635,_0x387dce(0xa0));existsSync(_0x4a0ff4)?(_0x18d0cc=_0x261635,console[_0x387dce(0x126)](a4_0x211100['dim'](_0x387dce(0xd6)+_0x261635))):_0x18d0cc=_0x261635;}else{if(_0x5d7e27)_0x18d0cc=a4_0x2361b2[_0x387dce(0x89)](_0x5d7e27),console[_0x387dce(0x126)](a4_0x211100['dim'](_0x387dce(0x106)+_0x18d0cc));else{if(_0x497f3f){const _0x55c79e=sanitizeForFilesystem(_0x497f3f);let _0x4ca7ae=_0x55c79e,_0x530288=a4_0x2361b2[_0x387dce(0xb0)](process[_0x387dce(0x87)](),'agents',_0x55c79e,_0x387dce(0xa0));if(!existsSync(_0x530288)){const _0x502798=normalizeName(_0x497f3f),_0xce8d71=a4_0x2361b2['join'](process[_0x387dce(0x87)](),_0x387dce(0x8a),_0x502798,_0x387dce(0xa0));existsSync(_0xce8d71)&&(_0x4ca7ae=_0x502798,_0x530288=_0xce8d71);}if(existsSync(_0x530288))_0x18d0cc=a4_0x2361b2[_0x387dce(0x89)](_0x530288),console['log'](a4_0x211100[_0x387dce(0x99)](_0x387dce(0xd6)+_0x18d0cc));else{const _0x1286c9=_0x6d070a[_0x387dce(0x125)];if(_0x1286c9)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x387dce(0x108)+_0x497f3f+_0x387dce(0xdf),undefined,{'helpText':_0x387dce(0x12f)+_0x387dce(0xc2)+(_0x387dce(0xd3)+_0x497f3f+'\x0a')+(_0x387dce(0x10e)+_0x4ca7ae+'\x20--name\x20'+(_0x5a3ecd||_0x387dce(0xff))+_0x387dce(0xeb)+_0x1286c9)});_0x18d0cc=_0x497f3f,console[_0x387dce(0x126)](a4_0x211100['dim']('Using\x20context\x20project:\x20'+_0x497f3f));}}}}if(!_0x18d0cc)return console[_0x387dce(0x126)](a4_0x211100[_0x387dce(0x111)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x387dce(0x126)](_0x387dce(0x128)),console['log'](_0x387dce(0xd1)),console[_0x387dce(0x126)](_0x387dce(0xde)),console['log'](_0x387dce(0x123)),0x1;if(!_0x5a3ecd)throw new SDKError(ErrorCode[_0x387dce(0x98)],_0x387dce(0xf0),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x44a51b&&!_0x2438a3){if(!isInteractive())return console[_0x387dce(0x80)](a4_0x211100[_0x387dce(0xc0)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x387dce(0x80)](a4_0x211100[_0x387dce(0x99)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x367dc5=await confirmKey(_0x387dce(0xb2)+_0x18d0cc+_0x387dce(0x94)+_0x5a3ecd+'\x22?');if(!_0x367dc5)return console[_0x387dce(0x126)](a4_0x211100['yellow'](_0x387dce(0x124))),0x1;}const {data:_0xced0f9}=await withSpinner(_0x387dce(0x10a)+_0x18d0cc+_0x387dce(0x11d)+_0x5a3ecd+'\x22...',()=>_0x2168bb[_0x387dce(0x12d)][_0x387dce(0xa5)](_0x18d0cc,_0x5a3ecd,{'dryRun':_0x2438a3}));if(_0x2438a3){console[_0x387dce(0x126)](a4_0x211100['yellow'](_0x387dce(0xd2))),console[_0x387dce(0x126)](_0x387dce(0xef)+_0xced0f9['sourceProjectName']),console[_0x387dce(0x126)]('New\x20project:\x20'+_0x5a3ecd),console[_0x387dce(0x126)]('Would\x20clone:'),console[_0x387dce(0x126)](_0x387dce(0xa7)+_0xced0f9[_0x387dce(0x10d)]['agents'][_0x387dce(0x118)]),console[_0x387dce(0x126)](_0x387dce(0xce)+_0xced0f9['counts']['knowledgeBases']['created']),console[_0x387dce(0x126)](_0x387dce(0x9b)+_0xced0f9[_0x387dce(0x10d)][_0x387dce(0x121)][_0x387dce(0x118)]);const _0x149191=_0xced0f9[_0x387dce(0x10d)][_0x387dce(0xbd)][_0x387dce(0x118)]>0x0||_0xced0f9[_0x387dce(0x10d)][_0x387dce(0x95)][_0x387dce(0x118)]>0x0;return _0x149191&&(console[_0x387dce(0x126)](_0x387dce(0xc8)+_0xced0f9[_0x387dce(0x10d)][_0x387dce(0xbd)][_0x387dce(0x118)]),console['log'](_0x387dce(0xb1)+_0xced0f9[_0x387dce(0x10d)][_0x387dce(0x95)][_0x387dce(0x118)])),0x0;}const _0x906312=_0xced0f9[_0x387dce(0x10d)][_0x387dce(0x8a)][_0x387dce(0x91)]>0x0||_0xced0f9[_0x387dce(0x10d)][_0x387dce(0xbc)]['errors']>0x0||_0xced0f9[_0x387dce(0x10d)][_0x387dce(0x121)][_0x387dce(0x91)]>0x0||_0xced0f9['counts'][_0x387dce(0xbd)][_0x387dce(0x91)]>0x0||_0xced0f9[_0x387dce(0x10d)][_0x387dce(0x95)][_0x387dce(0x91)]>0x0;_0x906312?console[_0x387dce(0x126)](a4_0x211100[_0x387dce(0x111)]('Project\x20cloned\x20with\x20errors')):console[_0x387dce(0x126)](a4_0x211100[_0x387dce(0x7c)](_0x387dce(0x84)));console[_0x387dce(0x126)](_0x387dce(0xef)+_0xced0f9['sourceProjectName']),console[_0x387dce(0x126)](_0x387dce(0xa3)+_0xced0f9[_0x387dce(0xaf)]),console['log'](_0x387dce(0xaa)+_0xced0f9[_0x387dce(0xdd)]),console[_0x387dce(0x126)](),console[_0x387dce(0x126)]('Summary:'),console[_0x387dce(0x126)](_0x387dce(0xa7)+formatCountSummary(_0xced0f9[_0x387dce(0x10d)][_0x387dce(0x8a)])),console[_0x387dce(0x126)](_0x387dce(0xce)+formatCountSummary(_0xced0f9['counts'][_0x387dce(0xbc)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0xced0f9[_0x387dce(0x10d)][_0x387dce(0x121)])),console[_0x387dce(0x126)](_0x387dce(0x7e)+formatCountSummary(_0xced0f9[_0x387dce(0x10d)][_0x387dce(0x11a)]));const _0x9d7109=_0xced0f9['counts'][_0x387dce(0xbd)][_0x387dce(0x118)]>0x0||_0xced0f9[_0x387dce(0x10d)]['experimentalKnowledgeBases'][_0x387dce(0xf2)]>0x0||_0xced0f9['counts'][_0x387dce(0xbd)][_0x387dce(0x113)]>0x0||_0xced0f9['counts'][_0x387dce(0x95)][_0x387dce(0x118)]>0x0||_0xced0f9[_0x387dce(0x10d)][_0x387dce(0x95)]['updated']>0x0||_0xced0f9['counts'][_0x387dce(0x95)][_0x387dce(0x113)]>0x0;_0x9d7109&&(console[_0x387dce(0x126)](_0x387dce(0xc8)+formatCountSummary(_0xced0f9[_0x387dce(0x10d)][_0x387dce(0xbd)])),console[_0x387dce(0x126)](_0x387dce(0xb1)+formatCountSummary(_0xced0f9[_0x387dce(0x10d)]['experimentalArtifacts'])));if(_0x906312){console[_0x387dce(0x126)](),console['log'](a4_0x211100[_0x387dce(0xc0)](_0x387dce(0xee)));for(const _0x391f31 of _0xced0f9['agents']){_0x391f31[_0x387dce(0xc3)]===_0x387dce(0x80)&&console[_0x387dce(0x126)](a4_0x211100[_0x387dce(0xc0)](_0x387dce(0x134)+_0x391f31[_0x387dce(0xe5)]+_0x387dce(0xad)+_0x391f31[_0x387dce(0x80)]));}for(const _0x1199e2 of _0xced0f9[_0x387dce(0xbc)]){_0x1199e2['action']===_0x387dce(0x80)&&console['log'](a4_0x211100['red'](_0x387dce(0xa4)+_0x1199e2['name']+'\x22:\x20'+_0x1199e2[_0x387dce(0x80)]));}for(const _0x4b7f2d of _0xced0f9['prompts']){_0x4b7f2d[_0x387dce(0xc3)]===_0x387dce(0x80)&&console[_0x387dce(0x126)](a4_0x211100[_0x387dce(0xc0)](_0x387dce(0x135)+_0x4b7f2d[_0x387dce(0x110)]+_0x387dce(0xad)+_0x4b7f2d['error']));}for(const _0xcea322 of _0xced0f9[_0x387dce(0x11a)]){_0xcea322[_0x387dce(0xc3)]==='error'&&console[_0x387dce(0x126)](a4_0x211100[_0x387dce(0xc0)]('\x20\x20Integration\x20\x22'+_0xcea322[_0x387dce(0x110)]+_0x387dce(0xad)+_0xcea322[_0x387dce(0x80)]));}for(const _0x55775d of _0xced0f9[_0x387dce(0xbd)]){_0x55775d[_0x387dce(0xc3)]===_0x387dce(0x80)&&console['log'](a4_0x211100[_0x387dce(0xc0)](_0x387dce(0xa2)+_0x55775d[_0x387dce(0x110)]+_0x387dce(0xad)+_0x55775d[_0x387dce(0x80)]));}for(const _0x4370f3 of _0xced0f9[_0x387dce(0x95)]){_0x4370f3[_0x387dce(0xc3)]==='error'&&console[_0x387dce(0x126)](a4_0x211100[_0x387dce(0xc0)](_0x387dce(0x8e)+_0x4370f3['name']+'\x22:\x20'+_0x4370f3['error']));}return 0x1;}console[_0x387dce(0x126)]();const _0x40b84b=getLLMProjectUrl(_0x663eb0,_0xced0f9['newProjectId']);return console[_0x387dce(0x126)](_0x387dce(0xcd)+a4_0x211100['cyan'](_0x40b84b)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x28911e(0x110)]=a4_0x28911e(0x11c);[a4_0x28911e(0xc7)]=a4_0x28911e(0x116);async[a4_0x28911e(0xe2)](_0x3fb6e0){const _0x32e21c=a4_0x28911e,{options:_0x443ee0,args:_0x419db9,tdx:_0x23664c}=_0x3fb6e0;let _0x89b900=_0x419db9[0x0]||process[_0x32e21c(0x87)]();const _0x44dd0b=_0x443ee0[_0x32e21c(0x96)],_0x5d768d=_0x443ee0[_0x32e21c(0x10c)],_0x1dd9ea=_0x443ee0[_0x32e21c(0x139)],_0x481d1f=_0x443ee0[_0x32e21c(0xc1)],_0x4d3716=a4_0x2361b2[_0x32e21c(0xb0)](_0x89b900,_0x32e21c(0x97)),_0x12d033=existsSync(_0x4d3716);if(_0x12d033){const {data:_0x68691c}=await withSpinner(_0x32e21c(0x93)+_0x89b900+'\x22...',()=>_0x23664c['llm']['pushAgent'](_0x89b900,{'dryRun':_0x44dd0b,'force':_0x5d768d}));if(_0x44dd0b)return console['log'](a4_0x211100[_0x32e21c(0x111)](_0x32e21c(0xd2))),console[_0x32e21c(0x126)](_0x32e21c(0xe6)+_0x68691c[_0x32e21c(0xe5)]),0x0;if(_0x68691c[_0x32e21c(0xc3)]==='error')return console[_0x32e21c(0x126)](a4_0x211100[_0x32e21c(0xc0)](_0x32e21c(0x109)+_0x68691c[_0x32e21c(0x80)])),0x1;console[_0x32e21c(0x126)](a4_0x211100['green'](_0x32e21c(0x100)+_0x68691c[_0x32e21c(0xc3)]+_0x32e21c(0xed))),console[_0x32e21c(0x126)](_0x32e21c(0xbf)+_0x68691c[_0x32e21c(0xe5)]);if(_0x68691c['agentId']&&_0x68691c[_0x32e21c(0x107)]){const _0x2108de=getLLMAgentChatUrl(_0x481d1f,_0x68691c[_0x32e21c(0x107)],_0x68691c[_0x32e21c(0x11e)]);console[_0x32e21c(0x126)]('Chat:\x20'+a4_0x211100[_0x32e21c(0x127)](_0x2108de));}return 0x0;}const _0x36e4da=_0x443ee0[_0x32e21c(0x8b)],_0x24e9d0=resolveProjectFromContext(_0x89b900,_0x36e4da);if(_0x24e9d0[_0x32e21c(0x105)])_0x89b900=_0x24e9d0['projectDir'],_0x24e9d0['source']==='context'&&console[_0x32e21c(0x126)](a4_0x211100['dim'](_0x32e21c(0x137)+_0x89b900));else{let _0x6d46b7=_0x32e21c(0xc4);_0x24e9d0[_0x32e21c(0xac)]===_0x32e21c(0xfe)&&(_0x6d46b7=_0x24e9d0[_0x32e21c(0x85)]+_0x32e21c(0x11f)+_0x24e9d0['llmProject']+_0x32e21c(0xea));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x24e9d0[_0x32e21c(0xac)]===_0x32e21c(0xca)?_0x24e9d0[_0x32e21c(0x85)]:'No\x20tdx.json\x20found\x20in\x20'+_0x89b900,undefined,{'helpText':_0x6d46b7});}const {data:_0x45a884}=await withSpinner(_0x32e21c(0xe0),()=>_0x23664c[_0x32e21c(0x12d)][_0x32e21c(0xda)](_0x89b900,{'dryRun':!![]})),_0x4a3da8=_0x45a884[_0x32e21c(0x10d)][_0x32e21c(0x8a)][_0x32e21c(0x91)]>0x0;if(_0x4a3da8){console[_0x32e21c(0x126)](a4_0x211100['red'](_0x32e21c(0xb3)));for(const _0x331693 of _0x45a884[_0x32e21c(0x8a)]){_0x331693[_0x32e21c(0xc3)]==='error'&&console['log'](a4_0x211100[_0x32e21c(0xc0)](_0x32e21c(0x134)+_0x331693[_0x32e21c(0xe5)]+_0x32e21c(0xad)+_0x331693[_0x32e21c(0x80)]));}return 0x1;}const _0x378647=_0x45a884[_0x32e21c(0x10d)]['agents']['created']+_0x45a884[_0x32e21c(0x10d)]['knowledgeBases']['created']+_0x45a884[_0x32e21c(0x10d)][_0x32e21c(0x82)][_0x32e21c(0x118)]+_0x45a884[_0x32e21c(0x10d)][_0x32e21c(0x121)][_0x32e21c(0x118)]+_0x45a884[_0x32e21c(0x10d)][_0x32e21c(0x11a)][_0x32e21c(0x118)]+_0x45a884[_0x32e21c(0x10d)][_0x32e21c(0xbd)][_0x32e21c(0x118)]+_0x45a884[_0x32e21c(0x10d)][_0x32e21c(0x95)][_0x32e21c(0x118)],_0x24d970=_0x45a884[_0x32e21c(0x10d)]['agents']['updated']+_0x45a884[_0x32e21c(0x10d)][_0x32e21c(0xbc)][_0x32e21c(0xf2)]+_0x45a884[_0x32e21c(0x10d)][_0x32e21c(0x82)][_0x32e21c(0xf2)]+_0x45a884[_0x32e21c(0x10d)]['prompts']['updated']+_0x45a884[_0x32e21c(0x10d)]['integrations']['updated']+_0x45a884[_0x32e21c(0x10d)]['experimentalKnowledgeBases'][_0x32e21c(0xf2)]+_0x45a884['counts'][_0x32e21c(0x95)][_0x32e21c(0xf2)],_0x47a051=_0x45a884['counts'][_0x32e21c(0x8a)][_0x32e21c(0x113)]+_0x45a884['counts']['knowledgeBases'][_0x32e21c(0x113)]+_0x45a884[_0x32e21c(0x10d)][_0x32e21c(0x82)][_0x32e21c(0x113)]+_0x45a884[_0x32e21c(0x10d)][_0x32e21c(0x121)][_0x32e21c(0x113)]+_0x45a884[_0x32e21c(0x10d)][_0x32e21c(0x11a)][_0x32e21c(0x113)]+_0x45a884[_0x32e21c(0x10d)]['experimentalKnowledgeBases'][_0x32e21c(0x113)]+_0x45a884[_0x32e21c(0x10d)]['experimentalArtifacts']['unchanged'];console['log']('\x0aPush\x20summary\x20for\x20\x27'+_0x45a884['projectName']+'\x27:'),console[_0x32e21c(0x126)]('\x20\x20'+a4_0x211100[_0x32e21c(0x7c)]('+\x20'+_0x378647+_0x32e21c(0xd0))+_0x32e21c(0xf8)+a4_0x211100[_0x32e21c(0x111)]('~\x20'+_0x24d970+'\x20changed')+_0x32e21c(0xf8)+a4_0x211100[_0x32e21c(0x99)]('=\x20'+_0x47a051+_0x32e21c(0x7a))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x45a884[_0x32e21c(0x10d)][_0x32e21c(0x8a)])),console['log'](_0x32e21c(0xce)+formatCountSummary(_0x45a884['counts'][_0x32e21c(0xbc)])),console[_0x32e21c(0x126)](_0x32e21c(0xdc)+formatCountSummary(_0x45a884[_0x32e21c(0x10d)][_0x32e21c(0x82)])),console[_0x32e21c(0x126)](_0x32e21c(0x9b)+formatCountSummary(_0x45a884[_0x32e21c(0x10d)]['prompts'])),console['log'](_0x32e21c(0x7e)+formatCountSummary(_0x45a884[_0x32e21c(0x10d)][_0x32e21c(0x11a)]));const _0x2c2509=_0x45a884[_0x32e21c(0x10d)]['experimentalKnowledgeBases'][_0x32e21c(0x118)]>0x0||_0x45a884['counts'][_0x32e21c(0xbd)][_0x32e21c(0xf2)]>0x0||_0x45a884['counts'][_0x32e21c(0xbd)][_0x32e21c(0x113)]>0x0||_0x45a884['counts'][_0x32e21c(0x95)][_0x32e21c(0x118)]>0x0||_0x45a884[_0x32e21c(0x10d)][_0x32e21c(0x95)][_0x32e21c(0xf2)]>0x0||_0x45a884[_0x32e21c(0x10d)]['experimentalArtifacts'][_0x32e21c(0x113)]>0x0;_0x2c2509&&(console[_0x32e21c(0x126)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x45a884[_0x32e21c(0x10d)][_0x32e21c(0xbd)])),console[_0x32e21c(0x126)](_0x32e21c(0xb1)+formatCountSummary(_0x45a884[_0x32e21c(0x10d)][_0x32e21c(0x95)])));console[_0x32e21c(0x126)](_0x32e21c(0x138)+a4_0x211100[_0x32e21c(0x127)](_0x89b900)),displayDiffs(_0x45a884['agents'],_0x45a884[_0x32e21c(0xbc)],_0x45a884['textKnowledgeBases'],_0x45a884[_0x32e21c(0x121)],_0x45a884['integrations'],_0x45a884[_0x32e21c(0xbd)],_0x45a884['experimentalArtifacts']);if(_0x44dd0b)return console[_0x32e21c(0x126)](a4_0x211100['yellow'](_0x32e21c(0xc5))),0x0;if(_0x378647===0x0&&_0x24d970===0x0){console['log'](a4_0x211100['green'](_0x32e21c(0x102)));const _0x315ce9=getLLMProjectUrl(_0x481d1f,_0x45a884[_0x32e21c(0x107)]);return console[_0x32e21c(0x126)](_0x32e21c(0xcd)+a4_0x211100[_0x32e21c(0x127)](_0x315ce9)),0x0;}if(!_0x1dd9ea&&!_0x5d768d){if(!isInteractive())return console[_0x32e21c(0x80)](a4_0x211100[_0x32e21c(0xc0)]('\x0aError:'),_0x32e21c(0x83)),console[_0x32e21c(0x80)](a4_0x211100[_0x32e21c(0x99)](_0x32e21c(0x132))),0x1;const _0x644de6=await confirmKey(_0x32e21c(0x101)+(_0x378647+_0x24d970)+_0x32e21c(0xb9));if(!_0x644de6)return console[_0x32e21c(0x126)](a4_0x211100[_0x32e21c(0x111)](_0x32e21c(0x124)),_0x32e21c(0x8d)),0x1;}const {data:_0x188a7d}=await withSpinner('Pushing\x20to\x20project...',()=>_0x23664c['llm'][_0x32e21c(0xda)](_0x89b900,{'force':_0x5d768d})),_0x169406=_0x188a7d[_0x32e21c(0x10d)][_0x32e21c(0x8a)][_0x32e21c(0x91)]>0x0||_0x188a7d[_0x32e21c(0x10d)]['knowledgeBases']['errors']>0x0||_0x188a7d[_0x32e21c(0x10d)][_0x32e21c(0x82)][_0x32e21c(0x91)]>0x0||_0x188a7d[_0x32e21c(0x10d)][_0x32e21c(0x121)][_0x32e21c(0x91)]>0x0;if(_0x169406){console[_0x32e21c(0x126)](a4_0x211100[_0x32e21c(0x111)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x32e21c(0x126)](),console['log'](a4_0x211100[_0x32e21c(0xc0)](_0x32e21c(0xee)));for(const _0x3e97f6 of _0x188a7d[_0x32e21c(0x8a)]){_0x3e97f6['action']===_0x32e21c(0x80)&&console[_0x32e21c(0x126)](a4_0x211100[_0x32e21c(0xc0)](_0x32e21c(0x134)+_0x3e97f6[_0x32e21c(0xe5)]+_0x32e21c(0xad)+_0x3e97f6[_0x32e21c(0x80)]));}for(const _0x40c176 of _0x188a7d[_0x32e21c(0xbc)]){_0x40c176['action']===_0x32e21c(0x80)&&console[_0x32e21c(0x126)](a4_0x211100['red'](_0x32e21c(0xa4)+_0x40c176[_0x32e21c(0x110)]+'\x22:\x20'+_0x40c176[_0x32e21c(0x80)]));}for(const _0x557527 of _0x188a7d[_0x32e21c(0x82)]){_0x557527[_0x32e21c(0xc3)]===_0x32e21c(0x80)&&console['log'](a4_0x211100[_0x32e21c(0xc0)](_0x32e21c(0xb6)+_0x557527['name']+_0x32e21c(0xad)+_0x557527['error']));}for(const _0x1d24de of _0x188a7d[_0x32e21c(0x121)]){_0x1d24de['action']==='error'&&console[_0x32e21c(0x126)](a4_0x211100[_0x32e21c(0xc0)](_0x32e21c(0x135)+_0x1d24de[_0x32e21c(0x110)]+_0x32e21c(0xad)+_0x1d24de['error']));}for(const _0x25ed6a of _0x188a7d[_0x32e21c(0x11a)]){_0x25ed6a[_0x32e21c(0xc3)]===_0x32e21c(0x80)&&console[_0x32e21c(0x126)](a4_0x211100['red'](_0x32e21c(0xb7)+_0x25ed6a[_0x32e21c(0x110)]+_0x32e21c(0xad)+_0x25ed6a['error']));}return 0x1;}console['log'](a4_0x211100['green'](_0x32e21c(0x86)+(_0x378647+_0x24d970)+'\x20resources\x20to\x20\x27'+_0x188a7d[_0x32e21c(0x11b)]+'\x27'));const _0x2eace7=getLLMProjectUrl(_0x481d1f,_0x188a7d[_0x32e21c(0x107)]);return console[_0x32e21c(0x126)]('Project:\x20'+a4_0x211100[_0x32e21c(0x127)](_0x2eace7)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x1a4011=a5_0x5385;(function(_0x1dac9d,_0x128495){const _0x2b0ed5=a5_0x5385,_0x361afd=_0x1dac9d();while(!![]){try{const _0x4a7c70=parseInt(_0x2b0ed5(0x171))/0x1+-parseInt(_0x2b0ed5(0x190))/0x2+-parseInt(_0x2b0ed5(0x1b8))/0x3*(-parseInt(_0x2b0ed5(0x19c))/0x4)+-parseInt(_0x2b0ed5(0x16b))/0x5*(-parseInt(_0x2b0ed5(0x1a9))/0x6)+parseInt(_0x2b0ed5(0x1dd))/0x7*(-parseInt(_0x2b0ed5(0x1c6))/0x8)+-parseInt(_0x2b0ed5(0x1f5))/0x9+parseInt(_0x2b0ed5(0x1a3))/0xa;if(_0x4a7c70===_0x128495)break;else _0x361afd['push'](_0x361afd['shift']());}catch(_0x3cca98){_0x361afd['push'](_0x361afd['shift']());}}}(a5_0x7157,0x2fbab));function a5_0x7157(){const _0x3fb487=['dim',':\x20Sending\x20user\x20input...','6AHyvjP','Round\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Evaluating\x20response...','has','now','testName','/<agent-name>','No\x20tests\x20have\x20tags\x20defined.','red','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Available\x20tags:\x20','\x20(cached)','toLowerCase','Output\x20written\x20to:\x20','6KQeVai','Cached\x20run\x20is\x20from\x20site\x20\x22','white','Re-evaluation\x20Summary','executeReeval','log','Running\x20test:\x20','\x20\x20Conversation:\x20','Duration:\x20','not\x20found','\x20-\x20','rounds','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','llm','104wpwILc','tags','filter','resolve','Run\x20\x27tdx\x20agent\x20pull\x20','agentDirs','found','Error\x20writing\x20output\x20file:\x20','No\x20tests\x20found\x20matching:\x20','Failed\x20Tests:','\x22,\x20but\x20current\x20site\x20is\x20\x22','FAIL','reeval','conversations','round','PASS','Project\x20path:\x20','find','verbose','agent','green','toISOString','...\x20','2443WUBMGp','json','substring','Running\x20agent\x20tests...','isSpinning','repeat','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','message','\x20\x20-\x20','writeFileSync','name','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','table','Run\x20tests\x20for\x20an\x20LLM\x20agent','Executing\x20new\x20tests...','size','some','✓\x20PASS:\x20','Total:\x20\x20\x20\x20','resolveAgentId','timestamp','join','add','\x20\x20Round\x20','3042378VxReWE','test.yml','status','tsv','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','length','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','conversation_url','Cached\x20run\x20from:\x20','New\x20tests\x20to\x20execute:\x20','\x20(new)','yellow','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','agent:test','Test\x20Configuration:','ERROR','includes','tests','\x20\x20Agent:\x20','Agent:\x20','dryRun','basename','792415OILVGO','Tests\x20found:\x20','split','reason','no_context','cyan','18812FbkkeB','existsSync','Round\x201/','\x20\x20Evaluating...\x20','projectName','Using\x20agent:\x20','\x22:\x20','agentName','Conversation\x20URL:\x20','trim','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','no_tests','✗\x20ERROR:\x20','testYmlPath','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','stop','utf-8','Test\x20','Running:\x20','description','Available\x20tests:\x20','llmProject','404','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','map','start','Either\x20switch\x20to\x20the\x20\x22','Site:\x20','Usage:','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','256564pRprPP','forEach','push','execute','Error:\x20No\x20previous\x20test\x20run\x20found.','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','context','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','multiple_agents','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','text','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','108096eLsIxQ','output','Test\x20Summary','projectDir','Failed:\x20\x20\x20','...','jsonl','4350170BEQnnP','Passed:\x20\x20\x20','site','✗\x20FAIL:\x20'];a5_0x7157=function(){return _0x3fb487;};return a5_0x7157();}import*as a5_0xb6ee80 from'node:fs';import*as a5_0x4f828f from'node:path';function a5_0x5385(_0x5a054,_0x524705){_0x5a054=_0x5a054-0x156;const _0x7157d1=a5_0x7157();let _0x5385c7=_0x7157d1[_0x5a054];return _0x5385c7;}import a5_0x2fb5d0 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x1a4011(0x1e7)]=a5_0x1a4011(0x162);[a5_0x1a4011(0x184)]=a5_0x1a4011(0x1ea);async[a5_0x1a4011(0x193)](_0x39df46){const _0x1b6575=a5_0x1a4011,{options:_0x4d2fe3,args:_0x1cf9ef,tdx:_0x58e263}=_0x39df46,_0x48eec4=_0x1cf9ef[0x0]||'.',_0x441862=_0x4d2fe3[_0x1b6575(0x169)],_0x3a38db=_0x4d2fe3,_0xc6b0e4=_0x3a38db['eval']===![],_0x14b7a1=_0x3a38db[_0x1b6575(0x1d2)],_0x378a19=_0x3a38db[_0x1b6575(0x1e7)],_0x5dd44f=_0x3a38db[_0x1b6575(0x1c7)],_0x363548=_0x4d2fe3[_0x1b6575(0x1a5)],_0x285f38=_0x3a38db[_0x1b6575(0x19d)];if(_0x14b7a1&&_0xc6b0e4)return console['log'](a5_0x2fb5d0[_0x1b6575(0x1b2)](_0x1b6575(0x1b3))),0x1;let _0x40e66d=_0x1b6575(0x1e9);if(_0x3a38db[_0x1b6575(0x1de)])_0x40e66d=_0x1b6575(0x1de);else{if(_0x3a38db[_0x1b6575(0x1a2)])_0x40e66d=_0x1b6575(0x1a2);else{if(_0x3a38db[_0x1b6575(0x158)])_0x40e66d=_0x1b6575(0x158);else{if(_0x3a38db[_0x1b6575(0x1e9)])_0x40e66d=_0x1b6575(0x1e9);}}}const _0x26f27a=_0x3a38db[_0x1b6575(0x186)];let _0x54b096=_0x48eec4;const _0x488f24=a5_0xb6ee80[_0x1b6575(0x172)](_0x48eec4),_0x2428b3=_0x48eec4==='.';if(!_0x488f24||_0x2428b3){const _0x49cd50=resolveProjectFromContext(_0x48eec4,_0x26f27a,{'requireFile':_0x1b6575(0x156)});if(_0x49cd50[_0x1b6575(0x1cc)])_0x54b096=_0x49cd50[_0x1b6575(0x19f)],_0x49cd50['source']===_0x1b6575(0x196)&&console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1a7)](_0x1b6575(0x176)+_0x54b096));else switch(_0x49cd50[_0x1b6575(0x16e)]){case _0x1b6575(0x16f):console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x160)](_0x49cd50[_0x1b6575(0x1e4)])),console['log'](),console['log'](_0x1b6575(0x18e)),console['log'](_0x1b6575(0x15b)),console[_0x1b6575(0x1bd)](_0x1b6575(0x1e8)),console[_0x1b6575(0x1bd)](),console[_0x1b6575(0x1bd)](_0x1b6575(0x17f));return 0x1;case'no_local_folder':console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x160)](_0x49cd50[_0x1b6575(0x1e4)])),console[_0x1b6575(0x1bd)](),console[_0x1b6575(0x1bd)](_0x1b6575(0x1ca)+_0x49cd50['llmProject']+_0x1b6575(0x188));return 0x1;case _0x1b6575(0x198):{const _0x4ac640=a5_0x4f828f[_0x1b6575(0x16a)](_0x49cd50[_0x1b6575(0x19f)]);console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x160)](_0x1b6575(0x159)+_0x49cd50['llmProject']+'\x22:'));for(const _0x1df174 of _0x49cd50[_0x1b6575(0x1cb)]){console['log'](_0x1b6575(0x1e5)+_0x1df174);}return console[_0x1b6575(0x1bd)](),console[_0x1b6575(0x1bd)](_0x1b6575(0x1e3)+_0x4ac640+_0x1b6575(0x1b0)),0x1;}case _0x1b6575(0x17c):console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x160)](_0x1b6575(0x197)+_0x49cd50[_0x1b6575(0x186)]+'\x22.')),console[_0x1b6575(0x1bd)](a5_0x2fb5d0['dim'](_0x1b6575(0x1d6)+_0x49cd50[_0x1b6575(0x19f)])),console[_0x1b6575(0x1bd)](),console[_0x1b6575(0x1bd)](_0x1b6575(0x17b));return 0x1;}}const {definition:_0xa7b1e4,agentInfo:_0x202ba4}=parseTestFile(_0x54b096);let _0xd821bc=_0xa7b1e4['tests'];if(_0x378a19){const _0x2fd3a4=_0x378a19[_0x1b6575(0x16d)](',')[_0x1b6575(0x18a)](_0x96ac50=>_0x96ac50[_0x1b6575(0x17a)]());_0xd821bc=_0xa7b1e4[_0x1b6575(0x166)][_0x1b6575(0x1c8)](_0x447315=>_0x2fd3a4[_0x1b6575(0x165)](_0x447315[_0x1b6575(0x1e7)]));if(_0xd821bc['length']===0x0)return console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x160)](_0x1b6575(0x1ce)+_0x378a19)),console[_0x1b6575(0x1bd)](a5_0x2fb5d0['dim'](_0x1b6575(0x185)+_0xa7b1e4[_0x1b6575(0x166)][_0x1b6575(0x18a)](_0x1faa1b=>_0x1faa1b[_0x1b6575(0x1e7)])[_0x1b6575(0x1f2)](',\x20'))),0x1;}if(_0x5dd44f){const _0x2ccad7=_0x5dd44f[_0x1b6575(0x16d)](',')[_0x1b6575(0x18a)](_0x2a1766=>_0x2a1766[_0x1b6575(0x17a)]()[_0x1b6575(0x1b6)]());_0xd821bc=_0xd821bc['filter'](_0x9dd6c9=>_0x9dd6c9['tags']?.[_0x1b6575(0x1ed)](_0x87996d=>_0x2ccad7[_0x1b6575(0x165)](_0x87996d[_0x1b6575(0x1b6)]())));if(_0xd821bc['length']===0x0){console['log'](a5_0x2fb5d0['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x5dd44f));const _0x3dca16=new Set();return _0xa7b1e4[_0x1b6575(0x166)][_0x1b6575(0x191)](_0xafffcd=>_0xafffcd[_0x1b6575(0x1c7)]?.['forEach'](_0x43c98a=>_0x3dca16[_0x1b6575(0x1f3)](_0x43c98a))),_0x3dca16[_0x1b6575(0x1ec)]>0x0?console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1a7)](_0x1b6575(0x1b4)+[..._0x3dca16]['join'](',\x20'))):console['log'](a5_0x2fb5d0[_0x1b6575(0x1a7)](_0x1b6575(0x1b1))),0x1;}}if(_0x14b7a1)return this[_0x1b6575(0x1bc)](_0x39df46,{'definition':{'tests':_0xd821bc},'agentInfo':_0x202ba4,'outputFormat':_0x40e66d,'outputFile':_0x285f38,'testNames':_0x378a19});if(_0x441862){console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x170)](_0x1b6575(0x163))),console[_0x1b6575(0x1bd)]('\x20\x20Site:\x20'+a5_0x2fb5d0[_0x1b6575(0x1ba)](_0x363548)),console[_0x1b6575(0x1bd)]('\x20\x20Project:\x20'+a5_0x2fb5d0[_0x1b6575(0x1ba)](_0x202ba4['projectName'])),console[_0x1b6575(0x1bd)](_0x1b6575(0x167)+a5_0x2fb5d0[_0x1b6575(0x1ba)](_0x202ba4['agentName'])),console['log'](),console[_0x1b6575(0x1bd)](_0x1b6575(0x16c)+a5_0x2fb5d0[_0x1b6575(0x1ba)](_0xd821bc[_0x1b6575(0x15a)]));for(let _0x555646=0x0;_0x555646<_0xd821bc[_0x1b6575(0x15a)];_0x555646++){const _0x5afbc3=_0xd821bc[_0x555646],_0x1a9c91=_0x5afbc3[_0x1b6575(0x1c3)][_0x1b6575(0x15a)]===0x1?_0x1b6575(0x1d4):_0x1b6575(0x1c3),_0x51d671=_0x5afbc3[_0x1b6575(0x1c7)]?.[_0x1b6575(0x15a)]?'\x20['+_0x5afbc3['tags'][_0x1b6575(0x1f2)](',\x20')+']':'';console['log']('\x20\x20'+(_0x555646+0x1)+'.\x20'+a5_0x2fb5d0['white'](_0x5afbc3['name'])+'\x20('+_0x5afbc3[_0x1b6575(0x1c3)]['length']+'\x20'+_0x1a9c91+')'+a5_0x2fb5d0[_0x1b6575(0x1a7)](_0x51d671));}return 0x0;}let _0x44ed9e,_0x2acaec;try{_0x44ed9e=await _0x58e263[_0x1b6575(0x1c5)]['resolveProjectId'](_0x202ba4[_0x1b6575(0x175)]);}catch(_0x4e6f21){const _0x156526=_0x4e6f21 instanceof Error?_0x4e6f21[_0x1b6575(0x1e4)]:String(_0x4e6f21);return _0x156526[_0x1b6575(0x165)]('404')||_0x156526[_0x1b6575(0x1b6)]()[_0x1b6575(0x165)]('not\x20found')?console['log'](a5_0x2fb5d0[_0x1b6575(0x1b2)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x202ba4[_0x1b6575(0x175)])):console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1b2)](_0x1b6575(0x1c4)+_0x202ba4[_0x1b6575(0x175)]+_0x1b6575(0x177)+_0x156526)),0x1;}try{_0x2acaec=await _0x58e263['llm'][_0x1b6575(0x1f0)](_0x202ba4[_0x1b6575(0x178)],_0x44ed9e);}catch(_0x24808a){const _0x18bf7a=_0x24808a instanceof Error?_0x24808a[_0x1b6575(0x1e4)]:String(_0x24808a);return _0x18bf7a[_0x1b6575(0x165)](_0x1b6575(0x187))||_0x18bf7a[_0x1b6575(0x1b6)]()[_0x1b6575(0x165)](_0x1b6575(0x1c1))?console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1b2)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x202ba4[_0x1b6575(0x178)])):console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1b2)](_0x1b6575(0x195)+_0x202ba4[_0x1b6575(0x178)]+'\x22:\x20'+_0x18bf7a)),0x1;}let _0x57db1f;if(!_0xc6b0e4)try{_0x57db1f=await setupEvaluatorAgent(_0x58e263[_0x1b6575(0x1c5)],_0x4d2fe3[_0x1b6575(0x1d8)]);}catch(_0x52f7cb){const _0x1b6638=_0x52f7cb instanceof Error?_0x52f7cb[_0x1b6575(0x1e4)]:String(_0x52f7cb);return console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1b2)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x1b6638)),0x1;}console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x170)](_0x1b6575(0x1e0))),console[_0x1b6575(0x1bd)](_0x1b6575(0x18d)+a5_0x2fb5d0[_0x1b6575(0x1ba)](_0x363548)),console[_0x1b6575(0x1bd)]('Agent:\x20'+a5_0x2fb5d0[_0x1b6575(0x1ba)](_0x202ba4[_0x1b6575(0x175)]+'/'+_0x202ba4[_0x1b6575(0x178)])),console[_0x1b6575(0x1bd)]();const _0x15ef1e=[],_0x534a09=[],_0x1cf9fa=Date[_0x1b6575(0x1ae)]();for(let _0x203560=0x0;_0x203560<_0xd821bc[_0x1b6575(0x15a)];_0x203560++){const _0x62dfdb=_0xd821bc[_0x203560];_0xd821bc[_0x1b6575(0x15a)]>0x1?console[_0x1b6575(0x1bd)](_0x1b6575(0x182)+(_0x203560+0x1)+'/'+_0xd821bc[_0x1b6575(0x15a)]+':\x20'+a5_0x2fb5d0[_0x1b6575(0x1ba)](_0x62dfdb['name'])):console['log'](_0x1b6575(0x1be)+a5_0x2fb5d0[_0x1b6575(0x1ba)](_0x62dfdb[_0x1b6575(0x1e7)]));const _0x31f5ef=createCommandSpinner(_0x1b6575(0x173)+_0x62dfdb[_0x1b6575(0x1c3)][_0x1b6575(0x15a)]+':\x20Sending\x20user\x20input...');_0x31f5ef[_0x1b6575(0x18b)]();try{const {result:_0x50d5a7,conversation:_0x518d5d}=await runTest(_0x58e263[_0x1b6575(0x1c5)],_0x62dfdb,{'agentId':_0x2acaec,'projectId':_0x44ed9e,'site':_0x363548,'noEval':_0xc6b0e4,'evaluatorId':_0x57db1f,'onRoundStart':(_0x1203de,_0x5a68a0)=>{const _0x49ed3b=_0x1b6575;_0x31f5ef[_0x49ed3b(0x19a)]=_0x49ed3b(0x1aa)+(_0x1203de+0x1)+'/'+_0x5a68a0+_0x49ed3b(0x1a8);},'onRoundComplete':(_0x4a103d,_0x2908d7,_0xb93012)=>{const _0x158e1b=_0x1b6575,_0x1599fe=formatElapsed(_0x2908d7);_0xb93012?console[_0x158e1b(0x1bd)](_0x158e1b(0x1f4)+(_0x4a103d+0x1)+'/'+_0x62dfdb[_0x158e1b(0x1c3)][_0x158e1b(0x15a)]+_0x158e1b(0x1dc)+a5_0x2fb5d0[_0x158e1b(0x1da)]('✓')+'\x20('+_0x1599fe+')'):console[_0x158e1b(0x1bd)]('\x20\x20Round\x20'+(_0x4a103d+0x1)+'/'+_0x62dfdb[_0x158e1b(0x1c3)][_0x158e1b(0x15a)]+_0x158e1b(0x1dc)+a5_0x2fb5d0[_0x158e1b(0x1b2)]('✗'));},'onEvaluationStart':()=>{const _0x23ce61=_0x1b6575;_0x31f5ef[_0x23ce61(0x19a)]=_0x23ce61(0x1ac);},'onEvaluationComplete':_0xed7d0f=>{const _0x58ca5c=_0x1b6575,_0x2d5948=formatElapsed(_0xed7d0f);console[_0x58ca5c(0x1bd)](_0x58ca5c(0x174)+a5_0x2fb5d0[_0x58ca5c(0x1da)]('✓')+'\x20('+_0x2d5948+')');}});_0x31f5ef['stop'](),_0x15ef1e['push'](_0x50d5a7),_0x534a09['push'](_0x518d5d);if(_0x50d5a7['status']===_0x1b6575(0x1d5))console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1da)](_0x1b6575(0x1ee)+_0x50d5a7[_0x1b6575(0x16e)]));else _0x50d5a7[_0x1b6575(0x157)]===_0x1b6575(0x1d1)?console['log'](a5_0x2fb5d0['red'](_0x1b6575(0x1a6)+_0x50d5a7['reason'])):console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1b2)]('✗\x20ERROR:\x20'+_0x50d5a7[_0x1b6575(0x16e)]));_0x50d5a7[_0x1b6575(0x15c)]&&console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1a7)](_0x1b6575(0x179)+_0x50d5a7[_0x1b6575(0x15c)])),console[_0x1b6575(0x1bd)]();}catch(_0x1448d1){_0x31f5ef[_0x1b6575(0x180)]();const _0x21c3bb=_0x1448d1 instanceof Error?_0x1448d1[_0x1b6575(0x1e4)]:String(_0x1448d1);console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1b2)](_0x1b6575(0x17d)+_0x21c3bb)),console[_0x1b6575(0x1bd)](),_0x15ef1e[_0x1b6575(0x192)]({'name':_0x62dfdb['name'],'status':_0x1b6575(0x164),'reason':_0x21c3bb,'timestamp':new Date()[_0x1b6575(0x1db)](),'duration_ms':0x0});}}const _0x61f5fb=Date[_0x1b6575(0x1ae)]()-_0x1cf9fa,_0x33ab96=_0x15ef1e[_0x1b6575(0x1c8)](_0x465aa8=>_0x465aa8['status']==='PASS')['length'],_0xfd3424=_0x15ef1e['filter'](_0x3d7b28=>_0x3d7b28[_0x1b6575(0x157)]===_0x1b6575(0x1d1))[_0x1b6575(0x15a)],_0x542a4a=_0x15ef1e[_0x1b6575(0x1c8)](_0xe7e156=>_0xe7e156[_0x1b6575(0x157)]===_0x1b6575(0x164))[_0x1b6575(0x15a)];console['log']('━'[_0x1b6575(0x1e2)](0x3c)),console[_0x1b6575(0x1bd)](_0x1b6575(0x19e)),console['log']('━'[_0x1b6575(0x1e2)](0x3c)),console[_0x1b6575(0x1bd)]('Total:\x20\x20\x20\x20'+_0x15ef1e[_0x1b6575(0x15a)]),console['log'](_0x1b6575(0x1a4)+a5_0x2fb5d0[_0x1b6575(0x1da)](_0x33ab96)),console[_0x1b6575(0x1bd)](_0x1b6575(0x1a0)+a5_0x2fb5d0[_0x1b6575(0x1b2)](_0xfd3424));_0x542a4a>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x2fb5d0[_0x1b6575(0x1b2)](_0x542a4a));console[_0x1b6575(0x1bd)](_0x1b6575(0x1c0)+formatElapsed(_0x61f5fb)),console[_0x1b6575(0x1bd)]('━'['repeat'](0x3c));const _0x499882=_0x15ef1e[_0x1b6575(0x1c8)](_0x3847d4=>_0x3847d4[_0x1b6575(0x157)]!==_0x1b6575(0x1d5));if(_0x499882[_0x1b6575(0x15a)]>0x0){console[_0x1b6575(0x1bd)](),console['log'](_0x1b6575(0x1cf));for(const _0x281583 of _0x499882){const _0x53b992=a5_0x2fb5d0[_0x1b6575(0x1b2)]('✗'),_0xe5a2a9=_0x281583[_0x1b6575(0x16e)]['length']>0x32?_0x281583[_0x1b6575(0x16e)][_0x1b6575(0x1df)](0x0,0x32)+_0x1b6575(0x1a1):_0x281583[_0x1b6575(0x16e)];console['log']('\x20\x20'+_0x53b992+'\x20'+_0x281583['name']+':\x20'+_0xe5a2a9);}}const _0x51954e={'summary':{'total':_0x15ef1e[_0x1b6575(0x15a)],'passed':_0x33ab96,'failed':_0xfd3424,'errors':_0x542a4a>0x0?_0x542a4a:undefined,'duration_ms':_0x61f5fb},'tests':_0x15ef1e,'agent':{'project':_0x202ba4[_0x1b6575(0x175)],'name':_0x202ba4[_0x1b6575(0x178)],'site':_0x363548},'timestamp':new Date(_0x1cf9fa)[_0x1b6575(0x1db)]()};try{const _0x1f2d01=buildCachedTestRun(_0x534a09,{'site':_0x363548,'projectId':_0x44ed9e,'projectName':_0x202ba4[_0x1b6575(0x175)],'agentId':_0x2acaec,'agentName':_0x202ba4[_0x1b6575(0x178)],'testYmlPath':a5_0x4f828f[_0x1b6575(0x1c9)](_0x202ba4[_0x1b6575(0x17e)])});saveLastTestRun(_0x1f2d01);}catch{}if(_0x40e66d!==_0x1b6575(0x1e9)||_0x285f38){const _0x4e9b8b=formatResults(_0x51954e,_0x40e66d);if(_0x285f38)try{a5_0xb6ee80[_0x1b6575(0x1e6)](_0x285f38,_0x4e9b8b,'utf-8'),console[_0x1b6575(0x1bd)](),console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1a7)](_0x1b6575(0x1b7)+_0x285f38));}catch(_0xe4f16a){return console[_0x1b6575(0x1bd)](),console[_0x1b6575(0x1bd)](a5_0x2fb5d0[_0x1b6575(0x1b2)](_0x1b6575(0x1cd)+_0xe4f16a)),0x1;}else console[_0x1b6575(0x1bd)](),console[_0x1b6575(0x1bd)](_0x4e9b8b);}return _0x499882[_0x1b6575(0x15a)]>0x0?0x1:0x0;}async[a5_0x1a4011(0x1bc)](_0x12312f,_0x5afd5c){const _0x57bd4f=a5_0x1a4011,{options:_0x49ade9,tdx:_0x5cd5fb}=_0x12312f,{definition:_0x3c4cc7,agentInfo:_0xa2a16,outputFormat:_0x5c9eaf,outputFile:_0x44a228}=_0x5afd5c,_0x19d496=_0x49ade9[_0x57bd4f(0x1a5)],_0x4386ce=loadLastTestRun();if(!_0x4386ce)return console['log'](a5_0x2fb5d0['red'](_0x57bd4f(0x194))),console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1a7)](_0x57bd4f(0x1ab))),0x1;if(_0x4386ce['agent']['agentName']!==_0xa2a16[_0x57bd4f(0x178)])return console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1b2)](_0x57bd4f(0x18f)+_0x4386ce[_0x57bd4f(0x1d9)][_0x57bd4f(0x178)]+_0x57bd4f(0x189)+_0xa2a16[_0x57bd4f(0x178)]+'\x22.')),console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1a7)](_0x57bd4f(0x199))),0x1;const _0x4ae66d=new Set(_0x4386ce[_0x57bd4f(0x1d3)][_0x57bd4f(0x18a)](_0x522d1e=>_0x522d1e[_0x57bd4f(0x1af)])),_0x114cd=_0x3c4cc7[_0x57bd4f(0x166)][_0x57bd4f(0x1c8)](_0xbcafc9=>!_0x4ae66d[_0x57bd4f(0x1ad)](_0xbcafc9[_0x57bd4f(0x1e7)]));if(_0x114cd[_0x57bd4f(0x15a)]>0x0&&_0x4386ce[_0x57bd4f(0x1a5)]!==_0x19d496)return console[_0x57bd4f(0x1bd)](a5_0x2fb5d0['red'](_0x57bd4f(0x19b))),console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1a7)](_0x57bd4f(0x1b9)+_0x4386ce[_0x57bd4f(0x1a5)]+_0x57bd4f(0x1d0)+_0x19d496+'\x22.')),console['log'](a5_0x2fb5d0[_0x57bd4f(0x1a7)](_0x57bd4f(0x18c)+_0x4386ce[_0x57bd4f(0x1a5)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x4ee4dc=_0x3c4cc7[_0x57bd4f(0x166)][_0x57bd4f(0x1c8)](_0x264d93=>_0x4ae66d[_0x57bd4f(0x1ad)](_0x264d93[_0x57bd4f(0x1e7)])),_0x44bb03=_0x114cd;let _0x25c839;try{_0x25c839=await setupEvaluatorAgent(_0x5cd5fb[_0x57bd4f(0x1c5)],_0x49ade9['verbose']);}catch(_0x395a6e){const _0x3da2fc=_0x395a6e instanceof Error?_0x395a6e[_0x57bd4f(0x1e4)]:String(_0x395a6e);return console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1b2)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x3da2fc)),0x1;}console[_0x57bd4f(0x1bd)](a5_0x2fb5d0['cyan']('Re-evaluating\x20cached\x20test\x20run...')),console[_0x57bd4f(0x1bd)](_0x57bd4f(0x15d)+a5_0x2fb5d0['white'](_0x4386ce[_0x57bd4f(0x1f1)])),console[_0x57bd4f(0x1bd)](_0x57bd4f(0x168)+a5_0x2fb5d0[_0x57bd4f(0x1ba)](_0x4386ce['agent'][_0x57bd4f(0x175)]+'/'+_0x4386ce[_0x57bd4f(0x1d9)][_0x57bd4f(0x178)]));_0x44bb03[_0x57bd4f(0x15a)]>0x0&&console[_0x57bd4f(0x1bd)](_0x57bd4f(0x15e)+a5_0x2fb5d0['yellow'](_0x44bb03[_0x57bd4f(0x15a)]));console['log']();const _0x3a0d7e=[],_0x248c81=Date['now'](),_0x2d8051=createCommandSpinner('Re-evaluating...');if(_0x4ee4dc[_0x57bd4f(0x15a)]>0x0)try{const _0x998e74=await reevaluateFromCache(_0x5cd5fb[_0x57bd4f(0x1c5)],_0x4386ce,{'tests':_0x4ee4dc},{'evaluatorId':_0x25c839,'onTestStart':(_0xfa72d8,_0x4d700b,_0x3e9298)=>{const _0xfe6c3b=_0x57bd4f;_0x2d8051[_0xfe6c3b(0x19a)]='Re-evaluating\x20'+(_0x4d700b+0x1)+'/'+_0x3e9298+':\x20'+_0xfa72d8+'...';if(!_0x2d8051[_0xfe6c3b(0x1e1)])_0x2d8051[_0xfe6c3b(0x18b)]();},'onTestComplete':(_0x277201,_0x4988e1)=>{const _0xed92d0=_0x57bd4f;_0x2d8051[_0xed92d0(0x180)]();if(_0x4988e1[_0xed92d0(0x157)]===_0xed92d0(0x1d5))console['log'](a5_0x2fb5d0[_0xed92d0(0x1da)]('✓\x20PASS:\x20'+_0x277201)+a5_0x2fb5d0['dim'](_0xed92d0(0x1b5)));else _0x4988e1[_0xed92d0(0x157)]===_0xed92d0(0x1d1)?console[_0xed92d0(0x1bd)](a5_0x2fb5d0['red'](_0xed92d0(0x1a6)+_0x277201+'\x20-\x20'+_0x4988e1[_0xed92d0(0x16e)])+a5_0x2fb5d0[_0xed92d0(0x1a7)](_0xed92d0(0x1b5))):console[_0xed92d0(0x1bd)](a5_0x2fb5d0[_0xed92d0(0x1b2)]('✗\x20ERROR:\x20'+_0x277201+_0xed92d0(0x1c2)+_0x4988e1['reason']));_0x4988e1[_0xed92d0(0x15c)]&&console[_0xed92d0(0x1bd)](a5_0x2fb5d0[_0xed92d0(0x1a7)](_0xed92d0(0x1bf)+_0x4988e1['conversation_url'])),_0x3a0d7e[_0xed92d0(0x192)](_0x4988e1);},'onTestSkipped':(_0x467339,_0x313603)=>{const _0x18cf56=_0x57bd4f;_0x2d8051['stop'](),console[_0x18cf56(0x1bd)](a5_0x2fb5d0[_0x18cf56(0x160)]('⚠\x20SKIPPED:\x20'+_0x467339+'\x20-\x20'+_0x313603));}});for(const _0x1945e6 of _0x998e74){!_0x3a0d7e[_0x57bd4f(0x1d7)](_0x4a5e05=>_0x4a5e05['name']===_0x1945e6[_0x57bd4f(0x1e7)])&&_0x3a0d7e[_0x57bd4f(0x192)](_0x1945e6);}}catch(_0xc1f343){_0x2d8051[_0x57bd4f(0x180)]();const _0xad4dee=_0xc1f343 instanceof Error?_0xc1f343['message']:String(_0xc1f343);return console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1b2)](_0x57bd4f(0x161)+_0xad4dee)),0x1;}_0x2d8051[_0x57bd4f(0x180)]();if(_0x44bb03[_0x57bd4f(0x15a)]>0x0){console[_0x57bd4f(0x1bd)](),console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x170)](_0x57bd4f(0x1eb)));const {projectId:_0x145141,agentId:_0x3ad939}=_0x4386ce[_0x57bd4f(0x1d9)];for(const _0x3f09d9 of _0x44bb03){console[_0x57bd4f(0x1bd)](_0x57bd4f(0x183)+a5_0x2fb5d0['white'](_0x3f09d9[_0x57bd4f(0x1e7)]));const _0x1b0d14=createCommandSpinner(_0x57bd4f(0x173)+_0x3f09d9[_0x57bd4f(0x1c3)][_0x57bd4f(0x15a)]+_0x57bd4f(0x1a8));_0x1b0d14[_0x57bd4f(0x18b)]();try{const {result:_0x50336d}=await runTest(_0x5cd5fb[_0x57bd4f(0x1c5)],_0x3f09d9,{'agentId':_0x3ad939,'projectId':_0x145141,'site':_0x4386ce[_0x57bd4f(0x1a5)],'noEval':![],'evaluatorId':_0x25c839,'onRoundStart':(_0x4b1f4c,_0x49d6b2)=>{const _0x337dde=_0x57bd4f;_0x1b0d14[_0x337dde(0x19a)]=_0x337dde(0x1aa)+(_0x4b1f4c+0x1)+'/'+_0x49d6b2+_0x337dde(0x1a8);},'onRoundComplete':(_0x42278e,_0x1491ce,_0x56e03b)=>{const _0x3a662a=_0x57bd4f,_0x393a1c=formatElapsed(_0x1491ce);_0x56e03b?console['log'](_0x3a662a(0x1f4)+(_0x42278e+0x1)+'/'+_0x3f09d9['rounds']['length']+'...\x20'+a5_0x2fb5d0[_0x3a662a(0x1da)]('✓')+'\x20('+_0x393a1c+')'):console['log']('\x20\x20Round\x20'+(_0x42278e+0x1)+'/'+_0x3f09d9['rounds'][_0x3a662a(0x15a)]+_0x3a662a(0x1dc)+a5_0x2fb5d0['red']('✗'));},'onEvaluationStart':()=>{const _0xafca2c=_0x57bd4f;_0x1b0d14[_0xafca2c(0x19a)]=_0xafca2c(0x1ac);},'onEvaluationComplete':_0xaf952d=>{const _0x33b7e9=_0x57bd4f,_0x393623=formatElapsed(_0xaf952d);console[_0x33b7e9(0x1bd)](_0x33b7e9(0x174)+a5_0x2fb5d0[_0x33b7e9(0x1da)]('✓')+'\x20('+_0x393623+')');}});_0x1b0d14[_0x57bd4f(0x180)](),_0x3a0d7e[_0x57bd4f(0x192)](_0x50336d);if(_0x50336d[_0x57bd4f(0x157)]===_0x57bd4f(0x1d5))console['log'](a5_0x2fb5d0[_0x57bd4f(0x1da)]('✓\x20PASS:\x20'+_0x50336d[_0x57bd4f(0x16e)])+a5_0x2fb5d0[_0x57bd4f(0x1a7)](_0x57bd4f(0x15f)));else _0x50336d[_0x57bd4f(0x157)]===_0x57bd4f(0x1d1)?console['log'](a5_0x2fb5d0[_0x57bd4f(0x1b2)](_0x57bd4f(0x1a6)+_0x50336d[_0x57bd4f(0x16e)])+a5_0x2fb5d0[_0x57bd4f(0x1a7)](_0x57bd4f(0x15f))):console['log'](a5_0x2fb5d0[_0x57bd4f(0x1b2)]('✗\x20ERROR:\x20'+_0x50336d[_0x57bd4f(0x16e)]));_0x50336d[_0x57bd4f(0x15c)]&&console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1a7)]('\x20\x20Conversation:\x20'+_0x50336d[_0x57bd4f(0x15c)]));}catch(_0x322774){_0x1b0d14[_0x57bd4f(0x180)]();const _0x543334=_0x322774 instanceof Error?_0x322774[_0x57bd4f(0x1e4)]:String(_0x322774);console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1b2)]('✗\x20ERROR:\x20'+_0x543334)),_0x3a0d7e['push']({'name':_0x3f09d9[_0x57bd4f(0x1e7)],'status':'ERROR','reason':_0x543334,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x57bd4f(0x1bd)]();const _0x30c215=Date['now']()-_0x248c81,_0x786df4=_0x3a0d7e[_0x57bd4f(0x1c8)](_0x3603b2=>_0x3603b2[_0x57bd4f(0x157)]===_0x57bd4f(0x1d5))[_0x57bd4f(0x15a)],_0x2301f0=_0x3a0d7e['filter'](_0x331503=>_0x331503[_0x57bd4f(0x157)]===_0x57bd4f(0x1d1))[_0x57bd4f(0x15a)],_0x326dda=_0x3a0d7e[_0x57bd4f(0x1c8)](_0x2636d3=>_0x2636d3[_0x57bd4f(0x157)]===_0x57bd4f(0x164))[_0x57bd4f(0x15a)];console[_0x57bd4f(0x1bd)]('━'[_0x57bd4f(0x1e2)](0x3c)),console['log'](_0x57bd4f(0x1bb)),console['log']('━'['repeat'](0x3c)),console[_0x57bd4f(0x1bd)](_0x57bd4f(0x1ef)+_0x3a0d7e[_0x57bd4f(0x15a)]),console[_0x57bd4f(0x1bd)](_0x57bd4f(0x1a4)+a5_0x2fb5d0[_0x57bd4f(0x1da)](_0x786df4)),console['log'](_0x57bd4f(0x1a0)+a5_0x2fb5d0[_0x57bd4f(0x1b2)](_0x2301f0));_0x326dda>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x2fb5d0[_0x57bd4f(0x1b2)](_0x326dda));console['log']('Duration:\x20'+formatElapsed(_0x30c215)),console[_0x57bd4f(0x1bd)]('━'[_0x57bd4f(0x1e2)](0x3c));const _0x2719ec={'summary':{'total':_0x3a0d7e[_0x57bd4f(0x15a)],'passed':_0x786df4,'failed':_0x2301f0,'errors':_0x326dda>0x0?_0x326dda:undefined,'duration_ms':_0x30c215},'tests':_0x3a0d7e,'agent':{'project':_0xa2a16[_0x57bd4f(0x175)],'name':_0xa2a16[_0x57bd4f(0x178)],'site':_0x19d496},'timestamp':new Date(_0x248c81)[_0x57bd4f(0x1db)]()};if(_0x5c9eaf!==_0x57bd4f(0x1e9)||_0x44a228){const _0x36fcb8=formatResults(_0x2719ec,_0x5c9eaf);if(_0x44a228)try{a5_0xb6ee80[_0x57bd4f(0x1e6)](_0x44a228,_0x36fcb8,_0x57bd4f(0x181)),console[_0x57bd4f(0x1bd)](),console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1a7)](_0x57bd4f(0x1b7)+_0x44a228));}catch(_0x1d4938){return console[_0x57bd4f(0x1bd)](),console[_0x57bd4f(0x1bd)](a5_0x2fb5d0[_0x57bd4f(0x1b2)](_0x57bd4f(0x1cd)+_0x1d4938)),0x1;}else console[_0x57bd4f(0x1bd)](),console['log'](_0x36fcb8);}const _0x4869c2=_0x3a0d7e[_0x57bd4f(0x1c8)](_0x2f158a=>_0x2f158a[_0x57bd4f(0x157)]!=='PASS');return _0x4869c2['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x81937f=a5_0x48a7;function a5_0x2835(){const _0x30b3d0=['\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','\x22:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Failed:\x20\x20\x20','description','site','tags','table','find','Cached\x20run\x20is\x20from\x20site\x20\x22','toISOString','404','Re-evaluation\x20Summary','red','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Site:\x20','timestamp','log','Evaluating\x20response...','Available\x20tags:\x20','Conversation\x20URL:\x20','Passed:\x20\x20\x20','2IjOjUW','Total:\x20\x20\x20\x20','has','5LJDBan','Re-evaluating...','map','Tests\x20found:\x20','Error\x20writing\x20output\x20file:\x20','New\x20tests\x20to\x20execute:\x20','llm','verbose','reason','Test\x20Summary','length','✗\x20ERROR:\x20Project\x20not\x20found:\x20','status','yellow','green','push','agentName','\x20\x20Evaluating...\x20','1120yxWPdV','executeReeval','forEach','1458444faFuQB','projectDir','✗\x20FAIL:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','Test\x20','44254gtdveF','no_tests','Project\x20path:\x20','593462nSZAgt','\x20\x20Round\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','not\x20found','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Output\x20written\x20to:\x20','PASS','start','repeat','dim','writeFileSync','Either\x20switch\x20to\x20the\x20\x22','FAIL','dryRun','\x20\x20Agent:\x20','testName','text','rounds','Run\x20tests\x20for\x20an\x20LLM\x20agent','Running\x20agent\x20tests...','no_context','/<agent-name>','jsonl','No\x20tests\x20have\x20tags\x20defined.','\x20\x20Conversation:\x20','agent','agentDirs','stop','5303444CqPelo','Re-evaluating\x20cached\x20test\x20run...','resolve','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','now','message','add','white','Available\x20tests:\x20','json','Failed\x20Tests:','5511741CiDklS','tsv','execute','Test\x20Configuration:','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','basename','⚠\x20SKIPPED:\x20','\x20(new)','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','conversation_url','filter','Cached\x20run\x20from:\x20','11yvOAYj','name','cyan',':\x20Sending\x20user\x20input...','context','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','\x20\x20Project:\x20','substring','includes','test.yml','No\x20tests\x20found\x20matching:\x20','\x20-\x20','found','agent:test','trim','resolveAgentId','Agent:\x20','✗\x20ERROR:\x20','Round\x201/','join','✓\x20PASS:\x20','projectName','\x27\x20to\x20create\x20the\x20folder\x20structure.','resolveProjectId','12217760ruYhUx','Re-evaluating\x20','output','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','6984774KoXhpQ','toLowerCase','ERROR','llmProject','Executing\x20new\x20tests...','some','...\x20','tests','Duration:\x20','\x20(cached)','\x20\x20-\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20\x20Site:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Using\x20agent:\x20'];a5_0x2835=function(){return _0x30b3d0;};return a5_0x2835();}(function(_0x508740,_0x5c5a31){const _0x36bd38=a5_0x48a7,_0x57dd9a=_0x508740();while(!![]){try{const _0x1514f3=parseInt(_0x36bd38(0x221))/0x1*(-parseInt(_0x36bd38(0x201))/0x2)+parseInt(_0x36bd38(0x1b3))/0x3+parseInt(_0x36bd38(0x23d))/0x4*(parseInt(_0x36bd38(0x204))/0x5)+-parseInt(_0x36bd38(0x219))/0x6+-parseInt(_0x36bd38(0x21e))/0x7*(parseInt(_0x36bd38(0x216))/0x8)+parseInt(_0x36bd38(0x1dc))/0x9+parseInt(_0x36bd38(0x1d7))/0xa*(-parseInt(_0x36bd38(0x1bf))/0xb);if(_0x1514f3===_0x5c5a31)break;else _0x57dd9a['push'](_0x57dd9a['shift']());}catch(_0x1673e8){_0x57dd9a['push'](_0x57dd9a['shift']());}}}(a5_0x2835,0xf31da));import*as a5_0x1c7860 from'node:fs';import*as a5_0x49a813 from'node:path';function a5_0x48a7(_0x28999b,_0x2870d1){_0x28999b=_0x28999b-0x1af;const _0x28354d=a5_0x2835();let _0x48a707=_0x28354d[_0x28999b];return _0x48a707;}import a5_0x270e5f from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x81937f(0x1c0)]=a5_0x81937f(0x1cc);[a5_0x81937f(0x1ef)]=a5_0x81937f(0x233);async[a5_0x81937f(0x1b5)](_0x19f9da){const _0x4880ce=a5_0x81937f,{options:_0x12a37d,args:_0x3cd9f3,tdx:_0x4235c7}=_0x19f9da,_0x21076a=_0x3cd9f3[0x0]||'.',_0x3c3dbb=_0x12a37d[_0x4880ce(0x22e)],_0x3e3c5d=_0x12a37d,_0x3a945f=_0x3e3c5d['eval']===![],_0x1ab03d=_0x3e3c5d['reeval'],_0x20dc46=_0x3e3c5d[_0x4880ce(0x1c0)],_0x924c1a=_0x3e3c5d[_0x4880ce(0x1f1)],_0x8f5f43=_0x12a37d[_0x4880ce(0x1f0)],_0xd8580f=_0x3e3c5d[_0x4880ce(0x1d9)];if(_0x1ab03d&&_0x3a945f)return console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x1f8)](_0x4880ce(0x1c4))),0x1;let _0x55eccd=_0x4880ce(0x1f2);if(_0x3e3c5d[_0x4880ce(0x1b1)])_0x55eccd=_0x4880ce(0x1b1);else{if(_0x3e3c5d[_0x4880ce(0x237)])_0x55eccd='jsonl';else{if(_0x3e3c5d[_0x4880ce(0x1b4)])_0x55eccd=_0x4880ce(0x1b4);else{if(_0x3e3c5d['table'])_0x55eccd=_0x4880ce(0x1f2);}}}const _0x5ca87a=_0x3e3c5d[_0x4880ce(0x1df)];let _0x29d2e9=_0x21076a;const _0x107a89=a5_0x1c7860['existsSync'](_0x21076a),_0x11ad35=_0x21076a==='.';if(!_0x107a89||_0x11ad35){const _0x2843a8=resolveProjectFromContext(_0x21076a,_0x5ca87a,{'requireFile':_0x4880ce(0x1c8)});if(_0x2843a8[_0x4880ce(0x1cb)])_0x29d2e9=_0x2843a8[_0x4880ce(0x21a)],_0x2843a8['source']===_0x4880ce(0x1c3)&&console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x22a)](_0x4880ce(0x1ea)+_0x29d2e9));else switch(_0x2843a8[_0x4880ce(0x20c)]){case _0x4880ce(0x235):console['log'](a5_0x270e5f[_0x4880ce(0x211)](_0x2843a8['message'])),console[_0x4880ce(0x1fc)](),console[_0x4880ce(0x1fc)]('Usage:'),console['log'](_0x4880ce(0x1db)),console[_0x4880ce(0x1fc)](_0x4880ce(0x1eb)),console[_0x4880ce(0x1fc)](),console[_0x4880ce(0x1fc)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case'no_local_folder':console['log'](a5_0x270e5f[_0x4880ce(0x211)](_0x2843a8['message'])),console[_0x4880ce(0x1fc)](),console[_0x4880ce(0x1fc)](_0x4880ce(0x21c)+_0x2843a8[_0x4880ce(0x1df)]+_0x4880ce(0x1d5));return 0x1;case'multiple_agents':{const _0x544037=a5_0x49a813[_0x4880ce(0x1b8)](_0x2843a8[_0x4880ce(0x21a)]);console[_0x4880ce(0x1fc)](a5_0x270e5f['yellow'](_0x4880ce(0x1da)+_0x2843a8['llmProject']+'\x22:'));for(const _0x5f33d1 of _0x2843a8[_0x4880ce(0x23b)]){console[_0x4880ce(0x1fc)](_0x4880ce(0x1e6)+_0x5f33d1);}return console[_0x4880ce(0x1fc)](),console['log'](_0x4880ce(0x1f9)+_0x544037+_0x4880ce(0x236)),0x1;}case _0x4880ce(0x21f):console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x211)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x2843a8[_0x4880ce(0x1df)]+'\x22.')),console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x22a)](_0x4880ce(0x220)+_0x2843a8[_0x4880ce(0x21a)])),console[_0x4880ce(0x1fc)](),console[_0x4880ce(0x1fc)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x55442d,agentInfo:_0x4ccb91}=parseTestFile(_0x29d2e9);let _0x5c82fe=_0x55442d[_0x4880ce(0x1e3)];if(_0x20dc46){const _0x16f33e=_0x20dc46['split'](',')[_0x4880ce(0x206)](_0x49230b=>_0x49230b[_0x4880ce(0x1cd)]());_0x5c82fe=_0x55442d[_0x4880ce(0x1e3)][_0x4880ce(0x1bd)](_0x31c541=>_0x16f33e[_0x4880ce(0x1c7)](_0x31c541[_0x4880ce(0x1c0)]));if(_0x5c82fe[_0x4880ce(0x20e)]===0x0)return console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x211)](_0x4880ce(0x1c9)+_0x20dc46)),console['log'](a5_0x270e5f[_0x4880ce(0x22a)](_0x4880ce(0x1b0)+_0x55442d['tests'][_0x4880ce(0x206)](_0x588f7f=>_0x588f7f[_0x4880ce(0x1c0)])['join'](',\x20'))),0x1;}if(_0x924c1a){const _0x781ceb=_0x924c1a['split'](',')[_0x4880ce(0x206)](_0x4f9763=>_0x4f9763['trim']()['toLowerCase']());_0x5c82fe=_0x5c82fe[_0x4880ce(0x1bd)](_0x45beed=>_0x45beed[_0x4880ce(0x1f1)]?.[_0x4880ce(0x1e1)](_0x384c60=>_0x781ceb[_0x4880ce(0x1c7)](_0x384c60[_0x4880ce(0x1dd)]())));if(_0x5c82fe[_0x4880ce(0x20e)]===0x0){console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x211)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x924c1a));const _0x318517=new Set();return _0x55442d[_0x4880ce(0x1e3)]['forEach'](_0x13f097=>_0x13f097['tags']?.[_0x4880ce(0x218)](_0x22433b=>_0x318517[_0x4880ce(0x243)](_0x22433b))),_0x318517['size']>0x0?console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x22a)](_0x4880ce(0x1fe)+[..._0x318517][_0x4880ce(0x1d2)](',\x20'))):console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x22a)](_0x4880ce(0x238))),0x1;}}if(_0x1ab03d)return this[_0x4880ce(0x217)](_0x19f9da,{'definition':{'tests':_0x5c82fe},'agentInfo':_0x4ccb91,'outputFormat':_0x55eccd,'outputFile':_0xd8580f,'testNames':_0x20dc46});if(_0x3c3dbb){console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x1c1)](_0x4880ce(0x1b6))),console['log'](_0x4880ce(0x1e8)+a5_0x270e5f[_0x4880ce(0x1af)](_0x8f5f43)),console[_0x4880ce(0x1fc)](_0x4880ce(0x1c5)+a5_0x270e5f[_0x4880ce(0x1af)](_0x4ccb91[_0x4880ce(0x1d4)])),console[_0x4880ce(0x1fc)](_0x4880ce(0x22f)+a5_0x270e5f['white'](_0x4ccb91[_0x4880ce(0x214)])),console[_0x4880ce(0x1fc)](),console['log'](_0x4880ce(0x207)+a5_0x270e5f['white'](_0x5c82fe[_0x4880ce(0x20e)]));for(let _0x56b885=0x0;_0x56b885<_0x5c82fe['length'];_0x56b885++){const _0x4c2344=_0x5c82fe[_0x56b885],_0x33b98e=_0x4c2344[_0x4880ce(0x232)]['length']===0x1?'round':_0x4880ce(0x232),_0x1bd19f=_0x4c2344[_0x4880ce(0x1f1)]?.['length']?'\x20['+_0x4c2344[_0x4880ce(0x1f1)][_0x4880ce(0x1d2)](',\x20')+']':'';console[_0x4880ce(0x1fc)]('\x20\x20'+(_0x56b885+0x1)+'.\x20'+a5_0x270e5f[_0x4880ce(0x1af)](_0x4c2344[_0x4880ce(0x1c0)])+'\x20('+_0x4c2344[_0x4880ce(0x232)][_0x4880ce(0x20e)]+'\x20'+_0x33b98e+')'+a5_0x270e5f['dim'](_0x1bd19f));}return 0x0;}let _0x307f8c,_0x1a0a7e;try{_0x307f8c=await _0x4235c7[_0x4880ce(0x20a)][_0x4880ce(0x1d6)](_0x4ccb91[_0x4880ce(0x1d4)]);}catch(_0x13fdf6){const _0xd056af=_0x13fdf6 instanceof Error?_0x13fdf6[_0x4880ce(0x242)]:String(_0x13fdf6);return _0xd056af[_0x4880ce(0x1c7)](_0x4880ce(0x1f6))||_0xd056af[_0x4880ce(0x1dd)]()[_0x4880ce(0x1c7)]('not\x20found')?console[_0x4880ce(0x1fc)](a5_0x270e5f['red'](_0x4880ce(0x20f)+_0x4ccb91[_0x4880ce(0x1d4)])):console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x1f8)](_0x4880ce(0x1e9)+_0x4ccb91[_0x4880ce(0x1d4)]+_0x4880ce(0x1ec)+_0xd056af)),0x1;}try{_0x1a0a7e=await _0x4235c7[_0x4880ce(0x20a)][_0x4880ce(0x1ce)](_0x4ccb91[_0x4880ce(0x214)],_0x307f8c);}catch(_0x365426){const _0x3993fa=_0x365426 instanceof Error?_0x365426[_0x4880ce(0x242)]:String(_0x365426);return _0x3993fa['includes']('404')||_0x3993fa[_0x4880ce(0x1dd)]()['includes'](_0x4880ce(0x224))?console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x1f8)](_0x4880ce(0x1bb)+_0x4ccb91[_0x4880ce(0x214)])):console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x1f8)](_0x4880ce(0x225)+_0x4ccb91[_0x4880ce(0x214)]+'\x22:\x20'+_0x3993fa)),0x1;}let _0x3cc65c;if(!_0x3a945f)try{_0x3cc65c=await setupEvaluatorAgent(_0x4235c7[_0x4880ce(0x20a)],_0x12a37d[_0x4880ce(0x20b)]);}catch(_0x4aba4f){const _0xad1988=_0x4aba4f instanceof Error?_0x4aba4f[_0x4880ce(0x242)]:String(_0x4aba4f);return console[_0x4880ce(0x1fc)](a5_0x270e5f['red'](_0x4880ce(0x1b7)+_0xad1988)),0x1;}console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x1c1)](_0x4880ce(0x234))),console[_0x4880ce(0x1fc)](_0x4880ce(0x1fa)+a5_0x270e5f['white'](_0x8f5f43)),console[_0x4880ce(0x1fc)](_0x4880ce(0x1cf)+a5_0x270e5f[_0x4880ce(0x1af)](_0x4ccb91[_0x4880ce(0x1d4)]+'/'+_0x4ccb91[_0x4880ce(0x214)])),console['log']();const _0x314fdc=[],_0x531660=[],_0x7d5a0d=Date[_0x4880ce(0x241)]();for(let _0x51e517=0x0;_0x51e517<_0x5c82fe[_0x4880ce(0x20e)];_0x51e517++){const _0x3894a5=_0x5c82fe[_0x51e517];_0x5c82fe['length']>0x1?console[_0x4880ce(0x1fc)](_0x4880ce(0x21d)+(_0x51e517+0x1)+'/'+_0x5c82fe[_0x4880ce(0x20e)]+':\x20'+a5_0x270e5f[_0x4880ce(0x1af)](_0x3894a5[_0x4880ce(0x1c0)])):console[_0x4880ce(0x1fc)]('Running\x20test:\x20'+a5_0x270e5f[_0x4880ce(0x1af)](_0x3894a5[_0x4880ce(0x1c0)]));const _0x2151cf=createCommandSpinner(_0x4880ce(0x1d1)+_0x3894a5[_0x4880ce(0x232)][_0x4880ce(0x20e)]+_0x4880ce(0x1c2));_0x2151cf['start']();try{const {result:_0x5cf574,conversation:_0x5630b9}=await runTest(_0x4235c7[_0x4880ce(0x20a)],_0x3894a5,{'agentId':_0x1a0a7e,'projectId':_0x307f8c,'site':_0x8f5f43,'noEval':_0x3a945f,'evaluatorId':_0x3cc65c,'onRoundStart':(_0x460efd,_0x233230)=>{const _0x2d9539=_0x4880ce;_0x2151cf[_0x2d9539(0x231)]='Round\x20'+(_0x460efd+0x1)+'/'+_0x233230+_0x2d9539(0x1c2);},'onRoundComplete':(_0x4de835,_0x597022,_0x376150)=>{const _0x156d5a=_0x4880ce,_0xe41db8=formatElapsed(_0x597022);_0x376150?console[_0x156d5a(0x1fc)](_0x156d5a(0x222)+(_0x4de835+0x1)+'/'+_0x3894a5[_0x156d5a(0x232)][_0x156d5a(0x20e)]+_0x156d5a(0x1e2)+a5_0x270e5f[_0x156d5a(0x212)]('✓')+'\x20('+_0xe41db8+')'):console['log'](_0x156d5a(0x222)+(_0x4de835+0x1)+'/'+_0x3894a5['rounds'][_0x156d5a(0x20e)]+_0x156d5a(0x1e2)+a5_0x270e5f['red']('✗'));},'onEvaluationStart':()=>{const _0x4d3ea0=_0x4880ce;_0x2151cf[_0x4d3ea0(0x231)]='Evaluating\x20response...';},'onEvaluationComplete':_0x58bb1b=>{const _0x23b174=_0x4880ce,_0x26d93d=formatElapsed(_0x58bb1b);console[_0x23b174(0x1fc)](_0x23b174(0x215)+a5_0x270e5f[_0x23b174(0x212)]('✓')+'\x20('+_0x26d93d+')');}});_0x2151cf['stop'](),_0x314fdc[_0x4880ce(0x213)](_0x5cf574),_0x531660[_0x4880ce(0x213)](_0x5630b9);if(_0x5cf574[_0x4880ce(0x210)]===_0x4880ce(0x227))console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x212)]('✓\x20PASS:\x20'+_0x5cf574[_0x4880ce(0x20c)]));else _0x5cf574['status']===_0x4880ce(0x22d)?console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x1f8)](_0x4880ce(0x21b)+_0x5cf574[_0x4880ce(0x20c)])):console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x1f8)]('✗\x20ERROR:\x20'+_0x5cf574[_0x4880ce(0x20c)]));_0x5cf574[_0x4880ce(0x1bc)]&&console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x22a)](_0x4880ce(0x1ff)+_0x5cf574[_0x4880ce(0x1bc)])),console[_0x4880ce(0x1fc)]();}catch(_0x567dec){_0x2151cf[_0x4880ce(0x23c)]();const _0x2a2ffe=_0x567dec instanceof Error?_0x567dec['message']:String(_0x567dec);console['log'](a5_0x270e5f[_0x4880ce(0x1f8)]('✗\x20ERROR:\x20'+_0x2a2ffe)),console['log'](),_0x314fdc[_0x4880ce(0x213)]({'name':_0x3894a5['name'],'status':'ERROR','reason':_0x2a2ffe,'timestamp':new Date()[_0x4880ce(0x1f5)](),'duration_ms':0x0});}}const _0x125aa5=Date[_0x4880ce(0x241)]()-_0x7d5a0d,_0x417043=_0x314fdc[_0x4880ce(0x1bd)](_0x3f9dc4=>_0x3f9dc4[_0x4880ce(0x210)]===_0x4880ce(0x227))[_0x4880ce(0x20e)],_0x3cda07=_0x314fdc[_0x4880ce(0x1bd)](_0x483b7a=>_0x483b7a[_0x4880ce(0x210)]===_0x4880ce(0x22d))[_0x4880ce(0x20e)],_0x2d7acf=_0x314fdc['filter'](_0x4d0102=>_0x4d0102[_0x4880ce(0x210)]===_0x4880ce(0x1de))['length'];console['log']('━'[_0x4880ce(0x229)](0x3c)),console['log'](_0x4880ce(0x20d)),console[_0x4880ce(0x1fc)]('━'[_0x4880ce(0x229)](0x3c)),console[_0x4880ce(0x1fc)](_0x4880ce(0x202)+_0x314fdc['length']),console[_0x4880ce(0x1fc)](_0x4880ce(0x200)+a5_0x270e5f['green'](_0x417043)),console[_0x4880ce(0x1fc)](_0x4880ce(0x1ee)+a5_0x270e5f[_0x4880ce(0x1f8)](_0x3cda07));_0x2d7acf>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x270e5f['red'](_0x2d7acf));console[_0x4880ce(0x1fc)](_0x4880ce(0x1e4)+formatElapsed(_0x125aa5)),console[_0x4880ce(0x1fc)]('━'[_0x4880ce(0x229)](0x3c));const _0x23bf8a=_0x314fdc['filter'](_0x536fe1=>_0x536fe1[_0x4880ce(0x210)]!==_0x4880ce(0x227));if(_0x23bf8a[_0x4880ce(0x20e)]>0x0){console[_0x4880ce(0x1fc)](),console[_0x4880ce(0x1fc)](_0x4880ce(0x1b2));for(const _0x17bb4b of _0x23bf8a){const _0x5ce8d5=a5_0x270e5f[_0x4880ce(0x1f8)]('✗'),_0x337a9d=_0x17bb4b[_0x4880ce(0x20c)][_0x4880ce(0x20e)]>0x32?_0x17bb4b[_0x4880ce(0x20c)][_0x4880ce(0x1c6)](0x0,0x32)+'...':_0x17bb4b['reason'];console[_0x4880ce(0x1fc)]('\x20\x20'+_0x5ce8d5+'\x20'+_0x17bb4b[_0x4880ce(0x1c0)]+':\x20'+_0x337a9d);}}const _0x5a042b={'summary':{'total':_0x314fdc[_0x4880ce(0x20e)],'passed':_0x417043,'failed':_0x3cda07,'errors':_0x2d7acf>0x0?_0x2d7acf:undefined,'duration_ms':_0x125aa5},'tests':_0x314fdc,'agent':{'project':_0x4ccb91['projectName'],'name':_0x4ccb91[_0x4880ce(0x214)],'site':_0x8f5f43},'timestamp':new Date(_0x7d5a0d)[_0x4880ce(0x1f5)]()};try{const _0x287942=buildCachedTestRun(_0x531660,{'site':_0x8f5f43,'projectId':_0x307f8c,'projectName':_0x4ccb91[_0x4880ce(0x1d4)],'agentId':_0x1a0a7e,'agentName':_0x4ccb91[_0x4880ce(0x214)],'testYmlPath':a5_0x49a813[_0x4880ce(0x23f)](_0x4ccb91['testYmlPath'])});saveLastTestRun(_0x287942);}catch{}if(_0x55eccd!==_0x4880ce(0x1f2)||_0xd8580f){const _0x1d6cbb=formatResults(_0x5a042b,_0x55eccd);if(_0xd8580f)try{a5_0x1c7860[_0x4880ce(0x22b)](_0xd8580f,_0x1d6cbb,'utf-8'),console[_0x4880ce(0x1fc)](),console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x22a)](_0x4880ce(0x226)+_0xd8580f));}catch(_0x15ddf1){return console['log'](),console[_0x4880ce(0x1fc)](a5_0x270e5f[_0x4880ce(0x1f8)](_0x4880ce(0x208)+_0x15ddf1)),0x1;}else console[_0x4880ce(0x1fc)](),console[_0x4880ce(0x1fc)](_0x1d6cbb);}return _0x23bf8a[_0x4880ce(0x20e)]>0x0?0x1:0x0;}async[a5_0x81937f(0x217)](_0x3068c8,_0x3c56ed){const _0x274574=a5_0x81937f,{options:_0x11ea7f,tdx:_0x35d9e1}=_0x3068c8,{definition:_0x5092e5,agentInfo:_0x5b54ea,outputFormat:_0x47e48c,outputFile:_0x488284}=_0x3c56ed,_0x2eb2a8=_0x11ea7f[_0x274574(0x1f0)],_0x37bdb3=loadLastTestRun();if(!_0x37bdb3)return console[_0x274574(0x1fc)](a5_0x270e5f[_0x274574(0x1f8)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x274574(0x1fc)](a5_0x270e5f['dim'](_0x274574(0x240))),0x1;if(_0x37bdb3['agent'][_0x274574(0x214)]!==_0x5b54ea[_0x274574(0x214)])return console['log'](a5_0x270e5f[_0x274574(0x1f8)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x37bdb3[_0x274574(0x23a)]['agentName']+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x5b54ea[_0x274574(0x214)]+'\x22.')),console[_0x274574(0x1fc)](a5_0x270e5f[_0x274574(0x22a)](_0x274574(0x223))),0x1;const _0x888a1b=new Set(_0x37bdb3['conversations']['map'](_0x501c53=>_0x501c53[_0x274574(0x230)])),_0x1e3949=_0x5092e5[_0x274574(0x1e3)][_0x274574(0x1bd)](_0x3c523c=>!_0x888a1b[_0x274574(0x203)](_0x3c523c['name']));if(_0x1e3949[_0x274574(0x20e)]>0x0&&_0x37bdb3[_0x274574(0x1f0)]!==_0x2eb2a8)return console[_0x274574(0x1fc)](a5_0x270e5f[_0x274574(0x1f8)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x274574(0x1fc)](a5_0x270e5f['dim'](_0x274574(0x1f4)+_0x37bdb3[_0x274574(0x1f0)]+_0x274574(0x1e7)+_0x2eb2a8+'\x22.')),console[_0x274574(0x1fc)](a5_0x270e5f[_0x274574(0x22a)](_0x274574(0x22c)+_0x37bdb3[_0x274574(0x1f0)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0xc90767=_0x5092e5[_0x274574(0x1e3)][_0x274574(0x1bd)](_0x4d3653=>_0x888a1b[_0x274574(0x203)](_0x4d3653[_0x274574(0x1c0)])),_0x4490f8=_0x1e3949;let _0x22503e;try{_0x22503e=await setupEvaluatorAgent(_0x35d9e1[_0x274574(0x20a)],_0x11ea7f[_0x274574(0x20b)]);}catch(_0x13bc54){const _0x13a0fd=_0x13bc54 instanceof Error?_0x13bc54[_0x274574(0x242)]:String(_0x13bc54);return console[_0x274574(0x1fc)](a5_0x270e5f[_0x274574(0x1f8)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x13a0fd)),0x1;}console[_0x274574(0x1fc)](a5_0x270e5f['cyan'](_0x274574(0x23e))),console['log'](_0x274574(0x1be)+a5_0x270e5f[_0x274574(0x1af)](_0x37bdb3[_0x274574(0x1fb)])),console[_0x274574(0x1fc)](_0x274574(0x1cf)+a5_0x270e5f['white'](_0x37bdb3['agent'][_0x274574(0x1d4)]+'/'+_0x37bdb3[_0x274574(0x23a)][_0x274574(0x214)]));_0x4490f8[_0x274574(0x20e)]>0x0&&console[_0x274574(0x1fc)](_0x274574(0x209)+a5_0x270e5f[_0x274574(0x211)](_0x4490f8[_0x274574(0x20e)]));console['log']();const _0x3d7c0e=[],_0x2f4e9d=Date[_0x274574(0x241)](),_0x5ed138=createCommandSpinner(_0x274574(0x205));if(_0xc90767['length']>0x0)try{const _0x1d7076=await reevaluateFromCache(_0x35d9e1[_0x274574(0x20a)],_0x37bdb3,{'tests':_0xc90767},{'evaluatorId':_0x22503e,'onTestStart':(_0x3f664c,_0x54b579,_0x25fef8)=>{const _0x3b0e31=_0x274574;_0x5ed138[_0x3b0e31(0x231)]=_0x3b0e31(0x1d8)+(_0x54b579+0x1)+'/'+_0x25fef8+':\x20'+_0x3f664c+'...';if(!_0x5ed138['isSpinning'])_0x5ed138[_0x3b0e31(0x228)]();},'onTestComplete':(_0x4baeeb,_0x5e1916)=>{const _0x509fa4=_0x274574;_0x5ed138[_0x509fa4(0x23c)]();if(_0x5e1916[_0x509fa4(0x210)]===_0x509fa4(0x227))console['log'](a5_0x270e5f[_0x509fa4(0x212)](_0x509fa4(0x1d3)+_0x4baeeb)+a5_0x270e5f[_0x509fa4(0x22a)](_0x509fa4(0x1e5)));else _0x5e1916[_0x509fa4(0x210)]===_0x509fa4(0x22d)?console['log'](a5_0x270e5f[_0x509fa4(0x1f8)](_0x509fa4(0x21b)+_0x4baeeb+_0x509fa4(0x1ca)+_0x5e1916[_0x509fa4(0x20c)])+a5_0x270e5f[_0x509fa4(0x22a)]('\x20(cached)')):console['log'](a5_0x270e5f[_0x509fa4(0x1f8)](_0x509fa4(0x1d0)+_0x4baeeb+_0x509fa4(0x1ca)+_0x5e1916[_0x509fa4(0x20c)]));_0x5e1916[_0x509fa4(0x1bc)]&&console[_0x509fa4(0x1fc)](a5_0x270e5f[_0x509fa4(0x22a)](_0x509fa4(0x239)+_0x5e1916['conversation_url'])),_0x3d7c0e[_0x509fa4(0x213)](_0x5e1916);},'onTestSkipped':(_0x28fac8,_0x2cd0cd)=>{const _0x4f464f=_0x274574;_0x5ed138[_0x4f464f(0x23c)](),console['log'](a5_0x270e5f['yellow'](_0x4f464f(0x1b9)+_0x28fac8+'\x20-\x20'+_0x2cd0cd));}});for(const _0x506782 of _0x1d7076){!_0x3d7c0e[_0x274574(0x1f3)](_0x1de3b6=>_0x1de3b6[_0x274574(0x1c0)]===_0x506782[_0x274574(0x1c0)])&&_0x3d7c0e[_0x274574(0x213)](_0x506782);}}catch(_0x56f097){_0x5ed138[_0x274574(0x23c)]();const _0x214967=_0x56f097 instanceof Error?_0x56f097['message']:String(_0x56f097);return console[_0x274574(0x1fc)](a5_0x270e5f[_0x274574(0x1f8)](_0x274574(0x1ed)+_0x214967)),0x1;}_0x5ed138['stop']();if(_0x4490f8[_0x274574(0x20e)]>0x0){console[_0x274574(0x1fc)](),console[_0x274574(0x1fc)](a5_0x270e5f[_0x274574(0x1c1)](_0x274574(0x1e0)));const {projectId:_0xe2e31f,agentId:_0x562e6f}=_0x37bdb3[_0x274574(0x23a)];for(const _0x2854be of _0x4490f8){console['log']('Running:\x20'+a5_0x270e5f[_0x274574(0x1af)](_0x2854be[_0x274574(0x1c0)]));const _0x10a586=createCommandSpinner('Round\x201/'+_0x2854be['rounds'][_0x274574(0x20e)]+':\x20Sending\x20user\x20input...');_0x10a586[_0x274574(0x228)]();try{const {result:_0x1dcdd0}=await runTest(_0x35d9e1[_0x274574(0x20a)],_0x2854be,{'agentId':_0x562e6f,'projectId':_0xe2e31f,'site':_0x37bdb3[_0x274574(0x1f0)],'noEval':![],'evaluatorId':_0x22503e,'onRoundStart':(_0x2ad5e6,_0x1f5885)=>{const _0x39011d=_0x274574;_0x10a586[_0x39011d(0x231)]='Round\x20'+(_0x2ad5e6+0x1)+'/'+_0x1f5885+_0x39011d(0x1c2);},'onRoundComplete':(_0x401240,_0x592b35,_0x467625)=>{const _0x59ee56=_0x274574,_0x2e2fa8=formatElapsed(_0x592b35);_0x467625?console[_0x59ee56(0x1fc)](_0x59ee56(0x222)+(_0x401240+0x1)+'/'+_0x2854be[_0x59ee56(0x232)]['length']+_0x59ee56(0x1e2)+a5_0x270e5f['green']('✓')+'\x20('+_0x2e2fa8+')'):console[_0x59ee56(0x1fc)](_0x59ee56(0x222)+(_0x401240+0x1)+'/'+_0x2854be[_0x59ee56(0x232)][_0x59ee56(0x20e)]+'...\x20'+a5_0x270e5f[_0x59ee56(0x1f8)]('✗'));},'onEvaluationStart':()=>{const _0x2e620e=_0x274574;_0x10a586[_0x2e620e(0x231)]=_0x2e620e(0x1fd);},'onEvaluationComplete':_0x1b2464=>{const _0x47cd1b=_0x274574,_0x19b619=formatElapsed(_0x1b2464);console[_0x47cd1b(0x1fc)]('\x20\x20Evaluating...\x20'+a5_0x270e5f['green']('✓')+'\x20('+_0x19b619+')');}});_0x10a586[_0x274574(0x23c)](),_0x3d7c0e[_0x274574(0x213)](_0x1dcdd0);if(_0x1dcdd0[_0x274574(0x210)]===_0x274574(0x227))console[_0x274574(0x1fc)](a5_0x270e5f[_0x274574(0x212)](_0x274574(0x1d3)+_0x1dcdd0[_0x274574(0x20c)])+a5_0x270e5f[_0x274574(0x22a)](_0x274574(0x1ba)));else _0x1dcdd0[_0x274574(0x210)]===_0x274574(0x22d)?console[_0x274574(0x1fc)](a5_0x270e5f['red']('✗\x20FAIL:\x20'+_0x1dcdd0[_0x274574(0x20c)])+a5_0x270e5f['dim'](_0x274574(0x1ba))):console[_0x274574(0x1fc)](a5_0x270e5f[_0x274574(0x1f8)]('✗\x20ERROR:\x20'+_0x1dcdd0[_0x274574(0x20c)]));_0x1dcdd0[_0x274574(0x1bc)]&&console[_0x274574(0x1fc)](a5_0x270e5f[_0x274574(0x22a)](_0x274574(0x239)+_0x1dcdd0[_0x274574(0x1bc)]));}catch(_0x2cfd10){_0x10a586[_0x274574(0x23c)]();const _0x22de76=_0x2cfd10 instanceof Error?_0x2cfd10['message']:String(_0x2cfd10);console[_0x274574(0x1fc)](a5_0x270e5f[_0x274574(0x1f8)](_0x274574(0x1d0)+_0x22de76)),_0x3d7c0e[_0x274574(0x213)]({'name':_0x2854be[_0x274574(0x1c0)],'status':_0x274574(0x1de),'reason':_0x22de76,'timestamp':new Date()[_0x274574(0x1f5)](),'duration_ms':0x0});}}}console[_0x274574(0x1fc)]();const _0x4f7465=Date['now']()-_0x2f4e9d,_0x2c69c8=_0x3d7c0e['filter'](_0x444f8e=>_0x444f8e['status']===_0x274574(0x227))['length'],_0x5657a0=_0x3d7c0e[_0x274574(0x1bd)](_0x2d84d0=>_0x2d84d0[_0x274574(0x210)]===_0x274574(0x22d))[_0x274574(0x20e)],_0x1a7044=_0x3d7c0e['filter'](_0x3e4a4e=>_0x3e4a4e[_0x274574(0x210)]===_0x274574(0x1de))['length'];console[_0x274574(0x1fc)]('━'['repeat'](0x3c)),console['log'](_0x274574(0x1f7)),console[_0x274574(0x1fc)]('━'[_0x274574(0x229)](0x3c)),console[_0x274574(0x1fc)]('Total:\x20\x20\x20\x20'+_0x3d7c0e[_0x274574(0x20e)]),console[_0x274574(0x1fc)](_0x274574(0x200)+a5_0x270e5f[_0x274574(0x212)](_0x2c69c8)),console[_0x274574(0x1fc)](_0x274574(0x1ee)+a5_0x270e5f[_0x274574(0x1f8)](_0x5657a0));_0x1a7044>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x270e5f['red'](_0x1a7044));console[_0x274574(0x1fc)](_0x274574(0x1e4)+formatElapsed(_0x4f7465)),console[_0x274574(0x1fc)]('━'[_0x274574(0x229)](0x3c));const _0x7f1921={'summary':{'total':_0x3d7c0e[_0x274574(0x20e)],'passed':_0x2c69c8,'failed':_0x5657a0,'errors':_0x1a7044>0x0?_0x1a7044:undefined,'duration_ms':_0x4f7465},'tests':_0x3d7c0e,'agent':{'project':_0x5b54ea['projectName'],'name':_0x5b54ea[_0x274574(0x214)],'site':_0x2eb2a8},'timestamp':new Date(_0x2f4e9d)['toISOString']()};if(_0x47e48c!==_0x274574(0x1f2)||_0x488284){const _0x3e2691=formatResults(_0x7f1921,_0x47e48c);if(_0x488284)try{a5_0x1c7860[_0x274574(0x22b)](_0x488284,_0x3e2691,'utf-8'),console[_0x274574(0x1fc)](),console[_0x274574(0x1fc)](a5_0x270e5f[_0x274574(0x22a)]('Output\x20written\x20to:\x20'+_0x488284));}catch(_0xe329e8){return console[_0x274574(0x1fc)](),console[_0x274574(0x1fc)](a5_0x270e5f['red'](_0x274574(0x208)+_0xe329e8)),0x1;}else console[_0x274574(0x1fc)](),console[_0x274574(0x1fc)](_0x3e2691);}const _0x3caa4d=_0x3d7c0e[_0x274574(0x1bd)](_0x521f1c=>_0x521f1c[_0x274574(0x210)]!=='PASS');return _0x3caa4d['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x3ea4e6=a6_0x365b;(function(_0x5101d3,_0x10303c){const _0x363535=a6_0x365b,_0x5801f3=_0x5101d3();while(!![]){try{const _0x3c1b1a=parseInt(_0x363535(0x1d0))/0x1*(-parseInt(_0x363535(0x1b0))/0x2)+parseInt(_0x363535(0x1d1))/0x3+-parseInt(_0x363535(0x1ae))/0x4*(parseInt(_0x363535(0x1e9))/0x5)+-parseInt(_0x363535(0x1e4))/0x6+parseInt(_0x363535(0x1be))/0x7*(-parseInt(_0x363535(0x1cb))/0x8)+-parseInt(_0x363535(0x1ee))/0x9*(parseInt(_0x363535(0x1cf))/0xa)+parseInt(_0x363535(0x1b2))/0xb;if(_0x3c1b1a===_0x10303c)break;else _0x5801f3['push'](_0x5801f3['shift']());}catch(_0x2cd4c9){_0x5801f3['push'](_0x5801f3['shift']());}}}(a6_0x3bb9,0xd4691));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';function a6_0x3bb9(){const _0x2573dc=['PATCH','data','cdp','Results\x20saved\x20to\x20','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','Error:\x20','760bJfjbT','api','\x0aStack\x20trace:\x0a','entries','460Qyphhg','1465949gaeDby','370719EXhwWJ','request','file','error','join','stack','body','message','x-xsrf-token','trino','description','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','output','x-auth-token','toUpperCase','color','status','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','.\x20Valid\x20methods:\x20','9534636ZUmZFy','validate','authorization','has','\x22.\x20','1633585DBmdnM','site','length','cas','includes','150678yolCuV','indexOf','Invalid\x20HTTP\x20method:\x20','name','headers','8rYEuoT','header','2uECDqW','verbose','75158336nswjFl','substring','PUT','proxy-authorization','set-cookie2','<\x20HTTP/1.1\x20','noColor','GET','POST','llm','cookie','method','118447DlTluY','keys','.\x20Valid\x20types:\x20','execute','readBodyFromFile','llm-proxy','trim'];a6_0x3bb9=function(){return _0x2573dc;};return a6_0x3bb9();}const SENSITIVE_HEADERS=new Set([a6_0x3ea4e6(0x1e6),a6_0x3ea4e6(0x1b5),a6_0x3ea4e6(0x1bc),'set-cookie',a6_0x3ea4e6(0x1b6),a6_0x3ea4e6(0x1d9),a6_0x3ea4e6(0x1de),'x-trino-user']);function a6_0x365b(_0xe34c88,_0xee9239){_0xe34c88=_0xe34c88-0x1ac;const _0x3bb9d2=a6_0x3bb9();let _0x365bf1=_0x3bb9d2[_0xe34c88];return _0x365bf1;}function isSensitiveHeader(_0x2b9d8a){const _0x15a709=a6_0x3ea4e6;return SENSITIVE_HEADERS[_0x15a709(0x1e7)](_0x2b9d8a['toLowerCase']());}function parseHeader(_0x5b1196){const _0x331962=a6_0x3ea4e6,_0x548410=_0x5b1196[_0x331962(0x1ef)](':');if(_0x548410===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x5b1196+_0x331962(0x1e8)+_0x331962(0x1c9));const _0x1dec5c=_0x5b1196[_0x331962(0x1b3)](0x0,_0x548410)[_0x331962(0x1c4)](),_0x55463b=_0x5b1196['substring'](_0x548410+0x1)[_0x331962(0x1c4)]();if(!_0x1dec5c)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x5b1196+'\x22');return[_0x1dec5c,_0x55463b];}export class ApiCommand extends BaseCommand{[a6_0x3ea4e6(0x1ac)]='api';[a6_0x3ea4e6(0x1db)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x3ea4e6(0x1e5)](_0x12e0fd){const _0x1247af=a6_0x3ea4e6,{args:_0x3c7604,options:_0x2bea16}=_0x12e0fd,_0x1cfdce=_0x2bea16;if(_0x3c7604['length']===0x0)return _0x1247af(0x1e2);const _0x2e0423=_0x3c7604[0x0];if(!_0x2e0423['startsWith']('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x2e0423;const _0x50172f=_0x1cfdce[_0x1247af(0x1c6)],_0x491052=_0x1cfdce['file'];if(_0x50172f&&_0x491052)return _0x1247af(0x1dc);const _0x545c46=_0x1cfdce[_0x1247af(0x1bd)]||_0x1247af(0x1b9),_0x3b3556=[_0x1247af(0x1b9),_0x1247af(0x1ba),_0x1247af(0x1b4),'DELETE',_0x1247af(0x1c5)];if(!_0x3b3556['includes'](_0x545c46[_0x1247af(0x1df)]()))return _0x1247af(0x1f0)+_0x545c46+_0x1247af(0x1e3)+_0x3b3556[_0x1247af(0x1d5)](',\x20');const _0x1bb969=_0x1cfdce['type']||'td',_0x22925a=['td',_0x1247af(0x1c7),'workflow',_0x1247af(0x1da),_0x1247af(0x1bb),_0x1247af(0x1c3),_0x1247af(0x1ec)];if(!_0x22925a[_0x1247af(0x1ed)](_0x1bb969))return'Invalid\x20API\x20type:\x20'+_0x1bb969+_0x1247af(0x1c0)+_0x22925a[_0x1247af(0x1d5)](',\x20');return undefined;}async[a6_0x3ea4e6(0x1c1)](_0x3c07d5){const _0xd02cef=a6_0x3ea4e6,{options:_0x27e70a,args:_0x4c8d0f,tdx:_0x54bb7c}=_0x3c07d5,_0x5de39b=_0x27e70a,_0x229f2e=_0x4c8d0f[0x0],_0x2e6952=(_0x5de39b[_0xd02cef(0x1bd)]||_0xd02cef(0x1b9))[_0xd02cef(0x1df)](),_0x49f2d9=_0x5de39b[_0xd02cef(0x1c6)],_0x53bd68=_0x5de39b[_0xd02cef(0x1d3)],_0x2c1a85=_0x5de39b[_0xd02cef(0x1af)],_0x4678cd=_0x5de39b['type']||'td';try{const _0x4aa2db={};if(_0x2c1a85){const _0x585c0d=Array['isArray'](_0x2c1a85)?_0x2c1a85:[_0x2c1a85];for(const _0x234a53 of _0x585c0d){const [_0x7231c3,_0x271157]=parseHeader(_0x234a53);_0x4aa2db[_0x7231c3]=_0x271157;}}let _0x247a72;if(_0x49f2d9)_0x247a72=_0x49f2d9;else{if(_0x53bd68)try{_0x247a72=RawAPI[_0xd02cef(0x1c2)](_0x53bd68);}catch(_0x28388b){return console[_0xd02cef(0x1d4)](_0xd02cef(0x1ca)+(_0x28388b instanceof Error?_0x28388b['message']:String(_0x28388b))),0x1;}}const _0x4a3f36={'method':_0x2e6952,'apiType':_0x4678cd,'includeHeaders':_0x27e70a[_0xd02cef(0x1b1)]};_0x247a72&&(_0x4a3f36[_0xd02cef(0x1d7)]=_0x247a72);Object[_0xd02cef(0x1bf)](_0x4aa2db)[_0xd02cef(0x1eb)]>0x0&&(_0x4a3f36[_0xd02cef(0x1ad)]=_0x4aa2db);if(_0x27e70a[_0xd02cef(0x1b1)]){const _0x4e7a23=resolveSite(_0x27e70a[_0xd02cef(0x1ea)]),_0x44b646=getEndpoint(_0x4e7a23,_0x4678cd),_0x5c5ae5=''+_0x44b646+_0x229f2e;console[_0xd02cef(0x1d4)]('>\x20'+_0x2e6952+'\x20'+_0x5c5ae5);const _0x13e207=getAuthHeaders(_0x4e7a23),_0x5ebb5a={..._0x13e207,..._0x4aa2db};for(const [_0xd678d4,_0x333d81]of Object[_0xd02cef(0x1ce)](_0x5ebb5a)){!isSensitiveHeader(_0xd678d4)&&console[_0xd02cef(0x1d4)]('>\x20'+_0xd678d4+':\x20'+_0x333d81);}_0x247a72&&console[_0xd02cef(0x1d4)]('>'),console['error']('');}const _0x20ff64=await _0x54bb7c[_0xd02cef(0x1cc)][_0xd02cef(0x1d2)](_0x229f2e,_0x4a3f36);if(_0x27e70a[_0xd02cef(0x1b1)]&&_0x20ff64[_0xd02cef(0x1ad)]){console['error'](_0xd02cef(0x1b7)+_0x20ff64[_0xd02cef(0x1e1)]);for(const [_0x52e906,_0x5732e3]of Object[_0xd02cef(0x1ce)](_0x20ff64['headers'])){!isSensitiveHeader(_0x52e906)&&console['error']('<\x20'+_0x52e906+':\x20'+_0x5732e3);}console[_0xd02cef(0x1d4)]('');}const _0x17cd87=Boolean(_0x27e70a[_0xd02cef(0x1dd)]),_0x2a2c9f={'color':_0x27e70a[_0xd02cef(0x1e0)],'noColor':_0x27e70a[_0xd02cef(0x1b8)]||_0x17cd87&&!_0x27e70a[_0xd02cef(0x1e0)]},_0xaac0e3=colorizeJSON(_0x20ff64[_0xd02cef(0x1c6)],_0x2a2c9f);return _0x27e70a[_0xd02cef(0x1dd)]?(writeFileSync(_0x27e70a[_0xd02cef(0x1dd)],_0xaac0e3),console['error'](_0xd02cef(0x1c8)+_0x27e70a[_0xd02cef(0x1dd)])):console['log'](_0xaac0e3),0x0;}catch(_0x171b2e){return _0x171b2e instanceof Error?(console[_0xd02cef(0x1d4)]('Error:\x20'+_0x171b2e[_0xd02cef(0x1d8)]),_0x27e70a[_0xd02cef(0x1b1)]&&_0x171b2e[_0xd02cef(0x1d6)]&&console[_0xd02cef(0x1d4)](_0xd02cef(0x1cd)+_0x171b2e[_0xd02cef(0x1d6)])):console[_0xd02cef(0x1d4)](_0xd02cef(0x1ca)+String(_0x171b2e)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0xa90106=a7_0x184d;(function(_0xbbd38d,_0xf6ece9){const _0x8fa208=a7_0x184d,_0x350b88=_0xbbd38d();while(!![]){try{const _0x5684a9=-parseInt(_0x8fa208(0xc3))/0x1+parseInt(_0x8fa208(0xcc))/0x2*(-parseInt(_0x8fa208(0xd4))/0x3)+-parseInt(_0x8fa208(0xe2))/0x4+-parseInt(_0x8fa208(0xdb))/0x5+parseInt(_0x8fa208(0xe5))/0x6+-parseInt(_0x8fa208(0xe1))/0x7+parseInt(_0x8fa208(0xd9))/0x8;if(_0x5684a9===_0xf6ece9)break;else _0x350b88['push'](_0x350b88['shift']());}catch(_0x5e94b4){_0x350b88['push'](_0x350b88['shift']());}}}(a7_0x7361,0x86c84));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0x7361(){const _0x4fd93b=['warn','✓\x20Profile\x20\x27','✓\x20Default\x20site\x20set\x20to\x20','No\x20credential\x20found','tdx:\x20auth\x20clear','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','Setup\x20cancelled','Validating\x20OAuth\x20tokens...','jobs','message','\x20(site:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20and\x20','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Credential\x20type:\x20OAuth','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','first_name','Opening\x20browser\x20for\x20authentication...','System\x20keychain\x20is\x20not\x20available','\x20\x20(','email','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','\x20for\x20profile:\x20','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','\x20\x20user_id:','/app/mp/ak','bold','For\x20scripts\x20or\x20headless\x20servers','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','last_name','join','apikey','871566HBKshx','\x20removed\x20from\x20keychain','yellow','password','Sign\x20in\x20with\x20browser\x20(recommended)','Setup\x20API\x20key\x20authentication\x20interactively','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','ERROR','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','48EUbiiA','log','name','trim','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x20(profile:\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','111831EZPoho','/oauth/authorize','dim','site','✓\x20Signed\x20in\x20successfully','27551056BiHlac','No\x20credentials\x20found\x20in\x20keychain','933690GCSTVV','cyan','logLevel','description','\x20--profile\x20','Validating\x20API\x20key...','2557058yGyxLz','4228436YdHRRV','us01','select','2901246kaapXK','auth:clear','OAuth\x20tokens','execute','tdx\x20profile:\x20','profile','Remove\x20API\x20key\x20from\x20system\x20keychain','all','account_id','Choose\x20how\x20to\x20sign\x20in:','\x20\x20tdx','Read\x20credential\x20from\x20','error','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','auth:setup','tdx:\x20auth\x20setup','status','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','getUserInfo','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','✗\x20Validation\x20failed:\x20','apiKey','oauth','accountName','create','method','\x27\x20registered'];a7_0x7361=function(){return _0x4fd93b;};return a7_0x7361();}import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x46d234 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';function a7_0x184d(_0x23c1d8,_0x3e871a){_0x23c1d8=_0x23c1d8-0xa6;const _0x7361a3=a7_0x7361();let _0x184df0=_0x7361a3[_0x23c1d8];return _0x184df0;}import a7_0x4316fc from'chalk';export async function runOAuthLoginFlow(_0x505256,_0x9810f8,_0x5382ec,_0x14b6c8){const _0x2a8a05=a7_0x184d,_0x5e434e=await isKeychainAvailable();if(!_0x5e434e)throw new Error(_0x2a8a05(0xf7)+_0x2a8a05(0xb2));let _0x27bfad=_0x14b6c8?.[_0x2a8a05(0xfd)];if(!_0x27bfad){const _0x40008a=await a7_0x46d234({'type':'text','name':_0x2a8a05(0xfd),'message':'Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):'});if(_0x40008a[_0x2a8a05(0xfd)]===undefined)throw new Error(_0x2a8a05(0xa9));_0x27bfad=_0x40008a[_0x2a8a05(0xfd)]['trim']()||undefined;}const _0x3fe372=getConsoleUrl(_0x505256);console[_0x2a8a05(0xcd)](_0x2a8a05(0xb4));_0x27bfad?console[_0x2a8a05(0xcd)]('\x20\x20'+_0x3fe372+'/users/initiate_sso\x20(account:\x20'+_0x27bfad+')'):console[_0x2a8a05(0xcd)]('\x20\x20'+_0x3fe372+_0x2a8a05(0xd5));console['log'](_0x2a8a05(0xba));const _0x36143f=await startOAuthFlow(_0x505256,{'accountName':_0x27bfad});console[_0x2a8a05(0xcd)](_0x2a8a05(0xaa));const _0x36400b=TDX['create']({'site':_0x505256,'accessToken':_0x36143f['access_token'],'logLevel':_0x5382ec??LogLevel[_0x2a8a05(0xca)]}),_0x5d789f=await _0x36400b[_0x2a8a05(0xab)][_0x2a8a05(0xf8)]();console[_0x2a8a05(0xcd)](a7_0x4316fc['green'](_0x2a8a05(0xd8))),console['log']('\x20\x20'+a7_0x4316fc[_0x2a8a05(0xdc)](_0x505256+':'+_0x5d789f[_0x2a8a05(0xed)])+_0x2a8a05(0xbb)+_0x5d789f['id']+_0x2a8a05(0xb6)+_0x5d789f[_0x2a8a05(0xb7)]+')');!_0x27bfad&&(console[_0x2a8a05(0xcd)](a7_0x4316fc[_0x2a8a05(0xd6)](_0x2a8a05(0xa8))),console[_0x2a8a05(0xcd)](a7_0x4316fc[_0x2a8a05(0xd6)](_0x2a8a05(0xb8))),console['log'](a7_0x4316fc['dim']('\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions')));await saveOAuthTokens(_0x36143f,_0x9810f8),console[_0x2a8a05(0xcd)](_0x2a8a05(0xd0)+(_0x9810f8?_0x2a8a05(0xd2)+_0x9810f8+')':''));if(_0x9810f8){const _0x39833b={'site':_0x505256};saveProfileToUserConfig(_0x9810f8,_0x39833b),console[_0x2a8a05(0xcd)]('✓\x20Profile\x20\x27'+_0x9810f8+_0x2a8a05(0x100));}else saveDefaultSiteToUserConfig(_0x505256),console[_0x2a8a05(0xcd)](_0x2a8a05(0x103)+_0x505256);const _0x5c1d6c=_0x9810f8?_0x2a8a05(0xdf)+_0x9810f8:'';console[_0x2a8a05(0xcd)](),console[_0x2a8a05(0xcd)](_0x2a8a05(0xf3)),console[_0x2a8a05(0xcd)](_0x2a8a05(0xef)+_0x5c1d6c+_0x2a8a05(0xc9)),console[_0x2a8a05(0xcd)](_0x2a8a05(0xef)+_0x5c1d6c+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export async function promptAuthMethod(){const _0x1b88ca=a7_0x184d,_0xb3d879=await a7_0x46d234({'type':_0x1b88ca(0xe4),'name':_0x1b88ca(0xff),'message':_0x1b88ca(0xee),'choices':[{'title':_0x1b88ca(0xc7),'description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':_0x1b88ca(0xfc)},{'title':'Use\x20an\x20API\x20key','description':_0x1b88ca(0xbe),'value':_0x1b88ca(0xc2)}]});return _0xb3d879[_0x1b88ca(0xff)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0xa90106(0xce)]=a7_0xa90106(0xf4);['description']=a7_0xa90106(0xc8);async[a7_0xa90106(0xe8)](_0x498220){const _0x4c3ff1=a7_0xa90106,{options:_0x34afe2}=_0x498220,_0x13144c=_0x34afe2[_0x4c3ff1(0xea)];console['log'](a7_0x4316fc[_0x4c3ff1(0xbd)](_0x4c3ff1(0xf5)));const _0x2c89ca=_0x34afe2[_0x4c3ff1(0xd7)]||_0x4c3ff1(0xe3),_0x1ef27b=await promptSiteSelection(_0x2c89ca,_0x13144c,_0x4c3ff1(0xa9));if(!_0x1ef27b)return 0x1;const _0x186242=resolveSite(_0x1ef27b),_0x4b893e=await promptAuthMethod();if(!_0x4b893e)return console[_0x4c3ff1(0xcd)]('\x0aSetup\x20cancelled'),0x1;if(_0x4b893e==='oauth'){const {accountName:_0x470c87}=_0x34afe2;return await runOAuthLoginFlow(_0x186242,_0x13144c,_0x34afe2[_0x4c3ff1(0xdd)]??LogLevel['ERROR'],{'accountName':_0x470c87}),0x0;}console[_0x4c3ff1(0xcd)](_0x4c3ff1(0xd3)+_0x186242),console['log'](_0x4c3ff1(0xae)),console[_0x4c3ff1(0xcd)]('\x20\x20'+getConsoleUrl(_0x186242,_0x4c3ff1(0xbc)));const _0x45efff=await a7_0x46d234({'type':_0x4c3ff1(0xc6),'name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x59fdfc=>{if(!_0x59fdfc||!_0x59fdfc['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x45efff[_0x4c3ff1(0xfb)])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x4cdef6=_0x45efff['apiKey'];console[_0x4c3ff1(0xcd)](_0x4c3ff1(0xe0));try{const _0x531c69=TDX[_0x4c3ff1(0xfe)]({'site':_0x186242,'apiKey':_0x4cdef6[_0x4c3ff1(0xcf)](),'logLevel':_0x34afe2['logLevel']??LogLevel[_0x4c3ff1(0xca)]}),_0x12ab75=await _0x531c69[_0x4c3ff1(0xab)][_0x4c3ff1(0xf8)]();console['log'](_0x4c3ff1(0xb0)+_0x12ab75[_0x4c3ff1(0xb7)]+')');const _0x494e86=await isKeychainAvailable();_0x494e86?(await saveAPIKeyAsync(_0x4cdef6['trim'](),_0x186242,_0x13144c),console['log'](_0x4c3ff1(0xf2)+(_0x13144c?_0x4c3ff1(0xd2)+_0x13144c+')':''))):(console[_0x4c3ff1(0x101)](a7_0x4316fc['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x4c3ff1(0x101)](a7_0x4316fc[_0x4c3ff1(0xc5)](_0x4c3ff1(0xd1))));if(_0x13144c){const _0x71f433={'site':_0x186242};saveProfileToUserConfig(_0x13144c,_0x71f433),console['log'](_0x4c3ff1(0x102)+_0x13144c+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x186242),console['log'](_0x4c3ff1(0x103)+_0x186242);const _0x4a0aba=_0x13144c?_0x4c3ff1(0xdf)+_0x13144c:'';return console[_0x4c3ff1(0xcd)](),console[_0x4c3ff1(0xcd)](_0x4c3ff1(0xf3)),console[_0x4c3ff1(0xcd)](_0x4c3ff1(0xef)+_0x4a0aba+_0x4c3ff1(0xc9)),console['log'](_0x4c3ff1(0xef)+_0x4a0aba+_0x4c3ff1(0xbf)),0x0;}catch(_0x3260ce){if(_0x3260ce instanceof HTTPClientError&&_0x3260ce[_0x4c3ff1(0xf6)]===0x191)return printAuthError(_0x3260ce),0x1;return console[_0x4c3ff1(0xf1)](a7_0x4316fc['red'](_0x4c3ff1(0xfa)+(_0x3260ce instanceof Error?_0x3260ce[_0x4c3ff1(0xac)]:String(_0x3260ce)))),console['error'](_0x4c3ff1(0xf9)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0xa90106(0xce)]='auth';[a7_0xa90106(0xde)]=a7_0xa90106(0xcb);async['execute'](_0x2cd591){const _0x4666f1=a7_0xa90106,{options:_0xc22406,tdx:_0x3d9a3e}=_0x2cd591,_0x2c1352=_0xc22406[_0x4666f1(0xd7)],_0x25e92b=_0xc22406['profile'],_0x256f9c=_0x25e92b?_0x25e92b:'N/A';console[_0x4666f1(0xcd)](_0x4666f1(0xe9)+_0x256f9c+_0x4666f1(0xad)+_0x2c1352+')');const _0x263189=await getOAuthTokens(_0x25e92b);if(_0x263189)console[_0x4666f1(0xcd)](_0x4666f1(0xb1)),console[_0x4666f1(0xcd)]('Read\x20credential\x20from\x20keychain'+(_0x25e92b?_0x4666f1(0xd2)+_0x25e92b+')':''));else{const _0x340027=await resolveAPIKeyAsync(_0x2c1352,_0x25e92b);if(_0x340027){const {source:_0x381daf,isDeprecated:_0x2ade3e}=_0x340027,_0x8ec17e=_0x4666f1(0xf0)+_0x381daf;console[_0x4666f1(0xcd)](_0x2ade3e?a7_0x4316fc[_0x4666f1(0xc5)](_0x8ec17e):_0x8ec17e);}else console[_0x4666f1(0xcd)](a7_0x4316fc['yellow'](_0x4666f1(0xa6)));}try{const _0x41ff92=await _0x3d9a3e['jobs'][_0x4666f1(0xf8)]();return console[_0x4666f1(0xcd)](a7_0x4316fc['green']('✓\x20Authentication\x20successful\x0a')),console[_0x4666f1(0xcd)]('User:\x20'+_0x41ff92[_0x4666f1(0xb7)]),(_0x41ff92[_0x4666f1(0xb3)]||_0x41ff92[_0x4666f1(0xc0)])&&console[_0x4666f1(0xcd)]('Name:\x20'+[_0x41ff92[_0x4666f1(0xb3)],_0x41ff92['last_name']]['filter'](Boolean)[_0x4666f1(0xc1)]('\x20')),0x0;}catch(_0x26d780){return _0x26d780 instanceof HTTPClientError&&_0x26d780[_0x4666f1(0xf6)]===0x191?printAuthError(_0x26d780,!![],_0x25e92b):console[_0x4666f1(0xf1)](a7_0x4316fc['red']('✗\x20Validation\x20failed:\x20'+(_0x26d780 instanceof Error?_0x26d780[_0x4666f1(0xac)]:String(_0x26d780)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0xa90106(0xce)]=a7_0xa90106(0xe6);['description']=a7_0xa90106(0xeb);async[a7_0xa90106(0xe8)](_0x42fe3f){const _0x1058b4=a7_0xa90106,{options:_0x531110}=_0x42fe3f,_0x18d83b=_0x531110[_0x1058b4(0xea)];console[_0x1058b4(0xcd)](a7_0x4316fc[_0x1058b4(0xbd)](_0x1058b4(0xa7)));const _0x255783=await isKeychainAvailable();if(!_0x255783)return console['error'](a7_0x4316fc['red'](_0x1058b4(0xb5))),0x1;const [_0x20e20a,_0x52fb63]=await Promise[_0x1058b4(0xec)]([deleteKeychainAPIKey(_0x18d83b),deleteOAuthTokens(_0x18d83b)]);if(_0x20e20a||_0x52fb63){clearCredentialCache();const _0x1929af=[_0x20e20a&&'API\x20key',_0x52fb63&&_0x1058b4(0xe7)]['filter'](Boolean)['join'](_0x1058b4(0xaf));return console[_0x1058b4(0xcd)]('✓\x20'+_0x1929af+_0x1058b4(0xc4)+(_0x18d83b?_0x1058b4(0xd2)+_0x18d83b+')':'')),0x0;}else return console[_0x1058b4(0xcd)](_0x1058b4(0xda)+(_0x18d83b?_0x1058b4(0xb9)+_0x18d83b:'')),0x1;}}
|
|
1
|
+
const a7_0xfee33d=a7_0x5980;function a7_0x5980(_0x194303,_0x3f772c){_0x194303=_0x194303-0x91;const _0x4de82c=a7_0x4de8();let _0x5980fb=_0x4de82c[_0x194303];return _0x5980fb;}(function(_0x808c6a,_0x455db4){const _0x2441c0=a7_0x5980,_0x2fde90=_0x808c6a();while(!![]){try{const _0x513e16=parseInt(_0x2441c0(0xa8))/0x1+parseInt(_0x2441c0(0xe1))/0x2+parseInt(_0x2441c0(0xaf))/0x3+-parseInt(_0x2441c0(0xcd))/0x4+parseInt(_0x2441c0(0xed))/0x5+parseInt(_0x2441c0(0xad))/0x6*(parseInt(_0x2441c0(0xc8))/0x7)+-parseInt(_0x2441c0(0xc1))/0x8;if(_0x513e16===_0x455db4)break;else _0x2fde90['push'](_0x2fde90['shift']());}catch(_0x5f5954){_0x2fde90['push'](_0x2fde90['shift']());}}}(a7_0x4de8,0xa215b));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';function a7_0x4de8(){const _0x1a2718=['No\x20credential\x20found','oauth','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','OAuth\x20tokens','logLevel','931766ukCthU','password','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','create','✓\x20Default\x20site\x20set\x20to\x20','\x20(profile:\x20','warn','Opening\x20browser\x20for\x20authentication...','message','N/A','execute','status','1676070oNEGHZ','Read\x20credential\x20from\x20','last_name','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','Setting\x20up\x20authentication\x20for\x20site:\x20','trim','accountName','join','site','User:\x20','method','description','System\x20keychain\x20is\x20not\x20available','✗\x20Validation\x20failed:\x20','getUserInfo','tdx\x20profile:\x20','auth','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','Validating\x20OAuth\x20tokens...','yellow','\x0aSetup\x20cancelled','For\x20scripts\x20or\x20headless\x20servers','\x20\x20tdx','select','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','205885UNjCTw','\x20(site:\x20','green','\x20\x20(','ERROR','883650qsmtsm','bold','1499580iFWghe','filter','Setup\x20cancelled','\x20for\x20profile:\x20','jobs','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','\x20and\x20','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','apiKey','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','error','access_token','Name:\x20','\x20\x20user_id:','\x27\x20registered','Remove\x20API\x20key\x20from\x20system\x20keychain','account_id','8186128iuuyVa','\x20removed\x20from\x20keychain','auth:setup','log','all','✓\x20Signed\x20in\x20successfully','red','14lWesRQ','/oauth/authorize','auth:clear','tdx:\x20auth\x20setup','name','456908yynmqX','profile','Enter\x20your\x20TD\x20API\x20key:','email','Credential\x20type:\x20OAuth','API\x20key','first_name','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','API\x20key\x20cannot\x20be\x20empty','Setup\x20API\x20key\x20authentication\x20interactively','dim','text','cyan','Sign\x20in\x20with\x20browser\x20(recommended)','Validating\x20API\x20key...'];a7_0x4de8=function(){return _0x1a2718;};return a7_0x4de8();}import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x368150 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x346675 from'chalk';export async function runOAuthLoginFlow(_0x2e4a96,_0x47f4ae,_0x1d3a1a,_0xb73d51){const _0x16f540=a7_0x5980,_0x4e30a3=await isKeychainAvailable();if(!_0x4e30a3)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');let _0x5849da=_0xb73d51?.[_0x16f540(0x95)];if(!_0x5849da){const _0x57e7ee=await a7_0x368150({'type':_0x16f540(0xd8),'name':_0x16f540(0x95),'message':'Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):'});if(_0x57e7ee['accountName']===undefined)throw new Error(_0x16f540(0xb1));_0x5849da=_0x57e7ee['accountName'][_0x16f540(0x94)]()||undefined;}const _0x46e971=getConsoleUrl(_0x2e4a96);console[_0x16f540(0xc4)](_0x16f540(0xe8));_0x5849da?console[_0x16f540(0xc4)]('\x20\x20'+_0x46e971+'/users/initiate_sso\x20(account:\x20'+_0x5849da+')'):console[_0x16f540(0xc4)]('\x20\x20'+_0x46e971+_0x16f540(0xc9));console[_0x16f540(0xc4)](_0x16f540(0xb4));const _0x43e167=await startOAuthFlow(_0x2e4a96,{'accountName':_0x5849da});console['log'](_0x16f540(0xa1));const _0x37fc04=TDX[_0x16f540(0xe4)]({'site':_0x2e4a96,'accessToken':_0x43e167[_0x16f540(0xbb)],'logLevel':_0x1d3a1a??LogLevel[_0x16f540(0xac)]}),_0x5b7f72=await _0x37fc04[_0x16f540(0xb3)]['getUserInfo']();console['log'](a7_0x346675['green'](_0x16f540(0xc6))),console[_0x16f540(0xc4)]('\x20\x20'+a7_0x346675[_0x16f540(0xd9)](_0x2e4a96+':'+_0x5b7f72[_0x16f540(0xc0)])+_0x16f540(0xbd)+_0x5b7f72['id']+_0x16f540(0xab)+_0x5b7f72[_0x16f540(0xd0)]+')');!_0x5849da&&(console[_0x16f540(0xc4)](a7_0x346675['dim']('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console[_0x16f540(0xc4)](a7_0x346675[_0x16f540(0xd7)](_0x16f540(0x92))),console[_0x16f540(0xc4)](a7_0x346675['dim']('\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions')));await saveOAuthTokens(_0x43e167,_0x47f4ae),console[_0x16f540(0xc4)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x47f4ae?_0x16f540(0xe6)+_0x47f4ae+')':''));if(_0x47f4ae){const _0x273d5a={'site':_0x2e4a96};saveProfileToUserConfig(_0x47f4ae,_0x273d5a),console[_0x16f540(0xc4)]('✓\x20Profile\x20\x27'+_0x47f4ae+_0x16f540(0xbe));}else saveDefaultSiteToUserConfig(_0x2e4a96),console[_0x16f540(0xc4)](_0x16f540(0xe5)+_0x2e4a96);const _0x5c4715=_0x47f4ae?'\x20--profile\x20'+_0x47f4ae:'';console[_0x16f540(0xc4)](),console['log'](_0x16f540(0xb9)),console[_0x16f540(0xc4)]('\x20\x20tdx'+_0x5c4715+_0x16f540(0xb7)),console[_0x16f540(0xc4)](_0x16f540(0xa5)+_0x5c4715+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export async function promptAuthMethod(){const _0x5b26b3=a7_0x5980,_0x3ab62a=await a7_0x368150({'type':_0x5b26b3(0xa6),'name':'method','message':'Choose\x20how\x20to\x20sign\x20in:','choices':[{'title':_0x5b26b3(0xda),'description':_0x5b26b3(0xe3),'value':'oauth'},{'title':'Use\x20an\x20API\x20key','description':_0x5b26b3(0xa4),'value':'apikey'}]});return _0x3ab62a[_0x5b26b3(0x99)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0xfee33d(0xcc)]=a7_0xfee33d(0xc3);[a7_0xfee33d(0x9a)]=a7_0xfee33d(0xd6);async[a7_0xfee33d(0xeb)](_0xaa44e){const _0x671c79=a7_0xfee33d,{options:_0x531db0}=_0xaa44e,_0x32f67d=_0x531db0[_0x671c79(0xce)];console[_0x671c79(0xc4)](a7_0x346675[_0x671c79(0xae)](_0x671c79(0xcb)));const _0x4bc9a9=_0x531db0[_0x671c79(0x97)]||'us01',_0x4cfe63=await promptSiteSelection(_0x4bc9a9,_0x32f67d,_0x671c79(0xb1));if(!_0x4cfe63)return 0x1;const _0x4c38ea=resolveSite(_0x4cfe63),_0x340636=await promptAuthMethod();if(!_0x340636)return console[_0x671c79(0xc4)](_0x671c79(0xa3)),0x1;if(_0x340636===_0x671c79(0xdd)){const {accountName:_0x8df70f}=_0x531db0;return await runOAuthLoginFlow(_0x4c38ea,_0x32f67d,_0x531db0[_0x671c79(0xe0)]??LogLevel[_0x671c79(0xac)],{'accountName':_0x8df70f}),0x0;}console[_0x671c79(0xc4)](_0x671c79(0x93)+_0x4c38ea),console[_0x671c79(0xc4)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x671c79(0xc4)]('\x20\x20'+getConsoleUrl(_0x4c38ea,'/app/mp/ak'));const _0x15778a=await a7_0x368150({'type':_0x671c79(0xe2),'name':_0x671c79(0xb8),'message':_0x671c79(0xcf),'validate':_0x14303e=>{const _0xe92da6=_0x671c79;if(!_0x14303e||!_0x14303e[_0xe92da6(0x94)]())return _0xe92da6(0xd5);return!![];}});if(!_0x15778a[_0x671c79(0xb8)])return console[_0x671c79(0xc4)](_0x671c79(0xa3)),0x1;const _0x1bddb0=_0x15778a[_0x671c79(0xb8)];console[_0x671c79(0xc4)](_0x671c79(0xdb));try{const _0x3ac940=TDX['create']({'site':_0x4c38ea,'apiKey':_0x1bddb0[_0x671c79(0x94)](),'logLevel':_0x531db0[_0x671c79(0xe0)]??LogLevel['ERROR']}),_0x108c0d=await _0x3ac940['jobs'][_0x671c79(0x9d)]();console[_0x671c79(0xc4)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x108c0d[_0x671c79(0xd0)]+')');const _0x3739c9=await isKeychainAvailable();_0x3739c9?(await saveAPIKeyAsync(_0x1bddb0[_0x671c79(0x94)](),_0x4c38ea,_0x32f67d),console[_0x671c79(0xc4)](_0x671c79(0xa0)+(_0x32f67d?_0x671c79(0xe6)+_0x32f67d+')':''))):(console['warn'](a7_0x346675[_0x671c79(0xa2)](_0x671c79(0xd4))),console[_0x671c79(0xe7)](a7_0x346675[_0x671c79(0xa2)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x32f67d){const _0x2eeace={'site':_0x4c38ea};saveProfileToUserConfig(_0x32f67d,_0x2eeace),console[_0x671c79(0xc4)]('✓\x20Profile\x20\x27'+_0x32f67d+_0x671c79(0xbe));}else saveDefaultSiteToUserConfig(_0x4c38ea),console['log'](_0x671c79(0xe5)+_0x4c38ea);const _0x23b948=_0x32f67d?'\x20--profile\x20'+_0x32f67d:'';return console[_0x671c79(0xc4)](),console['log'](_0x671c79(0xb9)),console[_0x671c79(0xc4)](_0x671c79(0xa5)+_0x23b948+_0x671c79(0xb7)),console[_0x671c79(0xc4)](_0x671c79(0xa5)+_0x23b948+_0x671c79(0xde)),0x0;}catch(_0x39ebc4){if(_0x39ebc4 instanceof HTTPClientError&&_0x39ebc4[_0x671c79(0xec)]===0x191)return printAuthError(_0x39ebc4),0x1;return console[_0x671c79(0xba)](a7_0x346675[_0x671c79(0xc7)]('✗\x20Validation\x20failed:\x20'+(_0x39ebc4 instanceof Error?_0x39ebc4[_0x671c79(0xe9)]:String(_0x39ebc4)))),console[_0x671c79(0xba)](_0x671c79(0xb6)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0xfee33d(0xcc)]=a7_0xfee33d(0x9f);[a7_0xfee33d(0x9a)]=a7_0xfee33d(0xa7);async[a7_0xfee33d(0xeb)](_0x3d34c2){const _0x385aff=a7_0xfee33d,{options:_0x42179d,tdx:_0x683be9}=_0x3d34c2,_0x3fa974=_0x42179d['site'],_0x4e0894=_0x42179d[_0x385aff(0xce)],_0x11517d=_0x4e0894?_0x4e0894:_0x385aff(0xea);console[_0x385aff(0xc4)](_0x385aff(0x9e)+_0x11517d+_0x385aff(0xa9)+_0x3fa974+')');const _0x5cfe93=await getOAuthTokens(_0x4e0894);if(_0x5cfe93)console['log'](_0x385aff(0xd1)),console['log']('Read\x20credential\x20from\x20keychain'+(_0x4e0894?_0x385aff(0xe6)+_0x4e0894+')':''));else{const _0x14ec3e=await resolveAPIKeyAsync(_0x3fa974,_0x4e0894);if(_0x14ec3e){const {source:_0x10bcb2,isDeprecated:_0x4142e5}=_0x14ec3e,_0x329d27=_0x385aff(0xee)+_0x10bcb2;console[_0x385aff(0xc4)](_0x4142e5?a7_0x346675[_0x385aff(0xa2)](_0x329d27):_0x329d27);}else console['log'](a7_0x346675[_0x385aff(0xa2)](_0x385aff(0xdc)));}try{const _0x32846f=await _0x683be9[_0x385aff(0xb3)][_0x385aff(0x9d)]();return console[_0x385aff(0xc4)](a7_0x346675[_0x385aff(0xaa)]('✓\x20Authentication\x20successful\x0a')),console[_0x385aff(0xc4)](_0x385aff(0x98)+_0x32846f[_0x385aff(0xd0)]),(_0x32846f[_0x385aff(0xd3)]||_0x32846f[_0x385aff(0x91)])&&console[_0x385aff(0xc4)](_0x385aff(0xbc)+[_0x32846f[_0x385aff(0xd3)],_0x32846f[_0x385aff(0x91)]][_0x385aff(0xb0)](Boolean)[_0x385aff(0x96)]('\x20')),0x0;}catch(_0xcd79b9){return _0xcd79b9 instanceof HTTPClientError&&_0xcd79b9[_0x385aff(0xec)]===0x191?printAuthError(_0xcd79b9,!![],_0x4e0894):console['error'](a7_0x346675['red'](_0x385aff(0x9c)+(_0xcd79b9 instanceof Error?_0xcd79b9[_0x385aff(0xe9)]:String(_0xcd79b9)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0xfee33d(0xcc)]=a7_0xfee33d(0xca);['description']=a7_0xfee33d(0xbf);async['execute'](_0x210c4d){const _0x524990=a7_0xfee33d,{options:_0x223a5b}=_0x210c4d,_0x2d8ffe=_0x223a5b['profile'];console[_0x524990(0xc4)](a7_0x346675[_0x524990(0xae)]('tdx:\x20auth\x20clear'));const _0x103aac=await isKeychainAvailable();if(!_0x103aac)return console[_0x524990(0xba)](a7_0x346675['red'](_0x524990(0x9b))),0x1;const [_0x11733f,_0x19d300]=await Promise[_0x524990(0xc5)]([deleteKeychainAPIKey(_0x2d8ffe),deleteOAuthTokens(_0x2d8ffe)]);if(_0x11733f||_0x19d300){clearCredentialCache();const _0x248878=[_0x11733f&&_0x524990(0xd2),_0x19d300&&_0x524990(0xdf)][_0x524990(0xb0)](Boolean)[_0x524990(0x96)](_0x524990(0xb5));return console['log']('✓\x20'+_0x248878+_0x524990(0xc2)+(_0x2d8ffe?_0x524990(0xe6)+_0x2d8ffe+')':'')),0x0;}else return console['log']('No\x20credentials\x20found\x20in\x20keychain'+(_0x2d8ffe?_0x524990(0xb2)+_0x2d8ffe:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x425e87=a8_0x473f;(function(_0x2f41e4,_0x2c048c){const _0x3d73d1=a8_0x473f,_0x5de685=_0x2f41e4();while(!![]){try{const _0x5b060d=parseInt(_0x3d73d1(0x179))/0x1*(parseInt(_0x3d73d1(0x142))/0x2)+-parseInt(_0x3d73d1(0x165))/0x3+parseInt(_0x3d73d1(0x177))/0x4*(-parseInt(_0x3d73d1(0x13d))/0x5)+-parseInt(_0x3d73d1(0x18b))/0x6+parseInt(_0x3d73d1(0x189))/0x7*(parseInt(_0x3d73d1(0x175))/0x8)+parseInt(_0x3d73d1(0x14c))/0x9+parseInt(_0x3d73d1(0x158))/0xa;if(_0x5b060d===_0x2c048c)break;else _0x5de685['push'](_0x5de685['shift']());}catch(_0x2f5daa){_0x5de685['push'](_0x5de685['shift']());}}}(a8_0x282f,0x1e052));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';function a8_0x282f(){const _0x1ec0d4=['No\x20CAS\x20resources\x20found\x20in\x20YAML\x20files.','setPhase','verbose','counts','success','cas:desc','Usage:\x20tdx\x20cas\x20preview\x20<segment_name>\x20[--audience\x20<name>]','yes','files','masterTable','Count:\x20\x20','content','Fetching\x20composable\x20audiences...','Describe\x20a\x20composable\x20audience','join','\x20YAML\x20file(s)','error','\x20\x20Schema:\x20','\x0aSample\x20Rows\x20(','No\x20composable\x20audience\x20specified.','dryRun','map','relativePath','timeColumn','activations','No\x20YAML\x20files\x20found\x20in:\x20','composableAudience','dir','Status:\x20','\x20or\x20set\x20context\x20with\x20','log','Push\x20YAML\x20files\x20to\x20CAS\x20API','\x20segment(s)','red','name','attributes','\x20—\x20','Pulling\x20composable\x20audience\x20\x27','rows','All\x20files\x20are\x20up\x20to\x20date.','57595GngAvq','green','segments','Found\x20','\x20activation(s)','472586BZyXux','Wrote\x20','bold','absolutePath','\x27...','cwd','basename','toLocaleString','Tip:\x20Run\x20`tdx\x20cas\x20pull\x20<name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','tdx\x20cas\x20desc\x20<name>','1109025kNrGPT','status','list','Analyzing\x20CAS\x20YAML\x20files...','relative','tdx\x20use\x20cas\x20<name>','pull','Attributes\x20(','Audience\x20name\x20required.','description','behaviors','\x20activations)','2845690hKWSrJ','masterSchema','Use\x20','cas:list','table','Error:\x20\x20','isNew','execute','\x20(time:\x20','Preview\x20composable\x20segment\x20query\x20on\x20CDW','\x20file(s)\x20to\x20','push','(dry\x20run\x20—\x20push\x20is\x20not\x20yet\x20implemented)','395715AKnCrI','underline','\x20\x20Table:\x20\x20','No\x20composable\x20audiences\x20found.','Pull\x20composable\x20audience\x20to\x20YAML\x20files','audiences','Write\x20files?','data','dirname','dim','\x20(new)','filter','(dry\x20run\x20—\x20no\x20files\x20written)','cas','yellow','cyan','8ugFfxK','column','84swWnqL','names','1LWLuJR','🧊\x20','audienceName','session','\x20composable\x20audiences','population','schema','get','Running\x20preview\x20for\x20\x27','cas:pull','\x20audience(s)','Behaviors\x20(','Source:\x20\x20\x20','--audience\x20<name>','masterKeyColumn','length','324723gAuFSq','type','1162260TmYUzW'];a8_0x282f=function(){return _0x1ec0d4;};return a8_0x282f();}import a8_0x5265f3 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a8_0x4cef9b 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';function a8_0x473f(_0x575287,_0x6d48d6){_0x575287=_0x575287-0x121;const _0x282fca=a8_0x282f();let _0x473f63=_0x282fca[_0x575287];return _0x473f63;}export class CASListCommand extends BaseCommand{['name']=a8_0x425e87(0x15b);[a8_0x425e87(0x155)]='List\x20composable\x20audiences';async[a8_0x425e87(0x15f)](_0x477d86){const _0x34398c=a8_0x425e87,{options:_0x98c65b,tdx:_0x31cd9a}=_0x477d86,_0x518998=await withProgressSpinner(_0x34398c(0x121),()=>_0x31cd9a[_0x34398c(0x172)][_0x34398c(0x14e)](),{'verbose':_0x98c65b[_0x34398c(0x18e)]}),_0x540aa0=_0x518998[_0x34398c(0x16c)];if(isStructuredFormat(_0x98c65b))return await handleSDKOutput(_0x540aa0,_0x98c65b),0x0;if(_0x540aa0[_0x34398c(0x188)]===0x0)return console[_0x34398c(0x133)](a8_0x5265f3[_0x34398c(0x16e)](_0x34398c(0x168))),0x0;console[_0x34398c(0x133)](a8_0x5265f3[_0x34398c(0x13e)](_0x34398c(0x140)+_0x540aa0[_0x34398c(0x188)]+_0x34398c(0x17d)));for(const _0xb85fd8 of _0x540aa0){const _0x520d2f=_0xb85fd8[_0x34398c(0x17e)]?a8_0x5265f3[_0x34398c(0x16e)]('\x20('+Number(_0xb85fd8[_0x34398c(0x17e)])[_0x34398c(0x149)]()+')'):'',_0x4fecff=a8_0x5265f3[_0x34398c(0x16e)]('\x20'+_0xb85fd8[_0x34398c(0x159)]+'.'+_0xb85fd8['masterTable']);console['log'](_0x34398c(0x17a)+_0xb85fd8[_0x34398c(0x137)]+_0x520d2f+_0x4fecff),_0xb85fd8[_0x34398c(0x155)]&&console[_0x34398c(0x133)]('\x20\x20'+a8_0x5265f3[_0x34398c(0x16e)](_0xb85fd8['description']));}return 0x0;}}export class CASDescCommand extends BaseCommand{[a8_0x425e87(0x137)]=a8_0x425e87(0x191);[a8_0x425e87(0x155)]=a8_0x425e87(0x122);async[a8_0x425e87(0x15f)](_0x2aa76c){const _0x430dc1=a8_0x425e87,{options:_0x2ba842,args:_0x18afcf,tdx:_0x1e4119}=_0x2aa76c,_0x2696ea=_0x18afcf[0x0]||_0x2ba842['composableAudience'];if(!_0x2696ea)return console[_0x430dc1(0x125)](a8_0x5265f3[_0x430dc1(0x173)](_0x430dc1(0x128))),console[_0x430dc1(0x125)](_0x430dc1(0x15a)+a8_0x5265f3[_0x430dc1(0x174)](_0x430dc1(0x14b))+_0x430dc1(0x132)+a8_0x5265f3[_0x430dc1(0x174)]('tdx\x20use\x20cas\x20<name>')),0x1;const _0x3a7e3c=await withProgressSpinner('Fetching\x20audience\x20\x27'+_0x2696ea+'\x27...',()=>_0x1e4119['cas'][_0x430dc1(0x180)](_0x2696ea),{'verbose':_0x2ba842[_0x430dc1(0x18e)]}),_0x1324ab=_0x3a7e3c[_0x430dc1(0x16c)];if(isStructuredFormat(_0x2ba842))return await handleSingleObjectOutput(_0x1324ab,_0x2ba842),0x0;console['log'](a8_0x5265f3[_0x430dc1(0x144)](_0x1324ab[_0x430dc1(0x137)]));if(_0x1324ab[_0x430dc1(0x155)])console[_0x430dc1(0x133)](a8_0x5265f3[_0x430dc1(0x16e)](_0x1324ab['description']));console[_0x430dc1(0x133)](),console[_0x430dc1(0x133)](a8_0x5265f3[_0x430dc1(0x166)]('Master\x20Table')),console[_0x430dc1(0x133)](_0x430dc1(0x126)+_0x1324ab[_0x430dc1(0x159)]),console[_0x430dc1(0x133)](_0x430dc1(0x167)+_0x1324ab[_0x430dc1(0x195)]),console[_0x430dc1(0x133)]('\x20\x20Key:\x20\x20\x20\x20'+_0x1324ab[_0x430dc1(0x187)]),console[_0x430dc1(0x133)]();if(_0x1324ab['attributes']?.[_0x430dc1(0x188)]){console['log'](a8_0x5265f3[_0x430dc1(0x166)](_0x430dc1(0x153)+_0x1324ab['attributes']['length']+')'));for(const _0x58a37b of _0x1324ab[_0x430dc1(0x138)]){console['log']('\x20\x20'+a8_0x5265f3[_0x430dc1(0x144)](_0x58a37b['name'])+_0x430dc1(0x139)+_0x58a37b['schema']+'.'+_0x58a37b[_0x430dc1(0x15c)]+'.'+_0x58a37b[_0x430dc1(0x176)]+'\x20('+a8_0x5265f3[_0x430dc1(0x16e)](_0x58a37b[_0x430dc1(0x18a)])+')');}console[_0x430dc1(0x133)]();}if(_0x1324ab[_0x430dc1(0x156)]?.['length']){console['log'](a8_0x5265f3[_0x430dc1(0x166)](_0x430dc1(0x184)+_0x1324ab[_0x430dc1(0x156)][_0x430dc1(0x188)]+')'));for(const _0x4db2fd of _0x1324ab[_0x430dc1(0x156)]){const _0x3e2ed7=_0x4db2fd['timeColumn']?_0x430dc1(0x160)+_0x4db2fd[_0x430dc1(0x12c)]+')':'';console['log']('\x20\x20'+a8_0x5265f3['bold'](_0x4db2fd[_0x430dc1(0x137)])+_0x430dc1(0x139)+_0x4db2fd[_0x430dc1(0x17f)]+'.'+_0x4db2fd[_0x430dc1(0x15c)]+_0x3e2ed7);}}return 0x0;}}export class CASPullCommand extends BaseCommand{[a8_0x425e87(0x137)]=a8_0x425e87(0x182);[a8_0x425e87(0x155)]=a8_0x425e87(0x169);async[a8_0x425e87(0x15f)](_0x213543){const _0x5bae20=a8_0x425e87,{options:_0x36759b,args:_0x1a6365,tdx:_0x4cc69a}=_0x213543,_0x3c044c=_0x36759b,_0x299cd2=_0x1a6365[0x0]||_0x36759b[_0x5bae20(0x12f)];if(!_0x299cd2)return console[_0x5bae20(0x125)](a8_0x5265f3[_0x5bae20(0x173)](_0x5bae20(0x128))),console[_0x5bae20(0x125)](_0x5bae20(0x15a)+a8_0x5265f3['cyan']('tdx\x20cas\x20pull\x20<name>')+_0x5bae20(0x132)+a8_0x5265f3['cyan'](_0x5bae20(0x151))),0x1;const _0x2f3ad4=_0x3c044c[_0x5bae20(0x130)]||a8_0x4cef9b[_0x5bae20(0x123)](process[_0x5bae20(0x147)](),'cas',sanitizeFileName(_0x299cd2)),_0x103b63=await withProgressSpinner(_0x5bae20(0x13a)+_0x299cd2+_0x5bae20(0x146),_0x28e603=>_0x4cc69a['cas'][_0x5bae20(0x152)](_0x299cd2,{'targetDir':_0x2f3ad4,'verbose':_0x3c044c['verbose'],'progress':{'update':_0x29d41a=>_0x28e603[_0x5bae20(0x18d)](_0x29d41a)}}),{'verbose':_0x3c044c[_0x5bae20(0x18e)]}),_0xfbc310=_0x103b63[_0x5bae20(0x16c)],_0x38f681=_0xfbc310[_0x5bae20(0x194)][_0x5bae20(0x170)](_0x55c220=>_0x55c220[_0x5bae20(0x15e)]||_0x55c220['hasChanges']);saveSessionContext({'composable_audience':_0xfbc310['audienceName']},_0x3c044c[_0x5bae20(0x17c)]),console[_0x5bae20(0x133)](a8_0x5265f3[_0x5bae20(0x13e)]('Context\x20set:\x20'+a8_0x5265f3[_0x5bae20(0x16e)]('composable_audience')+'\x20=\x20'+a8_0x5265f3[_0x5bae20(0x174)](_0xfbc310[_0x5bae20(0x17b)])));if(_0x38f681['length']===0x0)return console[_0x5bae20(0x133)](a8_0x5265f3['green'](_0x5bae20(0x13c))),0x0;for(const _0x5d2ca6 of _0x38f681){if(_0x5d2ca6[_0x5bae20(0x15e)])console[_0x5bae20(0x133)](a8_0x5265f3[_0x5bae20(0x13e)]('+\x20'+_0x5d2ca6['relativePath']+_0x5bae20(0x16f)));else _0x5d2ca6['diff']&&(console[_0x5bae20(0x133)](a8_0x5265f3['yellow']('~\x20'+_0x5d2ca6[_0x5bae20(0x12b)])),console[_0x5bae20(0x133)](_0x5d2ca6['diff']));}console[_0x5bae20(0x133)]('\x0a'+_0x38f681[_0x5bae20(0x188)]+'\x20file(s)\x20to\x20write\x20'+('('+_0xfbc310[_0x5bae20(0x18f)][_0x5bae20(0x13f)]+'\x20segments,\x20'+_0xfbc310[_0x5bae20(0x18f)][_0x5bae20(0x12d)]+_0x5bae20(0x157)));if(_0x3c044c[_0x5bae20(0x129)])return console[_0x5bae20(0x133)](a8_0x5265f3[_0x5bae20(0x16e)](_0x5bae20(0x171))),0x0;if(!_0x3c044c[_0x5bae20(0x193)]&&isInteractive()){const _0x46bec4=await confirmKey(_0x5bae20(0x16b));if(!_0x46bec4)return console[_0x5bae20(0x133)](a8_0x5265f3[_0x5bae20(0x16e)]('Cancelled.')),0x0;}for(const _0x39c1ed of _0x38f681){const _0x513cdb=a8_0x4cef9b[_0x5bae20(0x16d)](_0x39c1ed[_0x5bae20(0x145)]);if(!existsSync(_0x513cdb))mkdirSync(_0x513cdb,{'recursive':!![]});writeFileSync(_0x39c1ed[_0x5bae20(0x145)],_0x39c1ed[_0x5bae20(0x197)],'utf-8');}return console['log'](a8_0x5265f3[_0x5bae20(0x13e)](_0x5bae20(0x143)+_0x38f681[_0x5bae20(0x188)]+_0x5bae20(0x162)+_0x2f3ad4)),0x0;}}export class CASPushCommand extends BaseCommand{[a8_0x425e87(0x137)]='cas:push';[a8_0x425e87(0x155)]=a8_0x425e87(0x134);async['execute'](_0x8d5aac){const _0x31bc17=a8_0x425e87,{options:_0x1c725b,args:_0x386b0a,tdx:_0x414b50}=_0x8d5aac,_0x487125=_0x1c725b;let _0x2dc513=_0x386b0a[0x0];!_0x2dc513&&_0x1c725b[_0x31bc17(0x12f)]&&(_0x2dc513=a8_0x4cef9b[_0x31bc17(0x123)](process[_0x31bc17(0x147)](),_0x31bc17(0x172),sanitizeFileName(_0x1c725b[_0x31bc17(0x12f)])));if(!_0x2dc513)return console['error'](a8_0x5265f3[_0x31bc17(0x173)]('No\x20composable\x20audience\x20specified.')),console[_0x31bc17(0x125)](_0x31bc17(0x15a)+a8_0x5265f3['cyan']('tdx\x20cas\x20push\x20<path>')+_0x31bc17(0x132)+a8_0x5265f3['cyan'](_0x31bc17(0x151))),0x1;if(!existsSync(_0x2dc513))return console[_0x31bc17(0x125)](a8_0x5265f3[_0x31bc17(0x136)]('Directory\x20not\x20found:\x20'+_0x2dc513)),console[_0x31bc17(0x125)](a8_0x5265f3[_0x31bc17(0x16e)](_0x31bc17(0x14a))),0x1;const _0x4a0d90=_0x1c725b[_0x31bc17(0x12f)]||a8_0x4cef9b[_0x31bc17(0x148)](_0x2dc513),_0xec0382=a8_0x4cef9b[_0x31bc17(0x150)](process[_0x31bc17(0x147)](),_0x2dc513)||'.';console['log']('Audience:\x20'+a8_0x5265f3[_0x31bc17(0x174)](_0x4a0d90)),console[_0x31bc17(0x133)](_0x31bc17(0x185)+a8_0x5265f3[_0x31bc17(0x16e)](_0xec0382)),console['log'](a8_0x5265f3[_0x31bc17(0x173)]('\x0a⚠\x20Experimental:\x20CAS\x20push\x20runs\x20in\x20dry-run\x20mode\x20only.\x20Push\x20support\x20is\x20not\x20yet\x20complete.')),console['log']();const _0x49a9f3=collectYamlFiles(_0x2dc513);if(_0x49a9f3[_0x31bc17(0x188)]===0x0)return console[_0x31bc17(0x125)](a8_0x5265f3[_0x31bc17(0x136)](_0x31bc17(0x12e)+_0x2dc513)),0x1;console[_0x31bc17(0x133)]('Found\x20'+_0x49a9f3[_0x31bc17(0x188)]+_0x31bc17(0x124));const _0x3ab6c7=await withProgressSpinner(_0x31bc17(0x14f),_0xf09911=>_0x414b50['cas'][_0x31bc17(0x163)](_0x49a9f3,{'dryRun':!![],'verbose':_0x487125[_0x31bc17(0x18e)],'progress':{'update':_0x36b1a6=>_0xf09911['setPhase'](_0x36b1a6)}}),{'verbose':_0x487125[_0x31bc17(0x18e)]}),_0x5e7993=_0x3ab6c7[_0x31bc17(0x16c)],{created:_0x3ce482}=_0x5e7993,_0x371c75=[];if(_0x3ce482[_0x31bc17(0x16a)])_0x371c75['push'](_0x3ce482[_0x31bc17(0x16a)]+_0x31bc17(0x183));if(_0x3ce482[_0x31bc17(0x13f)])_0x371c75[_0x31bc17(0x163)](_0x3ce482[_0x31bc17(0x13f)]+_0x31bc17(0x135));if(_0x3ce482[_0x31bc17(0x12d)])_0x371c75[_0x31bc17(0x163)](_0x3ce482[_0x31bc17(0x12d)]+_0x31bc17(0x141));return _0x371c75['length']===0x0?console[_0x31bc17(0x133)](a8_0x5265f3[_0x31bc17(0x16e)](_0x31bc17(0x18c))):console['log']('Would\x20push:\x20'+_0x371c75[_0x31bc17(0x123)](',\x20')),console['log'](a8_0x5265f3[_0x31bc17(0x16e)](_0x31bc17(0x164))),0x0;}}export class CASPreviewCommand extends BaseCommand{['name']='cas:preview';[a8_0x425e87(0x155)]=a8_0x425e87(0x161);async[a8_0x425e87(0x15f)](_0x169edd){const _0x54db30=a8_0x425e87,{options:_0x556d31,args:_0x9facb4,tdx:_0x1a7c8e}=_0x169edd,_0x2d0fcb=_0x9facb4[0x0],_0x3cd558=_0x9facb4[0x1]||_0x556d31[_0x54db30(0x12f)];if(!_0x2d0fcb)return console[_0x54db30(0x125)](a8_0x5265f3[_0x54db30(0x136)](_0x54db30(0x192))),0x1;if(!_0x3cd558)return console['error'](a8_0x5265f3[_0x54db30(0x173)](_0x54db30(0x154))),console[_0x54db30(0x125)](_0x54db30(0x15a)+a8_0x5265f3['cyan'](_0x54db30(0x186))+'\x20or\x20set\x20context\x20with\x20'+a8_0x5265f3[_0x54db30(0x174)](_0x54db30(0x151))),0x1;const _0x48ec8e=await withProgressSpinner(_0x54db30(0x181)+_0x2d0fcb+'\x27...',()=>_0x1a7c8e[_0x54db30(0x172)]['preview'](_0x3cd558,_0x2d0fcb),{'verbose':_0x556d31['verbose']}),{query:_0x497c89,customers:_0x3ab7af}=_0x48ec8e[_0x54db30(0x16c)];if(isStructuredFormat(_0x556d31))return await handleSingleObjectOutput({'query':_0x497c89,'customers':_0x3ab7af},_0x556d31),0x0;const _0x459989=_0x497c89[_0x54db30(0x14d)]===_0x54db30(0x190)?a8_0x5265f3['green']:a8_0x5265f3['yellow'];console[_0x54db30(0x133)](_0x54db30(0x131)+_0x459989(_0x497c89[_0x54db30(0x14d)])),console[_0x54db30(0x133)](_0x54db30(0x196)+a8_0x5265f3[_0x54db30(0x144)](String(_0x497c89['count'])));_0x497c89[_0x54db30(0x125)]&&console[_0x54db30(0x133)](_0x54db30(0x15d)+a8_0x5265f3[_0x54db30(0x136)](_0x497c89[_0x54db30(0x125)]));if(_0x3ab7af?.[_0x54db30(0x178)]&&_0x3ab7af?.[_0x54db30(0x13b)]){console[_0x54db30(0x133)](a8_0x5265f3[_0x54db30(0x166)](_0x54db30(0x127)+_0x3ab7af[_0x54db30(0x13b)]['length']+')'));const _0x4dc95a=_0x3ab7af['rows'][_0x54db30(0x12a)](_0x3eb253=>{const _0x2dd2b7=_0x54db30,_0x5d97d8={};for(let _0x52ead4=0x0;_0x52ead4<_0x3ab7af[_0x2dd2b7(0x178)][_0x2dd2b7(0x188)];_0x52ead4++){_0x5d97d8[_0x3ab7af['names'][_0x52ead4]]=_0x3eb253[_0x52ead4];}return _0x5d97d8;});await handleSDKOutput(_0x4dc95a,_0x556d31);}return 0x0;}}
|
|
1
|
+
const a8_0xdabb1c=a8_0x56da;(function(_0x3e0e5b,_0x50dc62){const _0x175b7e=a8_0x56da,_0xf3a87a=_0x3e0e5b();while(!![]){try{const _0x111168=-parseInt(_0x175b7e(0x107))/0x1+-parseInt(_0x175b7e(0xbe))/0x2*(parseInt(_0x175b7e(0x9a))/0x3)+-parseInt(_0x175b7e(0x96))/0x4+-parseInt(_0x175b7e(0xf4))/0x5+-parseInt(_0x175b7e(0xc4))/0x6+-parseInt(_0x175b7e(0xd8))/0x7+parseInt(_0x175b7e(0xc0))/0x8*(parseInt(_0x175b7e(0xe1))/0x9);if(_0x111168===_0x50dc62)break;else _0xf3a87a['push'](_0xf3a87a['shift']());}catch(_0xdb37f1){_0xf3a87a['push'](_0xf3a87a['shift']());}}}(a8_0x1977,0x50266));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import a8_0x29e169 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a8_0x31c79f from'path';import{confirmKey,isInteractive}from'../utils/prompt.js';function a8_0x1977(){const _0x33ae1a=['join','Pull\x20composable\x20audience\x20to\x20YAML\x20files','isNew','\x20YAML\x20file(s)','description','636850UsgWCj','\x20audience(s)','cwd','error','\x20\x20Table:\x20\x20','log','659628mToQQd','Error:\x20\x20','Audience\x20name\x20required.','behaviors','843SNqbME','relativePath','Would\x20push:\x20','setPhase','\x20(time:\x20','preview','\x20file(s)\x20to\x20','green','Preview\x20composable\x20segment\x20query\x20on\x20CDW','(dry\x20run\x20—\x20no\x20files\x20written)','No\x20CAS\x20resources\x20found\x20in\x20YAML\x20files.','timeColumn','length','dir','list','\x20activation(s)','\x20or\x20set\x20context\x20with\x20','Describe\x20a\x20composable\x20audience','masterSchema','table','Running\x20preview\x20for\x20\x27','Cancelled.','\x27...','cas:preview','No\x20composable\x20audience\x20specified.','\x20\x20Schema:\x20','Use\x20','basename','underline','diff','red','cas:desc','files','Tip:\x20Run\x20`tdx\x20cas\x20pull\x20<name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20=\x20','\x20segment(s)','4478CnZkPS','Wrote\x20','22139704ukUWnD','name','\x20file(s)\x20to\x20write\x20','schema','1836756cKLoBR','audienceName','attributes','column','🧊\x20','All\x20files\x20are\x20up\x20to\x20date.','push','population','\x20segments,\x20','List\x20composable\x20audiences','Write\x20files?','dim','absolutePath','composable_audience','status','audiences','Fetching\x20audience\x20\x27','counts','\x0aSample\x20Rows\x20(','cas:push','2329957aDXSmo','Audience:\x20','type','names','Analyzing\x20CAS\x20YAML\x20files...','success','hasChanges','cyan','bold','9gbbcZm','\x20—\x20','composableAudience','cas','Master\x20Table','dryRun','Context\x20set:\x20','rows','activations','utf-8','segments','masterKeyColumn','\x20composable\x20audiences','yes','tdx\x20cas\x20desc\x20<name>','session','masterTable','Directory\x20not\x20found:\x20','Pulling\x20composable\x20audience\x20\x27','1846380CyfSNC','content','tdx\x20cas\x20pull\x20<name>','map','get','Found\x20','yellow','Push\x20YAML\x20files\x20to\x20CAS\x20API','\x20\x20Key:\x20\x20\x20\x20','data','No\x20composable\x20audiences\x20found.','tdx\x20use\x20cas\x20<name>','verbose','execute'];a8_0x1977=function(){return _0x33ae1a;};return a8_0x1977();}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_0xdabb1c(0xc1)]='cas:list';['description']=a8_0xdabb1c(0xcd);async[a8_0xdabb1c(0x101)](_0x4b9eb2){const _0x522b32=a8_0xdabb1c,{options:_0x157dd8,tdx:_0xe00b1d}=_0x4b9eb2,_0x11edf5=await withProgressSpinner('Fetching\x20composable\x20audiences...',()=>_0xe00b1d[_0x522b32(0xe4)][_0x522b32(0xa8)](),{'verbose':_0x157dd8[_0x522b32(0x100)]}),_0x44a3b4=_0x11edf5[_0x522b32(0xfd)];if(isStructuredFormat(_0x157dd8))return await handleSDKOutput(_0x44a3b4,_0x157dd8),0x0;if(_0x44a3b4[_0x522b32(0xa6)]===0x0)return console[_0x522b32(0x95)](a8_0x29e169[_0x522b32(0xcf)](_0x522b32(0xfe))),0x0;console[_0x522b32(0x95)](a8_0x29e169[_0x522b32(0xa1)](_0x522b32(0xf9)+_0x44a3b4['length']+_0x522b32(0xed)));for(const _0x11951a of _0x44a3b4){const _0x350352=_0x11951a[_0x522b32(0xcb)]?a8_0x29e169['dim']('\x20('+Number(_0x11951a[_0x522b32(0xcb)])['toLocaleString']()+')'):'',_0x10039e=a8_0x29e169[_0x522b32(0xcf)]('\x20'+_0x11951a[_0x522b32(0xac)]+'.'+_0x11951a[_0x522b32(0xf1)]);console['log'](_0x522b32(0xc8)+_0x11951a[_0x522b32(0xc1)]+_0x350352+_0x10039e),_0x11951a['description']&&console['log']('\x20\x20'+a8_0x29e169[_0x522b32(0xcf)](_0x11951a[_0x522b32(0x106)]));}return 0x0;}}function a8_0x56da(_0x3b7b9d,_0x2b0f2c){_0x3b7b9d=_0x3b7b9d-0x92;const _0x19778a=a8_0x1977();let _0x56da23=_0x19778a[_0x3b7b9d];return _0x56da23;}export class CASDescCommand extends BaseCommand{['name']=a8_0xdabb1c(0xb9);[a8_0xdabb1c(0x106)]=a8_0xdabb1c(0xab);async[a8_0xdabb1c(0x101)](_0x7f7136){const _0x1764b6=a8_0xdabb1c,{options:_0x18daa8,args:_0x2e22b4,tdx:_0x1f5ace}=_0x7f7136,_0x840899=_0x2e22b4[0x0]||_0x18daa8[_0x1764b6(0xe3)];if(!_0x840899)return console['error'](a8_0x29e169[_0x1764b6(0xfa)](_0x1764b6(0xb2))),console[_0x1764b6(0x93)](_0x1764b6(0xb4)+a8_0x29e169[_0x1764b6(0xdf)](_0x1764b6(0xef))+_0x1764b6(0xaa)+a8_0x29e169[_0x1764b6(0xdf)]('tdx\x20use\x20cas\x20<name>')),0x1;const _0x30905e=await withProgressSpinner(_0x1764b6(0xd4)+_0x840899+_0x1764b6(0xb0),()=>_0x1f5ace[_0x1764b6(0xe4)][_0x1764b6(0xf8)](_0x840899),{'verbose':_0x18daa8[_0x1764b6(0x100)]}),_0x446c70=_0x30905e[_0x1764b6(0xfd)];if(isStructuredFormat(_0x18daa8))return await handleSingleObjectOutput(_0x446c70,_0x18daa8),0x0;console['log'](a8_0x29e169[_0x1764b6(0xe0)](_0x446c70[_0x1764b6(0xc1)]));if(_0x446c70[_0x1764b6(0x106)])console[_0x1764b6(0x95)](a8_0x29e169[_0x1764b6(0xcf)](_0x446c70[_0x1764b6(0x106)]));console[_0x1764b6(0x95)](),console['log'](a8_0x29e169[_0x1764b6(0xb6)](_0x1764b6(0xe5))),console[_0x1764b6(0x95)](_0x1764b6(0xb3)+_0x446c70[_0x1764b6(0xac)]),console[_0x1764b6(0x95)](_0x1764b6(0x94)+_0x446c70[_0x1764b6(0xf1)]),console['log'](_0x1764b6(0xfc)+_0x446c70[_0x1764b6(0xec)]),console[_0x1764b6(0x95)]();if(_0x446c70[_0x1764b6(0xc6)]?.[_0x1764b6(0xa6)]){console[_0x1764b6(0x95)](a8_0x29e169[_0x1764b6(0xb6)]('Attributes\x20('+_0x446c70['attributes'][_0x1764b6(0xa6)]+')'));for(const _0x1022ce of _0x446c70['attributes']){console[_0x1764b6(0x95)]('\x20\x20'+a8_0x29e169['bold'](_0x1022ce['name'])+_0x1764b6(0xe2)+_0x1022ce[_0x1764b6(0xc3)]+'.'+_0x1022ce[_0x1764b6(0xad)]+'.'+_0x1022ce[_0x1764b6(0xc7)]+'\x20('+a8_0x29e169[_0x1764b6(0xcf)](_0x1022ce[_0x1764b6(0xda)])+')');}console[_0x1764b6(0x95)]();}if(_0x446c70[_0x1764b6(0x99)]?.['length']){console['log'](a8_0x29e169[_0x1764b6(0xb6)]('Behaviors\x20('+_0x446c70[_0x1764b6(0x99)][_0x1764b6(0xa6)]+')'));for(const _0x236da9 of _0x446c70[_0x1764b6(0x99)]){const _0xee710f=_0x236da9['timeColumn']?_0x1764b6(0x9e)+_0x236da9[_0x1764b6(0xa5)]+')':'';console['log']('\x20\x20'+a8_0x29e169['bold'](_0x236da9[_0x1764b6(0xc1)])+_0x1764b6(0xe2)+_0x236da9['schema']+'.'+_0x236da9[_0x1764b6(0xad)]+_0xee710f);}}return 0x0;}}export class CASPullCommand extends BaseCommand{[a8_0xdabb1c(0xc1)]='cas:pull';['description']=a8_0xdabb1c(0x103);async[a8_0xdabb1c(0x101)](_0x57ff31){const _0x1d6eea=a8_0xdabb1c,{options:_0x1e0466,args:_0x3bab17,tdx:_0x28ffcd}=_0x57ff31,_0x141cfd=_0x1e0466,_0x4515ad=_0x3bab17[0x0]||_0x1e0466[_0x1d6eea(0xe3)];if(!_0x4515ad)return console[_0x1d6eea(0x93)](a8_0x29e169['yellow'](_0x1d6eea(0xb2))),console['error'](_0x1d6eea(0xb4)+a8_0x29e169[_0x1d6eea(0xdf)](_0x1d6eea(0xf6))+'\x20or\x20set\x20context\x20with\x20'+a8_0x29e169[_0x1d6eea(0xdf)](_0x1d6eea(0xff))),0x1;const _0xea4377=_0x141cfd[_0x1d6eea(0xa7)]||a8_0x31c79f['join'](process[_0x1d6eea(0x92)](),_0x1d6eea(0xe4),sanitizeFileName(_0x4515ad)),_0x281b07=await withProgressSpinner(_0x1d6eea(0xf3)+_0x4515ad+_0x1d6eea(0xb0),_0x3f34cb=>_0x28ffcd['cas']['pull'](_0x4515ad,{'targetDir':_0xea4377,'verbose':_0x141cfd[_0x1d6eea(0x100)],'progress':{'update':_0x1d2e21=>_0x3f34cb[_0x1d6eea(0x9d)](_0x1d2e21)}}),{'verbose':_0x141cfd['verbose']}),_0x2bda43=_0x281b07[_0x1d6eea(0xfd)],_0x4ff290=_0x2bda43[_0x1d6eea(0xba)]['filter'](_0x52fa7e=>_0x52fa7e['isNew']||_0x52fa7e[_0x1d6eea(0xde)]);saveSessionContext({'composable_audience':_0x2bda43[_0x1d6eea(0xc5)]},_0x141cfd[_0x1d6eea(0xf0)]),console[_0x1d6eea(0x95)](a8_0x29e169[_0x1d6eea(0xa1)](_0x1d6eea(0xe7)+a8_0x29e169['dim'](_0x1d6eea(0xd1))+_0x1d6eea(0xbc)+a8_0x29e169['cyan'](_0x2bda43[_0x1d6eea(0xc5)])));if(_0x4ff290[_0x1d6eea(0xa6)]===0x0)return console[_0x1d6eea(0x95)](a8_0x29e169[_0x1d6eea(0xa1)](_0x1d6eea(0xc9))),0x0;for(const _0x4ed5b1 of _0x4ff290){if(_0x4ed5b1[_0x1d6eea(0x104)])console['log'](a8_0x29e169[_0x1d6eea(0xa1)]('+\x20'+_0x4ed5b1[_0x1d6eea(0x9b)]+'\x20(new)'));else _0x4ed5b1[_0x1d6eea(0xb7)]&&(console[_0x1d6eea(0x95)](a8_0x29e169[_0x1d6eea(0xfa)]('~\x20'+_0x4ed5b1[_0x1d6eea(0x9b)])),console['log'](_0x4ed5b1[_0x1d6eea(0xb7)]));}console[_0x1d6eea(0x95)]('\x0a'+_0x4ff290[_0x1d6eea(0xa6)]+_0x1d6eea(0xc2)+('('+_0x2bda43[_0x1d6eea(0xd5)][_0x1d6eea(0xeb)]+_0x1d6eea(0xcc)+_0x2bda43['counts'][_0x1d6eea(0xe9)]+'\x20activations)'));if(_0x141cfd[_0x1d6eea(0xe6)])return console[_0x1d6eea(0x95)](a8_0x29e169['dim'](_0x1d6eea(0xa3))),0x0;if(!_0x141cfd[_0x1d6eea(0xee)]&&isInteractive()){const _0x52aee4=await confirmKey(_0x1d6eea(0xce));if(!_0x52aee4)return console[_0x1d6eea(0x95)](a8_0x29e169[_0x1d6eea(0xcf)](_0x1d6eea(0xaf))),0x0;}for(const _0x1152ef of _0x4ff290){const _0x4e5d7c=a8_0x31c79f['dirname'](_0x1152ef[_0x1d6eea(0xd0)]);if(!existsSync(_0x4e5d7c))mkdirSync(_0x4e5d7c,{'recursive':!![]});writeFileSync(_0x1152ef['absolutePath'],_0x1152ef[_0x1d6eea(0xf5)],_0x1d6eea(0xea));}return console[_0x1d6eea(0x95)](a8_0x29e169[_0x1d6eea(0xa1)](_0x1d6eea(0xbf)+_0x4ff290[_0x1d6eea(0xa6)]+_0x1d6eea(0xa0)+_0xea4377)),0x0;}}export class CASPushCommand extends BaseCommand{[a8_0xdabb1c(0xc1)]=a8_0xdabb1c(0xd7);[a8_0xdabb1c(0x106)]=a8_0xdabb1c(0xfb);async[a8_0xdabb1c(0x101)](_0x39047c){const _0x40febb=a8_0xdabb1c,{options:_0x119943,args:_0x104fa3,tdx:_0x32f280}=_0x39047c,_0x23fc8c=_0x119943;let _0x3af37e=_0x104fa3[0x0];!_0x3af37e&&_0x119943['composableAudience']&&(_0x3af37e=a8_0x31c79f['join'](process[_0x40febb(0x92)](),'cas',sanitizeFileName(_0x119943['composableAudience'])));if(!_0x3af37e)return console['error'](a8_0x29e169[_0x40febb(0xfa)](_0x40febb(0xb2))),console[_0x40febb(0x93)](_0x40febb(0xb4)+a8_0x29e169[_0x40febb(0xdf)]('tdx\x20cas\x20push\x20<path>')+'\x20or\x20set\x20context\x20with\x20'+a8_0x29e169[_0x40febb(0xdf)](_0x40febb(0xff))),0x1;if(!existsSync(_0x3af37e))return console['error'](a8_0x29e169[_0x40febb(0xb8)](_0x40febb(0xf2)+_0x3af37e)),console[_0x40febb(0x93)](a8_0x29e169['dim'](_0x40febb(0xbb))),0x1;const _0x1788af=_0x119943['composableAudience']||a8_0x31c79f[_0x40febb(0xb5)](_0x3af37e),_0x5c7ed7=a8_0x31c79f['relative'](process[_0x40febb(0x92)](),_0x3af37e)||'.';console['log'](_0x40febb(0xd9)+a8_0x29e169[_0x40febb(0xdf)](_0x1788af)),console[_0x40febb(0x95)]('Source:\x20\x20\x20'+a8_0x29e169[_0x40febb(0xcf)](_0x5c7ed7)),console[_0x40febb(0x95)](a8_0x29e169[_0x40febb(0xfa)]('\x0a⚠\x20Experimental:\x20CAS\x20push\x20runs\x20in\x20dry-run\x20mode\x20only.\x20Push\x20support\x20is\x20not\x20yet\x20complete.')),console['log']();const _0x208218=collectYamlFiles(_0x3af37e);if(_0x208218['length']===0x0)return console[_0x40febb(0x93)](a8_0x29e169[_0x40febb(0xb8)]('No\x20YAML\x20files\x20found\x20in:\x20'+_0x3af37e)),0x1;console[_0x40febb(0x95)](_0x40febb(0xf9)+_0x208218[_0x40febb(0xa6)]+_0x40febb(0x105));const _0x29e322=await withProgressSpinner(_0x40febb(0xdc),_0x563328=>_0x32f280['cas'][_0x40febb(0xca)](_0x208218,{'dryRun':!![],'verbose':_0x23fc8c[_0x40febb(0x100)],'progress':{'update':_0x290aed=>_0x563328[_0x40febb(0x9d)](_0x290aed)}}),{'verbose':_0x23fc8c[_0x40febb(0x100)]}),_0x3acb0d=_0x29e322[_0x40febb(0xfd)],{created:_0x488328}=_0x3acb0d,_0x29c841=[];if(_0x488328['audiences'])_0x29c841['push'](_0x488328[_0x40febb(0xd3)]+_0x40febb(0x108));if(_0x488328[_0x40febb(0xeb)])_0x29c841[_0x40febb(0xca)](_0x488328[_0x40febb(0xeb)]+_0x40febb(0xbd));if(_0x488328['activations'])_0x29c841[_0x40febb(0xca)](_0x488328['activations']+_0x40febb(0xa9));return _0x29c841[_0x40febb(0xa6)]===0x0?console[_0x40febb(0x95)](a8_0x29e169[_0x40febb(0xcf)](_0x40febb(0xa4))):console['log'](_0x40febb(0x9c)+_0x29c841[_0x40febb(0x102)](',\x20')),console['log'](a8_0x29e169[_0x40febb(0xcf)]('(dry\x20run\x20—\x20push\x20is\x20not\x20yet\x20implemented)')),0x0;}}export class CASPreviewCommand extends BaseCommand{[a8_0xdabb1c(0xc1)]=a8_0xdabb1c(0xb1);['description']=a8_0xdabb1c(0xa2);async[a8_0xdabb1c(0x101)](_0x111158){const _0xf7aa06=a8_0xdabb1c,{options:_0x563e8d,args:_0x3ac5eb,tdx:_0x255a07}=_0x111158,_0x43b27c=_0x3ac5eb[0x0],_0x574db6=_0x3ac5eb[0x1]||_0x563e8d[_0xf7aa06(0xe3)];if(!_0x43b27c)return console['error'](a8_0x29e169[_0xf7aa06(0xb8)]('Usage:\x20tdx\x20cas\x20preview\x20<segment_name>\x20[--audience\x20<name>]')),0x1;if(!_0x574db6)return console[_0xf7aa06(0x93)](a8_0x29e169[_0xf7aa06(0xfa)](_0xf7aa06(0x98))),console['error']('Use\x20'+a8_0x29e169[_0xf7aa06(0xdf)]('--audience\x20<name>')+'\x20or\x20set\x20context\x20with\x20'+a8_0x29e169[_0xf7aa06(0xdf)]('tdx\x20use\x20cas\x20<name>')),0x1;const _0x313052=await withProgressSpinner(_0xf7aa06(0xae)+_0x43b27c+_0xf7aa06(0xb0),()=>_0x255a07[_0xf7aa06(0xe4)][_0xf7aa06(0x9f)](_0x574db6,_0x43b27c),{'verbose':_0x563e8d[_0xf7aa06(0x100)]}),{query:_0x1057c1,customers:_0x35d56d}=_0x313052[_0xf7aa06(0xfd)];if(isStructuredFormat(_0x563e8d))return await handleSingleObjectOutput({'query':_0x1057c1,'customers':_0x35d56d},_0x563e8d),0x0;const _0x40456d=_0x1057c1[_0xf7aa06(0xd2)]===_0xf7aa06(0xdd)?a8_0x29e169[_0xf7aa06(0xa1)]:a8_0x29e169['yellow'];console[_0xf7aa06(0x95)]('Status:\x20'+_0x40456d(_0x1057c1[_0xf7aa06(0xd2)])),console[_0xf7aa06(0x95)]('Count:\x20\x20'+a8_0x29e169[_0xf7aa06(0xe0)](String(_0x1057c1['count'])));_0x1057c1['error']&&console['log'](_0xf7aa06(0x97)+a8_0x29e169[_0xf7aa06(0xb8)](_0x1057c1[_0xf7aa06(0x93)]));if(_0x35d56d?.[_0xf7aa06(0xdb)]&&_0x35d56d?.[_0xf7aa06(0xe8)]){console[_0xf7aa06(0x95)](a8_0x29e169[_0xf7aa06(0xb6)](_0xf7aa06(0xd6)+_0x35d56d[_0xf7aa06(0xe8)][_0xf7aa06(0xa6)]+')'));const _0x36b7be=_0x35d56d[_0xf7aa06(0xe8)][_0xf7aa06(0xf7)](_0x5a0e58=>{const _0x3066bc=_0xf7aa06,_0x358389={};for(let _0x54f6a6=0x0;_0x54f6a6<_0x35d56d[_0x3066bc(0xdb)][_0x3066bc(0xa6)];_0x54f6a6++){_0x358389[_0x35d56d[_0x3066bc(0xdb)][_0x54f6a6]]=_0x5a0e58[_0x54f6a6];}return _0x358389;});await handleSDKOutput(_0x36b7be,_0x563e8d);}return 0x0;}}
|