@treasuredata/tdx 0.29.1 → 0.29.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.d.ts +1 -2
- package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.d.ts +13 -6
- package/dist/sdk/segment/journey-validator.d.ts.map +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-validator.js.map +1 -1
- package/dist/sdk/segment/journey-yaml.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.js +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/segment-validator.d.ts.map +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/segment-validator.js.map +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.d.ts +184 -0
- package/dist/sdk/segment/types/activation-schema.d.ts.map +1 -0
- package/dist/sdk/segment/types/activation-schema.js +1 -0
- package/dist/sdk/segment/types/activation-schema.js.map +1 -0
- package/dist/sdk/segment/types/journey-def.d.ts +5 -0
- package/dist/sdk/segment/types/journey-def.d.ts.map +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-def.js.map +1 -1
- package/dist/sdk/segment/types/journey-schema.d.ts +419 -0
- package/dist/sdk/segment/types/journey-schema.d.ts.map +1 -0
- package/dist/sdk/segment/types/journey-schema.js +1 -0
- package/dist/sdk/segment/types/journey-schema.js.map +1 -0
- package/dist/sdk/segment/types/segment-def.d.ts +4 -87
- package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-def.js.map +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/validate-files.js.map +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts +14 -1
- 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.js +1 -1
- package/dist/sdk/types/cdp.d.ts +3 -3
- 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/file-reader.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x3e89a1=a3_0x6261;function a3_0x17a8(){const _0x37e60a=['Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','\x20\x20Cause:\x20','15657378xaVjcf','error','2293736ICRMSw','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','225371PWxXxi','8AdpFMy','cause','resolveParentId','Resolved\x20child\x20ID:\x20','872682ZEshMa','21777hXIfoW','\x27...','activations','387jucKvJ','verbose','Parent\x20name:\x20','List\x20activations\x20for\x20a\x20segment','Error:\x20','\x20activation','description','length','execute','447495lLYfPP','6yMBprH','data','Site:\x20','21410fDIKkk','Listing\x20activations\x20for\x20segment\x20\x27','1974xRsfTz','name','site','Error:\x20Segment\x20name\x20is\x20required','segment'];a3_0x17a8=function(){return _0x37e60a;};return a3_0x17a8();}(function(_0x2f7b96,_0x3cf125){const _0x3ce76f=a3_0x6261,_0x2649f5=_0x2f7b96();while(!![]){try{const _0x461b6c=parseInt(_0x3ce76f(0xea))/0x1*(-parseInt(_0x3ce76f(0xda))/0x2)+parseInt(_0x3ce76f(0xef))/0x3+-parseInt(_0x3ce76f(0xeb))/0x4*(-parseInt(_0x3ce76f(0xd9))/0x5)+parseInt(_0x3ce76f(0xdf))/0x6*(-parseInt(_0x3ce76f(0xf0))/0x7)+parseInt(_0x3ce76f(0xe8))/0x8+-parseInt(_0x3ce76f(0xf3))/0x9*(-parseInt(_0x3ce76f(0xdd))/0xa)+parseInt(_0x3ce76f(0xe6))/0xb;if(_0x461b6c===_0x3cf125)break;else _0x2649f5['push'](_0x2649f5['shift']());}catch(_0x27859c){_0x2649f5['push'](_0x2649f5['shift']());}}}(a3_0x17a8,0x8bc16));import{BaseCommand}from'./command.js';function a3_0x6261(_0x333d9c,_0x27a6f0){_0x333d9c=_0x333d9c-0xd3;const _0x17a83e=a3_0x17a8();let _0x6261ac=_0x17a83e[_0x333d9c];return _0x6261ac;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x3e89a1(0xe0)]=a3_0x3e89a1(0xf2);[a3_0x3e89a1(0xd6)]=a3_0x3e89a1(0xd3);async[a3_0x3e89a1(0xd8)](_0x41eb95){const _0x55d063=a3_0x3e89a1,{options:_0x16bc3d,args:_0x3adb83,tdx:_0x337cb0}=_0x41eb95;if(_0x3adb83['length']===0x0)return console[_0x55d063(0xe7)](_0x55d063(0xe2)),console['error'](_0x55d063(0xe9)),0x1;try{const {parentId:_0x424b11,childId:_0xeff5dc}=parseSegmentRef(_0x3adb83[0x0]);if(!_0xeff5dc)return console[_0x55d063(0xe7)](_0x55d063(0xe4)),console['error'](_0x55d063(0xe9)),0x1;_0x16bc3d[_0x55d063(0xf4)]&&(console[_0x55d063(0xe7)](_0x55d063(0xdc)+_0x16bc3d[_0x55d063(0xe1)]),console[_0x55d063(0xe7)](_0x55d063(0xf5)+_0x424b11),console['error']('Child\x20name:\x20'+_0xeff5dc));const _0xb78c1b=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x424b11+_0x55d063(0xf1),()=>_0x337cb0[_0x55d063(0xe3)][_0x55d063(0xed)](_0x424b11),{'verbose':_0x16bc3d['verbose']}),_0x1c7d83=_0xb78c1b['data'];_0x16bc3d[_0x55d063(0xf4)]&&console[_0x55d063(0xe7)]('Resolved\x20parent\x20ID:\x20'+_0x1c7d83);const _0x553a8f=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0xeff5dc+'\x27...',()=>_0x337cb0[_0x55d063(0xe3)]['resolveSegmentId'](_0x1c7d83,_0xeff5dc),{'verbose':_0x16bc3d[_0x55d063(0xf4)]}),_0x3ec06b=_0x553a8f[_0x55d063(0xdb)];_0x16bc3d[_0x55d063(0xf4)]&&console[_0x55d063(0xe7)](_0x55d063(0xee)+_0x3ec06b);const _0x54ede5=await withSpinner(_0x55d063(0xde)+_0xeff5dc+'\x27...',()=>_0x337cb0[_0x55d063(0xe3)]['listActivations'](_0x1c7d83,_0x3ec06b),{'verbose':_0x16bc3d[_0x55d063(0xf4)]}),_0x46580f=_0x54ede5[_0x55d063(0xdb)];return console['error']('✔\x20Found\x20'+_0x46580f[_0x55d063(0xd7)]+_0x55d063(0xd5)+(_0x46580f[_0x55d063(0xd7)]!==0x1?'s':'')),await handleSDKOutput(_0x46580f,_0x16bc3d),0x0;}catch(_0x44e244){if(_0x44e244 instanceof SDKError)return console[_0x55d063(0xe7)](_0x55d063(0xd4)+_0x44e244['message']),_0x44e244['cause']&&console[_0x55d063(0xe7)](_0x55d063(0xe5)+_0x44e244[_0x55d063(0xec)]),0x1;throw _0x44e244;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x46ea57=a4_0xb5f9;(function(_0x10b208,_0x3c4caf){const _0x45c9fe=a4_0xb5f9,_0x31377a=_0x10b208();while(!![]){try{const _0x25270e=-parseInt(_0x45c9fe(0x263))/0x1*(-parseInt(_0x45c9fe(0x264))/0x2)+-parseInt(_0x45c9fe(0x253))/0x3+parseInt(_0x45c9fe(0x215))/0x4+parseInt(_0x45c9fe(0x1fa))/0x5*(-parseInt(_0x45c9fe(0x1ee))/0x6)+parseInt(_0x45c9fe(0x1ef))/0x7+parseInt(_0x45c9fe(0x1ed))/0x8+-parseInt(_0x45c9fe(0x1de))/0x9;if(_0x25270e===_0x3c4caf)break;else _0x31377a['push'](_0x31377a['shift']());}catch(_0x5cca0e){_0x31377a['push'](_0x31377a['shift']());}}}(a4_0x392f,0x1af0c));import a4_0x5b7797 from'chalk';import a4_0xd83b37 from'path';import{existsSync,readFileSync}from'fs';function a4_0xb5f9(_0x1fe491,_0x1ddef5){_0x1fe491=_0x1fe491-0x1c6;const _0x392fb4=a4_0x392f();let _0xb5f944=_0x392fb4[_0x1fe491];return _0xb5f944;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x338ba6){const _0x38fa14=a4_0xb5f9,_0x5c869d=[];if(_0x338ba6[_0x38fa14(0x1fe)]!==undefined)_0x5c869d[_0x38fa14(0x1f5)](_0x338ba6['total']+_0x38fa14(0x268));if(_0x338ba6['new']!==undefined&&_0x338ba6[_0x38fa14(0x20d)]>0x0)_0x5c869d[_0x38fa14(0x1f5)](a4_0x5b7797[_0x38fa14(0x260)](_0x338ba6[_0x38fa14(0x20d)]+_0x38fa14(0x214)));if(_0x338ba6[_0x38fa14(0x259)]!==undefined&&_0x338ba6[_0x38fa14(0x259)]>0x0)_0x5c869d[_0x38fa14(0x1f5)](a4_0x5b7797['green'](_0x338ba6[_0x38fa14(0x259)]+_0x38fa14(0x1d3)));if(_0x338ba6[_0x38fa14(0x246)]!==undefined&&_0x338ba6[_0x38fa14(0x246)]>0x0)_0x5c869d['push'](a4_0x5b7797[_0x38fa14(0x221)](_0x338ba6['updated']+_0x38fa14(0x270)));if(_0x338ba6[_0x38fa14(0x258)]!==undefined&&_0x338ba6['unchanged']>0x0)_0x5c869d[_0x38fa14(0x1f5)](a4_0x5b7797[_0x38fa14(0x21c)](_0x338ba6[_0x38fa14(0x258)]+_0x38fa14(0x26a)));if(_0x338ba6[_0x38fa14(0x1d0)]!==undefined&&_0x338ba6[_0x38fa14(0x1d0)]>0x0)_0x5c869d[_0x38fa14(0x1f5)](a4_0x5b7797[_0x38fa14(0x1cf)](_0x338ba6[_0x38fa14(0x1d0)]+'\x20errors'));return _0x5c869d[_0x38fa14(0x272)](',\x20');}function displayDiffs(_0x3b090f,_0x587a01,_0x2a905d,_0x33669a,_0x1b52e9,_0x319bfe,_0x334c0f){const _0x5e0ccc=a4_0xb5f9;for(const _0x228d59 of _0x3b090f){if(_0x228d59[_0x5e0ccc(0x1ea)]){const _0x75a52a=_0x228d59[_0x5e0ccc(0x26b)]||_0x228d59[_0x5e0ccc(0x1d8)];console['log'](_0x5e0ccc(0x1fd)+_0x75a52a+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x5e0ccc(0x216)](_0x228d59['diff']),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c));}}for(const _0x3776a5 of _0x587a01){_0x3776a5[_0x5e0ccc(0x1ea)]&&(console['log']('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x3776a5[_0x5e0ccc(0x1d8)]+'\x27:'),console['log']('─'[_0x5e0ccc(0x26d)](0x3c)),console[_0x5e0ccc(0x216)](_0x3776a5[_0x5e0ccc(0x1ea)]),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c)));}for(const _0x40f4c3 of _0x2a905d){_0x40f4c3['diff']&&(console[_0x5e0ccc(0x216)](_0x5e0ccc(0x209)+_0x40f4c3[_0x5e0ccc(0x1d8)]+'\x27:'),console['log']('─'[_0x5e0ccc(0x26d)](0x3c)),console['log'](_0x40f4c3[_0x5e0ccc(0x1ea)]),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c)));}for(const _0x1f749b of _0x33669a){_0x1f749b[_0x5e0ccc(0x1ea)]&&(console[_0x5e0ccc(0x216)](_0x5e0ccc(0x1f6)+_0x1f749b[_0x5e0ccc(0x1d8)]+'\x27:'),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c)),console[_0x5e0ccc(0x216)](_0x1f749b['diff']),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c)));}for(const _0x597359 of _0x1b52e9){_0x597359[_0x5e0ccc(0x1ea)]&&(console[_0x5e0ccc(0x216)](_0x5e0ccc(0x282)+_0x597359['name']+'\x27:'),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c)),console[_0x5e0ccc(0x216)](_0x597359['diff']),console['log']('─'[_0x5e0ccc(0x26d)](0x3c)));}for(const _0x3f4f5b of _0x319bfe){_0x3f4f5b[_0x5e0ccc(0x1ea)]&&(console[_0x5e0ccc(0x216)](_0x5e0ccc(0x222)+_0x3f4f5b['name']+'\x27:'),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c)),console[_0x5e0ccc(0x216)](_0x3f4f5b[_0x5e0ccc(0x1ea)]),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c)));}for(const _0x473028 of _0x334c0f){_0x473028['diff']&&(console[_0x5e0ccc(0x216)](_0x5e0ccc(0x1e6)+_0x473028['name']+'\x27:'),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c)),console[_0x5e0ccc(0x216)](_0x473028['diff']),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x46ea57(0x1d8)]=a4_0x46ea57(0x1d2);[a4_0x46ea57(0x206)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0x1e6ada){const _0x3674c7=a4_0x46ea57,{options:_0x4bc64d,args:_0x4a61b1,tdx:_0x5141e8}=_0x1e6ada,_0x3e5fc6=_0x4a61b1[0x0],_0xb5c4ba=_0x4a61b1[0x1],_0x3ec4f9=_0x4bc64d[_0x3674c7(0x27b)],_0x4876a2=_0x4bc64d['dryRun'],_0xb89f36=_0x4bc64d[_0x3674c7(0x1d4)],_0x3aaed5=_0x4bc64d['yes'],_0x4b4b2c=_0x4bc64d[_0x3674c7(0x21d)],_0x5eda98=_0x4bc64d[_0x3674c7(0x23e)];let _0x3cfbe5;if(_0x3e5fc6){const _0x45b8b8=a4_0xd83b37['join'](_0x3e5fc6,_0x3674c7(0x238));if(existsSync(_0x45b8b8))try{const _0x1d28c9=JSON[_0x3674c7(0x276)](readFileSync(_0x45b8b8,_0x3674c7(0x200)));_0x1d28c9[_0x3674c7(0x213)]&&(_0x3cfbe5={'llm_project':_0x1d28c9[_0x3674c7(0x213)]});}catch{}}const _0x445c51=findAgentConfigPath(process[_0x3674c7(0x25c)]());let _0x5ed261;if(_0x445c51)try{const _0x4570b5=JSON[_0x3674c7(0x276)](readFileSync(_0x445c51,'utf-8'));_0x4570b5[_0x3674c7(0x213)]&&(_0x5ed261={'llm_project':_0x4570b5[_0x3674c7(0x213)]});}catch{}const _0x219559=resolveAgentPullArgs({'arg':_0x3e5fc6,'agentNameArg':_0xb5c4ba,'agentFlag':_0x5eda98,'contextProject':_0x4b4b2c,'argDirConfig':_0x3cfbe5,'cwdConfigPath':_0x445c51||undefined,'cwdConfig':_0x5ed261}),{projectNameOrId:_0x5e7546,targetAgentName:_0x3c090e,existingOutputDir:_0x3a0e2e,source:_0x2ae868}=_0x219559;if(_0x2ae868===_0x3674c7(0x256))console['log'](a4_0x5b7797[_0x3674c7(0x1e1)](_0x3674c7(0x1d7)+a4_0xd83b37[_0x3674c7(0x272)](_0x3e5fc6,_0x3674c7(0x238))+':\x20'+_0x5e7546));else{if(_0x2ae868===_0x3674c7(0x1fc))console[_0x3674c7(0x216)](a4_0x5b7797[_0x3674c7(0x1e1)](_0x3674c7(0x255)+_0x5e7546));else _0x2ae868===_0x3674c7(0x257)&&console[_0x3674c7(0x216)](a4_0x5b7797[_0x3674c7(0x1e1)](_0x3674c7(0x23f)+_0x5e7546));}if(!_0x5e7546)return _0x5eda98?(console[_0x3674c7(0x216)](a4_0x5b7797['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console['log'](_0x3674c7(0x1e9)),console[_0x3674c7(0x216)](_0x3674c7(0x278))):(console['log'](a4_0x5b7797[_0x3674c7(0x221)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x3674c7(0x216)](_0x3674c7(0x21b)),console[_0x3674c7(0x216)](_0x3674c7(0x1ce)),console[_0x3674c7(0x216)](_0x3674c7(0x1f8)),console[_0x3674c7(0x216)](_0x3674c7(0x231)),console['log'](_0x3674c7(0x224))),0x1;if(_0x3c090e){const {data:_0x467ac5}=await withSpinner('Pulling\x20agent\x20\x22'+_0x3c090e+_0x3674c7(0x250)+_0x5e7546+_0x3674c7(0x241),()=>_0x5141e8[_0x3674c7(0x23a)][_0x3674c7(0x1cb)](_0x5e7546,_0x3c090e,_0x3ec4f9,{'dryRun':_0x4876a2,'force':_0xb89f36}));if(_0x4876a2)return console[_0x3674c7(0x216)](a4_0x5b7797[_0x3674c7(0x221)](_0x3674c7(0x265))),console[_0x3674c7(0x216)]('Would\x20pull\x20agent:\x20'+_0x467ac5[_0x3674c7(0x26b)]),console[_0x3674c7(0x216)](_0x3674c7(0x24d)+_0x467ac5['outputPath']),_0x467ac5[_0x3674c7(0x1ea)]&&(console[_0x3674c7(0x216)](_0x3674c7(0x240)),console[_0x3674c7(0x216)]('─'[_0x3674c7(0x26d)](0x3c)),console[_0x3674c7(0x216)](_0x467ac5[_0x3674c7(0x1ea)]),console['log']('─'['repeat'](0x3c))),0x0;return console[_0x3674c7(0x216)](a4_0x5b7797[_0x3674c7(0x260)]('Agent\x20pulled\x20successfully')),console[_0x3674c7(0x216)](_0x3674c7(0x20c)+_0x467ac5['agentName']),console[_0x3674c7(0x216)](_0x3674c7(0x267)+_0x467ac5[_0x3674c7(0x1eb)]),console['log']('Status:\x20'+(_0x467ac5[_0x3674c7(0x1e5)]?a4_0x5b7797[_0x3674c7(0x260)](_0x3674c7(0x20d)):_0x467ac5[_0x3674c7(0x273)]?a4_0x5b7797[_0x3674c7(0x221)](_0x3674c7(0x246)):a4_0x5b7797[_0x3674c7(0x21c)](_0x3674c7(0x258)))),0x0;}const _0x2c13df=_0x3a0e2e||_0x3ec4f9,{data:_0x198925}=await withSpinner(_0x3674c7(0x1c7)+_0x5e7546+_0x3674c7(0x241),()=>_0x5141e8[_0x3674c7(0x23a)][_0x3674c7(0x244)](_0x5e7546,_0x2c13df,{'dryRun':!![]})),_0x1de87d=_0x198925[_0x3674c7(0x275)][_0x3674c7(0x203)]['new']+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x1da)][_0x3674c7(0x20d)]+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x23b)]['new']+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x1ff)]['new']+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x26e)][_0x3674c7(0x20d)]+_0x198925['counts'][_0x3674c7(0x207)][_0x3674c7(0x20d)]+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x211)]['new'],_0x54e42f=_0x198925[_0x3674c7(0x275)]['agents'][_0x3674c7(0x246)]+_0x198925[_0x3674c7(0x275)]['knowledgeBases'][_0x3674c7(0x246)]+_0x198925[_0x3674c7(0x275)]['textKnowledgeBases'][_0x3674c7(0x246)]+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x1ff)]['updated']+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x26e)][_0x3674c7(0x246)]+_0x198925[_0x3674c7(0x275)]['experimentalKnowledgeBases'][_0x3674c7(0x246)]+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x211)]['updated'],_0x1fc6d5=_0x198925['counts']['agents'][_0x3674c7(0x258)]+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x1da)]['unchanged']+_0x198925[_0x3674c7(0x275)]['textKnowledgeBases'][_0x3674c7(0x258)]+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x1ff)][_0x3674c7(0x258)]+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x26e)][_0x3674c7(0x258)]+_0x198925['counts'][_0x3674c7(0x207)][_0x3674c7(0x258)]+_0x198925[_0x3674c7(0x275)]['experimentalArtifacts'][_0x3674c7(0x258)];console['log'](_0x3674c7(0x27f)+_0x198925['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x5b7797['green']('+\x20'+_0x1de87d+'\x20new')+_0x3674c7(0x1d9)+a4_0x5b7797['yellow']('~\x20'+_0x54e42f+_0x3674c7(0x1e4))+_0x3674c7(0x1d9)+a4_0x5b7797[_0x3674c7(0x1e1)]('=\x20'+_0x1fc6d5+_0x3674c7(0x26a))),console[_0x3674c7(0x216)](_0x3674c7(0x1dc)+formatCountSummary(_0x198925[_0x3674c7(0x275)][_0x3674c7(0x203)])),console[_0x3674c7(0x216)](_0x3674c7(0x1f4)+formatCountSummary(_0x198925[_0x3674c7(0x275)]['knowledgeBases'])),console['log'](_0x3674c7(0x227)+formatCountSummary(_0x198925[_0x3674c7(0x275)][_0x3674c7(0x23b)])),console[_0x3674c7(0x216)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x198925[_0x3674c7(0x275)][_0x3674c7(0x1ff)])),console['log'](_0x3674c7(0x22d)+formatCountSummary(_0x198925['counts'][_0x3674c7(0x26e)]));const _0x3fc6d0=_0x198925[_0x3674c7(0x275)][_0x3674c7(0x207)][_0x3674c7(0x1fe)]>0x0||_0x198925[_0x3674c7(0x275)][_0x3674c7(0x211)]['total']>0x0;_0x3fc6d0&&(console[_0x3674c7(0x216)](_0x3674c7(0x22e)+formatCountSummary(_0x198925[_0x3674c7(0x275)][_0x3674c7(0x207)])),console['log'](_0x3674c7(0x25f)+formatCountSummary(_0x198925[_0x3674c7(0x275)][_0x3674c7(0x211)])));console[_0x3674c7(0x216)]('\x20\x20Target:\x20'+a4_0x5b7797['cyan'](_0x198925[_0x3674c7(0x23d)])),displayDiffs(_0x198925['agents'],_0x198925[_0x3674c7(0x1da)],_0x198925['textKnowledgeBases'],_0x198925['prompts'],_0x198925['integrations'],_0x198925[_0x3674c7(0x207)],_0x198925[_0x3674c7(0x211)]);if(_0x4876a2)return console[_0x3674c7(0x216)](a4_0x5b7797[_0x3674c7(0x221)](_0x3674c7(0x277))),0x0;if(_0x1de87d===0x0&&_0x54e42f===0x0)return console[_0x3674c7(0x216)](a4_0x5b7797['green'](_0x3674c7(0x228))),saveSessionContext({'llm_project':_0x198925[_0x3674c7(0x20b)]},_0x4bc64d[_0x3674c7(0x26c)]),console['log'](a4_0x5b7797[_0x3674c7(0x260)]('✔\x20Context\x20set:\x20'+a4_0x5b7797[_0x3674c7(0x1e1)](_0x3674c7(0x213))+'\x20=\x20'+a4_0x5b7797[_0x3674c7(0x251)](_0x198925[_0x3674c7(0x20b)]))),0x0;if(!_0x3aaed5&&!_0xb89f36){if(!isInteractive())return console[_0x3674c7(0x212)](a4_0x5b7797[_0x3674c7(0x1cf)](_0x3674c7(0x229)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3674c7(0x212)](a4_0x5b7797[_0x3674c7(0x1e1)](_0x3674c7(0x236))),0x1;const _0x5b27c5=await confirmKey('\x0aWrite\x20'+(_0x1de87d+_0x54e42f)+'\x20files?');if(!_0x5b27c5)return console[_0x3674c7(0x216)](a4_0x5b7797['yellow'](_0x3674c7(0x1fb)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x1d1e3c}=await withSpinner(_0x3674c7(0x208),()=>_0x5141e8['llm']['pullProject'](_0x5e7546,_0x2c13df,{'force':_0xb89f36}));return console[_0x3674c7(0x216)](a4_0x5b7797[_0x3674c7(0x260)](_0x3674c7(0x1f2)+(_0x1de87d+_0x54e42f)+_0x3674c7(0x1ca)+_0x1d1e3c[_0x3674c7(0x23d)])),saveSessionContext({'llm_project':_0x1d1e3c[_0x3674c7(0x20b)]},_0x4bc64d[_0x3674c7(0x26c)]),console[_0x3674c7(0x216)](a4_0x5b7797[_0x3674c7(0x260)](_0x3674c7(0x24b)+a4_0x5b7797[_0x3674c7(0x1e1)]('llm_project')+_0x3674c7(0x239)+a4_0x5b7797['cyan'](_0x1d1e3c[_0x3674c7(0x20b)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x46ea57(0x1d8)]='agent:clone';['description']=a4_0x46ea57(0x1c6);async[a4_0x46ea57(0x242)](_0x403ec6){const _0x4bf35f=a4_0x46ea57,{options:_0x155f25,args:_0x58a17f,tdx:_0x1b4c95}=_0x403ec6,_0x352aaf=_0x58a17f[0x0],_0x50fe0d=_0x155f25[_0x4bf35f(0x1d8)],_0x5cdd86=_0x155f25['dryRun'],_0x34f9ff=_0x155f25[_0x4bf35f(0x269)],_0x445bd7=_0x155f25[_0x4bf35f(0x245)],_0x571013=_0x155f25[_0x4bf35f(0x21d)];let _0x37f246;const _0x5056ca=findAgentConfigPath(process[_0x4bf35f(0x25c)]());if(_0x352aaf){const _0x37156c=a4_0xd83b37['join'](_0x352aaf,'tdx.json');existsSync(_0x37156c)?(_0x37f246=_0x352aaf,console[_0x4bf35f(0x216)](a4_0x5b7797[_0x4bf35f(0x1e1)](_0x4bf35f(0x1e8)+_0x352aaf))):_0x37f246=_0x352aaf;}else{if(_0x5056ca)_0x37f246=a4_0xd83b37[_0x4bf35f(0x21a)](_0x5056ca),console[_0x4bf35f(0x216)](a4_0x5b7797[_0x4bf35f(0x1e1)](_0x4bf35f(0x1cc)+_0x37f246));else{if(_0x571013){const _0xb9014f=sanitizeForFilesystem(_0x571013);let _0x13a970=_0xb9014f,_0x1a4ea7=a4_0xd83b37['join'](process[_0x4bf35f(0x25c)](),_0x4bf35f(0x203),_0xb9014f,'tdx.json');if(!existsSync(_0x1a4ea7)){const _0x516a4f=normalizeName(_0x571013),_0x407ab7=a4_0xd83b37['join'](process[_0x4bf35f(0x25c)](),_0x4bf35f(0x203),_0x516a4f,_0x4bf35f(0x238));existsSync(_0x407ab7)&&(_0x13a970=_0x516a4f,_0x1a4ea7=_0x407ab7);}if(existsSync(_0x1a4ea7))_0x37f246=a4_0xd83b37[_0x4bf35f(0x21a)](_0x1a4ea7),console[_0x4bf35f(0x216)](a4_0x5b7797['dim'](_0x4bf35f(0x1e8)+_0x37f246));else{const _0x4e3d87=_0x155f25[_0x4bf35f(0x204)];if(_0x4e3d87)throw new SDKError(ErrorCode[_0x4bf35f(0x1ec)],_0x4bf35f(0x266)+_0x571013+_0x4bf35f(0x1f7),undefined,{'helpText':_0x4bf35f(0x1d6)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x4bf35f(0x24e)+_0x571013+'\x0a')+(_0x4bf35f(0x25b)+_0x13a970+_0x4bf35f(0x232)+(_0x50fe0d||_0x4bf35f(0x25a))+_0x4bf35f(0x248)+_0x4e3d87)});_0x37f246=_0x571013,console[_0x4bf35f(0x216)](a4_0x5b7797['dim']('Using\x20context\x20project:\x20'+_0x571013));}}}}if(!_0x37f246)return console[_0x4bf35f(0x216)](a4_0x5b7797[_0x4bf35f(0x221)](_0x4bf35f(0x22a))),console['log'](_0x4bf35f(0x205)),console['log'](_0x4bf35f(0x24f)),console[_0x4bf35f(0x216)](_0x4bf35f(0x1f1)),console['log'](_0x4bf35f(0x1e2)),0x1;if(!_0x50fe0d)throw new SDKError(ErrorCode[_0x4bf35f(0x27d)],_0x4bf35f(0x21e),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x34f9ff&&!_0x5cdd86){if(!isInteractive())return console['error'](a4_0x5b7797['red'](_0x4bf35f(0x229)),_0x4bf35f(0x230)),console[_0x4bf35f(0x212)](a4_0x5b7797['dim'](_0x4bf35f(0x236))),0x1;const _0x2420c5=await confirmKey('Clone\x20\x22'+_0x37f246+_0x4bf35f(0x20a)+_0x50fe0d+'\x22?');if(!_0x2420c5)return console[_0x4bf35f(0x216)](a4_0x5b7797[_0x4bf35f(0x221)](_0x4bf35f(0x1fb))),0x1;}const {data:_0x19401a}=await withSpinner(_0x4bf35f(0x254)+_0x37f246+_0x4bf35f(0x27c)+_0x50fe0d+_0x4bf35f(0x241),()=>_0x1b4c95[_0x4bf35f(0x23a)][_0x4bf35f(0x24c)](_0x37f246,_0x50fe0d,{'dryRun':_0x5cdd86}));if(_0x5cdd86){console['log'](a4_0x5b7797[_0x4bf35f(0x221)](_0x4bf35f(0x1db))),console[_0x4bf35f(0x216)](_0x4bf35f(0x217)+_0x19401a['sourceProjectName']),console[_0x4bf35f(0x216)](_0x4bf35f(0x274)+_0x50fe0d),console['log'](_0x4bf35f(0x218)),console['log'](_0x4bf35f(0x1dc)+_0x19401a[_0x4bf35f(0x275)]['agents']['created']),console[_0x4bf35f(0x216)]('\x20\x20Knowledge\x20Bases:\x20'+_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x1da)][_0x4bf35f(0x259)]),console[_0x4bf35f(0x216)]('\x20\x20Prompts:\x20'+_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x1ff)][_0x4bf35f(0x259)]);const _0x1198ca=_0x19401a[_0x4bf35f(0x275)]['experimentalKnowledgeBases']['created']>0x0||_0x19401a['counts'][_0x4bf35f(0x211)][_0x4bf35f(0x259)]>0x0;return _0x1198ca&&(console[_0x4bf35f(0x216)](_0x4bf35f(0x22e)+_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x207)][_0x4bf35f(0x259)]),console[_0x4bf35f(0x216)](_0x4bf35f(0x25f)+_0x19401a['counts'][_0x4bf35f(0x211)]['created'])),0x0;}const _0x26216b=_0x19401a[_0x4bf35f(0x275)]['agents'][_0x4bf35f(0x1d0)]>0x0||_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x1da)]['errors']>0x0||_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x1ff)][_0x4bf35f(0x1d0)]>0x0||_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x207)]['errors']>0x0||_0x19401a[_0x4bf35f(0x275)]['experimentalArtifacts'][_0x4bf35f(0x1d0)]>0x0;_0x26216b?console[_0x4bf35f(0x216)](a4_0x5b7797[_0x4bf35f(0x221)](_0x4bf35f(0x233))):console[_0x4bf35f(0x216)](a4_0x5b7797['green'](_0x4bf35f(0x226)));console[_0x4bf35f(0x216)](_0x4bf35f(0x217)+_0x19401a[_0x4bf35f(0x1c8)]),console[_0x4bf35f(0x216)]('New\x20project:\x20'+_0x19401a[_0x4bf35f(0x262)]),console[_0x4bf35f(0x216)](_0x4bf35f(0x234)+_0x19401a['newProjectId']),console[_0x4bf35f(0x216)](),console[_0x4bf35f(0x216)](_0x4bf35f(0x261)),console['log'](_0x4bf35f(0x1dc)+formatCountSummary(_0x19401a['counts'][_0x4bf35f(0x203)])),console[_0x4bf35f(0x216)](_0x4bf35f(0x1f4)+formatCountSummary(_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x1da)])),console[_0x4bf35f(0x216)](_0x4bf35f(0x279)+formatCountSummary(_0x19401a[_0x4bf35f(0x275)]['prompts'])),console[_0x4bf35f(0x216)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x19401a['counts'][_0x4bf35f(0x26e)]));const _0xc07566=_0x19401a[_0x4bf35f(0x275)]['experimentalKnowledgeBases'][_0x4bf35f(0x259)]>0x0||_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x207)][_0x4bf35f(0x246)]>0x0||_0x19401a['counts']['experimentalKnowledgeBases'][_0x4bf35f(0x258)]>0x0||_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x211)][_0x4bf35f(0x259)]>0x0||_0x19401a[_0x4bf35f(0x275)]['experimentalArtifacts'][_0x4bf35f(0x246)]>0x0||_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x211)]['unchanged']>0x0;_0xc07566&&(console[_0x4bf35f(0x216)](_0x4bf35f(0x22e)+formatCountSummary(_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x207)])),console['log'](_0x4bf35f(0x25f)+formatCountSummary(_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x211)])));if(_0x26216b){console[_0x4bf35f(0x216)](),console[_0x4bf35f(0x216)](a4_0x5b7797['red'](_0x4bf35f(0x1f3)));for(const _0x23aac6 of _0x19401a[_0x4bf35f(0x203)]){_0x23aac6['action']===_0x4bf35f(0x212)&&console[_0x4bf35f(0x216)](a4_0x5b7797[_0x4bf35f(0x1cf)](_0x4bf35f(0x20f)+_0x23aac6['agentName']+'\x22:\x20'+_0x23aac6['error']));}for(const _0x47e5f9 of _0x19401a[_0x4bf35f(0x1da)]){_0x47e5f9[_0x4bf35f(0x27a)]===_0x4bf35f(0x212)&&console['log'](a4_0x5b7797['red'](_0x4bf35f(0x24a)+_0x47e5f9[_0x4bf35f(0x1d8)]+_0x4bf35f(0x220)+_0x47e5f9['error']));}for(const _0x52e499 of _0x19401a[_0x4bf35f(0x1ff)]){_0x52e499[_0x4bf35f(0x27a)]===_0x4bf35f(0x212)&&console['log'](a4_0x5b7797[_0x4bf35f(0x1cf)](_0x4bf35f(0x1f0)+_0x52e499['name']+_0x4bf35f(0x220)+_0x52e499[_0x4bf35f(0x212)]));}for(const _0x541de5 of _0x19401a[_0x4bf35f(0x26e)]){_0x541de5['action']===_0x4bf35f(0x212)&&console['log'](a4_0x5b7797[_0x4bf35f(0x1cf)](_0x4bf35f(0x1dd)+_0x541de5[_0x4bf35f(0x1d8)]+_0x4bf35f(0x220)+_0x541de5[_0x4bf35f(0x212)]));}for(const _0x4faef3 of _0x19401a[_0x4bf35f(0x207)]){_0x4faef3[_0x4bf35f(0x27a)]===_0x4bf35f(0x212)&&console[_0x4bf35f(0x216)](a4_0x5b7797[_0x4bf35f(0x1cf)](_0x4bf35f(0x1c9)+_0x4faef3[_0x4bf35f(0x1d8)]+_0x4bf35f(0x220)+_0x4faef3[_0x4bf35f(0x212)]));}for(const _0x18117f of _0x19401a['experimentalArtifacts']){_0x18117f[_0x4bf35f(0x27a)]===_0x4bf35f(0x212)&&console[_0x4bf35f(0x216)](a4_0x5b7797['red'](_0x4bf35f(0x21f)+_0x18117f[_0x4bf35f(0x1d8)]+_0x4bf35f(0x220)+_0x18117f[_0x4bf35f(0x212)]));}return 0x1;}console[_0x4bf35f(0x216)]();const _0x25f696=getLLMProjectUrl(_0x445bd7,_0x19401a[_0x4bf35f(0x283)]);return console[_0x4bf35f(0x216)](_0x4bf35f(0x22f)+a4_0x5b7797[_0x4bf35f(0x251)](_0x25f696)),0x0;}}function a4_0x392f(){const _0x33a0ce=['\x0aPull\x20summary\x20for\x20\x27','pushProject','\x20successfully','\x0aChanges\x20to\x20integration\x20\x27','newProjectId','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Analyzing\x20project\x20\x22','sourceProjectName','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20files\x20to\x20','pullAgent','Using\x20current\x20project:\x20','No\x20tdx.json\x20found\x20in\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','red','errors','agent.yml','agent:pull','\x20created','force','\x20\x20Text\x20Knowledge\x20Base\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Using\x20project\x20from\x20','name','\x20|\x20','knowledgeBases','Dry\x20run\x20-\x20no\x20changes\x20made','\x20\x20Agents:\x20','\x20\x20Integration\x20\x22','1231299kzNvNd','\x20\x20Source:\x20','Pushing\x20to\x20project...','dim','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','no_context','\x20changed','isNew','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Using\x20local\x20project:\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','diff','outputPath','INVALID_ARGUMENT','326880HxcxNa','54DPlWrs','1507646FdnysD','\x20\x20Prompt\x20\x22','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','\x0a✔\x20Pulled\x20','Errors:','\x20\x20Knowledge\x20Bases:\x20','push','\x0aChanges\x20to\x20prompt\x20\x27','\x22\x20to\x20a\x20different\x20profile','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','85835BZwRjj','Cancelled','cwd-config','\x0aChanges\x20to\x20agent\x20\x27','total','prompts','utf-8','no_local_folder','Agent\x20','agents','profile','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','description','experimentalKnowledgeBases','Writing\x20files...','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x22\x20to\x20new\x20project\x20\x22','projectName','Agent:\x20','new','\x0aPush\x20','\x20\x20Agent\x20\x22','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','experimentalArtifacts','error','llm_project','\x20new','173336oYXBFF','log','Source:\x20','Would\x20clone:','Failed\x20to\x20push\x20agent:\x20','dirname','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','gray','llmProject','New\x20project\x20name\x20is\x20required','\x20\x20Experimental\x20Artifact\x20\x22','\x22:\x20','yellow','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x0a✔\x20Pushed\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','\x20resources\x20to\x20\x27','Project\x20cloned\x20successfully','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aError:','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aErrors\x20found:','\x20\x20Integrations:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Project:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','\x20--name\x20','Project\x20cloned\x20with\x20errors','New\x20project\x20ID:\x20','message','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dryRun','tdx.json','\x20=\x20','llm','textKnowledgeBases','reason','outputDir','agent','Using\x20project\x20from\x20context:\x20','\x0aChanges:','\x22...','execute','projectDir','pullProject','site','updated','Analyzing\x20changes\x20to\x20push...','\x20--profile\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Knowledge\x20Base\x20\x22','✔\x20Context\x20set:\x20','cloneProject','Output\x20path:\x20','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x22\x20from\x20project\x20\x22','cyan','\x0aProject\x20pushed\x20with\x20errors','202074TkMlNG','Cloning\x20\x22','Using\x20project:\x20','arg-dir','context','unchanged','created','<new-name>','\x20\x20tdx\x20agent\x20clone\x20agents/','cwd','projectId','agentId','\x20\x20Experimental\x20Artifacts:\x20','green','Summary:','newProjectName','42362PmWrmd','8IpmoCE','Dry\x20run\x20-\x20no\x20files\x20written','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Output:\x20','\x20total','yes','\x20unchanged','agentName','session','repeat','integrations','\x0aPush\x20summary\x20for\x20\x27','\x20updated','Pushing\x20agent\x20from\x20\x22','join','hasChanges','New\x20project:\x20','counts','parse','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20\x20Prompts:\x20','action','output','\x22\x20to\x20\x22','MISSING_ARGUMENT','Chat:\x20'];a4_0x392f=function(){return _0x33a0ce;};return a4_0x392f();}export class AgentPushCommand extends BaseCommand{[a4_0x46ea57(0x1d8)]='agent:push';[a4_0x46ea57(0x206)]=a4_0x46ea57(0x1e7);async[a4_0x46ea57(0x242)](_0x2dc83d){const _0x4b5427=a4_0x46ea57,{options:_0x17a690,args:_0x3395c0,tdx:_0x82ec45}=_0x2dc83d;let _0x3a1f7b=_0x3395c0[0x0]||process[_0x4b5427(0x25c)]();const _0x3b65=_0x17a690[_0x4b5427(0x237)],_0x2fb24b=_0x17a690['force'],_0x2a51ea=_0x17a690[_0x4b5427(0x269)],_0x51c476=_0x17a690['site'],_0x394986=a4_0xd83b37[_0x4b5427(0x272)](_0x3a1f7b,_0x4b5427(0x1d1)),_0x4b83ab=existsSync(_0x394986);if(_0x4b83ab){const {data:_0x27391e}=await withSpinner(_0x4b5427(0x271)+_0x3a1f7b+'\x22...',()=>_0x82ec45[_0x4b5427(0x23a)]['pushAgent'](_0x3a1f7b,{'dryRun':_0x3b65,'force':_0x2fb24b}));if(_0x3b65)return console[_0x4b5427(0x216)](a4_0x5b7797['yellow'](_0x4b5427(0x1db))),console['log']('Would\x20push\x20agent:\x20'+_0x27391e[_0x4b5427(0x26b)]),0x0;if(_0x27391e[_0x4b5427(0x27a)]===_0x4b5427(0x212))return console[_0x4b5427(0x216)](a4_0x5b7797[_0x4b5427(0x1cf)](_0x4b5427(0x219)+_0x27391e['error'])),0x1;console['log'](a4_0x5b7797[_0x4b5427(0x260)](_0x4b5427(0x202)+_0x27391e[_0x4b5427(0x27a)]+_0x4b5427(0x281))),console['log']('Agent:\x20'+_0x27391e[_0x4b5427(0x26b)]);if(_0x27391e[_0x4b5427(0x25e)]&&_0x27391e[_0x4b5427(0x25d)]){const _0x15b7fd=getLLMAgentChatUrl(_0x51c476,_0x27391e[_0x4b5427(0x25d)],_0x27391e['agentId']);console[_0x4b5427(0x216)](_0x4b5427(0x27e)+a4_0x5b7797['cyan'](_0x15b7fd));}return 0x0;}const _0x31dc63=_0x17a690[_0x4b5427(0x21d)],_0x497180=resolveProjectFromContext(_0x3a1f7b,_0x31dc63);if(_0x497180['found'])_0x3a1f7b=_0x497180[_0x4b5427(0x243)],_0x497180['source']===_0x4b5427(0x257)&&console[_0x4b5427(0x216)](a4_0x5b7797[_0x4b5427(0x1e1)](_0x4b5427(0x255)+_0x3a1f7b));else{let _0x58ca41=_0x4b5427(0x1f9);_0x497180[_0x4b5427(0x23c)]===_0x4b5427(0x201)&&(_0x58ca41=_0x497180[_0x4b5427(0x235)]+_0x4b5427(0x249)+_0x497180['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x4b5427(0x1ec)],_0x497180[_0x4b5427(0x23c)]===_0x4b5427(0x1e3)?_0x497180[_0x4b5427(0x235)]:_0x4b5427(0x1cd)+_0x3a1f7b,undefined,{'helpText':_0x58ca41});}const {data:_0x18a6c9}=await withSpinner(_0x4b5427(0x247),()=>_0x82ec45[_0x4b5427(0x23a)][_0x4b5427(0x280)](_0x3a1f7b,{'dryRun':!![]})),_0x2ae98a=_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x203)]['errors']>0x0;if(_0x2ae98a){console['log'](a4_0x5b7797[_0x4b5427(0x1cf)](_0x4b5427(0x22c)));for(const _0x34b81b of _0x18a6c9['agents']){_0x34b81b[_0x4b5427(0x27a)]===_0x4b5427(0x212)&&console[_0x4b5427(0x216)](a4_0x5b7797[_0x4b5427(0x1cf)](_0x4b5427(0x20f)+_0x34b81b[_0x4b5427(0x26b)]+_0x4b5427(0x220)+_0x34b81b[_0x4b5427(0x212)]));}return 0x1;}const _0x21c168=_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x203)][_0x4b5427(0x259)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x1da)][_0x4b5427(0x259)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x23b)][_0x4b5427(0x259)]+_0x18a6c9['counts'][_0x4b5427(0x1ff)][_0x4b5427(0x259)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x26e)][_0x4b5427(0x259)]+_0x18a6c9[_0x4b5427(0x275)]['experimentalKnowledgeBases'][_0x4b5427(0x259)]+_0x18a6c9['counts'][_0x4b5427(0x211)][_0x4b5427(0x259)],_0x27adf2=_0x18a6c9[_0x4b5427(0x275)]['agents'][_0x4b5427(0x246)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x1da)][_0x4b5427(0x246)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x23b)][_0x4b5427(0x246)]+_0x18a6c9[_0x4b5427(0x275)]['prompts'][_0x4b5427(0x246)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x26e)][_0x4b5427(0x246)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x207)][_0x4b5427(0x246)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x211)][_0x4b5427(0x246)],_0x311f32=_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x203)][_0x4b5427(0x258)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x1da)]['unchanged']+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x23b)][_0x4b5427(0x258)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x1ff)][_0x4b5427(0x258)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x26e)][_0x4b5427(0x258)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x207)][_0x4b5427(0x258)]+_0x18a6c9[_0x4b5427(0x275)]['experimentalArtifacts'][_0x4b5427(0x258)];console[_0x4b5427(0x216)](_0x4b5427(0x26f)+_0x18a6c9[_0x4b5427(0x20b)]+'\x27:'),console[_0x4b5427(0x216)]('\x20\x20'+a4_0x5b7797[_0x4b5427(0x260)]('+\x20'+_0x21c168+_0x4b5427(0x214))+_0x4b5427(0x1d9)+a4_0x5b7797[_0x4b5427(0x221)]('~\x20'+_0x27adf2+'\x20changed')+_0x4b5427(0x1d9)+a4_0x5b7797[_0x4b5427(0x1e1)]('=\x20'+_0x311f32+_0x4b5427(0x26a))),console[_0x4b5427(0x216)](_0x4b5427(0x1dc)+formatCountSummary(_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x203)])),console[_0x4b5427(0x216)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x1da)])),console[_0x4b5427(0x216)](_0x4b5427(0x227)+formatCountSummary(_0x18a6c9['counts'][_0x4b5427(0x23b)])),console[_0x4b5427(0x216)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x18a6c9[_0x4b5427(0x275)]['prompts'])),console[_0x4b5427(0x216)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x26e)]));const _0x53b93e=_0x18a6c9[_0x4b5427(0x275)]['experimentalKnowledgeBases'][_0x4b5427(0x259)]>0x0||_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x207)]['updated']>0x0||_0x18a6c9['counts'][_0x4b5427(0x207)][_0x4b5427(0x258)]>0x0||_0x18a6c9['counts'][_0x4b5427(0x211)][_0x4b5427(0x259)]>0x0||_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x211)][_0x4b5427(0x246)]>0x0||_0x18a6c9[_0x4b5427(0x275)]['experimentalArtifacts']['unchanged']>0x0;_0x53b93e&&(console[_0x4b5427(0x216)](_0x4b5427(0x22e)+formatCountSummary(_0x18a6c9[_0x4b5427(0x275)]['experimentalKnowledgeBases'])),console[_0x4b5427(0x216)](_0x4b5427(0x25f)+formatCountSummary(_0x18a6c9['counts'][_0x4b5427(0x211)])));console[_0x4b5427(0x216)](_0x4b5427(0x1df)+a4_0x5b7797[_0x4b5427(0x251)](_0x3a1f7b)),displayDiffs(_0x18a6c9[_0x4b5427(0x203)],_0x18a6c9['knowledgeBases'],_0x18a6c9['textKnowledgeBases'],_0x18a6c9[_0x4b5427(0x1ff)],_0x18a6c9['integrations'],_0x18a6c9[_0x4b5427(0x207)],_0x18a6c9['experimentalArtifacts']);if(_0x3b65)return console[_0x4b5427(0x216)](a4_0x5b7797['yellow'](_0x4b5427(0x22b))),0x0;if(_0x21c168===0x0&&_0x27adf2===0x0){console[_0x4b5427(0x216)](a4_0x5b7797[_0x4b5427(0x260)](_0x4b5427(0x210)));const _0x2069e0=getLLMProjectUrl(_0x51c476,_0x18a6c9['projectId']);return console[_0x4b5427(0x216)]('Project:\x20'+a4_0x5b7797[_0x4b5427(0x251)](_0x2069e0)),0x0;}if(!_0x2a51ea&&!_0x2fb24b){if(!isInteractive())return console[_0x4b5427(0x212)](a4_0x5b7797[_0x4b5427(0x1cf)](_0x4b5427(0x229)),_0x4b5427(0x230)),console[_0x4b5427(0x212)](a4_0x5b7797['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x341581=await confirmKey(_0x4b5427(0x20e)+(_0x21c168+_0x27adf2)+'\x20resources?');if(!_0x341581)return console['log'](a4_0x5b7797[_0x4b5427(0x221)](_0x4b5427(0x1fb)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x1c6597}=await withSpinner(_0x4b5427(0x1e0),()=>_0x82ec45[_0x4b5427(0x23a)][_0x4b5427(0x280)](_0x3a1f7b,{'force':_0x2fb24b})),_0x2615ed=_0x1c6597[_0x4b5427(0x275)][_0x4b5427(0x203)]['errors']>0x0||_0x1c6597['counts'][_0x4b5427(0x1da)][_0x4b5427(0x1d0)]>0x0||_0x1c6597['counts'][_0x4b5427(0x23b)]['errors']>0x0||_0x1c6597[_0x4b5427(0x275)]['prompts'][_0x4b5427(0x1d0)]>0x0;if(_0x2615ed){console['log'](a4_0x5b7797[_0x4b5427(0x221)](_0x4b5427(0x252))),console[_0x4b5427(0x216)](),console[_0x4b5427(0x216)](a4_0x5b7797[_0x4b5427(0x1cf)](_0x4b5427(0x1f3)));for(const _0x401e29 of _0x1c6597['agents']){_0x401e29['action']===_0x4b5427(0x212)&&console[_0x4b5427(0x216)](a4_0x5b7797['red'](_0x4b5427(0x20f)+_0x401e29[_0x4b5427(0x26b)]+_0x4b5427(0x220)+_0x401e29[_0x4b5427(0x212)]));}for(const _0x541a52 of _0x1c6597[_0x4b5427(0x1da)]){_0x541a52[_0x4b5427(0x27a)]==='error'&&console['log'](a4_0x5b7797['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x541a52[_0x4b5427(0x1d8)]+'\x22:\x20'+_0x541a52[_0x4b5427(0x212)]));}for(const _0x40ad0d of _0x1c6597[_0x4b5427(0x23b)]){_0x40ad0d[_0x4b5427(0x27a)]===_0x4b5427(0x212)&&console[_0x4b5427(0x216)](a4_0x5b7797['red'](_0x4b5427(0x1d5)+_0x40ad0d[_0x4b5427(0x1d8)]+_0x4b5427(0x220)+_0x40ad0d['error']));}for(const _0x401eef of _0x1c6597[_0x4b5427(0x1ff)]){_0x401eef[_0x4b5427(0x27a)]===_0x4b5427(0x212)&&console[_0x4b5427(0x216)](a4_0x5b7797['red'](_0x4b5427(0x1f0)+_0x401eef[_0x4b5427(0x1d8)]+_0x4b5427(0x220)+_0x401eef[_0x4b5427(0x212)]));}for(const _0x4e5f35 of _0x1c6597[_0x4b5427(0x26e)]){_0x4e5f35[_0x4b5427(0x27a)]===_0x4b5427(0x212)&&console[_0x4b5427(0x216)](a4_0x5b7797[_0x4b5427(0x1cf)]('\x20\x20Integration\x20\x22'+_0x4e5f35[_0x4b5427(0x1d8)]+_0x4b5427(0x220)+_0x4e5f35[_0x4b5427(0x212)]));}return 0x1;}console[_0x4b5427(0x216)](a4_0x5b7797[_0x4b5427(0x260)](_0x4b5427(0x223)+(_0x21c168+_0x27adf2)+_0x4b5427(0x225)+_0x1c6597[_0x4b5427(0x20b)]+'\x27'));const _0x3044e5=getLLMProjectUrl(_0x51c476,_0x1c6597['projectId']);return console[_0x4b5427(0x216)](_0x4b5427(0x22f)+a4_0x5b7797['cyan'](_0x3044e5)),0x0;}}
|
|
1
|
+
const a4_0x27ae42=a4_0x1cbf;(function(_0x3de6ce,_0x1a9d4b){const _0x2ddbe7=a4_0x1cbf,_0x52aec5=_0x3de6ce();while(!![]){try{const _0xf75517=-parseInt(_0x2ddbe7(0xed))/0x1*(-parseInt(_0x2ddbe7(0x106))/0x2)+parseInt(_0x2ddbe7(0x187))/0x3+-parseInt(_0x2ddbe7(0x116))/0x4*(-parseInt(_0x2ddbe7(0xcf))/0x5)+-parseInt(_0x2ddbe7(0xea))/0x6+parseInt(_0x2ddbe7(0x164))/0x7*(parseInt(_0x2ddbe7(0x182))/0x8)+-parseInt(_0x2ddbe7(0xfc))/0x9+-parseInt(_0x2ddbe7(0x11b))/0xa;if(_0xf75517===_0x1a9d4b)break;else _0x52aec5['push'](_0x52aec5['shift']());}catch(_0x47f80d){_0x52aec5['push'](_0x52aec5['shift']());}}}(a4_0x5b12,0x64281));import a4_0x52e8f3 from'chalk';import a4_0x596575 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';function a4_0x5b12(){const _0x1f0e1d=['\x20\x20tdx\x20agent\x20pull\x20','\x20total','agentId','pullProject','repeat','tdx.json','-\x20nothing\x20pushed','diff','pushAgent','6159123WvauUj','\x20\x20Prompts:\x20','Dry\x20run\x20-\x20no\x20changes\x20made','Errors:','prompts','\x20files?','dim','newProjectName','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','2VhkHrG','Output\x20path:\x20','\x0aChanges:','counts','gray','Using\x20current\x20project:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0a✔\x20Pushed\x20','\x0aChanges\x20to\x20integration\x20\x27','session','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','cwd-config','yellow','new','cyan','total','71584eKOPSO','execute','site','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Cannot\x20clone\x20from\x20context\x20project\x20\x22','10244060yAzphG','\x20changed','\x0aChanges\x20to\x20agent\x20\x27','\x20\x20Source:\x20','\x20new','projectId','updated','agent:push','outputDir','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Agent\x20pulled\x20successfully','Cloning\x20\x22','\x20\x20Agents:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20=\x20','unchanged','yes','\x20\x20Integrations:\x20','<new-name>','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','no_local_folder','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','Agent:\x20','found','\x22:\x20','force','\x20\x20Prompt\x20\x22','experimentalKnowledgeBases','Failed\x20to\x20push\x20agent:\x20','-\x20no\x20files\x20written','\x22\x20to\x20a\x20different\x20profile','reason','\x20successfully','Using\x20project\x20from\x20context:\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','Writing\x20files...','description','\x20unchanged','No\x20tdx.json\x20found\x20in\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','New\x20project:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20Experimental\x20Artifact\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','\x20updated','knowledgeBases','log','isNew','\x20--name\x20','Pushing\x20agent\x20from\x20\x22','green','INVALID_ARGUMENT','\x20--profile\x20','utf-8','llm_project','Summary:','\x20\x20Text\x20Knowledge\x20Bases:\x20','arg-dir','name','integrations','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','agent.yml','agentName','✔\x20Context\x20set:\x20','\x20\x20Knowledge\x20Bases:\x20','sourceProjectName','push','textKnowledgeBases','\x0aErrors\x20found:','cwd','parse','\x20\x20Agent\x20\x22','14qrwYzR','projectDir','Output:\x20','error','projectName','output','Would\x20pull\x20agent:\x20','cloneProject','llmProject','errors','dirname','Using\x20project\x20from\x20','\x20\x20Knowledge\x20Base\x20\x22','\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)','no_context','Using\x20context\x20project:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Pushing\x20to\x20project...','Source:\x20','pullAgent','Project:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','Using\x20project:\x20','action','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','profile','message','Status:\x20','agent','\x0aWrite\x20','3236208SHvXkJ','red','pushProject','dryRun','\x0aPull\x20summary\x20for\x20\x27','1613064gNXirh','New\x20project\x20ID:\x20','MISSING_ARGUMENT','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','hasChanges','55lkaMAm','context','\x20\x20Integration\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20\x20Target:\x20','New\x20project\x20name\x20is\x20required','\x0aPush\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Cancelled','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Analyzing\x20project\x20\x22','\x20|\x20','Clone\x20\x22','Chat:\x20','join','\x0aError:','agents','\x20\x20Experimental\x20Artifacts:\x20','Using\x20local\x20project:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','newProjectId','\x20resources?','llm','created','\x22\x20to\x20new\x20project\x20\x22','Project\x20cloned\x20with\x20errors','412626HhuVky','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Would\x20clone:','644169fJmMLk','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','experimentalArtifacts','\x20\x20tdx\x20agent\x20clone\x20agents/','\x22...','\x0aProject\x20pushed\x20with\x20errors'];a4_0x5b12=function(){return _0x1f0e1d;};return a4_0x5b12();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';function a4_0x1cbf(_0x4a03da,_0x4aed55){_0x4a03da=_0x4a03da-0xcb;const _0x5b12b3=a4_0x5b12();let _0x1cbf0a=_0x5b12b3[_0x4a03da];return _0x1cbf0a;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x38f5bf){const _0xd55468=a4_0x1cbf,_0x5ad06a=[];if(_0x38f5bf[_0xd55468(0x115)]!==undefined)_0x5ad06a[_0xd55468(0x15e)](_0x38f5bf['total']+_0xd55468(0xf4));if(_0x38f5bf[_0xd55468(0x113)]!==undefined&&_0x38f5bf[_0xd55468(0x113)]>0x0)_0x5ad06a[_0xd55468(0x15e)](a4_0x52e8f3['green'](_0x38f5bf['new']+_0xd55468(0x11f)));if(_0x38f5bf['created']!==undefined&&_0x38f5bf[_0xd55468(0xe7)]>0x0)_0x5ad06a['push'](a4_0x52e8f3[_0xd55468(0x14e)](_0x38f5bf[_0xd55468(0xe7)]+'\x20created'));if(_0x38f5bf[_0xd55468(0x121)]!==undefined&&_0x38f5bf['updated']>0x0)_0x5ad06a[_0xd55468(0x15e)](a4_0x52e8f3[_0xd55468(0x112)](_0x38f5bf[_0xd55468(0x121)]+_0xd55468(0x148)));if(_0x38f5bf[_0xd55468(0x12a)]!==undefined&&_0x38f5bf[_0xd55468(0x12a)]>0x0)_0x5ad06a['push'](a4_0x52e8f3['gray'](_0x38f5bf['unchanged']+_0xd55468(0x141)));if(_0x38f5bf[_0xd55468(0x16d)]!==undefined&&_0x38f5bf[_0xd55468(0x16d)]>0x0)_0x5ad06a['push'](a4_0x52e8f3[_0xd55468(0x183)](_0x38f5bf[_0xd55468(0x16d)]+'\x20errors'));return _0x5ad06a['join'](',\x20');}function displayDiffs(_0x193a08,_0x3c9d91,_0x3677c4,_0x5dfe5f,_0x58ba1d,_0x45eb18,_0x38c88a){const _0xaabee6=a4_0x1cbf;for(const _0x23552b of _0x193a08){if(_0x23552b['diff']){const _0x28cbb5=_0x23552b[_0xaabee6(0x15a)]||_0x23552b[_0xaabee6(0x156)];console[_0xaabee6(0x14a)](_0xaabee6(0x11d)+_0x28cbb5+'\x27:'),console['log']('─'[_0xaabee6(0xf7)](0x3c)),console[_0xaabee6(0x14a)](_0x23552b[_0xaabee6(0xfa)]),console[_0xaabee6(0x14a)]('─'[_0xaabee6(0xf7)](0x3c));}}for(const _0xef888a of _0x3c9d91){_0xef888a[_0xaabee6(0xfa)]&&(console[_0xaabee6(0x14a)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0xef888a[_0xaabee6(0x156)]+'\x27:'),console['log']('─'[_0xaabee6(0xf7)](0x3c)),console['log'](_0xef888a[_0xaabee6(0xfa)]),console[_0xaabee6(0x14a)]('─'[_0xaabee6(0xf7)](0x3c)));}for(const _0x3e33bd of _0x3677c4){_0x3e33bd[_0xaabee6(0xfa)]&&(console[_0xaabee6(0x14a)](_0xaabee6(0x119)+_0x3e33bd['name']+'\x27:'),console[_0xaabee6(0x14a)]('─'[_0xaabee6(0xf7)](0x3c)),console[_0xaabee6(0x14a)](_0x3e33bd[_0xaabee6(0xfa)]),console[_0xaabee6(0x14a)]('─'[_0xaabee6(0xf7)](0x3c)));}for(const _0x465263 of _0x5dfe5f){_0x465263[_0xaabee6(0xfa)]&&(console[_0xaabee6(0x14a)](_0xaabee6(0x147)+_0x465263[_0xaabee6(0x156)]+'\x27:'),console[_0xaabee6(0x14a)]('─'[_0xaabee6(0xf7)](0x3c)),console[_0xaabee6(0x14a)](_0x465263[_0xaabee6(0xfa)]),console['log']('─'[_0xaabee6(0xf7)](0x3c)));}for(const _0x184406 of _0x58ba1d){_0x184406[_0xaabee6(0xfa)]&&(console[_0xaabee6(0x14a)](_0xaabee6(0x10e)+_0x184406['name']+'\x27:'),console[_0xaabee6(0x14a)]('─'['repeat'](0x3c)),console['log'](_0x184406[_0xaabee6(0xfa)]),console[_0xaabee6(0x14a)]('─'['repeat'](0x3c)));}for(const _0x452c66 of _0x45eb18){_0x452c66['diff']&&(console[_0xaabee6(0x14a)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x452c66['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0xaabee6(0x14a)](_0x452c66[_0xaabee6(0xfa)]),console[_0xaabee6(0x14a)]('─'[_0xaabee6(0xf7)](0x3c)));}for(const _0x238a49 of _0x38c88a){_0x238a49[_0xaabee6(0xfa)]&&(console['log'](_0xaabee6(0xd2)+_0x238a49[_0xaabee6(0x156)]+'\x27:'),console[_0xaabee6(0x14a)]('─'[_0xaabee6(0xf7)](0x3c)),console[_0xaabee6(0x14a)](_0x238a49[_0xaabee6(0xfa)]),console[_0xaabee6(0x14a)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x27ae42(0x156)]='agent:pull';[a4_0x27ae42(0x140)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0xbb5b95){const _0x4913dd=a4_0x27ae42,{options:_0x2923e6,args:_0x28e42e,tdx:_0xdbcc89}=_0xbb5b95,_0xdb8af3=_0x28e42e[0x0],_0x33deac=_0x28e42e[0x1],_0x1ea035=_0x2923e6[_0x4913dd(0x169)],_0x382b09=_0x2923e6[_0x4913dd(0x185)],_0x2250ec=_0x2923e6[_0x4913dd(0x135)],_0x2ac669=_0x2923e6[_0x4913dd(0x12b)],_0x261f73=_0x2923e6[_0x4913dd(0x16c)],_0x2249c5=_0x2923e6[_0x4913dd(0x180)];let _0x4eecf9;if(_0xdb8af3){const _0x1665a4=a4_0x596575[_0x4913dd(0xdd)](_0xdb8af3,_0x4913dd(0xf8));if(existsSync(_0x1665a4))try{const _0x2997ac=JSON[_0x4913dd(0x162)](readFileSync(_0x1665a4,_0x4913dd(0x151)));_0x2997ac[_0x4913dd(0x152)]&&(_0x4eecf9={'llm_project':_0x2997ac[_0x4913dd(0x152)]});}catch{}}const _0x1c5cc6=findAgentConfigPath(process[_0x4913dd(0x161)]());let _0xf82e4b;if(_0x1c5cc6)try{const _0x2c6347=JSON['parse'](readFileSync(_0x1c5cc6,'utf-8'));_0x2c6347[_0x4913dd(0x152)]&&(_0xf82e4b={'llm_project':_0x2c6347[_0x4913dd(0x152)]});}catch{}const _0x261920=resolveAgentPullArgs({'arg':_0xdb8af3,'agentNameArg':_0x33deac,'agentFlag':_0x2249c5,'contextProject':_0x261f73,'argDirConfig':_0x4eecf9,'cwdConfigPath':_0x1c5cc6||undefined,'cwdConfig':_0xf82e4b}),{projectNameOrId:_0x4601f9,targetAgentName:_0x4c10f5,existingOutputDir:_0x226b18,source:_0x36cbe7}=_0x261920;if(_0x36cbe7===_0x4913dd(0x155))console['log'](a4_0x52e8f3[_0x4913dd(0x102)](_0x4913dd(0x16f)+a4_0x596575[_0x4913dd(0xdd)](_0xdb8af3,_0x4913dd(0xf8))+':\x20'+_0x4601f9));else{if(_0x36cbe7===_0x4913dd(0x111))console[_0x4913dd(0x14a)](a4_0x52e8f3[_0x4913dd(0x102)](_0x4913dd(0x17a)+_0x4601f9));else _0x36cbe7==='context'&&console[_0x4913dd(0x14a)](a4_0x52e8f3['dim'](_0x4913dd(0x13d)+_0x4601f9));}if(!_0x4601f9)return _0x2249c5?(console[_0x4913dd(0x14a)](a4_0x52e8f3[_0x4913dd(0x112)](_0x4913dd(0xeb))),console['log'](_0x4913dd(0x104)),console[_0x4913dd(0x14a)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x4913dd(0x14a)](a4_0x52e8f3['yellow'](_0x4913dd(0xd8))),console[_0x4913dd(0x14a)](_0x4913dd(0x13e)),console[_0x4913dd(0x14a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x4913dd(0x14a)](_0x4913dd(0x130)),console[_0x4913dd(0x14a)](_0x4913dd(0xe2)),console[_0x4913dd(0x14a)](_0x4913dd(0x131))),0x1;if(_0x4c10f5){const {data:_0x5aff9b}=await withSpinner('Pulling\x20agent\x20\x22'+_0x4c10f5+'\x22\x20from\x20project\x20\x22'+_0x4601f9+_0x4913dd(0xf1),()=>_0xdbcc89['llm'][_0x4913dd(0x177)](_0x4601f9,_0x4c10f5,_0x1ea035,{'dryRun':_0x382b09,'force':_0x2250ec}));if(_0x382b09)return console[_0x4913dd(0x14a)](a4_0x52e8f3[_0x4913dd(0x112)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x4913dd(0x14a)](_0x4913dd(0x16a)+_0x5aff9b['agentName']),console[_0x4913dd(0x14a)](_0x4913dd(0x107)+_0x5aff9b['outputPath']),_0x5aff9b['diff']&&(console[_0x4913dd(0x14a)](_0x4913dd(0x108)),console[_0x4913dd(0x14a)]('─'[_0x4913dd(0xf7)](0x3c)),console[_0x4913dd(0x14a)](_0x5aff9b[_0x4913dd(0xfa)]),console['log']('─'[_0x4913dd(0xf7)](0x3c))),0x0;return console[_0x4913dd(0x14a)](a4_0x52e8f3[_0x4913dd(0x14e)](_0x4913dd(0x125))),console[_0x4913dd(0x14a)](_0x4913dd(0x132)+_0x5aff9b[_0x4913dd(0x15a)]),console['log'](_0x4913dd(0x166)+_0x5aff9b['outputPath']),console['log'](_0x4913dd(0x17f)+(_0x5aff9b[_0x4913dd(0x14b)]?a4_0x52e8f3[_0x4913dd(0x14e)](_0x4913dd(0x113)):_0x5aff9b[_0x4913dd(0xce)]?a4_0x52e8f3['yellow'](_0x4913dd(0x121)):a4_0x52e8f3[_0x4913dd(0x10a)]('unchanged'))),0x0;}const _0x3e3ed7=_0x226b18||_0x1ea035,{data:_0x5b82ec}=await withSpinner(_0x4913dd(0xd9)+_0x4601f9+_0x4913dd(0xf1),()=>_0xdbcc89[_0x4913dd(0xe6)][_0x4913dd(0xf6)](_0x4601f9,_0x3e3ed7,{'dryRun':!![]})),_0x91f5c9=_0x5b82ec[_0x4913dd(0x109)][_0x4913dd(0xdf)][_0x4913dd(0x113)]+_0x5b82ec[_0x4913dd(0x109)][_0x4913dd(0x149)][_0x4913dd(0x113)]+_0x5b82ec[_0x4913dd(0x109)][_0x4913dd(0x15f)][_0x4913dd(0x113)]+_0x5b82ec[_0x4913dd(0x109)][_0x4913dd(0x100)]['new']+_0x5b82ec[_0x4913dd(0x109)]['integrations'][_0x4913dd(0x113)]+_0x5b82ec[_0x4913dd(0x109)]['experimentalKnowledgeBases'][_0x4913dd(0x113)]+_0x5b82ec['counts'][_0x4913dd(0xef)][_0x4913dd(0x113)],_0x18309f=_0x5b82ec[_0x4913dd(0x109)][_0x4913dd(0xdf)][_0x4913dd(0x121)]+_0x5b82ec[_0x4913dd(0x109)][_0x4913dd(0x149)]['updated']+_0x5b82ec[_0x4913dd(0x109)][_0x4913dd(0x15f)]['updated']+_0x5b82ec[_0x4913dd(0x109)][_0x4913dd(0x100)]['updated']+_0x5b82ec[_0x4913dd(0x109)]['integrations'][_0x4913dd(0x121)]+_0x5b82ec[_0x4913dd(0x109)]['experimentalKnowledgeBases']['updated']+_0x5b82ec[_0x4913dd(0x109)]['experimentalArtifacts'][_0x4913dd(0x121)],_0x3379d2=_0x5b82ec[_0x4913dd(0x109)][_0x4913dd(0xdf)][_0x4913dd(0x12a)]+_0x5b82ec[_0x4913dd(0x109)][_0x4913dd(0x149)][_0x4913dd(0x12a)]+_0x5b82ec[_0x4913dd(0x109)][_0x4913dd(0x15f)][_0x4913dd(0x12a)]+_0x5b82ec[_0x4913dd(0x109)][_0x4913dd(0x100)][_0x4913dd(0x12a)]+_0x5b82ec[_0x4913dd(0x109)]['integrations']['unchanged']+_0x5b82ec[_0x4913dd(0x109)]['experimentalKnowledgeBases']['unchanged']+_0x5b82ec[_0x4913dd(0x109)][_0x4913dd(0xef)][_0x4913dd(0x12a)];console[_0x4913dd(0x14a)](_0x4913dd(0x186)+_0x5b82ec[_0x4913dd(0x168)]+'\x27:'),console[_0x4913dd(0x14a)]('\x20\x20'+a4_0x52e8f3[_0x4913dd(0x14e)]('+\x20'+_0x91f5c9+_0x4913dd(0x11f))+_0x4913dd(0xda)+a4_0x52e8f3[_0x4913dd(0x112)]('~\x20'+_0x18309f+_0x4913dd(0x11c))+_0x4913dd(0xda)+a4_0x52e8f3[_0x4913dd(0x102)]('=\x20'+_0x3379d2+'\x20unchanged')),console[_0x4913dd(0x14a)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5b82ec[_0x4913dd(0x109)][_0x4913dd(0xdf)])),console[_0x4913dd(0x14a)](_0x4913dd(0x15c)+formatCountSummary(_0x5b82ec[_0x4913dd(0x109)]['knowledgeBases'])),console['log'](_0x4913dd(0x154)+formatCountSummary(_0x5b82ec['counts'][_0x4913dd(0x15f)])),console['log'](_0x4913dd(0xfd)+formatCountSummary(_0x5b82ec[_0x4913dd(0x109)][_0x4913dd(0x100)])),console[_0x4913dd(0x14a)](_0x4913dd(0x12c)+formatCountSummary(_0x5b82ec[_0x4913dd(0x109)]['integrations']));const _0x551d9f=_0x5b82ec[_0x4913dd(0x109)]['experimentalKnowledgeBases'][_0x4913dd(0x115)]>0x0||_0x5b82ec[_0x4913dd(0x109)]['experimentalArtifacts'][_0x4913dd(0x115)]>0x0;_0x551d9f&&(console[_0x4913dd(0x14a)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5b82ec[_0x4913dd(0x109)][_0x4913dd(0x137)])),console[_0x4913dd(0x14a)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x5b82ec['counts']['experimentalArtifacts'])));console[_0x4913dd(0x14a)](_0x4913dd(0xd3)+a4_0x52e8f3[_0x4913dd(0x114)](_0x5b82ec['outputDir'])),displayDiffs(_0x5b82ec['agents'],_0x5b82ec[_0x4913dd(0x149)],_0x5b82ec[_0x4913dd(0x15f)],_0x5b82ec[_0x4913dd(0x100)],_0x5b82ec['integrations'],_0x5b82ec[_0x4913dd(0x137)],_0x5b82ec[_0x4913dd(0xef)]);if(_0x382b09)return console['log'](a4_0x52e8f3[_0x4913dd(0x112)](_0x4913dd(0x110))),0x0;if(_0x91f5c9===0x0&&_0x18309f===0x0)return console['log'](a4_0x52e8f3[_0x4913dd(0x14e)](_0x4913dd(0x143))),saveSessionContext({'llm_project':_0x5b82ec[_0x4913dd(0x168)]},_0x2923e6['session']),console[_0x4913dd(0x14a)](a4_0x52e8f3['green'](_0x4913dd(0x15b)+a4_0x52e8f3[_0x4913dd(0x102)](_0x4913dd(0x152))+_0x4913dd(0x129)+a4_0x52e8f3['cyan'](_0x5b82ec[_0x4913dd(0x168)]))),0x0;if(!_0x2ac669&&!_0x2250ec){if(!isInteractive())return console['error'](a4_0x52e8f3[_0x4913dd(0x183)](_0x4913dd(0xde)),_0x4913dd(0x174)),console[_0x4913dd(0x167)](a4_0x52e8f3[_0x4913dd(0x102)](_0x4913dd(0xe3))),0x1;const _0x4e2163=await confirmKey(_0x4913dd(0x181)+(_0x91f5c9+_0x18309f)+_0x4913dd(0x101));if(!_0x4e2163)return console[_0x4913dd(0x14a)](a4_0x52e8f3[_0x4913dd(0x112)](_0x4913dd(0xd7)),_0x4913dd(0x139)),0x1;}const {data:_0x50a141}=await withSpinner(_0x4913dd(0x13f),()=>_0xdbcc89['llm'][_0x4913dd(0xf6)](_0x4601f9,_0x3e3ed7,{'force':_0x2250ec}));return console[_0x4913dd(0x14a)](a4_0x52e8f3[_0x4913dd(0x14e)]('\x0a✔\x20Pulled\x20'+(_0x91f5c9+_0x18309f)+'\x20files\x20to\x20'+_0x50a141[_0x4913dd(0x123)])),saveSessionContext({'llm_project':_0x50a141[_0x4913dd(0x168)]},_0x2923e6[_0x4913dd(0x10f)]),console['log'](a4_0x52e8f3[_0x4913dd(0x14e)]('✔\x20Context\x20set:\x20'+a4_0x52e8f3['dim']('llm_project')+_0x4913dd(0x129)+a4_0x52e8f3[_0x4913dd(0x114)](_0x50a141['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x27ae42(0x156)]='agent:clone';[a4_0x27ae42(0x140)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x27ae42(0x117)](_0x3e99c3){const _0xa65764=a4_0x27ae42,{options:_0x2bcb0f,args:_0x1919dc,tdx:_0x1699ec}=_0x3e99c3,_0x4bda3e=_0x1919dc[0x0],_0x3e0b5f=_0x2bcb0f['name'],_0x1db7ec=_0x2bcb0f[_0xa65764(0x185)],_0x5b6baa=_0x2bcb0f[_0xa65764(0x12b)],_0x17bdb3=_0x2bcb0f[_0xa65764(0x118)],_0x623413=_0x2bcb0f[_0xa65764(0x16c)];let _0x464af5;const _0x598200=findAgentConfigPath(process[_0xa65764(0x161)]());if(_0x4bda3e){const _0x4635bc=a4_0x596575['join'](_0x4bda3e,_0xa65764(0xf8));existsSync(_0x4635bc)?(_0x464af5=_0x4bda3e,console[_0xa65764(0x14a)](a4_0x52e8f3[_0xa65764(0x102)](_0xa65764(0xe1)+_0x4bda3e))):_0x464af5=_0x4bda3e;}else{if(_0x598200)_0x464af5=a4_0x596575[_0xa65764(0x16e)](_0x598200),console[_0xa65764(0x14a)](a4_0x52e8f3[_0xa65764(0x102)](_0xa65764(0x10b)+_0x464af5));else{if(_0x623413){const _0x335c37=sanitizeForFilesystem(_0x623413);let _0x1128e5=_0x335c37,_0x546980=a4_0x596575[_0xa65764(0xdd)](process[_0xa65764(0x161)](),_0xa65764(0xdf),_0x335c37,_0xa65764(0xf8));if(!existsSync(_0x546980)){const _0x4fffdc=normalizeName(_0x623413),_0x2b0d33=a4_0x596575[_0xa65764(0xdd)](process[_0xa65764(0x161)](),_0xa65764(0xdf),_0x4fffdc,_0xa65764(0xf8));existsSync(_0x2b0d33)&&(_0x1128e5=_0x4fffdc,_0x546980=_0x2b0d33);}if(existsSync(_0x546980))_0x464af5=a4_0x596575[_0xa65764(0x16e)](_0x546980),console[_0xa65764(0x14a)](a4_0x52e8f3[_0xa65764(0x102)](_0xa65764(0xe1)+_0x464af5));else{const _0x54367c=_0x2bcb0f[_0xa65764(0x17d)];if(_0x54367c)throw new SDKError(ErrorCode[_0xa65764(0x14f)],_0xa65764(0x11a)+_0x623413+_0xa65764(0x13a),undefined,{'helpText':_0xa65764(0x124)+_0xa65764(0xee)+(_0xa65764(0xf3)+_0x623413+'\x0a')+(_0xa65764(0xf0)+_0x1128e5+_0xa65764(0x14c)+(_0x3e0b5f||_0xa65764(0x12d))+_0xa65764(0x150)+_0x54367c)});_0x464af5=_0x623413,console['log'](a4_0x52e8f3['dim'](_0xa65764(0x173)+_0x623413));}}}}if(!_0x464af5)return console['log'](a4_0x52e8f3[_0xa65764(0x112)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console['log']('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0xa65764(0x14a)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0xa65764(0x14a)](_0xa65764(0x171)),console[_0xa65764(0x14a)](_0xa65764(0x17c)),0x1;if(!_0x3e0b5f)throw new SDKError(ErrorCode[_0xa65764(0xcc)],_0xa65764(0xd4),undefined,{'helpText':_0xa65764(0x12e)});if(!_0x5b6baa&&!_0x1db7ec){if(!isInteractive())return console[_0xa65764(0x167)](a4_0x52e8f3[_0xa65764(0x183)](_0xa65764(0xde)),_0xa65764(0x174)),console[_0xa65764(0x167)](a4_0x52e8f3[_0xa65764(0x102)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5a1026=await confirmKey(_0xa65764(0xdb)+_0x464af5+_0xa65764(0xe8)+_0x3e0b5f+'\x22?');if(!_0x5a1026)return console[_0xa65764(0x14a)](a4_0x52e8f3[_0xa65764(0x112)]('Cancelled')),0x1;}const {data:_0x275462}=await withSpinner(_0xa65764(0x126)+_0x464af5+'\x22\x20to\x20\x22'+_0x3e0b5f+_0xa65764(0xf1),()=>_0x1699ec[_0xa65764(0xe6)][_0xa65764(0x16b)](_0x464af5,_0x3e0b5f,{'dryRun':_0x1db7ec}));if(_0x1db7ec){console[_0xa65764(0x14a)](a4_0x52e8f3['yellow'](_0xa65764(0xfe))),console['log']('Source:\x20'+_0x275462[_0xa65764(0x15d)]),console[_0xa65764(0x14a)](_0xa65764(0x144)+_0x3e0b5f),console[_0xa65764(0x14a)](_0xa65764(0xec)),console['log'](_0xa65764(0x127)+_0x275462[_0xa65764(0x109)][_0xa65764(0xdf)][_0xa65764(0xe7)]),console[_0xa65764(0x14a)](_0xa65764(0x15c)+_0x275462['counts']['knowledgeBases'][_0xa65764(0xe7)]),console['log']('\x20\x20Prompts:\x20'+_0x275462['counts']['prompts'][_0xa65764(0xe7)]);const _0x2872a9=_0x275462[_0xa65764(0x109)][_0xa65764(0x137)][_0xa65764(0xe7)]>0x0||_0x275462['counts'][_0xa65764(0xef)][_0xa65764(0xe7)]>0x0;return _0x2872a9&&(console[_0xa65764(0x14a)](_0xa65764(0x128)+_0x275462['counts'][_0xa65764(0x137)][_0xa65764(0xe7)]),console[_0xa65764(0x14a)](_0xa65764(0xe0)+_0x275462['counts'][_0xa65764(0xef)]['created'])),0x0;}const _0x34d60a=_0x275462[_0xa65764(0x109)]['agents'][_0xa65764(0x16d)]>0x0||_0x275462[_0xa65764(0x109)]['knowledgeBases'][_0xa65764(0x16d)]>0x0||_0x275462[_0xa65764(0x109)][_0xa65764(0x100)][_0xa65764(0x16d)]>0x0||_0x275462[_0xa65764(0x109)][_0xa65764(0x137)][_0xa65764(0x16d)]>0x0||_0x275462[_0xa65764(0x109)][_0xa65764(0xef)][_0xa65764(0x16d)]>0x0;_0x34d60a?console[_0xa65764(0x14a)](a4_0x52e8f3[_0xa65764(0x112)](_0xa65764(0xe9))):console['log'](a4_0x52e8f3['green']('Project\x20cloned\x20successfully'));console['log'](_0xa65764(0x176)+_0x275462[_0xa65764(0x15d)]),console[_0xa65764(0x14a)](_0xa65764(0x144)+_0x275462[_0xa65764(0x103)]),console[_0xa65764(0x14a)](_0xa65764(0xcb)+_0x275462[_0xa65764(0xe4)]),console[_0xa65764(0x14a)](),console[_0xa65764(0x14a)](_0xa65764(0x153)),console[_0xa65764(0x14a)](_0xa65764(0x127)+formatCountSummary(_0x275462[_0xa65764(0x109)][_0xa65764(0xdf)])),console['log'](_0xa65764(0x15c)+formatCountSummary(_0x275462[_0xa65764(0x109)][_0xa65764(0x149)])),console[_0xa65764(0x14a)](_0xa65764(0xfd)+formatCountSummary(_0x275462['counts']['prompts'])),console[_0xa65764(0x14a)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x275462[_0xa65764(0x109)][_0xa65764(0x157)]));const _0x4cd16d=_0x275462[_0xa65764(0x109)][_0xa65764(0x137)][_0xa65764(0xe7)]>0x0||_0x275462['counts'][_0xa65764(0x137)][_0xa65764(0x121)]>0x0||_0x275462['counts'][_0xa65764(0x137)][_0xa65764(0x12a)]>0x0||_0x275462[_0xa65764(0x109)][_0xa65764(0xef)][_0xa65764(0xe7)]>0x0||_0x275462[_0xa65764(0x109)]['experimentalArtifacts']['updated']>0x0||_0x275462['counts'][_0xa65764(0xef)]['unchanged']>0x0;_0x4cd16d&&(console[_0xa65764(0x14a)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x275462[_0xa65764(0x109)][_0xa65764(0x137)])),console['log'](_0xa65764(0xe0)+formatCountSummary(_0x275462[_0xa65764(0x109)][_0xa65764(0xef)])));if(_0x34d60a){console[_0xa65764(0x14a)](),console[_0xa65764(0x14a)](a4_0x52e8f3[_0xa65764(0x183)]('Errors:'));for(const _0xac29fe of _0x275462['agents']){_0xac29fe[_0xa65764(0x17b)]===_0xa65764(0x167)&&console[_0xa65764(0x14a)](a4_0x52e8f3[_0xa65764(0x183)](_0xa65764(0x163)+_0xac29fe[_0xa65764(0x15a)]+_0xa65764(0x134)+_0xac29fe['error']));}for(const _0x3ed82c of _0x275462[_0xa65764(0x149)]){_0x3ed82c[_0xa65764(0x17b)]==='error'&&console['log'](a4_0x52e8f3[_0xa65764(0x183)](_0xa65764(0x170)+_0x3ed82c[_0xa65764(0x156)]+'\x22:\x20'+_0x3ed82c[_0xa65764(0x167)]));}for(const _0x3ef019 of _0x275462[_0xa65764(0x100)]){_0x3ef019[_0xa65764(0x17b)]===_0xa65764(0x167)&&console[_0xa65764(0x14a)](a4_0x52e8f3[_0xa65764(0x183)](_0xa65764(0x136)+_0x3ef019[_0xa65764(0x156)]+_0xa65764(0x134)+_0x3ef019[_0xa65764(0x167)]));}for(const _0x5689aa of _0x275462[_0xa65764(0x157)]){_0x5689aa[_0xa65764(0x17b)]===_0xa65764(0x167)&&console[_0xa65764(0x14a)](a4_0x52e8f3[_0xa65764(0x183)](_0xa65764(0xd1)+_0x5689aa[_0xa65764(0x156)]+'\x22:\x20'+_0x5689aa['error']));}for(const _0x5ad2cc of _0x275462['experimentalKnowledgeBases']){_0x5ad2cc[_0xa65764(0x17b)]==='error'&&console[_0xa65764(0x14a)](a4_0x52e8f3[_0xa65764(0x183)](_0xa65764(0xd6)+_0x5ad2cc[_0xa65764(0x156)]+_0xa65764(0x134)+_0x5ad2cc['error']));}for(const _0x151a20 of _0x275462[_0xa65764(0xef)]){_0x151a20[_0xa65764(0x17b)]==='error'&&console[_0xa65764(0x14a)](a4_0x52e8f3[_0xa65764(0x183)](_0xa65764(0x146)+_0x151a20[_0xa65764(0x156)]+_0xa65764(0x134)+_0x151a20[_0xa65764(0x167)]));}return 0x1;}console[_0xa65764(0x14a)]();const _0x41b940=getLLMProjectUrl(_0x17bdb3,_0x275462[_0xa65764(0xe4)]);return console[_0xa65764(0x14a)](_0xa65764(0x178)+a4_0x52e8f3[_0xa65764(0x114)](_0x41b940)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x27ae42(0x156)]=a4_0x27ae42(0x122);[a4_0x27ae42(0x140)]=a4_0x27ae42(0x105);async['execute'](_0x5c71cc){const _0x17f328=a4_0x27ae42,{options:_0x4604da,args:_0x26b291,tdx:_0x3b5cc6}=_0x5c71cc;let _0x28298c=_0x26b291[0x0]||process['cwd']();const _0x4167c9=_0x4604da[_0x17f328(0x185)],_0x1ab7a5=_0x4604da[_0x17f328(0x135)],_0x3e6bc1=_0x4604da[_0x17f328(0x12b)],_0x78dd4b=_0x4604da[_0x17f328(0x118)],_0x48fafe=a4_0x596575['join'](_0x28298c,_0x17f328(0x159)),_0x4bf5e3=existsSync(_0x48fafe);if(_0x4bf5e3){const {data:_0x587d8f}=await withSpinner(_0x17f328(0x14d)+_0x28298c+_0x17f328(0xf1),()=>_0x3b5cc6[_0x17f328(0xe6)][_0x17f328(0xfb)](_0x28298c,{'dryRun':_0x4167c9,'force':_0x1ab7a5}));if(_0x4167c9)return console[_0x17f328(0x14a)](a4_0x52e8f3['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x17f328(0x14a)]('Would\x20push\x20agent:\x20'+_0x587d8f[_0x17f328(0x15a)]),0x0;if(_0x587d8f['action']==='error')return console[_0x17f328(0x14a)](a4_0x52e8f3[_0x17f328(0x183)](_0x17f328(0x138)+_0x587d8f[_0x17f328(0x167)])),0x1;console[_0x17f328(0x14a)](a4_0x52e8f3[_0x17f328(0x14e)]('Agent\x20'+_0x587d8f[_0x17f328(0x17b)]+_0x17f328(0x13c))),console[_0x17f328(0x14a)](_0x17f328(0x132)+_0x587d8f[_0x17f328(0x15a)]);if(_0x587d8f['agentId']&&_0x587d8f[_0x17f328(0x120)]){const _0x1fc7f7=getLLMAgentChatUrl(_0x78dd4b,_0x587d8f['projectId'],_0x587d8f[_0x17f328(0xf5)]);console[_0x17f328(0x14a)](_0x17f328(0xdc)+a4_0x52e8f3['cyan'](_0x1fc7f7));}return 0x0;}const _0x1e5968=_0x4604da[_0x17f328(0x16c)],_0x18aa61=resolveProjectFromContext(_0x28298c,_0x1e5968);if(_0x18aa61[_0x17f328(0x133)])_0x28298c=_0x18aa61[_0x17f328(0x165)],_0x18aa61['source']===_0x17f328(0xd0)&&console[_0x17f328(0x14a)](a4_0x52e8f3[_0x17f328(0x102)](_0x17f328(0x17a)+_0x28298c));else{let _0x250108=_0x17f328(0x158);_0x18aa61[_0x17f328(0x13b)]===_0x17f328(0x12f)&&(_0x250108=_0x18aa61[_0x17f328(0x17e)]+_0x17f328(0xcd)+_0x18aa61['llmProject']+_0x17f328(0x179));throw new SDKError(ErrorCode[_0x17f328(0x14f)],_0x18aa61[_0x17f328(0x13b)]===_0x17f328(0x172)?_0x18aa61['message']:_0x17f328(0x142)+_0x28298c,undefined,{'helpText':_0x250108});}const {data:_0x1ea530}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x3b5cc6['llm'][_0x17f328(0x184)](_0x28298c,{'dryRun':!![]})),_0x277c0f=_0x1ea530['counts'][_0x17f328(0xdf)][_0x17f328(0x16d)]>0x0;if(_0x277c0f){console[_0x17f328(0x14a)](a4_0x52e8f3[_0x17f328(0x183)](_0x17f328(0x160)));for(const _0x1f4dc9 of _0x1ea530[_0x17f328(0xdf)]){_0x1f4dc9[_0x17f328(0x17b)]===_0x17f328(0x167)&&console[_0x17f328(0x14a)](a4_0x52e8f3[_0x17f328(0x183)](_0x17f328(0x163)+_0x1f4dc9[_0x17f328(0x15a)]+_0x17f328(0x134)+_0x1f4dc9['error']));}return 0x1;}const _0x1a34c4=_0x1ea530[_0x17f328(0x109)][_0x17f328(0xdf)][_0x17f328(0xe7)]+_0x1ea530[_0x17f328(0x109)]['knowledgeBases']['created']+_0x1ea530[_0x17f328(0x109)][_0x17f328(0x15f)]['created']+_0x1ea530[_0x17f328(0x109)][_0x17f328(0x100)][_0x17f328(0xe7)]+_0x1ea530[_0x17f328(0x109)][_0x17f328(0x157)][_0x17f328(0xe7)]+_0x1ea530[_0x17f328(0x109)][_0x17f328(0x137)]['created']+_0x1ea530[_0x17f328(0x109)]['experimentalArtifacts'][_0x17f328(0xe7)],_0x41bc1e=_0x1ea530[_0x17f328(0x109)][_0x17f328(0xdf)][_0x17f328(0x121)]+_0x1ea530['counts'][_0x17f328(0x149)][_0x17f328(0x121)]+_0x1ea530[_0x17f328(0x109)][_0x17f328(0x15f)][_0x17f328(0x121)]+_0x1ea530[_0x17f328(0x109)][_0x17f328(0x100)][_0x17f328(0x121)]+_0x1ea530[_0x17f328(0x109)]['integrations']['updated']+_0x1ea530[_0x17f328(0x109)][_0x17f328(0x137)][_0x17f328(0x121)]+_0x1ea530[_0x17f328(0x109)][_0x17f328(0xef)][_0x17f328(0x121)],_0x52b432=_0x1ea530[_0x17f328(0x109)][_0x17f328(0xdf)]['unchanged']+_0x1ea530['counts'][_0x17f328(0x149)]['unchanged']+_0x1ea530[_0x17f328(0x109)][_0x17f328(0x15f)][_0x17f328(0x12a)]+_0x1ea530[_0x17f328(0x109)][_0x17f328(0x100)][_0x17f328(0x12a)]+_0x1ea530[_0x17f328(0x109)]['integrations'][_0x17f328(0x12a)]+_0x1ea530[_0x17f328(0x109)]['experimentalKnowledgeBases'][_0x17f328(0x12a)]+_0x1ea530[_0x17f328(0x109)][_0x17f328(0xef)]['unchanged'];console[_0x17f328(0x14a)]('\x0aPush\x20summary\x20for\x20\x27'+_0x1ea530[_0x17f328(0x168)]+'\x27:'),console[_0x17f328(0x14a)]('\x20\x20'+a4_0x52e8f3[_0x17f328(0x14e)]('+\x20'+_0x1a34c4+_0x17f328(0x11f))+_0x17f328(0xda)+a4_0x52e8f3[_0x17f328(0x112)]('~\x20'+_0x41bc1e+_0x17f328(0x11c))+_0x17f328(0xda)+a4_0x52e8f3[_0x17f328(0x102)]('=\x20'+_0x52b432+_0x17f328(0x141))),console['log'](_0x17f328(0x127)+formatCountSummary(_0x1ea530[_0x17f328(0x109)][_0x17f328(0xdf)])),console[_0x17f328(0x14a)](_0x17f328(0x15c)+formatCountSummary(_0x1ea530[_0x17f328(0x109)]['knowledgeBases'])),console['log'](_0x17f328(0x154)+formatCountSummary(_0x1ea530[_0x17f328(0x109)]['textKnowledgeBases'])),console[_0x17f328(0x14a)](_0x17f328(0xfd)+formatCountSummary(_0x1ea530[_0x17f328(0x109)]['prompts'])),console[_0x17f328(0x14a)](_0x17f328(0x12c)+formatCountSummary(_0x1ea530[_0x17f328(0x109)][_0x17f328(0x157)]));const _0x4f7569=_0x1ea530[_0x17f328(0x109)]['experimentalKnowledgeBases'][_0x17f328(0xe7)]>0x0||_0x1ea530[_0x17f328(0x109)]['experimentalKnowledgeBases'][_0x17f328(0x121)]>0x0||_0x1ea530[_0x17f328(0x109)][_0x17f328(0x137)][_0x17f328(0x12a)]>0x0||_0x1ea530[_0x17f328(0x109)][_0x17f328(0xef)][_0x17f328(0xe7)]>0x0||_0x1ea530[_0x17f328(0x109)][_0x17f328(0xef)][_0x17f328(0x121)]>0x0||_0x1ea530[_0x17f328(0x109)][_0x17f328(0xef)][_0x17f328(0x12a)]>0x0;_0x4f7569&&(console[_0x17f328(0x14a)](_0x17f328(0x128)+formatCountSummary(_0x1ea530[_0x17f328(0x109)][_0x17f328(0x137)])),console[_0x17f328(0x14a)](_0x17f328(0xe0)+formatCountSummary(_0x1ea530['counts'][_0x17f328(0xef)])));console['log'](_0x17f328(0x11e)+a4_0x52e8f3[_0x17f328(0x114)](_0x28298c)),displayDiffs(_0x1ea530[_0x17f328(0xdf)],_0x1ea530[_0x17f328(0x149)],_0x1ea530[_0x17f328(0x15f)],_0x1ea530['prompts'],_0x1ea530[_0x17f328(0x157)],_0x1ea530['experimentalKnowledgeBases'],_0x1ea530[_0x17f328(0xef)]);if(_0x4167c9)return console[_0x17f328(0x14a)](a4_0x52e8f3[_0x17f328(0x112)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x1a34c4===0x0&&_0x41bc1e===0x0){console[_0x17f328(0x14a)](a4_0x52e8f3['green'](_0x17f328(0x10c)));const _0x27a872=getLLMProjectUrl(_0x78dd4b,_0x1ea530['projectId']);return console[_0x17f328(0x14a)](_0x17f328(0x178)+a4_0x52e8f3['cyan'](_0x27a872)),0x0;}if(!_0x3e6bc1&&!_0x1ab7a5){if(!isInteractive())return console[_0x17f328(0x167)](a4_0x52e8f3[_0x17f328(0x183)](_0x17f328(0xde)),_0x17f328(0x174)),console['error'](a4_0x52e8f3[_0x17f328(0x102)](_0x17f328(0xe3))),0x1;const _0x3606d5=await confirmKey(_0x17f328(0xd5)+(_0x1a34c4+_0x41bc1e)+_0x17f328(0xe5));if(!_0x3606d5)return console[_0x17f328(0x14a)](a4_0x52e8f3[_0x17f328(0x112)](_0x17f328(0xd7)),_0x17f328(0xf9)),0x1;}const {data:_0x177041}=await withSpinner(_0x17f328(0x175),()=>_0x3b5cc6[_0x17f328(0xe6)][_0x17f328(0x184)](_0x28298c,{'force':_0x1ab7a5})),_0x5c8c8a=_0x177041['counts']['agents'][_0x17f328(0x16d)]>0x0||_0x177041['counts']['knowledgeBases']['errors']>0x0||_0x177041[_0x17f328(0x109)][_0x17f328(0x15f)][_0x17f328(0x16d)]>0x0||_0x177041[_0x17f328(0x109)][_0x17f328(0x100)][_0x17f328(0x16d)]>0x0;if(_0x5c8c8a){console['log'](a4_0x52e8f3[_0x17f328(0x112)](_0x17f328(0xf2))),console[_0x17f328(0x14a)](),console[_0x17f328(0x14a)](a4_0x52e8f3[_0x17f328(0x183)](_0x17f328(0xff)));for(const _0x55943c of _0x177041[_0x17f328(0xdf)]){_0x55943c[_0x17f328(0x17b)]===_0x17f328(0x167)&&console[_0x17f328(0x14a)](a4_0x52e8f3[_0x17f328(0x183)](_0x17f328(0x163)+_0x55943c['agentName']+_0x17f328(0x134)+_0x55943c[_0x17f328(0x167)]));}for(const _0x434cd6 of _0x177041[_0x17f328(0x149)]){_0x434cd6[_0x17f328(0x17b)]==='error'&&console[_0x17f328(0x14a)](a4_0x52e8f3[_0x17f328(0x183)](_0x17f328(0x170)+_0x434cd6['name']+_0x17f328(0x134)+_0x434cd6[_0x17f328(0x167)]));}for(const _0x4a5650 of _0x177041[_0x17f328(0x15f)]){_0x4a5650[_0x17f328(0x17b)]===_0x17f328(0x167)&&console[_0x17f328(0x14a)](a4_0x52e8f3[_0x17f328(0x183)](_0x17f328(0x145)+_0x4a5650[_0x17f328(0x156)]+_0x17f328(0x134)+_0x4a5650[_0x17f328(0x167)]));}for(const _0x37acdc of _0x177041[_0x17f328(0x100)]){_0x37acdc['action']===_0x17f328(0x167)&&console[_0x17f328(0x14a)](a4_0x52e8f3[_0x17f328(0x183)](_0x17f328(0x136)+_0x37acdc[_0x17f328(0x156)]+'\x22:\x20'+_0x37acdc[_0x17f328(0x167)]));}for(const _0x41cf6a of _0x177041[_0x17f328(0x157)]){_0x41cf6a[_0x17f328(0x17b)]===_0x17f328(0x167)&&console['log'](a4_0x52e8f3[_0x17f328(0x183)](_0x17f328(0xd1)+_0x41cf6a[_0x17f328(0x156)]+'\x22:\x20'+_0x41cf6a[_0x17f328(0x167)]));}return 0x1;}console[_0x17f328(0x14a)](a4_0x52e8f3['green'](_0x17f328(0x10d)+(_0x1a34c4+_0x41bc1e)+'\x20resources\x20to\x20\x27'+_0x177041[_0x17f328(0x168)]+'\x27'));const _0x4fa395=getLLMProjectUrl(_0x78dd4b,_0x177041[_0x17f328(0x120)]);return console[_0x17f328(0x14a)](_0x17f328(0x178)+a4_0x52e8f3[_0x17f328(0x114)](_0x4fa395)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x2240af=a5_0x40cd;function a5_0x40cd(_0x1c106b,_0x59f183){_0x1c106b=_0x1c106b-0x86;const _0x56410d=a5_0x5641();let _0x40cd56=_0x56410d[_0x1c106b];return _0x40cd56;}function a5_0x5641(){const _0x3f9194=['split','join','table','404','272630PTqSaA','agent:test','\x20(cached)','✗\x20FAIL:\x20','filter','tsv','writeFileSync','dryRun','resolveProjectId','agentDirs','utf-8','\x20\x20Project:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Round\x201/','isSpinning','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','green','agent','⚠\x20SKIPPED:\x20','765338AUFeDj','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Run\x20tests\x20for\x20an\x20LLM\x20agent','red','Agent:\x20','projectName','\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_tests','\x20\x20Evaluating...\x20','\x20\x20Agent:\x20','resolve','verbose','status','existsSync','66wURKjI','log','llmProject','map','Running\x20agent\x20tests...','yellow','Errors:\x20\x20\x20','source','✗\x20ERROR:\x20Project\x20not\x20found:\x20','16UiNAnf','tests','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','executeReeval','message','substring','...','size','12gHPvXY','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','start','Using\x20agent:\x20','Available\x20tests:\x20','site','✓\x20PASS:\x20','some','FAIL','Error\x20writing\x20output\x20file:\x20','Re-evaluating\x20cached\x20test\x20run...','ERROR','conversation_url','dim','214150Eirswt','Executing\x20new\x20tests...','Round\x20','Total:\x20\x20\x20\x20','Evaluating\x20response...','Available\x20tags:\x20','context','Site:\x20','1835872GrSbzN','No\x20tests\x20found\x20matching:\x20','Failed:\x20\x20\x20','toLowerCase','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','✗\x20ERROR:\x20','\x20\x20Conversation:\x20','forEach','Duration:\x20','Cached\x20run\x20from:\x20','\x20-\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','...\x20','basename','Test\x20','text','Output\x20written\x20to:\x20','not\x20found','Project\x20path:\x20','conversations','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','2pWUUJe','\x20\x20Round\x20','push',':\x20Sending\x20user\x20input...','agentName','name','567759uvnldJ','reeval','Error:\x20No\x20previous\x20test\x20run\x20found.','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','now','projectDir','length','\x20\x20Site:\x20','No\x20tests\x20have\x20tags\x20defined.','round','1085004LBKmRr','has','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','rounds','Test\x20Configuration:','testName','toISOString','PASS','reason','trim','find','resolveAgentId','Run\x20\x27tdx\x20agent\x20pull\x20','llm','tags','139355ayxDGN','repeat','Running:\x20','eval','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Tests\x20found:\x20','Running\x20test:\x20','\x20\x20-\x20','execute','\x22:\x20','stop','cyan','81rEMbsY','Passed:\x20\x20\x20','includes','white','\x27\x20to\x20create\x20the\x20folder\x20structure.','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','jsonl','test.yml','multiple_agents','Re-evaluating...','Test\x20Summary'];a5_0x5641=function(){return _0x3f9194;};return a5_0x5641();}(function(_0x1d8454,_0xeccc0e){const _0x2604f4=a5_0x40cd,_0xfd5d90=_0x1d8454();while(!![]){try{const _0x36a794=-parseInt(_0x2604f4(0x8d))/0x1+-parseInt(_0x2604f4(0xaa))/0x2*(parseInt(_0x2604f4(0xb0))/0x3)+-parseInt(_0x2604f4(0x10f))/0x4*(parseInt(_0x2604f4(0xca))/0x5)+parseInt(_0x2604f4(0x117))/0x6*(parseInt(_0x2604f4(0xf8))/0x7)+parseInt(_0x2604f4(0x95))/0x8+parseInt(_0x2604f4(0xd6))/0x9*(-parseInt(_0x2604f4(0xe5))/0xa)+-parseInt(_0x2604f4(0x106))/0xb*(-parseInt(_0x2604f4(0xba))/0xc);if(_0x36a794===_0xeccc0e)break;else _0xfd5d90['push'](_0xfd5d90['shift']());}catch(_0x4b3591){_0xfd5d90['push'](_0xfd5d90['shift']());}}}(a5_0x5641,0x38400));import*as a5_0x228e74 from'node:fs';import*as a5_0x5b5922 from'node:path';import a5_0x1dc59b 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{['name']=a5_0x2240af(0xe6);['description']=a5_0x2240af(0xfa);async[a5_0x2240af(0xd2)](_0x47e489){const _0x3c1166=a5_0x2240af,{options:_0x1f2d2d,args:_0x13d1cd,tdx:_0x366945}=_0x47e489,_0xb5ef1b=_0x13d1cd[0x0]||'.',_0x366558=_0x1f2d2d[_0x3c1166(0xec)],_0x331366=_0x1f2d2d,_0x1e51a7=_0x331366[_0x3c1166(0xcd)]===![],_0x1e0fca=_0x331366[_0x3c1166(0xb1)],_0x3251b2=_0x331366[_0x3c1166(0xaf)],_0xf310a1=_0x331366[_0x3c1166(0xc9)],_0x335adc=_0x1f2d2d[_0x3c1166(0x11c)],_0x2ffe10=_0x331366['output'];if(_0x1e0fca&&_0x1e51a7)return console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0xfb)](_0x3c1166(0xce))),0x1;let _0x4b6611=_0x3c1166(0xe3);if(_0x331366['json'])_0x4b6611='json';else{if(_0x331366[_0x3c1166(0xdc)])_0x4b6611=_0x3c1166(0xdc);else{if(_0x331366[_0x3c1166(0xea)])_0x4b6611=_0x3c1166(0xea);else{if(_0x331366[_0x3c1166(0xe3)])_0x4b6611=_0x3c1166(0xe3);}}}const _0xdd545c=_0x331366[_0x3c1166(0x108)];let _0x1b7e83=_0xb5ef1b;const _0x2cb53b=a5_0x228e74[_0x3c1166(0x105)](_0xb5ef1b),_0x4208f0=_0xb5ef1b==='.';if(!_0x2cb53b||_0x4208f0){const _0x23f02b=resolveProjectFromContext(_0xb5ef1b,_0xdd545c,{'requireFile':_0x3c1166(0xdd)});if(_0x23f02b['found'])_0x1b7e83=_0x23f02b['projectDir'],_0x23f02b[_0x3c1166(0x10d)]===_0x3c1166(0x93)&&console[_0x3c1166(0x107)](a5_0x1dc59b['dim'](_0x3c1166(0x11a)+_0x1b7e83));else switch(_0x23f02b[_0x3c1166(0xc3)]){case'no_context':console[_0x3c1166(0x107)](a5_0x1dc59b['yellow'](_0x23f02b['message'])),console[_0x3c1166(0x107)](),console[_0x3c1166(0x107)]('Usage:'),console['log'](_0x3c1166(0xfe)),console['log'](_0x3c1166(0xf4)),console[_0x3c1166(0x107)](),console[_0x3c1166(0x107)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case'no_local_folder':console[_0x3c1166(0x107)](a5_0x1dc59b['yellow'](_0x23f02b[_0x3c1166(0x113)])),console['log'](),console['log'](_0x3c1166(0xc7)+_0x23f02b['llmProject']+_0x3c1166(0xda));return 0x1;case _0x3c1166(0xde):{const _0x255e06=a5_0x5b5922[_0x3c1166(0xa2)](_0x23f02b['projectDir']);console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0x10b)](_0x3c1166(0xf1)+_0x23f02b[_0x3c1166(0x108)]+'\x22:'));for(const _0x4d3eae of _0x23f02b[_0x3c1166(0xee)]){console[_0x3c1166(0x107)](_0x3c1166(0xd1)+_0x4d3eae);}return console[_0x3c1166(0x107)](),console[_0x3c1166(0x107)](_0x3c1166(0x118)+_0x255e06+'/<agent-name>'),0x1;}case _0x3c1166(0xff):console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0x10b)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x23f02b[_0x3c1166(0x108)]+'\x22.')),console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0x8c)](_0x3c1166(0xa7)+_0x23f02b[_0x3c1166(0xb5)])),console['log'](),console[_0x3c1166(0x107)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x1d5e8e,agentInfo:_0x14b964}=parseTestFile(_0x1b7e83);let _0x233ef5=_0x1d5e8e[_0x3c1166(0x110)];if(_0x3251b2){const _0x497ddc=_0x3251b2[_0x3c1166(0xe1)](',')[_0x3c1166(0x109)](_0x3fb42f=>_0x3fb42f[_0x3c1166(0xc4)]());_0x233ef5=_0x1d5e8e[_0x3c1166(0x110)][_0x3c1166(0xe9)](_0x753ce6=>_0x497ddc[_0x3c1166(0xd8)](_0x753ce6['name']));if(_0x233ef5[_0x3c1166(0xb6)]===0x0)return console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0x10b)](_0x3c1166(0x96)+_0x3251b2)),console['log'](a5_0x1dc59b[_0x3c1166(0x8c)](_0x3c1166(0x11b)+_0x1d5e8e[_0x3c1166(0x110)][_0x3c1166(0x109)](_0x5b6df8=>_0x5b6df8[_0x3c1166(0xaf)])[_0x3c1166(0xe2)](',\x20'))),0x1;}if(_0xf310a1){const _0x10aa89=_0xf310a1['split'](',')[_0x3c1166(0x109)](_0x3d0e98=>_0x3d0e98[_0x3c1166(0xc4)]()[_0x3c1166(0x98)]());_0x233ef5=_0x233ef5[_0x3c1166(0xe9)](_0x1316b1=>_0x1316b1[_0x3c1166(0xc9)]?.[_0x3c1166(0x86)](_0x114290=>_0x10aa89[_0x3c1166(0xd8)](_0x114290[_0x3c1166(0x98)]())));if(_0x233ef5[_0x3c1166(0xb6)]===0x0){console['log'](a5_0x1dc59b[_0x3c1166(0x10b)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0xf310a1));const _0x2ecec4=new Set();return _0x1d5e8e[_0x3c1166(0x110)]['forEach'](_0x1cab9e=>_0x1cab9e['tags']?.[_0x3c1166(0x9c)](_0x331dec=>_0x2ecec4['add'](_0x331dec))),_0x2ecec4[_0x3c1166(0x116)]>0x0?console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0x8c)](_0x3c1166(0x92)+[..._0x2ecec4]['join'](',\x20'))):console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0x8c)](_0x3c1166(0xb8))),0x1;}}if(_0x1e0fca)return this[_0x3c1166(0x112)](_0x47e489,{'definition':{'tests':_0x233ef5},'agentInfo':_0x14b964,'outputFormat':_0x4b6611,'outputFile':_0x2ffe10,'testNames':_0x3251b2});if(_0x366558){console['log'](a5_0x1dc59b[_0x3c1166(0xd5)](_0x3c1166(0xbf))),console['log'](_0x3c1166(0xb7)+a5_0x1dc59b[_0x3c1166(0xd9)](_0x335adc)),console[_0x3c1166(0x107)](_0x3c1166(0xf0)+a5_0x1dc59b[_0x3c1166(0xd9)](_0x14b964[_0x3c1166(0xfd)])),console[_0x3c1166(0x107)](_0x3c1166(0x101)+a5_0x1dc59b['white'](_0x14b964[_0x3c1166(0xae)])),console[_0x3c1166(0x107)](),console[_0x3c1166(0x107)](_0x3c1166(0xcf)+a5_0x1dc59b[_0x3c1166(0xd9)](_0x233ef5[_0x3c1166(0xb6)]));for(let _0x1d90bb=0x0;_0x1d90bb<_0x233ef5[_0x3c1166(0xb6)];_0x1d90bb++){const _0x19d97c=_0x233ef5[_0x1d90bb],_0xf79188=_0x19d97c[_0x3c1166(0xbe)]['length']===0x1?_0x3c1166(0xb9):'rounds',_0x2db847=_0x19d97c['tags']?.[_0x3c1166(0xb6)]?'\x20['+_0x19d97c[_0x3c1166(0xc9)][_0x3c1166(0xe2)](',\x20')+']':'';console[_0x3c1166(0x107)]('\x20\x20'+(_0x1d90bb+0x1)+'.\x20'+a5_0x1dc59b[_0x3c1166(0xd9)](_0x19d97c['name'])+'\x20('+_0x19d97c[_0x3c1166(0xbe)][_0x3c1166(0xb6)]+'\x20'+_0xf79188+')'+a5_0x1dc59b[_0x3c1166(0x8c)](_0x2db847));}return 0x0;}let _0x295514,_0x401388;try{_0x295514=await _0x366945[_0x3c1166(0xc8)][_0x3c1166(0xed)](_0x14b964[_0x3c1166(0xfd)]);}catch(_0x568721){const _0x2fa1c7=_0x568721 instanceof Error?_0x568721[_0x3c1166(0x113)]:String(_0x568721);return _0x2fa1c7[_0x3c1166(0xd8)](_0x3c1166(0xe4))||_0x2fa1c7[_0x3c1166(0x98)]()['includes'](_0x3c1166(0xa6))?console['log'](a5_0x1dc59b['red'](_0x3c1166(0x10e)+_0x14b964[_0x3c1166(0xfd)])):console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0xfb)](_0x3c1166(0xf9)+_0x14b964[_0x3c1166(0xfd)]+_0x3c1166(0xd3)+_0x2fa1c7)),0x1;}try{_0x401388=await _0x366945[_0x3c1166(0xc8)][_0x3c1166(0xc6)](_0x14b964[_0x3c1166(0xae)],_0x295514);}catch(_0x2015f8){const _0x4d8240=_0x2015f8 instanceof Error?_0x2015f8[_0x3c1166(0x113)]:String(_0x2015f8);return _0x4d8240[_0x3c1166(0xd8)](_0x3c1166(0xe4))||_0x4d8240[_0x3c1166(0x98)]()[_0x3c1166(0xd8)](_0x3c1166(0xa6))?console['log'](a5_0x1dc59b['red'](_0x3c1166(0xa0)+_0x14b964[_0x3c1166(0xae)])):console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0xfb)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x14b964[_0x3c1166(0xae)]+_0x3c1166(0xd3)+_0x4d8240)),0x1;}let _0x24bb26;if(!_0x1e51a7)try{_0x24bb26=await setupEvaluatorAgent(_0x366945[_0x3c1166(0xc8)],_0x1f2d2d[_0x3c1166(0x103)]);}catch(_0x277a56){const _0x4891a3=_0x277a56 instanceof Error?_0x277a56[_0x3c1166(0x113)]:String(_0x277a56);return console[_0x3c1166(0x107)](a5_0x1dc59b['red'](_0x3c1166(0x99)+_0x4891a3)),0x1;}console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0xd5)](_0x3c1166(0x10a))),console[_0x3c1166(0x107)](_0x3c1166(0x94)+a5_0x1dc59b[_0x3c1166(0xd9)](_0x335adc)),console[_0x3c1166(0x107)](_0x3c1166(0xfc)+a5_0x1dc59b[_0x3c1166(0xd9)](_0x14b964[_0x3c1166(0xfd)]+'/'+_0x14b964[_0x3c1166(0xae)])),console[_0x3c1166(0x107)]();const _0x742987=[],_0x305a9c=[],_0xbba474=Date[_0x3c1166(0xb4)]();for(let _0xd7aeeb=0x0;_0xd7aeeb<_0x233ef5[_0x3c1166(0xb6)];_0xd7aeeb++){const _0x27ef1d=_0x233ef5[_0xd7aeeb];_0x233ef5[_0x3c1166(0xb6)]>0x1?console['log'](_0x3c1166(0xa3)+(_0xd7aeeb+0x1)+'/'+_0x233ef5['length']+':\x20'+a5_0x1dc59b[_0x3c1166(0xd9)](_0x27ef1d[_0x3c1166(0xaf)])):console[_0x3c1166(0x107)](_0x3c1166(0xd0)+a5_0x1dc59b[_0x3c1166(0xd9)](_0x27ef1d[_0x3c1166(0xaf)]));const _0x4f59f7=createCommandSpinner(_0x3c1166(0xf2)+_0x27ef1d[_0x3c1166(0xbe)][_0x3c1166(0xb6)]+_0x3c1166(0xad));_0x4f59f7[_0x3c1166(0x119)]();try{const {result:_0x12eb1b,conversation:_0x13edfb}=await runTest(_0x366945[_0x3c1166(0xc8)],_0x27ef1d,{'agentId':_0x401388,'projectId':_0x295514,'site':_0x335adc,'noEval':_0x1e51a7,'evaluatorId':_0x24bb26,'onRoundStart':(_0x2b897b,_0x49d189)=>{const _0x40f63e=_0x3c1166;_0x4f59f7[_0x40f63e(0xa4)]=_0x40f63e(0x8f)+(_0x2b897b+0x1)+'/'+_0x49d189+_0x40f63e(0xad);},'onRoundComplete':(_0x4e9024,_0x3ff290,_0x3514ee)=>{const _0x283d93=_0x3c1166,_0x39677b=formatElapsed(_0x3ff290);_0x3514ee?console[_0x283d93(0x107)]('\x20\x20Round\x20'+(_0x4e9024+0x1)+'/'+_0x27ef1d[_0x283d93(0xbe)]['length']+_0x283d93(0xa1)+a5_0x1dc59b[_0x283d93(0xf5)]('✓')+'\x20('+_0x39677b+')'):console[_0x283d93(0x107)](_0x283d93(0xab)+(_0x4e9024+0x1)+'/'+_0x27ef1d[_0x283d93(0xbe)]['length']+'...\x20'+a5_0x1dc59b[_0x283d93(0xfb)]('✗'));},'onEvaluationStart':()=>{const _0x33dfb8=_0x3c1166;_0x4f59f7[_0x33dfb8(0xa4)]=_0x33dfb8(0x91);},'onEvaluationComplete':_0x37d80a=>{const _0x2cd999=_0x3c1166,_0x15dd56=formatElapsed(_0x37d80a);console[_0x2cd999(0x107)]('\x20\x20Evaluating...\x20'+a5_0x1dc59b[_0x2cd999(0xf5)]('✓')+'\x20('+_0x15dd56+')');}});_0x4f59f7[_0x3c1166(0xd4)](),_0x742987[_0x3c1166(0xac)](_0x12eb1b),_0x305a9c[_0x3c1166(0xac)](_0x13edfb);if(_0x12eb1b['status']===_0x3c1166(0xc2))console[_0x3c1166(0x107)](a5_0x1dc59b['green'](_0x3c1166(0x11d)+_0x12eb1b[_0x3c1166(0xc3)]));else _0x12eb1b[_0x3c1166(0x104)]==='FAIL'?console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0xfb)](_0x3c1166(0xe8)+_0x12eb1b[_0x3c1166(0xc3)])):console['log'](a5_0x1dc59b[_0x3c1166(0xfb)](_0x3c1166(0x9a)+_0x12eb1b[_0x3c1166(0xc3)]));_0x12eb1b[_0x3c1166(0x8b)]&&console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0x8c)]('Conversation\x20URL:\x20'+_0x12eb1b['conversation_url'])),console[_0x3c1166(0x107)]();}catch(_0x5f3e9c){_0x4f59f7['stop']();const _0x2bfb8b=_0x5f3e9c instanceof Error?_0x5f3e9c['message']:String(_0x5f3e9c);console['log'](a5_0x1dc59b['red'](_0x3c1166(0x9a)+_0x2bfb8b)),console['log'](),_0x742987['push']({'name':_0x27ef1d[_0x3c1166(0xaf)],'status':_0x3c1166(0x8a),'reason':_0x2bfb8b,'timestamp':new Date()[_0x3c1166(0xc1)](),'duration_ms':0x0});}}const _0x2d83c7=Date['now']()-_0xbba474,_0x5c18e1=_0x742987['filter'](_0x3e40fd=>_0x3e40fd['status']===_0x3c1166(0xc2))[_0x3c1166(0xb6)],_0x20a29f=_0x742987[_0x3c1166(0xe9)](_0x1944ba=>_0x1944ba[_0x3c1166(0x104)]===_0x3c1166(0x87))[_0x3c1166(0xb6)],_0x18c622=_0x742987[_0x3c1166(0xe9)](_0x46bf6e=>_0x46bf6e[_0x3c1166(0x104)]===_0x3c1166(0x8a))['length'];console[_0x3c1166(0x107)]('━'[_0x3c1166(0xcb)](0x3c)),console[_0x3c1166(0x107)](_0x3c1166(0xe0)),console[_0x3c1166(0x107)]('━'['repeat'](0x3c)),console[_0x3c1166(0x107)](_0x3c1166(0x90)+_0x742987[_0x3c1166(0xb6)]),console[_0x3c1166(0x107)](_0x3c1166(0xd7)+a5_0x1dc59b['green'](_0x5c18e1)),console[_0x3c1166(0x107)](_0x3c1166(0x97)+a5_0x1dc59b[_0x3c1166(0xfb)](_0x20a29f));_0x18c622>0x0&&console[_0x3c1166(0x107)](_0x3c1166(0x10c)+a5_0x1dc59b['red'](_0x18c622));console['log'](_0x3c1166(0x9d)+formatElapsed(_0x2d83c7)),console[_0x3c1166(0x107)]('━'['repeat'](0x3c));const _0x252005=_0x742987[_0x3c1166(0xe9)](_0x11231b=>_0x11231b[_0x3c1166(0x104)]!==_0x3c1166(0xc2));if(_0x252005[_0x3c1166(0xb6)]>0x0){console[_0x3c1166(0x107)](),console[_0x3c1166(0x107)]('Failed\x20Tests:');for(const _0x2a3852 of _0x252005){const _0x5c9eaf=a5_0x1dc59b[_0x3c1166(0xfb)]('✗'),_0xa59503=_0x2a3852[_0x3c1166(0xc3)]['length']>0x32?_0x2a3852[_0x3c1166(0xc3)][_0x3c1166(0x114)](0x0,0x32)+_0x3c1166(0x115):_0x2a3852[_0x3c1166(0xc3)];console[_0x3c1166(0x107)]('\x20\x20'+_0x5c9eaf+'\x20'+_0x2a3852[_0x3c1166(0xaf)]+':\x20'+_0xa59503);}}const _0x246a36={'summary':{'total':_0x742987[_0x3c1166(0xb6)],'passed':_0x5c18e1,'failed':_0x20a29f,'errors':_0x18c622>0x0?_0x18c622:undefined,'duration_ms':_0x2d83c7},'tests':_0x742987,'agent':{'project':_0x14b964[_0x3c1166(0xfd)],'name':_0x14b964[_0x3c1166(0xae)],'site':_0x335adc},'timestamp':new Date(_0xbba474)[_0x3c1166(0xc1)]()};try{const _0x108c57=buildCachedTestRun(_0x305a9c,{'site':_0x335adc,'projectId':_0x295514,'projectName':_0x14b964[_0x3c1166(0xfd)],'agentId':_0x401388,'agentName':_0x14b964[_0x3c1166(0xae)],'testYmlPath':a5_0x5b5922[_0x3c1166(0x102)](_0x14b964['testYmlPath'])});saveLastTestRun(_0x108c57);}catch{}if(_0x4b6611!==_0x3c1166(0xe3)||_0x2ffe10){const _0x149230=formatResults(_0x246a36,_0x4b6611);if(_0x2ffe10)try{a5_0x228e74[_0x3c1166(0xeb)](_0x2ffe10,_0x149230,'utf-8'),console[_0x3c1166(0x107)](),console[_0x3c1166(0x107)](a5_0x1dc59b['dim'](_0x3c1166(0xa5)+_0x2ffe10));}catch(_0x54a541){return console[_0x3c1166(0x107)](),console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0xfb)]('Error\x20writing\x20output\x20file:\x20'+_0x54a541)),0x1;}else console['log'](),console['log'](_0x149230);}return _0x252005['length']>0x0?0x1:0x0;}async[a5_0x2240af(0x112)](_0x58d6c5,_0x391045){const _0x312dd8=a5_0x2240af,{options:_0x23b5c7,tdx:_0x4c65ac}=_0x58d6c5,{definition:_0x1bd533,agentInfo:_0x378198,outputFormat:_0x3bab79,outputFile:_0x5303be}=_0x391045,_0x5481cd=_0x23b5c7[_0x312dd8(0x11c)],_0xa94df7=loadLastTestRun();if(!_0xa94df7)return console[_0x312dd8(0x107)](a5_0x1dc59b['red'](_0x312dd8(0xb2))),console[_0x312dd8(0x107)](a5_0x1dc59b[_0x312dd8(0x8c)](_0x312dd8(0xa9))),0x1;if(_0xa94df7['agent']['agentName']!==_0x378198[_0x312dd8(0xae)])return console[_0x312dd8(0x107)](a5_0x1dc59b['red'](_0x312dd8(0xdb)+_0xa94df7[_0x312dd8(0xf6)][_0x312dd8(0xae)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x378198['agentName']+'\x22.')),console[_0x312dd8(0x107)](a5_0x1dc59b[_0x312dd8(0x8c)](_0x312dd8(0x111))),0x1;const _0xf539a7=new Set(_0xa94df7[_0x312dd8(0xa8)]['map'](_0x4e362b=>_0x4e362b[_0x312dd8(0xc0)])),_0x1bc867=_0x1bd533['tests'][_0x312dd8(0xe9)](_0x25daf9=>!_0xf539a7['has'](_0x25daf9[_0x312dd8(0xaf)]));if(_0x1bc867['length']>0x0&&_0xa94df7[_0x312dd8(0x11c)]!==_0x5481cd)return console['log'](a5_0x1dc59b['red'](_0x312dd8(0xbc))),console[_0x312dd8(0x107)](a5_0x1dc59b[_0x312dd8(0x8c)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0xa94df7[_0x312dd8(0x11c)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x5481cd+'\x22.')),console['log'](a5_0x1dc59b[_0x312dd8(0x8c)]('Either\x20switch\x20to\x20the\x20\x22'+_0xa94df7[_0x312dd8(0x11c)]+_0x312dd8(0xb3))),0x1;const _0x4100ff=_0x1bd533[_0x312dd8(0x110)][_0x312dd8(0xe9)](_0x15592e=>_0xf539a7[_0x312dd8(0xbb)](_0x15592e['name'])),_0x5367a5=_0x1bc867;let _0x538589;try{_0x538589=await setupEvaluatorAgent(_0x4c65ac['llm'],_0x23b5c7['verbose']);}catch(_0xc9a209){const _0x2e5726=_0xc9a209 instanceof Error?_0xc9a209[_0x312dd8(0x113)]:String(_0xc9a209);return console[_0x312dd8(0x107)](a5_0x1dc59b['red'](_0x312dd8(0x99)+_0x2e5726)),0x1;}console[_0x312dd8(0x107)](a5_0x1dc59b[_0x312dd8(0xd5)](_0x312dd8(0x89))),console[_0x312dd8(0x107)](_0x312dd8(0x9e)+a5_0x1dc59b[_0x312dd8(0xd9)](_0xa94df7['timestamp'])),console[_0x312dd8(0x107)](_0x312dd8(0xfc)+a5_0x1dc59b[_0x312dd8(0xd9)](_0xa94df7[_0x312dd8(0xf6)][_0x312dd8(0xfd)]+'/'+_0xa94df7[_0x312dd8(0xf6)]['agentName']));_0x5367a5[_0x312dd8(0xb6)]>0x0&&console[_0x312dd8(0x107)]('New\x20tests\x20to\x20execute:\x20'+a5_0x1dc59b[_0x312dd8(0x10b)](_0x5367a5[_0x312dd8(0xb6)]));console[_0x312dd8(0x107)]();const _0xb15af9=[],_0x20f85e=Date[_0x312dd8(0xb4)](),_0x250586=createCommandSpinner(_0x312dd8(0xdf));if(_0x4100ff[_0x312dd8(0xb6)]>0x0)try{const _0x36a6b5=await reevaluateFromCache(_0x4c65ac[_0x312dd8(0xc8)],_0xa94df7,{'tests':_0x4100ff},{'evaluatorId':_0x538589,'onTestStart':(_0xfc0722,_0x549e4c,_0x28a9ae)=>{const _0x72acf=_0x312dd8;_0x250586['text']='Re-evaluating\x20'+(_0x549e4c+0x1)+'/'+_0x28a9ae+':\x20'+_0xfc0722+_0x72acf(0x115);if(!_0x250586[_0x72acf(0xf3)])_0x250586[_0x72acf(0x119)]();},'onTestComplete':(_0x497581,_0x5e9762)=>{const _0x59660c=_0x312dd8;_0x250586[_0x59660c(0xd4)]();if(_0x5e9762['status']===_0x59660c(0xc2))console[_0x59660c(0x107)](a5_0x1dc59b['green']('✓\x20PASS:\x20'+_0x497581)+a5_0x1dc59b[_0x59660c(0x8c)](_0x59660c(0xe7)));else _0x5e9762[_0x59660c(0x104)]===_0x59660c(0x87)?console[_0x59660c(0x107)](a5_0x1dc59b[_0x59660c(0xfb)](_0x59660c(0xe8)+_0x497581+_0x59660c(0x9f)+_0x5e9762['reason'])+a5_0x1dc59b[_0x59660c(0x8c)](_0x59660c(0xe7))):console[_0x59660c(0x107)](a5_0x1dc59b[_0x59660c(0xfb)](_0x59660c(0x9a)+_0x497581+'\x20-\x20'+_0x5e9762[_0x59660c(0xc3)]));_0x5e9762[_0x59660c(0x8b)]&&console['log'](a5_0x1dc59b[_0x59660c(0x8c)]('\x20\x20Conversation:\x20'+_0x5e9762[_0x59660c(0x8b)])),_0xb15af9['push'](_0x5e9762);},'onTestSkipped':(_0x36ebd5,_0x2a2428)=>{const _0x1b1120=_0x312dd8;_0x250586['stop'](),console[_0x1b1120(0x107)](a5_0x1dc59b[_0x1b1120(0x10b)](_0x1b1120(0xf7)+_0x36ebd5+_0x1b1120(0x9f)+_0x2a2428));}});for(const _0xe7a86d of _0x36a6b5){!_0xb15af9[_0x312dd8(0xc5)](_0x4bdaf0=>_0x4bdaf0[_0x312dd8(0xaf)]===_0xe7a86d[_0x312dd8(0xaf)])&&_0xb15af9[_0x312dd8(0xac)](_0xe7a86d);}}catch(_0x20728d){_0x250586[_0x312dd8(0xd4)]();const _0x1df7ab=_0x20728d instanceof Error?_0x20728d['message']:String(_0x20728d);return console[_0x312dd8(0x107)](a5_0x1dc59b['red'](_0x312dd8(0xbd)+_0x1df7ab)),0x1;}_0x250586[_0x312dd8(0xd4)]();if(_0x5367a5['length']>0x0){console[_0x312dd8(0x107)](),console[_0x312dd8(0x107)](a5_0x1dc59b['cyan'](_0x312dd8(0x8e)));const {projectId:_0x3ac13f,agentId:_0x44636d}=_0xa94df7[_0x312dd8(0xf6)];for(const _0x2b5054 of _0x5367a5){console[_0x312dd8(0x107)](_0x312dd8(0xcc)+a5_0x1dc59b[_0x312dd8(0xd9)](_0x2b5054[_0x312dd8(0xaf)]));const _0x5c0390=createCommandSpinner(_0x312dd8(0xf2)+_0x2b5054['rounds'][_0x312dd8(0xb6)]+':\x20Sending\x20user\x20input...');_0x5c0390[_0x312dd8(0x119)]();try{const {result:_0x3d7ac3}=await runTest(_0x4c65ac[_0x312dd8(0xc8)],_0x2b5054,{'agentId':_0x44636d,'projectId':_0x3ac13f,'site':_0xa94df7['site'],'noEval':![],'evaluatorId':_0x538589,'onRoundStart':(_0x5b1bd4,_0x284aab)=>{const _0x408da1=_0x312dd8;_0x5c0390[_0x408da1(0xa4)]=_0x408da1(0x8f)+(_0x5b1bd4+0x1)+'/'+_0x284aab+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x126893,_0x2059ae,_0x4d6c3b)=>{const _0x121cd8=_0x312dd8,_0x2eb103=formatElapsed(_0x2059ae);_0x4d6c3b?console[_0x121cd8(0x107)](_0x121cd8(0xab)+(_0x126893+0x1)+'/'+_0x2b5054[_0x121cd8(0xbe)][_0x121cd8(0xb6)]+'...\x20'+a5_0x1dc59b['green']('✓')+'\x20('+_0x2eb103+')'):console[_0x121cd8(0x107)](_0x121cd8(0xab)+(_0x126893+0x1)+'/'+_0x2b5054[_0x121cd8(0xbe)][_0x121cd8(0xb6)]+'...\x20'+a5_0x1dc59b[_0x121cd8(0xfb)]('✗'));},'onEvaluationStart':()=>{const _0x3e8479=_0x312dd8;_0x5c0390[_0x3e8479(0xa4)]=_0x3e8479(0x91);},'onEvaluationComplete':_0x26b63a=>{const _0x3df85a=_0x312dd8,_0x235dc4=formatElapsed(_0x26b63a);console[_0x3df85a(0x107)](_0x3df85a(0x100)+a5_0x1dc59b[_0x3df85a(0xf5)]('✓')+'\x20('+_0x235dc4+')');}});_0x5c0390[_0x312dd8(0xd4)](),_0xb15af9['push'](_0x3d7ac3);if(_0x3d7ac3[_0x312dd8(0x104)]==='PASS')console[_0x312dd8(0x107)](a5_0x1dc59b['green'](_0x312dd8(0x11d)+_0x3d7ac3[_0x312dd8(0xc3)])+a5_0x1dc59b[_0x312dd8(0x8c)]('\x20(new)'));else _0x3d7ac3['status']===_0x312dd8(0x87)?console[_0x312dd8(0x107)](a5_0x1dc59b[_0x312dd8(0xfb)](_0x312dd8(0xe8)+_0x3d7ac3[_0x312dd8(0xc3)])+a5_0x1dc59b[_0x312dd8(0x8c)]('\x20(new)')):console['log'](a5_0x1dc59b[_0x312dd8(0xfb)]('✗\x20ERROR:\x20'+_0x3d7ac3[_0x312dd8(0xc3)]));_0x3d7ac3[_0x312dd8(0x8b)]&&console[_0x312dd8(0x107)](a5_0x1dc59b[_0x312dd8(0x8c)](_0x312dd8(0x9b)+_0x3d7ac3[_0x312dd8(0x8b)]));}catch(_0x2c1541){_0x5c0390[_0x312dd8(0xd4)]();const _0x1f81b1=_0x2c1541 instanceof Error?_0x2c1541[_0x312dd8(0x113)]:String(_0x2c1541);console[_0x312dd8(0x107)](a5_0x1dc59b[_0x312dd8(0xfb)](_0x312dd8(0x9a)+_0x1f81b1)),_0xb15af9[_0x312dd8(0xac)]({'name':_0x2b5054[_0x312dd8(0xaf)],'status':'ERROR','reason':_0x1f81b1,'timestamp':new Date()[_0x312dd8(0xc1)](),'duration_ms':0x0});}}}console['log']();const _0xea9789=Date[_0x312dd8(0xb4)]()-_0x20f85e,_0x3b42d1=_0xb15af9['filter'](_0x2a40a0=>_0x2a40a0[_0x312dd8(0x104)]===_0x312dd8(0xc2))[_0x312dd8(0xb6)],_0x5471dd=_0xb15af9[_0x312dd8(0xe9)](_0x2c9fef=>_0x2c9fef[_0x312dd8(0x104)]===_0x312dd8(0x87))[_0x312dd8(0xb6)],_0x217919=_0xb15af9['filter'](_0xd7f2b9=>_0xd7f2b9[_0x312dd8(0x104)]===_0x312dd8(0x8a))[_0x312dd8(0xb6)];console[_0x312dd8(0x107)]('━'[_0x312dd8(0xcb)](0x3c)),console[_0x312dd8(0x107)]('Re-evaluation\x20Summary'),console['log']('━'[_0x312dd8(0xcb)](0x3c)),console['log'](_0x312dd8(0x90)+_0xb15af9[_0x312dd8(0xb6)]),console[_0x312dd8(0x107)]('Passed:\x20\x20\x20'+a5_0x1dc59b[_0x312dd8(0xf5)](_0x3b42d1)),console[_0x312dd8(0x107)](_0x312dd8(0x97)+a5_0x1dc59b[_0x312dd8(0xfb)](_0x5471dd));_0x217919>0x0&&console[_0x312dd8(0x107)](_0x312dd8(0x10c)+a5_0x1dc59b['red'](_0x217919));console[_0x312dd8(0x107)](_0x312dd8(0x9d)+formatElapsed(_0xea9789)),console['log']('━'['repeat'](0x3c));const _0x18c6ac={'summary':{'total':_0xb15af9[_0x312dd8(0xb6)],'passed':_0x3b42d1,'failed':_0x5471dd,'errors':_0x217919>0x0?_0x217919:undefined,'duration_ms':_0xea9789},'tests':_0xb15af9,'agent':{'project':_0x378198[_0x312dd8(0xfd)],'name':_0x378198['agentName'],'site':_0x5481cd},'timestamp':new Date(_0x20f85e)[_0x312dd8(0xc1)]()};if(_0x3bab79!==_0x312dd8(0xe3)||_0x5303be){const _0x4b92b5=formatResults(_0x18c6ac,_0x3bab79);if(_0x5303be)try{a5_0x228e74['writeFileSync'](_0x5303be,_0x4b92b5,_0x312dd8(0xef)),console[_0x312dd8(0x107)](),console['log'](a5_0x1dc59b['dim']('Output\x20written\x20to:\x20'+_0x5303be));}catch(_0x4f660d){return console[_0x312dd8(0x107)](),console[_0x312dd8(0x107)](a5_0x1dc59b['red'](_0x312dd8(0x88)+_0x4f660d)),0x1;}else console['log'](),console['log'](_0x4b92b5);}const _0x1f1b77=_0xb15af9[_0x312dd8(0xe9)](_0x15f846=>_0x15f846[_0x312dd8(0x104)]!=='PASS');return _0x1f1b77['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x695929=a5_0x236a;(function(_0x1a71b2,_0x4d5b9b){const _0x276cc0=a5_0x236a,_0x4b8d41=_0x1a71b2();while(!![]){try{const _0x1ec1bc=-parseInt(_0x276cc0(0x18b))/0x1*(-parseInt(_0x276cc0(0x14c))/0x2)+-parseInt(_0x276cc0(0x137))/0x3*(-parseInt(_0x276cc0(0x190))/0x4)+-parseInt(_0x276cc0(0x17c))/0x5+-parseInt(_0x276cc0(0x103))/0x6+-parseInt(_0x276cc0(0x130))/0x7+-parseInt(_0x276cc0(0x11b))/0x8+parseInt(_0x276cc0(0x110))/0x9*(parseInt(_0x276cc0(0x150))/0xa);if(_0x1ec1bc===_0x4d5b9b)break;else _0x4b8d41['push'](_0x4b8d41['shift']());}catch(_0x108ed1){_0x4b8d41['push'](_0x4b8d41['shift']());}}}(a5_0x14d2,0xb38c4));import*as a5_0x533469 from'node:fs';import*as a5_0x25e32b from'node:path';import a5_0x459c27 from'chalk';function a5_0x236a(_0x46da43,_0x1a0eae){_0x46da43=_0x46da43-0xf9;const _0x14d249=a5_0x14d2();let _0x236a96=_0x14d249[_0x46da43];return _0x236a96;}function a5_0x14d2(){const _0x5e9e78=['json','testName','Running\x20agent\x20tests...','has','tests','/<agent-name>','find','tags','executeReeval','...','Failed\x20Tests:','llm','split','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','source','agentName','No\x20tests\x20found\x20matching:\x20','table','writeFileSync','projectName','\x20-\x20','\x20(new)','\x20\x20-\x20','conversation_url','...\x20','toISOString','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Either\x20switch\x20to\x20the\x20\x22','basename','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','llmProject','PASS','length','\x20(cached)','\x22:\x20','2599250IxfAcE','map','repeat','No\x20tests\x20have\x20tags\x20defined.','resolveProjectId','Error\x20writing\x20output\x20file:\x20','Running:\x20','now','\x20\x20Site:\x20','verbose','name','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','output','log','isSpinning','13914lbZqTO','description','Available\x20tests:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Tests\x20found:\x20','180256iGpvnQ','\x22,\x20but\x20current\x20site\x20is\x20\x22','Error:\x20No\x20previous\x20test\x20run\x20found.','Agent:\x20','toLowerCase','found','dryRun','ERROR','green','rounds','FAIL','5022738xlnIsE','Round\x20','Output\x20written\x20to:\x20','\x20\x20Conversation:\x20','Passed:\x20\x20\x20','cyan','multiple_agents','Total:\x20\x20\x20\x20','includes','message','Running\x20test:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Errors:\x20\x20\x20','1551762kllyrw','Project\x20path:\x20','New\x20tests\x20to\x20execute:\x20','\x20\x20Round\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Evaluating\x20response...','resolveAgentId','start','status','Round\x201/','size','8223096JlmbNW','not\x20found','existsSync','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','✓\x20PASS:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','agentDirs','Re-evaluating...','Re-evaluating\x20cached\x20test\x20run...','agent','eval','text','projectDir','reeval','reason','push','stop','\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','Duration:\x20','red','some','10170370gKPzxU','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','no_local_folder','jsonl','Available\x20tags:\x20','dim','join','51DYqpvp','forEach','tsv','Re-evaluating\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','substring','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Using\x20agent:\x20','yellow','⚠\x20SKIPPED:\x20','Site:\x20','Failed:\x20\x20\x20','testYmlPath','add','✗\x20FAIL:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Project:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','filter','site','✗\x20ERROR:\x20','2jWZkZC','404','Conversation\x20URL:\x20','Re-evaluation\x20Summary','220rhKiiX',':\x20Sending\x20user\x20input...','no_tests','no_context','utf-8','resolve','trim','agent:test','white'];a5_0x14d2=function(){return _0x5e9e78;};return a5_0x14d2();}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_0x695929(0x186)]=a5_0x695929(0x157);[a5_0x695929(0x18c)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async['execute'](_0x1699d4){const _0x423bfe=a5_0x695929,{options:_0x5b7846,args:_0x1cca5f,tdx:_0x3367ce}=_0x1699d4,_0x403a10=_0x1cca5f[0x0]||'.',_0x20a6ba=_0x5b7846[_0x423bfe(0xfe)],_0x3cdd80=_0x5b7846,_0x4b4deb=_0x3cdd80[_0x423bfe(0x125)]===![],_0x2164f4=_0x3cdd80[_0x423bfe(0x128)],_0x309483=_0x3cdd80['name'],_0x116d77=_0x3cdd80['tags'],_0x4be435=_0x5b7846[_0x423bfe(0x14a)],_0x207e26=_0x3cdd80[_0x423bfe(0x188)];if(_0x2164f4&&_0x4b4deb)return console[_0x423bfe(0x189)](a5_0x459c27[_0x423bfe(0x12e)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x1f7845='table';if(_0x3cdd80[_0x423bfe(0x159)])_0x1f7845=_0x423bfe(0x159);else{if(_0x3cdd80[_0x423bfe(0x133)])_0x1f7845=_0x423bfe(0x133);else{if(_0x3cdd80[_0x423bfe(0x139)])_0x1f7845=_0x423bfe(0x139);else{if(_0x3cdd80['table'])_0x1f7845=_0x423bfe(0x16a);}}}const _0x49dcd8=_0x3cdd80[_0x423bfe(0x177)];let _0x3cba0a=_0x403a10;const _0x411d0c=a5_0x533469[_0x423bfe(0x11d)](_0x403a10),_0x2b793a=_0x403a10==='.';if(!_0x411d0c||_0x2b793a){const _0xdae254=resolveProjectFromContext(_0x403a10,_0x49dcd8,{'requireFile':'test.yml'});if(_0xdae254[_0x423bfe(0xfd)])_0x3cba0a=_0xdae254[_0x423bfe(0x127)],_0xdae254[_0x423bfe(0x167)]==='context'&&console[_0x423bfe(0x189)](a5_0x459c27['dim'](_0x423bfe(0x13e)+_0x3cba0a));else switch(_0xdae254[_0x423bfe(0x129)]){case _0x423bfe(0x153):console[_0x423bfe(0x189)](a5_0x459c27[_0x423bfe(0x13f)](_0xdae254[_0x423bfe(0x10c)])),console['log'](),console[_0x423bfe(0x189)]('Usage:'),console[_0x423bfe(0x189)](_0x423bfe(0x12c)),console[_0x423bfe(0x189)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x423bfe(0x189)](),console[_0x423bfe(0x189)](_0x423bfe(0x18e));return 0x1;case _0x423bfe(0x132):console[_0x423bfe(0x189)](a5_0x459c27[_0x423bfe(0x13f)](_0xdae254[_0x423bfe(0x10c)])),console[_0x423bfe(0x189)](),console['log'](_0x423bfe(0x146)+_0xdae254[_0x423bfe(0x177)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x423bfe(0x109):{const _0xfab655=a5_0x25e32b[_0x423bfe(0x175)](_0xdae254[_0x423bfe(0x127)]);console[_0x423bfe(0x189)](a5_0x459c27['yellow'](_0x423bfe(0x166)+_0xdae254[_0x423bfe(0x177)]+'\x22:'));for(const _0x37c815 of _0xdae254[_0x423bfe(0x121)]){console['log'](_0x423bfe(0x16f)+_0x37c815);}return console['log'](),console[_0x423bfe(0x189)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0xfab655+_0x423bfe(0x15e)),0x1;}case _0x423bfe(0x152):console[_0x423bfe(0x189)](a5_0x459c27[_0x423bfe(0x13f)](_0x423bfe(0x120)+_0xdae254[_0x423bfe(0x177)]+'\x22.')),console[_0x423bfe(0x189)](a5_0x459c27[_0x423bfe(0x135)](_0x423bfe(0x111)+_0xdae254['projectDir'])),console[_0x423bfe(0x189)](),console[_0x423bfe(0x189)](_0x423bfe(0x11e));return 0x1;}}const {definition:_0x32f703,agentInfo:_0x9d1a15}=parseTestFile(_0x3cba0a);let _0x3b747c=_0x32f703[_0x423bfe(0x15d)];if(_0x309483){const _0x2baf74=_0x309483[_0x423bfe(0x165)](',')[_0x423bfe(0x17d)](_0x39d8ea=>_0x39d8ea['trim']());_0x3b747c=_0x32f703[_0x423bfe(0x15d)]['filter'](_0x1556fa=>_0x2baf74[_0x423bfe(0x10b)](_0x1556fa[_0x423bfe(0x186)]));if(_0x3b747c['length']===0x0)return console[_0x423bfe(0x189)](a5_0x459c27[_0x423bfe(0x13f)](_0x423bfe(0x169)+_0x309483)),console['log'](a5_0x459c27['dim'](_0x423bfe(0x18d)+_0x32f703[_0x423bfe(0x15d)][_0x423bfe(0x17d)](_0x25402e=>_0x25402e[_0x423bfe(0x186)])[_0x423bfe(0x136)](',\x20'))),0x1;}if(_0x116d77){const _0x2af9ee=_0x116d77[_0x423bfe(0x165)](',')['map'](_0x56d0bf=>_0x56d0bf[_0x423bfe(0x156)]()[_0x423bfe(0xfc)]());_0x3b747c=_0x3b747c[_0x423bfe(0x149)](_0x35afa1=>_0x35afa1[_0x423bfe(0x160)]?.[_0x423bfe(0x12f)](_0x313a75=>_0x2af9ee[_0x423bfe(0x10b)](_0x313a75[_0x423bfe(0xfc)]())));if(_0x3b747c[_0x423bfe(0x179)]===0x0){console[_0x423bfe(0x189)](a5_0x459c27['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x116d77));const _0x5f227e=new Set();return _0x32f703[_0x423bfe(0x15d)][_0x423bfe(0x138)](_0x18336c=>_0x18336c['tags']?.[_0x423bfe(0x138)](_0x4f0e7c=>_0x5f227e[_0x423bfe(0x144)](_0x4f0e7c))),_0x5f227e[_0x423bfe(0x11a)]>0x0?console['log'](a5_0x459c27[_0x423bfe(0x135)](_0x423bfe(0x134)+[..._0x5f227e][_0x423bfe(0x136)](',\x20'))):console[_0x423bfe(0x189)](a5_0x459c27[_0x423bfe(0x135)](_0x423bfe(0x17f))),0x1;}}if(_0x2164f4)return this[_0x423bfe(0x161)](_0x1699d4,{'definition':{'tests':_0x3b747c},'agentInfo':_0x9d1a15,'outputFormat':_0x1f7845,'outputFile':_0x207e26,'testNames':_0x309483});if(_0x20a6ba){console[_0x423bfe(0x189)](a5_0x459c27[_0x423bfe(0x108)]('Test\x20Configuration:')),console[_0x423bfe(0x189)](_0x423bfe(0x184)+a5_0x459c27[_0x423bfe(0x158)](_0x4be435)),console[_0x423bfe(0x189)](_0x423bfe(0x147)+a5_0x459c27['white'](_0x9d1a15[_0x423bfe(0x16c)])),console[_0x423bfe(0x189)]('\x20\x20Agent:\x20'+a5_0x459c27['white'](_0x9d1a15[_0x423bfe(0x168)])),console[_0x423bfe(0x189)](),console['log'](_0x423bfe(0x18f)+a5_0x459c27[_0x423bfe(0x158)](_0x3b747c[_0x423bfe(0x179)]));for(let _0x2039ee=0x0;_0x2039ee<_0x3b747c[_0x423bfe(0x179)];_0x2039ee++){const _0x3b5f85=_0x3b747c[_0x2039ee],_0x1ec53c=_0x3b5f85[_0x423bfe(0x101)][_0x423bfe(0x179)]===0x1?'round':_0x423bfe(0x101),_0x3ae649=_0x3b5f85[_0x423bfe(0x160)]?.[_0x423bfe(0x179)]?'\x20['+_0x3b5f85[_0x423bfe(0x160)][_0x423bfe(0x136)](',\x20')+']':'';console['log']('\x20\x20'+(_0x2039ee+0x1)+'.\x20'+a5_0x459c27[_0x423bfe(0x158)](_0x3b5f85['name'])+'\x20('+_0x3b5f85[_0x423bfe(0x101)][_0x423bfe(0x179)]+'\x20'+_0x1ec53c+')'+a5_0x459c27[_0x423bfe(0x135)](_0x3ae649));}return 0x0;}let _0x28075d,_0x4adf45;try{_0x28075d=await _0x3367ce['llm'][_0x423bfe(0x180)](_0x9d1a15[_0x423bfe(0x16c)]);}catch(_0x52d0e4){const _0x56b070=_0x52d0e4 instanceof Error?_0x52d0e4[_0x423bfe(0x10c)]:String(_0x52d0e4);return _0x56b070['includes'](_0x423bfe(0x14d))||_0x56b070['toLowerCase']()[_0x423bfe(0x10b)](_0x423bfe(0x11c))?console[_0x423bfe(0x189)](a5_0x459c27[_0x423bfe(0x12e)](_0x423bfe(0x173)+_0x9d1a15[_0x423bfe(0x16c)])):console['log'](a5_0x459c27[_0x423bfe(0x12e)](_0x423bfe(0x10e)+_0x9d1a15[_0x423bfe(0x16c)]+_0x423bfe(0x17b)+_0x56b070)),0x1;}try{_0x4adf45=await _0x3367ce[_0x423bfe(0x164)][_0x423bfe(0x116)](_0x9d1a15[_0x423bfe(0x168)],_0x28075d);}catch(_0x158858){const _0x2cc441=_0x158858 instanceof Error?_0x158858[_0x423bfe(0x10c)]:String(_0x158858);return _0x2cc441[_0x423bfe(0x10b)]('404')||_0x2cc441[_0x423bfe(0xfc)]()[_0x423bfe(0x10b)](_0x423bfe(0x11c))?console['log'](a5_0x459c27[_0x423bfe(0x12e)](_0x423bfe(0x131)+_0x9d1a15[_0x423bfe(0x168)])):console['log'](a5_0x459c27['red'](_0x423bfe(0x187)+_0x9d1a15[_0x423bfe(0x168)]+_0x423bfe(0x17b)+_0x2cc441)),0x1;}let _0x2a93c2;if(!_0x4b4deb)try{_0x2a93c2=await setupEvaluatorAgent(_0x3367ce[_0x423bfe(0x164)],_0x5b7846[_0x423bfe(0x185)]);}catch(_0x14a92c){const _0x54d036=_0x14a92c instanceof Error?_0x14a92c[_0x423bfe(0x10c)]:String(_0x14a92c);return console[_0x423bfe(0x189)](a5_0x459c27[_0x423bfe(0x12e)](_0x423bfe(0x13d)+_0x54d036)),0x1;}console['log'](a5_0x459c27[_0x423bfe(0x108)](_0x423bfe(0x15b))),console[_0x423bfe(0x189)](_0x423bfe(0x141)+a5_0x459c27['white'](_0x4be435)),console[_0x423bfe(0x189)](_0x423bfe(0xfb)+a5_0x459c27['white'](_0x9d1a15[_0x423bfe(0x16c)]+'/'+_0x9d1a15['agentName'])),console[_0x423bfe(0x189)]();const _0xe5946b=[],_0x476734=[],_0x1f32fa=Date[_0x423bfe(0x183)]();for(let _0x102da6=0x0;_0x102da6<_0x3b747c[_0x423bfe(0x179)];_0x102da6++){const _0x4bb2db=_0x3b747c[_0x102da6];_0x3b747c['length']>0x1?console[_0x423bfe(0x189)]('Test\x20'+(_0x102da6+0x1)+'/'+_0x3b747c[_0x423bfe(0x179)]+':\x20'+a5_0x459c27[_0x423bfe(0x158)](_0x4bb2db[_0x423bfe(0x186)])):console[_0x423bfe(0x189)](_0x423bfe(0x10d)+a5_0x459c27['white'](_0x4bb2db[_0x423bfe(0x186)]));const _0x9066b0=createCommandSpinner(_0x423bfe(0x119)+_0x4bb2db[_0x423bfe(0x101)][_0x423bfe(0x179)]+_0x423bfe(0x151));_0x9066b0[_0x423bfe(0x117)]();try{const {result:_0x199b74,conversation:_0x4d4e81}=await runTest(_0x3367ce[_0x423bfe(0x164)],_0x4bb2db,{'agentId':_0x4adf45,'projectId':_0x28075d,'site':_0x4be435,'noEval':_0x4b4deb,'evaluatorId':_0x2a93c2,'onRoundStart':(_0x15617e,_0x501334)=>{const _0x2cc787=_0x423bfe;_0x9066b0[_0x2cc787(0x126)]=_0x2cc787(0x104)+(_0x15617e+0x1)+'/'+_0x501334+_0x2cc787(0x151);},'onRoundComplete':(_0x59ba0a,_0x39bddb,_0x2fbf12)=>{const _0x5ba17d=_0x423bfe,_0x3b131a=formatElapsed(_0x39bddb);_0x2fbf12?console[_0x5ba17d(0x189)](_0x5ba17d(0x113)+(_0x59ba0a+0x1)+'/'+_0x4bb2db[_0x5ba17d(0x101)][_0x5ba17d(0x179)]+_0x5ba17d(0x171)+a5_0x459c27['green']('✓')+'\x20('+_0x3b131a+')'):console[_0x5ba17d(0x189)]('\x20\x20Round\x20'+(_0x59ba0a+0x1)+'/'+_0x4bb2db[_0x5ba17d(0x101)][_0x5ba17d(0x179)]+_0x5ba17d(0x171)+a5_0x459c27[_0x5ba17d(0x12e)]('✗'));},'onEvaluationStart':()=>{const _0x1871e=_0x423bfe;_0x9066b0['text']=_0x1871e(0x115);},'onEvaluationComplete':_0x32633b=>{const _0x1c5ee6=_0x423bfe,_0x211ff1=formatElapsed(_0x32633b);console[_0x1c5ee6(0x189)]('\x20\x20Evaluating...\x20'+a5_0x459c27[_0x1c5ee6(0x100)]('✓')+'\x20('+_0x211ff1+')');}});_0x9066b0['stop'](),_0xe5946b[_0x423bfe(0x12a)](_0x199b74),_0x476734['push'](_0x4d4e81);if(_0x199b74[_0x423bfe(0x118)]===_0x423bfe(0x178))console[_0x423bfe(0x189)](a5_0x459c27[_0x423bfe(0x100)]('✓\x20PASS:\x20'+_0x199b74['reason']));else _0x199b74[_0x423bfe(0x118)]===_0x423bfe(0x102)?console['log'](a5_0x459c27[_0x423bfe(0x12e)](_0x423bfe(0x145)+_0x199b74[_0x423bfe(0x129)])):console[_0x423bfe(0x189)](a5_0x459c27['red'](_0x423bfe(0x14b)+_0x199b74[_0x423bfe(0x129)]));_0x199b74[_0x423bfe(0x170)]&&console['log'](a5_0x459c27[_0x423bfe(0x135)](_0x423bfe(0x14e)+_0x199b74[_0x423bfe(0x170)])),console[_0x423bfe(0x189)]();}catch(_0x1a1077){_0x9066b0[_0x423bfe(0x12b)]();const _0x32e78a=_0x1a1077 instanceof Error?_0x1a1077[_0x423bfe(0x10c)]:String(_0x1a1077);console['log'](a5_0x459c27[_0x423bfe(0x12e)](_0x423bfe(0x14b)+_0x32e78a)),console[_0x423bfe(0x189)](),_0xe5946b[_0x423bfe(0x12a)]({'name':_0x4bb2db[_0x423bfe(0x186)],'status':_0x423bfe(0xff),'reason':_0x32e78a,'timestamp':new Date()[_0x423bfe(0x172)](),'duration_ms':0x0});}}const _0x39b9ab=Date['now']()-_0x1f32fa,_0x4d26e4=_0xe5946b[_0x423bfe(0x149)](_0x1afd5a=>_0x1afd5a[_0x423bfe(0x118)]===_0x423bfe(0x178))[_0x423bfe(0x179)],_0x5a6b66=_0xe5946b[_0x423bfe(0x149)](_0x28c02b=>_0x28c02b[_0x423bfe(0x118)]==='FAIL')['length'],_0x239e62=_0xe5946b['filter'](_0x260be1=>_0x260be1['status']===_0x423bfe(0xff))[_0x423bfe(0x179)];console[_0x423bfe(0x189)]('━'[_0x423bfe(0x17e)](0x3c)),console[_0x423bfe(0x189)]('Test\x20Summary'),console[_0x423bfe(0x189)]('━'[_0x423bfe(0x17e)](0x3c)),console[_0x423bfe(0x189)](_0x423bfe(0x10a)+_0xe5946b[_0x423bfe(0x179)]),console[_0x423bfe(0x189)]('Passed:\x20\x20\x20'+a5_0x459c27[_0x423bfe(0x100)](_0x4d26e4)),console[_0x423bfe(0x189)]('Failed:\x20\x20\x20'+a5_0x459c27[_0x423bfe(0x12e)](_0x5a6b66));_0x239e62>0x0&&console['log'](_0x423bfe(0x10f)+a5_0x459c27[_0x423bfe(0x12e)](_0x239e62));console[_0x423bfe(0x189)](_0x423bfe(0x12d)+formatElapsed(_0x39b9ab)),console['log']('━'[_0x423bfe(0x17e)](0x3c));const _0x4e3101=_0xe5946b[_0x423bfe(0x149)](_0x4a254b=>_0x4a254b[_0x423bfe(0x118)]!=='PASS');if(_0x4e3101[_0x423bfe(0x179)]>0x0){console[_0x423bfe(0x189)](),console[_0x423bfe(0x189)](_0x423bfe(0x163));for(const _0xf4f16e of _0x4e3101){const _0x400a23=a5_0x459c27[_0x423bfe(0x12e)]('✗'),_0x111b4f=_0xf4f16e[_0x423bfe(0x129)]['length']>0x32?_0xf4f16e[_0x423bfe(0x129)][_0x423bfe(0x13c)](0x0,0x32)+_0x423bfe(0x162):_0xf4f16e[_0x423bfe(0x129)];console[_0x423bfe(0x189)]('\x20\x20'+_0x400a23+'\x20'+_0xf4f16e[_0x423bfe(0x186)]+':\x20'+_0x111b4f);}}const _0x5e61b1={'summary':{'total':_0xe5946b[_0x423bfe(0x179)],'passed':_0x4d26e4,'failed':_0x5a6b66,'errors':_0x239e62>0x0?_0x239e62:undefined,'duration_ms':_0x39b9ab},'tests':_0xe5946b,'agent':{'project':_0x9d1a15['projectName'],'name':_0x9d1a15[_0x423bfe(0x168)],'site':_0x4be435},'timestamp':new Date(_0x1f32fa)[_0x423bfe(0x172)]()};try{const _0x3ff3d0=buildCachedTestRun(_0x476734,{'site':_0x4be435,'projectId':_0x28075d,'projectName':_0x9d1a15[_0x423bfe(0x16c)],'agentId':_0x4adf45,'agentName':_0x9d1a15[_0x423bfe(0x168)],'testYmlPath':a5_0x25e32b[_0x423bfe(0x155)](_0x9d1a15[_0x423bfe(0x143)])});saveLastTestRun(_0x3ff3d0);}catch{}if(_0x1f7845!=='table'||_0x207e26){const _0x41f42d=formatResults(_0x5e61b1,_0x1f7845);if(_0x207e26)try{a5_0x533469[_0x423bfe(0x16b)](_0x207e26,_0x41f42d,_0x423bfe(0x154)),console['log'](),console[_0x423bfe(0x189)](a5_0x459c27[_0x423bfe(0x135)]('Output\x20written\x20to:\x20'+_0x207e26));}catch(_0x13f8c8){return console[_0x423bfe(0x189)](),console[_0x423bfe(0x189)](a5_0x459c27[_0x423bfe(0x12e)]('Error\x20writing\x20output\x20file:\x20'+_0x13f8c8)),0x1;}else console[_0x423bfe(0x189)](),console[_0x423bfe(0x189)](_0x41f42d);}return _0x4e3101[_0x423bfe(0x179)]>0x0?0x1:0x0;}async['executeReeval'](_0x26a62b,_0x481267){const _0xb114da=a5_0x695929,{options:_0x3f3222,tdx:_0x51e78a}=_0x26a62b,{definition:_0x360108,agentInfo:_0x537796,outputFormat:_0x23b25c,outputFile:_0x183b84}=_0x481267,_0x3b68e0=_0x3f3222[_0xb114da(0x14a)],_0x2e595e=loadLastTestRun();if(!_0x2e595e)return console[_0xb114da(0x189)](a5_0x459c27[_0xb114da(0x12e)](_0xb114da(0xfa))),console[_0xb114da(0x189)](a5_0x459c27['dim'](_0xb114da(0x176))),0x1;if(_0x2e595e[_0xb114da(0x124)]['agentName']!==_0x537796[_0xb114da(0x168)])return console[_0xb114da(0x189)](a5_0x459c27[_0xb114da(0x12e)](_0xb114da(0x148)+_0x2e595e[_0xb114da(0x124)][_0xb114da(0x168)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x537796[_0xb114da(0x168)]+'\x22.')),console[_0xb114da(0x189)](a5_0x459c27['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x2a7c2f=new Set(_0x2e595e['conversations'][_0xb114da(0x17d)](_0xdef14a=>_0xdef14a[_0xb114da(0x15a)])),_0x4db44d=_0x360108[_0xb114da(0x15d)]['filter'](_0x46442d=>!_0x2a7c2f[_0xb114da(0x15c)](_0x46442d[_0xb114da(0x186)]));if(_0x4db44d['length']>0x0&&_0x2e595e[_0xb114da(0x14a)]!==_0x3b68e0)return console['log'](a5_0x459c27[_0xb114da(0x12e)](_0xb114da(0x114))),console[_0xb114da(0x189)](a5_0x459c27[_0xb114da(0x135)](_0xb114da(0x13b)+_0x2e595e[_0xb114da(0x14a)]+_0xb114da(0xf9)+_0x3b68e0+'\x22.')),console['log'](a5_0x459c27[_0xb114da(0x135)](_0xb114da(0x174)+_0x2e595e['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x282c54=_0x360108['tests'][_0xb114da(0x149)](_0x298b00=>_0x2a7c2f['has'](_0x298b00[_0xb114da(0x186)])),_0x30c662=_0x4db44d;let _0x4ea3e6;try{_0x4ea3e6=await setupEvaluatorAgent(_0x51e78a['llm'],_0x3f3222[_0xb114da(0x185)]);}catch(_0x1f9c63){const _0x16d18c=_0x1f9c63 instanceof Error?_0x1f9c63['message']:String(_0x1f9c63);return console[_0xb114da(0x189)](a5_0x459c27[_0xb114da(0x12e)](_0xb114da(0x13d)+_0x16d18c)),0x1;}console[_0xb114da(0x189)](a5_0x459c27['cyan'](_0xb114da(0x123))),console['log']('Cached\x20run\x20from:\x20'+a5_0x459c27[_0xb114da(0x158)](_0x2e595e['timestamp'])),console[_0xb114da(0x189)](_0xb114da(0xfb)+a5_0x459c27[_0xb114da(0x158)](_0x2e595e['agent'][_0xb114da(0x16c)]+'/'+_0x2e595e[_0xb114da(0x124)][_0xb114da(0x168)]));_0x30c662['length']>0x0&&console['log'](_0xb114da(0x112)+a5_0x459c27[_0xb114da(0x13f)](_0x30c662['length']));console[_0xb114da(0x189)]();const _0x205820=[],_0x11ad6b=Date[_0xb114da(0x183)](),_0x426d29=createCommandSpinner(_0xb114da(0x122));if(_0x282c54[_0xb114da(0x179)]>0x0)try{const _0xc412a5=await reevaluateFromCache(_0x51e78a['llm'],_0x2e595e,{'tests':_0x282c54},{'evaluatorId':_0x4ea3e6,'onTestStart':(_0x5a5ba8,_0x6c840e,_0x655ead)=>{const _0x3a186d=_0xb114da;_0x426d29['text']=_0x3a186d(0x13a)+(_0x6c840e+0x1)+'/'+_0x655ead+':\x20'+_0x5a5ba8+_0x3a186d(0x162);if(!_0x426d29[_0x3a186d(0x18a)])_0x426d29[_0x3a186d(0x117)]();},'onTestComplete':(_0x268bd3,_0x1aa546)=>{const _0x353066=_0xb114da;_0x426d29[_0x353066(0x12b)]();if(_0x1aa546[_0x353066(0x118)]==='PASS')console[_0x353066(0x189)](a5_0x459c27['green'](_0x353066(0x11f)+_0x268bd3)+a5_0x459c27[_0x353066(0x135)](_0x353066(0x17a)));else _0x1aa546['status']===_0x353066(0x102)?console[_0x353066(0x189)](a5_0x459c27[_0x353066(0x12e)]('✗\x20FAIL:\x20'+_0x268bd3+_0x353066(0x16d)+_0x1aa546['reason'])+a5_0x459c27[_0x353066(0x135)](_0x353066(0x17a))):console['log'](a5_0x459c27[_0x353066(0x12e)](_0x353066(0x14b)+_0x268bd3+_0x353066(0x16d)+_0x1aa546[_0x353066(0x129)]));_0x1aa546[_0x353066(0x170)]&&console[_0x353066(0x189)](a5_0x459c27[_0x353066(0x135)](_0x353066(0x106)+_0x1aa546[_0x353066(0x170)])),_0x205820['push'](_0x1aa546);},'onTestSkipped':(_0x3669a9,_0x4015dc)=>{const _0x4e7cdf=_0xb114da;_0x426d29[_0x4e7cdf(0x12b)](),console[_0x4e7cdf(0x189)](a5_0x459c27[_0x4e7cdf(0x13f)](_0x4e7cdf(0x140)+_0x3669a9+'\x20-\x20'+_0x4015dc));}});for(const _0x4ddcab of _0xc412a5){!_0x205820[_0xb114da(0x15f)](_0x4e6775=>_0x4e6775[_0xb114da(0x186)]===_0x4ddcab[_0xb114da(0x186)])&&_0x205820['push'](_0x4ddcab);}}catch(_0x19fde2){_0x426d29[_0xb114da(0x12b)]();const _0x352dd8=_0x19fde2 instanceof Error?_0x19fde2[_0xb114da(0x10c)]:String(_0x19fde2);return console[_0xb114da(0x189)](a5_0x459c27[_0xb114da(0x12e)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x352dd8)),0x1;}_0x426d29[_0xb114da(0x12b)]();if(_0x30c662[_0xb114da(0x179)]>0x0){console[_0xb114da(0x189)](),console[_0xb114da(0x189)](a5_0x459c27['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x38b2e1,agentId:_0x3ea215}=_0x2e595e[_0xb114da(0x124)];for(const _0xc60fc0 of _0x30c662){console[_0xb114da(0x189)](_0xb114da(0x182)+a5_0x459c27[_0xb114da(0x158)](_0xc60fc0['name']));const _0x37fe9a=createCommandSpinner(_0xb114da(0x119)+_0xc60fc0[_0xb114da(0x101)]['length']+_0xb114da(0x151));_0x37fe9a[_0xb114da(0x117)]();try{const {result:_0x1dc116}=await runTest(_0x51e78a[_0xb114da(0x164)],_0xc60fc0,{'agentId':_0x3ea215,'projectId':_0x38b2e1,'site':_0x2e595e[_0xb114da(0x14a)],'noEval':![],'evaluatorId':_0x4ea3e6,'onRoundStart':(_0x2091bf,_0x212491)=>{const _0x3b0671=_0xb114da;_0x37fe9a[_0x3b0671(0x126)]=_0x3b0671(0x104)+(_0x2091bf+0x1)+'/'+_0x212491+_0x3b0671(0x151);},'onRoundComplete':(_0x587d47,_0x30baf9,_0x5a3100)=>{const _0x1d50a5=_0xb114da,_0x6efd99=formatElapsed(_0x30baf9);_0x5a3100?console['log'](_0x1d50a5(0x113)+(_0x587d47+0x1)+'/'+_0xc60fc0[_0x1d50a5(0x101)]['length']+'...\x20'+a5_0x459c27['green']('✓')+'\x20('+_0x6efd99+')'):console[_0x1d50a5(0x189)](_0x1d50a5(0x113)+(_0x587d47+0x1)+'/'+_0xc60fc0[_0x1d50a5(0x101)][_0x1d50a5(0x179)]+_0x1d50a5(0x171)+a5_0x459c27[_0x1d50a5(0x12e)]('✗'));},'onEvaluationStart':()=>{const _0x78428=_0xb114da;_0x37fe9a['text']=_0x78428(0x115);},'onEvaluationComplete':_0x1f419a=>{const _0x3b2505=_0xb114da,_0x651e40=formatElapsed(_0x1f419a);console[_0x3b2505(0x189)]('\x20\x20Evaluating...\x20'+a5_0x459c27[_0x3b2505(0x100)]('✓')+'\x20('+_0x651e40+')');}});_0x37fe9a[_0xb114da(0x12b)](),_0x205820['push'](_0x1dc116);if(_0x1dc116['status']==='PASS')console[_0xb114da(0x189)](a5_0x459c27[_0xb114da(0x100)](_0xb114da(0x11f)+_0x1dc116[_0xb114da(0x129)])+a5_0x459c27['dim']('\x20(new)'));else _0x1dc116['status']===_0xb114da(0x102)?console[_0xb114da(0x189)](a5_0x459c27[_0xb114da(0x12e)](_0xb114da(0x145)+_0x1dc116[_0xb114da(0x129)])+a5_0x459c27[_0xb114da(0x135)](_0xb114da(0x16e))):console['log'](a5_0x459c27[_0xb114da(0x12e)](_0xb114da(0x14b)+_0x1dc116[_0xb114da(0x129)]));_0x1dc116[_0xb114da(0x170)]&&console[_0xb114da(0x189)](a5_0x459c27[_0xb114da(0x135)](_0xb114da(0x106)+_0x1dc116[_0xb114da(0x170)]));}catch(_0x120f32){_0x37fe9a[_0xb114da(0x12b)]();const _0x16bbaf=_0x120f32 instanceof Error?_0x120f32[_0xb114da(0x10c)]:String(_0x120f32);console['log'](a5_0x459c27[_0xb114da(0x12e)](_0xb114da(0x14b)+_0x16bbaf)),_0x205820[_0xb114da(0x12a)]({'name':_0xc60fc0[_0xb114da(0x186)],'status':_0xb114da(0xff),'reason':_0x16bbaf,'timestamp':new Date()[_0xb114da(0x172)](),'duration_ms':0x0});}}}console[_0xb114da(0x189)]();const _0x452032=Date[_0xb114da(0x183)]()-_0x11ad6b,_0x44dfea=_0x205820['filter'](_0x27cd39=>_0x27cd39[_0xb114da(0x118)]==='PASS')['length'],_0x545452=_0x205820['filter'](_0x4a9261=>_0x4a9261[_0xb114da(0x118)]===_0xb114da(0x102))['length'],_0x50ccc0=_0x205820['filter'](_0x589ee9=>_0x589ee9[_0xb114da(0x118)]===_0xb114da(0xff))[_0xb114da(0x179)];console[_0xb114da(0x189)]('━'[_0xb114da(0x17e)](0x3c)),console[_0xb114da(0x189)](_0xb114da(0x14f)),console['log']('━'[_0xb114da(0x17e)](0x3c)),console[_0xb114da(0x189)]('Total:\x20\x20\x20\x20'+_0x205820['length']),console[_0xb114da(0x189)](_0xb114da(0x107)+a5_0x459c27[_0xb114da(0x100)](_0x44dfea)),console[_0xb114da(0x189)](_0xb114da(0x142)+a5_0x459c27['red'](_0x545452));_0x50ccc0>0x0&&console['log'](_0xb114da(0x10f)+a5_0x459c27[_0xb114da(0x12e)](_0x50ccc0));console[_0xb114da(0x189)](_0xb114da(0x12d)+formatElapsed(_0x452032)),console[_0xb114da(0x189)]('━'['repeat'](0x3c));const _0x5b3145={'summary':{'total':_0x205820['length'],'passed':_0x44dfea,'failed':_0x545452,'errors':_0x50ccc0>0x0?_0x50ccc0:undefined,'duration_ms':_0x452032},'tests':_0x205820,'agent':{'project':_0x537796[_0xb114da(0x16c)],'name':_0x537796['agentName'],'site':_0x3b68e0},'timestamp':new Date(_0x11ad6b)[_0xb114da(0x172)]()};if(_0x23b25c!==_0xb114da(0x16a)||_0x183b84){const _0xcdde1b=formatResults(_0x5b3145,_0x23b25c);if(_0x183b84)try{a5_0x533469[_0xb114da(0x16b)](_0x183b84,_0xcdde1b,'utf-8'),console[_0xb114da(0x189)](),console[_0xb114da(0x189)](a5_0x459c27['dim'](_0xb114da(0x105)+_0x183b84));}catch(_0x29bb01){return console[_0xb114da(0x189)](),console[_0xb114da(0x189)](a5_0x459c27['red'](_0xb114da(0x181)+_0x29bb01)),0x1;}else console[_0xb114da(0x189)](),console[_0xb114da(0x189)](_0xcdde1b);}const _0x5fdeed=_0x205820[_0xb114da(0x149)](_0x5bba24=>_0x5bba24['status']!=='PASS');return _0x5fdeed[_0xb114da(0x179)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x5eb280=a6_0x2642;(function(_0x11f8c7,_0x694dc9){const _0x377800=a6_0x2642,_0x58a817=_0x11f8c7();while(!![]){try{const _0x1bd7dc=parseInt(_0x377800(0x211))/0x1*(parseInt(_0x377800(0x22c))/0x2)+parseInt(_0x377800(0x218))/0x3*(parseInt(_0x377800(0x213))/0x4)+-parseInt(_0x377800(0x1fa))/0x5+-parseInt(_0x377800(0x226))/0x6+-parseInt(_0x377800(0x203))/0x7+parseInt(_0x377800(0x21f))/0x8*(parseInt(_0x377800(0x216))/0x9)+-parseInt(_0x377800(0x1f9))/0xa*(-parseInt(_0x377800(0x221))/0xb);if(_0x1bd7dc===_0x694dc9)break;else _0x58a817['push'](_0x58a817['shift']());}catch(_0x26b173){_0x58a817['push'](_0x58a817['shift']());}}}(a6_0x4a76,0x68493));import{BaseCommand}from'./command.js';function a6_0x4a76(){const _0x156a38=['PUT','set-cookie','description','llm','Results\x20saved\x20to\x20','20aQDuyL','2272910AhgUZE','body','x-xsrf-token','noColor','entries','\x22.\x20','isArray','log','authorization','1041621DbAUoN','site','headers','.\x20Valid\x20methods:\x20','cookie','Invalid\x20API\x20type:\x20','includes','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','api','llm-proxy','GET','Invalid\x20header\x20format:\x20\x22','file','DELETE','132iEBqSI','toLowerCase','4gYCXTj','type','header','50139mTTnsF','x-auth-token','1900785wbfoAY','execute','output','cdp','Error:\x20','toUpperCase','PATCH','664QmOIRF','<\x20HTTP/1.1\x20','218845CBxFEh','Invalid\x20HTTP\x20method:\x20','trino','data','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','898332AzoUut','validate','proxy-authorization','POST','length','keys','674aPUvbl','name','set-cookie2','stack','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','error','color','method','substring','.\x20Valid\x20types:\x20','verbose','x-trino-user','message'];a6_0x4a76=function(){return _0x156a38;};return a6_0x4a76();}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_0x2642(_0x5db924,_0x52c36c){_0x5db924=_0x5db924-0x1ed;const _0x4a762c=a6_0x4a76();let _0x264283=_0x4a762c[_0x5db924];return _0x264283;}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x5eb280(0x202),a6_0x5eb280(0x228),a6_0x5eb280(0x207),a6_0x5eb280(0x1f5),a6_0x5eb280(0x22e),a6_0x5eb280(0x1fc),a6_0x5eb280(0x217),a6_0x5eb280(0x1f2)]);function isSensitiveHeader(_0x53511b){const _0x47b6e2=a6_0x5eb280;return SENSITIVE_HEADERS['has'](_0x53511b[_0x47b6e2(0x212)]());}function parseHeader(_0x284753){const _0x21306c=a6_0x5eb280,_0x141312=_0x284753['indexOf'](':');if(_0x141312===-0x1)throw new Error(_0x21306c(0x20e)+_0x284753+_0x21306c(0x1ff)+_0x21306c(0x230));const _0x120731=_0x284753[_0x21306c(0x1ef)](0x0,_0x141312)['trim'](),_0x4ba1f9=_0x284753[_0x21306c(0x1ef)](_0x141312+0x1)['trim']();if(!_0x120731)throw new Error(_0x21306c(0x20a)+_0x284753+'\x22');return[_0x120731,_0x4ba1f9];}export class ApiCommand extends BaseCommand{[a6_0x5eb280(0x22d)]=a6_0x5eb280(0x20b);[a6_0x5eb280(0x1f6)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x5eb280(0x227)](_0x440e42){const _0x354eeb=a6_0x5eb280,{args:_0x29053d,options:_0x38acee}=_0x440e42,_0xb6551=_0x38acee;if(_0x29053d[_0x354eeb(0x22a)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x1ccb2c=_0x29053d[0x0];if(!_0x1ccb2c['startsWith']('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x1ccb2c;const _0x407d6b=_0xb6551['data'],_0x284ba1=_0xb6551[_0x354eeb(0x20f)];if(_0x407d6b&&_0x284ba1)return _0x354eeb(0x225);const _0x2bfeff=_0xb6551[_0x354eeb(0x1ee)]||_0x354eeb(0x20d),_0x4a7106=[_0x354eeb(0x20d),_0x354eeb(0x229),_0x354eeb(0x1f4),_0x354eeb(0x210),_0x354eeb(0x21e)];if(!_0x4a7106[_0x354eeb(0x209)](_0x2bfeff[_0x354eeb(0x21d)]()))return _0x354eeb(0x222)+_0x2bfeff+_0x354eeb(0x206)+_0x4a7106['join'](',\x20');const _0x3b9dfc=_0xb6551[_0x354eeb(0x214)]||'td',_0x315392=['td',_0x354eeb(0x21b),'workflow',_0x354eeb(0x223),_0x354eeb(0x1f7),_0x354eeb(0x20c)];if(!_0x315392['includes'](_0x3b9dfc))return _0x354eeb(0x208)+_0x3b9dfc+_0x354eeb(0x1f0)+_0x315392['join'](',\x20');return undefined;}async[a6_0x5eb280(0x219)](_0x123b0e){const _0xd56f1=a6_0x5eb280,{options:_0x3d54e1,args:_0xce9f28,tdx:_0xde8af7}=_0x123b0e,_0x40ab8a=_0x3d54e1,_0x206a9b=_0xce9f28[0x0],_0x15d5c7=(_0x40ab8a['method']||_0xd56f1(0x20d))[_0xd56f1(0x21d)](),_0x13b2a2=_0x40ab8a[_0xd56f1(0x224)],_0x43cf8a=_0x40ab8a['file'],_0x21dd0c=_0x40ab8a[_0xd56f1(0x215)],_0x4bfd90=_0x40ab8a['type']||'td';try{const _0x5bc8b0={};if(_0x21dd0c){const _0x136d1c=Array[_0xd56f1(0x200)](_0x21dd0c)?_0x21dd0c:[_0x21dd0c];for(const _0x614ac9 of _0x136d1c){const [_0x213db6,_0x321c3a]=parseHeader(_0x614ac9);_0x5bc8b0[_0x213db6]=_0x321c3a;}}let _0xa9b6c1;if(_0x13b2a2)_0xa9b6c1=_0x13b2a2;else{if(_0x43cf8a)try{_0xa9b6c1=RawAPI['readBodyFromFile'](_0x43cf8a);}catch(_0x23dacd){return console['error'](_0xd56f1(0x21c)+(_0x23dacd instanceof Error?_0x23dacd[_0xd56f1(0x1f3)]:String(_0x23dacd))),0x1;}}const _0xcb9e94={'method':_0x15d5c7,'apiType':_0x4bfd90,'includeHeaders':_0x3d54e1[_0xd56f1(0x1f1)]};_0xa9b6c1&&(_0xcb9e94[_0xd56f1(0x1fb)]=_0xa9b6c1);Object[_0xd56f1(0x22b)](_0x5bc8b0)['length']>0x0&&(_0xcb9e94[_0xd56f1(0x205)]=_0x5bc8b0);if(_0x3d54e1[_0xd56f1(0x1f1)]){const _0x51faa6=resolveSite(_0x3d54e1[_0xd56f1(0x204)]),_0x4d75fe=getEndpoint(_0x51faa6,_0x4bfd90),_0x537787=''+_0x4d75fe+_0x206a9b;console[_0xd56f1(0x231)]('>\x20'+_0x15d5c7+'\x20'+_0x537787);const _0x35d977=getAuthHeaders(_0x51faa6),_0x4c5293={..._0x35d977,..._0x5bc8b0};for(const [_0x1a5de8,_0x28d1d9]of Object[_0xd56f1(0x1fe)](_0x4c5293)){!isSensitiveHeader(_0x1a5de8)&&console[_0xd56f1(0x231)]('>\x20'+_0x1a5de8+':\x20'+_0x28d1d9);}_0xa9b6c1&&console[_0xd56f1(0x231)]('>'),console[_0xd56f1(0x231)]('');}const _0xcaea15=await _0xde8af7['api']['request'](_0x206a9b,_0xcb9e94);if(_0x3d54e1[_0xd56f1(0x1f1)]&&_0xcaea15[_0xd56f1(0x205)]){console[_0xd56f1(0x231)](_0xd56f1(0x220)+_0xcaea15['status']);for(const [_0x37eb10,_0x56eaf0]of Object['entries'](_0xcaea15[_0xd56f1(0x205)])){!isSensitiveHeader(_0x37eb10)&&console[_0xd56f1(0x231)]('<\x20'+_0x37eb10+':\x20'+_0x56eaf0);}console[_0xd56f1(0x231)]('');}const _0x5d06de=Boolean(_0x3d54e1[_0xd56f1(0x21a)]),_0x226b86={'color':_0x3d54e1[_0xd56f1(0x1ed)],'noColor':_0x3d54e1[_0xd56f1(0x1fd)]||_0x5d06de&&!_0x3d54e1[_0xd56f1(0x1ed)]},_0x27fc04=colorizeJSON(_0xcaea15[_0xd56f1(0x224)],_0x226b86);return _0x3d54e1[_0xd56f1(0x21a)]?(writeFileSync(_0x3d54e1[_0xd56f1(0x21a)],_0x27fc04),console[_0xd56f1(0x231)](_0xd56f1(0x1f8)+_0x3d54e1[_0xd56f1(0x21a)])):console[_0xd56f1(0x201)](_0x27fc04),0x0;}catch(_0x107f7d){return _0x107f7d instanceof Error?(console[_0xd56f1(0x231)](_0xd56f1(0x21c)+_0x107f7d[_0xd56f1(0x1f3)]),_0x3d54e1[_0xd56f1(0x1f1)]&&_0x107f7d[_0xd56f1(0x22f)]&&console[_0xd56f1(0x231)]('\x0aStack\x20trace:\x0a'+_0x107f7d[_0xd56f1(0x22f)])):console['error'](_0xd56f1(0x21c)+String(_0x107f7d)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x1f5a76=a7_0x5332;function a7_0x5332(_0x14737f,_0x39f51b){_0x14737f=_0x14737f-0xe7;const _0x3355dc=a7_0x3355();let _0x5332d0=_0x3355dc[_0x14737f];return _0x5332d0;}(function(_0x426b8b,_0x122ac8){const _0x50cf00=a7_0x5332,_0xa3474f=_0x426b8b();while(!![]){try{const _0x1a357f=-parseInt(_0x50cf00(0x133))/0x1+parseInt(_0x50cf00(0xea))/0x2+parseInt(_0x50cf00(0x11f))/0x3+-parseInt(_0x50cf00(0x104))/0x4+-parseInt(_0x50cf00(0x10c))/0x5*(-parseInt(_0x50cf00(0xf5))/0x6)+parseInt(_0x50cf00(0x130))/0x7*(parseInt(_0x50cf00(0xf6))/0x8)+parseInt(_0x50cf00(0x113))/0x9;if(_0x1a357f===_0x122ac8)break;else _0xa3474f['push'](_0xa3474f['shift']());}catch(_0xbcea9d){_0xa3474f['push'](_0xa3474f['shift']());}}}(a7_0x3355,0xaf471));function a7_0x3355(){const _0xadbf55=['profile','bold','441iaAEvb','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','API\x20key\x20cannot\x20be\x20empty','982481tLngGT','description','User:\x20','tdx:\x20auth\x20setup','No\x20credential\x20found','trim','235400LFMrZp','email','last_name','execute','Name:\x20','✓\x20Default\x20site\x20set\x20to\x20','\x27\x20registered','tdx\x20profile:\x20','name','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','1091562TeWrye','59288UiJRbb','us01','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','log','yellow','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','status','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','✓\x20API\x20key\x20removed\x20from\x20keychain','jobs','No\x20API\x20key\x20found\x20in\x20keychain','\x20for\x20profile:\x20','\x20--profile\x20','2149216fJcbvs','text','N/A','warn','auth:setup','select','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','customSite','15IbCkXA','getUserInfo','Setup\x20API\x20key\x20authentication\x20interactively','\x20\x20tdx','red','\x20(profile:\x20','Enter\x20site\x20name:','8025876nRngSS','green','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Select\x20your\x20Treasure\x20Data\x20site:','password','/app/mp/ak','\x0aSetup\x20cancelled','apiKey','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','✗\x20Validation\x20failed:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','message','646752hUWPay','test','site','✓\x20Profile\x20\x27','first_name','auth','Enter\x20your\x20TD\x20API\x20key:','auth:clear','tdx:\x20auth\x20clear','filter','error','System\x20keychain\x20is\x20not\x20available','\x20(site:\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','Read\x20credential\x20from\x20'];a7_0x3355=function(){return _0xadbf55;};return a7_0x3355();}import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x26f5ab 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_0xada4b4 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x1f5a76(0xf2)]=a7_0x1f5a76(0x108);[a7_0x1f5a76(0x134)]=a7_0x1f5a76(0x10e);async[a7_0x1f5a76(0xed)](_0x35c6ce){const _0x20e553=a7_0x1f5a76,{options:_0xc52d39}=_0x35c6ce,_0x5d9bd4=_0xc52d39[_0x20e553(0x12e)];console[_0x20e553(0xf9)](a7_0xada4b4['bold'](_0x20e553(0xe7)));const _0x113837=_0xc52d39[_0x20e553(0x121)]||_0x20e553(0xf7),{choices:_0xcaf606,initialIndex:_0x27e0fa}=buildSiteChoices(_0x113837),_0x213deb=_0x5d9bd4?_0x20e553(0xfd)+_0x5d9bd4+'):':_0x20e553(0x116),_0x15620b=await a7_0x26f5ab({'type':_0x20e553(0x109),'name':_0x20e553(0x121),'message':_0x213deb,'choices':_0xcaf606,'initial':_0x27e0fa});if(!_0x15620b[_0x20e553(0x121)])return console[_0x20e553(0xf9)](_0x20e553(0x119)),0x1;let _0x2113f4;if(_0x15620b[_0x20e553(0x121)]==='other'){const _0x464837=await a7_0x26f5ab({'type':_0x20e553(0x105),'name':_0x20e553(0x10b),'message':_0x20e553(0x112),'initial':'us01','validate':_0x2480e8=>{const _0x56d0a3=_0x20e553;if(!_0x2480e8||!_0x2480e8['trim']())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x56d0a3(0x120)](_0x2480e8['trim']()))return _0x56d0a3(0xf4);return!![];}});if(!_0x464837['customSite'])return console['log'](_0x20e553(0x119)),0x1;_0x2113f4=_0x464837[_0x20e553(0x10b)];}else _0x2113f4=_0x15620b[_0x20e553(0x121)];const _0x3d640a=resolveSite(_0x2113f4);console[_0x20e553(0xf9)](_0x20e553(0x12c)+_0x3d640a),console[_0x20e553(0xf9)](_0x20e553(0x11d)),console[_0x20e553(0xf9)]('\x20\x20'+getConsoleUrl(_0x3d640a,_0x20e553(0x118)));const _0x36fab0=await a7_0x26f5ab({'type':_0x20e553(0x117),'name':_0x20e553(0x11a),'message':_0x20e553(0x125),'validate':_0x3dab00=>{const _0x1cf83e=_0x20e553;if(!_0x3dab00||!_0x3dab00[_0x1cf83e(0xe9)]())return _0x1cf83e(0x132);return!![];}});if(!_0x36fab0[_0x20e553(0x11a)])return console[_0x20e553(0xf9)](_0x20e553(0x119)),0x1;const _0x59cd9d=_0x36fab0[_0x20e553(0x11a)];console[_0x20e553(0xf9)]('Validating\x20API\x20key...');try{const _0x3276a2=TDX['create']({'site':_0x3d640a,'apiKey':_0x59cd9d[_0x20e553(0xe9)](),'logLevel':_0xc52d39['logLevel']??LogLevel['ERROR']}),_0x2f5c26=await _0x3276a2[_0x20e553(0x100)][_0x20e553(0x10d)]();console[_0x20e553(0xf9)](_0x20e553(0x10a)+_0x2f5c26[_0x20e553(0xeb)]+')');const _0x4da1b7=await isKeychainAvailable();_0x4da1b7?(await saveAPIKeyAsync(_0x59cd9d[_0x20e553(0xe9)](),_0x3d640a,_0x5d9bd4),console[_0x20e553(0xf9)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x5d9bd4?'\x20(profile:\x20'+_0x5d9bd4+')':''))):(console[_0x20e553(0x107)](a7_0xada4b4['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console['warn'](a7_0xada4b4[_0x20e553(0xfa)](_0x20e553(0xfb))));if(_0x5d9bd4){const _0x5c4eda={'site':_0x3d640a};saveProfileToUserConfig(_0x5d9bd4,_0x5c4eda),console[_0x20e553(0xf9)](_0x20e553(0x122)+_0x5d9bd4+_0x20e553(0xf0));}else saveDefaultSiteToUserConfig(_0x3d640a),console[_0x20e553(0xf9)](_0x20e553(0xef)+_0x3d640a);const _0x2f2cbc=_0x5d9bd4?_0x20e553(0x103)+_0x5d9bd4:'';return console[_0x20e553(0xf9)](),console[_0x20e553(0xf9)](_0x20e553(0xf3)),console[_0x20e553(0xf9)]('\x20\x20tdx'+_0x2f2cbc+_0x20e553(0x131)),console[_0x20e553(0xf9)](_0x20e553(0x10f)+_0x2f2cbc+_0x20e553(0xf8)),0x0;}catch(_0x2b0692){if(_0x2b0692 instanceof HTTPClientError&&_0x2b0692[_0x20e553(0xfc)]===0x191)return printAuthError(_0x2b0692),0x1;return console['error'](a7_0xada4b4[_0x20e553(0x110)](_0x20e553(0x11c)+(_0x2b0692 instanceof Error?_0x2b0692[_0x20e553(0x11e)]:String(_0x2b0692)))),console[_0x20e553(0x129)](_0x20e553(0x11b)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x1f5a76(0xf2)]=a7_0x1f5a76(0x124);['description']=a7_0x1f5a76(0x115);async[a7_0x1f5a76(0xed)](_0x40ef81){const _0x1d0712=a7_0x1f5a76,{options:_0x1804ba,tdx:_0x2dd0f9}=_0x40ef81,_0x15ae02=_0x1804ba['site'],_0x2cf3c5=_0x1804ba[_0x1d0712(0x12e)],_0x44137d=_0x2cf3c5?_0x2cf3c5:_0x1d0712(0x106);console[_0x1d0712(0xf9)](_0x1d0712(0xf1)+_0x44137d+_0x1d0712(0x12b)+_0x15ae02+')');const _0x56f534=await resolveAPIKeyAsync(_0x15ae02,_0x2cf3c5);if(_0x56f534){const {source:_0xb520af,isDeprecated:_0x35802c}=_0x56f534,_0xaad7f4=_0x1d0712(0x12d)+_0xb520af;console[_0x1d0712(0xf9)](_0x35802c?a7_0xada4b4[_0x1d0712(0xfa)](_0xaad7f4):_0xaad7f4);}else console[_0x1d0712(0xf9)](a7_0xada4b4[_0x1d0712(0xfa)](_0x1d0712(0xe8)));try{const _0x3b62cb=await _0x2dd0f9[_0x1d0712(0x100)][_0x1d0712(0x10d)]();return console['log'](a7_0xada4b4[_0x1d0712(0x114)]('✓\x20Authentication\x20successful\x0a')),console[_0x1d0712(0xf9)](_0x1d0712(0x135)+_0x3b62cb[_0x1d0712(0xeb)]),(_0x3b62cb['first_name']||_0x3b62cb[_0x1d0712(0xec)])&&console[_0x1d0712(0xf9)](_0x1d0712(0xee)+[_0x3b62cb[_0x1d0712(0x123)],_0x3b62cb['last_name']][_0x1d0712(0x128)](Boolean)['join']('\x20')),0x0;}catch(_0x32a3ad){return _0x32a3ad instanceof HTTPClientError&&_0x32a3ad['status']===0x191?printAuthError(_0x32a3ad,!![],_0x2cf3c5):console['error'](a7_0xada4b4[_0x1d0712(0x110)]('✗\x20Validation\x20failed:\x20'+(_0x32a3ad instanceof Error?_0x32a3ad[_0x1d0712(0x11e)]:String(_0x32a3ad)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x1f5a76(0xf2)]=a7_0x1f5a76(0x126);[a7_0x1f5a76(0x134)]=a7_0x1f5a76(0xfe);async[a7_0x1f5a76(0xed)](_0x3cea43){const _0x1b1b0c=a7_0x1f5a76,{options:_0x52bbd6}=_0x3cea43,_0x5ed335=_0x52bbd6[_0x1b1b0c(0x12e)];console[_0x1b1b0c(0xf9)](a7_0xada4b4[_0x1b1b0c(0x12f)](_0x1b1b0c(0x127)));const _0x46a1ab=await isKeychainAvailable();if(!_0x46a1ab)return console['error'](a7_0xada4b4['red'](_0x1b1b0c(0x12a))),0x1;const _0x39ca7f=await deleteKeychainAPIKey(_0x5ed335);return _0x39ca7f?(clearCredentialCache(),console[_0x1b1b0c(0xf9)](_0x1b1b0c(0xff)+(_0x5ed335?_0x1b1b0c(0x111)+_0x5ed335+')':'')),0x0):(console[_0x1b1b0c(0xf9)](_0x1b1b0c(0x101)+(_0x5ed335?_0x1b1b0c(0x102)+_0x5ed335:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x4ba00c=a8_0x1c6b;(function(_0x26e361,_0x5c107c){const _0x368ecf=a8_0x1c6b,_0x3f02ae=_0x26e361();while(!![]){try{const _0x3935a9=-parseInt(_0x368ecf(0x1ed))/0x1*(parseInt(_0x368ecf(0x1eb))/0x2)+-parseInt(_0x368ecf(0x1c1))/0x3*(parseInt(_0x368ecf(0x1f1))/0x4)+parseInt(_0x368ecf(0x1d0))/0x5*(-parseInt(_0x368ecf(0x207))/0x6)+-parseInt(_0x368ecf(0x1c2))/0x7+-parseInt(_0x368ecf(0x1f2))/0x8+-parseInt(_0x368ecf(0x1c7))/0x9+parseInt(_0x368ecf(0x1cf))/0xa*(parseInt(_0x368ecf(0x1e2))/0xb);if(_0x3935a9===_0x5c107c)break;else _0x3f02ae['push'](_0x3f02ae['shift']());}catch(_0x2fc634){_0x3f02ae['push'](_0x3f02ae['shift']());}}}(a8_0xf0e2,0x450ea));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';function a8_0xf0e2(){const _0x425d3a=['streamChatJsonl','\x27...','join','tool_call','log','2076hVpxYy','1196314IGaEkj','llmProject','\x20\x20Cause:\x20','Chat\x20session:\x20','type','602847KImkZj','agentId','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','Error:\x20Chat\x20session\x20\x27','llmAgent','done','404','chatId','290rNombO','15710jLwpND','\x0aError:\x20','functionName','handleChatEvent','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','Create\x20a\x20new\x20chat\x20session','targetAgent','streamChat','agent','llm','args','\x0aStack\x20trace:','execute','--agent\x20flag','Getting\x20default\x20agent...','site','stringify','Using\x20agent\x20from\x20','608476UPOkAv','context','startChat','code','Resolving\x20project\x20\x27','error','Resolving\x20agent\x20\x27','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','resolveAgentId','446pSqJfq','chat-create','734TTgzkr','content','message','data','2672CvKycI','1271944DTJXei','targetKnowledgeBase','validate','cause','stack','tool','metadata','new','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','description','verbose','CHAT_NOT_FOUND','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','targetFunction','name','write','projectId','Continuing\x20chat:\x20','Using\x20cached\x20default\x20agent:\x20','tool_result','options','570mXvQKn','getOrCreateDefaultAgent','chat','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','event'];a8_0xf0e2=function(){return _0x425d3a;};return a8_0xf0e2();}import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x522740,_0xf7fbdf){const _0xb4a03f=a8_0x1c6b;if(_0x522740 instanceof SDKError)console['error']('Error:\x20'+_0x522740['message']),_0xf7fbdf[_0xb4a03f(0x1fc)]&&(_0x522740[_0xb4a03f(0x1f5)]&&console['error'](_0xb4a03f(0x1c4)+_0x522740['cause']),_0x522740[_0xb4a03f(0x1f6)]&&(console[_0xb4a03f(0x1e7)](_0xb4a03f(0x1db)),console[_0xb4a03f(0x1e7)](_0x522740[_0xb4a03f(0x1f6)])));else throw _0x522740;}async function resolveAgentId(_0x1b0d32,_0x1f2ffc,_0x41282c,_0x1e1760,_0x4db397){const _0x5aa8c6=a8_0x1c6b,_0x5a71c2=_0x1f2ffc||_0x41282c;if(_0x5a71c2){const {projectName:_0xf96eec,agentName:_0x5a346d}=parseAgentRef(_0x5a71c2),_0x722564=_0x5a346d||_0x5a71c2,_0x24bcbb=_0x5a346d?_0xf96eec:_0x1e1760;if(!_0x24bcbb)throw new Error(_0x5aa8c6(0x1fe));if(_0x4db397){const _0x1fcc1d=_0x1f2ffc?_0x5aa8c6(0x1dd):'session\x20context';console[_0x5aa8c6(0x1e7)](_0x5aa8c6(0x1e1)+_0x1fcc1d+':\x20'+_0x24bcbb+'/'+_0x722564);}const _0x544905=await withSpinner(_0x5aa8c6(0x1e6)+_0x24bcbb+_0x5aa8c6(0x1bd),()=>_0x1b0d32[_0x5aa8c6(0x1d9)]['resolveProjectId'](_0x24bcbb),{'verbose':_0x4db397}),_0x3f2373=await withSpinner(_0x5aa8c6(0x1e8)+_0x722564+_0x5aa8c6(0x1bd),()=>_0x1b0d32[_0x5aa8c6(0x1d9)][_0x5aa8c6(0x1ea)](_0x722564,_0x544905[_0x5aa8c6(0x1f0)]),{'verbose':_0x4db397});return _0x3f2373[_0x5aa8c6(0x1f0)];}else{const _0x577714=_0x1b0d32['llm']['getDefaultAgent']();if(_0x577714)return _0x4db397&&console[_0x5aa8c6(0x1e7)](_0x5aa8c6(0x204)+_0x577714[_0x5aa8c6(0x200)]),_0x577714['id'];const _0xcf5ec=await withSpinner(_0x5aa8c6(0x1de),()=>_0x1b0d32[_0x5aa8c6(0x1d9)][_0x5aa8c6(0x208)]('claude-4.5-haiku',0x0),{'verbose':_0x4db397});return _0xcf5ec[_0x5aa8c6(0x1f0)]['id'];}}function a8_0x1c6b(_0x5ea5ee,_0x555c22){_0x5ea5ee=_0x5ea5ee-0x1bb;const _0xf0e2d9=a8_0xf0e2();let _0x1c6b9f=_0xf0e2d9[_0x5ea5ee];return _0x1c6b9f;}export class ChatCommand extends BaseCommand{[a8_0x4ba00c(0x200)]=a8_0x4ba00c(0x209);[a8_0x4ba00c(0x1fb)]=a8_0x4ba00c(0x1c9);[a8_0x4ba00c(0x1f4)](_0x5d8e68){const _0x21a3d0=a8_0x4ba00c,_0x55d0e2=_0x5d8e68[_0x21a3d0(0x1da)][_0x21a3d0(0x1be)]('\x20');if(!_0x55d0e2)return _0x21a3d0(0x1d4);return undefined;}async['streamChat'](_0x5a2d1d,_0x166049,_0x4a15b9,_0x13a614,_0x509a62){const _0x1bfba2=a8_0x4ba00c;for await(const _0x5dfe61 of _0x5a2d1d[_0x1bfba2(0x1d9)]['chat'](_0x166049,{'agentId':_0x4a15b9,'chatId':_0x13a614})){if(_0x5dfe61[_0x1bfba2(0x1c6)]===_0x1bfba2(0x1f8)){const _0x136840=_0x5dfe61[_0x1bfba2(0x1f0)]['chatId'];saveLastChatId(_0x136840),_0x509a62&&console[_0x1bfba2(0x1e7)](_0x1bfba2(0x1c5)+_0x136840);}else _0x5dfe61[_0x1bfba2(0x1c6)]===_0x1bfba2(0x1bb)&&this[_0x1bfba2(0x1d3)](_0x5dfe61[_0x1bfba2(0x1f0)]);}}async['streamChatJsonl'](_0x7bef53,_0x2210c2,_0x24db97,_0x561820){const _0x21acdd=a8_0x4ba00c,_0x1858af=_0x7bef53[_0x21acdd(0x1e3)][_0x21acdd(0x1df)];let _0x4bbdee=![];for await(const _0x1478b5 of _0x7bef53['llm'][_0x21acdd(0x209)](_0x2210c2,{'agentId':_0x24db97,'chatId':_0x561820})){if(_0x1478b5[_0x21acdd(0x1c6)]==='metadata'){const _0x19335f=_0x1478b5[_0x21acdd(0x1f0)];saveLastChatId(_0x19335f['chatId']);const _0xe4d27=_0x19335f[_0x21acdd(0x202)]&&_0x19335f['agentId']?getLLMConversationUrl(_0x1858af,_0x19335f[_0x21acdd(0x202)],_0x19335f[_0x21acdd(0x1c8)],_0x19335f[_0x21acdd(0x1ce)]):undefined;console[_0x21acdd(0x1c0)](JSON['stringify']({'type':_0x21acdd(0x1f8),'data':{'chatId':_0x19335f[_0x21acdd(0x1ce)],'agentId':_0x19335f[_0x21acdd(0x1c8)],'consoleUrl':_0xe4d27}})),_0x4bbdee=!![];}else{if(_0x1478b5[_0x21acdd(0x1c6)]==='event'){!_0x4bbdee&&_0x561820&&(console[_0x21acdd(0x1c0)](JSON[_0x21acdd(0x1e0)]({'type':_0x21acdd(0x1f8),'data':{'chatId':_0x561820}})),_0x4bbdee=!![]);const _0x856acf=_0x1478b5[_0x21acdd(0x1f0)];if(_0x21acdd(0x1ee)in _0x856acf)console[_0x21acdd(0x1c0)](JSON[_0x21acdd(0x1e0)]({'type':_0x21acdd(0x1ee),'data':{'content':_0x856acf[_0x21acdd(0x1ee)]}}));else{if(_0x21acdd(0x1bf)in _0x856acf){const _0x412435=_0x856acf['tool_call'];console[_0x21acdd(0x1c0)](JSON['stringify']({'type':'tool_call','data':{'id':_0x412435['id'],'name':_0x412435[_0x21acdd(0x1d2)],'target':_0x412435[_0x21acdd(0x1f3)]?.[_0x21acdd(0x200)]||_0x412435[_0x21acdd(0x1d6)]?.['name']||_0x412435['targetWebSearchTool']?.[_0x21acdd(0x200)]||_0x412435[_0x21acdd(0x1ff)]}}));}else{if(_0x21acdd(0x1f7)in _0x856acf)console[_0x21acdd(0x1c0)](JSON[_0x21acdd(0x1e0)]({'type':_0x21acdd(0x205),'data':{'id':_0x856acf[_0x21acdd(0x1f7)]['id'],'name':_0x856acf['tool'][_0x21acdd(0x1d2)],'result':typeof _0x856acf['tool'][_0x21acdd(0x1ee)]==='string'?_0x856acf[_0x21acdd(0x1f7)][_0x21acdd(0x1ee)]['slice'](0x0,0x1f4):''}}));else _0x21acdd(0x1e7)in _0x856acf&&console['log'](JSON[_0x21acdd(0x1e0)]({'type':_0x21acdd(0x1e7),'data':{'error':_0x856acf['error']}}));}}}}}console['log'](JSON[_0x21acdd(0x1e0)]({'type':_0x21acdd(0x1cc)}));}async[a8_0x4ba00c(0x1dc)](_0x595e86){const _0x39df27=a8_0x4ba00c,{options:_0x4230ee,args:_0x2aec92,tdx:_0x501f1e}=_0x595e86,_0x1f59c3=_0x2aec92[_0x39df27(0x1be)]('\x20'),_0x249ee1=_0x4230ee,_0x268a74=_0x249ee1['agent'],_0x21bc69=_0x249ee1[_0x39df27(0x1cb)],_0x4c4c95=_0x249ee1[_0x39df27(0x1c3)],_0x349f22=_0x249ee1[_0x39df27(0x1f9)],_0x216152=_0x249ee1[_0x39df27(0x1ce)],_0xc2eeeb=_0x249ee1['stream'];if(_0x349f22&&_0x216152)return console[_0x39df27(0x1e7)](_0x39df27(0x1e9)),0x1;try{let _0x299c01,_0x4f15b3;if(_0x216152)_0x4f15b3=_0x216152;else!_0x349f22&&(_0x4f15b3=loadLastChatId(),_0x4f15b3&&_0x4230ee[_0x39df27(0x1fc)]&&console[_0x39df27(0x1e7)](_0x39df27(0x203)+_0x4f15b3));!_0x216152&&(_0x349f22||!_0x4f15b3)&&(_0x299c01=await resolveAgentId(_0x501f1e,_0x268a74,_0x21bc69,_0x4c4c95,_0x4230ee[_0x39df27(0x1fc)]));const _0xe186fb=_0xc2eeeb?(_0x416f8d,_0x4be2dc,_0x50f179)=>this[_0x39df27(0x1bc)](_0x501f1e,_0x416f8d,_0x4be2dc,_0x50f179):(_0x25a294,_0x2cfc7a,_0x98d50b)=>this[_0x39df27(0x1d7)](_0x501f1e,_0x25a294,_0x2cfc7a,_0x98d50b,_0x4230ee[_0x39df27(0x1fc)]);try{await _0xe186fb(_0x1f59c3,_0x299c01,_0x4f15b3);}catch(_0x587f6d){const _0x117886=_0x587f6d instanceof SDKError&&_0x587f6d[_0x39df27(0x1e5)]===ErrorCode[_0x39df27(0x1fd)]||_0x587f6d instanceof Error&&_0x587f6d[_0x39df27(0x1ef)]['includes'](_0x39df27(0x1cd));if(_0x117886&&_0x216152)return console[_0x39df27(0x1e7)](_0x39df27(0x1ca)+_0x216152+'\x27\x20not\x20found'),0x1;if(_0x117886)_0x4230ee[_0x39df27(0x1fc)]&&console[_0x39df27(0x1e7)](_0x39df27(0x20a)),!_0x299c01&&(_0x299c01=await resolveAgentId(_0x501f1e,_0x268a74,_0x21bc69,_0x4c4c95,_0x4230ee[_0x39df27(0x1fc)])),await _0xe186fb(_0x1f59c3,_0x299c01,undefined);else throw _0x587f6d;}return!_0xc2eeeb&&console[_0x39df27(0x1c0)](),0x0;}catch(_0x223ae0){return console[_0x39df27(0x1e7)](),handleSDKError(_0x223ae0,_0x4230ee),0x1;}}['handleChatEvent'](_0x78f9aa){const _0x590df5=a8_0x4ba00c;if(_0x590df5(0x1ee)in _0x78f9aa)process['stdout'][_0x590df5(0x201)](_0x78f9aa[_0x590df5(0x1ee)]);else _0x590df5(0x1e7)in _0x78f9aa&&console[_0x590df5(0x1e7)](_0x590df5(0x1d1)+_0x78f9aa['error']);}}export class ChatCreateCommand extends BaseCommand{['name']=a8_0x4ba00c(0x1ec);[a8_0x4ba00c(0x1fb)]=a8_0x4ba00c(0x1d5);[a8_0x4ba00c(0x1f4)](_0x3bce1d){const _0x31c7ea=a8_0x4ba00c,_0x273264=_0x3bce1d[_0x31c7ea(0x206)],_0x1b7622=_0x273264['agent'],_0x37b96f=_0x273264[_0x31c7ea(0x1cb)];if(!_0x1b7622&&!_0x37b96f)return _0x31c7ea(0x1fa);return undefined;}async['execute'](_0x271398){const _0x5735de=a8_0x4ba00c,{options:_0x27f255,tdx:_0x5dddd8}=_0x271398,_0x3c3dcd=_0x27f255,_0x50c6f8=_0x3c3dcd[_0x5735de(0x1d8)],_0x3391d1=_0x3c3dcd[_0x5735de(0x1cb)],_0x83ec0b=_0x3c3dcd[_0x5735de(0x1c3)];try{const _0x13656f=await resolveAgentId(_0x5dddd8,_0x50c6f8,_0x3391d1,_0x83ec0b,_0x27f255[_0x5735de(0x1fc)]),_0x4e0a9c=await _0x5dddd8[_0x5735de(0x1d9)][_0x5735de(0x1e4)](_0x13656f);return saveLastChatId(_0x4e0a9c['id']),console[_0x5735de(0x1c0)](JSON[_0x5735de(0x1e0)]({'chatId':_0x4e0a9c['id'],'agentId':_0x13656f})),0x0;}catch(_0x285c37){return handleSDKError(_0x285c37,_0x27f255),0x1;}}}
|
|
1
|
+
const a8_0x2a9cf9=a8_0x3c39;(function(_0x52ef04,_0x614ebd){const _0x5cec86=a8_0x3c39,_0x1d7859=_0x52ef04();while(!![]){try{const _0x415de9=-parseInt(_0x5cec86(0x1e0))/0x1*(-parseInt(_0x5cec86(0x1ea))/0x2)+-parseInt(_0x5cec86(0x201))/0x3*(-parseInt(_0x5cec86(0x20b))/0x4)+-parseInt(_0x5cec86(0x1fd))/0x5+parseInt(_0x5cec86(0x208))/0x6+parseInt(_0x5cec86(0x1f1))/0x7*(parseInt(_0x5cec86(0x206))/0x8)+parseInt(_0x5cec86(0x1e7))/0x9*(parseInt(_0x5cec86(0x1e8))/0xa)+parseInt(_0x5cec86(0x219))/0xb*(-parseInt(_0x5cec86(0x1e1))/0xc);if(_0x415de9===_0x614ebd)break;else _0x1d7859['push'](_0x1d7859['shift']());}catch(_0x4e0cb4){_0x1d7859['push'](_0x1d7859['shift']());}}}(a8_0x5a13,0xa175d));function a8_0x3c39(_0x53b516,_0x19f216){_0x53b516=_0x53b516-0x1cf;const _0x5a13cc=a8_0x5a13();let _0x3c39c0=_0x5a13cc[_0x53b516];return _0x3c39c0;}import{BaseCommand}from'./command.js';function a8_0x5a13(){const _0x351486=['execute','Resolving\x20agent\x20\x27','llmProject','metadata','getOrCreateDefaultAgent','write','11lxVglw','options','content','site','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','chat-create','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','Using\x20agent\x20from\x20','Create\x20a\x20new\x20chat\x20session','\x20\x20Cause:\x20','slice','data','agent','startChat','cause','Getting\x20default\x20agent...','message','log','tool_call','functionName','validate','description','projectId','--agent\x20flag','282250lvxKmL','40207092lostTC','stream','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','claude-4.5-haiku','code','done','9dbsLJN','10598600myqfcn','stack','8tVzeky','type','join','resolveProjectId','\x27...','name','targetKnowledgeBase','308WLPsPK','agentId','llm','chatId','includes','streamChat','Using\x20cached\x20default\x20agent:\x20','Error:\x20','session\x20context','chat','handleChatEvent','targetAgent','3760945cErMoy','tool','error','Continuing\x20chat:\x20','785940ypvMhj','Chat\x20session:\x20','getDefaultAgent','stringify','llmAgent','153704jGbUre','\x0aError:\x20','4091814OuFFpz','new','Resolving\x20project\x20\x27','16APCKji','string','\x0aStack\x20trace:','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','event','stdout','targetWebSearchTool','verbose'];a8_0x5a13=function(){return _0x351486;};return a8_0x5a13();}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(_0x215c2a,_0x5eb569){const _0x5cf1a6=a8_0x3c39;if(_0x215c2a instanceof SDKError)console[_0x5cf1a6(0x1ff)](_0x5cf1a6(0x1f8)+_0x215c2a[_0x5cf1a6(0x1d8)]),_0x5eb569[_0x5cf1a6(0x212)]&&(_0x215c2a[_0x5cf1a6(0x1d6)]&&console[_0x5cf1a6(0x1ff)](_0x5cf1a6(0x1d1)+_0x215c2a['cause']),_0x215c2a[_0x5cf1a6(0x1e9)]&&(console[_0x5cf1a6(0x1ff)](_0x5cf1a6(0x20d)),console['error'](_0x215c2a[_0x5cf1a6(0x1e9)])));else throw _0x215c2a;}async function resolveAgentId(_0x582705,_0x2703e5,_0xeba21c,_0x1105fd,_0x103a9f){const _0x21d792=a8_0x3c39,_0x3ee7e8=_0x2703e5||_0xeba21c;if(_0x3ee7e8){const {projectName:_0x3ab7ee,agentName:_0x4f2bb6}=parseAgentRef(_0x3ee7e8),_0x4e0ff7=_0x4f2bb6||_0x3ee7e8,_0x41496e=_0x4f2bb6?_0x3ab7ee:_0x1105fd;if(!_0x41496e)throw new Error(_0x21d792(0x1e3));if(_0x103a9f){const _0x45063d=_0x2703e5?_0x21d792(0x1df):_0x21d792(0x1f9);console[_0x21d792(0x1ff)](_0x21d792(0x1cf)+_0x45063d+':\x20'+_0x41496e+'/'+_0x4e0ff7);}const _0x13a7bf=await withSpinner(_0x21d792(0x20a)+_0x41496e+_0x21d792(0x1ee),()=>_0x582705[_0x21d792(0x1f3)][_0x21d792(0x1ed)](_0x41496e),{'verbose':_0x103a9f}),_0x10747f=await withSpinner(_0x21d792(0x214)+_0x4e0ff7+_0x21d792(0x1ee),()=>_0x582705[_0x21d792(0x1f3)]['resolveAgentId'](_0x4e0ff7,_0x13a7bf['data']),{'verbose':_0x103a9f});return _0x10747f[_0x21d792(0x1d3)];}else{const _0x3cf145=_0x582705[_0x21d792(0x1f3)][_0x21d792(0x203)]();if(_0x3cf145)return _0x103a9f&&console[_0x21d792(0x1ff)](_0x21d792(0x1f7)+_0x3cf145['name']),_0x3cf145['id'];const _0x184b86=await withSpinner(_0x21d792(0x1d7),()=>_0x582705[_0x21d792(0x1f3)][_0x21d792(0x217)](_0x21d792(0x1e4),0x0),{'verbose':_0x103a9f});return _0x184b86[_0x21d792(0x1d3)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x2a9cf9(0x1ef)]='chat';[a8_0x2a9cf9(0x1dd)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x2a9cf9(0x1dc)](_0x4ed6ca){const _0x3d3b0f=a8_0x2a9cf9,_0x238752=_0x4ed6ca['args'][_0x3d3b0f(0x1ec)]('\x20');if(!_0x238752)return _0x3d3b0f(0x20e);return undefined;}async[a8_0x2a9cf9(0x1f6)](_0x575725,_0x4e6f1d,_0x2de498,_0x28267d,_0x5ec0cd){const _0xc69f66=a8_0x2a9cf9;for await(const _0x3f7986 of _0x575725[_0xc69f66(0x1f3)][_0xc69f66(0x1fa)](_0x4e6f1d,{'agentId':_0x2de498,'chatId':_0x28267d})){if(_0x3f7986[_0xc69f66(0x1eb)]===_0xc69f66(0x216)){const _0x25e0d5=_0x3f7986['data'][_0xc69f66(0x1f4)];saveLastChatId(_0x25e0d5),_0x5ec0cd&&console[_0xc69f66(0x1ff)](_0xc69f66(0x202)+_0x25e0d5);}else _0x3f7986[_0xc69f66(0x1eb)]==='event'&&this[_0xc69f66(0x1fb)](_0x3f7986[_0xc69f66(0x1d3)]);}}async['streamChatJsonl'](_0x4f9c46,_0x41fbf3,_0x4be8f7,_0x593295){const _0x17cbf8=a8_0x2a9cf9,_0x143b78=_0x4f9c46['context'][_0x17cbf8(0x21c)];let _0x22e64a=![];for await(const _0x20c215 of _0x4f9c46[_0x17cbf8(0x1f3)][_0x17cbf8(0x1fa)](_0x41fbf3,{'agentId':_0x4be8f7,'chatId':_0x593295})){if(_0x20c215[_0x17cbf8(0x1eb)]===_0x17cbf8(0x216)){const _0x50c7bd=_0x20c215[_0x17cbf8(0x1d3)];saveLastChatId(_0x50c7bd[_0x17cbf8(0x1f4)]);const _0x5595a3=_0x50c7bd[_0x17cbf8(0x1de)]&&_0x50c7bd[_0x17cbf8(0x1f2)]?getLLMConversationUrl(_0x143b78,_0x50c7bd[_0x17cbf8(0x1de)],_0x50c7bd[_0x17cbf8(0x1f2)],_0x50c7bd[_0x17cbf8(0x1f4)]):undefined;console[_0x17cbf8(0x1d9)](JSON[_0x17cbf8(0x204)]({'type':_0x17cbf8(0x216),'data':{'chatId':_0x50c7bd[_0x17cbf8(0x1f4)],'agentId':_0x50c7bd[_0x17cbf8(0x1f2)],'consoleUrl':_0x5595a3}})),_0x22e64a=!![];}else{if(_0x20c215['type']===_0x17cbf8(0x20f)){!_0x22e64a&&_0x593295&&(console[_0x17cbf8(0x1d9)](JSON['stringify']({'type':'metadata','data':{'chatId':_0x593295}})),_0x22e64a=!![]);const _0x2c8f9f=_0x20c215[_0x17cbf8(0x1d3)];if(_0x17cbf8(0x21b)in _0x2c8f9f)console['log'](JSON['stringify']({'type':_0x17cbf8(0x21b),'data':{'content':_0x2c8f9f[_0x17cbf8(0x21b)]}}));else{if(_0x17cbf8(0x1da)in _0x2c8f9f){const _0x235975=_0x2c8f9f[_0x17cbf8(0x1da)];console[_0x17cbf8(0x1d9)](JSON[_0x17cbf8(0x204)]({'type':'tool_call','data':{'id':_0x235975['id'],'name':_0x235975[_0x17cbf8(0x1db)],'target':_0x235975[_0x17cbf8(0x1f0)]?.[_0x17cbf8(0x1ef)]||_0x235975[_0x17cbf8(0x1fc)]?.[_0x17cbf8(0x1ef)]||_0x235975[_0x17cbf8(0x211)]?.[_0x17cbf8(0x1ef)]||_0x235975['targetFunction']}}));}else{if(_0x17cbf8(0x1fe)in _0x2c8f9f)console[_0x17cbf8(0x1d9)](JSON[_0x17cbf8(0x204)]({'type':'tool_result','data':{'id':_0x2c8f9f[_0x17cbf8(0x1fe)]['id'],'name':_0x2c8f9f[_0x17cbf8(0x1fe)][_0x17cbf8(0x1db)],'result':typeof _0x2c8f9f[_0x17cbf8(0x1fe)][_0x17cbf8(0x21b)]===_0x17cbf8(0x20c)?_0x2c8f9f[_0x17cbf8(0x1fe)][_0x17cbf8(0x21b)][_0x17cbf8(0x1d2)](0x0,0x1f4):''}}));else _0x17cbf8(0x1ff)in _0x2c8f9f&&console[_0x17cbf8(0x1d9)](JSON[_0x17cbf8(0x204)]({'type':'error','data':{'error':_0x2c8f9f['error']}}));}}}}}console[_0x17cbf8(0x1d9)](JSON[_0x17cbf8(0x204)]({'type':_0x17cbf8(0x1e6)}));}async[a8_0x2a9cf9(0x213)](_0x31af4e){const _0x4e0d88=a8_0x2a9cf9,{options:_0x7431de,args:_0x5b7050,tdx:_0x22142f}=_0x31af4e,_0xebbfbd=_0x5b7050[_0x4e0d88(0x1ec)]('\x20'),_0x377313=_0x7431de,_0x446607=_0x377313['agent'],_0x3926e6=_0x377313[_0x4e0d88(0x205)],_0x300b98=_0x377313[_0x4e0d88(0x215)],_0x488f34=_0x377313[_0x4e0d88(0x209)],_0x8f25a8=_0x377313[_0x4e0d88(0x1f4)],_0x346739=_0x377313[_0x4e0d88(0x1e2)];if(_0x488f34&&_0x8f25a8)return console['error'](_0x4e0d88(0x21d)),0x1;try{let _0x3838f1,_0x4d193c;if(_0x8f25a8)_0x4d193c=_0x8f25a8;else!_0x488f34&&(_0x4d193c=loadLastChatId(),_0x4d193c&&_0x7431de[_0x4e0d88(0x212)]&&console[_0x4e0d88(0x1ff)](_0x4e0d88(0x200)+_0x4d193c));!_0x8f25a8&&(_0x488f34||!_0x4d193c)&&(_0x3838f1=await resolveAgentId(_0x22142f,_0x446607,_0x3926e6,_0x300b98,_0x7431de[_0x4e0d88(0x212)]));const _0x3da658=_0x346739?(_0x254245,_0xeb11ce,_0x2e1ec5)=>this['streamChatJsonl'](_0x22142f,_0x254245,_0xeb11ce,_0x2e1ec5):(_0x2687b7,_0x22f153,_0x47bbf8)=>this[_0x4e0d88(0x1f6)](_0x22142f,_0x2687b7,_0x22f153,_0x47bbf8,_0x7431de[_0x4e0d88(0x212)]);try{await _0x3da658(_0xebbfbd,_0x3838f1,_0x4d193c);}catch(_0x41f23a){const _0x543cc2=_0x41f23a instanceof SDKError&&_0x41f23a[_0x4e0d88(0x1e5)]===ErrorCode['CHAT_NOT_FOUND']||_0x41f23a instanceof Error&&_0x41f23a['message'][_0x4e0d88(0x1f5)]('404');if(_0x543cc2&&_0x8f25a8)return console['error']('Error:\x20Chat\x20session\x20\x27'+_0x8f25a8+'\x27\x20not\x20found'),0x1;if(_0x543cc2)_0x7431de[_0x4e0d88(0x212)]&&console[_0x4e0d88(0x1ff)]('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x3838f1&&(_0x3838f1=await resolveAgentId(_0x22142f,_0x446607,_0x3926e6,_0x300b98,_0x7431de['verbose'])),await _0x3da658(_0xebbfbd,_0x3838f1,undefined);else throw _0x41f23a;}return!_0x346739&&console[_0x4e0d88(0x1d9)](),0x0;}catch(_0x58a204){return console[_0x4e0d88(0x1ff)](),handleSDKError(_0x58a204,_0x7431de),0x1;}}[a8_0x2a9cf9(0x1fb)](_0x2bfe03){const _0x1c189a=a8_0x2a9cf9;if(_0x1c189a(0x21b)in _0x2bfe03)process[_0x1c189a(0x210)][_0x1c189a(0x218)](_0x2bfe03['content']);else _0x1c189a(0x1ff)in _0x2bfe03&&console[_0x1c189a(0x1ff)](_0x1c189a(0x207)+_0x2bfe03['error']);}}export class ChatCreateCommand extends BaseCommand{[a8_0x2a9cf9(0x1ef)]=a8_0x2a9cf9(0x21e);[a8_0x2a9cf9(0x1dd)]=a8_0x2a9cf9(0x1d0);[a8_0x2a9cf9(0x1dc)](_0x6718e9){const _0x30966d=a8_0x2a9cf9,_0x32b387=_0x6718e9[_0x30966d(0x21a)],_0x49dda0=_0x32b387[_0x30966d(0x1d4)],_0xc26b7f=_0x32b387[_0x30966d(0x205)];if(!_0x49dda0&&!_0xc26b7f)return _0x30966d(0x21f);return undefined;}async['execute'](_0x1fe206){const _0x3a66e0=a8_0x2a9cf9,{options:_0x1c7ba9,tdx:_0x20e820}=_0x1fe206,_0x12e648=_0x1c7ba9,_0x231aea=_0x12e648[_0x3a66e0(0x1d4)],_0x502e32=_0x12e648[_0x3a66e0(0x205)],_0x3f2547=_0x12e648[_0x3a66e0(0x215)];try{const _0x32e102=await resolveAgentId(_0x20e820,_0x231aea,_0x502e32,_0x3f2547,_0x1c7ba9[_0x3a66e0(0x212)]),_0x14b998=await _0x20e820['llm'][_0x3a66e0(0x1d5)](_0x32e102);return saveLastChatId(_0x14b998['id']),console['log'](JSON[_0x3a66e0(0x204)]({'chatId':_0x14b998['id'],'agentId':_0x32e102})),0x0;}catch(_0x577824){return handleSDKError(_0x577824,_0x1c7ba9),0x1;}}}
|