@treasuredata/tdx 2026.3.49 → 2026.3.50
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.d.ts +6 -4
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +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/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_0xdba3e5=a3_0x303d;(function(_0x18b775,_0x15cd32){const _0xd2f38e=a3_0x303d,_0x2313d7=_0x18b775();while(!![]){try{const _0xb655b0=parseInt(_0xd2f38e(0x10f))/0x1+parseInt(_0xd2f38e(0x130))/0x2+-parseInt(_0xd2f38e(0x118))/0x3*(-parseInt(_0xd2f38e(0x12c))/0x4)+-parseInt(_0xd2f38e(0x128))/0x5*(parseInt(_0xd2f38e(0x11a))/0x6)+parseInt(_0xd2f38e(0x132))/0x7+-parseInt(_0xd2f38e(0x119))/0x8+-parseInt(_0xd2f38e(0x131))/0x9*(parseInt(_0xd2f38e(0x121))/0xa);if(_0xb655b0===_0x15cd32)break;else _0x2313d7['push'](_0x2313d7['shift']());}catch(_0x26518d){_0x2313d7['push'](_0x2313d7['shift']());}}}(a3_0xa191,0xf2776));function a3_0xa191(){const _0x5530cc=['5160YDaint','Site:\x20','\x20activation','error','3519056MjfiUK','5670171lmSGyM','1956283aGWMxn','Resolved\x20child\x20ID:\x20','1712549wUADar','activations','Error:\x20','message','Child\x20name:\x20','\x27...','segment','name','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','2571CKQoCK','15434280EDdhqg','34014YMNYYj','length','site','execute','\x20\x20Cause:\x20','Parent\x20name:\x20','resolveSegmentId','20QvxEFO','listActivations','Error:\x20Segment\x20name\x20is\x20required','resolveParentId','Resolved\x20parent\x20ID:\x20','description','verbose','595SMcwMU','cause','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','data'];a3_0xa191=function(){return _0x5530cc;};return a3_0xa191();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x303d(_0x128f39,_0x1e08be){_0x128f39=_0x128f39-0x10f;const _0xa1910b=a3_0xa191();let _0x303d3e=_0xa1910b[_0x128f39];return _0x303d3e;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0xdba3e5(0x116)]=a3_0xdba3e5(0x110);[a3_0xdba3e5(0x126)]='List\x20activations\x20for\x20a\x20segment';async[a3_0xdba3e5(0x11d)](_0x1b23c9){const _0x1ff40f=a3_0xdba3e5,{options:_0x2d45ee,args:_0x282ac9,tdx:_0xbdecb0}=_0x1b23c9;if(_0x282ac9[_0x1ff40f(0x11b)]===0x0)return console[_0x1ff40f(0x12f)](_0x1ff40f(0x123)),console[_0x1ff40f(0x12f)](_0x1ff40f(0x12a)),0x1;try{const {parentId:_0x3fd696,childId:_0x529b01}=parseSegmentRef(_0x282ac9[0x0]);if(!_0x529b01)return console['error'](_0x1ff40f(0x117)),console['error']('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x2d45ee[_0x1ff40f(0x127)]&&(console[_0x1ff40f(0x12f)](_0x1ff40f(0x12d)+_0x2d45ee[_0x1ff40f(0x11c)]),console[_0x1ff40f(0x12f)](_0x1ff40f(0x11f)+_0x3fd696),console[_0x1ff40f(0x12f)](_0x1ff40f(0x113)+_0x529b01));const _0x27c9c4=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3fd696+_0x1ff40f(0x114),()=>_0xbdecb0[_0x1ff40f(0x115)][_0x1ff40f(0x124)](_0x3fd696),{'verbose':_0x2d45ee[_0x1ff40f(0x127)]}),_0x244e50=_0x27c9c4[_0x1ff40f(0x12b)];_0x2d45ee[_0x1ff40f(0x127)]&&console[_0x1ff40f(0x12f)](_0x1ff40f(0x125)+_0x244e50);const _0x1d012f=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x529b01+_0x1ff40f(0x114),()=>_0xbdecb0['segment'][_0x1ff40f(0x120)](_0x244e50,_0x529b01),{'verbose':_0x2d45ee[_0x1ff40f(0x127)]}),_0xe31b36=_0x1d012f[_0x1ff40f(0x12b)];_0x2d45ee[_0x1ff40f(0x127)]&&console[_0x1ff40f(0x12f)](_0x1ff40f(0x133)+_0xe31b36);const _0x329477=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x529b01+'\x27...',()=>_0xbdecb0[_0x1ff40f(0x115)][_0x1ff40f(0x122)](_0x244e50,_0xe31b36),{'verbose':_0x2d45ee[_0x1ff40f(0x127)]}),_0x2a5f42=_0x329477[_0x1ff40f(0x12b)];return console[_0x1ff40f(0x12f)]('✔\x20Found\x20'+_0x2a5f42[_0x1ff40f(0x11b)]+_0x1ff40f(0x12e)+(_0x2a5f42[_0x1ff40f(0x11b)]!==0x1?'s':'')),await handleSDKOutput(_0x2a5f42,_0x2d45ee),0x0;}catch(_0x3a396d){if(_0x3a396d instanceof SDKError)return console[_0x1ff40f(0x12f)](_0x1ff40f(0x111)+_0x3a396d[_0x1ff40f(0x112)]),_0x3a396d['cause']&&console[_0x1ff40f(0x12f)](_0x1ff40f(0x11e)+_0x3a396d[_0x1ff40f(0x129)]),0x1;throw _0x3a396d;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x16dca6=a4_0x2bcb;(function(_0x52222b,_0xbc414a){const _0x1bff83=a4_0x2bcb,_0x3db43c=_0x52222b();while(!![]){try{const _0x1b086e=parseInt(_0x1bff83(0xd3))/0x1+parseInt(_0x1bff83(0xe6))/0x2*(parseInt(_0x1bff83(0xa1))/0x3)+parseInt(_0x1bff83(0x101))/0x4+parseInt(_0x1bff83(0xe4))/0x5+parseInt(_0x1bff83(0x71))/0x6+parseInt(_0x1bff83(0xc0))/0x7+-parseInt(_0x1bff83(0xa7))/0x8;if(_0x1b086e===_0xbc414a)break;else _0x3db43c['push'](_0x3db43c['shift']());}catch(_0x23168e){_0x3db43c['push'](_0x3db43c['shift']());}}}(a4_0x2a30,0x69e78));import a4_0x4a693d from'chalk';function a4_0x2bcb(_0x4e8522,_0x2b7986){_0x4e8522=_0x4e8522-0x68;const _0x2a30c6=a4_0x2a30();let _0x2bcbcb=_0x2a30c6[_0x4e8522];return _0x2bcbcb;}import a4_0x36d97d 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';function a4_0x2a30(){const _0x6a0e=['Cancelled','outputPath','diff','yellow','Using\x20project:\x20','Would\x20clone:','created','prompts','profile','repeat','agents','found','-\x20no\x20files\x20written','4820382hjXGfG','source','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','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)','Dry\x20run\x20-\x20no\x20files\x20written','pullProject','\x0aPush\x20','Agent:\x20','Output:\x20','Cloning\x20\x22','experimentalKnowledgeBases','Agent\x20','llm_project','newProjectId','cwd-config','\x20updated','Using\x20context\x20project:\x20','execute','\x0aPush\x20summary\x20for\x20\x27','495696SRwnqM','agentName','\x20new','Failed\x20to\x20push\x20agent:\x20','\x0aChanges\x20to\x20prompt\x20\x27','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','integrations','\x20\x20tdx\x20agent\x20pull\x20','\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','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','experimentalArtifacts','name','outputDir','\x22\x20to\x20a\x20different\x20profile','agent','\x20resources\x20to\x20\x27','gray','1015605qmumrT','force','20VAVscD','tdx.json','join','\x20errors','no_local_folder','Source:\x20','\x0aChanges\x20to\x20integration\x20\x27','agent.yml','\x20changed','parse','\x22\x20to\x20\x22','\x0aChanges\x20to\x20agent\x20\x27','\x22:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20tdx\x20agent\x20clone\x20agents/','green','Using\x20project\x20from\x20','\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)','\x20resources?','action','Analyzing\x20project\x20\x22','\x20\x20Integrations:\x20','agentId','\x20\x20Experimental\x20Artifacts:\x20','Summary:','\x0aErrors\x20found:','524596tHsUtc','-\x20nothing\x20pushed','Chat:\x20','message','reason','textKnowledgeBases','Project\x20cloned\x20successfully','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Target:\x20','pushProject','updated','context','\x20\x20Agents:\x20','\x20\x20Experimental\x20Artifact\x20\x22','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Errors:','✔\x20Context\x20set:\x20','\x20files\x20to\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','New\x20project\x20name\x20is\x20required','\x20unchanged','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','site','counts','\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','New\x20project:\x20','New\x20project\x20ID:\x20','Analyzing\x20changes\x20to\x20push...','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','total','\x0a✔\x20Pulled\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','sourceProjectName','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20\x20Integration\x20\x22','dim','new','\x20files?','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','4244904sIVxOb','\x0aWrite\x20','INVALID_ARGUMENT','red','\x22\x20to\x20new\x20project\x20\x22','\x22\x20from\x20project\x20\x22','knowledgeBases','agent:push','Project:\x20','\x0aPull\x20summary\x20for\x20\x27','Status:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Prompt\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','llmProject','dirname','error','cyan','\x22...','no_context','\x0aError:','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Dry\x20run\x20-\x20no\x20changes\x20made','llm','<new-name>','log','description','Clone\x20\x22','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20total','Using\x20project\x20from\x20context:\x20','Would\x20push\x20agent:\x20','Output\x20path:\x20','yes','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','projectId','errors','unchanged','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20=\x20','\x20\x20Source:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','isNew','\x20\x20Knowledge\x20Bases:\x20','Using\x20local\x20project:\x20','output','166758KmmBPo','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','cwd','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Writing\x20files...','18785216QNPBva','\x20|\x20','projectName','Would\x20pull\x20agent:\x20','\x20\x20Knowledge\x20Base\x20\x22','\x20--name\x20','Agent\x20pulled\x20successfully','\x20\x20Agent\x20\x22','push','dryRun','\x20\x20Prompts:\x20','Pushing\x20agent\x20from\x20\x22'];a4_0x2a30=function(){return _0x6a0e;};return a4_0x2a30();}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(_0x9b3fb9){const _0xd8d553=a4_0x2bcb,_0x17e197=[];if(_0x9b3fb9[_0xd8d553(0x11f)]!==undefined)_0x17e197[_0xd8d553(0xaf)](_0x9b3fb9[_0xd8d553(0x11f)]+_0xd8d553(0x90));if(_0x9b3fb9[_0xd8d553(0x6e)]!==undefined&&_0x9b3fb9[_0xd8d553(0x6e)]>0x0)_0x17e197[_0xd8d553(0xaf)](a4_0x4a693d['green'](_0x9b3fb9[_0xd8d553(0x6e)]+'\x20new'));if(_0x9b3fb9[_0xd8d553(0xb9)]!==undefined&&_0x9b3fb9[_0xd8d553(0xb9)]>0x0)_0x17e197[_0xd8d553(0xaf)](a4_0x4a693d[_0xd8d553(0xf6)](_0x9b3fb9[_0xd8d553(0xb9)]+'\x20created'));if(_0x9b3fb9['updated']!==undefined&&_0x9b3fb9[_0xd8d553(0x10b)]>0x0)_0x17e197[_0xd8d553(0xaf)](a4_0x4a693d[_0xd8d553(0xb6)](_0x9b3fb9[_0xd8d553(0x10b)]+_0xd8d553(0xcf)));if(_0x9b3fb9['unchanged']!==undefined&&_0x9b3fb9[_0xd8d553(0x98)]>0x0)_0x17e197['push'](a4_0x4a693d[_0xd8d553(0xe3)](_0x9b3fb9[_0xd8d553(0x98)]+_0xd8d553(0x116)));if(_0x9b3fb9[_0xd8d553(0x97)]!==undefined&&_0x9b3fb9[_0xd8d553(0x97)]>0x0)_0x17e197[_0xd8d553(0xaf)](a4_0x4a693d[_0xd8d553(0x74)](_0x9b3fb9[_0xd8d553(0x97)]+_0xd8d553(0xe9)));return _0x17e197[_0xd8d553(0xe8)](',\x20');}function displayDiffs(_0x3e3f0b,_0x23ca0d,_0x230907,_0x2a2caf,_0x45ffe1,_0x4209eb,_0x29ea9e){const _0x3e8a3c=a4_0x2bcb;for(const _0x578174 of _0x3e3f0b){if(_0x578174['diff']){const _0x151f87=_0x578174['agentName']||_0x578174['name'];console[_0x3e8a3c(0x8b)](_0x3e8a3c(0xf1)+_0x151f87+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x578174[_0x3e8a3c(0xb5)]),console[_0x3e8a3c(0x8b)]('─'[_0x3e8a3c(0xbc)](0x3c));}}for(const _0x5026e7 of _0x23ca0d){_0x5026e7['diff']&&(console[_0x3e8a3c(0x8b)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x5026e7['name']+'\x27:'),console['log']('─'[_0x3e8a3c(0xbc)](0x3c)),console[_0x3e8a3c(0x8b)](_0x5026e7[_0x3e8a3c(0xb5)]),console[_0x3e8a3c(0x8b)]('─'[_0x3e8a3c(0xbc)](0x3c)));}for(const _0x37b538 of _0x230907){_0x37b538[_0x3e8a3c(0xb5)]&&(console[_0x3e8a3c(0x8b)](_0x3e8a3c(0x6b)+_0x37b538['name']+'\x27:'),console['log']('─'[_0x3e8a3c(0xbc)](0x3c)),console[_0x3e8a3c(0x8b)](_0x37b538[_0x3e8a3c(0xb5)]),console[_0x3e8a3c(0x8b)]('─'[_0x3e8a3c(0xbc)](0x3c)));}for(const _0x2e8f5f of _0x2a2caf){_0x2e8f5f[_0x3e8a3c(0xb5)]&&(console[_0x3e8a3c(0x8b)](_0x3e8a3c(0xd7)+_0x2e8f5f[_0x3e8a3c(0xde)]+'\x27:'),console[_0x3e8a3c(0x8b)]('─'[_0x3e8a3c(0xbc)](0x3c)),console[_0x3e8a3c(0x8b)](_0x2e8f5f[_0x3e8a3c(0xb5)]),console[_0x3e8a3c(0x8b)]('─'[_0x3e8a3c(0xbc)](0x3c)));}for(const _0x21f609 of _0x45ffe1){_0x21f609['diff']&&(console['log'](_0x3e8a3c(0xec)+_0x21f609[_0x3e8a3c(0xde)]+'\x27:'),console[_0x3e8a3c(0x8b)]('─'[_0x3e8a3c(0xbc)](0x3c)),console[_0x3e8a3c(0x8b)](_0x21f609[_0x3e8a3c(0xb5)]),console[_0x3e8a3c(0x8b)]('─'[_0x3e8a3c(0xbc)](0x3c)));}for(const _0x3bfe51 of _0x4209eb){_0x3bfe51['diff']&&(console[_0x3e8a3c(0x8b)](_0x3e8a3c(0x108)+_0x3bfe51[_0x3e8a3c(0xde)]+'\x27:'),console[_0x3e8a3c(0x8b)]('─'[_0x3e8a3c(0xbc)](0x3c)),console[_0x3e8a3c(0x8b)](_0x3bfe51[_0x3e8a3c(0xb5)]),console[_0x3e8a3c(0x8b)]('─'['repeat'](0x3c)));}for(const _0x4f26b0 of _0x29ea9e){_0x4f26b0[_0x3e8a3c(0xb5)]&&(console[_0x3e8a3c(0x8b)](_0x3e8a3c(0x9c)+_0x4f26b0[_0x3e8a3c(0xde)]+'\x27:'),console[_0x3e8a3c(0x8b)]('─'[_0x3e8a3c(0xbc)](0x3c)),console[_0x3e8a3c(0x8b)](_0x4f26b0['diff']),console[_0x3e8a3c(0x8b)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x16dca6(0xde)]='agent:pull';[a4_0x16dca6(0x8c)]=a4_0x16dca6(0x70);async['execute'](_0x5eb236){const _0x140179=a4_0x16dca6,{options:_0x3d693c,args:_0x3d1eeb,tdx:_0x3ad2e7}=_0x5eb236,_0x575574=_0x3d1eeb[0x0],_0x4d6c3e=_0x3d1eeb[0x1],_0x1a5a58=_0x3d693c[_0x140179(0xa0)],_0x2dabc3=_0x3d693c[_0x140179(0xb0)],_0x3e2665=_0x3d693c[_0x140179(0xe5)],_0x5e16cd=_0x3d693c[_0x140179(0x94)],_0x5d4e2e=_0x3d693c['llmProject'],_0x4975ed=_0x3d693c[_0x140179(0xe1)];let _0x443df1;if(_0x575574){const _0xeb3bdc=a4_0x36d97d[_0x140179(0xe8)](_0x575574,_0x140179(0xe7));if(existsSync(_0xeb3bdc))try{const _0x1927de=JSON[_0x140179(0xef)](readFileSync(_0xeb3bdc,'utf-8'));_0x1927de[_0x140179(0xcc)]&&(_0x443df1={'llm_project':_0x1927de[_0x140179(0xcc)]});}catch{}}const _0x2364b9=findAgentConfigPath(process['cwd']());let _0x1e9b75;if(_0x2364b9)try{const _0x2368f8=JSON[_0x140179(0xef)](readFileSync(_0x2364b9,'utf-8'));_0x2368f8[_0x140179(0xcc)]&&(_0x1e9b75={'llm_project':_0x2368f8[_0x140179(0xcc)]});}catch{}const _0x14ee02=resolveAgentPullArgs({'arg':_0x575574,'agentNameArg':_0x4d6c3e,'agentFlag':_0x4975ed,'contextProject':_0x5d4e2e,'argDirConfig':_0x443df1,'cwdConfigPath':_0x2364b9||undefined,'cwdConfig':_0x1e9b75}),{projectNameOrId:_0x492c8f,targetAgentName:_0x2210ba,existingOutputDir:_0x214b74,source:_0x5be864}=_0x14ee02;if(_0x5be864==='arg-dir')console['log'](a4_0x4a693d[_0x140179(0x6d)](_0x140179(0xf7)+a4_0x36d97d[_0x140179(0xe8)](_0x575574,_0x140179(0xe7))+':\x20'+_0x492c8f));else{if(_0x5be864===_0x140179(0xce))console['log'](a4_0x4a693d[_0x140179(0x6d)]('Using\x20project:\x20'+_0x492c8f));else _0x5be864===_0x140179(0x10c)&&console[_0x140179(0x8b)](a4_0x4a693d[_0x140179(0x6d)](_0x140179(0x91)+_0x492c8f));}if(!_0x492c8f)return _0x4975ed?(console['log'](a4_0x4a693d['yellow'](_0x140179(0x87))),console['log'](_0x140179(0x110)),console[_0x140179(0x8b)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x140179(0x8b)](a4_0x4a693d[_0x140179(0xb6)](_0x140179(0xdc))),console[_0x140179(0x8b)](_0x140179(0xc3)),console['log'](_0x140179(0xdb)),console[_0x140179(0x8b)]('\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'),console[_0x140179(0x8b)]('\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['log'](_0x140179(0x11a))),0x1;if(_0x2210ba){const {data:_0x46c5b9}=await withSpinner('Pulling\x20agent\x20\x22'+_0x2210ba+_0x140179(0x76)+_0x492c8f+'\x22...',()=>_0x3ad2e7['llm']['pullAgent'](_0x492c8f,_0x2210ba,_0x1a5a58,{'dryRun':_0x2dabc3,'force':_0x3e2665}));if(_0x2dabc3)return console[_0x140179(0x8b)](a4_0x4a693d[_0x140179(0xb6)](_0x140179(0xc4))),console[_0x140179(0x8b)](_0x140179(0xaa)+_0x46c5b9[_0x140179(0xd4)]),console[_0x140179(0x8b)](_0x140179(0x93)+_0x46c5b9[_0x140179(0xb4)]),_0x46c5b9['diff']&&(console['log']('\x0aChanges:'),console[_0x140179(0x8b)]('─'[_0x140179(0xbc)](0x3c)),console['log'](_0x46c5b9[_0x140179(0xb5)]),console[_0x140179(0x8b)]('─'[_0x140179(0xbc)](0x3c))),0x0;return console['log'](a4_0x4a693d[_0x140179(0xf6)](_0x140179(0xad))),console[_0x140179(0x8b)](_0x140179(0xc7)+_0x46c5b9[_0x140179(0xd4)]),console[_0x140179(0x8b)](_0x140179(0xc8)+_0x46c5b9[_0x140179(0xb4)]),console[_0x140179(0x8b)](_0x140179(0x7b)+(_0x46c5b9[_0x140179(0x9d)]?a4_0x4a693d[_0x140179(0xf6)](_0x140179(0x6e)):_0x46c5b9['hasChanges']?a4_0x4a693d[_0x140179(0xb6)](_0x140179(0x10b)):a4_0x4a693d[_0x140179(0xe3)](_0x140179(0x98)))),0x0;}const _0x11f07e=_0x214b74||_0x1a5a58,{data:_0x328481}=await withSpinner(_0x140179(0xfb)+_0x492c8f+_0x140179(0x84),()=>_0x3ad2e7['llm']['pullProject'](_0x492c8f,_0x11f07e,{'dryRun':!![]})),_0x48448d=_0x328481[_0x140179(0x119)][_0x140179(0xbd)][_0x140179(0x6e)]+_0x328481[_0x140179(0x119)]['knowledgeBases'][_0x140179(0x6e)]+_0x328481[_0x140179(0x119)][_0x140179(0x106)][_0x140179(0x6e)]+_0x328481[_0x140179(0x119)][_0x140179(0xba)][_0x140179(0x6e)]+_0x328481['counts'][_0x140179(0xd9)]['new']+_0x328481[_0x140179(0x119)][_0x140179(0xca)]['new']+_0x328481[_0x140179(0x119)][_0x140179(0xdd)][_0x140179(0x6e)],_0x15b6a2=_0x328481['counts'][_0x140179(0xbd)][_0x140179(0x10b)]+_0x328481[_0x140179(0x119)][_0x140179(0x77)][_0x140179(0x10b)]+_0x328481['counts']['textKnowledgeBases']['updated']+_0x328481[_0x140179(0x119)][_0x140179(0xba)]['updated']+_0x328481[_0x140179(0x119)][_0x140179(0xd9)][_0x140179(0x10b)]+_0x328481[_0x140179(0x119)][_0x140179(0xca)]['updated']+_0x328481['counts'][_0x140179(0xdd)][_0x140179(0x10b)],_0x30732a=_0x328481[_0x140179(0x119)][_0x140179(0xbd)][_0x140179(0x98)]+_0x328481[_0x140179(0x119)]['knowledgeBases'][_0x140179(0x98)]+_0x328481[_0x140179(0x119)][_0x140179(0x106)]['unchanged']+_0x328481['counts'][_0x140179(0xba)][_0x140179(0x98)]+_0x328481[_0x140179(0x119)][_0x140179(0xd9)][_0x140179(0x98)]+_0x328481['counts'][_0x140179(0xca)][_0x140179(0x98)]+_0x328481[_0x140179(0x119)][_0x140179(0xdd)][_0x140179(0x98)];console[_0x140179(0x8b)](_0x140179(0x7a)+_0x328481[_0x140179(0xa9)]+'\x27:'),console['log']('\x20\x20'+a4_0x4a693d[_0x140179(0xf6)]('+\x20'+_0x48448d+_0x140179(0xd5))+'\x20|\x20'+a4_0x4a693d[_0x140179(0xb6)]('~\x20'+_0x15b6a2+_0x140179(0xee))+'\x20|\x20'+a4_0x4a693d[_0x140179(0x6d)]('=\x20'+_0x30732a+'\x20unchanged')),console['log'](_0x140179(0x10d)+formatCountSummary(_0x328481['counts'][_0x140179(0xbd)])),console['log'](_0x140179(0x9e)+formatCountSummary(_0x328481[_0x140179(0x119)]['knowledgeBases'])),console[_0x140179(0x8b)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x328481[_0x140179(0x119)][_0x140179(0x106)])),console[_0x140179(0x8b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x328481[_0x140179(0x119)]['prompts'])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x328481['counts'][_0x140179(0xd9)]));const _0x558864=_0x328481[_0x140179(0x119)]['experimentalKnowledgeBases'][_0x140179(0x11f)]>0x0||_0x328481[_0x140179(0x119)]['experimentalArtifacts'][_0x140179(0x11f)]>0x0;_0x558864&&(console[_0x140179(0x8b)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x328481[_0x140179(0x119)][_0x140179(0xca)])),console[_0x140179(0x8b)](_0x140179(0xfe)+formatCountSummary(_0x328481[_0x140179(0x119)][_0x140179(0xdd)])));console[_0x140179(0x8b)](_0x140179(0x109)+a4_0x4a693d[_0x140179(0x83)](_0x328481[_0x140179(0xdf)])),displayDiffs(_0x328481[_0x140179(0xbd)],_0x328481[_0x140179(0x77)],_0x328481['textKnowledgeBases'],_0x328481[_0x140179(0xba)],_0x328481[_0x140179(0xd9)],_0x328481[_0x140179(0xca)],_0x328481[_0x140179(0xdd)]);if(_0x2dabc3)return console[_0x140179(0x8b)](a4_0x4a693d[_0x140179(0xb6)](_0x140179(0xf4))),0x0;if(_0x48448d===0x0&&_0x15b6a2===0x0)return console[_0x140179(0x8b)](a4_0x4a693d['green'](_0x140179(0xa2))),saveSessionContext({'llm_project':_0x328481[_0x140179(0xa9)]},_0x3d693c['session']),console[_0x140179(0x8b)](a4_0x4a693d[_0x140179(0xf6)](_0x140179(0x112)+a4_0x4a693d[_0x140179(0x6d)](_0x140179(0xcc))+_0x140179(0x9a)+a4_0x4a693d[_0x140179(0x83)](_0x328481[_0x140179(0xa9)]))),0x0;if(!_0x5e16cd&&!_0x3e2665){if(!isInteractive())return console[_0x140179(0x82)](a4_0x4a693d['red'](_0x140179(0x86)),_0x140179(0x114)),console[_0x140179(0x82)](a4_0x4a693d[_0x140179(0x6d)](_0x140179(0xc2))),0x1;const _0x2203f1=await confirmKey(_0x140179(0x72)+(_0x48448d+_0x15b6a2)+_0x140179(0x6f));if(!_0x2203f1)return console[_0x140179(0x8b)](a4_0x4a693d[_0x140179(0xb6)](_0x140179(0xb3)),_0x140179(0xbf)),0x1;}const {data:_0x425c10}=await withSpinner(_0x140179(0xa6),()=>_0x3ad2e7[_0x140179(0x89)][_0x140179(0xc5)](_0x492c8f,_0x11f07e,{'force':_0x3e2665}));return console[_0x140179(0x8b)](a4_0x4a693d['green'](_0x140179(0x68)+(_0x48448d+_0x15b6a2)+_0x140179(0x113)+_0x425c10['outputDir'])),saveSessionContext({'llm_project':_0x425c10['projectName']},_0x3d693c['session']),console['log'](a4_0x4a693d[_0x140179(0xf6)](_0x140179(0x112)+a4_0x4a693d[_0x140179(0x6d)](_0x140179(0xcc))+'\x20=\x20'+a4_0x4a693d[_0x140179(0x83)](_0x425c10[_0x140179(0xa9)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x16dca6(0x8c)]=a4_0x16dca6(0x117);async[a4_0x16dca6(0xd1)](_0x74d7a9){const _0x582491=a4_0x16dca6,{options:_0x2f4e18,args:_0x57ba4c,tdx:_0x3c5dd5}=_0x74d7a9,_0x2ef848=_0x57ba4c[0x0],_0x3d6924=_0x2f4e18['name'],_0x53d00e=_0x2f4e18[_0x582491(0xb0)],_0x19cdbf=_0x2f4e18['yes'],_0x4bd33a=_0x2f4e18[_0x582491(0x118)],_0x2f3d1b=_0x2f4e18[_0x582491(0x80)];let _0x33e56c;const _0x278076=findAgentConfigPath(process['cwd']());if(_0x2ef848){const _0x296d1d=a4_0x36d97d[_0x582491(0xe8)](_0x2ef848,_0x582491(0xe7));existsSync(_0x296d1d)?(_0x33e56c=_0x2ef848,console['log'](a4_0x4a693d[_0x582491(0x6d)](_0x582491(0x9f)+_0x2ef848))):_0x33e56c=_0x2ef848;}else{if(_0x278076)_0x33e56c=a4_0x36d97d[_0x582491(0x81)](_0x278076),console[_0x582491(0x8b)](a4_0x4a693d['dim']('Using\x20current\x20project:\x20'+_0x33e56c));else{if(_0x2f3d1b){const _0x308785=sanitizeForFilesystem(_0x2f3d1b);let _0x2fe4dd=_0x308785,_0x1e00ff=a4_0x36d97d[_0x582491(0xe8)](process[_0x582491(0xa3)](),'agents',_0x308785,'tdx.json');if(!existsSync(_0x1e00ff)){const _0x5b214f=normalizeName(_0x2f3d1b),_0x4d3a5c=a4_0x36d97d[_0x582491(0xe8)](process['cwd'](),_0x582491(0xbd),_0x5b214f,_0x582491(0xe7));existsSync(_0x4d3a5c)&&(_0x2fe4dd=_0x5b214f,_0x1e00ff=_0x4d3a5c);}if(existsSync(_0x1e00ff))_0x33e56c=a4_0x36d97d[_0x582491(0x81)](_0x1e00ff),console[_0x582491(0x8b)](a4_0x4a693d['dim'](_0x582491(0x9f)+_0x33e56c));else{const _0x304600=_0x2f4e18[_0x582491(0xbb)];if(_0x304600)throw new SDKError(ErrorCode[_0x582491(0x73)],_0x582491(0x8e)+_0x2f3d1b+_0x582491(0xe0),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x582491(0x11e)+(_0x582491(0xda)+_0x2f3d1b+'\x0a')+(_0x582491(0xf5)+_0x2fe4dd+_0x582491(0xac)+(_0x3d6924||_0x582491(0x8a))+'\x20--profile\x20'+_0x304600)});_0x33e56c=_0x2f3d1b,console['log'](a4_0x4a693d['dim'](_0x582491(0xd0)+_0x2f3d1b));}}}}if(!_0x33e56c)return console[_0x582491(0x8b)](a4_0x4a693d[_0x582491(0xb6)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x582491(0x8b)](_0x582491(0xa5)),console['log'](_0x582491(0x7f)),console['log'](_0x582491(0xf8)),console['log'](_0x582491(0xa4)),0x1;if(!_0x3d6924)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x582491(0x115),undefined,{'helpText':_0x582491(0x7c)});if(!_0x19cdbf&&!_0x53d00e){if(!isInteractive())return console[_0x582491(0x82)](a4_0x4a693d[_0x582491(0x74)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x582491(0x82)](a4_0x4a693d['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1f2d65=await confirmKey(_0x582491(0x8d)+_0x33e56c+_0x582491(0x75)+_0x3d6924+'\x22?');if(!_0x1f2d65)return console[_0x582491(0x8b)](a4_0x4a693d['yellow'](_0x582491(0xb3))),0x1;}const {data:_0x2b834b}=await withSpinner(_0x582491(0xc9)+_0x33e56c+_0x582491(0xf0)+_0x3d6924+'\x22...',()=>_0x3c5dd5[_0x582491(0x89)]['cloneProject'](_0x33e56c,_0x3d6924,{'dryRun':_0x53d00e}));if(_0x53d00e){console[_0x582491(0x8b)](a4_0x4a693d[_0x582491(0xb6)](_0x582491(0x88))),console[_0x582491(0x8b)](_0x582491(0xeb)+_0x2b834b[_0x582491(0x6a)]),console['log']('New\x20project:\x20'+_0x3d6924),console['log'](_0x582491(0xb8)),console[_0x582491(0x8b)]('\x20\x20Agents:\x20'+_0x2b834b[_0x582491(0x119)][_0x582491(0xbd)]['created']),console[_0x582491(0x8b)]('\x20\x20Knowledge\x20Bases:\x20'+_0x2b834b['counts'][_0x582491(0x77)][_0x582491(0xb9)]),console[_0x582491(0x8b)](_0x582491(0xb1)+_0x2b834b['counts'][_0x582491(0xba)][_0x582491(0xb9)]);const _0x16d10=_0x2b834b['counts'][_0x582491(0xca)][_0x582491(0xb9)]>0x0||_0x2b834b[_0x582491(0x119)][_0x582491(0xdd)][_0x582491(0xb9)]>0x0;return _0x16d10&&(console['log'](_0x582491(0x10f)+_0x2b834b[_0x582491(0x119)]['experimentalKnowledgeBases'][_0x582491(0xb9)]),console['log'](_0x582491(0xfe)+_0x2b834b[_0x582491(0x119)][_0x582491(0xdd)]['created'])),0x0;}const _0x582d85=_0x2b834b[_0x582491(0x119)][_0x582491(0xbd)]['errors']>0x0||_0x2b834b[_0x582491(0x119)][_0x582491(0x77)][_0x582491(0x97)]>0x0||_0x2b834b[_0x582491(0x119)][_0x582491(0xba)][_0x582491(0x97)]>0x0||_0x2b834b['counts'][_0x582491(0xca)][_0x582491(0x97)]>0x0||_0x2b834b['counts'][_0x582491(0xdd)]['errors']>0x0;_0x582d85?console[_0x582491(0x8b)](a4_0x4a693d[_0x582491(0xb6)]('Project\x20cloned\x20with\x20errors')):console[_0x582491(0x8b)](a4_0x4a693d[_0x582491(0xf6)](_0x582491(0x107)));console[_0x582491(0x8b)](_0x582491(0xeb)+_0x2b834b[_0x582491(0x6a)]),console[_0x582491(0x8b)](_0x582491(0x11b)+_0x2b834b['newProjectName']),console[_0x582491(0x8b)](_0x582491(0x11c)+_0x2b834b[_0x582491(0xcd)]),console[_0x582491(0x8b)](),console[_0x582491(0x8b)](_0x582491(0xff)),console['log'](_0x582491(0x10d)+formatCountSummary(_0x2b834b[_0x582491(0x119)][_0x582491(0xbd)])),console[_0x582491(0x8b)](_0x582491(0x9e)+formatCountSummary(_0x2b834b['counts']['knowledgeBases'])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x2b834b[_0x582491(0x119)][_0x582491(0xba)])),console[_0x582491(0x8b)](_0x582491(0xfc)+formatCountSummary(_0x2b834b[_0x582491(0x119)][_0x582491(0xd9)]));const _0x532db8=_0x2b834b[_0x582491(0x119)][_0x582491(0xca)][_0x582491(0xb9)]>0x0||_0x2b834b['counts'][_0x582491(0xca)][_0x582491(0x10b)]>0x0||_0x2b834b[_0x582491(0x119)][_0x582491(0xca)][_0x582491(0x98)]>0x0||_0x2b834b[_0x582491(0x119)][_0x582491(0xdd)][_0x582491(0xb9)]>0x0||_0x2b834b['counts'][_0x582491(0xdd)][_0x582491(0x10b)]>0x0||_0x2b834b[_0x582491(0x119)][_0x582491(0xdd)][_0x582491(0x98)]>0x0;_0x532db8&&(console[_0x582491(0x8b)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2b834b[_0x582491(0x119)][_0x582491(0xca)])),console[_0x582491(0x8b)](_0x582491(0xfe)+formatCountSummary(_0x2b834b[_0x582491(0x119)][_0x582491(0xdd)])));if(_0x582d85){console['log'](),console[_0x582491(0x8b)](a4_0x4a693d[_0x582491(0x74)](_0x582491(0x111)));for(const _0xaa0277 of _0x2b834b[_0x582491(0xbd)]){_0xaa0277['action']==='error'&&console['log'](a4_0x4a693d[_0x582491(0x74)](_0x582491(0xae)+_0xaa0277['agentName']+_0x582491(0xf2)+_0xaa0277[_0x582491(0x82)]));}for(const _0x12b4d3 of _0x2b834b['knowledgeBases']){_0x12b4d3[_0x582491(0xfa)]===_0x582491(0x82)&&console['log'](a4_0x4a693d[_0x582491(0x74)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x12b4d3['name']+'\x22:\x20'+_0x12b4d3[_0x582491(0x82)]));}for(const _0x377168 of _0x2b834b[_0x582491(0xba)]){_0x377168[_0x582491(0xfa)]===_0x582491(0x82)&&console[_0x582491(0x8b)](a4_0x4a693d[_0x582491(0x74)](_0x582491(0x7e)+_0x377168[_0x582491(0xde)]+'\x22:\x20'+_0x377168['error']));}for(const _0x54704e of _0x2b834b[_0x582491(0xd9)]){_0x54704e[_0x582491(0xfa)]===_0x582491(0x82)&&console[_0x582491(0x8b)](a4_0x4a693d['red'](_0x582491(0x6c)+_0x54704e[_0x582491(0xde)]+'\x22:\x20'+_0x54704e[_0x582491(0x82)]));}for(const _0x2426bc of _0x2b834b[_0x582491(0xca)]){_0x2426bc[_0x582491(0xfa)]==='error'&&console[_0x582491(0x8b)](a4_0x4a693d[_0x582491(0x74)](_0x582491(0x95)+_0x2426bc[_0x582491(0xde)]+'\x22:\x20'+_0x2426bc['error']));}for(const _0x116ef8 of _0x2b834b[_0x582491(0xdd)]){_0x116ef8[_0x582491(0xfa)]==='error'&&console[_0x582491(0x8b)](a4_0x4a693d['red'](_0x582491(0x10e)+_0x116ef8[_0x582491(0xde)]+_0x582491(0xf2)+_0x116ef8[_0x582491(0x82)]));}return 0x1;}console[_0x582491(0x8b)]();const _0x4d139f=getLLMProjectUrl(_0x4bd33a,_0x2b834b['newProjectId']);return console['log'](_0x582491(0x79)+a4_0x4a693d[_0x582491(0x83)](_0x4d139f)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x16dca6(0xde)]=a4_0x16dca6(0x78);['description']=a4_0x16dca6(0x8f);async['execute'](_0x5e4d1b){const _0x79645d=a4_0x16dca6,{options:_0x273451,args:_0xbb5965,tdx:_0x11a12a}=_0x5e4d1b;let _0x13fcae=_0xbb5965[0x0]||process['cwd']();const _0x480c59=_0x273451[_0x79645d(0xb0)],_0x3858f9=_0x273451[_0x79645d(0xe5)],_0x216616=_0x273451['yes'],_0x1d45ef=_0x273451[_0x79645d(0x118)],_0x4588cc=a4_0x36d97d[_0x79645d(0xe8)](_0x13fcae,_0x79645d(0xed)),_0x24e31d=existsSync(_0x4588cc);if(_0x24e31d){const {data:_0x3c25a8}=await withSpinner(_0x79645d(0xb2)+_0x13fcae+'\x22...',()=>_0x11a12a[_0x79645d(0x89)]['pushAgent'](_0x13fcae,{'dryRun':_0x480c59,'force':_0x3858f9}));if(_0x480c59)return console[_0x79645d(0x8b)](a4_0x4a693d['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x79645d(0x8b)](_0x79645d(0x92)+_0x3c25a8[_0x79645d(0xd4)]),0x0;if(_0x3c25a8[_0x79645d(0xfa)]===_0x79645d(0x82))return console[_0x79645d(0x8b)](a4_0x4a693d[_0x79645d(0x74)](_0x79645d(0xd6)+_0x3c25a8[_0x79645d(0x82)])),0x1;console[_0x79645d(0x8b)](a4_0x4a693d[_0x79645d(0xf6)](_0x79645d(0xcb)+_0x3c25a8[_0x79645d(0xfa)]+'\x20successfully')),console['log'](_0x79645d(0xc7)+_0x3c25a8[_0x79645d(0xd4)]);if(_0x3c25a8[_0x79645d(0xfd)]&&_0x3c25a8[_0x79645d(0x96)]){const _0x570b9f=getLLMAgentChatUrl(_0x1d45ef,_0x3c25a8['projectId'],_0x3c25a8[_0x79645d(0xfd)]);console['log'](_0x79645d(0x103)+a4_0x4a693d[_0x79645d(0x83)](_0x570b9f));}return 0x0;}const _0x797174=_0x273451[_0x79645d(0x80)],_0x4fcee7=resolveProjectFromContext(_0x13fcae,_0x797174);if(_0x4fcee7[_0x79645d(0xbe)])_0x13fcae=_0x4fcee7['projectDir'],_0x4fcee7[_0x79645d(0xc1)]===_0x79645d(0x10c)&&console['log'](a4_0x4a693d['dim'](_0x79645d(0xb7)+_0x13fcae));else{let _0x4f5dde=_0x79645d(0x99);_0x4fcee7[_0x79645d(0x105)]===_0x79645d(0xea)&&(_0x4f5dde=_0x4fcee7[_0x79645d(0x104)]+_0x79645d(0xd8)+_0x4fcee7[_0x79645d(0x80)]+_0x79645d(0x7d));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4fcee7[_0x79645d(0x105)]===_0x79645d(0x85)?_0x4fcee7[_0x79645d(0x104)]:'No\x20tdx.json\x20found\x20in\x20'+_0x13fcae,undefined,{'helpText':_0x4f5dde});}const {data:_0x4c0f14}=await withSpinner(_0x79645d(0x11d),()=>_0x11a12a[_0x79645d(0x89)]['pushProject'](_0x13fcae,{'dryRun':!![]})),_0x5a8044=_0x4c0f14[_0x79645d(0x119)][_0x79645d(0xbd)][_0x79645d(0x97)]>0x0;if(_0x5a8044){console[_0x79645d(0x8b)](a4_0x4a693d['red'](_0x79645d(0x100)));for(const _0x133113 of _0x4c0f14['agents']){_0x133113[_0x79645d(0xfa)]===_0x79645d(0x82)&&console[_0x79645d(0x8b)](a4_0x4a693d[_0x79645d(0x74)](_0x79645d(0xae)+_0x133113[_0x79645d(0xd4)]+_0x79645d(0xf2)+_0x133113[_0x79645d(0x82)]));}return 0x1;}const _0x562e79=_0x4c0f14[_0x79645d(0x119)][_0x79645d(0xbd)]['created']+_0x4c0f14[_0x79645d(0x119)][_0x79645d(0x77)]['created']+_0x4c0f14[_0x79645d(0x119)][_0x79645d(0x106)][_0x79645d(0xb9)]+_0x4c0f14[_0x79645d(0x119)]['prompts'][_0x79645d(0xb9)]+_0x4c0f14[_0x79645d(0x119)][_0x79645d(0xd9)]['created']+_0x4c0f14[_0x79645d(0x119)][_0x79645d(0xca)]['created']+_0x4c0f14[_0x79645d(0x119)][_0x79645d(0xdd)]['created'],_0x43287a=_0x4c0f14[_0x79645d(0x119)][_0x79645d(0xbd)][_0x79645d(0x10b)]+_0x4c0f14[_0x79645d(0x119)][_0x79645d(0x77)]['updated']+_0x4c0f14[_0x79645d(0x119)][_0x79645d(0x106)][_0x79645d(0x10b)]+_0x4c0f14[_0x79645d(0x119)][_0x79645d(0xba)][_0x79645d(0x10b)]+_0x4c0f14['counts'][_0x79645d(0xd9)][_0x79645d(0x10b)]+_0x4c0f14[_0x79645d(0x119)]['experimentalKnowledgeBases'][_0x79645d(0x10b)]+_0x4c0f14[_0x79645d(0x119)]['experimentalArtifacts'][_0x79645d(0x10b)],_0x7e4d20=_0x4c0f14[_0x79645d(0x119)][_0x79645d(0xbd)][_0x79645d(0x98)]+_0x4c0f14[_0x79645d(0x119)][_0x79645d(0x77)][_0x79645d(0x98)]+_0x4c0f14[_0x79645d(0x119)]['textKnowledgeBases']['unchanged']+_0x4c0f14[_0x79645d(0x119)][_0x79645d(0xba)][_0x79645d(0x98)]+_0x4c0f14[_0x79645d(0x119)]['integrations'][_0x79645d(0x98)]+_0x4c0f14[_0x79645d(0x119)][_0x79645d(0xca)][_0x79645d(0x98)]+_0x4c0f14[_0x79645d(0x119)]['experimentalArtifacts'][_0x79645d(0x98)];console[_0x79645d(0x8b)](_0x79645d(0xd2)+_0x4c0f14[_0x79645d(0xa9)]+'\x27:'),console[_0x79645d(0x8b)]('\x20\x20'+a4_0x4a693d['green']('+\x20'+_0x562e79+'\x20new')+_0x79645d(0xa8)+a4_0x4a693d['yellow']('~\x20'+_0x43287a+'\x20changed')+_0x79645d(0xa8)+a4_0x4a693d[_0x79645d(0x6d)]('=\x20'+_0x7e4d20+'\x20unchanged')),console[_0x79645d(0x8b)](_0x79645d(0x10d)+formatCountSummary(_0x4c0f14[_0x79645d(0x119)][_0x79645d(0xbd)])),console['log'](_0x79645d(0x9e)+formatCountSummary(_0x4c0f14['counts'][_0x79645d(0x77)])),console[_0x79645d(0x8b)](_0x79645d(0x69)+formatCountSummary(_0x4c0f14['counts'][_0x79645d(0x106)])),console['log'](_0x79645d(0xb1)+formatCountSummary(_0x4c0f14['counts'][_0x79645d(0xba)])),console[_0x79645d(0x8b)](_0x79645d(0xfc)+formatCountSummary(_0x4c0f14[_0x79645d(0x119)][_0x79645d(0xd9)]));const _0x2fa6af=_0x4c0f14[_0x79645d(0x119)]['experimentalKnowledgeBases'][_0x79645d(0xb9)]>0x0||_0x4c0f14[_0x79645d(0x119)][_0x79645d(0xca)][_0x79645d(0x10b)]>0x0||_0x4c0f14[_0x79645d(0x119)][_0x79645d(0xca)][_0x79645d(0x98)]>0x0||_0x4c0f14[_0x79645d(0x119)][_0x79645d(0xdd)][_0x79645d(0xb9)]>0x0||_0x4c0f14[_0x79645d(0x119)][_0x79645d(0xdd)]['updated']>0x0||_0x4c0f14[_0x79645d(0x119)]['experimentalArtifacts']['unchanged']>0x0;_0x2fa6af&&(console[_0x79645d(0x8b)](_0x79645d(0x10f)+formatCountSummary(_0x4c0f14[_0x79645d(0x119)][_0x79645d(0xca)])),console[_0x79645d(0x8b)](_0x79645d(0xfe)+formatCountSummary(_0x4c0f14[_0x79645d(0x119)][_0x79645d(0xdd)])));console[_0x79645d(0x8b)](_0x79645d(0x9b)+a4_0x4a693d['cyan'](_0x13fcae)),displayDiffs(_0x4c0f14[_0x79645d(0xbd)],_0x4c0f14['knowledgeBases'],_0x4c0f14[_0x79645d(0x106)],_0x4c0f14[_0x79645d(0xba)],_0x4c0f14['integrations'],_0x4c0f14[_0x79645d(0xca)],_0x4c0f14[_0x79645d(0xdd)]);if(_0x480c59)return console[_0x79645d(0x8b)](a4_0x4a693d[_0x79645d(0xb6)](_0x79645d(0xf3))),0x0;if(_0x562e79===0x0&&_0x43287a===0x0){console[_0x79645d(0x8b)](a4_0x4a693d['green']('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0xad93a9=getLLMProjectUrl(_0x1d45ef,_0x4c0f14[_0x79645d(0x96)]);return console['log'](_0x79645d(0x79)+a4_0x4a693d[_0x79645d(0x83)](_0xad93a9)),0x0;}if(!_0x216616&&!_0x3858f9){if(!isInteractive())return console['error'](a4_0x4a693d[_0x79645d(0x74)]('\x0aError:'),_0x79645d(0x114)),console[_0x79645d(0x82)](a4_0x4a693d[_0x79645d(0x6d)](_0x79645d(0xc2))),0x1;const _0x38197d=await confirmKey(_0x79645d(0xc6)+(_0x562e79+_0x43287a)+_0x79645d(0xf9));if(!_0x38197d)return console[_0x79645d(0x8b)](a4_0x4a693d[_0x79645d(0xb6)](_0x79645d(0xb3)),_0x79645d(0x102)),0x1;}const {data:_0x353953}=await withSpinner('Pushing\x20to\x20project...',()=>_0x11a12a[_0x79645d(0x89)][_0x79645d(0x10a)](_0x13fcae,{'force':_0x3858f9})),_0x47431a=_0x353953['counts'][_0x79645d(0xbd)][_0x79645d(0x97)]>0x0||_0x353953[_0x79645d(0x119)][_0x79645d(0x77)][_0x79645d(0x97)]>0x0||_0x353953[_0x79645d(0x119)]['textKnowledgeBases']['errors']>0x0||_0x353953[_0x79645d(0x119)][_0x79645d(0xba)][_0x79645d(0x97)]>0x0;if(_0x47431a){console['log'](a4_0x4a693d[_0x79645d(0xb6)]('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console['log'](a4_0x4a693d['red'](_0x79645d(0x111)));for(const _0x1fc6be of _0x353953[_0x79645d(0xbd)]){_0x1fc6be[_0x79645d(0xfa)]==='error'&&console[_0x79645d(0x8b)](a4_0x4a693d['red'](_0x79645d(0xae)+_0x1fc6be[_0x79645d(0xd4)]+_0x79645d(0xf2)+_0x1fc6be[_0x79645d(0x82)]));}for(const _0x5643b5 of _0x353953[_0x79645d(0x77)]){_0x5643b5[_0x79645d(0xfa)]===_0x79645d(0x82)&&console[_0x79645d(0x8b)](a4_0x4a693d[_0x79645d(0x74)](_0x79645d(0xab)+_0x5643b5['name']+_0x79645d(0xf2)+_0x5643b5[_0x79645d(0x82)]));}for(const _0x4fea2a of _0x353953['textKnowledgeBases']){_0x4fea2a[_0x79645d(0xfa)]===_0x79645d(0x82)&&console[_0x79645d(0x8b)](a4_0x4a693d['red']('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x4fea2a[_0x79645d(0xde)]+_0x79645d(0xf2)+_0x4fea2a[_0x79645d(0x82)]));}for(const _0x481af6 of _0x353953[_0x79645d(0xba)]){_0x481af6[_0x79645d(0xfa)]==='error'&&console[_0x79645d(0x8b)](a4_0x4a693d[_0x79645d(0x74)](_0x79645d(0x7e)+_0x481af6[_0x79645d(0xde)]+_0x79645d(0xf2)+_0x481af6[_0x79645d(0x82)]));}for(const _0x4bfacb of _0x353953[_0x79645d(0xd9)]){_0x4bfacb[_0x79645d(0xfa)]===_0x79645d(0x82)&&console[_0x79645d(0x8b)](a4_0x4a693d['red'](_0x79645d(0x6c)+_0x4bfacb['name']+'\x22:\x20'+_0x4bfacb[_0x79645d(0x82)]));}return 0x1;}console[_0x79645d(0x8b)](a4_0x4a693d['green']('\x0a✔\x20Pushed\x20'+(_0x562e79+_0x43287a)+_0x79645d(0xe2)+_0x353953['projectName']+'\x27'));const _0xff47fe=getLLMProjectUrl(_0x1d45ef,_0x353953['projectId']);return console['log']('Project:\x20'+a4_0x4a693d[_0x79645d(0x83)](_0xff47fe)),0x0;}}
|
|
1
|
+
const a4_0x2c3b5c=a4_0x3363;(function(_0x9781f,_0x250ae1){const _0x358100=a4_0x3363,_0x2b9cfa=_0x9781f();while(!![]){try{const _0x120ff5=parseInt(_0x358100(0x150))/0x1+-parseInt(_0x358100(0x175))/0x2+parseInt(_0x358100(0x145))/0x3*(parseInt(_0x358100(0x1bc))/0x4)+-parseInt(_0x358100(0x1d2))/0x5+parseInt(_0x358100(0x136))/0x6+parseInt(_0x358100(0x1b9))/0x7*(parseInt(_0x358100(0x141))/0x8)+-parseInt(_0x358100(0x17b))/0x9*(parseInt(_0x358100(0x1d1))/0xa);if(_0x120ff5===_0x250ae1)break;else _0x2b9cfa['push'](_0x2b9cfa['shift']());}catch(_0xed7a07){_0x2b9cfa['push'](_0x2b9cfa['shift']());}}}(a4_0x5079,0x75bdb));import a4_0x4fff68 from'chalk';import a4_0x5d88db 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';function a4_0x3363(_0x4f24ff,_0x2d6148){_0x4f24ff=_0x4f24ff-0x128;const _0x50798a=a4_0x5079();let _0x3363e4=_0x50798a[_0x4f24ff];return _0x3363e4;}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 a4_0x5079(){const _0x1a3ad9=['gray','Output:\x20','agent','New\x20project\x20name\x20is\x20required','\x20\x20Agents:\x20','sourceProjectName','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20Integrations:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','red','\x0a✔\x20Pushed\x20','2731278XeOayH','name','Agent:\x20','Pulling\x20agent\x20\x22','-\x20nothing\x20pushed','Would\x20pull\x20agent:\x20','repeat','Using\x20context\x20project:\x20','\x20files?','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Chat:\x20','2164912zLJPnh','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aWrite\x20','\x20\x20Experimental\x20Artifacts:\x20','1642083wIktRc','arg-dir','total','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','utf-8','agent.yml','\x20\x20Integration\x20\x22','\x20resources?','\x22\x20to\x20a\x20different\x20profile','\x0aPush\x20','\x20total','867383OfYpQv','push','execute','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','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)','session','\x20created','MISSING_ARGUMENT','dryRun','\x0a✔\x20Pulled\x20','log','\x20files\x20to\x20','cloneProject','\x20resources\x20to\x20\x27','Errors:','profile','\x20|\x20','force','Cloning\x20\x22','\x20--name\x20','\x0aError:','-\x20no\x20files\x20written','Dry\x20run\x20-\x20no\x20changes\x20made','outputDir','Agent\x20','agents','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0aChanges\x20to\x20agent\x20\x27','\x0aChanges\x20to\x20prompt\x20\x27','action','no_local_folder','prompts','\x20\x20Prompts:\x20','\x0aChanges:','\x20=\x20','\x20errors','green','831060FudGay','isNew','site','no_context','llmProject','\x20\x20Knowledge\x20Base\x20\x22','5413257cXzOaF','reason','parse','Using\x20local\x20project:\x20','join','Dry\x20run\x20-\x20no\x20files\x20written','cwd-config','Analyzing\x20changes\x20to\x20push...','integrations','Pushing\x20to\x20project...','new','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','unchanged','experimentalKnowledgeBases','Summary:','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','agentId','message','outputPath','description','\x20\x20Agent\x20\x22','updated','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x0aErrors\x20found:','llm','Using\x20project\x20from\x20context:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20\x20Knowledge\x20Bases:\x20','Status:\x20','dim','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','agent:push','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','tdx.json','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','No\x20tdx.json\x20found\x20in\x20','output','created','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Cancelled','newProjectName','cwd','Project\x20cloned\x20with\x20errors','\x20successfully','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x22...','\x20unchanged','\x20\x20Target:\x20','\x0aPush\x20summary\x20for\x20\x27','Output\x20path:\x20','yellow','\x22:\x20','Would\x20clone:','Project:\x20','\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)','Source:\x20','\x20changed','errors','agent:clone','projectId','✔\x20Context\x20set:\x20','7OHqXps','\x20new','\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','4CLjVXM','\x20\x20Text\x20Knowledge\x20Bases:\x20','Writing\x20files...','\x20--profile\x20','newProjectId','\x27\x20to\x20create\x20the\x20folder\x20structure.','agentName','counts','hasChanges','textKnowledgeBases','Failed\x20to\x20push\x20agent:\x20','context','pullProject','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','llm_project','INVALID_ARGUMENT','experimentalArtifacts','Using\x20project:\x20','\x20\x20Experimental\x20Artifact\x20\x22','pushProject','New\x20project:\x20','10YjFOQi','3206505CQQvrD','New\x20project\x20ID:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','diff','Would\x20push\x20agent:\x20','Project\x20cloned\x20successfully','knowledgeBases','<new-name>','\x20\x20Prompt\x20\x22','dirname','cyan','yes','error','Analyzing\x20project\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','projectName'];a4_0x5079=function(){return _0x1a3ad9;};return a4_0x5079();}function formatCountSummary(_0x433e95){const _0x1adc4f=a4_0x3363,_0x4cd03e=[];if(_0x433e95[_0x1adc4f(0x147)]!==undefined)_0x4cd03e[_0x1adc4f(0x151)](_0x433e95[_0x1adc4f(0x147)]+_0x1adc4f(0x14f));if(_0x433e95[_0x1adc4f(0x185)]!==undefined&&_0x433e95['new']>0x0)_0x4cd03e['push'](a4_0x4fff68['green'](_0x433e95['new']+_0x1adc4f(0x1ba)));if(_0x433e95[_0x1adc4f(0x1a1)]!==undefined&&_0x433e95[_0x1adc4f(0x1a1)]>0x0)_0x4cd03e[_0x1adc4f(0x151)](a4_0x4fff68['green'](_0x433e95[_0x1adc4f(0x1a1)]+_0x1adc4f(0x156)));if(_0x433e95[_0x1adc4f(0x191)]!==undefined&&_0x433e95[_0x1adc4f(0x191)]>0x0)_0x4cd03e[_0x1adc4f(0x151)](a4_0x4fff68[_0x1adc4f(0x1ae)](_0x433e95[_0x1adc4f(0x191)]+'\x20updated'));if(_0x433e95[_0x1adc4f(0x187)]!==undefined&&_0x433e95[_0x1adc4f(0x187)]>0x0)_0x4cd03e[_0x1adc4f(0x151)](a4_0x4fff68[_0x1adc4f(0x12b)](_0x433e95[_0x1adc4f(0x187)]+_0x1adc4f(0x1aa)));if(_0x433e95[_0x1adc4f(0x1b5)]!==undefined&&_0x433e95['errors']>0x0)_0x4cd03e[_0x1adc4f(0x151)](a4_0x4fff68[_0x1adc4f(0x134)](_0x433e95['errors']+_0x1adc4f(0x173)));return _0x4cd03e[_0x1adc4f(0x17f)](',\x20');}function displayDiffs(_0x93acb6,_0x273c10,_0x14513c,_0x16bc57,_0x4a90c2,_0x15636b,_0x4c5810){const _0x2d1526=a4_0x3363;for(const _0x3f3f81 of _0x93acb6){if(_0x3f3f81[_0x2d1526(0x1d5)]){const _0x1ef09d=_0x3f3f81['agentName']||_0x3f3f81[_0x2d1526(0x137)];console['log'](_0x2d1526(0x16b)+_0x1ef09d+'\x27:'),console[_0x2d1526(0x15a)]('─'['repeat'](0x3c)),console[_0x2d1526(0x15a)](_0x3f3f81[_0x2d1526(0x1d5)]),console['log']('─'[_0x2d1526(0x13c)](0x3c));}}for(const _0xd1498f of _0x273c10){_0xd1498f[_0x2d1526(0x1d5)]&&(console[_0x2d1526(0x15a)](_0x2d1526(0x1c9)+_0xd1498f[_0x2d1526(0x137)]+'\x27:'),console[_0x2d1526(0x15a)]('─'[_0x2d1526(0x13c)](0x3c)),console[_0x2d1526(0x15a)](_0xd1498f[_0x2d1526(0x1d5)]),console['log']('─'[_0x2d1526(0x13c)](0x3c)));}for(const _0x257963 of _0x14513c){_0x257963[_0x2d1526(0x1d5)]&&(console[_0x2d1526(0x15a)](_0x2d1526(0x148)+_0x257963[_0x2d1526(0x137)]+'\x27:'),console[_0x2d1526(0x15a)]('─'[_0x2d1526(0x13c)](0x3c)),console['log'](_0x257963[_0x2d1526(0x1d5)]),console['log']('─'[_0x2d1526(0x13c)](0x3c)));}for(const _0x5481c4 of _0x16bc57){_0x5481c4[_0x2d1526(0x1d5)]&&(console[_0x2d1526(0x15a)](_0x2d1526(0x16c)+_0x5481c4['name']+'\x27:'),console[_0x2d1526(0x15a)]('─'[_0x2d1526(0x13c)](0x3c)),console[_0x2d1526(0x15a)](_0x5481c4['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x19df26 of _0x4a90c2){_0x19df26['diff']&&(console[_0x2d1526(0x15a)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x19df26['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x19df26['diff']),console['log']('─'[_0x2d1526(0x13c)](0x3c)));}for(const _0x2f6987 of _0x15636b){_0x2f6987[_0x2d1526(0x1d5)]&&(console['log']('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x2f6987[_0x2d1526(0x137)]+'\x27:'),console[_0x2d1526(0x15a)]('─'[_0x2d1526(0x13c)](0x3c)),console[_0x2d1526(0x15a)](_0x2f6987[_0x2d1526(0x1d5)]),console['log']('─'[_0x2d1526(0x13c)](0x3c)));}for(const _0x3800e6 of _0x4c5810){_0x3800e6[_0x2d1526(0x1d5)]&&(console['log'](_0x2d1526(0x1d4)+_0x3800e6[_0x2d1526(0x137)]+'\x27:'),console[_0x2d1526(0x15a)]('─'['repeat'](0x3c)),console[_0x2d1526(0x15a)](_0x3800e6['diff']),console[_0x2d1526(0x15a)]('─'[_0x2d1526(0x13c)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x2c3b5c(0x137)]='agent:pull';[a4_0x2c3b5c(0x18f)]=a4_0x2c3b5c(0x18b);async[a4_0x2c3b5c(0x152)](_0x8b81e5){const _0x1500a3=a4_0x2c3b5c,{options:_0x4d9808,args:_0x2ad236,tdx:_0x47b749}=_0x8b81e5,_0x194235=_0x2ad236[0x0],_0x4b7697=_0x2ad236[0x1],_0x10c551=_0x4d9808[_0x1500a3(0x1a0)],_0x47688d=_0x4d9808[_0x1500a3(0x158)],_0x2ca510=_0x4d9808[_0x1500a3(0x161)],_0x2c9e21=_0x4d9808[_0x1500a3(0x1dd)],_0x4f6132=_0x4d9808[_0x1500a3(0x179)],_0xe9f94a=_0x4d9808[_0x1500a3(0x12d)];let _0x59cc01;if(_0x194235){const _0x27ccf1=a4_0x5d88db[_0x1500a3(0x17f)](_0x194235,_0x1500a3(0x19d));if(existsSync(_0x27ccf1))try{const _0x313374=JSON[_0x1500a3(0x17d)](readFileSync(_0x27ccf1,'utf-8'));_0x313374[_0x1500a3(0x1ca)]&&(_0x59cc01={'llm_project':_0x313374[_0x1500a3(0x1ca)]});}catch{}}const _0x2dabfb=findAgentConfigPath(process[_0x1500a3(0x1a5)]());let _0xfb0ed;if(_0x2dabfb)try{const _0x227113=JSON['parse'](readFileSync(_0x2dabfb,_0x1500a3(0x149)));_0x227113[_0x1500a3(0x1ca)]&&(_0xfb0ed={'llm_project':_0x227113['llm_project']});}catch{}const _0x21a83f=resolveAgentPullArgs({'arg':_0x194235,'agentNameArg':_0x4b7697,'agentFlag':_0xe9f94a,'contextProject':_0x4f6132,'argDirConfig':_0x59cc01,'cwdConfigPath':_0x2dabfb||undefined,'cwdConfig':_0xfb0ed}),{projectNameOrId:_0x16395c,targetAgentName:_0x2454b6,existingOutputDir:_0x5cc5c8,source:_0x505327}=_0x21a83f;if(_0x505327===_0x1500a3(0x146))console[_0x1500a3(0x15a)](a4_0x4fff68[_0x1500a3(0x199)]('Using\x20project\x20from\x20'+a4_0x5d88db['join'](_0x194235,'tdx.json')+':\x20'+_0x16395c));else{if(_0x505327===_0x1500a3(0x181))console[_0x1500a3(0x15a)](a4_0x4fff68[_0x1500a3(0x199)](_0x1500a3(0x1cd)+_0x16395c));else _0x505327===_0x1500a3(0x1c7)&&console[_0x1500a3(0x15a)](a4_0x4fff68[_0x1500a3(0x199)](_0x1500a3(0x195)+_0x16395c));}if(!_0x16395c)return _0xe9f94a?(console[_0x1500a3(0x15a)](a4_0x4fff68[_0x1500a3(0x1ae)](_0x1500a3(0x133))),console[_0x1500a3(0x15a)](_0x1500a3(0x13f)),console['log'](_0x1500a3(0x153))):(console[_0x1500a3(0x15a)](a4_0x4fff68[_0x1500a3(0x1ae)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x1500a3(0x15a)](_0x1500a3(0x154)),console[_0x1500a3(0x15a)](_0x1500a3(0x1bb)),console['log']('\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'),console[_0x1500a3(0x15a)]('\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[_0x1500a3(0x15a)]('\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')),0x1;if(_0x2454b6){const {data:_0x4d330c}=await withSpinner(_0x1500a3(0x139)+_0x2454b6+'\x22\x20from\x20project\x20\x22'+_0x16395c+_0x1500a3(0x1a9),()=>_0x47b749[_0x1500a3(0x194)]['pullAgent'](_0x16395c,_0x2454b6,_0x10c551,{'dryRun':_0x47688d,'force':_0x2ca510}));if(_0x47688d)return console[_0x1500a3(0x15a)](a4_0x4fff68[_0x1500a3(0x1ae)](_0x1500a3(0x180))),console['log'](_0x1500a3(0x13b)+_0x4d330c['agentName']),console[_0x1500a3(0x15a)](_0x1500a3(0x1ad)+_0x4d330c[_0x1500a3(0x18e)]),_0x4d330c[_0x1500a3(0x1d5)]&&(console[_0x1500a3(0x15a)](_0x1500a3(0x171)),console[_0x1500a3(0x15a)]('─'[_0x1500a3(0x13c)](0x3c)),console[_0x1500a3(0x15a)](_0x4d330c[_0x1500a3(0x1d5)]),console[_0x1500a3(0x15a)]('─'[_0x1500a3(0x13c)](0x3c))),0x0;return console[_0x1500a3(0x15a)](a4_0x4fff68['green']('Agent\x20pulled\x20successfully')),console[_0x1500a3(0x15a)](_0x1500a3(0x138)+_0x4d330c[_0x1500a3(0x1c2)]),console[_0x1500a3(0x15a)](_0x1500a3(0x12c)+_0x4d330c[_0x1500a3(0x18e)]),console['log'](_0x1500a3(0x198)+(_0x4d330c[_0x1500a3(0x176)]?a4_0x4fff68[_0x1500a3(0x174)](_0x1500a3(0x185)):_0x4d330c[_0x1500a3(0x1c4)]?a4_0x4fff68[_0x1500a3(0x1ae)](_0x1500a3(0x191)):a4_0x4fff68[_0x1500a3(0x12b)](_0x1500a3(0x187)))),0x0;}const _0x57aca9=_0x5cc5c8||_0x10c551,{data:_0xcd4054}=await withSpinner(_0x1500a3(0x128)+_0x16395c+_0x1500a3(0x1a9),()=>_0x47b749['llm']['pullProject'](_0x16395c,_0x57aca9,{'dryRun':!![]})),_0x461dd2=_0xcd4054['counts'][_0x1500a3(0x169)][_0x1500a3(0x185)]+_0xcd4054[_0x1500a3(0x1c3)][_0x1500a3(0x1d8)][_0x1500a3(0x185)]+_0xcd4054['counts']['textKnowledgeBases'][_0x1500a3(0x185)]+_0xcd4054['counts'][_0x1500a3(0x16f)][_0x1500a3(0x185)]+_0xcd4054['counts']['integrations'][_0x1500a3(0x185)]+_0xcd4054[_0x1500a3(0x1c3)][_0x1500a3(0x188)]['new']+_0xcd4054[_0x1500a3(0x1c3)][_0x1500a3(0x1cc)][_0x1500a3(0x185)],_0x4abb9e=_0xcd4054['counts'][_0x1500a3(0x169)][_0x1500a3(0x191)]+_0xcd4054[_0x1500a3(0x1c3)][_0x1500a3(0x1d8)][_0x1500a3(0x191)]+_0xcd4054['counts'][_0x1500a3(0x1c5)]['updated']+_0xcd4054['counts'][_0x1500a3(0x16f)]['updated']+_0xcd4054[_0x1500a3(0x1c3)][_0x1500a3(0x183)][_0x1500a3(0x191)]+_0xcd4054[_0x1500a3(0x1c3)][_0x1500a3(0x188)][_0x1500a3(0x191)]+_0xcd4054[_0x1500a3(0x1c3)][_0x1500a3(0x1cc)][_0x1500a3(0x191)],_0x279ff1=_0xcd4054['counts'][_0x1500a3(0x169)][_0x1500a3(0x187)]+_0xcd4054[_0x1500a3(0x1c3)][_0x1500a3(0x1d8)]['unchanged']+_0xcd4054['counts']['textKnowledgeBases'][_0x1500a3(0x187)]+_0xcd4054[_0x1500a3(0x1c3)][_0x1500a3(0x16f)][_0x1500a3(0x187)]+_0xcd4054[_0x1500a3(0x1c3)][_0x1500a3(0x183)][_0x1500a3(0x187)]+_0xcd4054[_0x1500a3(0x1c3)][_0x1500a3(0x188)][_0x1500a3(0x187)]+_0xcd4054[_0x1500a3(0x1c3)]['experimentalArtifacts'][_0x1500a3(0x187)];console[_0x1500a3(0x15a)]('\x0aPull\x20summary\x20for\x20\x27'+_0xcd4054[_0x1500a3(0x12a)]+'\x27:'),console['log']('\x20\x20'+a4_0x4fff68[_0x1500a3(0x174)]('+\x20'+_0x461dd2+_0x1500a3(0x1ba))+_0x1500a3(0x160)+a4_0x4fff68[_0x1500a3(0x1ae)]('~\x20'+_0x4abb9e+_0x1500a3(0x1b4))+'\x20|\x20'+a4_0x4fff68[_0x1500a3(0x199)]('=\x20'+_0x279ff1+_0x1500a3(0x1aa))),console[_0x1500a3(0x15a)]('\x20\x20Agents:\x20'+formatCountSummary(_0xcd4054[_0x1500a3(0x1c3)][_0x1500a3(0x169)])),console['log'](_0x1500a3(0x197)+formatCountSummary(_0xcd4054[_0x1500a3(0x1c3)][_0x1500a3(0x1d8)])),console[_0x1500a3(0x15a)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xcd4054[_0x1500a3(0x1c3)]['textKnowledgeBases'])),console['log'](_0x1500a3(0x170)+formatCountSummary(_0xcd4054[_0x1500a3(0x1c3)][_0x1500a3(0x16f)])),console[_0x1500a3(0x15a)](_0x1500a3(0x132)+formatCountSummary(_0xcd4054[_0x1500a3(0x1c3)][_0x1500a3(0x183)]));const _0x519bc3=_0xcd4054[_0x1500a3(0x1c3)][_0x1500a3(0x188)]['total']>0x0||_0xcd4054['counts'][_0x1500a3(0x1cc)][_0x1500a3(0x147)]>0x0;_0x519bc3&&(console['log'](_0x1500a3(0x192)+formatCountSummary(_0xcd4054[_0x1500a3(0x1c3)][_0x1500a3(0x188)])),console[_0x1500a3(0x15a)](_0x1500a3(0x144)+formatCountSummary(_0xcd4054[_0x1500a3(0x1c3)][_0x1500a3(0x1cc)])));console['log'](_0x1500a3(0x1ab)+a4_0x4fff68[_0x1500a3(0x1dc)](_0xcd4054[_0x1500a3(0x167)])),displayDiffs(_0xcd4054['agents'],_0xcd4054[_0x1500a3(0x1d8)],_0xcd4054[_0x1500a3(0x1c5)],_0xcd4054['prompts'],_0xcd4054[_0x1500a3(0x183)],_0xcd4054['experimentalKnowledgeBases'],_0xcd4054[_0x1500a3(0x1cc)]);if(_0x47688d)return console[_0x1500a3(0x15a)](a4_0x4fff68[_0x1500a3(0x1ae)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x461dd2===0x0&&_0x4abb9e===0x0)return console[_0x1500a3(0x15a)](a4_0x4fff68[_0x1500a3(0x174)](_0x1500a3(0x19e))),saveSessionContext({'llm_project':_0xcd4054[_0x1500a3(0x12a)]},_0x4d9808[_0x1500a3(0x155)]),console[_0x1500a3(0x15a)](a4_0x4fff68[_0x1500a3(0x174)]('✔\x20Context\x20set:\x20'+a4_0x4fff68[_0x1500a3(0x199)](_0x1500a3(0x1ca))+_0x1500a3(0x172)+a4_0x4fff68[_0x1500a3(0x1dc)](_0xcd4054['projectName']))),0x0;if(!_0x2c9e21&&!_0x2ca510){if(!isInteractive())return console[_0x1500a3(0x1de)](a4_0x4fff68[_0x1500a3(0x134)](_0x1500a3(0x164)),_0x1500a3(0x131)),console[_0x1500a3(0x1de)](a4_0x4fff68[_0x1500a3(0x199)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2b844a=await confirmKey(_0x1500a3(0x143)+(_0x461dd2+_0x4abb9e)+_0x1500a3(0x13e));if(!_0x2b844a)return console[_0x1500a3(0x15a)](a4_0x4fff68['yellow']('Cancelled'),_0x1500a3(0x165)),0x1;}const {data:_0x11a049}=await withSpinner(_0x1500a3(0x1be),()=>_0x47b749[_0x1500a3(0x194)][_0x1500a3(0x1c8)](_0x16395c,_0x57aca9,{'force':_0x2ca510}));return console['log'](a4_0x4fff68[_0x1500a3(0x174)](_0x1500a3(0x159)+(_0x461dd2+_0x4abb9e)+_0x1500a3(0x15b)+_0x11a049[_0x1500a3(0x167)])),saveSessionContext({'llm_project':_0x11a049['projectName']},_0x4d9808[_0x1500a3(0x155)]),console[_0x1500a3(0x15a)](a4_0x4fff68[_0x1500a3(0x174)](_0x1500a3(0x1b8)+a4_0x4fff68[_0x1500a3(0x199)](_0x1500a3(0x1ca))+_0x1500a3(0x172)+a4_0x4fff68[_0x1500a3(0x1dc)](_0x11a049[_0x1500a3(0x12a)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x2c3b5c(0x137)]=a4_0x2c3b5c(0x1b6);[a4_0x2c3b5c(0x18f)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async['execute'](_0x20f75a){const _0x4eb52d=a4_0x2c3b5c,{options:_0x469c32,args:_0x582c68,tdx:_0x15bd29}=_0x20f75a,_0x3e746d=_0x582c68[0x0],_0x2c7767=_0x469c32['name'],_0x41fc1e=_0x469c32['dryRun'],_0xd02c67=_0x469c32[_0x4eb52d(0x1dd)],_0x53b54c=_0x469c32[_0x4eb52d(0x177)],_0x30bef5=_0x469c32['llmProject'];let _0x3f540f;const _0xc149d=findAgentConfigPath(process['cwd']());if(_0x3e746d){const _0x591da8=a4_0x5d88db[_0x4eb52d(0x17f)](_0x3e746d,_0x4eb52d(0x19d));existsSync(_0x591da8)?(_0x3f540f=_0x3e746d,console[_0x4eb52d(0x15a)](a4_0x4fff68['dim']('Using\x20local\x20project:\x20'+_0x3e746d))):_0x3f540f=_0x3e746d;}else{if(_0xc149d)_0x3f540f=a4_0x5d88db['dirname'](_0xc149d),console['log'](a4_0x4fff68[_0x4eb52d(0x199)]('Using\x20current\x20project:\x20'+_0x3f540f));else{if(_0x30bef5){const _0x373aed=sanitizeForFilesystem(_0x30bef5);let _0x3e60cd=_0x373aed,_0x4e5ce8=a4_0x5d88db[_0x4eb52d(0x17f)](process[_0x4eb52d(0x1a5)](),_0x4eb52d(0x169),_0x373aed,_0x4eb52d(0x19d));if(!existsSync(_0x4e5ce8)){const _0x3fe380=normalizeName(_0x30bef5),_0x1a0660=a4_0x5d88db['join'](process[_0x4eb52d(0x1a5)](),'agents',_0x3fe380,_0x4eb52d(0x19d));existsSync(_0x1a0660)&&(_0x3e60cd=_0x3fe380,_0x4e5ce8=_0x1a0660);}if(existsSync(_0x4e5ce8))_0x3f540f=a4_0x5d88db[_0x4eb52d(0x1db)](_0x4e5ce8),console['log'](a4_0x4fff68[_0x4eb52d(0x199)](_0x4eb52d(0x17e)+_0x3f540f));else{const _0x49e872=_0x469c32[_0x4eb52d(0x15f)];if(_0x49e872)throw new SDKError(ErrorCode[_0x4eb52d(0x1cb)],_0x4eb52d(0x196)+_0x30bef5+_0x4eb52d(0x14d),undefined,{'helpText':_0x4eb52d(0x186)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+('\x20\x20tdx\x20agent\x20pull\x20'+_0x30bef5+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x3e60cd+_0x4eb52d(0x163)+(_0x2c7767||_0x4eb52d(0x1d9))+_0x4eb52d(0x1bf)+_0x49e872)});_0x3f540f=_0x30bef5,console['log'](a4_0x4fff68['dim'](_0x4eb52d(0x13d)+_0x30bef5));}}}}if(!_0x3f540f)return console['log'](a4_0x4fff68['yellow'](_0x4eb52d(0x16a))),console['log']('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log'](_0x4eb52d(0x129)),console[_0x4eb52d(0x15a)](_0x4eb52d(0x1b2)),console[_0x4eb52d(0x15a)](_0x4eb52d(0x1a2)),0x1;if(!_0x2c7767)throw new SDKError(ErrorCode[_0x4eb52d(0x157)],_0x4eb52d(0x12e),undefined,{'helpText':_0x4eb52d(0x18a)});if(!_0xd02c67&&!_0x41fc1e){if(!isInteractive())return console[_0x4eb52d(0x1de)](a4_0x4fff68[_0x4eb52d(0x134)](_0x4eb52d(0x164)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x4fff68['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4eac71=await confirmKey('Clone\x20\x22'+_0x3f540f+'\x22\x20to\x20new\x20project\x20\x22'+_0x2c7767+'\x22?');if(!_0x4eac71)return console[_0x4eb52d(0x15a)](a4_0x4fff68['yellow'](_0x4eb52d(0x1a3))),0x1;}const {data:_0x26ceab}=await withSpinner(_0x4eb52d(0x162)+_0x3f540f+'\x22\x20to\x20\x22'+_0x2c7767+_0x4eb52d(0x1a9),()=>_0x15bd29[_0x4eb52d(0x194)][_0x4eb52d(0x15c)](_0x3f540f,_0x2c7767,{'dryRun':_0x41fc1e}));if(_0x41fc1e){console[_0x4eb52d(0x15a)](a4_0x4fff68[_0x4eb52d(0x1ae)](_0x4eb52d(0x166))),console['log'](_0x4eb52d(0x1b3)+_0x26ceab['sourceProjectName']),console[_0x4eb52d(0x15a)](_0x4eb52d(0x1d0)+_0x2c7767),console[_0x4eb52d(0x15a)](_0x4eb52d(0x1b0)),console[_0x4eb52d(0x15a)](_0x4eb52d(0x12f)+_0x26ceab['counts']['agents'][_0x4eb52d(0x1a1)]),console[_0x4eb52d(0x15a)](_0x4eb52d(0x197)+_0x26ceab[_0x4eb52d(0x1c3)][_0x4eb52d(0x1d8)][_0x4eb52d(0x1a1)]),console[_0x4eb52d(0x15a)](_0x4eb52d(0x170)+_0x26ceab['counts'][_0x4eb52d(0x16f)][_0x4eb52d(0x1a1)]);const _0x24eaaa=_0x26ceab[_0x4eb52d(0x1c3)][_0x4eb52d(0x188)][_0x4eb52d(0x1a1)]>0x0||_0x26ceab[_0x4eb52d(0x1c3)]['experimentalArtifacts']['created']>0x0;return _0x24eaaa&&(console[_0x4eb52d(0x15a)](_0x4eb52d(0x192)+_0x26ceab[_0x4eb52d(0x1c3)][_0x4eb52d(0x188)][_0x4eb52d(0x1a1)]),console['log'](_0x4eb52d(0x144)+_0x26ceab[_0x4eb52d(0x1c3)][_0x4eb52d(0x1cc)][_0x4eb52d(0x1a1)])),0x0;}const _0x3f9711=_0x26ceab[_0x4eb52d(0x1c3)][_0x4eb52d(0x169)][_0x4eb52d(0x1b5)]>0x0||_0x26ceab[_0x4eb52d(0x1c3)][_0x4eb52d(0x1d8)][_0x4eb52d(0x1b5)]>0x0||_0x26ceab[_0x4eb52d(0x1c3)][_0x4eb52d(0x16f)]['errors']>0x0||_0x26ceab[_0x4eb52d(0x1c3)][_0x4eb52d(0x188)][_0x4eb52d(0x1b5)]>0x0||_0x26ceab['counts']['experimentalArtifacts']['errors']>0x0;_0x3f9711?console[_0x4eb52d(0x15a)](a4_0x4fff68[_0x4eb52d(0x1ae)](_0x4eb52d(0x1a6))):console['log'](a4_0x4fff68[_0x4eb52d(0x174)](_0x4eb52d(0x1d7)));console[_0x4eb52d(0x15a)](_0x4eb52d(0x1b3)+_0x26ceab[_0x4eb52d(0x130)]),console['log']('New\x20project:\x20'+_0x26ceab[_0x4eb52d(0x1a4)]),console[_0x4eb52d(0x15a)](_0x4eb52d(0x1d3)+_0x26ceab[_0x4eb52d(0x1c0)]),console[_0x4eb52d(0x15a)](),console[_0x4eb52d(0x15a)](_0x4eb52d(0x189)),console[_0x4eb52d(0x15a)]('\x20\x20Agents:\x20'+formatCountSummary(_0x26ceab[_0x4eb52d(0x1c3)][_0x4eb52d(0x169)])),console[_0x4eb52d(0x15a)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x26ceab[_0x4eb52d(0x1c3)][_0x4eb52d(0x1d8)])),console[_0x4eb52d(0x15a)](_0x4eb52d(0x170)+formatCountSummary(_0x26ceab[_0x4eb52d(0x1c3)]['prompts'])),console[_0x4eb52d(0x15a)](_0x4eb52d(0x132)+formatCountSummary(_0x26ceab[_0x4eb52d(0x1c3)][_0x4eb52d(0x183)]));const _0x1d2504=_0x26ceab[_0x4eb52d(0x1c3)][_0x4eb52d(0x188)][_0x4eb52d(0x1a1)]>0x0||_0x26ceab[_0x4eb52d(0x1c3)][_0x4eb52d(0x188)][_0x4eb52d(0x191)]>0x0||_0x26ceab['counts']['experimentalKnowledgeBases'][_0x4eb52d(0x187)]>0x0||_0x26ceab[_0x4eb52d(0x1c3)][_0x4eb52d(0x1cc)][_0x4eb52d(0x1a1)]>0x0||_0x26ceab['counts'][_0x4eb52d(0x1cc)][_0x4eb52d(0x191)]>0x0||_0x26ceab[_0x4eb52d(0x1c3)][_0x4eb52d(0x1cc)][_0x4eb52d(0x187)]>0x0;_0x1d2504&&(console[_0x4eb52d(0x15a)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x26ceab[_0x4eb52d(0x1c3)][_0x4eb52d(0x188)])),console[_0x4eb52d(0x15a)](_0x4eb52d(0x144)+formatCountSummary(_0x26ceab[_0x4eb52d(0x1c3)]['experimentalArtifacts'])));if(_0x3f9711){console[_0x4eb52d(0x15a)](),console[_0x4eb52d(0x15a)](a4_0x4fff68[_0x4eb52d(0x134)]('Errors:'));for(const _0xa2a7b3 of _0x26ceab[_0x4eb52d(0x169)]){_0xa2a7b3[_0x4eb52d(0x16d)]===_0x4eb52d(0x1de)&&console['log'](a4_0x4fff68[_0x4eb52d(0x134)]('\x20\x20Agent\x20\x22'+_0xa2a7b3[_0x4eb52d(0x1c2)]+'\x22:\x20'+_0xa2a7b3[_0x4eb52d(0x1de)]));}for(const _0x9b67a8 of _0x26ceab[_0x4eb52d(0x1d8)]){_0x9b67a8['action']===_0x4eb52d(0x1de)&&console[_0x4eb52d(0x15a)](a4_0x4fff68[_0x4eb52d(0x134)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x9b67a8[_0x4eb52d(0x137)]+_0x4eb52d(0x1af)+_0x9b67a8[_0x4eb52d(0x1de)]));}for(const _0x24cfaa of _0x26ceab[_0x4eb52d(0x16f)]){_0x24cfaa[_0x4eb52d(0x16d)]===_0x4eb52d(0x1de)&&console[_0x4eb52d(0x15a)](a4_0x4fff68[_0x4eb52d(0x134)](_0x4eb52d(0x1da)+_0x24cfaa[_0x4eb52d(0x137)]+_0x4eb52d(0x1af)+_0x24cfaa[_0x4eb52d(0x1de)]));}for(const _0x4fabfe of _0x26ceab[_0x4eb52d(0x183)]){_0x4fabfe[_0x4eb52d(0x16d)]===_0x4eb52d(0x1de)&&console[_0x4eb52d(0x15a)](a4_0x4fff68[_0x4eb52d(0x134)](_0x4eb52d(0x14b)+_0x4fabfe['name']+_0x4eb52d(0x1af)+_0x4fabfe['error']));}for(const _0x8ab0ba of _0x26ceab[_0x4eb52d(0x188)]){_0x8ab0ba[_0x4eb52d(0x16d)]===_0x4eb52d(0x1de)&&console['log'](a4_0x4fff68[_0x4eb52d(0x134)](_0x4eb52d(0x19a)+_0x8ab0ba['name']+'\x22:\x20'+_0x8ab0ba[_0x4eb52d(0x1de)]));}for(const _0x18fda7 of _0x26ceab[_0x4eb52d(0x1cc)]){_0x18fda7[_0x4eb52d(0x16d)]===_0x4eb52d(0x1de)&&console[_0x4eb52d(0x15a)](a4_0x4fff68['red'](_0x4eb52d(0x1ce)+_0x18fda7['name']+_0x4eb52d(0x1af)+_0x18fda7[_0x4eb52d(0x1de)]));}return 0x1;}console[_0x4eb52d(0x15a)]();const _0x53744d=getLLMProjectUrl(_0x53b54c,_0x26ceab['newProjectId']);return console[_0x4eb52d(0x15a)](_0x4eb52d(0x1b1)+a4_0x4fff68[_0x4eb52d(0x1dc)](_0x53744d)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x2c3b5c(0x137)]=a4_0x2c3b5c(0x19b);[a4_0x2c3b5c(0x18f)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x2c3b5c(0x152)](_0x1d6707){const _0x4797a8=a4_0x2c3b5c,{options:_0x5bbca3,args:_0x4f8a52,tdx:_0x28dc17}=_0x1d6707;let _0x519c66=_0x4f8a52[0x0]||process[_0x4797a8(0x1a5)]();const _0x24a3f2=_0x5bbca3[_0x4797a8(0x158)],_0x4aa7f3=_0x5bbca3[_0x4797a8(0x161)],_0x3bade8=_0x5bbca3[_0x4797a8(0x1dd)],_0x475966=_0x5bbca3['site'],_0x4209cf=a4_0x5d88db[_0x4797a8(0x17f)](_0x519c66,_0x4797a8(0x14a)),_0x1d1c2c=existsSync(_0x4209cf);if(_0x1d1c2c){const {data:_0x199e70}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x519c66+_0x4797a8(0x1a9),()=>_0x28dc17[_0x4797a8(0x194)]['pushAgent'](_0x519c66,{'dryRun':_0x24a3f2,'force':_0x4aa7f3}));if(_0x24a3f2)return console[_0x4797a8(0x15a)](a4_0x4fff68[_0x4797a8(0x1ae)](_0x4797a8(0x166))),console[_0x4797a8(0x15a)](_0x4797a8(0x1d6)+_0x199e70[_0x4797a8(0x1c2)]),0x0;if(_0x199e70['action']===_0x4797a8(0x1de))return console['log'](a4_0x4fff68['red'](_0x4797a8(0x1c6)+_0x199e70['error'])),0x1;console[_0x4797a8(0x15a)](a4_0x4fff68[_0x4797a8(0x174)](_0x4797a8(0x168)+_0x199e70[_0x4797a8(0x16d)]+_0x4797a8(0x1a7))),console[_0x4797a8(0x15a)](_0x4797a8(0x138)+_0x199e70[_0x4797a8(0x1c2)]);if(_0x199e70[_0x4797a8(0x18c)]&&_0x199e70[_0x4797a8(0x1b7)]){const _0xeed1f5=getLLMAgentChatUrl(_0x475966,_0x199e70[_0x4797a8(0x1b7)],_0x199e70[_0x4797a8(0x18c)]);console[_0x4797a8(0x15a)](_0x4797a8(0x140)+a4_0x4fff68['cyan'](_0xeed1f5));}return 0x0;}const _0x44f6ea=_0x5bbca3[_0x4797a8(0x179)],_0x1eddd6=resolveProjectFromContext(_0x519c66,_0x44f6ea);if(_0x1eddd6['found'])_0x519c66=_0x1eddd6['projectDir'],_0x1eddd6['source']===_0x4797a8(0x1c7)&&console[_0x4797a8(0x15a)](a4_0x4fff68[_0x4797a8(0x199)](_0x4797a8(0x1cd)+_0x519c66));else{let _0x2428c2=_0x4797a8(0x1a8);_0x1eddd6[_0x4797a8(0x17c)]===_0x4797a8(0x16e)&&(_0x2428c2=_0x1eddd6[_0x4797a8(0x18d)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x1eddd6[_0x4797a8(0x179)]+_0x4797a8(0x1c1));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1eddd6[_0x4797a8(0x17c)]===_0x4797a8(0x178)?_0x1eddd6[_0x4797a8(0x18d)]:_0x4797a8(0x19f)+_0x519c66,undefined,{'helpText':_0x2428c2});}const {data:_0x3d0e83}=await withSpinner(_0x4797a8(0x182),()=>_0x28dc17[_0x4797a8(0x194)][_0x4797a8(0x1cf)](_0x519c66,{'dryRun':!![]})),_0x50a123=_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x169)][_0x4797a8(0x1b5)]>0x0;if(_0x50a123){console[_0x4797a8(0x15a)](a4_0x4fff68['red'](_0x4797a8(0x193)));for(const _0x37d1f7 of _0x3d0e83[_0x4797a8(0x169)]){_0x37d1f7[_0x4797a8(0x16d)]===_0x4797a8(0x1de)&&console['log'](a4_0x4fff68[_0x4797a8(0x134)](_0x4797a8(0x190)+_0x37d1f7[_0x4797a8(0x1c2)]+_0x4797a8(0x1af)+_0x37d1f7[_0x4797a8(0x1de)]));}return 0x1;}const _0x17527b=_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x169)][_0x4797a8(0x1a1)]+_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x1d8)][_0x4797a8(0x1a1)]+_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x1c5)]['created']+_0x3d0e83['counts'][_0x4797a8(0x16f)][_0x4797a8(0x1a1)]+_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x183)][_0x4797a8(0x1a1)]+_0x3d0e83[_0x4797a8(0x1c3)]['experimentalKnowledgeBases'][_0x4797a8(0x1a1)]+_0x3d0e83[_0x4797a8(0x1c3)]['experimentalArtifacts']['created'],_0x3a4eba=_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x169)][_0x4797a8(0x191)]+_0x3d0e83['counts'][_0x4797a8(0x1d8)]['updated']+_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x1c5)][_0x4797a8(0x191)]+_0x3d0e83[_0x4797a8(0x1c3)]['prompts'][_0x4797a8(0x191)]+_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x183)]['updated']+_0x3d0e83['counts'][_0x4797a8(0x188)][_0x4797a8(0x191)]+_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x1cc)][_0x4797a8(0x191)],_0x45f6ce=_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x169)][_0x4797a8(0x187)]+_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x1d8)][_0x4797a8(0x187)]+_0x3d0e83[_0x4797a8(0x1c3)]['textKnowledgeBases'][_0x4797a8(0x187)]+_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x16f)]['unchanged']+_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x183)][_0x4797a8(0x187)]+_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x188)][_0x4797a8(0x187)]+_0x3d0e83['counts'][_0x4797a8(0x1cc)][_0x4797a8(0x187)];console[_0x4797a8(0x15a)](_0x4797a8(0x1ac)+_0x3d0e83[_0x4797a8(0x12a)]+'\x27:'),console['log']('\x20\x20'+a4_0x4fff68['green']('+\x20'+_0x17527b+_0x4797a8(0x1ba))+_0x4797a8(0x160)+a4_0x4fff68[_0x4797a8(0x1ae)]('~\x20'+_0x3a4eba+_0x4797a8(0x1b4))+_0x4797a8(0x160)+a4_0x4fff68[_0x4797a8(0x199)]('=\x20'+_0x45f6ce+'\x20unchanged')),console[_0x4797a8(0x15a)](_0x4797a8(0x12f)+formatCountSummary(_0x3d0e83['counts']['agents'])),console[_0x4797a8(0x15a)](_0x4797a8(0x197)+formatCountSummary(_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x1d8)])),console[_0x4797a8(0x15a)](_0x4797a8(0x1bd)+formatCountSummary(_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x1c5)])),console[_0x4797a8(0x15a)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x16f)])),console[_0x4797a8(0x15a)](_0x4797a8(0x132)+formatCountSummary(_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x183)]));const _0x19aea4=_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x188)]['created']>0x0||_0x3d0e83[_0x4797a8(0x1c3)]['experimentalKnowledgeBases'][_0x4797a8(0x191)]>0x0||_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x188)][_0x4797a8(0x187)]>0x0||_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x1cc)][_0x4797a8(0x1a1)]>0x0||_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x1cc)]['updated']>0x0||_0x3d0e83[_0x4797a8(0x1c3)]['experimentalArtifacts'][_0x4797a8(0x187)]>0x0;_0x19aea4&&(console[_0x4797a8(0x15a)](_0x4797a8(0x192)+formatCountSummary(_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x188)])),console[_0x4797a8(0x15a)](_0x4797a8(0x144)+formatCountSummary(_0x3d0e83[_0x4797a8(0x1c3)][_0x4797a8(0x1cc)])));console['log']('\x20\x20Source:\x20'+a4_0x4fff68[_0x4797a8(0x1dc)](_0x519c66)),displayDiffs(_0x3d0e83['agents'],_0x3d0e83[_0x4797a8(0x1d8)],_0x3d0e83['textKnowledgeBases'],_0x3d0e83[_0x4797a8(0x16f)],_0x3d0e83[_0x4797a8(0x183)],_0x3d0e83['experimentalKnowledgeBases'],_0x3d0e83[_0x4797a8(0x1cc)]);if(_0x24a3f2)return console['log'](a4_0x4fff68[_0x4797a8(0x1ae)](_0x4797a8(0x19c))),0x0;if(_0x17527b===0x0&&_0x3a4eba===0x0){console['log'](a4_0x4fff68['green']('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x489be5=getLLMProjectUrl(_0x475966,_0x3d0e83[_0x4797a8(0x1b7)]);return console['log'](_0x4797a8(0x1b1)+a4_0x4fff68['cyan'](_0x489be5)),0x0;}if(!_0x3bade8&&!_0x4aa7f3){if(!isInteractive())return console[_0x4797a8(0x1de)](a4_0x4fff68[_0x4797a8(0x134)](_0x4797a8(0x164)),_0x4797a8(0x131)),console[_0x4797a8(0x1de)](a4_0x4fff68[_0x4797a8(0x199)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xb6e3a9=await confirmKey(_0x4797a8(0x14e)+(_0x17527b+_0x3a4eba)+_0x4797a8(0x14c));if(!_0xb6e3a9)return console[_0x4797a8(0x15a)](a4_0x4fff68[_0x4797a8(0x1ae)](_0x4797a8(0x1a3)),_0x4797a8(0x13a)),0x1;}const {data:_0xcc6353}=await withSpinner(_0x4797a8(0x184),()=>_0x28dc17[_0x4797a8(0x194)][_0x4797a8(0x1cf)](_0x519c66,{'force':_0x4aa7f3})),_0x36cf8b=_0xcc6353[_0x4797a8(0x1c3)][_0x4797a8(0x169)]['errors']>0x0||_0xcc6353[_0x4797a8(0x1c3)][_0x4797a8(0x1d8)][_0x4797a8(0x1b5)]>0x0||_0xcc6353[_0x4797a8(0x1c3)]['textKnowledgeBases'][_0x4797a8(0x1b5)]>0x0||_0xcc6353[_0x4797a8(0x1c3)][_0x4797a8(0x16f)][_0x4797a8(0x1b5)]>0x0;if(_0x36cf8b){console[_0x4797a8(0x15a)](a4_0x4fff68[_0x4797a8(0x1ae)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x4797a8(0x15a)](),console[_0x4797a8(0x15a)](a4_0x4fff68[_0x4797a8(0x134)](_0x4797a8(0x15e)));for(const _0x4ae449 of _0xcc6353['agents']){_0x4ae449[_0x4797a8(0x16d)]===_0x4797a8(0x1de)&&console[_0x4797a8(0x15a)](a4_0x4fff68[_0x4797a8(0x134)](_0x4797a8(0x190)+_0x4ae449[_0x4797a8(0x1c2)]+_0x4797a8(0x1af)+_0x4ae449[_0x4797a8(0x1de)]));}for(const _0x3718ef of _0xcc6353[_0x4797a8(0x1d8)]){_0x3718ef[_0x4797a8(0x16d)]===_0x4797a8(0x1de)&&console[_0x4797a8(0x15a)](a4_0x4fff68[_0x4797a8(0x134)](_0x4797a8(0x17a)+_0x3718ef[_0x4797a8(0x137)]+_0x4797a8(0x1af)+_0x3718ef[_0x4797a8(0x1de)]));}for(const _0x13ad28 of _0xcc6353[_0x4797a8(0x1c5)]){_0x13ad28[_0x4797a8(0x16d)]===_0x4797a8(0x1de)&&console[_0x4797a8(0x15a)](a4_0x4fff68[_0x4797a8(0x134)](_0x4797a8(0x142)+_0x13ad28[_0x4797a8(0x137)]+'\x22:\x20'+_0x13ad28['error']));}for(const _0x18d4c3 of _0xcc6353[_0x4797a8(0x16f)]){_0x18d4c3['action']===_0x4797a8(0x1de)&&console[_0x4797a8(0x15a)](a4_0x4fff68[_0x4797a8(0x134)](_0x4797a8(0x1da)+_0x18d4c3[_0x4797a8(0x137)]+_0x4797a8(0x1af)+_0x18d4c3[_0x4797a8(0x1de)]));}for(const _0x3338bc of _0xcc6353['integrations']){_0x3338bc[_0x4797a8(0x16d)]===_0x4797a8(0x1de)&&console['log'](a4_0x4fff68['red']('\x20\x20Integration\x20\x22'+_0x3338bc[_0x4797a8(0x137)]+_0x4797a8(0x1af)+_0x3338bc[_0x4797a8(0x1de)]));}return 0x1;}console['log'](a4_0x4fff68['green'](_0x4797a8(0x135)+(_0x17527b+_0x3a4eba)+_0x4797a8(0x15d)+_0xcc6353[_0x4797a8(0x12a)]+'\x27'));const _0x50a5e7=getLLMProjectUrl(_0x475966,_0xcc6353['projectId']);return console[_0x4797a8(0x15a)](_0x4797a8(0x1b1)+a4_0x4fff68[_0x4797a8(0x1dc)](_0x50a5e7)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x43cf6d=a5_0x2b73;(function(_0x2bb80c,_0x41de4c){const _0x4b5040=a5_0x2b73,_0x44b7cd=_0x2bb80c();while(!![]){try{const _0x2b6630=parseInt(_0x4b5040(0x1f7))/0x1*(parseInt(_0x4b5040(0x24b))/0x2)+parseInt(_0x4b5040(0x21e))/0x3+-parseInt(_0x4b5040(0x20c))/0x4*(parseInt(_0x4b5040(0x232))/0x5)+parseInt(_0x4b5040(0x236))/0x6*(parseInt(_0x4b5040(0x1fe))/0x7)+-parseInt(_0x4b5040(0x220))/0x8+parseInt(_0x4b5040(0x20d))/0x9*(-parseInt(_0x4b5040(0x243))/0xa)+parseInt(_0x4b5040(0x24f))/0xb;if(_0x2b6630===_0x41de4c)break;else _0x44b7cd['push'](_0x44b7cd['shift']());}catch(_0x4df587){_0x44b7cd['push'](_0x44b7cd['shift']());}}}(a5_0x107a,0x45545));function a5_0x2b73(_0x2e34ab,_0x50564f){_0x2e34ab=_0x2e34ab-0x1e8;const _0x107a46=a5_0x107a();let _0x2b7376=_0x107a46[_0x2e34ab];return _0x2b7376;}import*as a5_0x3b077d from'node:fs';import*as a5_0xd16ea0 from'node:path';import a5_0x59452f from'chalk';import{BaseCommand}from'./command.js';function a5_0x107a(){const _0x57f8a6=['source','resolveProjectId','Using\x20agent:\x20','toLowerCase','Available\x20tags:\x20','round','Passed:\x20\x20\x20','map','Output\x20written\x20to:\x20',':\x20Sending\x20user\x20input...','PASS','isSpinning','verbose','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','output','cyan','\x20\x20Project:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','tsv','projectDir','Running:\x20','white','ERROR','Running\x20test:\x20','agentName','timestamp','llm','projectName','\x20\x20Conversation:\x20','104olYtJb','add','Executing\x20new\x20tests...','executeReeval','dim','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','utf-8','14BEpFMg','table','Re-evaluating\x20cached\x20test\x20run...','repeat','\x20\x20Site:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','agent','Total:\x20\x20\x20\x20','site','red','\x27\x20to\x20create\x20the\x20folder\x20structure.','eval','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','⚠\x20SKIPPED:\x20','28tfSJvE','3152853AWcFvY','No\x20tests\x20have\x20tags\x20defined.','...','log','conversations','filter','Site:\x20','✗\x20FAIL:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Test\x20','Project\x20path:\x20','find','\x20-\x20','name','reason','✓\x20PASS:\x20','Agent:\x20','1263060nxijUu','✗\x20ERROR:\x20','1848536VcZPTH','writeFileSync','test.yml','no_context','Evaluating\x20response...','yellow','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','includes','some','\x20(cached)','not\x20found','rounds','Running\x20agent\x20tests...','tags','Test\x20Summary','\x20\x20Evaluating...\x20','agentDirs','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','170215gXzKWz','json','join','Error\x20writing\x20output\x20file:\x20','79410YrvJeA','message','Failed\x20Tests:','Conversation\x20URL:\x20','no_tests','has','split','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','FAIL','start','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','10BhjFwS','execute','llmProject','/<agent-name>','green','forEach','testYmlPath','toISOString','5700kfsqSS','existsSync','Either\x20switch\x20to\x20the\x20\x22','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','3957448NatSYu','Test\x20Configuration:','Usage:','\x20\x20Round\x20','conversation_url','Re-evaluating\x20','size','push','Cached\x20run\x20from:\x20','context','description','jsonl','Run\x20\x27tdx\x20agent\x20pull\x20','no_local_folder','Round\x20','\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)','trim','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','resolveAgentId','404','...\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','stop','substring','New\x20tests\x20to\x20execute:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','found','status','Failed:\x20\x20\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','text','Errors:\x20\x20\x20','\x20\x20-\x20','Tests\x20found:\x20','now','\x22:\x20','\x20(new)','Duration:\x20','tests'];a5_0x107a=function(){return _0x57f8a6;};return a5_0x107a();}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{['name']='agent:test';[a5_0x43cf6d(0x259)]=a5_0x43cf6d(0x269);async[a5_0x43cf6d(0x244)](_0x724fe9){const _0x5000e3=a5_0x43cf6d,{options:_0x4d8132,args:_0x557c31,tdx:_0x27d87e}=_0x724fe9,_0x4d859f=_0x557c31[0x0]||'.',_0x58c51c=_0x4d8132['dryRun'],_0x1cffb8=_0x4d8132,_0x30c026=_0x1cffb8[_0x5000e3(0x209)]===![],_0x27f192=_0x1cffb8['reeval'],_0xa0c75b=_0x1cffb8[_0x5000e3(0x21a)],_0x157ec0=_0x1cffb8[_0x5000e3(0x22d)],_0x447029=_0x4d8132[_0x5000e3(0x206)],_0x136d89=_0x1cffb8[_0x5000e3(0x1e8)];if(_0x27f192&&_0x30c026)return console[_0x5000e3(0x210)](a5_0x59452f[_0x5000e3(0x207)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x48d63b='table';if(_0x1cffb8['json'])_0x48d63b=_0x5000e3(0x233);else{if(_0x1cffb8['jsonl'])_0x48d63b=_0x5000e3(0x25a);else{if(_0x1cffb8[_0x5000e3(0x1ec)])_0x48d63b=_0x5000e3(0x1ec);else{if(_0x1cffb8[_0x5000e3(0x1ff)])_0x48d63b=_0x5000e3(0x1ff);}}}const _0x429c62=_0x1cffb8['llmProject'];let _0xf6e230=_0x4d859f;const _0xca95e=a5_0x3b077d[_0x5000e3(0x24c)](_0x4d859f),_0x19fbe4=_0x4d859f==='.';if(!_0xca95e||_0x19fbe4){const _0x311934=resolveProjectFromContext(_0x4d859f,_0x429c62,{'requireFile':_0x5000e3(0x222)});if(_0x311934[_0x5000e3(0x26a)])_0xf6e230=_0x311934[_0x5000e3(0x1ed)],_0x311934[_0x5000e3(0x277)]===_0x5000e3(0x258)&&console['log'](a5_0x59452f[_0x5000e3(0x1fb)](_0x5000e3(0x279)+_0xf6e230));else switch(_0x311934[_0x5000e3(0x21b)]){case _0x5000e3(0x223):console[_0x5000e3(0x210)](a5_0x59452f['yellow'](_0x311934[_0x5000e3(0x237)])),console['log'](),console[_0x5000e3(0x210)](_0x5000e3(0x251)),console[_0x5000e3(0x210)](_0x5000e3(0x261)),console['log'](_0x5000e3(0x25e)),console[_0x5000e3(0x210)](),console[_0x5000e3(0x210)](_0x5000e3(0x20a));return 0x1;case _0x5000e3(0x25c):console[_0x5000e3(0x210)](a5_0x59452f[_0x5000e3(0x225)](_0x311934[_0x5000e3(0x237)])),console[_0x5000e3(0x210)](),console[_0x5000e3(0x210)](_0x5000e3(0x25b)+_0x311934[_0x5000e3(0x245)]+_0x5000e3(0x208));return 0x1;case'multiple_agents':{const _0x50eab3=a5_0xd16ea0['basename'](_0x311934['projectDir']);console['log'](a5_0x59452f[_0x5000e3(0x225)](_0x5000e3(0x231)+_0x311934[_0x5000e3(0x245)]+'\x22:'));for(const _0x326a9e of _0x311934[_0x5000e3(0x230)]){console[_0x5000e3(0x210)](_0x5000e3(0x270)+_0x326a9e);}return console['log'](),console[_0x5000e3(0x210)](_0x5000e3(0x284)+_0x50eab3+_0x5000e3(0x246)),0x1;}case _0x5000e3(0x23a):console[_0x5000e3(0x210)](a5_0x59452f[_0x5000e3(0x225)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x311934[_0x5000e3(0x245)]+'\x22.')),console[_0x5000e3(0x210)](a5_0x59452f[_0x5000e3(0x1fb)](_0x5000e3(0x217)+_0x311934[_0x5000e3(0x1ed)])),console['log'](),console[_0x5000e3(0x210)](_0x5000e3(0x226));return 0x1;}}const {definition:_0x5e3e68,agentInfo:_0x4d702f}=parseTestFile(_0xf6e230);let _0x3f4feb=_0x5e3e68['tests'];if(_0xa0c75b){const _0x47221d=_0xa0c75b[_0x5000e3(0x23c)](',')[_0x5000e3(0x27e)](_0x894ff4=>_0x894ff4[_0x5000e3(0x25f)]());_0x3f4feb=_0x5e3e68[_0x5000e3(0x276)]['filter'](_0x21987f=>_0x47221d[_0x5000e3(0x227)](_0x21987f[_0x5000e3(0x21a)]));if(_0x3f4feb[_0x5000e3(0x260)]===0x0)return console[_0x5000e3(0x210)](a5_0x59452f[_0x5000e3(0x225)]('No\x20tests\x20found\x20matching:\x20'+_0xa0c75b)),console[_0x5000e3(0x210)](a5_0x59452f[_0x5000e3(0x1fb)]('Available\x20tests:\x20'+_0x5e3e68[_0x5000e3(0x276)][_0x5000e3(0x27e)](_0x4ba405=>_0x4ba405[_0x5000e3(0x21a)])['join'](',\x20'))),0x1;}if(_0x157ec0){const _0x36a067=_0x157ec0[_0x5000e3(0x23c)](',')[_0x5000e3(0x27e)](_0x556ac4=>_0x556ac4['trim']()[_0x5000e3(0x27a)]());_0x3f4feb=_0x3f4feb[_0x5000e3(0x212)](_0x12c00d=>_0x12c00d['tags']?.[_0x5000e3(0x228)](_0x1de8af=>_0x36a067[_0x5000e3(0x227)](_0x1de8af['toLowerCase']())));if(_0x3f4feb[_0x5000e3(0x260)]===0x0){console[_0x5000e3(0x210)](a5_0x59452f[_0x5000e3(0x225)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x157ec0));const _0xc155d8=new Set();return _0x5e3e68[_0x5000e3(0x276)]['forEach'](_0x30fd0e=>_0x30fd0e['tags']?.[_0x5000e3(0x248)](_0x3e5ba7=>_0xc155d8[_0x5000e3(0x1f8)](_0x3e5ba7))),_0xc155d8[_0x5000e3(0x255)]>0x0?console['log'](a5_0x59452f['dim'](_0x5000e3(0x27b)+[..._0xc155d8][_0x5000e3(0x234)](',\x20'))):console[_0x5000e3(0x210)](a5_0x59452f[_0x5000e3(0x1fb)](_0x5000e3(0x20e))),0x1;}}if(_0x27f192)return this[_0x5000e3(0x1fa)](_0x724fe9,{'definition':{'tests':_0x3f4feb},'agentInfo':_0x4d702f,'outputFormat':_0x48d63b,'outputFile':_0x136d89,'testNames':_0xa0c75b});if(_0x58c51c){console[_0x5000e3(0x210)](a5_0x59452f[_0x5000e3(0x1e9)](_0x5000e3(0x250))),console['log'](_0x5000e3(0x202)+a5_0x59452f[_0x5000e3(0x1ef)](_0x447029)),console[_0x5000e3(0x210)](_0x5000e3(0x1ea)+a5_0x59452f[_0x5000e3(0x1ef)](_0x4d702f[_0x5000e3(0x1f5)])),console[_0x5000e3(0x210)]('\x20\x20Agent:\x20'+a5_0x59452f[_0x5000e3(0x1ef)](_0x4d702f['agentName'])),console['log'](),console[_0x5000e3(0x210)](_0x5000e3(0x271)+a5_0x59452f['white'](_0x3f4feb['length']));for(let _0x46fddb=0x0;_0x46fddb<_0x3f4feb[_0x5000e3(0x260)];_0x46fddb++){const _0x250c7b=_0x3f4feb[_0x46fddb],_0x3172e7=_0x250c7b[_0x5000e3(0x22b)][_0x5000e3(0x260)]===0x1?_0x5000e3(0x27c):_0x5000e3(0x22b),_0x44b237=_0x250c7b[_0x5000e3(0x22d)]?.['length']?'\x20['+_0x250c7b[_0x5000e3(0x22d)][_0x5000e3(0x234)](',\x20')+']':'';console[_0x5000e3(0x210)]('\x20\x20'+(_0x46fddb+0x1)+'.\x20'+a5_0x59452f[_0x5000e3(0x1ef)](_0x250c7b['name'])+'\x20('+_0x250c7b[_0x5000e3(0x22b)][_0x5000e3(0x260)]+'\x20'+_0x3172e7+')'+a5_0x59452f[_0x5000e3(0x1fb)](_0x44b237));}return 0x0;}let _0x5c0b6a,_0x1e4025;try{_0x5c0b6a=await _0x27d87e['llm'][_0x5000e3(0x278)](_0x4d702f[_0x5000e3(0x1f5)]);}catch(_0x2f82a3){const _0x23a0ea=_0x2f82a3 instanceof Error?_0x2f82a3[_0x5000e3(0x237)]:String(_0x2f82a3);return _0x23a0ea[_0x5000e3(0x227)](_0x5000e3(0x263))||_0x23a0ea[_0x5000e3(0x27a)]()[_0x5000e3(0x227)](_0x5000e3(0x22a))?console[_0x5000e3(0x210)](a5_0x59452f[_0x5000e3(0x207)](_0x5000e3(0x26d)+_0x4d702f[_0x5000e3(0x1f5)])):console[_0x5000e3(0x210)](a5_0x59452f[_0x5000e3(0x207)](_0x5000e3(0x203)+_0x4d702f[_0x5000e3(0x1f5)]+'\x22:\x20'+_0x23a0ea)),0x1;}try{_0x1e4025=await _0x27d87e[_0x5000e3(0x1f4)][_0x5000e3(0x262)](_0x4d702f[_0x5000e3(0x1f2)],_0x5c0b6a);}catch(_0x5b1dfb){const _0x3ec407=_0x5b1dfb instanceof Error?_0x5b1dfb[_0x5000e3(0x237)]:String(_0x5b1dfb);return _0x3ec407[_0x5000e3(0x227)]('404')||_0x3ec407[_0x5000e3(0x27a)]()[_0x5000e3(0x227)](_0x5000e3(0x22a))?console[_0x5000e3(0x210)](a5_0x59452f[_0x5000e3(0x207)](_0x5000e3(0x24e)+_0x4d702f[_0x5000e3(0x1f2)])):console['log'](a5_0x59452f['red'](_0x5000e3(0x242)+_0x4d702f[_0x5000e3(0x1f2)]+_0x5000e3(0x273)+_0x3ec407)),0x1;}let _0x26fc9e;if(!_0x30c026)try{_0x26fc9e=await setupEvaluatorAgent(_0x27d87e[_0x5000e3(0x1f4)],_0x4d8132['verbose']);}catch(_0x395021){const _0x4b6128=_0x395021 instanceof Error?_0x395021[_0x5000e3(0x237)]:String(_0x395021);return console['log'](a5_0x59452f['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x4b6128)),0x1;}console[_0x5000e3(0x210)](a5_0x59452f[_0x5000e3(0x1e9)](_0x5000e3(0x22c))),console['log'](_0x5000e3(0x213)+a5_0x59452f[_0x5000e3(0x1ef)](_0x447029)),console['log']('Agent:\x20'+a5_0x59452f[_0x5000e3(0x1ef)](_0x4d702f[_0x5000e3(0x1f5)]+'/'+_0x4d702f[_0x5000e3(0x1f2)])),console[_0x5000e3(0x210)]();const _0x352959=[],_0x592e5c=[],_0x246274=Date[_0x5000e3(0x272)]();for(let _0x47a874=0x0;_0x47a874<_0x3f4feb[_0x5000e3(0x260)];_0x47a874++){const _0x186356=_0x3f4feb[_0x47a874];_0x3f4feb['length']>0x1?console[_0x5000e3(0x210)](_0x5000e3(0x216)+(_0x47a874+0x1)+'/'+_0x3f4feb['length']+':\x20'+a5_0x59452f[_0x5000e3(0x1ef)](_0x186356['name'])):console[_0x5000e3(0x210)](_0x5000e3(0x1f1)+a5_0x59452f['white'](_0x186356[_0x5000e3(0x21a)]));const _0xdf4656=createCommandSpinner('Round\x201/'+_0x186356['rounds'][_0x5000e3(0x260)]+_0x5000e3(0x280));_0xdf4656[_0x5000e3(0x240)]();try{const {result:_0x3ce676,conversation:_0x2e1e55}=await runTest(_0x27d87e[_0x5000e3(0x1f4)],_0x186356,{'agentId':_0x1e4025,'projectId':_0x5c0b6a,'site':_0x447029,'noEval':_0x30c026,'evaluatorId':_0x26fc9e,'onRoundStart':(_0x4d807d,_0x174f8c)=>{const _0x1db2e0=_0x5000e3;_0xdf4656[_0x1db2e0(0x26e)]='Round\x20'+(_0x4d807d+0x1)+'/'+_0x174f8c+_0x1db2e0(0x280);},'onRoundComplete':(_0x2a1e71,_0x4c300f,_0xd941f9)=>{const _0x553a0f=_0x5000e3,_0x3e95d4=formatElapsed(_0x4c300f);_0xd941f9?console['log'](_0x553a0f(0x252)+(_0x2a1e71+0x1)+'/'+_0x186356[_0x553a0f(0x22b)][_0x553a0f(0x260)]+_0x553a0f(0x264)+a5_0x59452f[_0x553a0f(0x247)]('✓')+'\x20('+_0x3e95d4+')'):console[_0x553a0f(0x210)](_0x553a0f(0x252)+(_0x2a1e71+0x1)+'/'+_0x186356[_0x553a0f(0x22b)][_0x553a0f(0x260)]+_0x553a0f(0x264)+a5_0x59452f['red']('✗'));},'onEvaluationStart':()=>{const _0x5c9bf4=_0x5000e3;_0xdf4656[_0x5c9bf4(0x26e)]=_0x5c9bf4(0x224);},'onEvaluationComplete':_0x1accd2=>{const _0x333055=_0x5000e3,_0x1dcd16=formatElapsed(_0x1accd2);console[_0x333055(0x210)](_0x333055(0x22f)+a5_0x59452f[_0x333055(0x247)]('✓')+'\x20('+_0x1dcd16+')');}});_0xdf4656[_0x5000e3(0x266)](),_0x352959[_0x5000e3(0x256)](_0x3ce676),_0x592e5c[_0x5000e3(0x256)](_0x2e1e55);if(_0x3ce676[_0x5000e3(0x26b)]===_0x5000e3(0x281))console['log'](a5_0x59452f[_0x5000e3(0x247)]('✓\x20PASS:\x20'+_0x3ce676[_0x5000e3(0x21b)]));else _0x3ce676['status']===_0x5000e3(0x23f)?console[_0x5000e3(0x210)](a5_0x59452f[_0x5000e3(0x207)](_0x5000e3(0x214)+_0x3ce676[_0x5000e3(0x21b)])):console[_0x5000e3(0x210)](a5_0x59452f['red'](_0x5000e3(0x21f)+_0x3ce676[_0x5000e3(0x21b)]));_0x3ce676[_0x5000e3(0x253)]&&console['log'](a5_0x59452f[_0x5000e3(0x1fb)](_0x5000e3(0x239)+_0x3ce676[_0x5000e3(0x253)])),console['log']();}catch(_0x43f393){_0xdf4656['stop']();const _0x5da322=_0x43f393 instanceof Error?_0x43f393[_0x5000e3(0x237)]:String(_0x43f393);console[_0x5000e3(0x210)](a5_0x59452f[_0x5000e3(0x207)](_0x5000e3(0x21f)+_0x5da322)),console[_0x5000e3(0x210)](),_0x352959[_0x5000e3(0x256)]({'name':_0x186356[_0x5000e3(0x21a)],'status':_0x5000e3(0x1f0),'reason':_0x5da322,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x363616=Date[_0x5000e3(0x272)]()-_0x246274,_0x489769=_0x352959[_0x5000e3(0x212)](_0x112785=>_0x112785[_0x5000e3(0x26b)]===_0x5000e3(0x281))['length'],_0x1addc5=_0x352959[_0x5000e3(0x212)](_0x326180=>_0x326180[_0x5000e3(0x26b)]===_0x5000e3(0x23f))[_0x5000e3(0x260)],_0x526410=_0x352959['filter'](_0x493156=>_0x493156[_0x5000e3(0x26b)]===_0x5000e3(0x1f0))[_0x5000e3(0x260)];console[_0x5000e3(0x210)]('━'['repeat'](0x3c)),console[_0x5000e3(0x210)](_0x5000e3(0x22e)),console[_0x5000e3(0x210)]('━'[_0x5000e3(0x201)](0x3c)),console['log'](_0x5000e3(0x205)+_0x352959[_0x5000e3(0x260)]),console[_0x5000e3(0x210)]('Passed:\x20\x20\x20'+a5_0x59452f['green'](_0x489769)),console[_0x5000e3(0x210)](_0x5000e3(0x26c)+a5_0x59452f['red'](_0x1addc5));_0x526410>0x0&&console[_0x5000e3(0x210)](_0x5000e3(0x26f)+a5_0x59452f[_0x5000e3(0x207)](_0x526410));console[_0x5000e3(0x210)](_0x5000e3(0x275)+formatElapsed(_0x363616)),console[_0x5000e3(0x210)]('━'[_0x5000e3(0x201)](0x3c));const _0x467b77=_0x352959['filter'](_0x54fe04=>_0x54fe04['status']!==_0x5000e3(0x281));if(_0x467b77['length']>0x0){console[_0x5000e3(0x210)](),console[_0x5000e3(0x210)](_0x5000e3(0x238));for(const _0x2cb05a of _0x467b77){const _0x128fd3=a5_0x59452f[_0x5000e3(0x207)]('✗'),_0x1f60bc=_0x2cb05a[_0x5000e3(0x21b)][_0x5000e3(0x260)]>0x32?_0x2cb05a[_0x5000e3(0x21b)][_0x5000e3(0x267)](0x0,0x32)+'...':_0x2cb05a[_0x5000e3(0x21b)];console[_0x5000e3(0x210)]('\x20\x20'+_0x128fd3+'\x20'+_0x2cb05a[_0x5000e3(0x21a)]+':\x20'+_0x1f60bc);}}const _0x2e8356={'summary':{'total':_0x352959[_0x5000e3(0x260)],'passed':_0x489769,'failed':_0x1addc5,'errors':_0x526410>0x0?_0x526410:undefined,'duration_ms':_0x363616},'tests':_0x352959,'agent':{'project':_0x4d702f[_0x5000e3(0x1f5)],'name':_0x4d702f[_0x5000e3(0x1f2)],'site':_0x447029},'timestamp':new Date(_0x246274)[_0x5000e3(0x24a)]()};try{const _0x36beba=buildCachedTestRun(_0x592e5c,{'site':_0x447029,'projectId':_0x5c0b6a,'projectName':_0x4d702f[_0x5000e3(0x1f5)],'agentId':_0x1e4025,'agentName':_0x4d702f[_0x5000e3(0x1f2)],'testYmlPath':a5_0xd16ea0['resolve'](_0x4d702f[_0x5000e3(0x249)])});saveLastTestRun(_0x36beba);}catch{}if(_0x48d63b!==_0x5000e3(0x1ff)||_0x136d89){const _0x1a6464=formatResults(_0x2e8356,_0x48d63b);if(_0x136d89)try{a5_0x3b077d[_0x5000e3(0x221)](_0x136d89,_0x1a6464,_0x5000e3(0x1fd)),console[_0x5000e3(0x210)](),console['log'](a5_0x59452f[_0x5000e3(0x1fb)](_0x5000e3(0x27f)+_0x136d89));}catch(_0x1e9fa2){return console['log'](),console['log'](a5_0x59452f['red']('Error\x20writing\x20output\x20file:\x20'+_0x1e9fa2)),0x1;}else console[_0x5000e3(0x210)](),console[_0x5000e3(0x210)](_0x1a6464);}return _0x467b77[_0x5000e3(0x260)]>0x0?0x1:0x0;}async[a5_0x43cf6d(0x1fa)](_0x5bb575,_0x45b1ff){const _0x5196db=a5_0x43cf6d,{options:_0x2752f5,tdx:_0x4f8225}=_0x5bb575,{definition:_0x50e4a9,agentInfo:_0x58caf0,outputFormat:_0x2a5cc4,outputFile:_0x51ab75}=_0x45b1ff,_0x20feae=_0x2752f5[_0x5196db(0x206)],_0x5201d5=loadLastTestRun();if(!_0x5201d5)return console[_0x5196db(0x210)](a5_0x59452f[_0x5196db(0x207)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x5196db(0x210)](a5_0x59452f[_0x5196db(0x1fb)](_0x5196db(0x241))),0x1;if(_0x5201d5[_0x5196db(0x204)]['agentName']!==_0x58caf0[_0x5196db(0x1f2)])return console[_0x5196db(0x210)](a5_0x59452f[_0x5196db(0x207)](_0x5196db(0x23e)+_0x5201d5[_0x5196db(0x204)][_0x5196db(0x1f2)]+_0x5196db(0x265)+_0x58caf0[_0x5196db(0x1f2)]+'\x22.')),console[_0x5196db(0x210)](a5_0x59452f['dim'](_0x5196db(0x23d))),0x1;const _0x4aa44b=new Set(_0x5201d5[_0x5196db(0x211)][_0x5196db(0x27e)](_0x3b8bea=>_0x3b8bea['testName'])),_0x569345=_0x50e4a9[_0x5196db(0x276)][_0x5196db(0x212)](_0x89c1a1=>!_0x4aa44b[_0x5196db(0x23b)](_0x89c1a1['name']));if(_0x569345[_0x5196db(0x260)]>0x0&&_0x5201d5[_0x5196db(0x206)]!==_0x20feae)return console[_0x5196db(0x210)](a5_0x59452f[_0x5196db(0x207)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x5196db(0x210)](a5_0x59452f[_0x5196db(0x1fb)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x5201d5[_0x5196db(0x206)]+_0x5196db(0x1eb)+_0x20feae+'\x22.')),console['log'](a5_0x59452f[_0x5196db(0x1fb)](_0x5196db(0x24d)+_0x5201d5['site']+_0x5196db(0x1fc))),0x1;const _0x22f754=_0x50e4a9[_0x5196db(0x276)][_0x5196db(0x212)](_0x1c6e31=>_0x4aa44b[_0x5196db(0x23b)](_0x1c6e31[_0x5196db(0x21a)])),_0x4998b2=_0x569345;let _0x55aad6;try{_0x55aad6=await setupEvaluatorAgent(_0x4f8225[_0x5196db(0x1f4)],_0x2752f5[_0x5196db(0x283)]);}catch(_0x565157){const _0x5eab56=_0x565157 instanceof Error?_0x565157[_0x5196db(0x237)]:String(_0x565157);return console['log'](a5_0x59452f[_0x5196db(0x207)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x5eab56)),0x1;}console['log'](a5_0x59452f['cyan'](_0x5196db(0x200))),console[_0x5196db(0x210)](_0x5196db(0x257)+a5_0x59452f['white'](_0x5201d5[_0x5196db(0x1f3)])),console[_0x5196db(0x210)](_0x5196db(0x21d)+a5_0x59452f['white'](_0x5201d5[_0x5196db(0x204)][_0x5196db(0x1f5)]+'/'+_0x5201d5[_0x5196db(0x204)][_0x5196db(0x1f2)]));_0x4998b2[_0x5196db(0x260)]>0x0&&console['log'](_0x5196db(0x268)+a5_0x59452f[_0x5196db(0x225)](_0x4998b2[_0x5196db(0x260)]));console[_0x5196db(0x210)]();const _0x17007c=[],_0x349d09=Date[_0x5196db(0x272)](),_0x5692c8=createCommandSpinner('Re-evaluating...');if(_0x22f754[_0x5196db(0x260)]>0x0)try{const _0x4e0af6=await reevaluateFromCache(_0x4f8225[_0x5196db(0x1f4)],_0x5201d5,{'tests':_0x22f754},{'evaluatorId':_0x55aad6,'onTestStart':(_0x5f4dc0,_0x242b7b,_0xa738bd)=>{const _0x4a625f=_0x5196db;_0x5692c8[_0x4a625f(0x26e)]=_0x4a625f(0x254)+(_0x242b7b+0x1)+'/'+_0xa738bd+':\x20'+_0x5f4dc0+_0x4a625f(0x20f);if(!_0x5692c8[_0x4a625f(0x282)])_0x5692c8[_0x4a625f(0x240)]();},'onTestComplete':(_0x34b6dd,_0x423a6a)=>{const _0x7eb3c6=_0x5196db;_0x5692c8[_0x7eb3c6(0x266)]();if(_0x423a6a[_0x7eb3c6(0x26b)]===_0x7eb3c6(0x281))console['log'](a5_0x59452f[_0x7eb3c6(0x247)](_0x7eb3c6(0x21c)+_0x34b6dd)+a5_0x59452f['dim'](_0x7eb3c6(0x229)));else _0x423a6a['status']==='FAIL'?console['log'](a5_0x59452f[_0x7eb3c6(0x207)](_0x7eb3c6(0x214)+_0x34b6dd+_0x7eb3c6(0x219)+_0x423a6a[_0x7eb3c6(0x21b)])+a5_0x59452f['dim'](_0x7eb3c6(0x229))):console['log'](a5_0x59452f[_0x7eb3c6(0x207)]('✗\x20ERROR:\x20'+_0x34b6dd+'\x20-\x20'+_0x423a6a[_0x7eb3c6(0x21b)]));_0x423a6a[_0x7eb3c6(0x253)]&&console[_0x7eb3c6(0x210)](a5_0x59452f[_0x7eb3c6(0x1fb)](_0x7eb3c6(0x1f6)+_0x423a6a['conversation_url'])),_0x17007c['push'](_0x423a6a);},'onTestSkipped':(_0x2665b3,_0x47530b)=>{const _0x4fe24d=_0x5196db;_0x5692c8[_0x4fe24d(0x266)](),console[_0x4fe24d(0x210)](a5_0x59452f[_0x4fe24d(0x225)](_0x4fe24d(0x20b)+_0x2665b3+_0x4fe24d(0x219)+_0x47530b));}});for(const _0x285d53 of _0x4e0af6){!_0x17007c[_0x5196db(0x218)](_0x54a196=>_0x54a196[_0x5196db(0x21a)]===_0x285d53[_0x5196db(0x21a)])&&_0x17007c[_0x5196db(0x256)](_0x285d53);}}catch(_0x2fe3de){_0x5692c8[_0x5196db(0x266)]();const _0x5d7893=_0x2fe3de instanceof Error?_0x2fe3de[_0x5196db(0x237)]:String(_0x2fe3de);return console[_0x5196db(0x210)](a5_0x59452f[_0x5196db(0x207)](_0x5196db(0x215)+_0x5d7893)),0x1;}_0x5692c8[_0x5196db(0x266)]();if(_0x4998b2[_0x5196db(0x260)]>0x0){console[_0x5196db(0x210)](),console['log'](a5_0x59452f[_0x5196db(0x1e9)](_0x5196db(0x1f9)));const {projectId:_0x1f954e,agentId:_0x20bc57}=_0x5201d5['agent'];for(const _0x13615b of _0x4998b2){console[_0x5196db(0x210)](_0x5196db(0x1ee)+a5_0x59452f[_0x5196db(0x1ef)](_0x13615b[_0x5196db(0x21a)]));const _0x5c1635=createCommandSpinner('Round\x201/'+_0x13615b[_0x5196db(0x22b)][_0x5196db(0x260)]+_0x5196db(0x280));_0x5c1635[_0x5196db(0x240)]();try{const {result:_0x2c7b1b}=await runTest(_0x4f8225[_0x5196db(0x1f4)],_0x13615b,{'agentId':_0x20bc57,'projectId':_0x1f954e,'site':_0x5201d5['site'],'noEval':![],'evaluatorId':_0x55aad6,'onRoundStart':(_0x5c5d28,_0x485923)=>{const _0x4eb4a5=_0x5196db;_0x5c1635['text']=_0x4eb4a5(0x25d)+(_0x5c5d28+0x1)+'/'+_0x485923+_0x4eb4a5(0x280);},'onRoundComplete':(_0x2bd028,_0x1bc2a4,_0x286d4b)=>{const _0x16c0eb=_0x5196db,_0x2b8ddf=formatElapsed(_0x1bc2a4);_0x286d4b?console[_0x16c0eb(0x210)](_0x16c0eb(0x252)+(_0x2bd028+0x1)+'/'+_0x13615b['rounds'][_0x16c0eb(0x260)]+_0x16c0eb(0x264)+a5_0x59452f[_0x16c0eb(0x247)]('✓')+'\x20('+_0x2b8ddf+')'):console[_0x16c0eb(0x210)](_0x16c0eb(0x252)+(_0x2bd028+0x1)+'/'+_0x13615b[_0x16c0eb(0x22b)]['length']+'...\x20'+a5_0x59452f[_0x16c0eb(0x207)]('✗'));},'onEvaluationStart':()=>{const _0x3c53e9=_0x5196db;_0x5c1635[_0x3c53e9(0x26e)]=_0x3c53e9(0x224);},'onEvaluationComplete':_0x48d851=>{const _0x1fb9de=_0x5196db,_0x4a3473=formatElapsed(_0x48d851);console[_0x1fb9de(0x210)](_0x1fb9de(0x22f)+a5_0x59452f[_0x1fb9de(0x247)]('✓')+'\x20('+_0x4a3473+')');}});_0x5c1635[_0x5196db(0x266)](),_0x17007c[_0x5196db(0x256)](_0x2c7b1b);if(_0x2c7b1b[_0x5196db(0x26b)]===_0x5196db(0x281))console[_0x5196db(0x210)](a5_0x59452f[_0x5196db(0x247)](_0x5196db(0x21c)+_0x2c7b1b[_0x5196db(0x21b)])+a5_0x59452f[_0x5196db(0x1fb)](_0x5196db(0x274)));else _0x2c7b1b[_0x5196db(0x26b)]===_0x5196db(0x23f)?console[_0x5196db(0x210)](a5_0x59452f[_0x5196db(0x207)](_0x5196db(0x214)+_0x2c7b1b[_0x5196db(0x21b)])+a5_0x59452f[_0x5196db(0x1fb)](_0x5196db(0x274))):console[_0x5196db(0x210)](a5_0x59452f[_0x5196db(0x207)](_0x5196db(0x21f)+_0x2c7b1b[_0x5196db(0x21b)]));_0x2c7b1b[_0x5196db(0x253)]&&console['log'](a5_0x59452f[_0x5196db(0x1fb)](_0x5196db(0x1f6)+_0x2c7b1b[_0x5196db(0x253)]));}catch(_0x58eb1c){_0x5c1635[_0x5196db(0x266)]();const _0x31dae9=_0x58eb1c instanceof Error?_0x58eb1c['message']:String(_0x58eb1c);console['log'](a5_0x59452f[_0x5196db(0x207)]('✗\x20ERROR:\x20'+_0x31dae9)),_0x17007c[_0x5196db(0x256)]({'name':_0x13615b['name'],'status':_0x5196db(0x1f0),'reason':_0x31dae9,'timestamp':new Date()[_0x5196db(0x24a)](),'duration_ms':0x0});}}}console[_0x5196db(0x210)]();const _0x3bb476=Date[_0x5196db(0x272)]()-_0x349d09,_0x44154b=_0x17007c['filter'](_0x394067=>_0x394067[_0x5196db(0x26b)]===_0x5196db(0x281))['length'],_0x221f13=_0x17007c[_0x5196db(0x212)](_0x4e328e=>_0x4e328e[_0x5196db(0x26b)]===_0x5196db(0x23f))['length'],_0x32f5ce=_0x17007c[_0x5196db(0x212)](_0x25910a=>_0x25910a[_0x5196db(0x26b)]===_0x5196db(0x1f0))[_0x5196db(0x260)];console[_0x5196db(0x210)]('━'[_0x5196db(0x201)](0x3c)),console['log']('Re-evaluation\x20Summary'),console[_0x5196db(0x210)]('━'[_0x5196db(0x201)](0x3c)),console['log'](_0x5196db(0x205)+_0x17007c[_0x5196db(0x260)]),console['log'](_0x5196db(0x27d)+a5_0x59452f[_0x5196db(0x247)](_0x44154b)),console[_0x5196db(0x210)](_0x5196db(0x26c)+a5_0x59452f['red'](_0x221f13));_0x32f5ce>0x0&&console[_0x5196db(0x210)](_0x5196db(0x26f)+a5_0x59452f[_0x5196db(0x207)](_0x32f5ce));console[_0x5196db(0x210)](_0x5196db(0x275)+formatElapsed(_0x3bb476)),console[_0x5196db(0x210)]('━'['repeat'](0x3c));const _0x34dd64={'summary':{'total':_0x17007c['length'],'passed':_0x44154b,'failed':_0x221f13,'errors':_0x32f5ce>0x0?_0x32f5ce:undefined,'duration_ms':_0x3bb476},'tests':_0x17007c,'agent':{'project':_0x58caf0[_0x5196db(0x1f5)],'name':_0x58caf0[_0x5196db(0x1f2)],'site':_0x20feae},'timestamp':new Date(_0x349d09)[_0x5196db(0x24a)]()};if(_0x2a5cc4!==_0x5196db(0x1ff)||_0x51ab75){const _0x243178=formatResults(_0x34dd64,_0x2a5cc4);if(_0x51ab75)try{a5_0x3b077d[_0x5196db(0x221)](_0x51ab75,_0x243178,_0x5196db(0x1fd)),console['log'](),console[_0x5196db(0x210)](a5_0x59452f[_0x5196db(0x1fb)]('Output\x20written\x20to:\x20'+_0x51ab75));}catch(_0x1157c9){return console[_0x5196db(0x210)](),console[_0x5196db(0x210)](a5_0x59452f[_0x5196db(0x207)](_0x5196db(0x235)+_0x1157c9)),0x1;}else console[_0x5196db(0x210)](),console[_0x5196db(0x210)](_0x243178);}const _0x2653a7=_0x17007c[_0x5196db(0x212)](_0x395ad0=>_0x395ad0[_0x5196db(0x26b)]!==_0x5196db(0x281));return _0x2653a7[_0x5196db(0x260)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x31f577=a5_0x1da7;(function(_0x518d2a,_0x54269f){const _0x3e2674=a5_0x1da7,_0x2565ce=_0x518d2a();while(!![]){try{const _0x5cd317=-parseInt(_0x3e2674(0x146))/0x1*(-parseInt(_0x3e2674(0x13d))/0x2)+-parseInt(_0x3e2674(0x1ba))/0x3+-parseInt(_0x3e2674(0x18f))/0x4*(-parseInt(_0x3e2674(0x169))/0x5)+-parseInt(_0x3e2674(0x18a))/0x6*(-parseInt(_0x3e2674(0x14b))/0x7)+parseInt(_0x3e2674(0x142))/0x8*(parseInt(_0x3e2674(0x1ab))/0x9)+parseInt(_0x3e2674(0x159))/0xa*(-parseInt(_0x3e2674(0x1b6))/0xb)+-parseInt(_0x3e2674(0x186))/0xc*(parseInt(_0x3e2674(0x148))/0xd);if(_0x5cd317===_0x54269f)break;else _0x2565ce['push'](_0x2565ce['shift']());}catch(_0x5eeab1){_0x2565ce['push'](_0x2565ce['shift']());}}}(a5_0x48b9,0x1dc6c));import*as a5_0x14274d from'node:fs';import*as a5_0x3196a1 from'node:path';import a5_0x1a22a7 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';function a5_0x1da7(_0x505abe,_0xc386c8){_0x505abe=_0x505abe-0x11c;const _0x48b978=a5_0x48b9();let _0x1da707=_0x48b978[_0x505abe];return _0x1da707;}export class AgentTestCommand extends BaseCommand{[a5_0x31f577(0x145)]='agent:test';['description']=a5_0x31f577(0x19b);async[a5_0x31f577(0x17b)](_0x515a03){const _0x4db6b0=a5_0x31f577,{options:_0x3b8db4,args:_0x787eb8,tdx:_0x118b62}=_0x515a03,_0x3c3dae=_0x787eb8[0x0]||'.',_0x4a1e71=_0x3b8db4['dryRun'],_0x28e841=_0x3b8db4,_0x40bfc0=_0x28e841[_0x4db6b0(0x189)]===![],_0x4fd5d6=_0x28e841[_0x4db6b0(0x163)],_0x319dc0=_0x28e841[_0x4db6b0(0x145)],_0x3774eb=_0x28e841[_0x4db6b0(0x14c)],_0x1fd3a5=_0x3b8db4[_0x4db6b0(0x14d)],_0x47f7f8=_0x28e841['output'];if(_0x4fd5d6&&_0x40bfc0)return console[_0x4db6b0(0x1a8)](a5_0x1a22a7[_0x4db6b0(0x17c)](_0x4db6b0(0x129))),0x1;let _0x5a3f3c=_0x4db6b0(0x151);if(_0x28e841['json'])_0x5a3f3c=_0x4db6b0(0x193);else{if(_0x28e841[_0x4db6b0(0x187)])_0x5a3f3c=_0x4db6b0(0x187);else{if(_0x28e841[_0x4db6b0(0x149)])_0x5a3f3c=_0x4db6b0(0x149);else{if(_0x28e841[_0x4db6b0(0x151)])_0x5a3f3c=_0x4db6b0(0x151);}}}const _0x254115=_0x28e841[_0x4db6b0(0x120)];let _0xb5375a=_0x3c3dae;const _0xeb812f=a5_0x14274d[_0x4db6b0(0x15d)](_0x3c3dae),_0x5e3eeb=_0x3c3dae==='.';if(!_0xeb812f||_0x5e3eeb){const _0xc589d8=resolveProjectFromContext(_0x3c3dae,_0x254115,{'requireFile':'test.yml'});if(_0xc589d8[_0x4db6b0(0x162)])_0xb5375a=_0xc589d8[_0x4db6b0(0x176)],_0xc589d8[_0x4db6b0(0x14a)]==='context'&&console['log'](a5_0x1a22a7[_0x4db6b0(0x14e)](_0x4db6b0(0x175)+_0xb5375a));else switch(_0xc589d8['reason']){case'no_context':console['log'](a5_0x1a22a7['yellow'](_0xc589d8[_0x4db6b0(0x1b4)])),console['log'](),console[_0x4db6b0(0x1a8)](_0x4db6b0(0x12d)),console['log'](_0x4db6b0(0x19e)),console[_0x4db6b0(0x1a8)](_0x4db6b0(0x17f)),console[_0x4db6b0(0x1a8)](),console['log'](_0x4db6b0(0x1ac));return 0x1;case'no_local_folder':console[_0x4db6b0(0x1a8)](a5_0x1a22a7[_0x4db6b0(0x14f)](_0xc589d8['message'])),console[_0x4db6b0(0x1a8)](),console['log'](_0x4db6b0(0x17a)+_0xc589d8[_0x4db6b0(0x120)]+_0x4db6b0(0x160));return 0x1;case _0x4db6b0(0x1aa):{const _0x389d48=a5_0x3196a1['basename'](_0xc589d8['projectDir']);console['log'](a5_0x1a22a7[_0x4db6b0(0x14f)](_0x4db6b0(0x11e)+_0xc589d8[_0x4db6b0(0x120)]+'\x22:'));for(const _0x5831d8 of _0xc589d8[_0x4db6b0(0x1b9)]){console[_0x4db6b0(0x1a8)](_0x4db6b0(0x15e)+_0x5831d8);}return console['log'](),console[_0x4db6b0(0x1a8)](_0x4db6b0(0x181)+_0x389d48+_0x4db6b0(0x126)),0x1;}case _0x4db6b0(0x1b8):console[_0x4db6b0(0x1a8)](a5_0x1a22a7[_0x4db6b0(0x14f)](_0x4db6b0(0x121)+_0xc589d8['llmProject']+'\x22.')),console[_0x4db6b0(0x1a8)](a5_0x1a22a7[_0x4db6b0(0x14e)](_0x4db6b0(0x192)+_0xc589d8[_0x4db6b0(0x176)])),console[_0x4db6b0(0x1a8)](),console[_0x4db6b0(0x1a8)](_0x4db6b0(0x196));return 0x1;}}const {definition:_0x194e0f,agentInfo:_0xa77617}=parseTestFile(_0xb5375a);let _0x33819e=_0x194e0f[_0x4db6b0(0x141)];if(_0x319dc0){const _0x3f4e26=_0x319dc0[_0x4db6b0(0x133)](',')[_0x4db6b0(0x184)](_0x121e4c=>_0x121e4c[_0x4db6b0(0x185)]());_0x33819e=_0x194e0f[_0x4db6b0(0x141)][_0x4db6b0(0x131)](_0x97f646=>_0x3f4e26[_0x4db6b0(0x123)](_0x97f646[_0x4db6b0(0x145)]));if(_0x33819e['length']===0x0)return console[_0x4db6b0(0x1a8)](a5_0x1a22a7['yellow'](_0x4db6b0(0x132)+_0x319dc0)),console['log'](a5_0x1a22a7[_0x4db6b0(0x14e)](_0x4db6b0(0x180)+_0x194e0f['tests'][_0x4db6b0(0x184)](_0x3371b6=>_0x3371b6[_0x4db6b0(0x145)])[_0x4db6b0(0x18b)](',\x20'))),0x1;}if(_0x3774eb){const _0x64c230=_0x3774eb[_0x4db6b0(0x133)](',')['map'](_0x4cf3e5=>_0x4cf3e5[_0x4db6b0(0x185)]()['toLowerCase']());_0x33819e=_0x33819e[_0x4db6b0(0x131)](_0x50aef7=>_0x50aef7[_0x4db6b0(0x14c)]?.[_0x4db6b0(0x166)](_0x4232f4=>_0x64c230[_0x4db6b0(0x123)](_0x4232f4[_0x4db6b0(0x19d)]())));if(_0x33819e[_0x4db6b0(0x137)]===0x0){console['log'](a5_0x1a22a7['yellow'](_0x4db6b0(0x1a3)+_0x3774eb));const _0x51fd1b=new Set();return _0x194e0f[_0x4db6b0(0x141)][_0x4db6b0(0x155)](_0x264e87=>_0x264e87[_0x4db6b0(0x14c)]?.[_0x4db6b0(0x155)](_0x45ebd7=>_0x51fd1b[_0x4db6b0(0x16e)](_0x45ebd7))),_0x51fd1b[_0x4db6b0(0x190)]>0x0?console['log'](a5_0x1a22a7[_0x4db6b0(0x14e)](_0x4db6b0(0x1a4)+[..._0x51fd1b][_0x4db6b0(0x18b)](',\x20'))):console[_0x4db6b0(0x1a8)](a5_0x1a22a7[_0x4db6b0(0x14e)](_0x4db6b0(0x13e))),0x1;}}if(_0x4fd5d6)return this[_0x4db6b0(0x198)](_0x515a03,{'definition':{'tests':_0x33819e},'agentInfo':_0xa77617,'outputFormat':_0x5a3f3c,'outputFile':_0x47f7f8,'testNames':_0x319dc0});if(_0x4a1e71){console[_0x4db6b0(0x1a8)](a5_0x1a22a7['cyan']('Test\x20Configuration:')),console[_0x4db6b0(0x1a8)](_0x4db6b0(0x128)+a5_0x1a22a7['white'](_0x1fd3a5)),console[_0x4db6b0(0x1a8)]('\x20\x20Project:\x20'+a5_0x1a22a7[_0x4db6b0(0x152)](_0xa77617[_0x4db6b0(0x1b5)])),console[_0x4db6b0(0x1a8)](_0x4db6b0(0x182)+a5_0x1a22a7[_0x4db6b0(0x152)](_0xa77617['agentName'])),console[_0x4db6b0(0x1a8)](),console[_0x4db6b0(0x1a8)](_0x4db6b0(0x154)+a5_0x1a22a7[_0x4db6b0(0x152)](_0x33819e[_0x4db6b0(0x137)]));for(let _0x20d914=0x0;_0x20d914<_0x33819e[_0x4db6b0(0x137)];_0x20d914++){const _0x34c01e=_0x33819e[_0x20d914],_0x3f1708=_0x34c01e['rounds'][_0x4db6b0(0x137)]===0x1?_0x4db6b0(0x135):_0x4db6b0(0x13a),_0x55293e=_0x34c01e[_0x4db6b0(0x14c)]?.[_0x4db6b0(0x137)]?'\x20['+_0x34c01e[_0x4db6b0(0x14c)][_0x4db6b0(0x18b)](',\x20')+']':'';console[_0x4db6b0(0x1a8)]('\x20\x20'+(_0x20d914+0x1)+'.\x20'+a5_0x1a22a7['white'](_0x34c01e[_0x4db6b0(0x145)])+'\x20('+_0x34c01e['rounds'][_0x4db6b0(0x137)]+'\x20'+_0x3f1708+')'+a5_0x1a22a7[_0x4db6b0(0x14e)](_0x55293e));}return 0x0;}let _0x123a09,_0x27eb54;try{_0x123a09=await _0x118b62['llm']['resolveProjectId'](_0xa77617[_0x4db6b0(0x1b5)]);}catch(_0x394c18){const _0x3dae00=_0x394c18 instanceof Error?_0x394c18[_0x4db6b0(0x1b4)]:String(_0x394c18);return _0x3dae00[_0x4db6b0(0x123)]('404')||_0x3dae00[_0x4db6b0(0x19d)]()['includes'](_0x4db6b0(0x1ad))?console[_0x4db6b0(0x1a8)](a5_0x1a22a7[_0x4db6b0(0x17c)](_0x4db6b0(0x18d)+_0xa77617[_0x4db6b0(0x1b5)])):console['log'](a5_0x1a22a7['red'](_0x4db6b0(0x15f)+_0xa77617[_0x4db6b0(0x1b5)]+_0x4db6b0(0x157)+_0x3dae00)),0x1;}try{_0x27eb54=await _0x118b62['llm'][_0x4db6b0(0x12f)](_0xa77617[_0x4db6b0(0x17d)],_0x123a09);}catch(_0x5e93be){const _0x49d4b4=_0x5e93be instanceof Error?_0x5e93be['message']:String(_0x5e93be);return _0x49d4b4[_0x4db6b0(0x123)](_0x4db6b0(0x1bc))||_0x49d4b4[_0x4db6b0(0x19d)]()[_0x4db6b0(0x123)](_0x4db6b0(0x1ad))?console[_0x4db6b0(0x1a8)](a5_0x1a22a7[_0x4db6b0(0x17c)](_0x4db6b0(0x168)+_0xa77617[_0x4db6b0(0x17d)])):console[_0x4db6b0(0x1a8)](a5_0x1a22a7[_0x4db6b0(0x17c)](_0x4db6b0(0x197)+_0xa77617[_0x4db6b0(0x17d)]+'\x22:\x20'+_0x49d4b4)),0x1;}let _0x111914;if(!_0x40bfc0)try{_0x111914=await setupEvaluatorAgent(_0x118b62[_0x4db6b0(0x1af)],_0x3b8db4[_0x4db6b0(0x11f)]);}catch(_0x47d5e1){const _0x57adc2=_0x47d5e1 instanceof Error?_0x47d5e1[_0x4db6b0(0x1b4)]:String(_0x47d5e1);return console[_0x4db6b0(0x1a8)](a5_0x1a22a7[_0x4db6b0(0x17c)](_0x4db6b0(0x1a5)+_0x57adc2)),0x1;}console['log'](a5_0x1a22a7['cyan'](_0x4db6b0(0x1a1))),console[_0x4db6b0(0x1a8)](_0x4db6b0(0x18e)+a5_0x1a22a7[_0x4db6b0(0x152)](_0x1fd3a5)),console[_0x4db6b0(0x1a8)](_0x4db6b0(0x16c)+a5_0x1a22a7[_0x4db6b0(0x152)](_0xa77617[_0x4db6b0(0x1b5)]+'/'+_0xa77617[_0x4db6b0(0x17d)])),console[_0x4db6b0(0x1a8)]();const _0x3efa8c=[],_0x568eb8=[],_0x102f8d=Date['now']();for(let _0x407d59=0x0;_0x407d59<_0x33819e[_0x4db6b0(0x137)];_0x407d59++){const _0x30fe06=_0x33819e[_0x407d59];_0x33819e[_0x4db6b0(0x137)]>0x1?console['log'](_0x4db6b0(0x194)+(_0x407d59+0x1)+'/'+_0x33819e['length']+':\x20'+a5_0x1a22a7[_0x4db6b0(0x152)](_0x30fe06['name'])):console[_0x4db6b0(0x1a8)](_0x4db6b0(0x172)+a5_0x1a22a7[_0x4db6b0(0x152)](_0x30fe06['name']));const _0x406e37=createCommandSpinner(_0x4db6b0(0x1bb)+_0x30fe06[_0x4db6b0(0x13a)]['length']+_0x4db6b0(0x140));_0x406e37[_0x4db6b0(0x179)]();try{const {result:_0x2c2d99,conversation:_0x5978d7}=await runTest(_0x118b62['llm'],_0x30fe06,{'agentId':_0x27eb54,'projectId':_0x123a09,'site':_0x1fd3a5,'noEval':_0x40bfc0,'evaluatorId':_0x111914,'onRoundStart':(_0x9e5ff,_0x2a436c)=>{const _0x2460f2=_0x4db6b0;_0x406e37[_0x2460f2(0x191)]='Round\x20'+(_0x9e5ff+0x1)+'/'+_0x2a436c+_0x2460f2(0x140);},'onRoundComplete':(_0x8636e9,_0x5588e3,_0x26a157)=>{const _0x200f90=_0x4db6b0,_0x3ebb31=formatElapsed(_0x5588e3);_0x26a157?console['log'](_0x200f90(0x1b3)+(_0x8636e9+0x1)+'/'+_0x30fe06[_0x200f90(0x13a)][_0x200f90(0x137)]+'...\x20'+a5_0x1a22a7[_0x200f90(0x12e)]('✓')+'\x20('+_0x3ebb31+')'):console['log'](_0x200f90(0x1b3)+(_0x8636e9+0x1)+'/'+_0x30fe06[_0x200f90(0x13a)][_0x200f90(0x137)]+_0x200f90(0x153)+a5_0x1a22a7[_0x200f90(0x17c)]('✗'));},'onEvaluationStart':()=>{const _0x36b1c2=_0x4db6b0;_0x406e37[_0x36b1c2(0x191)]=_0x36b1c2(0x16a);},'onEvaluationComplete':_0x28d276=>{const _0x3e7555=_0x4db6b0,_0x4fc1d7=formatElapsed(_0x28d276);console[_0x3e7555(0x1a8)](_0x3e7555(0x183)+a5_0x1a22a7[_0x3e7555(0x12e)]('✓')+'\x20('+_0x4fc1d7+')');}});_0x406e37[_0x4db6b0(0x125)](),_0x3efa8c[_0x4db6b0(0x164)](_0x2c2d99),_0x568eb8[_0x4db6b0(0x164)](_0x5978d7);if(_0x2c2d99['status']===_0x4db6b0(0x1b1))console[_0x4db6b0(0x1a8)](a5_0x1a22a7[_0x4db6b0(0x12e)]('✓\x20PASS:\x20'+_0x2c2d99[_0x4db6b0(0x11c)]));else _0x2c2d99[_0x4db6b0(0x15c)]==='FAIL'?console[_0x4db6b0(0x1a8)](a5_0x1a22a7[_0x4db6b0(0x17c)](_0x4db6b0(0x15b)+_0x2c2d99[_0x4db6b0(0x11c)])):console[_0x4db6b0(0x1a8)](a5_0x1a22a7[_0x4db6b0(0x17c)](_0x4db6b0(0x178)+_0x2c2d99['reason']));_0x2c2d99[_0x4db6b0(0x122)]&&console[_0x4db6b0(0x1a8)](a5_0x1a22a7['dim'](_0x4db6b0(0x1a2)+_0x2c2d99['conversation_url'])),console['log']();}catch(_0x51cd20){_0x406e37['stop']();const _0x1cb6fe=_0x51cd20 instanceof Error?_0x51cd20[_0x4db6b0(0x1b4)]:String(_0x51cd20);console[_0x4db6b0(0x1a8)](a5_0x1a22a7[_0x4db6b0(0x17c)](_0x4db6b0(0x178)+_0x1cb6fe)),console[_0x4db6b0(0x1a8)](),_0x3efa8c[_0x4db6b0(0x164)]({'name':_0x30fe06[_0x4db6b0(0x145)],'status':'ERROR','reason':_0x1cb6fe,'timestamp':new Date()[_0x4db6b0(0x12b)](),'duration_ms':0x0});}}const _0x19d8df=Date['now']()-_0x102f8d,_0x5f1206=_0x3efa8c[_0x4db6b0(0x131)](_0x14c7fd=>_0x14c7fd[_0x4db6b0(0x15c)]===_0x4db6b0(0x1b1))[_0x4db6b0(0x137)],_0x45d544=_0x3efa8c[_0x4db6b0(0x131)](_0x4e9321=>_0x4e9321['status']==='FAIL')[_0x4db6b0(0x137)],_0x38e8d1=_0x3efa8c['filter'](_0x3ee54c=>_0x3ee54c[_0x4db6b0(0x15c)]===_0x4db6b0(0x161))[_0x4db6b0(0x137)];console[_0x4db6b0(0x1a8)]('━'[_0x4db6b0(0x150)](0x3c)),console[_0x4db6b0(0x1a8)](_0x4db6b0(0x1b7)),console[_0x4db6b0(0x1a8)]('━'[_0x4db6b0(0x150)](0x3c)),console[_0x4db6b0(0x1a8)]('Total:\x20\x20\x20\x20'+_0x3efa8c[_0x4db6b0(0x137)]),console[_0x4db6b0(0x1a8)](_0x4db6b0(0x13f)+a5_0x1a22a7['green'](_0x5f1206)),console[_0x4db6b0(0x1a8)](_0x4db6b0(0x1a9)+a5_0x1a22a7['red'](_0x45d544));_0x38e8d1>0x0&&console[_0x4db6b0(0x1a8)](_0x4db6b0(0x199)+a5_0x1a22a7[_0x4db6b0(0x17c)](_0x38e8d1));console[_0x4db6b0(0x1a8)](_0x4db6b0(0x1b0)+formatElapsed(_0x19d8df)),console[_0x4db6b0(0x1a8)]('━'[_0x4db6b0(0x150)](0x3c));const _0x375c1e=_0x3efa8c[_0x4db6b0(0x131)](_0xfc5866=>_0xfc5866[_0x4db6b0(0x15c)]!==_0x4db6b0(0x1b1));if(_0x375c1e['length']>0x0){console[_0x4db6b0(0x1a8)](),console[_0x4db6b0(0x1a8)]('Failed\x20Tests:');for(const _0x4bc1a0 of _0x375c1e){const _0x1003f7=a5_0x1a22a7[_0x4db6b0(0x17c)]('✗'),_0x144827=_0x4bc1a0['reason'][_0x4db6b0(0x137)]>0x32?_0x4bc1a0[_0x4db6b0(0x11c)]['substring'](0x0,0x32)+_0x4db6b0(0x19c):_0x4bc1a0[_0x4db6b0(0x11c)];console['log']('\x20\x20'+_0x1003f7+'\x20'+_0x4bc1a0[_0x4db6b0(0x145)]+':\x20'+_0x144827);}}const _0xea1e29={'summary':{'total':_0x3efa8c[_0x4db6b0(0x137)],'passed':_0x5f1206,'failed':_0x45d544,'errors':_0x38e8d1>0x0?_0x38e8d1:undefined,'duration_ms':_0x19d8df},'tests':_0x3efa8c,'agent':{'project':_0xa77617['projectName'],'name':_0xa77617[_0x4db6b0(0x17d)],'site':_0x1fd3a5},'timestamp':new Date(_0x102f8d)[_0x4db6b0(0x12b)]()};try{const _0x145897=buildCachedTestRun(_0x568eb8,{'site':_0x1fd3a5,'projectId':_0x123a09,'projectName':_0xa77617[_0x4db6b0(0x1b5)],'agentId':_0x27eb54,'agentName':_0xa77617[_0x4db6b0(0x17d)],'testYmlPath':a5_0x3196a1[_0x4db6b0(0x170)](_0xa77617[_0x4db6b0(0x167)])});saveLastTestRun(_0x145897);}catch{}if(_0x5a3f3c!==_0x4db6b0(0x151)||_0x47f7f8){const _0x18ed51=formatResults(_0xea1e29,_0x5a3f3c);if(_0x47f7f8)try{a5_0x14274d[_0x4db6b0(0x174)](_0x47f7f8,_0x18ed51,_0x4db6b0(0x16d)),console['log'](),console['log'](a5_0x1a22a7['dim'](_0x4db6b0(0x1b2)+_0x47f7f8));}catch(_0x572aa2){return console[_0x4db6b0(0x1a8)](),console[_0x4db6b0(0x1a8)](a5_0x1a22a7[_0x4db6b0(0x17c)](_0x4db6b0(0x19a)+_0x572aa2)),0x1;}else console[_0x4db6b0(0x1a8)](),console['log'](_0x18ed51);}return _0x375c1e[_0x4db6b0(0x137)]>0x0?0x1:0x0;}async[a5_0x31f577(0x198)](_0x31de02,_0x5e3a7e){const _0x2f0ff0=a5_0x31f577,{options:_0x29e425,tdx:_0x43fec3}=_0x31de02,{definition:_0x3d6e55,agentInfo:_0x442293,outputFormat:_0x8ad558,outputFile:_0x2d3971}=_0x5e3a7e,_0x116f97=_0x29e425['site'],_0x5b0a2a=loadLastTestRun();if(!_0x5b0a2a)return console[_0x2f0ff0(0x1a8)](a5_0x1a22a7[_0x2f0ff0(0x17c)](_0x2f0ff0(0x19f))),console[_0x2f0ff0(0x1a8)](a5_0x1a22a7[_0x2f0ff0(0x14e)](_0x2f0ff0(0x18c))),0x1;if(_0x5b0a2a['agent']['agentName']!==_0x442293[_0x2f0ff0(0x17d)])return console['log'](a5_0x1a22a7[_0x2f0ff0(0x17c)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x5b0a2a[_0x2f0ff0(0x134)][_0x2f0ff0(0x17d)]+_0x2f0ff0(0x130)+_0x442293[_0x2f0ff0(0x17d)]+'\x22.')),console[_0x2f0ff0(0x1a8)](a5_0x1a22a7[_0x2f0ff0(0x14e)](_0x2f0ff0(0x195))),0x1;const _0x3a6199=new Set(_0x5b0a2a[_0x2f0ff0(0x16f)][_0x2f0ff0(0x184)](_0x495f0b=>_0x495f0b[_0x2f0ff0(0x138)])),_0x55c182=_0x3d6e55[_0x2f0ff0(0x141)][_0x2f0ff0(0x131)](_0x353e00=>!_0x3a6199[_0x2f0ff0(0x12c)](_0x353e00[_0x2f0ff0(0x145)]));if(_0x55c182[_0x2f0ff0(0x137)]>0x0&&_0x5b0a2a['site']!==_0x116f97)return console[_0x2f0ff0(0x1a8)](a5_0x1a22a7[_0x2f0ff0(0x17c)](_0x2f0ff0(0x136))),console[_0x2f0ff0(0x1a8)](a5_0x1a22a7[_0x2f0ff0(0x14e)](_0x2f0ff0(0x1a7)+_0x5b0a2a[_0x2f0ff0(0x14d)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x116f97+'\x22.')),console[_0x2f0ff0(0x1a8)](a5_0x1a22a7[_0x2f0ff0(0x14e)](_0x2f0ff0(0x11d)+_0x5b0a2a[_0x2f0ff0(0x14d)]+_0x2f0ff0(0x15a))),0x1;const _0x35c14f=_0x3d6e55[_0x2f0ff0(0x141)][_0x2f0ff0(0x131)](_0xe84d24=>_0x3a6199[_0x2f0ff0(0x12c)](_0xe84d24[_0x2f0ff0(0x145)])),_0x176bb1=_0x55c182;let _0x269d89;try{_0x269d89=await setupEvaluatorAgent(_0x43fec3[_0x2f0ff0(0x1af)],_0x29e425['verbose']);}catch(_0x26a5c1){const _0x4ac923=_0x26a5c1 instanceof Error?_0x26a5c1[_0x2f0ff0(0x1b4)]:String(_0x26a5c1);return console['log'](a5_0x1a22a7[_0x2f0ff0(0x17c)](_0x2f0ff0(0x1a5)+_0x4ac923)),0x1;}console[_0x2f0ff0(0x1a8)](a5_0x1a22a7['cyan'](_0x2f0ff0(0x147))),console[_0x2f0ff0(0x1a8)](_0x2f0ff0(0x16b)+a5_0x1a22a7['white'](_0x5b0a2a['timestamp'])),console[_0x2f0ff0(0x1a8)]('Agent:\x20'+a5_0x1a22a7[_0x2f0ff0(0x152)](_0x5b0a2a['agent'][_0x2f0ff0(0x1b5)]+'/'+_0x5b0a2a[_0x2f0ff0(0x134)][_0x2f0ff0(0x17d)]));_0x176bb1[_0x2f0ff0(0x137)]>0x0&&console[_0x2f0ff0(0x1a8)](_0x2f0ff0(0x1a0)+a5_0x1a22a7[_0x2f0ff0(0x14f)](_0x176bb1[_0x2f0ff0(0x137)]));console['log']();const _0x2012ab=[],_0x44ca7f=Date[_0x2f0ff0(0x127)](),_0x21ac28=createCommandSpinner(_0x2f0ff0(0x124));if(_0x35c14f[_0x2f0ff0(0x137)]>0x0)try{const _0x627a52=await reevaluateFromCache(_0x43fec3[_0x2f0ff0(0x1af)],_0x5b0a2a,{'tests':_0x35c14f},{'evaluatorId':_0x269d89,'onTestStart':(_0x1843a4,_0x59b888,_0x7aa4e4)=>{const _0x281b56=_0x2f0ff0;_0x21ac28['text']=_0x281b56(0x1a6)+(_0x59b888+0x1)+'/'+_0x7aa4e4+':\x20'+_0x1843a4+'...';if(!_0x21ac28[_0x281b56(0x17e)])_0x21ac28[_0x281b56(0x179)]();},'onTestComplete':(_0x4f457a,_0x2b4071)=>{const _0x4cc11f=_0x2f0ff0;_0x21ac28[_0x4cc11f(0x125)]();if(_0x2b4071[_0x4cc11f(0x15c)]==='PASS')console[_0x4cc11f(0x1a8)](a5_0x1a22a7[_0x4cc11f(0x12e)](_0x4cc11f(0x143)+_0x4f457a)+a5_0x1a22a7[_0x4cc11f(0x14e)](_0x4cc11f(0x173)));else _0x2b4071[_0x4cc11f(0x15c)]===_0x4cc11f(0x1ae)?console[_0x4cc11f(0x1a8)](a5_0x1a22a7[_0x4cc11f(0x17c)](_0x4cc11f(0x15b)+_0x4f457a+_0x4cc11f(0x156)+_0x2b4071[_0x4cc11f(0x11c)])+a5_0x1a22a7[_0x4cc11f(0x14e)](_0x4cc11f(0x173))):console[_0x4cc11f(0x1a8)](a5_0x1a22a7[_0x4cc11f(0x17c)](_0x4cc11f(0x178)+_0x4f457a+_0x4cc11f(0x156)+_0x2b4071[_0x4cc11f(0x11c)]));_0x2b4071[_0x4cc11f(0x122)]&&console[_0x4cc11f(0x1a8)](a5_0x1a22a7[_0x4cc11f(0x14e)](_0x4cc11f(0x165)+_0x2b4071[_0x4cc11f(0x122)])),_0x2012ab[_0x4cc11f(0x164)](_0x2b4071);},'onTestSkipped':(_0x1bf500,_0x3348c8)=>{const _0x4ca682=_0x2f0ff0;_0x21ac28[_0x4ca682(0x125)](),console[_0x4ca682(0x1a8)](a5_0x1a22a7[_0x4ca682(0x14f)]('⚠\x20SKIPPED:\x20'+_0x1bf500+'\x20-\x20'+_0x3348c8));}});for(const _0x30b459 of _0x627a52){!_0x2012ab[_0x2f0ff0(0x13b)](_0x3b86e4=>_0x3b86e4[_0x2f0ff0(0x145)]===_0x30b459[_0x2f0ff0(0x145)])&&_0x2012ab[_0x2f0ff0(0x164)](_0x30b459);}}catch(_0x8a3726){_0x21ac28[_0x2f0ff0(0x125)]();const _0x29f929=_0x8a3726 instanceof Error?_0x8a3726['message']:String(_0x8a3726);return console[_0x2f0ff0(0x1a8)](a5_0x1a22a7['red'](_0x2f0ff0(0x139)+_0x29f929)),0x1;}_0x21ac28[_0x2f0ff0(0x125)]();if(_0x176bb1['length']>0x0){console[_0x2f0ff0(0x1a8)](),console[_0x2f0ff0(0x1a8)](a5_0x1a22a7[_0x2f0ff0(0x12a)](_0x2f0ff0(0x144)));const {projectId:_0x4f580b,agentId:_0x5a145a}=_0x5b0a2a['agent'];for(const _0x485ff6 of _0x176bb1){console[_0x2f0ff0(0x1a8)](_0x2f0ff0(0x158)+a5_0x1a22a7['white'](_0x485ff6[_0x2f0ff0(0x145)]));const _0x4ea004=createCommandSpinner(_0x2f0ff0(0x1bb)+_0x485ff6[_0x2f0ff0(0x13a)][_0x2f0ff0(0x137)]+_0x2f0ff0(0x140));_0x4ea004[_0x2f0ff0(0x179)]();try{const {result:_0x2759de}=await runTest(_0x43fec3['llm'],_0x485ff6,{'agentId':_0x5a145a,'projectId':_0x4f580b,'site':_0x5b0a2a[_0x2f0ff0(0x14d)],'noEval':![],'evaluatorId':_0x269d89,'onRoundStart':(_0x1513e2,_0x120eb7)=>{const _0x4843f9=_0x2f0ff0;_0x4ea004[_0x4843f9(0x191)]=_0x4843f9(0x188)+(_0x1513e2+0x1)+'/'+_0x120eb7+_0x4843f9(0x140);},'onRoundComplete':(_0x35f615,_0x1d3e8c,_0x10654c)=>{const _0x500d3c=_0x2f0ff0,_0x52b497=formatElapsed(_0x1d3e8c);_0x10654c?console[_0x500d3c(0x1a8)](_0x500d3c(0x1b3)+(_0x35f615+0x1)+'/'+_0x485ff6[_0x500d3c(0x13a)][_0x500d3c(0x137)]+_0x500d3c(0x153)+a5_0x1a22a7[_0x500d3c(0x12e)]('✓')+'\x20('+_0x52b497+')'):console['log'](_0x500d3c(0x1b3)+(_0x35f615+0x1)+'/'+_0x485ff6[_0x500d3c(0x13a)][_0x500d3c(0x137)]+_0x500d3c(0x153)+a5_0x1a22a7[_0x500d3c(0x17c)]('✗'));},'onEvaluationStart':()=>{const _0x5b7af5=_0x2f0ff0;_0x4ea004['text']=_0x5b7af5(0x16a);},'onEvaluationComplete':_0x1628c4=>{const _0x3b6d51=_0x2f0ff0,_0x3270a1=formatElapsed(_0x1628c4);console['log'](_0x3b6d51(0x183)+a5_0x1a22a7[_0x3b6d51(0x12e)]('✓')+'\x20('+_0x3270a1+')');}});_0x4ea004[_0x2f0ff0(0x125)](),_0x2012ab[_0x2f0ff0(0x164)](_0x2759de);if(_0x2759de['status']===_0x2f0ff0(0x1b1))console['log'](a5_0x1a22a7[_0x2f0ff0(0x12e)](_0x2f0ff0(0x143)+_0x2759de[_0x2f0ff0(0x11c)])+a5_0x1a22a7['dim']('\x20(new)'));else _0x2759de[_0x2f0ff0(0x15c)]===_0x2f0ff0(0x1ae)?console[_0x2f0ff0(0x1a8)](a5_0x1a22a7['red'](_0x2f0ff0(0x15b)+_0x2759de[_0x2f0ff0(0x11c)])+a5_0x1a22a7[_0x2f0ff0(0x14e)](_0x2f0ff0(0x13c))):console[_0x2f0ff0(0x1a8)](a5_0x1a22a7[_0x2f0ff0(0x17c)](_0x2f0ff0(0x178)+_0x2759de[_0x2f0ff0(0x11c)]));_0x2759de[_0x2f0ff0(0x122)]&&console[_0x2f0ff0(0x1a8)](a5_0x1a22a7[_0x2f0ff0(0x14e)](_0x2f0ff0(0x165)+_0x2759de[_0x2f0ff0(0x122)]));}catch(_0x5e4b78){_0x4ea004['stop']();const _0xae533b=_0x5e4b78 instanceof Error?_0x5e4b78[_0x2f0ff0(0x1b4)]:String(_0x5e4b78);console[_0x2f0ff0(0x1a8)](a5_0x1a22a7['red']('✗\x20ERROR:\x20'+_0xae533b)),_0x2012ab[_0x2f0ff0(0x164)]({'name':_0x485ff6[_0x2f0ff0(0x145)],'status':_0x2f0ff0(0x161),'reason':_0xae533b,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x2f0ff0(0x1a8)]();const _0x1ef1aa=Date['now']()-_0x44ca7f,_0x3bf078=_0x2012ab[_0x2f0ff0(0x131)](_0x4241f8=>_0x4241f8['status']===_0x2f0ff0(0x1b1))['length'],_0x432076=_0x2012ab['filter'](_0x3bbf22=>_0x3bbf22['status']==='FAIL')['length'],_0x513f5c=_0x2012ab[_0x2f0ff0(0x131)](_0x3eba4f=>_0x3eba4f[_0x2f0ff0(0x15c)]===_0x2f0ff0(0x161))['length'];console[_0x2f0ff0(0x1a8)]('━'['repeat'](0x3c)),console[_0x2f0ff0(0x1a8)](_0x2f0ff0(0x177)),console[_0x2f0ff0(0x1a8)]('━'[_0x2f0ff0(0x150)](0x3c)),console[_0x2f0ff0(0x1a8)](_0x2f0ff0(0x171)+_0x2012ab[_0x2f0ff0(0x137)]),console[_0x2f0ff0(0x1a8)](_0x2f0ff0(0x13f)+a5_0x1a22a7[_0x2f0ff0(0x12e)](_0x3bf078)),console[_0x2f0ff0(0x1a8)](_0x2f0ff0(0x1a9)+a5_0x1a22a7[_0x2f0ff0(0x17c)](_0x432076));_0x513f5c>0x0&&console['log'](_0x2f0ff0(0x199)+a5_0x1a22a7[_0x2f0ff0(0x17c)](_0x513f5c));console[_0x2f0ff0(0x1a8)](_0x2f0ff0(0x1b0)+formatElapsed(_0x1ef1aa)),console[_0x2f0ff0(0x1a8)]('━'[_0x2f0ff0(0x150)](0x3c));const _0x3c4c74={'summary':{'total':_0x2012ab[_0x2f0ff0(0x137)],'passed':_0x3bf078,'failed':_0x432076,'errors':_0x513f5c>0x0?_0x513f5c:undefined,'duration_ms':_0x1ef1aa},'tests':_0x2012ab,'agent':{'project':_0x442293[_0x2f0ff0(0x1b5)],'name':_0x442293[_0x2f0ff0(0x17d)],'site':_0x116f97},'timestamp':new Date(_0x44ca7f)[_0x2f0ff0(0x12b)]()};if(_0x8ad558!==_0x2f0ff0(0x151)||_0x2d3971){const _0x5c481e=formatResults(_0x3c4c74,_0x8ad558);if(_0x2d3971)try{a5_0x14274d[_0x2f0ff0(0x174)](_0x2d3971,_0x5c481e,'utf-8'),console[_0x2f0ff0(0x1a8)](),console[_0x2f0ff0(0x1a8)](a5_0x1a22a7[_0x2f0ff0(0x14e)]('Output\x20written\x20to:\x20'+_0x2d3971));}catch(_0x174cd4){return console['log'](),console[_0x2f0ff0(0x1a8)](a5_0x1a22a7[_0x2f0ff0(0x17c)](_0x2f0ff0(0x19a)+_0x174cd4)),0x1;}else console['log'](),console[_0x2f0ff0(0x1a8)](_0x5c481e);}const _0x3d158e=_0x2012ab[_0x2f0ff0(0x131)](_0x5164bf=>_0x5164bf[_0x2f0ff0(0x15c)]!==_0x2f0ff0(0x1b1));return _0x3d158e[_0x2f0ff0(0x137)]>0x0?0x1:0x0;}}function a5_0x48b9(){const _0x37de61=['agentName','isSpinning','\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)','Available\x20tests:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','\x20\x20Agent:\x20','\x20\x20Evaluating...\x20','map','trim','12tbBngL','jsonl','Round\x20','eval','288axVznM','join','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Site:\x20','28HvMvzu','size','text','Project\x20path:\x20','json','Test\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','executeReeval','Errors:\x20\x20\x20','Error\x20writing\x20output\x20file:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','...','toLowerCase','\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','Error:\x20No\x20previous\x20test\x20run\x20found.','New\x20tests\x20to\x20execute:\x20','Running\x20agent\x20tests...','Conversation\x20URL:\x20','No\x20tests\x20found\x20with\x20tags:\x20','Available\x20tags:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Re-evaluating\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','log','Failed:\x20\x20\x20','multiple_agents','9HPkbrP','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','not\x20found','FAIL','llm','Duration:\x20','PASS','Output\x20written\x20to:\x20','\x20\x20Round\x20','message','projectName','231aWOgYV','Test\x20Summary','no_tests','agentDirs','50682NvveWl','Round\x201/','404','reason','Either\x20switch\x20to\x20the\x20\x22','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','verbose','llmProject','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','conversation_url','includes','Re-evaluating...','stop','/<agent-name>','now','\x20\x20Site:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','cyan','toISOString','has','Usage:','green','resolveAgentId','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','filter','No\x20tests\x20found\x20matching:\x20','split','agent','round','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','length','testName','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','rounds','find','\x20(new)','1756weTpxe','No\x20tests\x20have\x20tags\x20defined.','Passed:\x20\x20\x20',':\x20Sending\x20user\x20input...','tests','1540408nEHfzW','✓\x20PASS:\x20','Executing\x20new\x20tests...','name','121OKLMdc','Re-evaluating\x20cached\x20test\x20run...','3959319VhYmpO','tsv','source','20888baXRbo','tags','site','dim','yellow','repeat','table','white','...\x20','Tests\x20found:\x20','forEach','\x20-\x20','\x22:\x20','Running:\x20','101190baXktU','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','✗\x20FAIL:\x20','status','existsSync','\x20\x20-\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','ERROR','found','reeval','push','\x20\x20Conversation:\x20','some','testYmlPath','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','152785tKUUFh','Evaluating\x20response...','Cached\x20run\x20from:\x20','Agent:\x20','utf-8','add','conversations','resolve','Total:\x20\x20\x20\x20','Running\x20test:\x20','\x20(cached)','writeFileSync','Using\x20agent:\x20','projectDir','Re-evaluation\x20Summary','✗\x20ERROR:\x20','start','Run\x20\x27tdx\x20agent\x20pull\x20','execute','red'];a5_0x48b9=function(){return _0x37de61;};return a5_0x48b9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a6_0x2e9e(_0x3c001b,_0x2271dd){_0x3c001b=_0x3c001b-0x15d;const _0x3f661b=a6_0x3f66();let _0x2e9eb2=_0x3f661b[_0x3c001b];return _0x2e9eb2;}const a6_0x2eacb0=a6_0x2e9e;(function(_0x1fbaf1,_0x53451b){const _0x5b79c9=a6_0x2e9e,_0x5e36db=_0x1fbaf1();while(!![]){try{const _0x58246e=-parseInt(_0x5b79c9(0x178))/0x1+-parseInt(_0x5b79c9(0x17f))/0x2+parseInt(_0x5b79c9(0x181))/0x3+-parseInt(_0x5b79c9(0x176))/0x4*(parseInt(_0x5b79c9(0x168))/0x5)+-parseInt(_0x5b79c9(0x184))/0x6+parseInt(_0x5b79c9(0x16f))/0x7*(parseInt(_0x5b79c9(0x195))/0x8)+parseInt(_0x5b79c9(0x199))/0x9;if(_0x58246e===_0x53451b)break;else _0x5e36db['push'](_0x5e36db['shift']());}catch(_0x48a6c9){_0x5e36db['push'](_0x5e36db['shift']());}}}(a6_0x3f66,0xce28e));import{BaseCommand}from'./command.js';function a6_0x3f66(){const _0x5e9819=['join','name','3305PdnyYq','Invalid\x20header\x20format:\x20\x22','trim','status','Invalid\x20API\x20type:\x20','site','api','122234jyPSBS','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','output','toUpperCase','data','readBodyFromFile','message','5980AYTGZO','Results\x20saved\x20to\x20','943728wvWbBu','keys','entries','error','toLowerCase','x-trino-user','.\x20Valid\x20types:\x20','2672228xfGpbS','indexOf','4629786NwVYYW','file','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','9600558sHiOPs','stack','description','.\x20Valid\x20methods:\x20','llm','length','body','substring','\x0aStack\x20trace:\x0a','cdp','GET','set-cookie','Invalid\x20HTTP\x20method:\x20','startsWith','POST','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','includes','88mMirWB','Endpoint\x20must\x20start\x20with\x20/:\x20','Error:\x20','has','35794944kzDJqm','cookie','headers','isArray','cas','execute','request','type','authorization','trino','color','<\x20HTTP/1.1\x20','llm-proxy','PUT','verbose','log','method'];a6_0x3f66=function(){return _0x5e9819;};return a6_0x3f66();}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';const SENSITIVE_HEADERS=new Set([a6_0x2eacb0(0x15d),'proxy-authorization',a6_0x2eacb0(0x19a),a6_0x2eacb0(0x18f),'set-cookie2','x-xsrf-token','x-auth-token',a6_0x2eacb0(0x17d)]);function isSensitiveHeader(_0xe238ea){const _0x49e6d7=a6_0x2eacb0;return SENSITIVE_HEADERS[_0x49e6d7(0x198)](_0xe238ea[_0x49e6d7(0x17c)]());}function parseHeader(_0xc11a6e){const _0x450fa3=a6_0x2eacb0,_0x2a9f8a=_0xc11a6e[_0x450fa3(0x180)](':');if(_0x2a9f8a===-0x1)throw new Error(_0x450fa3(0x169)+_0xc11a6e+'\x22.\x20'+_0x450fa3(0x193));const _0x408633=_0xc11a6e['substring'](0x0,_0x2a9f8a)['trim'](),_0x1ce39a=_0xc11a6e[_0x450fa3(0x18b)](_0x2a9f8a+0x1)[_0x450fa3(0x16a)]();if(!_0x408633)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0xc11a6e+'\x22');return[_0x408633,_0x1ce39a];}export class ApiCommand extends BaseCommand{[a6_0x2eacb0(0x167)]=a6_0x2eacb0(0x16e);[a6_0x2eacb0(0x186)]=a6_0x2eacb0(0x183);['validate'](_0x48d1c6){const _0x36de99=a6_0x2eacb0,{args:_0x53320,options:_0x51d588}=_0x48d1c6,_0x4911fd=_0x51d588;if(_0x53320[_0x36de99(0x189)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x1603ec=_0x53320[0x0];if(!_0x1603ec[_0x36de99(0x191)]('/'))return _0x36de99(0x196)+_0x1603ec;const _0x4f4444=_0x4911fd['data'],_0x2b4ece=_0x4911fd[_0x36de99(0x182)];if(_0x4f4444&&_0x2b4ece)return _0x36de99(0x170);const _0x4b8af0=_0x4911fd[_0x36de99(0x165)]||_0x36de99(0x18e),_0x32bed6=[_0x36de99(0x18e),_0x36de99(0x192),_0x36de99(0x162),'DELETE','PATCH'];if(!_0x32bed6['includes'](_0x4b8af0[_0x36de99(0x172)]()))return _0x36de99(0x190)+_0x4b8af0+_0x36de99(0x187)+_0x32bed6[_0x36de99(0x166)](',\x20');const _0x278570=_0x4911fd[_0x36de99(0x1a0)]||'td',_0x579233=['td',_0x36de99(0x18d),'workflow',_0x36de99(0x15e),_0x36de99(0x188),_0x36de99(0x161),_0x36de99(0x19d)];if(!_0x579233[_0x36de99(0x194)](_0x278570))return _0x36de99(0x16c)+_0x278570+_0x36de99(0x17e)+_0x579233['join'](',\x20');return undefined;}async[a6_0x2eacb0(0x19e)](_0x55d068){const _0x1d7888=a6_0x2eacb0,{options:_0x1a4e7c,args:_0x2eebd4,tdx:_0x1b2118}=_0x55d068,_0x35619f=_0x1a4e7c,_0x830b44=_0x2eebd4[0x0],_0x1cdbaa=(_0x35619f[_0x1d7888(0x165)]||_0x1d7888(0x18e))['toUpperCase'](),_0x3d6d27=_0x35619f[_0x1d7888(0x173)],_0x29e504=_0x35619f['file'],_0x21f30f=_0x35619f['header'],_0x22b77a=_0x35619f[_0x1d7888(0x1a0)]||'td';try{const _0x3897de={};if(_0x21f30f){const _0x1df4b3=Array[_0x1d7888(0x19c)](_0x21f30f)?_0x21f30f:[_0x21f30f];for(const _0x25a90a of _0x1df4b3){const [_0x9e8d03,_0x2ceeb6]=parseHeader(_0x25a90a);_0x3897de[_0x9e8d03]=_0x2ceeb6;}}let _0x321b24;if(_0x3d6d27)_0x321b24=_0x3d6d27;else{if(_0x29e504)try{_0x321b24=RawAPI[_0x1d7888(0x174)](_0x29e504);}catch(_0x4e89e8){return console[_0x1d7888(0x17b)](_0x1d7888(0x197)+(_0x4e89e8 instanceof Error?_0x4e89e8[_0x1d7888(0x175)]:String(_0x4e89e8))),0x1;}}const _0x585426={'method':_0x1cdbaa,'apiType':_0x22b77a,'includeHeaders':_0x1a4e7c[_0x1d7888(0x163)]};_0x321b24&&(_0x585426[_0x1d7888(0x18a)]=_0x321b24);Object[_0x1d7888(0x179)](_0x3897de)[_0x1d7888(0x189)]>0x0&&(_0x585426['headers']=_0x3897de);if(_0x1a4e7c[_0x1d7888(0x163)]){const _0x3f6c8f=resolveSite(_0x1a4e7c[_0x1d7888(0x16d)]),_0x479fa1=getEndpoint(_0x3f6c8f,_0x22b77a),_0x29920b=''+_0x479fa1+_0x830b44;console[_0x1d7888(0x17b)]('>\x20'+_0x1cdbaa+'\x20'+_0x29920b);const _0x441fc3=getAuthHeaders(_0x3f6c8f),_0x3daaf4={..._0x441fc3,..._0x3897de};for(const [_0x26d9bf,_0x36f059]of Object[_0x1d7888(0x17a)](_0x3daaf4)){!isSensitiveHeader(_0x26d9bf)&&console[_0x1d7888(0x17b)]('>\x20'+_0x26d9bf+':\x20'+_0x36f059);}_0x321b24&&console[_0x1d7888(0x17b)]('>'),console[_0x1d7888(0x17b)]('');}const _0x1cad96=await _0x1b2118[_0x1d7888(0x16e)][_0x1d7888(0x19f)](_0x830b44,_0x585426);if(_0x1a4e7c[_0x1d7888(0x163)]&&_0x1cad96[_0x1d7888(0x19b)]){console[_0x1d7888(0x17b)](_0x1d7888(0x160)+_0x1cad96[_0x1d7888(0x16b)]);for(const [_0x457878,_0x387b6f]of Object[_0x1d7888(0x17a)](_0x1cad96['headers'])){!isSensitiveHeader(_0x457878)&&console['error']('<\x20'+_0x457878+':\x20'+_0x387b6f);}console[_0x1d7888(0x17b)]('');}const _0x3789a6=Boolean(_0x1a4e7c['output']),_0xd1324e={'color':_0x1a4e7c[_0x1d7888(0x15f)],'noColor':_0x1a4e7c['noColor']||_0x3789a6&&!_0x1a4e7c[_0x1d7888(0x15f)]},_0x185bc5=colorizeJSON(_0x1cad96['data'],_0xd1324e);return _0x1a4e7c[_0x1d7888(0x171)]?(writeFileSync(_0x1a4e7c[_0x1d7888(0x171)],_0x185bc5),console[_0x1d7888(0x17b)](_0x1d7888(0x177)+_0x1a4e7c[_0x1d7888(0x171)])):console[_0x1d7888(0x164)](_0x185bc5),0x0;}catch(_0x34305c){return _0x34305c instanceof Error?(console[_0x1d7888(0x17b)](_0x1d7888(0x197)+_0x34305c[_0x1d7888(0x175)]),_0x1a4e7c[_0x1d7888(0x163)]&&_0x34305c['stack']&&console[_0x1d7888(0x17b)](_0x1d7888(0x18c)+_0x34305c[_0x1d7888(0x185)])):console[_0x1d7888(0x17b)](_0x1d7888(0x197)+String(_0x34305c)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0x1b023c=a7_0x5402;(function(_0x6a359a,_0x1957de){const _0x30ec38=a7_0x5402,_0x14dad6=_0x6a359a();while(!![]){try{const _0x1d21df=-parseInt(_0x30ec38(0xbd))/0x1*(-parseInt(_0x30ec38(0xf9))/0x2)+parseInt(_0x30ec38(0xb0))/0x3*(parseInt(_0x30ec38(0xb9))/0x4)+parseInt(_0x30ec38(0x109))/0x5+-parseInt(_0x30ec38(0xde))/0x6*(parseInt(_0x30ec38(0xe7))/0x7)+-parseInt(_0x30ec38(0xe4))/0x8*(-parseInt(_0x30ec38(0xe5))/0x9)+-parseInt(_0x30ec38(0xd4))/0xa+-parseInt(_0x30ec38(0xad))/0xb*(parseInt(_0x30ec38(0xb2))/0xc);if(_0x1d21df===_0x1957de)break;else _0x14dad6['push'](_0x14dad6['shift']());}catch(_0x2ce7f3){_0x14dad6['push'](_0x14dad6['shift']());}}}(a7_0x345c,0xbafbe));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';function a7_0x345c(){const _0x1dc56c=['\x20(site:\x20','4278348EYrmaS','No\x20credential\x20found','account_id','cyan','✓\x20Profile\x20\x27','first_name','dim','156920biVnjY','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','join','description','1aeAJeR','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x0aSetup\x20cancelled','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','/users/initiate_sso\x20(account:\x20','Validating\x20OAuth\x20tokens...','User:\x20','ERROR','N/A','site','Use\x20an\x20API\x20key','✓\x20Default\x20site\x20set\x20to\x20','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','red','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','apiKey','error','\x20--profile\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','warn','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','13561040BETjOi','\x20\x20(','all','message','profile','No\x20credentials\x20found\x20in\x20keychain','getUserInfo','password','log','method','13548jlICFo','yellow','API\x20key\x20cannot\x20be\x20empty','create','Setup\x20API\x20key\x20authentication\x20interactively','trim','6128vAGygo','9441TROoES','\x20\x20tdx','427gKDyGB','\x20(profile:\x20','green','Remove\x20API\x20key\x20from\x20system\x20keychain','auth:clear','/app/mp/ak','execute','access_token','✓\x20Authentication\x20successful\x0a','For\x20scripts\x20or\x20headless\x20servers','jobs','Read\x20credential\x20from\x20keychain','name','Setup\x20cancelled','filter','✓\x20Signed\x20in\x20successfully','auth','auth:setup','2478032VwaIHH','Read\x20credential\x20from\x20','logLevel','last_name','✗\x20Validation\x20failed:\x20','oauth','Enter\x20your\x20TD\x20API\x20key:','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Validating\x20API\x20key...','System\x20keychain\x20is\x20not\x20available','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20\x20user_id:','tdx\x20profile:\x20','email','text','API\x20key','3133865DsUpOa','accountName','status','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','55Iehvgm','Credential\x20type:\x20OAuth','Setting\x20up\x20authentication\x20for\x20site:\x20','105ytAmav'];a7_0x345c=function(){return _0x1dc56c;};return a7_0x345c();}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';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_0x26759f 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_0x17ef52 from'chalk';function a7_0x5402(_0x3778e3,_0x1f5df5){_0x3778e3=_0x3778e3-0xab;const _0x345c1a=a7_0x345c();let _0x540231=_0x345c1a[_0x3778e3];return _0x540231;}export async function runOAuthLoginFlow(_0x3b4ed0,_0x384e70,_0x1a8d06,_0x26430a){const _0x2424fa=a7_0x5402,_0x574730=await isKeychainAvailable();if(!_0x574730)throw new Error(_0x2424fa(0x100)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');let _0x1c1c01=_0x26430a?.[_0x2424fa(0x10a)];if(!_0x1c1c01){const _0x4837f9=await a7_0x26759f({'type':_0x2424fa(0x107),'name':_0x2424fa(0x10a),'message':'Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):'});if(_0x4837f9[_0x2424fa(0x10a)]===undefined)throw new Error(_0x2424fa(0xf4));_0x1c1c01=_0x4837f9[_0x2424fa(0x10a)][_0x2424fa(0xe3)]()||undefined;}const _0x2dd9cf=getConsoleUrl(_0x3b4ed0);console[_0x2424fa(0xdc)]('Opening\x20browser\x20for\x20authentication...');_0x1c1c01?console[_0x2424fa(0xdc)]('\x20\x20'+_0x2dd9cf+_0x2424fa(0xc1)+_0x1c1c01+')'):console[_0x2424fa(0xdc)]('\x20\x20'+_0x2dd9cf+'/oauth/authorize');console[_0x2424fa(0xdc)](_0x2424fa(0xcc));const _0x1fcd21=await startOAuthFlow(_0x3b4ed0,{'accountName':_0x1c1c01});console['log'](_0x2424fa(0xc2));const _0x1e73c8=TDX[_0x2424fa(0xe1)]({'site':_0x3b4ed0,'accessToken':_0x1fcd21[_0x2424fa(0xee)],'logLevel':_0x1a8d06??LogLevel[_0x2424fa(0xc4)]}),_0x128b49=await _0x1e73c8['jobs'][_0x2424fa(0xda)]();console[_0x2424fa(0xdc)](a7_0x17ef52[_0x2424fa(0xe9)](_0x2424fa(0xf6))),console['log']('\x20\x20'+a7_0x17ef52[_0x2424fa(0xb5)](_0x3b4ed0+':'+_0x128b49[_0x2424fa(0xb4)])+_0x2424fa(0x104)+_0x128b49['id']+_0x2424fa(0xd5)+_0x128b49['email']+')');!_0x1c1c01&&(console[_0x2424fa(0xdc)](a7_0x17ef52[_0x2424fa(0xb8)](_0x2424fa(0xac))),console[_0x2424fa(0xdc)](a7_0x17ef52['dim']('\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>')),console['log'](a7_0x17ef52[_0x2424fa(0xb8)]('\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions')));await saveOAuthTokens(_0x1fcd21,_0x384e70),console[_0x2424fa(0xdc)](_0x2424fa(0xca)+(_0x384e70?_0x2424fa(0xe8)+_0x384e70+')':''));if(_0x384e70){const _0x4c5af6={'site':_0x3b4ed0};saveProfileToUserConfig(_0x384e70,_0x4c5af6),console['log'](_0x2424fa(0xb6)+_0x384e70+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x3b4ed0),console['log'](_0x2424fa(0xc8)+_0x3b4ed0);const _0x5cd3c4=_0x384e70?'\x20--profile\x20'+_0x384e70:'';console[_0x2424fa(0xdc)](),console[_0x2424fa(0xdc)](_0x2424fa(0xbe)),console[_0x2424fa(0xdc)](_0x2424fa(0xe6)+_0x5cd3c4+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x2424fa(0xe6)+_0x5cd3c4+_0x2424fa(0xd3));}export async function promptAuthMethod(){const _0x38df42=a7_0x5402,_0x4ce3e6=await a7_0x26759f({'type':'select','name':_0x38df42(0xdd),'message':'Choose\x20how\x20to\x20sign\x20in:','choices':[{'title':'Sign\x20in\x20with\x20browser\x20(recommended)','description':_0x38df42(0xc9),'value':_0x38df42(0xfe)},{'title':_0x38df42(0xc7),'description':_0x38df42(0xf0),'value':'apikey'}]});return _0x4ce3e6[_0x38df42(0xdd)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x1b023c(0xf3)]=a7_0x1b023c(0xf8);['description']=a7_0x1b023c(0xe2);async[a7_0x1b023c(0xed)](_0x29302b){const _0x45a9a2=a7_0x1b023c,{options:_0x372154}=_0x29302b,_0x4c351e=_0x372154[_0x45a9a2(0xd8)];console[_0x45a9a2(0xdc)](a7_0x17ef52['bold']('tdx:\x20auth\x20setup'));const _0x2908df=_0x372154['site']||'us01',_0x4bee14=await promptSiteSelection(_0x2908df,_0x4c351e,_0x45a9a2(0xf4));if(!_0x4bee14)return 0x1;const _0x2bc425=resolveSite(_0x4bee14),_0x1ed7bb=await promptAuthMethod();if(!_0x1ed7bb)return console[_0x45a9a2(0xdc)](_0x45a9a2(0xbf)),0x1;if(_0x1ed7bb===_0x45a9a2(0xfe)){const {accountName:_0x50c3f0}=_0x372154;return await runOAuthLoginFlow(_0x2bc425,_0x4c351e,_0x372154[_0x45a9a2(0xfb)]??LogLevel['ERROR'],{'accountName':_0x50c3f0}),0x0;}console[_0x45a9a2(0xdc)](_0x45a9a2(0xaf)+_0x2bc425),console['log'](_0x45a9a2(0xd2)),console[_0x45a9a2(0xdc)]('\x20\x20'+getConsoleUrl(_0x2bc425,_0x45a9a2(0xec)));const _0x1a8255=await a7_0x26759f({'type':_0x45a9a2(0xdb),'name':_0x45a9a2(0xcd),'message':_0x45a9a2(0xff),'validate':_0xc0b48f=>{const _0x84b7c9=_0x45a9a2;if(!_0xc0b48f||!_0xc0b48f['trim']())return _0x84b7c9(0xe0);return!![];}});if(!_0x1a8255[_0x45a9a2(0xcd)])return console[_0x45a9a2(0xdc)](_0x45a9a2(0xbf)),0x1;const _0x376694=_0x1a8255[_0x45a9a2(0xcd)];console[_0x45a9a2(0xdc)](_0x45a9a2(0x101));try{const _0x9426d1=TDX[_0x45a9a2(0xe1)]({'site':_0x2bc425,'apiKey':_0x376694[_0x45a9a2(0xe3)](),'logLevel':_0x372154[_0x45a9a2(0xfb)]??LogLevel[_0x45a9a2(0xc4)]}),_0x4a5ba5=await _0x9426d1[_0x45a9a2(0xf1)][_0x45a9a2(0xda)]();console[_0x45a9a2(0xdc)](_0x45a9a2(0xc0)+_0x4a5ba5['email']+')');const _0x561e85=await isKeychainAvailable();_0x561e85?(await saveAPIKeyAsync(_0x376694[_0x45a9a2(0xe3)](),_0x2bc425,_0x4c351e),console['log'](_0x45a9a2(0xba)+(_0x4c351e?'\x20(profile:\x20'+_0x4c351e+')':''))):(console[_0x45a9a2(0xd1)](a7_0x17ef52[_0x45a9a2(0xdf)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x45a9a2(0xd1)](a7_0x17ef52['yellow'](_0x45a9a2(0xd0))));if(_0x4c351e){const _0xd00151={'site':_0x2bc425};saveProfileToUserConfig(_0x4c351e,_0xd00151),console[_0x45a9a2(0xdc)](_0x45a9a2(0xb6)+_0x4c351e+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x2bc425),console[_0x45a9a2(0xdc)](_0x45a9a2(0xc8)+_0x2bc425);const _0x58dd38=_0x4c351e?_0x45a9a2(0xcf)+_0x4c351e:'';return console[_0x45a9a2(0xdc)](),console[_0x45a9a2(0xdc)](_0x45a9a2(0xbe)),console[_0x45a9a2(0xdc)](_0x45a9a2(0xe6)+_0x58dd38+_0x45a9a2(0x103)),console[_0x45a9a2(0xdc)]('\x20\x20tdx'+_0x58dd38+_0x45a9a2(0xd3)),0x0;}catch(_0x2fcb0f){if(_0x2fcb0f instanceof HTTPClientError&&_0x2fcb0f['status']===0x191)return printAuthError(_0x2fcb0f),0x1;return console[_0x45a9a2(0xce)](a7_0x17ef52[_0x45a9a2(0xcb)](_0x45a9a2(0xfd)+(_0x2fcb0f instanceof Error?_0x2fcb0f[_0x45a9a2(0xd7)]:String(_0x2fcb0f)))),console[_0x45a9a2(0xce)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x1b023c(0xf3)]=a7_0x1b023c(0xf7);[a7_0x1b023c(0xbc)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x1b023c(0xed)](_0x4b2275){const _0x29f200=a7_0x1b023c,{options:_0x12c98a,tdx:_0x5e3922}=_0x4b2275,_0x4e2d96=_0x12c98a[_0x29f200(0xc6)],_0x316a04=_0x12c98a[_0x29f200(0xd8)],_0xacd04a=_0x316a04?_0x316a04:_0x29f200(0xc5);console[_0x29f200(0xdc)](_0x29f200(0x105)+_0xacd04a+_0x29f200(0xb1)+_0x4e2d96+')');const _0x26e757=await getOAuthTokens(_0x316a04);if(_0x26e757)console[_0x29f200(0xdc)](_0x29f200(0xae)),console[_0x29f200(0xdc)](_0x29f200(0xf2)+(_0x316a04?_0x29f200(0xe8)+_0x316a04+')':''));else{const _0x22e02b=await resolveAPIKeyAsync(_0x4e2d96,_0x316a04);if(_0x22e02b){const {source:_0x2be644,isDeprecated:_0x304889}=_0x22e02b,_0x432a85=_0x29f200(0xfa)+_0x2be644;console['log'](_0x304889?a7_0x17ef52[_0x29f200(0xdf)](_0x432a85):_0x432a85);}else console[_0x29f200(0xdc)](a7_0x17ef52[_0x29f200(0xdf)](_0x29f200(0xb3)));}try{const _0x373047=await _0x5e3922[_0x29f200(0xf1)][_0x29f200(0xda)]();return console[_0x29f200(0xdc)](a7_0x17ef52[_0x29f200(0xe9)](_0x29f200(0xef))),console[_0x29f200(0xdc)](_0x29f200(0xc3)+_0x373047[_0x29f200(0x106)]),(_0x373047[_0x29f200(0xb7)]||_0x373047[_0x29f200(0xfc)])&&console[_0x29f200(0xdc)]('Name:\x20'+[_0x373047['first_name'],_0x373047[_0x29f200(0xfc)]]['filter'](Boolean)[_0x29f200(0xbb)]('\x20')),0x0;}catch(_0x4392b3){return _0x4392b3 instanceof HTTPClientError&&_0x4392b3[_0x29f200(0xab)]===0x191?printAuthError(_0x4392b3,!![],_0x316a04):console[_0x29f200(0xce)](a7_0x17ef52[_0x29f200(0xcb)]('✗\x20Validation\x20failed:\x20'+(_0x4392b3 instanceof Error?_0x4392b3[_0x29f200(0xd7)]:String(_0x4392b3)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x1b023c(0xeb);[a7_0x1b023c(0xbc)]=a7_0x1b023c(0xea);async[a7_0x1b023c(0xed)](_0x186eda){const _0x4828e7=a7_0x1b023c,{options:_0x12296c}=_0x186eda,_0xe5da85=_0x12296c[_0x4828e7(0xd8)];console['log'](a7_0x17ef52['bold']('tdx:\x20auth\x20clear'));const _0x5067a2=await isKeychainAvailable();if(!_0x5067a2)return console[_0x4828e7(0xce)](a7_0x17ef52[_0x4828e7(0xcb)](_0x4828e7(0x102))),0x1;const [_0x2469f6,_0x1d49d1]=await Promise[_0x4828e7(0xd6)]([deleteKeychainAPIKey(_0xe5da85),deleteOAuthTokens(_0xe5da85)]);if(_0x2469f6||_0x1d49d1){clearCredentialCache();const _0x3a3c1d=[_0x2469f6&&_0x4828e7(0x108),_0x1d49d1&&'OAuth\x20tokens'][_0x4828e7(0xf5)](Boolean)['join']('\x20and\x20');return console[_0x4828e7(0xdc)]('✓\x20'+_0x3a3c1d+'\x20removed\x20from\x20keychain'+(_0xe5da85?_0x4828e7(0xe8)+_0xe5da85+')':'')),0x0;}else return console['log'](_0x4828e7(0xd9)+(_0xe5da85?'\x20for\x20profile:\x20'+_0xe5da85:'')),0x1;}}
|
|
1
|
+
const a7_0x3a27f4=a7_0x151b;(function(_0x2c8370,_0x25dc92){const _0x1cb3e9=a7_0x151b,_0xc31936=_0x2c8370();while(!![]){try{const _0x5116cd=-parseInt(_0x1cb3e9(0x1eb))/0x1*(parseInt(_0x1cb3e9(0x208))/0x2)+-parseInt(_0x1cb3e9(0x21c))/0x3+-parseInt(_0x1cb3e9(0x1c5))/0x4*(parseInt(_0x1cb3e9(0x1fc))/0x5)+-parseInt(_0x1cb3e9(0x222))/0x6*(parseInt(_0x1cb3e9(0x1f3))/0x7)+-parseInt(_0x1cb3e9(0x1cc))/0x8*(parseInt(_0x1cb3e9(0x1d7))/0x9)+parseInt(_0x1cb3e9(0x205))/0xa*(-parseInt(_0x1cb3e9(0x1e3))/0xb)+parseInt(_0x1cb3e9(0x223))/0xc;if(_0x5116cd===_0x25dc92)break;else _0xc31936['push'](_0xc31936['shift']());}catch(_0x31c2df){_0xc31936['push'](_0xc31936['shift']());}}}(a7_0x1acf,0xed162));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';function a7_0x1acf(){const _0x1eb75a=['\x20for\x20profile:\x20','auth:setup','\x20--profile\x20','jobs','\x20(site:\x20','N/A','method','accountName','error','User:\x20','first_name','apiKey','create','Setup\x20cancelled','No\x20credentials\x20found\x20in\x20keychain','ERROR','logLevel','green','No\x20credential\x20found','5819028ctvGMl','Name:\x20','last_name','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Read\x20credential\x20from\x20','\x27\x20registered','37290HBZOzT','77104140nzYHQu','System\x20keychain\x20is\x20not\x20available','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','✗\x20Validation\x20failed:\x20','warn','status','all','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','cyan','4nXQLRP','email','execute','Remove\x20API\x20key\x20from\x20system\x20keychain','red','auth:clear','Opening\x20browser\x20for\x20authentication...','16yorxCd','bold','API\x20key\x20cannot\x20be\x20empty','✓\x20Profile\x20\x27','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','API\x20key','join','message','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','yellow','477306AvGrGz','account_id','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','OAuth\x20tokens','tdx:\x20auth\x20setup','description','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','getUserInfo','name','log','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','3890029HsZnZm','filter','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','select','/app/mp/ak','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','2WBhzDB','trim','\x20\x20user_id:','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20and\x20','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','Enter\x20your\x20TD\x20API\x20key:','tdx\x20profile:\x20','343Vwswym','✓\x20Signed\x20in\x20successfully','✓\x20Authentication\x20successful\x0a','/oauth/authorize','access_token','For\x20scripts\x20or\x20headless\x20servers','\x20(profile:\x20','profile','\x20\x20tdx','2786095VztlPc','\x20removed\x20from\x20keychain','\x0aSetup\x20cancelled','auth','oauth','/users/initiate_sso\x20(account:\x20','Validating\x20API\x20key...','Setting\x20up\x20authentication\x20for\x20site:\x20','site','50WPoOlu','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','dim','778546GsHktf'];a7_0x1acf=function(){return _0x1eb75a;};return a7_0x1acf();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';function a7_0x151b(_0xe78d8e,_0x1dc5a3){_0xe78d8e=_0xe78d8e-0x1c2;const _0x1acfff=a7_0x1acf();let _0x151bcc=_0x1acfff[_0xe78d8e];return _0x151bcc;}import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x1c3ea2 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_0x296e95 from'chalk';export async function runOAuthLoginFlow(_0x26795f,_0x969444,_0x389e25,_0x286567){const _0x76107=a7_0x151b,_0x5c91d9=await isKeychainAvailable();if(!_0x5c91d9)throw new Error(_0x76107(0x21f)+_0x76107(0x1d0));let _0x2c6cbf=_0x286567?.[_0x76107(0x210)];if(!_0x2c6cbf){const _0x27943b=await a7_0x1c3ea2({'type':'text','name':_0x76107(0x210),'message':_0x76107(0x1e2)});if(_0x27943b['accountName']===undefined)throw new Error(_0x76107(0x216));_0x2c6cbf=_0x27943b[_0x76107(0x210)]['trim']()||undefined;}const _0x31d377=getConsoleUrl(_0x26795f);console[_0x76107(0x1e1)](_0x76107(0x1cb));_0x2c6cbf?console[_0x76107(0x1e1)]('\x20\x20'+_0x31d377+_0x76107(0x201)+_0x2c6cbf+')'):console[_0x76107(0x1e1)]('\x20\x20'+_0x31d377+_0x76107(0x1f6));console['log'](_0x76107(0x1de));const _0x4da0ad=await startOAuthFlow(_0x26795f,{'accountName':_0x2c6cbf});console[_0x76107(0x1e1)]('Validating\x20OAuth\x20tokens...');const _0x1e4c2b=TDX[_0x76107(0x215)]({'site':_0x26795f,'accessToken':_0x4da0ad[_0x76107(0x1f7)],'logLevel':_0x389e25??LogLevel[_0x76107(0x218)]}),_0x43cf2b=await _0x1e4c2b[_0x76107(0x20c)][_0x76107(0x1df)]();console[_0x76107(0x1e1)](a7_0x296e95[_0x76107(0x21a)](_0x76107(0x1f4))),console['log']('\x20\x20'+a7_0x296e95[_0x76107(0x1c4)](_0x26795f+':'+_0x43cf2b[_0x76107(0x1d8)])+_0x76107(0x1ed)+_0x43cf2b['id']+'\x20\x20('+_0x43cf2b[_0x76107(0x1c6)]+')');!_0x2c6cbf&&(console[_0x76107(0x1e1)](a7_0x296e95[_0x76107(0x207)]('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console[_0x76107(0x1e1)](a7_0x296e95['dim'](_0x76107(0x1f0))),console['log'](a7_0x296e95[_0x76107(0x207)](_0x76107(0x1c3))));await saveOAuthTokens(_0x4da0ad,_0x969444),console[_0x76107(0x1e1)](_0x76107(0x206)+(_0x969444?'\x20(profile:\x20'+_0x969444+')':''));if(_0x969444){const _0x3262c0={'site':_0x26795f};saveProfileToUserConfig(_0x969444,_0x3262c0),console[_0x76107(0x1e1)](_0x76107(0x1cf)+_0x969444+_0x76107(0x221));}else saveDefaultSiteToUserConfig(_0x26795f),console[_0x76107(0x1e1)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x26795f);const _0x490d8e=_0x969444?'\x20--profile\x20'+_0x969444:'';console[_0x76107(0x1e1)](),console[_0x76107(0x1e1)](_0x76107(0x1d9)),console[_0x76107(0x1e1)](_0x76107(0x1fb)+_0x490d8e+_0x76107(0x1e5)),console[_0x76107(0x1e1)](_0x76107(0x1fb)+_0x490d8e+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export async function promptAuthMethod(){const _0x20ae20=a7_0x151b,_0x372064=await a7_0x1c3ea2({'type':_0x20ae20(0x1e8),'name':_0x20ae20(0x20f),'message':'Choose\x20how\x20to\x20sign\x20in:','choices':[{'title':'Sign\x20in\x20with\x20browser\x20(recommended)','description':_0x20ae20(0x1e7),'value':_0x20ae20(0x200)},{'title':'Use\x20an\x20API\x20key','description':_0x20ae20(0x1f8),'value':'apikey'}]});return _0x372064[_0x20ae20(0x20f)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x3a27f4(0x1e0)]=a7_0x3a27f4(0x20a);['description']='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x3a27f4(0x1c7)](_0x876c83){const _0x3338a4=a7_0x3a27f4,{options:_0x49dffe}=_0x876c83,_0x46cfe7=_0x49dffe['profile'];console[_0x3338a4(0x1e1)](a7_0x296e95[_0x3338a4(0x1cd)](_0x3338a4(0x1dc)));const _0x32c92d=_0x49dffe[_0x3338a4(0x204)]||'us01',_0x1c18eb=await promptSiteSelection(_0x32c92d,_0x46cfe7,_0x3338a4(0x216));if(!_0x1c18eb)return 0x1;const _0x48f450=resolveSite(_0x1c18eb),_0x109ad9=await promptAuthMethod();if(!_0x109ad9)return console['log'](_0x3338a4(0x1fe)),0x1;if(_0x109ad9===_0x3338a4(0x200)){const {accountName:_0x40067a}=_0x49dffe;return await runOAuthLoginFlow(_0x48f450,_0x46cfe7,_0x49dffe[_0x3338a4(0x219)]??LogLevel[_0x3338a4(0x218)],{'accountName':_0x40067a}),0x0;}console[_0x3338a4(0x1e1)](_0x3338a4(0x203)+_0x48f450),console[_0x3338a4(0x1e1)](_0x3338a4(0x1ee)),console['log']('\x20\x20'+getConsoleUrl(_0x48f450,_0x3338a4(0x1e9)));const _0x2add1f=await a7_0x1c3ea2({'type':'password','name':_0x3338a4(0x214),'message':_0x3338a4(0x1f1),'validate':_0x1a1275=>{const _0x30b88b=_0x3338a4;if(!_0x1a1275||!_0x1a1275['trim']())return _0x30b88b(0x1ce);return!![];}});if(!_0x2add1f['apiKey'])return console['log'](_0x3338a4(0x1fe)),0x1;const _0xddbb33=_0x2add1f[_0x3338a4(0x214)];console[_0x3338a4(0x1e1)](_0x3338a4(0x202));try{const _0x36af76=TDX['create']({'site':_0x48f450,'apiKey':_0xddbb33[_0x3338a4(0x1ec)](),'logLevel':_0x49dffe[_0x3338a4(0x219)]??LogLevel[_0x3338a4(0x218)]}),_0x2e0999=await _0x36af76[_0x3338a4(0x20c)]['getUserInfo']();console['log'](_0x3338a4(0x1ea)+_0x2e0999[_0x3338a4(0x1c6)]+')');const _0x39aa98=await isKeychainAvailable();_0x39aa98?(await saveAPIKeyAsync(_0xddbb33[_0x3338a4(0x1ec)](),_0x48f450,_0x46cfe7),console[_0x3338a4(0x1e1)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x46cfe7?_0x3338a4(0x1f9)+_0x46cfe7+')':''))):(console['warn'](a7_0x296e95[_0x3338a4(0x1d6)](_0x3338a4(0x225))),console[_0x3338a4(0x227)](a7_0x296e95[_0x3338a4(0x1d6)](_0x3338a4(0x1d1))));if(_0x46cfe7){const _0x483b96={'site':_0x48f450};saveProfileToUserConfig(_0x46cfe7,_0x483b96),console[_0x3338a4(0x1e1)](_0x3338a4(0x1cf)+_0x46cfe7+_0x3338a4(0x221));}else saveDefaultSiteToUserConfig(_0x48f450),console[_0x3338a4(0x1e1)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x48f450);const _0x2fbbfb=_0x46cfe7?_0x3338a4(0x20b)+_0x46cfe7:'';return console[_0x3338a4(0x1e1)](),console[_0x3338a4(0x1e1)](_0x3338a4(0x1d9)),console['log'](_0x3338a4(0x1fb)+_0x2fbbfb+_0x3338a4(0x1e5)),console[_0x3338a4(0x1e1)]('\x20\x20tdx'+_0x2fbbfb+_0x3338a4(0x1da)),0x0;}catch(_0x4f7b17){if(_0x4f7b17 instanceof HTTPClientError&&_0x4f7b17[_0x3338a4(0x228)]===0x191)return printAuthError(_0x4f7b17),0x1;return console[_0x3338a4(0x211)](a7_0x296e95[_0x3338a4(0x1c9)]('✗\x20Validation\x20failed:\x20'+(_0x4f7b17 instanceof Error?_0x4f7b17['message']:String(_0x4f7b17)))),console['error'](_0x3338a4(0x1d5)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x3a27f4(0x1e0)]=a7_0x3a27f4(0x1ff);[a7_0x3a27f4(0x1dd)]=a7_0x3a27f4(0x1e6);async[a7_0x3a27f4(0x1c7)](_0x3b975e){const _0x1f4031=a7_0x3a27f4,{options:_0x11a71e,tdx:_0x5d276f}=_0x3b975e,_0x7a3ecf=_0x11a71e[_0x1f4031(0x204)],_0x102073=_0x11a71e[_0x1f4031(0x1fa)],_0x2b4f5a=_0x102073?_0x102073:_0x1f4031(0x20e);console[_0x1f4031(0x1e1)](_0x1f4031(0x1f2)+_0x2b4f5a+_0x1f4031(0x20d)+_0x7a3ecf+')');const _0x87b18b=await getOAuthTokens(_0x102073);if(_0x87b18b)console['log']('Credential\x20type:\x20OAuth'),console[_0x1f4031(0x1e1)]('Read\x20credential\x20from\x20keychain'+(_0x102073?_0x1f4031(0x1f9)+_0x102073+')':''));else{const _0x240a30=await resolveAPIKeyAsync(_0x7a3ecf,_0x102073);if(_0x240a30){const {source:_0x59de57,isDeprecated:_0x4f8e42}=_0x240a30,_0x4814c2=_0x1f4031(0x220)+_0x59de57;console[_0x1f4031(0x1e1)](_0x4f8e42?a7_0x296e95['yellow'](_0x4814c2):_0x4814c2);}else console[_0x1f4031(0x1e1)](a7_0x296e95['yellow'](_0x1f4031(0x21b)));}try{const _0x3e6c20=await _0x5d276f['jobs'][_0x1f4031(0x1df)]();return console['log'](a7_0x296e95[_0x1f4031(0x21a)](_0x1f4031(0x1f5))),console[_0x1f4031(0x1e1)](_0x1f4031(0x212)+_0x3e6c20[_0x1f4031(0x1c6)]),(_0x3e6c20[_0x1f4031(0x213)]||_0x3e6c20[_0x1f4031(0x21e)])&&console[_0x1f4031(0x1e1)](_0x1f4031(0x21d)+[_0x3e6c20[_0x1f4031(0x213)],_0x3e6c20[_0x1f4031(0x21e)]][_0x1f4031(0x1e4)](Boolean)[_0x1f4031(0x1d3)]('\x20')),0x0;}catch(_0x3270ea){return _0x3270ea instanceof HTTPClientError&&_0x3270ea['status']===0x191?printAuthError(_0x3270ea,!![],_0x102073):console[_0x1f4031(0x211)](a7_0x296e95[_0x1f4031(0x1c9)](_0x1f4031(0x226)+(_0x3270ea instanceof Error?_0x3270ea[_0x1f4031(0x1d4)]:String(_0x3270ea)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x3a27f4(0x1e0)]=a7_0x3a27f4(0x1ca);['description']=a7_0x3a27f4(0x1c8);async['execute'](_0x5805b6){const _0x1c30d0=a7_0x3a27f4,{options:_0x5ee698}=_0x5805b6,_0x4a198d=_0x5ee698['profile'];console[_0x1c30d0(0x1e1)](a7_0x296e95[_0x1c30d0(0x1cd)]('tdx:\x20auth\x20clear'));const _0x11c4ee=await isKeychainAvailable();if(!_0x11c4ee)return console[_0x1c30d0(0x211)](a7_0x296e95[_0x1c30d0(0x1c9)](_0x1c30d0(0x224))),0x1;const [_0x562838,_0x841975]=await Promise[_0x1c30d0(0x1c2)]([deleteKeychainAPIKey(_0x4a198d),deleteOAuthTokens(_0x4a198d)]);if(_0x562838||_0x841975){clearCredentialCache();const _0x28641=[_0x562838&&_0x1c30d0(0x1d2),_0x841975&&_0x1c30d0(0x1db)][_0x1c30d0(0x1e4)](Boolean)[_0x1c30d0(0x1d3)](_0x1c30d0(0x1ef));return console[_0x1c30d0(0x1e1)]('✓\x20'+_0x28641+_0x1c30d0(0x1fd)+(_0x4a198d?_0x1c30d0(0x1f9)+_0x4a198d+')':'')),0x0;}else return console[_0x1c30d0(0x1e1)](_0x1c30d0(0x217)+(_0x4a198d?_0x1c30d0(0x209)+_0x4a198d:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x72b2f8=a8_0x58db;(function(_0x3a1654,_0x4659c9){const _0x15cac9=a8_0x58db,_0x17677b=_0x3a1654();while(!![]){try{const _0x172117=-parseInt(_0x15cac9(0x1b5))/0x1+-parseInt(_0x15cac9(0x1a9))/0x2+-parseInt(_0x15cac9(0x18c))/0x3*(parseInt(_0x15cac9(0x192))/0x4)+parseInt(_0x15cac9(0x1cf))/0x5*(-parseInt(_0x15cac9(0x1e3))/0x6)+parseInt(_0x15cac9(0x1c7))/0x7*(-parseInt(_0x15cac9(0x1d4))/0x8)+parseInt(_0x15cac9(0x1df))/0x9+parseInt(_0x15cac9(0x1ef))/0xa*(parseInt(_0x15cac9(0x1c9))/0xb);if(_0x172117===_0x4659c9)break;else _0x17677b['push'](_0x17677b['shift']());}catch(_0x12e1d9){_0x17677b['push'](_0x17677b['shift']());}}}(a8_0x4adb,0x4fe4b));import{BaseCommand}from'./command.js';function a8_0x4adb(){const _0x1abfe2=['\x0aSample\x20Rows\x20(','Fetching\x20composable\x20audiences...','population','content','session','Pull\x20composable\x20audience\x20to\x20YAML\x20files','\x20YAML\x20file(s)','Error:\x20\x20','Fetching\x20audience\x20\x27','814314XGKHAs','cas:preview','Found\x20','Context\x20set:\x20','\x20file(s)\x20to\x20write\x20','dim','4dsugrR','setPhase','names','cas:list','Use\x20','toLocaleString','Audience\x20name\x20required.','pull','Preview\x20composable\x20segment\x20query\x20on\x20CDW','get','push','No\x20composable\x20audience\x20specified.','\x20\x20Schema:\x20','green','No\x20YAML\x20files\x20found\x20in:\x20','behaviors','audiences','Would\x20push:\x20','dirname','masterTable','filter','Master\x20Table','\x20(time:\x20','1130998jQnswG','Attributes\x20(','Count:\x20\x20','type','counts','error','count','red','Pulling\x20composable\x20audience\x20\x27','log','masterSchema','\x20segment(s)','559953rGzYTH','cyan','composableAudience','cwd','Analyzing\x20CAS\x20YAML\x20files...','\x27...','\x20activations)','Source:\x20\x20\x20','table','attributes','description','schema','🧊\x20','\x20audience(s)','\x0a⚠\x20Experimental:\x20CAS\x20push\x20runs\x20in\x20dry-run\x20mode\x20only.\x20Push\x20support\x20is\x20not\x20yet\x20complete.','tdx\x20cas\x20desc\x20<name>','timeColumn','tdx\x20cas\x20pull\x20<name>','7nNonHQ','list','77Rzucgh','data','length','underline','tdx\x20cas\x20push\x20<path>','cas','5JVDsGB','diff','(dry\x20run\x20—\x20push\x20is\x20not\x20yet\x20implemented)','Tip:\x20Run\x20`tdx\x20cas\x20pull\x20<name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','rows','2618904TwhcHN','Directory\x20not\x20found:\x20','tdx\x20use\x20cas\x20<name>','masterKeyColumn','hasChanges','verbose','cas:desc','basename','files','cas:push','bold','3194244JhQvBB','yellow','dryRun','yes','2078346HDxBEH','\x20=\x20','No\x20composable\x20audiences\x20found.','All\x20files\x20are\x20up\x20to\x20date.','(dry\x20run\x20—\x20no\x20files\x20written)','activations','absolutePath','\x20—\x20','Behaviors\x20(','join','Describe\x20a\x20composable\x20audience','No\x20CAS\x20resources\x20found\x20in\x20YAML\x20files.','2918530pGJtWE','segments','success','\x20or\x20set\x20context\x20with\x20','isNew','name','execute','utf-8','\x20segments,\x20','relativePath','Running\x20preview\x20for\x20\x27'];a8_0x4adb=function(){return _0x1abfe2;};return a8_0x4adb();}import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import a8_0x498081 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a8_0x27b4b3 from'path';import{confirmKey,isInteractive}from'../utils/prompt.js';import{collectYamlFiles}from'../sdk/cas/push-workflow.js';import{saveSessionContext}from'../core/session.js';function a8_0x58db(_0x3078de,_0x577530){_0x3078de=_0x3078de-0x17d;const _0x4adb23=a8_0x4adb();let _0x58dbca=_0x4adb23[_0x3078de];return _0x58dbca;}import{sanitizeFileName}from'../utils/string-utils.js';export class CASListCommand extends BaseCommand{[a8_0x72b2f8(0x17d)]=a8_0x72b2f8(0x195);[a8_0x72b2f8(0x1bf)]='List\x20composable\x20audiences';async[a8_0x72b2f8(0x17e)](_0x4124e1){const _0x41dd4f=a8_0x72b2f8,{options:_0x1b8856,tdx:_0x4619ff}=_0x4124e1,_0x4c6b89=await withProgressSpinner(_0x41dd4f(0x184),()=>_0x4619ff['cas'][_0x41dd4f(0x1c8)](),{'verbose':_0x1b8856[_0x41dd4f(0x1d9)]}),_0x14879d=_0x4c6b89['data'];if(isStructuredFormat(_0x1b8856))return await handleSDKOutput(_0x14879d,_0x1b8856),0x0;if(_0x14879d[_0x41dd4f(0x1cb)]===0x0)return console[_0x41dd4f(0x1b2)](a8_0x498081[_0x41dd4f(0x191)](_0x41dd4f(0x1e5))),0x0;console['log'](a8_0x498081[_0x41dd4f(0x19f)](_0x41dd4f(0x18e)+_0x14879d[_0x41dd4f(0x1cb)]+'\x20composable\x20audiences'));for(const _0x209d42 of _0x14879d){const _0x53c580=_0x209d42[_0x41dd4f(0x185)]?a8_0x498081['dim']('\x20('+Number(_0x209d42['population'])[_0x41dd4f(0x197)]()+')'):'',_0x2432cc=a8_0x498081['dim']('\x20'+_0x209d42[_0x41dd4f(0x1b3)]+'.'+_0x209d42['masterTable']);console['log'](_0x41dd4f(0x1c1)+_0x209d42[_0x41dd4f(0x17d)]+_0x53c580+_0x2432cc),_0x209d42['description']&&console[_0x41dd4f(0x1b2)]('\x20\x20'+a8_0x498081[_0x41dd4f(0x191)](_0x209d42[_0x41dd4f(0x1bf)]));}return 0x0;}}export class CASDescCommand extends BaseCommand{[a8_0x72b2f8(0x17d)]=a8_0x72b2f8(0x1da);[a8_0x72b2f8(0x1bf)]=a8_0x72b2f8(0x1ed);async[a8_0x72b2f8(0x17e)](_0x2d5395){const _0x22a251=a8_0x72b2f8,{options:_0x5d8e2d,args:_0x108018,tdx:_0x283403}=_0x2d5395,_0x2c7139=_0x108018[0x0]||_0x5d8e2d['composableAudience'];if(!_0x2c7139)return console[_0x22a251(0x1ae)](a8_0x498081[_0x22a251(0x1e0)](_0x22a251(0x19d))),console[_0x22a251(0x1ae)]('Use\x20'+a8_0x498081['cyan'](_0x22a251(0x1c4))+_0x22a251(0x1f2)+a8_0x498081[_0x22a251(0x1b6)](_0x22a251(0x1d6))),0x1;const _0x4767f4=await withProgressSpinner(_0x22a251(0x18b)+_0x2c7139+_0x22a251(0x1ba),()=>_0x283403['cas'][_0x22a251(0x19b)](_0x2c7139),{'verbose':_0x5d8e2d[_0x22a251(0x1d9)]}),_0x10c43b=_0x4767f4['data'];if(isStructuredFormat(_0x5d8e2d))return await handleSingleObjectOutput(_0x10c43b,_0x5d8e2d),0x0;console[_0x22a251(0x1b2)](a8_0x498081[_0x22a251(0x1de)](_0x10c43b['name']));if(_0x10c43b['description'])console[_0x22a251(0x1b2)](a8_0x498081[_0x22a251(0x191)](_0x10c43b[_0x22a251(0x1bf)]));console[_0x22a251(0x1b2)](),console[_0x22a251(0x1b2)](a8_0x498081[_0x22a251(0x1cc)](_0x22a251(0x1a7))),console[_0x22a251(0x1b2)](_0x22a251(0x19e)+_0x10c43b['masterSchema']),console['log']('\x20\x20Table:\x20\x20'+_0x10c43b[_0x22a251(0x1a5)]),console[_0x22a251(0x1b2)]('\x20\x20Key:\x20\x20\x20\x20'+_0x10c43b[_0x22a251(0x1d7)]),console[_0x22a251(0x1b2)]();if(_0x10c43b['attributes']?.[_0x22a251(0x1cb)]){console[_0x22a251(0x1b2)](a8_0x498081['underline'](_0x22a251(0x1aa)+_0x10c43b[_0x22a251(0x1be)][_0x22a251(0x1cb)]+')'));for(const _0x155833 of _0x10c43b[_0x22a251(0x1be)]){console[_0x22a251(0x1b2)]('\x20\x20'+a8_0x498081[_0x22a251(0x1de)](_0x155833['name'])+'\x20—\x20'+_0x155833['schema']+'.'+_0x155833[_0x22a251(0x1bd)]+'.'+_0x155833['column']+'\x20('+a8_0x498081[_0x22a251(0x191)](_0x155833[_0x22a251(0x1ac)])+')');}console['log']();}if(_0x10c43b[_0x22a251(0x1a1)]?.[_0x22a251(0x1cb)]){console['log'](a8_0x498081[_0x22a251(0x1cc)](_0x22a251(0x1eb)+_0x10c43b[_0x22a251(0x1a1)][_0x22a251(0x1cb)]+')'));for(const _0x39b920 of _0x10c43b[_0x22a251(0x1a1)]){const _0x4de21b=_0x39b920[_0x22a251(0x1c5)]?_0x22a251(0x1a8)+_0x39b920['timeColumn']+')':'';console[_0x22a251(0x1b2)]('\x20\x20'+a8_0x498081[_0x22a251(0x1de)](_0x39b920[_0x22a251(0x17d)])+_0x22a251(0x1ea)+_0x39b920[_0x22a251(0x1c0)]+'.'+_0x39b920[_0x22a251(0x1bd)]+_0x4de21b);}}return 0x0;}}export class CASPullCommand extends BaseCommand{[a8_0x72b2f8(0x17d)]='cas:pull';[a8_0x72b2f8(0x1bf)]=a8_0x72b2f8(0x188);async[a8_0x72b2f8(0x17e)](_0x3cd2da){const _0x4f8dee=a8_0x72b2f8,{options:_0x5a8dd2,args:_0x2e9734,tdx:_0x3a4d4e}=_0x3cd2da,_0x38bca0=_0x5a8dd2,_0x3d3888=_0x2e9734[0x0]||_0x5a8dd2[_0x4f8dee(0x1b7)];if(!_0x3d3888)return console['error'](a8_0x498081[_0x4f8dee(0x1e0)](_0x4f8dee(0x19d))),console['error'](_0x4f8dee(0x196)+a8_0x498081[_0x4f8dee(0x1b6)](_0x4f8dee(0x1c6))+_0x4f8dee(0x1f2)+a8_0x498081[_0x4f8dee(0x1b6)](_0x4f8dee(0x1d6))),0x1;const _0x1ae2a1=_0x38bca0['dir']||a8_0x27b4b3[_0x4f8dee(0x1ec)](process[_0x4f8dee(0x1b8)](),_0x4f8dee(0x1ce),sanitizeFileName(_0x3d3888)),_0x5cda9e=await withProgressSpinner(_0x4f8dee(0x1b1)+_0x3d3888+'\x27...',_0x3f04ac=>_0x3a4d4e['cas'][_0x4f8dee(0x199)](_0x3d3888,{'targetDir':_0x1ae2a1,'verbose':_0x38bca0[_0x4f8dee(0x1d9)],'progress':{'update':_0x47074d=>_0x3f04ac[_0x4f8dee(0x193)](_0x47074d)}}),{'verbose':_0x38bca0[_0x4f8dee(0x1d9)]}),_0x3b3892=_0x5cda9e[_0x4f8dee(0x1ca)],_0xe60691=_0x3b3892[_0x4f8dee(0x1dc)][_0x4f8dee(0x1a6)](_0x2da598=>_0x2da598[_0x4f8dee(0x1f3)]||_0x2da598[_0x4f8dee(0x1d8)]);saveSessionContext({'composable_audience':_0x3b3892['audienceName']},_0x38bca0[_0x4f8dee(0x187)]),console[_0x4f8dee(0x1b2)](a8_0x498081['green'](_0x4f8dee(0x18f)+a8_0x498081['dim']('composable_audience')+_0x4f8dee(0x1e4)+a8_0x498081[_0x4f8dee(0x1b6)](_0x3b3892['audienceName'])));if(_0xe60691[_0x4f8dee(0x1cb)]===0x0)return console[_0x4f8dee(0x1b2)](a8_0x498081[_0x4f8dee(0x19f)](_0x4f8dee(0x1e6))),0x0;for(const _0x2aa2a5 of _0xe60691){if(_0x2aa2a5['isNew'])console[_0x4f8dee(0x1b2)](a8_0x498081[_0x4f8dee(0x19f)]('+\x20'+_0x2aa2a5[_0x4f8dee(0x181)]+'\x20(new)'));else _0x2aa2a5[_0x4f8dee(0x1d0)]&&(console[_0x4f8dee(0x1b2)](a8_0x498081[_0x4f8dee(0x1e0)]('~\x20'+_0x2aa2a5['relativePath'])),console['log'](_0x2aa2a5['diff']));}console[_0x4f8dee(0x1b2)]('\x0a'+_0xe60691[_0x4f8dee(0x1cb)]+_0x4f8dee(0x190)+('('+_0x3b3892[_0x4f8dee(0x1ad)][_0x4f8dee(0x1f0)]+_0x4f8dee(0x180)+_0x3b3892['counts']['activations']+_0x4f8dee(0x1bb)));if(_0x38bca0[_0x4f8dee(0x1e1)])return console[_0x4f8dee(0x1b2)](a8_0x498081[_0x4f8dee(0x191)](_0x4f8dee(0x1e7))),0x0;if(!_0x38bca0[_0x4f8dee(0x1e2)]&&isInteractive()){const _0x2b3c7a=await confirmKey('Write\x20files?');if(!_0x2b3c7a)return console['log'](a8_0x498081[_0x4f8dee(0x191)]('Cancelled.')),0x0;}for(const _0x240dba of _0xe60691){const _0x318a78=a8_0x27b4b3[_0x4f8dee(0x1a4)](_0x240dba[_0x4f8dee(0x1e9)]);if(!existsSync(_0x318a78))mkdirSync(_0x318a78,{'recursive':!![]});writeFileSync(_0x240dba[_0x4f8dee(0x1e9)],_0x240dba[_0x4f8dee(0x186)],_0x4f8dee(0x17f));}return console[_0x4f8dee(0x1b2)](a8_0x498081['green']('Wrote\x20'+_0xe60691[_0x4f8dee(0x1cb)]+'\x20file(s)\x20to\x20'+_0x1ae2a1)),0x0;}}export class CASPushCommand extends BaseCommand{[a8_0x72b2f8(0x17d)]=a8_0x72b2f8(0x1dd);[a8_0x72b2f8(0x1bf)]='Push\x20YAML\x20files\x20to\x20CAS\x20API';async['execute'](_0x272e25){const _0x2d3a51=a8_0x72b2f8,{options:_0x5f1ea2,args:_0x54a252,tdx:_0x617223}=_0x272e25,_0x126a20=_0x5f1ea2;let _0x487953=_0x54a252[0x0];!_0x487953&&_0x5f1ea2[_0x2d3a51(0x1b7)]&&(_0x487953=a8_0x27b4b3[_0x2d3a51(0x1ec)](process['cwd'](),_0x2d3a51(0x1ce),sanitizeFileName(_0x5f1ea2[_0x2d3a51(0x1b7)])));if(!_0x487953)return console['error'](a8_0x498081['yellow']('No\x20composable\x20audience\x20specified.')),console[_0x2d3a51(0x1ae)]('Use\x20'+a8_0x498081[_0x2d3a51(0x1b6)](_0x2d3a51(0x1cd))+_0x2d3a51(0x1f2)+a8_0x498081[_0x2d3a51(0x1b6)](_0x2d3a51(0x1d6))),0x1;if(!existsSync(_0x487953))return console[_0x2d3a51(0x1ae)](a8_0x498081[_0x2d3a51(0x1b0)](_0x2d3a51(0x1d5)+_0x487953)),console[_0x2d3a51(0x1ae)](a8_0x498081[_0x2d3a51(0x191)](_0x2d3a51(0x1d2))),0x1;const _0x127929=_0x5f1ea2[_0x2d3a51(0x1b7)]||a8_0x27b4b3[_0x2d3a51(0x1db)](_0x487953),_0x1810e3=a8_0x27b4b3['relative'](process[_0x2d3a51(0x1b8)](),_0x487953)||'.';console[_0x2d3a51(0x1b2)]('Audience:\x20'+a8_0x498081[_0x2d3a51(0x1b6)](_0x127929)),console['log'](_0x2d3a51(0x1bc)+a8_0x498081[_0x2d3a51(0x191)](_0x1810e3)),console[_0x2d3a51(0x1b2)](a8_0x498081['yellow'](_0x2d3a51(0x1c3))),console[_0x2d3a51(0x1b2)]();const _0x3d73e0=collectYamlFiles(_0x487953);if(_0x3d73e0[_0x2d3a51(0x1cb)]===0x0)return console['error'](a8_0x498081[_0x2d3a51(0x1b0)](_0x2d3a51(0x1a0)+_0x487953)),0x1;console[_0x2d3a51(0x1b2)](_0x2d3a51(0x18e)+_0x3d73e0[_0x2d3a51(0x1cb)]+_0x2d3a51(0x189));const _0x411a8d=await withProgressSpinner(_0x2d3a51(0x1b9),_0x198c34=>_0x617223['cas'][_0x2d3a51(0x19c)](_0x3d73e0,{'dryRun':!![],'verbose':_0x126a20[_0x2d3a51(0x1d9)],'progress':{'update':_0xa655b9=>_0x198c34[_0x2d3a51(0x193)](_0xa655b9)}}),{'verbose':_0x126a20['verbose']}),_0x4aba59=_0x411a8d[_0x2d3a51(0x1ca)],{created:_0x372a10}=_0x4aba59,_0x1a6a1d=[];if(_0x372a10[_0x2d3a51(0x1a2)])_0x1a6a1d['push'](_0x372a10[_0x2d3a51(0x1a2)]+_0x2d3a51(0x1c2));if(_0x372a10[_0x2d3a51(0x1f0)])_0x1a6a1d['push'](_0x372a10[_0x2d3a51(0x1f0)]+_0x2d3a51(0x1b4));if(_0x372a10['activations'])_0x1a6a1d[_0x2d3a51(0x19c)](_0x372a10[_0x2d3a51(0x1e8)]+'\x20activation(s)');return _0x1a6a1d[_0x2d3a51(0x1cb)]===0x0?console['log'](a8_0x498081[_0x2d3a51(0x191)](_0x2d3a51(0x1ee))):console[_0x2d3a51(0x1b2)](_0x2d3a51(0x1a3)+_0x1a6a1d[_0x2d3a51(0x1ec)](',\x20')),console[_0x2d3a51(0x1b2)](a8_0x498081[_0x2d3a51(0x191)](_0x2d3a51(0x1d1))),0x0;}}export class CASPreviewCommand extends BaseCommand{[a8_0x72b2f8(0x17d)]=a8_0x72b2f8(0x18d);['description']=a8_0x72b2f8(0x19a);async[a8_0x72b2f8(0x17e)](_0x153544){const _0x36b5da=a8_0x72b2f8,{options:_0x290c54,args:_0x490829,tdx:_0x5b85ac}=_0x153544,_0x2ea009=_0x490829[0x0],_0x5bd30a=_0x490829[0x1]||_0x290c54[_0x36b5da(0x1b7)];if(!_0x2ea009)return console['error'](a8_0x498081['red']('Usage:\x20tdx\x20cas\x20preview\x20<segment_name>\x20[--audience\x20<name>]')),0x1;if(!_0x5bd30a)return console[_0x36b5da(0x1ae)](a8_0x498081[_0x36b5da(0x1e0)](_0x36b5da(0x198))),console[_0x36b5da(0x1ae)](_0x36b5da(0x196)+a8_0x498081['cyan']('--audience\x20<name>')+_0x36b5da(0x1f2)+a8_0x498081['cyan']('tdx\x20use\x20cas\x20<name>')),0x1;const _0x70a42c=await withProgressSpinner(_0x36b5da(0x182)+_0x2ea009+_0x36b5da(0x1ba),()=>_0x5b85ac[_0x36b5da(0x1ce)]['preview'](_0x5bd30a,_0x2ea009),{'verbose':_0x290c54[_0x36b5da(0x1d9)]}),{query:_0x1730eb,customers:_0x53915f}=_0x70a42c[_0x36b5da(0x1ca)];if(isStructuredFormat(_0x290c54))return await handleSingleObjectOutput({'query':_0x1730eb,'customers':_0x53915f},_0x290c54),0x0;const _0x32e1fa=_0x1730eb['status']===_0x36b5da(0x1f1)?a8_0x498081[_0x36b5da(0x19f)]:a8_0x498081[_0x36b5da(0x1e0)];console[_0x36b5da(0x1b2)]('Status:\x20'+_0x32e1fa(_0x1730eb['status'])),console[_0x36b5da(0x1b2)](_0x36b5da(0x1ab)+a8_0x498081[_0x36b5da(0x1de)](String(_0x1730eb[_0x36b5da(0x1af)])));_0x1730eb[_0x36b5da(0x1ae)]&&console['log'](_0x36b5da(0x18a)+a8_0x498081['red'](_0x1730eb[_0x36b5da(0x1ae)]));if(_0x53915f?.[_0x36b5da(0x194)]&&_0x53915f?.[_0x36b5da(0x1d3)]){console[_0x36b5da(0x1b2)](a8_0x498081[_0x36b5da(0x1cc)](_0x36b5da(0x183)+_0x53915f['rows'][_0x36b5da(0x1cb)]+')'));const _0x4e4857=_0x53915f[_0x36b5da(0x1d3)]['map'](_0x3aadac=>{const _0x3d7a49=_0x36b5da,_0x3460c5={};for(let _0x3b9384=0x0;_0x3b9384<_0x53915f[_0x3d7a49(0x194)][_0x3d7a49(0x1cb)];_0x3b9384++){_0x3460c5[_0x53915f[_0x3d7a49(0x194)][_0x3b9384]]=_0x3aadac[_0x3b9384];}return _0x3460c5;});await handleSDKOutput(_0x4e4857,_0x290c54);}return 0x0;}}
|
|
1
|
+
const a8_0x408d47=a8_0x3fb6;(function(_0x1920b2,_0x3c78c2){const _0x239517=a8_0x3fb6,_0x3da8ae=_0x1920b2();while(!![]){try{const _0xf276ae=-parseInt(_0x239517(0xd9))/0x1+-parseInt(_0x239517(0xfb))/0x2+parseInt(_0x239517(0x119))/0x3+-parseInt(_0x239517(0xe7))/0x4+parseInt(_0x239517(0xf1))/0x5+-parseInt(_0x239517(0xbe))/0x6+parseInt(_0x239517(0xda))/0x7;if(_0xf276ae===_0x3c78c2)break;else _0x3da8ae['push'](_0x3da8ae['shift']());}catch(_0x3ebbaf){_0x3da8ae['push'](_0x3da8ae['shift']());}}}(a8_0x1ffa,0xc68ba));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import a8_0x29b8f6 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a8_0x5d132a from'path';import{confirmKey,isInteractive}from'../utils/prompt.js';import{collectYamlFiles}from'../sdk/cas/push-workflow.js';import{saveSessionContext}from'../core/session.js';function a8_0x3fb6(_0x4e73e1,_0x3a9aca){_0x4e73e1=_0x4e73e1-0xae;const _0x1ffafd=a8_0x1ffa();let _0x3fb61c=_0x1ffafd[_0x4e73e1];return _0x3fb61c;}import{sanitizeFileName}from'../utils/string-utils.js';export class CASListCommand extends BaseCommand{['name']='cas:list';[a8_0x408d47(0xd0)]=a8_0x408d47(0xb6);async[a8_0x408d47(0xd6)](_0x3eb3d5){const _0x13c3f2=a8_0x408d47,{options:_0x571b7b,tdx:_0x42c22a}=_0x3eb3d5,_0x2ad3a4=await withProgressSpinner(_0x13c3f2(0xe0),()=>_0x42c22a['cas']['list'](),{'verbose':_0x571b7b[_0x13c3f2(0xe3)]}),_0x2cb64e=_0x2ad3a4[_0x13c3f2(0xed)];if(isStructuredFormat(_0x571b7b))return await handleSDKOutput(_0x2cb64e,_0x571b7b),0x0;if(_0x2cb64e[_0x13c3f2(0xf9)]===0x0)return console['log'](a8_0x29b8f6[_0x13c3f2(0x11d)](_0x13c3f2(0xcc))),0x0;console[_0x13c3f2(0xbb)](a8_0x29b8f6[_0x13c3f2(0xdf)](_0x13c3f2(0xcb)+_0x2cb64e['length']+_0x13c3f2(0x108)));for(const _0x29b6a4 of _0x2cb64e){const _0x5072f5=_0x29b6a4[_0x13c3f2(0x118)]?a8_0x29b8f6[_0x13c3f2(0x11d)]('\x20('+Number(_0x29b6a4['population'])[_0x13c3f2(0xc7)]()+')'):'',_0x4ebc23=a8_0x29b8f6[_0x13c3f2(0x11d)]('\x20'+_0x29b6a4[_0x13c3f2(0x110)]+'.'+_0x29b6a4[_0x13c3f2(0x11a)]);console[_0x13c3f2(0xbb)](_0x13c3f2(0xcf)+_0x29b6a4[_0x13c3f2(0x117)]+_0x5072f5+_0x4ebc23),_0x29b6a4[_0x13c3f2(0xd0)]&&console[_0x13c3f2(0xbb)]('\x20\x20'+a8_0x29b8f6[_0x13c3f2(0x11d)](_0x29b6a4[_0x13c3f2(0xd0)]));}return 0x0;}}export class CASDescCommand extends BaseCommand{[a8_0x408d47(0x117)]='cas:desc';[a8_0x408d47(0xd0)]=a8_0x408d47(0xc6);async[a8_0x408d47(0xd6)](_0x4daafd){const _0x4a9eea=a8_0x408d47,{options:_0x41d0b9,args:_0x5e8769,tdx:_0x45e8ad}=_0x4daafd,_0x542523=_0x5e8769[0x0]||_0x41d0b9[_0x4a9eea(0xd1)];if(!_0x542523)return console['error'](a8_0x29b8f6[_0x4a9eea(0xc9)](_0x4a9eea(0xe5))),console[_0x4a9eea(0x113)](_0x4a9eea(0xf2)+a8_0x29b8f6[_0x4a9eea(0xdb)](_0x4a9eea(0xb7))+'\x20or\x20set\x20context\x20with\x20'+a8_0x29b8f6['cyan'](_0x4a9eea(0xbc))),0x1;const _0x293758=await withProgressSpinner(_0x4a9eea(0xec)+_0x542523+_0x4a9eea(0x111),()=>_0x45e8ad[_0x4a9eea(0x106)]['get'](_0x542523),{'verbose':_0x41d0b9[_0x4a9eea(0xe3)]}),_0x370be8=_0x293758[_0x4a9eea(0xed)];if(isStructuredFormat(_0x41d0b9))return await handleSingleObjectOutput(_0x370be8,_0x41d0b9),0x0;console[_0x4a9eea(0xbb)](a8_0x29b8f6[_0x4a9eea(0x10b)](_0x370be8[_0x4a9eea(0x117)]));if(_0x370be8['description'])console['log'](a8_0x29b8f6[_0x4a9eea(0x11d)](_0x370be8[_0x4a9eea(0xd0)]));console[_0x4a9eea(0xbb)](),console[_0x4a9eea(0xbb)](a8_0x29b8f6['underline']('Master\x20Table')),console[_0x4a9eea(0xbb)](_0x4a9eea(0xde)+_0x370be8[_0x4a9eea(0x110)]),console[_0x4a9eea(0xbb)]('\x20\x20Table:\x20\x20'+_0x370be8[_0x4a9eea(0x11a)]),console[_0x4a9eea(0xbb)](_0x4a9eea(0x112)+_0x370be8[_0x4a9eea(0x115)]),console['log']();if(_0x370be8['attributes']?.[_0x4a9eea(0xf9)]){console[_0x4a9eea(0xbb)](a8_0x29b8f6[_0x4a9eea(0xd2)](_0x4a9eea(0xe4)+_0x370be8[_0x4a9eea(0x10e)][_0x4a9eea(0xf9)]+')'));for(const _0x446d9b of _0x370be8[_0x4a9eea(0x10e)]){console[_0x4a9eea(0xbb)]('\x20\x20'+a8_0x29b8f6[_0x4a9eea(0x10b)](_0x446d9b['name'])+_0x4a9eea(0x100)+_0x446d9b[_0x4a9eea(0xb2)]+'.'+_0x446d9b['table']+'.'+_0x446d9b[_0x4a9eea(0xeb)]+'\x20('+a8_0x29b8f6[_0x4a9eea(0x11d)](_0x446d9b[_0x4a9eea(0xc2)])+')');}console[_0x4a9eea(0xbb)]();}if(_0x370be8[_0x4a9eea(0xc4)]?.[_0x4a9eea(0xf9)]){console['log'](a8_0x29b8f6[_0x4a9eea(0xd2)]('Behaviors\x20('+_0x370be8[_0x4a9eea(0xc4)][_0x4a9eea(0xf9)]+')'));for(const _0x4f8b1b of _0x370be8[_0x4a9eea(0xc4)]){const _0x2c61e1=_0x4f8b1b['timeColumn']?_0x4a9eea(0x121)+_0x4f8b1b[_0x4a9eea(0xfa)]+')':'';console[_0x4a9eea(0xbb)]('\x20\x20'+a8_0x29b8f6[_0x4a9eea(0x10b)](_0x4f8b1b[_0x4a9eea(0x117)])+_0x4a9eea(0x100)+_0x4f8b1b[_0x4a9eea(0xb2)]+'.'+_0x4f8b1b[_0x4a9eea(0xb4)]+_0x2c61e1);}}return 0x0;}}export class CASPullCommand extends BaseCommand{[a8_0x408d47(0x117)]='cas:pull';[a8_0x408d47(0xd0)]='Pull\x20composable\x20audience\x20to\x20YAML\x20files';async[a8_0x408d47(0xd6)](_0x20437c){const _0x3df191=a8_0x408d47,{options:_0x5c39ef,args:_0x4eaa40,tdx:_0xd53a76}=_0x20437c,_0x380c0b=_0x5c39ef,_0x37235d=_0x4eaa40[0x0]||_0x5c39ef[_0x3df191(0xd1)];if(!_0x37235d)return console['error'](a8_0x29b8f6['yellow']('No\x20composable\x20audience\x20specified.')),console[_0x3df191(0x113)](_0x3df191(0xf2)+a8_0x29b8f6[_0x3df191(0xdb)](_0x3df191(0xbd))+_0x3df191(0xd5)+a8_0x29b8f6['cyan'](_0x3df191(0xbc))),0x1;const _0x397935=_0x380c0b[_0x3df191(0x116)]||a8_0x5d132a[_0x3df191(0xb1)](process[_0x3df191(0xd8)](),_0x3df191(0x106),sanitizeFileName(_0x37235d)),_0x1743ed=await withProgressSpinner(_0x3df191(0x11b)+_0x37235d+_0x3df191(0x111),_0x42bb70=>_0xd53a76['cas'][_0x3df191(0x120)](_0x37235d,{'targetDir':_0x397935,'verbose':_0x380c0b[_0x3df191(0xe3)],'progress':{'update':_0xa6b44e=>_0x42bb70[_0x3df191(0xf8)](_0xa6b44e)}}),{'verbose':_0x380c0b[_0x3df191(0xe3)]}),_0x46cfc5=_0x1743ed['data'],_0x1799c1=_0x46cfc5[_0x3df191(0x10d)][_0x3df191(0xf7)](_0x1a04b0=>_0x1a04b0[_0x3df191(0xb3)]||_0x1a04b0[_0x3df191(0xdd)]);saveSessionContext({'composable_audience':_0x46cfc5[_0x3df191(0xcd)]},_0x380c0b[_0x3df191(0xfd)]),console[_0x3df191(0xbb)](a8_0x29b8f6['green'](_0x3df191(0xc0)+a8_0x29b8f6['dim'](_0x3df191(0x10f))+_0x3df191(0xea)+a8_0x29b8f6['cyan'](_0x46cfc5[_0x3df191(0xcd)])));if(_0x1799c1[_0x3df191(0xf9)]===0x0)return console['log'](a8_0x29b8f6[_0x3df191(0xdf)]('All\x20files\x20are\x20up\x20to\x20date.')),0x0;for(const _0x4f29d7 of _0x1799c1){if(_0x4f29d7[_0x3df191(0xb3)])console[_0x3df191(0xbb)](a8_0x29b8f6['green']('+\x20'+_0x4f29d7[_0x3df191(0x102)]+_0x3df191(0xe9)));else _0x4f29d7['diff']&&(console['log'](a8_0x29b8f6[_0x3df191(0xc9)]('~\x20'+_0x4f29d7[_0x3df191(0x102)])),console[_0x3df191(0xbb)](_0x4f29d7[_0x3df191(0x107)]));}console[_0x3df191(0xbb)]('\x0a'+_0x1799c1[_0x3df191(0xf9)]+_0x3df191(0xf0)+('('+_0x46cfc5[_0x3df191(0xee)][_0x3df191(0xd3)]+_0x3df191(0xd4)+_0x46cfc5[_0x3df191(0xee)][_0x3df191(0xef)]+_0x3df191(0xc8)));if(_0x380c0b[_0x3df191(0xae)])return console['log'](a8_0x29b8f6[_0x3df191(0x11d)](_0x3df191(0xe1))),0x0;if(!_0x380c0b[_0x3df191(0x10a)]&&isInteractive()){const _0x3d3464=await confirmKey(_0x3df191(0xdc));if(!_0x3d3464)return console[_0x3df191(0xbb)](a8_0x29b8f6['dim'](_0x3df191(0xc5))),0x0;}for(const _0x2649f6 of _0x1799c1){const _0x2aa69a=a8_0x5d132a[_0x3df191(0xd7)](_0x2649f6[_0x3df191(0x109)]);if(!existsSync(_0x2aa69a))mkdirSync(_0x2aa69a,{'recursive':!![]});writeFileSync(_0x2649f6[_0x3df191(0x109)],_0x2649f6['content'],_0x3df191(0xe8));}return console['log'](a8_0x29b8f6['green'](_0x3df191(0x103)+_0x1799c1[_0x3df191(0xf9)]+_0x3df191(0xff)+_0x397935)),0x0;}}export class CASPushCommand extends BaseCommand{['name']=a8_0x408d47(0xe2);[a8_0x408d47(0xd0)]=a8_0x408d47(0xfe);async['execute'](_0x2365dd){const _0x1c84ce=a8_0x408d47,{options:_0x44f71e,args:_0x5ee643,tdx:_0x365aa7}=_0x2365dd,_0x28ae13=_0x44f71e;let _0x5224b8=_0x5ee643[0x0];!_0x5224b8&&_0x44f71e[_0x1c84ce(0xd1)]&&(_0x5224b8=a8_0x5d132a[_0x1c84ce(0xb1)](process[_0x1c84ce(0xd8)](),_0x1c84ce(0x106),sanitizeFileName(_0x44f71e[_0x1c84ce(0xd1)])));if(!_0x5224b8)return console[_0x1c84ce(0x113)](a8_0x29b8f6[_0x1c84ce(0xc9)](_0x1c84ce(0xe5))),console[_0x1c84ce(0x113)](_0x1c84ce(0xf2)+a8_0x29b8f6[_0x1c84ce(0xdb)](_0x1c84ce(0xb9))+_0x1c84ce(0xd5)+a8_0x29b8f6[_0x1c84ce(0xdb)]('tdx\x20use\x20cas\x20<name>')),0x1;if(!existsSync(_0x5224b8))return console[_0x1c84ce(0x113)](a8_0x29b8f6['red'](_0x1c84ce(0xce)+_0x5224b8)),console['error'](a8_0x29b8f6[_0x1c84ce(0x11d)](_0x1c84ce(0x105))),0x1;const _0x2af3dc=_0x44f71e['composableAudience']||a8_0x5d132a[_0x1c84ce(0xfc)](_0x5224b8),_0x28e0de=a8_0x5d132a[_0x1c84ce(0xba)](process[_0x1c84ce(0xd8)](),_0x5224b8)||'.';console['log'](_0x1c84ce(0xf6)+a8_0x29b8f6['cyan'](_0x2af3dc)),console[_0x1c84ce(0xbb)](_0x1c84ce(0xc3)+a8_0x29b8f6[_0x1c84ce(0x11d)](_0x28e0de)),console[_0x1c84ce(0xbb)](a8_0x29b8f6['yellow']('\x0a⚠\x20Experimental:\x20CAS\x20push\x20runs\x20in\x20dry-run\x20mode\x20only.\x20Push\x20support\x20is\x20not\x20yet\x20complete.')),console[_0x1c84ce(0xbb)]();const _0x1c2f23=collectYamlFiles(_0x5224b8);if(_0x1c2f23['length']===0x0)return console[_0x1c84ce(0x113)](a8_0x29b8f6[_0x1c84ce(0xb0)](_0x1c84ce(0xf5)+_0x5224b8)),0x1;console['log']('Found\x20'+_0x1c2f23[_0x1c84ce(0xf9)]+'\x20YAML\x20file(s)');const _0x2a149b=await withProgressSpinner(_0x1c84ce(0xc1),_0x4e87ad=>_0x365aa7[_0x1c84ce(0x106)][_0x1c84ce(0xb8)](_0x1c2f23,{'dryRun':!![],'verbose':_0x28ae13[_0x1c84ce(0xe3)],'progress':{'update':_0x1a82bb=>_0x4e87ad['setPhase'](_0x1a82bb)}}),{'verbose':_0x28ae13['verbose']}),_0x206162=_0x2a149b[_0x1c84ce(0xed)],{created:_0x455867}=_0x206162,_0x56c35e=[];if(_0x455867[_0x1c84ce(0xf4)])_0x56c35e['push'](_0x455867[_0x1c84ce(0xf4)]+'\x20audience(s)');if(_0x455867[_0x1c84ce(0xd3)])_0x56c35e['push'](_0x455867['segments']+_0x1c84ce(0x11e));if(_0x455867[_0x1c84ce(0xef)])_0x56c35e[_0x1c84ce(0xb8)](_0x455867[_0x1c84ce(0xef)]+_0x1c84ce(0x122));return _0x56c35e['length']===0x0?console['log'](a8_0x29b8f6[_0x1c84ce(0x11d)]('No\x20CAS\x20resources\x20found\x20in\x20YAML\x20files.')):console[_0x1c84ce(0xbb)](_0x1c84ce(0xca)+_0x56c35e['join'](',\x20')),console[_0x1c84ce(0xbb)](a8_0x29b8f6[_0x1c84ce(0x11d)](_0x1c84ce(0xe6))),0x0;}}export class CASPreviewCommand extends BaseCommand{[a8_0x408d47(0x117)]='cas:preview';[a8_0x408d47(0xd0)]='Preview\x20composable\x20segment\x20query\x20on\x20CDW';async[a8_0x408d47(0xd6)](_0x4b3549){const _0x105a72=a8_0x408d47,{options:_0x538d7f,args:_0x2f1d65,tdx:_0x3cb817}=_0x4b3549,_0x10655c=_0x2f1d65[0x0],_0x335f3f=_0x2f1d65[0x1]||_0x538d7f[_0x105a72(0xd1)];if(!_0x10655c)return console[_0x105a72(0x113)](a8_0x29b8f6['red'](_0x105a72(0xf3))),0x1;if(!_0x335f3f)return console[_0x105a72(0x113)](a8_0x29b8f6['yellow']('Audience\x20name\x20required.')),console[_0x105a72(0x113)](_0x105a72(0xf2)+a8_0x29b8f6[_0x105a72(0xdb)](_0x105a72(0x104))+_0x105a72(0xd5)+a8_0x29b8f6[_0x105a72(0xdb)](_0x105a72(0xbc))),0x1;const _0x4f2de1=await withProgressSpinner(_0x105a72(0x114)+_0x10655c+_0x105a72(0x111),()=>_0x3cb817[_0x105a72(0x106)][_0x105a72(0xb5)](_0x335f3f,_0x10655c),{'verbose':_0x538d7f[_0x105a72(0xe3)]}),{query:_0x3fcfd7,customers:_0x4bbf27}=_0x4f2de1[_0x105a72(0xed)];if(isStructuredFormat(_0x538d7f))return await handleSingleObjectOutput({'query':_0x3fcfd7,'customers':_0x4bbf27},_0x538d7f),0x0;const _0x15c98e=_0x3fcfd7['status']===_0x105a72(0x11f)?a8_0x29b8f6[_0x105a72(0xdf)]:a8_0x29b8f6[_0x105a72(0xc9)];console['log'](_0x105a72(0x101)+_0x15c98e(_0x3fcfd7['status'])),console[_0x105a72(0xbb)]('Count:\x20\x20'+a8_0x29b8f6[_0x105a72(0x10b)](String(_0x3fcfd7['count'])));_0x3fcfd7['error']&&console['log'](_0x105a72(0xbf)+a8_0x29b8f6[_0x105a72(0xb0)](_0x3fcfd7[_0x105a72(0x113)]));if(_0x4bbf27?.[_0x105a72(0x11c)]&&_0x4bbf27?.[_0x105a72(0xaf)]){console[_0x105a72(0xbb)](a8_0x29b8f6[_0x105a72(0xd2)](_0x105a72(0x10c)+_0x4bbf27[_0x105a72(0xaf)][_0x105a72(0xf9)]+')'));const _0x314779=_0x4bbf27[_0x105a72(0xaf)]['map'](_0x8bf5c6=>{const _0x1f0363=_0x105a72,_0x5a7642={};for(let _0x2f3623=0x0;_0x2f3623<_0x4bbf27[_0x1f0363(0x11c)]['length'];_0x2f3623++){_0x5a7642[_0x4bbf27['names'][_0x2f3623]]=_0x8bf5c6[_0x2f3623];}return _0x5a7642;});await handleSDKOutput(_0x314779,_0x538d7f);}return 0x0;}}function a8_0x1ffa(){const _0x2a5a89=['bold','\x0aSample\x20Rows\x20(','files','attributes','composable_audience','masterSchema','\x27...','\x20\x20Key:\x20\x20\x20\x20','error','Running\x20preview\x20for\x20\x27','masterKeyColumn','dir','name','population','3190425SoIKLJ','masterTable','Pulling\x20composable\x20audience\x20\x27','names','dim','\x20segment(s)','success','pull','\x20(time:\x20','\x20activation(s)','dryRun','rows','red','join','schema','isNew','table','preview','List\x20composable\x20audiences','tdx\x20cas\x20desc\x20<name>','push','tdx\x20cas\x20push\x20<path>','relative','log','tdx\x20use\x20cas\x20<name>','tdx\x20cas\x20pull\x20<name>','9428304LGROEx','Error:\x20\x20','Context\x20set:\x20','Analyzing\x20CAS\x20YAML\x20files...','type','Source:\x20\x20\x20','behaviors','Cancelled.','Describe\x20a\x20composable\x20audience','toLocaleString','\x20activations)','yellow','Would\x20push:\x20','Found\x20','No\x20composable\x20audiences\x20found.','audienceName','Directory\x20not\x20found:\x20','🧊\x20','description','composableAudience','underline','segments','\x20segments,\x20','\x20or\x20set\x20context\x20with\x20','execute','dirname','cwd','30006sIrKAa','19181729RoZnID','cyan','Write\x20files?','hasChanges','\x20\x20Schema:\x20','green','Fetching\x20composable\x20audiences...','(dry\x20run\x20—\x20no\x20files\x20written)','cas:push','verbose','Attributes\x20(','No\x20composable\x20audience\x20specified.','(dry\x20run\x20—\x20push\x20is\x20not\x20yet\x20implemented)','5982144WZUwFK','utf-8','\x20(new)','\x20=\x20','column','Fetching\x20audience\x20\x27','data','counts','activations','\x20file(s)\x20to\x20write\x20','5067725lhUWnu','Use\x20','Usage:\x20tdx\x20cas\x20preview\x20<segment_name>\x20[--audience\x20<name>]','audiences','No\x20YAML\x20files\x20found\x20in:\x20','Audience:\x20','filter','setPhase','length','timeColumn','1814198IudibP','basename','session','Push\x20YAML\x20files\x20to\x20CAS\x20API','\x20file(s)\x20to\x20','\x20—\x20','Status:\x20','relativePath','Wrote\x20','--audience\x20<name>','Tip:\x20Run\x20`tdx\x20cas\x20pull\x20<name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','cas','diff','\x20composable\x20audiences','absolutePath','yes'];a8_0x1ffa=function(){return _0x2a5a89;};return a8_0x1ffa();}
|