@treasuredata/tdx 2026.3.3 → 2026.3.5
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/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/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/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a3_0x1a7a0f=a3_0x393d;(function(_0x428bde,_0x413ecd){const _0x14be65=a3_0x393d,_0x5a1e50=_0x428bde();while(!![]){try{const _0x1eec72=-parseInt(_0x14be65(0x1c4))/0x1*(-parseInt(_0x14be65(0x1d5))/0x2)+-parseInt(_0x14be65(0x1d8))/0x3+-parseInt(_0x14be65(0x1d4))/0x4+parseInt(_0x14be65(0x1de))/0x5*(-parseInt(_0x14be65(0x1c6))/0x6)+-parseInt(_0x14be65(0x1cd))/0x7*(-parseInt(_0x14be65(0x1dd))/0x8)+-parseInt(_0x14be65(0x1c3))/0x9+parseInt(_0x14be65(0x1cb))/0xa;if(_0x1eec72===_0x413ecd)break;else _0x5a1e50['push'](_0x5a1e50['shift']());}catch(_0xda1291){_0x5a1e50['push'](_0x5a1e50['shift']());}}}(a3_0x11e3,0xdc5e7));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x393d(_0x23ea30,_0xbcdbc4){_0x23ea30=_0x23ea30-0x1c3;const _0x11e302=a3_0x11e3();let _0x393d67=_0x11e302[_0x23ea30];return _0x393d67;}import{withSpinner}from'../utils/spinner.js';function a3_0x11e3(){const _0x2c64ef=['Resolved\x20parent\x20ID:\x20','listActivations','13790223OLpYpK','1gWkVMg','Resolved\x20child\x20ID:\x20','366BUrnYu','Resolving\x20child\x20segment\x20\x27','verbose','Error:\x20','segment','39610650kICrqT','✔\x20Found\x20','7gyWDlD','Listing\x20activations\x20for\x20segment\x20\x27','cause','resolveParentId','description','Resolving\x20parent\x20segment\x20\x27','data','4697312SPYSoF','185602KnvxwH','execute','name','2089062XHfayV','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','\x20activation','Child\x20name:\x20','activations','9024648oLSFjg','71835bocQnR','\x27...','error','\x20\x20Cause:\x20','resolveSegmentId','message','length'];a3_0x11e3=function(){return _0x2c64ef;};return a3_0x11e3();}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x1a7a0f(0x1d7)]=a3_0x1a7a0f(0x1dc);[a3_0x1a7a0f(0x1d1)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x1a7a0f(0x1d6)](_0x3ef615){const _0x153be3=a3_0x1a7a0f,{options:_0x1aae67,args:_0x4a6a53,tdx:_0x5416b0}=_0x3ef615;if(_0x4a6a53[_0x153be3(0x1e4)]===0x0)return console[_0x153be3(0x1e0)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x153be3(0x1e0)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x19f2f0,childId:_0x3c1996}=parseSegmentRef(_0x4a6a53[0x0]);if(!_0x3c1996)return console['error'](_0x153be3(0x1d9)),console[_0x153be3(0x1e0)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x1aae67[_0x153be3(0x1c8)]&&(console[_0x153be3(0x1e0)]('Site:\x20'+_0x1aae67['site']),console['error']('Parent\x20name:\x20'+_0x19f2f0),console[_0x153be3(0x1e0)](_0x153be3(0x1db)+_0x3c1996));const _0x3dd73e=await withSpinner(_0x153be3(0x1d2)+_0x19f2f0+_0x153be3(0x1df),()=>_0x5416b0[_0x153be3(0x1ca)][_0x153be3(0x1d0)](_0x19f2f0),{'verbose':_0x1aae67[_0x153be3(0x1c8)]}),_0x24ea85=_0x3dd73e['data'];_0x1aae67['verbose']&&console[_0x153be3(0x1e0)](_0x153be3(0x1e5)+_0x24ea85);const _0x4759d5=await withSpinner(_0x153be3(0x1c7)+_0x3c1996+_0x153be3(0x1df),()=>_0x5416b0[_0x153be3(0x1ca)][_0x153be3(0x1e2)](_0x24ea85,_0x3c1996),{'verbose':_0x1aae67[_0x153be3(0x1c8)]}),_0x3a8205=_0x4759d5['data'];_0x1aae67[_0x153be3(0x1c8)]&&console['error'](_0x153be3(0x1c5)+_0x3a8205);const _0x351206=await withSpinner(_0x153be3(0x1ce)+_0x3c1996+_0x153be3(0x1df),()=>_0x5416b0[_0x153be3(0x1ca)][_0x153be3(0x1e6)](_0x24ea85,_0x3a8205),{'verbose':_0x1aae67[_0x153be3(0x1c8)]}),_0x3fc32c=_0x351206[_0x153be3(0x1d3)];return console['error'](_0x153be3(0x1cc)+_0x3fc32c['length']+_0x153be3(0x1da)+(_0x3fc32c[_0x153be3(0x1e4)]!==0x1?'s':'')),await handleSDKOutput(_0x3fc32c,_0x1aae67),0x0;}catch(_0x55b672){if(_0x55b672 instanceof SDKError)return console[_0x153be3(0x1e0)](_0x153be3(0x1c9)+_0x55b672[_0x153be3(0x1e3)]),_0x55b672[_0x153be3(0x1cf)]&&console[_0x153be3(0x1e0)](_0x153be3(0x1e1)+_0x55b672[_0x153be3(0x1cf)]),0x1;throw _0x55b672;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x1cb4eb=a4_0x442c;(function(_0x51c0db,_0x2ca608){const _0x149dc6=a4_0x442c,_0xe43b9=_0x51c0db();while(!![]){try{const _0x22c4c2=-parseInt(_0x149dc6(0x285))/0x1+parseInt(_0x149dc6(0x21e))/0x2+parseInt(_0x149dc6(0x1f7))/0x3*(-parseInt(_0x149dc6(0x229))/0x4)+-parseInt(_0x149dc6(0x25e))/0x5+parseInt(_0x149dc6(0x275))/0x6*(-parseInt(_0x149dc6(0x1e9))/0x7)+-parseInt(_0x149dc6(0x266))/0x8*(-parseInt(_0x149dc6(0x202))/0x9)+parseInt(_0x149dc6(0x24e))/0xa;if(_0x22c4c2===_0x2ca608)break;else _0xe43b9['push'](_0xe43b9['shift']());}catch(_0x24f31a){_0xe43b9['push'](_0xe43b9['shift']());}}}(a4_0x5f45,0xe8f64));import a4_0x4e523b from'chalk';import a4_0x51e605 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x5f45(){const _0x230a03=['33147140JBCEUW','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Source:\x20','integrations','\x20\x20Prompt\x20\x22','dryRun','agent:pull','\x0aErrors\x20found:','found','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)','context','green','\x20\x20Knowledge\x20Bases:\x20','errors','profile','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','4679755xLSwli','prompts','newProjectName','\x0aProject\x20pushed\x20with\x20errors','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20\x20tdx\x20agent\x20clone\x20agents/','Analyzing\x20changes\x20to\x20push...','New\x20project:\x20','122968bghZct','\x20=\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\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','Dry\x20run\x20-\x20no\x20files\x20written','\x0aPull\x20summary\x20for\x20\x27','yellow','llmProject','New\x20project\x20ID:\x20','\x20|\x20','projectId','Would\x20push\x20agent:\x20','agents','textKnowledgeBases','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','30whbkYH','\x20--name\x20','Agent:\x20','tdx.json','source','cyan','Status:\x20','reason','\x20resources?','outputDir','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x0aChanges\x20to\x20agent\x20\x27','dirname','\x20new','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Output\x20path:\x20','509471OegOYh','\x20created','llm_project','New\x20project\x20name\x20is\x20required','Source:\x20','MISSING_ARGUMENT','red','-\x20nothing\x20pushed','\x22\x20from\x20project\x20\x22','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','-\x20no\x20files\x20written','push','\x20--profile\x20','\x20total','\x20\x20Integration\x20\x22','Project:\x20','\x20\x20Target:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','repeat','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','cwd','pullAgent','llm','\x27\x20to\x20create\x20the\x20folder\x20structure.','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20updated','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','sourceProjectName','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\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','\x20\x20Agents:\x20','Cloning\x20\x22','\x20files?','2456881NxUmNx','gray','description','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','no_context','cloneProject','name','\x20changed','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Using\x20project:\x20','\x22\x20to\x20a\x20different\x20profile','Agent\x20','experimentalKnowledgeBases','✔\x20Context\x20set:\x20','318585nWZVeM','\x22\x20to\x20new\x20project\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','error','total','projectDir','<new-name>','message','pullProject','Using\x20local\x20project:\x20','\x20\x20Prompts:\x20','981pfBvmu','Analyzing\x20project\x20\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Text\x20Knowledge\x20Bases:\x20','diff','projectName','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Would\x20pull\x20agent:\x20','unchanged','updated','parse','Failed\x20to\x20push\x20agent:\x20','force','Writing\x20files...','counts','\x20files\x20to\x20','cwd-config','pushProject','\x0aPush\x20','pushAgent','agent.yml','execute','action','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20errors','Pushing\x20agent\x20from\x20\x22','\x20resources\x20to\x20\x27','Using\x20project\x20from\x20context:\x20','1089862qTDSOX','agentName','utf-8','No\x20tdx.json\x20found\x20in\x20','agentId','isNew','no_local_folder','Dry\x20run\x20-\x20no\x20changes\x20made','new','\x20\x20Text\x20Knowledge\x20Base\x20\x22','outputPath','52HQeRDu','Output:\x20','\x20successfully','experimentalArtifacts','agent:clone','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x22...','dim','\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)','session','\x0aChanges\x20to\x20prompt\x20\x27','Pushing\x20to\x20project...','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','site','newProjectId','log','\x20\x20Integrations:\x20','\x20unchanged','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20tdx\x20agent\x20pull\x20','INVALID_ARGUMENT','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x22:\x20','join','yes','\x20\x20Agent\x20\x22','\x20\x20Knowledge\x20Base\x20\x22','Cancelled','\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','Clone\x20\x22','\x0a✔\x20Pushed\x20','agent:push','created','knowledgeBases','Errors:','arg-dir','hasChanges'];a4_0x5f45=function(){return _0x230a03;};return a4_0x5f45();}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(_0x4e8b01){const _0x46e5b9=a4_0x442c,_0x294bc1=[];if(_0x4e8b01[_0x46e5b9(0x1fb)]!==undefined)_0x294bc1['push'](_0x4e8b01['total']+_0x46e5b9(0x293));if(_0x4e8b01[_0x46e5b9(0x226)]!==undefined&&_0x4e8b01[_0x46e5b9(0x226)]>0x0)_0x294bc1[_0x46e5b9(0x291)](a4_0x4e523b[_0x46e5b9(0x259)](_0x4e8b01[_0x46e5b9(0x226)]+_0x46e5b9(0x282)));if(_0x4e8b01[_0x46e5b9(0x249)]!==undefined&&_0x4e8b01[_0x46e5b9(0x249)]>0x0)_0x294bc1[_0x46e5b9(0x291)](a4_0x4e523b[_0x46e5b9(0x259)](_0x4e8b01['created']+_0x46e5b9(0x286)));if(_0x4e8b01[_0x46e5b9(0x20b)]!==undefined&&_0x4e8b01['updated']>0x0)_0x294bc1[_0x46e5b9(0x291)](a4_0x4e523b[_0x46e5b9(0x26c)](_0x4e8b01[_0x46e5b9(0x20b)]+_0x46e5b9(0x2a0)));if(_0x4e8b01[_0x46e5b9(0x20a)]!==undefined&&_0x4e8b01[_0x46e5b9(0x20a)]>0x0)_0x294bc1['push'](a4_0x4e523b[_0x46e5b9(0x1ea)](_0x4e8b01[_0x46e5b9(0x20a)]+'\x20unchanged'));if(_0x4e8b01[_0x46e5b9(0x25b)]!==undefined&&_0x4e8b01[_0x46e5b9(0x25b)]>0x0)_0x294bc1[_0x46e5b9(0x291)](a4_0x4e523b['red'](_0x4e8b01['errors']+_0x46e5b9(0x21a)));return _0x294bc1[_0x46e5b9(0x240)](',\x20');}function displayDiffs(_0x4ab882,_0x4012b2,_0x1b257e,_0x2bc55f,_0xcadf0f,_0x459aab,_0x5730a7){const _0x4e13a1=a4_0x442c;for(const _0x116007 of _0x4ab882){if(_0x116007['diff']){const _0x5a92b3=_0x116007[_0x4e13a1(0x21f)]||_0x116007[_0x4e13a1(0x1ef)];console[_0x4e13a1(0x238)](_0x4e13a1(0x280)+_0x5a92b3+'\x27:'),console[_0x4e13a1(0x238)]('─'[_0x4e13a1(0x299)](0x3c)),console[_0x4e13a1(0x238)](_0x116007[_0x4e13a1(0x206)]),console[_0x4e13a1(0x238)]('─'[_0x4e13a1(0x299)](0x3c));}}for(const _0x3f045c of _0x4012b2){_0x3f045c['diff']&&(console[_0x4e13a1(0x238)](_0x4e13a1(0x29a)+_0x3f045c['name']+'\x27:'),console[_0x4e13a1(0x238)]('─'[_0x4e13a1(0x299)](0x3c)),console[_0x4e13a1(0x238)](_0x3f045c['diff']),console[_0x4e13a1(0x238)]('─'[_0x4e13a1(0x299)](0x3c)));}for(const _0x20dff5 of _0x1b257e){_0x20dff5[_0x4e13a1(0x206)]&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x20dff5['name']+'\x27:'),console[_0x4e13a1(0x238)]('─'[_0x4e13a1(0x299)](0x3c)),console[_0x4e13a1(0x238)](_0x20dff5[_0x4e13a1(0x206)]),console[_0x4e13a1(0x238)]('─'['repeat'](0x3c)));}for(const _0x58023e of _0x2bc55f){_0x58023e[_0x4e13a1(0x206)]&&(console['log'](_0x4e13a1(0x233)+_0x58023e[_0x4e13a1(0x1ef)]+'\x27:'),console[_0x4e13a1(0x238)]('─'[_0x4e13a1(0x299)](0x3c)),console[_0x4e13a1(0x238)](_0x58023e['diff']),console[_0x4e13a1(0x238)]('─'[_0x4e13a1(0x299)](0x3c)));}for(const _0x4cb9a0 of _0xcadf0f){_0x4cb9a0['diff']&&(console[_0x4e13a1(0x238)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x4cb9a0[_0x4e13a1(0x1ef)]+'\x27:'),console[_0x4e13a1(0x238)]('─'[_0x4e13a1(0x299)](0x3c)),console[_0x4e13a1(0x238)](_0x4cb9a0[_0x4e13a1(0x206)]),console[_0x4e13a1(0x238)]('─'[_0x4e13a1(0x299)](0x3c)));}for(const _0x33f359 of _0x459aab){_0x33f359['diff']&&(console[_0x4e13a1(0x238)](_0x4e13a1(0x23b)+_0x33f359[_0x4e13a1(0x1ef)]+'\x27:'),console[_0x4e13a1(0x238)]('─'['repeat'](0x3c)),console[_0x4e13a1(0x238)](_0x33f359[_0x4e13a1(0x206)]),console[_0x4e13a1(0x238)]('─'[_0x4e13a1(0x299)](0x3c)));}for(const _0x1fcf5d of _0x5730a7){_0x1fcf5d[_0x4e13a1(0x206)]&&(console['log'](_0x4e13a1(0x283)+_0x1fcf5d[_0x4e13a1(0x1ef)]+'\x27:'),console[_0x4e13a1(0x238)]('─'['repeat'](0x3c)),console[_0x4e13a1(0x238)](_0x1fcf5d[_0x4e13a1(0x206)]),console[_0x4e13a1(0x238)]('─'[_0x4e13a1(0x299)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x1cb4eb(0x254);[a4_0x1cb4eb(0x1eb)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x1cb4eb(0x217)](_0x1e65b6){const _0x24cf21=a4_0x1cb4eb,{options:_0x5e08a2,args:_0x1638c2,tdx:_0x57615e}=_0x1e65b6,_0x61f00e=_0x1638c2[0x0],_0x10d4a0=_0x1638c2[0x1],_0x11fac6=_0x5e08a2['output'],_0x40db5a=_0x5e08a2[_0x24cf21(0x253)],_0x8631ff=_0x5e08a2['force'],_0x510cdf=_0x5e08a2[_0x24cf21(0x241)],_0x250960=_0x5e08a2[_0x24cf21(0x26d)],_0x41c6ed=_0x5e08a2['agent'];let _0x4fb220;if(_0x61f00e){const _0x264618=a4_0x51e605[_0x24cf21(0x240)](_0x61f00e,'tdx.json');if(existsSync(_0x264618))try{const _0x2a645a=JSON[_0x24cf21(0x20c)](readFileSync(_0x264618,_0x24cf21(0x220)));_0x2a645a['llm_project']&&(_0x4fb220={'llm_project':_0x2a645a[_0x24cf21(0x287)]});}catch{}}const _0x415408=findAgentConfigPath(process['cwd']());let _0x5e3365;if(_0x415408)try{const _0x50413a=JSON[_0x24cf21(0x20c)](readFileSync(_0x415408,'utf-8'));_0x50413a['llm_project']&&(_0x5e3365={'llm_project':_0x50413a[_0x24cf21(0x287)]});}catch{}const _0x4cb4e1=resolveAgentPullArgs({'arg':_0x61f00e,'agentNameArg':_0x10d4a0,'agentFlag':_0x41c6ed,'contextProject':_0x250960,'argDirConfig':_0x4fb220,'cwdConfigPath':_0x415408||undefined,'cwdConfig':_0x5e3365}),{projectNameOrId:_0xc8cec0,targetAgentName:_0x528326,existingOutputDir:_0x204c5a,source:_0x39e029}=_0x4cb4e1;if(_0x39e029===_0x24cf21(0x24c))console[_0x24cf21(0x238)](a4_0x4e523b[_0x24cf21(0x230)]('Using\x20project\x20from\x20'+a4_0x51e605['join'](_0x61f00e,_0x24cf21(0x278))+':\x20'+_0xc8cec0));else{if(_0x39e029===_0x24cf21(0x212))console[_0x24cf21(0x238)](a4_0x4e523b['dim'](_0x24cf21(0x1f2)+_0xc8cec0));else _0x39e029===_0x24cf21(0x258)&&console['log'](a4_0x4e523b[_0x24cf21(0x230)](_0x24cf21(0x21d)+_0xc8cec0));}if(!_0xc8cec0)return _0x41c6ed?(console[_0x24cf21(0x238)](a4_0x4e523b['yellow'](_0x24cf21(0x28e))),console[_0x24cf21(0x238)](_0x24cf21(0x29f)),console[_0x24cf21(0x238)](_0x24cf21(0x2a3))):(console['log'](a4_0x4e523b['yellow'](_0x24cf21(0x268))),console[_0x24cf21(0x238)](_0x24cf21(0x257)),console[_0x24cf21(0x238)](_0x24cf21(0x245)),console[_0x24cf21(0x238)](_0x24cf21(0x235)),console[_0x24cf21(0x238)](_0x24cf21(0x269)),console[_0x24cf21(0x238)](_0x24cf21(0x2a4))),0x1;if(_0x528326){const {data:_0x3162ba}=await withSpinner('Pulling\x20agent\x20\x22'+_0x528326+_0x24cf21(0x28d)+_0xc8cec0+_0x24cf21(0x22f),()=>_0x57615e[_0x24cf21(0x29d)][_0x24cf21(0x29c)](_0xc8cec0,_0x528326,_0x11fac6,{'dryRun':_0x40db5a,'force':_0x8631ff}));if(_0x40db5a)return console[_0x24cf21(0x238)](a4_0x4e523b['yellow'](_0x24cf21(0x26a))),console[_0x24cf21(0x238)](_0x24cf21(0x209)+_0x3162ba['agentName']),console[_0x24cf21(0x238)](_0x24cf21(0x284)+_0x3162ba[_0x24cf21(0x228)]),_0x3162ba[_0x24cf21(0x206)]&&(console[_0x24cf21(0x238)]('\x0aChanges:'),console[_0x24cf21(0x238)]('─'[_0x24cf21(0x299)](0x3c)),console[_0x24cf21(0x238)](_0x3162ba[_0x24cf21(0x206)]),console[_0x24cf21(0x238)]('─'[_0x24cf21(0x299)](0x3c))),0x0;return console[_0x24cf21(0x238)](a4_0x4e523b[_0x24cf21(0x259)]('Agent\x20pulled\x20successfully')),console['log'](_0x24cf21(0x277)+_0x3162ba[_0x24cf21(0x21f)]),console['log'](_0x24cf21(0x22a)+_0x3162ba[_0x24cf21(0x228)]),console[_0x24cf21(0x238)](_0x24cf21(0x27b)+(_0x3162ba[_0x24cf21(0x223)]?a4_0x4e523b[_0x24cf21(0x259)](_0x24cf21(0x226)):_0x3162ba[_0x24cf21(0x24d)]?a4_0x4e523b[_0x24cf21(0x26c)](_0x24cf21(0x20b)):a4_0x4e523b[_0x24cf21(0x1ea)](_0x24cf21(0x20a)))),0x0;}const _0x3e0d70=_0x204c5a||_0x11fac6,{data:_0x420d40}=await withSpinner(_0x24cf21(0x203)+_0xc8cec0+_0x24cf21(0x22f),()=>_0x57615e[_0x24cf21(0x29d)]['pullProject'](_0xc8cec0,_0x3e0d70,{'dryRun':!![]})),_0x54dda4=_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x272)][_0x24cf21(0x226)]+_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x24a)][_0x24cf21(0x226)]+_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x273)][_0x24cf21(0x226)]+_0x420d40['counts'][_0x24cf21(0x25f)]['new']+_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x251)]['new']+_0x420d40['counts']['experimentalKnowledgeBases'][_0x24cf21(0x226)]+_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x22c)]['new'],_0x2766f3=_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x272)]['updated']+_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x24a)]['updated']+_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x273)][_0x24cf21(0x20b)]+_0x420d40['counts'][_0x24cf21(0x25f)][_0x24cf21(0x20b)]+_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x251)][_0x24cf21(0x20b)]+_0x420d40[_0x24cf21(0x210)]['experimentalKnowledgeBases'][_0x24cf21(0x20b)]+_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x22c)]['updated'],_0x44400f=_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x272)]['unchanged']+_0x420d40['counts'][_0x24cf21(0x24a)][_0x24cf21(0x20a)]+_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x273)]['unchanged']+_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x25f)][_0x24cf21(0x20a)]+_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x251)][_0x24cf21(0x20a)]+_0x420d40['counts'][_0x24cf21(0x1f5)][_0x24cf21(0x20a)]+_0x420d40['counts'][_0x24cf21(0x22c)][_0x24cf21(0x20a)];console[_0x24cf21(0x238)](_0x24cf21(0x26b)+_0x420d40[_0x24cf21(0x207)]+'\x27:'),console[_0x24cf21(0x238)]('\x20\x20'+a4_0x4e523b['green']('+\x20'+_0x54dda4+_0x24cf21(0x282))+_0x24cf21(0x26f)+a4_0x4e523b[_0x24cf21(0x26c)]('~\x20'+_0x2766f3+_0x24cf21(0x1f0))+_0x24cf21(0x26f)+a4_0x4e523b[_0x24cf21(0x230)]('=\x20'+_0x44400f+_0x24cf21(0x23a))),console['log'](_0x24cf21(0x1e6)+formatCountSummary(_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x272)])),console[_0x24cf21(0x238)](_0x24cf21(0x25a)+formatCountSummary(_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x24a)])),console['log'](_0x24cf21(0x205)+formatCountSummary(_0x420d40[_0x24cf21(0x210)]['textKnowledgeBases'])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x25f)])),console['log'](_0x24cf21(0x239)+formatCountSummary(_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x251)]));const _0x45bb33=_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x1f5)][_0x24cf21(0x1fb)]>0x0||_0x420d40[_0x24cf21(0x210)]['experimentalArtifacts'][_0x24cf21(0x1fb)]>0x0;_0x45bb33&&(console[_0x24cf21(0x238)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x420d40['counts'][_0x24cf21(0x1f5)])),console[_0x24cf21(0x238)](_0x24cf21(0x24f)+formatCountSummary(_0x420d40[_0x24cf21(0x210)][_0x24cf21(0x22c)])));console['log'](_0x24cf21(0x296)+a4_0x4e523b[_0x24cf21(0x27a)](_0x420d40[_0x24cf21(0x27e)])),displayDiffs(_0x420d40['agents'],_0x420d40[_0x24cf21(0x24a)],_0x420d40[_0x24cf21(0x273)],_0x420d40[_0x24cf21(0x25f)],_0x420d40[_0x24cf21(0x251)],_0x420d40[_0x24cf21(0x1f5)],_0x420d40['experimentalArtifacts']);if(_0x40db5a)return console[_0x24cf21(0x238)](a4_0x4e523b['yellow'](_0x24cf21(0x25d))),0x0;if(_0x54dda4===0x0&&_0x2766f3===0x0)return console['log'](a4_0x4e523b['green']('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x420d40[_0x24cf21(0x207)]},_0x5e08a2[_0x24cf21(0x232)]),console[_0x24cf21(0x238)](a4_0x4e523b[_0x24cf21(0x259)](_0x24cf21(0x1f6)+a4_0x4e523b[_0x24cf21(0x230)](_0x24cf21(0x287))+_0x24cf21(0x267)+a4_0x4e523b[_0x24cf21(0x27a)](_0x420d40[_0x24cf21(0x207)]))),0x0;if(!_0x510cdf&&!_0x8631ff){if(!isInteractive())return console[_0x24cf21(0x1fa)](a4_0x4e523b[_0x24cf21(0x28b)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x24cf21(0x1fa)](a4_0x4e523b[_0x24cf21(0x230)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x44a42f=await confirmKey('\x0aWrite\x20'+(_0x54dda4+_0x2766f3)+_0x24cf21(0x1e8));if(!_0x44a42f)return console[_0x24cf21(0x238)](a4_0x4e523b['yellow']('Cancelled'),_0x24cf21(0x290)),0x1;}const {data:_0x3d635b}=await withSpinner(_0x24cf21(0x20f),()=>_0x57615e[_0x24cf21(0x29d)][_0x24cf21(0x1ff)](_0xc8cec0,_0x3e0d70,{'force':_0x8631ff}));return console[_0x24cf21(0x238)](a4_0x4e523b['green']('\x0a✔\x20Pulled\x20'+(_0x54dda4+_0x2766f3)+_0x24cf21(0x211)+_0x3d635b[_0x24cf21(0x27e)])),saveSessionContext({'llm_project':_0x3d635b[_0x24cf21(0x207)]},_0x5e08a2[_0x24cf21(0x232)]),console[_0x24cf21(0x238)](a4_0x4e523b[_0x24cf21(0x259)](_0x24cf21(0x1f6)+a4_0x4e523b[_0x24cf21(0x230)](_0x24cf21(0x287))+_0x24cf21(0x267)+a4_0x4e523b[_0x24cf21(0x27a)](_0x3d635b[_0x24cf21(0x207)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x1cb4eb(0x1ef)]=a4_0x1cb4eb(0x22d);[a4_0x1cb4eb(0x1eb)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x1cb4eb(0x217)](_0x5b9c2f){const _0x5b5ecc=a4_0x1cb4eb,{options:_0x4de410,args:_0x39fbc4,tdx:_0x19b05b}=_0x5b9c2f,_0x4f448f=_0x39fbc4[0x0],_0x41eb42=_0x4de410[_0x5b5ecc(0x1ef)],_0x36731c=_0x4de410[_0x5b5ecc(0x253)],_0x45a62b=_0x4de410[_0x5b5ecc(0x241)],_0x1eafe9=_0x4de410[_0x5b5ecc(0x236)],_0x158820=_0x4de410[_0x5b5ecc(0x26d)];let _0x301593;const _0x134c22=findAgentConfigPath(process['cwd']());if(_0x4f448f){const _0x5eb63c=a4_0x51e605['join'](_0x4f448f,'tdx.json');existsSync(_0x5eb63c)?(_0x301593=_0x4f448f,console[_0x5b5ecc(0x238)](a4_0x4e523b[_0x5b5ecc(0x230)](_0x5b5ecc(0x200)+_0x4f448f))):_0x301593=_0x4f448f;}else{if(_0x134c22)_0x301593=a4_0x51e605[_0x5b5ecc(0x281)](_0x134c22),console[_0x5b5ecc(0x238)](a4_0x4e523b[_0x5b5ecc(0x230)]('Using\x20current\x20project:\x20'+_0x301593));else{if(_0x158820){const _0x4158d9=sanitizeForFilesystem(_0x158820);let _0x31860f=_0x4158d9,_0x16b699=a4_0x51e605['join'](process[_0x5b5ecc(0x29b)](),_0x5b5ecc(0x272),_0x4158d9,_0x5b5ecc(0x278));if(!existsSync(_0x16b699)){const _0x291271=normalizeName(_0x158820),_0x34d812=a4_0x51e605[_0x5b5ecc(0x240)](process['cwd'](),_0x5b5ecc(0x272),_0x291271,_0x5b5ecc(0x278));existsSync(_0x34d812)&&(_0x31860f=_0x291271,_0x16b699=_0x34d812);}if(existsSync(_0x16b699))_0x301593=a4_0x51e605[_0x5b5ecc(0x281)](_0x16b699),console['log'](a4_0x4e523b[_0x5b5ecc(0x230)](_0x5b5ecc(0x200)+_0x301593));else{const _0x3e06b2=_0x4de410[_0x5b5ecc(0x25c)];if(_0x3e06b2)throw new SDKError(ErrorCode[_0x5b5ecc(0x23d)],_0x5b5ecc(0x27f)+_0x158820+_0x5b5ecc(0x1f3),undefined,{'helpText':_0x5b5ecc(0x22e)+_0x5b5ecc(0x1f1)+(_0x5b5ecc(0x23c)+_0x158820+'\x0a')+(_0x5b5ecc(0x263)+_0x31860f+_0x5b5ecc(0x276)+(_0x41eb42||_0x5b5ecc(0x1fd))+_0x5b5ecc(0x292)+_0x3e06b2)});_0x301593=_0x158820,console[_0x5b5ecc(0x238)](a4_0x4e523b[_0x5b5ecc(0x230)]('Using\x20context\x20project:\x20'+_0x158820));}}}}if(!_0x301593)return console[_0x5b5ecc(0x238)](a4_0x4e523b[_0x5b5ecc(0x26c)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console['log'](_0x5b5ecc(0x1f9)),console[_0x5b5ecc(0x238)](_0x5b5ecc(0x28f)),console['log'](_0x5b5ecc(0x231)),console['log'](_0x5b5ecc(0x219)),0x1;if(!_0x41eb42)throw new SDKError(ErrorCode[_0x5b5ecc(0x28a)],_0x5b5ecc(0x288),undefined,{'helpText':_0x5b5ecc(0x262)});if(!_0x45a62b&&!_0x36731c){if(!isInteractive())return console[_0x5b5ecc(0x1fa)](a4_0x4e523b[_0x5b5ecc(0x28b)]('\x0aError:'),_0x5b5ecc(0x208)),console[_0x5b5ecc(0x1fa)](a4_0x4e523b[_0x5b5ecc(0x230)](_0x5b5ecc(0x204))),0x1;const _0x427ca3=await confirmKey(_0x5b5ecc(0x246)+_0x301593+_0x5b5ecc(0x1f8)+_0x41eb42+'\x22?');if(!_0x427ca3)return console['log'](a4_0x4e523b[_0x5b5ecc(0x26c)](_0x5b5ecc(0x244))),0x1;}const {data:_0x425b74}=await withSpinner(_0x5b5ecc(0x1e7)+_0x301593+'\x22\x20to\x20\x22'+_0x41eb42+_0x5b5ecc(0x22f),()=>_0x19b05b[_0x5b5ecc(0x29d)][_0x5b5ecc(0x1ee)](_0x301593,_0x41eb42,{'dryRun':_0x36731c}));if(_0x36731c){console[_0x5b5ecc(0x238)](a4_0x4e523b['yellow'](_0x5b5ecc(0x225))),console[_0x5b5ecc(0x238)]('Source:\x20'+_0x425b74[_0x5b5ecc(0x2a2)]),console[_0x5b5ecc(0x238)](_0x5b5ecc(0x265)+_0x41eb42),console[_0x5b5ecc(0x238)]('Would\x20clone:'),console[_0x5b5ecc(0x238)](_0x5b5ecc(0x1e6)+_0x425b74[_0x5b5ecc(0x210)][_0x5b5ecc(0x272)][_0x5b5ecc(0x249)]),console[_0x5b5ecc(0x238)](_0x5b5ecc(0x25a)+_0x425b74[_0x5b5ecc(0x210)][_0x5b5ecc(0x24a)][_0x5b5ecc(0x249)]),console['log']('\x20\x20Prompts:\x20'+_0x425b74[_0x5b5ecc(0x210)][_0x5b5ecc(0x25f)]['created']);const _0x299abe=_0x425b74['counts'][_0x5b5ecc(0x1f5)][_0x5b5ecc(0x249)]>0x0||_0x425b74['counts'][_0x5b5ecc(0x22c)][_0x5b5ecc(0x249)]>0x0;return _0x299abe&&(console[_0x5b5ecc(0x238)](_0x5b5ecc(0x2a1)+_0x425b74[_0x5b5ecc(0x210)][_0x5b5ecc(0x1f5)][_0x5b5ecc(0x249)]),console[_0x5b5ecc(0x238)](_0x5b5ecc(0x24f)+_0x425b74['counts']['experimentalArtifacts'][_0x5b5ecc(0x249)])),0x0;}const _0x5e198c=_0x425b74[_0x5b5ecc(0x210)][_0x5b5ecc(0x272)]['errors']>0x0||_0x425b74[_0x5b5ecc(0x210)][_0x5b5ecc(0x24a)][_0x5b5ecc(0x25b)]>0x0||_0x425b74[_0x5b5ecc(0x210)][_0x5b5ecc(0x25f)][_0x5b5ecc(0x25b)]>0x0||_0x425b74[_0x5b5ecc(0x210)]['experimentalKnowledgeBases'][_0x5b5ecc(0x25b)]>0x0||_0x425b74[_0x5b5ecc(0x210)][_0x5b5ecc(0x22c)][_0x5b5ecc(0x25b)]>0x0;_0x5e198c?console[_0x5b5ecc(0x238)](a4_0x4e523b[_0x5b5ecc(0x26c)]('Project\x20cloned\x20with\x20errors')):console[_0x5b5ecc(0x238)](a4_0x4e523b[_0x5b5ecc(0x259)]('Project\x20cloned\x20successfully'));console[_0x5b5ecc(0x238)](_0x5b5ecc(0x289)+_0x425b74[_0x5b5ecc(0x2a2)]),console[_0x5b5ecc(0x238)](_0x5b5ecc(0x265)+_0x425b74[_0x5b5ecc(0x260)]),console[_0x5b5ecc(0x238)](_0x5b5ecc(0x26e)+_0x425b74[_0x5b5ecc(0x237)]),console[_0x5b5ecc(0x238)](),console[_0x5b5ecc(0x238)]('Summary:'),console['log'](_0x5b5ecc(0x1e6)+formatCountSummary(_0x425b74['counts']['agents'])),console['log'](_0x5b5ecc(0x25a)+formatCountSummary(_0x425b74['counts'][_0x5b5ecc(0x24a)])),console['log'](_0x5b5ecc(0x201)+formatCountSummary(_0x425b74[_0x5b5ecc(0x210)][_0x5b5ecc(0x25f)])),console[_0x5b5ecc(0x238)](_0x5b5ecc(0x239)+formatCountSummary(_0x425b74['counts'][_0x5b5ecc(0x251)]));const _0x59776a=_0x425b74[_0x5b5ecc(0x210)][_0x5b5ecc(0x1f5)][_0x5b5ecc(0x249)]>0x0||_0x425b74[_0x5b5ecc(0x210)][_0x5b5ecc(0x1f5)]['updated']>0x0||_0x425b74[_0x5b5ecc(0x210)][_0x5b5ecc(0x1f5)][_0x5b5ecc(0x20a)]>0x0||_0x425b74[_0x5b5ecc(0x210)]['experimentalArtifacts'][_0x5b5ecc(0x249)]>0x0||_0x425b74['counts']['experimentalArtifacts']['updated']>0x0||_0x425b74[_0x5b5ecc(0x210)]['experimentalArtifacts'][_0x5b5ecc(0x20a)]>0x0;_0x59776a&&(console[_0x5b5ecc(0x238)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x425b74[_0x5b5ecc(0x210)][_0x5b5ecc(0x1f5)])),console[_0x5b5ecc(0x238)](_0x5b5ecc(0x24f)+formatCountSummary(_0x425b74['counts']['experimentalArtifacts'])));if(_0x5e198c){console[_0x5b5ecc(0x238)](),console[_0x5b5ecc(0x238)](a4_0x4e523b['red']('Errors:'));for(const _0x20435b of _0x425b74[_0x5b5ecc(0x272)]){_0x20435b[_0x5b5ecc(0x218)]===_0x5b5ecc(0x1fa)&&console['log'](a4_0x4e523b[_0x5b5ecc(0x28b)](_0x5b5ecc(0x242)+_0x20435b[_0x5b5ecc(0x21f)]+_0x5b5ecc(0x23f)+_0x20435b[_0x5b5ecc(0x1fa)]));}for(const _0x472599 of _0x425b74[_0x5b5ecc(0x24a)]){_0x472599['action']===_0x5b5ecc(0x1fa)&&console[_0x5b5ecc(0x238)](a4_0x4e523b[_0x5b5ecc(0x28b)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x472599[_0x5b5ecc(0x1ef)]+_0x5b5ecc(0x23f)+_0x472599['error']));}for(const _0x21f61b of _0x425b74[_0x5b5ecc(0x25f)]){_0x21f61b[_0x5b5ecc(0x218)]==='error'&&console['log'](a4_0x4e523b[_0x5b5ecc(0x28b)](_0x5b5ecc(0x252)+_0x21f61b['name']+_0x5b5ecc(0x23f)+_0x21f61b['error']));}for(const _0x4dd183 of _0x425b74[_0x5b5ecc(0x251)]){_0x4dd183[_0x5b5ecc(0x218)]===_0x5b5ecc(0x1fa)&&console['log'](a4_0x4e523b[_0x5b5ecc(0x28b)](_0x5b5ecc(0x294)+_0x4dd183['name']+_0x5b5ecc(0x23f)+_0x4dd183['error']));}for(const _0x5994af of _0x425b74[_0x5b5ecc(0x1f5)]){_0x5994af[_0x5b5ecc(0x218)]===_0x5b5ecc(0x1fa)&&console[_0x5b5ecc(0x238)](a4_0x4e523b[_0x5b5ecc(0x28b)](_0x5b5ecc(0x297)+_0x5994af[_0x5b5ecc(0x1ef)]+_0x5b5ecc(0x23f)+_0x5994af[_0x5b5ecc(0x1fa)]));}for(const _0x5aca00 of _0x425b74['experimentalArtifacts']){_0x5aca00['action']===_0x5b5ecc(0x1fa)&&console[_0x5b5ecc(0x238)](a4_0x4e523b[_0x5b5ecc(0x28b)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x5aca00[_0x5b5ecc(0x1ef)]+_0x5b5ecc(0x23f)+_0x5aca00[_0x5b5ecc(0x1fa)]));}return 0x1;}console[_0x5b5ecc(0x238)]();const _0x2d9e99=getLLMProjectUrl(_0x1eafe9,_0x425b74[_0x5b5ecc(0x237)]);return console['log'](_0x5b5ecc(0x295)+a4_0x4e523b['cyan'](_0x2d9e99)),0x0;}}function a4_0x442c(_0x53c5c8,_0x2a51d4){_0x53c5c8=_0x53c5c8-0x1e6;const _0x5f45c4=a4_0x5f45();let _0x442c87=_0x5f45c4[_0x53c5c8];return _0x442c87;}export class AgentPushCommand extends BaseCommand{['name']=a4_0x1cb4eb(0x248);[a4_0x1cb4eb(0x1eb)]=a4_0x1cb4eb(0x274);async[a4_0x1cb4eb(0x217)](_0x105f0e){const _0x87ff16=a4_0x1cb4eb,{options:_0xe594e3,args:_0x742232,tdx:_0x50bc1c}=_0x105f0e;let _0x5f4959=_0x742232[0x0]||process[_0x87ff16(0x29b)]();const _0x522039=_0xe594e3[_0x87ff16(0x253)],_0x59c616=_0xe594e3[_0x87ff16(0x20e)],_0x5ea48f=_0xe594e3[_0x87ff16(0x241)],_0x4c6d43=_0xe594e3[_0x87ff16(0x236)],_0x9c1458=a4_0x51e605[_0x87ff16(0x240)](_0x5f4959,_0x87ff16(0x216)),_0x3e0afe=existsSync(_0x9c1458);if(_0x3e0afe){const {data:_0x5a4195}=await withSpinner(_0x87ff16(0x21b)+_0x5f4959+_0x87ff16(0x22f),()=>_0x50bc1c[_0x87ff16(0x29d)][_0x87ff16(0x215)](_0x5f4959,{'dryRun':_0x522039,'force':_0x59c616}));if(_0x522039)return console['log'](a4_0x4e523b[_0x87ff16(0x26c)](_0x87ff16(0x225))),console[_0x87ff16(0x238)](_0x87ff16(0x271)+_0x5a4195[_0x87ff16(0x21f)]),0x0;if(_0x5a4195[_0x87ff16(0x218)]===_0x87ff16(0x1fa))return console[_0x87ff16(0x238)](a4_0x4e523b['red'](_0x87ff16(0x20d)+_0x5a4195[_0x87ff16(0x1fa)])),0x1;console['log'](a4_0x4e523b[_0x87ff16(0x259)](_0x87ff16(0x1f4)+_0x5a4195[_0x87ff16(0x218)]+_0x87ff16(0x22b))),console[_0x87ff16(0x238)]('Agent:\x20'+_0x5a4195[_0x87ff16(0x21f)]);if(_0x5a4195[_0x87ff16(0x222)]&&_0x5a4195[_0x87ff16(0x270)]){const _0x40e489=getLLMAgentChatUrl(_0x4c6d43,_0x5a4195[_0x87ff16(0x270)],_0x5a4195[_0x87ff16(0x222)]);console[_0x87ff16(0x238)]('Chat:\x20'+a4_0x4e523b[_0x87ff16(0x27a)](_0x40e489));}return 0x0;}const _0x14617f=_0xe594e3['llmProject'],_0x5699b8=resolveProjectFromContext(_0x5f4959,_0x14617f);if(_0x5699b8[_0x87ff16(0x256)])_0x5f4959=_0x5699b8[_0x87ff16(0x1fc)],_0x5699b8[_0x87ff16(0x279)]===_0x87ff16(0x258)&&console['log'](a4_0x4e523b[_0x87ff16(0x230)](_0x87ff16(0x1f2)+_0x5f4959));else{let _0x2ccbf2=_0x87ff16(0x23e);_0x5699b8[_0x87ff16(0x27c)]===_0x87ff16(0x224)&&(_0x2ccbf2=_0x5699b8[_0x87ff16(0x1fe)]+_0x87ff16(0x298)+_0x5699b8[_0x87ff16(0x26d)]+_0x87ff16(0x29e));throw new SDKError(ErrorCode[_0x87ff16(0x23d)],_0x5699b8[_0x87ff16(0x27c)]===_0x87ff16(0x1ed)?_0x5699b8[_0x87ff16(0x1fe)]:_0x87ff16(0x221)+_0x5f4959,undefined,{'helpText':_0x2ccbf2});}const {data:_0x24d810}=await withSpinner(_0x87ff16(0x264),()=>_0x50bc1c[_0x87ff16(0x29d)][_0x87ff16(0x213)](_0x5f4959,{'dryRun':!![]})),_0x395cc4=_0x24d810['counts'][_0x87ff16(0x272)]['errors']>0x0;if(_0x395cc4){console[_0x87ff16(0x238)](a4_0x4e523b[_0x87ff16(0x28b)](_0x87ff16(0x255)));for(const _0x2c1cdc of _0x24d810['agents']){_0x2c1cdc['action']==='error'&&console[_0x87ff16(0x238)](a4_0x4e523b['red'](_0x87ff16(0x242)+_0x2c1cdc[_0x87ff16(0x21f)]+_0x87ff16(0x23f)+_0x2c1cdc[_0x87ff16(0x1fa)]));}return 0x1;}const _0x566830=_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x272)][_0x87ff16(0x249)]+_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x24a)][_0x87ff16(0x249)]+_0x24d810['counts'][_0x87ff16(0x273)]['created']+_0x24d810['counts'][_0x87ff16(0x25f)][_0x87ff16(0x249)]+_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x251)][_0x87ff16(0x249)]+_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x1f5)][_0x87ff16(0x249)]+_0x24d810['counts'][_0x87ff16(0x22c)][_0x87ff16(0x249)],_0x1c31fc=_0x24d810[_0x87ff16(0x210)]['agents'][_0x87ff16(0x20b)]+_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x24a)]['updated']+_0x24d810['counts'][_0x87ff16(0x273)][_0x87ff16(0x20b)]+_0x24d810['counts'][_0x87ff16(0x25f)][_0x87ff16(0x20b)]+_0x24d810[_0x87ff16(0x210)]['integrations'][_0x87ff16(0x20b)]+_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x1f5)][_0x87ff16(0x20b)]+_0x24d810['counts'][_0x87ff16(0x22c)][_0x87ff16(0x20b)],_0x371e11=_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x272)]['unchanged']+_0x24d810['counts'][_0x87ff16(0x24a)][_0x87ff16(0x20a)]+_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x273)][_0x87ff16(0x20a)]+_0x24d810['counts']['prompts'][_0x87ff16(0x20a)]+_0x24d810[_0x87ff16(0x210)]['integrations'][_0x87ff16(0x20a)]+_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x1f5)]['unchanged']+_0x24d810['counts'][_0x87ff16(0x22c)][_0x87ff16(0x20a)];console[_0x87ff16(0x238)]('\x0aPush\x20summary\x20for\x20\x27'+_0x24d810[_0x87ff16(0x207)]+'\x27:'),console[_0x87ff16(0x238)]('\x20\x20'+a4_0x4e523b[_0x87ff16(0x259)]('+\x20'+_0x566830+_0x87ff16(0x282))+_0x87ff16(0x26f)+a4_0x4e523b[_0x87ff16(0x26c)]('~\x20'+_0x1c31fc+_0x87ff16(0x1f0))+'\x20|\x20'+a4_0x4e523b[_0x87ff16(0x230)]('=\x20'+_0x371e11+_0x87ff16(0x23a))),console[_0x87ff16(0x238)](_0x87ff16(0x1e6)+formatCountSummary(_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x272)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x24d810['counts'][_0x87ff16(0x24a)])),console[_0x87ff16(0x238)](_0x87ff16(0x205)+formatCountSummary(_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x273)])),console[_0x87ff16(0x238)](_0x87ff16(0x201)+formatCountSummary(_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x25f)])),console[_0x87ff16(0x238)](_0x87ff16(0x239)+formatCountSummary(_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x251)]));const _0x53b036=_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x1f5)][_0x87ff16(0x249)]>0x0||_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x1f5)][_0x87ff16(0x20b)]>0x0||_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x1f5)]['unchanged']>0x0||_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x22c)][_0x87ff16(0x249)]>0x0||_0x24d810[_0x87ff16(0x210)]['experimentalArtifacts'][_0x87ff16(0x20b)]>0x0||_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x22c)][_0x87ff16(0x20a)]>0x0;_0x53b036&&(console[_0x87ff16(0x238)](_0x87ff16(0x2a1)+formatCountSummary(_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x1f5)])),console[_0x87ff16(0x238)](_0x87ff16(0x24f)+formatCountSummary(_0x24d810[_0x87ff16(0x210)][_0x87ff16(0x22c)])));console[_0x87ff16(0x238)](_0x87ff16(0x250)+a4_0x4e523b['cyan'](_0x5f4959)),displayDiffs(_0x24d810['agents'],_0x24d810['knowledgeBases'],_0x24d810[_0x87ff16(0x273)],_0x24d810['prompts'],_0x24d810[_0x87ff16(0x251)],_0x24d810[_0x87ff16(0x1f5)],_0x24d810[_0x87ff16(0x22c)]);if(_0x522039)return console[_0x87ff16(0x238)](a4_0x4e523b['yellow'](_0x87ff16(0x1ec))),0x0;if(_0x566830===0x0&&_0x1c31fc===0x0){console[_0x87ff16(0x238)](a4_0x4e523b[_0x87ff16(0x259)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x3167ec=getLLMProjectUrl(_0x4c6d43,_0x24d810[_0x87ff16(0x270)]);return console[_0x87ff16(0x238)](_0x87ff16(0x295)+a4_0x4e523b['cyan'](_0x3167ec)),0x0;}if(!_0x5ea48f&&!_0x59c616){if(!isInteractive())return console[_0x87ff16(0x1fa)](a4_0x4e523b[_0x87ff16(0x28b)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x4e523b[_0x87ff16(0x230)](_0x87ff16(0x204))),0x1;const _0x1350c6=await confirmKey(_0x87ff16(0x214)+(_0x566830+_0x1c31fc)+_0x87ff16(0x27d));if(!_0x1350c6)return console[_0x87ff16(0x238)](a4_0x4e523b[_0x87ff16(0x26c)](_0x87ff16(0x244)),_0x87ff16(0x28c)),0x1;}const {data:_0x40ae8e}=await withSpinner(_0x87ff16(0x234),()=>_0x50bc1c[_0x87ff16(0x29d)]['pushProject'](_0x5f4959,{'force':_0x59c616})),_0x3dfdd3=_0x40ae8e[_0x87ff16(0x210)][_0x87ff16(0x272)][_0x87ff16(0x25b)]>0x0||_0x40ae8e['counts'][_0x87ff16(0x24a)][_0x87ff16(0x25b)]>0x0||_0x40ae8e['counts']['textKnowledgeBases']['errors']>0x0||_0x40ae8e['counts'][_0x87ff16(0x25f)]['errors']>0x0;if(_0x3dfdd3){console[_0x87ff16(0x238)](a4_0x4e523b[_0x87ff16(0x26c)](_0x87ff16(0x261))),console[_0x87ff16(0x238)](),console[_0x87ff16(0x238)](a4_0x4e523b[_0x87ff16(0x28b)](_0x87ff16(0x24b)));for(const _0x57d172 of _0x40ae8e[_0x87ff16(0x272)]){_0x57d172['action']===_0x87ff16(0x1fa)&&console[_0x87ff16(0x238)](a4_0x4e523b['red'](_0x87ff16(0x242)+_0x57d172[_0x87ff16(0x21f)]+_0x87ff16(0x23f)+_0x57d172[_0x87ff16(0x1fa)]));}for(const _0x46e376 of _0x40ae8e['knowledgeBases']){_0x46e376[_0x87ff16(0x218)]===_0x87ff16(0x1fa)&&console[_0x87ff16(0x238)](a4_0x4e523b[_0x87ff16(0x28b)](_0x87ff16(0x243)+_0x46e376[_0x87ff16(0x1ef)]+'\x22:\x20'+_0x46e376[_0x87ff16(0x1fa)]));}for(const _0x2f4fe9 of _0x40ae8e[_0x87ff16(0x273)]){_0x2f4fe9['action']===_0x87ff16(0x1fa)&&console[_0x87ff16(0x238)](a4_0x4e523b[_0x87ff16(0x28b)](_0x87ff16(0x227)+_0x2f4fe9[_0x87ff16(0x1ef)]+_0x87ff16(0x23f)+_0x2f4fe9['error']));}for(const _0x59d976 of _0x40ae8e[_0x87ff16(0x25f)]){_0x59d976[_0x87ff16(0x218)]===_0x87ff16(0x1fa)&&console[_0x87ff16(0x238)](a4_0x4e523b['red'](_0x87ff16(0x252)+_0x59d976[_0x87ff16(0x1ef)]+_0x87ff16(0x23f)+_0x59d976[_0x87ff16(0x1fa)]));}for(const _0x4a169f of _0x40ae8e[_0x87ff16(0x251)]){_0x4a169f[_0x87ff16(0x218)]===_0x87ff16(0x1fa)&&console[_0x87ff16(0x238)](a4_0x4e523b[_0x87ff16(0x28b)](_0x87ff16(0x294)+_0x4a169f['name']+_0x87ff16(0x23f)+_0x4a169f[_0x87ff16(0x1fa)]));}return 0x1;}console[_0x87ff16(0x238)](a4_0x4e523b[_0x87ff16(0x259)](_0x87ff16(0x247)+(_0x566830+_0x1c31fc)+_0x87ff16(0x21c)+_0x40ae8e['projectName']+'\x27'));const _0x28b0f6=getLLMProjectUrl(_0x4c6d43,_0x40ae8e[_0x87ff16(0x270)]);return console[_0x87ff16(0x238)]('Project:\x20'+a4_0x4e523b[_0x87ff16(0x27a)](_0x28b0f6)),0x0;}}
|
|
1
|
+
const a4_0x5f1e4e=a4_0x43b2;(function(_0x13f495,_0x16c91c){const _0x4722f9=a4_0x43b2,_0x23c69c=_0x13f495();while(!![]){try{const _0xd4c7b6=parseInt(_0x4722f9(0x170))/0x1*(parseInt(_0x4722f9(0x1b1))/0x2)+parseInt(_0x4722f9(0x1af))/0x3*(-parseInt(_0x4722f9(0x165))/0x4)+parseInt(_0x4722f9(0x16b))/0x5+-parseInt(_0x4722f9(0x1a7))/0x6*(-parseInt(_0x4722f9(0x10b))/0x7)+parseInt(_0x4722f9(0x101))/0x8*(-parseInt(_0x4722f9(0x18c))/0x9)+-parseInt(_0x4722f9(0x102))/0xa*(parseInt(_0x4722f9(0x10c))/0xb)+parseInt(_0x4722f9(0x196))/0xc;if(_0xd4c7b6===_0x16c91c)break;else _0x23c69c['push'](_0x23c69c['shift']());}catch(_0x17cb3b){_0x23c69c['push'](_0x23c69c['shift']());}}}(a4_0x2463,0x6d0d0));import a4_0x187973 from'chalk';import a4_0x1e3af3 from'path';function a4_0x2463(){const _0x54b839=['created','profile','reason','Clone\x20\x22','\x20files?','\x20\x20Knowledge\x20Bases:\x20','output','Source:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','9LpGWHf','\x20total','\x0aChanges\x20to\x20prompt\x20\x27','✔\x20Context\x20set:\x20','Using\x20local\x20project:\x20','dirname','\x0aPush\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\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','Chat:\x20','5724624EjLJwu','force','prompts','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20new','\x20created','no_context','\x0aChanges\x20to\x20agent\x20\x27','hasChanges','newProjectId','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20Agents:\x20','utf-8','errors','Using\x20project\x20from\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','found','4126242KYMckb','parse','context','pushProject','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20--name\x20','join','name','458727VFrTuV','unchanged','146wqFufD','\x20\x20tdx\x20agent\x20pull\x20','\x0aChanges:','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Output:\x20','\x20\x20Knowledge\x20Base\x20\x22','agents','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','405896oIIuul','120ekYGRA','\x22\x20to\x20\x22','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Would\x20clone:','\x20\x20Agent\x20\x22','MISSING_ARGUMENT','\x0a✔\x20Pushed\x20','agent:pull','updated','7LXeWrr','723569wUkjtS','Errors:','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','INVALID_ARGUMENT','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20\x20Integration\x20\x22','\x0aError:','Agent\x20','error','log','Project:\x20','\x0a✔\x20Pulled\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20tdx\x20agent\x20clone\x20agents/','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Output\x20path:\x20','-\x20no\x20files\x20written','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','yes','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','agent','tdx.json','\x0aWrite\x20','site','\x0aChanges\x20to\x20integration\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20|\x20','cwd','Dry\x20run\x20-\x20no\x20changes\x20made','session','yellow','projectDir','dryRun','sourceProjectName','\x20\x20Prompt\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x22...','counts','cyan','total','green','agentId','llm','New\x20project\x20name\x20is\x20required','\x22\x20to\x20a\x20different\x20profile','\x20\x20Text\x20Knowledge\x20Base\x20\x22','projectId','message','agent:push','\x20\x20Integrations:\x20','llmProject','llm_project','\x20--profile\x20','New\x20project\x20ID:\x20','cwd-config','push','Failed\x20to\x20push\x20agent:\x20','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','new','\x20=\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Experimental\x20Artifact\x20\x22','\x20\x20Experimental\x20Artifacts:\x20','Agent:\x20','Using\x20context\x20project:\x20','Cancelled','\x20unchanged','execute','Agent\x20pulled\x20successfully','Dry\x20run\x20-\x20no\x20files\x20written','Writing\x20files...','\x22:\x20','gray','outputDir','Cloning\x20\x22','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','pullProject','agentName','Pushing\x20agent\x20from\x20\x22','projectName','\x20files\x20to\x20','pullAgent','Would\x20pull\x20agent:\x20','\x20resources?','isNew','experimentalArtifacts','4PAjAVn','arg-dir','\x20\x20Prompts:\x20','experimentalKnowledgeBases','description','diff','1315040KdbIye','Using\x20current\x20project:\x20','New\x20project:\x20','\x20successfully','\x0aPush\x20summary\x20for\x20\x27','163oEIcTK','Using\x20project:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20updated','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x22\x20to\x20new\x20project\x20\x22','red','Summary:','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','integrations','textKnowledgeBases','action','cloneProject','\x20errors','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','dim','knowledgeBases','repeat'];a4_0x2463=function(){return _0x54b839;};return a4_0x2463();}function a4_0x43b2(_0x4f87b9,_0x4494fa){_0x4f87b9=_0x4f87b9-0xfb;const _0x246387=a4_0x2463();let _0x43b22f=_0x246387[_0x4f87b9];return _0x43b22f;}import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x51cfbd){const _0x43b419=a4_0x43b2,_0x3c9c92=[];if(_0x51cfbd[_0x43b419(0x135)]!==undefined)_0x3c9c92[_0x43b419(0x145)](_0x51cfbd[_0x43b419(0x135)]+_0x43b419(0x18d));if(_0x51cfbd[_0x43b419(0x148)]!==undefined&&_0x51cfbd['new']>0x0)_0x3c9c92[_0x43b419(0x145)](a4_0x187973[_0x43b419(0x136)](_0x51cfbd[_0x43b419(0x148)]+'\x20new'));if(_0x51cfbd[_0x43b419(0x183)]!==undefined&&_0x51cfbd['created']>0x0)_0x3c9c92[_0x43b419(0x145)](a4_0x187973['green'](_0x51cfbd[_0x43b419(0x183)]+_0x43b419(0x19b)));if(_0x51cfbd[_0x43b419(0x10a)]!==undefined&&_0x51cfbd[_0x43b419(0x10a)]>0x0)_0x3c9c92[_0x43b419(0x145)](a4_0x187973['yellow'](_0x51cfbd['updated']+_0x43b419(0x173)));if(_0x51cfbd[_0x43b419(0x1b0)]!==undefined&&_0x51cfbd[_0x43b419(0x1b0)]>0x0)_0x3c9c92[_0x43b419(0x145)](a4_0x187973[_0x43b419(0x156)](_0x51cfbd[_0x43b419(0x1b0)]+_0x43b419(0x150)));if(_0x51cfbd[_0x43b419(0x1a3)]!==undefined&&_0x51cfbd[_0x43b419(0x1a3)]>0x0)_0x3c9c92[_0x43b419(0x145)](a4_0x187973[_0x43b419(0x176)](_0x51cfbd['errors']+_0x43b419(0x17d)));return _0x3c9c92[_0x43b419(0x1ad)](',\x20');}function displayDiffs(_0x559fa3,_0xba8e8d,_0x100227,_0x3a2cc2,_0x4b4925,_0x39d62e,_0x1327b5){const _0x1315af=a4_0x43b2;for(const _0x35f9b0 of _0x559fa3){if(_0x35f9b0[_0x1315af(0x16a)]){const _0x430d76=_0x35f9b0['agentName']||_0x35f9b0[_0x1315af(0x1ae)];console[_0x1315af(0x115)](_0x1315af(0x19d)+_0x430d76+'\x27:'),console['log']('─'[_0x1315af(0x182)](0x3c)),console[_0x1315af(0x115)](_0x35f9b0[_0x1315af(0x16a)]),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c));}}for(const _0x1d1ada of _0xba8e8d){_0x1d1ada[_0x1315af(0x16a)]&&(console['log'](_0x1315af(0x174)+_0x1d1ada[_0x1315af(0x1ae)]+'\x27:'),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c)),console['log'](_0x1d1ada[_0x1315af(0x16a)]),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c)));}for(const _0xeae45d of _0x100227){_0xeae45d[_0x1315af(0x16a)]&&(console[_0x1315af(0x115)](_0x1315af(0x17f)+_0xeae45d[_0x1315af(0x1ae)]+'\x27:'),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c)),console[_0x1315af(0x115)](_0xeae45d['diff']),console['log']('─'[_0x1315af(0x182)](0x3c)));}for(const _0x587050 of _0x3a2cc2){_0x587050[_0x1315af(0x16a)]&&(console['log'](_0x1315af(0x18e)+_0x587050['name']+'\x27:'),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c)),console[_0x1315af(0x115)](_0x587050[_0x1315af(0x16a)]),console['log']('─'[_0x1315af(0x182)](0x3c)));}for(const _0x549479 of _0x4b4925){_0x549479['diff']&&(console['log'](_0x1315af(0x125)+_0x549479['name']+'\x27:'),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c)),console[_0x1315af(0x115)](_0x549479['diff']),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c)));}for(const _0x409ea0 of _0x39d62e){_0x409ea0[_0x1315af(0x16a)]&&(console[_0x1315af(0x115)](_0x1315af(0x18b)+_0x409ea0['name']+'\x27:'),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c)),console['log'](_0x409ea0[_0x1315af(0x16a)]),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c)));}for(const _0x4e6479 of _0x1327b5){_0x4e6479[_0x1315af(0x16a)]&&(console[_0x1315af(0x115)](_0x1315af(0x172)+_0x4e6479[_0x1315af(0x1ae)]+'\x27:'),console[_0x1315af(0x115)]('─'[_0x1315af(0x182)](0x3c)),console[_0x1315af(0x115)](_0x4e6479[_0x1315af(0x16a)]),console['log']('─'[_0x1315af(0x182)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x5f1e4e(0x1ae)]=a4_0x5f1e4e(0x109);[a4_0x5f1e4e(0x169)]=a4_0x5f1e4e(0xfc);async[a4_0x5f1e4e(0x151)](_0x13a64e){const _0x4900d6=a4_0x5f1e4e,{options:_0x1c06e1,args:_0xb796e4,tdx:_0x26a4ba}=_0x13a64e,_0x534879=_0xb796e4[0x0],_0x1e5ae5=_0xb796e4[0x1],_0x384f38=_0x1c06e1[_0x4900d6(0x189)],_0x4f633a=_0x1c06e1['dryRun'],_0x285aae=_0x1c06e1['force'],_0x3cca24=_0x1c06e1['yes'],_0xc787a9=_0x1c06e1[_0x4900d6(0x140)],_0x29ee0d=_0x1c06e1[_0x4900d6(0x121)];let _0x30f79d;if(_0x534879){const _0x31e482=a4_0x1e3af3[_0x4900d6(0x1ad)](_0x534879,_0x4900d6(0x122));if(existsSync(_0x31e482))try{const _0x30ae3d=JSON[_0x4900d6(0x1a8)](readFileSync(_0x31e482,_0x4900d6(0x1a2)));_0x30ae3d['llm_project']&&(_0x30f79d={'llm_project':_0x30ae3d[_0x4900d6(0x141)]});}catch{}}const _0x5d36c4=findAgentConfigPath(process['cwd']());let _0x26df98;if(_0x5d36c4)try{const _0xa43dd0=JSON[_0x4900d6(0x1a8)](readFileSync(_0x5d36c4,_0x4900d6(0x1a2)));_0xa43dd0[_0x4900d6(0x141)]&&(_0x26df98={'llm_project':_0xa43dd0['llm_project']});}catch{}const _0x2c4887=resolveAgentPullArgs({'arg':_0x534879,'agentNameArg':_0x1e5ae5,'agentFlag':_0x29ee0d,'contextProject':_0xc787a9,'argDirConfig':_0x30f79d,'cwdConfigPath':_0x5d36c4||undefined,'cwdConfig':_0x26df98}),{projectNameOrId:_0x58b1cc,targetAgentName:_0x39b8fe,existingOutputDir:_0xeeeff7,source:_0x278334}=_0x2c4887;if(_0x278334===_0x4900d6(0x166))console[_0x4900d6(0x115)](a4_0x187973[_0x4900d6(0x180)](_0x4900d6(0x1a4)+a4_0x1e3af3[_0x4900d6(0x1ad)](_0x534879,_0x4900d6(0x122))+':\x20'+_0x58b1cc));else{if(_0x278334===_0x4900d6(0x144))console['log'](a4_0x187973[_0x4900d6(0x180)](_0x4900d6(0x171)+_0x58b1cc));else _0x278334==='context'&&console[_0x4900d6(0x115)](a4_0x187973['dim']('Using\x20project\x20from\x20context:\x20'+_0x58b1cc));}if(!_0x58b1cc)return _0x29ee0d?(console['log'](a4_0x187973[_0x4900d6(0x12c)](_0x4900d6(0x100))),console[_0x4900d6(0x115)](_0x4900d6(0x104)),console['log'](_0x4900d6(0x110))):(console[_0x4900d6(0x115)](a4_0x187973[_0x4900d6(0x12c)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x4900d6(0x115)]('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[_0x4900d6(0x115)](_0x4900d6(0x127)),console[_0x4900d6(0x115)](_0x4900d6(0x126)),console[_0x4900d6(0x115)]('\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[_0x4900d6(0x115)](_0x4900d6(0x194))),0x1;if(_0x39b8fe){const {data:_0x1d8daf}=await withSpinner('Pulling\x20agent\x20\x22'+_0x39b8fe+'\x22\x20from\x20project\x20\x22'+_0x58b1cc+_0x4900d6(0x132),()=>_0x26a4ba['llm'][_0x4900d6(0x160)](_0x58b1cc,_0x39b8fe,_0x384f38,{'dryRun':_0x4f633a,'force':_0x285aae}));if(_0x4f633a)return console['log'](a4_0x187973[_0x4900d6(0x12c)](_0x4900d6(0x153))),console['log'](_0x4900d6(0x161)+_0x1d8daf[_0x4900d6(0x15c)]),console[_0x4900d6(0x115)](_0x4900d6(0x11b)+_0x1d8daf['outputPath']),_0x1d8daf[_0x4900d6(0x16a)]&&(console['log'](_0x4900d6(0xfb)),console['log']('─'[_0x4900d6(0x182)](0x3c)),console[_0x4900d6(0x115)](_0x1d8daf['diff']),console[_0x4900d6(0x115)]('─'['repeat'](0x3c))),0x0;return console[_0x4900d6(0x115)](a4_0x187973['green'](_0x4900d6(0x152))),console['log'](_0x4900d6(0x14d)+_0x1d8daf[_0x4900d6(0x15c)]),console[_0x4900d6(0x115)](_0x4900d6(0xfd)+_0x1d8daf['outputPath']),console['log']('Status:\x20'+(_0x1d8daf[_0x4900d6(0x163)]?a4_0x187973[_0x4900d6(0x136)](_0x4900d6(0x148)):_0x1d8daf[_0x4900d6(0x19e)]?a4_0x187973[_0x4900d6(0x12c)]('updated'):a4_0x187973[_0x4900d6(0x156)]('unchanged'))),0x0;}const _0x1374cf=_0xeeeff7||_0x384f38,{data:_0x49a315}=await withSpinner('Analyzing\x20project\x20\x22'+_0x58b1cc+_0x4900d6(0x132),()=>_0x26a4ba['llm'][_0x4900d6(0x15b)](_0x58b1cc,_0x1374cf,{'dryRun':!![]})),_0xea32d=_0x49a315['counts'][_0x4900d6(0xff)][_0x4900d6(0x148)]+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x181)][_0x4900d6(0x148)]+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x17a)][_0x4900d6(0x148)]+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x198)][_0x4900d6(0x148)]+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x179)][_0x4900d6(0x148)]+_0x49a315[_0x4900d6(0x133)]['experimentalKnowledgeBases'][_0x4900d6(0x148)]+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x164)][_0x4900d6(0x148)],_0x3b9997=_0x49a315[_0x4900d6(0x133)][_0x4900d6(0xff)]['updated']+_0x49a315['counts'][_0x4900d6(0x181)][_0x4900d6(0x10a)]+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x17a)]['updated']+_0x49a315['counts'][_0x4900d6(0x198)][_0x4900d6(0x10a)]+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x179)][_0x4900d6(0x10a)]+_0x49a315[_0x4900d6(0x133)]['experimentalKnowledgeBases'][_0x4900d6(0x10a)]+_0x49a315['counts'][_0x4900d6(0x164)]['updated'],_0x5deb7b=_0x49a315[_0x4900d6(0x133)][_0x4900d6(0xff)]['unchanged']+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x181)][_0x4900d6(0x1b0)]+_0x49a315['counts'][_0x4900d6(0x17a)][_0x4900d6(0x1b0)]+_0x49a315[_0x4900d6(0x133)]['prompts'][_0x4900d6(0x1b0)]+_0x49a315['counts'][_0x4900d6(0x179)][_0x4900d6(0x1b0)]+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x168)][_0x4900d6(0x1b0)]+_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x164)][_0x4900d6(0x1b0)];console[_0x4900d6(0x115)]('\x0aPull\x20summary\x20for\x20\x27'+_0x49a315[_0x4900d6(0x15e)]+'\x27:'),console[_0x4900d6(0x115)]('\x20\x20'+a4_0x187973[_0x4900d6(0x136)]('+\x20'+_0xea32d+_0x4900d6(0x19a))+_0x4900d6(0x128)+a4_0x187973[_0x4900d6(0x12c)]('~\x20'+_0x3b9997+'\x20changed')+_0x4900d6(0x128)+a4_0x187973[_0x4900d6(0x180)]('=\x20'+_0x5deb7b+'\x20unchanged')),console[_0x4900d6(0x115)](_0x4900d6(0x1a1)+formatCountSummary(_0x49a315[_0x4900d6(0x133)][_0x4900d6(0xff)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x49a315['counts']['knowledgeBases'])),console[_0x4900d6(0x115)](_0x4900d6(0x199)+formatCountSummary(_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x17a)])),console[_0x4900d6(0x115)](_0x4900d6(0x167)+formatCountSummary(_0x49a315['counts'][_0x4900d6(0x198)])),console[_0x4900d6(0x115)](_0x4900d6(0x13f)+formatCountSummary(_0x49a315[_0x4900d6(0x133)]['integrations']));const _0x2f5ed2=_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x168)][_0x4900d6(0x135)]>0x0||_0x49a315[_0x4900d6(0x133)][_0x4900d6(0x164)][_0x4900d6(0x135)]>0x0;_0x2f5ed2&&(console['log'](_0x4900d6(0x1a5)+formatCountSummary(_0x49a315['counts']['experimentalKnowledgeBases'])),console[_0x4900d6(0x115)](_0x4900d6(0x14c)+formatCountSummary(_0x49a315[_0x4900d6(0x133)]['experimentalArtifacts'])));console[_0x4900d6(0x115)]('\x20\x20Target:\x20'+a4_0x187973[_0x4900d6(0x134)](_0x49a315[_0x4900d6(0x157)])),displayDiffs(_0x49a315[_0x4900d6(0xff)],_0x49a315[_0x4900d6(0x181)],_0x49a315[_0x4900d6(0x17a)],_0x49a315[_0x4900d6(0x198)],_0x49a315['integrations'],_0x49a315[_0x4900d6(0x168)],_0x49a315[_0x4900d6(0x164)]);if(_0x4f633a)return console[_0x4900d6(0x115)](a4_0x187973['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0xea32d===0x0&&_0x3b9997===0x0)return console[_0x4900d6(0x115)](a4_0x187973['green']('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x49a315[_0x4900d6(0x15e)]},_0x1c06e1[_0x4900d6(0x12b)]),console[_0x4900d6(0x115)](a4_0x187973[_0x4900d6(0x136)](_0x4900d6(0x18f)+a4_0x187973[_0x4900d6(0x180)](_0x4900d6(0x141))+_0x4900d6(0x149)+a4_0x187973[_0x4900d6(0x134)](_0x49a315[_0x4900d6(0x15e)]))),0x0;if(!_0x3cca24&&!_0x285aae){if(!isInteractive())return console['error'](a4_0x187973['red'](_0x4900d6(0x112)),_0x4900d6(0x15a)),console['error'](a4_0x187973[_0x4900d6(0x180)](_0x4900d6(0x193))),0x1;const _0x4e608b=await confirmKey(_0x4900d6(0x123)+(_0xea32d+_0x3b9997)+_0x4900d6(0x187));if(!_0x4e608b)return console[_0x4900d6(0x115)](a4_0x187973[_0x4900d6(0x12c)](_0x4900d6(0x14f)),_0x4900d6(0x11c)),0x1;}const {data:_0x365be2}=await withSpinner(_0x4900d6(0x154),()=>_0x26a4ba[_0x4900d6(0x138)]['pullProject'](_0x58b1cc,_0x1374cf,{'force':_0x285aae}));return console[_0x4900d6(0x115)](a4_0x187973[_0x4900d6(0x136)](_0x4900d6(0x117)+(_0xea32d+_0x3b9997)+_0x4900d6(0x15f)+_0x365be2[_0x4900d6(0x157)])),saveSessionContext({'llm_project':_0x365be2[_0x4900d6(0x15e)]},_0x1c06e1['session']),console[_0x4900d6(0x115)](a4_0x187973[_0x4900d6(0x136)]('✔\x20Context\x20set:\x20'+a4_0x187973[_0x4900d6(0x180)](_0x4900d6(0x141))+_0x4900d6(0x149)+a4_0x187973[_0x4900d6(0x134)](_0x365be2['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x5f1e4e(0x1ae)]='agent:clone';[a4_0x5f1e4e(0x169)]=a4_0x5f1e4e(0x178);async[a4_0x5f1e4e(0x151)](_0x4e5c09){const _0x17c2c6=a4_0x5f1e4e,{options:_0x184d35,args:_0x2f5749,tdx:_0x21eacd}=_0x4e5c09,_0x45ec7e=_0x2f5749[0x0],_0xc7a0bd=_0x184d35[_0x17c2c6(0x1ae)],_0x2f9388=_0x184d35[_0x17c2c6(0x12e)],_0x237704=_0x184d35[_0x17c2c6(0x11f)],_0x2a7fb5=_0x184d35[_0x17c2c6(0x124)],_0x2cbe98=_0x184d35['llmProject'];let _0xf2983f;const _0x5849d8=findAgentConfigPath(process[_0x17c2c6(0x129)]());if(_0x45ec7e){const _0x2b59a8=a4_0x1e3af3[_0x17c2c6(0x1ad)](_0x45ec7e,_0x17c2c6(0x122));existsSync(_0x2b59a8)?(_0xf2983f=_0x45ec7e,console['log'](a4_0x187973[_0x17c2c6(0x180)](_0x17c2c6(0x190)+_0x45ec7e))):_0xf2983f=_0x45ec7e;}else{if(_0x5849d8)_0xf2983f=a4_0x1e3af3['dirname'](_0x5849d8),console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x180)](_0x17c2c6(0x16c)+_0xf2983f));else{if(_0x2cbe98){const _0x335895=sanitizeForFilesystem(_0x2cbe98);let _0x3e05d2=_0x335895,_0x3acddb=a4_0x1e3af3[_0x17c2c6(0x1ad)](process[_0x17c2c6(0x129)](),_0x17c2c6(0xff),_0x335895,_0x17c2c6(0x122));if(!existsSync(_0x3acddb)){const _0x4c2d83=normalizeName(_0x2cbe98),_0x58bf9d=a4_0x1e3af3[_0x17c2c6(0x1ad)](process[_0x17c2c6(0x129)](),_0x17c2c6(0xff),_0x4c2d83,_0x17c2c6(0x122));existsSync(_0x58bf9d)&&(_0x3e05d2=_0x4c2d83,_0x3acddb=_0x58bf9d);}if(existsSync(_0x3acddb))_0xf2983f=a4_0x1e3af3[_0x17c2c6(0x191)](_0x3acddb),console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x180)]('Using\x20local\x20project:\x20'+_0xf2983f));else{const _0x304340=_0x184d35[_0x17c2c6(0x184)];if(_0x304340)throw new SDKError(ErrorCode[_0x17c2c6(0x10f)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x2cbe98+_0x17c2c6(0x13a),undefined,{'helpText':_0x17c2c6(0x118)+_0x17c2c6(0x11a)+(_0x17c2c6(0x1b2)+_0x2cbe98+'\x0a')+(_0x17c2c6(0x119)+_0x3e05d2+_0x17c2c6(0x1ac)+(_0xc7a0bd||'<new-name>')+_0x17c2c6(0x142)+_0x304340)});_0xf2983f=_0x2cbe98,console[_0x17c2c6(0x115)](a4_0x187973['dim'](_0x17c2c6(0x14e)+_0x2cbe98));}}}}if(!_0xf2983f)return console[_0x17c2c6(0x115)](a4_0x187973['yellow'](_0x17c2c6(0x159))),console[_0x17c2c6(0x115)](_0x17c2c6(0x17e)),console[_0x17c2c6(0x115)](_0x17c2c6(0x131)),console[_0x17c2c6(0x115)](_0x17c2c6(0x147)),console[_0x17c2c6(0x115)](_0x17c2c6(0x14a)),0x1;if(!_0xc7a0bd)throw new SDKError(ErrorCode[_0x17c2c6(0x107)],_0x17c2c6(0x139),undefined,{'helpText':_0x17c2c6(0x11e)});if(!_0x237704&&!_0x2f9388){if(!isInteractive())return console[_0x17c2c6(0x114)](a4_0x187973[_0x17c2c6(0x176)](_0x17c2c6(0x112)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x17c2c6(0x114)](a4_0x187973[_0x17c2c6(0x180)](_0x17c2c6(0x193))),0x1;const _0x443c48=await confirmKey(_0x17c2c6(0x186)+_0xf2983f+_0x17c2c6(0x175)+_0xc7a0bd+'\x22?');if(!_0x443c48)return console['log'](a4_0x187973[_0x17c2c6(0x12c)](_0x17c2c6(0x14f))),0x1;}const {data:_0x33a0de}=await withSpinner(_0x17c2c6(0x158)+_0xf2983f+_0x17c2c6(0x103)+_0xc7a0bd+'\x22...',()=>_0x21eacd['llm'][_0x17c2c6(0x17c)](_0xf2983f,_0xc7a0bd,{'dryRun':_0x2f9388}));if(_0x2f9388){console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x12c)](_0x17c2c6(0x12a))),console[_0x17c2c6(0x115)](_0x17c2c6(0x18a)+_0x33a0de[_0x17c2c6(0x12f)]),console['log'](_0x17c2c6(0x16d)+_0xc7a0bd),console[_0x17c2c6(0x115)](_0x17c2c6(0x105)),console[_0x17c2c6(0x115)](_0x17c2c6(0x1a1)+_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0xff)]['created']),console[_0x17c2c6(0x115)](_0x17c2c6(0x188)+_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0x181)][_0x17c2c6(0x183)]),console[_0x17c2c6(0x115)](_0x17c2c6(0x167)+_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0x198)]['created']);const _0x3890e2=_0x33a0de[_0x17c2c6(0x133)]['experimentalKnowledgeBases'][_0x17c2c6(0x183)]>0x0||_0x33a0de['counts'][_0x17c2c6(0x164)][_0x17c2c6(0x183)]>0x0;return _0x3890e2&&(console[_0x17c2c6(0x115)](_0x17c2c6(0x1a5)+_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0x168)][_0x17c2c6(0x183)]),console[_0x17c2c6(0x115)](_0x17c2c6(0x14c)+_0x33a0de[_0x17c2c6(0x133)]['experimentalArtifacts'][_0x17c2c6(0x183)])),0x0;}const _0x2b30a4=_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0xff)][_0x17c2c6(0x1a3)]>0x0||_0x33a0de['counts']['knowledgeBases'][_0x17c2c6(0x1a3)]>0x0||_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0x198)][_0x17c2c6(0x1a3)]>0x0||_0x33a0de[_0x17c2c6(0x133)]['experimentalKnowledgeBases'][_0x17c2c6(0x1a3)]>0x0||_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0x164)]['errors']>0x0;_0x2b30a4?console[_0x17c2c6(0x115)](a4_0x187973['yellow']('Project\x20cloned\x20with\x20errors')):console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x136)]('Project\x20cloned\x20successfully'));console[_0x17c2c6(0x115)](_0x17c2c6(0x18a)+_0x33a0de[_0x17c2c6(0x12f)]),console[_0x17c2c6(0x115)](_0x17c2c6(0x16d)+_0x33a0de['newProjectName']),console[_0x17c2c6(0x115)](_0x17c2c6(0x143)+_0x33a0de['newProjectId']),console[_0x17c2c6(0x115)](),console['log'](_0x17c2c6(0x177)),console[_0x17c2c6(0x115)]('\x20\x20Agents:\x20'+formatCountSummary(_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0xff)])),console[_0x17c2c6(0x115)](_0x17c2c6(0x188)+formatCountSummary(_0x33a0de['counts'][_0x17c2c6(0x181)])),console[_0x17c2c6(0x115)](_0x17c2c6(0x167)+formatCountSummary(_0x33a0de['counts'][_0x17c2c6(0x198)])),console[_0x17c2c6(0x115)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x33a0de[_0x17c2c6(0x133)]['integrations']));const _0x19c6fb=_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0x168)][_0x17c2c6(0x183)]>0x0||_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0x168)][_0x17c2c6(0x10a)]>0x0||_0x33a0de[_0x17c2c6(0x133)][_0x17c2c6(0x168)]['unchanged']>0x0||_0x33a0de[_0x17c2c6(0x133)]['experimentalArtifacts'][_0x17c2c6(0x183)]>0x0||_0x33a0de[_0x17c2c6(0x133)]['experimentalArtifacts'][_0x17c2c6(0x10a)]>0x0||_0x33a0de[_0x17c2c6(0x133)]['experimentalArtifacts'][_0x17c2c6(0x1b0)]>0x0;_0x19c6fb&&(console['log'](_0x17c2c6(0x1a5)+formatCountSummary(_0x33a0de['counts']['experimentalKnowledgeBases'])),console[_0x17c2c6(0x115)](_0x17c2c6(0x14c)+formatCountSummary(_0x33a0de['counts']['experimentalArtifacts'])));if(_0x2b30a4){console[_0x17c2c6(0x115)](),console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x176)](_0x17c2c6(0x10d)));for(const _0x58599c of _0x33a0de[_0x17c2c6(0xff)]){_0x58599c[_0x17c2c6(0x17b)]===_0x17c2c6(0x114)&&console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x176)](_0x17c2c6(0x106)+_0x58599c[_0x17c2c6(0x15c)]+_0x17c2c6(0x155)+_0x58599c[_0x17c2c6(0x114)]));}for(const _0x8cfeb8 of _0x33a0de['knowledgeBases']){_0x8cfeb8[_0x17c2c6(0x17b)]===_0x17c2c6(0x114)&&console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x176)](_0x17c2c6(0xfe)+_0x8cfeb8[_0x17c2c6(0x1ae)]+'\x22:\x20'+_0x8cfeb8['error']));}for(const _0x311c0a of _0x33a0de[_0x17c2c6(0x198)]){_0x311c0a[_0x17c2c6(0x17b)]===_0x17c2c6(0x114)&&console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x176)]('\x20\x20Prompt\x20\x22'+_0x311c0a[_0x17c2c6(0x1ae)]+_0x17c2c6(0x155)+_0x311c0a[_0x17c2c6(0x114)]));}for(const _0xf9f9f0 of _0x33a0de['integrations']){_0xf9f9f0['action']===_0x17c2c6(0x114)&&console[_0x17c2c6(0x115)](a4_0x187973['red'](_0x17c2c6(0x111)+_0xf9f9f0[_0x17c2c6(0x1ae)]+'\x22:\x20'+_0xf9f9f0['error']));}for(const _0x39d273 of _0x33a0de['experimentalKnowledgeBases']){_0x39d273['action']==='error'&&console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x176)](_0x17c2c6(0x11d)+_0x39d273['name']+'\x22:\x20'+_0x39d273[_0x17c2c6(0x114)]));}for(const _0x561a97 of _0x33a0de['experimentalArtifacts']){_0x561a97[_0x17c2c6(0x17b)]===_0x17c2c6(0x114)&&console[_0x17c2c6(0x115)](a4_0x187973[_0x17c2c6(0x176)](_0x17c2c6(0x14b)+_0x561a97[_0x17c2c6(0x1ae)]+_0x17c2c6(0x155)+_0x561a97['error']));}return 0x1;}console[_0x17c2c6(0x115)]();const _0x18d37e=getLLMProjectUrl(_0x2a7fb5,_0x33a0de[_0x17c2c6(0x19f)]);return console[_0x17c2c6(0x115)](_0x17c2c6(0x116)+a4_0x187973[_0x17c2c6(0x134)](_0x18d37e)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x5f1e4e(0x1ae)]=a4_0x5f1e4e(0x13e);[a4_0x5f1e4e(0x169)]=a4_0x5f1e4e(0x1a0);async[a4_0x5f1e4e(0x151)](_0x161319){const _0x113bbb=a4_0x5f1e4e,{options:_0x329f27,args:_0x35b9e0,tdx:_0x55dc89}=_0x161319;let _0x49ade1=_0x35b9e0[0x0]||process[_0x113bbb(0x129)]();const _0x874292=_0x329f27[_0x113bbb(0x12e)],_0x19561c=_0x329f27[_0x113bbb(0x197)],_0x34b921=_0x329f27[_0x113bbb(0x11f)],_0xc1b2ad=_0x329f27[_0x113bbb(0x124)],_0x4d6771=a4_0x1e3af3[_0x113bbb(0x1ad)](_0x49ade1,'agent.yml'),_0x54f2e7=existsSync(_0x4d6771);if(_0x54f2e7){const {data:_0x2abc38}=await withSpinner(_0x113bbb(0x15d)+_0x49ade1+_0x113bbb(0x132),()=>_0x55dc89[_0x113bbb(0x138)]['pushAgent'](_0x49ade1,{'dryRun':_0x874292,'force':_0x19561c}));if(_0x874292)return console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x12c)](_0x113bbb(0x12a))),console[_0x113bbb(0x115)]('Would\x20push\x20agent:\x20'+_0x2abc38[_0x113bbb(0x15c)]),0x0;if(_0x2abc38['action']===_0x113bbb(0x114))return console[_0x113bbb(0x115)](a4_0x187973['red'](_0x113bbb(0x146)+_0x2abc38[_0x113bbb(0x114)])),0x1;console[_0x113bbb(0x115)](a4_0x187973['green'](_0x113bbb(0x113)+_0x2abc38[_0x113bbb(0x17b)]+_0x113bbb(0x16e))),console['log'](_0x113bbb(0x14d)+_0x2abc38[_0x113bbb(0x15c)]);if(_0x2abc38[_0x113bbb(0x137)]&&_0x2abc38[_0x113bbb(0x13c)]){const _0x51dab7=getLLMAgentChatUrl(_0xc1b2ad,_0x2abc38[_0x113bbb(0x13c)],_0x2abc38[_0x113bbb(0x137)]);console[_0x113bbb(0x115)](_0x113bbb(0x195)+a4_0x187973['cyan'](_0x51dab7));}return 0x0;}const _0x997b82=_0x329f27[_0x113bbb(0x140)],_0x4d3451=resolveProjectFromContext(_0x49ade1,_0x997b82);if(_0x4d3451[_0x113bbb(0x1a6)])_0x49ade1=_0x4d3451[_0x113bbb(0x12d)],_0x4d3451['source']===_0x113bbb(0x1a9)&&console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x180)](_0x113bbb(0x171)+_0x49ade1));else{let _0x290116=_0x113bbb(0x120);_0x4d3451[_0x113bbb(0x185)]==='no_local_folder'&&(_0x290116=_0x4d3451[_0x113bbb(0x13d)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x4d3451[_0x113bbb(0x140)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4d3451['reason']===_0x113bbb(0x19c)?_0x4d3451[_0x113bbb(0x13d)]:'No\x20tdx.json\x20found\x20in\x20'+_0x49ade1,undefined,{'helpText':_0x290116});}const {data:_0x349f16}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x55dc89[_0x113bbb(0x138)][_0x113bbb(0x1aa)](_0x49ade1,{'dryRun':!![]})),_0x1f249c=_0x349f16[_0x113bbb(0x133)][_0x113bbb(0xff)]['errors']>0x0;if(_0x1f249c){console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x176)]('\x0aErrors\x20found:'));for(const _0x4409c2 of _0x349f16[_0x113bbb(0xff)]){_0x4409c2[_0x113bbb(0x17b)]===_0x113bbb(0x114)&&console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x176)](_0x113bbb(0x106)+_0x4409c2[_0x113bbb(0x15c)]+_0x113bbb(0x155)+_0x4409c2['error']));}return 0x1;}const _0x2941bb=_0x349f16[_0x113bbb(0x133)]['agents'][_0x113bbb(0x183)]+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x181)]['created']+_0x349f16[_0x113bbb(0x133)]['textKnowledgeBases'][_0x113bbb(0x183)]+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x198)][_0x113bbb(0x183)]+_0x349f16['counts']['integrations']['created']+_0x349f16['counts'][_0x113bbb(0x168)][_0x113bbb(0x183)]+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x164)]['created'],_0x43166f=_0x349f16[_0x113bbb(0x133)][_0x113bbb(0xff)][_0x113bbb(0x10a)]+_0x349f16[_0x113bbb(0x133)]['knowledgeBases'][_0x113bbb(0x10a)]+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x17a)][_0x113bbb(0x10a)]+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x198)][_0x113bbb(0x10a)]+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x179)]['updated']+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x168)][_0x113bbb(0x10a)]+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x164)]['updated'],_0x6238ed=_0x349f16[_0x113bbb(0x133)][_0x113bbb(0xff)]['unchanged']+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x181)][_0x113bbb(0x1b0)]+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x17a)]['unchanged']+_0x349f16['counts'][_0x113bbb(0x198)][_0x113bbb(0x1b0)]+_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x179)][_0x113bbb(0x1b0)]+_0x349f16['counts'][_0x113bbb(0x168)]['unchanged']+_0x349f16[_0x113bbb(0x133)]['experimentalArtifacts'][_0x113bbb(0x1b0)];console['log'](_0x113bbb(0x16f)+_0x349f16[_0x113bbb(0x15e)]+'\x27:'),console[_0x113bbb(0x115)]('\x20\x20'+a4_0x187973[_0x113bbb(0x136)]('+\x20'+_0x2941bb+_0x113bbb(0x19a))+_0x113bbb(0x128)+a4_0x187973['yellow']('~\x20'+_0x43166f+'\x20changed')+'\x20|\x20'+a4_0x187973[_0x113bbb(0x180)]('=\x20'+_0x6238ed+_0x113bbb(0x150))),console[_0x113bbb(0x115)](_0x113bbb(0x1a1)+formatCountSummary(_0x349f16[_0x113bbb(0x133)][_0x113bbb(0xff)])),console[_0x113bbb(0x115)](_0x113bbb(0x188)+formatCountSummary(_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x181)])),console[_0x113bbb(0x115)](_0x113bbb(0x199)+formatCountSummary(_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x17a)])),console[_0x113bbb(0x115)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x198)])),console[_0x113bbb(0x115)](_0x113bbb(0x13f)+formatCountSummary(_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x179)]));const _0x4820dd=_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x168)]['created']>0x0||_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x168)][_0x113bbb(0x10a)]>0x0||_0x349f16[_0x113bbb(0x133)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x164)][_0x113bbb(0x183)]>0x0||_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x164)][_0x113bbb(0x10a)]>0x0||_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x164)][_0x113bbb(0x1b0)]>0x0;_0x4820dd&&(console['log'](_0x113bbb(0x1a5)+formatCountSummary(_0x349f16[_0x113bbb(0x133)][_0x113bbb(0x168)])),console[_0x113bbb(0x115)](_0x113bbb(0x14c)+formatCountSummary(_0x349f16['counts'][_0x113bbb(0x164)])));console[_0x113bbb(0x115)]('\x20\x20Source:\x20'+a4_0x187973[_0x113bbb(0x134)](_0x49ade1)),displayDiffs(_0x349f16['agents'],_0x349f16['knowledgeBases'],_0x349f16[_0x113bbb(0x17a)],_0x349f16[_0x113bbb(0x198)],_0x349f16[_0x113bbb(0x179)],_0x349f16[_0x113bbb(0x168)],_0x349f16[_0x113bbb(0x164)]);if(_0x874292)return console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x12c)](_0x113bbb(0x10e))),0x0;if(_0x2941bb===0x0&&_0x43166f===0x0){console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x136)](_0x113bbb(0x1ab)));const _0x5bf455=getLLMProjectUrl(_0xc1b2ad,_0x349f16[_0x113bbb(0x13c)]);return console['log'](_0x113bbb(0x116)+a4_0x187973[_0x113bbb(0x134)](_0x5bf455)),0x0;}if(!_0x34b921&&!_0x19561c){if(!isInteractive())return console['error'](a4_0x187973['red'](_0x113bbb(0x112)),_0x113bbb(0x15a)),console[_0x113bbb(0x114)](a4_0x187973[_0x113bbb(0x180)](_0x113bbb(0x193))),0x1;const _0x32074a=await confirmKey(_0x113bbb(0x192)+(_0x2941bb+_0x43166f)+_0x113bbb(0x162));if(!_0x32074a)return console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x12c)](_0x113bbb(0x14f)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x404b77}=await withSpinner('Pushing\x20to\x20project...',()=>_0x55dc89[_0x113bbb(0x138)][_0x113bbb(0x1aa)](_0x49ade1,{'force':_0x19561c})),_0x363eae=_0x404b77[_0x113bbb(0x133)][_0x113bbb(0xff)][_0x113bbb(0x1a3)]>0x0||_0x404b77[_0x113bbb(0x133)]['knowledgeBases'][_0x113bbb(0x1a3)]>0x0||_0x404b77[_0x113bbb(0x133)]['textKnowledgeBases'][_0x113bbb(0x1a3)]>0x0||_0x404b77[_0x113bbb(0x133)][_0x113bbb(0x198)][_0x113bbb(0x1a3)]>0x0;if(_0x363eae){console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x12c)]('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console[_0x113bbb(0x115)](a4_0x187973['red'](_0x113bbb(0x10d)));for(const _0x46a03c of _0x404b77['agents']){_0x46a03c[_0x113bbb(0x17b)]===_0x113bbb(0x114)&&console['log'](a4_0x187973[_0x113bbb(0x176)](_0x113bbb(0x106)+_0x46a03c[_0x113bbb(0x15c)]+_0x113bbb(0x155)+_0x46a03c[_0x113bbb(0x114)]));}for(const _0x31fb4e of _0x404b77[_0x113bbb(0x181)]){_0x31fb4e['action']==='error'&&console['log'](a4_0x187973[_0x113bbb(0x176)](_0x113bbb(0xfe)+_0x31fb4e['name']+_0x113bbb(0x155)+_0x31fb4e[_0x113bbb(0x114)]));}for(const _0x11c821 of _0x404b77['textKnowledgeBases']){_0x11c821[_0x113bbb(0x17b)]===_0x113bbb(0x114)&&console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x176)](_0x113bbb(0x13b)+_0x11c821[_0x113bbb(0x1ae)]+_0x113bbb(0x155)+_0x11c821[_0x113bbb(0x114)]));}for(const _0x3e2d20 of _0x404b77['prompts']){_0x3e2d20[_0x113bbb(0x17b)]===_0x113bbb(0x114)&&console[_0x113bbb(0x115)](a4_0x187973['red'](_0x113bbb(0x130)+_0x3e2d20[_0x113bbb(0x1ae)]+_0x113bbb(0x155)+_0x3e2d20[_0x113bbb(0x114)]));}for(const _0x4caffe of _0x404b77['integrations']){_0x4caffe['action']===_0x113bbb(0x114)&&console['log'](a4_0x187973[_0x113bbb(0x176)]('\x20\x20Integration\x20\x22'+_0x4caffe[_0x113bbb(0x1ae)]+_0x113bbb(0x155)+_0x4caffe[_0x113bbb(0x114)]));}return 0x1;}console[_0x113bbb(0x115)](a4_0x187973[_0x113bbb(0x136)](_0x113bbb(0x108)+(_0x2941bb+_0x43166f)+'\x20resources\x20to\x20\x27'+_0x404b77[_0x113bbb(0x15e)]+'\x27'));const _0x937255=getLLMProjectUrl(_0xc1b2ad,_0x404b77[_0x113bbb(0x13c)]);return console[_0x113bbb(0x115)](_0x113bbb(0x116)+a4_0x187973[_0x113bbb(0x134)](_0x937255)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x3bce42=a5_0x48e7;(function(_0x3c5674,_0x102e41){const _0x183f9e=a5_0x48e7,_0x111e4f=_0x3c5674();while(!![]){try{const _0x17d2c9=parseInt(_0x183f9e(0x1ab))/0x1*(-parseInt(_0x183f9e(0x19f))/0x2)+parseInt(_0x183f9e(0x16d))/0x3*(-parseInt(_0x183f9e(0x156))/0x4)+-parseInt(_0x183f9e(0x1d3))/0x5+parseInt(_0x183f9e(0x197))/0x6*(parseInt(_0x183f9e(0x1c4))/0x7)+parseInt(_0x183f9e(0x15c))/0x8+-parseInt(_0x183f9e(0x187))/0x9+parseInt(_0x183f9e(0x178))/0xa*(parseInt(_0x183f9e(0x169))/0xb);if(_0x17d2c9===_0x102e41)break;else _0x111e4f['push'](_0x111e4f['shift']());}catch(_0x445c77){_0x111e4f['push'](_0x111e4f['shift']());}}}(a5_0x238e,0x8a885));import*as a5_0xc5dfb3 from'node:fs';import*as a5_0x567d85 from'node:path';function a5_0x238e(){const _0x31b674=['\x20\x20Conversation:\x20','start','Re-evaluating...','Site:\x20','white','green','resolveProjectId','test.yml','conversations','Round\x20','description','json','name','status','tags','no_tests','resolveAgentId','Executing\x20new\x20tests...','Cached\x20run\x20is\x20from\x20site\x20\x22','2493012QIoiuN','size','Run\x20tests\x20for\x20an\x20LLM\x20agent','red','Passed:\x20\x20\x20','forEach','4691712GFlqEk','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Test\x20Summary','PASS','stop','Error\x20writing\x20output\x20file:\x20','ERROR','yellow','has','text','no_local_folder','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Project\x20path:\x20','77Jvupox','...\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Usage:','3jNeUFe','Re-evaluating\x20','length','\x20(cached)','agent','tsv','\x27\x20to\x20create\x20the\x20folder\x20structure.','table','\x22:\x20','eval','find','2816690VkpClS','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','message','dim','Re-evaluation\x20Summary','basename','agentName','some','trim','output','dryRun','Round\x201/','\x20-\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','8479143FUJIiO','toLowerCase','toISOString','\x20\x20Round\x20','tests','/<agent-name>','✗\x20ERROR:\x20','join','filter','\x20\x20Evaluating...\x20','\x20\x20-\x20','execute','⚠\x20SKIPPED:\x20','jsonl','agent:test','substring','552wCNqQQ','No\x20tests\x20have\x20tags\x20defined.','✓\x20PASS:\x20','add','Total:\x20\x20\x20\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Running:\x20','Either\x20switch\x20to\x20the\x20\x22','5638mBvWdR','context','executeReeval','✗\x20FAIL:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','reason','push','round','projectName','Using\x20agent:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','Test\x20Configuration:','106BGKVbh','writeFileSync','rounds','multiple_agents','log','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','existsSync','verbose','\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','map','site','Errors:\x20\x20\x20','llmProject','not\x20found','testYmlPath','Output\x20written\x20to:\x20','cyan','...','split','\x20\x20Project:\x20','now',':\x20Sending\x20user\x20input...','Agent:\x20','includes','3836MrDAqE','Failed:\x20\x20\x20','Duration:\x20','isSpinning','No\x20tests\x20found\x20with\x20tags:\x20','\x20(new)','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','resolve','conversation_url','FAIL','Running\x20test:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','projectDir','llm','repeat','884700HEWtYH'];a5_0x238e=function(){return _0x31b674;};return a5_0x238e();}function a5_0x48e7(_0x116722,_0x1e293d){_0x116722=_0x116722-0x148;const _0x238e32=a5_0x238e();let _0x48e705=_0x238e32[_0x116722];return _0x48e705;}import a5_0xec0b4b 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_0x3bce42(0x14f)]=a5_0x3bce42(0x195);[a5_0x3bce42(0x14d)]=a5_0x3bce42(0x158);async[a5_0x3bce42(0x192)](_0x5eb610){const _0x842982=a5_0x3bce42,{options:_0x3e9f01,args:_0x20025f,tdx:_0x17b029}=_0x5eb610,_0x27f4f0=_0x20025f[0x0]||'.',_0x18f092=_0x3e9f01[_0x842982(0x182)],_0x5b3c58=_0x3e9f01,_0x48afae=_0x5b3c58[_0x842982(0x176)]===![],_0x32f2ce=_0x5b3c58['reeval'],_0x4625aa=_0x5b3c58[_0x842982(0x14f)],_0x175625=_0x5b3c58[_0x842982(0x151)],_0x379037=_0x3e9f01[_0x842982(0x1b6)],_0xb58214=_0x5b3c58[_0x842982(0x181)];if(_0x32f2ce&&_0x48afae)return console[_0x842982(0x1af)](a5_0xec0b4b[_0x842982(0x159)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x3256bc=_0x842982(0x174);if(_0x5b3c58[_0x842982(0x14e)])_0x3256bc=_0x842982(0x14e);else{if(_0x5b3c58[_0x842982(0x194)])_0x3256bc=_0x842982(0x194);else{if(_0x5b3c58[_0x842982(0x172)])_0x3256bc=_0x842982(0x172);else{if(_0x5b3c58[_0x842982(0x174)])_0x3256bc=_0x842982(0x174);}}}const _0x2e0e76=_0x5b3c58[_0x842982(0x1b8)];let _0x3bc770=_0x27f4f0;const _0x363fda=a5_0xc5dfb3[_0x842982(0x1b2)](_0x27f4f0),_0x379a6f=_0x27f4f0==='.';if(!_0x363fda||_0x379a6f){const _0x4ddbc3=resolveProjectFromContext(_0x27f4f0,_0x2e0e76,{'requireFile':_0x842982(0x14a)});if(_0x4ddbc3['found'])_0x3bc770=_0x4ddbc3[_0x842982(0x1d0)],_0x4ddbc3['source']===_0x842982(0x1a0)&&console['log'](a5_0xec0b4b[_0x842982(0x17b)](_0x842982(0x1a8)+_0x3bc770));else switch(_0x4ddbc3[_0x842982(0x1a4)]){case'no_context':console[_0x842982(0x1af)](a5_0xec0b4b[_0x842982(0x163)](_0x4ddbc3[_0x842982(0x17a)])),console['log'](),console[_0x842982(0x1af)](_0x842982(0x16c)),console['log'](_0x842982(0x1b4)),console[_0x842982(0x1af)]('\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)'),console[_0x842982(0x1af)](),console[_0x842982(0x1af)](_0x842982(0x1a3));return 0x1;case _0x842982(0x166):console[_0x842982(0x1af)](a5_0xec0b4b[_0x842982(0x163)](_0x4ddbc3[_0x842982(0x17a)])),console[_0x842982(0x1af)](),console[_0x842982(0x1af)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x4ddbc3[_0x842982(0x1b8)]+_0x842982(0x173));return 0x1;case _0x842982(0x1ae):{const _0x383237=a5_0x567d85[_0x842982(0x17d)](_0x4ddbc3[_0x842982(0x1d0)]);console['log'](a5_0xec0b4b[_0x842982(0x163)](_0x842982(0x185)+_0x4ddbc3[_0x842982(0x1b8)]+'\x22:'));for(const _0x41215c of _0x4ddbc3['agentDirs']){console['log'](_0x842982(0x191)+_0x41215c);}return console[_0x842982(0x1af)](),console[_0x842982(0x1af)](_0x842982(0x179)+_0x383237+_0x842982(0x18c)),0x1;}case _0x842982(0x152):console['log'](a5_0xec0b4b[_0x842982(0x163)](_0x842982(0x167)+_0x4ddbc3[_0x842982(0x1b8)]+'\x22.')),console[_0x842982(0x1af)](a5_0xec0b4b['dim'](_0x842982(0x168)+_0x4ddbc3['projectDir'])),console[_0x842982(0x1af)](),console[_0x842982(0x1af)](_0x842982(0x1ca));return 0x1;}}const {definition:_0x22341a,agentInfo:_0x104cf9}=parseTestFile(_0x3bc770);let _0x3e2eeb=_0x22341a[_0x842982(0x18b)];if(_0x4625aa){const _0x1c8ad9=_0x4625aa[_0x842982(0x1be)](',')['map'](_0x33ba81=>_0x33ba81[_0x842982(0x180)]());_0x3e2eeb=_0x22341a[_0x842982(0x18b)]['filter'](_0x1c9bff=>_0x1c8ad9['includes'](_0x1c9bff['name']));if(_0x3e2eeb['length']===0x0)return console[_0x842982(0x1af)](a5_0xec0b4b[_0x842982(0x163)]('No\x20tests\x20found\x20matching:\x20'+_0x4625aa)),console[_0x842982(0x1af)](a5_0xec0b4b[_0x842982(0x17b)]('Available\x20tests:\x20'+_0x22341a[_0x842982(0x18b)]['map'](_0x4fb35b=>_0x4fb35b[_0x842982(0x14f)])[_0x842982(0x18e)](',\x20'))),0x1;}if(_0x175625){const _0x2182b6=_0x175625[_0x842982(0x1be)](',')[_0x842982(0x1b5)](_0x3a29e8=>_0x3a29e8[_0x842982(0x180)]()[_0x842982(0x188)]());_0x3e2eeb=_0x3e2eeb['filter'](_0x16d8de=>_0x16d8de[_0x842982(0x151)]?.[_0x842982(0x17f)](_0x42e877=>_0x2182b6[_0x842982(0x1c3)](_0x42e877[_0x842982(0x188)]())));if(_0x3e2eeb[_0x842982(0x16f)]===0x0){console[_0x842982(0x1af)](a5_0xec0b4b[_0x842982(0x163)](_0x842982(0x1c8)+_0x175625));const _0x350b78=new Set();return _0x22341a['tests'][_0x842982(0x15b)](_0x2a00cf=>_0x2a00cf[_0x842982(0x151)]?.[_0x842982(0x15b)](_0x58ae5e=>_0x350b78[_0x842982(0x19a)](_0x58ae5e))),_0x350b78[_0x842982(0x157)]>0x0?console[_0x842982(0x1af)](a5_0xec0b4b[_0x842982(0x17b)]('Available\x20tags:\x20'+[..._0x350b78][_0x842982(0x18e)](',\x20'))):console['log'](a5_0xec0b4b[_0x842982(0x17b)](_0x842982(0x198))),0x1;}}if(_0x32f2ce)return this[_0x842982(0x1a1)](_0x5eb610,{'definition':{'tests':_0x3e2eeb},'agentInfo':_0x104cf9,'outputFormat':_0x3256bc,'outputFile':_0xb58214,'testNames':_0x4625aa});if(_0x18f092){console[_0x842982(0x1af)](a5_0xec0b4b[_0x842982(0x1bc)](_0x842982(0x1aa))),console[_0x842982(0x1af)]('\x20\x20Site:\x20'+a5_0xec0b4b[_0x842982(0x1d8)](_0x379037)),console[_0x842982(0x1af)](_0x842982(0x1bf)+a5_0xec0b4b[_0x842982(0x1d8)](_0x104cf9[_0x842982(0x1a7)])),console['log']('\x20\x20Agent:\x20'+a5_0xec0b4b[_0x842982(0x1d8)](_0x104cf9['agentName'])),console['log'](),console['log']('Tests\x20found:\x20'+a5_0xec0b4b[_0x842982(0x1d8)](_0x3e2eeb['length']));for(let _0x3527e2=0x0;_0x3527e2<_0x3e2eeb[_0x842982(0x16f)];_0x3527e2++){const _0x43b711=_0x3e2eeb[_0x3527e2],_0x2475da=_0x43b711[_0x842982(0x1ad)][_0x842982(0x16f)]===0x1?_0x842982(0x1a6):_0x842982(0x1ad),_0x3b4a12=_0x43b711[_0x842982(0x151)]?.[_0x842982(0x16f)]?'\x20['+_0x43b711[_0x842982(0x151)][_0x842982(0x18e)](',\x20')+']':'';console['log']('\x20\x20'+(_0x3527e2+0x1)+'.\x20'+a5_0xec0b4b[_0x842982(0x1d8)](_0x43b711[_0x842982(0x14f)])+'\x20('+_0x43b711[_0x842982(0x1ad)][_0x842982(0x16f)]+'\x20'+_0x2475da+')'+a5_0xec0b4b[_0x842982(0x17b)](_0x3b4a12));}return 0x0;}let _0x1ba7ec,_0xbbd0ed;try{_0x1ba7ec=await _0x17b029['llm'][_0x842982(0x149)](_0x104cf9[_0x842982(0x1a7)]);}catch(_0x51b6bd){const _0x2a8f01=_0x51b6bd instanceof Error?_0x51b6bd[_0x842982(0x17a)]:String(_0x51b6bd);return _0x2a8f01[_0x842982(0x1c3)]('404')||_0x2a8f01['toLowerCase']()[_0x842982(0x1c3)](_0x842982(0x1b9))?console[_0x842982(0x1af)](a5_0xec0b4b[_0x842982(0x159)](_0x842982(0x1b1)+_0x104cf9[_0x842982(0x1a7)])):console[_0x842982(0x1af)](a5_0xec0b4b[_0x842982(0x159)](_0x842982(0x19c)+_0x104cf9[_0x842982(0x1a7)]+_0x842982(0x175)+_0x2a8f01)),0x1;}try{_0xbbd0ed=await _0x17b029[_0x842982(0x1d1)][_0x842982(0x153)](_0x104cf9['agentName'],_0x1ba7ec);}catch(_0x4501d2){const _0x285503=_0x4501d2 instanceof Error?_0x4501d2[_0x842982(0x17a)]:String(_0x4501d2);return _0x285503[_0x842982(0x1c3)]('404')||_0x285503[_0x842982(0x188)]()[_0x842982(0x1c3)](_0x842982(0x1b9))?console['log'](a5_0xec0b4b[_0x842982(0x159)](_0x842982(0x1b0)+_0x104cf9[_0x842982(0x17e)])):console[_0x842982(0x1af)](a5_0xec0b4b[_0x842982(0x159)](_0x842982(0x15d)+_0x104cf9[_0x842982(0x17e)]+_0x842982(0x175)+_0x285503)),0x1;}let _0x17db2a;if(!_0x48afae)try{_0x17db2a=await setupEvaluatorAgent(_0x17b029[_0x842982(0x1d1)],_0x3e9f01[_0x842982(0x1b3)]);}catch(_0x21f16d){const _0x4e9b07=_0x21f16d instanceof Error?_0x21f16d[_0x842982(0x17a)]:String(_0x21f16d);return console['log'](a5_0xec0b4b[_0x842982(0x159)](_0x842982(0x186)+_0x4e9b07)),0x1;}console['log'](a5_0xec0b4b['cyan']('Running\x20agent\x20tests...')),console[_0x842982(0x1af)](_0x842982(0x1d7)+a5_0xec0b4b[_0x842982(0x1d8)](_0x379037)),console[_0x842982(0x1af)](_0x842982(0x1c2)+a5_0xec0b4b['white'](_0x104cf9[_0x842982(0x1a7)]+'/'+_0x104cf9[_0x842982(0x17e)])),console[_0x842982(0x1af)]();const _0x2fede0=[],_0x16b617=[],_0x521c4b=Date[_0x842982(0x1c0)]();for(let _0x232cf5=0x0;_0x232cf5<_0x3e2eeb[_0x842982(0x16f)];_0x232cf5++){const _0x3594b6=_0x3e2eeb[_0x232cf5];_0x3e2eeb[_0x842982(0x16f)]>0x1?console[_0x842982(0x1af)]('Test\x20'+(_0x232cf5+0x1)+'/'+_0x3e2eeb['length']+':\x20'+a5_0xec0b4b[_0x842982(0x1d8)](_0x3594b6[_0x842982(0x14f)])):console[_0x842982(0x1af)](_0x842982(0x1ce)+a5_0xec0b4b['white'](_0x3594b6[_0x842982(0x14f)]));const _0x3826a0=createCommandSpinner(_0x842982(0x183)+_0x3594b6['rounds']['length']+_0x842982(0x1c1));_0x3826a0['start']();try{const {result:_0x1660c,conversation:_0x345ed5}=await runTest(_0x17b029['llm'],_0x3594b6,{'agentId':_0xbbd0ed,'projectId':_0x1ba7ec,'site':_0x379037,'noEval':_0x48afae,'evaluatorId':_0x17db2a,'onRoundStart':(_0x1cb47c,_0x448d92)=>{const _0x100106=_0x842982;_0x3826a0['text']=_0x100106(0x14c)+(_0x1cb47c+0x1)+'/'+_0x448d92+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x36fae9,_0xb9e0ad,_0x451e58)=>{const _0x33a64e=_0x842982,_0x29544c=formatElapsed(_0xb9e0ad);_0x451e58?console[_0x33a64e(0x1af)](_0x33a64e(0x18a)+(_0x36fae9+0x1)+'/'+_0x3594b6[_0x33a64e(0x1ad)][_0x33a64e(0x16f)]+_0x33a64e(0x16a)+a5_0xec0b4b[_0x33a64e(0x148)]('✓')+'\x20('+_0x29544c+')'):console[_0x33a64e(0x1af)](_0x33a64e(0x18a)+(_0x36fae9+0x1)+'/'+_0x3594b6[_0x33a64e(0x1ad)]['length']+'...\x20'+a5_0xec0b4b['red']('✗'));},'onEvaluationStart':()=>{_0x3826a0['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x40ff55=>{const _0x45b1e6=_0x842982,_0x44aa57=formatElapsed(_0x40ff55);console[_0x45b1e6(0x1af)](_0x45b1e6(0x190)+a5_0xec0b4b[_0x45b1e6(0x148)]('✓')+'\x20('+_0x44aa57+')');}});_0x3826a0[_0x842982(0x160)](),_0x2fede0[_0x842982(0x1a5)](_0x1660c),_0x16b617[_0x842982(0x1a5)](_0x345ed5);if(_0x1660c[_0x842982(0x150)]===_0x842982(0x15f))console[_0x842982(0x1af)](a5_0xec0b4b[_0x842982(0x148)](_0x842982(0x199)+_0x1660c['reason']));else _0x1660c['status']===_0x842982(0x1cd)?console['log'](a5_0xec0b4b['red']('✗\x20FAIL:\x20'+_0x1660c[_0x842982(0x1a4)])):console[_0x842982(0x1af)](a5_0xec0b4b['red'](_0x842982(0x18d)+_0x1660c[_0x842982(0x1a4)]));_0x1660c['conversation_url']&&console['log'](a5_0xec0b4b['dim']('Conversation\x20URL:\x20'+_0x1660c[_0x842982(0x1cc)])),console[_0x842982(0x1af)]();}catch(_0x169305){_0x3826a0['stop']();const _0x52811a=_0x169305 instanceof Error?_0x169305[_0x842982(0x17a)]:String(_0x169305);console['log'](a5_0xec0b4b[_0x842982(0x159)]('✗\x20ERROR:\x20'+_0x52811a)),console[_0x842982(0x1af)](),_0x2fede0['push']({'name':_0x3594b6['name'],'status':_0x842982(0x162),'reason':_0x52811a,'timestamp':new Date()[_0x842982(0x189)](),'duration_ms':0x0});}}const _0x3a9633=Date[_0x842982(0x1c0)]()-_0x521c4b,_0x381740=_0x2fede0[_0x842982(0x18f)](_0x43973f=>_0x43973f[_0x842982(0x150)]===_0x842982(0x15f))[_0x842982(0x16f)],_0x1e45ab=_0x2fede0[_0x842982(0x18f)](_0x44e796=>_0x44e796[_0x842982(0x150)]===_0x842982(0x1cd))['length'],_0x564190=_0x2fede0['filter'](_0x59c0e9=>_0x59c0e9['status']==='ERROR')['length'];console['log']('━'['repeat'](0x3c)),console['log'](_0x842982(0x15e)),console['log']('━'['repeat'](0x3c)),console[_0x842982(0x1af)](_0x842982(0x19b)+_0x2fede0[_0x842982(0x16f)]),console['log']('Passed:\x20\x20\x20'+a5_0xec0b4b[_0x842982(0x148)](_0x381740)),console['log'](_0x842982(0x1c5)+a5_0xec0b4b[_0x842982(0x159)](_0x1e45ab));_0x564190>0x0&&console[_0x842982(0x1af)](_0x842982(0x1b7)+a5_0xec0b4b[_0x842982(0x159)](_0x564190));console[_0x842982(0x1af)](_0x842982(0x1c6)+formatElapsed(_0x3a9633)),console[_0x842982(0x1af)]('━'[_0x842982(0x1d2)](0x3c));const _0x8a3ac8=_0x2fede0[_0x842982(0x18f)](_0x5c87a2=>_0x5c87a2[_0x842982(0x150)]!==_0x842982(0x15f));if(_0x8a3ac8[_0x842982(0x16f)]>0x0){console['log'](),console[_0x842982(0x1af)]('Failed\x20Tests:');for(const _0x3f1d79 of _0x8a3ac8){const _0x4e7640=a5_0xec0b4b[_0x842982(0x159)]('✗'),_0x8cb35e=_0x3f1d79[_0x842982(0x1a4)][_0x842982(0x16f)]>0x32?_0x3f1d79['reason'][_0x842982(0x196)](0x0,0x32)+_0x842982(0x1bd):_0x3f1d79[_0x842982(0x1a4)];console[_0x842982(0x1af)]('\x20\x20'+_0x4e7640+'\x20'+_0x3f1d79['name']+':\x20'+_0x8cb35e);}}const _0x5880e1={'summary':{'total':_0x2fede0[_0x842982(0x16f)],'passed':_0x381740,'failed':_0x1e45ab,'errors':_0x564190>0x0?_0x564190:undefined,'duration_ms':_0x3a9633},'tests':_0x2fede0,'agent':{'project':_0x104cf9[_0x842982(0x1a7)],'name':_0x104cf9[_0x842982(0x17e)],'site':_0x379037},'timestamp':new Date(_0x521c4b)[_0x842982(0x189)]()};try{const _0x2824da=buildCachedTestRun(_0x16b617,{'site':_0x379037,'projectId':_0x1ba7ec,'projectName':_0x104cf9['projectName'],'agentId':_0xbbd0ed,'agentName':_0x104cf9[_0x842982(0x17e)],'testYmlPath':a5_0x567d85[_0x842982(0x1cb)](_0x104cf9[_0x842982(0x1ba)])});saveLastTestRun(_0x2824da);}catch{}if(_0x3256bc!=='table'||_0xb58214){const _0x227e9f=formatResults(_0x5880e1,_0x3256bc);if(_0xb58214)try{a5_0xc5dfb3[_0x842982(0x1ac)](_0xb58214,_0x227e9f,'utf-8'),console[_0x842982(0x1af)](),console[_0x842982(0x1af)](a5_0xec0b4b[_0x842982(0x17b)]('Output\x20written\x20to:\x20'+_0xb58214));}catch(_0x20ac17){return console['log'](),console['log'](a5_0xec0b4b[_0x842982(0x159)](_0x842982(0x161)+_0x20ac17)),0x1;}else console[_0x842982(0x1af)](),console['log'](_0x227e9f);}return _0x8a3ac8['length']>0x0?0x1:0x0;}async[a5_0x3bce42(0x1a1)](_0x5f2202,_0x39f4f8){const _0x2c2bf3=a5_0x3bce42,{options:_0x15f5bc,tdx:_0x18677a}=_0x5f2202,{definition:_0x4a122e,agentInfo:_0x18e29a,outputFormat:_0x186836,outputFile:_0x4208fb}=_0x39f4f8,_0x53b55c=_0x15f5bc['site'],_0x1a42bb=loadLastTestRun();if(!_0x1a42bb)return console['log'](a5_0xec0b4b[_0x2c2bf3(0x159)](_0x2c2bf3(0x1a9))),console['log'](a5_0xec0b4b[_0x2c2bf3(0x17b)](_0x2c2bf3(0x1cf))),0x1;if(_0x1a42bb[_0x2c2bf3(0x171)][_0x2c2bf3(0x17e)]!==_0x18e29a['agentName'])return console[_0x2c2bf3(0x1af)](a5_0xec0b4b[_0x2c2bf3(0x159)](_0x2c2bf3(0x16b)+_0x1a42bb[_0x2c2bf3(0x171)][_0x2c2bf3(0x17e)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x18e29a['agentName']+'\x22.')),console[_0x2c2bf3(0x1af)](a5_0xec0b4b[_0x2c2bf3(0x17b)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x37d930=new Set(_0x1a42bb[_0x2c2bf3(0x14b)]['map'](_0x3007f2=>_0x3007f2['testName'])),_0x4a27b5=_0x4a122e['tests'][_0x2c2bf3(0x18f)](_0x501c9e=>!_0x37d930[_0x2c2bf3(0x164)](_0x501c9e[_0x2c2bf3(0x14f)]));if(_0x4a27b5[_0x2c2bf3(0x16f)]>0x0&&_0x1a42bb['site']!==_0x53b55c)return console['log'](a5_0xec0b4b[_0x2c2bf3(0x159)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x2c2bf3(0x1af)](a5_0xec0b4b[_0x2c2bf3(0x17b)](_0x2c2bf3(0x155)+_0x1a42bb[_0x2c2bf3(0x1b6)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x53b55c+'\x22.')),console['log'](a5_0xec0b4b['dim'](_0x2c2bf3(0x19e)+_0x1a42bb[_0x2c2bf3(0x1b6)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x67c4f4=_0x4a122e[_0x2c2bf3(0x18b)]['filter'](_0x3f5247=>_0x37d930[_0x2c2bf3(0x164)](_0x3f5247[_0x2c2bf3(0x14f)])),_0x4f8aab=_0x4a27b5;let _0x15ff37;try{_0x15ff37=await setupEvaluatorAgent(_0x18677a['llm'],_0x15f5bc[_0x2c2bf3(0x1b3)]);}catch(_0x5a9df6){const _0xd292be=_0x5a9df6 instanceof Error?_0x5a9df6[_0x2c2bf3(0x17a)]:String(_0x5a9df6);return console['log'](a5_0xec0b4b[_0x2c2bf3(0x159)](_0x2c2bf3(0x186)+_0xd292be)),0x1;}console[_0x2c2bf3(0x1af)](a5_0xec0b4b[_0x2c2bf3(0x1bc)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x2c2bf3(0x1af)]('Cached\x20run\x20from:\x20'+a5_0xec0b4b[_0x2c2bf3(0x1d8)](_0x1a42bb['timestamp'])),console[_0x2c2bf3(0x1af)]('Agent:\x20'+a5_0xec0b4b[_0x2c2bf3(0x1d8)](_0x1a42bb['agent'][_0x2c2bf3(0x1a7)]+'/'+_0x1a42bb[_0x2c2bf3(0x171)][_0x2c2bf3(0x17e)]));_0x4f8aab[_0x2c2bf3(0x16f)]>0x0&&console[_0x2c2bf3(0x1af)]('New\x20tests\x20to\x20execute:\x20'+a5_0xec0b4b['yellow'](_0x4f8aab[_0x2c2bf3(0x16f)]));console[_0x2c2bf3(0x1af)]();const _0x7d2926=[],_0x5f4ebd=Date[_0x2c2bf3(0x1c0)](),_0xfa3105=createCommandSpinner(_0x2c2bf3(0x1d6));if(_0x67c4f4['length']>0x0)try{const _0x190004=await reevaluateFromCache(_0x18677a[_0x2c2bf3(0x1d1)],_0x1a42bb,{'tests':_0x67c4f4},{'evaluatorId':_0x15ff37,'onTestStart':(_0x221da8,_0x31865b,_0x30fcc8)=>{const _0x53165d=_0x2c2bf3;_0xfa3105['text']=_0x53165d(0x16e)+(_0x31865b+0x1)+'/'+_0x30fcc8+':\x20'+_0x221da8+_0x53165d(0x1bd);if(!_0xfa3105[_0x53165d(0x1c7)])_0xfa3105[_0x53165d(0x1d5)]();},'onTestComplete':(_0x3c28d6,_0x5a0659)=>{const _0x388d6c=_0x2c2bf3;_0xfa3105['stop']();if(_0x5a0659[_0x388d6c(0x150)]===_0x388d6c(0x15f))console[_0x388d6c(0x1af)](a5_0xec0b4b[_0x388d6c(0x148)](_0x388d6c(0x199)+_0x3c28d6)+a5_0xec0b4b[_0x388d6c(0x17b)]('\x20(cached)'));else _0x5a0659[_0x388d6c(0x150)]===_0x388d6c(0x1cd)?console['log'](a5_0xec0b4b['red'](_0x388d6c(0x1a2)+_0x3c28d6+_0x388d6c(0x184)+_0x5a0659[_0x388d6c(0x1a4)])+a5_0xec0b4b[_0x388d6c(0x17b)](_0x388d6c(0x170))):console[_0x388d6c(0x1af)](a5_0xec0b4b[_0x388d6c(0x159)](_0x388d6c(0x18d)+_0x3c28d6+_0x388d6c(0x184)+_0x5a0659[_0x388d6c(0x1a4)]));_0x5a0659[_0x388d6c(0x1cc)]&&console[_0x388d6c(0x1af)](a5_0xec0b4b[_0x388d6c(0x17b)](_0x388d6c(0x1d4)+_0x5a0659[_0x388d6c(0x1cc)])),_0x7d2926[_0x388d6c(0x1a5)](_0x5a0659);},'onTestSkipped':(_0x3b1403,_0x1976d0)=>{const _0x1154ad=_0x2c2bf3;_0xfa3105[_0x1154ad(0x160)](),console[_0x1154ad(0x1af)](a5_0xec0b4b[_0x1154ad(0x163)](_0x1154ad(0x193)+_0x3b1403+'\x20-\x20'+_0x1976d0));}});for(const _0xb2b02d of _0x190004){!_0x7d2926[_0x2c2bf3(0x177)](_0x585111=>_0x585111['name']===_0xb2b02d['name'])&&_0x7d2926[_0x2c2bf3(0x1a5)](_0xb2b02d);}}catch(_0x5bca54){_0xfa3105[_0x2c2bf3(0x160)]();const _0x18f6c8=_0x5bca54 instanceof Error?_0x5bca54['message']:String(_0x5bca54);return console[_0x2c2bf3(0x1af)](a5_0xec0b4b[_0x2c2bf3(0x159)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x18f6c8)),0x1;}_0xfa3105[_0x2c2bf3(0x160)]();if(_0x4f8aab[_0x2c2bf3(0x16f)]>0x0){console[_0x2c2bf3(0x1af)](),console[_0x2c2bf3(0x1af)](a5_0xec0b4b[_0x2c2bf3(0x1bc)](_0x2c2bf3(0x154)));const {projectId:_0x25b17c,agentId:_0x24aa55}=_0x1a42bb[_0x2c2bf3(0x171)];for(const _0x5e9d5e of _0x4f8aab){console[_0x2c2bf3(0x1af)](_0x2c2bf3(0x19d)+a5_0xec0b4b[_0x2c2bf3(0x1d8)](_0x5e9d5e[_0x2c2bf3(0x14f)]));const _0x45f884=createCommandSpinner(_0x2c2bf3(0x183)+_0x5e9d5e[_0x2c2bf3(0x1ad)][_0x2c2bf3(0x16f)]+_0x2c2bf3(0x1c1));_0x45f884[_0x2c2bf3(0x1d5)]();try{const {result:_0x1fe503}=await runTest(_0x18677a[_0x2c2bf3(0x1d1)],_0x5e9d5e,{'agentId':_0x24aa55,'projectId':_0x25b17c,'site':_0x1a42bb['site'],'noEval':![],'evaluatorId':_0x15ff37,'onRoundStart':(_0x2d19a1,_0x1010fc)=>{const _0x20b32e=_0x2c2bf3;_0x45f884[_0x20b32e(0x165)]=_0x20b32e(0x14c)+(_0x2d19a1+0x1)+'/'+_0x1010fc+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x4f2d80,_0x185e2a,_0x16253a)=>{const _0x41bdcb=_0x2c2bf3,_0x128795=formatElapsed(_0x185e2a);_0x16253a?console[_0x41bdcb(0x1af)](_0x41bdcb(0x18a)+(_0x4f2d80+0x1)+'/'+_0x5e9d5e['rounds']['length']+_0x41bdcb(0x16a)+a5_0xec0b4b[_0x41bdcb(0x148)]('✓')+'\x20('+_0x128795+')'):console[_0x41bdcb(0x1af)](_0x41bdcb(0x18a)+(_0x4f2d80+0x1)+'/'+_0x5e9d5e[_0x41bdcb(0x1ad)][_0x41bdcb(0x16f)]+_0x41bdcb(0x16a)+a5_0xec0b4b[_0x41bdcb(0x159)]('✗'));},'onEvaluationStart':()=>{const _0x370a8a=_0x2c2bf3;_0x45f884[_0x370a8a(0x165)]='Evaluating\x20response...';},'onEvaluationComplete':_0x30b841=>{const _0x590732=_0x2c2bf3,_0x42f92d=formatElapsed(_0x30b841);console[_0x590732(0x1af)](_0x590732(0x190)+a5_0xec0b4b[_0x590732(0x148)]('✓')+'\x20('+_0x42f92d+')');}});_0x45f884[_0x2c2bf3(0x160)](),_0x7d2926[_0x2c2bf3(0x1a5)](_0x1fe503);if(_0x1fe503[_0x2c2bf3(0x150)]===_0x2c2bf3(0x15f))console[_0x2c2bf3(0x1af)](a5_0xec0b4b[_0x2c2bf3(0x148)](_0x2c2bf3(0x199)+_0x1fe503[_0x2c2bf3(0x1a4)])+a5_0xec0b4b[_0x2c2bf3(0x17b)](_0x2c2bf3(0x1c9)));else _0x1fe503[_0x2c2bf3(0x150)]===_0x2c2bf3(0x1cd)?console[_0x2c2bf3(0x1af)](a5_0xec0b4b[_0x2c2bf3(0x159)]('✗\x20FAIL:\x20'+_0x1fe503['reason'])+a5_0xec0b4b[_0x2c2bf3(0x17b)](_0x2c2bf3(0x1c9))):console[_0x2c2bf3(0x1af)](a5_0xec0b4b[_0x2c2bf3(0x159)](_0x2c2bf3(0x18d)+_0x1fe503[_0x2c2bf3(0x1a4)]));_0x1fe503[_0x2c2bf3(0x1cc)]&&console[_0x2c2bf3(0x1af)](a5_0xec0b4b[_0x2c2bf3(0x17b)](_0x2c2bf3(0x1d4)+_0x1fe503[_0x2c2bf3(0x1cc)]));}catch(_0x37cb5a){_0x45f884[_0x2c2bf3(0x160)]();const _0x8aaa2a=_0x37cb5a instanceof Error?_0x37cb5a['message']:String(_0x37cb5a);console[_0x2c2bf3(0x1af)](a5_0xec0b4b[_0x2c2bf3(0x159)](_0x2c2bf3(0x18d)+_0x8aaa2a)),_0x7d2926[_0x2c2bf3(0x1a5)]({'name':_0x5e9d5e[_0x2c2bf3(0x14f)],'status':_0x2c2bf3(0x162),'reason':_0x8aaa2a,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console['log']();const _0x54f9d2=Date['now']()-_0x5f4ebd,_0x51deed=_0x7d2926[_0x2c2bf3(0x18f)](_0xe9f2ba=>_0xe9f2ba[_0x2c2bf3(0x150)]==='PASS')[_0x2c2bf3(0x16f)],_0x27469f=_0x7d2926[_0x2c2bf3(0x18f)](_0x489d71=>_0x489d71[_0x2c2bf3(0x150)]===_0x2c2bf3(0x1cd))[_0x2c2bf3(0x16f)],_0x522f0c=_0x7d2926[_0x2c2bf3(0x18f)](_0x3d8e60=>_0x3d8e60[_0x2c2bf3(0x150)]===_0x2c2bf3(0x162))[_0x2c2bf3(0x16f)];console['log']('━'[_0x2c2bf3(0x1d2)](0x3c)),console[_0x2c2bf3(0x1af)](_0x2c2bf3(0x17c)),console[_0x2c2bf3(0x1af)]('━'[_0x2c2bf3(0x1d2)](0x3c)),console[_0x2c2bf3(0x1af)](_0x2c2bf3(0x19b)+_0x7d2926['length']),console[_0x2c2bf3(0x1af)](_0x2c2bf3(0x15a)+a5_0xec0b4b[_0x2c2bf3(0x148)](_0x51deed)),console['log'](_0x2c2bf3(0x1c5)+a5_0xec0b4b[_0x2c2bf3(0x159)](_0x27469f));_0x522f0c>0x0&&console[_0x2c2bf3(0x1af)](_0x2c2bf3(0x1b7)+a5_0xec0b4b['red'](_0x522f0c));console['log'](_0x2c2bf3(0x1c6)+formatElapsed(_0x54f9d2)),console['log']('━'[_0x2c2bf3(0x1d2)](0x3c));const _0x1db305={'summary':{'total':_0x7d2926['length'],'passed':_0x51deed,'failed':_0x27469f,'errors':_0x522f0c>0x0?_0x522f0c:undefined,'duration_ms':_0x54f9d2},'tests':_0x7d2926,'agent':{'project':_0x18e29a[_0x2c2bf3(0x1a7)],'name':_0x18e29a[_0x2c2bf3(0x17e)],'site':_0x53b55c},'timestamp':new Date(_0x5f4ebd)['toISOString']()};if(_0x186836!==_0x2c2bf3(0x174)||_0x4208fb){const _0x2373b2=formatResults(_0x1db305,_0x186836);if(_0x4208fb)try{a5_0xc5dfb3[_0x2c2bf3(0x1ac)](_0x4208fb,_0x2373b2,'utf-8'),console['log'](),console[_0x2c2bf3(0x1af)](a5_0xec0b4b[_0x2c2bf3(0x17b)](_0x2c2bf3(0x1bb)+_0x4208fb));}catch(_0x57f56e){return console['log'](),console[_0x2c2bf3(0x1af)](a5_0xec0b4b[_0x2c2bf3(0x159)](_0x2c2bf3(0x161)+_0x57f56e)),0x1;}else console[_0x2c2bf3(0x1af)](),console['log'](_0x2373b2);}const _0x23ac6f=_0x7d2926[_0x2c2bf3(0x18f)](_0x49afd9=>_0x49afd9[_0x2c2bf3(0x150)]!==_0x2c2bf3(0x15f));return _0x23ac6f[_0x2c2bf3(0x16f)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x7b37=a5_0x5bfe;(function(_0x2a3e29,_0x6aaf94){const _0x377cf6=a5_0x5bfe,_0x5545db=_0x2a3e29();while(!![]){try{const _0x5b759c=-parseInt(_0x377cf6(0x1ca))/0x1*(parseInt(_0x377cf6(0x1d8))/0x2)+parseInt(_0x377cf6(0x1c4))/0x3+-parseInt(_0x377cf6(0x223))/0x4+-parseInt(_0x377cf6(0x1cd))/0x5+-parseInt(_0x377cf6(0x1b1))/0x6*(-parseInt(_0x377cf6(0x1f9))/0x7)+-parseInt(_0x377cf6(0x1e6))/0x8+parseInt(_0x377cf6(0x1e9))/0x9;if(_0x5b759c===_0x6aaf94)break;else _0x5545db['push'](_0x5545db['shift']());}catch(_0x783425){_0x5545db['push'](_0x5545db['shift']());}}}(a5_0x1c5d,0x757ea));import*as a5_0x21bf8d from'node:fs';import*as a5_0x4eae37 from'node:path';function a5_0x5bfe(_0x35eea3,_0x4092ee){_0x35eea3=_0x35eea3-0x1ae;const _0x1c5d46=a5_0x1c5d();let _0x5bfe6d=_0x1c5d46[_0x35eea3];return _0x5bfe6d;}import a5_0x3ae7c1 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x1c5d(){const _0x846273=['basename','Run\x20\x27tdx\x20agent\x20pull\x20','\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','no_local_folder','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','No\x20tests\x20found\x20with\x20tags:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','tsv','dryRun','map','context','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','stop','isSpinning','conversation_url','Duration:\x20','12ulHdAX','conversations','✗\x20ERROR:\x20','site','...','\x20(cached)','reason','Error\x20writing\x20output\x20file:\x20','Project\x20path:\x20','projectDir','no_tests','toLowerCase','FAIL','resolveProjectId','json','join','Running:\x20','...\x20','404','119004KMowOW','includes','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','eval','Total:\x20\x20\x20\x20','round','32143KGfvDt','Tests\x20found:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','3313260JaPlzF','Cached\x20run\x20is\x20from\x20site\x20\x22','writeFileSync','\x20\x20Conversation:\x20','New\x20tests\x20to\x20execute:\x20','Output\x20written\x20to:\x20','agentName','Failed\x20Tests:','Passed:\x20\x20\x20','verbose','projectName','4sUUsQF','test.yml','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','cyan','add','No\x20tests\x20found\x20matching:\x20','\x20\x20Project:\x20','Failed:\x20\x20\x20','find','⚠\x20SKIPPED:\x20','testYmlPath','output',':\x20Sending\x20user\x20input...','has','2754032VOcOSi','agentDirs','Re-evaluating\x20','16841466oYVdpA','some','✗\x20ERROR:\x20Project\x20not\x20found:\x20','existsSync','text','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','jsonl','now','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','toISOString','push','\x22,\x20but\x20current\x20site\x20is\x20\x22','Conversation\x20URL:\x20','table','\x20\x20Round\x20','Available\x20tags:\x20','1966279FFgJey','✗\x20FAIL:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Running\x20test:\x20','length','Test\x20Configuration:','start','not\x20found','Test\x20','execute','Usage:','executeReeval','\x20(new)','source','timestamp','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Evaluating\x20response...','size','ERROR','llmProject','Available\x20tests:\x20','tests','\x20\x20Site:\x20','message','white','Agent:\x20','filter','tags','split','yellow','dim','Round\x20','agent','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Either\x20switch\x20to\x20the\x20\x22','\x22:\x20','\x20\x20Agent:\x20','trim','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','✓\x20PASS:\x20','repeat','3681144FsDlLs','Re-evaluation\x20Summary','\x20\x20-\x20','PASS','rounds','Error:\x20No\x20previous\x20test\x20run\x20found.','Running\x20agent\x20tests...','Cached\x20run\x20from:\x20','description','llm','found','Re-evaluating\x20cached\x20test\x20run...','Test\x20Summary','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','green','status','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x20\x20Evaluating...\x20','log','\x20-\x20','Round\x201/','red','forEach','name','resolve'];a5_0x1c5d=function(){return _0x846273;};return a5_0x1c5d();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x7b37(0x23a)]='agent:test';[a5_0x7b37(0x22b)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x7b37(0x202)](_0x1a24f1){const _0x5450a2=a5_0x7b37,{options:_0x3aa8f4,args:_0x5c7972,tdx:_0x45fe97}=_0x1a24f1,_0x1ac850=_0x5c7972[0x0]||'.',_0x5eccc5=_0x3aa8f4[_0x5450a2(0x244)],_0x333bde=_0x3aa8f4,_0x2e8730=_0x333bde[_0x5450a2(0x1c7)]===![],_0x4451c9=_0x333bde['reeval'],_0x85b4b7=_0x333bde[_0x5450a2(0x23a)],_0xf81afb=_0x333bde[_0x5450a2(0x214)],_0x3b1552=_0x3aa8f4['site'],_0x3e7b3d=_0x333bde[_0x5450a2(0x1e3)];if(_0x4451c9&&_0x2e8730)return console['log'](a5_0x3ae7c1[_0x5450a2(0x238)](_0x5450a2(0x1c6))),0x1;let _0x15c566='table';if(_0x333bde[_0x5450a2(0x1bf)])_0x15c566=_0x5450a2(0x1bf);else{if(_0x333bde['jsonl'])_0x15c566=_0x5450a2(0x1ef);else{if(_0x333bde[_0x5450a2(0x243)])_0x15c566=_0x5450a2(0x243);else{if(_0x333bde[_0x5450a2(0x1f6)])_0x15c566=_0x5450a2(0x1f6);}}}const _0x4c2eff=_0x333bde[_0x5450a2(0x20c)];let _0x16f177=_0x1ac850;const _0x54f482=a5_0x21bf8d[_0x5450a2(0x1ec)](_0x1ac850),_0x49d014=_0x1ac850==='.';if(!_0x54f482||_0x49d014){const _0x99e248=resolveProjectFromContext(_0x1ac850,_0x4c2eff,{'requireFile':_0x5450a2(0x1d9)});if(_0x99e248[_0x5450a2(0x22d)])_0x16f177=_0x99e248['projectDir'],_0x99e248[_0x5450a2(0x206)]===_0x5450a2(0x246)&&console['log'](a5_0x3ae7c1['dim']('Using\x20agent:\x20'+_0x16f177));else switch(_0x99e248['reason']){case'no_context':console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x216)](_0x99e248[_0x5450a2(0x210)])),console[_0x5450a2(0x235)](),console[_0x5450a2(0x235)](_0x5450a2(0x203)),console[_0x5450a2(0x235)](_0x5450a2(0x23e)),console[_0x5450a2(0x235)]('\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)'),console[_0x5450a2(0x235)](),console['log'](_0x5450a2(0x242));return 0x1;case _0x5450a2(0x23f):console['log'](a5_0x3ae7c1['yellow'](_0x99e248[_0x5450a2(0x210)])),console[_0x5450a2(0x235)](),console[_0x5450a2(0x235)](_0x5450a2(0x23d)+_0x99e248[_0x5450a2(0x20c)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case'multiple_agents':{const _0x39075f=a5_0x4eae37[_0x5450a2(0x23c)](_0x99e248[_0x5450a2(0x1ba)]);console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x216)](_0x5450a2(0x1ee)+_0x99e248[_0x5450a2(0x20c)]+'\x22:'));for(const _0x58c8e4 of _0x99e248[_0x5450a2(0x1e7)]){console[_0x5450a2(0x235)](_0x5450a2(0x225)+_0x58c8e4);}return console[_0x5450a2(0x235)](),console['log'](_0x5450a2(0x230)+_0x39075f+'/<agent-name>'),0x1;}case _0x5450a2(0x1bb):console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x216)](_0x5450a2(0x220)+_0x99e248['llmProject']+'\x22.')),console['log'](a5_0x3ae7c1[_0x5450a2(0x217)](_0x5450a2(0x1b9)+_0x99e248[_0x5450a2(0x1ba)])),console[_0x5450a2(0x235)](),console['log'](_0x5450a2(0x21a));return 0x1;}}const {definition:_0x7b49a3,agentInfo:_0x41e50c}=parseTestFile(_0x16f177);let _0x515795=_0x7b49a3[_0x5450a2(0x20e)];if(_0x85b4b7){const _0x4ed3a7=_0x85b4b7[_0x5450a2(0x215)](',')[_0x5450a2(0x245)](_0x3f1964=>_0x3f1964[_0x5450a2(0x21f)]());_0x515795=_0x7b49a3[_0x5450a2(0x20e)][_0x5450a2(0x213)](_0x324094=>_0x4ed3a7[_0x5450a2(0x1c5)](_0x324094[_0x5450a2(0x23a)]));if(_0x515795['length']===0x0)return console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x216)](_0x5450a2(0x1dd)+_0x85b4b7)),console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x217)](_0x5450a2(0x20d)+_0x7b49a3[_0x5450a2(0x20e)][_0x5450a2(0x245)](_0xcdfab0=>_0xcdfab0[_0x5450a2(0x23a)])[_0x5450a2(0x1c0)](',\x20'))),0x1;}if(_0xf81afb){const _0x4dc4c3=_0xf81afb[_0x5450a2(0x215)](',')['map'](_0x121f22=>_0x121f22[_0x5450a2(0x21f)]()[_0x5450a2(0x1bc)]());_0x515795=_0x515795[_0x5450a2(0x213)](_0x439bc6=>_0x439bc6[_0x5450a2(0x214)]?.[_0x5450a2(0x1ea)](_0x35655c=>_0x4dc4c3[_0x5450a2(0x1c5)](_0x35655c[_0x5450a2(0x1bc)]())));if(_0x515795[_0x5450a2(0x1fd)]===0x0){console['log'](a5_0x3ae7c1[_0x5450a2(0x216)](_0x5450a2(0x241)+_0xf81afb));const _0x309a7b=new Set();return _0x7b49a3['tests'][_0x5450a2(0x239)](_0x4c2488=>_0x4c2488[_0x5450a2(0x214)]?.[_0x5450a2(0x239)](_0x4505f2=>_0x309a7b[_0x5450a2(0x1dc)](_0x4505f2))),_0x309a7b[_0x5450a2(0x20a)]>0x0?console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x217)](_0x5450a2(0x1f8)+[..._0x309a7b][_0x5450a2(0x1c0)](',\x20'))):console['log'](a5_0x3ae7c1[_0x5450a2(0x217)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x4451c9)return this[_0x5450a2(0x204)](_0x1a24f1,{'definition':{'tests':_0x515795},'agentInfo':_0x41e50c,'outputFormat':_0x15c566,'outputFile':_0x3e7b3d,'testNames':_0x85b4b7});if(_0x5eccc5){console['log'](a5_0x3ae7c1[_0x5450a2(0x1db)](_0x5450a2(0x1fe))),console['log'](_0x5450a2(0x20f)+a5_0x3ae7c1[_0x5450a2(0x211)](_0x3b1552)),console['log'](_0x5450a2(0x1de)+a5_0x3ae7c1[_0x5450a2(0x211)](_0x41e50c[_0x5450a2(0x1d7)])),console['log'](_0x5450a2(0x21e)+a5_0x3ae7c1['white'](_0x41e50c[_0x5450a2(0x1d3)])),console[_0x5450a2(0x235)](),console['log'](_0x5450a2(0x1cb)+a5_0x3ae7c1['white'](_0x515795[_0x5450a2(0x1fd)]));for(let _0x57d82a=0x0;_0x57d82a<_0x515795[_0x5450a2(0x1fd)];_0x57d82a++){const _0x3ceffc=_0x515795[_0x57d82a],_0x303c3c=_0x3ceffc[_0x5450a2(0x227)]['length']===0x1?_0x5450a2(0x1c9):_0x5450a2(0x227),_0x2e4d0d=_0x3ceffc[_0x5450a2(0x214)]?.['length']?'\x20['+_0x3ceffc[_0x5450a2(0x214)]['join'](',\x20')+']':'';console['log']('\x20\x20'+(_0x57d82a+0x1)+'.\x20'+a5_0x3ae7c1[_0x5450a2(0x211)](_0x3ceffc[_0x5450a2(0x23a)])+'\x20('+_0x3ceffc[_0x5450a2(0x227)]['length']+'\x20'+_0x303c3c+')'+a5_0x3ae7c1['dim'](_0x2e4d0d));}return 0x0;}let _0x3796c1,_0xca3ec1;try{_0x3796c1=await _0x45fe97[_0x5450a2(0x22c)][_0x5450a2(0x1be)](_0x41e50c[_0x5450a2(0x1d7)]);}catch(_0x24bbfd){const _0xb91eb6=_0x24bbfd instanceof Error?_0x24bbfd[_0x5450a2(0x210)]:String(_0x24bbfd);return _0xb91eb6['includes']('404')||_0xb91eb6['toLowerCase']()['includes'](_0x5450a2(0x200))?console[_0x5450a2(0x235)](a5_0x3ae7c1['red'](_0x5450a2(0x1eb)+_0x41e50c[_0x5450a2(0x1d7)])):console['log'](a5_0x3ae7c1[_0x5450a2(0x238)](_0x5450a2(0x1f1)+_0x41e50c['projectName']+_0x5450a2(0x21d)+_0xb91eb6)),0x1;}try{_0xca3ec1=await _0x45fe97['llm']['resolveAgentId'](_0x41e50c[_0x5450a2(0x1d3)],_0x3796c1);}catch(_0xb4a1f4){const _0x4a8b1e=_0xb4a1f4 instanceof Error?_0xb4a1f4[_0x5450a2(0x210)]:String(_0xb4a1f4);return _0x4a8b1e[_0x5450a2(0x1c5)](_0x5450a2(0x1c3))||_0x4a8b1e[_0x5450a2(0x1bc)]()[_0x5450a2(0x1c5)](_0x5450a2(0x200))?console[_0x5450a2(0x235)](a5_0x3ae7c1['red'](_0x5450a2(0x247)+_0x41e50c[_0x5450a2(0x1d3)])):console['log'](a5_0x3ae7c1[_0x5450a2(0x238)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x41e50c['agentName']+_0x5450a2(0x21d)+_0x4a8b1e)),0x1;}let _0x39ef77;if(!_0x2e8730)try{_0x39ef77=await setupEvaluatorAgent(_0x45fe97['llm'],_0x3aa8f4[_0x5450a2(0x1d6)]);}catch(_0x3ffb10){const _0x3e817c=_0x3ffb10 instanceof Error?_0x3ffb10['message']:String(_0x3ffb10);return console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x238)](_0x5450a2(0x233)+_0x3e817c)),0x1;}console[_0x5450a2(0x235)](a5_0x3ae7c1['cyan'](_0x5450a2(0x229))),console[_0x5450a2(0x235)]('Site:\x20'+a5_0x3ae7c1[_0x5450a2(0x211)](_0x3b1552)),console[_0x5450a2(0x235)](_0x5450a2(0x212)+a5_0x3ae7c1[_0x5450a2(0x211)](_0x41e50c[_0x5450a2(0x1d7)]+'/'+_0x41e50c[_0x5450a2(0x1d3)])),console[_0x5450a2(0x235)]();const _0xf434b8=[],_0x36acec=[],_0x10e3f1=Date[_0x5450a2(0x1f0)]();for(let _0x130c31=0x0;_0x130c31<_0x515795[_0x5450a2(0x1fd)];_0x130c31++){const _0x4aaf0f=_0x515795[_0x130c31];_0x515795[_0x5450a2(0x1fd)]>0x1?console[_0x5450a2(0x235)](_0x5450a2(0x201)+(_0x130c31+0x1)+'/'+_0x515795[_0x5450a2(0x1fd)]+':\x20'+a5_0x3ae7c1[_0x5450a2(0x211)](_0x4aaf0f[_0x5450a2(0x23a)])):console['log'](_0x5450a2(0x1fc)+a5_0x3ae7c1['white'](_0x4aaf0f[_0x5450a2(0x23a)]));const _0x3377da=createCommandSpinner(_0x5450a2(0x237)+_0x4aaf0f['rounds'][_0x5450a2(0x1fd)]+_0x5450a2(0x1e4));_0x3377da[_0x5450a2(0x1ff)]();try{const {result:_0x3ff843,conversation:_0x3eac06}=await runTest(_0x45fe97[_0x5450a2(0x22c)],_0x4aaf0f,{'agentId':_0xca3ec1,'projectId':_0x3796c1,'site':_0x3b1552,'noEval':_0x2e8730,'evaluatorId':_0x39ef77,'onRoundStart':(_0x30695f,_0x3c6cc2)=>{const _0x4c9cfe=_0x5450a2;_0x3377da['text']=_0x4c9cfe(0x218)+(_0x30695f+0x1)+'/'+_0x3c6cc2+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x4ab084,_0x33eb6c,_0x13546c)=>{const _0x9fe178=_0x5450a2,_0x1b529d=formatElapsed(_0x33eb6c);_0x13546c?console['log'](_0x9fe178(0x1f7)+(_0x4ab084+0x1)+'/'+_0x4aaf0f[_0x9fe178(0x227)]['length']+_0x9fe178(0x1c2)+a5_0x3ae7c1[_0x9fe178(0x231)]('✓')+'\x20('+_0x1b529d+')'):console[_0x9fe178(0x235)](_0x9fe178(0x1f7)+(_0x4ab084+0x1)+'/'+_0x4aaf0f[_0x9fe178(0x227)]['length']+_0x9fe178(0x1c2)+a5_0x3ae7c1[_0x9fe178(0x238)]('✗'));},'onEvaluationStart':()=>{const _0x4997dd=_0x5450a2;_0x3377da[_0x4997dd(0x1ed)]=_0x4997dd(0x209);},'onEvaluationComplete':_0x55e90e=>{const _0x375afc=_0x5450a2,_0x424972=formatElapsed(_0x55e90e);console[_0x375afc(0x235)](_0x375afc(0x234)+a5_0x3ae7c1['green']('✓')+'\x20('+_0x424972+')');}});_0x3377da['stop'](),_0xf434b8['push'](_0x3ff843),_0x36acec['push'](_0x3eac06);if(_0x3ff843[_0x5450a2(0x232)]===_0x5450a2(0x226))console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x231)](_0x5450a2(0x221)+_0x3ff843[_0x5450a2(0x1b7)]));else _0x3ff843[_0x5450a2(0x232)]==='FAIL'?console['log'](a5_0x3ae7c1[_0x5450a2(0x238)](_0x5450a2(0x1fa)+_0x3ff843['reason'])):console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x238)](_0x5450a2(0x1b3)+_0x3ff843[_0x5450a2(0x1b7)]));_0x3ff843[_0x5450a2(0x1af)]&&console[_0x5450a2(0x235)](a5_0x3ae7c1['dim'](_0x5450a2(0x1f5)+_0x3ff843[_0x5450a2(0x1af)])),console['log']();}catch(_0xdcebca){_0x3377da['stop']();const _0x51d2fd=_0xdcebca instanceof Error?_0xdcebca[_0x5450a2(0x210)]:String(_0xdcebca);console['log'](a5_0x3ae7c1[_0x5450a2(0x238)](_0x5450a2(0x1b3)+_0x51d2fd)),console[_0x5450a2(0x235)](),_0xf434b8[_0x5450a2(0x1f3)]({'name':_0x4aaf0f['name'],'status':_0x5450a2(0x20b),'reason':_0x51d2fd,'timestamp':new Date()[_0x5450a2(0x1f2)](),'duration_ms':0x0});}}const _0x5d7b1d=Date['now']()-_0x10e3f1,_0x1f0a69=_0xf434b8['filter'](_0x4d52b6=>_0x4d52b6[_0x5450a2(0x232)]===_0x5450a2(0x226))['length'],_0x4c1fc3=_0xf434b8['filter'](_0x4fa89e=>_0x4fa89e['status']===_0x5450a2(0x1bd))[_0x5450a2(0x1fd)],_0x258d64=_0xf434b8[_0x5450a2(0x213)](_0x3102ae=>_0x3102ae['status']===_0x5450a2(0x20b))[_0x5450a2(0x1fd)];console[_0x5450a2(0x235)]('━'['repeat'](0x3c)),console[_0x5450a2(0x235)](_0x5450a2(0x22f)),console[_0x5450a2(0x235)]('━'[_0x5450a2(0x222)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0xf434b8[_0x5450a2(0x1fd)]),console[_0x5450a2(0x235)](_0x5450a2(0x1d5)+a5_0x3ae7c1[_0x5450a2(0x231)](_0x1f0a69)),console[_0x5450a2(0x235)](_0x5450a2(0x1df)+a5_0x3ae7c1[_0x5450a2(0x238)](_0x4c1fc3));_0x258d64>0x0&&console[_0x5450a2(0x235)]('Errors:\x20\x20\x20'+a5_0x3ae7c1[_0x5450a2(0x238)](_0x258d64));console[_0x5450a2(0x235)](_0x5450a2(0x1b0)+formatElapsed(_0x5d7b1d)),console[_0x5450a2(0x235)]('━'[_0x5450a2(0x222)](0x3c));const _0x2f6755=_0xf434b8[_0x5450a2(0x213)](_0x16273c=>_0x16273c['status']!=='PASS');if(_0x2f6755['length']>0x0){console[_0x5450a2(0x235)](),console[_0x5450a2(0x235)](_0x5450a2(0x1d4));for(const _0x5c4980 of _0x2f6755){const _0xc2431f=a5_0x3ae7c1[_0x5450a2(0x238)]('✗'),_0x246a08=_0x5c4980['reason']['length']>0x32?_0x5c4980[_0x5450a2(0x1b7)]['substring'](0x0,0x32)+_0x5450a2(0x1b5):_0x5c4980['reason'];console['log']('\x20\x20'+_0xc2431f+'\x20'+_0x5c4980['name']+':\x20'+_0x246a08);}}const _0xe0091d={'summary':{'total':_0xf434b8[_0x5450a2(0x1fd)],'passed':_0x1f0a69,'failed':_0x4c1fc3,'errors':_0x258d64>0x0?_0x258d64:undefined,'duration_ms':_0x5d7b1d},'tests':_0xf434b8,'agent':{'project':_0x41e50c[_0x5450a2(0x1d7)],'name':_0x41e50c[_0x5450a2(0x1d3)],'site':_0x3b1552},'timestamp':new Date(_0x10e3f1)[_0x5450a2(0x1f2)]()};try{const _0x5d5aea=buildCachedTestRun(_0x36acec,{'site':_0x3b1552,'projectId':_0x3796c1,'projectName':_0x41e50c['projectName'],'agentId':_0xca3ec1,'agentName':_0x41e50c[_0x5450a2(0x1d3)],'testYmlPath':a5_0x4eae37[_0x5450a2(0x23b)](_0x41e50c[_0x5450a2(0x1e2)])});saveLastTestRun(_0x5d5aea);}catch{}if(_0x15c566!==_0x5450a2(0x1f6)||_0x3e7b3d){const _0x5d5b32=formatResults(_0xe0091d,_0x15c566);if(_0x3e7b3d)try{a5_0x21bf8d[_0x5450a2(0x1cf)](_0x3e7b3d,_0x5d5b32,'utf-8'),console[_0x5450a2(0x235)](),console[_0x5450a2(0x235)](a5_0x3ae7c1['dim'](_0x5450a2(0x1d2)+_0x3e7b3d));}catch(_0x3f4c04){return console['log'](),console[_0x5450a2(0x235)](a5_0x3ae7c1[_0x5450a2(0x238)](_0x5450a2(0x1b8)+_0x3f4c04)),0x1;}else console[_0x5450a2(0x235)](),console[_0x5450a2(0x235)](_0x5d5b32);}return _0x2f6755[_0x5450a2(0x1fd)]>0x0?0x1:0x0;}async['executeReeval'](_0x1f8e85,_0x9c9084){const _0x571e3d=a5_0x7b37,{options:_0xb04b1a,tdx:_0x106349}=_0x1f8e85,{definition:_0xede042,agentInfo:_0x5098b5,outputFormat:_0x9d5236,outputFile:_0x50c87c}=_0x9c9084,_0x2bae20=_0xb04b1a[_0x571e3d(0x1b4)],_0x36f9d1=loadLastTestRun();if(!_0x36f9d1)return console['log'](a5_0x3ae7c1['red'](_0x571e3d(0x228))),console[_0x571e3d(0x235)](a5_0x3ae7c1['dim'](_0x571e3d(0x21b))),0x1;if(_0x36f9d1[_0x571e3d(0x219)][_0x571e3d(0x1d3)]!==_0x5098b5[_0x571e3d(0x1d3)])return console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x238)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x36f9d1[_0x571e3d(0x219)][_0x571e3d(0x1d3)]+_0x571e3d(0x1fb)+_0x5098b5['agentName']+'\x22.')),console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x217)](_0x571e3d(0x1da))),0x1;const _0x42211c=new Set(_0x36f9d1[_0x571e3d(0x1b2)][_0x571e3d(0x245)](_0x256800=>_0x256800['testName'])),_0x42a0af=_0xede042[_0x571e3d(0x20e)][_0x571e3d(0x213)](_0x4d5cbf=>!_0x42211c[_0x571e3d(0x1e5)](_0x4d5cbf[_0x571e3d(0x23a)]));if(_0x42a0af['length']>0x0&&_0x36f9d1[_0x571e3d(0x1b4)]!==_0x2bae20)return console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x238)](_0x571e3d(0x240))),console[_0x571e3d(0x235)](a5_0x3ae7c1['dim'](_0x571e3d(0x1ce)+_0x36f9d1[_0x571e3d(0x1b4)]+_0x571e3d(0x1f4)+_0x2bae20+'\x22.')),console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x217)](_0x571e3d(0x21c)+_0x36f9d1['site']+_0x571e3d(0x1cc))),0x1;const _0xb9b70d=_0xede042[_0x571e3d(0x20e)]['filter'](_0x2a59c3=>_0x42211c[_0x571e3d(0x1e5)](_0x2a59c3['name'])),_0x2cb2e6=_0x42a0af;let _0x4ec8dc;try{_0x4ec8dc=await setupEvaluatorAgent(_0x106349['llm'],_0xb04b1a[_0x571e3d(0x1d6)]);}catch(_0x18746a){const _0x4d292a=_0x18746a instanceof Error?_0x18746a[_0x571e3d(0x210)]:String(_0x18746a);return console[_0x571e3d(0x235)](a5_0x3ae7c1['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x4d292a)),0x1;}console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x1db)](_0x571e3d(0x22e))),console['log'](_0x571e3d(0x22a)+a5_0x3ae7c1['white'](_0x36f9d1[_0x571e3d(0x207)])),console['log'](_0x571e3d(0x212)+a5_0x3ae7c1[_0x571e3d(0x211)](_0x36f9d1[_0x571e3d(0x219)][_0x571e3d(0x1d7)]+'/'+_0x36f9d1['agent'][_0x571e3d(0x1d3)]));_0x2cb2e6[_0x571e3d(0x1fd)]>0x0&&console['log'](_0x571e3d(0x1d1)+a5_0x3ae7c1[_0x571e3d(0x216)](_0x2cb2e6[_0x571e3d(0x1fd)]));console[_0x571e3d(0x235)]();const _0x187c59=[],_0x4385cb=Date[_0x571e3d(0x1f0)](),_0x2ba543=createCommandSpinner('Re-evaluating...');if(_0xb9b70d['length']>0x0)try{const _0x2ba735=await reevaluateFromCache(_0x106349['llm'],_0x36f9d1,{'tests':_0xb9b70d},{'evaluatorId':_0x4ec8dc,'onTestStart':(_0x2e5565,_0x9bbafe,_0x1a80bb)=>{const _0x26a5d0=_0x571e3d;_0x2ba543['text']=_0x26a5d0(0x1e8)+(_0x9bbafe+0x1)+'/'+_0x1a80bb+':\x20'+_0x2e5565+'...';if(!_0x2ba543[_0x26a5d0(0x1ae)])_0x2ba543['start']();},'onTestComplete':(_0x50196e,_0x47f3dc)=>{const _0xb6cf36=_0x571e3d;_0x2ba543[_0xb6cf36(0x248)]();if(_0x47f3dc[_0xb6cf36(0x232)]==='PASS')console[_0xb6cf36(0x235)](a5_0x3ae7c1[_0xb6cf36(0x231)](_0xb6cf36(0x221)+_0x50196e)+a5_0x3ae7c1[_0xb6cf36(0x217)]('\x20(cached)'));else _0x47f3dc['status']===_0xb6cf36(0x1bd)?console[_0xb6cf36(0x235)](a5_0x3ae7c1[_0xb6cf36(0x238)](_0xb6cf36(0x1fa)+_0x50196e+'\x20-\x20'+_0x47f3dc[_0xb6cf36(0x1b7)])+a5_0x3ae7c1[_0xb6cf36(0x217)](_0xb6cf36(0x1b6))):console['log'](a5_0x3ae7c1[_0xb6cf36(0x238)](_0xb6cf36(0x1b3)+_0x50196e+_0xb6cf36(0x236)+_0x47f3dc[_0xb6cf36(0x1b7)]));_0x47f3dc[_0xb6cf36(0x1af)]&&console[_0xb6cf36(0x235)](a5_0x3ae7c1[_0xb6cf36(0x217)](_0xb6cf36(0x1d0)+_0x47f3dc[_0xb6cf36(0x1af)])),_0x187c59['push'](_0x47f3dc);},'onTestSkipped':(_0x3beca1,_0x1751a5)=>{const _0x3ab88e=_0x571e3d;_0x2ba543[_0x3ab88e(0x248)](),console['log'](a5_0x3ae7c1['yellow'](_0x3ab88e(0x1e1)+_0x3beca1+_0x3ab88e(0x236)+_0x1751a5));}});for(const _0x376660 of _0x2ba735){!_0x187c59[_0x571e3d(0x1e0)](_0x1b62d0=>_0x1b62d0[_0x571e3d(0x23a)]===_0x376660[_0x571e3d(0x23a)])&&_0x187c59[_0x571e3d(0x1f3)](_0x376660);}}catch(_0x230d42){_0x2ba543[_0x571e3d(0x248)]();const _0x2fc01f=_0x230d42 instanceof Error?_0x230d42[_0x571e3d(0x210)]:String(_0x230d42);return console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x238)](_0x571e3d(0x208)+_0x2fc01f)),0x1;}_0x2ba543[_0x571e3d(0x248)]();if(_0x2cb2e6[_0x571e3d(0x1fd)]>0x0){console[_0x571e3d(0x235)](),console[_0x571e3d(0x235)](a5_0x3ae7c1['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x1043e5,agentId:_0x6d6704}=_0x36f9d1['agent'];for(const _0x219c55 of _0x2cb2e6){console[_0x571e3d(0x235)](_0x571e3d(0x1c1)+a5_0x3ae7c1['white'](_0x219c55[_0x571e3d(0x23a)]));const _0x4ac277=createCommandSpinner(_0x571e3d(0x237)+_0x219c55[_0x571e3d(0x227)][_0x571e3d(0x1fd)]+_0x571e3d(0x1e4));_0x4ac277[_0x571e3d(0x1ff)]();try{const {result:_0x50009e}=await runTest(_0x106349['llm'],_0x219c55,{'agentId':_0x6d6704,'projectId':_0x1043e5,'site':_0x36f9d1[_0x571e3d(0x1b4)],'noEval':![],'evaluatorId':_0x4ec8dc,'onRoundStart':(_0x9499cb,_0x3f9efb)=>{const _0x448e1d=_0x571e3d;_0x4ac277[_0x448e1d(0x1ed)]='Round\x20'+(_0x9499cb+0x1)+'/'+_0x3f9efb+_0x448e1d(0x1e4);},'onRoundComplete':(_0x59d6fb,_0x1532a,_0x41f9e2)=>{const _0x2c16e3=_0x571e3d,_0x1e34b6=formatElapsed(_0x1532a);_0x41f9e2?console[_0x2c16e3(0x235)](_0x2c16e3(0x1f7)+(_0x59d6fb+0x1)+'/'+_0x219c55[_0x2c16e3(0x227)][_0x2c16e3(0x1fd)]+_0x2c16e3(0x1c2)+a5_0x3ae7c1[_0x2c16e3(0x231)]('✓')+'\x20('+_0x1e34b6+')'):console[_0x2c16e3(0x235)]('\x20\x20Round\x20'+(_0x59d6fb+0x1)+'/'+_0x219c55['rounds'][_0x2c16e3(0x1fd)]+_0x2c16e3(0x1c2)+a5_0x3ae7c1['red']('✗'));},'onEvaluationStart':()=>{const _0x4dee05=_0x571e3d;_0x4ac277[_0x4dee05(0x1ed)]=_0x4dee05(0x209);},'onEvaluationComplete':_0x2bbd69=>{const _0x53d77a=_0x571e3d,_0x300239=formatElapsed(_0x2bbd69);console['log'](_0x53d77a(0x234)+a5_0x3ae7c1[_0x53d77a(0x231)]('✓')+'\x20('+_0x300239+')');}});_0x4ac277[_0x571e3d(0x248)](),_0x187c59['push'](_0x50009e);if(_0x50009e['status']===_0x571e3d(0x226))console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x231)](_0x571e3d(0x221)+_0x50009e[_0x571e3d(0x1b7)])+a5_0x3ae7c1[_0x571e3d(0x217)]('\x20(new)'));else _0x50009e[_0x571e3d(0x232)]===_0x571e3d(0x1bd)?console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x238)](_0x571e3d(0x1fa)+_0x50009e['reason'])+a5_0x3ae7c1[_0x571e3d(0x217)](_0x571e3d(0x205))):console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x238)](_0x571e3d(0x1b3)+_0x50009e['reason']));_0x50009e[_0x571e3d(0x1af)]&&console[_0x571e3d(0x235)](a5_0x3ae7c1['dim'](_0x571e3d(0x1d0)+_0x50009e[_0x571e3d(0x1af)]));}catch(_0x5adf55){_0x4ac277[_0x571e3d(0x248)]();const _0x387f08=_0x5adf55 instanceof Error?_0x5adf55[_0x571e3d(0x210)]:String(_0x5adf55);console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x238)](_0x571e3d(0x1b3)+_0x387f08)),_0x187c59['push']({'name':_0x219c55[_0x571e3d(0x23a)],'status':_0x571e3d(0x20b),'reason':_0x387f08,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x571e3d(0x235)]();const _0x13a1a7=Date[_0x571e3d(0x1f0)]()-_0x4385cb,_0x3c0712=_0x187c59['filter'](_0x35dc2e=>_0x35dc2e[_0x571e3d(0x232)]===_0x571e3d(0x226))[_0x571e3d(0x1fd)],_0x4842a4=_0x187c59[_0x571e3d(0x213)](_0x592308=>_0x592308[_0x571e3d(0x232)]===_0x571e3d(0x1bd))[_0x571e3d(0x1fd)],_0x2bac20=_0x187c59[_0x571e3d(0x213)](_0x1f2882=>_0x1f2882[_0x571e3d(0x232)]==='ERROR')[_0x571e3d(0x1fd)];console['log']('━'[_0x571e3d(0x222)](0x3c)),console[_0x571e3d(0x235)](_0x571e3d(0x224)),console[_0x571e3d(0x235)]('━'['repeat'](0x3c)),console['log'](_0x571e3d(0x1c8)+_0x187c59['length']),console[_0x571e3d(0x235)](_0x571e3d(0x1d5)+a5_0x3ae7c1[_0x571e3d(0x231)](_0x3c0712)),console[_0x571e3d(0x235)](_0x571e3d(0x1df)+a5_0x3ae7c1[_0x571e3d(0x238)](_0x4842a4));_0x2bac20>0x0&&console[_0x571e3d(0x235)]('Errors:\x20\x20\x20'+a5_0x3ae7c1['red'](_0x2bac20));console[_0x571e3d(0x235)](_0x571e3d(0x1b0)+formatElapsed(_0x13a1a7)),console[_0x571e3d(0x235)]('━'[_0x571e3d(0x222)](0x3c));const _0x5706cf={'summary':{'total':_0x187c59['length'],'passed':_0x3c0712,'failed':_0x4842a4,'errors':_0x2bac20>0x0?_0x2bac20:undefined,'duration_ms':_0x13a1a7},'tests':_0x187c59,'agent':{'project':_0x5098b5[_0x571e3d(0x1d7)],'name':_0x5098b5['agentName'],'site':_0x2bae20},'timestamp':new Date(_0x4385cb)[_0x571e3d(0x1f2)]()};if(_0x9d5236!==_0x571e3d(0x1f6)||_0x50c87c){const _0x3da27d=formatResults(_0x5706cf,_0x9d5236);if(_0x50c87c)try{a5_0x21bf8d[_0x571e3d(0x1cf)](_0x50c87c,_0x3da27d,'utf-8'),console[_0x571e3d(0x235)](),console['log'](a5_0x3ae7c1['dim']('Output\x20written\x20to:\x20'+_0x50c87c));}catch(_0xedfdc){return console['log'](),console[_0x571e3d(0x235)](a5_0x3ae7c1[_0x571e3d(0x238)]('Error\x20writing\x20output\x20file:\x20'+_0xedfdc)),0x1;}else console[_0x571e3d(0x235)](),console[_0x571e3d(0x235)](_0x3da27d);}const _0x1aaa2c=_0x187c59[_0x571e3d(0x213)](_0x4cd286=>_0x4cd286[_0x571e3d(0x232)]!==_0x571e3d(0x226));return _0x1aaa2c[_0x571e3d(0x1fd)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a6_0x16eaf9=a6_0x2fed;(function(_0x1113d1,_0x5ee8ea){const _0xa33628=a6_0x2fed,_0x4cc70f=_0x1113d1();while(!![]){try{const _0x48cb92=-parseInt(_0xa33628(0xe6))/0x1+parseInt(_0xa33628(0x116))/0x2+parseInt(_0xa33628(0xf1))/0x3+-parseInt(_0xa33628(0xfe))/0x4+-parseInt(_0xa33628(0xef))/0x5*(-parseInt(_0xa33628(0xf2))/0x6)+-parseInt(_0xa33628(0x101))/0x7*(-parseInt(_0xa33628(0x11a))/0x8)+-parseInt(_0xa33628(0x103))/0x9;if(_0x48cb92===_0x5ee8ea)break;else _0x4cc70f['push'](_0x4cc70f['shift']());}catch(_0x255d1c){_0x4cc70f['push'](_0x4cc70f['shift']());}}}(a6_0x3b6e,0x427ed));import{BaseCommand}from'./command.js';function a6_0x2fed(_0x375814,_0x533fcf){_0x375814=_0x375814-0xe1;const _0x3b6e07=a6_0x3b6e();let _0x2fed2d=_0x3b6e07[_0x375814];return _0x2fed2d;}import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x3b6e(){const _0x1a5cfa=['stack','includes','header','81829pPjIMF','Invalid\x20header\x20format:\x20\x22','set-cookie2','data','type','Endpoint\x20must\x20start\x20with\x20/:\x20','POST','error','\x22.\x20','25anqmaY','isArray','220746IqFzaC','567048CflKWG','workflow','entries','trim','log','proxy-authorization','cookie','GET','length','set-cookie','keys','trino','1259548uqqzLP','.\x20Valid\x20methods:\x20','name','680092RRSgrc','PATCH','6691878VtvdMS','body','description','api','llm','file','request','color','has','headers','noColor','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','join','Error:\x20','DELETE','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','site','toUpperCase','toLowerCase','955754nYrafl','message','verbose','x-trino-user','32DAHkCE','x-auth-token','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','status','authorization','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','method','llm-proxy','execute','.\x20Valid\x20types:\x20','startsWith','output','validate'];a6_0x3b6e=function(){return _0x1a5cfa;};return a6_0x3b6e();}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x16eaf9(0x11e),a6_0x16eaf9(0xf7),a6_0x16eaf9(0xf8),a6_0x16eaf9(0xfb),a6_0x16eaf9(0xe8),'x-xsrf-token',a6_0x16eaf9(0x11b),a6_0x16eaf9(0x119)]);function isSensitiveHeader(_0x3e7b9b){const _0x26eb29=a6_0x16eaf9;return SENSITIVE_HEADERS[_0x26eb29(0x10b)](_0x3e7b9b[_0x26eb29(0x115)]());}function parseHeader(_0x3d709b){const _0x12d6ec=a6_0x16eaf9,_0x30bd30=_0x3d709b['indexOf'](':');if(_0x30bd30===-0x1)throw new Error(_0x12d6ec(0xe7)+_0x3d709b+_0x12d6ec(0xee)+_0x12d6ec(0x10e));const _0x1acd4e=_0x3d709b['substring'](0x0,_0x30bd30)['trim'](),_0x2efe51=_0x3d709b['substring'](_0x30bd30+0x1)[_0x12d6ec(0xf5)]();if(!_0x1acd4e)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x3d709b+'\x22');return[_0x1acd4e,_0x2efe51];}export class ApiCommand extends BaseCommand{[a6_0x16eaf9(0x100)]=a6_0x16eaf9(0x106);[a6_0x16eaf9(0x105)]=a6_0x16eaf9(0x11c);[a6_0x16eaf9(0xe2)](_0x557d6c){const _0x346cf0=a6_0x16eaf9,{args:_0x106514,options:_0x283c33}=_0x557d6c,_0xa4f5e3=_0x283c33;if(_0x106514[_0x346cf0(0xfa)]===0x0)return _0x346cf0(0x112);const _0x5212d6=_0x106514[0x0];if(!_0x5212d6[_0x346cf0(0x124)]('/'))return _0x346cf0(0xeb)+_0x5212d6;const _0xae474=_0xa4f5e3[_0x346cf0(0xe9)],_0x5f601d=_0xa4f5e3[_0x346cf0(0x108)];if(_0xae474&&_0x5f601d)return _0x346cf0(0x11f);const _0x410516=_0xa4f5e3[_0x346cf0(0x120)]||_0x346cf0(0xf9),_0x36306d=[_0x346cf0(0xf9),_0x346cf0(0xec),'PUT',_0x346cf0(0x111),_0x346cf0(0x102)];if(!_0x36306d['includes'](_0x410516[_0x346cf0(0x114)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x410516+_0x346cf0(0xff)+_0x36306d[_0x346cf0(0x10f)](',\x20');const _0x3a4b91=_0xa4f5e3[_0x346cf0(0xea)]||'td',_0x54faa0=['td','cdp',_0x346cf0(0xf3),_0x346cf0(0xfd),_0x346cf0(0x107),_0x346cf0(0x121)];if(!_0x54faa0[_0x346cf0(0xe4)](_0x3a4b91))return'Invalid\x20API\x20type:\x20'+_0x3a4b91+_0x346cf0(0x123)+_0x54faa0[_0x346cf0(0x10f)](',\x20');return undefined;}async[a6_0x16eaf9(0x122)](_0x563c63){const _0xbb15a4=a6_0x16eaf9,{options:_0x355358,args:_0x2e3b27,tdx:_0x164616}=_0x563c63,_0x5691b8=_0x355358,_0x5cfbdf=_0x2e3b27[0x0],_0x533b2c=(_0x5691b8[_0xbb15a4(0x120)]||_0xbb15a4(0xf9))[_0xbb15a4(0x114)](),_0xee80bc=_0x5691b8[_0xbb15a4(0xe9)],_0x1d4eb0=_0x5691b8[_0xbb15a4(0x108)],_0x146a0c=_0x5691b8[_0xbb15a4(0xe5)],_0x1d49f2=_0x5691b8['type']||'td';try{const _0x5875ec={};if(_0x146a0c){const _0x253e9c=Array[_0xbb15a4(0xf0)](_0x146a0c)?_0x146a0c:[_0x146a0c];for(const _0x1a5746 of _0x253e9c){const [_0x5ec3fb,_0x1d12ba]=parseHeader(_0x1a5746);_0x5875ec[_0x5ec3fb]=_0x1d12ba;}}let _0x29de8b;if(_0xee80bc)_0x29de8b=_0xee80bc;else{if(_0x1d4eb0)try{_0x29de8b=RawAPI['readBodyFromFile'](_0x1d4eb0);}catch(_0xdce887){return console[_0xbb15a4(0xed)](_0xbb15a4(0x110)+(_0xdce887 instanceof Error?_0xdce887[_0xbb15a4(0x117)]:String(_0xdce887))),0x1;}}const _0x14f003={'method':_0x533b2c,'apiType':_0x1d49f2,'includeHeaders':_0x355358['verbose']};_0x29de8b&&(_0x14f003[_0xbb15a4(0x104)]=_0x29de8b);Object[_0xbb15a4(0xfc)](_0x5875ec)[_0xbb15a4(0xfa)]>0x0&&(_0x14f003[_0xbb15a4(0x10c)]=_0x5875ec);if(_0x355358[_0xbb15a4(0x118)]){const _0x3c4dc0=resolveSite(_0x355358[_0xbb15a4(0x113)]),_0x53c8f3=getEndpoint(_0x3c4dc0,_0x1d49f2),_0x1446ab=''+_0x53c8f3+_0x5cfbdf;console['error']('>\x20'+_0x533b2c+'\x20'+_0x1446ab);const _0x2c96cc=getAuthHeaders(_0x3c4dc0),_0x394d21={..._0x2c96cc,..._0x5875ec};for(const [_0x4ffd1a,_0x271df9]of Object[_0xbb15a4(0xf4)](_0x394d21)){!isSensitiveHeader(_0x4ffd1a)&&console[_0xbb15a4(0xed)]('>\x20'+_0x4ffd1a+':\x20'+_0x271df9);}_0x29de8b&&console[_0xbb15a4(0xed)]('>'),console[_0xbb15a4(0xed)]('');}const _0x481257=await _0x164616[_0xbb15a4(0x106)][_0xbb15a4(0x109)](_0x5cfbdf,_0x14f003);if(_0x355358[_0xbb15a4(0x118)]&&_0x481257[_0xbb15a4(0x10c)]){console[_0xbb15a4(0xed)]('<\x20HTTP/1.1\x20'+_0x481257[_0xbb15a4(0x11d)]);for(const [_0x130091,_0x145202]of Object[_0xbb15a4(0xf4)](_0x481257[_0xbb15a4(0x10c)])){!isSensitiveHeader(_0x130091)&&console[_0xbb15a4(0xed)]('<\x20'+_0x130091+':\x20'+_0x145202);}console[_0xbb15a4(0xed)]('');}const _0x1c0a02=Boolean(_0x355358[_0xbb15a4(0xe1)]),_0x4f4477={'color':_0x355358['color'],'noColor':_0x355358[_0xbb15a4(0x10d)]||_0x1c0a02&&!_0x355358[_0xbb15a4(0x10a)]},_0x4cc890=colorizeJSON(_0x481257[_0xbb15a4(0xe9)],_0x4f4477);return _0x355358[_0xbb15a4(0xe1)]?(writeFileSync(_0x355358[_0xbb15a4(0xe1)],_0x4cc890),console[_0xbb15a4(0xed)]('Results\x20saved\x20to\x20'+_0x355358[_0xbb15a4(0xe1)])):console[_0xbb15a4(0xf6)](_0x4cc890),0x0;}catch(_0x9ebeaa){return _0x9ebeaa instanceof Error?(console[_0xbb15a4(0xed)](_0xbb15a4(0x110)+_0x9ebeaa[_0xbb15a4(0x117)]),_0x355358['verbose']&&_0x9ebeaa[_0xbb15a4(0xe3)]&&console['error']('\x0aStack\x20trace:\x0a'+_0x9ebeaa[_0xbb15a4(0xe3)])):console[_0xbb15a4(0xed)](_0xbb15a4(0x110)+String(_0x9ebeaa)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x15f73c=a7_0x17ae;(function(_0x50b42f,_0x199f68){const _0x3a262f=a7_0x17ae,_0x3030dd=_0x50b42f();while(!![]){try{const _0x141a1d=-parseInt(_0x3a262f(0x1a1))/0x1*(-parseInt(_0x3a262f(0x1b7))/0x2)+parseInt(_0x3a262f(0x1a0))/0x3*(parseInt(_0x3a262f(0x1c3))/0x4)+parseInt(_0x3a262f(0x1cf))/0x5+parseInt(_0x3a262f(0x1bf))/0x6*(parseInt(_0x3a262f(0x1c7))/0x7)+parseInt(_0x3a262f(0x19e))/0x8+parseInt(_0x3a262f(0x1b3))/0x9+-parseInt(_0x3a262f(0x1b6))/0xa;if(_0x141a1d===_0x199f68)break;else _0x3030dd['push'](_0x3030dd['shift']());}catch(_0x98f966){_0x3030dd['push'](_0x3030dd['shift']());}}}(a7_0x30fa,0x35409));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';function a7_0x30fa(){const _0x1773f8=['\x20(profile:\x20','✗\x20Validation\x20failed:\x20','Enter\x20site\x20name:','Select\x20your\x20Treasure\x20Data\x20site:','No\x20API\x20key\x20found\x20in\x20keychain','auth:clear','3366528mRburS','text','1187469xXJMeH','41569nnmwBs','Setup\x20API\x20key\x20authentication\x20interactively','message','Remove\x20API\x20key\x20from\x20system\x20keychain','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','join','jobs','Read\x20credential\x20from\x20','\x20\x20tdx','getUserInfo','error','first_name','System\x20keychain\x20is\x20not\x20available','green','tdx:\x20auth\x20clear','password','site','bold','1767015xjmRAE','us01','✓\x20Default\x20site\x20set\x20to\x20','11235550uFXvBV','6GBbDHO','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','description','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','\x20for\x20profile:\x20','status','filter','30BUDwsl','execute','Name:\x20','red','4rkqDdK','No\x20credential\x20found','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','apiKey','283801ZIWeRf','trim','\x0aSetup\x20cancelled','profile','other','✓\x20Authentication\x20successful\x0a','customSite','You\x20can\x20find\x20your\x20API\x20key\x20at:','6400NSqING','Enter\x20your\x20TD\x20API\x20key:','yellow','log','test','warn','auth:setup','✓\x20Profile\x20\x27','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','N/A','ERROR','auth','name','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','logLevel','User:\x20','email'];a7_0x30fa=function(){return _0x1773f8;};return a7_0x30fa();}import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x428331 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x17ae(_0x1b0c09,_0x185524){_0x1b0c09=_0x1b0c09-0x18b;const _0x30fa3f=a7_0x30fa();let _0x17aea6=_0x30fa3f[_0x1b0c09];return _0x17aea6;}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x4ac8c1 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x15f73c(0x193)]=a7_0x15f73c(0x18c);[a7_0x15f73c(0x1ba)]=a7_0x15f73c(0x1a2);async['execute'](_0x5a747e){const _0x1417a9=a7_0x15f73c,{options:_0x32a60b}=_0x5a747e,_0x125682=_0x32a60b[_0x1417a9(0x1ca)];console[_0x1417a9(0x1d2)](a7_0x4ac8c1[_0x1417a9(0x1b2)]('tdx:\x20auth\x20setup'));const _0x44021f=_0x32a60b['site']||_0x1417a9(0x1b4),{choices:_0x40c80f,initialIndex:_0x4b803e}=buildSiteChoices(_0x44021f),_0x8e5144=_0x125682?_0x1417a9(0x1bb)+_0x125682+'):':_0x1417a9(0x19b),_0x5aba2b=await a7_0x428331({'type':'select','name':_0x1417a9(0x1b1),'message':_0x8e5144,'choices':_0x40c80f,'initial':_0x4b803e});if(!_0x5aba2b[_0x1417a9(0x1b1)])return console['log'](_0x1417a9(0x1c9)),0x1;let _0x4ae7b3;if(_0x5aba2b[_0x1417a9(0x1b1)]===_0x1417a9(0x1cb)){const _0x4955cb=await a7_0x428331({'type':_0x1417a9(0x19f),'name':_0x1417a9(0x1cd),'message':_0x1417a9(0x19a),'initial':'us01','validate':_0x2fe72e=>{const _0x5c9dbb=_0x1417a9;if(!_0x2fe72e||!_0x2fe72e[_0x5c9dbb(0x1c8)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x5c9dbb(0x1d3)](_0x2fe72e[_0x5c9dbb(0x1c8)]()))return _0x5c9dbb(0x1b8);return!![];}});if(!_0x4955cb['customSite'])return console[_0x1417a9(0x1d2)](_0x1417a9(0x1c9)),0x1;_0x4ae7b3=_0x4955cb[_0x1417a9(0x1cd)];}else _0x4ae7b3=_0x5aba2b[_0x1417a9(0x1b1)];const _0x2741b9=resolveSite(_0x4ae7b3);console['log']('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x2741b9),console[_0x1417a9(0x1d2)](_0x1417a9(0x1ce)),console[_0x1417a9(0x1d2)]('\x20\x20'+getConsoleUrl(_0x2741b9,'/app/mp/ak'));const _0x47e0e4=await a7_0x428331({'type':_0x1417a9(0x1b0),'name':_0x1417a9(0x1c6),'message':_0x1417a9(0x1d0),'validate':_0x4b679c=>{const _0x1fb83c=_0x1417a9;if(!_0x4b679c||!_0x4b679c[_0x1fb83c(0x1c8)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x47e0e4[_0x1417a9(0x1c6)])return console[_0x1417a9(0x1d2)](_0x1417a9(0x1c9)),0x1;const _0x42599c=_0x47e0e4[_0x1417a9(0x1c6)];console[_0x1417a9(0x1d2)]('Validating\x20API\x20key...');try{const _0x2bd4ab=TDX['create']({'site':_0x2741b9,'apiKey':_0x42599c[_0x1417a9(0x1c8)](),'logLevel':_0x32a60b[_0x1417a9(0x195)]??LogLevel[_0x1417a9(0x191)]}),_0x11f972=await _0x2bd4ab[_0x1417a9(0x1a7)][_0x1417a9(0x1aa)]();console[_0x1417a9(0x1d2)](_0x1417a9(0x18f)+_0x11f972[_0x1417a9(0x197)]+')');const _0x1cca7a=await isKeychainAvailable();_0x1cca7a?(await saveAPIKeyAsync(_0x42599c[_0x1417a9(0x1c8)](),_0x2741b9,_0x125682),console[_0x1417a9(0x1d2)](_0x1417a9(0x1c5)+(_0x125682?_0x1417a9(0x198)+_0x125682+')':''))):(console[_0x1417a9(0x18b)](a7_0x4ac8c1['yellow'](_0x1417a9(0x18e))),console[_0x1417a9(0x18b)](a7_0x4ac8c1[_0x1417a9(0x1d1)](_0x1417a9(0x1a5))));if(_0x125682){const _0xa5493f={'site':_0x2741b9};saveProfileToUserConfig(_0x125682,_0xa5493f),console[_0x1417a9(0x1d2)](_0x1417a9(0x18d)+_0x125682+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x2741b9),console['log'](_0x1417a9(0x1b5)+_0x2741b9);const _0x558435=_0x125682?'\x20--profile\x20'+_0x125682:'';return console[_0x1417a9(0x1d2)](),console[_0x1417a9(0x1d2)](_0x1417a9(0x194)),console[_0x1417a9(0x1d2)](_0x1417a9(0x1a9)+_0x558435+_0x1417a9(0x1b9)),console['log'](_0x1417a9(0x1a9)+_0x558435+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x50d3b0){if(_0x50d3b0 instanceof HTTPClientError&&_0x50d3b0[_0x1417a9(0x1bd)]===0x191)return printAuthError(_0x50d3b0),0x1;return console[_0x1417a9(0x1ab)](a7_0x4ac8c1[_0x1417a9(0x1c2)](_0x1417a9(0x199)+(_0x50d3b0 instanceof Error?_0x50d3b0[_0x1417a9(0x1a3)]:String(_0x50d3b0)))),console[_0x1417a9(0x1ab)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x15f73c(0x193)]=a7_0x15f73c(0x192);[a7_0x15f73c(0x1ba)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x15f73c(0x1c0)](_0x2e0e48){const _0x42894d=a7_0x15f73c,{options:_0x429ab6,tdx:_0x484883}=_0x2e0e48,_0x2f56c7=_0x429ab6[_0x42894d(0x1b1)],_0x185d52=_0x429ab6[_0x42894d(0x1ca)],_0x478a44=_0x185d52?_0x185d52:_0x42894d(0x190);console['log']('tdx\x20profile:\x20'+_0x478a44+'\x20(site:\x20'+_0x2f56c7+')');const _0x493319=await resolveAPIKeyAsync(_0x2f56c7,_0x185d52);if(_0x493319){const {source:_0x4c3a7d,isDeprecated:_0x2b5bd2}=_0x493319,_0x78f8bf=_0x42894d(0x1a8)+_0x4c3a7d;console[_0x42894d(0x1d2)](_0x2b5bd2?a7_0x4ac8c1['yellow'](_0x78f8bf):_0x78f8bf);}else console[_0x42894d(0x1d2)](a7_0x4ac8c1[_0x42894d(0x1d1)](_0x42894d(0x1c4)));try{const _0x560000=await _0x484883[_0x42894d(0x1a7)][_0x42894d(0x1aa)]();return console[_0x42894d(0x1d2)](a7_0x4ac8c1[_0x42894d(0x1ae)](_0x42894d(0x1cc))),console[_0x42894d(0x1d2)](_0x42894d(0x196)+_0x560000['email']),(_0x560000['first_name']||_0x560000['last_name'])&&console[_0x42894d(0x1d2)](_0x42894d(0x1c1)+[_0x560000[_0x42894d(0x1ac)],_0x560000['last_name']][_0x42894d(0x1be)](Boolean)[_0x42894d(0x1a6)]('\x20')),0x0;}catch(_0x1f20a6){return _0x1f20a6 instanceof HTTPClientError&&_0x1f20a6['status']===0x191?printAuthError(_0x1f20a6,!![],_0x185d52):console[_0x42894d(0x1ab)](a7_0x4ac8c1[_0x42894d(0x1c2)](_0x42894d(0x199)+(_0x1f20a6 instanceof Error?_0x1f20a6[_0x42894d(0x1a3)]:String(_0x1f20a6)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x15f73c(0x193)]=a7_0x15f73c(0x19d);[a7_0x15f73c(0x1ba)]=a7_0x15f73c(0x1a4);async['execute'](_0x201b11){const _0x2b47ad=a7_0x15f73c,{options:_0x58cca4}=_0x201b11,_0x408e73=_0x58cca4[_0x2b47ad(0x1ca)];console[_0x2b47ad(0x1d2)](a7_0x4ac8c1[_0x2b47ad(0x1b2)](_0x2b47ad(0x1af)));const _0x18fe15=await isKeychainAvailable();if(!_0x18fe15)return console[_0x2b47ad(0x1ab)](a7_0x4ac8c1[_0x2b47ad(0x1c2)](_0x2b47ad(0x1ad))),0x1;const _0x1764dd=await deleteKeychainAPIKey(_0x408e73);return _0x1764dd?(clearCredentialCache(),console['log']('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x408e73?_0x2b47ad(0x198)+_0x408e73+')':'')),0x0):(console[_0x2b47ad(0x1d2)](_0x2b47ad(0x19c)+(_0x408e73?_0x2b47ad(0x1bc)+_0x408e73:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x36edb4=a8_0x23bc;(function(_0x22037f,_0x16d641){const _0x4f374b=a8_0x23bc,_0x41ab5c=_0x22037f();while(!![]){try{const _0x8ce680=parseInt(_0x4f374b(0x1f8))/0x1+-parseInt(_0x4f374b(0x228))/0x2*(parseInt(_0x4f374b(0x22b))/0x3)+-parseInt(_0x4f374b(0x218))/0x4+-parseInt(_0x4f374b(0x233))/0x5*(parseInt(_0x4f374b(0x1fc))/0x6)+parseInt(_0x4f374b(0x20e))/0x7+parseInt(_0x4f374b(0x225))/0x8+parseInt(_0x4f374b(0x21d))/0x9*(parseInt(_0x4f374b(0x214))/0xa);if(_0x8ce680===_0x16d641)break;else _0x41ab5c['push'](_0x41ab5c['shift']());}catch(_0x272f6b){_0x41ab5c['push'](_0x41ab5c['shift']());}}}(a8_0x37a2,0x3ac49));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 a8_0x37a2(){const _0x343076=['args','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','5LIrqpU','options','llmAgent','CHAT_NOT_FOUND','\x0aError:\x20','description','event','log','\x20\x20Cause:\x20','data','session\x20context','write','tool','llmProject','targetAgent','stdout','Using\x20agent\x20from\x20','chat-create','Create\x20a\x20new\x20chat\x20session','projectId','name','join','36120thSjoE','tool_result','context','stream','1808454AZfsPZ','chat','tool_call','targetWebSearchTool','content','agentId','resolveAgentId','\x27...','Chat\x20session:\x20','message','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','--agent\x20flag','stringify','verbose','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','type','stack','slice','1649977XOPVOP','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','resolveProjectId','Resolving\x20agent\x20\x27','Error:\x20','execute','70kZChoB','includes','chatId','\x0aStack\x20trace:','665324xhXRhJ','site','llm','\x27\x20not\x20found','targetKnowledgeBase','440397SdLTjI','cause','agent','error','code','handleChatEvent','getDefaultAgent','claude-4.5-haiku','1791040OwTRaY','Using\x20cached\x20default\x20agent:\x20','metadata','2622TalPEi','new','validate','297JBOXbu','Resolving\x20project\x20\x27','404','getOrCreateDefaultAgent','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','streamChat'];a8_0x37a2=function(){return _0x343076;};return a8_0x37a2();}function handleSDKError(_0x3c9e73,_0x4193c7){const _0x56c145=a8_0x23bc;if(_0x3c9e73 instanceof SDKError)console[_0x56c145(0x220)](_0x56c145(0x212)+_0x3c9e73[_0x56c145(0x205)]),_0x4193c7[_0x56c145(0x209)]&&(_0x3c9e73['cause']&&console[_0x56c145(0x220)](_0x56c145(0x23b)+_0x3c9e73[_0x56c145(0x21e)]),_0x3c9e73[_0x56c145(0x20c)]&&(console[_0x56c145(0x220)](_0x56c145(0x217)),console['error'](_0x3c9e73[_0x56c145(0x20c)])));else throw _0x3c9e73;}async function resolveAgentId(_0x4362ac,_0x456a80,_0x35eea1,_0x2b2cce,_0x40fb82){const _0x4ac1b6=a8_0x23bc,_0x130026=_0x456a80||_0x35eea1;if(_0x130026){const {projectName:_0x18832b,agentName:_0x2e1381}=parseAgentRef(_0x130026),_0x2d4bac=_0x2e1381||_0x130026,_0x304408=_0x2e1381?_0x18832b:_0x2b2cce;if(!_0x304408)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x40fb82){const _0x427e38=_0x456a80?_0x4ac1b6(0x207):_0x4ac1b6(0x23d);console['error'](_0x4ac1b6(0x1f2)+_0x427e38+':\x20'+_0x304408+'/'+_0x2d4bac);}const _0x49a242=await withSpinner(_0x4ac1b6(0x22c)+_0x304408+_0x4ac1b6(0x203),()=>_0x4362ac[_0x4ac1b6(0x21a)][_0x4ac1b6(0x210)](_0x304408),{'verbose':_0x40fb82}),_0x3c2dfa=await withSpinner(_0x4ac1b6(0x211)+_0x2d4bac+'\x27...',()=>_0x4362ac[_0x4ac1b6(0x21a)][_0x4ac1b6(0x202)](_0x2d4bac,_0x49a242[_0x4ac1b6(0x23c)]),{'verbose':_0x40fb82});return _0x3c2dfa[_0x4ac1b6(0x23c)];}else{const _0x29c599=_0x4362ac[_0x4ac1b6(0x21a)][_0x4ac1b6(0x223)]();if(_0x29c599)return _0x40fb82&&console['error'](_0x4ac1b6(0x226)+_0x29c599[_0x4ac1b6(0x1f6)]),_0x29c599['id'];const _0x362444=await withSpinner('Getting\x20default\x20agent...',()=>_0x4362ac[_0x4ac1b6(0x21a)][_0x4ac1b6(0x22e)](_0x4ac1b6(0x224),0x0),{'verbose':_0x40fb82});return _0x362444['data']['id'];}}export class ChatCommand extends BaseCommand{[a8_0x36edb4(0x1f6)]=a8_0x36edb4(0x1fd);[a8_0x36edb4(0x238)]=a8_0x36edb4(0x206);[a8_0x36edb4(0x22a)](_0x4edca5){const _0x1ebabc=a8_0x36edb4,_0xf51536=_0x4edca5[_0x1ebabc(0x231)]['join']('\x20');if(!_0xf51536)return _0x1ebabc(0x22f);return undefined;}async[a8_0x36edb4(0x230)](_0xd6ec6d,_0x507858,_0x26038b,_0x165f64,_0x325d8b){const _0x3bc164=a8_0x36edb4;for await(const _0x5a1543 of _0xd6ec6d[_0x3bc164(0x21a)][_0x3bc164(0x1fd)](_0x507858,{'agentId':_0x26038b,'chatId':_0x165f64})){if(_0x5a1543[_0x3bc164(0x20b)]===_0x3bc164(0x227)){const _0x50a051=_0x5a1543[_0x3bc164(0x23c)][_0x3bc164(0x216)];saveLastChatId(_0x50a051),_0x325d8b&&console[_0x3bc164(0x220)](_0x3bc164(0x204)+_0x50a051);}else _0x5a1543[_0x3bc164(0x20b)]===_0x3bc164(0x239)&&this['handleChatEvent'](_0x5a1543[_0x3bc164(0x23c)]);}}async['streamChatJsonl'](_0x598d05,_0x530b74,_0xd77786,_0x12c9ae){const _0x379331=a8_0x36edb4,_0xaf1b1d=_0x598d05[_0x379331(0x1fa)][_0x379331(0x219)];let _0x27f716=![];for await(const _0x44397d of _0x598d05[_0x379331(0x21a)][_0x379331(0x1fd)](_0x530b74,{'agentId':_0xd77786,'chatId':_0x12c9ae})){if(_0x44397d[_0x379331(0x20b)]===_0x379331(0x227)){const _0x4c5150=_0x44397d[_0x379331(0x23c)];saveLastChatId(_0x4c5150[_0x379331(0x216)]);const _0x2a5477=_0x4c5150[_0x379331(0x1f5)]&&_0x4c5150[_0x379331(0x201)]?getLLMConversationUrl(_0xaf1b1d,_0x4c5150['projectId'],_0x4c5150[_0x379331(0x201)],_0x4c5150['chatId']):undefined;console[_0x379331(0x23a)](JSON[_0x379331(0x208)]({'type':_0x379331(0x227),'data':{'chatId':_0x4c5150['chatId'],'agentId':_0x4c5150['agentId'],'consoleUrl':_0x2a5477}})),_0x27f716=!![];}else{if(_0x44397d[_0x379331(0x20b)]===_0x379331(0x239)){!_0x27f716&&_0x12c9ae&&(console[_0x379331(0x23a)](JSON[_0x379331(0x208)]({'type':_0x379331(0x227),'data':{'chatId':_0x12c9ae}})),_0x27f716=!![]);const _0x50c25c=_0x44397d[_0x379331(0x23c)];if(_0x379331(0x200)in _0x50c25c)console[_0x379331(0x23a)](JSON['stringify']({'type':_0x379331(0x200),'data':{'content':_0x50c25c[_0x379331(0x200)]}}));else{if(_0x379331(0x1fe)in _0x50c25c){const _0x1e014b=_0x50c25c['tool_call'];console[_0x379331(0x23a)](JSON[_0x379331(0x208)]({'type':'tool_call','data':{'id':_0x1e014b['id'],'name':_0x1e014b['functionName'],'target':_0x1e014b[_0x379331(0x21c)]?.[_0x379331(0x1f6)]||_0x1e014b[_0x379331(0x241)]?.[_0x379331(0x1f6)]||_0x1e014b[_0x379331(0x1ff)]?.[_0x379331(0x1f6)]||_0x1e014b['targetFunction']}}));}else{if(_0x379331(0x23f)in _0x50c25c)console['log'](JSON[_0x379331(0x208)]({'type':_0x379331(0x1f9),'data':{'id':_0x50c25c[_0x379331(0x23f)]['id'],'name':_0x50c25c[_0x379331(0x23f)]['functionName'],'result':typeof _0x50c25c['tool'][_0x379331(0x200)]==='string'?_0x50c25c[_0x379331(0x23f)]['content'][_0x379331(0x20d)](0x0,0x1f4):''}}));else _0x379331(0x220)in _0x50c25c&&console[_0x379331(0x23a)](JSON['stringify']({'type':_0x379331(0x220),'data':{'error':_0x50c25c['error']}}));}}}}}console[_0x379331(0x23a)](JSON[_0x379331(0x208)]({'type':'done'}));}async['execute'](_0x1b97bd){const _0x337999=a8_0x36edb4,{options:_0x4decdd,args:_0x27a926,tdx:_0x1d3dc0}=_0x1b97bd,_0x44e949=_0x27a926[_0x337999(0x1f7)]('\x20'),_0x104b46=_0x4decdd,_0x152e02=_0x104b46[_0x337999(0x21f)],_0x5c3e47=_0x104b46[_0x337999(0x235)],_0x35a12f=_0x104b46[_0x337999(0x240)],_0x32621b=_0x104b46[_0x337999(0x229)],_0x5e918f=_0x104b46['chatId'],_0x460bdc=_0x104b46[_0x337999(0x1fb)];if(_0x32621b&&_0x5e918f)return console[_0x337999(0x220)](_0x337999(0x232)),0x1;try{let _0x509e94,_0x152692;if(_0x5e918f)_0x152692=_0x5e918f;else!_0x32621b&&(_0x152692=loadLastChatId(),_0x152692&&_0x4decdd['verbose']&&console['error']('Continuing\x20chat:\x20'+_0x152692));!_0x5e918f&&(_0x32621b||!_0x152692)&&(_0x509e94=await resolveAgentId(_0x1d3dc0,_0x152e02,_0x5c3e47,_0x35a12f,_0x4decdd[_0x337999(0x209)]));const _0x5ca837=_0x460bdc?(_0x428c66,_0x59d56f,_0x59d5ea)=>this['streamChatJsonl'](_0x1d3dc0,_0x428c66,_0x59d56f,_0x59d5ea):(_0x9c6d3b,_0x21be4c,_0x297fb5)=>this[_0x337999(0x230)](_0x1d3dc0,_0x9c6d3b,_0x21be4c,_0x297fb5,_0x4decdd['verbose']);try{await _0x5ca837(_0x44e949,_0x509e94,_0x152692);}catch(_0x2798b5){const _0x5b30e5=_0x2798b5 instanceof SDKError&&_0x2798b5[_0x337999(0x221)]===ErrorCode[_0x337999(0x236)]||_0x2798b5 instanceof Error&&_0x2798b5[_0x337999(0x205)][_0x337999(0x215)](_0x337999(0x22d));if(_0x5b30e5&&_0x5e918f)return console[_0x337999(0x220)]('Error:\x20Chat\x20session\x20\x27'+_0x5e918f+_0x337999(0x21b)),0x1;if(_0x5b30e5)_0x4decdd[_0x337999(0x209)]&&console[_0x337999(0x220)](_0x337999(0x20a)),!_0x509e94&&(_0x509e94=await resolveAgentId(_0x1d3dc0,_0x152e02,_0x5c3e47,_0x35a12f,_0x4decdd['verbose'])),await _0x5ca837(_0x44e949,_0x509e94,undefined);else throw _0x2798b5;}return!_0x460bdc&&console[_0x337999(0x23a)](),0x0;}catch(_0x44d87d){return console[_0x337999(0x220)](),handleSDKError(_0x44d87d,_0x4decdd),0x1;}}[a8_0x36edb4(0x222)](_0xe84a){const _0x5c0ab1=a8_0x36edb4;if(_0x5c0ab1(0x200)in _0xe84a)process[_0x5c0ab1(0x242)][_0x5c0ab1(0x23e)](_0xe84a[_0x5c0ab1(0x200)]);else'error'in _0xe84a&&console[_0x5c0ab1(0x220)](_0x5c0ab1(0x237)+_0xe84a['error']);}}function a8_0x23bc(_0x1ab21c,_0x159f89){_0x1ab21c=_0x1ab21c-0x1f2;const _0x37a216=a8_0x37a2();let _0x23bc08=_0x37a216[_0x1ab21c];return _0x23bc08;}export class ChatCreateCommand extends BaseCommand{[a8_0x36edb4(0x1f6)]=a8_0x36edb4(0x1f3);['description']=a8_0x36edb4(0x1f4);[a8_0x36edb4(0x22a)](_0x3fd57a){const _0x39696d=a8_0x36edb4,_0x1c871e=_0x3fd57a[_0x39696d(0x234)],_0x3dd4be=_0x1c871e[_0x39696d(0x21f)],_0x3a8521=_0x1c871e[_0x39696d(0x235)];if(!_0x3dd4be&&!_0x3a8521)return _0x39696d(0x20f);return undefined;}async[a8_0x36edb4(0x213)](_0x439340){const _0x4f1d45=a8_0x36edb4,{options:_0x23fc6e,tdx:_0x407540}=_0x439340,_0x314161=_0x23fc6e,_0xc439dc=_0x314161[_0x4f1d45(0x21f)],_0x4c22b3=_0x314161[_0x4f1d45(0x235)],_0xc2ddf6=_0x314161[_0x4f1d45(0x240)];try{const _0xc3e29f=await resolveAgentId(_0x407540,_0xc439dc,_0x4c22b3,_0xc2ddf6,_0x23fc6e[_0x4f1d45(0x209)]),_0x135903=await _0x407540[_0x4f1d45(0x21a)]['startChat'](_0xc3e29f);return saveLastChatId(_0x135903['id']),console[_0x4f1d45(0x23a)](JSON[_0x4f1d45(0x208)]({'chatId':_0x135903['id'],'agentId':_0xc3e29f})),0x0;}catch(_0x226414){return handleSDKError(_0x226414,_0x23fc6e),0x1;}}}
|
|
1
|
+
const a8_0xbb12b7=a8_0x59c1;(function(_0x4320ce,_0x379db4){const _0x3b88c8=a8_0x59c1,_0x959638=_0x4320ce();while(!![]){try{const _0x4c0d9d=parseInt(_0x3b88c8(0x194))/0x1*(-parseInt(_0x3b88c8(0x195))/0x2)+-parseInt(_0x3b88c8(0x17e))/0x3*(parseInt(_0x3b88c8(0x151))/0x4)+parseInt(_0x3b88c8(0x190))/0x5*(-parseInt(_0x3b88c8(0x183))/0x6)+parseInt(_0x3b88c8(0x189))/0x7+parseInt(_0x3b88c8(0x15a))/0x8+parseInt(_0x3b88c8(0x17b))/0x9*(parseInt(_0x3b88c8(0x167))/0xa)+parseInt(_0x3b88c8(0x160))/0xb;if(_0x4c0d9d===_0x379db4)break;else _0x959638['push'](_0x959638['shift']());}catch(_0x55753f){_0x959638['push'](_0x959638['shift']());}}}(a8_0x304c,0x25b0b));import{BaseCommand}from'./command.js';function a8_0x59c1(_0x452366,_0x246466){_0x452366=_0x452366-0x148;const _0x304c04=a8_0x304c();let _0x59c16f=_0x304c04[_0x452366];return _0x59c16f;}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(_0x6cee05,_0x23e7f3){const _0x51f8fe=a8_0x59c1;if(_0x6cee05 instanceof SDKError)console[_0x51f8fe(0x161)](_0x51f8fe(0x162)+_0x6cee05[_0x51f8fe(0x150)]),_0x23e7f3[_0x51f8fe(0x16b)]&&(_0x6cee05['cause']&&console[_0x51f8fe(0x161)](_0x51f8fe(0x179)+_0x6cee05[_0x51f8fe(0x18d)]),_0x6cee05[_0x51f8fe(0x152)]&&(console['error'](_0x51f8fe(0x169)),console['error'](_0x6cee05[_0x51f8fe(0x152)])));else throw _0x6cee05;}function a8_0x304c(){const _0x25d195=['message','8NVmDaO','stack','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','tool_result','args','stringify','Create\x20a\x20new\x20chat\x20session','site','streamChat','1740936uLtKoY','validate','getOrCreateDefaultAgent','streamChatJsonl','resolveProjectId','chat-create','2730816ExPZxr','error','Error:\x20','\x27\x20not\x20found','projectId','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','content','1910YYfGHy','Continuing\x20chat:\x20','\x0aStack\x20trace:','metadata','verbose','chat','tool_call','agentId','chatId','join','llmAgent','startChat','string','Getting\x20default\x20agent...','getDefaultAgent','new','\x27...','handleChatEvent','\x20\x20Cause:\x20','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','10413CkJZDE','functionName','execute','48894ysBLwQ','tool','type','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','CHAT_NOT_FOUND','3414vojgzA','description','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','stdout','Using\x20agent\x20from\x20','llmProject','302491tJOFjY','llm','\x0aError:\x20','data','cause','Chat\x20session:\x20','name','2375pfkHUV','log','context','stream','272823dUbwhW','2Vtnfdj','code','event','targetKnowledgeBase','404','targetWebSearchTool','claude-4.5-haiku','slice','targetFunction','agent'];a8_0x304c=function(){return _0x25d195;};return a8_0x304c();}async function resolveAgentId(_0x51567d,_0x64076e,_0x1ef8c4,_0x9e9b8d,_0x2a2c43){const _0x15de73=a8_0x59c1,_0x244a67=_0x64076e||_0x1ef8c4;if(_0x244a67){const {projectName:_0x30903a,agentName:_0x35814f}=parseAgentRef(_0x244a67),_0x173c05=_0x35814f||_0x244a67,_0x463630=_0x35814f?_0x30903a:_0x9e9b8d;if(!_0x463630)throw new Error(_0x15de73(0x17a));if(_0x2a2c43){const _0x5d1296=_0x64076e?'--agent\x20flag':'session\x20context';console[_0x15de73(0x161)](_0x15de73(0x187)+_0x5d1296+':\x20'+_0x463630+'/'+_0x173c05);}const _0x53d2fd=await withSpinner('Resolving\x20project\x20\x27'+_0x463630+_0x15de73(0x177),()=>_0x51567d[_0x15de73(0x18a)][_0x15de73(0x15e)](_0x463630),{'verbose':_0x2a2c43}),_0x567ff2=await withSpinner('Resolving\x20agent\x20\x27'+_0x173c05+_0x15de73(0x177),()=>_0x51567d[_0x15de73(0x18a)]['resolveAgentId'](_0x173c05,_0x53d2fd[_0x15de73(0x18c)]),{'verbose':_0x2a2c43});return _0x567ff2[_0x15de73(0x18c)];}else{const _0x474803=_0x51567d['llm'][_0x15de73(0x175)]();if(_0x474803)return _0x2a2c43&&console[_0x15de73(0x161)]('Using\x20cached\x20default\x20agent:\x20'+_0x474803[_0x15de73(0x18f)]),_0x474803['id'];const _0x4d39c9=await withSpinner(_0x15de73(0x174),()=>_0x51567d[_0x15de73(0x18a)][_0x15de73(0x15c)](_0x15de73(0x14c),0x0),{'verbose':_0x2a2c43});return _0x4d39c9['data']['id'];}}export class ChatCommand extends BaseCommand{[a8_0xbb12b7(0x18f)]=a8_0xbb12b7(0x16c);[a8_0xbb12b7(0x184)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0xbb12b7(0x15b)](_0x5575e8){const _0x26158e=a8_0xbb12b7,_0x4220e7=_0x5575e8[_0x26158e(0x155)]['join']('\x20');if(!_0x4220e7)return _0x26158e(0x165);return undefined;}async['streamChat'](_0x56cd73,_0x31bcd0,_0x652382,_0x3b541e,_0x3e2fa4){const _0x3893c6=a8_0xbb12b7;for await(const _0x5b2c7d of _0x56cd73['llm']['chat'](_0x31bcd0,{'agentId':_0x652382,'chatId':_0x3b541e})){if(_0x5b2c7d[_0x3893c6(0x180)]===_0x3893c6(0x16a)){const _0x161626=_0x5b2c7d['data'][_0x3893c6(0x16f)];saveLastChatId(_0x161626),_0x3e2fa4&&console['error'](_0x3893c6(0x18e)+_0x161626);}else _0x5b2c7d['type']===_0x3893c6(0x148)&&this['handleChatEvent'](_0x5b2c7d[_0x3893c6(0x18c)]);}}async[a8_0xbb12b7(0x15d)](_0x48caac,_0x1f67e9,_0x3f4369,_0xf88cf3){const _0x5afaca=a8_0xbb12b7,_0x509509=_0x48caac[_0x5afaca(0x192)][_0x5afaca(0x158)];let _0x7184b7=![];for await(const _0x46e478 of _0x48caac[_0x5afaca(0x18a)][_0x5afaca(0x16c)](_0x1f67e9,{'agentId':_0x3f4369,'chatId':_0xf88cf3})){if(_0x46e478[_0x5afaca(0x180)]===_0x5afaca(0x16a)){const _0x302c9a=_0x46e478['data'];saveLastChatId(_0x302c9a[_0x5afaca(0x16f)]);const _0x2bf61c=_0x302c9a[_0x5afaca(0x164)]&&_0x302c9a[_0x5afaca(0x16e)]?getLLMConversationUrl(_0x509509,_0x302c9a[_0x5afaca(0x164)],_0x302c9a[_0x5afaca(0x16e)],_0x302c9a[_0x5afaca(0x16f)]):undefined;console['log'](JSON[_0x5afaca(0x156)]({'type':_0x5afaca(0x16a),'data':{'chatId':_0x302c9a[_0x5afaca(0x16f)],'agentId':_0x302c9a[_0x5afaca(0x16e)],'consoleUrl':_0x2bf61c}})),_0x7184b7=!![];}else{if(_0x46e478[_0x5afaca(0x180)]===_0x5afaca(0x148)){!_0x7184b7&&_0xf88cf3&&(console['log'](JSON[_0x5afaca(0x156)]({'type':_0x5afaca(0x16a),'data':{'chatId':_0xf88cf3}})),_0x7184b7=!![]);const _0xef839c=_0x46e478[_0x5afaca(0x18c)];if('content'in _0xef839c)console[_0x5afaca(0x191)](JSON['stringify']({'type':'content','data':{'content':_0xef839c['content']}}));else{if(_0x5afaca(0x16d)in _0xef839c){const _0x108b39=_0xef839c['tool_call'];console['log'](JSON['stringify']({'type':_0x5afaca(0x16d),'data':{'id':_0x108b39['id'],'name':_0x108b39[_0x5afaca(0x17c)],'target':_0x108b39[_0x5afaca(0x149)]?.['name']||_0x108b39['targetAgent']?.['name']||_0x108b39[_0x5afaca(0x14b)]?.[_0x5afaca(0x18f)]||_0x108b39[_0x5afaca(0x14e)]}}));}else{if(_0x5afaca(0x17f)in _0xef839c)console[_0x5afaca(0x191)](JSON[_0x5afaca(0x156)]({'type':_0x5afaca(0x154),'data':{'id':_0xef839c[_0x5afaca(0x17f)]['id'],'name':_0xef839c[_0x5afaca(0x17f)][_0x5afaca(0x17c)],'result':typeof _0xef839c[_0x5afaca(0x17f)]['content']===_0x5afaca(0x173)?_0xef839c[_0x5afaca(0x17f)][_0x5afaca(0x166)][_0x5afaca(0x14d)](0x0,0x1f4):''}}));else'error'in _0xef839c&&console[_0x5afaca(0x191)](JSON[_0x5afaca(0x156)]({'type':_0x5afaca(0x161),'data':{'error':_0xef839c[_0x5afaca(0x161)]}}));}}}}}console[_0x5afaca(0x191)](JSON[_0x5afaca(0x156)]({'type':'done'}));}async[a8_0xbb12b7(0x17d)](_0x4b6c3f){const _0x2d3a59=a8_0xbb12b7,{options:_0xcdf4bc,args:_0x4cbcb3,tdx:_0x49ab48}=_0x4b6c3f,_0x14550b=_0x4cbcb3[_0x2d3a59(0x170)]('\x20'),_0x244657=_0xcdf4bc,_0x24e41b=_0x244657[_0x2d3a59(0x14f)],_0x2e63b5=_0x244657[_0x2d3a59(0x171)],_0x2620bc=_0x244657['llmProject'],_0x52799b=_0x244657[_0x2d3a59(0x176)],_0x1a3dac=_0x244657[_0x2d3a59(0x16f)],_0x587324=_0x244657[_0x2d3a59(0x193)];if(_0x52799b&&_0x1a3dac)return console[_0x2d3a59(0x161)](_0x2d3a59(0x185)),0x1;try{let _0x32b78d,_0x3ecea8;if(_0x1a3dac)_0x3ecea8=_0x1a3dac;else!_0x52799b&&(_0x3ecea8=loadLastChatId(),_0x3ecea8&&_0xcdf4bc[_0x2d3a59(0x16b)]&&console[_0x2d3a59(0x161)](_0x2d3a59(0x168)+_0x3ecea8));!_0x1a3dac&&(_0x52799b||!_0x3ecea8)&&(_0x32b78d=await resolveAgentId(_0x49ab48,_0x24e41b,_0x2e63b5,_0x2620bc,_0xcdf4bc[_0x2d3a59(0x16b)]));const _0x5d7178=_0x587324?(_0x2bc43d,_0x458d2a,_0x33b341)=>this[_0x2d3a59(0x15d)](_0x49ab48,_0x2bc43d,_0x458d2a,_0x33b341):(_0x231eaa,_0xd0a986,_0x26bce2)=>this[_0x2d3a59(0x159)](_0x49ab48,_0x231eaa,_0xd0a986,_0x26bce2,_0xcdf4bc['verbose']);try{await _0x5d7178(_0x14550b,_0x32b78d,_0x3ecea8);}catch(_0x42ed06){const _0x4dcf64=_0x42ed06 instanceof SDKError&&_0x42ed06[_0x2d3a59(0x196)]===ErrorCode[_0x2d3a59(0x182)]||_0x42ed06 instanceof Error&&_0x42ed06[_0x2d3a59(0x150)]['includes'](_0x2d3a59(0x14a));if(_0x4dcf64&&_0x1a3dac)return console[_0x2d3a59(0x161)]('Error:\x20Chat\x20session\x20\x27'+_0x1a3dac+_0x2d3a59(0x163)),0x1;if(_0x4dcf64)_0xcdf4bc[_0x2d3a59(0x16b)]&&console[_0x2d3a59(0x161)](_0x2d3a59(0x153)),!_0x32b78d&&(_0x32b78d=await resolveAgentId(_0x49ab48,_0x24e41b,_0x2e63b5,_0x2620bc,_0xcdf4bc[_0x2d3a59(0x16b)])),await _0x5d7178(_0x14550b,_0x32b78d,undefined);else throw _0x42ed06;}return!_0x587324&&console[_0x2d3a59(0x191)](),0x0;}catch(_0x18a87f){return console[_0x2d3a59(0x161)](),handleSDKError(_0x18a87f,_0xcdf4bc),0x1;}}[a8_0xbb12b7(0x178)](_0x17dcac){const _0x46a251=a8_0xbb12b7;if(_0x46a251(0x166)in _0x17dcac)process[_0x46a251(0x186)]['write'](_0x17dcac[_0x46a251(0x166)]);else _0x46a251(0x161)in _0x17dcac&&console[_0x46a251(0x161)](_0x46a251(0x18b)+_0x17dcac[_0x46a251(0x161)]);}}export class ChatCreateCommand extends BaseCommand{['name']=a8_0xbb12b7(0x15f);[a8_0xbb12b7(0x184)]=a8_0xbb12b7(0x157);[a8_0xbb12b7(0x15b)](_0x3b6a68){const _0x3ed7f3=a8_0xbb12b7,_0x2cdbd9=_0x3b6a68['options'],_0x550671=_0x2cdbd9[_0x3ed7f3(0x14f)],_0x592668=_0x2cdbd9[_0x3ed7f3(0x171)];if(!_0x550671&&!_0x592668)return _0x3ed7f3(0x181);return undefined;}async[a8_0xbb12b7(0x17d)](_0xb73e30){const _0x50f941=a8_0xbb12b7,{options:_0x251e06,tdx:_0x262d4c}=_0xb73e30,_0x219488=_0x251e06,_0x5b527f=_0x219488[_0x50f941(0x14f)],_0x261272=_0x219488[_0x50f941(0x171)],_0x283945=_0x219488[_0x50f941(0x188)];try{const _0x5376f2=await resolveAgentId(_0x262d4c,_0x5b527f,_0x261272,_0x283945,_0x251e06['verbose']),_0x25ac72=await _0x262d4c['llm'][_0x50f941(0x172)](_0x5376f2);return saveLastChatId(_0x25ac72['id']),console[_0x50f941(0x191)](JSON['stringify']({'chatId':_0x25ac72['id'],'agentId':_0x5376f2})),0x0;}catch(_0x564406){return handleSDKError(_0x564406,_0x251e06),0x1;}}}
|