@treasuredata/tdx 0.25.6 → 0.25.8
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/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.d.ts +7 -0
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +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/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.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.d.ts +19 -0
- package/dist/sdk/segment/journey-validator.d.ts.map +1 -0
- package/dist/sdk/segment/journey-validator.js +1 -0
- package/dist/sdk/segment/journey-validator.js.map +1 -0
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +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.d.ts +42 -0
- package/dist/sdk/segment/push-recovery.d.ts.map +1 -0
- package/dist/sdk/segment/push-recovery.js +1 -0
- package/dist/sdk/segment/push-recovery.js.map +1 -0
- package/dist/sdk/segment/push-workflow.d.ts +18 -12
- package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/segment-def.d.ts +2 -0
- package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
- package/dist/sdk/segment/validate-files.d.ts.map +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/validate-files.js.map +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts +7 -7
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.d.ts +5 -0
- package/dist/sdk/segment.d.ts.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/segment.js.map +1 -1
- package/dist/sdk/types/cdp.d.ts +117 -0
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x2bad25=a3_0xc279;(function(_0x51d566,_0x33c6c1){const _0x2a411d=a3_0xc279,_0x1037ea=_0x51d566();while(!![]){try{const _0x3ac2f3=parseInt(_0x2a411d(0x1d0))/0x1+parseInt(_0x2a411d(0x1d5))/0x2+parseInt(_0x2a411d(0x1da))/0x3+-parseInt(_0x2a411d(0x1ca))/0x4*(-parseInt(_0x2a411d(0x1c5))/0x5)+-parseInt(_0x2a411d(0x1bf))/0x6*(parseInt(_0x2a411d(0x1d9))/0x7)+parseInt(_0x2a411d(0x1d6))/0x8+-parseInt(_0x2a411d(0x1ce))/0x9;if(_0x3ac2f3===_0x33c6c1)break;else _0x1037ea['push'](_0x1037ea['shift']());}catch(_0x38b0cf){_0x1037ea['push'](_0x1037ea['shift']());}}}(a3_0x2e6f,0xcaed8));import{BaseCommand}from'./command.js';function a3_0xc279(_0x30fd1d,_0x5c00a3){_0x30fd1d=_0x30fd1d-0x1b6;const _0x2e6fed=a3_0x2e6f();let _0xc27982=_0x2e6fed[_0x30fd1d];return _0xc27982;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x2e6f(){const _0x57ca6d=['Resolved\x20parent\x20ID:\x20','resolveSegmentId','425792htbXLZ','7375176ltzSql','Child\x20name:\x20','length','112322gQqroS','30912fOlJJi','✔\x20Found\x20','listActivations','execute','Site:\x20','Error:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Parent\x20name:\x20','data','Resolving\x20parent\x20segment\x20\x27','name','618caNuWp','Resolved\x20child\x20ID:\x20','segment','description','resolveParentId','Listing\x20activations\x20for\x20segment\x20\x27','248865LtVdZq','\x27...','\x20activation','error','verbose','120epPHGk','List\x20activations\x20for\x20a\x20segment','message','\x20\x20Cause:\x20','16174161kuFMTs','site','1642772aIwgfj','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','cause'];a3_0x2e6f=function(){return _0x57ca6d;};return a3_0x2e6f();}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x2bad25(0x1be)]='activations';[a3_0x2bad25(0x1c2)]=a3_0x2bad25(0x1cb);async[a3_0x2bad25(0x1b7)](_0x114b41){const _0x1d0628=a3_0x2bad25,{options:_0x4ed3e1,args:_0x5aa7f9,tdx:_0x378f1a}=_0x114b41;if(_0x5aa7f9['length']===0x0)return console[_0x1d0628(0x1c8)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x1d0628(0x1c8)](_0x1d0628(0x1ba)),0x1;try{const {parentId:_0x3c19b7,childId:_0x323a83}=parseSegmentRef(_0x5aa7f9[0x0]);if(!_0x323a83)return console['error'](_0x1d0628(0x1d1)),console[_0x1d0628(0x1c8)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x4ed3e1['verbose']&&(console['error'](_0x1d0628(0x1b8)+_0x4ed3e1[_0x1d0628(0x1cf)]),console[_0x1d0628(0x1c8)](_0x1d0628(0x1bb)+_0x3c19b7),console[_0x1d0628(0x1c8)](_0x1d0628(0x1d7)+_0x323a83));const _0x4c1d79=await withSpinner(_0x1d0628(0x1bd)+_0x3c19b7+'\x27...',()=>_0x378f1a[_0x1d0628(0x1c1)][_0x1d0628(0x1c3)](_0x3c19b7),{'verbose':_0x4ed3e1['verbose']}),_0x28d97d=_0x4c1d79[_0x1d0628(0x1bc)];_0x4ed3e1[_0x1d0628(0x1c9)]&&console[_0x1d0628(0x1c8)](_0x1d0628(0x1d3)+_0x28d97d);const _0x2c421b=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x323a83+_0x1d0628(0x1c6),()=>_0x378f1a[_0x1d0628(0x1c1)][_0x1d0628(0x1d4)](_0x28d97d,_0x323a83),{'verbose':_0x4ed3e1['verbose']}),_0x4548b5=_0x2c421b[_0x1d0628(0x1bc)];_0x4ed3e1[_0x1d0628(0x1c9)]&&console[_0x1d0628(0x1c8)](_0x1d0628(0x1c0)+_0x4548b5);const _0x1ab1c0=await withSpinner(_0x1d0628(0x1c4)+_0x323a83+_0x1d0628(0x1c6),()=>_0x378f1a[_0x1d0628(0x1c1)][_0x1d0628(0x1b6)](_0x28d97d,_0x4548b5),{'verbose':_0x4ed3e1['verbose']}),_0x5399db=_0x1ab1c0[_0x1d0628(0x1bc)];return console[_0x1d0628(0x1c8)](_0x1d0628(0x1db)+_0x5399db[_0x1d0628(0x1d8)]+_0x1d0628(0x1c7)+(_0x5399db[_0x1d0628(0x1d8)]!==0x1?'s':'')),await handleSDKOutput(_0x5399db,_0x4ed3e1),0x0;}catch(_0x58c6ed){if(_0x58c6ed instanceof SDKError)return console[_0x1d0628(0x1c8)](_0x1d0628(0x1b9)+_0x58c6ed[_0x1d0628(0x1cc)]),_0x58c6ed[_0x1d0628(0x1d2)]&&console[_0x1d0628(0x1c8)](_0x1d0628(0x1cd)+_0x58c6ed[_0x1d0628(0x1d2)]),0x1;throw _0x58c6ed;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x3da32f=a4_0x4a38;(function(_0x877152,_0x51b68a){const _0x49b7d7=a4_0x4a38,_0x380fdb=_0x877152();while(!![]){try{const _0x5ace29=-parseInt(_0x49b7d7(0x1a4))/0x1+parseInt(_0x49b7d7(0x114))/0x2+-parseInt(_0x49b7d7(0x169))/0x3*(parseInt(_0x49b7d7(0x104))/0x4)+parseInt(_0x49b7d7(0x18e))/0x5*(-parseInt(_0x49b7d7(0x188))/0x6)+parseInt(_0x49b7d7(0x112))/0x7+parseInt(_0x49b7d7(0x133))/0x8+parseInt(_0x49b7d7(0x195))/0x9;if(_0x5ace29===_0x51b68a)break;else _0x380fdb['push'](_0x380fdb['shift']());}catch(_0x43df33){_0x380fdb['push'](_0x380fdb['shift']());}}}(a4_0x88f7,0x5ac4a));import a4_0x727e9d from'chalk';import a4_0xba3762 from'path';import{existsSync,readFileSync}from'fs';function a4_0x88f7(){const _0x449760=['\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','hasChanges','\x20\x20Experimental\x20Artifact\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','\x0aPush\x20summary\x20for\x20\x27','\x20successfully','New\x20project:\x20','\x20\x20Integration\x20\x22','\x0aChanges\x20to\x20agent\x20\x27','projectName','Analyzing\x20project\x20\x22','red','projectId','cyan','\x0aError:','llm_project','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Would\x20push\x20agent:\x20','\x20files\x20to\x20','\x22\x20to\x20a\x20different\x20profile','push','Dry\x20run\x20-\x20no\x20changes\x20made','\x20resources?','\x0aChanges:','New\x20project\x20name\x20is\x20required','\x0aPull\x20summary\x20for\x20\x27','new','Project\x20cloned\x20with\x20errors','\x22:\x20','\x0a✔\x20Pushed\x20','parse','\x20unchanged','textKnowledgeBases','210999BqDbUg','Project:\x20','session','gray','diff','Writing\x20files...','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20\x20Target:\x20','\x20\x20Prompt\x20\x22','\x20\x20Prompts:\x20','counts','newProjectId','Pushing\x20agent\x20from\x20\x22','dim','✔\x20Context\x20set:\x20','repeat','outputDir','<new-name>','Output\x20path:\x20','\x20=\x20','\x0aWrite\x20','\x20\x20Integrations:\x20','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Agents:\x20','pushProject','Pushing\x20to\x20project...','\x20\x20tdx\x20agent\x20clone\x20agents/','Pulling\x20agent\x20\x22','\x22\x20from\x20project\x20\x22','\x0aPush\x20','log','3593706CrDxMX','Using\x20local\x20project:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','experimentalKnowledgeBases','prompts','\x20\x20Knowledge\x20Base\x20\x22','5mffcLJ','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Agent:\x20','\x20files?','-\x20no\x20files\x20written','created','reason','13253229uXHaAf','yellow','Analyzing\x20changes\x20to\x20push...','agentName','\x20errors','errors','agentId','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','cloneProject','pushAgent','Errors:','newProjectName','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x22\x20to\x20new\x20project\x20\x22','\x22\x20to\x20\x22','661982Hvegsi','\x20\x20Experimental\x20Artifacts:\x20','action','Clone\x20\x22','tdx.json','force','\x20changed','\x20total','error','name','knowledgeBases','\x20\x20Agent\x20\x22','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Failed\x20to\x20push\x20agent:\x20','28ABBDuh','updated','isNew','site','\x20--profile\x20','context','sourceProjectName','Summary:','\x20|\x20','outputPath','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','join','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','unchanged','3287102HthAvQ','source','288806lUneWS','\x20\x20Source:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','integrations','\x27\x20to\x20create\x20the\x20folder\x20structure.','dryRun','experimentalArtifacts','pullProject','New\x20project\x20ID:\x20','Cancelled','Cloning\x20\x22','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20created','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','cwd','green','\x20\x20Knowledge\x20Bases:\x20','\x0a✔\x20Pulled\x20','\x22...','\x20new','Source:\x20','pullAgent','Using\x20current\x20project:\x20','-\x20nothing\x20pushed','agent:clone','message','llm','total','description','307840wwEhJr','llmProject','dirname','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','profile','Usage:\x20tdx\x20agent\x20pull\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)','agents','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','yes','\x20--name\x20','INVALID_ARGUMENT','agent:pull','\x20\x20Text\x20Knowledge\x20Bases:\x20','Agent\x20pulled\x20successfully','execute','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Project\x20cloned\x20successfully','\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)','output','Status:\x20','utf-8'];a4_0x88f7=function(){return _0x449760;};return a4_0x88f7();}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}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function a4_0x4a38(_0x44cc60,_0x115228){_0x44cc60=_0x44cc60-0x100;const _0x88f7f8=a4_0x88f7();let _0x4a3800=_0x88f7f8[_0x44cc60];return _0x4a3800;}function formatCountSummary(_0x310792){const _0x5e5875=a4_0x4a38,_0xa9a4c9=[];if(_0x310792[_0x5e5875(0x131)]!==undefined)_0xa9a4c9[_0x5e5875(0x15c)](_0x310792[_0x5e5875(0x131)]+_0x5e5875(0x1ab));if(_0x310792[_0x5e5875(0x162)]!==undefined&&_0x310792[_0x5e5875(0x162)]>0x0)_0xa9a4c9['push'](a4_0x727e9d[_0x5e5875(0x125)](_0x310792['new']+'\x20new'));if(_0x310792[_0x5e5875(0x193)]!==undefined&&_0x310792[_0x5e5875(0x193)]>0x0)_0xa9a4c9[_0x5e5875(0x15c)](a4_0x727e9d[_0x5e5875(0x125)](_0x310792[_0x5e5875(0x193)]+_0x5e5875(0x121)));if(_0x310792[_0x5e5875(0x105)]!==undefined&&_0x310792['updated']>0x0)_0xa9a4c9['push'](a4_0x727e9d[_0x5e5875(0x196)](_0x310792['updated']+'\x20updated'));if(_0x310792[_0x5e5875(0x111)]!==undefined&&_0x310792[_0x5e5875(0x111)]>0x0)_0xa9a4c9['push'](a4_0x727e9d[_0x5e5875(0x16c)](_0x310792['unchanged']+'\x20unchanged'));if(_0x310792[_0x5e5875(0x19a)]!==undefined&&_0x310792[_0x5e5875(0x19a)]>0x0)_0xa9a4c9['push'](a4_0x727e9d[_0x5e5875(0x153)](_0x310792[_0x5e5875(0x19a)]+_0x5e5875(0x199)));return _0xa9a4c9[_0x5e5875(0x10f)](',\x20');}function displayDiffs(_0x3e5ae2,_0x180110,_0x229e0f,_0x525cf9,_0x390d31,_0x108845,_0x31ed17){const _0x370023=a4_0x4a38;for(const _0xfd5a0c of _0x3e5ae2){if(_0xfd5a0c[_0x370023(0x16d)]){const _0x5f4b65=_0xfd5a0c[_0x370023(0x198)]||_0xfd5a0c[_0x370023(0x1ad)];console[_0x370023(0x187)](_0x370023(0x150)+_0x5f4b65+'\x27:'),console['log']('─'[_0x370023(0x178)](0x3c)),console[_0x370023(0x187)](_0xfd5a0c['diff']),console[_0x370023(0x187)]('─'[_0x370023(0x178)](0x3c));}}for(const _0x253a24 of _0x180110){_0x253a24['diff']&&(console[_0x370023(0x187)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x253a24[_0x370023(0x1ad)]+'\x27:'),console[_0x370023(0x187)]('─'[_0x370023(0x178)](0x3c)),console['log'](_0x253a24[_0x370023(0x16d)]),console[_0x370023(0x187)]('─'[_0x370023(0x178)](0x3c)));}for(const _0x4f3311 of _0x229e0f){_0x4f3311[_0x370023(0x16d)]&&(console[_0x370023(0x187)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x4f3311['name']+'\x27:'),console[_0x370023(0x187)]('─'[_0x370023(0x178)](0x3c)),console[_0x370023(0x187)](_0x4f3311[_0x370023(0x16d)]),console[_0x370023(0x187)]('─'[_0x370023(0x178)](0x3c)));}for(const _0x24eb1f of _0x525cf9){_0x24eb1f[_0x370023(0x16d)]&&(console[_0x370023(0x187)](_0x370023(0x14b)+_0x24eb1f[_0x370023(0x1ad)]+'\x27:'),console['log']('─'[_0x370023(0x178)](0x3c)),console[_0x370023(0x187)](_0x24eb1f['diff']),console['log']('─'[_0x370023(0x178)](0x3c)));}for(const _0x3e6010 of _0x390d31){_0x3e6010[_0x370023(0x16d)]&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0x3e6010[_0x370023(0x1ad)]+'\x27:'),console[_0x370023(0x187)]('─'['repeat'](0x3c)),console[_0x370023(0x187)](_0x3e6010[_0x370023(0x16d)]),console['log']('─'[_0x370023(0x178)](0x3c)));}for(const _0x4935e3 of _0x108845){_0x4935e3[_0x370023(0x16d)]&&(console[_0x370023(0x187)](_0x370023(0x110)+_0x4935e3[_0x370023(0x1ad)]+'\x27:'),console['log']('─'[_0x370023(0x178)](0x3c)),console['log'](_0x4935e3[_0x370023(0x16d)]),console['log']('─'[_0x370023(0x178)](0x3c)));}for(const _0x2b04e8 of _0x31ed17){_0x2b04e8['diff']&&(console[_0x370023(0x187)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x2b04e8['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x370023(0x187)](_0x2b04e8[_0x370023(0x16d)]),console['log']('─'[_0x370023(0x178)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x3da32f(0x13e);['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x3da32f(0x141)](_0x4f7eab){const _0x206e00=a4_0x3da32f,{options:_0x3d40d1,args:_0x179483,tdx:_0x98b858}=_0x4f7eab,_0x3dd66d=_0x179483[0x0],_0x473c80=_0x179483[0x1],_0x35a6fe=_0x3d40d1[_0x206e00(0x145)],_0x3bb39d=_0x3d40d1['dryRun'],_0x6bf6db=_0x3d40d1[_0x206e00(0x1a9)],_0x40dc4d=_0x3d40d1[_0x206e00(0x13b)],_0xb245c=_0x3d40d1[_0x206e00(0x134)];let _0x4f9647,_0x3a2d3d;const _0x331c89=findAgentConfigPath(process[_0x206e00(0x124)]());if(_0x3dd66d){const _0xa6f427=a4_0xba3762['join'](_0x3dd66d,'tdx.json');if(existsSync(_0xa6f427))try{const _0x333bce=JSON['parse'](readFileSync(_0xa6f427,_0x206e00(0x147)));_0x4f9647=_0x333bce['llm_project'],_0x3a2d3d=_0x3dd66d,console[_0x206e00(0x187)](a4_0x727e9d[_0x206e00(0x176)]('Using\x20project\x20from\x20'+_0xa6f427+':\x20'+_0x4f9647));}catch{_0x4f9647=_0x3dd66d;}else _0x4f9647=_0x3dd66d;}else{if(_0x331c89)try{const _0x33aa72=JSON[_0x206e00(0x166)](readFileSync(_0x331c89,_0x206e00(0x147)));_0x4f9647=_0x33aa72[_0x206e00(0x157)],_0x3a2d3d=a4_0xba3762['dirname'](_0x331c89),console[_0x206e00(0x187)](a4_0x727e9d[_0x206e00(0x176)]('Using\x20project:\x20'+_0x4f9647));}catch{_0x4f9647=_0xb245c;}else _0x4f9647=_0xb245c;}if(!_0x4f9647)return console[_0x206e00(0x187)](a4_0x727e9d[_0x206e00(0x196)](_0x206e00(0x13a))),console[_0x206e00(0x187)](_0x206e00(0x138)),console[_0x206e00(0x187)](_0x206e00(0x122)),console[_0x206e00(0x187)](_0x206e00(0x1a1)),console[_0x206e00(0x187)](_0x206e00(0x10e)),0x1;if(_0x473c80){const {data:_0x309577}=await withSpinner(_0x206e00(0x184)+_0x473c80+_0x206e00(0x185)+_0x4f9647+'\x22...',()=>_0x98b858[_0x206e00(0x130)][_0x206e00(0x12b)](_0x4f9647,_0x473c80,_0x35a6fe,{'dryRun':_0x3bb39d,'force':_0x6bf6db}));if(_0x3bb39d)return console[_0x206e00(0x187)](a4_0x727e9d['yellow'](_0x206e00(0x17f))),console[_0x206e00(0x187)]('Would\x20pull\x20agent:\x20'+_0x309577[_0x206e00(0x198)]),console[_0x206e00(0x187)](_0x206e00(0x17b)+_0x309577[_0x206e00(0x10d)]),_0x309577[_0x206e00(0x16d)]&&(console[_0x206e00(0x187)](_0x206e00(0x15f)),console['log']('─'[_0x206e00(0x178)](0x3c)),console[_0x206e00(0x187)](_0x309577[_0x206e00(0x16d)]),console[_0x206e00(0x187)]('─'[_0x206e00(0x178)](0x3c))),0x0;return console[_0x206e00(0x187)](a4_0x727e9d[_0x206e00(0x125)](_0x206e00(0x140))),console['log'](_0x206e00(0x190)+_0x309577[_0x206e00(0x198)]),console[_0x206e00(0x187)]('Output:\x20'+_0x309577['outputPath']),console[_0x206e00(0x187)](_0x206e00(0x146)+(_0x309577[_0x206e00(0x106)]?a4_0x727e9d[_0x206e00(0x125)]('new'):_0x309577[_0x206e00(0x149)]?a4_0x727e9d['yellow'](_0x206e00(0x105)):a4_0x727e9d[_0x206e00(0x16c)]('unchanged'))),0x0;}const _0x962380=_0x3a2d3d||_0x35a6fe,{data:_0x316fa8}=await withSpinner(_0x206e00(0x152)+_0x4f9647+'\x22...',()=>_0x98b858[_0x206e00(0x130)][_0x206e00(0x11b)](_0x4f9647,_0x962380,{'dryRun':!![]})),_0x23df77=_0x316fa8[_0x206e00(0x173)][_0x206e00(0x139)][_0x206e00(0x162)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x100)][_0x206e00(0x162)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x168)][_0x206e00(0x162)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x18c)][_0x206e00(0x162)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x117)][_0x206e00(0x162)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x18b)][_0x206e00(0x162)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x11a)][_0x206e00(0x162)],_0x22a235=_0x316fa8[_0x206e00(0x173)][_0x206e00(0x139)][_0x206e00(0x105)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x100)][_0x206e00(0x105)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x168)][_0x206e00(0x105)]+_0x316fa8[_0x206e00(0x173)]['prompts']['updated']+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x117)]['updated']+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x18b)][_0x206e00(0x105)]+_0x316fa8['counts'][_0x206e00(0x11a)]['updated'],_0x5d580e=_0x316fa8[_0x206e00(0x173)]['agents'][_0x206e00(0x111)]+_0x316fa8[_0x206e00(0x173)]['knowledgeBases'][_0x206e00(0x111)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x168)][_0x206e00(0x111)]+_0x316fa8['counts']['prompts'][_0x206e00(0x111)]+_0x316fa8[_0x206e00(0x173)]['integrations']['unchanged']+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x18b)][_0x206e00(0x111)]+_0x316fa8[_0x206e00(0x173)][_0x206e00(0x11a)][_0x206e00(0x111)];console[_0x206e00(0x187)](_0x206e00(0x161)+_0x316fa8[_0x206e00(0x151)]+'\x27:'),console[_0x206e00(0x187)]('\x20\x20'+a4_0x727e9d[_0x206e00(0x125)]('+\x20'+_0x23df77+'\x20new')+_0x206e00(0x10c)+a4_0x727e9d[_0x206e00(0x196)]('~\x20'+_0x22a235+'\x20changed')+'\x20|\x20'+a4_0x727e9d[_0x206e00(0x176)]('=\x20'+_0x5d580e+'\x20unchanged')),console[_0x206e00(0x187)](_0x206e00(0x180)+formatCountSummary(_0x316fa8[_0x206e00(0x173)]['agents'])),console[_0x206e00(0x187)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x316fa8['counts']['knowledgeBases'])),console[_0x206e00(0x187)](_0x206e00(0x13f)+formatCountSummary(_0x316fa8[_0x206e00(0x173)][_0x206e00(0x168)])),console['log'](_0x206e00(0x172)+formatCountSummary(_0x316fa8[_0x206e00(0x173)][_0x206e00(0x18c)])),console[_0x206e00(0x187)](_0x206e00(0x17e)+formatCountSummary(_0x316fa8[_0x206e00(0x173)][_0x206e00(0x117)]));const _0x33e404=_0x316fa8[_0x206e00(0x173)][_0x206e00(0x18b)][_0x206e00(0x131)]>0x0||_0x316fa8[_0x206e00(0x173)]['experimentalArtifacts'][_0x206e00(0x131)]>0x0;_0x33e404&&(console[_0x206e00(0x187)](_0x206e00(0x16f)+formatCountSummary(_0x316fa8[_0x206e00(0x173)][_0x206e00(0x18b)])),console['log'](_0x206e00(0x1a5)+formatCountSummary(_0x316fa8['counts'][_0x206e00(0x11a)])));console[_0x206e00(0x187)](_0x206e00(0x170)+a4_0x727e9d[_0x206e00(0x155)](_0x316fa8[_0x206e00(0x179)])),displayDiffs(_0x316fa8['agents'],_0x316fa8[_0x206e00(0x100)],_0x316fa8[_0x206e00(0x168)],_0x316fa8['prompts'],_0x316fa8['integrations'],_0x316fa8[_0x206e00(0x18b)],_0x316fa8[_0x206e00(0x11a)]);if(_0x3bb39d)return console[_0x206e00(0x187)](a4_0x727e9d[_0x206e00(0x196)](_0x206e00(0x120))),0x0;if(_0x23df77===0x0&&_0x22a235===0x0)return console['log'](a4_0x727e9d[_0x206e00(0x125)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x316fa8[_0x206e00(0x151)]},_0x3d40d1[_0x206e00(0x16b)]),console['log'](a4_0x727e9d[_0x206e00(0x125)](_0x206e00(0x177)+a4_0x727e9d['dim'](_0x206e00(0x157))+_0x206e00(0x17c)+a4_0x727e9d[_0x206e00(0x155)](_0x316fa8[_0x206e00(0x151)]))),0x0;if(!_0x40dc4d&&!_0x6bf6db){if(!isInteractive())return console['error'](a4_0x727e9d[_0x206e00(0x153)](_0x206e00(0x156)),_0x206e00(0x158)),console['error'](a4_0x727e9d[_0x206e00(0x176)](_0x206e00(0x123))),0x1;const _0x7b41c1=await confirmKey(_0x206e00(0x17d)+(_0x23df77+_0x22a235)+_0x206e00(0x191));if(!_0x7b41c1)return console['log'](a4_0x727e9d[_0x206e00(0x196)]('Cancelled'),_0x206e00(0x192)),0x1;}const {data:_0x4f355d}=await withSpinner(_0x206e00(0x16e),()=>_0x98b858[_0x206e00(0x130)][_0x206e00(0x11b)](_0x4f9647,_0x962380,{'force':_0x6bf6db}));return console['log'](a4_0x727e9d[_0x206e00(0x125)](_0x206e00(0x127)+(_0x23df77+_0x22a235)+_0x206e00(0x15a)+_0x4f355d[_0x206e00(0x179)])),saveSessionContext({'llm_project':_0x4f355d['projectName']},_0x3d40d1[_0x206e00(0x16b)]),console['log'](a4_0x727e9d[_0x206e00(0x125)](_0x206e00(0x177)+a4_0x727e9d[_0x206e00(0x176)](_0x206e00(0x157))+'\x20=\x20'+a4_0x727e9d[_0x206e00(0x155)](_0x4f355d['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3da32f(0x1ad)]=a4_0x3da32f(0x12e);[a4_0x3da32f(0x132)]=a4_0x3da32f(0x11f);async[a4_0x3da32f(0x141)](_0x2e0e3b){const _0x330eb4=a4_0x3da32f,{options:_0x2aad27,args:_0x42ef76,tdx:_0x2e910b}=_0x2e0e3b,_0x248622=_0x42ef76[0x0],_0x505193=_0x2aad27[_0x330eb4(0x1ad)],_0xc65445=_0x2aad27['dryRun'],_0x292e1c=_0x2aad27['yes'],_0x378478=_0x2aad27[_0x330eb4(0x107)],_0x6d652=_0x2aad27['llmProject'];let _0x1b6900;const _0x268ea2=findAgentConfigPath(process['cwd']());if(_0x248622){const _0x43d384=a4_0xba3762[_0x330eb4(0x10f)](_0x248622,_0x330eb4(0x1a8));existsSync(_0x43d384)?(_0x1b6900=_0x248622,console['log'](a4_0x727e9d[_0x330eb4(0x176)]('Using\x20local\x20project:\x20'+_0x248622))):_0x1b6900=_0x248622;}else{if(_0x268ea2)_0x1b6900=a4_0xba3762[_0x330eb4(0x135)](_0x268ea2),console['log'](a4_0x727e9d[_0x330eb4(0x176)](_0x330eb4(0x12c)+_0x1b6900));else{if(_0x6d652){const _0x2a4b55=sanitizeForFilesystem(_0x6d652);let _0x88f35e=_0x2a4b55,_0x16a267=a4_0xba3762[_0x330eb4(0x10f)](process['cwd'](),_0x330eb4(0x139),_0x2a4b55,_0x330eb4(0x1a8));if(!existsSync(_0x16a267)){const _0x52e4f7=normalizeName(_0x6d652),_0x495355=a4_0xba3762['join'](process[_0x330eb4(0x124)](),'agents',_0x52e4f7,_0x330eb4(0x1a8));existsSync(_0x495355)&&(_0x88f35e=_0x52e4f7,_0x16a267=_0x495355);}if(existsSync(_0x16a267))_0x1b6900=a4_0xba3762['dirname'](_0x16a267),console[_0x330eb4(0x187)](a4_0x727e9d[_0x330eb4(0x176)](_0x330eb4(0x189)+_0x1b6900));else{const _0x132fe7=_0x2aad27[_0x330eb4(0x137)];if(_0x132fe7)throw new SDKError(ErrorCode[_0x330eb4(0x13d)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x6d652+_0x330eb4(0x15b),undefined,{'helpText':_0x330eb4(0x116)+_0x330eb4(0x142)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x6d652+'\x0a')+(_0x330eb4(0x183)+_0x88f35e+_0x330eb4(0x13c)+(_0x505193||_0x330eb4(0x17a))+_0x330eb4(0x108)+_0x132fe7)});_0x1b6900=_0x6d652,console['log'](a4_0x727e9d['dim']('Using\x20context\x20project:\x20'+_0x6d652));}}}}if(!_0x1b6900)return console['log'](a4_0x727e9d['yellow'](_0x330eb4(0x19c))),console[_0x330eb4(0x187)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x330eb4(0x187)](_0x330eb4(0x144)),console[_0x330eb4(0x187)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x505193)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x330eb4(0x160),undefined,{'helpText':_0x330eb4(0x18f)});if(!_0x292e1c&&!_0xc65445){if(!isInteractive())return console[_0x330eb4(0x1ac)](a4_0x727e9d[_0x330eb4(0x153)]('\x0aError:'),_0x330eb4(0x158)),console[_0x330eb4(0x1ac)](a4_0x727e9d[_0x330eb4(0x176)](_0x330eb4(0x123))),0x1;const _0x532efb=await confirmKey(_0x330eb4(0x1a7)+_0x1b6900+_0x330eb4(0x1a2)+_0x505193+'\x22?');if(!_0x532efb)return console[_0x330eb4(0x187)](a4_0x727e9d[_0x330eb4(0x196)](_0x330eb4(0x11d))),0x1;}const {data:_0x4f5c34}=await withSpinner(_0x330eb4(0x11e)+_0x1b6900+_0x330eb4(0x1a3)+_0x505193+_0x330eb4(0x128),()=>_0x2e910b[_0x330eb4(0x130)][_0x330eb4(0x19d)](_0x1b6900,_0x505193,{'dryRun':_0xc65445}));if(_0xc65445){console['log'](a4_0x727e9d['yellow'](_0x330eb4(0x15d))),console[_0x330eb4(0x187)]('Source:\x20'+_0x4f5c34[_0x330eb4(0x10a)]),console[_0x330eb4(0x187)]('New\x20project:\x20'+_0x505193),console[_0x330eb4(0x187)]('Would\x20clone:'),console[_0x330eb4(0x187)](_0x330eb4(0x180)+_0x4f5c34[_0x330eb4(0x173)]['agents']['created']),console[_0x330eb4(0x187)](_0x330eb4(0x126)+_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x100)][_0x330eb4(0x193)]),console[_0x330eb4(0x187)]('\x20\x20Prompts:\x20'+_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x18c)]['created']);const _0x2145fe=_0x4f5c34['counts'][_0x330eb4(0x18b)]['created']>0x0||_0x4f5c34['counts'][_0x330eb4(0x11a)]['created']>0x0;return _0x2145fe&&(console[_0x330eb4(0x187)](_0x330eb4(0x16f)+_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x18b)][_0x330eb4(0x193)]),console[_0x330eb4(0x187)](_0x330eb4(0x1a5)+_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x11a)][_0x330eb4(0x193)])),0x0;}const _0xfe3979=_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x139)][_0x330eb4(0x19a)]>0x0||_0x4f5c34['counts'][_0x330eb4(0x100)][_0x330eb4(0x19a)]>0x0||_0x4f5c34['counts'][_0x330eb4(0x18c)][_0x330eb4(0x19a)]>0x0||_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x18b)][_0x330eb4(0x19a)]>0x0||_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x11a)][_0x330eb4(0x19a)]>0x0;_0xfe3979?console['log'](a4_0x727e9d[_0x330eb4(0x196)](_0x330eb4(0x163))):console[_0x330eb4(0x187)](a4_0x727e9d['green'](_0x330eb4(0x143)));console[_0x330eb4(0x187)](_0x330eb4(0x12a)+_0x4f5c34['sourceProjectName']),console['log'](_0x330eb4(0x14e)+_0x4f5c34[_0x330eb4(0x1a0)]),console[_0x330eb4(0x187)](_0x330eb4(0x11c)+_0x4f5c34['newProjectId']),console[_0x330eb4(0x187)](),console['log'](_0x330eb4(0x10b)),console['log'](_0x330eb4(0x180)+formatCountSummary(_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x139)])),console['log'](_0x330eb4(0x126)+formatCountSummary(_0x4f5c34['counts'][_0x330eb4(0x100)])),console[_0x330eb4(0x187)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x4f5c34['counts']['prompts'])),console[_0x330eb4(0x187)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x117)]));const _0x29a229=_0x4f5c34[_0x330eb4(0x173)]['experimentalKnowledgeBases'][_0x330eb4(0x193)]>0x0||_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x18b)][_0x330eb4(0x105)]>0x0||_0x4f5c34['counts'][_0x330eb4(0x18b)]['unchanged']>0x0||_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x11a)][_0x330eb4(0x193)]>0x0||_0x4f5c34[_0x330eb4(0x173)]['experimentalArtifacts'][_0x330eb4(0x105)]>0x0||_0x4f5c34['counts'][_0x330eb4(0x11a)][_0x330eb4(0x111)]>0x0;_0x29a229&&(console[_0x330eb4(0x187)](_0x330eb4(0x16f)+formatCountSummary(_0x4f5c34[_0x330eb4(0x173)][_0x330eb4(0x18b)])),console[_0x330eb4(0x187)](_0x330eb4(0x1a5)+formatCountSummary(_0x4f5c34[_0x330eb4(0x173)]['experimentalArtifacts'])));if(_0xfe3979){console[_0x330eb4(0x187)](),console['log'](a4_0x727e9d[_0x330eb4(0x153)](_0x330eb4(0x19f)));for(const _0x11e1ff of _0x4f5c34['agents']){_0x11e1ff[_0x330eb4(0x1a6)]===_0x330eb4(0x1ac)&&console[_0x330eb4(0x187)](a4_0x727e9d[_0x330eb4(0x153)](_0x330eb4(0x101)+_0x11e1ff[_0x330eb4(0x198)]+'\x22:\x20'+_0x11e1ff['error']));}for(const _0xf9f4e4 of _0x4f5c34[_0x330eb4(0x100)]){_0xf9f4e4[_0x330eb4(0x1a6)]===_0x330eb4(0x1ac)&&console[_0x330eb4(0x187)](a4_0x727e9d['red'](_0x330eb4(0x18d)+_0xf9f4e4[_0x330eb4(0x1ad)]+_0x330eb4(0x164)+_0xf9f4e4['error']));}for(const _0x32412c of _0x4f5c34['prompts']){_0x32412c['action']===_0x330eb4(0x1ac)&&console[_0x330eb4(0x187)](a4_0x727e9d['red'](_0x330eb4(0x171)+_0x32412c[_0x330eb4(0x1ad)]+_0x330eb4(0x164)+_0x32412c[_0x330eb4(0x1ac)]));}for(const _0x5a6813 of _0x4f5c34[_0x330eb4(0x117)]){_0x5a6813['action']===_0x330eb4(0x1ac)&&console['log'](a4_0x727e9d[_0x330eb4(0x153)](_0x330eb4(0x14f)+_0x5a6813[_0x330eb4(0x1ad)]+_0x330eb4(0x164)+_0x5a6813[_0x330eb4(0x1ac)]));}for(const _0x36fd18 of _0x4f5c34['experimentalKnowledgeBases']){_0x36fd18[_0x330eb4(0x1a6)]===_0x330eb4(0x1ac)&&console[_0x330eb4(0x187)](a4_0x727e9d[_0x330eb4(0x153)](_0x330eb4(0x148)+_0x36fd18[_0x330eb4(0x1ad)]+_0x330eb4(0x164)+_0x36fd18[_0x330eb4(0x1ac)]));}for(const _0x14caa1 of _0x4f5c34[_0x330eb4(0x11a)]){_0x14caa1['action']===_0x330eb4(0x1ac)&&console[_0x330eb4(0x187)](a4_0x727e9d[_0x330eb4(0x153)](_0x330eb4(0x14a)+_0x14caa1['name']+_0x330eb4(0x164)+_0x14caa1[_0x330eb4(0x1ac)]));}return 0x1;}console[_0x330eb4(0x187)]();const _0x52db03=getLLMProjectUrl(_0x378478,_0x4f5c34[_0x330eb4(0x174)]);return console[_0x330eb4(0x187)](_0x330eb4(0x16a)+a4_0x727e9d[_0x330eb4(0x155)](_0x52db03)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']='agent:push';['description']=a4_0x3da32f(0x102);async['execute'](_0x24e65c){const _0x595653=a4_0x3da32f,{options:_0x15e013,args:_0x32ad88,tdx:_0x3f9c1d}=_0x24e65c;let _0x406453=_0x32ad88[0x0]||process[_0x595653(0x124)]();const _0x43da02=_0x15e013[_0x595653(0x119)],_0x3ae03d=_0x15e013[_0x595653(0x1a9)],_0x599cee=_0x15e013[_0x595653(0x13b)],_0x4b0475=_0x15e013[_0x595653(0x107)],_0x31db2f=a4_0xba3762[_0x595653(0x10f)](_0x406453,'agent.yml'),_0x33897a=existsSync(_0x31db2f);if(_0x33897a){const {data:_0x112be9}=await withSpinner(_0x595653(0x175)+_0x406453+_0x595653(0x128),()=>_0x3f9c1d[_0x595653(0x130)][_0x595653(0x19e)](_0x406453,{'dryRun':_0x43da02,'force':_0x3ae03d}));if(_0x43da02)return console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x196)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console['log'](_0x595653(0x159)+_0x112be9['agentName']),0x0;if(_0x112be9['action']===_0x595653(0x1ac))return console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x153)](_0x595653(0x103)+_0x112be9[_0x595653(0x1ac)])),0x1;console[_0x595653(0x187)](a4_0x727e9d['green']('Agent\x20'+_0x112be9[_0x595653(0x1a6)]+_0x595653(0x14d))),console[_0x595653(0x187)](_0x595653(0x190)+_0x112be9[_0x595653(0x198)]);if(_0x112be9[_0x595653(0x19b)]&&_0x112be9[_0x595653(0x154)]){const _0x333142=getLLMAgentChatUrl(_0x4b0475,_0x112be9['projectId'],_0x112be9[_0x595653(0x19b)]);console[_0x595653(0x187)]('Chat:\x20'+a4_0x727e9d['cyan'](_0x333142));}return 0x0;}const _0x6d35d3=_0x15e013[_0x595653(0x134)],_0x1b11dd=resolveProjectFromContext(_0x406453,_0x6d35d3);if(_0x1b11dd['found'])_0x406453=_0x1b11dd['projectDir'],_0x1b11dd[_0x595653(0x113)]===_0x595653(0x109)&&console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x176)]('Using\x20project:\x20'+_0x406453));else{let _0x44e284='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x1b11dd[_0x595653(0x194)]==='no_local_folder'&&(_0x44e284=_0x1b11dd[_0x595653(0x12f)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x1b11dd[_0x595653(0x134)]+_0x595653(0x118));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1b11dd[_0x595653(0x194)]==='no_context'?_0x1b11dd[_0x595653(0x12f)]:'No\x20tdx.json\x20found\x20in\x20'+_0x406453,undefined,{'helpText':_0x44e284});}const {data:_0x5d1035}=await withSpinner(_0x595653(0x197),()=>_0x3f9c1d[_0x595653(0x130)][_0x595653(0x181)](_0x406453,{'dryRun':!![]})),_0xee0e36=_0x5d1035[_0x595653(0x173)]['agents']['errors']>0x0;if(_0xee0e36){console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x153)]('\x0aErrors\x20found:'));for(const _0x35d913 of _0x5d1035[_0x595653(0x139)]){_0x35d913[_0x595653(0x1a6)]===_0x595653(0x1ac)&&console['log'](a4_0x727e9d[_0x595653(0x153)]('\x20\x20Agent\x20\x22'+_0x35d913[_0x595653(0x198)]+_0x595653(0x164)+_0x35d913[_0x595653(0x1ac)]));}return 0x1;}const _0xcdf521=_0x5d1035['counts'][_0x595653(0x139)][_0x595653(0x193)]+_0x5d1035[_0x595653(0x173)][_0x595653(0x100)][_0x595653(0x193)]+_0x5d1035[_0x595653(0x173)][_0x595653(0x168)]['created']+_0x5d1035['counts'][_0x595653(0x18c)]['created']+_0x5d1035[_0x595653(0x173)][_0x595653(0x117)]['created']+_0x5d1035[_0x595653(0x173)][_0x595653(0x18b)][_0x595653(0x193)]+_0x5d1035[_0x595653(0x173)]['experimentalArtifacts'][_0x595653(0x193)],_0x3367ef=_0x5d1035[_0x595653(0x173)][_0x595653(0x139)][_0x595653(0x105)]+_0x5d1035[_0x595653(0x173)][_0x595653(0x100)][_0x595653(0x105)]+_0x5d1035[_0x595653(0x173)][_0x595653(0x168)][_0x595653(0x105)]+_0x5d1035[_0x595653(0x173)][_0x595653(0x18c)]['updated']+_0x5d1035['counts']['integrations'][_0x595653(0x105)]+_0x5d1035[_0x595653(0x173)][_0x595653(0x18b)][_0x595653(0x105)]+_0x5d1035[_0x595653(0x173)]['experimentalArtifacts'][_0x595653(0x105)],_0x18b962=_0x5d1035['counts']['agents']['unchanged']+_0x5d1035['counts']['knowledgeBases'][_0x595653(0x111)]+_0x5d1035[_0x595653(0x173)][_0x595653(0x168)][_0x595653(0x111)]+_0x5d1035[_0x595653(0x173)]['prompts'][_0x595653(0x111)]+_0x5d1035[_0x595653(0x173)][_0x595653(0x117)][_0x595653(0x111)]+_0x5d1035['counts'][_0x595653(0x18b)][_0x595653(0x111)]+_0x5d1035[_0x595653(0x173)][_0x595653(0x11a)][_0x595653(0x111)];console[_0x595653(0x187)](_0x595653(0x14c)+_0x5d1035[_0x595653(0x151)]+'\x27:'),console[_0x595653(0x187)]('\x20\x20'+a4_0x727e9d[_0x595653(0x125)]('+\x20'+_0xcdf521+_0x595653(0x129))+_0x595653(0x10c)+a4_0x727e9d[_0x595653(0x196)]('~\x20'+_0x3367ef+_0x595653(0x1aa))+'\x20|\x20'+a4_0x727e9d[_0x595653(0x176)]('=\x20'+_0x18b962+_0x595653(0x167))),console[_0x595653(0x187)](_0x595653(0x180)+formatCountSummary(_0x5d1035[_0x595653(0x173)][_0x595653(0x139)])),console[_0x595653(0x187)](_0x595653(0x126)+formatCountSummary(_0x5d1035[_0x595653(0x173)]['knowledgeBases'])),console[_0x595653(0x187)](_0x595653(0x13f)+formatCountSummary(_0x5d1035['counts'][_0x595653(0x168)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x5d1035[_0x595653(0x173)][_0x595653(0x18c)])),console[_0x595653(0x187)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x5d1035[_0x595653(0x173)]['integrations']));const _0x96f2a9=_0x5d1035[_0x595653(0x173)][_0x595653(0x18b)]['created']>0x0||_0x5d1035['counts'][_0x595653(0x18b)][_0x595653(0x105)]>0x0||_0x5d1035[_0x595653(0x173)][_0x595653(0x18b)]['unchanged']>0x0||_0x5d1035['counts'][_0x595653(0x11a)][_0x595653(0x193)]>0x0||_0x5d1035['counts'][_0x595653(0x11a)][_0x595653(0x105)]>0x0||_0x5d1035[_0x595653(0x173)][_0x595653(0x11a)][_0x595653(0x111)]>0x0;_0x96f2a9&&(console['log'](_0x595653(0x16f)+formatCountSummary(_0x5d1035[_0x595653(0x173)][_0x595653(0x18b)])),console[_0x595653(0x187)](_0x595653(0x1a5)+formatCountSummary(_0x5d1035['counts'][_0x595653(0x11a)])));console[_0x595653(0x187)](_0x595653(0x115)+a4_0x727e9d[_0x595653(0x155)](_0x406453)),displayDiffs(_0x5d1035['agents'],_0x5d1035[_0x595653(0x100)],_0x5d1035['textKnowledgeBases'],_0x5d1035[_0x595653(0x18c)],_0x5d1035[_0x595653(0x117)],_0x5d1035[_0x595653(0x18b)],_0x5d1035[_0x595653(0x11a)]);if(_0x43da02)return console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x196)](_0x595653(0x18a))),0x0;if(_0xcdf521===0x0&&_0x3367ef===0x0){console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x125)](_0x595653(0x136)));const _0x32324d=getLLMProjectUrl(_0x4b0475,_0x5d1035['projectId']);return console['log'](_0x595653(0x16a)+a4_0x727e9d[_0x595653(0x155)](_0x32324d)),0x0;}if(!_0x599cee&&!_0x3ae03d){if(!isInteractive())return console[_0x595653(0x1ac)](a4_0x727e9d[_0x595653(0x153)]('\x0aError:'),_0x595653(0x158)),console[_0x595653(0x1ac)](a4_0x727e9d[_0x595653(0x176)](_0x595653(0x123))),0x1;const _0x5eb33a=await confirmKey(_0x595653(0x186)+(_0xcdf521+_0x3367ef)+_0x595653(0x15e));if(!_0x5eb33a)return console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x196)](_0x595653(0x11d)),_0x595653(0x12d)),0x1;}const {data:_0x379286}=await withSpinner(_0x595653(0x182),()=>_0x3f9c1d[_0x595653(0x130)][_0x595653(0x181)](_0x406453,{'force':_0x3ae03d})),_0x4ae5af=_0x379286[_0x595653(0x173)][_0x595653(0x139)][_0x595653(0x19a)]>0x0||_0x379286['counts'][_0x595653(0x100)]['errors']>0x0||_0x379286['counts'][_0x595653(0x168)][_0x595653(0x19a)]>0x0||_0x379286[_0x595653(0x173)][_0x595653(0x18c)]['errors']>0x0;if(_0x4ae5af){console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x196)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x595653(0x187)](),console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x153)](_0x595653(0x19f)));for(const _0x49628b of _0x379286[_0x595653(0x139)]){_0x49628b[_0x595653(0x1a6)]===_0x595653(0x1ac)&&console[_0x595653(0x187)](a4_0x727e9d['red'](_0x595653(0x101)+_0x49628b[_0x595653(0x198)]+'\x22:\x20'+_0x49628b['error']));}for(const _0x1f7219 of _0x379286['knowledgeBases']){_0x1f7219[_0x595653(0x1a6)]===_0x595653(0x1ac)&&console['log'](a4_0x727e9d['red'](_0x595653(0x18d)+_0x1f7219[_0x595653(0x1ad)]+_0x595653(0x164)+_0x1f7219['error']));}for(const _0x2f417b of _0x379286['textKnowledgeBases']){_0x2f417b[_0x595653(0x1a6)]==='error'&&console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x153)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x2f417b[_0x595653(0x1ad)]+_0x595653(0x164)+_0x2f417b[_0x595653(0x1ac)]));}for(const _0x953e90 of _0x379286[_0x595653(0x18c)]){_0x953e90['action']===_0x595653(0x1ac)&&console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x153)]('\x20\x20Prompt\x20\x22'+_0x953e90[_0x595653(0x1ad)]+_0x595653(0x164)+_0x953e90['error']));}for(const _0x1308ec of _0x379286[_0x595653(0x117)]){_0x1308ec[_0x595653(0x1a6)]==='error'&&console[_0x595653(0x187)](a4_0x727e9d[_0x595653(0x153)]('\x20\x20Integration\x20\x22'+_0x1308ec[_0x595653(0x1ad)]+'\x22:\x20'+_0x1308ec[_0x595653(0x1ac)]));}return 0x1;}console[_0x595653(0x187)](a4_0x727e9d['green'](_0x595653(0x165)+(_0xcdf521+_0x3367ef)+'\x20resources\x20to\x20\x27'+_0x379286['projectName']+'\x27'));const _0x198725=getLLMProjectUrl(_0x4b0475,_0x379286['projectId']);return console['log'](_0x595653(0x16a)+a4_0x727e9d['cyan'](_0x198725)),0x0;}}
|
|
1
|
+
const a4_0xdc039d=a4_0x1199;(function(_0x54ef4e,_0x28680b){const _0x483833=a4_0x1199,_0x49e633=_0x54ef4e();while(!![]){try{const _0x41885c=-parseInt(_0x483833(0x21d))/0x1*(-parseInt(_0x483833(0x267))/0x2)+-parseInt(_0x483833(0x1f9))/0x3+parseInt(_0x483833(0x243))/0x4*(parseInt(_0x483833(0x258))/0x5)+parseInt(_0x483833(0x1d9))/0x6*(-parseInt(_0x483833(0x232))/0x7)+-parseInt(_0x483833(0x1f1))/0x8*(parseInt(_0x483833(0x227))/0x9)+parseInt(_0x483833(0x25e))/0xa*(-parseInt(_0x483833(0x21a))/0xb)+parseInt(_0x483833(0x1eb))/0xc;if(_0x41885c===_0x28680b)break;else _0x49e633['push'](_0x49e633['shift']());}catch(_0x42490f){_0x49e633['push'](_0x49e633['shift']());}}}(a4_0x5c31,0x1e7bf));import a4_0x5424b1 from'chalk';import a4_0x4975e4 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}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(_0xbc43cf){const _0x3d3e67=a4_0x1199,_0x284d60=[];if(_0xbc43cf[_0x3d3e67(0x22e)]!==undefined)_0x284d60[_0x3d3e67(0x1bf)](_0xbc43cf[_0x3d3e67(0x22e)]+_0x3d3e67(0x254));if(_0xbc43cf[_0x3d3e67(0x1ed)]!==undefined&&_0xbc43cf[_0x3d3e67(0x1ed)]>0x0)_0x284d60[_0x3d3e67(0x1bf)](a4_0x5424b1[_0x3d3e67(0x23b)](_0xbc43cf[_0x3d3e67(0x1ed)]+'\x20new'));if(_0xbc43cf[_0x3d3e67(0x26d)]!==undefined&&_0xbc43cf[_0x3d3e67(0x26d)]>0x0)_0x284d60[_0x3d3e67(0x1bf)](a4_0x5424b1[_0x3d3e67(0x23b)](_0xbc43cf[_0x3d3e67(0x26d)]+'\x20created'));if(_0xbc43cf[_0x3d3e67(0x229)]!==undefined&&_0xbc43cf[_0x3d3e67(0x229)]>0x0)_0x284d60[_0x3d3e67(0x1bf)](a4_0x5424b1[_0x3d3e67(0x263)](_0xbc43cf[_0x3d3e67(0x229)]+_0x3d3e67(0x226)));if(_0xbc43cf[_0x3d3e67(0x25c)]!==undefined&&_0xbc43cf[_0x3d3e67(0x25c)]>0x0)_0x284d60[_0x3d3e67(0x1bf)](a4_0x5424b1[_0x3d3e67(0x200)](_0xbc43cf['unchanged']+_0x3d3e67(0x26a)));if(_0xbc43cf[_0x3d3e67(0x1e4)]!==undefined&&_0xbc43cf[_0x3d3e67(0x1e4)]>0x0)_0x284d60[_0x3d3e67(0x1bf)](a4_0x5424b1[_0x3d3e67(0x1cf)](_0xbc43cf[_0x3d3e67(0x1e4)]+_0x3d3e67(0x1be)));return _0x284d60['join'](',\x20');}function displayDiffs(_0xdf8022,_0x466959,_0x414da5,_0x499092,_0x514a94,_0x435b58,_0x6becaf){const _0x3016ef=a4_0x1199;for(const _0x4a50e1 of _0xdf8022){if(_0x4a50e1[_0x3016ef(0x1fa)]){const _0x376c7b=_0x4a50e1[_0x3016ef(0x22c)]||_0x4a50e1['name'];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x376c7b+'\x27:'),console[_0x3016ef(0x24c)]('─'[_0x3016ef(0x218)](0x3c)),console[_0x3016ef(0x24c)](_0x4a50e1['diff']),console['log']('─'[_0x3016ef(0x218)](0x3c));}}for(const _0x2cbb85 of _0x466959){_0x2cbb85[_0x3016ef(0x1fa)]&&(console[_0x3016ef(0x24c)](_0x3016ef(0x249)+_0x2cbb85[_0x3016ef(0x1ee)]+'\x27:'),console[_0x3016ef(0x24c)]('─'['repeat'](0x3c)),console['log'](_0x2cbb85[_0x3016ef(0x1fa)]),console[_0x3016ef(0x24c)]('─'[_0x3016ef(0x218)](0x3c)));}for(const _0x207ee8 of _0x414da5){_0x207ee8[_0x3016ef(0x1fa)]&&(console[_0x3016ef(0x24c)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x207ee8[_0x3016ef(0x1ee)]+'\x27:'),console[_0x3016ef(0x24c)]('─'['repeat'](0x3c)),console[_0x3016ef(0x24c)](_0x207ee8[_0x3016ef(0x1fa)]),console[_0x3016ef(0x24c)]('─'[_0x3016ef(0x218)](0x3c)));}for(const _0x7488c of _0x499092){_0x7488c['diff']&&(console[_0x3016ef(0x24c)](_0x3016ef(0x1d1)+_0x7488c[_0x3016ef(0x1ee)]+'\x27:'),console[_0x3016ef(0x24c)]('─'[_0x3016ef(0x218)](0x3c)),console[_0x3016ef(0x24c)](_0x7488c['diff']),console[_0x3016ef(0x24c)]('─'[_0x3016ef(0x218)](0x3c)));}for(const _0x36bf6f of _0x514a94){_0x36bf6f[_0x3016ef(0x1fa)]&&(console[_0x3016ef(0x24c)](_0x3016ef(0x1f0)+_0x36bf6f['name']+'\x27:'),console['log']('─'[_0x3016ef(0x218)](0x3c)),console[_0x3016ef(0x24c)](_0x36bf6f[_0x3016ef(0x1fa)]),console[_0x3016ef(0x24c)]('─'[_0x3016ef(0x218)](0x3c)));}for(const _0x517348 of _0x435b58){_0x517348[_0x3016ef(0x1fa)]&&(console[_0x3016ef(0x24c)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x517348[_0x3016ef(0x1ee)]+'\x27:'),console[_0x3016ef(0x24c)]('─'[_0x3016ef(0x218)](0x3c)),console[_0x3016ef(0x24c)](_0x517348['diff']),console[_0x3016ef(0x24c)]('─'['repeat'](0x3c)));}for(const _0x56eb11 of _0x6becaf){_0x56eb11[_0x3016ef(0x1fa)]&&(console[_0x3016ef(0x24c)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x56eb11['name']+'\x27:'),console[_0x3016ef(0x24c)]('─'[_0x3016ef(0x218)](0x3c)),console[_0x3016ef(0x24c)](_0x56eb11[_0x3016ef(0x1fa)]),console[_0x3016ef(0x24c)]('─'[_0x3016ef(0x218)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0xdc039d(0x1ee)]=a4_0xdc039d(0x257);['description']=a4_0xdc039d(0x1f7);async[a4_0xdc039d(0x1c1)](_0x4f7d46){const _0xef3a7b=a4_0xdc039d,{options:_0x331c0b,args:_0x5860ca,tdx:_0x29f0e3}=_0x4f7d46,_0x37eb84=_0x5860ca[0x0],_0x28e022=_0x5860ca[0x1],_0x43fbce=_0x331c0b[_0xef3a7b(0x221)],_0x118475=_0x331c0b[_0xef3a7b(0x1d2)],_0xe15e10=_0x331c0b[_0xef3a7b(0x238)],_0x111f0f=_0x331c0b[_0xef3a7b(0x20f)],_0xa0ba62=_0x331c0b['llmProject'];let _0x2fe86a,_0x2ac47b;const _0x2abc94=findAgentConfigPath(process[_0xef3a7b(0x247)]());if(_0x37eb84){const _0x3caeee=a4_0x4975e4[_0xef3a7b(0x239)](_0x37eb84,_0xef3a7b(0x26e));if(existsSync(_0x3caeee))try{const _0x516a00=JSON['parse'](readFileSync(_0x3caeee,_0xef3a7b(0x212)));_0x2fe86a=_0x516a00[_0xef3a7b(0x255)],_0x2ac47b=_0x37eb84,console[_0xef3a7b(0x24c)](a4_0x5424b1[_0xef3a7b(0x242)]('Using\x20project\x20from\x20'+_0x3caeee+':\x20'+_0x2fe86a));}catch{_0x2fe86a=_0x37eb84;}else _0x2fe86a=_0x37eb84;}else{if(_0x2abc94)try{const _0x5d8dc9=JSON['parse'](readFileSync(_0x2abc94,_0xef3a7b(0x212)));_0x2fe86a=_0x5d8dc9[_0xef3a7b(0x255)],_0x2ac47b=a4_0x4975e4[_0xef3a7b(0x1d7)](_0x2abc94),console[_0xef3a7b(0x24c)](a4_0x5424b1[_0xef3a7b(0x242)](_0xef3a7b(0x1ce)+_0x2fe86a));}catch{_0x2fe86a=_0xa0ba62;}else _0x2fe86a=_0xa0ba62;}if(!_0x2fe86a)return console[_0xef3a7b(0x24c)](a4_0x5424b1[_0xef3a7b(0x263)](_0xef3a7b(0x269))),console['log'](_0xef3a7b(0x26b)),console[_0xef3a7b(0x24c)](_0xef3a7b(0x201)),console[_0xef3a7b(0x24c)](_0xef3a7b(0x22b)),console['log'](_0xef3a7b(0x20e)),0x1;if(_0x28e022){const {data:_0xd35f6a}=await withSpinner(_0xef3a7b(0x233)+_0x28e022+_0xef3a7b(0x1cc)+_0x2fe86a+_0xef3a7b(0x237),()=>_0x29f0e3[_0xef3a7b(0x246)][_0xef3a7b(0x260)](_0x2fe86a,_0x28e022,_0x43fbce,{'dryRun':_0x118475,'force':_0xe15e10}));if(_0x118475)return console[_0xef3a7b(0x24c)](a4_0x5424b1['yellow'](_0xef3a7b(0x20a))),console[_0xef3a7b(0x24c)](_0xef3a7b(0x202)+_0xd35f6a[_0xef3a7b(0x22c)]),console['log'](_0xef3a7b(0x208)+_0xd35f6a[_0xef3a7b(0x1db)]),_0xd35f6a[_0xef3a7b(0x1fa)]&&(console[_0xef3a7b(0x24c)]('\x0aChanges:'),console['log']('─'[_0xef3a7b(0x218)](0x3c)),console[_0xef3a7b(0x24c)](_0xd35f6a['diff']),console['log']('─'[_0xef3a7b(0x218)](0x3c))),0x0;return console['log'](a4_0x5424b1[_0xef3a7b(0x23b)](_0xef3a7b(0x26f))),console['log'](_0xef3a7b(0x265)+_0xd35f6a['agentName']),console['log'](_0xef3a7b(0x22a)+_0xd35f6a[_0xef3a7b(0x1db)]),console[_0xef3a7b(0x24c)]('Status:\x20'+(_0xd35f6a['isNew']?a4_0x5424b1['green']('new'):_0xd35f6a[_0xef3a7b(0x225)]?a4_0x5424b1[_0xef3a7b(0x263)](_0xef3a7b(0x229)):a4_0x5424b1[_0xef3a7b(0x200)](_0xef3a7b(0x25c)))),0x0;}const _0x57d344=_0x2ac47b||_0x43fbce,{data:_0x5d47a1}=await withSpinner(_0xef3a7b(0x1cd)+_0x2fe86a+_0xef3a7b(0x237),()=>_0x29f0e3['llm'][_0xef3a7b(0x21e)](_0x2fe86a,_0x57d344,{'dryRun':!![]})),_0x56c913=_0x5d47a1['counts'][_0xef3a7b(0x230)]['new']+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x210)]['new']+_0x5d47a1['counts'][_0xef3a7b(0x1fe)][_0xef3a7b(0x1ed)]+_0x5d47a1['counts'][_0xef3a7b(0x1d5)]['new']+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x223)][_0xef3a7b(0x1ed)]+_0x5d47a1['counts'][_0xef3a7b(0x23d)][_0xef3a7b(0x1ed)]+_0x5d47a1['counts'][_0xef3a7b(0x1c7)]['new'],_0x8f2d18=_0x5d47a1[_0xef3a7b(0x1bd)]['agents'][_0xef3a7b(0x229)]+_0x5d47a1[_0xef3a7b(0x1bd)]['knowledgeBases'][_0xef3a7b(0x229)]+_0x5d47a1['counts'][_0xef3a7b(0x1fe)][_0xef3a7b(0x229)]+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x1d5)][_0xef3a7b(0x229)]+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x223)][_0xef3a7b(0x229)]+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x23d)][_0xef3a7b(0x229)]+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x1c7)][_0xef3a7b(0x229)],_0x38e68e=_0x5d47a1[_0xef3a7b(0x1bd)]['agents'][_0xef3a7b(0x25c)]+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x210)]['unchanged']+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x1fe)][_0xef3a7b(0x25c)]+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x1d5)][_0xef3a7b(0x25c)]+_0x5d47a1['counts'][_0xef3a7b(0x223)][_0xef3a7b(0x25c)]+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x23d)]['unchanged']+_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x1c7)][_0xef3a7b(0x25c)];console[_0xef3a7b(0x24c)]('\x0aPull\x20summary\x20for\x20\x27'+_0x5d47a1[_0xef3a7b(0x236)]+'\x27:'),console[_0xef3a7b(0x24c)]('\x20\x20'+a4_0x5424b1[_0xef3a7b(0x23b)]('+\x20'+_0x56c913+_0xef3a7b(0x250))+'\x20|\x20'+a4_0x5424b1[_0xef3a7b(0x263)]('~\x20'+_0x8f2d18+_0xef3a7b(0x26c))+_0xef3a7b(0x264)+a4_0x5424b1[_0xef3a7b(0x242)]('=\x20'+_0x38e68e+_0xef3a7b(0x26a))),console[_0xef3a7b(0x24c)](_0xef3a7b(0x24e)+formatCountSummary(_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x230)])),console[_0xef3a7b(0x24c)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x210)])),console[_0xef3a7b(0x24c)](_0xef3a7b(0x22f)+formatCountSummary(_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x1fe)])),console[_0xef3a7b(0x24c)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x1d5)])),console[_0xef3a7b(0x24c)](_0xef3a7b(0x217)+formatCountSummary(_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x223)]));const _0x335f64=_0x5d47a1['counts'][_0xef3a7b(0x23d)][_0xef3a7b(0x22e)]>0x0||_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x1c7)][_0xef3a7b(0x22e)]>0x0;_0x335f64&&(console[_0xef3a7b(0x24c)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x23d)])),console['log'](_0xef3a7b(0x205)+formatCountSummary(_0x5d47a1[_0xef3a7b(0x1bd)][_0xef3a7b(0x1c7)])));console[_0xef3a7b(0x24c)](_0xef3a7b(0x21c)+a4_0x5424b1['cyan'](_0x5d47a1[_0xef3a7b(0x204)])),displayDiffs(_0x5d47a1[_0xef3a7b(0x230)],_0x5d47a1[_0xef3a7b(0x210)],_0x5d47a1[_0xef3a7b(0x1fe)],_0x5d47a1[_0xef3a7b(0x1d5)],_0x5d47a1[_0xef3a7b(0x223)],_0x5d47a1['experimentalKnowledgeBases'],_0x5d47a1[_0xef3a7b(0x1c7)]);if(_0x118475)return console[_0xef3a7b(0x24c)](a4_0x5424b1[_0xef3a7b(0x263)](_0xef3a7b(0x211))),0x0;if(_0x56c913===0x0&&_0x8f2d18===0x0)return console[_0xef3a7b(0x24c)](a4_0x5424b1['green'](_0xef3a7b(0x241))),saveSessionContext({'llm_project':_0x5d47a1[_0xef3a7b(0x236)]},_0x331c0b['session']),console[_0xef3a7b(0x24c)](a4_0x5424b1[_0xef3a7b(0x23b)](_0xef3a7b(0x24f)+a4_0x5424b1[_0xef3a7b(0x242)]('llm_project')+_0xef3a7b(0x1c9)+a4_0x5424b1[_0xef3a7b(0x1c5)](_0x5d47a1[_0xef3a7b(0x236)]))),0x0;if(!_0x111f0f&&!_0xe15e10){if(!isInteractive())return console['error'](a4_0x5424b1[_0xef3a7b(0x1cf)](_0xef3a7b(0x209)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xef3a7b(0x1c0)](a4_0x5424b1[_0xef3a7b(0x242)](_0xef3a7b(0x203))),0x1;const _0x529e69=await confirmKey('\x0aWrite\x20'+(_0x56c913+_0x8f2d18)+'\x20files?');if(!_0x529e69)return console[_0xef3a7b(0x24c)](a4_0x5424b1[_0xef3a7b(0x263)](_0xef3a7b(0x21f)),_0xef3a7b(0x253)),0x1;}const {data:_0x3c4ec4}=await withSpinner(_0xef3a7b(0x24d),()=>_0x29f0e3[_0xef3a7b(0x246)][_0xef3a7b(0x21e)](_0x2fe86a,_0x57d344,{'force':_0xe15e10}));return console['log'](a4_0x5424b1[_0xef3a7b(0x23b)](_0xef3a7b(0x1f8)+(_0x56c913+_0x8f2d18)+_0xef3a7b(0x1dc)+_0x3c4ec4['outputDir'])),saveSessionContext({'llm_project':_0x3c4ec4[_0xef3a7b(0x236)]},_0x331c0b['session']),console[_0xef3a7b(0x24c)](a4_0x5424b1[_0xef3a7b(0x23b)]('✔\x20Context\x20set:\x20'+a4_0x5424b1[_0xef3a7b(0x242)]('llm_project')+_0xef3a7b(0x1c9)+a4_0x5424b1[_0xef3a7b(0x1c5)](_0x3c4ec4[_0xef3a7b(0x236)]))),0x0;}}function a4_0x1199(_0x588517,_0x33b34c){_0x588517=_0x588517-0x1ba;const _0x5c3168=a4_0x5c31();let _0x119975=_0x5c3168[_0x588517];return _0x119975;}export class AgentCloneCommand extends BaseCommand{[a4_0xdc039d(0x1ee)]='agent:clone';[a4_0xdc039d(0x25a)]=a4_0xdc039d(0x240);async[a4_0xdc039d(0x1c1)](_0x40b0a6){const _0x2d3677=a4_0xdc039d,{options:_0x3ddff9,args:_0x57d92f,tdx:_0x576101}=_0x40b0a6,_0x2abbd2=_0x57d92f[0x0],_0x59d46b=_0x3ddff9[_0x2d3677(0x1ee)],_0x33cc77=_0x3ddff9[_0x2d3677(0x1d2)],_0x20b557=_0x3ddff9['yes'],_0x12639e=_0x3ddff9[_0x2d3677(0x1bb)],_0x30edba=_0x3ddff9[_0x2d3677(0x20d)];let _0x5e38ad;const _0x514b5c=findAgentConfigPath(process[_0x2d3677(0x247)]());if(_0x2abbd2){const _0x4d51cc=a4_0x4975e4[_0x2d3677(0x239)](_0x2abbd2,_0x2d3677(0x26e));existsSync(_0x4d51cc)?(_0x5e38ad=_0x2abbd2,console[_0x2d3677(0x24c)](a4_0x5424b1[_0x2d3677(0x242)](_0x2d3677(0x244)+_0x2abbd2))):_0x5e38ad=_0x2abbd2;}else{if(_0x514b5c)_0x5e38ad=a4_0x4975e4['dirname'](_0x514b5c),console[_0x2d3677(0x24c)](a4_0x5424b1[_0x2d3677(0x242)](_0x2d3677(0x1ec)+_0x5e38ad));else{if(_0x30edba){const _0x4028da=sanitizeForFilesystem(_0x30edba);let _0x55c45c=_0x4028da,_0x485535=a4_0x4975e4[_0x2d3677(0x239)](process[_0x2d3677(0x247)](),'agents',_0x4028da,_0x2d3677(0x26e));if(!existsSync(_0x485535)){const _0x25b44f=normalizeName(_0x30edba),_0x34b97e=a4_0x4975e4[_0x2d3677(0x239)](process[_0x2d3677(0x247)](),'agents',_0x25b44f,'tdx.json');existsSync(_0x34b97e)&&(_0x55c45c=_0x25b44f,_0x485535=_0x34b97e);}if(existsSync(_0x485535))_0x5e38ad=a4_0x4975e4[_0x2d3677(0x1d7)](_0x485535),console['log'](a4_0x5424b1[_0x2d3677(0x242)](_0x2d3677(0x244)+_0x5e38ad));else{const _0x2f82b2=_0x3ddff9[_0x2d3677(0x234)];if(_0x2f82b2)throw new SDKError(ErrorCode[_0x2d3677(0x219)],_0x2d3677(0x228)+_0x30edba+_0x2d3677(0x22d),undefined,{'helpText':_0x2d3677(0x1e3)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+('\x20\x20tdx\x20agent\x20pull\x20'+_0x30edba+'\x0a')+(_0x2d3677(0x1c4)+_0x55c45c+_0x2d3677(0x1ff)+(_0x59d46b||_0x2d3677(0x25b))+'\x20--profile\x20'+_0x2f82b2)});_0x5e38ad=_0x30edba,console[_0x2d3677(0x24c)](a4_0x5424b1['dim'](_0x2d3677(0x1ba)+_0x30edba));}}}}if(!_0x5e38ad)return console[_0x2d3677(0x24c)](a4_0x5424b1[_0x2d3677(0x263)](_0x2d3677(0x1e8))),console[_0x2d3677(0x24c)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x2d3677(0x24c)](_0x2d3677(0x1fd)),console[_0x2d3677(0x24c)](_0x2d3677(0x235)),console[_0x2d3677(0x24c)](_0x2d3677(0x222)),0x1;if(!_0x59d46b)throw new SDKError(ErrorCode[_0x2d3677(0x25d)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x2d3677(0x1f5)});if(!_0x20b557&&!_0x33cc77){if(!isInteractive())return console[_0x2d3677(0x1c0)](a4_0x5424b1[_0x2d3677(0x1cf)](_0x2d3677(0x209)),_0x2d3677(0x1fc)),console['error'](a4_0x5424b1[_0x2d3677(0x242)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x56ee45=await confirmKey('Clone\x20\x22'+_0x5e38ad+_0x2d3677(0x1d3)+_0x59d46b+'\x22?');if(!_0x56ee45)return console[_0x2d3677(0x24c)](a4_0x5424b1['yellow'](_0x2d3677(0x21f))),0x1;}const {data:_0x3fbd04}=await withSpinner(_0x2d3677(0x1e2)+_0x5e38ad+_0x2d3677(0x1e7)+_0x59d46b+_0x2d3677(0x237),()=>_0x576101[_0x2d3677(0x246)]['cloneProject'](_0x5e38ad,_0x59d46b,{'dryRun':_0x33cc77}));if(_0x33cc77){console[_0x2d3677(0x24c)](a4_0x5424b1['yellow'](_0x2d3677(0x23e))),console[_0x2d3677(0x24c)](_0x2d3677(0x1ef)+_0x3fbd04[_0x2d3677(0x1c8)]),console[_0x2d3677(0x24c)]('New\x20project:\x20'+_0x59d46b),console['log'](_0x2d3677(0x1e9)),console[_0x2d3677(0x24c)](_0x2d3677(0x24e)+_0x3fbd04[_0x2d3677(0x1bd)]['agents'][_0x2d3677(0x26d)]),console[_0x2d3677(0x24c)]('\x20\x20Knowledge\x20Bases:\x20'+_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x210)]['created']),console['log'](_0x2d3677(0x270)+_0x3fbd04[_0x2d3677(0x1bd)]['prompts']['created']);const _0x22cb0b=_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x23d)]['created']>0x0||_0x3fbd04['counts'][_0x2d3677(0x1c7)][_0x2d3677(0x26d)]>0x0;return _0x22cb0b&&(console[_0x2d3677(0x24c)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x3fbd04['counts'][_0x2d3677(0x23d)][_0x2d3677(0x26d)]),console[_0x2d3677(0x24c)](_0x2d3677(0x205)+_0x3fbd04['counts'][_0x2d3677(0x1c7)][_0x2d3677(0x26d)])),0x0;}const _0x2abbbf=_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x230)][_0x2d3677(0x1e4)]>0x0||_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x210)][_0x2d3677(0x1e4)]>0x0||_0x3fbd04['counts'][_0x2d3677(0x1d5)][_0x2d3677(0x1e4)]>0x0||_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x23d)][_0x2d3677(0x1e4)]>0x0||_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x1c7)][_0x2d3677(0x1e4)]>0x0;_0x2abbbf?console[_0x2d3677(0x24c)](a4_0x5424b1['yellow'](_0x2d3677(0x256))):console[_0x2d3677(0x24c)](a4_0x5424b1[_0x2d3677(0x23b)](_0x2d3677(0x24a)));console[_0x2d3677(0x24c)](_0x2d3677(0x1ef)+_0x3fbd04['sourceProjectName']),console[_0x2d3677(0x24c)](_0x2d3677(0x1e6)+_0x3fbd04['newProjectName']),console[_0x2d3677(0x24c)](_0x2d3677(0x1ea)+_0x3fbd04[_0x2d3677(0x23c)]),console[_0x2d3677(0x24c)](),console[_0x2d3677(0x24c)](_0x2d3677(0x207)),console[_0x2d3677(0x24c)](_0x2d3677(0x24e)+formatCountSummary(_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x230)])),console[_0x2d3677(0x24c)](_0x2d3677(0x271)+formatCountSummary(_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x210)])),console[_0x2d3677(0x24c)](_0x2d3677(0x270)+formatCountSummary(_0x3fbd04[_0x2d3677(0x1bd)]['prompts'])),console[_0x2d3677(0x24c)](_0x2d3677(0x217)+formatCountSummary(_0x3fbd04['counts'][_0x2d3677(0x223)]));const _0x407f8=_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x23d)][_0x2d3677(0x26d)]>0x0||_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x23d)][_0x2d3677(0x229)]>0x0||_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x23d)][_0x2d3677(0x25c)]>0x0||_0x3fbd04['counts'][_0x2d3677(0x1c7)][_0x2d3677(0x26d)]>0x0||_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x1c7)][_0x2d3677(0x229)]>0x0||_0x3fbd04['counts'][_0x2d3677(0x1c7)][_0x2d3677(0x25c)]>0x0;_0x407f8&&(console[_0x2d3677(0x24c)](_0x2d3677(0x1bc)+formatCountSummary(_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x23d)])),console[_0x2d3677(0x24c)](_0x2d3677(0x205)+formatCountSummary(_0x3fbd04[_0x2d3677(0x1bd)][_0x2d3677(0x1c7)])));if(_0x2abbbf){console[_0x2d3677(0x24c)](),console['log'](a4_0x5424b1[_0x2d3677(0x1cf)](_0x2d3677(0x206)));for(const _0x3ed6b9 of _0x3fbd04[_0x2d3677(0x230)]){_0x3ed6b9[_0x2d3677(0x1fb)]===_0x2d3677(0x1c0)&&console[_0x2d3677(0x24c)](a4_0x5424b1[_0x2d3677(0x1cf)](_0x2d3677(0x1de)+_0x3ed6b9[_0x2d3677(0x22c)]+_0x2d3677(0x1ca)+_0x3ed6b9[_0x2d3677(0x1c0)]));}for(const _0x3402af of _0x3fbd04[_0x2d3677(0x210)]){_0x3402af[_0x2d3677(0x1fb)]===_0x2d3677(0x1c0)&&console[_0x2d3677(0x24c)](a4_0x5424b1[_0x2d3677(0x1cf)](_0x2d3677(0x1cb)+_0x3402af[_0x2d3677(0x1ee)]+_0x2d3677(0x1ca)+_0x3402af[_0x2d3677(0x1c0)]));}for(const _0x92d7c6 of _0x3fbd04['prompts']){_0x92d7c6[_0x2d3677(0x1fb)]===_0x2d3677(0x1c0)&&console['log'](a4_0x5424b1[_0x2d3677(0x1cf)](_0x2d3677(0x224)+_0x92d7c6[_0x2d3677(0x1ee)]+'\x22:\x20'+_0x92d7c6[_0x2d3677(0x1c0)]));}for(const _0x102af9 of _0x3fbd04[_0x2d3677(0x223)]){_0x102af9[_0x2d3677(0x1fb)]===_0x2d3677(0x1c0)&&console[_0x2d3677(0x24c)](a4_0x5424b1[_0x2d3677(0x1cf)](_0x2d3677(0x24b)+_0x102af9['name']+_0x2d3677(0x1ca)+_0x102af9[_0x2d3677(0x1c0)]));}for(const _0x2c11e9 of _0x3fbd04[_0x2d3677(0x23d)]){_0x2c11e9['action']===_0x2d3677(0x1c0)&&console['log'](a4_0x5424b1[_0x2d3677(0x1cf)](_0x2d3677(0x20c)+_0x2c11e9[_0x2d3677(0x1ee)]+_0x2d3677(0x1ca)+_0x2c11e9['error']));}for(const _0xc06d9d of _0x3fbd04[_0x2d3677(0x1c7)]){_0xc06d9d[_0x2d3677(0x1fb)]===_0x2d3677(0x1c0)&&console[_0x2d3677(0x24c)](a4_0x5424b1['red'](_0x2d3677(0x245)+_0xc06d9d[_0x2d3677(0x1ee)]+_0x2d3677(0x1ca)+_0xc06d9d[_0x2d3677(0x1c0)]));}return 0x1;}console[_0x2d3677(0x24c)]();const _0x3319c2=getLLMProjectUrl(_0x12639e,_0x3fbd04[_0x2d3677(0x23c)]);return console[_0x2d3677(0x24c)](_0x2d3677(0x213)+a4_0x5424b1[_0x2d3677(0x1c5)](_0x3319c2)),0x0;}}function a4_0x5c31(){const _0x35929b=['execute','\x0aProject\x20pushed\x20with\x20errors','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20tdx\x20agent\x20clone\x20agents/','cyan','agent.yml','experimentalArtifacts','sourceProjectName','\x20=\x20','\x22:\x20','\x20\x20Knowledge\x20Base\x20\x22','\x22\x20from\x20project\x20\x22','Analyzing\x20project\x20\x22','Using\x20project:\x20','red','reason','\x0aChanges\x20to\x20prompt\x20\x27','dryRun','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Text\x20Knowledge\x20Base\x20\x22','prompts','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','dirname','message','789420QVaFQP','\x0aErrors\x20found:','outputPath','\x20files\x20to\x20','\x0aPush\x20','\x20\x20Agent\x20\x22','\x20resources\x20to\x20\x27','Would\x20push\x20agent:\x20','\x0aPush\x20summary\x20for\x20\x27','Cloning\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','errors','no_local_folder','New\x20project:\x20','\x22\x20to\x20\x22','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Would\x20clone:','New\x20project\x20ID:\x20','6382296rMCRtT','Using\x20current\x20project:\x20','new','name','Source:\x20','\x0aChanges\x20to\x20integration\x20\x27','72616aLKUle','projectId','Agent\x20','source','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Failed\x20to\x20push\x20agent:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x0a✔\x20Pulled\x20','667248Jmalox','diff','action','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','textKnowledgeBases','\x20--name\x20','gray','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','Would\x20pull\x20agent:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','outputDir','\x20\x20Experimental\x20Artifacts:\x20','Errors:','Summary:','Output\x20path:\x20','\x0aError:','Dry\x20run\x20-\x20no\x20files\x20written','pushAgent','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','llmProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','yes','knowledgeBases','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','utf-8','Project:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20resources?','\x20successfully','\x20\x20Integrations:\x20','repeat','INVALID_ARGUMENT','289630xUKJql','agent:push','\x20\x20Target:\x20','2tiRvAl','pullProject','Cancelled','Chat:\x20','output','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','integrations','\x20\x20Prompt\x20\x22','hasChanges','\x20updated','9fUhgwM','Cannot\x20clone\x20from\x20context\x20project\x20\x22','updated','Output:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','agentName','\x22\x20to\x20a\x20different\x20profile','total','\x20\x20Text\x20Knowledge\x20Bases:\x20','agents','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','7CAzDjN','Pulling\x20agent\x20\x22','profile','\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)','projectName','\x22...','force','join','projectDir','green','newProjectId','experimentalKnowledgeBases','Dry\x20run\x20-\x20no\x20changes\x20made','agentId','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','dim','150608umMMYq','Using\x20local\x20project:\x20','\x20\x20Experimental\x20Artifact\x20\x22','llm','cwd','Analyzing\x20changes\x20to\x20push...','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Project\x20cloned\x20successfully','\x20\x20Integration\x20\x22','log','Writing\x20files...','\x20\x20Agents:\x20','✔\x20Context\x20set:\x20','\x20new','pushProject','Pushing\x20to\x20project...','-\x20no\x20files\x20written','\x20total','llm_project','Project\x20cloned\x20with\x20errors','agent:pull','5GvoPBL','\x0a✔\x20Pushed\x20','description','<new-name>','unchanged','MISSING_ARGUMENT','70axqVdg','no_context','pullAgent','\x20\x20Source:\x20','context','yellow','\x20|\x20','Agent:\x20','Pushing\x20agent\x20from\x20\x22','102726sSUuhA','\x27\x20to\x20create\x20the\x20folder\x20structure.','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20unchanged','Usage:\x20tdx\x20agent\x20pull\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)','\x20changed','created','tdx.json','Agent\x20pulled\x20successfully','\x20\x20Prompts:\x20','\x20\x20Knowledge\x20Bases:\x20','Using\x20context\x20project:\x20','site','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','counts','\x20errors','push','error'];a4_0x5c31=function(){return _0x35929b;};return a4_0x5c31();}export class AgentPushCommand extends BaseCommand{[a4_0xdc039d(0x1ee)]=a4_0xdc039d(0x21b);[a4_0xdc039d(0x25a)]=a4_0xdc039d(0x214);async['execute'](_0x375122){const _0x47f53f=a4_0xdc039d,{options:_0x128540,args:_0x21a34c,tdx:_0xf45f78}=_0x375122;let _0x45974e=_0x21a34c[0x0]||process['cwd']();const _0x387c82=_0x128540[_0x47f53f(0x1d2)],_0xacfc3e=_0x128540[_0x47f53f(0x238)],_0x5e478e=_0x128540['yes'],_0x439da9=_0x128540[_0x47f53f(0x1bb)],_0x6cd156=a4_0x4975e4[_0x47f53f(0x239)](_0x45974e,_0x47f53f(0x1c6)),_0x16043b=existsSync(_0x6cd156);if(_0x16043b){const {data:_0x223a3f}=await withSpinner(_0x47f53f(0x266)+_0x45974e+_0x47f53f(0x237),()=>_0xf45f78[_0x47f53f(0x246)][_0x47f53f(0x20b)](_0x45974e,{'dryRun':_0x387c82,'force':_0xacfc3e}));if(_0x387c82)return console[_0x47f53f(0x24c)](a4_0x5424b1['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console['log'](_0x47f53f(0x1e0)+_0x223a3f[_0x47f53f(0x22c)]),0x0;if(_0x223a3f[_0x47f53f(0x1fb)]===_0x47f53f(0x1c0))return console[_0x47f53f(0x24c)](a4_0x5424b1['red'](_0x47f53f(0x1f6)+_0x223a3f[_0x47f53f(0x1c0)])),0x1;console['log'](a4_0x5424b1[_0x47f53f(0x23b)](_0x47f53f(0x1f3)+_0x223a3f[_0x47f53f(0x1fb)]+_0x47f53f(0x216))),console[_0x47f53f(0x24c)](_0x47f53f(0x265)+_0x223a3f[_0x47f53f(0x22c)]);if(_0x223a3f[_0x47f53f(0x23f)]&&_0x223a3f[_0x47f53f(0x1f2)]){const _0x41203d=getLLMAgentChatUrl(_0x439da9,_0x223a3f['projectId'],_0x223a3f[_0x47f53f(0x23f)]);console[_0x47f53f(0x24c)](_0x47f53f(0x220)+a4_0x5424b1[_0x47f53f(0x1c5)](_0x41203d));}return 0x0;}const _0x5d7be6=_0x128540[_0x47f53f(0x20d)],_0x51e405=resolveProjectFromContext(_0x45974e,_0x5d7be6);if(_0x51e405['found'])_0x45974e=_0x51e405[_0x47f53f(0x23a)],_0x51e405[_0x47f53f(0x1f4)]===_0x47f53f(0x262)&&console[_0x47f53f(0x24c)](a4_0x5424b1['dim'](_0x47f53f(0x1ce)+_0x45974e));else{let _0x338d2d=_0x47f53f(0x1d6);_0x51e405[_0x47f53f(0x1d0)]===_0x47f53f(0x1e5)&&(_0x338d2d=_0x51e405[_0x47f53f(0x1d8)]+_0x47f53f(0x231)+_0x51e405[_0x47f53f(0x20d)]+_0x47f53f(0x268));throw new SDKError(ErrorCode[_0x47f53f(0x219)],_0x51e405[_0x47f53f(0x1d0)]===_0x47f53f(0x25f)?_0x51e405['message']:'No\x20tdx.json\x20found\x20in\x20'+_0x45974e,undefined,{'helpText':_0x338d2d});}const {data:_0x5540b4}=await withSpinner(_0x47f53f(0x248),()=>_0xf45f78['llm'][_0x47f53f(0x251)](_0x45974e,{'dryRun':!![]})),_0x38b4bc=_0x5540b4['counts']['agents'][_0x47f53f(0x1e4)]>0x0;if(_0x38b4bc){console[_0x47f53f(0x24c)](a4_0x5424b1[_0x47f53f(0x1cf)](_0x47f53f(0x1da)));for(const _0x6d9773 of _0x5540b4[_0x47f53f(0x230)]){_0x6d9773[_0x47f53f(0x1fb)]===_0x47f53f(0x1c0)&&console[_0x47f53f(0x24c)](a4_0x5424b1[_0x47f53f(0x1cf)](_0x47f53f(0x1de)+_0x6d9773[_0x47f53f(0x22c)]+_0x47f53f(0x1ca)+_0x6d9773['error']));}return 0x1;}const _0x326780=_0x5540b4['counts'][_0x47f53f(0x230)]['created']+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x210)][_0x47f53f(0x26d)]+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1fe)][_0x47f53f(0x26d)]+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1d5)][_0x47f53f(0x26d)]+_0x5540b4[_0x47f53f(0x1bd)]['integrations']['created']+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x23d)][_0x47f53f(0x26d)]+_0x5540b4[_0x47f53f(0x1bd)]['experimentalArtifacts'][_0x47f53f(0x26d)],_0x34b57c=_0x5540b4['counts'][_0x47f53f(0x230)][_0x47f53f(0x229)]+_0x5540b4[_0x47f53f(0x1bd)]['knowledgeBases']['updated']+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1fe)][_0x47f53f(0x229)]+_0x5540b4[_0x47f53f(0x1bd)]['prompts'][_0x47f53f(0x229)]+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x223)][_0x47f53f(0x229)]+_0x5540b4['counts'][_0x47f53f(0x23d)][_0x47f53f(0x229)]+_0x5540b4['counts']['experimentalArtifacts'][_0x47f53f(0x229)],_0x383828=_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x230)][_0x47f53f(0x25c)]+_0x5540b4[_0x47f53f(0x1bd)]['knowledgeBases'][_0x47f53f(0x25c)]+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1fe)][_0x47f53f(0x25c)]+_0x5540b4[_0x47f53f(0x1bd)]['prompts'][_0x47f53f(0x25c)]+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x223)][_0x47f53f(0x25c)]+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x23d)][_0x47f53f(0x25c)]+_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1c7)][_0x47f53f(0x25c)];console[_0x47f53f(0x24c)](_0x47f53f(0x1e1)+_0x5540b4['projectName']+'\x27:'),console[_0x47f53f(0x24c)]('\x20\x20'+a4_0x5424b1[_0x47f53f(0x23b)]('+\x20'+_0x326780+_0x47f53f(0x250))+_0x47f53f(0x264)+a4_0x5424b1[_0x47f53f(0x263)]('~\x20'+_0x34b57c+'\x20changed')+_0x47f53f(0x264)+a4_0x5424b1[_0x47f53f(0x242)]('=\x20'+_0x383828+_0x47f53f(0x26a))),console[_0x47f53f(0x24c)](_0x47f53f(0x24e)+formatCountSummary(_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x230)])),console[_0x47f53f(0x24c)](_0x47f53f(0x271)+formatCountSummary(_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x210)])),console[_0x47f53f(0x24c)](_0x47f53f(0x22f)+formatCountSummary(_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1fe)])),console[_0x47f53f(0x24c)](_0x47f53f(0x270)+formatCountSummary(_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1d5)])),console[_0x47f53f(0x24c)](_0x47f53f(0x217)+formatCountSummary(_0x5540b4[_0x47f53f(0x1bd)]['integrations']));const _0x3047cd=_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x23d)]['created']>0x0||_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x23d)][_0x47f53f(0x229)]>0x0||_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x23d)]['unchanged']>0x0||_0x5540b4[_0x47f53f(0x1bd)]['experimentalArtifacts']['created']>0x0||_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1c7)][_0x47f53f(0x229)]>0x0||_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1c7)][_0x47f53f(0x25c)]>0x0;_0x3047cd&&(console['log'](_0x47f53f(0x1bc)+formatCountSummary(_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x23d)])),console[_0x47f53f(0x24c)](_0x47f53f(0x205)+formatCountSummary(_0x5540b4[_0x47f53f(0x1bd)][_0x47f53f(0x1c7)])));console[_0x47f53f(0x24c)](_0x47f53f(0x261)+a4_0x5424b1[_0x47f53f(0x1c5)](_0x45974e)),displayDiffs(_0x5540b4['agents'],_0x5540b4[_0x47f53f(0x210)],_0x5540b4[_0x47f53f(0x1fe)],_0x5540b4['prompts'],_0x5540b4[_0x47f53f(0x223)],_0x5540b4[_0x47f53f(0x23d)],_0x5540b4[_0x47f53f(0x1c7)]);if(_0x387c82)return console[_0x47f53f(0x24c)](a4_0x5424b1[_0x47f53f(0x263)](_0x47f53f(0x1c3))),0x0;if(_0x326780===0x0&&_0x34b57c===0x0){console[_0x47f53f(0x24c)](a4_0x5424b1[_0x47f53f(0x23b)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x2bbd3b=getLLMProjectUrl(_0x439da9,_0x5540b4['projectId']);return console['log'](_0x47f53f(0x213)+a4_0x5424b1[_0x47f53f(0x1c5)](_0x2bbd3b)),0x0;}if(!_0x5e478e&&!_0xacfc3e){if(!isInteractive())return console[_0x47f53f(0x1c0)](a4_0x5424b1[_0x47f53f(0x1cf)]('\x0aError:'),_0x47f53f(0x1fc)),console[_0x47f53f(0x1c0)](a4_0x5424b1[_0x47f53f(0x242)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3148fe=await confirmKey(_0x47f53f(0x1dd)+(_0x326780+_0x34b57c)+_0x47f53f(0x215));if(!_0x3148fe)return console['log'](a4_0x5424b1['yellow'](_0x47f53f(0x21f)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x206921}=await withSpinner(_0x47f53f(0x252),()=>_0xf45f78[_0x47f53f(0x246)]['pushProject'](_0x45974e,{'force':_0xacfc3e})),_0x5d41cf=_0x206921[_0x47f53f(0x1bd)][_0x47f53f(0x230)][_0x47f53f(0x1e4)]>0x0||_0x206921['counts'][_0x47f53f(0x210)][_0x47f53f(0x1e4)]>0x0||_0x206921[_0x47f53f(0x1bd)]['textKnowledgeBases'][_0x47f53f(0x1e4)]>0x0||_0x206921[_0x47f53f(0x1bd)]['prompts'][_0x47f53f(0x1e4)]>0x0;if(_0x5d41cf){console[_0x47f53f(0x24c)](a4_0x5424b1[_0x47f53f(0x263)](_0x47f53f(0x1c2))),console[_0x47f53f(0x24c)](),console[_0x47f53f(0x24c)](a4_0x5424b1[_0x47f53f(0x1cf)](_0x47f53f(0x206)));for(const _0x44a94c of _0x206921[_0x47f53f(0x230)]){_0x44a94c['action']===_0x47f53f(0x1c0)&&console['log'](a4_0x5424b1[_0x47f53f(0x1cf)](_0x47f53f(0x1de)+_0x44a94c[_0x47f53f(0x22c)]+'\x22:\x20'+_0x44a94c['error']));}for(const _0x41dc6a of _0x206921[_0x47f53f(0x210)]){_0x41dc6a[_0x47f53f(0x1fb)]===_0x47f53f(0x1c0)&&console['log'](a4_0x5424b1[_0x47f53f(0x1cf)](_0x47f53f(0x1cb)+_0x41dc6a[_0x47f53f(0x1ee)]+'\x22:\x20'+_0x41dc6a[_0x47f53f(0x1c0)]));}for(const _0x51e128 of _0x206921[_0x47f53f(0x1fe)]){_0x51e128['action']===_0x47f53f(0x1c0)&&console[_0x47f53f(0x24c)](a4_0x5424b1['red'](_0x47f53f(0x1d4)+_0x51e128['name']+_0x47f53f(0x1ca)+_0x51e128['error']));}for(const _0x5c7ff5 of _0x206921['prompts']){_0x5c7ff5[_0x47f53f(0x1fb)]===_0x47f53f(0x1c0)&&console[_0x47f53f(0x24c)](a4_0x5424b1[_0x47f53f(0x1cf)](_0x47f53f(0x224)+_0x5c7ff5['name']+_0x47f53f(0x1ca)+_0x5c7ff5['error']));}for(const _0x362318 of _0x206921[_0x47f53f(0x223)]){_0x362318[_0x47f53f(0x1fb)]===_0x47f53f(0x1c0)&&console[_0x47f53f(0x24c)](a4_0x5424b1['red'](_0x47f53f(0x24b)+_0x362318[_0x47f53f(0x1ee)]+'\x22:\x20'+_0x362318[_0x47f53f(0x1c0)]));}return 0x1;}console[_0x47f53f(0x24c)](a4_0x5424b1[_0x47f53f(0x23b)](_0x47f53f(0x259)+(_0x326780+_0x34b57c)+_0x47f53f(0x1df)+_0x206921[_0x47f53f(0x236)]+'\x27'));const _0x2c72ab=getLLMProjectUrl(_0x439da9,_0x206921['projectId']);return console[_0x47f53f(0x24c)]('Project:\x20'+a4_0x5424b1[_0x47f53f(0x1c5)](_0x2c72ab)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x4ea2b1=a5_0x38ec;(function(_0x2fc0cf,_0x3ca1aa){const _0x3bc4ff=a5_0x38ec,_0xc77c15=_0x2fc0cf();while(!![]){try{const _0x2d81fa=parseInt(_0x3bc4ff(0x179))/0x1+-parseInt(_0x3bc4ff(0x15d))/0x2+-parseInt(_0x3bc4ff(0x188))/0x3*(parseInt(_0x3bc4ff(0x1b5))/0x4)+parseInt(_0x3bc4ff(0x1bd))/0x5*(-parseInt(_0x3bc4ff(0x187))/0x6)+parseInt(_0x3bc4ff(0x158))/0x7*(parseInt(_0x3bc4ff(0x185))/0x8)+-parseInt(_0x3bc4ff(0x181))/0x9+parseInt(_0x3bc4ff(0x1a4))/0xa;if(_0x2d81fa===_0x3ca1aa)break;else _0xc77c15['push'](_0xc77c15['shift']());}catch(_0x49897d){_0xc77c15['push'](_0xc77c15['shift']());}}}(a5_0x3de4,0x913a1));import*as a5_0x49b85d from'node:fs';function a5_0x38ec(_0x1db75d,_0x2e0cff){_0x1db75d=_0x1db75d-0x13e;const _0x3de4ef=a5_0x3de4();let _0x38ecec=_0x3de4ef[_0x1db75d];return _0x38ecec;}import*as a5_0x48c92c from'node:path';import a5_0x1b661a from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x3de4(){const _0x521617=['FAIL','2246624wfAcMR','some','site','includes','text','projectName','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','agent:test','testName','has','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','/<agent-name>','agentName','Cached\x20run\x20is\x20from\x20site\x20\x22','join','ERROR','dryRun','Total:\x20\x20\x20\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','no_context','stop','test.yml','resolve','⚠\x20SKIPPED:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','llm','Usage:','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','186322dbVlaG','eval','push','add','...','name','find','resolveAgentId','8324199dQmjaj','toISOString','Running\x20agent\x20tests...','...\x20','3801088dFQuRl','\x20\x20Conversation:\x20','78750xqVfDC','5493ljAqsJ','✓\x20PASS:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','start','length','\x20\x20Round\x20','output','substring','toLowerCase','Duration:\x20','conversations','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','table','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','tsv','found','projectDir','\x20\x20Project:\x20','Output\x20written\x20to:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','verbose','\x20\x20Site:\x20','message','dim','Re-evaluating...','tests','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','reason','31988340AGXnlL','404','\x20\x20-\x20','execute','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','description','Evaluating\x20response...','Cached\x20run\x20from:\x20','no_local_folder','PASS','map','Failed:\x20\x20\x20','red','timestamp','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','round','1604GseVUA','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','forEach','\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','Site:\x20','llmProject','agent',':\x20Sending\x20user\x20input...','365cwRsAD','Available\x20tests:\x20','now','white','testYmlPath','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','No\x20tests\x20have\x20tags\x20defined.','Error\x20writing\x20output\x20file:\x20','✗\x20FAIL:\x20','resolveProjectId','cyan','Error:\x20No\x20previous\x20test\x20run\x20found.','executeReeval','No\x20tests\x20found\x20with\x20tags:\x20','Agent:\x20','✗\x20ERROR:\x20','status','multiple_agents','\x20-\x20','not\x20found','split','Running\x20test:\x20','tags','Using\x20agent:\x20','reeval','writeFileSync','\x20(cached)','Available\x20tags:\x20','\x22:\x20','repeat','log','yellow','Failed\x20Tests:','conversation_url','utf-8','Errors:\x20\x20\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','rounds','green','Run\x20\x27tdx\x20agent\x20pull\x20','\x20(new)','Round\x20','filter','\x20\x20Evaluating...\x20','Test\x20Configuration:','no_tests','Round\x201/','trim','No\x20tests\x20found\x20matching:\x20','Executing\x20new\x20tests...','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Running:\x20','json','\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)','context','jsonl','14tPBykK','Tests\x20found:\x20','\x20\x20Agent:\x20','agentDirs'];a5_0x3de4=function(){return _0x521617;};return a5_0x3de4();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x4ea2b1(0x17e)]=a5_0x4ea2b1(0x164);[a5_0x4ea2b1(0x1a9)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x4ea2b1(0x1a7)](_0x5e36f5){const _0x50f8a3=a5_0x4ea2b1,{options:_0x4e0425,args:_0x1cdbb1,tdx:_0x5964c4}=_0x5e36f5,_0x139ddb=_0x1cdbb1[0x0]||'.',_0x545af9=_0x4e0425[_0x50f8a3(0x16d)],_0x5ab1eb=_0x4e0425,_0x6bbc95=_0x5ab1eb[_0x50f8a3(0x17a)]===![],_0x22d90c=_0x5ab1eb[_0x50f8a3(0x1d5)],_0x2cd547=_0x5ab1eb['name'],_0x22b109=_0x5ab1eb[_0x50f8a3(0x1d3)],_0x991f50=_0x4e0425[_0x50f8a3(0x15f)],_0xb4409f=_0x5ab1eb[_0x50f8a3(0x18e)];if(_0x22d90c&&_0x6bbc95)return console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x1b0)](_0x50f8a3(0x163))),0x1;let _0x260640='table';if(_0x5ab1eb[_0x50f8a3(0x154)])_0x260640=_0x50f8a3(0x154);else{if(_0x5ab1eb['jsonl'])_0x260640=_0x50f8a3(0x157);else{if(_0x5ab1eb[_0x50f8a3(0x196)])_0x260640=_0x50f8a3(0x196);else{if(_0x5ab1eb[_0x50f8a3(0x194)])_0x260640=_0x50f8a3(0x194);}}}const _0x140977=_0x5ab1eb[_0x50f8a3(0x1ba)];let _0x65ec2=_0x139ddb;const _0x35f458=a5_0x49b85d['existsSync'](_0x139ddb),_0x4aa3ef=_0x139ddb==='.';if(!_0x35f458||_0x4aa3ef){const _0x468a0e=resolveProjectFromContext(_0x139ddb,_0x140977,{'requireFile':_0x50f8a3(0x172)});if(_0x468a0e[_0x50f8a3(0x197)])_0x65ec2=_0x468a0e[_0x50f8a3(0x198)],_0x468a0e['source']===_0x50f8a3(0x156)&&console[_0x50f8a3(0x13e)](a5_0x1b661a['dim'](_0x50f8a3(0x1d4)+_0x65ec2));else switch(_0x468a0e[_0x50f8a3(0x1a3)]){case _0x50f8a3(0x170):console['log'](a5_0x1b661a['yellow'](_0x468a0e['message'])),console[_0x50f8a3(0x13e)](),console['log'](_0x50f8a3(0x177)),console['log'](_0x50f8a3(0x1b8)),console[_0x50f8a3(0x13e)](_0x50f8a3(0x155)),console[_0x50f8a3(0x13e)](),console['log'](_0x50f8a3(0x144));return 0x1;case _0x50f8a3(0x1ac):console[_0x50f8a3(0x13e)](a5_0x1b661a['yellow'](_0x468a0e[_0x50f8a3(0x19e)])),console[_0x50f8a3(0x13e)](),console[_0x50f8a3(0x13e)](_0x50f8a3(0x147)+_0x468a0e[_0x50f8a3(0x1ba)]+_0x50f8a3(0x19b));return 0x1;case _0x50f8a3(0x1ce):{const _0x40fbab=a5_0x48c92c['basename'](_0x468a0e[_0x50f8a3(0x198)]);console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x13f)](_0x50f8a3(0x1b2)+_0x468a0e[_0x50f8a3(0x1ba)]+'\x22:'));for(const _0x151005 of _0x468a0e[_0x50f8a3(0x15b)]){console['log'](_0x50f8a3(0x1a6)+_0x151005);}return console[_0x50f8a3(0x13e)](),console[_0x50f8a3(0x13e)](_0x50f8a3(0x152)+_0x40fbab+_0x50f8a3(0x168)),0x1;}case _0x50f8a3(0x14d):console['log'](a5_0x1b661a[_0x50f8a3(0x13f)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x468a0e[_0x50f8a3(0x1ba)]+'\x22.')),console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x19f)]('Project\x20path:\x20'+_0x468a0e['projectDir'])),console[_0x50f8a3(0x13e)](),console[_0x50f8a3(0x13e)](_0x50f8a3(0x16f));return 0x1;}}const {definition:_0xe188be,agentInfo:_0x13fc27}=parseTestFile(_0x65ec2);let _0x272e32=_0xe188be[_0x50f8a3(0x1a1)];if(_0x2cd547){const _0x2f053d=_0x2cd547[_0x50f8a3(0x1d1)](',')[_0x50f8a3(0x1ae)](_0x212ae8=>_0x212ae8[_0x50f8a3(0x14f)]());_0x272e32=_0xe188be[_0x50f8a3(0x1a1)]['filter'](_0x1bc00b=>_0x2f053d[_0x50f8a3(0x160)](_0x1bc00b[_0x50f8a3(0x17e)]));if(_0x272e32['length']===0x0)return console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x13f)](_0x50f8a3(0x150)+_0x2cd547)),console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x19f)](_0x50f8a3(0x1be)+_0xe188be[_0x50f8a3(0x1a1)][_0x50f8a3(0x1ae)](_0x1e9440=>_0x1e9440[_0x50f8a3(0x17e)])[_0x50f8a3(0x16b)](',\x20'))),0x1;}if(_0x22b109){const _0x60e36=_0x22b109[_0x50f8a3(0x1d1)](',')[_0x50f8a3(0x1ae)](_0x8cfb3d=>_0x8cfb3d[_0x50f8a3(0x14f)]()[_0x50f8a3(0x190)]());_0x272e32=_0x272e32[_0x50f8a3(0x14a)](_0x438aff=>_0x438aff[_0x50f8a3(0x1d3)]?.[_0x50f8a3(0x15e)](_0x44db55=>_0x60e36[_0x50f8a3(0x160)](_0x44db55[_0x50f8a3(0x190)]())));if(_0x272e32[_0x50f8a3(0x18c)]===0x0){console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x13f)](_0x50f8a3(0x1ca)+_0x22b109));const _0x2353fc=new Set();return _0xe188be[_0x50f8a3(0x1a1)][_0x50f8a3(0x1b7)](_0x9f6b54=>_0x9f6b54['tags']?.[_0x50f8a3(0x1b7)](_0xa21211=>_0x2353fc[_0x50f8a3(0x17c)](_0xa21211))),_0x2353fc['size']>0x0?console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x19f)](_0x50f8a3(0x1d8)+[..._0x2353fc]['join'](',\x20'))):console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x19f)](_0x50f8a3(0x1c3))),0x1;}}if(_0x22d90c)return this['executeReeval'](_0x5e36f5,{'definition':{'tests':_0x272e32},'agentInfo':_0x13fc27,'outputFormat':_0x260640,'outputFile':_0xb4409f,'testNames':_0x2cd547});if(_0x545af9){console['log'](a5_0x1b661a[_0x50f8a3(0x1c7)](_0x50f8a3(0x14c))),console[_0x50f8a3(0x13e)](_0x50f8a3(0x19d)+a5_0x1b661a[_0x50f8a3(0x1c0)](_0x991f50)),console[_0x50f8a3(0x13e)](_0x50f8a3(0x199)+a5_0x1b661a[_0x50f8a3(0x1c0)](_0x13fc27[_0x50f8a3(0x162)])),console[_0x50f8a3(0x13e)](_0x50f8a3(0x15a)+a5_0x1b661a[_0x50f8a3(0x1c0)](_0x13fc27[_0x50f8a3(0x169)])),console[_0x50f8a3(0x13e)](),console['log'](_0x50f8a3(0x159)+a5_0x1b661a[_0x50f8a3(0x1c0)](_0x272e32[_0x50f8a3(0x18c)]));for(let _0x1aa6f0=0x0;_0x1aa6f0<_0x272e32[_0x50f8a3(0x18c)];_0x1aa6f0++){const _0xe9e649=_0x272e32[_0x1aa6f0],_0x5d431e=_0xe9e649[_0x50f8a3(0x145)][_0x50f8a3(0x18c)]===0x1?_0x50f8a3(0x1b4):_0x50f8a3(0x145),_0x3c710d=_0xe9e649[_0x50f8a3(0x1d3)]?.[_0x50f8a3(0x18c)]?'\x20['+_0xe9e649['tags'][_0x50f8a3(0x16b)](',\x20')+']':'';console[_0x50f8a3(0x13e)]('\x20\x20'+(_0x1aa6f0+0x1)+'.\x20'+a5_0x1b661a[_0x50f8a3(0x1c0)](_0xe9e649[_0x50f8a3(0x17e)])+'\x20('+_0xe9e649['rounds'][_0x50f8a3(0x18c)]+'\x20'+_0x5d431e+')'+a5_0x1b661a['dim'](_0x3c710d));}return 0x0;}let _0x24d9fa,_0x4f1e20;try{_0x24d9fa=await _0x5964c4[_0x50f8a3(0x176)][_0x50f8a3(0x1c6)](_0x13fc27[_0x50f8a3(0x162)]);}catch(_0x5f2b01){const _0xc01c74=_0x5f2b01 instanceof Error?_0x5f2b01[_0x50f8a3(0x19e)]:String(_0x5f2b01);return _0xc01c74[_0x50f8a3(0x160)](_0x50f8a3(0x1a5))||_0xc01c74[_0x50f8a3(0x190)]()[_0x50f8a3(0x160)](_0x50f8a3(0x1d0))?console['log'](a5_0x1b661a['red'](_0x50f8a3(0x18a)+_0x13fc27[_0x50f8a3(0x162)])):console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x1b0)](_0x50f8a3(0x195)+_0x13fc27[_0x50f8a3(0x162)]+_0x50f8a3(0x1d9)+_0xc01c74)),0x1;}try{_0x4f1e20=await _0x5964c4[_0x50f8a3(0x176)][_0x50f8a3(0x180)](_0x13fc27[_0x50f8a3(0x169)],_0x24d9fa);}catch(_0x290ef2){const _0xfd21d8=_0x290ef2 instanceof Error?_0x290ef2['message']:String(_0x290ef2);return _0xfd21d8[_0x50f8a3(0x160)]('404')||_0xfd21d8[_0x50f8a3(0x190)]()['includes']('not\x20found')?console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x1b0)](_0x50f8a3(0x1a8)+_0x13fc27[_0x50f8a3(0x169)])):console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x1b0)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x13fc27['agentName']+_0x50f8a3(0x1d9)+_0xfd21d8)),0x1;}let _0x4f2545;if(!_0x6bbc95)try{_0x4f2545=await setupEvaluatorAgent(_0x5964c4[_0x50f8a3(0x176)],_0x4e0425['verbose']);}catch(_0x32a744){const _0x382760=_0x32a744 instanceof Error?_0x32a744['message']:String(_0x32a744);return console['log'](a5_0x1b661a[_0x50f8a3(0x1b0)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x382760)),0x1;}console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x1c7)](_0x50f8a3(0x183))),console[_0x50f8a3(0x13e)](_0x50f8a3(0x1b9)+a5_0x1b661a[_0x50f8a3(0x1c0)](_0x991f50)),console[_0x50f8a3(0x13e)](_0x50f8a3(0x1cb)+a5_0x1b661a[_0x50f8a3(0x1c0)](_0x13fc27[_0x50f8a3(0x162)]+'/'+_0x13fc27[_0x50f8a3(0x169)])),console[_0x50f8a3(0x13e)]();const _0x3311c9=[],_0x2ab363=[],_0xe54691=Date[_0x50f8a3(0x1bf)]();for(let _0x2430ef=0x0;_0x2430ef<_0x272e32[_0x50f8a3(0x18c)];_0x2430ef++){const _0x3751a4=_0x272e32[_0x2430ef];_0x272e32['length']>0x1?console[_0x50f8a3(0x13e)]('Test\x20'+(_0x2430ef+0x1)+'/'+_0x272e32[_0x50f8a3(0x18c)]+':\x20'+a5_0x1b661a[_0x50f8a3(0x1c0)](_0x3751a4[_0x50f8a3(0x17e)])):console[_0x50f8a3(0x13e)](_0x50f8a3(0x1d2)+a5_0x1b661a[_0x50f8a3(0x1c0)](_0x3751a4[_0x50f8a3(0x17e)]));const _0x384bfa=createCommandSpinner('Round\x201/'+_0x3751a4[_0x50f8a3(0x145)][_0x50f8a3(0x18c)]+_0x50f8a3(0x1bc));_0x384bfa[_0x50f8a3(0x18b)]();try{const {result:_0x2b3785,conversation:_0x40eb73}=await runTest(_0x5964c4[_0x50f8a3(0x176)],_0x3751a4,{'agentId':_0x4f1e20,'projectId':_0x24d9fa,'site':_0x991f50,'noEval':_0x6bbc95,'evaluatorId':_0x4f2545,'onRoundStart':(_0x570a63,_0x557ed4)=>{const _0x10e19a=_0x50f8a3;_0x384bfa[_0x10e19a(0x161)]='Round\x20'+(_0x570a63+0x1)+'/'+_0x557ed4+_0x10e19a(0x1bc);},'onRoundComplete':(_0x2491a3,_0x384cef,_0x529d15)=>{const _0x4c959c=_0x50f8a3,_0x4a5bd3=formatElapsed(_0x384cef);_0x529d15?console[_0x4c959c(0x13e)](_0x4c959c(0x18d)+(_0x2491a3+0x1)+'/'+_0x3751a4[_0x4c959c(0x145)][_0x4c959c(0x18c)]+_0x4c959c(0x184)+a5_0x1b661a[_0x4c959c(0x146)]('✓')+'\x20('+_0x4a5bd3+')'):console[_0x4c959c(0x13e)](_0x4c959c(0x18d)+(_0x2491a3+0x1)+'/'+_0x3751a4[_0x4c959c(0x145)][_0x4c959c(0x18c)]+_0x4c959c(0x184)+a5_0x1b661a['red']('✗'));},'onEvaluationStart':()=>{const _0x238609=_0x50f8a3;_0x384bfa['text']=_0x238609(0x1aa);},'onEvaluationComplete':_0x2a77e5=>{const _0x1ed7a6=_0x50f8a3,_0x443a07=formatElapsed(_0x2a77e5);console[_0x1ed7a6(0x13e)](_0x1ed7a6(0x14b)+a5_0x1b661a[_0x1ed7a6(0x146)]('✓')+'\x20('+_0x443a07+')');}});_0x384bfa['stop'](),_0x3311c9[_0x50f8a3(0x17b)](_0x2b3785),_0x2ab363['push'](_0x40eb73);if(_0x2b3785[_0x50f8a3(0x1cd)]===_0x50f8a3(0x1ad))console['log'](a5_0x1b661a[_0x50f8a3(0x146)](_0x50f8a3(0x189)+_0x2b3785[_0x50f8a3(0x1a3)]));else _0x2b3785[_0x50f8a3(0x1cd)]===_0x50f8a3(0x15c)?console['log'](a5_0x1b661a[_0x50f8a3(0x1b0)](_0x50f8a3(0x1c5)+_0x2b3785[_0x50f8a3(0x1a3)])):console['log'](a5_0x1b661a[_0x50f8a3(0x1b0)](_0x50f8a3(0x1cc)+_0x2b3785[_0x50f8a3(0x1a3)]));_0x2b3785[_0x50f8a3(0x141)]&&console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x19f)]('Conversation\x20URL:\x20'+_0x2b3785[_0x50f8a3(0x141)])),console['log']();}catch(_0x21ef2c){_0x384bfa[_0x50f8a3(0x171)]();const _0x58f255=_0x21ef2c instanceof Error?_0x21ef2c['message']:String(_0x21ef2c);console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x1b0)](_0x50f8a3(0x1cc)+_0x58f255)),console[_0x50f8a3(0x13e)](),_0x3311c9['push']({'name':_0x3751a4[_0x50f8a3(0x17e)],'status':_0x50f8a3(0x16c),'reason':_0x58f255,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x1749ae=Date[_0x50f8a3(0x1bf)]()-_0xe54691,_0x17e138=_0x3311c9[_0x50f8a3(0x14a)](_0x2ce7c5=>_0x2ce7c5[_0x50f8a3(0x1cd)]==='PASS')['length'],_0x5b0861=_0x3311c9['filter'](_0x7b8655=>_0x7b8655[_0x50f8a3(0x1cd)]===_0x50f8a3(0x15c))[_0x50f8a3(0x18c)],_0xe6e22d=_0x3311c9[_0x50f8a3(0x14a)](_0x3d6775=>_0x3d6775[_0x50f8a3(0x1cd)]===_0x50f8a3(0x16c))[_0x50f8a3(0x18c)];console[_0x50f8a3(0x13e)]('━'[_0x50f8a3(0x1da)](0x3c)),console[_0x50f8a3(0x13e)]('Test\x20Summary'),console['log']('━'['repeat'](0x3c)),console['log'](_0x50f8a3(0x16e)+_0x3311c9[_0x50f8a3(0x18c)]),console[_0x50f8a3(0x13e)]('Passed:\x20\x20\x20'+a5_0x1b661a[_0x50f8a3(0x146)](_0x17e138)),console['log'](_0x50f8a3(0x1af)+a5_0x1b661a[_0x50f8a3(0x1b0)](_0x5b0861));_0xe6e22d>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x1b661a[_0x50f8a3(0x1b0)](_0xe6e22d));console['log'](_0x50f8a3(0x191)+formatElapsed(_0x1749ae)),console[_0x50f8a3(0x13e)]('━'[_0x50f8a3(0x1da)](0x3c));const _0x40dc14=_0x3311c9[_0x50f8a3(0x14a)](_0x483007=>_0x483007[_0x50f8a3(0x1cd)]!==_0x50f8a3(0x1ad));if(_0x40dc14[_0x50f8a3(0x18c)]>0x0){console[_0x50f8a3(0x13e)](),console[_0x50f8a3(0x13e)](_0x50f8a3(0x140));for(const _0x4abea8 of _0x40dc14){const _0x5dff61=a5_0x1b661a[_0x50f8a3(0x1b0)]('✗'),_0x4f2d86=_0x4abea8[_0x50f8a3(0x1a3)][_0x50f8a3(0x18c)]>0x32?_0x4abea8[_0x50f8a3(0x1a3)][_0x50f8a3(0x18f)](0x0,0x32)+_0x50f8a3(0x17d):_0x4abea8[_0x50f8a3(0x1a3)];console[_0x50f8a3(0x13e)]('\x20\x20'+_0x5dff61+'\x20'+_0x4abea8[_0x50f8a3(0x17e)]+':\x20'+_0x4f2d86);}}const _0x1f29b0={'summary':{'total':_0x3311c9[_0x50f8a3(0x18c)],'passed':_0x17e138,'failed':_0x5b0861,'errors':_0xe6e22d>0x0?_0xe6e22d:undefined,'duration_ms':_0x1749ae},'tests':_0x3311c9,'agent':{'project':_0x13fc27[_0x50f8a3(0x162)],'name':_0x13fc27[_0x50f8a3(0x169)],'site':_0x991f50},'timestamp':new Date(_0xe54691)['toISOString']()};try{const _0xb0277a=buildCachedTestRun(_0x2ab363,{'site':_0x991f50,'projectId':_0x24d9fa,'projectName':_0x13fc27[_0x50f8a3(0x162)],'agentId':_0x4f1e20,'agentName':_0x13fc27[_0x50f8a3(0x169)],'testYmlPath':a5_0x48c92c[_0x50f8a3(0x173)](_0x13fc27[_0x50f8a3(0x1c1)])});saveLastTestRun(_0xb0277a);}catch{}if(_0x260640!==_0x50f8a3(0x194)||_0xb4409f){const _0x6a5b0c=formatResults(_0x1f29b0,_0x260640);if(_0xb4409f)try{a5_0x49b85d[_0x50f8a3(0x1d6)](_0xb4409f,_0x6a5b0c,_0x50f8a3(0x142)),console[_0x50f8a3(0x13e)](),console[_0x50f8a3(0x13e)](a5_0x1b661a[_0x50f8a3(0x19f)](_0x50f8a3(0x19a)+_0xb4409f));}catch(_0x553bd8){return console[_0x50f8a3(0x13e)](),console[_0x50f8a3(0x13e)](a5_0x1b661a['red'](_0x50f8a3(0x1c4)+_0x553bd8)),0x1;}else console[_0x50f8a3(0x13e)](),console[_0x50f8a3(0x13e)](_0x6a5b0c);}return _0x40dc14[_0x50f8a3(0x18c)]>0x0?0x1:0x0;}async[a5_0x4ea2b1(0x1c9)](_0xe95b5d,_0x54e166){const _0x205047=a5_0x4ea2b1,{options:_0x5c7f91,tdx:_0x18642b}=_0xe95b5d,{definition:_0x1f9795,agentInfo:_0x2b4c5b,outputFormat:_0x2ee88e,outputFile:_0x1d9ab8}=_0x54e166,_0x55f8b0=_0x5c7f91[_0x205047(0x15f)],_0x4ab74c=loadLastTestRun();if(!_0x4ab74c)return console[_0x205047(0x13e)](a5_0x1b661a['red'](_0x205047(0x1c8))),console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x19f)](_0x205047(0x1b6))),0x1;if(_0x4ab74c[_0x205047(0x1bb)]['agentName']!==_0x2b4c5b[_0x205047(0x169)])return console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x1b0)](_0x205047(0x178)+_0x4ab74c[_0x205047(0x1bb)][_0x205047(0x169)]+_0x205047(0x1a2)+_0x2b4c5b['agentName']+'\x22.')),console['log'](a5_0x1b661a['dim'](_0x205047(0x193))),0x1;const _0xc9387d=new Set(_0x4ab74c[_0x205047(0x192)][_0x205047(0x1ae)](_0x350a4f=>_0x350a4f[_0x205047(0x165)])),_0x2e88cd=_0x1f9795[_0x205047(0x1a1)]['filter'](_0x16b51f=>!_0xc9387d[_0x205047(0x166)](_0x16b51f[_0x205047(0x17e)]));if(_0x2e88cd[_0x205047(0x18c)]>0x0&&_0x4ab74c[_0x205047(0x15f)]!==_0x55f8b0)return console['log'](a5_0x1b661a['red']('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x19f)](_0x205047(0x16a)+_0x4ab74c[_0x205047(0x15f)]+_0x205047(0x175)+_0x55f8b0+'\x22.')),console['log'](a5_0x1b661a[_0x205047(0x19f)]('Either\x20switch\x20to\x20the\x20\x22'+_0x4ab74c[_0x205047(0x15f)]+_0x205047(0x1c2))),0x1;const _0x102c20=_0x1f9795[_0x205047(0x1a1)][_0x205047(0x14a)](_0x192c97=>_0xc9387d[_0x205047(0x166)](_0x192c97[_0x205047(0x17e)])),_0x53cb32=_0x2e88cd;let _0x149c41;try{_0x149c41=await setupEvaluatorAgent(_0x18642b['llm'],_0x5c7f91[_0x205047(0x19c)]);}catch(_0x27b975){const _0x228537=_0x27b975 instanceof Error?_0x27b975[_0x205047(0x19e)]:String(_0x27b975);return console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x1b0)](_0x205047(0x1b3)+_0x228537)),0x1;}console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x1c7)]('Re-evaluating\x20cached\x20test\x20run...')),console['log'](_0x205047(0x1ab)+a5_0x1b661a['white'](_0x4ab74c[_0x205047(0x1b1)])),console[_0x205047(0x13e)](_0x205047(0x1cb)+a5_0x1b661a[_0x205047(0x1c0)](_0x4ab74c['agent']['projectName']+'/'+_0x4ab74c[_0x205047(0x1bb)][_0x205047(0x169)]));_0x53cb32[_0x205047(0x18c)]>0x0&&console[_0x205047(0x13e)]('New\x20tests\x20to\x20execute:\x20'+a5_0x1b661a[_0x205047(0x13f)](_0x53cb32[_0x205047(0x18c)]));console[_0x205047(0x13e)]();const _0x5d00b5=[],_0xd9af33=Date['now'](),_0x14da02=createCommandSpinner(_0x205047(0x1a0));if(_0x102c20[_0x205047(0x18c)]>0x0)try{const _0xe56823=await reevaluateFromCache(_0x18642b[_0x205047(0x176)],_0x4ab74c,{'tests':_0x102c20},{'evaluatorId':_0x149c41,'onTestStart':(_0x523a45,_0x3511e3,_0x52a74d)=>{const _0xc91cbf=_0x205047;_0x14da02[_0xc91cbf(0x161)]='Re-evaluating\x20'+(_0x3511e3+0x1)+'/'+_0x52a74d+':\x20'+_0x523a45+'...';if(!_0x14da02['isSpinning'])_0x14da02[_0xc91cbf(0x18b)]();},'onTestComplete':(_0x3273bd,_0x3238ef)=>{const _0x4fa594=_0x205047;_0x14da02[_0x4fa594(0x171)]();if(_0x3238ef[_0x4fa594(0x1cd)]===_0x4fa594(0x1ad))console[_0x4fa594(0x13e)](a5_0x1b661a['green'](_0x4fa594(0x189)+_0x3273bd)+a5_0x1b661a['dim']('\x20(cached)'));else _0x3238ef[_0x4fa594(0x1cd)]===_0x4fa594(0x15c)?console[_0x4fa594(0x13e)](a5_0x1b661a['red'](_0x4fa594(0x1c5)+_0x3273bd+_0x4fa594(0x1cf)+_0x3238ef[_0x4fa594(0x1a3)])+a5_0x1b661a['dim'](_0x4fa594(0x1d7))):console[_0x4fa594(0x13e)](a5_0x1b661a[_0x4fa594(0x1b0)]('✗\x20ERROR:\x20'+_0x3273bd+_0x4fa594(0x1cf)+_0x3238ef[_0x4fa594(0x1a3)]));_0x3238ef['conversation_url']&&console[_0x4fa594(0x13e)](a5_0x1b661a['dim']('\x20\x20Conversation:\x20'+_0x3238ef[_0x4fa594(0x141)])),_0x5d00b5['push'](_0x3238ef);},'onTestSkipped':(_0x1f87e2,_0x1ddbe4)=>{const _0x4bbff5=_0x205047;_0x14da02['stop'](),console[_0x4bbff5(0x13e)](a5_0x1b661a[_0x4bbff5(0x13f)](_0x4bbff5(0x174)+_0x1f87e2+_0x4bbff5(0x1cf)+_0x1ddbe4));}});for(const _0x1e85e0 of _0xe56823){!_0x5d00b5[_0x205047(0x17f)](_0x22063e=>_0x22063e['name']===_0x1e85e0[_0x205047(0x17e)])&&_0x5d00b5[_0x205047(0x17b)](_0x1e85e0);}}catch(_0x906008){_0x14da02[_0x205047(0x171)]();const _0xdeb136=_0x906008 instanceof Error?_0x906008[_0x205047(0x19e)]:String(_0x906008);return console['log'](a5_0x1b661a[_0x205047(0x1b0)](_0x205047(0x167)+_0xdeb136)),0x1;}_0x14da02[_0x205047(0x171)]();if(_0x53cb32[_0x205047(0x18c)]>0x0){console['log'](),console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x1c7)](_0x205047(0x151)));const {projectId:_0x39421f,agentId:_0x3497db}=_0x4ab74c['agent'];for(const _0x28ca07 of _0x53cb32){console[_0x205047(0x13e)](_0x205047(0x153)+a5_0x1b661a[_0x205047(0x1c0)](_0x28ca07[_0x205047(0x17e)]));const _0x198ceb=createCommandSpinner(_0x205047(0x14e)+_0x28ca07[_0x205047(0x145)]['length']+_0x205047(0x1bc));_0x198ceb[_0x205047(0x18b)]();try{const {result:_0x1b77dd}=await runTest(_0x18642b[_0x205047(0x176)],_0x28ca07,{'agentId':_0x3497db,'projectId':_0x39421f,'site':_0x4ab74c['site'],'noEval':![],'evaluatorId':_0x149c41,'onRoundStart':(_0x516920,_0x48d275)=>{const _0x3c84bf=_0x205047;_0x198ceb[_0x3c84bf(0x161)]=_0x3c84bf(0x149)+(_0x516920+0x1)+'/'+_0x48d275+_0x3c84bf(0x1bc);},'onRoundComplete':(_0x51371a,_0x257b9c,_0x244813)=>{const _0x30865b=_0x205047,_0x1e466b=formatElapsed(_0x257b9c);_0x244813?console[_0x30865b(0x13e)](_0x30865b(0x18d)+(_0x51371a+0x1)+'/'+_0x28ca07[_0x30865b(0x145)][_0x30865b(0x18c)]+_0x30865b(0x184)+a5_0x1b661a['green']('✓')+'\x20('+_0x1e466b+')'):console[_0x30865b(0x13e)](_0x30865b(0x18d)+(_0x51371a+0x1)+'/'+_0x28ca07[_0x30865b(0x145)]['length']+'...\x20'+a5_0x1b661a[_0x30865b(0x1b0)]('✗'));},'onEvaluationStart':()=>{const _0x13d2ef=_0x205047;_0x198ceb[_0x13d2ef(0x161)]='Evaluating\x20response...';},'onEvaluationComplete':_0x41cdb7=>{const _0x311370=_0x205047,_0x3364ef=formatElapsed(_0x41cdb7);console[_0x311370(0x13e)]('\x20\x20Evaluating...\x20'+a5_0x1b661a['green']('✓')+'\x20('+_0x3364ef+')');}});_0x198ceb['stop'](),_0x5d00b5[_0x205047(0x17b)](_0x1b77dd);if(_0x1b77dd[_0x205047(0x1cd)]===_0x205047(0x1ad))console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x146)](_0x205047(0x189)+_0x1b77dd[_0x205047(0x1a3)])+a5_0x1b661a['dim'](_0x205047(0x148)));else _0x1b77dd[_0x205047(0x1cd)]==='FAIL'?console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x1b0)](_0x205047(0x1c5)+_0x1b77dd['reason'])+a5_0x1b661a[_0x205047(0x19f)](_0x205047(0x148))):console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x1b0)]('✗\x20ERROR:\x20'+_0x1b77dd['reason']));_0x1b77dd[_0x205047(0x141)]&&console['log'](a5_0x1b661a[_0x205047(0x19f)](_0x205047(0x186)+_0x1b77dd['conversation_url']));}catch(_0xe29ffc){_0x198ceb[_0x205047(0x171)]();const _0x1a40c4=_0xe29ffc instanceof Error?_0xe29ffc[_0x205047(0x19e)]:String(_0xe29ffc);console[_0x205047(0x13e)](a5_0x1b661a['red']('✗\x20ERROR:\x20'+_0x1a40c4)),_0x5d00b5[_0x205047(0x17b)]({'name':_0x28ca07[_0x205047(0x17e)],'status':_0x205047(0x16c),'reason':_0x1a40c4,'timestamp':new Date()[_0x205047(0x182)](),'duration_ms':0x0});}}}console[_0x205047(0x13e)]();const _0x3734a9=Date[_0x205047(0x1bf)]()-_0xd9af33,_0x2dce47=_0x5d00b5[_0x205047(0x14a)](_0x43a63b=>_0x43a63b[_0x205047(0x1cd)]===_0x205047(0x1ad))[_0x205047(0x18c)],_0x4ef17d=_0x5d00b5['filter'](_0xa601c4=>_0xa601c4[_0x205047(0x1cd)]===_0x205047(0x15c))['length'],_0x3e3dbd=_0x5d00b5[_0x205047(0x14a)](_0x36008a=>_0x36008a['status']===_0x205047(0x16c))['length'];console[_0x205047(0x13e)]('━'[_0x205047(0x1da)](0x3c)),console['log']('Re-evaluation\x20Summary'),console['log']('━'[_0x205047(0x1da)](0x3c)),console[_0x205047(0x13e)](_0x205047(0x16e)+_0x5d00b5['length']),console['log']('Passed:\x20\x20\x20'+a5_0x1b661a[_0x205047(0x146)](_0x2dce47)),console['log']('Failed:\x20\x20\x20'+a5_0x1b661a[_0x205047(0x1b0)](_0x4ef17d));_0x3e3dbd>0x0&&console[_0x205047(0x13e)](_0x205047(0x143)+a5_0x1b661a[_0x205047(0x1b0)](_0x3e3dbd));console[_0x205047(0x13e)](_0x205047(0x191)+formatElapsed(_0x3734a9)),console[_0x205047(0x13e)]('━'[_0x205047(0x1da)](0x3c));const _0x1b62f3={'summary':{'total':_0x5d00b5[_0x205047(0x18c)],'passed':_0x2dce47,'failed':_0x4ef17d,'errors':_0x3e3dbd>0x0?_0x3e3dbd:undefined,'duration_ms':_0x3734a9},'tests':_0x5d00b5,'agent':{'project':_0x2b4c5b[_0x205047(0x162)],'name':_0x2b4c5b['agentName'],'site':_0x55f8b0},'timestamp':new Date(_0xd9af33)[_0x205047(0x182)]()};if(_0x2ee88e!==_0x205047(0x194)||_0x1d9ab8){const _0x51c08b=formatResults(_0x1b62f3,_0x2ee88e);if(_0x1d9ab8)try{a5_0x49b85d[_0x205047(0x1d6)](_0x1d9ab8,_0x51c08b,'utf-8'),console[_0x205047(0x13e)](),console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x19f)](_0x205047(0x19a)+_0x1d9ab8));}catch(_0x4b8fa8){return console[_0x205047(0x13e)](),console[_0x205047(0x13e)](a5_0x1b661a[_0x205047(0x1b0)](_0x205047(0x1c4)+_0x4b8fa8)),0x1;}else console[_0x205047(0x13e)](),console[_0x205047(0x13e)](_0x51c08b);}const _0x3e2b30=_0x5d00b5[_0x205047(0x14a)](_0x5dcbca=>_0x5dcbca[_0x205047(0x1cd)]!==_0x205047(0x1ad));return _0x3e2b30['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x4ee16d=a5_0x36cc;(function(_0x1214f6,_0x285f71){const _0x206129=a5_0x36cc,_0xe3137a=_0x1214f6();while(!![]){try{const _0x3c4991=parseInt(_0x206129(0x268))/0x1+-parseInt(_0x206129(0x1f9))/0x2+parseInt(_0x206129(0x24b))/0x3+-parseInt(_0x206129(0x267))/0x4+-parseInt(_0x206129(0x266))/0x5+-parseInt(_0x206129(0x22a))/0x6+-parseInt(_0x206129(0x251))/0x7*(-parseInt(_0x206129(0x24c))/0x8);if(_0x3c4991===_0x285f71)break;else _0xe3137a['push'](_0xe3137a['shift']());}catch(_0x54b481){_0xe3137a['push'](_0xe3137a['shift']());}}}(a5_0x4718,0x6aaaa));import*as a5_0x252daf from'node:fs';function a5_0x4718(){const _0x3ea8a5=['agentName','Round\x20','Evaluating\x20response...','\x22,\x20but\x20current\x20site\x20is\x20\x22','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','start','\x20\x20Agent:\x20','toLowerCase','404','PASS','context','\x20\x20-\x20','tags','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','No\x20tests\x20have\x20tags\x20defined.','substring','basename','forEach','Running\x20agent\x20tests...','stop','site','json','Run\x20tests\x20for\x20an\x20LLM\x20agent','Re-evaluating\x20cached\x20test\x20run...',':\x20Sending\x20user\x20input...','size','conversations','find','\x22:\x20','round','No\x20tests\x20found\x20with\x20tags:\x20','\x20(cached)','82718QLHylx','writeFileSync','Tests\x20found:\x20','isSpinning','Agent:\x20','conversation_url','repeat','jsonl','New\x20tests\x20to\x20execute:\x20','has','utf-8','llm','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Test\x20Configuration:','trim','Failed:\x20\x20\x20','text','resolve','map','test.yml','Duration:\x20','\x20\x20Evaluating...\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Passed:\x20\x20\x20','testYmlPath','status','...','\x20\x20Site:\x20','Project\x20path:\x20','Cached\x20run\x20from:\x20','llmProject','executeReeval','\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)','agent:test','rounds','output','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','table','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','projectDir','green','Running:\x20','Errors:\x20\x20\x20','Available\x20tags:\x20','message','tsv','✓\x20PASS:\x20','white','\x20\x20Project:\x20','1786542UZdgsg','Round\x201/','\x27\x20to\x20create\x20the\x20folder\x20structure.','length','includes','join','description','...\x20','not\x20found','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Re-evaluating...','found','✗\x20FAIL:\x20','red','now','Output\x20written\x20to:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','dim','Conversation\x20URL:\x20','Either\x20switch\x20to\x20the\x20\x22','name','resolveAgentId','Test\x20','✗\x20ERROR:\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','Usage:','Total:\x20\x20\x20\x20','execute','no_tests','filter','1952709iCCfxk','16MSxVbw','\x20-\x20','cyan','tests','Error\x20writing\x20output\x20file:\x20','1041061PBbsdz','ERROR','verbose','Using\x20agent:\x20','source','toISOString','Re-evaluation\x20Summary','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','agent','reason','dryRun','eval','\x20\x20Round\x20','push','resolveProjectId','Re-evaluating\x20','Executing\x20new\x20tests...','projectName','log','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','yellow','1673100QMtnQG','1745492XPjmEs','598666bfZqNu','split','\x20\x20Conversation:\x20','no_context','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','timestamp','⚠\x20SKIPPED:\x20','Failed\x20Tests:','FAIL','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'];a5_0x4718=function(){return _0x3ea8a5;};return a5_0x4718();}import*as a5_0x527aab from'node:path';function a5_0x36cc(_0xfea270,_0x4cae40){_0xfea270=_0xfea270-0x1e0;const _0x47186e=a5_0x4718();let _0x36cc48=_0x47186e[_0xfea270];return _0x36cc48;}import a5_0x555240 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_0x4ee16d(0x240)]=a5_0x4ee16d(0x21a);[a5_0x4ee16d(0x230)]=a5_0x4ee16d(0x1ef);async[a5_0x4ee16d(0x248)](_0x30a462){const _0x369f1a=a5_0x4ee16d,{options:_0x415ef0,args:_0x538e45,tdx:_0x376f3e}=_0x30a462,_0x5a94d2=_0x538e45[0x0]||'.',_0x4df8ae=_0x415ef0[_0x369f1a(0x25b)],_0x4eb967=_0x415ef0,_0x2bd0a6=_0x4eb967[_0x369f1a(0x25c)]===![],_0x34d162=_0x4eb967['reeval'],_0x373b81=_0x4eb967[_0x369f1a(0x240)],_0x15bba7=_0x4eb967[_0x369f1a(0x1e5)],_0x1505b0=_0x415ef0[_0x369f1a(0x1ed)],_0x5cc68d=_0x4eb967[_0x369f1a(0x21c)];if(_0x34d162&&_0x2bd0a6)return console[_0x369f1a(0x263)](a5_0x555240['red'](_0x369f1a(0x264))),0x1;let _0xbea8ec='table';if(_0x4eb967[_0x369f1a(0x1ee)])_0xbea8ec=_0x369f1a(0x1ee);else{if(_0x4eb967[_0x369f1a(0x200)])_0xbea8ec=_0x369f1a(0x200);else{if(_0x4eb967[_0x369f1a(0x226)])_0xbea8ec=_0x369f1a(0x226);else{if(_0x4eb967['table'])_0xbea8ec=_0x369f1a(0x21e);}}}const _0x52e2d6=_0x4eb967[_0x369f1a(0x217)];let _0x315a31=_0x5a94d2;const _0x3d9062=a5_0x252daf['existsSync'](_0x5a94d2),_0x5785e4=_0x5a94d2==='.';if(!_0x3d9062||_0x5785e4){const _0xdeaf44=resolveProjectFromContext(_0x5a94d2,_0x52e2d6,{'requireFile':_0x369f1a(0x20c)});if(_0xdeaf44[_0x369f1a(0x236)])_0x315a31=_0xdeaf44[_0x369f1a(0x220)],_0xdeaf44[_0x369f1a(0x255)]===_0x369f1a(0x1e3)&&console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x23d)](_0x369f1a(0x254)+_0x315a31));else switch(_0xdeaf44[_0x369f1a(0x25a)]){case _0x369f1a(0x26b):console['log'](a5_0x555240[_0x369f1a(0x265)](_0xdeaf44['message'])),console[_0x369f1a(0x263)](),console[_0x369f1a(0x263)](_0x369f1a(0x246)),console[_0x369f1a(0x263)](_0x369f1a(0x244)),console[_0x369f1a(0x263)](_0x369f1a(0x219)),console[_0x369f1a(0x263)](),console['log'](_0x369f1a(0x276));return 0x1;case _0x369f1a(0x245):console[_0x369f1a(0x263)](a5_0x555240['yellow'](_0xdeaf44[_0x369f1a(0x225)])),console[_0x369f1a(0x263)](),console[_0x369f1a(0x263)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0xdeaf44[_0x369f1a(0x217)]+_0x369f1a(0x22c));return 0x1;case'multiple_agents':{const _0x5354ed=a5_0x527aab[_0x369f1a(0x1e9)](_0xdeaf44['projectDir']);console[_0x369f1a(0x263)](a5_0x555240['yellow'](_0x369f1a(0x26c)+_0xdeaf44[_0x369f1a(0x217)]+'\x22:'));for(const _0x5a882b of _0xdeaf44['agentDirs']){console[_0x369f1a(0x263)](_0x369f1a(0x1e4)+_0x5a882b);}return console[_0x369f1a(0x263)](),console[_0x369f1a(0x263)](_0x369f1a(0x23b)+_0x5354ed+'/<agent-name>'),0x1;}case _0x369f1a(0x249):console[_0x369f1a(0x263)](a5_0x555240['yellow'](_0x369f1a(0x23c)+_0xdeaf44[_0x369f1a(0x217)]+'\x22.')),console['log'](a5_0x555240[_0x369f1a(0x23d)](_0x369f1a(0x215)+_0xdeaf44[_0x369f1a(0x220)])),console['log'](),console[_0x369f1a(0x263)](_0x369f1a(0x205));return 0x1;}}const {definition:_0x1a68d8,agentInfo:_0x47009c}=parseTestFile(_0x315a31);let _0x1758f6=_0x1a68d8[_0x369f1a(0x24f)];if(_0x373b81){const _0x33c8bd=_0x373b81['split'](',')[_0x369f1a(0x20b)](_0x1e13fe=>_0x1e13fe[_0x369f1a(0x207)]());_0x1758f6=_0x1a68d8[_0x369f1a(0x24f)][_0x369f1a(0x24a)](_0x34ecae=>_0x33c8bd[_0x369f1a(0x22e)](_0x34ecae['name']));if(_0x1758f6[_0x369f1a(0x22d)]===0x0)return console[_0x369f1a(0x263)](a5_0x555240['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x373b81)),console[_0x369f1a(0x263)](a5_0x555240['dim']('Available\x20tests:\x20'+_0x1a68d8[_0x369f1a(0x24f)][_0x369f1a(0x20b)](_0xc12f9b=>_0xc12f9b[_0x369f1a(0x240)])[_0x369f1a(0x22f)](',\x20'))),0x1;}if(_0x15bba7){const _0x447552=_0x15bba7[_0x369f1a(0x269)](',')[_0x369f1a(0x20b)](_0x403d1e=>_0x403d1e['trim']()[_0x369f1a(0x1e0)]());_0x1758f6=_0x1758f6[_0x369f1a(0x24a)](_0x441566=>_0x441566[_0x369f1a(0x1e5)]?.['some'](_0x21b7ea=>_0x447552[_0x369f1a(0x22e)](_0x21b7ea[_0x369f1a(0x1e0)]())));if(_0x1758f6[_0x369f1a(0x22d)]===0x0){console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x265)](_0x369f1a(0x1f7)+_0x15bba7));const _0x3bd5a9=new Set();return _0x1a68d8[_0x369f1a(0x24f)][_0x369f1a(0x1ea)](_0x18bce2=>_0x18bce2[_0x369f1a(0x1e5)]?.[_0x369f1a(0x1ea)](_0x30f41e=>_0x3bd5a9['add'](_0x30f41e))),_0x3bd5a9[_0x369f1a(0x1f2)]>0x0?console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x23d)](_0x369f1a(0x224)+[..._0x3bd5a9][_0x369f1a(0x22f)](',\x20'))):console['log'](a5_0x555240['dim'](_0x369f1a(0x1e7))),0x1;}}if(_0x34d162)return this['executeReeval'](_0x30a462,{'definition':{'tests':_0x1758f6},'agentInfo':_0x47009c,'outputFormat':_0xbea8ec,'outputFile':_0x5cc68d,'testNames':_0x373b81});if(_0x4df8ae){console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x24e)](_0x369f1a(0x206))),console['log'](_0x369f1a(0x214)+a5_0x555240[_0x369f1a(0x228)](_0x1505b0)),console[_0x369f1a(0x263)](_0x369f1a(0x229)+a5_0x555240['white'](_0x47009c['projectName'])),console[_0x369f1a(0x263)](_0x369f1a(0x279)+a5_0x555240['white'](_0x47009c[_0x369f1a(0x272)])),console[_0x369f1a(0x263)](),console[_0x369f1a(0x263)](_0x369f1a(0x1fb)+a5_0x555240[_0x369f1a(0x228)](_0x1758f6[_0x369f1a(0x22d)]));for(let _0x586758=0x0;_0x586758<_0x1758f6['length'];_0x586758++){const _0xe14fda=_0x1758f6[_0x586758],_0x33ab80=_0xe14fda[_0x369f1a(0x21b)]['length']===0x1?_0x369f1a(0x1f6):_0x369f1a(0x21b),_0x408f65=_0xe14fda[_0x369f1a(0x1e5)]?.[_0x369f1a(0x22d)]?'\x20['+_0xe14fda[_0x369f1a(0x1e5)][_0x369f1a(0x22f)](',\x20')+']':'';console[_0x369f1a(0x263)]('\x20\x20'+(_0x586758+0x1)+'.\x20'+a5_0x555240['white'](_0xe14fda[_0x369f1a(0x240)])+'\x20('+_0xe14fda['rounds'][_0x369f1a(0x22d)]+'\x20'+_0x33ab80+')'+a5_0x555240['dim'](_0x408f65));}return 0x0;}let _0x4a2805,_0xb62a;try{_0x4a2805=await _0x376f3e[_0x369f1a(0x204)][_0x369f1a(0x25f)](_0x47009c[_0x369f1a(0x262)]);}catch(_0x5471c4){const _0x5a82c1=_0x5471c4 instanceof Error?_0x5471c4[_0x369f1a(0x225)]:String(_0x5471c4);return _0x5a82c1[_0x369f1a(0x22e)](_0x369f1a(0x1e1))||_0x5a82c1[_0x369f1a(0x1e0)]()[_0x369f1a(0x22e)]('not\x20found')?console['log'](a5_0x555240[_0x369f1a(0x238)](_0x369f1a(0x234)+_0x47009c[_0x369f1a(0x262)])):console[_0x369f1a(0x263)](a5_0x555240['red'](_0x369f1a(0x258)+_0x47009c[_0x369f1a(0x262)]+_0x369f1a(0x1f5)+_0x5a82c1)),0x1;}try{_0xb62a=await _0x376f3e[_0x369f1a(0x204)][_0x369f1a(0x241)](_0x47009c[_0x369f1a(0x272)],_0x4a2805);}catch(_0x4d0f4e){const _0x22f2af=_0x4d0f4e instanceof Error?_0x4d0f4e[_0x369f1a(0x225)]:String(_0x4d0f4e);return _0x22f2af[_0x369f1a(0x22e)](_0x369f1a(0x1e1))||_0x22f2af[_0x369f1a(0x1e0)]()[_0x369f1a(0x22e)](_0x369f1a(0x232))?console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x238)](_0x369f1a(0x1e6)+_0x47009c[_0x369f1a(0x272)])):console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x238)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x47009c[_0x369f1a(0x272)]+_0x369f1a(0x1f5)+_0x22f2af)),0x1;}let _0x4f6333;if(!_0x2bd0a6)try{_0x4f6333=await setupEvaluatorAgent(_0x376f3e[_0x369f1a(0x204)],_0x415ef0[_0x369f1a(0x253)]);}catch(_0xb730db){const _0x26d98e=_0xb730db instanceof Error?_0xb730db[_0x369f1a(0x225)]:String(_0xb730db);return console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x238)](_0x369f1a(0x271)+_0x26d98e)),0x1;}console[_0x369f1a(0x263)](a5_0x555240['cyan'](_0x369f1a(0x1eb))),console[_0x369f1a(0x263)]('Site:\x20'+a5_0x555240[_0x369f1a(0x228)](_0x1505b0)),console['log'](_0x369f1a(0x1fd)+a5_0x555240[_0x369f1a(0x228)](_0x47009c[_0x369f1a(0x262)]+'/'+_0x47009c['agentName'])),console[_0x369f1a(0x263)]();const _0x411e8e=[],_0x3c5ca3=[],_0x39626f=Date[_0x369f1a(0x239)]();for(let _0xece314=0x0;_0xece314<_0x1758f6[_0x369f1a(0x22d)];_0xece314++){const _0x44d869=_0x1758f6[_0xece314];_0x1758f6[_0x369f1a(0x22d)]>0x1?console['log'](_0x369f1a(0x242)+(_0xece314+0x1)+'/'+_0x1758f6[_0x369f1a(0x22d)]+':\x20'+a5_0x555240[_0x369f1a(0x228)](_0x44d869[_0x369f1a(0x240)])):console[_0x369f1a(0x263)]('Running\x20test:\x20'+a5_0x555240['white'](_0x44d869[_0x369f1a(0x240)]));const _0x2f26f7=createCommandSpinner(_0x369f1a(0x22b)+_0x44d869[_0x369f1a(0x21b)][_0x369f1a(0x22d)]+_0x369f1a(0x1f1));_0x2f26f7[_0x369f1a(0x278)]();try{const {result:_0x467324,conversation:_0x2ae3f2}=await runTest(_0x376f3e['llm'],_0x44d869,{'agentId':_0xb62a,'projectId':_0x4a2805,'site':_0x1505b0,'noEval':_0x2bd0a6,'evaluatorId':_0x4f6333,'onRoundStart':(_0x3610a5,_0x106fa9)=>{const _0x26fa11=_0x369f1a;_0x2f26f7[_0x26fa11(0x209)]=_0x26fa11(0x273)+(_0x3610a5+0x1)+'/'+_0x106fa9+_0x26fa11(0x1f1);},'onRoundComplete':(_0x4c97d3,_0x562a23,_0x1984dc)=>{const _0xe20960=_0x369f1a,_0x5e596f=formatElapsed(_0x562a23);_0x1984dc?console[_0xe20960(0x263)](_0xe20960(0x25d)+(_0x4c97d3+0x1)+'/'+_0x44d869['rounds'][_0xe20960(0x22d)]+_0xe20960(0x231)+a5_0x555240[_0xe20960(0x221)]('✓')+'\x20('+_0x5e596f+')'):console[_0xe20960(0x263)](_0xe20960(0x25d)+(_0x4c97d3+0x1)+'/'+_0x44d869['rounds'][_0xe20960(0x22d)]+'...\x20'+a5_0x555240[_0xe20960(0x238)]('✗'));},'onEvaluationStart':()=>{const _0x58e7ab=_0x369f1a;_0x2f26f7[_0x58e7ab(0x209)]=_0x58e7ab(0x274);},'onEvaluationComplete':_0x31087c=>{const _0x40f863=_0x369f1a,_0xa2fcaa=formatElapsed(_0x31087c);console[_0x40f863(0x263)](_0x40f863(0x20e)+a5_0x555240[_0x40f863(0x221)]('✓')+'\x20('+_0xa2fcaa+')');}});_0x2f26f7[_0x369f1a(0x1ec)](),_0x411e8e[_0x369f1a(0x25e)](_0x467324),_0x3c5ca3[_0x369f1a(0x25e)](_0x2ae3f2);if(_0x467324[_0x369f1a(0x212)]==='PASS')console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x221)]('✓\x20PASS:\x20'+_0x467324[_0x369f1a(0x25a)]));else _0x467324[_0x369f1a(0x212)]==='FAIL'?console['log'](a5_0x555240[_0x369f1a(0x238)](_0x369f1a(0x237)+_0x467324['reason'])):console['log'](a5_0x555240['red'](_0x369f1a(0x243)+_0x467324[_0x369f1a(0x25a)]));_0x467324['conversation_url']&&console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x23d)](_0x369f1a(0x23e)+_0x467324[_0x369f1a(0x1fe)])),console[_0x369f1a(0x263)]();}catch(_0x240a46){_0x2f26f7[_0x369f1a(0x1ec)]();const _0x55ebd4=_0x240a46 instanceof Error?_0x240a46['message']:String(_0x240a46);console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x238)](_0x369f1a(0x243)+_0x55ebd4)),console[_0x369f1a(0x263)](),_0x411e8e[_0x369f1a(0x25e)]({'name':_0x44d869[_0x369f1a(0x240)],'status':_0x369f1a(0x252),'reason':_0x55ebd4,'timestamp':new Date()[_0x369f1a(0x256)](),'duration_ms':0x0});}}const _0x588ca9=Date[_0x369f1a(0x239)]()-_0x39626f,_0x8a54ce=_0x411e8e[_0x369f1a(0x24a)](_0x1378d1=>_0x1378d1[_0x369f1a(0x212)]===_0x369f1a(0x1e2))[_0x369f1a(0x22d)],_0x3b444e=_0x411e8e['filter'](_0x582e2a=>_0x582e2a[_0x369f1a(0x212)]===_0x369f1a(0x270))[_0x369f1a(0x22d)],_0x312fb4=_0x411e8e[_0x369f1a(0x24a)](_0x464d99=>_0x464d99[_0x369f1a(0x212)]==='ERROR')[_0x369f1a(0x22d)];console[_0x369f1a(0x263)]('━'[_0x369f1a(0x1ff)](0x3c)),console['log']('Test\x20Summary'),console[_0x369f1a(0x263)]('━'[_0x369f1a(0x1ff)](0x3c)),console[_0x369f1a(0x263)](_0x369f1a(0x247)+_0x411e8e[_0x369f1a(0x22d)]),console[_0x369f1a(0x263)](_0x369f1a(0x210)+a5_0x555240[_0x369f1a(0x221)](_0x8a54ce)),console[_0x369f1a(0x263)](_0x369f1a(0x208)+a5_0x555240[_0x369f1a(0x238)](_0x3b444e));_0x312fb4>0x0&&console[_0x369f1a(0x263)](_0x369f1a(0x223)+a5_0x555240['red'](_0x312fb4));console['log']('Duration:\x20'+formatElapsed(_0x588ca9)),console['log']('━'[_0x369f1a(0x1ff)](0x3c));const _0x123fa7=_0x411e8e[_0x369f1a(0x24a)](_0x59bd6f=>_0x59bd6f[_0x369f1a(0x212)]!==_0x369f1a(0x1e2));if(_0x123fa7[_0x369f1a(0x22d)]>0x0){console[_0x369f1a(0x263)](),console[_0x369f1a(0x263)](_0x369f1a(0x26f));for(const _0xbe555e of _0x123fa7){const _0x931a37=a5_0x555240[_0x369f1a(0x238)]('✗'),_0x4fd271=_0xbe555e[_0x369f1a(0x25a)][_0x369f1a(0x22d)]>0x32?_0xbe555e[_0x369f1a(0x25a)][_0x369f1a(0x1e8)](0x0,0x32)+'...':_0xbe555e[_0x369f1a(0x25a)];console[_0x369f1a(0x263)]('\x20\x20'+_0x931a37+'\x20'+_0xbe555e['name']+':\x20'+_0x4fd271);}}const _0x49da8c={'summary':{'total':_0x411e8e[_0x369f1a(0x22d)],'passed':_0x8a54ce,'failed':_0x3b444e,'errors':_0x312fb4>0x0?_0x312fb4:undefined,'duration_ms':_0x588ca9},'tests':_0x411e8e,'agent':{'project':_0x47009c[_0x369f1a(0x262)],'name':_0x47009c['agentName'],'site':_0x1505b0},'timestamp':new Date(_0x39626f)['toISOString']()};try{const _0x5b1b52=buildCachedTestRun(_0x3c5ca3,{'site':_0x1505b0,'projectId':_0x4a2805,'projectName':_0x47009c['projectName'],'agentId':_0xb62a,'agentName':_0x47009c[_0x369f1a(0x272)],'testYmlPath':a5_0x527aab[_0x369f1a(0x20a)](_0x47009c[_0x369f1a(0x211)])});saveLastTestRun(_0x5b1b52);}catch{}if(_0xbea8ec!==_0x369f1a(0x21e)||_0x5cc68d){const _0x5dadf6=formatResults(_0x49da8c,_0xbea8ec);if(_0x5cc68d)try{a5_0x252daf['writeFileSync'](_0x5cc68d,_0x5dadf6,'utf-8'),console['log'](),console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x23d)](_0x369f1a(0x23a)+_0x5cc68d));}catch(_0x7f9a62){return console[_0x369f1a(0x263)](),console[_0x369f1a(0x263)](a5_0x555240[_0x369f1a(0x238)]('Error\x20writing\x20output\x20file:\x20'+_0x7f9a62)),0x1;}else console[_0x369f1a(0x263)](),console[_0x369f1a(0x263)](_0x5dadf6);}return _0x123fa7[_0x369f1a(0x22d)]>0x0?0x1:0x0;}async[a5_0x4ee16d(0x218)](_0x5861f1,_0x35604d){const _0x20d28a=a5_0x4ee16d,{options:_0x2fab7a,tdx:_0xabd198}=_0x5861f1,{definition:_0x21c577,agentInfo:_0x426049,outputFormat:_0x19ed17,outputFile:_0x22817b}=_0x35604d,_0x3bc378=_0x2fab7a[_0x20d28a(0x1ed)],_0x4ef77d=loadLastTestRun();if(!_0x4ef77d)return console['log'](a5_0x555240[_0x20d28a(0x238)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x20d28a(0x263)](a5_0x555240[_0x20d28a(0x23d)](_0x20d28a(0x20f))),0x1;if(_0x4ef77d[_0x20d28a(0x259)][_0x20d28a(0x272)]!==_0x426049[_0x20d28a(0x272)])return console[_0x20d28a(0x263)](a5_0x555240['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x4ef77d[_0x20d28a(0x259)]['agentName']+_0x20d28a(0x21f)+_0x426049[_0x20d28a(0x272)]+'\x22.')),console[_0x20d28a(0x263)](a5_0x555240[_0x20d28a(0x23d)](_0x20d28a(0x21d))),0x1;const _0x31974e=new Set(_0x4ef77d[_0x20d28a(0x1f3)][_0x20d28a(0x20b)](_0x2026de=>_0x2026de['testName'])),_0x27132a=_0x21c577[_0x20d28a(0x24f)][_0x20d28a(0x24a)](_0x331aef=>!_0x31974e[_0x20d28a(0x202)](_0x331aef[_0x20d28a(0x240)]));if(_0x27132a[_0x20d28a(0x22d)]>0x0&&_0x4ef77d[_0x20d28a(0x1ed)]!==_0x3bc378)return console[_0x20d28a(0x263)](a5_0x555240['red'](_0x20d28a(0x233))),console[_0x20d28a(0x263)](a5_0x555240[_0x20d28a(0x23d)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x4ef77d[_0x20d28a(0x1ed)]+_0x20d28a(0x275)+_0x3bc378+'\x22.')),console[_0x20d28a(0x263)](a5_0x555240[_0x20d28a(0x23d)](_0x20d28a(0x23f)+_0x4ef77d[_0x20d28a(0x1ed)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x450891=_0x21c577[_0x20d28a(0x24f)][_0x20d28a(0x24a)](_0x2acdae=>_0x31974e['has'](_0x2acdae[_0x20d28a(0x240)])),_0x6e62ed=_0x27132a;let _0xfdb028;try{_0xfdb028=await setupEvaluatorAgent(_0xabd198[_0x20d28a(0x204)],_0x2fab7a[_0x20d28a(0x253)]);}catch(_0x2601bf){const _0x55967f=_0x2601bf instanceof Error?_0x2601bf[_0x20d28a(0x225)]:String(_0x2601bf);return console[_0x20d28a(0x263)](a5_0x555240['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x55967f)),0x1;}console[_0x20d28a(0x263)](a5_0x555240[_0x20d28a(0x24e)](_0x20d28a(0x1f0))),console[_0x20d28a(0x263)](_0x20d28a(0x216)+a5_0x555240[_0x20d28a(0x228)](_0x4ef77d[_0x20d28a(0x26d)])),console[_0x20d28a(0x263)](_0x20d28a(0x1fd)+a5_0x555240[_0x20d28a(0x228)](_0x4ef77d[_0x20d28a(0x259)][_0x20d28a(0x262)]+'/'+_0x4ef77d[_0x20d28a(0x259)]['agentName']));_0x6e62ed[_0x20d28a(0x22d)]>0x0&&console[_0x20d28a(0x263)](_0x20d28a(0x201)+a5_0x555240['yellow'](_0x6e62ed[_0x20d28a(0x22d)]));console[_0x20d28a(0x263)]();const _0x3503c3=[],_0x14b38c=Date[_0x20d28a(0x239)](),_0x4c528a=createCommandSpinner(_0x20d28a(0x235));if(_0x450891[_0x20d28a(0x22d)]>0x0)try{const _0x18a7f1=await reevaluateFromCache(_0xabd198[_0x20d28a(0x204)],_0x4ef77d,{'tests':_0x450891},{'evaluatorId':_0xfdb028,'onTestStart':(_0x323c10,_0xa37453,_0x5226a4)=>{const _0x89309c=_0x20d28a;_0x4c528a[_0x89309c(0x209)]=_0x89309c(0x260)+(_0xa37453+0x1)+'/'+_0x5226a4+':\x20'+_0x323c10+_0x89309c(0x213);if(!_0x4c528a[_0x89309c(0x1fc)])_0x4c528a['start']();},'onTestComplete':(_0x1c1c52,_0x10562b)=>{const _0x76812a=_0x20d28a;_0x4c528a['stop']();if(_0x10562b[_0x76812a(0x212)]===_0x76812a(0x1e2))console[_0x76812a(0x263)](a5_0x555240[_0x76812a(0x221)](_0x76812a(0x227)+_0x1c1c52)+a5_0x555240[_0x76812a(0x23d)](_0x76812a(0x1f8)));else _0x10562b[_0x76812a(0x212)]===_0x76812a(0x270)?console['log'](a5_0x555240[_0x76812a(0x238)](_0x76812a(0x237)+_0x1c1c52+_0x76812a(0x24d)+_0x10562b[_0x76812a(0x25a)])+a5_0x555240[_0x76812a(0x23d)]('\x20(cached)')):console[_0x76812a(0x263)](a5_0x555240['red'](_0x76812a(0x243)+_0x1c1c52+_0x76812a(0x24d)+_0x10562b[_0x76812a(0x25a)]));_0x10562b[_0x76812a(0x1fe)]&&console[_0x76812a(0x263)](a5_0x555240[_0x76812a(0x23d)](_0x76812a(0x26a)+_0x10562b[_0x76812a(0x1fe)])),_0x3503c3['push'](_0x10562b);},'onTestSkipped':(_0x5c7af0,_0x38bbe8)=>{const _0x4e4933=_0x20d28a;_0x4c528a[_0x4e4933(0x1ec)](),console[_0x4e4933(0x263)](a5_0x555240[_0x4e4933(0x265)](_0x4e4933(0x26e)+_0x5c7af0+_0x4e4933(0x24d)+_0x38bbe8));}});for(const _0x1673ec of _0x18a7f1){!_0x3503c3[_0x20d28a(0x1f4)](_0x2f9fc4=>_0x2f9fc4[_0x20d28a(0x240)]===_0x1673ec[_0x20d28a(0x240)])&&_0x3503c3['push'](_0x1673ec);}}catch(_0x12af5e){_0x4c528a['stop']();const _0x1045f8=_0x12af5e instanceof Error?_0x12af5e[_0x20d28a(0x225)]:String(_0x12af5e);return console[_0x20d28a(0x263)](a5_0x555240[_0x20d28a(0x238)](_0x20d28a(0x277)+_0x1045f8)),0x1;}_0x4c528a[_0x20d28a(0x1ec)]();if(_0x6e62ed[_0x20d28a(0x22d)]>0x0){console[_0x20d28a(0x263)](),console['log'](a5_0x555240[_0x20d28a(0x24e)](_0x20d28a(0x261)));const {projectId:_0x103ab5,agentId:_0x207586}=_0x4ef77d[_0x20d28a(0x259)];for(const _0x2174e3 of _0x6e62ed){console[_0x20d28a(0x263)](_0x20d28a(0x222)+a5_0x555240['white'](_0x2174e3['name']));const _0x44aff6=createCommandSpinner(_0x20d28a(0x22b)+_0x2174e3[_0x20d28a(0x21b)][_0x20d28a(0x22d)]+_0x20d28a(0x1f1));_0x44aff6[_0x20d28a(0x278)]();try{const {result:_0x95dedd}=await runTest(_0xabd198[_0x20d28a(0x204)],_0x2174e3,{'agentId':_0x207586,'projectId':_0x103ab5,'site':_0x4ef77d[_0x20d28a(0x1ed)],'noEval':![],'evaluatorId':_0xfdb028,'onRoundStart':(_0x2dff47,_0x342ac5)=>{const _0x9ed50c=_0x20d28a;_0x44aff6['text']=_0x9ed50c(0x273)+(_0x2dff47+0x1)+'/'+_0x342ac5+_0x9ed50c(0x1f1);},'onRoundComplete':(_0x46fbd4,_0x7641d,_0x303d38)=>{const _0x545a7f=_0x20d28a,_0x54db1e=formatElapsed(_0x7641d);_0x303d38?console[_0x545a7f(0x263)](_0x545a7f(0x25d)+(_0x46fbd4+0x1)+'/'+_0x2174e3[_0x545a7f(0x21b)][_0x545a7f(0x22d)]+_0x545a7f(0x231)+a5_0x555240[_0x545a7f(0x221)]('✓')+'\x20('+_0x54db1e+')'):console[_0x545a7f(0x263)](_0x545a7f(0x25d)+(_0x46fbd4+0x1)+'/'+_0x2174e3[_0x545a7f(0x21b)]['length']+'...\x20'+a5_0x555240[_0x545a7f(0x238)]('✗'));},'onEvaluationStart':()=>{const _0x29300d=_0x20d28a;_0x44aff6[_0x29300d(0x209)]=_0x29300d(0x274);},'onEvaluationComplete':_0x4e43f9=>{const _0x30cc8d=_0x20d28a,_0x59435d=formatElapsed(_0x4e43f9);console[_0x30cc8d(0x263)](_0x30cc8d(0x20e)+a5_0x555240['green']('✓')+'\x20('+_0x59435d+')');}});_0x44aff6[_0x20d28a(0x1ec)](),_0x3503c3['push'](_0x95dedd);if(_0x95dedd[_0x20d28a(0x212)]==='PASS')console[_0x20d28a(0x263)](a5_0x555240[_0x20d28a(0x221)](_0x20d28a(0x227)+_0x95dedd[_0x20d28a(0x25a)])+a5_0x555240[_0x20d28a(0x23d)]('\x20(new)'));else _0x95dedd[_0x20d28a(0x212)]===_0x20d28a(0x270)?console[_0x20d28a(0x263)](a5_0x555240['red'](_0x20d28a(0x237)+_0x95dedd[_0x20d28a(0x25a)])+a5_0x555240[_0x20d28a(0x23d)]('\x20(new)')):console['log'](a5_0x555240['red']('✗\x20ERROR:\x20'+_0x95dedd[_0x20d28a(0x25a)]));_0x95dedd[_0x20d28a(0x1fe)]&&console[_0x20d28a(0x263)](a5_0x555240[_0x20d28a(0x23d)]('\x20\x20Conversation:\x20'+_0x95dedd[_0x20d28a(0x1fe)]));}catch(_0xb83935){_0x44aff6[_0x20d28a(0x1ec)]();const _0x4a8f50=_0xb83935 instanceof Error?_0xb83935[_0x20d28a(0x225)]:String(_0xb83935);console['log'](a5_0x555240[_0x20d28a(0x238)](_0x20d28a(0x243)+_0x4a8f50)),_0x3503c3[_0x20d28a(0x25e)]({'name':_0x2174e3[_0x20d28a(0x240)],'status':_0x20d28a(0x252),'reason':_0x4a8f50,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x20d28a(0x263)]();const _0x91eabf=Date[_0x20d28a(0x239)]()-_0x14b38c,_0x150400=_0x3503c3[_0x20d28a(0x24a)](_0x295e33=>_0x295e33[_0x20d28a(0x212)]==='PASS')[_0x20d28a(0x22d)],_0x2d5ce6=_0x3503c3[_0x20d28a(0x24a)](_0x30ea79=>_0x30ea79[_0x20d28a(0x212)]===_0x20d28a(0x270))['length'],_0x3f19c6=_0x3503c3[_0x20d28a(0x24a)](_0x2bc9f5=>_0x2bc9f5[_0x20d28a(0x212)]===_0x20d28a(0x252))[_0x20d28a(0x22d)];console['log']('━'[_0x20d28a(0x1ff)](0x3c)),console[_0x20d28a(0x263)](_0x20d28a(0x257)),console['log']('━'[_0x20d28a(0x1ff)](0x3c)),console[_0x20d28a(0x263)](_0x20d28a(0x247)+_0x3503c3[_0x20d28a(0x22d)]),console[_0x20d28a(0x263)]('Passed:\x20\x20\x20'+a5_0x555240[_0x20d28a(0x221)](_0x150400)),console['log'](_0x20d28a(0x208)+a5_0x555240[_0x20d28a(0x238)](_0x2d5ce6));_0x3f19c6>0x0&&console[_0x20d28a(0x263)](_0x20d28a(0x223)+a5_0x555240[_0x20d28a(0x238)](_0x3f19c6));console[_0x20d28a(0x263)](_0x20d28a(0x20d)+formatElapsed(_0x91eabf)),console['log']('━'['repeat'](0x3c));const _0x37b1ee={'summary':{'total':_0x3503c3[_0x20d28a(0x22d)],'passed':_0x150400,'failed':_0x2d5ce6,'errors':_0x3f19c6>0x0?_0x3f19c6:undefined,'duration_ms':_0x91eabf},'tests':_0x3503c3,'agent':{'project':_0x426049[_0x20d28a(0x262)],'name':_0x426049[_0x20d28a(0x272)],'site':_0x3bc378},'timestamp':new Date(_0x14b38c)[_0x20d28a(0x256)]()};if(_0x19ed17!==_0x20d28a(0x21e)||_0x22817b){const _0x47487b=formatResults(_0x37b1ee,_0x19ed17);if(_0x22817b)try{a5_0x252daf[_0x20d28a(0x1fa)](_0x22817b,_0x47487b,_0x20d28a(0x203)),console[_0x20d28a(0x263)](),console[_0x20d28a(0x263)](a5_0x555240[_0x20d28a(0x23d)](_0x20d28a(0x23a)+_0x22817b));}catch(_0x1131d6){return console['log'](),console['log'](a5_0x555240[_0x20d28a(0x238)](_0x20d28a(0x250)+_0x1131d6)),0x1;}else console[_0x20d28a(0x263)](),console[_0x20d28a(0x263)](_0x47487b);}const _0xa206d8=_0x3503c3[_0x20d28a(0x24a)](_0x50ce24=>_0x50ce24['status']!==_0x20d28a(0x1e2));return _0xa206d8[_0x20d28a(0x22d)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x30f4ed=a6_0x36d5;(function(_0x58c3ce,_0x4409fc){const _0x294289=a6_0x36d5,_0x486a55=_0x58c3ce();while(!![]){try{const _0x2a9175=parseInt(_0x294289(0x96))/0x1+parseInt(_0x294289(0x94))/0x2*(-parseInt(_0x294289(0x85))/0x3)+-parseInt(_0x294289(0x7a))/0x4*(parseInt(_0x294289(0x87))/0x5)+parseInt(_0x294289(0xb6))/0x6*(parseInt(_0x294289(0xa3))/0x7)+-parseInt(_0x294289(0x88))/0x8*(parseInt(_0x294289(0x86))/0x9)+parseInt(_0x294289(0x84))/0xa+parseInt(_0x294289(0x8c))/0xb;if(_0x2a9175===_0x4409fc)break;else _0x486a55['push'](_0x486a55['shift']());}catch(_0x36c316){_0x486a55['push'](_0x486a55['shift']());}}}(a6_0x3eee,0x70798));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x3eee(){const _0x4b3f3b=['body','set-cookie','has','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','2110572nsdhLo','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','stack','error','Error:\x20','headers','method','log','description','entries','PATCH','execute','request','12vpFIMI','toUpperCase','output','indexOf','x-xsrf-token','<\x20HTTP/1.1\x20','api','Invalid\x20API\x20type:\x20','proxy-authorization','isArray','61770FOSvYx','6UZpyMC','2061DpzNAj','203615YGUAyz','40dsoDHi','keys','x-auth-token','header','3902294EbhLeL','\x22.\x20','file','substring','toLowerCase','Results\x20saved\x20to\x20','site','readBodyFromFile','388906ByeOLT','verbose','260223VdPSbM','DELETE','message','x-trino-user','cookie','noColor','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','set-cookie2','trim','Invalid\x20HTTP\x20method:\x20','\x0aStack\x20trace:\x0a','GET','includes','7ysHLfi','llm','PUT','Invalid\x20header\x20format:\x20\x22','length','llm-proxy','POST','workflow','type','data','color','trino','authorization','startsWith','join'];a6_0x3eee=function(){return _0x4b3f3b;};return a6_0x3eee();}import{resolveSite}from'../core/config.js';function a6_0x36d5(_0x4347e6,_0x24d785){_0x4347e6=_0x4347e6-0x75;const _0x3eee4f=a6_0x3eee();let _0x36d514=_0x3eee4f[_0x4347e6];return _0x36d514;}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x30f4ed(0xaf),a6_0x30f4ed(0x82),a6_0x30f4ed(0x9a),a6_0x30f4ed(0xb3),a6_0x30f4ed(0x9d),a6_0x30f4ed(0x7e),a6_0x30f4ed(0x8a),a6_0x30f4ed(0x99)]);function isSensitiveHeader(_0x66145d){const _0x1b5670=a6_0x30f4ed;return SENSITIVE_HEADERS[_0x1b5670(0xb4)](_0x66145d[_0x1b5670(0x90)]());}function parseHeader(_0x5421bb){const _0x59a3dc=a6_0x30f4ed,_0xfda583=_0x5421bb[_0x59a3dc(0x7d)](':');if(_0xfda583===-0x1)throw new Error(_0x59a3dc(0xa6)+_0x5421bb+_0x59a3dc(0x8d)+_0x59a3dc(0xb7));const _0x56bfe8=_0x5421bb['substring'](0x0,_0xfda583)['trim'](),_0x19b92a=_0x5421bb[_0x59a3dc(0x8f)](_0xfda583+0x1)[_0x59a3dc(0x9e)]();if(!_0x56bfe8)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x5421bb+'\x22');return[_0x56bfe8,_0x19b92a];}export class ApiCommand extends BaseCommand{['name']='api';[a6_0x30f4ed(0x75)]=a6_0x30f4ed(0xb5);['validate'](_0x39b455){const _0x42981b=a6_0x30f4ed,{args:_0x57e5f9,options:_0xb04303}=_0x39b455,_0xc879c2=_0xb04303;if(_0x57e5f9['length']===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x3f6843=_0x57e5f9[0x0];if(!_0x3f6843[_0x42981b(0xb0)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x3f6843;const _0x1bbf82=_0xc879c2['data'],_0x4acd7d=_0xc879c2[_0x42981b(0x8e)];if(_0x1bbf82&&_0x4acd7d)return _0x42981b(0x9c);const _0xacf482=_0xc879c2[_0x42981b(0xbc)]||_0x42981b(0xa1),_0x1bd9e4=[_0x42981b(0xa1),_0x42981b(0xa9),_0x42981b(0xa5),_0x42981b(0x97),_0x42981b(0x77)];if(!_0x1bd9e4[_0x42981b(0xa2)](_0xacf482[_0x42981b(0x7b)]()))return _0x42981b(0x9f)+_0xacf482+'.\x20Valid\x20methods:\x20'+_0x1bd9e4[_0x42981b(0xb1)](',\x20');const _0x2dbb41=_0xc879c2[_0x42981b(0xab)]||'td',_0x41c32b=['td','cdp',_0x42981b(0xaa),_0x42981b(0xae),_0x42981b(0xa4),_0x42981b(0xa8)];if(!_0x41c32b[_0x42981b(0xa2)](_0x2dbb41))return _0x42981b(0x81)+_0x2dbb41+'.\x20Valid\x20types:\x20'+_0x41c32b[_0x42981b(0xb1)](',\x20');return undefined;}async[a6_0x30f4ed(0x78)](_0x1b20b6){const _0x42300f=a6_0x30f4ed,{options:_0x2293a5,args:_0x3a1996,tdx:_0x49e3c5}=_0x1b20b6,_0x2d0daa=_0x2293a5,_0x5aa6ab=_0x3a1996[0x0],_0x476e1f=(_0x2d0daa[_0x42300f(0xbc)]||'GET')['toUpperCase'](),_0x35d84e=_0x2d0daa[_0x42300f(0xac)],_0x461567=_0x2d0daa[_0x42300f(0x8e)],_0x246393=_0x2d0daa[_0x42300f(0x8b)],_0x4d73e5=_0x2d0daa[_0x42300f(0xab)]||'td';try{const _0x3bcca6={};if(_0x246393){const _0x5549d2=Array[_0x42300f(0x83)](_0x246393)?_0x246393:[_0x246393];for(const _0x406167 of _0x5549d2){const [_0x5ac69d,_0x1606d2]=parseHeader(_0x406167);_0x3bcca6[_0x5ac69d]=_0x1606d2;}}let _0x3674a8;if(_0x35d84e)_0x3674a8=_0x35d84e;else{if(_0x461567)try{_0x3674a8=RawAPI[_0x42300f(0x93)](_0x461567);}catch(_0x2d86ac){return console['error']('Error:\x20'+(_0x2d86ac instanceof Error?_0x2d86ac[_0x42300f(0x98)]:String(_0x2d86ac))),0x1;}}const _0x3e1cf2={'method':_0x476e1f,'apiType':_0x4d73e5,'includeHeaders':_0x2293a5[_0x42300f(0x95)]};_0x3674a8&&(_0x3e1cf2[_0x42300f(0xb2)]=_0x3674a8);Object[_0x42300f(0x89)](_0x3bcca6)[_0x42300f(0xa7)]>0x0&&(_0x3e1cf2['headers']=_0x3bcca6);if(_0x2293a5['verbose']){const _0x56a38a=resolveSite(_0x2293a5[_0x42300f(0x92)]),_0x337013=getEndpoint(_0x56a38a,_0x4d73e5),_0x3108d7=''+_0x337013+_0x5aa6ab;console[_0x42300f(0xb9)]('>\x20'+_0x476e1f+'\x20'+_0x3108d7);const _0x571100=getAuthHeaders(_0x56a38a),_0xa59a64={..._0x571100,..._0x3bcca6};for(const [_0x5be604,_0x4776fb]of Object[_0x42300f(0x76)](_0xa59a64)){!isSensitiveHeader(_0x5be604)&&console[_0x42300f(0xb9)]('>\x20'+_0x5be604+':\x20'+_0x4776fb);}_0x3674a8&&console['error']('>'),console[_0x42300f(0xb9)]('');}const _0x160555=await _0x49e3c5[_0x42300f(0x80)][_0x42300f(0x79)](_0x5aa6ab,_0x3e1cf2);if(_0x2293a5[_0x42300f(0x95)]&&_0x160555[_0x42300f(0xbb)]){console[_0x42300f(0xb9)](_0x42300f(0x7f)+_0x160555['status']);for(const [_0x292f27,_0x13cca2]of Object[_0x42300f(0x76)](_0x160555[_0x42300f(0xbb)])){!isSensitiveHeader(_0x292f27)&&console[_0x42300f(0xb9)]('<\x20'+_0x292f27+':\x20'+_0x13cca2);}console[_0x42300f(0xb9)]('');}const _0x5295c9=Boolean(_0x2293a5[_0x42300f(0x7c)]),_0x4e7c13={'color':_0x2293a5[_0x42300f(0xad)],'noColor':_0x2293a5[_0x42300f(0x9b)]||_0x5295c9&&!_0x2293a5[_0x42300f(0xad)]},_0x4d1bcb=colorizeJSON(_0x160555[_0x42300f(0xac)],_0x4e7c13);return _0x2293a5[_0x42300f(0x7c)]?(writeFileSync(_0x2293a5[_0x42300f(0x7c)],_0x4d1bcb),console['error'](_0x42300f(0x91)+_0x2293a5[_0x42300f(0x7c)])):console[_0x42300f(0xbd)](_0x4d1bcb),0x0;}catch(_0x1816cd){return _0x1816cd instanceof Error?(console['error'](_0x42300f(0xba)+_0x1816cd[_0x42300f(0x98)]),_0x2293a5['verbose']&&_0x1816cd[_0x42300f(0xb8)]&&console[_0x42300f(0xb9)](_0x42300f(0xa0)+_0x1816cd[_0x42300f(0xb8)])):console['error'](_0x42300f(0xba)+String(_0x1816cd)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x12057a=a7_0x2c84;(function(_0x570f7f,_0x4b2291){const _0x2044fb=a7_0x2c84,_0x3fbf64=_0x570f7f();while(!![]){try{const _0x41e58c=-parseInt(_0x2044fb(0x128))/0x1*(-parseInt(_0x2044fb(0x12b))/0x2)+parseInt(_0x2044fb(0xf7))/0x3+-parseInt(_0x2044fb(0x119))/0x4+parseInt(_0x2044fb(0x111))/0x5*(-parseInt(_0x2044fb(0x11e))/0x6)+parseInt(_0x2044fb(0xea))/0x7*(-parseInt(_0x2044fb(0x11d))/0x8)+parseInt(_0x2044fb(0xfd))/0x9*(-parseInt(_0x2044fb(0xed))/0xa)+parseInt(_0x2044fb(0x105))/0xb*(parseInt(_0x2044fb(0xeb))/0xc);if(_0x41e58c===_0x4b2291)break;else _0x3fbf64['push'](_0x3fbf64['shift']());}catch(_0x4cd542){_0x3fbf64['push'](_0x3fbf64['shift']());}}}(a7_0x50f7,0x82bc3));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';function a7_0x50f7(){const _0x4a7cb1=['\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','red','ERROR','auth','yellow','other','status','\x20(site:\x20','1YjLcfE','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','error','432076XqcCZo','apiKey','Select\x20your\x20Treasure\x20Data\x20site:','✓\x20Authentication\x20successful\x0a','profile','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✗\x20Validation\x20failed:\x20','API\x20key\x20cannot\x20be\x20empty','jobs','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','site','\x20for\x20profile:\x20','3540726WBggGe','36nDjZht','create','388070nXtrNi','✓\x20Default\x20site\x20set\x20to\x20','\x20\x20tdx','✓\x20API\x20key\x20removed\x20from\x20keychain','getUserInfo','customSite','auth:setup','logLevel','auth:clear','\x20(profile:\x20','3190890JzhfmI','last_name','tdx:\x20auth\x20setup','/app/mp/ak','Name:\x20','execute','18bFUqty','text','bold','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','\x0aSetup\x20cancelled','first_name','warn','3729781qHEqlm','Setting\x20up\x20authentication\x20for\x20site:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','tdx\x20profile:\x20','description','Site\x20name\x20cannot\x20be\x20empty','green','Enter\x20your\x20TD\x20API\x20key:','tdx:\x20auth\x20clear','log','trim','4113195ojASzO','name','select','System\x20keychain\x20is\x20not\x20available','email','us01','Enter\x20site\x20name:','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','1421276culdEt','filter','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x20--profile\x20','8DqyQcr','6ntsVLo','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens'];a7_0x50f7=function(){return _0x4a7cb1;};return a7_0x50f7();}import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0x2c84(_0x37344a,_0x5335be){_0x37344a=_0x37344a-0xdf;const _0x50f732=a7_0x50f7();let _0x2c8493=_0x50f732[_0x37344a];return _0x2c8493;}import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x1d5c63 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x28bef9 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x12057a(0x112)]=a7_0x12057a(0xf3);[a7_0x12057a(0x10a)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x12057a(0xfc)](_0x1a6a89){const _0x438cd1=a7_0x12057a,{options:_0x459043}=_0x1a6a89,_0x16081a=_0x459043[_0x438cd1(0xe2)];console[_0x438cd1(0x10f)](a7_0x28bef9[_0x438cd1(0xff)](_0x438cd1(0xf9)));const _0x1de971=_0x459043[_0x438cd1(0xe8)]||_0x438cd1(0x116),{choices:_0x3ac12a,initialIndex:_0x198ebf}=buildSiteChoices(_0x1de971),_0x5b11aa=_0x16081a?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x16081a+'):':_0x438cd1(0xe0),_0x167296=await a7_0x1d5c63({'type':_0x438cd1(0x113),'name':_0x438cd1(0xe8),'message':_0x5b11aa,'choices':_0x3ac12a,'initial':_0x198ebf});if(!_0x167296[_0x438cd1(0xe8)])return console[_0x438cd1(0x10f)](_0x438cd1(0x102)),0x1;let _0x11f8ea;if(_0x167296[_0x438cd1(0xe8)]===_0x438cd1(0x125)){const _0x251454=await a7_0x1d5c63({'type':_0x438cd1(0xfe),'name':_0x438cd1(0xf2),'message':_0x438cd1(0x117),'initial':_0x438cd1(0x116),'validate':_0x2fbffb=>{const _0x1e6bb1=_0x438cd1;if(!_0x2fbffb||!_0x2fbffb[_0x1e6bb1(0x110)]())return _0x1e6bb1(0x10b);if(!/^[a-z0-9-]+$/['test'](_0x2fbffb['trim']()))return _0x1e6bb1(0x11f);return!![];}});if(!_0x251454[_0x438cd1(0xf2)])return console[_0x438cd1(0x10f)]('\x0aSetup\x20cancelled'),0x1;_0x11f8ea=_0x251454[_0x438cd1(0xf2)];}else _0x11f8ea=_0x167296[_0x438cd1(0xe8)];const _0x273888=resolveSite(_0x11f8ea);console[_0x438cd1(0x10f)](_0x438cd1(0x106)+_0x273888),console['log']('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x438cd1(0x10f)]('\x20\x20'+getConsoleUrl(_0x273888,_0x438cd1(0xfa)));const _0x5215ee=await a7_0x1d5c63({'type':'password','name':_0x438cd1(0xdf),'message':_0x438cd1(0x10d),'validate':_0x3cc18c=>{const _0x7df169=_0x438cd1;if(!_0x3cc18c||!_0x3cc18c['trim']())return _0x7df169(0xe5);return!![];}});if(!_0x5215ee[_0x438cd1(0xdf)])return console[_0x438cd1(0x10f)](_0x438cd1(0x102)),0x1;const _0x52bfdb=_0x5215ee[_0x438cd1(0xdf)];console['log']('Validating\x20API\x20key...');try{const _0x5eafe0=TDX[_0x438cd1(0xec)]({'site':_0x273888,'apiKey':_0x52bfdb[_0x438cd1(0x110)](),'logLevel':_0x459043[_0x438cd1(0xf4)]??LogLevel[_0x438cd1(0x122)]}),_0x3bf243=await _0x5eafe0[_0x438cd1(0xe6)][_0x438cd1(0xf1)]();console[_0x438cd1(0x10f)](_0x438cd1(0xe3)+_0x3bf243[_0x438cd1(0x115)]+')');const _0x3886b2=await isKeychainAvailable();_0x3886b2?(await saveAPIKeyAsync(_0x52bfdb['trim'](),_0x273888,_0x16081a),console[_0x438cd1(0x10f)](_0x438cd1(0x118)+(_0x16081a?_0x438cd1(0xf6)+_0x16081a+')':''))):(console[_0x438cd1(0x104)](a7_0x28bef9[_0x438cd1(0x124)](_0x438cd1(0x129))),console['warn'](a7_0x28bef9['yellow'](_0x438cd1(0x108))));if(_0x16081a){const _0x1c3bfb={'site':_0x273888};saveProfileToUserConfig(_0x16081a,_0x1c3bfb),console[_0x438cd1(0x10f)]('✓\x20Profile\x20\x27'+_0x16081a+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x273888),console['log'](_0x438cd1(0xee)+_0x273888);const _0x5db6a8=_0x16081a?_0x438cd1(0x11c)+_0x16081a:'';return console[_0x438cd1(0x10f)](),console[_0x438cd1(0x10f)](_0x438cd1(0x11b)),console[_0x438cd1(0x10f)]('\x20\x20tdx'+_0x5db6a8+_0x438cd1(0x120)),console[_0x438cd1(0x10f)](_0x438cd1(0xef)+_0x5db6a8+_0x438cd1(0x100)),0x0;}catch(_0x5c230c){if(_0x5c230c instanceof HTTPClientError&&_0x5c230c[_0x438cd1(0x126)]===0x191)return printAuthError(_0x5c230c),0x1;return console[_0x438cd1(0x12a)](a7_0x28bef9[_0x438cd1(0x121)](_0x438cd1(0xe4)+(_0x5c230c instanceof Error?_0x5c230c['message']:String(_0x5c230c)))),console['error'](_0x438cd1(0x101)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x12057a(0x112)]=a7_0x12057a(0x123);[a7_0x12057a(0x10a)]=a7_0x12057a(0xe7);async[a7_0x12057a(0xfc)](_0xffca8c){const _0xe3f94=a7_0x12057a,{options:_0x25ddff,tdx:_0x2493a7}=_0xffca8c,_0x4bf5fc=_0x25ddff['site'],_0x5bceb8=_0x25ddff[_0xe3f94(0xe2)],_0x1a4bb2=_0x5bceb8?_0x5bceb8:'N/A';console[_0xe3f94(0x10f)](_0xe3f94(0x109)+_0x1a4bb2+_0xe3f94(0x127)+_0x4bf5fc+')');const _0x28dd6f=await resolveAPIKeyAsync(_0x4bf5fc,_0x5bceb8);if(_0x28dd6f){const {source:_0x2fbef7,isDeprecated:_0x1fcd91}=_0x28dd6f,_0x58c369='Read\x20credential\x20from\x20'+_0x2fbef7;console[_0xe3f94(0x10f)](_0x1fcd91?a7_0x28bef9['yellow'](_0x58c369):_0x58c369);}else console[_0xe3f94(0x10f)](a7_0x28bef9[_0xe3f94(0x124)]('No\x20credential\x20found'));try{const _0x207c56=await _0x2493a7['jobs'][_0xe3f94(0xf1)]();return console[_0xe3f94(0x10f)](a7_0x28bef9[_0xe3f94(0x10c)](_0xe3f94(0xe1))),console[_0xe3f94(0x10f)]('User:\x20'+_0x207c56[_0xe3f94(0x115)]),(_0x207c56[_0xe3f94(0x103)]||_0x207c56[_0xe3f94(0xf8)])&&console['log'](_0xe3f94(0xfb)+[_0x207c56[_0xe3f94(0x103)],_0x207c56[_0xe3f94(0xf8)]][_0xe3f94(0x11a)](Boolean)['join']('\x20')),0x0;}catch(_0x1c3c85){return _0x1c3c85 instanceof HTTPClientError&&_0x1c3c85[_0xe3f94(0x126)]===0x191?printAuthError(_0x1c3c85,!![],_0x5bceb8):console[_0xe3f94(0x12a)](a7_0x28bef9[_0xe3f94(0x121)](_0xe3f94(0xe4)+(_0x1c3c85 instanceof Error?_0x1c3c85['message']:String(_0x1c3c85)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x12057a(0x112)]=a7_0x12057a(0xf5);[a7_0x12057a(0x10a)]=a7_0x12057a(0x107);async[a7_0x12057a(0xfc)](_0x14d999){const _0x15e5a2=a7_0x12057a,{options:_0x4aa939}=_0x14d999,_0x2adeab=_0x4aa939['profile'];console[_0x15e5a2(0x10f)](a7_0x28bef9['bold'](_0x15e5a2(0x10e)));const _0x2c63f9=await isKeychainAvailable();if(!_0x2c63f9)return console['error'](a7_0x28bef9['red'](_0x15e5a2(0x114))),0x1;const _0x779517=await deleteKeychainAPIKey(_0x2adeab);return _0x779517?(clearCredentialCache(),console['log'](_0x15e5a2(0xf0)+(_0x2adeab?'\x20(profile:\x20'+_0x2adeab+')':'')),0x0):(console[_0x15e5a2(0x10f)]('No\x20API\x20key\x20found\x20in\x20keychain'+(_0x2adeab?_0x15e5a2(0xe9)+_0x2adeab:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x3dc73a=a8_0x2714;function a8_0x53db(){const _0x129413=['48028816YGEKfU','Resolving\x20project\x20\x27','projectId','type','new','includes','29330XBybGp','tool','validate','stack','Error:\x20','name','chat','functionName','10sFSvZd','verbose','291833OUicMi','Create\x20a\x20new\x20chat\x20session','chatId','Continuing\x20chat:\x20','resolveProjectId','event','streamChat','execute','session\x20context','tool_result','join','slice','message','23388rdfUNr','1902XRoyOJ','streamChatJsonl','content','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','write','Resolving\x20agent\x20\x27','data','767427heESLI','metadata','handleChatEvent','startChat','claude-4.5-haiku','getDefaultAgent','stringify','stdout','description','targetFunction','tool_call','2649104CEHiYS','13583637MmAgNb','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','\x0aError:\x20','targetWebSearchTool','site','615nhgtLE','targetKnowledgeBase','string','Using\x20agent\x20from\x20','4PDXOBM','Getting\x20default\x20agent...','llmAgent','Error:\x20Chat\x20session\x20\x27','agent','chat-create','agentId','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','log','error','llm','Using\x20cached\x20default\x20agent:\x20','context','options','\x27\x20not\x20found','cause','resolveAgentId','\x27...'];a8_0x53db=function(){return _0x129413;};return a8_0x53db();}function a8_0x2714(_0x546774,_0x12d3d5){_0x546774=_0x546774-0x6e;const _0x53db10=a8_0x53db();let _0x2714c7=_0x53db10[_0x546774];return _0x2714c7;}(function(_0x872644,_0x5f11e4){const _0x3325da=a8_0x2714,_0x50bb21=_0x872644();while(!![]){try{const _0x4c495b=parseInt(_0x3325da(0xb9))/0x1*(-parseInt(_0x3325da(0x97))/0x2)+parseInt(_0x3325da(0x82))/0x3+-parseInt(_0x3325da(0x7a))/0x4*(parseInt(_0x3325da(0x93))/0x5)+parseInt(_0x3325da(0x7b))/0x6*(-parseInt(_0x3325da(0xaf))/0x7)+parseInt(_0x3325da(0x8d))/0x8+parseInt(_0x3325da(0x8e))/0x9*(-parseInt(_0x3325da(0xb7))/0xa)+parseInt(_0x3325da(0xa9))/0xb;if(_0x4c495b===_0x5f11e4)break;else _0x50bb21['push'](_0x50bb21['shift']());}catch(_0x57df06){_0x50bb21['push'](_0x50bb21['shift']());}}}(a8_0x53db,0xc6721));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x34fefe,_0x52928d){const _0x17d9e9=a8_0x2714;if(_0x34fefe instanceof SDKError)console[_0x17d9e9(0xa0)](_0x17d9e9(0xb3)+_0x34fefe[_0x17d9e9(0x79)]),_0x52928d[_0x17d9e9(0xb8)]&&(_0x34fefe[_0x17d9e9(0xa6)]&&console[_0x17d9e9(0xa0)]('\x20\x20Cause:\x20'+_0x34fefe[_0x17d9e9(0xa6)]),_0x34fefe['stack']&&(console[_0x17d9e9(0xa0)]('\x0aStack\x20trace:'),console[_0x17d9e9(0xa0)](_0x34fefe[_0x17d9e9(0xb2)])));else throw _0x34fefe;}async function resolveAgentId(_0x1dfdae,_0x27e06e,_0x4d018d,_0x4981bd,_0x5de9ce){const _0x314c6e=a8_0x2714,_0x43c585=_0x27e06e||_0x4d018d;if(_0x43c585){const {projectName:_0x43df4e,agentName:_0x5e310d}=parseAgentRef(_0x43c585),_0x2fb007=_0x5e310d||_0x43c585,_0x2915db=_0x5e310d?_0x43df4e:_0x4981bd;if(!_0x2915db)throw new Error(_0x314c6e(0x8f));if(_0x5de9ce){const _0x3b7b1d=_0x27e06e?'--agent\x20flag':_0x314c6e(0x75);console[_0x314c6e(0xa0)](_0x314c6e(0x96)+_0x3b7b1d+':\x20'+_0x2915db+'/'+_0x2fb007);}const _0x26423e=await withSpinner(_0x314c6e(0xaa)+_0x2915db+_0x314c6e(0xa8),()=>_0x1dfdae[_0x314c6e(0xa1)][_0x314c6e(0x71)](_0x2915db),{'verbose':_0x5de9ce}),_0x65c51=await withSpinner(_0x314c6e(0x80)+_0x2fb007+_0x314c6e(0xa8),()=>_0x1dfdae[_0x314c6e(0xa1)][_0x314c6e(0xa7)](_0x2fb007,_0x26423e['data']),{'verbose':_0x5de9ce});return _0x65c51[_0x314c6e(0x81)];}else{const _0x566fd0=_0x1dfdae[_0x314c6e(0xa1)][_0x314c6e(0x87)]();if(_0x566fd0)return _0x5de9ce&&console[_0x314c6e(0xa0)](_0x314c6e(0xa2)+_0x566fd0['name']),_0x566fd0['id'];const _0x5f4197=await withSpinner(_0x314c6e(0x98),()=>_0x1dfdae[_0x314c6e(0xa1)]['getOrCreateDefaultAgent'](_0x314c6e(0x86),0x0),{'verbose':_0x5de9ce});return _0x5f4197[_0x314c6e(0x81)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x3dc73a(0xb4)]=a8_0x3dc73a(0xb5);[a8_0x3dc73a(0x8a)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x3dc73a(0xb1)](_0x6f57a9){const _0xa417b2=a8_0x3dc73a,_0x4b2868=_0x6f57a9['args'][_0xa417b2(0x77)]('\x20');if(!_0x4b2868)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a8_0x3dc73a(0x73)](_0x55db7a,_0x254483,_0x17e5ca,_0x40aae8,_0x55d20c){const _0x737ef4=a8_0x3dc73a;for await(const _0x2c7584 of _0x55db7a[_0x737ef4(0xa1)][_0x737ef4(0xb5)](_0x254483,{'agentId':_0x17e5ca,'chatId':_0x40aae8})){if(_0x2c7584['type']===_0x737ef4(0x83)){const _0x5b7b5d=_0x2c7584[_0x737ef4(0x81)]['chatId'];saveLastChatId(_0x5b7b5d),_0x55d20c&&console[_0x737ef4(0xa0)]('Chat\x20session:\x20'+_0x5b7b5d);}else _0x2c7584[_0x737ef4(0xac)]===_0x737ef4(0x72)&&this[_0x737ef4(0x84)](_0x2c7584['data']);}}async[a8_0x3dc73a(0x7c)](_0x4b0f03,_0x48398c,_0x2a2d01,_0xb83836){const _0xf82a15=a8_0x3dc73a,_0x26115c=_0x4b0f03[_0xf82a15(0xa3)][_0xf82a15(0x92)];let _0x3ca5e6=![];for await(const _0x47e1ff of _0x4b0f03[_0xf82a15(0xa1)][_0xf82a15(0xb5)](_0x48398c,{'agentId':_0x2a2d01,'chatId':_0xb83836})){if(_0x47e1ff[_0xf82a15(0xac)]===_0xf82a15(0x83)){const _0xf081f5=_0x47e1ff['data'];saveLastChatId(_0xf081f5[_0xf82a15(0x6f)]);const _0x4e83e8=_0xf081f5[_0xf82a15(0xab)]&&_0xf081f5['agentId']?getLLMConversationUrl(_0x26115c,_0xf081f5[_0xf82a15(0xab)],_0xf081f5[_0xf82a15(0x9d)],_0xf081f5[_0xf82a15(0x6f)]):undefined;console['log'](JSON[_0xf82a15(0x88)]({'type':_0xf82a15(0x83),'data':{'chatId':_0xf081f5[_0xf82a15(0x6f)],'agentId':_0xf081f5['agentId'],'consoleUrl':_0x4e83e8}})),_0x3ca5e6=!![];}else{if(_0x47e1ff[_0xf82a15(0xac)]===_0xf82a15(0x72)){!_0x3ca5e6&&_0xb83836&&(console[_0xf82a15(0x9f)](JSON['stringify']({'type':_0xf82a15(0x83),'data':{'chatId':_0xb83836}})),_0x3ca5e6=!![]);const _0x5f07c7=_0x47e1ff[_0xf82a15(0x81)];if(_0xf82a15(0x7d)in _0x5f07c7)console[_0xf82a15(0x9f)](JSON[_0xf82a15(0x88)]({'type':_0xf82a15(0x7d),'data':{'content':_0x5f07c7[_0xf82a15(0x7d)]}}));else{if(_0xf82a15(0x8c)in _0x5f07c7){const _0x402c78=_0x5f07c7['tool_call'];console[_0xf82a15(0x9f)](JSON['stringify']({'type':_0xf82a15(0x8c),'data':{'id':_0x402c78['id'],'name':_0x402c78[_0xf82a15(0xb6)],'target':_0x402c78[_0xf82a15(0x94)]?.['name']||_0x402c78['targetAgent']?.[_0xf82a15(0xb4)]||_0x402c78[_0xf82a15(0x91)]?.[_0xf82a15(0xb4)]||_0x402c78[_0xf82a15(0x8b)]}}));}else{if(_0xf82a15(0xb0)in _0x5f07c7)console[_0xf82a15(0x9f)](JSON['stringify']({'type':_0xf82a15(0x76),'data':{'id':_0x5f07c7['tool']['id'],'name':_0x5f07c7[_0xf82a15(0xb0)][_0xf82a15(0xb6)],'result':typeof _0x5f07c7['tool'][_0xf82a15(0x7d)]===_0xf82a15(0x95)?_0x5f07c7[_0xf82a15(0xb0)][_0xf82a15(0x7d)][_0xf82a15(0x78)](0x0,0x1f4):''}}));else _0xf82a15(0xa0)in _0x5f07c7&&console[_0xf82a15(0x9f)](JSON[_0xf82a15(0x88)]({'type':_0xf82a15(0xa0),'data':{'error':_0x5f07c7[_0xf82a15(0xa0)]}}));}}}}}console['log'](JSON[_0xf82a15(0x88)]({'type':'done'}));}async[a8_0x3dc73a(0x74)](_0xbd2503){const _0x268b05=a8_0x3dc73a,{options:_0x58fa72,args:_0x4a6ec3,tdx:_0x56f2bc}=_0xbd2503,_0x567be6=_0x4a6ec3[_0x268b05(0x77)]('\x20'),_0x261604=_0x58fa72,_0x32efc4=_0x261604[_0x268b05(0x9b)],_0x5796b2=_0x261604[_0x268b05(0x99)],_0x5cd534=_0x261604['llmProject'],_0x3a4b5e=_0x261604[_0x268b05(0xad)],_0xf60267=_0x261604['chatId'],_0x1e5d11=_0x261604['stream'];if(_0x3a4b5e&&_0xf60267)return console['error'](_0x268b05(0x9e)),0x1;try{let _0x9b435,_0x2b21be;if(_0xf60267)_0x2b21be=_0xf60267;else!_0x3a4b5e&&(_0x2b21be=loadLastChatId(),_0x2b21be&&_0x58fa72[_0x268b05(0xb8)]&&console[_0x268b05(0xa0)](_0x268b05(0x70)+_0x2b21be));!_0xf60267&&(_0x3a4b5e||!_0x2b21be)&&(_0x9b435=await resolveAgentId(_0x56f2bc,_0x32efc4,_0x5796b2,_0x5cd534,_0x58fa72[_0x268b05(0xb8)]));const _0x1443a8=_0x1e5d11?(_0x1de824,_0x1981fd,_0x1d9efa)=>this[_0x268b05(0x7c)](_0x56f2bc,_0x1de824,_0x1981fd,_0x1d9efa):(_0x3defca,_0x1be75c,_0x1eac9c)=>this[_0x268b05(0x73)](_0x56f2bc,_0x3defca,_0x1be75c,_0x1eac9c,_0x58fa72[_0x268b05(0xb8)]);try{await _0x1443a8(_0x567be6,_0x9b435,_0x2b21be);}catch(_0x29c036){const _0x4bc7e8=_0x29c036 instanceof SDKError&&_0x29c036['code']===ErrorCode['CHAT_NOT_FOUND']||_0x29c036 instanceof Error&&_0x29c036[_0x268b05(0x79)][_0x268b05(0xae)]('404');if(_0x4bc7e8&&_0xf60267)return console[_0x268b05(0xa0)](_0x268b05(0x9a)+_0xf60267+_0x268b05(0xa5)),0x1;if(_0x4bc7e8)_0x58fa72[_0x268b05(0xb8)]&&console[_0x268b05(0xa0)]('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x9b435&&(_0x9b435=await resolveAgentId(_0x56f2bc,_0x32efc4,_0x5796b2,_0x5cd534,_0x58fa72['verbose'])),await _0x1443a8(_0x567be6,_0x9b435,undefined);else throw _0x29c036;}return!_0x1e5d11&&console[_0x268b05(0x9f)](),0x0;}catch(_0x427b77){return console[_0x268b05(0xa0)](),handleSDKError(_0x427b77,_0x58fa72),0x1;}}[a8_0x3dc73a(0x84)](_0x182d07){const _0x56af63=a8_0x3dc73a;if(_0x56af63(0x7d)in _0x182d07)process[_0x56af63(0x89)][_0x56af63(0x7f)](_0x182d07[_0x56af63(0x7d)]);else'error'in _0x182d07&&console['error'](_0x56af63(0x90)+_0x182d07[_0x56af63(0xa0)]);}}export class ChatCreateCommand extends BaseCommand{['name']=a8_0x3dc73a(0x9c);[a8_0x3dc73a(0x8a)]=a8_0x3dc73a(0x6e);[a8_0x3dc73a(0xb1)](_0x502be5){const _0x4024f4=a8_0x3dc73a,_0x230760=_0x502be5[_0x4024f4(0xa4)],_0x22e46b=_0x230760[_0x4024f4(0x9b)],_0x7a7aa3=_0x230760['llmAgent'];if(!_0x22e46b&&!_0x7a7aa3)return _0x4024f4(0x7e);return undefined;}async[a8_0x3dc73a(0x74)](_0x34970a){const _0x90a698=a8_0x3dc73a,{options:_0x26b25c,tdx:_0xd51064}=_0x34970a,_0xfd7018=_0x26b25c,_0x5ccde6=_0xfd7018['agent'],_0x34ea40=_0xfd7018[_0x90a698(0x99)],_0x38dabd=_0xfd7018['llmProject'];try{const _0x490aac=await resolveAgentId(_0xd51064,_0x5ccde6,_0x34ea40,_0x38dabd,_0x26b25c[_0x90a698(0xb8)]),_0x2cdee8=await _0xd51064[_0x90a698(0xa1)][_0x90a698(0x85)](_0x490aac);return saveLastChatId(_0x2cdee8['id']),console['log'](JSON[_0x90a698(0x88)]({'chatId':_0x2cdee8['id'],'agentId':_0x490aac})),0x0;}catch(_0x3e358e){return handleSDKError(_0x3e358e,_0x26b25c),0x1;}}}
|
|
1
|
+
const a8_0x4d9afb=a8_0x40dc;(function(_0x5c923d,_0x4accbe){const _0x2d47ba=a8_0x40dc,_0x4d8438=_0x5c923d();while(!![]){try{const _0x24d043=-parseInt(_0x2d47ba(0x153))/0x1+-parseInt(_0x2d47ba(0x144))/0x2*(-parseInt(_0x2d47ba(0x122))/0x3)+parseInt(_0x2d47ba(0x14e))/0x4*(-parseInt(_0x2d47ba(0x152))/0x5)+-parseInt(_0x2d47ba(0x130))/0x6+parseInt(_0x2d47ba(0x158))/0x7+-parseInt(_0x2d47ba(0x118))/0x8+parseInt(_0x2d47ba(0x150))/0x9*(parseInt(_0x2d47ba(0x133))/0xa);if(_0x24d043===_0x4accbe)break;else _0x4d8438['push'](_0x4d8438['shift']());}catch(_0x3dd696){_0x4d8438['push'](_0x4d8438['shift']());}}}(a8_0x247d,0x87474));import{BaseCommand}from'./command.js';function a8_0x40dc(_0x28be79,_0x295403){_0x28be79=_0x28be79-0x10b;const _0x247d71=a8_0x247d();let _0x40dcaf=_0x247d71[_0x28be79];return _0x40dcaf;}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(_0x3e1be4,_0x3b2c2d){const _0x19ef54=a8_0x40dc;if(_0x3e1be4 instanceof SDKError)console[_0x19ef54(0x13e)]('Error:\x20'+_0x3e1be4[_0x19ef54(0x13b)]),_0x3b2c2d[_0x19ef54(0x12b)]&&(_0x3e1be4[_0x19ef54(0x13a)]&&console['error']('\x20\x20Cause:\x20'+_0x3e1be4[_0x19ef54(0x13a)]),_0x3e1be4[_0x19ef54(0x123)]&&(console['error'](_0x19ef54(0x155)),console['error'](_0x3e1be4[_0x19ef54(0x123)])));else throw _0x3e1be4;}async function resolveAgentId(_0x3c00b9,_0x13a78d,_0x26166c,_0x1b85ae,_0x32d897){const _0x16a3ff=a8_0x40dc,_0x52d556=_0x13a78d||_0x26166c;if(_0x52d556){const {projectName:_0x41dfe9,agentName:_0x434012}=parseAgentRef(_0x52d556),_0x25c5ab=_0x434012||_0x52d556,_0x3f5f66=_0x434012?_0x41dfe9:_0x1b85ae;if(!_0x3f5f66)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x32d897){const _0x4d2ae8=_0x13a78d?'--agent\x20flag':_0x16a3ff(0x12a);console['error'](_0x16a3ff(0x11d)+_0x4d2ae8+':\x20'+_0x3f5f66+'/'+_0x25c5ab);}const _0x59029e=await withSpinner('Resolving\x20project\x20\x27'+_0x3f5f66+_0x16a3ff(0x11f),()=>_0x3c00b9[_0x16a3ff(0x12e)][_0x16a3ff(0x146)](_0x3f5f66),{'verbose':_0x32d897}),_0x49ac37=await withSpinner(_0x16a3ff(0x121)+_0x25c5ab+_0x16a3ff(0x11f),()=>_0x3c00b9[_0x16a3ff(0x12e)][_0x16a3ff(0x143)](_0x25c5ab,_0x59029e[_0x16a3ff(0x129)]),{'verbose':_0x32d897});return _0x49ac37[_0x16a3ff(0x129)];}else{const _0xa3ba4c=_0x3c00b9[_0x16a3ff(0x12e)][_0x16a3ff(0x128)]();if(_0xa3ba4c)return _0x32d897&&console[_0x16a3ff(0x13e)](_0x16a3ff(0x114)+_0xa3ba4c[_0x16a3ff(0x10e)]),_0xa3ba4c['id'];const _0x327671=await withSpinner(_0x16a3ff(0x127),()=>_0x3c00b9[_0x16a3ff(0x12e)][_0x16a3ff(0x137)](_0x16a3ff(0x132),0x0),{'verbose':_0x32d897});return _0x327671[_0x16a3ff(0x129)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x4d9afb(0x10e)]='chat';[a8_0x4d9afb(0x139)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x4d9afb(0x151)](_0x3ac719){const _0x3ea475=a8_0x4d9afb,_0x2adc04=_0x3ac719['args'][_0x3ea475(0x116)]('\x20');if(!_0x2adc04)return _0x3ea475(0x11b);return undefined;}async[a8_0x4d9afb(0x148)](_0x55cc8c,_0x1687dc,_0x2de5ba,_0x15a4f9,_0xf6b692){const _0x4bf8f5=a8_0x4d9afb;for await(const _0x14684e of _0x55cc8c[_0x4bf8f5(0x12e)][_0x4bf8f5(0x149)](_0x1687dc,{'agentId':_0x2de5ba,'chatId':_0x15a4f9})){if(_0x14684e[_0x4bf8f5(0x115)]===_0x4bf8f5(0x135)){const _0x559e27=_0x14684e[_0x4bf8f5(0x129)]['chatId'];saveLastChatId(_0x559e27),_0xf6b692&&console[_0x4bf8f5(0x13e)](_0x4bf8f5(0x112)+_0x559e27);}else _0x14684e[_0x4bf8f5(0x115)]==='event'&&this[_0x4bf8f5(0x12f)](_0x14684e[_0x4bf8f5(0x129)]);}}async['streamChatJsonl'](_0x4487a9,_0x2ceec0,_0x7ef455,_0x2d8684){const _0x27dba9=a8_0x4d9afb,_0x1d6a08=_0x4487a9[_0x27dba9(0x10b)][_0x27dba9(0x11a)];let _0x1161e9=![];for await(const _0x58dcb4 of _0x4487a9[_0x27dba9(0x12e)][_0x27dba9(0x149)](_0x2ceec0,{'agentId':_0x7ef455,'chatId':_0x2d8684})){if(_0x58dcb4[_0x27dba9(0x115)]===_0x27dba9(0x135)){const _0x53a97b=_0x58dcb4[_0x27dba9(0x129)];saveLastChatId(_0x53a97b[_0x27dba9(0x125)]);const _0x338c29=_0x53a97b['projectId']&&_0x53a97b[_0x27dba9(0x124)]?getLLMConversationUrl(_0x1d6a08,_0x53a97b[_0x27dba9(0x120)],_0x53a97b[_0x27dba9(0x124)],_0x53a97b['chatId']):undefined;console[_0x27dba9(0x11e)](JSON['stringify']({'type':_0x27dba9(0x135),'data':{'chatId':_0x53a97b[_0x27dba9(0x125)],'agentId':_0x53a97b[_0x27dba9(0x124)],'consoleUrl':_0x338c29}})),_0x1161e9=!![];}else{if(_0x58dcb4[_0x27dba9(0x115)]==='event'){!_0x1161e9&&_0x2d8684&&(console[_0x27dba9(0x11e)](JSON['stringify']({'type':'metadata','data':{'chatId':_0x2d8684}})),_0x1161e9=!![]);const _0x3a842e=_0x58dcb4[_0x27dba9(0x129)];if(_0x27dba9(0x111)in _0x3a842e)console[_0x27dba9(0x11e)](JSON[_0x27dba9(0x13c)]({'type':_0x27dba9(0x111),'data':{'content':_0x3a842e[_0x27dba9(0x111)]}}));else{if(_0x27dba9(0x119)in _0x3a842e){const _0x15ac58=_0x3a842e[_0x27dba9(0x119)];console[_0x27dba9(0x11e)](JSON[_0x27dba9(0x13c)]({'type':'tool_call','data':{'id':_0x15ac58['id'],'name':_0x15ac58['functionName'],'target':_0x15ac58[_0x27dba9(0x110)]?.[_0x27dba9(0x10e)]||_0x15ac58[_0x27dba9(0x14f)]?.[_0x27dba9(0x10e)]||_0x15ac58['targetWebSearchTool']?.[_0x27dba9(0x10e)]||_0x15ac58[_0x27dba9(0x142)]}}));}else{if(_0x27dba9(0x14d)in _0x3a842e)console[_0x27dba9(0x11e)](JSON[_0x27dba9(0x13c)]({'type':_0x27dba9(0x10c),'data':{'id':_0x3a842e['tool']['id'],'name':_0x3a842e['tool'][_0x27dba9(0x11c)],'result':typeof _0x3a842e['tool'][_0x27dba9(0x111)]===_0x27dba9(0x140)?_0x3a842e[_0x27dba9(0x14d)]['content'][_0x27dba9(0x14b)](0x0,0x1f4):''}}));else _0x27dba9(0x13e)in _0x3a842e&&console[_0x27dba9(0x11e)](JSON[_0x27dba9(0x13c)]({'type':_0x27dba9(0x13e),'data':{'error':_0x3a842e[_0x27dba9(0x13e)]}}));}}}}}console[_0x27dba9(0x11e)](JSON[_0x27dba9(0x13c)]({'type':_0x27dba9(0x10d)}));}async[a8_0x4d9afb(0x134)](_0x2560c9){const _0x2b00cf=a8_0x4d9afb,{options:_0x17b9dc,args:_0x397cdc,tdx:_0x1271d8}=_0x2560c9,_0x4cf084=_0x397cdc[_0x2b00cf(0x116)]('\x20'),_0x4ad283=_0x17b9dc,_0x3b1597=_0x4ad283[_0x2b00cf(0x157)],_0x555c68=_0x4ad283[_0x2b00cf(0x117)],_0x3950fd=_0x4ad283[_0x2b00cf(0x12d)],_0x3dd6f2=_0x4ad283[_0x2b00cf(0x131)],_0x251b4f=_0x4ad283['chatId'],_0x14a268=_0x4ad283['stream'];if(_0x3dd6f2&&_0x251b4f)return console[_0x2b00cf(0x13e)]('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x5293f9,_0x1c6430;if(_0x251b4f)_0x1c6430=_0x251b4f;else!_0x3dd6f2&&(_0x1c6430=loadLastChatId(),_0x1c6430&&_0x17b9dc[_0x2b00cf(0x12b)]&&console[_0x2b00cf(0x13e)](_0x2b00cf(0x12c)+_0x1c6430));!_0x251b4f&&(_0x3dd6f2||!_0x1c6430)&&(_0x5293f9=await resolveAgentId(_0x1271d8,_0x3b1597,_0x555c68,_0x3950fd,_0x17b9dc[_0x2b00cf(0x12b)]));const _0x1a4d18=_0x14a268?(_0x21b853,_0x40d702,_0x3388d1)=>this[_0x2b00cf(0x141)](_0x1271d8,_0x21b853,_0x40d702,_0x3388d1):(_0x34e655,_0x27acda,_0x47d3cf)=>this['streamChat'](_0x1271d8,_0x34e655,_0x27acda,_0x47d3cf,_0x17b9dc[_0x2b00cf(0x12b)]);try{await _0x1a4d18(_0x4cf084,_0x5293f9,_0x1c6430);}catch(_0x5ae42b){const _0x4881a0=_0x5ae42b instanceof SDKError&&_0x5ae42b['code']===ErrorCode[_0x2b00cf(0x10f)]||_0x5ae42b instanceof Error&&_0x5ae42b[_0x2b00cf(0x13b)]['includes'](_0x2b00cf(0x14c));if(_0x4881a0&&_0x251b4f)return console[_0x2b00cf(0x13e)](_0x2b00cf(0x154)+_0x251b4f+_0x2b00cf(0x138)),0x1;if(_0x4881a0)_0x17b9dc[_0x2b00cf(0x12b)]&&console[_0x2b00cf(0x13e)](_0x2b00cf(0x147)),!_0x5293f9&&(_0x5293f9=await resolveAgentId(_0x1271d8,_0x3b1597,_0x555c68,_0x3950fd,_0x17b9dc[_0x2b00cf(0x12b)])),await _0x1a4d18(_0x4cf084,_0x5293f9,undefined);else throw _0x5ae42b;}return!_0x14a268&&console[_0x2b00cf(0x11e)](),0x0;}catch(_0x6d9f4b){return console[_0x2b00cf(0x13e)](),handleSDKError(_0x6d9f4b,_0x17b9dc),0x1;}}[a8_0x4d9afb(0x12f)](_0x12dad1){const _0xf401a2=a8_0x4d9afb;if(_0xf401a2(0x111)in _0x12dad1)process[_0xf401a2(0x13f)][_0xf401a2(0x113)](_0x12dad1[_0xf401a2(0x111)]);else'error'in _0x12dad1&&console['error'](_0xf401a2(0x145)+_0x12dad1['error']);}}function a8_0x247d(){const _0x5c2967=['chat-create','agent','2011772IOSTeL','context','tool_result','done','name','CHAT_NOT_FOUND','targetKnowledgeBase','content','Chat\x20session:\x20','write','Using\x20cached\x20default\x20agent:\x20','type','join','llmAgent','2845392QQwOyF','tool_call','site','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','functionName','Using\x20agent\x20from\x20','log','\x27...','projectId','Resolving\x20agent\x20\x27','6xsnIoM','stack','agentId','chatId','options','Getting\x20default\x20agent...','getDefaultAgent','data','session\x20context','verbose','Continuing\x20chat:\x20','llmProject','llm','handleChatEvent','3879768GEnUmb','new','claude-4.5-haiku','6430qgsrwm','execute','metadata','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','getOrCreateDefaultAgent','\x27\x20not\x20found','description','cause','message','stringify','Create\x20a\x20new\x20chat\x20session','error','stdout','string','streamChatJsonl','targetFunction','resolveAgentId','604848iYEnEu','\x0aError:\x20','resolveProjectId','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','streamChat','chat','startChat','slice','404','tool','92eSUusa','targetAgent','22878iryWgq','validate','45260rysEnm','762152ETuEdM','Error:\x20Chat\x20session\x20\x27','\x0aStack\x20trace:'];a8_0x247d=function(){return _0x5c2967;};return a8_0x247d();}export class ChatCreateCommand extends BaseCommand{[a8_0x4d9afb(0x10e)]=a8_0x4d9afb(0x156);[a8_0x4d9afb(0x139)]=a8_0x4d9afb(0x13d);[a8_0x4d9afb(0x151)](_0xbcd7a2){const _0x1ed22a=a8_0x4d9afb,_0x1f8233=_0xbcd7a2[_0x1ed22a(0x126)],_0x2c18a9=_0x1f8233[_0x1ed22a(0x157)],_0x2749c2=_0x1f8233['llmAgent'];if(!_0x2c18a9&&!_0x2749c2)return _0x1ed22a(0x136);return undefined;}async[a8_0x4d9afb(0x134)](_0x4b19d9){const _0x2a7164=a8_0x4d9afb,{options:_0x4699fa,tdx:_0x4ba69c}=_0x4b19d9,_0x4373f6=_0x4699fa,_0x317a59=_0x4373f6[_0x2a7164(0x157)],_0x443cee=_0x4373f6[_0x2a7164(0x117)],_0x1b7111=_0x4373f6[_0x2a7164(0x12d)];try{const _0x55da56=await resolveAgentId(_0x4ba69c,_0x317a59,_0x443cee,_0x1b7111,_0x4699fa[_0x2a7164(0x12b)]),_0x5e0815=await _0x4ba69c[_0x2a7164(0x12e)][_0x2a7164(0x14a)](_0x55da56);return saveLastChatId(_0x5e0815['id']),console['log'](JSON['stringify']({'chatId':_0x5e0815['id'],'agentId':_0x55da56})),0x0;}catch(_0x1765b4){return handleSDKError(_0x1765b4,_0x4699fa),0x1;}}}
|