@treasuredata/tdx 0.28.0 → 0.28.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/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/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/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/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/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/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/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/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-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.d.ts +6 -0
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/personalization.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.d.ts.map +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-validator.js.map +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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.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/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/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/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/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_0x3e2bc0=a3_0x34ad;(function(_0x32482a,_0x42729b){const _0x2c2a91=a3_0x34ad,_0x3b887d=_0x32482a();while(!![]){try{const _0x1e679b=-parseInt(_0x2c2a91(0x18a))/0x1*(parseInt(_0x2c2a91(0x195))/0x2)+parseInt(_0x2c2a91(0x189))/0x3*(parseInt(_0x2c2a91(0x185))/0x4)+-parseInt(_0x2c2a91(0x1a1))/0x5*(-parseInt(_0x2c2a91(0x1a4))/0x6)+parseInt(_0x2c2a91(0x19b))/0x7*(-parseInt(_0x2c2a91(0x192))/0x8)+-parseInt(_0x2c2a91(0x19c))/0x9+parseInt(_0x2c2a91(0x190))/0xa+parseInt(_0x2c2a91(0x1a3))/0xb*(-parseInt(_0x2c2a91(0x183))/0xc);if(_0x1e679b===_0x42729b)break;else _0x3b887d['push'](_0x3b887d['shift']());}catch(_0x5eaa7c){_0x3b887d['push'](_0x3b887d['shift']());}}}(a3_0x1418,0x402d1));import{BaseCommand}from'./command.js';function a3_0x34ad(_0x261472,_0x135b96){_0x261472=_0x261472-0x183;const _0x141868=a3_0x1418();let _0x34adf7=_0x141868[_0x261472];return _0x34adf7;}import{SDKError}from'../sdk/index.js';function a3_0x1418(){const _0xb9cdfb=['Listing\x20activations\x20for\x20segment\x20\x27','18264QBhxiS','\x20activation','resolveParentId','22IMbmws','Resolving\x20parent\x20segment\x20\x27','Error:\x20Segment\x20name\x20is\x20required','verbose','Error:\x20','length','210UOlaZj','3093336CRnYPI','resolveSegmentId','description','name','listActivations','89575SQfXNM','Site:\x20','11lkQuBK','114ZzLtLD','execute','Child\x20name:\x20','Resolving\x20child\x20segment\x20\x27','message','segment','2584380miKxdM','error','2708Tvnenu','\x27...','\x20\x20Cause:\x20','Resolved\x20child\x20ID:\x20','2256UxgdOh','39027eqwzkz','✔\x20Found\x20','cause','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','data','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','4702320ENhhqV'];a3_0x1418=function(){return _0xb9cdfb;};return a3_0x1418();}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_0x3e2bc0(0x19f)]='activations';[a3_0x3e2bc0(0x19e)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x3e2bc0(0x1a5)](_0x1355d4){const _0x11c7e4=a3_0x3e2bc0,{options:_0x4e3683,args:_0x2b2909,tdx:_0x17c0b1}=_0x1355d4;if(_0x2b2909[_0x11c7e4(0x19a)]===0x0)return console[_0x11c7e4(0x184)](_0x11c7e4(0x197)),console[_0x11c7e4(0x184)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x2f9945,childId:_0x477054}=parseSegmentRef(_0x2b2909[0x0]);if(!_0x477054)return console[_0x11c7e4(0x184)](_0x11c7e4(0x18f)),console['error'](_0x11c7e4(0x18d)),0x1;_0x4e3683[_0x11c7e4(0x198)]&&(console[_0x11c7e4(0x184)](_0x11c7e4(0x1a2)+_0x4e3683['site']),console[_0x11c7e4(0x184)]('Parent\x20name:\x20'+_0x2f9945),console[_0x11c7e4(0x184)](_0x11c7e4(0x1a6)+_0x477054));const _0x354e01=await withSpinner(_0x11c7e4(0x196)+_0x2f9945+'\x27...',()=>_0x17c0b1[_0x11c7e4(0x1a9)][_0x11c7e4(0x194)](_0x2f9945),{'verbose':_0x4e3683[_0x11c7e4(0x198)]}),_0x5a8a72=_0x354e01['data'];_0x4e3683[_0x11c7e4(0x198)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x5a8a72);const _0xebc3c8=await withSpinner(_0x11c7e4(0x1a7)+_0x477054+_0x11c7e4(0x186),()=>_0x17c0b1[_0x11c7e4(0x1a9)][_0x11c7e4(0x19d)](_0x5a8a72,_0x477054),{'verbose':_0x4e3683['verbose']}),_0x3b797a=_0xebc3c8[_0x11c7e4(0x18e)];_0x4e3683['verbose']&&console['error'](_0x11c7e4(0x188)+_0x3b797a);const _0xe6a832=await withSpinner(_0x11c7e4(0x191)+_0x477054+_0x11c7e4(0x186),()=>_0x17c0b1['segment'][_0x11c7e4(0x1a0)](_0x5a8a72,_0x3b797a),{'verbose':_0x4e3683[_0x11c7e4(0x198)]}),_0x25cb95=_0xe6a832[_0x11c7e4(0x18e)];return console[_0x11c7e4(0x184)](_0x11c7e4(0x18b)+_0x25cb95[_0x11c7e4(0x19a)]+_0x11c7e4(0x193)+(_0x25cb95[_0x11c7e4(0x19a)]!==0x1?'s':'')),await handleSDKOutput(_0x25cb95,_0x4e3683),0x0;}catch(_0x145ad9){if(_0x145ad9 instanceof SDKError)return console['error'](_0x11c7e4(0x199)+_0x145ad9[_0x11c7e4(0x1a8)]),_0x145ad9[_0x11c7e4(0x18c)]&&console[_0x11c7e4(0x184)](_0x11c7e4(0x187)+_0x145ad9[_0x11c7e4(0x18c)]),0x1;throw _0x145ad9;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x5e651a=a4_0x3062;(function(_0x14b6ea,_0x4f15e5){const _0x4bdec7=a4_0x3062,_0x31e167=_0x14b6ea();while(!![]){try{const _0x49b2c8=-parseInt(_0x4bdec7(0x129))/0x1+parseInt(_0x4bdec7(0x12c))/0x2*(parseInt(_0x4bdec7(0x17c))/0x3)+parseInt(_0x4bdec7(0x10b))/0x4*(parseInt(_0x4bdec7(0xf3))/0x5)+-parseInt(_0x4bdec7(0x14f))/0x6*(-parseInt(_0x4bdec7(0x14c))/0x7)+-parseInt(_0x4bdec7(0x18a))/0x8*(-parseInt(_0x4bdec7(0xfb))/0x9)+-parseInt(_0x4bdec7(0xff))/0xa*(-parseInt(_0x4bdec7(0x165))/0xb)+-parseInt(_0x4bdec7(0x119))/0xc;if(_0x49b2c8===_0x4f15e5)break;else _0x31e167['push'](_0x31e167['shift']());}catch(_0x1330d4){_0x31e167['push'](_0x31e167['shift']());}}}(a4_0x5195,0x4e3af));import a4_0x5088cf from'chalk';import a4_0x3b558d from'path';function a4_0x5195(){const _0x428c87=['total','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','dirname','errors','session','455425wTtSaV','no_local_folder','pullAgent','62VNiTqR','\x20|\x20','found','agent.yml','cloneProject','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Project:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Status:\x20','Using\x20current\x20project:\x20','\x0aError:','no_context','Failed\x20to\x20push\x20agent:\x20','new','projectId','output','Output:\x20','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)','\x20\x20Prompt\x20\x22','-\x20no\x20files\x20written','utf-8','New\x20project:\x20','Pushing\x20agent\x20from\x20\x22','repeat','\x20\x20Agents:\x20','Analyzing\x20project\x20\x22','created','execute','\x22\x20to\x20new\x20project\x20\x22','context','force','updated','850038eLHkKN','agent','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','18lHczlE','push','unchanged','projectName','\x20resources\x20to\x20\x27','Dry\x20run\x20-\x20no\x20changes\x20made','integrations','\x20new','isNew','dim','\x20\x20Knowledge\x20Bases:\x20','\x0a✔\x20Pushed\x20','Pulling\x20agent\x20\x22','pullProject','knowledgeBases','\x20\x20Target:\x20','llmProject','reason','join','\x20=\x20','name','\x0aChanges\x20to\x20prompt\x20\x27','330QxKEzg','\x20\x20Integrations:\x20','\x0a✔\x20Pulled\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\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','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Pushing\x20to\x20project...','llm_project','\x22\x20from\x20project\x20\x22','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20total','New\x20project\x20ID:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x0aPush\x20','\x22\x20to\x20a\x20different\x20profile','sourceProjectName','\x20\x20Experimental\x20Artifacts:\x20','experimentalArtifacts','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','tdx.json','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x0aPull\x20summary\x20for\x20\x27','39357KfoiKX','agents','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Experimental\x20Artifact\x20\x22','Chat:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','INVALID_ARGUMENT','Cloning\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','Summary:','experimentalKnowledgeBases','Using\x20project\x20from\x20context:\x20','Source:\x20','Project\x20cloned\x20with\x20errors','104jPhVPC','prompts','\x0aErrors\x20found:','\x20--profile\x20','red','Clone\x20\x22','cwd','\x20\x20Integration\x20\x22','Project\x20cloned\x20successfully','cwd-config','Cancelled','agentId','\x20successfully','message','projectDir','action','\x0aChanges\x20to\x20integration\x20\x27','yes','agent:push','newProjectName','\x20unchanged','Agent:\x20','newProjectId','Would\x20clone:','dryRun','error','Using\x20context\x20project:\x20','\x20\x20Knowledge\x20Base\x20\x22','gray','\x22\x20to\x20\x22','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20files\x20to\x20','Using\x20local\x20project:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','15zfOGwj','\x20\x20Text\x20Knowledge\x20Bases:\x20','agent:pull','Errors:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Agent\x20\x22','\x20changed','agentName','232794QpmZPl','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20\x20tdx\x20agent\x20pull\x20','\x20created','162810hjNiZS','yellow','agent:clone','textKnowledgeBases','Output\x20path:\x20','description','\x20\x20tdx\x20agent\x20clone\x20agents/','green','✔\x20Context\x20set:\x20','\x20errors','Analyzing\x20changes\x20to\x20push...','\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','806508WaWyOz','counts','cyan','llm','\x22...','site','parse','-\x20nothing\x20pushed','\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)','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','outputPath','log','pushAgent','Dry\x20run\x20-\x20no\x20files\x20written','17096448uwNAwn','Agent\x20','diff','\x0aWrite\x20','pushProject','\x0aChanges\x20to\x20agent\x20\x27','\x20\x20Prompts:\x20','\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','MISSING_ARGUMENT','\x22:\x20','Writing\x20files...'];a4_0x5195=function(){return _0x428c87;};return a4_0x5195();}import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x3062(_0xaf09e7,_0x1cc598){_0xaf09e7=_0xaf09e7-0xd9;const _0x5195cd=a4_0x5195();let _0x3062b5=_0x5195cd[_0xaf09e7];return _0x3062b5;}import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x199b98){const _0x2ad48b=a4_0x3062,_0x1ae026=[];if(_0x199b98[_0x2ad48b(0x124)]!==undefined)_0x1ae026[_0x2ad48b(0x150)](_0x199b98[_0x2ad48b(0x124)]+_0x2ad48b(0x170));if(_0x199b98[_0x2ad48b(0x139)]!==undefined&&_0x199b98['new']>0x0)_0x1ae026['push'](a4_0x5088cf[_0x2ad48b(0x106)](_0x199b98['new']+'\x20new'));if(_0x199b98['created']!==undefined&&_0x199b98[_0x2ad48b(0x146)]>0x0)_0x1ae026[_0x2ad48b(0x150)](a4_0x5088cf[_0x2ad48b(0x106)](_0x199b98[_0x2ad48b(0x146)]+_0x2ad48b(0xfe)));if(_0x199b98['updated']!==undefined&&_0x199b98['updated']>0x0)_0x1ae026[_0x2ad48b(0x150)](a4_0x5088cf[_0x2ad48b(0x100)](_0x199b98['updated']+'\x20updated'));if(_0x199b98[_0x2ad48b(0x151)]!==undefined&&_0x199b98[_0x2ad48b(0x151)]>0x0)_0x1ae026['push'](a4_0x5088cf[_0x2ad48b(0xec)](_0x199b98[_0x2ad48b(0x151)]+_0x2ad48b(0xe4)));if(_0x199b98[_0x2ad48b(0x127)]!==undefined&&_0x199b98[_0x2ad48b(0x127)]>0x0)_0x1ae026[_0x2ad48b(0x150)](a4_0x5088cf['red'](_0x199b98[_0x2ad48b(0x127)]+_0x2ad48b(0x108)));return _0x1ae026[_0x2ad48b(0x161)](',\x20');}function displayDiffs(_0x48a92b,_0x596b72,_0x39b9bf,_0x463239,_0x572fcb,_0x3b3579,_0xd4868b){const _0x5c1da9=a4_0x3062;for(const _0x30efce of _0x48a92b){if(_0x30efce[_0x5c1da9(0x11b)]){const _0x4e85c6=_0x30efce['agentName']||_0x30efce[_0x5c1da9(0x163)];console[_0x5c1da9(0x116)](_0x5c1da9(0x11e)+_0x4e85c6+'\x27:'),console[_0x5c1da9(0x116)]('─'[_0x5c1da9(0x143)](0x3c)),console[_0x5c1da9(0x116)](_0x30efce[_0x5c1da9(0x11b)]),console['log']('─'[_0x5c1da9(0x143)](0x3c));}}for(const _0x1d5eb6 of _0x596b72){_0x1d5eb6[_0x5c1da9(0x11b)]&&(console['log'](_0x5c1da9(0xfc)+_0x1d5eb6['name']+'\x27:'),console[_0x5c1da9(0x116)]('─'[_0x5c1da9(0x143)](0x3c)),console[_0x5c1da9(0x116)](_0x1d5eb6[_0x5c1da9(0x11b)]),console['log']('─'[_0x5c1da9(0x143)](0x3c)));}for(const _0x25eee2 of _0x39b9bf){_0x25eee2[_0x5c1da9(0x11b)]&&(console['log'](_0x5c1da9(0x16a)+_0x25eee2[_0x5c1da9(0x163)]+'\x27:'),console['log']('─'[_0x5c1da9(0x143)](0x3c)),console[_0x5c1da9(0x116)](_0x25eee2['diff']),console[_0x5c1da9(0x116)]('─'['repeat'](0x3c)));}for(const _0x59a033 of _0x463239){_0x59a033['diff']&&(console['log'](_0x5c1da9(0x164)+_0x59a033[_0x5c1da9(0x163)]+'\x27:'),console[_0x5c1da9(0x116)]('─'[_0x5c1da9(0x143)](0x3c)),console[_0x5c1da9(0x116)](_0x59a033[_0x5c1da9(0x11b)]),console[_0x5c1da9(0x116)]('─'[_0x5c1da9(0x143)](0x3c)));}for(const _0x5da0aa of _0x572fcb){_0x5da0aa[_0x5c1da9(0x11b)]&&(console[_0x5c1da9(0x116)](_0x5c1da9(0xe0)+_0x5da0aa['name']+'\x27:'),console[_0x5c1da9(0x116)]('─'[_0x5c1da9(0x143)](0x3c)),console[_0x5c1da9(0x116)](_0x5da0aa[_0x5c1da9(0x11b)]),console['log']('─'[_0x5c1da9(0x143)](0x3c)));}for(const _0x1b88f9 of _0x3b3579){_0x1b88f9['diff']&&(console['log'](_0x5c1da9(0xf1)+_0x1b88f9[_0x5c1da9(0x163)]+'\x27:'),console[_0x5c1da9(0x116)]('─'[_0x5c1da9(0x143)](0x3c)),console[_0x5c1da9(0x116)](_0x1b88f9[_0x5c1da9(0x11b)]),console[_0x5c1da9(0x116)]('─'[_0x5c1da9(0x143)](0x3c)));}for(const _0x43ab03 of _0xd4868b){_0x43ab03[_0x5c1da9(0x11b)]&&(console[_0x5c1da9(0x116)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x43ab03[_0x5c1da9(0x163)]+'\x27:'),console[_0x5c1da9(0x116)]('─'[_0x5c1da9(0x143)](0x3c)),console[_0x5c1da9(0x116)](_0x43ab03['diff']),console['log']('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x5e651a(0x163)]=a4_0x5e651a(0xf5);[a4_0x5e651a(0x104)]=a4_0x5e651a(0x131);async[a4_0x5e651a(0x147)](_0x49184b){const _0x205bc4=a4_0x5e651a,{options:_0x31197c,args:_0x55fb07,tdx:_0x9c47d2}=_0x49184b,_0x26d396=_0x55fb07[0x0],_0x562789=_0x55fb07[0x1],_0x50ece9=_0x31197c[_0x205bc4(0x13b)],_0x4987c0=_0x31197c['dryRun'],_0x2e1a1f=_0x31197c['force'],_0x5c23b0=_0x31197c[_0x205bc4(0xe1)],_0x398e4d=_0x31197c[_0x205bc4(0x15f)],_0x50483f=_0x31197c[_0x205bc4(0x14d)];let _0x26be61;if(_0x26d396){const _0x45609c=a4_0x3b558d['join'](_0x26d396,_0x205bc4(0x179));if(existsSync(_0x45609c))try{const _0x526501=JSON[_0x205bc4(0x111)](readFileSync(_0x45609c,_0x205bc4(0x140)));_0x526501[_0x205bc4(0x16d)]&&(_0x26be61={'llm_project':_0x526501[_0x205bc4(0x16d)]});}catch{}}const _0x1cd46d=findAgentConfigPath(process[_0x205bc4(0x190)]());let _0x11fa97;if(_0x1cd46d)try{const _0x347846=JSON[_0x205bc4(0x111)](readFileSync(_0x1cd46d,_0x205bc4(0x140)));_0x347846['llm_project']&&(_0x11fa97={'llm_project':_0x347846[_0x205bc4(0x16d)]});}catch{}const _0x4a4c08=resolveAgentPullArgs({'arg':_0x26d396,'agentNameArg':_0x562789,'agentFlag':_0x50483f,'contextProject':_0x398e4d,'argDirConfig':_0x26be61,'cwdConfigPath':_0x1cd46d||undefined,'cwdConfig':_0x11fa97}),{projectNameOrId:_0x196cbb,targetAgentName:_0x1addbc,existingOutputDir:_0x12a134,source:_0x5aad65}=_0x4a4c08;if(_0x5aad65==='arg-dir')console[_0x205bc4(0x116)](a4_0x5088cf[_0x205bc4(0x158)]('Using\x20project\x20from\x20'+a4_0x3b558d[_0x205bc4(0x161)](_0x26d396,_0x205bc4(0x179))+':\x20'+_0x196cbb));else{if(_0x5aad65===_0x205bc4(0xd9))console[_0x205bc4(0x116)](a4_0x5088cf[_0x205bc4(0x158)]('Using\x20project:\x20'+_0x196cbb));else _0x5aad65===_0x205bc4(0x149)&&console[_0x205bc4(0x116)](a4_0x5088cf[_0x205bc4(0x158)](_0x205bc4(0x187)+_0x196cbb));}if(!_0x196cbb)return _0x50483f?(console[_0x205bc4(0x116)](a4_0x5088cf[_0x205bc4(0x100)](_0x205bc4(0x16b))),console[_0x205bc4(0x116)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x205bc4(0x116)](_0x205bc4(0x16f))):(console['log'](a4_0x5088cf['yellow'](_0x205bc4(0x14e))),console[_0x205bc4(0x116)](_0x205bc4(0x13d)),console[_0x205bc4(0x116)](_0x205bc4(0x169)),console[_0x205bc4(0x116)](_0x205bc4(0x120)),console[_0x205bc4(0x116)]('\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[_0x205bc4(0x116)](_0x205bc4(0x10a))),0x1;if(_0x1addbc){const {data:_0x358b6b}=await withSpinner(_0x205bc4(0x15b)+_0x1addbc+_0x205bc4(0x16e)+_0x196cbb+_0x205bc4(0x10f),()=>_0x9c47d2[_0x205bc4(0x10e)][_0x205bc4(0x12b)](_0x196cbb,_0x1addbc,_0x50ece9,{'dryRun':_0x4987c0,'force':_0x2e1a1f}));if(_0x4987c0)return console[_0x205bc4(0x116)](a4_0x5088cf[_0x205bc4(0x100)](_0x205bc4(0x118))),console[_0x205bc4(0x116)]('Would\x20pull\x20agent:\x20'+_0x358b6b[_0x205bc4(0xfa)]),console['log'](_0x205bc4(0x103)+_0x358b6b[_0x205bc4(0x115)]),_0x358b6b['diff']&&(console[_0x205bc4(0x116)]('\x0aChanges:'),console[_0x205bc4(0x116)]('─'[_0x205bc4(0x143)](0x3c)),console[_0x205bc4(0x116)](_0x358b6b['diff']),console[_0x205bc4(0x116)]('─'[_0x205bc4(0x143)](0x3c))),0x0;return console[_0x205bc4(0x116)](a4_0x5088cf['green']('Agent\x20pulled\x20successfully')),console[_0x205bc4(0x116)]('Agent:\x20'+_0x358b6b['agentName']),console[_0x205bc4(0x116)](_0x205bc4(0x13c)+_0x358b6b[_0x205bc4(0x115)]),console['log'](_0x205bc4(0x134)+(_0x358b6b[_0x205bc4(0x157)]?a4_0x5088cf[_0x205bc4(0x106)](_0x205bc4(0x139)):_0x358b6b['hasChanges']?a4_0x5088cf[_0x205bc4(0x100)](_0x205bc4(0x14b)):a4_0x5088cf['gray'](_0x205bc4(0x151)))),0x0;}const _0x5359a2=_0x12a134||_0x50ece9,{data:_0x56a115}=await withSpinner(_0x205bc4(0x145)+_0x196cbb+_0x205bc4(0x10f),()=>_0x9c47d2[_0x205bc4(0x10e)]['pullProject'](_0x196cbb,_0x5359a2,{'dryRun':!![]})),_0x26c6ab=_0x56a115[_0x205bc4(0x10c)][_0x205bc4(0x17d)][_0x205bc4(0x139)]+_0x56a115[_0x205bc4(0x10c)][_0x205bc4(0x15d)][_0x205bc4(0x139)]+_0x56a115[_0x205bc4(0x10c)]['textKnowledgeBases']['new']+_0x56a115['counts']['prompts'][_0x205bc4(0x139)]+_0x56a115[_0x205bc4(0x10c)]['integrations'][_0x205bc4(0x139)]+_0x56a115[_0x205bc4(0x10c)][_0x205bc4(0x186)]['new']+_0x56a115[_0x205bc4(0x10c)][_0x205bc4(0x177)]['new'],_0x22cf9c=_0x56a115['counts']['agents'][_0x205bc4(0x14b)]+_0x56a115[_0x205bc4(0x10c)][_0x205bc4(0x15d)][_0x205bc4(0x14b)]+_0x56a115[_0x205bc4(0x10c)][_0x205bc4(0x102)][_0x205bc4(0x14b)]+_0x56a115[_0x205bc4(0x10c)][_0x205bc4(0x18b)][_0x205bc4(0x14b)]+_0x56a115[_0x205bc4(0x10c)][_0x205bc4(0x155)]['updated']+_0x56a115['counts']['experimentalKnowledgeBases'][_0x205bc4(0x14b)]+_0x56a115[_0x205bc4(0x10c)][_0x205bc4(0x177)][_0x205bc4(0x14b)],_0x384535=_0x56a115[_0x205bc4(0x10c)]['agents']['unchanged']+_0x56a115[_0x205bc4(0x10c)][_0x205bc4(0x15d)]['unchanged']+_0x56a115['counts']['textKnowledgeBases'][_0x205bc4(0x151)]+_0x56a115[_0x205bc4(0x10c)][_0x205bc4(0x18b)][_0x205bc4(0x151)]+_0x56a115[_0x205bc4(0x10c)][_0x205bc4(0x155)]['unchanged']+_0x56a115['counts'][_0x205bc4(0x186)][_0x205bc4(0x151)]+_0x56a115[_0x205bc4(0x10c)]['experimentalArtifacts'][_0x205bc4(0x151)];console[_0x205bc4(0x116)](_0x205bc4(0x17b)+_0x56a115[_0x205bc4(0x152)]+'\x27:'),console['log']('\x20\x20'+a4_0x5088cf[_0x205bc4(0x106)]('+\x20'+_0x26c6ab+_0x205bc4(0x156))+'\x20|\x20'+a4_0x5088cf[_0x205bc4(0x100)]('~\x20'+_0x22cf9c+_0x205bc4(0xf9))+_0x205bc4(0x12d)+a4_0x5088cf['dim']('=\x20'+_0x384535+_0x205bc4(0xe4))),console[_0x205bc4(0x116)](_0x205bc4(0x144)+formatCountSummary(_0x56a115['counts']['agents'])),console[_0x205bc4(0x116)](_0x205bc4(0x159)+formatCountSummary(_0x56a115[_0x205bc4(0x10c)]['knowledgeBases'])),console[_0x205bc4(0x116)](_0x205bc4(0xf4)+formatCountSummary(_0x56a115[_0x205bc4(0x10c)][_0x205bc4(0x102)])),console[_0x205bc4(0x116)](_0x205bc4(0x11f)+formatCountSummary(_0x56a115['counts'][_0x205bc4(0x18b)])),console[_0x205bc4(0x116)](_0x205bc4(0x166)+formatCountSummary(_0x56a115[_0x205bc4(0x10c)]['integrations']));const _0x6cbf3f=_0x56a115['counts'][_0x205bc4(0x186)][_0x205bc4(0x124)]>0x0||_0x56a115[_0x205bc4(0x10c)][_0x205bc4(0x177)]['total']>0x0;_0x6cbf3f&&(console[_0x205bc4(0x116)](_0x205bc4(0xee)+formatCountSummary(_0x56a115[_0x205bc4(0x10c)][_0x205bc4(0x186)])),console['log'](_0x205bc4(0x176)+formatCountSummary(_0x56a115[_0x205bc4(0x10c)]['experimentalArtifacts'])));console[_0x205bc4(0x116)](_0x205bc4(0x15e)+a4_0x5088cf[_0x205bc4(0x10d)](_0x56a115['outputDir'])),displayDiffs(_0x56a115[_0x205bc4(0x17d)],_0x56a115[_0x205bc4(0x15d)],_0x56a115[_0x205bc4(0x102)],_0x56a115[_0x205bc4(0x18b)],_0x56a115['integrations'],_0x56a115[_0x205bc4(0x186)],_0x56a115[_0x205bc4(0x177)]);if(_0x4987c0)return console[_0x205bc4(0x116)](a4_0x5088cf[_0x205bc4(0x100)](_0x205bc4(0x178))),0x0;if(_0x26c6ab===0x0&&_0x22cf9c===0x0)return console['log'](a4_0x5088cf[_0x205bc4(0x106)](_0x205bc4(0x133))),saveSessionContext({'llm_project':_0x56a115[_0x205bc4(0x152)]},_0x31197c[_0x205bc4(0x128)]),console['log'](a4_0x5088cf[_0x205bc4(0x106)](_0x205bc4(0x107)+a4_0x5088cf['dim'](_0x205bc4(0x16d))+_0x205bc4(0x162)+a4_0x5088cf['cyan'](_0x56a115['projectName']))),0x0;if(!_0x5c23b0&&!_0x2e1a1f){if(!isInteractive())return console['error'](a4_0x5088cf[_0x205bc4(0x18e)](_0x205bc4(0x136)),_0x205bc4(0xf2)),console[_0x205bc4(0xe9)](a4_0x5088cf[_0x205bc4(0x158)](_0x205bc4(0xf7))),0x1;const _0x240b33=await confirmKey(_0x205bc4(0x11c)+(_0x26c6ab+_0x22cf9c)+'\x20files?');if(!_0x240b33)return console[_0x205bc4(0x116)](a4_0x5088cf['yellow'](_0x205bc4(0xda)),_0x205bc4(0x13f)),0x1;}const {data:_0x340e34}=await withSpinner(_0x205bc4(0x123),()=>_0x9c47d2[_0x205bc4(0x10e)][_0x205bc4(0x15c)](_0x196cbb,_0x5359a2,{'force':_0x2e1a1f}));return console[_0x205bc4(0x116)](a4_0x5088cf[_0x205bc4(0x106)](_0x205bc4(0x167)+(_0x26c6ab+_0x22cf9c)+_0x205bc4(0xef)+_0x340e34['outputDir'])),saveSessionContext({'llm_project':_0x340e34[_0x205bc4(0x152)]},_0x31197c['session']),console[_0x205bc4(0x116)](a4_0x5088cf[_0x205bc4(0x106)]('✔\x20Context\x20set:\x20'+a4_0x5088cf[_0x205bc4(0x158)](_0x205bc4(0x16d))+'\x20=\x20'+a4_0x5088cf['cyan'](_0x340e34[_0x205bc4(0x152)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x5e651a(0x163)]=a4_0x5e651a(0x101);['description']='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async['execute'](_0x323d3d){const _0x7909ea=a4_0x5e651a,{options:_0x673899,args:_0x265552,tdx:_0x5df08c}=_0x323d3d,_0x325adf=_0x265552[0x0],_0x545298=_0x673899[_0x7909ea(0x163)],_0x1eb905=_0x673899['dryRun'],_0x28e3ed=_0x673899[_0x7909ea(0xe1)],_0x16c1f0=_0x673899[_0x7909ea(0x110)],_0x3ef51e=_0x673899['llmProject'];let _0x52b6c6;const _0x4f77ac=findAgentConfigPath(process['cwd']());if(_0x325adf){const _0x4c87a1=a4_0x3b558d['join'](_0x325adf,_0x7909ea(0x179));existsSync(_0x4c87a1)?(_0x52b6c6=_0x325adf,console[_0x7909ea(0x116)](a4_0x5088cf[_0x7909ea(0x158)]('Using\x20local\x20project:\x20'+_0x325adf))):_0x52b6c6=_0x325adf;}else{if(_0x4f77ac)_0x52b6c6=a4_0x3b558d[_0x7909ea(0x126)](_0x4f77ac),console[_0x7909ea(0x116)](a4_0x5088cf['dim'](_0x7909ea(0x135)+_0x52b6c6));else{if(_0x3ef51e){const _0x384daf=sanitizeForFilesystem(_0x3ef51e);let _0x9e4842=_0x384daf,_0x4eb5e2=a4_0x3b558d['join'](process['cwd'](),'agents',_0x384daf,_0x7909ea(0x179));if(!existsSync(_0x4eb5e2)){const _0x1bb935=normalizeName(_0x3ef51e),_0x29015f=a4_0x3b558d[_0x7909ea(0x161)](process['cwd'](),_0x7909ea(0x17d),_0x1bb935,_0x7909ea(0x179));existsSync(_0x29015f)&&(_0x9e4842=_0x1bb935,_0x4eb5e2=_0x29015f);}if(existsSync(_0x4eb5e2))_0x52b6c6=a4_0x3b558d['dirname'](_0x4eb5e2),console['log'](a4_0x5088cf['dim'](_0x7909ea(0xf0)+_0x52b6c6));else{const _0x4d9c38=_0x673899['profile'];if(_0x4d9c38)throw new SDKError(ErrorCode[_0x7909ea(0x182)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x3ef51e+_0x7909ea(0x174),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x7909ea(0x17a)+(_0x7909ea(0xfd)+_0x3ef51e+'\x0a')+(_0x7909ea(0x105)+_0x9e4842+'\x20--name\x20'+(_0x545298||'<new-name>')+_0x7909ea(0x18d)+_0x4d9c38)});_0x52b6c6=_0x3ef51e,console['log'](a4_0x5088cf[_0x7909ea(0x158)](_0x7909ea(0xea)+_0x3ef51e));}}}}if(!_0x52b6c6)return console['log'](a4_0x5088cf[_0x7909ea(0x100)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x7909ea(0x116)](_0x7909ea(0x17e)),console['log'](_0x7909ea(0x168)),console[_0x7909ea(0x116)](_0x7909ea(0x113)),console[_0x7909ea(0x116)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x545298)throw new SDKError(ErrorCode[_0x7909ea(0x121)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x28e3ed&&!_0x1eb905){if(!isInteractive())return console[_0x7909ea(0xe9)](a4_0x5088cf[_0x7909ea(0x18e)](_0x7909ea(0x136)),_0x7909ea(0xf2)),console['error'](a4_0x5088cf['dim'](_0x7909ea(0xf7))),0x1;const _0x246735=await confirmKey(_0x7909ea(0x18f)+_0x52b6c6+_0x7909ea(0x148)+_0x545298+'\x22?');if(!_0x246735)return console[_0x7909ea(0x116)](a4_0x5088cf['yellow'](_0x7909ea(0xda))),0x1;}const {data:_0x58c4e4}=await withSpinner(_0x7909ea(0x183)+_0x52b6c6+_0x7909ea(0xed)+_0x545298+_0x7909ea(0x10f),()=>_0x5df08c[_0x7909ea(0x10e)][_0x7909ea(0x130)](_0x52b6c6,_0x545298,{'dryRun':_0x1eb905}));if(_0x1eb905){console['log'](a4_0x5088cf['yellow'](_0x7909ea(0x154))),console[_0x7909ea(0x116)](_0x7909ea(0x188)+_0x58c4e4[_0x7909ea(0x175)]),console[_0x7909ea(0x116)](_0x7909ea(0x141)+_0x545298),console['log'](_0x7909ea(0xe7)),console[_0x7909ea(0x116)](_0x7909ea(0x144)+_0x58c4e4[_0x7909ea(0x10c)][_0x7909ea(0x17d)][_0x7909ea(0x146)]),console[_0x7909ea(0x116)]('\x20\x20Knowledge\x20Bases:\x20'+_0x58c4e4[_0x7909ea(0x10c)][_0x7909ea(0x15d)]['created']),console[_0x7909ea(0x116)](_0x7909ea(0x11f)+_0x58c4e4['counts'][_0x7909ea(0x18b)][_0x7909ea(0x146)]);const _0x398fd0=_0x58c4e4[_0x7909ea(0x10c)][_0x7909ea(0x186)][_0x7909ea(0x146)]>0x0||_0x58c4e4['counts'][_0x7909ea(0x177)]['created']>0x0;return _0x398fd0&&(console[_0x7909ea(0x116)](_0x7909ea(0xee)+_0x58c4e4[_0x7909ea(0x10c)][_0x7909ea(0x186)][_0x7909ea(0x146)]),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+_0x58c4e4[_0x7909ea(0x10c)][_0x7909ea(0x177)][_0x7909ea(0x146)])),0x0;}const _0x799c65=_0x58c4e4[_0x7909ea(0x10c)][_0x7909ea(0x17d)]['errors']>0x0||_0x58c4e4[_0x7909ea(0x10c)][_0x7909ea(0x15d)][_0x7909ea(0x127)]>0x0||_0x58c4e4[_0x7909ea(0x10c)][_0x7909ea(0x18b)][_0x7909ea(0x127)]>0x0||_0x58c4e4['counts'][_0x7909ea(0x186)][_0x7909ea(0x127)]>0x0||_0x58c4e4[_0x7909ea(0x10c)][_0x7909ea(0x177)][_0x7909ea(0x127)]>0x0;_0x799c65?console[_0x7909ea(0x116)](a4_0x5088cf[_0x7909ea(0x100)](_0x7909ea(0x189))):console[_0x7909ea(0x116)](a4_0x5088cf[_0x7909ea(0x106)](_0x7909ea(0x192)));console[_0x7909ea(0x116)](_0x7909ea(0x188)+_0x58c4e4['sourceProjectName']),console['log'](_0x7909ea(0x141)+_0x58c4e4[_0x7909ea(0xe3)]),console['log'](_0x7909ea(0x171)+_0x58c4e4[_0x7909ea(0xe6)]),console[_0x7909ea(0x116)](),console['log'](_0x7909ea(0x185)),console[_0x7909ea(0x116)](_0x7909ea(0x144)+formatCountSummary(_0x58c4e4['counts'][_0x7909ea(0x17d)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x58c4e4[_0x7909ea(0x10c)][_0x7909ea(0x15d)])),console[_0x7909ea(0x116)](_0x7909ea(0x11f)+formatCountSummary(_0x58c4e4['counts'][_0x7909ea(0x18b)])),console['log'](_0x7909ea(0x166)+formatCountSummary(_0x58c4e4[_0x7909ea(0x10c)]['integrations']));const _0x1d79e6=_0x58c4e4[_0x7909ea(0x10c)][_0x7909ea(0x186)]['created']>0x0||_0x58c4e4[_0x7909ea(0x10c)][_0x7909ea(0x186)][_0x7909ea(0x14b)]>0x0||_0x58c4e4['counts']['experimentalKnowledgeBases'][_0x7909ea(0x151)]>0x0||_0x58c4e4[_0x7909ea(0x10c)][_0x7909ea(0x177)][_0x7909ea(0x146)]>0x0||_0x58c4e4['counts'][_0x7909ea(0x177)][_0x7909ea(0x14b)]>0x0||_0x58c4e4[_0x7909ea(0x10c)][_0x7909ea(0x177)]['unchanged']>0x0;_0x1d79e6&&(console[_0x7909ea(0x116)](_0x7909ea(0xee)+formatCountSummary(_0x58c4e4[_0x7909ea(0x10c)]['experimentalKnowledgeBases'])),console[_0x7909ea(0x116)](_0x7909ea(0x176)+formatCountSummary(_0x58c4e4[_0x7909ea(0x10c)]['experimentalArtifacts'])));if(_0x799c65){console[_0x7909ea(0x116)](),console['log'](a4_0x5088cf[_0x7909ea(0x18e)](_0x7909ea(0xf6)));for(const _0x4a5659 of _0x58c4e4['agents']){_0x4a5659[_0x7909ea(0xdf)]===_0x7909ea(0xe9)&&console['log'](a4_0x5088cf[_0x7909ea(0x18e)](_0x7909ea(0xf8)+_0x4a5659[_0x7909ea(0xfa)]+_0x7909ea(0x122)+_0x4a5659[_0x7909ea(0xe9)]));}for(const _0x3ab33f of _0x58c4e4[_0x7909ea(0x15d)]){_0x3ab33f[_0x7909ea(0xdf)]===_0x7909ea(0xe9)&&console[_0x7909ea(0x116)](a4_0x5088cf['red'](_0x7909ea(0xeb)+_0x3ab33f[_0x7909ea(0x163)]+_0x7909ea(0x122)+_0x3ab33f[_0x7909ea(0xe9)]));}for(const _0x4ce4d7 of _0x58c4e4[_0x7909ea(0x18b)]){_0x4ce4d7['action']===_0x7909ea(0xe9)&&console[_0x7909ea(0x116)](a4_0x5088cf[_0x7909ea(0x18e)]('\x20\x20Prompt\x20\x22'+_0x4ce4d7[_0x7909ea(0x163)]+'\x22:\x20'+_0x4ce4d7[_0x7909ea(0xe9)]));}for(const _0x50b899 of _0x58c4e4[_0x7909ea(0x155)]){_0x50b899[_0x7909ea(0xdf)]===_0x7909ea(0xe9)&&console[_0x7909ea(0x116)](a4_0x5088cf[_0x7909ea(0x18e)]('\x20\x20Integration\x20\x22'+_0x50b899[_0x7909ea(0x163)]+_0x7909ea(0x122)+_0x50b899[_0x7909ea(0xe9)]));}for(const _0x155522 of _0x58c4e4[_0x7909ea(0x186)]){_0x155522[_0x7909ea(0xdf)]==='error'&&console['log'](a4_0x5088cf['red'](_0x7909ea(0x181)+_0x155522[_0x7909ea(0x163)]+_0x7909ea(0x122)+_0x155522[_0x7909ea(0xe9)]));}for(const _0x4d7f26 of _0x58c4e4[_0x7909ea(0x177)]){_0x4d7f26[_0x7909ea(0xdf)]===_0x7909ea(0xe9)&&console[_0x7909ea(0x116)](a4_0x5088cf[_0x7909ea(0x18e)](_0x7909ea(0x17f)+_0x4d7f26[_0x7909ea(0x163)]+_0x7909ea(0x122)+_0x4d7f26[_0x7909ea(0xe9)]));}return 0x1;}console[_0x7909ea(0x116)]();const _0x27aecb=getLLMProjectUrl(_0x16c1f0,_0x58c4e4['newProjectId']);return console['log'](_0x7909ea(0x132)+a4_0x5088cf[_0x7909ea(0x10d)](_0x27aecb)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x5e651a(0x163)]=a4_0x5e651a(0xe2);[a4_0x5e651a(0x104)]=a4_0x5e651a(0x125);async['execute'](_0x30cd3a){const _0x13f631=a4_0x5e651a,{options:_0x3a26c2,args:_0x4811fd,tdx:_0x2be7fc}=_0x30cd3a;let _0x57ef3c=_0x4811fd[0x0]||process[_0x13f631(0x190)]();const _0x7430a0=_0x3a26c2[_0x13f631(0xe8)],_0x51794c=_0x3a26c2[_0x13f631(0x14a)],_0x143cd5=_0x3a26c2[_0x13f631(0xe1)],_0x7b6810=_0x3a26c2['site'],_0x2190df=a4_0x3b558d[_0x13f631(0x161)](_0x57ef3c,_0x13f631(0x12f)),_0x1c8579=existsSync(_0x2190df);if(_0x1c8579){const {data:_0x513885}=await withSpinner(_0x13f631(0x142)+_0x57ef3c+_0x13f631(0x10f),()=>_0x2be7fc['llm'][_0x13f631(0x117)](_0x57ef3c,{'dryRun':_0x7430a0,'force':_0x51794c}));if(_0x7430a0)return console[_0x13f631(0x116)](a4_0x5088cf['yellow'](_0x13f631(0x154))),console['log']('Would\x20push\x20agent:\x20'+_0x513885[_0x13f631(0xfa)]),0x0;if(_0x513885[_0x13f631(0xdf)]==='error')return console[_0x13f631(0x116)](a4_0x5088cf[_0x13f631(0x18e)](_0x13f631(0x138)+_0x513885[_0x13f631(0xe9)])),0x1;console[_0x13f631(0x116)](a4_0x5088cf['green'](_0x13f631(0x11a)+_0x513885['action']+_0x13f631(0xdc))),console[_0x13f631(0x116)](_0x13f631(0xe5)+_0x513885[_0x13f631(0xfa)]);if(_0x513885[_0x13f631(0xdb)]&&_0x513885[_0x13f631(0x13a)]){const _0x1d9a81=getLLMAgentChatUrl(_0x7b6810,_0x513885[_0x13f631(0x13a)],_0x513885[_0x13f631(0xdb)]);console[_0x13f631(0x116)](_0x13f631(0x180)+a4_0x5088cf['cyan'](_0x1d9a81));}return 0x0;}const _0x2b20b5=_0x3a26c2[_0x13f631(0x15f)],_0x1fee4f=resolveProjectFromContext(_0x57ef3c,_0x2b20b5);if(_0x1fee4f[_0x13f631(0x12e)])_0x57ef3c=_0x1fee4f[_0x13f631(0xde)],_0x1fee4f['source']==='context'&&console['log'](a4_0x5088cf['dim']('Using\x20project:\x20'+_0x57ef3c));else{let _0x16c991=_0x13f631(0x172);_0x1fee4f[_0x13f631(0x160)]===_0x13f631(0x12a)&&(_0x16c991=_0x1fee4f[_0x13f631(0xdd)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x1fee4f['llmProject']+_0x13f631(0x184));throw new SDKError(ErrorCode[_0x13f631(0x182)],_0x1fee4f['reason']===_0x13f631(0x137)?_0x1fee4f[_0x13f631(0xdd)]:'No\x20tdx.json\x20found\x20in\x20'+_0x57ef3c,undefined,{'helpText':_0x16c991});}const {data:_0x4ff6c5}=await withSpinner(_0x13f631(0x109),()=>_0x2be7fc['llm']['pushProject'](_0x57ef3c,{'dryRun':!![]})),_0x4a1bd5=_0x4ff6c5['counts']['agents'][_0x13f631(0x127)]>0x0;if(_0x4a1bd5){console[_0x13f631(0x116)](a4_0x5088cf['red'](_0x13f631(0x18c)));for(const _0x49c0ba of _0x4ff6c5['agents']){_0x49c0ba[_0x13f631(0xdf)]===_0x13f631(0xe9)&&console[_0x13f631(0x116)](a4_0x5088cf[_0x13f631(0x18e)](_0x13f631(0xf8)+_0x49c0ba[_0x13f631(0xfa)]+_0x13f631(0x122)+_0x49c0ba['error']));}return 0x1;}const _0x5c80c4=_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x17d)]['created']+_0x4ff6c5[_0x13f631(0x10c)]['knowledgeBases'][_0x13f631(0x146)]+_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x102)][_0x13f631(0x146)]+_0x4ff6c5['counts'][_0x13f631(0x18b)][_0x13f631(0x146)]+_0x4ff6c5['counts']['integrations'][_0x13f631(0x146)]+_0x4ff6c5[_0x13f631(0x10c)]['experimentalKnowledgeBases'][_0x13f631(0x146)]+_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x177)][_0x13f631(0x146)],_0x19f802=_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x17d)][_0x13f631(0x14b)]+_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x15d)][_0x13f631(0x14b)]+_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x102)][_0x13f631(0x14b)]+_0x4ff6c5['counts'][_0x13f631(0x18b)][_0x13f631(0x14b)]+_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x155)][_0x13f631(0x14b)]+_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x186)][_0x13f631(0x14b)]+_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x177)][_0x13f631(0x14b)],_0xf03101=_0x4ff6c5[_0x13f631(0x10c)]['agents'][_0x13f631(0x151)]+_0x4ff6c5[_0x13f631(0x10c)]['knowledgeBases']['unchanged']+_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x102)][_0x13f631(0x151)]+_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x18b)][_0x13f631(0x151)]+_0x4ff6c5['counts']['integrations'][_0x13f631(0x151)]+_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x186)]['unchanged']+_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x177)]['unchanged'];console[_0x13f631(0x116)]('\x0aPush\x20summary\x20for\x20\x27'+_0x4ff6c5['projectName']+'\x27:'),console[_0x13f631(0x116)]('\x20\x20'+a4_0x5088cf[_0x13f631(0x106)]('+\x20'+_0x5c80c4+'\x20new')+_0x13f631(0x12d)+a4_0x5088cf[_0x13f631(0x100)]('~\x20'+_0x19f802+_0x13f631(0xf9))+_0x13f631(0x12d)+a4_0x5088cf[_0x13f631(0x158)]('=\x20'+_0xf03101+_0x13f631(0xe4))),console[_0x13f631(0x116)](_0x13f631(0x144)+formatCountSummary(_0x4ff6c5['counts'][_0x13f631(0x17d)])),console[_0x13f631(0x116)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x15d)])),console[_0x13f631(0x116)](_0x13f631(0xf4)+formatCountSummary(_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x102)])),console[_0x13f631(0x116)](_0x13f631(0x11f)+formatCountSummary(_0x4ff6c5['counts']['prompts'])),console[_0x13f631(0x116)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x155)]));const _0x50d5be=_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x186)][_0x13f631(0x146)]>0x0||_0x4ff6c5['counts']['experimentalKnowledgeBases'][_0x13f631(0x14b)]>0x0||_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x186)][_0x13f631(0x151)]>0x0||_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x177)][_0x13f631(0x146)]>0x0||_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x177)][_0x13f631(0x14b)]>0x0||_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x177)][_0x13f631(0x151)]>0x0;_0x50d5be&&(console[_0x13f631(0x116)](_0x13f631(0xee)+formatCountSummary(_0x4ff6c5[_0x13f631(0x10c)]['experimentalKnowledgeBases'])),console[_0x13f631(0x116)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x4ff6c5[_0x13f631(0x10c)][_0x13f631(0x177)])));console[_0x13f631(0x116)]('\x20\x20Source:\x20'+a4_0x5088cf[_0x13f631(0x10d)](_0x57ef3c)),displayDiffs(_0x4ff6c5[_0x13f631(0x17d)],_0x4ff6c5[_0x13f631(0x15d)],_0x4ff6c5[_0x13f631(0x102)],_0x4ff6c5[_0x13f631(0x18b)],_0x4ff6c5[_0x13f631(0x155)],_0x4ff6c5[_0x13f631(0x186)],_0x4ff6c5[_0x13f631(0x177)]);if(_0x7430a0)return console[_0x13f631(0x116)](a4_0x5088cf['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x5c80c4===0x0&&_0x19f802===0x0){console['log'](a4_0x5088cf[_0x13f631(0x106)](_0x13f631(0x114)));const _0x432df3=getLLMProjectUrl(_0x7b6810,_0x4ff6c5[_0x13f631(0x13a)]);return console[_0x13f631(0x116)](_0x13f631(0x132)+a4_0x5088cf['cyan'](_0x432df3)),0x0;}if(!_0x143cd5&&!_0x51794c){if(!isInteractive())return console['error'](a4_0x5088cf['red'](_0x13f631(0x136)),_0x13f631(0xf2)),console['error'](a4_0x5088cf['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xd2dced=await confirmKey(_0x13f631(0x173)+(_0x5c80c4+_0x19f802)+'\x20resources?');if(!_0xd2dced)return console['log'](a4_0x5088cf[_0x13f631(0x100)](_0x13f631(0xda)),_0x13f631(0x112)),0x1;}const {data:_0xbb9cdf}=await withSpinner(_0x13f631(0x16c),()=>_0x2be7fc[_0x13f631(0x10e)][_0x13f631(0x11d)](_0x57ef3c,{'force':_0x51794c})),_0x505f39=_0xbb9cdf[_0x13f631(0x10c)]['agents'][_0x13f631(0x127)]>0x0||_0xbb9cdf[_0x13f631(0x10c)][_0x13f631(0x15d)]['errors']>0x0||_0xbb9cdf[_0x13f631(0x10c)][_0x13f631(0x102)]['errors']>0x0||_0xbb9cdf[_0x13f631(0x10c)]['prompts']['errors']>0x0;if(_0x505f39){console[_0x13f631(0x116)](a4_0x5088cf['yellow']('\x0aProject\x20pushed\x20with\x20errors')),console[_0x13f631(0x116)](),console[_0x13f631(0x116)](a4_0x5088cf[_0x13f631(0x18e)](_0x13f631(0xf6)));for(const _0x25036b of _0xbb9cdf['agents']){_0x25036b[_0x13f631(0xdf)]==='error'&&console[_0x13f631(0x116)](a4_0x5088cf[_0x13f631(0x18e)](_0x13f631(0xf8)+_0x25036b['agentName']+'\x22:\x20'+_0x25036b[_0x13f631(0xe9)]));}for(const _0x30feed of _0xbb9cdf['knowledgeBases']){_0x30feed[_0x13f631(0xdf)]===_0x13f631(0xe9)&&console[_0x13f631(0x116)](a4_0x5088cf['red'](_0x13f631(0xeb)+_0x30feed[_0x13f631(0x163)]+_0x13f631(0x122)+_0x30feed[_0x13f631(0xe9)]));}for(const _0x1c346c of _0xbb9cdf['textKnowledgeBases']){_0x1c346c['action']==='error'&&console['log'](a4_0x5088cf[_0x13f631(0x18e)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x1c346c['name']+_0x13f631(0x122)+_0x1c346c[_0x13f631(0xe9)]));}for(const _0x587657 of _0xbb9cdf[_0x13f631(0x18b)]){_0x587657[_0x13f631(0xdf)]==='error'&&console[_0x13f631(0x116)](a4_0x5088cf[_0x13f631(0x18e)](_0x13f631(0x13e)+_0x587657['name']+_0x13f631(0x122)+_0x587657[_0x13f631(0xe9)]));}for(const _0x7d45c2 of _0xbb9cdf['integrations']){_0x7d45c2[_0x13f631(0xdf)]===_0x13f631(0xe9)&&console[_0x13f631(0x116)](a4_0x5088cf[_0x13f631(0x18e)](_0x13f631(0x191)+_0x7d45c2[_0x13f631(0x163)]+_0x13f631(0x122)+_0x7d45c2['error']));}return 0x1;}console[_0x13f631(0x116)](a4_0x5088cf[_0x13f631(0x106)](_0x13f631(0x15a)+(_0x5c80c4+_0x19f802)+_0x13f631(0x153)+_0xbb9cdf['projectName']+'\x27'));const _0xcb408e=getLLMProjectUrl(_0x7b6810,_0xbb9cdf['projectId']);return console[_0x13f631(0x116)](_0x13f631(0x132)+a4_0x5088cf[_0x13f631(0x10d)](_0xcb408e)),0x0;}}
|
|
1
|
+
const a4_0x5e331e=a4_0x4ea7;(function(_0x17fab6,_0x45f891){const _0x35a218=a4_0x4ea7,_0x33c602=_0x17fab6();while(!![]){try{const _0x1a4069=parseInt(_0x35a218(0x172))/0x1*(-parseInt(_0x35a218(0x13e))/0x2)+-parseInt(_0x35a218(0x18b))/0x3*(parseInt(_0x35a218(0x1a2))/0x4)+parseInt(_0x35a218(0x194))/0x5*(-parseInt(_0x35a218(0x133))/0x6)+-parseInt(_0x35a218(0x171))/0x7*(parseInt(_0x35a218(0x199))/0x8)+-parseInt(_0x35a218(0x112))/0x9+parseInt(_0x35a218(0x1ab))/0xa+-parseInt(_0x35a218(0x1a7))/0xb*(-parseInt(_0x35a218(0x16a))/0xc);if(_0x1a4069===_0x45f891)break;else _0x33c602['push'](_0x33c602['shift']());}catch(_0x1b3ce5){_0x33c602['push'](_0x33c602['shift']());}}}(a4_0x24d1,0xcbfc1));import a4_0x1aedd1 from'chalk';import a4_0x2fba22 from'path';import{existsSync,readFileSync}from'fs';function a4_0x24d1(){const _0x132479=['\x20--name\x20','\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','agentId','\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','Cancelled','site','103070MtoiHo','Status:\x20','total','New\x20project:\x20','isNew','654232vuqifn','\x22...','\x0aProject\x20pushed\x20with\x20errors','Source:\x20','textKnowledgeBases','agent','Using\x20current\x20project:\x20','red','\x20\x20Knowledge\x20Bases:\x20','92uPphQm','Agent:\x20','cyan','agent:clone','Project:\x20','8195uNQwEj','profile','Summary:','outputPath','5161210RkGWlA','pullAgent','\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','projectName','\x22\x20to\x20\x22','yellow','\x22\x20to\x20a\x20different\x20profile','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','repeat','new','parse','prompts','\x20resources\x20to\x20\x27','source','dryRun','green','push','Pushing\x20to\x20project...','Pulling\x20agent\x20\x22','\x0aErrors\x20found:','cwd','output','found','session','agentName','\x20\x20tdx\x20agent\x20clone\x20agents/','force','log','Errors:','\x0aWrite\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20new','2150271JygmNe','\x22:\x20','no_context','\x20\x20Integration\x20\x22','\x20created','\x20|\x20','Project\x20cloned\x20successfully','agents','llmProject','Would\x20push\x20agent:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','-\x20nothing\x20pushed','Dry\x20run\x20-\x20no\x20files\x20written','\x20files\x20to\x20','updated','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20Agents:\x20','context','Agent\x20','\x20\x20Target:\x20','INVALID_ARGUMENT','unchanged','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Failed\x20to\x20push\x20agent:\x20','created','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Analyzing\x20changes\x20to\x20push...','\x20successfully','\x20\x20Text\x20Knowledge\x20Base\x20\x22','dim','\x20changed','arg-dir','66ZRqPYj','\x20\x20tdx\x20agent\x20pull\x20','experimentalArtifacts','integrations','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Using\x20project\x20from\x20context:\x20','\x20=\x20','\x20total','projectDir','\x22\x20to\x20new\x20project\x20\x22','✔\x20Context\x20set:\x20','10nJDKvV','name','no_local_folder','\x22\x20from\x20project\x20\x22','\x0aPush\x20summary\x20for\x20\x27','\x0aChanges\x20to\x20agent\x20\x27','action','\x0aError:','Dry\x20run\x20-\x20no\x20changes\x20made','gray','\x27\x20to\x20create\x20the\x20folder\x20structure.','error','\x20\x20Agent\x20\x22','Writing\x20files...','execute','newProjectName','diff','\x0aChanges\x20to\x20integration\x20\x27','\x20resources?','llm','errors','Using\x20context\x20project:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','pushAgent','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Chat:\x20','cwd-config','\x0aChanges:','description','Output:\x20','Using\x20project:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','pullProject','cloneProject','\x20unchanged','join','Agent\x20pulled\x20successfully','knowledgeBases','\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','newProjectId','hasChanges','\x0aPush\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\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)','75300BJDLtV','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Prompt\x20\x22','Output\x20path:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x0aChanges\x20to\x20prompt\x20\x27','tdx.json','133vlXMEB','234178ldzUFr','Pushing\x20agent\x20from\x20\x22','yes','experimentalKnowledgeBases','reason','utf-8','Analyzing\x20project\x20\x22','llm_project','\x20\x20Prompts:\x20','pushProject','projectId','<new-name>','dirname','\x20\x20Integrations:\x20','message','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','counts','No\x20tdx.json\x20found\x20in\x20','-\x20no\x20files\x20written','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','outputDir','Would\x20pull\x20agent:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Knowledge\x20Base\x20\x22','151971lIpxYZ','sourceProjectName'];a4_0x24d1=function(){return _0x132479;};return a4_0x24d1();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';function a4_0x4ea7(_0x13c9ed,_0x29c767){_0x13c9ed=_0x13c9ed-0x109;const _0x24d1ca=a4_0x24d1();let _0x4ea73a=_0x24d1ca[_0x13c9ed];return _0x4ea73a;}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x42c839){const _0xf7201=a4_0x4ea7,_0x4c6dc1=[];if(_0x42c839[_0xf7201(0x196)]!==undefined)_0x4c6dc1[_0xf7201(0x1bc)](_0x42c839[_0xf7201(0x196)]+_0xf7201(0x13a));if(_0x42c839['new']!==undefined&&_0x42c839['new']>0x0)_0x4c6dc1['push'](a4_0x1aedd1['green'](_0x42c839[_0xf7201(0x1b5)]+_0xf7201(0x111)));if(_0x42c839['created']!==undefined&&_0x42c839[_0xf7201(0x12b)]>0x0)_0x4c6dc1[_0xf7201(0x1bc)](a4_0x1aedd1['green'](_0x42c839['created']+_0xf7201(0x116)));if(_0x42c839['updated']!==undefined&&_0x42c839[_0xf7201(0x120)]>0x0)_0x4c6dc1[_0xf7201(0x1bc)](a4_0x1aedd1[_0xf7201(0x1b0)](_0x42c839[_0xf7201(0x120)]+'\x20updated'));if(_0x42c839[_0xf7201(0x127)]!==undefined&&_0x42c839[_0xf7201(0x127)]>0x0)_0x4c6dc1[_0xf7201(0x1bc)](a4_0x1aedd1['gray'](_0x42c839[_0xf7201(0x127)]+'\x20unchanged'));if(_0x42c839[_0xf7201(0x152)]!==undefined&&_0x42c839['errors']>0x0)_0x4c6dc1['push'](a4_0x1aedd1['red'](_0x42c839[_0xf7201(0x152)]+'\x20errors'));return _0x4c6dc1[_0xf7201(0x161)](',\x20');}function displayDiffs(_0x25d2e6,_0x4e483c,_0x3b8502,_0x56e8ea,_0x5b012f,_0x45dfff,_0x208a65){const _0x29dc06=a4_0x4ea7;for(const _0x5ea96b of _0x25d2e6){if(_0x5ea96b[_0x29dc06(0x14e)]){const _0x29bf1a=_0x5ea96b['agentName']||_0x5ea96b[_0x29dc06(0x13f)];console['log'](_0x29dc06(0x143)+_0x29bf1a+'\x27:'),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)),console[_0x29dc06(0x10d)](_0x5ea96b['diff']),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c));}}for(const _0x52cc86 of _0x4e483c){_0x52cc86[_0x29dc06(0x14e)]&&(console[_0x29dc06(0x10d)](_0x29dc06(0x188)+_0x52cc86['name']+'\x27:'),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)),console[_0x29dc06(0x10d)](_0x52cc86[_0x29dc06(0x14e)]),console[_0x29dc06(0x10d)]('─'['repeat'](0x3c)));}for(const _0x2e38b8 of _0x3b8502){_0x2e38b8['diff']&&(console[_0x29dc06(0x10d)](_0x29dc06(0x154)+_0x2e38b8['name']+'\x27:'),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)),console[_0x29dc06(0x10d)](_0x2e38b8[_0x29dc06(0x14e)]),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)));}for(const _0x27cefa of _0x56e8ea){_0x27cefa[_0x29dc06(0x14e)]&&(console[_0x29dc06(0x10d)](_0x29dc06(0x16f)+_0x27cefa[_0x29dc06(0x13f)]+'\x27:'),console[_0x29dc06(0x10d)]('─'['repeat'](0x3c)),console[_0x29dc06(0x10d)](_0x27cefa[_0x29dc06(0x14e)]),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)));}for(const _0x8537f7 of _0x5b012f){_0x8537f7[_0x29dc06(0x14e)]&&(console[_0x29dc06(0x10d)](_0x29dc06(0x14f)+_0x8537f7['name']+'\x27:'),console[_0x29dc06(0x10d)]('─'['repeat'](0x3c)),console[_0x29dc06(0x10d)](_0x8537f7['diff']),console['log']('─'[_0x29dc06(0x1b4)](0x3c)));}for(const _0x57cf97 of _0x45dfff){_0x57cf97['diff']&&(console[_0x29dc06(0x10d)](_0x29dc06(0x15d)+_0x57cf97[_0x29dc06(0x13f)]+'\x27:'),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)),console[_0x29dc06(0x10d)](_0x57cf97[_0x29dc06(0x14e)]),console['log']('─'[_0x29dc06(0x1b4)](0x3c)));}for(const _0x37e6b8 of _0x208a65){_0x37e6b8[_0x29dc06(0x14e)]&&(console[_0x29dc06(0x10d)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x37e6b8['name']+'\x27:'),console[_0x29dc06(0x10d)]('─'['repeat'](0x3c)),console[_0x29dc06(0x10d)](_0x37e6b8[_0x29dc06(0x14e)]),console[_0x29dc06(0x10d)]('─'[_0x29dc06(0x1b4)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x5e331e(0x15a)]=a4_0x5e331e(0x16e);async[a4_0x5e331e(0x14c)](_0x379eec){const _0x3b39b8=a4_0x5e331e,{options:_0x4c732f,args:_0x3e93ce,tdx:_0x361e69}=_0x379eec,_0x299b96=_0x3e93ce[0x0],_0x143815=_0x3e93ce[0x1],_0x23f3fd=_0x4c732f[_0x3b39b8(0x1c1)],_0x4c989d=_0x4c732f['dryRun'],_0xe37ca6=_0x4c732f[_0x3b39b8(0x10c)],_0x4567e4=_0x4c732f['yes'],_0x14313d=_0x4c732f['llmProject'],_0x23d825=_0x4c732f[_0x3b39b8(0x19e)];let _0x2274fd;if(_0x299b96){const _0x43e48c=a4_0x2fba22[_0x3b39b8(0x161)](_0x299b96,'tdx.json');if(existsSync(_0x43e48c))try{const _0x299081=JSON[_0x3b39b8(0x1b6)](readFileSync(_0x43e48c,_0x3b39b8(0x177)));_0x299081[_0x3b39b8(0x179)]&&(_0x2274fd={'llm_project':_0x299081[_0x3b39b8(0x179)]});}catch{}}const _0x2c7bd8=findAgentConfigPath(process['cwd']());let _0x30fadd;if(_0x2c7bd8)try{const _0x1385f1=JSON['parse'](readFileSync(_0x2c7bd8,_0x3b39b8(0x177)));_0x1385f1[_0x3b39b8(0x179)]&&(_0x30fadd={'llm_project':_0x1385f1['llm_project']});}catch{}const _0x2668bc=resolveAgentPullArgs({'arg':_0x299b96,'agentNameArg':_0x143815,'agentFlag':_0x23d825,'contextProject':_0x14313d,'argDirConfig':_0x2274fd,'cwdConfigPath':_0x2c7bd8||undefined,'cwdConfig':_0x30fadd}),{projectNameOrId:_0x487e67,targetAgentName:_0x2a4d4c,existingOutputDir:_0x207665,source:_0xbdf84b}=_0x2668bc;if(_0xbdf84b===_0x3b39b8(0x132))console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x130)]('Using\x20project\x20from\x20'+a4_0x2fba22[_0x3b39b8(0x161)](_0x299b96,_0x3b39b8(0x170))+':\x20'+_0x487e67));else{if(_0xbdf84b===_0x3b39b8(0x158))console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x130)]('Using\x20project:\x20'+_0x487e67));else _0xbdf84b===_0x3b39b8(0x123)&&console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x130)](_0x3b39b8(0x138)+_0x487e67));}if(!_0x487e67)return _0x23d825?(console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x1b0)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x3b39b8(0x10d)](_0x3b39b8(0x16b)),console[_0x3b39b8(0x10d)](_0x3b39b8(0x11c))):(console['log'](a4_0x1aedd1[_0x3b39b8(0x1b0)](_0x3b39b8(0x137))),console[_0x3b39b8(0x10d)]('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)'),console[_0x3b39b8(0x10d)](_0x3b39b8(0x1ad)),console[_0x3b39b8(0x10d)](_0x3b39b8(0x18e)),console[_0x3b39b8(0x10d)](_0x3b39b8(0x164)),console[_0x3b39b8(0x10d)]('\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(_0x2a4d4c){const {data:_0x282b04}=await withSpinner(_0x3b39b8(0x1be)+_0x2a4d4c+_0x3b39b8(0x141)+_0x487e67+_0x3b39b8(0x19a),()=>_0x361e69[_0x3b39b8(0x151)][_0x3b39b8(0x1ac)](_0x487e67,_0x2a4d4c,_0x23f3fd,{'dryRun':_0x4c989d,'force':_0xe37ca6}));if(_0x4c989d)return console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x1b0)](_0x3b39b8(0x11e))),console['log'](_0x3b39b8(0x187)+_0x282b04['agentName']),console[_0x3b39b8(0x10d)](_0x3b39b8(0x16d)+_0x282b04[_0x3b39b8(0x1aa)]),_0x282b04[_0x3b39b8(0x14e)]&&(console[_0x3b39b8(0x10d)](_0x3b39b8(0x159)),console['log']('─'[_0x3b39b8(0x1b4)](0x3c)),console['log'](_0x282b04[_0x3b39b8(0x14e)]),console[_0x3b39b8(0x10d)]('─'[_0x3b39b8(0x1b4)](0x3c))),0x0;return console['log'](a4_0x1aedd1[_0x3b39b8(0x1bb)](_0x3b39b8(0x162))),console[_0x3b39b8(0x10d)](_0x3b39b8(0x1a3)+_0x282b04[_0x3b39b8(0x10a)]),console[_0x3b39b8(0x10d)](_0x3b39b8(0x15b)+_0x282b04[_0x3b39b8(0x1aa)]),console[_0x3b39b8(0x10d)](_0x3b39b8(0x195)+(_0x282b04[_0x3b39b8(0x198)]?a4_0x1aedd1['green'](_0x3b39b8(0x1b5)):_0x282b04[_0x3b39b8(0x166)]?a4_0x1aedd1['yellow'](_0x3b39b8(0x120)):a4_0x1aedd1[_0x3b39b8(0x147)](_0x3b39b8(0x127)))),0x0;}const _0x16f5ca=_0x207665||_0x23f3fd,{data:_0x5aceb8}=await withSpinner(_0x3b39b8(0x178)+_0x487e67+_0x3b39b8(0x19a),()=>_0x361e69['llm'][_0x3b39b8(0x15e)](_0x487e67,_0x16f5ca,{'dryRun':!![]})),_0x5545ff=_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x119)][_0x3b39b8(0x1b5)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x163)][_0x3b39b8(0x1b5)]+_0x5aceb8[_0x3b39b8(0x182)]['textKnowledgeBases'][_0x3b39b8(0x1b5)]+_0x5aceb8['counts'][_0x3b39b8(0x1b7)][_0x3b39b8(0x1b5)]+_0x5aceb8[_0x3b39b8(0x182)]['integrations'][_0x3b39b8(0x1b5)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x175)]['new']+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x135)][_0x3b39b8(0x1b5)],_0x826ee8=_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x119)]['updated']+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x163)][_0x3b39b8(0x120)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x19d)]['updated']+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x1b7)][_0x3b39b8(0x120)]+_0x5aceb8['counts'][_0x3b39b8(0x136)][_0x3b39b8(0x120)]+_0x5aceb8['counts'][_0x3b39b8(0x175)][_0x3b39b8(0x120)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x135)][_0x3b39b8(0x120)],_0x408c2f=_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x119)]['unchanged']+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x163)]['unchanged']+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x19d)]['unchanged']+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x1b7)][_0x3b39b8(0x127)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x136)][_0x3b39b8(0x127)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x175)][_0x3b39b8(0x127)]+_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x135)][_0x3b39b8(0x127)];console[_0x3b39b8(0x10d)]('\x0aPull\x20summary\x20for\x20\x27'+_0x5aceb8[_0x3b39b8(0x1ae)]+'\x27:'),console[_0x3b39b8(0x10d)]('\x20\x20'+a4_0x1aedd1['green']('+\x20'+_0x5545ff+'\x20new')+_0x3b39b8(0x117)+a4_0x1aedd1['yellow']('~\x20'+_0x826ee8+_0x3b39b8(0x131))+_0x3b39b8(0x117)+a4_0x1aedd1[_0x3b39b8(0x130)]('=\x20'+_0x408c2f+_0x3b39b8(0x160))),console[_0x3b39b8(0x10d)](_0x3b39b8(0x122)+formatCountSummary(_0x5aceb8['counts'][_0x3b39b8(0x119)])),console['log'](_0x3b39b8(0x1a1)+formatCountSummary(_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x163)])),console[_0x3b39b8(0x10d)](_0x3b39b8(0x1b3)+formatCountSummary(_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x19d)])),console[_0x3b39b8(0x10d)](_0x3b39b8(0x17a)+formatCountSummary(_0x5aceb8['counts'][_0x3b39b8(0x1b7)])),console[_0x3b39b8(0x10d)](_0x3b39b8(0x17f)+formatCountSummary(_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x136)]));const _0x395c77=_0x5aceb8['counts'][_0x3b39b8(0x175)]['total']>0x0||_0x5aceb8['counts'][_0x3b39b8(0x135)]['total']>0x0;_0x395c77&&(console[_0x3b39b8(0x10d)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x175)])),console[_0x3b39b8(0x10d)](_0x3b39b8(0x189)+formatCountSummary(_0x5aceb8[_0x3b39b8(0x182)][_0x3b39b8(0x135)])));console[_0x3b39b8(0x10d)](_0x3b39b8(0x125)+a4_0x1aedd1[_0x3b39b8(0x1a4)](_0x5aceb8[_0x3b39b8(0x186)])),displayDiffs(_0x5aceb8[_0x3b39b8(0x119)],_0x5aceb8[_0x3b39b8(0x163)],_0x5aceb8['textKnowledgeBases'],_0x5aceb8[_0x3b39b8(0x1b7)],_0x5aceb8[_0x3b39b8(0x136)],_0x5aceb8[_0x3b39b8(0x175)],_0x5aceb8[_0x3b39b8(0x135)]);if(_0x4c989d)return console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x1b0)](_0x3b39b8(0x12c))),0x0;if(_0x5545ff===0x0&&_0x826ee8===0x0)return console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x1bb)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x5aceb8[_0x3b39b8(0x1ae)]},_0x4c732f[_0x3b39b8(0x109)]),console['log'](a4_0x1aedd1[_0x3b39b8(0x1bb)](_0x3b39b8(0x13d)+a4_0x1aedd1[_0x3b39b8(0x130)](_0x3b39b8(0x179))+_0x3b39b8(0x139)+a4_0x1aedd1[_0x3b39b8(0x1a4)](_0x5aceb8[_0x3b39b8(0x1ae)]))),0x0;if(!_0x4567e4&&!_0xe37ca6){if(!isInteractive())return console['error'](a4_0x1aedd1[_0x3b39b8(0x1a0)](_0x3b39b8(0x145)),_0x3b39b8(0x121)),console[_0x3b39b8(0x149)](a4_0x1aedd1[_0x3b39b8(0x130)](_0x3b39b8(0x129))),0x1;const _0x379c1b=await confirmKey(_0x3b39b8(0x10f)+(_0x5545ff+_0x826ee8)+'\x20files?');if(!_0x379c1b)return console[_0x3b39b8(0x10d)](a4_0x1aedd1['yellow'](_0x3b39b8(0x192)),_0x3b39b8(0x184)),0x1;}const {data:_0x39eb83}=await withSpinner(_0x3b39b8(0x14b),()=>_0x361e69[_0x3b39b8(0x151)][_0x3b39b8(0x15e)](_0x487e67,_0x16f5ca,{'force':_0xe37ca6}));return console[_0x3b39b8(0x10d)](a4_0x1aedd1[_0x3b39b8(0x1bb)]('\x0a✔\x20Pulled\x20'+(_0x5545ff+_0x826ee8)+_0x3b39b8(0x11f)+_0x39eb83[_0x3b39b8(0x186)])),saveSessionContext({'llm_project':_0x39eb83[_0x3b39b8(0x1ae)]},_0x4c732f['session']),console['log'](a4_0x1aedd1[_0x3b39b8(0x1bb)](_0x3b39b8(0x13d)+a4_0x1aedd1[_0x3b39b8(0x130)](_0x3b39b8(0x179))+_0x3b39b8(0x139)+a4_0x1aedd1[_0x3b39b8(0x1a4)](_0x39eb83[_0x3b39b8(0x1ae)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x5e331e(0x13f)]=a4_0x5e331e(0x1a5);[a4_0x5e331e(0x15a)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x5e331e(0x14c)](_0x5062c3){const _0x4b8cd4=a4_0x5e331e,{options:_0x7467a6,args:_0x349c7f,tdx:_0x2e03b5}=_0x5062c3,_0xde1a5a=_0x349c7f[0x0],_0xe0262a=_0x7467a6[_0x4b8cd4(0x13f)],_0xf80e30=_0x7467a6[_0x4b8cd4(0x1ba)],_0x3f8853=_0x7467a6['yes'],_0x449e66=_0x7467a6['site'],_0x1ad36f=_0x7467a6[_0x4b8cd4(0x11a)];let _0x3a9310;const _0x5d44c7=findAgentConfigPath(process[_0x4b8cd4(0x1c0)]());if(_0xde1a5a){const _0x18cc38=a4_0x2fba22[_0x4b8cd4(0x161)](_0xde1a5a,_0x4b8cd4(0x170));existsSync(_0x18cc38)?(_0x3a9310=_0xde1a5a,console['log'](a4_0x1aedd1['dim']('Using\x20local\x20project:\x20'+_0xde1a5a))):_0x3a9310=_0xde1a5a;}else{if(_0x5d44c7)_0x3a9310=a4_0x2fba22['dirname'](_0x5d44c7),console[_0x4b8cd4(0x10d)](a4_0x1aedd1['dim'](_0x4b8cd4(0x19f)+_0x3a9310));else{if(_0x1ad36f){const _0xca969d=sanitizeForFilesystem(_0x1ad36f);let _0x949de2=_0xca969d,_0x42c427=a4_0x2fba22[_0x4b8cd4(0x161)](process[_0x4b8cd4(0x1c0)](),_0x4b8cd4(0x119),_0xca969d,_0x4b8cd4(0x170));if(!existsSync(_0x42c427)){const _0x4d1cac=normalizeName(_0x1ad36f),_0x31e1bf=a4_0x2fba22['join'](process[_0x4b8cd4(0x1c0)](),_0x4b8cd4(0x119),_0x4d1cac,_0x4b8cd4(0x170));existsSync(_0x31e1bf)&&(_0x949de2=_0x4d1cac,_0x42c427=_0x31e1bf);}if(existsSync(_0x42c427))_0x3a9310=a4_0x2fba22[_0x4b8cd4(0x17e)](_0x42c427),console[_0x4b8cd4(0x10d)](a4_0x1aedd1['dim']('Using\x20local\x20project:\x20'+_0x3a9310));else{const _0x5df09d=_0x7467a6[_0x4b8cd4(0x1a8)];if(_0x5df09d)throw new SDKError(ErrorCode[_0x4b8cd4(0x126)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x1ad36f+_0x4b8cd4(0x1b1),undefined,{'helpText':_0x4b8cd4(0x110)+_0x4b8cd4(0x128)+(_0x4b8cd4(0x134)+_0x1ad36f+'\x0a')+(_0x4b8cd4(0x10b)+_0x949de2+_0x4b8cd4(0x18d)+(_0xe0262a||_0x4b8cd4(0x17d))+'\x20--profile\x20'+_0x5df09d)});_0x3a9310=_0x1ad36f,console[_0x4b8cd4(0x10d)](a4_0x1aedd1['dim'](_0x4b8cd4(0x153)+_0x1ad36f));}}}}if(!_0x3a9310)return console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1b0)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console['log'](_0x4b8cd4(0x191)),console[_0x4b8cd4(0x10d)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console['log'](_0x4b8cd4(0x169)),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x190)),0x1;if(!_0xe0262a)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x3f8853&&!_0xf80e30){if(!isInteractive())return console['error'](a4_0x1aedd1[_0x4b8cd4(0x1a0)]('\x0aError:'),_0x4b8cd4(0x121)),console['error'](a4_0x1aedd1[_0x4b8cd4(0x130)](_0x4b8cd4(0x129))),0x1;const _0x510ba5=await confirmKey('Clone\x20\x22'+_0x3a9310+_0x4b8cd4(0x13c)+_0xe0262a+'\x22?');if(!_0x510ba5)return console['log'](a4_0x1aedd1['yellow'](_0x4b8cd4(0x192))),0x1;}const {data:_0x278aad}=await withSpinner('Cloning\x20\x22'+_0x3a9310+_0x4b8cd4(0x1af)+_0xe0262a+_0x4b8cd4(0x19a),()=>_0x2e03b5[_0x4b8cd4(0x151)][_0x4b8cd4(0x15f)](_0x3a9310,_0xe0262a,{'dryRun':_0xf80e30}));if(_0xf80e30){console['log'](a4_0x1aedd1['yellow'](_0x4b8cd4(0x146))),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x19c)+_0x278aad[_0x4b8cd4(0x18c)]),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x197)+_0xe0262a),console[_0x4b8cd4(0x10d)]('Would\x20clone:'),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x122)+_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x119)][_0x4b8cd4(0x12b)]),console[_0x4b8cd4(0x10d)]('\x20\x20Knowledge\x20Bases:\x20'+_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x163)][_0x4b8cd4(0x12b)]),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x17a)+_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x1b7)][_0x4b8cd4(0x12b)]);const _0x2f257a=_0x278aad['counts']['experimentalKnowledgeBases'][_0x4b8cd4(0x12b)]>0x0||_0x278aad[_0x4b8cd4(0x182)]['experimentalArtifacts']['created']>0x0;return _0x2f257a&&(console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x185)+_0x278aad['counts'][_0x4b8cd4(0x175)][_0x4b8cd4(0x12b)]),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x189)+_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x135)][_0x4b8cd4(0x12b)])),0x0;}const _0x488e73=_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x119)][_0x4b8cd4(0x152)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x163)][_0x4b8cd4(0x152)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x1b7)][_0x4b8cd4(0x152)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x175)][_0x4b8cd4(0x152)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x135)]['errors']>0x0;_0x488e73?console[_0x4b8cd4(0x10d)](a4_0x1aedd1['yellow']('Project\x20cloned\x20with\x20errors')):console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1bb)](_0x4b8cd4(0x118)));console[_0x4b8cd4(0x10d)]('Source:\x20'+_0x278aad[_0x4b8cd4(0x18c)]),console['log'](_0x4b8cd4(0x197)+_0x278aad[_0x4b8cd4(0x14d)]),console[_0x4b8cd4(0x10d)]('New\x20project\x20ID:\x20'+_0x278aad['newProjectId']),console[_0x4b8cd4(0x10d)](),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x1a9)),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x122)+formatCountSummary(_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x119)])),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x1a1)+formatCountSummary(_0x278aad['counts'][_0x4b8cd4(0x163)])),console['log'](_0x4b8cd4(0x17a)+formatCountSummary(_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x1b7)])),console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x17f)+formatCountSummary(_0x278aad['counts'][_0x4b8cd4(0x136)]));const _0xe54f1c=_0x278aad['counts'][_0x4b8cd4(0x175)][_0x4b8cd4(0x12b)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x175)][_0x4b8cd4(0x120)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x175)][_0x4b8cd4(0x127)]>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x135)]['created']>0x0||_0x278aad['counts'][_0x4b8cd4(0x135)]['updated']>0x0||_0x278aad[_0x4b8cd4(0x182)][_0x4b8cd4(0x135)][_0x4b8cd4(0x127)]>0x0;_0xe54f1c&&(console[_0x4b8cd4(0x10d)](_0x4b8cd4(0x185)+formatCountSummary(_0x278aad['counts'][_0x4b8cd4(0x175)])),console['log'](_0x4b8cd4(0x189)+formatCountSummary(_0x278aad[_0x4b8cd4(0x182)]['experimentalArtifacts'])));if(_0x488e73){console[_0x4b8cd4(0x10d)](),console['log'](a4_0x1aedd1[_0x4b8cd4(0x1a0)]('Errors:'));for(const _0x3b50e4 of _0x278aad['agents']){_0x3b50e4[_0x4b8cd4(0x144)]===_0x4b8cd4(0x149)&&console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1a0)](_0x4b8cd4(0x14a)+_0x3b50e4[_0x4b8cd4(0x10a)]+_0x4b8cd4(0x113)+_0x3b50e4[_0x4b8cd4(0x149)]));}for(const _0x36b563 of _0x278aad[_0x4b8cd4(0x163)]){_0x36b563[_0x4b8cd4(0x144)]===_0x4b8cd4(0x149)&&console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1a0)](_0x4b8cd4(0x18a)+_0x36b563[_0x4b8cd4(0x13f)]+_0x4b8cd4(0x113)+_0x36b563['error']));}for(const _0x1fdb4d of _0x278aad[_0x4b8cd4(0x1b7)]){_0x1fdb4d[_0x4b8cd4(0x144)]==='error'&&console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1a0)](_0x4b8cd4(0x16c)+_0x1fdb4d['name']+'\x22:\x20'+_0x1fdb4d[_0x4b8cd4(0x149)]));}for(const _0x4c2227 of _0x278aad[_0x4b8cd4(0x136)]){_0x4c2227['action']==='error'&&console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1a0)]('\x20\x20Integration\x20\x22'+_0x4c2227[_0x4b8cd4(0x13f)]+'\x22:\x20'+_0x4c2227[_0x4b8cd4(0x149)]));}for(const _0x4b70a4 of _0x278aad[_0x4b8cd4(0x175)]){_0x4b70a4[_0x4b8cd4(0x144)]===_0x4b8cd4(0x149)&&console[_0x4b8cd4(0x10d)](a4_0x1aedd1['red'](_0x4b8cd4(0x1b2)+_0x4b70a4['name']+_0x4b8cd4(0x113)+_0x4b70a4[_0x4b8cd4(0x149)]));}for(const _0x3e565f of _0x278aad[_0x4b8cd4(0x135)]){_0x3e565f[_0x4b8cd4(0x144)]===_0x4b8cd4(0x149)&&console[_0x4b8cd4(0x10d)](a4_0x1aedd1[_0x4b8cd4(0x1a0)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x3e565f[_0x4b8cd4(0x13f)]+_0x4b8cd4(0x113)+_0x3e565f[_0x4b8cd4(0x149)]));}return 0x1;}console['log']();const _0x548a42=getLLMProjectUrl(_0x449e66,_0x278aad[_0x4b8cd4(0x165)]);return console['log'](_0x4b8cd4(0x1a6)+a4_0x1aedd1[_0x4b8cd4(0x1a4)](_0x548a42)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x5e331e(0x13f)]='agent:push';[a4_0x5e331e(0x15a)]=a4_0x5e331e(0x156);async[a4_0x5e331e(0x14c)](_0x5083d8){const _0x4f1c26=a4_0x5e331e,{options:_0x493b0c,args:_0x203ada,tdx:_0x3ee319}=_0x5083d8;let _0x8949db=_0x203ada[0x0]||process[_0x4f1c26(0x1c0)]();const _0x48027d=_0x493b0c[_0x4f1c26(0x1ba)],_0x1ac105=_0x493b0c[_0x4f1c26(0x10c)],_0x4bc10d=_0x493b0c[_0x4f1c26(0x174)],_0x2d98f2=_0x493b0c[_0x4f1c26(0x193)],_0x36dbc2=a4_0x2fba22['join'](_0x8949db,'agent.yml'),_0x3dde9c=existsSync(_0x36dbc2);if(_0x3dde9c){const {data:_0x40ea65}=await withSpinner(_0x4f1c26(0x173)+_0x8949db+_0x4f1c26(0x19a),()=>_0x3ee319[_0x4f1c26(0x151)][_0x4f1c26(0x155)](_0x8949db,{'dryRun':_0x48027d,'force':_0x1ac105}));if(_0x48027d)return console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1b0)](_0x4f1c26(0x146))),console[_0x4f1c26(0x10d)](_0x4f1c26(0x11b)+_0x40ea65[_0x4f1c26(0x10a)]),0x0;if(_0x40ea65[_0x4f1c26(0x144)]===_0x4f1c26(0x149))return console['log'](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x12a)+_0x40ea65[_0x4f1c26(0x149)])),0x1;console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1bb)](_0x4f1c26(0x124)+_0x40ea65[_0x4f1c26(0x144)]+_0x4f1c26(0x12e))),console[_0x4f1c26(0x10d)]('Agent:\x20'+_0x40ea65[_0x4f1c26(0x10a)]);if(_0x40ea65[_0x4f1c26(0x18f)]&&_0x40ea65[_0x4f1c26(0x17c)]){const _0x251773=getLLMAgentChatUrl(_0x2d98f2,_0x40ea65[_0x4f1c26(0x17c)],_0x40ea65['agentId']);console[_0x4f1c26(0x10d)](_0x4f1c26(0x157)+a4_0x1aedd1[_0x4f1c26(0x1a4)](_0x251773));}return 0x0;}const _0x5e012d=_0x493b0c[_0x4f1c26(0x11a)],_0x58f0b0=resolveProjectFromContext(_0x8949db,_0x5e012d);if(_0x58f0b0[_0x4f1c26(0x1c2)])_0x8949db=_0x58f0b0[_0x4f1c26(0x13b)],_0x58f0b0[_0x4f1c26(0x1b9)]===_0x4f1c26(0x123)&&console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x130)](_0x4f1c26(0x15c)+_0x8949db));else{let _0x58f515=_0x4f1c26(0x168);_0x58f0b0['reason']===_0x4f1c26(0x140)&&(_0x58f515=_0x58f0b0[_0x4f1c26(0x180)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x58f0b0['llmProject']+_0x4f1c26(0x148));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x58f0b0[_0x4f1c26(0x176)]===_0x4f1c26(0x114)?_0x58f0b0[_0x4f1c26(0x180)]:_0x4f1c26(0x183)+_0x8949db,undefined,{'helpText':_0x58f515});}const {data:_0x53d400}=await withSpinner(_0x4f1c26(0x12d),()=>_0x3ee319[_0x4f1c26(0x151)][_0x4f1c26(0x17b)](_0x8949db,{'dryRun':!![]})),_0x4f2123=_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x119)][_0x4f1c26(0x152)]>0x0;if(_0x4f2123){console['log'](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x1bf)));for(const _0x4ef222 of _0x53d400[_0x4f1c26(0x119)]){_0x4ef222[_0x4f1c26(0x144)]===_0x4f1c26(0x149)&&console['log'](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x14a)+_0x4ef222[_0x4f1c26(0x10a)]+_0x4f1c26(0x113)+_0x4ef222[_0x4f1c26(0x149)]));}return 0x1;}const _0x5c7b6d=_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x119)]['created']+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x163)][_0x4f1c26(0x12b)]+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x19d)]['created']+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x1b7)]['created']+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x136)]['created']+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x175)]['created']+_0x53d400[_0x4f1c26(0x182)]['experimentalArtifacts'][_0x4f1c26(0x12b)],_0x2ac15c=_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x119)][_0x4f1c26(0x120)]+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x163)]['updated']+_0x53d400[_0x4f1c26(0x182)]['textKnowledgeBases'][_0x4f1c26(0x120)]+_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x1b7)][_0x4f1c26(0x120)]+_0x53d400['counts']['integrations'][_0x4f1c26(0x120)]+_0x53d400[_0x4f1c26(0x182)]['experimentalKnowledgeBases']['updated']+_0x53d400['counts']['experimentalArtifacts'][_0x4f1c26(0x120)],_0x88d0f1=_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x119)]['unchanged']+_0x53d400[_0x4f1c26(0x182)]['knowledgeBases'][_0x4f1c26(0x127)]+_0x53d400['counts']['textKnowledgeBases'][_0x4f1c26(0x127)]+_0x53d400[_0x4f1c26(0x182)]['prompts'][_0x4f1c26(0x127)]+_0x53d400[_0x4f1c26(0x182)]['integrations']['unchanged']+_0x53d400['counts'][_0x4f1c26(0x175)][_0x4f1c26(0x127)]+_0x53d400['counts']['experimentalArtifacts'][_0x4f1c26(0x127)];console['log'](_0x4f1c26(0x142)+_0x53d400[_0x4f1c26(0x1ae)]+'\x27:'),console['log']('\x20\x20'+a4_0x1aedd1['green']('+\x20'+_0x5c7b6d+_0x4f1c26(0x111))+_0x4f1c26(0x117)+a4_0x1aedd1[_0x4f1c26(0x1b0)]('~\x20'+_0x2ac15c+'\x20changed')+_0x4f1c26(0x117)+a4_0x1aedd1['dim']('=\x20'+_0x88d0f1+_0x4f1c26(0x160))),console[_0x4f1c26(0x10d)](_0x4f1c26(0x122)+formatCountSummary(_0x53d400[_0x4f1c26(0x182)]['agents'])),console[_0x4f1c26(0x10d)](_0x4f1c26(0x1a1)+formatCountSummary(_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x163)])),console[_0x4f1c26(0x10d)](_0x4f1c26(0x1b3)+formatCountSummary(_0x53d400['counts'][_0x4f1c26(0x19d)])),console[_0x4f1c26(0x10d)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x1b7)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x136)]));const _0x391ef0=_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x175)][_0x4f1c26(0x12b)]>0x0||_0x53d400['counts'][_0x4f1c26(0x175)][_0x4f1c26(0x120)]>0x0||_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x175)]['unchanged']>0x0||_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x135)][_0x4f1c26(0x12b)]>0x0||_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x135)]['updated']>0x0||_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x135)][_0x4f1c26(0x127)]>0x0;_0x391ef0&&(console[_0x4f1c26(0x10d)](_0x4f1c26(0x185)+formatCountSummary(_0x53d400[_0x4f1c26(0x182)]['experimentalKnowledgeBases'])),console['log'](_0x4f1c26(0x189)+formatCountSummary(_0x53d400[_0x4f1c26(0x182)][_0x4f1c26(0x135)])));console[_0x4f1c26(0x10d)]('\x20\x20Source:\x20'+a4_0x1aedd1[_0x4f1c26(0x1a4)](_0x8949db)),displayDiffs(_0x53d400[_0x4f1c26(0x119)],_0x53d400[_0x4f1c26(0x163)],_0x53d400[_0x4f1c26(0x19d)],_0x53d400['prompts'],_0x53d400[_0x4f1c26(0x136)],_0x53d400[_0x4f1c26(0x175)],_0x53d400[_0x4f1c26(0x135)]);if(_0x48027d)return console['log'](a4_0x1aedd1[_0x4f1c26(0x1b0)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x5c7b6d===0x0&&_0x2ac15c===0x0){console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1bb)](_0x4f1c26(0x181)));const _0x29dc5c=getLLMProjectUrl(_0x2d98f2,_0x53d400['projectId']);return console['log']('Project:\x20'+a4_0x1aedd1[_0x4f1c26(0x1a4)](_0x29dc5c)),0x0;}if(!_0x4bc10d&&!_0x1ac105){if(!isInteractive())return console['error'](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x145)),_0x4f1c26(0x121)),console[_0x4f1c26(0x149)](a4_0x1aedd1[_0x4f1c26(0x130)](_0x4f1c26(0x129))),0x1;const _0x17b4b2=await confirmKey(_0x4f1c26(0x167)+(_0x5c7b6d+_0x2ac15c)+_0x4f1c26(0x150));if(!_0x17b4b2)return console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1b0)]('Cancelled'),_0x4f1c26(0x11d)),0x1;}const {data:_0x3d5c4f}=await withSpinner(_0x4f1c26(0x1bd),()=>_0x3ee319['llm'][_0x4f1c26(0x17b)](_0x8949db,{'force':_0x1ac105})),_0x4129e8=_0x3d5c4f['counts'][_0x4f1c26(0x119)][_0x4f1c26(0x152)]>0x0||_0x3d5c4f[_0x4f1c26(0x182)][_0x4f1c26(0x163)][_0x4f1c26(0x152)]>0x0||_0x3d5c4f['counts'][_0x4f1c26(0x19d)][_0x4f1c26(0x152)]>0x0||_0x3d5c4f[_0x4f1c26(0x182)]['prompts'][_0x4f1c26(0x152)]>0x0;if(_0x4129e8){console['log'](a4_0x1aedd1['yellow'](_0x4f1c26(0x19b))),console[_0x4f1c26(0x10d)](),console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x10e)));for(const _0x385e47 of _0x3d5c4f['agents']){_0x385e47[_0x4f1c26(0x144)]===_0x4f1c26(0x149)&&console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x14a)+_0x385e47[_0x4f1c26(0x10a)]+_0x4f1c26(0x113)+_0x385e47[_0x4f1c26(0x149)]));}for(const _0x572f3a of _0x3d5c4f['knowledgeBases']){_0x572f3a['action']==='error'&&console['log'](a4_0x1aedd1['red'](_0x4f1c26(0x18a)+_0x572f3a['name']+'\x22:\x20'+_0x572f3a[_0x4f1c26(0x149)]));}for(const _0x41343b of _0x3d5c4f['textKnowledgeBases']){_0x41343b[_0x4f1c26(0x144)]===_0x4f1c26(0x149)&&console[_0x4f1c26(0x10d)](a4_0x1aedd1[_0x4f1c26(0x1a0)](_0x4f1c26(0x12f)+_0x41343b[_0x4f1c26(0x13f)]+_0x4f1c26(0x113)+_0x41343b['error']));}for(const _0x28c3eb of _0x3d5c4f[_0x4f1c26(0x1b7)]){_0x28c3eb[_0x4f1c26(0x144)]===_0x4f1c26(0x149)&&console['log'](a4_0x1aedd1['red']('\x20\x20Prompt\x20\x22'+_0x28c3eb[_0x4f1c26(0x13f)]+'\x22:\x20'+_0x28c3eb[_0x4f1c26(0x149)]));}for(const _0x2b0b58 of _0x3d5c4f['integrations']){_0x2b0b58[_0x4f1c26(0x144)]===_0x4f1c26(0x149)&&console[_0x4f1c26(0x10d)](a4_0x1aedd1['red'](_0x4f1c26(0x115)+_0x2b0b58[_0x4f1c26(0x13f)]+_0x4f1c26(0x113)+_0x2b0b58['error']));}return 0x1;}console['log'](a4_0x1aedd1[_0x4f1c26(0x1bb)]('\x0a✔\x20Pushed\x20'+(_0x5c7b6d+_0x2ac15c)+_0x4f1c26(0x1b8)+_0x3d5c4f['projectName']+'\x27'));const _0x53aaaa=getLLMProjectUrl(_0x2d98f2,_0x3d5c4f[_0x4f1c26(0x17c)]);return console[_0x4f1c26(0x10d)](_0x4f1c26(0x1a6)+a4_0x1aedd1[_0x4f1c26(0x1a4)](_0x53aaaa)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x388b9c=a5_0x25e7;function a5_0x3497(){const _0xcbc19e=['no_context','resolveProjectId','Error\x20writing\x20output\x20file:\x20','FAIL','Run\x20\x27tdx\x20agent\x20pull\x20','...\x20','Usage:','name','white','forEach','dim','...','\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)','No\x20tests\x20found\x20with\x20tags:\x20','utf-8','\x20\x20-\x20','⚠\x20SKIPPED:\x20','llmProject','dryRun','size','multiple_agents','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','length','status','found','filter','Duration:\x20','Failed:\x20\x20\x20','site','Either\x20switch\x20to\x20the\x20\x22','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','no_local_folder','Output\x20written\x20to:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','output','\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','\x22:\x20','verbose','agent','Running\x20test:\x20','split','ERROR','now','testName','1584807STvxSu','writeFileSync','Test\x20Summary','green','push','includes','Re-evaluating\x20cached\x20test\x20run...','testYmlPath','\x20(new)','tags','/<agent-name>','message','repeat','365HGRwzw','2859252PgZQYV','conversation_url','PASS','round','No\x20tests\x20have\x20tags\x20defined.','Re-evaluating...','agentDirs','✗\x20FAIL:\x20','Round\x20','Passed:\x20\x20\x20','llm','reeval','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','trim','Using\x20agent:\x20','yellow','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','projectDir','Running\x20agent\x20tests...','✗\x20ERROR:\x20Project\x20not\x20found:\x20','agent:test','Run\x20tests\x20for\x20an\x20LLM\x20agent','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x20\x20Site:\x20','Re-evaluating\x20','✓\x20PASS:\x20','context','stop','test.yml','\x20(cached)','Errors:\x20\x20\x20','328826luEVsc','cyan','jsonl','toISOString','8AnpOhA','table','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','source','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','resolve','Round\x201/','Executing\x20new\x20tests...','projectName','Test\x20Configuration:','23476jStiAj','agentName','timestamp','eval','\x20\x20Agent:\x20','404','existsSync','\x20\x20Evaluating...\x20','no_tests','description','New\x20tests\x20to\x20execute:\x20','✗\x20ERROR:\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','574107ExdKME','join','Available\x20tests:\x20','tsv','toLowerCase','tests','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','text','basename','start','find','\x20-\x20','\x20\x20Project:\x20','3772293eddhKJ','has','not\x20found','json','reason','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','executeReeval','conversations','map','Total:\x20\x20\x20\x20','\x20\x20Conversation:\x20','rounds','Evaluating\x20response...','\x20\x20Round\x20',':\x20Sending\x20user\x20input...','1169496KvwLaO','Test\x20','red','log'];a5_0x3497=function(){return _0xcbc19e;};return a5_0x3497();}(function(_0x4805c3,_0x5eb274){const _0x43a77f=a5_0x25e7,_0x1d689f=_0x4805c3();while(!![]){try{const _0x128050=-parseInt(_0x43a77f(0x131))/0x1+parseInt(_0x43a77f(0x116))/0x2+parseInt(_0x43a77f(0x17d))/0x3+-parseInt(_0x43a77f(0x124))/0x4*(-parseInt(_0x43a77f(0x18a))/0x5)+parseInt(_0x43a77f(0x18b))/0x6+parseInt(_0x43a77f(0x13e))/0x7*(-parseInt(_0x43a77f(0x11a))/0x8)+-parseInt(_0x43a77f(0x14d))/0x9;if(_0x128050===_0x5eb274)break;else _0x1d689f['push'](_0x1d689f['shift']());}catch(_0x414771){_0x1d689f['push'](_0x1d689f['shift']());}}}(a5_0x3497,0x56997));function a5_0x25e7(_0x14ddc7,_0x59ebe5){_0x14ddc7=_0x14ddc7-0x10c;const _0x3497ea=a5_0x3497();let _0x25e71f=_0x3497ea[_0x14ddc7];return _0x25e71f;}import*as a5_0x30d085 from'node:fs';import*as a5_0x426415 from'node:path';import a5_0x530ff0 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x388b9c(0x158)]=a5_0x388b9c(0x19f);[a5_0x388b9c(0x12d)]=a5_0x388b9c(0x10c);async['execute'](_0x4e584b){const _0x5c5640=a5_0x388b9c,{options:_0x47cb4d,args:_0x21b18d,tdx:_0x5edaa8}=_0x4e584b,_0x42383b=_0x21b18d[0x0]||'.',_0x1e39cc=_0x47cb4d[_0x5c5640(0x163)],_0x43ff39=_0x47cb4d,_0xf38265=_0x43ff39[_0x5c5640(0x127)]===![],_0x18e6e8=_0x43ff39[_0x5c5640(0x196)],_0x32cc55=_0x43ff39[_0x5c5640(0x158)],_0x24c558=_0x43ff39[_0x5c5640(0x186)],_0x2e5bc0=_0x47cb4d[_0x5c5640(0x16d)],_0x37846e=_0x43ff39[_0x5c5640(0x173)];if(_0x18e6e8&&_0xf38265)return console['log'](a5_0x530ff0[_0x5c5640(0x14f)](_0x5c5640(0x172))),0x1;let _0x492f5d=_0x5c5640(0x11b);if(_0x43ff39[_0x5c5640(0x141)])_0x492f5d=_0x5c5640(0x141);else{if(_0x43ff39[_0x5c5640(0x118)])_0x492f5d=_0x5c5640(0x118);else{if(_0x43ff39[_0x5c5640(0x134)])_0x492f5d=_0x5c5640(0x134);else{if(_0x43ff39[_0x5c5640(0x11b)])_0x492f5d=_0x5c5640(0x11b);}}}const _0x29898b=_0x43ff39['llmProject'];let _0x30a788=_0x42383b;const _0x25b7d1=a5_0x30d085[_0x5c5640(0x12a)](_0x42383b),_0x137b74=_0x42383b==='.';if(!_0x25b7d1||_0x137b74){const _0x9bfc61=resolveProjectFromContext(_0x42383b,_0x29898b,{'requireFile':_0x5c5640(0x113)});if(_0x9bfc61[_0x5c5640(0x169)])_0x30a788=_0x9bfc61[_0x5c5640(0x19c)],_0x9bfc61[_0x5c5640(0x11d)]===_0x5c5640(0x111)&&console[_0x5c5640(0x150)](a5_0x530ff0[_0x5c5640(0x15b)](_0x5c5640(0x199)+_0x30a788));else switch(_0x9bfc61[_0x5c5640(0x142)]){case _0x5c5640(0x151):console[_0x5c5640(0x150)](a5_0x530ff0['yellow'](_0x9bfc61['message'])),console['log'](),console[_0x5c5640(0x150)](_0x5c5640(0x157)),console[_0x5c5640(0x150)](_0x5c5640(0x174)),console[_0x5c5640(0x150)](_0x5c5640(0x15d)),console['log'](),console['log']('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x5c5640(0x170):console[_0x5c5640(0x150)](a5_0x530ff0['yellow'](_0x9bfc61['message'])),console[_0x5c5640(0x150)](),console[_0x5c5640(0x150)](_0x5c5640(0x155)+_0x9bfc61['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x5c5640(0x165):{const _0x118ef9=a5_0x426415[_0x5c5640(0x139)](_0x9bfc61[_0x5c5640(0x19c)]);console[_0x5c5640(0x150)](a5_0x530ff0[_0x5c5640(0x19a)](_0x5c5640(0x10d)+_0x9bfc61[_0x5c5640(0x162)]+'\x22:'));for(const _0x1f834c of _0x9bfc61[_0x5c5640(0x191)]){console[_0x5c5640(0x150)](_0x5c5640(0x160)+_0x1f834c);}return console['log'](),console['log'](_0x5c5640(0x137)+_0x118ef9+_0x5c5640(0x187)),0x1;}case _0x5c5640(0x12c):console['log'](a5_0x530ff0['yellow'](_0x5c5640(0x166)+_0x9bfc61['llmProject']+'\x22.')),console['log'](a5_0x530ff0[_0x5c5640(0x15b)]('Project\x20path:\x20'+_0x9bfc61['projectDir'])),console[_0x5c5640(0x150)](),console[_0x5c5640(0x150)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x2c3fe2,agentInfo:_0xda64b9}=parseTestFile(_0x30a788);let _0x563ff7=_0x2c3fe2[_0x5c5640(0x136)];if(_0x32cc55){const _0x21a28c=_0x32cc55[_0x5c5640(0x179)](',')[_0x5c5640(0x146)](_0x2b9f26=>_0x2b9f26[_0x5c5640(0x198)]());_0x563ff7=_0x2c3fe2['tests'][_0x5c5640(0x16a)](_0x50aa8f=>_0x21a28c['includes'](_0x50aa8f[_0x5c5640(0x158)]));if(_0x563ff7['length']===0x0)return console[_0x5c5640(0x150)](a5_0x530ff0[_0x5c5640(0x19a)]('No\x20tests\x20found\x20matching:\x20'+_0x32cc55)),console['log'](a5_0x530ff0[_0x5c5640(0x15b)](_0x5c5640(0x133)+_0x2c3fe2[_0x5c5640(0x136)][_0x5c5640(0x146)](_0xd12b41=>_0xd12b41[_0x5c5640(0x158)])['join'](',\x20'))),0x1;}if(_0x24c558){const _0xe2b4c9=_0x24c558[_0x5c5640(0x179)](',')[_0x5c5640(0x146)](_0x3f9534=>_0x3f9534[_0x5c5640(0x198)]()[_0x5c5640(0x135)]());_0x563ff7=_0x563ff7[_0x5c5640(0x16a)](_0x3eac77=>_0x3eac77['tags']?.['some'](_0x59ff2f=>_0xe2b4c9[_0x5c5640(0x182)](_0x59ff2f[_0x5c5640(0x135)]())));if(_0x563ff7[_0x5c5640(0x167)]===0x0){console[_0x5c5640(0x150)](a5_0x530ff0[_0x5c5640(0x19a)](_0x5c5640(0x15e)+_0x24c558));const _0x165dfd=new Set();return _0x2c3fe2[_0x5c5640(0x136)][_0x5c5640(0x15a)](_0x31a3bc=>_0x31a3bc[_0x5c5640(0x186)]?.['forEach'](_0x4b146f=>_0x165dfd['add'](_0x4b146f))),_0x165dfd[_0x5c5640(0x164)]>0x0?console[_0x5c5640(0x150)](a5_0x530ff0[_0x5c5640(0x15b)]('Available\x20tags:\x20'+[..._0x165dfd]['join'](',\x20'))):console[_0x5c5640(0x150)](a5_0x530ff0[_0x5c5640(0x15b)](_0x5c5640(0x18f))),0x1;}}if(_0x18e6e8)return this[_0x5c5640(0x144)](_0x4e584b,{'definition':{'tests':_0x563ff7},'agentInfo':_0xda64b9,'outputFormat':_0x492f5d,'outputFile':_0x37846e,'testNames':_0x32cc55});if(_0x1e39cc){console['log'](a5_0x530ff0[_0x5c5640(0x117)](_0x5c5640(0x123))),console[_0x5c5640(0x150)](_0x5c5640(0x10e)+a5_0x530ff0[_0x5c5640(0x159)](_0x2e5bc0)),console[_0x5c5640(0x150)](_0x5c5640(0x13d)+a5_0x530ff0[_0x5c5640(0x159)](_0xda64b9[_0x5c5640(0x122)])),console[_0x5c5640(0x150)](_0x5c5640(0x128)+a5_0x530ff0[_0x5c5640(0x159)](_0xda64b9[_0x5c5640(0x125)])),console['log'](),console[_0x5c5640(0x150)]('Tests\x20found:\x20'+a5_0x530ff0['white'](_0x563ff7[_0x5c5640(0x167)]));for(let _0x1da52b=0x0;_0x1da52b<_0x563ff7[_0x5c5640(0x167)];_0x1da52b++){const _0x3928cc=_0x563ff7[_0x1da52b],_0x28d83b=_0x3928cc[_0x5c5640(0x149)]['length']===0x1?_0x5c5640(0x18e):'rounds',_0x458ca9=_0x3928cc[_0x5c5640(0x186)]?.['length']?'\x20['+_0x3928cc[_0x5c5640(0x186)][_0x5c5640(0x132)](',\x20')+']':'';console[_0x5c5640(0x150)]('\x20\x20'+(_0x1da52b+0x1)+'.\x20'+a5_0x530ff0['white'](_0x3928cc[_0x5c5640(0x158)])+'\x20('+_0x3928cc[_0x5c5640(0x149)][_0x5c5640(0x167)]+'\x20'+_0x28d83b+')'+a5_0x530ff0[_0x5c5640(0x15b)](_0x458ca9));}return 0x0;}let _0x1544b6,_0x15926c;try{_0x1544b6=await _0x5edaa8['llm'][_0x5c5640(0x152)](_0xda64b9[_0x5c5640(0x122)]);}catch(_0x15ad8e){const _0x3ea0c2=_0x15ad8e instanceof Error?_0x15ad8e[_0x5c5640(0x188)]:String(_0x15ad8e);return _0x3ea0c2[_0x5c5640(0x182)](_0x5c5640(0x129))||_0x3ea0c2['toLowerCase']()[_0x5c5640(0x182)](_0x5c5640(0x140))?console['log'](a5_0x530ff0[_0x5c5640(0x14f)](_0x5c5640(0x19e)+_0xda64b9[_0x5c5640(0x122)])):console[_0x5c5640(0x150)](a5_0x530ff0[_0x5c5640(0x14f)](_0x5c5640(0x19b)+_0xda64b9[_0x5c5640(0x122)]+'\x22:\x20'+_0x3ea0c2)),0x1;}try{_0x15926c=await _0x5edaa8[_0x5c5640(0x195)]['resolveAgentId'](_0xda64b9[_0x5c5640(0x125)],_0x1544b6);}catch(_0x5421c2){const _0x43908b=_0x5421c2 instanceof Error?_0x5421c2[_0x5c5640(0x188)]:String(_0x5421c2);return _0x43908b[_0x5c5640(0x182)](_0x5c5640(0x129))||_0x43908b[_0x5c5640(0x135)]()[_0x5c5640(0x182)](_0x5c5640(0x140))?console[_0x5c5640(0x150)](a5_0x530ff0['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0xda64b9[_0x5c5640(0x125)])):console['log'](a5_0x530ff0[_0x5c5640(0x14f)](_0x5c5640(0x143)+_0xda64b9['agentName']+_0x5c5640(0x175)+_0x43908b)),0x1;}let _0x8b5a48;if(!_0xf38265)try{_0x8b5a48=await setupEvaluatorAgent(_0x5edaa8[_0x5c5640(0x195)],_0x47cb4d[_0x5c5640(0x176)]);}catch(_0x2ea849){const _0x269d64=_0x2ea849 instanceof Error?_0x2ea849[_0x5c5640(0x188)]:String(_0x2ea849);return console[_0x5c5640(0x150)](a5_0x530ff0[_0x5c5640(0x14f)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x269d64)),0x1;}console[_0x5c5640(0x150)](a5_0x530ff0[_0x5c5640(0x117)](_0x5c5640(0x19d))),console['log']('Site:\x20'+a5_0x530ff0[_0x5c5640(0x159)](_0x2e5bc0)),console[_0x5c5640(0x150)]('Agent:\x20'+a5_0x530ff0['white'](_0xda64b9[_0x5c5640(0x122)]+'/'+_0xda64b9[_0x5c5640(0x125)])),console[_0x5c5640(0x150)]();const _0x240ba6=[],_0x3a365e=[],_0x1b04ee=Date[_0x5c5640(0x17b)]();for(let _0x5cfc59=0x0;_0x5cfc59<_0x563ff7[_0x5c5640(0x167)];_0x5cfc59++){const _0x1527dc=_0x563ff7[_0x5cfc59];_0x563ff7['length']>0x1?console[_0x5c5640(0x150)](_0x5c5640(0x14e)+(_0x5cfc59+0x1)+'/'+_0x563ff7[_0x5c5640(0x167)]+':\x20'+a5_0x530ff0[_0x5c5640(0x159)](_0x1527dc[_0x5c5640(0x158)])):console[_0x5c5640(0x150)](_0x5c5640(0x178)+a5_0x530ff0[_0x5c5640(0x159)](_0x1527dc[_0x5c5640(0x158)]));const _0x57baef=createCommandSpinner(_0x5c5640(0x120)+_0x1527dc[_0x5c5640(0x149)][_0x5c5640(0x167)]+_0x5c5640(0x14c));_0x57baef['start']();try{const {result:_0x57e0ed,conversation:_0x3d0584}=await runTest(_0x5edaa8[_0x5c5640(0x195)],_0x1527dc,{'agentId':_0x15926c,'projectId':_0x1544b6,'site':_0x2e5bc0,'noEval':_0xf38265,'evaluatorId':_0x8b5a48,'onRoundStart':(_0x4a6447,_0x1875b7)=>{const _0x228e94=_0x5c5640;_0x57baef['text']=_0x228e94(0x193)+(_0x4a6447+0x1)+'/'+_0x1875b7+_0x228e94(0x14c);},'onRoundComplete':(_0x4dddc9,_0x2c8b5c,_0x51245a)=>{const _0x4f566a=_0x5c5640,_0x22ed70=formatElapsed(_0x2c8b5c);_0x51245a?console['log'](_0x4f566a(0x14b)+(_0x4dddc9+0x1)+'/'+_0x1527dc['rounds'][_0x4f566a(0x167)]+_0x4f566a(0x156)+a5_0x530ff0['green']('✓')+'\x20('+_0x22ed70+')'):console[_0x4f566a(0x150)](_0x4f566a(0x14b)+(_0x4dddc9+0x1)+'/'+_0x1527dc['rounds'][_0x4f566a(0x167)]+_0x4f566a(0x156)+a5_0x530ff0[_0x4f566a(0x14f)]('✗'));},'onEvaluationStart':()=>{const _0x1e0458=_0x5c5640;_0x57baef[_0x1e0458(0x138)]=_0x1e0458(0x14a);},'onEvaluationComplete':_0x2b8c26=>{const _0x2e5bbd=_0x5c5640,_0x39e7b5=formatElapsed(_0x2b8c26);console[_0x2e5bbd(0x150)]('\x20\x20Evaluating...\x20'+a5_0x530ff0['green']('✓')+'\x20('+_0x39e7b5+')');}});_0x57baef['stop'](),_0x240ba6[_0x5c5640(0x181)](_0x57e0ed),_0x3a365e[_0x5c5640(0x181)](_0x3d0584);if(_0x57e0ed['status']==='PASS')console[_0x5c5640(0x150)](a5_0x530ff0[_0x5c5640(0x180)](_0x5c5640(0x110)+_0x57e0ed[_0x5c5640(0x142)]));else _0x57e0ed['status']===_0x5c5640(0x154)?console['log'](a5_0x530ff0['red'](_0x5c5640(0x192)+_0x57e0ed[_0x5c5640(0x142)])):console[_0x5c5640(0x150)](a5_0x530ff0['red'](_0x5c5640(0x12f)+_0x57e0ed[_0x5c5640(0x142)]));_0x57e0ed[_0x5c5640(0x18c)]&&console[_0x5c5640(0x150)](a5_0x530ff0[_0x5c5640(0x15b)]('Conversation\x20URL:\x20'+_0x57e0ed['conversation_url'])),console[_0x5c5640(0x150)]();}catch(_0x4c951f){_0x57baef[_0x5c5640(0x112)]();const _0x2e4a65=_0x4c951f instanceof Error?_0x4c951f[_0x5c5640(0x188)]:String(_0x4c951f);console[_0x5c5640(0x150)](a5_0x530ff0['red']('✗\x20ERROR:\x20'+_0x2e4a65)),console['log'](),_0x240ba6[_0x5c5640(0x181)]({'name':_0x1527dc[_0x5c5640(0x158)],'status':'ERROR','reason':_0x2e4a65,'timestamp':new Date()[_0x5c5640(0x119)](),'duration_ms':0x0});}}const _0x1c813e=Date[_0x5c5640(0x17b)]()-_0x1b04ee,_0x1af3e9=_0x240ba6['filter'](_0x125206=>_0x125206[_0x5c5640(0x168)]==='PASS')[_0x5c5640(0x167)],_0x4be930=_0x240ba6[_0x5c5640(0x16a)](_0x29381a=>_0x29381a[_0x5c5640(0x168)]==='FAIL')[_0x5c5640(0x167)],_0x2573e1=_0x240ba6[_0x5c5640(0x16a)](_0x5a1bfa=>_0x5a1bfa[_0x5c5640(0x168)]==='ERROR')['length'];console[_0x5c5640(0x150)]('━'[_0x5c5640(0x189)](0x3c)),console['log'](_0x5c5640(0x17f)),console[_0x5c5640(0x150)]('━'[_0x5c5640(0x189)](0x3c)),console[_0x5c5640(0x150)]('Total:\x20\x20\x20\x20'+_0x240ba6[_0x5c5640(0x167)]),console[_0x5c5640(0x150)](_0x5c5640(0x194)+a5_0x530ff0[_0x5c5640(0x180)](_0x1af3e9)),console[_0x5c5640(0x150)](_0x5c5640(0x16c)+a5_0x530ff0['red'](_0x4be930));_0x2573e1>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x530ff0[_0x5c5640(0x14f)](_0x2573e1));console['log'](_0x5c5640(0x16b)+formatElapsed(_0x1c813e)),console[_0x5c5640(0x150)]('━'[_0x5c5640(0x189)](0x3c));const _0x511ed4=_0x240ba6[_0x5c5640(0x16a)](_0xcce21e=>_0xcce21e[_0x5c5640(0x168)]!==_0x5c5640(0x18d));if(_0x511ed4['length']>0x0){console[_0x5c5640(0x150)](),console['log']('Failed\x20Tests:');for(const _0x292b35 of _0x511ed4){const _0x3a822b=a5_0x530ff0[_0x5c5640(0x14f)]('✗'),_0x548e7c=_0x292b35[_0x5c5640(0x142)][_0x5c5640(0x167)]>0x32?_0x292b35[_0x5c5640(0x142)]['substring'](0x0,0x32)+_0x5c5640(0x15c):_0x292b35['reason'];console[_0x5c5640(0x150)]('\x20\x20'+_0x3a822b+'\x20'+_0x292b35[_0x5c5640(0x158)]+':\x20'+_0x548e7c);}}const _0xc0c91e={'summary':{'total':_0x240ba6[_0x5c5640(0x167)],'passed':_0x1af3e9,'failed':_0x4be930,'errors':_0x2573e1>0x0?_0x2573e1:undefined,'duration_ms':_0x1c813e},'tests':_0x240ba6,'agent':{'project':_0xda64b9[_0x5c5640(0x122)],'name':_0xda64b9['agentName'],'site':_0x2e5bc0},'timestamp':new Date(_0x1b04ee)[_0x5c5640(0x119)]()};try{const _0x486109=buildCachedTestRun(_0x3a365e,{'site':_0x2e5bc0,'projectId':_0x1544b6,'projectName':_0xda64b9[_0x5c5640(0x122)],'agentId':_0x15926c,'agentName':_0xda64b9[_0x5c5640(0x125)],'testYmlPath':a5_0x426415[_0x5c5640(0x11f)](_0xda64b9[_0x5c5640(0x184)])});saveLastTestRun(_0x486109);}catch{}if(_0x492f5d!=='table'||_0x37846e){const _0x205432=formatResults(_0xc0c91e,_0x492f5d);if(_0x37846e)try{a5_0x30d085[_0x5c5640(0x17e)](_0x37846e,_0x205432,_0x5c5640(0x15f)),console[_0x5c5640(0x150)](),console[_0x5c5640(0x150)](a5_0x530ff0['dim'](_0x5c5640(0x171)+_0x37846e));}catch(_0x16fedd){return console[_0x5c5640(0x150)](),console[_0x5c5640(0x150)](a5_0x530ff0[_0x5c5640(0x14f)](_0x5c5640(0x153)+_0x16fedd)),0x1;}else console[_0x5c5640(0x150)](),console['log'](_0x205432);}return _0x511ed4[_0x5c5640(0x167)]>0x0?0x1:0x0;}async[a5_0x388b9c(0x144)](_0x2ba22c,_0x554f96){const _0x47a1a8=a5_0x388b9c,{options:_0x1ba381,tdx:_0xaf11ae}=_0x2ba22c,{definition:_0x4c6315,agentInfo:_0x4c8618,outputFormat:_0xc914ae,outputFile:_0x127a4e}=_0x554f96,_0x588145=_0x1ba381[_0x47a1a8(0x16d)],_0x5ab1a9=loadLastTestRun();if(!_0x5ab1a9)return console[_0x47a1a8(0x150)](a5_0x530ff0[_0x47a1a8(0x14f)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console['log'](a5_0x530ff0['dim'](_0x47a1a8(0x197))),0x1;if(_0x5ab1a9['agent'][_0x47a1a8(0x125)]!==_0x4c8618[_0x47a1a8(0x125)])return console[_0x47a1a8(0x150)](a5_0x530ff0[_0x47a1a8(0x14f)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x5ab1a9[_0x47a1a8(0x177)][_0x47a1a8(0x125)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x4c8618[_0x47a1a8(0x125)]+'\x22.')),console[_0x47a1a8(0x150)](a5_0x530ff0[_0x47a1a8(0x15b)](_0x47a1a8(0x130))),0x1;const _0x32aa28=new Set(_0x5ab1a9[_0x47a1a8(0x145)][_0x47a1a8(0x146)](_0x1526fb=>_0x1526fb[_0x47a1a8(0x17c)])),_0x6d8542=_0x4c6315['tests'][_0x47a1a8(0x16a)](_0x40a02f=>!_0x32aa28[_0x47a1a8(0x13f)](_0x40a02f['name']));if(_0x6d8542['length']>0x0&&_0x5ab1a9[_0x47a1a8(0x16d)]!==_0x588145)return console['log'](a5_0x530ff0[_0x47a1a8(0x14f)](_0x47a1a8(0x16f))),console[_0x47a1a8(0x150)](a5_0x530ff0['dim']('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x5ab1a9[_0x47a1a8(0x16d)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x588145+'\x22.')),console[_0x47a1a8(0x150)](a5_0x530ff0[_0x47a1a8(0x15b)](_0x47a1a8(0x16e)+_0x5ab1a9[_0x47a1a8(0x16d)]+_0x47a1a8(0x11e))),0x1;const _0x36b48e=_0x4c6315[_0x47a1a8(0x136)][_0x47a1a8(0x16a)](_0x5b20c4=>_0x32aa28[_0x47a1a8(0x13f)](_0x5b20c4[_0x47a1a8(0x158)])),_0x18d317=_0x6d8542;let _0x2984b6;try{_0x2984b6=await setupEvaluatorAgent(_0xaf11ae[_0x47a1a8(0x195)],_0x1ba381['verbose']);}catch(_0x5058c0){const _0x3aaf3c=_0x5058c0 instanceof Error?_0x5058c0[_0x47a1a8(0x188)]:String(_0x5058c0);return console[_0x47a1a8(0x150)](a5_0x530ff0[_0x47a1a8(0x14f)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x3aaf3c)),0x1;}console[_0x47a1a8(0x150)](a5_0x530ff0[_0x47a1a8(0x117)](_0x47a1a8(0x183))),console['log']('Cached\x20run\x20from:\x20'+a5_0x530ff0[_0x47a1a8(0x159)](_0x5ab1a9[_0x47a1a8(0x126)])),console[_0x47a1a8(0x150)]('Agent:\x20'+a5_0x530ff0[_0x47a1a8(0x159)](_0x5ab1a9[_0x47a1a8(0x177)]['projectName']+'/'+_0x5ab1a9['agent']['agentName']));_0x18d317[_0x47a1a8(0x167)]>0x0&&console[_0x47a1a8(0x150)](_0x47a1a8(0x12e)+a5_0x530ff0[_0x47a1a8(0x19a)](_0x18d317[_0x47a1a8(0x167)]));console[_0x47a1a8(0x150)]();const _0x201963=[],_0x3b73ed=Date[_0x47a1a8(0x17b)](),_0x1a22d8=createCommandSpinner(_0x47a1a8(0x190));if(_0x36b48e[_0x47a1a8(0x167)]>0x0)try{const _0x4fc2c0=await reevaluateFromCache(_0xaf11ae['llm'],_0x5ab1a9,{'tests':_0x36b48e},{'evaluatorId':_0x2984b6,'onTestStart':(_0x3988fb,_0x1775d9,_0x346711)=>{const _0x2551dc=_0x47a1a8;_0x1a22d8[_0x2551dc(0x138)]=_0x2551dc(0x10f)+(_0x1775d9+0x1)+'/'+_0x346711+':\x20'+_0x3988fb+_0x2551dc(0x15c);if(!_0x1a22d8['isSpinning'])_0x1a22d8[_0x2551dc(0x13a)]();},'onTestComplete':(_0x103435,_0x18adf2)=>{const _0x440a1c=_0x47a1a8;_0x1a22d8[_0x440a1c(0x112)]();if(_0x18adf2[_0x440a1c(0x168)]==='PASS')console[_0x440a1c(0x150)](a5_0x530ff0['green'](_0x440a1c(0x110)+_0x103435)+a5_0x530ff0[_0x440a1c(0x15b)](_0x440a1c(0x114)));else _0x18adf2[_0x440a1c(0x168)]==='FAIL'?console['log'](a5_0x530ff0[_0x440a1c(0x14f)](_0x440a1c(0x192)+_0x103435+'\x20-\x20'+_0x18adf2[_0x440a1c(0x142)])+a5_0x530ff0[_0x440a1c(0x15b)]('\x20(cached)')):console['log'](a5_0x530ff0[_0x440a1c(0x14f)](_0x440a1c(0x12f)+_0x103435+_0x440a1c(0x13c)+_0x18adf2[_0x440a1c(0x142)]));_0x18adf2[_0x440a1c(0x18c)]&&console['log'](a5_0x530ff0[_0x440a1c(0x15b)](_0x440a1c(0x148)+_0x18adf2[_0x440a1c(0x18c)])),_0x201963[_0x440a1c(0x181)](_0x18adf2);},'onTestSkipped':(_0x4ed4ac,_0x1c392f)=>{const _0x3fdcd0=_0x47a1a8;_0x1a22d8[_0x3fdcd0(0x112)](),console[_0x3fdcd0(0x150)](a5_0x530ff0[_0x3fdcd0(0x19a)](_0x3fdcd0(0x161)+_0x4ed4ac+_0x3fdcd0(0x13c)+_0x1c392f));}});for(const _0x35104a of _0x4fc2c0){!_0x201963[_0x47a1a8(0x13b)](_0x205086=>_0x205086[_0x47a1a8(0x158)]===_0x35104a[_0x47a1a8(0x158)])&&_0x201963[_0x47a1a8(0x181)](_0x35104a);}}catch(_0x10702e){_0x1a22d8[_0x47a1a8(0x112)]();const _0x1bd68a=_0x10702e instanceof Error?_0x10702e[_0x47a1a8(0x188)]:String(_0x10702e);return console[_0x47a1a8(0x150)](a5_0x530ff0['red'](_0x47a1a8(0x11c)+_0x1bd68a)),0x1;}_0x1a22d8[_0x47a1a8(0x112)]();if(_0x18d317[_0x47a1a8(0x167)]>0x0){console['log'](),console[_0x47a1a8(0x150)](a5_0x530ff0[_0x47a1a8(0x117)](_0x47a1a8(0x121)));const {projectId:_0x1d3e31,agentId:_0x5a1cc7}=_0x5ab1a9[_0x47a1a8(0x177)];for(const _0x55fd8c of _0x18d317){console[_0x47a1a8(0x150)]('Running:\x20'+a5_0x530ff0[_0x47a1a8(0x159)](_0x55fd8c[_0x47a1a8(0x158)]));const _0x2fc4df=createCommandSpinner(_0x47a1a8(0x120)+_0x55fd8c[_0x47a1a8(0x149)][_0x47a1a8(0x167)]+_0x47a1a8(0x14c));_0x2fc4df[_0x47a1a8(0x13a)]();try{const {result:_0x28d25c}=await runTest(_0xaf11ae['llm'],_0x55fd8c,{'agentId':_0x5a1cc7,'projectId':_0x1d3e31,'site':_0x5ab1a9[_0x47a1a8(0x16d)],'noEval':![],'evaluatorId':_0x2984b6,'onRoundStart':(_0x5a7f7e,_0x57d47a)=>{const _0x24dedb=_0x47a1a8;_0x2fc4df[_0x24dedb(0x138)]=_0x24dedb(0x193)+(_0x5a7f7e+0x1)+'/'+_0x57d47a+_0x24dedb(0x14c);},'onRoundComplete':(_0x3a5bc4,_0x11d776,_0x24bec8)=>{const _0x5d5c61=_0x47a1a8,_0x3d3233=formatElapsed(_0x11d776);_0x24bec8?console[_0x5d5c61(0x150)](_0x5d5c61(0x14b)+(_0x3a5bc4+0x1)+'/'+_0x55fd8c[_0x5d5c61(0x149)]['length']+_0x5d5c61(0x156)+a5_0x530ff0[_0x5d5c61(0x180)]('✓')+'\x20('+_0x3d3233+')'):console['log'](_0x5d5c61(0x14b)+(_0x3a5bc4+0x1)+'/'+_0x55fd8c[_0x5d5c61(0x149)][_0x5d5c61(0x167)]+_0x5d5c61(0x156)+a5_0x530ff0[_0x5d5c61(0x14f)]('✗'));},'onEvaluationStart':()=>{const _0x3ff85e=_0x47a1a8;_0x2fc4df[_0x3ff85e(0x138)]=_0x3ff85e(0x14a);},'onEvaluationComplete':_0x505229=>{const _0x233b7d=_0x47a1a8,_0x32fdb5=formatElapsed(_0x505229);console[_0x233b7d(0x150)](_0x233b7d(0x12b)+a5_0x530ff0[_0x233b7d(0x180)]('✓')+'\x20('+_0x32fdb5+')');}});_0x2fc4df['stop'](),_0x201963['push'](_0x28d25c);if(_0x28d25c[_0x47a1a8(0x168)]===_0x47a1a8(0x18d))console[_0x47a1a8(0x150)](a5_0x530ff0[_0x47a1a8(0x180)](_0x47a1a8(0x110)+_0x28d25c[_0x47a1a8(0x142)])+a5_0x530ff0[_0x47a1a8(0x15b)](_0x47a1a8(0x185)));else _0x28d25c[_0x47a1a8(0x168)]===_0x47a1a8(0x154)?console[_0x47a1a8(0x150)](a5_0x530ff0[_0x47a1a8(0x14f)]('✗\x20FAIL:\x20'+_0x28d25c[_0x47a1a8(0x142)])+a5_0x530ff0[_0x47a1a8(0x15b)](_0x47a1a8(0x185))):console[_0x47a1a8(0x150)](a5_0x530ff0['red']('✗\x20ERROR:\x20'+_0x28d25c[_0x47a1a8(0x142)]));_0x28d25c[_0x47a1a8(0x18c)]&&console[_0x47a1a8(0x150)](a5_0x530ff0[_0x47a1a8(0x15b)](_0x47a1a8(0x148)+_0x28d25c[_0x47a1a8(0x18c)]));}catch(_0xe16e02){_0x2fc4df[_0x47a1a8(0x112)]();const _0x56c322=_0xe16e02 instanceof Error?_0xe16e02[_0x47a1a8(0x188)]:String(_0xe16e02);console[_0x47a1a8(0x150)](a5_0x530ff0[_0x47a1a8(0x14f)](_0x47a1a8(0x12f)+_0x56c322)),_0x201963['push']({'name':_0x55fd8c[_0x47a1a8(0x158)],'status':_0x47a1a8(0x17a),'reason':_0x56c322,'timestamp':new Date()[_0x47a1a8(0x119)](),'duration_ms':0x0});}}}console[_0x47a1a8(0x150)]();const _0x128be8=Date[_0x47a1a8(0x17b)]()-_0x3b73ed,_0x5f3e36=_0x201963['filter'](_0xd369ab=>_0xd369ab[_0x47a1a8(0x168)]===_0x47a1a8(0x18d))[_0x47a1a8(0x167)],_0x55f881=_0x201963[_0x47a1a8(0x16a)](_0x2a839e=>_0x2a839e['status']===_0x47a1a8(0x154))['length'],_0x55305b=_0x201963['filter'](_0x325c93=>_0x325c93[_0x47a1a8(0x168)]===_0x47a1a8(0x17a))[_0x47a1a8(0x167)];console[_0x47a1a8(0x150)]('━'[_0x47a1a8(0x189)](0x3c)),console['log']('Re-evaluation\x20Summary'),console[_0x47a1a8(0x150)]('━'[_0x47a1a8(0x189)](0x3c)),console[_0x47a1a8(0x150)](_0x47a1a8(0x147)+_0x201963[_0x47a1a8(0x167)]),console[_0x47a1a8(0x150)](_0x47a1a8(0x194)+a5_0x530ff0[_0x47a1a8(0x180)](_0x5f3e36)),console[_0x47a1a8(0x150)]('Failed:\x20\x20\x20'+a5_0x530ff0['red'](_0x55f881));_0x55305b>0x0&&console[_0x47a1a8(0x150)](_0x47a1a8(0x115)+a5_0x530ff0[_0x47a1a8(0x14f)](_0x55305b));console[_0x47a1a8(0x150)]('Duration:\x20'+formatElapsed(_0x128be8)),console['log']('━'[_0x47a1a8(0x189)](0x3c));const _0x843ce7={'summary':{'total':_0x201963['length'],'passed':_0x5f3e36,'failed':_0x55f881,'errors':_0x55305b>0x0?_0x55305b:undefined,'duration_ms':_0x128be8},'tests':_0x201963,'agent':{'project':_0x4c8618[_0x47a1a8(0x122)],'name':_0x4c8618[_0x47a1a8(0x125)],'site':_0x588145},'timestamp':new Date(_0x3b73ed)[_0x47a1a8(0x119)]()};if(_0xc914ae!=='table'||_0x127a4e){const _0x3e09bf=formatResults(_0x843ce7,_0xc914ae);if(_0x127a4e)try{a5_0x30d085['writeFileSync'](_0x127a4e,_0x3e09bf,_0x47a1a8(0x15f)),console['log'](),console[_0x47a1a8(0x150)](a5_0x530ff0[_0x47a1a8(0x15b)](_0x47a1a8(0x171)+_0x127a4e));}catch(_0x3489a2){return console['log'](),console['log'](a5_0x530ff0['red'](_0x47a1a8(0x153)+_0x3489a2)),0x1;}else console[_0x47a1a8(0x150)](),console['log'](_0x3e09bf);}const _0x32a1e0=_0x201963[_0x47a1a8(0x16a)](_0x3d8abd=>_0x3d8abd[_0x47a1a8(0x168)]!==_0x47a1a8(0x18d));return _0x32a1e0['length']>0x0?0x1:0x0;}}
|
|
1
|
+
function a5_0xcf51(_0x1ea3ec,_0x5875a4){_0x1ea3ec=_0x1ea3ec-0xd0;const _0x52c49c=a5_0x52c4();let _0xcf51=_0x52c49c[_0x1ea3ec];return _0xcf51;}const a5_0x1ddf43=a5_0xcf51;(function(_0x254742,_0x1bdb98){const _0x132a37=a5_0xcf51,_0x122435=_0x254742();while(!![]){try{const _0x12d838=-parseInt(_0x132a37(0xe2))/0x1*(parseInt(_0x132a37(0x14b))/0x2)+parseInt(_0x132a37(0x13e))/0x3+parseInt(_0x132a37(0x15b))/0x4*(-parseInt(_0x132a37(0x105))/0x5)+parseInt(_0x132a37(0x122))/0x6+parseInt(_0x132a37(0xed))/0x7*(-parseInt(_0x132a37(0x15d))/0x8)+parseInt(_0x132a37(0xe4))/0x9+-parseInt(_0x132a37(0x10d))/0xa;if(_0x12d838===_0x1bdb98)break;else _0x122435['push'](_0x122435['shift']());}catch(_0x5127d5){_0x122435['push'](_0x122435['shift']());}}}(a5_0x52c4,0x931ce));import*as a5_0x5187c7 from'node:fs';import*as a5_0x71a21a from'node:path';import a5_0x57ac79 from'chalk';import{BaseCommand}from'./command.js';function a5_0x52c4(){const _0x584a08=['ERROR','Error\x20writing\x20output\x20file:\x20','FAIL','resolve','Failed:\x20\x20\x20','1511562jjaTSF','No\x20tests\x20have\x20tags\x20defined.','resolveProjectId','site','tags','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','llmProject','cyan','split','projectDir','Cached\x20run\x20is\x20from\x20site\x20\x22','Errors:\x20\x20\x20','Re-evaluating...','306yxlJNZ','trim','Executing\x20new\x20tests...','no_local_folder','filter','found','log','length','✓\x20PASS:\x20','substring','not\x20found','Evaluating\x20response...','Usage:','add','⚠\x20SKIPPED:\x20','join','3340904phhxMI','has','278456KouxJo','conversation_url','Running:\x20','dryRun','status','rounds','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','reason','\x20\x20Evaluating...\x20','Round\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','timestamp','Test\x20','...\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Round\x201/','Re-evaluation\x20Summary','stop','conversations','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','no_tests','\x22:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','white','Duration:\x20','tests','3823zieDQj','\x20\x20Round\x20','7819659eFNTaV','test.yml','✗\x20ERROR:\x20','Agent:\x20','testYmlPath','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','projectName','Either\x20switch\x20to\x20the\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','63QNyHZR','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','executeReeval','\x20\x20-\x20','✗\x20FAIL:\x20','description','Test\x20Configuration:','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Failed\x20Tests:','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','\x20\x20Site:\x20','agent','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','table','start','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','utf-8','Test\x20Summary','Total:\x20\x20\x20\x20','json','toISOString','round','Conversation\x20URL:\x20','green','5SYzIrS','Output\x20written\x20to:\x20','repeat','includes','\x20\x20Agent:\x20','message','\x20(new)','dim','190100XyoPzn','isSpinning','Error:\x20No\x20previous\x20test\x20run\x20found.','\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)',':\x20Sending\x20user\x20input...','\x20\x20Conversation:\x20','/<agent-name>','Cached\x20run\x20from:\x20','Tests\x20found:\x20','execute','push','map','name','Re-evaluating\x20','some','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','existsSync','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Using\x20agent:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Running\x20agent\x20tests...','5893722gaTsZG','now','output','Project\x20path:\x20','toLowerCase','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x20-\x20','PASS','jsonl','reeval','text','yellow','agentName','\x20(cached)','Re-evaluating\x20cached\x20test\x20run...','red','eval','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','...','llm','tsv','writeFileSync','Passed:\x20\x20\x20'];a5_0x52c4=function(){return _0x584a08;};return a5_0x52c4();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x1ddf43(0x119)]='agent:test';[a5_0x1ddf43(0xf2)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x1ddf43(0x116)](_0x436a7d){const _0x244010=a5_0x1ddf43,{options:_0x5f1f06,args:_0x555d7b,tdx:_0x3d4b86}=_0x436a7d,_0x22f1cb=_0x555d7b[0x0]||'.',_0x11faa5=_0x5f1f06[_0x244010(0x160)],_0x4b4443=_0x5f1f06,_0x2f078b=_0x4b4443[_0x244010(0x132)]===![],_0x4c3fbe=_0x4b4443[_0x244010(0x12b)],_0x4e2662=_0x4b4443[_0x244010(0x119)],_0x59c1e9=_0x4b4443[_0x244010(0x142)],_0x38de0d=_0x5f1f06[_0x244010(0x141)],_0x251c33=_0x4b4443[_0x244010(0x124)];if(_0x4c3fbe&&_0x2f078b)return console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)](_0x244010(0x143))),0x1;let _0x397542='table';if(_0x4b4443['json'])_0x397542=_0x244010(0x100);else{if(_0x4b4443[_0x244010(0x12a)])_0x397542=_0x244010(0x12a);else{if(_0x4b4443[_0x244010(0x136)])_0x397542=_0x244010(0x136);else{if(_0x4b4443[_0x244010(0xfa)])_0x397542=_0x244010(0xfa);}}}const _0x93612c=_0x4b4443[_0x244010(0x144)];let _0x31c4da=_0x22f1cb;const _0x418f1e=a5_0x5187c7[_0x244010(0x11d)](_0x22f1cb),_0x278d52=_0x22f1cb==='.';if(!_0x418f1e||_0x278d52){const _0x147706=resolveProjectFromContext(_0x22f1cb,_0x93612c,{'requireFile':_0x244010(0xe5)});if(_0x147706[_0x244010(0x150)])_0x31c4da=_0x147706[_0x244010(0x147)],_0x147706['source']==='context'&&console[_0x244010(0x151)](a5_0x57ac79['dim'](_0x244010(0x11f)+_0x31c4da));else switch(_0x147706[_0x244010(0x164)]){case'no_context':console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x12d)](_0x147706[_0x244010(0x10a)])),console[_0x244010(0x151)](),console['log'](_0x244010(0x157)),console[_0x244010(0x151)]('\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'),console[_0x244010(0x151)](_0x244010(0x110)),console[_0x244010(0x151)](),console[_0x244010(0x151)](_0x244010(0x11e));return 0x1;case _0x244010(0x14e):console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x12d)](_0x147706[_0x244010(0x10a)])),console['log'](),console['log']('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x147706[_0x244010(0x144)]+_0x244010(0xec));return 0x1;case'multiple_agents':{const _0x1fc11c=a5_0x71a21a['basename'](_0x147706[_0x244010(0x147)]);console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x12d)](_0x244010(0x127)+_0x147706['llmProject']+'\x22:'));for(const _0x19253a of _0x147706['agentDirs']){console['log'](_0x244010(0xf0)+_0x19253a);}return console[_0x244010(0x151)](),console[_0x244010(0x151)](_0x244010(0xd6)+_0x1fc11c+_0x244010(0x113)),0x1;}case _0x244010(0xdc):console[_0x244010(0x151)](a5_0x57ac79['yellow'](_0x244010(0xf6)+_0x147706[_0x244010(0x144)]+'\x22.')),console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x10c)](_0x244010(0x125)+_0x147706[_0x244010(0x147)])),console[_0x244010(0x151)](),console['log'](_0x244010(0xfc));return 0x1;}}const {definition:_0x5d64c7,agentInfo:_0x90876c}=parseTestFile(_0x31c4da);let _0x278cb6=_0x5d64c7[_0x244010(0xe1)];if(_0x4e2662){const _0x49b8ce=_0x4e2662[_0x244010(0x146)](',')[_0x244010(0x118)](_0x1d2267=>_0x1d2267[_0x244010(0x14c)]());_0x278cb6=_0x5d64c7[_0x244010(0xe1)][_0x244010(0x14f)](_0x4ce465=>_0x49b8ce[_0x244010(0x108)](_0x4ce465['name']));if(_0x278cb6[_0x244010(0x152)]===0x0)return console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x12d)]('No\x20tests\x20found\x20matching:\x20'+_0x4e2662)),console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x10c)]('Available\x20tests:\x20'+_0x5d64c7[_0x244010(0xe1)]['map'](_0xc59f11=>_0xc59f11[_0x244010(0x119)])[_0x244010(0x15a)](',\x20'))),0x1;}if(_0x59c1e9){const _0x361187=_0x59c1e9['split'](',')['map'](_0x6176c=>_0x6176c[_0x244010(0x14c)]()[_0x244010(0x126)]());_0x278cb6=_0x278cb6[_0x244010(0x14f)](_0xa37319=>_0xa37319['tags']?.[_0x244010(0x11b)](_0x35970a=>_0x361187[_0x244010(0x108)](_0x35970a[_0x244010(0x126)]())));if(_0x278cb6[_0x244010(0x152)]===0x0){console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x12d)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x59c1e9));const _0x395867=new Set();return _0x5d64c7[_0x244010(0xe1)]['forEach'](_0x45a58d=>_0x45a58d[_0x244010(0x142)]?.['forEach'](_0x5bdf5a=>_0x395867[_0x244010(0x158)](_0x5bdf5a))),_0x395867['size']>0x0?console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x10c)]('Available\x20tags:\x20'+[..._0x395867][_0x244010(0x15a)](',\x20'))):console['log'](a5_0x57ac79[_0x244010(0x10c)](_0x244010(0x13f))),0x1;}}if(_0x4c3fbe)return this[_0x244010(0xef)](_0x436a7d,{'definition':{'tests':_0x278cb6},'agentInfo':_0x90876c,'outputFormat':_0x397542,'outputFile':_0x251c33,'testNames':_0x4e2662});if(_0x11faa5){console['log'](a5_0x57ac79[_0x244010(0x145)](_0x244010(0xf3))),console[_0x244010(0x151)](_0x244010(0xf7)+a5_0x57ac79[_0x244010(0xdf)](_0x38de0d)),console[_0x244010(0x151)]('\x20\x20Project:\x20'+a5_0x57ac79[_0x244010(0xdf)](_0x90876c['projectName'])),console[_0x244010(0x151)](_0x244010(0x109)+a5_0x57ac79[_0x244010(0xdf)](_0x90876c[_0x244010(0x12e)])),console[_0x244010(0x151)](),console[_0x244010(0x151)](_0x244010(0x115)+a5_0x57ac79[_0x244010(0xdf)](_0x278cb6[_0x244010(0x152)]));for(let _0x45e9df=0x0;_0x45e9df<_0x278cb6[_0x244010(0x152)];_0x45e9df++){const _0x53fbd3=_0x278cb6[_0x45e9df],_0x2c3df1=_0x53fbd3['rounds'][_0x244010(0x152)]===0x1?_0x244010(0x102):_0x244010(0x162),_0x2e0184=_0x53fbd3[_0x244010(0x142)]?.[_0x244010(0x152)]?'\x20['+_0x53fbd3[_0x244010(0x142)][_0x244010(0x15a)](',\x20')+']':'';console[_0x244010(0x151)]('\x20\x20'+(_0x45e9df+0x1)+'.\x20'+a5_0x57ac79[_0x244010(0xdf)](_0x53fbd3[_0x244010(0x119)])+'\x20('+_0x53fbd3['rounds'][_0x244010(0x152)]+'\x20'+_0x2c3df1+')'+a5_0x57ac79[_0x244010(0x10c)](_0x2e0184));}return 0x0;}let _0x2a7fe9,_0x22656f;try{_0x2a7fe9=await _0x3d4b86[_0x244010(0x135)][_0x244010(0x140)](_0x90876c[_0x244010(0xea)]);}catch(_0x4a83cb){const _0x54cf33=_0x4a83cb instanceof Error?_0x4a83cb[_0x244010(0x10a)]:String(_0x4a83cb);return _0x54cf33[_0x244010(0x108)]('404')||_0x54cf33[_0x244010(0x126)]()[_0x244010(0x108)](_0x244010(0x155))?console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)](_0x244010(0x120)+_0x90876c[_0x244010(0xea)])):console[_0x244010(0x151)](a5_0x57ac79['red'](_0x244010(0xf9)+_0x90876c[_0x244010(0xea)]+'\x22:\x20'+_0x54cf33)),0x1;}try{_0x22656f=await _0x3d4b86['llm']['resolveAgentId'](_0x90876c['agentName'],_0x2a7fe9);}catch(_0x60680b){const _0x52af50=_0x60680b instanceof Error?_0x60680b['message']:String(_0x60680b);return _0x52af50['includes']('404')||_0x52af50[_0x244010(0x126)]()[_0x244010(0x108)]('not\x20found')?console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x90876c[_0x244010(0x12e)])):console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x90876c[_0x244010(0x12e)]+_0x244010(0xdd)+_0x52af50)),0x1;}let _0x14fcba;if(!_0x2f078b)try{_0x14fcba=await setupEvaluatorAgent(_0x3d4b86[_0x244010(0x135)],_0x5f1f06['verbose']);}catch(_0x20cd43){const _0xd6dda0=_0x20cd43 instanceof Error?_0x20cd43[_0x244010(0x10a)]:String(_0x20cd43);return console['log'](a5_0x57ac79[_0x244010(0x131)](_0x244010(0x11c)+_0xd6dda0)),0x1;}console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x145)](_0x244010(0x121))),console[_0x244010(0x151)]('Site:\x20'+a5_0x57ac79[_0x244010(0xdf)](_0x38de0d)),console[_0x244010(0x151)](_0x244010(0xe7)+a5_0x57ac79['white'](_0x90876c[_0x244010(0xea)]+'/'+_0x90876c[_0x244010(0x12e)])),console[_0x244010(0x151)]();const _0x14f855=[],_0x340a5e=[],_0x506291=Date[_0x244010(0x123)]();for(let _0x3c3e29=0x0;_0x3c3e29<_0x278cb6[_0x244010(0x152)];_0x3c3e29++){const _0x5c5e56=_0x278cb6[_0x3c3e29];_0x278cb6[_0x244010(0x152)]>0x1?console[_0x244010(0x151)](_0x244010(0xd4)+(_0x3c3e29+0x1)+'/'+_0x278cb6['length']+':\x20'+a5_0x57ac79[_0x244010(0xdf)](_0x5c5e56['name'])):console[_0x244010(0x151)]('Running\x20test:\x20'+a5_0x57ac79[_0x244010(0xdf)](_0x5c5e56[_0x244010(0x119)]));const _0x274895=createCommandSpinner('Round\x201/'+_0x5c5e56['rounds'][_0x244010(0x152)]+_0x244010(0x111));_0x274895[_0x244010(0xfb)]();try{const {result:_0x409913,conversation:_0x2c1135}=await runTest(_0x3d4b86[_0x244010(0x135)],_0x5c5e56,{'agentId':_0x22656f,'projectId':_0x2a7fe9,'site':_0x38de0d,'noEval':_0x2f078b,'evaluatorId':_0x14fcba,'onRoundStart':(_0x25144e,_0x4c039f)=>{const _0x17df44=_0x244010;_0x274895[_0x17df44(0x12c)]=_0x17df44(0xd1)+(_0x25144e+0x1)+'/'+_0x4c039f+_0x17df44(0x111);},'onRoundComplete':(_0x583d6f,_0x2cac35,_0x379bda)=>{const _0x46520b=_0x244010,_0x30e7d4=formatElapsed(_0x2cac35);_0x379bda?console[_0x46520b(0x151)](_0x46520b(0xe3)+(_0x583d6f+0x1)+'/'+_0x5c5e56[_0x46520b(0x162)][_0x46520b(0x152)]+_0x46520b(0xd5)+a5_0x57ac79[_0x46520b(0x104)]('✓')+'\x20('+_0x30e7d4+')'):console[_0x46520b(0x151)](_0x46520b(0xe3)+(_0x583d6f+0x1)+'/'+_0x5c5e56['rounds'][_0x46520b(0x152)]+'...\x20'+a5_0x57ac79[_0x46520b(0x131)]('✗'));},'onEvaluationStart':()=>{const _0xa76980=_0x244010;_0x274895['text']=_0xa76980(0x156);},'onEvaluationComplete':_0x5e9d43=>{const _0x1448d0=_0x244010,_0x1c9a23=formatElapsed(_0x5e9d43);console['log'](_0x1448d0(0xd0)+a5_0x57ac79[_0x1448d0(0x104)]('✓')+'\x20('+_0x1c9a23+')');}});_0x274895[_0x244010(0xd9)](),_0x14f855['push'](_0x409913),_0x340a5e[_0x244010(0x117)](_0x2c1135);if(_0x409913['status']===_0x244010(0x129))console['log'](a5_0x57ac79[_0x244010(0x104)](_0x244010(0x153)+_0x409913[_0x244010(0x164)]));else _0x409913[_0x244010(0x161)]==='FAIL'?console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)]('✗\x20FAIL:\x20'+_0x409913[_0x244010(0x164)])):console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)](_0x244010(0xe6)+_0x409913[_0x244010(0x164)]));_0x409913[_0x244010(0x15e)]&&console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x10c)](_0x244010(0x103)+_0x409913[_0x244010(0x15e)])),console['log']();}catch(_0x53002d){_0x274895[_0x244010(0xd9)]();const _0x29ecb6=_0x53002d instanceof Error?_0x53002d['message']:String(_0x53002d);console[_0x244010(0x151)](a5_0x57ac79['red'](_0x244010(0xe6)+_0x29ecb6)),console['log'](),_0x14f855['push']({'name':_0x5c5e56[_0x244010(0x119)],'status':'ERROR','reason':_0x29ecb6,'timestamp':new Date()[_0x244010(0x101)](),'duration_ms':0x0});}}const _0x5886f1=Date[_0x244010(0x123)]()-_0x506291,_0x1cdbb3=_0x14f855[_0x244010(0x14f)](_0x48723d=>_0x48723d[_0x244010(0x161)]===_0x244010(0x129))[_0x244010(0x152)],_0x4cb43c=_0x14f855[_0x244010(0x14f)](_0x244ba7=>_0x244ba7[_0x244010(0x161)]===_0x244010(0x13b))[_0x244010(0x152)],_0x226882=_0x14f855[_0x244010(0x14f)](_0x1419f7=>_0x1419f7[_0x244010(0x161)]===_0x244010(0x139))['length'];console[_0x244010(0x151)]('━'[_0x244010(0x107)](0x3c)),console['log'](_0x244010(0xfe)),console[_0x244010(0x151)]('━'['repeat'](0x3c)),console[_0x244010(0x151)](_0x244010(0xff)+_0x14f855['length']),console[_0x244010(0x151)](_0x244010(0x138)+a5_0x57ac79['green'](_0x1cdbb3)),console[_0x244010(0x151)]('Failed:\x20\x20\x20'+a5_0x57ac79['red'](_0x4cb43c));_0x226882>0x0&&console[_0x244010(0x151)]('Errors:\x20\x20\x20'+a5_0x57ac79['red'](_0x226882));console[_0x244010(0x151)](_0x244010(0xe0)+formatElapsed(_0x5886f1)),console[_0x244010(0x151)]('━'[_0x244010(0x107)](0x3c));const _0x207b30=_0x14f855[_0x244010(0x14f)](_0xc2ac2b=>_0xc2ac2b[_0x244010(0x161)]!==_0x244010(0x129));if(_0x207b30[_0x244010(0x152)]>0x0){console['log'](),console['log'](_0x244010(0xf5));for(const _0x45eab7 of _0x207b30){const _0x599303=a5_0x57ac79[_0x244010(0x131)]('✗'),_0x5e2694=_0x45eab7['reason'][_0x244010(0x152)]>0x32?_0x45eab7[_0x244010(0x164)][_0x244010(0x154)](0x0,0x32)+_0x244010(0x134):_0x45eab7[_0x244010(0x164)];console[_0x244010(0x151)]('\x20\x20'+_0x599303+'\x20'+_0x45eab7[_0x244010(0x119)]+':\x20'+_0x5e2694);}}const _0x1fbace={'summary':{'total':_0x14f855[_0x244010(0x152)],'passed':_0x1cdbb3,'failed':_0x4cb43c,'errors':_0x226882>0x0?_0x226882:undefined,'duration_ms':_0x5886f1},'tests':_0x14f855,'agent':{'project':_0x90876c[_0x244010(0xea)],'name':_0x90876c[_0x244010(0x12e)],'site':_0x38de0d},'timestamp':new Date(_0x506291)[_0x244010(0x101)]()};try{const _0x25d040=buildCachedTestRun(_0x340a5e,{'site':_0x38de0d,'projectId':_0x2a7fe9,'projectName':_0x90876c[_0x244010(0xea)],'agentId':_0x22656f,'agentName':_0x90876c[_0x244010(0x12e)],'testYmlPath':a5_0x71a21a[_0x244010(0x13c)](_0x90876c[_0x244010(0xe8)])});saveLastTestRun(_0x25d040);}catch{}if(_0x397542!==_0x244010(0xfa)||_0x251c33){const _0x4c617f=formatResults(_0x1fbace,_0x397542);if(_0x251c33)try{a5_0x5187c7[_0x244010(0x137)](_0x251c33,_0x4c617f,_0x244010(0xfd)),console[_0x244010(0x151)](),console['log'](a5_0x57ac79['dim']('Output\x20written\x20to:\x20'+_0x251c33));}catch(_0x3aebc9){return console[_0x244010(0x151)](),console[_0x244010(0x151)](a5_0x57ac79[_0x244010(0x131)](_0x244010(0x13a)+_0x3aebc9)),0x1;}else console[_0x244010(0x151)](),console[_0x244010(0x151)](_0x4c617f);}return _0x207b30[_0x244010(0x152)]>0x0?0x1:0x0;}async[a5_0x1ddf43(0xef)](_0x241587,_0x411730){const _0x15f408=a5_0x1ddf43,{options:_0x453ced,tdx:_0x42abb7}=_0x241587,{definition:_0x1e6233,agentInfo:_0x584b4c,outputFormat:_0x3f3460,outputFile:_0xd6200a}=_0x411730,_0x2b4dad=_0x453ced[_0x15f408(0x141)],_0x32f5e3=loadLastTestRun();if(!_0x32f5e3)return console['log'](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0x10f))),console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x10c)](_0x15f408(0x133))),0x1;if(_0x32f5e3[_0x15f408(0xf8)][_0x15f408(0x12e)]!==_0x584b4c[_0x15f408(0x12e)])return console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0xdb)+_0x32f5e3[_0x15f408(0xf8)][_0x15f408(0x12e)]+_0x15f408(0xf4)+_0x584b4c[_0x15f408(0x12e)]+'\x22.')),console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x10c)](_0x15f408(0x163))),0x1;const _0xbde1d1=new Set(_0x32f5e3[_0x15f408(0xda)][_0x15f408(0x118)](_0xc14fe7=>_0xc14fe7['testName'])),_0x353cf8=_0x1e6233[_0x15f408(0xe1)][_0x15f408(0x14f)](_0x1b274f=>!_0xbde1d1[_0x15f408(0x15c)](_0x1b274f[_0x15f408(0x119)]));if(_0x353cf8[_0x15f408(0x152)]>0x0&&_0x32f5e3[_0x15f408(0x141)]!==_0x2b4dad)return console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0xe9))),console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x10c)](_0x15f408(0x148)+_0x32f5e3[_0x15f408(0x141)]+_0x15f408(0xde)+_0x2b4dad+'\x22.')),console['log'](a5_0x57ac79['dim'](_0x15f408(0xeb)+_0x32f5e3[_0x15f408(0x141)]+_0x15f408(0xd2))),0x1;const _0xb04c4a=_0x1e6233[_0x15f408(0xe1)][_0x15f408(0x14f)](_0x3d68da=>_0xbde1d1[_0x15f408(0x15c)](_0x3d68da[_0x15f408(0x119)])),_0xd20de6=_0x353cf8;let _0x11cf96;try{_0x11cf96=await setupEvaluatorAgent(_0x42abb7[_0x15f408(0x135)],_0x453ced['verbose']);}catch(_0x284719){const _0x17221c=_0x284719 instanceof Error?_0x284719[_0x15f408(0x10a)]:String(_0x284719);return console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0x11c)+_0x17221c)),0x1;}console['log'](a5_0x57ac79['cyan'](_0x15f408(0x130))),console[_0x15f408(0x151)](_0x15f408(0x114)+a5_0x57ac79[_0x15f408(0xdf)](_0x32f5e3[_0x15f408(0xd3)])),console[_0x15f408(0x151)](_0x15f408(0xe7)+a5_0x57ac79[_0x15f408(0xdf)](_0x32f5e3[_0x15f408(0xf8)][_0x15f408(0xea)]+'/'+_0x32f5e3['agent'][_0x15f408(0x12e)]));_0xd20de6[_0x15f408(0x152)]>0x0&&console[_0x15f408(0x151)]('New\x20tests\x20to\x20execute:\x20'+a5_0x57ac79[_0x15f408(0x12d)](_0xd20de6['length']));console['log']();const _0x14643d=[],_0x46e46d=Date[_0x15f408(0x123)](),_0x52a02b=createCommandSpinner(_0x15f408(0x14a));if(_0xb04c4a[_0x15f408(0x152)]>0x0)try{const _0x3d41d7=await reevaluateFromCache(_0x42abb7[_0x15f408(0x135)],_0x32f5e3,{'tests':_0xb04c4a},{'evaluatorId':_0x11cf96,'onTestStart':(_0x30c47b,_0x44c11,_0x5a3748)=>{const _0x3030f9=_0x15f408;_0x52a02b['text']=_0x3030f9(0x11a)+(_0x44c11+0x1)+'/'+_0x5a3748+':\x20'+_0x30c47b+_0x3030f9(0x134);if(!_0x52a02b[_0x3030f9(0x10e)])_0x52a02b[_0x3030f9(0xfb)]();},'onTestComplete':(_0x1f8307,_0x279373)=>{const _0x396da4=_0x15f408;_0x52a02b['stop']();if(_0x279373[_0x396da4(0x161)]===_0x396da4(0x129))console[_0x396da4(0x151)](a5_0x57ac79[_0x396da4(0x104)]('✓\x20PASS:\x20'+_0x1f8307)+a5_0x57ac79['dim'](_0x396da4(0x12f)));else _0x279373['status']===_0x396da4(0x13b)?console['log'](a5_0x57ac79[_0x396da4(0x131)](_0x396da4(0xf1)+_0x1f8307+_0x396da4(0x128)+_0x279373[_0x396da4(0x164)])+a5_0x57ac79[_0x396da4(0x10c)](_0x396da4(0x12f))):console[_0x396da4(0x151)](a5_0x57ac79['red']('✗\x20ERROR:\x20'+_0x1f8307+_0x396da4(0x128)+_0x279373[_0x396da4(0x164)]));_0x279373[_0x396da4(0x15e)]&&console[_0x396da4(0x151)](a5_0x57ac79[_0x396da4(0x10c)](_0x396da4(0x112)+_0x279373[_0x396da4(0x15e)])),_0x14643d[_0x396da4(0x117)](_0x279373);},'onTestSkipped':(_0x17cc35,_0x46231a)=>{const _0x3d65fd=_0x15f408;_0x52a02b[_0x3d65fd(0xd9)](),console[_0x3d65fd(0x151)](a5_0x57ac79[_0x3d65fd(0x12d)](_0x3d65fd(0x159)+_0x17cc35+_0x3d65fd(0x128)+_0x46231a));}});for(const _0x2bd7ad of _0x3d41d7){!_0x14643d['find'](_0x3b2546=>_0x3b2546['name']===_0x2bd7ad[_0x15f408(0x119)])&&_0x14643d[_0x15f408(0x117)](_0x2bd7ad);}}catch(_0x308e5b){_0x52a02b['stop']();const _0x2c398e=_0x308e5b instanceof Error?_0x308e5b[_0x15f408(0x10a)]:String(_0x308e5b);return console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0xee)+_0x2c398e)),0x1;}_0x52a02b['stop']();if(_0xd20de6[_0x15f408(0x152)]>0x0){console[_0x15f408(0x151)](),console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x145)](_0x15f408(0x14d)));const {projectId:_0x527c39,agentId:_0x4f439c}=_0x32f5e3[_0x15f408(0xf8)];for(const _0x4a3583 of _0xd20de6){console[_0x15f408(0x151)](_0x15f408(0x15f)+a5_0x57ac79['white'](_0x4a3583['name']));const _0x1fba74=createCommandSpinner(_0x15f408(0xd7)+_0x4a3583[_0x15f408(0x162)][_0x15f408(0x152)]+_0x15f408(0x111));_0x1fba74['start']();try{const {result:_0x49fb99}=await runTest(_0x42abb7[_0x15f408(0x135)],_0x4a3583,{'agentId':_0x4f439c,'projectId':_0x527c39,'site':_0x32f5e3['site'],'noEval':![],'evaluatorId':_0x11cf96,'onRoundStart':(_0x4e5412,_0x2b6acd)=>{const _0x3594d2=_0x15f408;_0x1fba74[_0x3594d2(0x12c)]=_0x3594d2(0xd1)+(_0x4e5412+0x1)+'/'+_0x2b6acd+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x4b2996,_0x3fbe15,_0x4d0ba1)=>{const _0x527d31=_0x15f408,_0x20283d=formatElapsed(_0x3fbe15);_0x4d0ba1?console[_0x527d31(0x151)](_0x527d31(0xe3)+(_0x4b2996+0x1)+'/'+_0x4a3583[_0x527d31(0x162)][_0x527d31(0x152)]+_0x527d31(0xd5)+a5_0x57ac79[_0x527d31(0x104)]('✓')+'\x20('+_0x20283d+')'):console[_0x527d31(0x151)]('\x20\x20Round\x20'+(_0x4b2996+0x1)+'/'+_0x4a3583['rounds'][_0x527d31(0x152)]+'...\x20'+a5_0x57ac79['red']('✗'));},'onEvaluationStart':()=>{const _0x13f9e6=_0x15f408;_0x1fba74[_0x13f9e6(0x12c)]=_0x13f9e6(0x156);},'onEvaluationComplete':_0x36ff56=>{const _0x24ac42=_0x15f408,_0x268e6c=formatElapsed(_0x36ff56);console['log'](_0x24ac42(0xd0)+a5_0x57ac79['green']('✓')+'\x20('+_0x268e6c+')');}});_0x1fba74[_0x15f408(0xd9)](),_0x14643d[_0x15f408(0x117)](_0x49fb99);if(_0x49fb99[_0x15f408(0x161)]===_0x15f408(0x129))console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x104)](_0x15f408(0x153)+_0x49fb99[_0x15f408(0x164)])+a5_0x57ac79[_0x15f408(0x10c)](_0x15f408(0x10b)));else _0x49fb99['status']===_0x15f408(0x13b)?console['log'](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0xf1)+_0x49fb99[_0x15f408(0x164)])+a5_0x57ac79[_0x15f408(0x10c)](_0x15f408(0x10b))):console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0xe6)+_0x49fb99[_0x15f408(0x164)]));_0x49fb99[_0x15f408(0x15e)]&&console[_0x15f408(0x151)](a5_0x57ac79['dim'](_0x15f408(0x112)+_0x49fb99[_0x15f408(0x15e)]));}catch(_0x3c9f05){_0x1fba74[_0x15f408(0xd9)]();const _0x54ab9b=_0x3c9f05 instanceof Error?_0x3c9f05[_0x15f408(0x10a)]:String(_0x3c9f05);console[_0x15f408(0x151)](a5_0x57ac79[_0x15f408(0x131)]('✗\x20ERROR:\x20'+_0x54ab9b)),_0x14643d['push']({'name':_0x4a3583[_0x15f408(0x119)],'status':_0x15f408(0x139),'reason':_0x54ab9b,'timestamp':new Date()[_0x15f408(0x101)](),'duration_ms':0x0});}}}console[_0x15f408(0x151)]();const _0x9ffa0f=Date['now']()-_0x46e46d,_0x5d41e5=_0x14643d[_0x15f408(0x14f)](_0x28cccb=>_0x28cccb[_0x15f408(0x161)]==='PASS')[_0x15f408(0x152)],_0xb37796=_0x14643d[_0x15f408(0x14f)](_0x307ee6=>_0x307ee6[_0x15f408(0x161)]===_0x15f408(0x13b))[_0x15f408(0x152)],_0x29adfc=_0x14643d[_0x15f408(0x14f)](_0x16abc2=>_0x16abc2['status']==='ERROR')[_0x15f408(0x152)];console[_0x15f408(0x151)]('━'[_0x15f408(0x107)](0x3c)),console[_0x15f408(0x151)](_0x15f408(0xd8)),console['log']('━'[_0x15f408(0x107)](0x3c)),console[_0x15f408(0x151)]('Total:\x20\x20\x20\x20'+_0x14643d[_0x15f408(0x152)]),console[_0x15f408(0x151)](_0x15f408(0x138)+a5_0x57ac79[_0x15f408(0x104)](_0x5d41e5)),console['log'](_0x15f408(0x13d)+a5_0x57ac79[_0x15f408(0x131)](_0xb37796));_0x29adfc>0x0&&console['log'](_0x15f408(0x149)+a5_0x57ac79[_0x15f408(0x131)](_0x29adfc));console[_0x15f408(0x151)](_0x15f408(0xe0)+formatElapsed(_0x9ffa0f)),console[_0x15f408(0x151)]('━'[_0x15f408(0x107)](0x3c));const _0x55169f={'summary':{'total':_0x14643d[_0x15f408(0x152)],'passed':_0x5d41e5,'failed':_0xb37796,'errors':_0x29adfc>0x0?_0x29adfc:undefined,'duration_ms':_0x9ffa0f},'tests':_0x14643d,'agent':{'project':_0x584b4c[_0x15f408(0xea)],'name':_0x584b4c['agentName'],'site':_0x2b4dad},'timestamp':new Date(_0x46e46d)['toISOString']()};if(_0x3f3460!==_0x15f408(0xfa)||_0xd6200a){const _0x4389df=formatResults(_0x55169f,_0x3f3460);if(_0xd6200a)try{a5_0x5187c7[_0x15f408(0x137)](_0xd6200a,_0x4389df,_0x15f408(0xfd)),console['log'](),console['log'](a5_0x57ac79['dim'](_0x15f408(0x106)+_0xd6200a));}catch(_0x542f52){return console['log'](),console['log'](a5_0x57ac79[_0x15f408(0x131)](_0x15f408(0x13a)+_0x542f52)),0x1;}else console[_0x15f408(0x151)](),console[_0x15f408(0x151)](_0x4389df);}const _0x4d3806=_0x14643d[_0x15f408(0x14f)](_0x58fbed=>_0x58fbed[_0x15f408(0x161)]!==_0x15f408(0x129));return _0x4d3806['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x500da4=a6_0x21a4;function a6_0x21a4(_0x21df0e,_0x3889a4){_0x21df0e=_0x21df0e-0x1e7;const _0x5d44b6=a6_0x5d44();let _0x21a415=_0x5d44b6[_0x21df0e];return _0x21a415;}(function(_0x3ceea7,_0x1aec84){const _0x37aa3a=a6_0x21a4,_0x190f97=_0x3ceea7();while(!![]){try{const _0x2213a0=parseInt(_0x37aa3a(0x1f9))/0x1*(parseInt(_0x37aa3a(0x200))/0x2)+-parseInt(_0x37aa3a(0x1f6))/0x3*(parseInt(_0x37aa3a(0x1fa))/0x4)+-parseInt(_0x37aa3a(0x208))/0x5+-parseInt(_0x37aa3a(0x21c))/0x6*(-parseInt(_0x37aa3a(0x210))/0x7)+parseInt(_0x37aa3a(0x1ef))/0x8+-parseInt(_0x37aa3a(0x20f))/0x9*(parseInt(_0x37aa3a(0x21e))/0xa)+-parseInt(_0x37aa3a(0x20d))/0xb*(parseInt(_0x37aa3a(0x203))/0xc);if(_0x2213a0===_0x1aec84)break;else _0x190f97['push'](_0x190f97['shift']());}catch(_0x510ba4){_0x190f97['push'](_0x190f97['shift']());}}}(a6_0x5d44,0x5188c));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x500da4(0x201),a6_0x500da4(0x20c),a6_0x500da4(0x20e),a6_0x500da4(0x1ea),a6_0x500da4(0x1fc),a6_0x500da4(0x207),a6_0x500da4(0x21b),a6_0x500da4(0x1eb)]);function isSensitiveHeader(_0xd97c3d){const _0x4e4818=a6_0x500da4;return SENSITIVE_HEADERS[_0x4e4818(0x21f)](_0xd97c3d[_0x4e4818(0x209)]());}function parseHeader(_0x3cf57c){const _0x3f8120=a6_0x500da4,_0x4da487=_0x3cf57c[_0x3f8120(0x1ed)](':');if(_0x4da487===-0x1)throw new Error(_0x3f8120(0x1ec)+_0x3cf57c+_0x3f8120(0x1f7)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x5dbdfb=_0x3cf57c[_0x3f8120(0x213)](0x0,_0x4da487)[_0x3f8120(0x202)](),_0x1354ef=_0x3cf57c[_0x3f8120(0x213)](_0x4da487+0x1)[_0x3f8120(0x202)]();if(!_0x5dbdfb)throw new Error(_0x3f8120(0x225)+_0x3cf57c+'\x22');return[_0x5dbdfb,_0x1354ef];}function a6_0x5d44(){const _0x33e0bf=['15288CaFnqm','POST','.\x20Valid\x20methods:\x20','name','x-xsrf-token','1411485TcBlJk','toLowerCase','error','site','proxy-authorization','275kFUdaW','cookie','9TOCiPX','58107vmNyqW','Invalid\x20HTTP\x20method:\x20','status','substring','data','PATCH','api','entries','readBodyFromFile','execute','method','x-auth-token','414DfugQT','description','3256570DPFFkh','has','includes','join','Results\x20saved\x20to\x20','validate','headers','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','\x0aStack\x20trace:\x0a','output','log','toUpperCase','cdp','message','set-cookie','x-trino-user','Invalid\x20header\x20format:\x20\x22','indexOf','request','3701272JbJewx','trino','GET','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','body','<\x20HTTP/1.1\x20','verbose','614316rpjIMJ','\x22.\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','536pskrcK','4ixqACA','Error:\x20','set-cookie2','type','workflow','noColor','534aItwZL','authorization','trim'];a6_0x5d44=function(){return _0x33e0bf;};return a6_0x5d44();}export class ApiCommand extends BaseCommand{[a6_0x500da4(0x206)]=a6_0x500da4(0x216);[a6_0x500da4(0x21d)]=a6_0x500da4(0x1f2);[a6_0x500da4(0x223)](_0x254d10){const _0xe7cb9d=a6_0x500da4,{args:_0x393b99,options:_0x1e8290}=_0x254d10,_0xf1af23=_0x1e8290;if(_0x393b99['length']===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x5ef053=_0x393b99[0x0];if(!_0x5ef053['startsWith']('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x5ef053;const _0x286263=_0xf1af23['data'],_0x272de8=_0xf1af23['file'];if(_0x286263&&_0x272de8)return _0xe7cb9d(0x1f8);const _0x270a8b=_0xf1af23[_0xe7cb9d(0x21a)]||'GET',_0x363661=[_0xe7cb9d(0x1f1),_0xe7cb9d(0x204),'PUT','DELETE',_0xe7cb9d(0x215)];if(!_0x363661[_0xe7cb9d(0x220)](_0x270a8b[_0xe7cb9d(0x1e7)]()))return _0xe7cb9d(0x211)+_0x270a8b+_0xe7cb9d(0x205)+_0x363661[_0xe7cb9d(0x221)](',\x20');const _0x21af86=_0xf1af23[_0xe7cb9d(0x1fd)]||'td',_0x2d1d90=['td',_0xe7cb9d(0x1e8),_0xe7cb9d(0x1fe),_0xe7cb9d(0x1f0),'llm','llm-proxy'];if(!_0x2d1d90[_0xe7cb9d(0x220)](_0x21af86))return'Invalid\x20API\x20type:\x20'+_0x21af86+'.\x20Valid\x20types:\x20'+_0x2d1d90[_0xe7cb9d(0x221)](',\x20');return undefined;}async[a6_0x500da4(0x219)](_0x1cb796){const _0x13d0c3=a6_0x500da4,{options:_0x3901b6,args:_0x55db36,tdx:_0x211113}=_0x1cb796,_0x277402=_0x3901b6,_0x489da1=_0x55db36[0x0],_0x3ff223=(_0x277402[_0x13d0c3(0x21a)]||_0x13d0c3(0x1f1))[_0x13d0c3(0x1e7)](),_0x6d4427=_0x277402[_0x13d0c3(0x214)],_0xf6ef2f=_0x277402['file'],_0xd5d818=_0x277402['header'],_0x2a729f=_0x277402[_0x13d0c3(0x1fd)]||'td';try{const _0x9a47b7={};if(_0xd5d818){const _0x48f164=Array['isArray'](_0xd5d818)?_0xd5d818:[_0xd5d818];for(const _0x18bd60 of _0x48f164){const [_0x419c8b,_0x5db9d5]=parseHeader(_0x18bd60);_0x9a47b7[_0x419c8b]=_0x5db9d5;}}let _0x38a803;if(_0x6d4427)_0x38a803=_0x6d4427;else{if(_0xf6ef2f)try{_0x38a803=RawAPI[_0x13d0c3(0x218)](_0xf6ef2f);}catch(_0x43b420){return console[_0x13d0c3(0x20a)](_0x13d0c3(0x1fb)+(_0x43b420 instanceof Error?_0x43b420[_0x13d0c3(0x1e9)]:String(_0x43b420))),0x1;}}const _0x51a20a={'method':_0x3ff223,'apiType':_0x2a729f,'includeHeaders':_0x3901b6[_0x13d0c3(0x1f5)]};_0x38a803&&(_0x51a20a[_0x13d0c3(0x1f3)]=_0x38a803);Object['keys'](_0x9a47b7)['length']>0x0&&(_0x51a20a[_0x13d0c3(0x224)]=_0x9a47b7);if(_0x3901b6[_0x13d0c3(0x1f5)]){const _0x2f7260=resolveSite(_0x3901b6[_0x13d0c3(0x20b)]),_0x26197e=getEndpoint(_0x2f7260,_0x2a729f),_0x47a2ff=''+_0x26197e+_0x489da1;console['error']('>\x20'+_0x3ff223+'\x20'+_0x47a2ff);const _0x41fc22=getAuthHeaders(_0x2f7260),_0x5ccdcc={..._0x41fc22,..._0x9a47b7};for(const [_0x2bc818,_0x3e0de3]of Object[_0x13d0c3(0x217)](_0x5ccdcc)){!isSensitiveHeader(_0x2bc818)&&console[_0x13d0c3(0x20a)]('>\x20'+_0x2bc818+':\x20'+_0x3e0de3);}_0x38a803&&console[_0x13d0c3(0x20a)]('>'),console['error']('');}const _0xc3c185=await _0x211113[_0x13d0c3(0x216)][_0x13d0c3(0x1ee)](_0x489da1,_0x51a20a);if(_0x3901b6['verbose']&&_0xc3c185[_0x13d0c3(0x224)]){console['error'](_0x13d0c3(0x1f4)+_0xc3c185[_0x13d0c3(0x212)]);for(const [_0x572a48,_0x17b55b]of Object[_0x13d0c3(0x217)](_0xc3c185['headers'])){!isSensitiveHeader(_0x572a48)&&console[_0x13d0c3(0x20a)]('<\x20'+_0x572a48+':\x20'+_0x17b55b);}console['error']('');}const _0x4a9f08=Boolean(_0x3901b6[_0x13d0c3(0x227)]),_0xc85376={'color':_0x3901b6['color'],'noColor':_0x3901b6[_0x13d0c3(0x1ff)]||_0x4a9f08&&!_0x3901b6['color']},_0x33e1ed=colorizeJSON(_0xc3c185['data'],_0xc85376);return _0x3901b6[_0x13d0c3(0x227)]?(writeFileSync(_0x3901b6[_0x13d0c3(0x227)],_0x33e1ed),console[_0x13d0c3(0x20a)](_0x13d0c3(0x222)+_0x3901b6[_0x13d0c3(0x227)])):console[_0x13d0c3(0x228)](_0x33e1ed),0x0;}catch(_0x32f445){return _0x32f445 instanceof Error?(console[_0x13d0c3(0x20a)](_0x13d0c3(0x1fb)+_0x32f445[_0x13d0c3(0x1e9)]),_0x3901b6[_0x13d0c3(0x1f5)]&&_0x32f445['stack']&&console[_0x13d0c3(0x20a)](_0x13d0c3(0x226)+_0x32f445['stack'])):console[_0x13d0c3(0x20a)](_0x13d0c3(0x1fb)+String(_0x32f445)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x30d347=a7_0x1fdb;function a7_0x1953(){const _0x3c79b5=['Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','join','us01','auth:setup','jobs','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','getUserInfo','5561660IRcdwt','167466QXssQn','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','384282mcXuTD','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','\x27\x20registered','\x20\x20tdx','apiKey','✓\x20Default\x20site\x20set\x20to\x20','error','create','bold','red','Name:\x20','execute','trim','ERROR','email','logLevel','site','profile','System\x20keychain\x20is\x20not\x20available','status','\x20(profile:\x20','last_name','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','name','147012umdVvo','Setup\x20API\x20key\x20authentication\x20interactively','Remove\x20API\x20key\x20from\x20system\x20keychain','\x20(site:\x20','log','\x0aSetup\x20cancelled','Select\x20your\x20Treasure\x20Data\x20site:','✗\x20Validation\x20failed:\x20','auth','tdx:\x20auth\x20clear','39RdVpZm','68594vxmsVT','✓\x20Authentication\x20successful\x0a','/app/mp/ak','first_name','N/A','\x20--profile\x20','auth:clear','description','36333DAqODC','Setting\x20up\x20authentication\x20for\x20site:\x20','\x20for\x20profile:\x20','Validating\x20API\x20key...','other','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','yellow','No\x20credential\x20found','55UnupZw','password','select','2005591fmYjnY','API\x20key\x20cannot\x20be\x20empty','warn','Site\x20name\x20cannot\x20be\x20empty','You\x20can\x20find\x20your\x20API\x20key\x20at:','filter','customSite','856pGVZvT'];a7_0x1953=function(){return _0x3c79b5;};return a7_0x1953();}(function(_0x37ae4a,_0x26ee23){const _0x3b9e5e=a7_0x1fdb,_0x484027=_0x37ae4a();while(!![]){try{const _0x1c4fe2=parseInt(_0x3b9e5e(0x113))/0x1+parseInt(_0x3b9e5e(0x139))/0x2+-parseInt(_0x3b9e5e(0x112))/0x3*(parseInt(_0x3b9e5e(0x108))/0x4)+parseInt(_0x3b9e5e(0x123))/0x5*(parseInt(_0x3b9e5e(0x137))/0x6)+parseInt(_0x3b9e5e(0x126))/0x7+parseInt(_0x3b9e5e(0x12d))/0x8*(parseInt(_0x3b9e5e(0x11b))/0x9)+-parseInt(_0x3b9e5e(0x136))/0xa;if(_0x1c4fe2===_0x26ee23)break;else _0x484027['push'](_0x484027['shift']());}catch(_0x2f7144){_0x484027['push'](_0x484027['shift']());}}}(a7_0x1953,0x3d971));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x1c8667 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_0x4480ae from'chalk';export class AuthSetupCommand extends BaseCommand{['name']=a7_0x30d347(0x132);['description']=a7_0x30d347(0x109);async[a7_0x30d347(0x144)](_0x40e41e){const _0x19ec0d=a7_0x30d347,{options:_0x9d3325}=_0x40e41e,_0x2488cb=_0x9d3325[_0x19ec0d(0x101)];console[_0x19ec0d(0x10c)](a7_0x4480ae[_0x19ec0d(0x141)]('tdx:\x20auth\x20setup'));const _0x32506b=_0x9d3325[_0x19ec0d(0x100)]||_0x19ec0d(0x131),{choices:_0x17736b,initialIndex:_0x550045}=buildSiteChoices(_0x32506b),_0x43d1d0=_0x2488cb?_0x19ec0d(0x12f)+_0x2488cb+'):':_0x19ec0d(0x10e),_0x2dfc1b=await a7_0x1c8667({'type':_0x19ec0d(0x125),'name':'site','message':_0x43d1d0,'choices':_0x17736b,'initial':_0x550045});if(!_0x2dfc1b[_0x19ec0d(0x100)])return console[_0x19ec0d(0x10c)]('\x0aSetup\x20cancelled'),0x1;let _0x466c91;if(_0x2dfc1b['site']===_0x19ec0d(0x11f)){const _0x54b149=await a7_0x1c8667({'type':'text','name':_0x19ec0d(0x12c),'message':'Enter\x20site\x20name:','initial':_0x19ec0d(0x131),'validate':_0x2ca9d9=>{const _0x5adc14=_0x19ec0d;if(!_0x2ca9d9||!_0x2ca9d9[_0x5adc14(0x145)]())return _0x5adc14(0x129);if(!/^[a-z0-9-]+$/['test'](_0x2ca9d9[_0x5adc14(0x145)]()))return _0x5adc14(0x12e);return!![];}});if(!_0x54b149['customSite'])return console[_0x19ec0d(0x10c)](_0x19ec0d(0x10d)),0x1;_0x466c91=_0x54b149['customSite'];}else _0x466c91=_0x2dfc1b[_0x19ec0d(0x100)];const _0x45a93a=resolveSite(_0x466c91);console[_0x19ec0d(0x10c)](_0x19ec0d(0x11c)+_0x45a93a),console[_0x19ec0d(0x10c)](_0x19ec0d(0x12a)),console[_0x19ec0d(0x10c)]('\x20\x20'+getConsoleUrl(_0x45a93a,_0x19ec0d(0x115)));const _0x114428=await a7_0x1c8667({'type':_0x19ec0d(0x124),'name':_0x19ec0d(0x13d),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x4a7276=>{const _0xa0d8e1=_0x19ec0d;if(!_0x4a7276||!_0x4a7276['trim']())return _0xa0d8e1(0x127);return!![];}});if(!_0x114428[_0x19ec0d(0x13d)])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x21e955=_0x114428['apiKey'];console[_0x19ec0d(0x10c)](_0x19ec0d(0x11e));try{const _0x20866b=TDX[_0x19ec0d(0x140)]({'site':_0x45a93a,'apiKey':_0x21e955[_0x19ec0d(0x145)](),'logLevel':_0x9d3325[_0x19ec0d(0x148)]??LogLevel[_0x19ec0d(0x146)]}),_0x385f2f=await _0x20866b[_0x19ec0d(0x133)][_0x19ec0d(0x135)]();console[_0x19ec0d(0x10c)](_0x19ec0d(0x13a)+_0x385f2f[_0x19ec0d(0x147)]+')');const _0x32c565=await isKeychainAvailable();_0x32c565?(await saveAPIKeyAsync(_0x21e955[_0x19ec0d(0x145)](),_0x45a93a,_0x2488cb),console['log'](_0x19ec0d(0x138)+(_0x2488cb?_0x19ec0d(0x104)+_0x2488cb+')':''))):(console['warn'](a7_0x4480ae[_0x19ec0d(0x121)](_0x19ec0d(0x106))),console[_0x19ec0d(0x128)](a7_0x4480ae[_0x19ec0d(0x121)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x2488cb){const _0x5a2f8c={'site':_0x45a93a};saveProfileToUserConfig(_0x2488cb,_0x5a2f8c),console[_0x19ec0d(0x10c)]('✓\x20Profile\x20\x27'+_0x2488cb+_0x19ec0d(0x13b));}else saveDefaultSiteToUserConfig(_0x45a93a),console[_0x19ec0d(0x10c)](_0x19ec0d(0x13e)+_0x45a93a);const _0x34a5f1=_0x2488cb?_0x19ec0d(0x118)+_0x2488cb:'';return console[_0x19ec0d(0x10c)](),console[_0x19ec0d(0x10c)](_0x19ec0d(0x120)),console[_0x19ec0d(0x10c)](_0x19ec0d(0x13c)+_0x34a5f1+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x19ec0d(0x10c)](_0x19ec0d(0x13c)+_0x34a5f1+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x266673){if(_0x266673 instanceof HTTPClientError&&_0x266673[_0x19ec0d(0x103)]===0x191)return printAuthError(_0x266673),0x1;return console['error'](a7_0x4480ae[_0x19ec0d(0x142)](_0x19ec0d(0x10f)+(_0x266673 instanceof Error?_0x266673['message']:String(_0x266673)))),console[_0x19ec0d(0x13f)](_0x19ec0d(0x134)),0x1;}}}function a7_0x1fdb(_0x50f825,_0x4fa967){_0x50f825=_0x50f825-0x100;const _0x19535e=a7_0x1953();let _0x1fdb33=_0x19535e[_0x50f825];return _0x1fdb33;}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x30d347(0x110);[a7_0x30d347(0x11a)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async['execute'](_0x31cc3e){const _0x53f450=a7_0x30d347,{options:_0x13545c,tdx:_0x50954f}=_0x31cc3e,_0x389e36=_0x13545c[_0x53f450(0x100)],_0x11abfb=_0x13545c[_0x53f450(0x101)],_0x176f48=_0x11abfb?_0x11abfb:_0x53f450(0x117);console['log']('tdx\x20profile:\x20'+_0x176f48+_0x53f450(0x10b)+_0x389e36+')');const _0x420d57=await resolveAPIKeyAsync(_0x389e36,_0x11abfb);if(_0x420d57){const {source:_0x4d3bf3,isDeprecated:_0x16e695}=_0x420d57,_0x47f072='Read\x20credential\x20from\x20'+_0x4d3bf3;console['log'](_0x16e695?a7_0x4480ae['yellow'](_0x47f072):_0x47f072);}else console[_0x53f450(0x10c)](a7_0x4480ae['yellow'](_0x53f450(0x122)));try{const _0x472a60=await _0x50954f['jobs'][_0x53f450(0x135)]();return console[_0x53f450(0x10c)](a7_0x4480ae['green'](_0x53f450(0x114))),console[_0x53f450(0x10c)]('User:\x20'+_0x472a60[_0x53f450(0x147)]),(_0x472a60[_0x53f450(0x116)]||_0x472a60['last_name'])&&console['log'](_0x53f450(0x143)+[_0x472a60[_0x53f450(0x116)],_0x472a60[_0x53f450(0x105)]][_0x53f450(0x12b)](Boolean)[_0x53f450(0x130)]('\x20')),0x0;}catch(_0x123f9e){return _0x123f9e instanceof HTTPClientError&&_0x123f9e[_0x53f450(0x103)]===0x191?printAuthError(_0x123f9e,!![],_0x11abfb):console[_0x53f450(0x13f)](a7_0x4480ae[_0x53f450(0x142)](_0x53f450(0x10f)+(_0x123f9e instanceof Error?_0x123f9e['message']:String(_0x123f9e)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x30d347(0x107)]=a7_0x30d347(0x119);[a7_0x30d347(0x11a)]=a7_0x30d347(0x10a);async[a7_0x30d347(0x144)](_0xfb06d7){const _0x33ee9c=a7_0x30d347,{options:_0x2fa074}=_0xfb06d7,_0x4b3a20=_0x2fa074[_0x33ee9c(0x101)];console[_0x33ee9c(0x10c)](a7_0x4480ae[_0x33ee9c(0x141)](_0x33ee9c(0x111)));const _0xaf2046=await isKeychainAvailable();if(!_0xaf2046)return console[_0x33ee9c(0x13f)](a7_0x4480ae[_0x33ee9c(0x142)](_0x33ee9c(0x102))),0x1;const _0x10b401=await deleteKeychainAPIKey(_0x4b3a20);return _0x10b401?(clearCredentialCache(),console[_0x33ee9c(0x10c)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x4b3a20?_0x33ee9c(0x104)+_0x4b3a20+')':'')),0x0):(console['log']('No\x20API\x20key\x20found\x20in\x20keychain'+(_0x4b3a20?_0x33ee9c(0x11d)+_0x4b3a20:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a8_0x2bec(_0x5eae74,_0xf8dd23){_0x5eae74=_0x5eae74-0x112;const _0x2556be=a8_0x2556();let _0x2bec7f=_0x2556be[_0x5eae74];return _0x2bec7f;}const a8_0x5a9f42=a8_0x2bec;(function(_0xb43115,_0x120ce7){const _0x3979dd=a8_0x2bec,_0xcbafa1=_0xb43115();while(!![]){try{const _0xd9600c=parseInt(_0x3979dd(0x124))/0x1*(-parseInt(_0x3979dd(0x134))/0x2)+parseInt(_0x3979dd(0x148))/0x3+-parseInt(_0x3979dd(0x11a))/0x4+-parseInt(_0x3979dd(0x120))/0x5*(parseInt(_0x3979dd(0x15f))/0x6)+-parseInt(_0x3979dd(0x14f))/0x7*(parseInt(_0x3979dd(0x117))/0x8)+parseInt(_0x3979dd(0x127))/0x9*(-parseInt(_0x3979dd(0x115))/0xa)+-parseInt(_0x3979dd(0x151))/0xb*(-parseInt(_0x3979dd(0x142))/0xc);if(_0xd9600c===_0x120ce7)break;else _0xcbafa1['push'](_0xcbafa1['shift']());}catch(_0x4cefd2){_0xcbafa1['push'](_0xcbafa1['shift']());}}}(a8_0x2556,0x8c0f3));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x204914,_0x3b0cfa){const _0xa64bd8=a8_0x2bec;if(_0x204914 instanceof SDKError)console[_0xa64bd8(0x11b)](_0xa64bd8(0x130)+_0x204914[_0xa64bd8(0x154)]),_0x3b0cfa[_0xa64bd8(0x13a)]&&(_0x204914['cause']&&console['error']('\x20\x20Cause:\x20'+_0x204914[_0xa64bd8(0x11d)]),_0x204914[_0xa64bd8(0x155)]&&(console['error'](_0xa64bd8(0x131)),console[_0xa64bd8(0x11b)](_0x204914[_0xa64bd8(0x155)])));else throw _0x204914;}async function resolveAgentId(_0x1608d0,_0x4d34e3,_0x16ad8e,_0x44cc20,_0x1cd1a6){const _0x32941d=a8_0x2bec,_0x38f373=_0x4d34e3||_0x16ad8e;if(_0x38f373){const {projectName:_0x37fb07,agentName:_0x28b640}=parseAgentRef(_0x38f373),_0x239fb4=_0x28b640||_0x38f373,_0x36e144=_0x28b640?_0x37fb07:_0x44cc20;if(!_0x36e144)throw new Error(_0x32941d(0x14a));if(_0x1cd1a6){const _0x1e937a=_0x4d34e3?_0x32941d(0x147):_0x32941d(0x14b);console[_0x32941d(0x11b)]('Using\x20agent\x20from\x20'+_0x1e937a+':\x20'+_0x36e144+'/'+_0x239fb4);}const _0x42cbfb=await withSpinner(_0x32941d(0x12e)+_0x36e144+_0x32941d(0x114),()=>_0x1608d0[_0x32941d(0x129)][_0x32941d(0x144)](_0x36e144),{'verbose':_0x1cd1a6}),_0x58a486=await withSpinner(_0x32941d(0x113)+_0x239fb4+_0x32941d(0x114),()=>_0x1608d0['llm'][_0x32941d(0x11f)](_0x239fb4,_0x42cbfb[_0x32941d(0x15d)]),{'verbose':_0x1cd1a6});return _0x58a486[_0x32941d(0x15d)];}else{const _0x477ce1=_0x1608d0[_0x32941d(0x129)][_0x32941d(0x140)]();if(_0x477ce1)return _0x1cd1a6&&console[_0x32941d(0x11b)](_0x32941d(0x126)+_0x477ce1[_0x32941d(0x13d)]),_0x477ce1['id'];const _0x5dd8e9=await withSpinner('Getting\x20default\x20agent...',()=>_0x1608d0['llm']['getOrCreateDefaultAgent'](_0x32941d(0x12a),0x0),{'verbose':_0x1cd1a6});return _0x5dd8e9[_0x32941d(0x15d)]['id'];}}function a8_0x2556(){const _0x27ff91=['new','targetFunction','3237680GfrqUM','error','description','cause','chat','resolveAgentId','330530YmNSdS','agentId','stringify','targetWebSearchTool','1117678FUgwtu','args','Using\x20cached\x20default\x20agent:\x20','3798zPqAza','stdout','llm','claude-4.5-haiku','functionName','content','metadata','Resolving\x20project\x20\x27','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','Error:\x20','\x0aStack\x20trace:','chat-create','tool_call','2uLjwfI','log','write','agent','projectId','execute','verbose','chatId','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','name','done','\x27\x20not\x20found','getDefaultAgent','targetAgent','24sEHkJJ','Error:\x20Chat\x20session\x20\x27','resolveProjectId','streamChat','llmProject','--agent\x20flag','1322007hFBlpD','type','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','session\x20context','targetKnowledgeBase','llmAgent','options','4726008HyiTYR','handleChatEvent','19940162YwOvVl','tool','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','message','stack','startChat','validate','string','event','CHAT_NOT_FOUND','code','context','data','tool_result','42xzcTtM','Continuing\x20chat:\x20','404','stream','Resolving\x20agent\x20\x27','\x27...','10130xxOgHk','slice','8dSCmVY'];a8_0x2556=function(){return _0x27ff91;};return a8_0x2556();}export class ChatCommand extends BaseCommand{['name']=a8_0x5a9f42(0x11e);[a8_0x5a9f42(0x11c)]=a8_0x5a9f42(0x13c);[a8_0x5a9f42(0x157)](_0x54fea7){const _0x734681=a8_0x5a9f42,_0x2ea70b=_0x54fea7[_0x734681(0x125)]['join']('\x20');if(!_0x2ea70b)return _0x734681(0x12f);return undefined;}async[a8_0x5a9f42(0x145)](_0x48c1d6,_0x3a2932,_0x2b8043,_0x430ae4,_0x1b0926){const _0x4c70c6=a8_0x5a9f42;for await(const _0x333197 of _0x48c1d6[_0x4c70c6(0x129)][_0x4c70c6(0x11e)](_0x3a2932,{'agentId':_0x2b8043,'chatId':_0x430ae4})){if(_0x333197[_0x4c70c6(0x149)]===_0x4c70c6(0x12d)){const _0x5593f3=_0x333197[_0x4c70c6(0x15d)][_0x4c70c6(0x13b)];saveLastChatId(_0x5593f3),_0x1b0926&&console['error']('Chat\x20session:\x20'+_0x5593f3);}else _0x333197[_0x4c70c6(0x149)]===_0x4c70c6(0x159)&&this[_0x4c70c6(0x150)](_0x333197['data']);}}async['streamChatJsonl'](_0x1eca0b,_0x3b140c,_0x79e249,_0x1f2070){const _0x33e5b4=a8_0x5a9f42,_0x1e0db0=_0x1eca0b[_0x33e5b4(0x15c)]['site'];let _0x51ee18=![];for await(const _0x539cd3 of _0x1eca0b[_0x33e5b4(0x129)][_0x33e5b4(0x11e)](_0x3b140c,{'agentId':_0x79e249,'chatId':_0x1f2070})){if(_0x539cd3['type']==='metadata'){const _0x973f97=_0x539cd3[_0x33e5b4(0x15d)];saveLastChatId(_0x973f97[_0x33e5b4(0x13b)]);const _0x22c5a7=_0x973f97[_0x33e5b4(0x138)]&&_0x973f97[_0x33e5b4(0x121)]?getLLMConversationUrl(_0x1e0db0,_0x973f97['projectId'],_0x973f97[_0x33e5b4(0x121)],_0x973f97[_0x33e5b4(0x13b)]):undefined;console[_0x33e5b4(0x135)](JSON[_0x33e5b4(0x122)]({'type':_0x33e5b4(0x12d),'data':{'chatId':_0x973f97[_0x33e5b4(0x13b)],'agentId':_0x973f97['agentId'],'consoleUrl':_0x22c5a7}})),_0x51ee18=!![];}else{if(_0x539cd3[_0x33e5b4(0x149)]==='event'){!_0x51ee18&&_0x1f2070&&(console['log'](JSON[_0x33e5b4(0x122)]({'type':'metadata','data':{'chatId':_0x1f2070}})),_0x51ee18=!![]);const _0x538a19=_0x539cd3[_0x33e5b4(0x15d)];if(_0x33e5b4(0x12c)in _0x538a19)console[_0x33e5b4(0x135)](JSON[_0x33e5b4(0x122)]({'type':_0x33e5b4(0x12c),'data':{'content':_0x538a19['content']}}));else{if('tool_call'in _0x538a19){const _0x1ddea7=_0x538a19['tool_call'];console[_0x33e5b4(0x135)](JSON[_0x33e5b4(0x122)]({'type':_0x33e5b4(0x133),'data':{'id':_0x1ddea7['id'],'name':_0x1ddea7[_0x33e5b4(0x12b)],'target':_0x1ddea7[_0x33e5b4(0x14c)]?.['name']||_0x1ddea7[_0x33e5b4(0x141)]?.[_0x33e5b4(0x13d)]||_0x1ddea7[_0x33e5b4(0x123)]?.[_0x33e5b4(0x13d)]||_0x1ddea7[_0x33e5b4(0x119)]}}));}else{if(_0x33e5b4(0x152)in _0x538a19)console[_0x33e5b4(0x135)](JSON[_0x33e5b4(0x122)]({'type':_0x33e5b4(0x15e),'data':{'id':_0x538a19[_0x33e5b4(0x152)]['id'],'name':_0x538a19[_0x33e5b4(0x152)]['functionName'],'result':typeof _0x538a19['tool'][_0x33e5b4(0x12c)]===_0x33e5b4(0x158)?_0x538a19[_0x33e5b4(0x152)][_0x33e5b4(0x12c)][_0x33e5b4(0x116)](0x0,0x1f4):''}}));else'error'in _0x538a19&&console['log'](JSON['stringify']({'type':_0x33e5b4(0x11b),'data':{'error':_0x538a19[_0x33e5b4(0x11b)]}}));}}}}}console[_0x33e5b4(0x135)](JSON[_0x33e5b4(0x122)]({'type':_0x33e5b4(0x13e)}));}async[a8_0x5a9f42(0x139)](_0x2620a1){const _0x285723=a8_0x5a9f42,{options:_0x447bb0,args:_0x227991,tdx:_0x528e13}=_0x2620a1,_0x44ae76=_0x227991['join']('\x20'),_0x43f6a6=_0x447bb0,_0x4038a7=_0x43f6a6['agent'],_0xd4c41a=_0x43f6a6['llmAgent'],_0x11a082=_0x43f6a6['llmProject'],_0x1ad51e=_0x43f6a6[_0x285723(0x118)],_0x4833ec=_0x43f6a6[_0x285723(0x13b)],_0x3fa38b=_0x43f6a6[_0x285723(0x112)];if(_0x1ad51e&&_0x4833ec)return console['error']('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x42b2cd,_0x2d1300;if(_0x4833ec)_0x2d1300=_0x4833ec;else!_0x1ad51e&&(_0x2d1300=loadLastChatId(),_0x2d1300&&_0x447bb0[_0x285723(0x13a)]&&console[_0x285723(0x11b)](_0x285723(0x160)+_0x2d1300));!_0x4833ec&&(_0x1ad51e||!_0x2d1300)&&(_0x42b2cd=await resolveAgentId(_0x528e13,_0x4038a7,_0xd4c41a,_0x11a082,_0x447bb0['verbose']));const _0x323886=_0x3fa38b?(_0x3bd642,_0x539989,_0x2017ae)=>this['streamChatJsonl'](_0x528e13,_0x3bd642,_0x539989,_0x2017ae):(_0x29903b,_0x138e88,_0x5ef6b6)=>this['streamChat'](_0x528e13,_0x29903b,_0x138e88,_0x5ef6b6,_0x447bb0[_0x285723(0x13a)]);try{await _0x323886(_0x44ae76,_0x42b2cd,_0x2d1300);}catch(_0xd3757e){const _0x2d3c58=_0xd3757e instanceof SDKError&&_0xd3757e[_0x285723(0x15b)]===ErrorCode[_0x285723(0x15a)]||_0xd3757e instanceof Error&&_0xd3757e[_0x285723(0x154)]['includes'](_0x285723(0x161));if(_0x2d3c58&&_0x4833ec)return console[_0x285723(0x11b)](_0x285723(0x143)+_0x4833ec+_0x285723(0x13f)),0x1;if(_0x2d3c58)_0x447bb0['verbose']&&console[_0x285723(0x11b)]('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x42b2cd&&(_0x42b2cd=await resolveAgentId(_0x528e13,_0x4038a7,_0xd4c41a,_0x11a082,_0x447bb0[_0x285723(0x13a)])),await _0x323886(_0x44ae76,_0x42b2cd,undefined);else throw _0xd3757e;}return!_0x3fa38b&&console[_0x285723(0x135)](),0x0;}catch(_0x36667d){return console[_0x285723(0x11b)](),handleSDKError(_0x36667d,_0x447bb0),0x1;}}[a8_0x5a9f42(0x150)](_0x281e14){const _0x2cc57a=a8_0x5a9f42;if('content'in _0x281e14)process[_0x2cc57a(0x128)][_0x2cc57a(0x136)](_0x281e14[_0x2cc57a(0x12c)]);else'error'in _0x281e14&&console['error']('\x0aError:\x20'+_0x281e14[_0x2cc57a(0x11b)]);}}export class ChatCreateCommand extends BaseCommand{['name']=a8_0x5a9f42(0x132);[a8_0x5a9f42(0x11c)]='Create\x20a\x20new\x20chat\x20session';[a8_0x5a9f42(0x157)](_0x28c129){const _0x367563=a8_0x5a9f42,_0x52e70e=_0x28c129[_0x367563(0x14e)],_0x31b86f=_0x52e70e[_0x367563(0x137)],_0x3ab297=_0x52e70e[_0x367563(0x14d)];if(!_0x31b86f&&!_0x3ab297)return _0x367563(0x153);return undefined;}async['execute'](_0x458add){const _0x59e054=a8_0x5a9f42,{options:_0x5d6d26,tdx:_0x55a7b7}=_0x458add,_0x75ea43=_0x5d6d26,_0x17a4ec=_0x75ea43[_0x59e054(0x137)],_0x5a12eb=_0x75ea43[_0x59e054(0x14d)],_0x414abd=_0x75ea43[_0x59e054(0x146)];try{const _0x47c642=await resolveAgentId(_0x55a7b7,_0x17a4ec,_0x5a12eb,_0x414abd,_0x5d6d26[_0x59e054(0x13a)]),_0x1633b0=await _0x55a7b7[_0x59e054(0x129)][_0x59e054(0x156)](_0x47c642);return saveLastChatId(_0x1633b0['id']),console['log'](JSON[_0x59e054(0x122)]({'chatId':_0x1633b0['id'],'agentId':_0x47c642})),0x0;}catch(_0x4a7c7b){return handleSDKError(_0x4a7c7b,_0x5d6d26),0x1;}}}
|
|
1
|
+
const a8_0x3df821=a8_0x1d09;(function(_0x31ff49,_0x53ba19){const _0xdac20f=a8_0x1d09,_0x1e69c8=_0x31ff49();while(!![]){try{const _0x586534=-parseInt(_0xdac20f(0x1b1))/0x1+parseInt(_0xdac20f(0x1a2))/0x2*(parseInt(_0xdac20f(0x1b8))/0x3)+parseInt(_0xdac20f(0x197))/0x4+-parseInt(_0xdac20f(0x1c5))/0x5+parseInt(_0xdac20f(0x1b9))/0x6*(parseInt(_0xdac20f(0x1a3))/0x7)+parseInt(_0xdac20f(0x1a5))/0x8*(parseInt(_0xdac20f(0x1d2))/0x9)+-parseInt(_0xdac20f(0x1d6))/0xa;if(_0x586534===_0x53ba19)break;else _0x1e69c8['push'](_0x1e69c8['shift']());}catch(_0x277360){_0x1e69c8['push'](_0x1e69c8['shift']());}}}(a8_0x4885,0xc800f));function a8_0x1d09(_0x1e6748,_0x255b9e){_0x1e6748=_0x1e6748-0x18c;const _0x4885f6=a8_0x4885();let _0x1d0928=_0x4885f6[_0x1e6748];return _0x1d0928;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0x4885(){const _0x26bfdb=['write','chat','projectId','tool','targetFunction','Chat\x20session:\x20','cause','event','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','name','134humJfH','3256862XqVTPc','message','8FgZVLX','claude-4.5-haiku','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','new','Getting\x20default\x20agent...','agentId','targetAgent','startChat','string','\x0aStack\x20trace:','error','context','684356aRtkjc','type','stream','includes','log','llmAgent','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','61839KKEVbx','12PgWwjb','targetWebSearchTool','handleChatEvent','Continuing\x20chat:\x20','metadata','description','stack','\x20\x20Cause:\x20','llm','llmProject','--agent\x20flag','agent','7176900mUNxIj','\x27...','slice','join','data','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','CHAT_NOT_FOUND','tool_call','Create\x20a\x20new\x20chat\x20session','streamChatJsonl','Resolving\x20project\x20\x27','chat-create','getDefaultAgent','12984858bbUAnv','validate','execute','Error:\x20','21969050nXogTq','streamChat','getOrCreateDefaultAgent','content','verbose','done','functionName','stringify','chatId','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','Resolving\x20agent\x20\x27','args','resolveAgentId','\x0aError:\x20','Using\x20cached\x20default\x20agent:\x20','5525964ZVrglF'];a8_0x4885=function(){return _0x26bfdb;};return a8_0x4885();}import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x59c0f1,_0x34b434){const _0x33a8ed=a8_0x1d09;if(_0x59c0f1 instanceof SDKError)console[_0x33a8ed(0x1af)](_0x33a8ed(0x1d5)+_0x59c0f1[_0x33a8ed(0x1a4)]),_0x34b434[_0x33a8ed(0x18c)]&&(_0x59c0f1[_0x33a8ed(0x19e)]&&console[_0x33a8ed(0x1af)](_0x33a8ed(0x1c0)+_0x59c0f1[_0x33a8ed(0x19e)]),_0x59c0f1[_0x33a8ed(0x1bf)]&&(console[_0x33a8ed(0x1af)](_0x33a8ed(0x1ae)),console[_0x33a8ed(0x1af)](_0x59c0f1[_0x33a8ed(0x1bf)])));else throw _0x59c0f1;}async function resolveAgentId(_0x9c4614,_0x370212,_0x95ce2,_0x5022c9,_0x50e40f){const _0x48448b=a8_0x1d09,_0x46693d=_0x370212||_0x95ce2;if(_0x46693d){const {projectName:_0x156b70,agentName:_0x498eaf}=parseAgentRef(_0x46693d),_0x57f7f2=_0x498eaf||_0x46693d,_0x2067c4=_0x498eaf?_0x156b70:_0x5022c9;if(!_0x2067c4)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x50e40f){const _0x54681c=_0x370212?_0x48448b(0x1c3):'session\x20context';console[_0x48448b(0x1af)]('Using\x20agent\x20from\x20'+_0x54681c+':\x20'+_0x2067c4+'/'+_0x57f7f2);}const _0x557094=await withSpinner(_0x48448b(0x1cf)+_0x2067c4+_0x48448b(0x1c6),()=>_0x9c4614['llm']['resolveProjectId'](_0x2067c4),{'verbose':_0x50e40f}),_0x307f6e=await withSpinner(_0x48448b(0x192)+_0x57f7f2+'\x27...',()=>_0x9c4614[_0x48448b(0x1c1)][_0x48448b(0x194)](_0x57f7f2,_0x557094[_0x48448b(0x1c9)]),{'verbose':_0x50e40f});return _0x307f6e[_0x48448b(0x1c9)];}else{const _0x2b1ca8=_0x9c4614[_0x48448b(0x1c1)][_0x48448b(0x1d1)]();if(_0x2b1ca8)return _0x50e40f&&console[_0x48448b(0x1af)](_0x48448b(0x196)+_0x2b1ca8[_0x48448b(0x1a1)]),_0x2b1ca8['id'];const _0x47925e=await withSpinner(_0x48448b(0x1a9),()=>_0x9c4614[_0x48448b(0x1c1)][_0x48448b(0x1d8)](_0x48448b(0x1a6),0x0),{'verbose':_0x50e40f});return _0x47925e[_0x48448b(0x1c9)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x3df821(0x1a1)]=a8_0x3df821(0x199);[a8_0x3df821(0x1be)]=a8_0x3df821(0x1ca);[a8_0x3df821(0x1d3)](_0x4bff54){const _0x4d40ce=a8_0x3df821,_0x292cf1=_0x4bff54[_0x4d40ce(0x193)][_0x4d40ce(0x1c8)]('\x20');if(!_0x292cf1)return _0x4d40ce(0x1a7);return undefined;}async[a8_0x3df821(0x1d7)](_0x5545e4,_0x5476b2,_0x562e3b,_0x2fc7c9,_0x3ed4cc){const _0xda48d9=a8_0x3df821;for await(const _0x164428 of _0x5545e4['llm'][_0xda48d9(0x199)](_0x5476b2,{'agentId':_0x562e3b,'chatId':_0x2fc7c9})){if(_0x164428[_0xda48d9(0x1b2)]===_0xda48d9(0x1bd)){const _0x5c09b7=_0x164428[_0xda48d9(0x1c9)]['chatId'];saveLastChatId(_0x5c09b7),_0x3ed4cc&&console[_0xda48d9(0x1af)](_0xda48d9(0x19d)+_0x5c09b7);}else _0x164428[_0xda48d9(0x1b2)]===_0xda48d9(0x19f)&&this[_0xda48d9(0x1bb)](_0x164428[_0xda48d9(0x1c9)]);}}async[a8_0x3df821(0x1ce)](_0x26ca59,_0x2265d5,_0x344586,_0x4a8b75){const _0x9dab71=a8_0x3df821,_0x2675cf=_0x26ca59[_0x9dab71(0x1b0)]['site'];let _0x4e68f3=![];for await(const _0x4dd990 of _0x26ca59[_0x9dab71(0x1c1)][_0x9dab71(0x199)](_0x2265d5,{'agentId':_0x344586,'chatId':_0x4a8b75})){if(_0x4dd990[_0x9dab71(0x1b2)]==='metadata'){const _0x3deeee=_0x4dd990[_0x9dab71(0x1c9)];saveLastChatId(_0x3deeee['chatId']);const _0x558570=_0x3deeee[_0x9dab71(0x19a)]&&_0x3deeee['agentId']?getLLMConversationUrl(_0x2675cf,_0x3deeee[_0x9dab71(0x19a)],_0x3deeee[_0x9dab71(0x1aa)],_0x3deeee[_0x9dab71(0x190)]):undefined;console[_0x9dab71(0x1b5)](JSON[_0x9dab71(0x18f)]({'type':_0x9dab71(0x1bd),'data':{'chatId':_0x3deeee[_0x9dab71(0x190)],'agentId':_0x3deeee[_0x9dab71(0x1aa)],'consoleUrl':_0x558570}})),_0x4e68f3=!![];}else{if(_0x4dd990[_0x9dab71(0x1b2)]===_0x9dab71(0x19f)){!_0x4e68f3&&_0x4a8b75&&(console[_0x9dab71(0x1b5)](JSON[_0x9dab71(0x18f)]({'type':_0x9dab71(0x1bd),'data':{'chatId':_0x4a8b75}})),_0x4e68f3=!![]);const _0x17c0fc=_0x4dd990[_0x9dab71(0x1c9)];if(_0x9dab71(0x1d9)in _0x17c0fc)console['log'](JSON[_0x9dab71(0x18f)]({'type':_0x9dab71(0x1d9),'data':{'content':_0x17c0fc[_0x9dab71(0x1d9)]}}));else{if(_0x9dab71(0x1cc)in _0x17c0fc){const _0x3c9a49=_0x17c0fc[_0x9dab71(0x1cc)];console[_0x9dab71(0x1b5)](JSON['stringify']({'type':_0x9dab71(0x1cc),'data':{'id':_0x3c9a49['id'],'name':_0x3c9a49['functionName'],'target':_0x3c9a49['targetKnowledgeBase']?.['name']||_0x3c9a49[_0x9dab71(0x1ab)]?.[_0x9dab71(0x1a1)]||_0x3c9a49[_0x9dab71(0x1ba)]?.[_0x9dab71(0x1a1)]||_0x3c9a49[_0x9dab71(0x19c)]}}));}else{if(_0x9dab71(0x19b)in _0x17c0fc)console[_0x9dab71(0x1b5)](JSON['stringify']({'type':'tool_result','data':{'id':_0x17c0fc[_0x9dab71(0x19b)]['id'],'name':_0x17c0fc[_0x9dab71(0x19b)][_0x9dab71(0x18e)],'result':typeof _0x17c0fc[_0x9dab71(0x19b)][_0x9dab71(0x1d9)]===_0x9dab71(0x1ad)?_0x17c0fc[_0x9dab71(0x19b)][_0x9dab71(0x1d9)][_0x9dab71(0x1c7)](0x0,0x1f4):''}}));else _0x9dab71(0x1af)in _0x17c0fc&&console['log'](JSON[_0x9dab71(0x18f)]({'type':_0x9dab71(0x1af),'data':{'error':_0x17c0fc['error']}}));}}}}}console[_0x9dab71(0x1b5)](JSON[_0x9dab71(0x18f)]({'type':_0x9dab71(0x18d)}));}async['execute'](_0x5c2564){const _0x3b6f96=a8_0x3df821,{options:_0x542061,args:_0x15b944,tdx:_0x4b6f94}=_0x5c2564,_0x4ad207=_0x15b944[_0x3b6f96(0x1c8)]('\x20'),_0x1661b0=_0x542061,_0x20ecca=_0x1661b0[_0x3b6f96(0x1c4)],_0xb78ff7=_0x1661b0[_0x3b6f96(0x1b6)],_0x52047c=_0x1661b0[_0x3b6f96(0x1c2)],_0x593871=_0x1661b0[_0x3b6f96(0x1a8)],_0x4e892a=_0x1661b0[_0x3b6f96(0x190)],_0xd4d2b=_0x1661b0[_0x3b6f96(0x1b3)];if(_0x593871&&_0x4e892a)return console['error'](_0x3b6f96(0x1b7)),0x1;try{let _0x8cb137,_0x3db936;if(_0x4e892a)_0x3db936=_0x4e892a;else!_0x593871&&(_0x3db936=loadLastChatId(),_0x3db936&&_0x542061['verbose']&&console[_0x3b6f96(0x1af)](_0x3b6f96(0x1bc)+_0x3db936));!_0x4e892a&&(_0x593871||!_0x3db936)&&(_0x8cb137=await resolveAgentId(_0x4b6f94,_0x20ecca,_0xb78ff7,_0x52047c,_0x542061['verbose']));const _0x416ac5=_0xd4d2b?(_0x20eee0,_0xc32365,_0x293d3c)=>this[_0x3b6f96(0x1ce)](_0x4b6f94,_0x20eee0,_0xc32365,_0x293d3c):(_0x2fddb8,_0x5a1478,_0x578318)=>this[_0x3b6f96(0x1d7)](_0x4b6f94,_0x2fddb8,_0x5a1478,_0x578318,_0x542061['verbose']);try{await _0x416ac5(_0x4ad207,_0x8cb137,_0x3db936);}catch(_0x594a69){const _0xa63c43=_0x594a69 instanceof SDKError&&_0x594a69['code']===ErrorCode[_0x3b6f96(0x1cb)]||_0x594a69 instanceof Error&&_0x594a69[_0x3b6f96(0x1a4)][_0x3b6f96(0x1b4)]('404');if(_0xa63c43&&_0x4e892a)return console[_0x3b6f96(0x1af)]('Error:\x20Chat\x20session\x20\x27'+_0x4e892a+'\x27\x20not\x20found'),0x1;if(_0xa63c43)_0x542061[_0x3b6f96(0x18c)]&&console[_0x3b6f96(0x1af)](_0x3b6f96(0x191)),!_0x8cb137&&(_0x8cb137=await resolveAgentId(_0x4b6f94,_0x20ecca,_0xb78ff7,_0x52047c,_0x542061['verbose'])),await _0x416ac5(_0x4ad207,_0x8cb137,undefined);else throw _0x594a69;}return!_0xd4d2b&&console['log'](),0x0;}catch(_0x4caa99){return console[_0x3b6f96(0x1af)](),handleSDKError(_0x4caa99,_0x542061),0x1;}}['handleChatEvent'](_0x19f936){const _0x427c04=a8_0x3df821;if('content'in _0x19f936)process['stdout'][_0x427c04(0x198)](_0x19f936['content']);else _0x427c04(0x1af)in _0x19f936&&console[_0x427c04(0x1af)](_0x427c04(0x195)+_0x19f936['error']);}}export class ChatCreateCommand extends BaseCommand{[a8_0x3df821(0x1a1)]=a8_0x3df821(0x1d0);[a8_0x3df821(0x1be)]=a8_0x3df821(0x1cd);[a8_0x3df821(0x1d3)](_0x3d341a){const _0x5549b4=a8_0x3df821,_0x515e9a=_0x3d341a['options'],_0x4e0940=_0x515e9a['agent'],_0x597d2e=_0x515e9a['llmAgent'];if(!_0x4e0940&&!_0x597d2e)return _0x5549b4(0x1a0);return undefined;}async[a8_0x3df821(0x1d4)](_0x591213){const _0x3dffb0=a8_0x3df821,{options:_0x4a28a3,tdx:_0x174adb}=_0x591213,_0x14d955=_0x4a28a3,_0x4f3052=_0x14d955['agent'],_0x4146e8=_0x14d955[_0x3dffb0(0x1b6)],_0x59c940=_0x14d955[_0x3dffb0(0x1c2)];try{const _0x591626=await resolveAgentId(_0x174adb,_0x4f3052,_0x4146e8,_0x59c940,_0x4a28a3['verbose']),_0x420138=await _0x174adb['llm'][_0x3dffb0(0x1ac)](_0x591626);return saveLastChatId(_0x420138['id']),console[_0x3dffb0(0x1b5)](JSON[_0x3dffb0(0x18f)]({'chatId':_0x420138['id'],'agentId':_0x591626})),0x0;}catch(_0x2f2b83){return handleSDKError(_0x2f2b83,_0x4a28a3),0x1;}}}
|