@treasuredata/tdx 2026.4.20 → 2026.4.22
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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +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.d.ts +47 -0
- package/dist/commands/engage-command.d.ts.map +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-command.js.map +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.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/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/passthrough-server.d.ts +10 -0
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.d.ts +50 -1
- package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.d.ts +35 -1
- package/dist/sdk/engage.d.ts.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/engage.js.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts +33 -9
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/engage.d.ts +53 -0
- package/dist/sdk/types/engage.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x23278c=a29_0x27a2;(function(_0x2d2f17,_0x3ce2f2){const _0x10e544=a29_0x27a2,_0x28b4e8=_0x2d2f17();while(!![]){try{const _0x4cbea2=-parseInt(_0x10e544(0x1d1))/0x1+parseInt(_0x10e544(0x20d))/0x2*(parseInt(_0x10e544(0x1c8))/0x3)+-parseInt(_0x10e544(0x1ff))/0x4*(parseInt(_0x10e544(0x1cd))/0x5)+parseInt(_0x10e544(0x1c4))/0x6+-parseInt(_0x10e544(0x25a))/0x7+parseInt(_0x10e544(0x19f))/0x8+parseInt(_0x10e544(0x1f3))/0x9*(parseInt(_0x10e544(0x222))/0xa);if(_0x4cbea2===_0x3ce2f2)break;else _0x28b4e8['push'](_0x28b4e8['shift']());}catch(_0x452fb4){_0x28b4e8['push'](_0x28b4e8['shift']());}}}(a29_0x1d69,0x909d0));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{confirm}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import*as a29_0x1f9959 from'node:fs';function handleSDKError(_0x552de2,_0x4c5896){const _0x424018=a29_0x27a2;if(_0x552de2 instanceof SDKError)console[_0x424018(0x280)](_0x424018(0x254)+_0x552de2[_0x424018(0x1d4)]),_0x4c5896[_0x424018(0x23a)]&&(_0x552de2['cause']&&console[_0x424018(0x280)]('\x20\x20Cause:\x20'+_0x552de2['cause']),_0x552de2[_0x424018(0x1dc)]&&(console[_0x424018(0x280)](_0x424018(0x279)),console[_0x424018(0x280)](_0x552de2['stack'])));else throw _0x552de2;}function formatChatHistoryEntry(_0x5c4bb9,_0xaf9756){const _0x41ce41=a29_0x27a2,_0x5a0c6c=getChalk(_0xaf9756),_0x5d9e78=_0x5a0c6c[_0x41ce41(0x1f9)](_0x5c4bb9['at']);if('input'in _0x5c4bb9){const _0x3db2a0=_0x5a0c6c[_0x41ce41(0x266)](_0x41ce41(0x1e8));return _0x5d9e78+'\x20'+_0x3db2a0+':\x20'+_0x5c4bb9[_0x41ce41(0x232)];}if('content'in _0x5c4bb9){const _0x4f054d=_0x5a0c6c['green'](_0x41ce41(0x211));return _0x5d9e78+'\x20'+_0x4f054d+':\x20'+_0x5c4bb9[_0x41ce41(0x238)];}if(_0x41ce41(0x267)in _0x5c4bb9){const _0xa1dc4a=_0x5a0c6c[_0x41ce41(0x252)](_0x41ce41(0x22f)),{functionName:_0x3b73cc,functionArguments:_0x1c7398,targetFunction:_0x286e13}=_0x5c4bb9[_0x41ce41(0x267)];let _0x167b0a=_0x5d9e78+'\x20'+_0xa1dc4a+':\x20'+_0x5a0c6c['bold'](_0x3b73cc);if(_0x1c7398&&Object[_0x41ce41(0x1cb)](_0x1c7398)['length']>0x0){const _0x58b6fd=Object[_0x41ce41(0x1ad)](_0x1c7398)['map'](([_0x50d983,_0xbf8921])=>_0x50d983+'='+JSON['stringify'](_0xbf8921))[_0x41ce41(0x1ea)](',\x20');_0x167b0a+='('+_0x58b6fd+')';}_0x286e13&&(_0x167b0a+=_0x5a0c6c[_0x41ce41(0x1f9)]('\x20['+_0x286e13+']'));let _0xde0e5b='';if(_0x5c4bb9[_0x41ce41(0x267)][_0x41ce41(0x1fb)])_0xde0e5b=_0x41ce41(0x285)+_0x5c4bb9['tool_call'][_0x41ce41(0x1fb)]['name'];else{if(_0x5c4bb9[_0x41ce41(0x267)][_0x41ce41(0x273)])_0xde0e5b=_0x41ce41(0x204)+_0x5c4bb9[_0x41ce41(0x267)][_0x41ce41(0x273)]['name'];else{if(_0x5c4bb9['tool_call']['targetWebSearchTool'])_0xde0e5b=_0x41ce41(0x1b0)+_0x5c4bb9['tool_call'][_0x41ce41(0x1c0)][_0x41ce41(0x245)];else _0x5c4bb9[_0x41ce41(0x267)][_0x41ce41(0x1fa)]&&(_0xde0e5b=_0x41ce41(0x272)+_0x5c4bb9[_0x41ce41(0x267)][_0x41ce41(0x1fa)][_0x41ce41(0x245)]);}}return _0x167b0a+_0xde0e5b;}if(_0x41ce41(0x219)in _0x5c4bb9){const _0x3fc660=_0x5a0c6c[_0x41ce41(0x23b)](_0x41ce41(0x23e)),{functionName:_0xb43bec,functionArguments:_0x1a1aff,content:_0x25d613,newChat:_0xff940a}=_0x5c4bb9[_0x41ce41(0x219)];let _0x398525=_0x5d9e78+'\x20'+_0x3fc660+':\x20'+_0x5a0c6c[_0x41ce41(0x1bc)](_0xb43bec);if(_0x1a1aff){const _0x4cae6c=typeof _0x1a1aff==='string'?_0x1a1aff:JSON[_0x41ce41(0x1a7)](_0x1a1aff);_0x398525+='('+_0x4cae6c+')';}return _0x25d613&&(_0x398525+='\x0a'+_0x5a0c6c[_0x41ce41(0x1f9)](_0x25d613)),_0xff940a&&(_0x398525+=_0x5a0c6c[_0x41ce41(0x1f9)](_0x41ce41(0x20a)+_0xff940a['id'])),_0x398525;}if(_0x41ce41(0x19b)in _0x5c4bb9){const _0x72d28=_0x5a0c6c[_0x41ce41(0x220)](_0x41ce41(0x239));return _0x5d9e78+'\x20'+_0x72d28+':\x20'+_0x5c4bb9['output'][_0x41ce41(0x245)]+'\x20('+_0x5c4bb9['output'][_0x41ce41(0x238)][_0x41ce41(0x19e)]+_0x41ce41(0x22a);}if(_0x41ce41(0x26b)in _0x5c4bb9){const _0x1f6f5e=_0x5a0c6c[_0x41ce41(0x220)]('[image]\x20\x20'),{width:_0x391b3e,height:_0x519bea,headerText:_0xa32570}=_0x5c4bb9[_0x41ce41(0x26b)],_0x329449=_0xa32570?_0x41ce41(0x1f8)+_0xa32570:'';return _0x5d9e78+'\x20'+_0x1f6f5e+':\x20'+_0x391b3e+'x'+_0x519bea+_0x329449;}if('error'in _0x5c4bb9){const _0x3167bc=_0x5a0c6c[_0x41ce41(0x1ef)](_0x41ce41(0x1f2));return _0x5d9e78+'\x20'+_0x3167bc+':\x20'+_0x5c4bb9[_0x41ce41(0x280)];}return _0x5d9e78+'\x20'+_0x5a0c6c[_0x41ce41(0x1f9)]('[unknown]')+':\x20'+JSON[_0x41ce41(0x1a7)](_0x5c4bb9);}async function executeChatHistoryCommand(_0x4d6c60,_0x20ed6f){const _0x1a1734=a29_0x27a2,{options:_0x27d310,args:_0x4f6ec9,tdx:_0x3be27e}=_0x4d6c60,_0xf61ed6=_0x4f6ec9[0x0],_0x5cef07=_0x27d310,_0x540fca=_0x5cef07[_0x1a1734(0x284)];try{if(_0x540fca&&_0xf61ed6)return console['error'](_0x1a1734(0x22b)),console[_0x1a1734(0x280)](_0x1a1734(0x1d7)+_0x20ed6f+_0x1a1734(0x1de)),0x1;if(!_0xf61ed6&&!_0x540fca&&_0x27d310['format']!==undefined){const _0x19b64b=resolveLimit(_0x27d310[_0x1a1734(0x250)],DEFAULT_LLM_LIMIT),_0x5a9a5b=await withSpinner(_0x1a1734(0x212),()=>_0x3be27e[_0x1a1734(0x1f0)]['chats'](_0x19b64b),{'verbose':_0x27d310[_0x1a1734(0x23a)]});return await handleSDKOutput(_0x5a9a5b[_0x1a1734(0x22d)],_0x27d310),0x0;}const _0x2bfcbe=await getChatIdOrSelect(_0x3be27e,_0x27d310,_0x540fca,_0xf61ed6);if(!_0x2bfcbe)return 0x0;return await displayChatHistory(_0x2bfcbe,_0x3be27e,_0x27d310),0x0;}catch(_0x1e31f9){return handleSDKError(_0x1e31f9,_0x27d310),0x1;}}async function displayChatHistory(_0x4f4756,_0x423db4,_0x55a54b){const _0x1d3be8=a29_0x27a2,_0x4d7e42=await withSpinner(_0x1d3be8(0x1e6)+_0x4f4756+_0x1d3be8(0x25b),()=>_0x423db4[_0x1d3be8(0x1f0)][_0x1d3be8(0x1e3)](_0x4f4756),{'verbose':_0x55a54b['verbose']}),_0x4f31f5=_0x4d7e42[_0x1d3be8(0x22d)]['data']??[];if(_0x4f31f5[_0x1d3be8(0x19e)]===0x0){console[_0x1d3be8(0x1e4)](_0x1d3be8(0x1d9));return;}if(_0x55a54b['format']!==undefined)await handleSDKOutput(_0x4f31f5,_0x55a54b);else{const _0x469a2d=_0x4f31f5[_0x1d3be8(0x1d6)](_0x56cd19=>formatChatHistoryEntry(_0x56cd19,_0x55a54b)),_0x54b7e1=_0x469a2d[_0x1d3be8(0x1ea)]('\x0a');await writeOutput(_0x54b7e1,_0x55a54b['output'],_0x1d3be8(0x263));}}async function getChatIdOrSelect(_0x4c9ca4,_0x17f6de,_0xb15561,_0x2401a2){const _0xea76bd=a29_0x27a2;if(_0x2401a2)return _0x2401a2;if(_0xb15561){const _0x1b8104=await withSpinner(_0xea76bd(0x1a1),()=>_0x4c9ca4[_0xea76bd(0x1f0)][_0xea76bd(0x1a5)](0x1),{'verbose':_0x17f6de[_0xea76bd(0x23a)]});if(_0x1b8104[_0xea76bd(0x22d)][_0xea76bd(0x19e)]===0x0)return console[_0xea76bd(0x1e4)](_0xea76bd(0x1ba)),undefined;return _0x1b8104[_0xea76bd(0x22d)][0x0]['id'];}const _0x488e8b=await selectChatInteractively(_0x4c9ca4,_0x17f6de);if(!_0x488e8b)return console['log'](_0xea76bd(0x1ee)),undefined;return _0x488e8b;}async function getProjectIdOrDefault(_0x5f142b){const _0x4b0389=await getProjectWithName(_0x5f142b);return _0x4b0389['id'];}async function getProjectWithName(_0x9a5f02){const _0x277e46=a29_0x27a2,{tdx:_0x28981e,options:_0x5a3f4c}=_0x9a5f02,_0x4f9388=_0x5a3f4c[_0x277e46(0x22e)];if(_0x4f9388){const _0x498195=await withSpinner(_0x277e46(0x21a)+_0x4f9388+_0x277e46(0x25b),()=>_0x28981e[_0x277e46(0x1f0)]['resolveProjectId'](_0x4f9388),{'verbose':_0x5a3f4c[_0x277e46(0x23a)]});return{'id':_0x498195[_0x277e46(0x22d)],'name':_0x4f9388};}const _0x46aa8f=_0x28981e['llm'][_0x277e46(0x19c)]();if(_0x46aa8f){const _0x494723=await _0x28981e[_0x277e46(0x1f0)][_0x277e46(0x1b4)](),_0x51ce50=_0x494723['find'](_0x8495ec=>_0x8495ec['id']===_0x46aa8f);return{'id':_0x46aa8f,'name':_0x51ce50?.[_0x277e46(0x214)][_0x277e46(0x245)]||'Unknown'};}const _0x18dfad=await withSpinner(_0x277e46(0x243),()=>_0x28981e[_0x277e46(0x1f0)][_0x277e46(0x20c)](),{'verbose':_0x5a3f4c[_0x277e46(0x23a)]});return{'id':_0x18dfad['data']['id'],'name':_0x18dfad[_0x277e46(0x22d)]['attributes'][_0x277e46(0x245)]};}function toLLMProjectInfo(_0x992627){const _0x1bc07c=a29_0x27a2;return{'name':_0x992627[_0x1bc07c(0x214)]['name'],'description':_0x992627['attributes']['description'],'createdAt':_0x992627[_0x1bc07c(0x214)]['createdAt'],'updatedAt':_0x992627[_0x1bc07c(0x214)][_0x1bc07c(0x251)]};}function toAgentInfo(_0x3ae162){const _0x431956=a29_0x27a2;return{'name':_0x3ae162[_0x431956(0x214)][_0x431956(0x245)],'description':_0x3ae162[_0x431956(0x214)][_0x431956(0x221)],'prompt':truncatePrompt(_0x3ae162['attributes'][_0x431956(0x248)]),'createdAt':_0x3ae162[_0x431956(0x214)][_0x431956(0x236)],'updatedAt':_0x3ae162[_0x431956(0x214)][_0x431956(0x251)]};}function truncatePrompt(_0x2b6959){const _0x2d952e=a29_0x27a2;if(!_0x2b6959)return undefined;const _0x3befcc=0x64;if(_0x2b6959[_0x2d952e(0x19e)]<=_0x3befcc)return _0x2b6959;return _0x2b6959[_0x2d952e(0x1da)](0x0,_0x3befcc)+_0x2d952e(0x20f);}export class LLMModelsCommand extends BaseCommand{['name']='llm:models';[a29_0x23278c(0x221)]=a29_0x23278c(0x26a);async['execute'](_0x3d89ba){const _0x2f866c=a29_0x23278c,{options:_0x3d9cac,tdx:_0x4554ef}=_0x3d89ba;try{const _0x1fb6c5=await withSpinner(_0x2f866c(0x1c7),()=>_0x4554ef[_0x2f866c(0x1f0)][_0x2f866c(0x1c2)](),{'verbose':_0x3d9cac[_0x2f866c(0x23a)]});return await handleSDKOutput(_0x1fb6c5[_0x2f866c(0x22d)],_0x3d9cac),0x0;}catch(_0x17efe5){return handleSDKError(_0x17efe5,_0x3d9cac),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a29_0x23278c(0x245)]=a29_0x23278c(0x25e);[a29_0x23278c(0x221)]=a29_0x23278c(0x270);async[a29_0x23278c(0x276)](_0x204a47){const _0x14d32d=a29_0x23278c,{options:_0x3c1c70,args:_0x325c28,tdx:_0x5e2a71}=_0x204a47,_0x14f54a=getChalk(_0x3c1c70),_0x323395=_0x3c1c70['site'];try{const _0x1d6ed4=_0x325c28[0x0],_0x37f1bd=resolveLimit(_0x3c1c70[_0x14d32d(0x250)],DEFAULT_LLM_LIMIT),_0x1412e2=await withSpinner(_0x14d32d(0x269),()=>_0x5e2a71['llm'][_0x14d32d(0x1b4)](_0x37f1bd),{'verbose':_0x3c1c70[_0x14d32d(0x23a)]});let _0x4de4ce=_0x1412e2[_0x14d32d(0x22d)];_0x1d6ed4&&(_0x4de4ce=_0x1412e2[_0x14d32d(0x22d)]['filter'](_0x4d818c=>matchGlobPattern(_0x4d818c['attributes'][_0x14d32d(0x245)],_0x1d6ed4)));const _0xa933bc=_0x3c1c70[_0x14d32d(0x27f)]===_0x14d32d(0x1e1)||_0x3c1c70[_0x14d32d(0x27f)]===_0x14d32d(0x23f)||_0x3c1c70[_0x14d32d(0x27f)]===_0x14d32d(0x263)||_0x3c1c70[_0x14d32d(0x27f)]===_0x14d32d(0x1a2);if(_0xa933bc){const _0x4caf97=_0x4de4ce[_0x14d32d(0x1d6)](_0x2b1c1c=>({...toLLMProjectInfo(_0x2b1c1c),'url':getLLMProjectUrl(_0x323395,_0x2b1c1c['id'])}));await handleSDKOutput(_0x4caf97,_0x3c1c70);}else{const _0x919443=[];if(_0x4de4ce[_0x14d32d(0x19e)]===0x0)_0x919443[_0x14d32d(0x202)](_0x14f54a[_0x14d32d(0x1f9)](_0x14d32d(0x1c1)));else{const _0x459fc0=[..._0x4de4ce][_0x14d32d(0x21d)]((_0x3300b9,_0x804f0b)=>_0x3300b9['attributes'][_0x14d32d(0x245)][_0x14d32d(0x1cc)](_0x804f0b[_0x14d32d(0x214)][_0x14d32d(0x245)]));for(const _0x3091ab of _0x459fc0){const _0x1b8bfb=getLLMProjectUrl(_0x323395,_0x3091ab['id']),_0x13b0bb=hyperlink(_0x3091ab[_0x14d32d(0x214)]['name'],_0x1b8bfb);_0x919443[_0x14d32d(0x202)]('⚒️\x20'+_0x13b0bb);}_0x919443[_0x14d32d(0x202)](_0x14f54a[_0x14d32d(0x1f9)](_0x4de4ce[_0x14d32d(0x19e)]+_0x14d32d(0x235)));}await writeOutput(_0x919443['join']('\x0a'),_0x3c1c70['output'],_0x14d32d(0x263));}return 0x0;}catch(_0x1f604b){return handleSDKError(_0x1f604b,_0x3c1c70),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a29_0x23278c(0x245)]=a29_0x23278c(0x253);[a29_0x23278c(0x221)]='List\x20agents\x20in\x20current\x20project';async[a29_0x23278c(0x276)](_0x3923e2){const _0x1585e3=a29_0x23278c,{options:_0xdf11f9,args:_0x209412,tdx:_0xa4b5fe}=_0x3923e2,_0x4e90fa=getChalk(_0xdf11f9),_0x2c7fe7=_0xdf11f9[_0x1585e3(0x257)];try{const _0x54585e=_0x209412[0x0];let _0x4aaede=_0x54585e,_0x35f3d3,_0x45012c;if(_0x54585e&&_0x54585e['includes']('/')){const _0x1e0d2e=_0x54585e['split']('/');if(_0x1e0d2e[_0x1585e3(0x19e)]===0x2){const [_0x1ac356,_0x4a38c6]=_0x1e0d2e,_0x3d5323=await _0xa4b5fe['llm'][_0x1585e3(0x1b4)](),_0x5b792e=_0x3d5323['find'](_0x56e1fe=>_0x56e1fe['attributes'][_0x1585e3(0x245)][_0x1585e3(0x1bd)]()===_0x1ac356[_0x1585e3(0x1bd)]());if(!_0x5b792e)throw new SDKError(ErrorCode[_0x1585e3(0x226)],_0x1585e3(0x1dd)+_0x1ac356,undefined,{'helpText':_0x1585e3(0x1b3)});_0x35f3d3=_0x5b792e['id'],_0x45012c=_0x5b792e[_0x1585e3(0x214)][_0x1585e3(0x245)],_0x4aaede=_0x4a38c6;}else throw new SDKError(ErrorCode[_0x1585e3(0x1fc)],_0x1585e3(0x19d)+_0x54585e,undefined,{'helpText':_0x1585e3(0x26c)});}else{const _0x495172=await getProjectWithName(_0x3923e2);_0x35f3d3=_0x495172['id'],_0x45012c=_0x495172['name'];}const _0x5145e4=await withSpinner(_0x1585e3(0x1ed),()=>_0xa4b5fe['llm']['agents'](_0x35f3d3),{'verbose':_0xdf11f9[_0x1585e3(0x23a)]});let _0x541b33=_0x5145e4[_0x1585e3(0x22d)];_0x4aaede&&(_0x541b33=_0x5145e4[_0x1585e3(0x22d)][_0x1585e3(0x1bb)](_0x4cf1ad=>matchGlobPattern(_0x4cf1ad[_0x1585e3(0x214)][_0x1585e3(0x245)],_0x4aaede)));const _0x2eea45=_0xdf11f9['format']===_0x1585e3(0x1e1)||_0xdf11f9['format']===_0x1585e3(0x23f)||_0xdf11f9[_0x1585e3(0x27f)]==='table'||_0xdf11f9[_0x1585e3(0x27f)]===_0x1585e3(0x1a2);if(_0x2eea45){const _0x33fb6d=_0x541b33[_0x1585e3(0x1d6)](_0x5a6b39=>({...toAgentInfo(_0x5a6b39),'chatUrl':getLLMAgentChatUrl(_0x2c7fe7,_0x35f3d3,_0x5a6b39['id'])}));await handleSDKOutput(_0x33fb6d,_0xdf11f9);}else{const _0x63d83e=[];_0x63d83e['push'](_0x4e90fa[_0x1585e3(0x1f9)]('['+_0x45012c+']'));if(_0x541b33[_0x1585e3(0x19e)]===0x0)_0x63d83e[_0x1585e3(0x202)](_0x4e90fa[_0x1585e3(0x1f9)](_0x1585e3(0x27d)));else{const _0x59f47a=[..._0x541b33][_0x1585e3(0x21d)]((_0x4ce197,_0x330ae0)=>_0x4ce197[_0x1585e3(0x214)][_0x1585e3(0x245)][_0x1585e3(0x1cc)](_0x330ae0[_0x1585e3(0x214)]['name']));for(const _0x28b0a8 of _0x59f47a){const _0x40fff0=getLLMAgentChatUrl(_0x2c7fe7,_0x35f3d3,_0x28b0a8['id']),_0x558da9=hyperlink(_0x28b0a8['attributes'][_0x1585e3(0x245)],_0x40fff0);_0x63d83e[_0x1585e3(0x202)](_0x1585e3(0x217)+_0x558da9);}_0x63d83e[_0x1585e3(0x202)](_0x4e90fa[_0x1585e3(0x1f9)](_0x541b33['length']+_0x1585e3(0x1b6)));}await writeOutput(_0x63d83e[_0x1585e3(0x1ea)]('\x0a'),_0xdf11f9[_0x1585e3(0x19b)],'table');}return 0x0;}catch(_0x9b1cec){return handleSDKError(_0x9b1cec,_0xdf11f9),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a29_0x23278c(0x245)]=a29_0x23278c(0x261);[a29_0x23278c(0x221)]=a29_0x23278c(0x227);async[a29_0x23278c(0x276)](_0x22b98e){const _0x344655=a29_0x23278c,{options:_0x4b8bf4,args:_0xfdc7b9,tdx:_0x453ce4}=_0x22b98e;if(_0xfdc7b9[_0x344655(0x19e)]===0x0)return console['error']('Error:\x20Agent\x20name\x20is\x20required'),console['error'](_0x344655(0x201)),0x1;const _0x2058ce=_0xfdc7b9[0x0];try{const _0x44a7a1=await getProjectIdOrDefault(_0x22b98e),_0x13c207=await withSpinner(_0x344655(0x237)+_0x2058ce+'\x27...',()=>_0x453ce4[_0x344655(0x1f0)][_0x344655(0x24b)](_0x2058ce,_0x44a7a1),{'verbose':_0x4b8bf4[_0x344655(0x23a)]}),_0x3945ef=await withSpinner(_0x344655(0x264),()=>_0x453ce4[_0x344655(0x1f0)]['agent'](_0x13c207[_0x344655(0x22d)]),{'verbose':_0x4b8bf4['verbose']});return await handleSDKOutput([_0x3945ef['data']],_0x4b8bf4),0x0;}catch(_0x5cd744){return handleSDKError(_0x5cd744,_0x4b8bf4),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{['name']='llm:agent:create';[a29_0x23278c(0x221)]='Create\x20a\x20new\x20agent\x20in\x20current\x20project';async[a29_0x23278c(0x276)](_0x59c304){const _0x5601b7=a29_0x23278c,{options:_0x2566a4,args:_0x7c3bc6,tdx:_0x296e26}=_0x59c304;if(_0x7c3bc6[_0x5601b7(0x19e)]===0x0)return console['error'](_0x5601b7(0x249)),console[_0x5601b7(0x280)](_0x5601b7(0x24e)),console[_0x5601b7(0x280)](_0x5601b7(0x205)),0x1;const _0x32422b=_0x7c3bc6[0x0],_0x3e42bf=_0x2566a4,_0x5d013=_0x3e42bf[_0x5601b7(0x206)],_0x7b78f4=_0x3e42bf[_0x5601b7(0x1be)]||_0x5601b7(0x1cf),_0x37a576=_0x3e42bf[_0x5601b7(0x234)],_0x1ecd7f=_0x3e42bf[_0x5601b7(0x1d5)]?Number(_0x3e42bf[_0x5601b7(0x1d5)]):undefined,_0x41fbb4=_0x3e42bf[_0x5601b7(0x26f)]?Number(_0x3e42bf[_0x5601b7(0x26f)]):undefined;try{let _0x77258,_0x3ed881;if(_0x32422b[_0x5601b7(0x1df)]('/')){const _0x41dfcf=_0x32422b[_0x5601b7(0x21f)]('/');if(_0x41dfcf[_0x5601b7(0x19e)]===0x2){const [_0x15ae96,_0x14babc]=_0x41dfcf,_0x3dbce1=await withSpinner(_0x5601b7(0x21a)+_0x15ae96+_0x5601b7(0x25b),()=>_0x296e26['llm'][_0x5601b7(0x20b)](_0x15ae96),{'verbose':_0x2566a4[_0x5601b7(0x23a)]});_0x77258=_0x3dbce1[_0x5601b7(0x22d)],_0x3ed881=_0x14babc;}else throw new SDKError(ErrorCode[_0x5601b7(0x1fc)],_0x5601b7(0x19d)+_0x32422b,undefined,{'helpText':_0x5601b7(0x26c)});}else _0x77258=await getProjectIdOrDefault(_0x59c304),_0x3ed881=_0x32422b;const _0x4ac49d=await withSpinner(_0x5601b7(0x1af)+_0x3ed881+_0x5601b7(0x25b),()=>_0x296e26[_0x5601b7(0x1f0)][_0x5601b7(0x1d0)]({'name':_0x3ed881,'projectId':_0x77258,'modelType':_0x7b78f4,'systemPrompt':_0x5d013,'starterMessage':_0x37a576,'maxToolIterations':_0x1ecd7f,'temperature':_0x41fbb4}),{'verbose':_0x2566a4[_0x5601b7(0x23a)]});return console[_0x5601b7(0x1e4)](_0x5601b7(0x277)+_0x4ac49d[_0x5601b7(0x22d)]['id']),await handleSDKOutput([_0x4ac49d[_0x5601b7(0x22d)]],_0x2566a4),0x0;}catch(_0x4cd133){return handleSDKError(_0x4cd133,_0x2566a4),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a29_0x23278c(0x245)]=a29_0x23278c(0x1b9);[a29_0x23278c(0x221)]='Update\x20an\x20existing\x20agent';async[a29_0x23278c(0x276)](_0x11ff33){const _0x5d3f1c=a29_0x23278c,{options:_0x2468c8,args:_0x3542dd,tdx:_0x28f27a}=_0x11ff33;if(_0x3542dd[_0x5d3f1c(0x19e)]===0x0)return console[_0x5d3f1c(0x280)](_0x5d3f1c(0x249)),console[_0x5d3f1c(0x280)](_0x5d3f1c(0x25f)),0x1;const _0x15a4d4=_0x3542dd[0x0],_0x2438b0=_0x2468c8,_0x282e39=_0x2438b0[_0x5d3f1c(0x245)],_0x4afde8=_0x2438b0[_0x5d3f1c(0x248)],_0x5b01f6=_0x2438b0[_0x5d3f1c(0x221)],_0x55e636=_0x2438b0[_0x5d3f1c(0x234)];if(!_0x282e39&&!_0x4afde8&&!_0x5b01f6&&!_0x55e636)return console['error']('Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required'),console['error'](_0x5d3f1c(0x1fd)),0x1;try{const _0x4e9115=await getProjectIdOrDefault(_0x11ff33),_0x4ea5bb=await withSpinner('Resolving\x20agent\x20\x27'+_0x15a4d4+_0x5d3f1c(0x25b),()=>_0x28f27a[_0x5d3f1c(0x1f0)][_0x5d3f1c(0x24b)](_0x15a4d4,_0x4e9115),{'verbose':_0x2468c8[_0x5d3f1c(0x23a)]}),_0x678600=_0x4ea5bb[_0x5d3f1c(0x22d)],_0x3af7b9=await withSpinner(_0x5d3f1c(0x1b2),()=>_0x28f27a['llm'][_0x5d3f1c(0x262)](_0x678600,{'name':_0x282e39,'prompt':_0x4afde8,'description':_0x5b01f6,'starterMessage':_0x55e636}),{'verbose':_0x2468c8[_0x5d3f1c(0x23a)]});return console[_0x5d3f1c(0x1e4)](_0x5d3f1c(0x1e5)+_0x3af7b9[_0x5d3f1c(0x22d)]['id']),await handleSDKOutput([_0x3af7b9[_0x5d3f1c(0x22d)]],_0x2468c8),0x0;}catch(_0x4e58e7){return handleSDKError(_0x4e58e7,_0x2468c8),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a29_0x23278c(0x245)]=a29_0x23278c(0x258);['description']=a29_0x23278c(0x1aa);async[a29_0x23278c(0x276)](_0x598404){const _0x4c5e5f=a29_0x23278c,{options:_0x58b746,args:_0x338c79,tdx:_0x4812dd}=_0x598404;if(_0x338c79[_0x4c5e5f(0x19e)]===0x0)return console[_0x4c5e5f(0x280)](_0x4c5e5f(0x249)),console[_0x4c5e5f(0x280)](_0x4c5e5f(0x241)),0x1;const _0x67d5d8=_0x338c79[0x0];try{const _0x3534ff=await getProjectIdOrDefault(_0x598404),_0x6632b1=await withSpinner(_0x4c5e5f(0x237)+_0x67d5d8+_0x4c5e5f(0x25b),()=>_0x4812dd[_0x4c5e5f(0x1f0)][_0x4c5e5f(0x24b)](_0x67d5d8,_0x3534ff),{'verbose':_0x58b746[_0x4c5e5f(0x23a)]}),_0x6a6973=_0x6632b1['data'];return await withSpinner(_0x4c5e5f(0x207),()=>_0x4812dd['llm'][_0x4c5e5f(0x200)](_0x6a6973),{'verbose':_0x58b746[_0x4c5e5f(0x23a)]}),console['log'](_0x4c5e5f(0x224)+_0x6a6973),0x0;}catch(_0x12fb90){return handleSDKError(_0x12fb90,_0x58b746),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a29_0x23278c(0x245)]=a29_0x23278c(0x1b8);[a29_0x23278c(0x221)]='Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions';async[a29_0x23278c(0x276)](_0x308a21){const _0x30ad83=a29_0x23278c;return executeChatHistoryCommand(_0x308a21,_0x30ad83(0x24f));}}export class LLMUseCommand extends BaseCommand{['name']='llm:use';[a29_0x23278c(0x221)]=a29_0x23278c(0x27c);async[a29_0x23278c(0x276)](_0x2bbd15){const _0x5b2d08=a29_0x23278c,{options:_0x509b44,args:_0x1cb266,tdx:_0x5e42b5}=_0x2bbd15;if(_0x1cb266[_0x5b2d08(0x19e)]===0x0)return console[_0x5b2d08(0x280)](_0x5b2d08(0x278)),console[_0x5b2d08(0x280)](_0x5b2d08(0x1e7)),0x1;const _0x4c2833=_0x1cb266[0x0];try{await withSpinner('Setting\x20project\x20context\x20to\x20\x27'+_0x4c2833+_0x5b2d08(0x25b),()=>_0x5e42b5[_0x5b2d08(0x1f0)][_0x5b2d08(0x1ca)](_0x4c2833),{'verbose':_0x509b44[_0x5b2d08(0x23a)]}),saveSessionContext({'llm_project':_0x4c2833},_0x509b44['session']);const _0x8161f=getChalk(_0x509b44);return console[_0x5b2d08(0x1e4)]('Session\x20llm_project\x20set\x20to:\x20'+_0x8161f[_0x5b2d08(0x1c6)](_0x4c2833)),0x0;}catch(_0x509b82){return handleSDKError(_0x509b82,_0x509b44),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a29_0x23278c(0x245)]=a29_0x23278c(0x22c);[a29_0x23278c(0x221)]=a29_0x23278c(0x1ce);async[a29_0x23278c(0x276)](_0x5e2066){const _0x5e626d=a29_0x23278c,{options:_0x438628,args:_0x17b6d3,tdx:_0x57d2ea}=_0x5e2066;if(_0x17b6d3[_0x5e626d(0x19e)]===0x0)return console[_0x5e626d(0x280)](_0x5e626d(0x278)),console[_0x5e626d(0x280)]('Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]'),0x1;const _0x43b4e1=_0x17b6d3[0x0],_0x4c2a85=_0x438628,_0x15e1e3=_0x4c2a85[_0x5e626d(0x221)];try{const _0x2eab97=await withSpinner(_0x5e626d(0x1a8)+_0x43b4e1+_0x5e626d(0x25b),()=>_0x57d2ea[_0x5e626d(0x1f0)][_0x5e626d(0x259)]({'name':_0x43b4e1,'description':_0x15e1e3}),{'verbose':_0x438628[_0x5e626d(0x23a)]});console[_0x5e626d(0x1e4)]('Project\x20created:\x20'+_0x2eab97['data']['id']);const _0x33334=toLLMProjectInfo(_0x2eab97[_0x5e626d(0x22d)]);return await handleSDKOutput([_0x33334],_0x438628),0x0;}catch(_0x5bf5cb){return handleSDKError(_0x5bf5cb,_0x438628),0x1;}}}function a29_0x27a2(_0x58f5f7,_0x38c7b3){_0x58f5f7=_0x58f5f7-0x19b;const _0x1d69c8=a29_0x1d69();let _0x27a2f8=_0x1d69c8[_0x58f5f7];return _0x27a2f8;}export class LLMProjectDeleteCommand extends BaseCommand{[a29_0x23278c(0x245)]='llm:project:delete';['description']=a29_0x23278c(0x274);async[a29_0x23278c(0x276)](_0x385edb){const _0x55058c=a29_0x23278c,{options:_0x4c1317,args:_0x55c123,tdx:_0x15618b}=_0x385edb;if(_0x55c123[_0x55058c(0x19e)]===0x0)return console[_0x55058c(0x280)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x55058c(0x280)](_0x55058c(0x1a3)),0x1;const _0x5e2d67=_0x55c123[0x0];try{return await withSpinner(_0x55058c(0x1c9)+_0x5e2d67+_0x55058c(0x25b),()=>_0x15618b[_0x55058c(0x1f0)][_0x55058c(0x268)](_0x5e2d67),{'verbose':_0x4c1317[_0x55058c(0x23a)]}),console[_0x55058c(0x1e4)](_0x55058c(0x21e)+_0x5e2d67),0x0;}catch(_0x32c5d0){return handleSDKError(_0x32c5d0,_0x4c1317),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{['name']=a29_0x23278c(0x231);['description']=a29_0x23278c(0x283);async[a29_0x23278c(0x276)](_0x360a74){const _0x2803b5=a29_0x23278c,{options:_0x44c4e2,args:_0x2e0714,tdx:_0x336136}=_0x360a74,_0x33ebab=getChalk(_0x44c4e2);console[_0x2803b5(0x1e4)](_0x33ebab[_0x2803b5(0x252)](_0x2803b5(0x1a4))),console[_0x2803b5(0x1e4)](_0x33ebab['yellow'](_0x2803b5(0x1c3))),console[_0x2803b5(0x1e4)](_0x33ebab[_0x2803b5(0x1f9)](_0x2803b5(0x203))),console['log']();if(_0x2e0714[_0x2803b5(0x19e)]===0x0)return console[_0x2803b5(0x280)](_0x2803b5(0x278)),console[_0x2803b5(0x280)](_0x2803b5(0x1f4)),0x1;const _0x2d8fc0=_0x2e0714[0x0],_0x124165=_0x44c4e2,_0x468cce=_0x124165[_0x2803b5(0x19b)],_0x2d15e8=_0x124165[_0x2803b5(0x246)];try{const _0x414d93=_0x468cce||_0x2d8fc0+_0x2803b5(0x233);if(a29_0x1f9959[_0x2803b5(0x20e)](_0x414d93)&&!_0x2d15e8){if(!_0x44c4e2['yes']){const _0x3a2783=await confirm(_0x2803b5(0x21b)+_0x414d93+'\x27\x20already\x20exists.\x20Overwrite?');if(!_0x3a2783)return console[_0x2803b5(0x1e4)](_0x2803b5(0x229)),0x0;}a29_0x1f9959[_0x2803b5(0x275)](_0x414d93,{'recursive':!![]});}const _0x2cf47f=await withSpinner(_0x2d15e8?_0x2803b5(0x1bf)+_0x2d8fc0+_0x2803b5(0x25b):_0x2803b5(0x1ac)+_0x2d8fc0+_0x2803b5(0x25b),()=>_0x336136['llm'][_0x2803b5(0x282)](_0x2d8fc0,_0x468cce,{'dryRun':_0x2d15e8}),{'verbose':_0x44c4e2[_0x2803b5(0x23a)]}),_0x53e77e=_0x2cf47f[_0x2803b5(0x22d)];return _0x2d15e8?console['log'](_0x2803b5(0x247)+_0x53e77e['outputDir']):console[_0x2803b5(0x1e4)](_0x2803b5(0x242)+_0x53e77e[_0x2803b5(0x1b7)]),console[_0x2803b5(0x1e4)](_0x2803b5(0x223)+_0x53e77e[_0x2803b5(0x255)][_0x2803b5(0x210)]),console[_0x2803b5(0x1e4)](_0x2803b5(0x1db)+_0x53e77e[_0x2803b5(0x255)][_0x2803b5(0x1b1)]),console['log'](_0x2803b5(0x265)+_0x53e77e[_0x2803b5(0x255)][_0x2803b5(0x218)]),console['log'](_0x2803b5(0x1a9)+_0x53e77e[_0x2803b5(0x255)][_0x2803b5(0x230)]),(_0x44c4e2['format']===_0x2803b5(0x1e1)||_0x44c4e2[_0x2803b5(0x27f)]==='jsonl')&&await handleSDKOutput([_0x53e77e],_0x44c4e2),0x0;}catch(_0x3d91ff){return handleSDKError(_0x3d91ff,_0x44c4e2),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{['name']='llm:project:restore';[a29_0x23278c(0x221)]='Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)';async['execute'](_0x4d8fae){const _0x1f9e76=a29_0x23278c,{options:_0x27a064,args:_0x16f942,tdx:_0x20ff90}=_0x4d8fae,_0xfd4f87=getChalk(_0x27a064);console[_0x1f9e76(0x1e4)](_0xfd4f87[_0x1f9e76(0x252)](_0x1f9e76(0x281))),console['log'](_0xfd4f87[_0x1f9e76(0x252)]('\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.')),console[_0x1f9e76(0x1e4)](_0xfd4f87[_0x1f9e76(0x1f9)](_0x1f9e76(0x24d))),console[_0x1f9e76(0x1e4)](_0xfd4f87[_0x1f9e76(0x1f9)](_0x1f9e76(0x1ab))),console[_0x1f9e76(0x1e4)](_0xfd4f87['dim'](_0x1f9e76(0x26d))),console[_0x1f9e76(0x1e4)]();if(_0x16f942[_0x1f9e76(0x19e)]===0x0)return console[_0x1f9e76(0x280)]('Error:\x20Backup\x20folder\x20path\x20is\x20required'),console[_0x1f9e76(0x280)](_0x1f9e76(0x26e)),0x1;const _0x9be62c=_0x16f942[0x0],_0x36c19c=_0x27a064,_0x496062=_0x36c19c['name'],_0x500c10=_0x36c19c['dryRun'];try{if(!_0x500c10){const _0x4f65b0=_0x20ff90[_0x1f9e76(0x1f0)][_0x1f9e76(0x1e2)](_0x9be62c),_0x13f44b=_0x496062||_0x4f65b0[_0x1f9e76(0x215)][_0x1f9e76(0x228)],_0x4f368e=await withSpinner(_0x1f9e76(0x256),()=>_0x20ff90['llm'][_0x1f9e76(0x1b4)](),{'verbose':_0x27a064['verbose']}),_0x595611=_0x4f368e[_0x1f9e76(0x22d)][_0x1f9e76(0x25d)](_0x4a675d=>_0x4a675d[_0x1f9e76(0x214)]['name']===_0x13f44b);if(_0x595611&&!_0x27a064[_0x1f9e76(0x25c)]){const _0x2d1cfe=await confirm(_0x1f9e76(0x1e9)+_0x13f44b+_0x1f9e76(0x1d2));if(!_0x2d1cfe)return console['log'](_0x1f9e76(0x209)),0x0;}}const _0x5e4119=await withSpinner(_0x500c10?_0x1f9e76(0x213)+_0x9be62c+_0x1f9e76(0x25b):_0x1f9e76(0x1b5)+_0x9be62c+'\x27...',()=>_0x20ff90[_0x1f9e76(0x1f0)]['restoreProject'](_0x9be62c,{'name':_0x496062,'dryRun':_0x500c10}),{'verbose':_0x27a064[_0x1f9e76(0x23a)]}),_0x5f0dd2=_0x5e4119['data'];return _0x5f0dd2[_0x1f9e76(0x286)]&&console[_0x1f9e76(0x1e4)](_0x1f9e76(0x1d8)+_0x5f0dd2[_0x1f9e76(0x286)]+'\x27'),_0x500c10?console[_0x1f9e76(0x1e4)]('[DRY\x20RUN]\x20Would\x20restore\x20project:\x20'+_0x5f0dd2[_0x1f9e76(0x228)]):console[_0x1f9e76(0x1e4)](_0x1f9e76(0x208)+_0x5f0dd2[_0x1f9e76(0x228)]+'\x20('+_0x5f0dd2[_0x1f9e76(0x24a)]+')'),console[_0x1f9e76(0x1e4)]('\x20\x20Agents:\x20'+_0x5f0dd2['counts'][_0x1f9e76(0x210)]),console[_0x1f9e76(0x1e4)](_0x1f9e76(0x1db)+_0x5f0dd2[_0x1f9e76(0x255)]['knowledgeBases']),console['log'](_0x1f9e76(0x265)+_0x5f0dd2[_0x1f9e76(0x255)][_0x1f9e76(0x218)]),console[_0x1f9e76(0x1e4)](_0x1f9e76(0x1a9)+_0x5f0dd2[_0x1f9e76(0x255)][_0x1f9e76(0x230)]),(_0x27a064[_0x1f9e76(0x27f)]==='json'||_0x27a064[_0x1f9e76(0x27f)]===_0x1f9e76(0x23f))&&await handleSDKOutput([_0x5f0dd2],_0x27a064),0x0;}catch(_0x148aec){return handleSDKError(_0x148aec,_0x27a064),0x1;}}}function a29_0x1d69(){const _0x37481c=['createAgent','283013cnldLC','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','tdx\x20chats','message','maxToolIterations','map','Usage:\x20','[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','No\x20messages\x20found\x20in\x20chat\x20history.','slice','\x20\x20Knowledge\x20Bases:\x20','stack','Project\x20not\x20found:\x20','\x20--last','includes','chatId','json','getBackupMetadata','history','log','Agent\x20updated:\x20','Fetching\x20chat\x20history\x20for\x20\x27','Usage:\x20tdx\x20llm\x20use\x20<project-name>','[input]\x20\x20','A\x20project\x20named\x20\x27','join','floor','m\x20ago','Fetching\x20agents...','\x0aCancelled','red','llm','set','[error]\x20\x20','36198xJwTgQ','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','Select\x20a\x20chat\x20session:','en-US','just\x20now','\x20-\x20','dim','targetImageGenerator','targetKnowledgeBase','INVALID_ARGUMENT','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','h\x20ago','36668lhVwnU','deleteAgent','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','push','\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents','\x20->\x20Agent:','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','systemPrompt','Deleting\x20agent...','Project\x20restored:\x20','Restore\x20cancelled.','\x20→\x20chat:\x20','resolveProjectId','getOrCreateDefaultProject','4TRXcHS','existsSync','...','agents','[content]','Fetching\x20chat\x20sessions...','Validating\x20backup\x20from\x20\x27','attributes','exportedFrom','lastConversationAt','🤖\x20','prompts','tool','Resolving\x20project\x20\x27','Output\x20directory\x20\x27','agent','sort','Project\x20deleted:\x20','split','blue','description','3730oqdKhn','\x20\x20Agents:\x20','Agent\x20deleted:\x20','(no\x20message)','LLM_PROJECT_NOT_FOUND','Show\x20agent\x20details','projectName','Backup\x20cancelled.','\x20bytes)','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','llm:project:create','data','llmProject','[tool_call]','integrations','llm:project:backup','input','.llm','starterMessage','\x20project(s)','createdAt','Resolving\x20agent\x20\x27','content','[output]\x20','verbose','magenta','toLocaleDateString','(no\x20agent)','[tool]\x20\x20\x20','jsonl','select','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','Project\x20backed\x20up\x20to:\x20','Getting\x20default\x20project...','__load_more__','name','dryRun','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','prompt','Error:\x20Agent\x20name\x20is\x20required','projectId','resolveAgentId','Load\x20more...','\x20\x20\x20Examples:','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','tdx\x20llm\x20history','limit','updatedAt','yellow','llm:agents','Error:\x20','counts','Checking\x20for\x20existing\x20projects...','site','llm:agent:delete','createProject','7101619DcwEki','\x27...','yes','find','llm:projects','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','default','llm:agent:show','updateAgent','table','Fetching\x20agent...','\x20\x20Prompts:\x20','cyan','tool_call','deleteProject','Fetching\x20projects...','List\x20available\x20LLM\x20models','image','Use\x20format:\x20project-name/agent-name','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','temperature','List\x20all\x20LLM\x20projects','Error:\x20chat-id\x20is\x20required','\x20->\x20ImageGen:','targetAgent','Delete\x20an\x20LLM\x20project','rmSync','execute','Agent\x20created:\x20','Error:\x20Project\x20name\x20is\x20required','\x0aStack\x20trace:','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','substring','Set\x20current\x20project\x20context','No\x20agents\x20found','Fetching\x20chat\x20log\x20for\x20\x27','format','error','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.','backupProject','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)','last','\x20->\x20KB:','sourceSite','output','getCurrentProject','Invalid\x20path\x20syntax:\x20','length','5572248oRZQAa','getTime','Fetching\x20most\x20recent\x20chat...','tsv','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','chats','agentId','stringify','Creating\x20project\x20\x27','\x20\x20Integrations:\x20','Delete\x20an\x20agent','\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/','Backing\x20up\x20project\x20\x27','entries','get','Creating\x20agent\x20\x27','\x20->\x20WebSearch:','knowledgeBases','Updating\x20agent...','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','projects','Restoring\x20project\x20from\x20\x27','\x20agent(s)','outputDir','llm:history','llm:agent:update','No\x20chat\x20sessions\x20found.','filter','bold','toLowerCase','model','Analyzing\x20project\x20\x27','targetWebSearchTool','No\x20projects\x20found','models','\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.','3691218UQThfZ','all','green','Fetching\x20available\x20models...','321951TqQcrK','Deleting\x20project\x20\x27','setCurrentProject','keys','localeCompare','620inpkZr','Create\x20a\x20new\x20LLM\x20project','claude-4.5-haiku'];a29_0x1d69=function(){return _0x37481c;};return a29_0x1d69();}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x1750e6,_0x11031a){const _0x20650a=a29_0x23278c,_0x59c14a=_0x11031a[_0x20650a(0x250)]||CHAT_SELECTOR_PAGE_SIZE;let _0x27a664=0x0,_0x3ff78c=[];const _0x36bdcb=(await import(_0x20650a(0x218)))[_0x20650a(0x260)],_0x4375ad=getChalk(_0x11031a);while(!![]){const _0x5eef0d=await withSpinner(_0x20650a(0x212),()=>_0x1750e6['llm']['chats'](_0x59c14a+_0x27a664),{'verbose':_0x11031a[_0x20650a(0x23a)]});_0x3ff78c=_0x5eef0d[_0x20650a(0x22d)];const _0x277a34=_0x3ff78c[_0x20650a(0x1da)](_0x27a664,_0x27a664+_0x59c14a),_0x40fced=_0x3ff78c['length']>_0x27a664+_0x59c14a,_0x290e18=[...new Set(_0x277a34['map'](_0x49d3c8=>_0x49d3c8['attributes'][_0x20650a(0x1a6)])['filter'](_0x1a3e08=>_0x1a3e08!==undefined))],_0x56d1df=new Map();await Promise[_0x20650a(0x1c5)](_0x290e18[_0x20650a(0x1d6)](async _0x16bc20=>{const _0xc3e14c=_0x20650a;try{const _0x59a009=await _0x1750e6['llm'][_0xc3e14c(0x21c)](_0x16bc20);_0x56d1df[_0xc3e14c(0x1f1)](_0x16bc20,_0x59a009[_0xc3e14c(0x214)][_0xc3e14c(0x245)]);}catch{_0x56d1df[_0xc3e14c(0x1f1)](_0x16bc20,_0x16bc20);}}));const _0x1426bd=_0x277a34['map'](_0x22a091=>{const _0xb3db71=_0x20650a,_0x555f4c=_0x22a091['attributes']['firstInputContent']||_0xb3db71(0x225),_0x4b89ca=_0x555f4c[_0xb3db71(0x21f)]('\x0a')[0x0],_0x4cea51=_0x4b89ca[_0xb3db71(0x19e)]>0x50?_0x4b89ca[_0xb3db71(0x27b)](0x0,0x4d)+_0xb3db71(0x20f):_0x4b89ca,_0x57dedf=_0x22a091[_0xb3db71(0x214)][_0xb3db71(0x1a6)]?_0x56d1df[_0xb3db71(0x1ae)](_0x22a091[_0xb3db71(0x214)][_0xb3db71(0x1a6)])||_0x22a091[_0xb3db71(0x214)][_0xb3db71(0x1a6)]:_0xb3db71(0x23d),_0xd1a740=_0x22a091['attributes'][_0xb3db71(0x216)]||_0x22a091[_0xb3db71(0x214)][_0xb3db71(0x251)],_0x49c84c=new Date(_0xd1a740),_0x50bbf8=new Date(),_0x3b6b0f=_0x50bbf8[_0xb3db71(0x1a0)]()-_0x49c84c[_0xb3db71(0x1a0)](),_0x3fbd98=Math[_0xb3db71(0x1eb)](_0x3b6b0f/0xea60),_0x243b00=Math[_0xb3db71(0x1eb)](_0x3b6b0f/0x36ee80),_0x335cb5=Math[_0xb3db71(0x1eb)](_0x3b6b0f/0x5265c00);let _0x3053e2;if(_0x3fbd98<0x1)_0x3053e2=_0xb3db71(0x1f7);else{if(_0x3fbd98<0x3c)_0x3053e2=_0x3fbd98+_0xb3db71(0x1ec);else{if(_0x243b00<0x18)_0x3053e2=_0x243b00+_0xb3db71(0x1fe);else _0x335cb5<0x7?_0x3053e2=_0x335cb5+'d\x20ago':_0x3053e2=_0x49c84c[_0xb3db71(0x23c)](_0xb3db71(0x1f6),{'month':'short','day':'numeric'});}}return{'title':_0x4cea51+'\x20'+_0x4375ad[_0xb3db71(0x1f9)]('['+_0x57dedf+']\x20'+_0x3053e2),'value':_0x22a091['id']};});_0x40fced&&_0x1426bd[_0x20650a(0x202)]({'title':_0x4375ad[_0x20650a(0x266)](_0x20650a(0x24c)),'value':_0x20650a(0x244)});const _0x1bdadc=await _0x36bdcb({'type':_0x20650a(0x240),'name':_0x20650a(0x1e0),'message':_0x20650a(0x1f5),'choices':_0x1426bd,'hint':_0x20650a(0x27a)});if(!_0x1bdadc['chatId'])return undefined;if(_0x1bdadc[_0x20650a(0x1e0)]===_0x20650a(0x244)){_0x27a664+=_0x59c14a;continue;}return _0x1bdadc[_0x20650a(0x1e0)];}}export class ChatsCommand extends BaseCommand{['name']=a29_0x23278c(0x1a5);[a29_0x23278c(0x221)]='Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history';async[a29_0x23278c(0x276)](_0x421257){const _0x12c8ba=a29_0x23278c;return executeChatHistoryCommand(_0x421257,_0x12c8ba(0x1d3));}}export class LLMLogCommand extends BaseCommand{['name']='llm:log';[a29_0x23278c(0x221)]='Show\x20chat\x20log';async[a29_0x23278c(0x276)](_0x50cf09){const _0x247e8d=a29_0x23278c,{options:_0x12584e,args:_0x14be3e,tdx:_0x2f510c}=_0x50cf09,_0x4f7eee=_0x14be3e[0x0];if(!_0x4f7eee)return console[_0x247e8d(0x280)](_0x247e8d(0x271)),console[_0x247e8d(0x280)]('Usage:\x20TDX_EXPERIMENTAL=true\x20tdx\x20llm\x20log\x20<chat-id>'),0x1;const _0x28c40b=await withSpinner(_0x247e8d(0x27e)+_0x4f7eee+_0x247e8d(0x25b),()=>_0x2f510c[_0x247e8d(0x1f0)]['getChatLog'](_0x4f7eee),{'verbose':_0x12584e['verbose']});return await handleSDKOutput(_0x28c40b[_0x247e8d(0x22d)][_0x247e8d(0x22d)],_0x12584e),0x0;}}
|
|
1
|
+
const a29_0x1ee233=a29_0x1483;(function(_0x4fd71f,_0x1a8994){const _0x5a062b=a29_0x1483,_0x451b05=_0x4fd71f();while(!![]){try{const _0x1e0406=parseInt(_0x5a062b(0xdb))/0x1*(parseInt(_0x5a062b(0x147))/0x2)+-parseInt(_0x5a062b(0x121))/0x3+parseInt(_0x5a062b(0x12a))/0x4*(-parseInt(_0x5a062b(0x11e))/0x5)+parseInt(_0x5a062b(0x124))/0x6+-parseInt(_0x5a062b(0x162))/0x7+-parseInt(_0x5a062b(0xbb))/0x8+-parseInt(_0x5a062b(0x9d))/0x9*(-parseInt(_0x5a062b(0xa9))/0xa);if(_0x1e0406===_0x1a8994)break;else _0x451b05['push'](_0x451b05['shift']());}catch(_0x4806b0){_0x451b05['push'](_0x451b05['shift']());}}}(a29_0x47ef,0x3be0e));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{getChalk}from'../utils/colors.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{confirm}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import*as a29_0x97a079 from'node:fs';function handleSDKError(_0x320f89,_0x4e568f){const _0x1115a4=a29_0x1483;if(_0x320f89 instanceof SDKError)console[_0x1115a4(0x167)](_0x1115a4(0xf6)+_0x320f89['message']),_0x4e568f[_0x1115a4(0xf0)]&&(_0x320f89[_0x1115a4(0xdc)]&&console[_0x1115a4(0x167)](_0x1115a4(0x9f)+_0x320f89[_0x1115a4(0xdc)]),_0x320f89[_0x1115a4(0x128)]&&(console['error'](_0x1115a4(0x117)),console[_0x1115a4(0x167)](_0x320f89['stack'])));else throw _0x320f89;}function formatChatHistoryEntry(_0x26dd3a,_0x350f47){const _0x13db15=a29_0x1483,_0x4bbf8e=getChalk(_0x350f47),_0x537c13=_0x4bbf8e[_0x13db15(0x9b)](_0x26dd3a['at']);if(_0x13db15(0xc5)in _0x26dd3a){const _0x1d6206=_0x4bbf8e['cyan'](_0x13db15(0xcc));return _0x537c13+'\x20'+_0x1d6206+':\x20'+_0x26dd3a[_0x13db15(0xc5)];}if('content'in _0x26dd3a){const _0xab3317=_0x4bbf8e[_0x13db15(0x16c)]('[content]');return _0x537c13+'\x20'+_0xab3317+':\x20'+_0x26dd3a['content'];}if(_0x13db15(0x15c)in _0x26dd3a){const _0x49cf45=_0x4bbf8e[_0x13db15(0x101)](_0x13db15(0x98)),{functionName:_0x5728e2,functionArguments:_0x50387d,targetFunction:_0x352bc8}=_0x26dd3a[_0x13db15(0x15c)];let _0x4bfd31=_0x537c13+'\x20'+_0x49cf45+':\x20'+_0x4bbf8e[_0x13db15(0xac)](_0x5728e2);if(_0x50387d&&Object[_0x13db15(0x171)](_0x50387d)['length']>0x0){const _0x4f7937=Object['entries'](_0x50387d)[_0x13db15(0x15d)](([_0xcea1cb,_0x3d0d35])=>_0xcea1cb+'='+JSON[_0x13db15(0xb8)](_0x3d0d35))['join'](',\x20');_0x4bfd31+='('+_0x4f7937+')';}_0x352bc8&&(_0x4bfd31+=_0x4bbf8e[_0x13db15(0x9b)]('\x20['+_0x352bc8+']'));let _0x5dbe93='';if(_0x26dd3a['tool_call'][_0x13db15(0x166)])_0x5dbe93=_0x13db15(0x13e)+_0x26dd3a[_0x13db15(0x15c)]['targetKnowledgeBase'][_0x13db15(0xed)];else{if(_0x26dd3a[_0x13db15(0x15c)][_0x13db15(0x14c)])_0x5dbe93=_0x13db15(0xbf)+_0x26dd3a['tool_call'][_0x13db15(0x14c)][_0x13db15(0xed)];else{if(_0x26dd3a[_0x13db15(0x15c)][_0x13db15(0x109)])_0x5dbe93=_0x13db15(0x94)+_0x26dd3a[_0x13db15(0x15c)][_0x13db15(0x109)][_0x13db15(0xed)];else _0x26dd3a['tool_call']['targetImageGenerator']&&(_0x5dbe93=_0x13db15(0x148)+_0x26dd3a[_0x13db15(0x15c)][_0x13db15(0xc9)][_0x13db15(0xed)]);}}return _0x4bfd31+_0x5dbe93;}if(_0x13db15(0x16a)in _0x26dd3a){const _0x134e49=_0x4bbf8e[_0x13db15(0x15b)]('[tool]\x20\x20\x20'),{functionName:_0x3d002a,functionArguments:_0x461d6b,content:_0x53dc51,newChat:_0x157727}=_0x26dd3a[_0x13db15(0x16a)];let _0x3aff8b=_0x537c13+'\x20'+_0x134e49+':\x20'+_0x4bbf8e[_0x13db15(0xac)](_0x3d002a);if(_0x461d6b){const _0x1c181a=typeof _0x461d6b===_0x13db15(0x102)?_0x461d6b:JSON['stringify'](_0x461d6b);_0x3aff8b+='('+_0x1c181a+')';}return _0x53dc51&&(_0x3aff8b+='\x0a'+_0x4bbf8e['dim'](_0x53dc51)),_0x157727&&(_0x3aff8b+=_0x4bbf8e[_0x13db15(0x9b)](_0x13db15(0x142)+_0x157727['id'])),_0x3aff8b;}if(_0x13db15(0x10d)in _0x26dd3a){const _0x2f186e=_0x4bbf8e['blue']('[output]\x20');return _0x537c13+'\x20'+_0x2f186e+':\x20'+_0x26dd3a['output'][_0x13db15(0xed)]+'\x20('+_0x26dd3a[_0x13db15(0x10d)][_0x13db15(0xda)]['length']+_0x13db15(0xb0);}if(_0x13db15(0x107)in _0x26dd3a){const _0x2c293d=_0x4bbf8e[_0x13db15(0x134)](_0x13db15(0x10e)),{width:_0x262cbd,height:_0x1d64f1,headerText:_0xd8a74b}=_0x26dd3a['image'],_0xb37aea=_0xd8a74b?'\x20-\x20'+_0xd8a74b:'';return _0x537c13+'\x20'+_0x2c293d+':\x20'+_0x262cbd+'x'+_0x1d64f1+_0xb37aea;}if(_0x13db15(0x167)in _0x26dd3a){const _0x3f2cd2=_0x4bbf8e[_0x13db15(0xf8)](_0x13db15(0xd4));return _0x537c13+'\x20'+_0x3f2cd2+':\x20'+_0x26dd3a[_0x13db15(0x167)];}return _0x537c13+'\x20'+_0x4bbf8e['dim'](_0x13db15(0x149))+':\x20'+JSON['stringify'](_0x26dd3a);}async function executeChatHistoryCommand(_0x1cbb33,_0x1de21f){const _0x3c4429=a29_0x1483,{options:_0x1eb9a6,args:_0x280516,tdx:_0x1be4af}=_0x1cbb33,_0x5b9058=_0x280516[0x0],_0x5a021f=_0x1eb9a6,_0x305f02=_0x5a021f[_0x3c4429(0x129)];try{if(_0x305f02&&_0x5b9058)return console[_0x3c4429(0x167)]('Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument'),console['error']('Usage:\x20'+_0x1de21f+_0x3c4429(0xcb)),0x1;if(!_0x5b9058&&!_0x305f02&&_0x1eb9a6['format']!==undefined){const _0x28e641=resolveLimit(_0x1eb9a6[_0x3c4429(0xe4)],DEFAULT_LLM_LIMIT),_0x2b75a5=await withSpinner(_0x3c4429(0x153),()=>_0x1be4af['llm'][_0x3c4429(0xe0)](_0x28e641),{'verbose':_0x1eb9a6[_0x3c4429(0xf0)]});return await handleSDKOutput(_0x2b75a5[_0x3c4429(0xb5)],_0x1eb9a6),0x0;}const _0x166bb2=await getChatIdOrSelect(_0x1be4af,_0x1eb9a6,_0x305f02,_0x5b9058);if(!_0x166bb2)return 0x0;return await displayChatHistory(_0x166bb2,_0x1be4af,_0x1eb9a6),0x0;}catch(_0x4e7721){return handleSDKError(_0x4e7721,_0x1eb9a6),0x1;}}async function displayChatHistory(_0x2c3de9,_0x5eb8c3,_0x1f7561){const _0x2b98f8=a29_0x1483,_0x5dcdf=await withSpinner(_0x2b98f8(0xab)+_0x2c3de9+'\x27...',()=>_0x5eb8c3[_0x2b98f8(0xa5)][_0x2b98f8(0xe3)](_0x2c3de9),{'verbose':_0x1f7561[_0x2b98f8(0xf0)]}),_0x4e4efa=_0x5dcdf[_0x2b98f8(0xb5)][_0x2b98f8(0xb5)]??[];if(_0x4e4efa[_0x2b98f8(0xd5)]===0x0){console[_0x2b98f8(0x155)](_0x2b98f8(0x125));return;}if(_0x1f7561[_0x2b98f8(0x13c)]!==undefined)await handleSDKOutput(_0x4e4efa,_0x1f7561);else{const _0x51bed1=_0x4e4efa[_0x2b98f8(0x15d)](_0x55e0cd=>formatChatHistoryEntry(_0x55e0cd,_0x1f7561)),_0x4dd146=_0x51bed1[_0x2b98f8(0x157)]('\x0a');await writeOutput(_0x4dd146,_0x1f7561[_0x2b98f8(0x10d)],_0x2b98f8(0x159));}}async function getChatIdOrSelect(_0x311d6b,_0x391026,_0x43b6e8,_0x1a67ba){const _0x377e5a=a29_0x1483;if(_0x1a67ba)return _0x1a67ba;if(_0x43b6e8){const _0x6638b5=await withSpinner(_0x377e5a(0x165),()=>_0x311d6b[_0x377e5a(0xa5)][_0x377e5a(0xe0)](0x1),{'verbose':_0x391026[_0x377e5a(0xf0)]});if(_0x6638b5[_0x377e5a(0xb5)][_0x377e5a(0xd5)]===0x0)return console['log'](_0x377e5a(0x120)),undefined;return _0x6638b5[_0x377e5a(0xb5)][0x0]['id'];}const _0x4ab288=await selectChatInteractively(_0x311d6b,_0x391026);if(!_0x4ab288)return console[_0x377e5a(0x155)](_0x377e5a(0x11d)),undefined;return _0x4ab288;}async function getProjectIdOrDefault(_0x2a1241){const _0x432be7=await getProjectWithName(_0x2a1241);return _0x432be7['id'];}async function getProjectWithName(_0x4dbd84){const _0x2d56d3=a29_0x1483,{tdx:_0x2dbd2c,options:_0x189def}=_0x4dbd84,_0x3a1df1=_0x189def[_0x2d56d3(0xcf)];if(_0x3a1df1){const _0x466b28=await withSpinner(_0x2d56d3(0xf3)+_0x3a1df1+'\x27...',()=>_0x2dbd2c[_0x2d56d3(0xa5)]['resolveProjectId'](_0x3a1df1),{'verbose':_0x189def[_0x2d56d3(0xf0)]});return{'id':_0x466b28['data'],'name':_0x3a1df1};}const _0x1661bc=_0x2dbd2c[_0x2d56d3(0xa5)][_0x2d56d3(0xc1)]();if(_0x1661bc){const _0x5b50c1=await _0x2dbd2c[_0x2d56d3(0xa5)][_0x2d56d3(0xc0)](),_0x236f39=_0x5b50c1['find'](_0x5a6eb8=>_0x5a6eb8['id']===_0x1661bc);return{'id':_0x1661bc,'name':_0x236f39?.[_0x2d56d3(0x138)][_0x2d56d3(0xed)]||'Unknown'};}const _0x2d0651=await withSpinner(_0x2d56d3(0x106),()=>_0x2dbd2c[_0x2d56d3(0xa5)][_0x2d56d3(0x115)](),{'verbose':_0x189def[_0x2d56d3(0xf0)]});return{'id':_0x2d0651['data']['id'],'name':_0x2d0651[_0x2d56d3(0xb5)][_0x2d56d3(0x138)][_0x2d56d3(0xed)]};}function toLLMProjectInfo(_0x12286c){const _0x1b615d=a29_0x1483;return{'name':_0x12286c[_0x1b615d(0x138)][_0x1b615d(0xed)],'description':_0x12286c[_0x1b615d(0x138)][_0x1b615d(0xad)],'createdAt':_0x12286c[_0x1b615d(0x138)][_0x1b615d(0xc8)],'updatedAt':_0x12286c[_0x1b615d(0x138)]['updatedAt']};}function toAgentInfo(_0x31ecb3){const _0x108883=a29_0x1483;return{'name':_0x31ecb3[_0x108883(0x138)]['name'],'description':_0x31ecb3[_0x108883(0x138)][_0x108883(0xad)],'prompt':truncatePrompt(_0x31ecb3['attributes']['prompt']),'createdAt':_0x31ecb3[_0x108883(0x138)][_0x108883(0xc8)],'updatedAt':_0x31ecb3['attributes'][_0x108883(0x112)]};}function a29_0x47ef(){const _0x437183=['Fetching\x20chat\x20sessions...','prompts','log','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','join','setCurrentProject','table','filter','magenta','tool_call','map','push','Project\x20backed\x20up\x20to:\x20','substring','sourceSite','33579RjaSZn','List\x20all\x20LLM\x20projects','systemPrompt','Fetching\x20most\x20recent\x20chat...','targetKnowledgeBase','error','Fetching\x20agent...','agents','tool','Backup\x20cancelled.','green','lastConversationAt','cyan','prompt','Usage:\x20TDX_EXPERIMENTAL=true\x20tdx\x20llm\x20log\x20<chat-id>','keys','Project\x20restored:\x20','getChatLog','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','llm:project:restore','llm:agent:delete','\x20\x20Prompts:\x20','\x20\x20Knowledge\x20Bases:\x20','\x20->\x20WebSearch:','Analyzing\x20project\x20\x27','deleteProject','.llm','[tool_call]','LLM_PROJECT_NOT_FOUND','toLowerCase','dim','Usage:\x20tdx\x20llm\x20use\x20<project-name>','51309jsXPXo','localeCompare','\x20\x20Cause:\x20','projectName','(no\x20agent)','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','\x20project(s)','⚒️\x20','llm','Project\x20not\x20found:\x20','__load_more__','tdx\x20chats','790chacsq','Fetching\x20chat\x20log\x20for\x20\x27','Fetching\x20chat\x20history\x20for\x20\x27','bold','description','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents','\x20bytes)','outputDir','Fetching\x20projects...','Validating\x20backup\x20from\x20\x27','Create\x20a\x20new\x20LLM\x20project','data','just\x20now','getTime','stringify','Delete\x20an\x20agent','tdx\x20llm\x20history','1403160pwEdOs','\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','\x20->\x20Agent:','projects','getCurrentProject','includes','llm:agent:create','projectId','input','getBackupMetadata','agentId','createdAt','targetImageGenerator','Setting\x20project\x20context\x20to\x20\x27','\x20--last','[input]\x20\x20','knowledgeBases','Error:\x20Backup\x20folder\x20path\x20is\x20required','llmProject','all','claude-4.5-haiku','dryRun','starterMessage','[error]\x20\x20','length','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','sort','Error:\x20Agent\x20name\x20is\x20required','\x20agent(s)','content','428782bGWVic','cause','List\x20available\x20LLM\x20models','Checking\x20for\x20existing\x20projects...','Restoring\x20project\x20from\x20\x27','chats','find','d\x20ago','history','limit','floor','maxToolIterations','exportedFrom','Fetching\x20available\x20models...','\x20\x20\x20Examples:','yes','short','Error:\x20chat-id\x20is\x20required','name','execute','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','verbose','Creating\x20project\x20\x27','Restore\x20cancelled.','Resolving\x20project\x20\x27','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','Error:\x20Project\x20name\x20is\x20required','Error:\x20','Deleting\x20agent...','red','llm:agents','json','slice','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','temperature','llm:models','Delete\x20an\x20LLM\x20project','llm:agent:update','yellow','string','Agent\x20deleted:\x20','resolveAgentId','Invalid\x20path\x20syntax:\x20','Getting\x20default\x20project...','image','split','targetWebSearchTool','Deleting\x20project\x20\x27','\x27...','chatId','output','[image]\x20\x20','get','select','set','updatedAt','Show\x20chat\x20log','jsonl','getOrCreateDefaultProject','Session\x20llm_project\x20set\x20to:\x20','\x0aStack\x20trace:','Use\x20format:\x20project-name/agent-name','backupProject','INVALID_ARGUMENT','A\x20project\x20named\x20\x27','counts','\x0aCancelled','965xUoYFe','No\x20agents\x20found','No\x20chat\x20sessions\x20found.','629133wnUtyC','Agent\x20updated:\x20','session','374928UdqUqe','No\x20messages\x20found\x20in\x20chat\x20history.','(no\x20message)','toLocaleDateString','stack','last','6352rKMIwo','existsSync','model','Select\x20a\x20chat\x20session:','rmSync','Output\x20directory\x20\x27','site','\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.','createAgent','Resolving\x20agent\x20\x27','blue','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','tsv','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','attributes','Updating\x20agent...','h\x20ago','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','format','llm:log','\x20->\x20KB:','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','Creating\x20agent\x20\x27','\x20→\x20chat:\x20','llm:use','Load\x20more...','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','2qiBHoW','\x20->\x20ImageGen:','[unknown]','Project\x20deleted:\x20','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','targetAgent','llm:project:create','agent','llm:projects','llm:agent:show','restoreProject','m\x20ago'];a29_0x47ef=function(){return _0x437183;};return a29_0x47ef();}function truncatePrompt(_0x13f05b){const _0x354c8e=a29_0x1483;if(!_0x13f05b)return undefined;const _0x526aef=0x64;if(_0x13f05b[_0x354c8e(0xd5)]<=_0x526aef)return _0x13f05b;return _0x13f05b['slice'](0x0,_0x526aef)+'...';}export class LLMModelsCommand extends BaseCommand{[a29_0x1ee233(0xed)]=a29_0x1ee233(0xfe);['description']=a29_0x1ee233(0xdd);async[a29_0x1ee233(0xee)](_0x5788bc){const _0x3bd71f=a29_0x1ee233,{options:_0x1e7681,tdx:_0x42f7b4}=_0x5788bc;try{const _0x3924a3=await withSpinner(_0x3bd71f(0xe8),()=>_0x42f7b4['llm']['models'](),{'verbose':_0x1e7681['verbose']});return await handleSDKOutput(_0x3924a3['data'],_0x1e7681),0x0;}catch(_0x3add18){return handleSDKError(_0x3add18,_0x1e7681),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a29_0x1ee233(0xed)]=a29_0x1ee233(0x14f);[a29_0x1ee233(0xad)]=a29_0x1ee233(0x163);async[a29_0x1ee233(0xee)](_0xf90fe2){const _0x48e781=a29_0x1ee233,{options:_0xd014bf,args:_0x5419ff,tdx:_0x30dc58}=_0xf90fe2,_0x4290ab=getChalk(_0xd014bf),_0x556e26=_0xd014bf['site'];try{const _0x28e5ec=_0x5419ff[0x0],_0x210713=resolveLimit(_0xd014bf[_0x48e781(0xe4)],DEFAULT_LLM_LIMIT),_0x3bf4e7=await withSpinner(_0x48e781(0xb2),()=>_0x30dc58[_0x48e781(0xa5)][_0x48e781(0xc0)](_0x210713),{'verbose':_0xd014bf[_0x48e781(0xf0)]});let _0x432dc8=_0x3bf4e7[_0x48e781(0xb5)];_0x28e5ec&&(_0x432dc8=_0x3bf4e7[_0x48e781(0xb5)][_0x48e781(0x15a)](_0x422e6d=>matchGlobPattern(_0x422e6d[_0x48e781(0x138)][_0x48e781(0xed)],_0x28e5ec)));const _0x228b0f=_0xd014bf['format']===_0x48e781(0xfa)||_0xd014bf[_0x48e781(0x13c)]===_0x48e781(0x114)||_0xd014bf['format']===_0x48e781(0x159)||_0xd014bf[_0x48e781(0x13c)]===_0x48e781(0x136);if(_0x228b0f){const _0x3f6621=_0x432dc8['map'](_0x414b6c=>({...toLLMProjectInfo(_0x414b6c),'url':getLLMProjectUrl(_0x556e26,_0x414b6c['id'])}));await handleSDKOutput(_0x3f6621,_0xd014bf);}else{const _0x4615bc=[];if(_0x432dc8[_0x48e781(0xd5)]===0x0)_0x4615bc[_0x48e781(0x15e)](_0x4290ab[_0x48e781(0x9b)]('No\x20projects\x20found'));else{const _0x45bf0a=[..._0x432dc8]['sort']((_0x4fc04f,_0x181699)=>_0x4fc04f[_0x48e781(0x138)][_0x48e781(0xed)][_0x48e781(0x9e)](_0x181699[_0x48e781(0x138)][_0x48e781(0xed)]));for(const _0x1edb67 of _0x45bf0a){const _0x3a6195=getLLMProjectUrl(_0x556e26,_0x1edb67['id']),_0x5d38cf=hyperlink(_0x1edb67[_0x48e781(0x138)][_0x48e781(0xed)],_0x3a6195);_0x4615bc['push'](_0x48e781(0xa4)+_0x5d38cf);}_0x4615bc[_0x48e781(0x15e)](_0x4290ab[_0x48e781(0x9b)](_0x432dc8[_0x48e781(0xd5)]+_0x48e781(0xa3)));}await writeOutput(_0x4615bc[_0x48e781(0x157)]('\x0a'),_0xd014bf[_0x48e781(0x10d)],'table');}return 0x0;}catch(_0x5469ad){return handleSDKError(_0x5469ad,_0xd014bf),0x1;}}}export class LLMAgentsCommand extends BaseCommand{['name']=a29_0x1ee233(0xf9);[a29_0x1ee233(0xad)]='List\x20agents\x20in\x20current\x20project';async['execute'](_0x5a8f3e){const _0xdc23d9=a29_0x1ee233,{options:_0xfa2eb5,args:_0x44466e,tdx:_0x64b3c9}=_0x5a8f3e,_0x16d641=getChalk(_0xfa2eb5),_0x485845=_0xfa2eb5[_0xdc23d9(0x130)];try{const _0x23b0f2=_0x44466e[0x0];let _0x436896=_0x23b0f2,_0x4090c9,_0xfec727;if(_0x23b0f2&&_0x23b0f2['includes']('/')){const _0x3edfea=_0x23b0f2[_0xdc23d9(0x108)]('/');if(_0x3edfea['length']===0x2){const [_0x4ca526,_0xc30286]=_0x3edfea,_0x31a5d5=await _0x64b3c9['llm'][_0xdc23d9(0xc0)](),_0x4b85b0=_0x31a5d5[_0xdc23d9(0xe1)](_0x3bd9bf=>_0x3bd9bf[_0xdc23d9(0x138)][_0xdc23d9(0xed)][_0xdc23d9(0x9a)]()===_0x4ca526[_0xdc23d9(0x9a)]());if(!_0x4b85b0)throw new SDKError(ErrorCode[_0xdc23d9(0x99)],_0xdc23d9(0xa6)+_0x4ca526,undefined,{'helpText':_0xdc23d9(0xd6)});_0x4090c9=_0x4b85b0['id'],_0xfec727=_0x4b85b0[_0xdc23d9(0x138)][_0xdc23d9(0xed)],_0x436896=_0xc30286;}else throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xdc23d9(0x105)+_0x23b0f2,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else{const _0x655d4e=await getProjectWithName(_0x5a8f3e);_0x4090c9=_0x655d4e['id'],_0xfec727=_0x655d4e[_0xdc23d9(0xed)];}const _0x190823=await withSpinner('Fetching\x20agents...',()=>_0x64b3c9[_0xdc23d9(0xa5)][_0xdc23d9(0x169)](_0x4090c9),{'verbose':_0xfa2eb5[_0xdc23d9(0xf0)]});let _0x2839d9=_0x190823[_0xdc23d9(0xb5)];_0x436896&&(_0x2839d9=_0x190823[_0xdc23d9(0xb5)][_0xdc23d9(0x15a)](_0x51c9ea=>matchGlobPattern(_0x51c9ea['attributes'][_0xdc23d9(0xed)],_0x436896)));const _0x4b8740=_0xfa2eb5['format']==='json'||_0xfa2eb5[_0xdc23d9(0x13c)]===_0xdc23d9(0x114)||_0xfa2eb5[_0xdc23d9(0x13c)]==='table'||_0xfa2eb5[_0xdc23d9(0x13c)]==='tsv';if(_0x4b8740){const _0x2a29c0=_0x2839d9['map'](_0x40dcbd=>({...toAgentInfo(_0x40dcbd),'chatUrl':getLLMAgentChatUrl(_0x485845,_0x4090c9,_0x40dcbd['id'])}));await handleSDKOutput(_0x2a29c0,_0xfa2eb5);}else{const _0x213f16=[];_0x213f16[_0xdc23d9(0x15e)](_0x16d641[_0xdc23d9(0x9b)]('['+_0xfec727+']'));if(_0x2839d9[_0xdc23d9(0xd5)]===0x0)_0x213f16['push'](_0x16d641['dim'](_0xdc23d9(0x11f)));else{const _0x31c357=[..._0x2839d9][_0xdc23d9(0xd7)]((_0x157efb,_0x3c62d6)=>_0x157efb[_0xdc23d9(0x138)][_0xdc23d9(0xed)][_0xdc23d9(0x9e)](_0x3c62d6[_0xdc23d9(0x138)]['name']));for(const _0x2dea9d of _0x31c357){const _0x416844=getLLMAgentChatUrl(_0x485845,_0x4090c9,_0x2dea9d['id']),_0x57cbaf=hyperlink(_0x2dea9d[_0xdc23d9(0x138)][_0xdc23d9(0xed)],_0x416844);_0x213f16[_0xdc23d9(0x15e)]('🤖\x20'+_0x57cbaf);}_0x213f16['push'](_0x16d641[_0xdc23d9(0x9b)](_0x2839d9[_0xdc23d9(0xd5)]+_0xdc23d9(0xd9)));}await writeOutput(_0x213f16[_0xdc23d9(0x157)]('\x0a'),_0xfa2eb5[_0xdc23d9(0x10d)],_0xdc23d9(0x159));}return 0x0;}catch(_0x597325){return handleSDKError(_0x597325,_0xfa2eb5),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a29_0x1ee233(0xed)]=a29_0x1ee233(0x150);[a29_0x1ee233(0xad)]='Show\x20agent\x20details';async[a29_0x1ee233(0xee)](_0x193a14){const _0x3c74f9=a29_0x1ee233,{options:_0x5d8394,args:_0x425893,tdx:_0x7ba63e}=_0x193a14;if(_0x425893[_0x3c74f9(0xd5)]===0x0)return console[_0x3c74f9(0x167)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x3c74f9(0x167)](_0x3c74f9(0xfc)),0x1;const _0x7f95ec=_0x425893[0x0];try{const _0x2a0339=await getProjectIdOrDefault(_0x193a14),_0xed55b0=await withSpinner(_0x3c74f9(0x133)+_0x7f95ec+'\x27...',()=>_0x7ba63e[_0x3c74f9(0xa5)]['resolveAgentId'](_0x7f95ec,_0x2a0339),{'verbose':_0x5d8394[_0x3c74f9(0xf0)]}),_0x39b96b=await withSpinner(_0x3c74f9(0x168),()=>_0x7ba63e['llm']['agent'](_0xed55b0[_0x3c74f9(0xb5)]),{'verbose':_0x5d8394[_0x3c74f9(0xf0)]});return await handleSDKOutput([_0x39b96b[_0x3c74f9(0xb5)]],_0x5d8394),0x0;}catch(_0x5282c0){return handleSDKError(_0x5282c0,_0x5d8394),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a29_0x1ee233(0xed)]=a29_0x1ee233(0xc3);[a29_0x1ee233(0xad)]='Create\x20a\x20new\x20agent\x20in\x20current\x20project';async[a29_0x1ee233(0xee)](_0x36ca92){const _0x3c50ad=a29_0x1ee233,{options:_0x32da3a,args:_0x754788,tdx:_0x41e4ca}=_0x36ca92;if(_0x754788[_0x3c50ad(0xd5)]===0x0)return console['error'](_0x3c50ad(0xd8)),console[_0x3c50ad(0x167)](_0x3c50ad(0x135)),console['error'](_0x3c50ad(0xbc)),0x1;const _0x960cab=_0x754788[0x0],_0x14fcd2=_0x32da3a,_0x471c74=_0x14fcd2[_0x3c50ad(0x164)],_0x2ff1f3=_0x14fcd2[_0x3c50ad(0x12c)]||_0x3c50ad(0xd1),_0x3d79de=_0x14fcd2[_0x3c50ad(0xd3)],_0x43fc7b=_0x14fcd2[_0x3c50ad(0xe6)]?Number(_0x14fcd2[_0x3c50ad(0xe6)]):undefined,_0x5c71e5=_0x14fcd2['temperature']?Number(_0x14fcd2[_0x3c50ad(0xfd)]):undefined;try{let _0x1c5477,_0x197387;if(_0x960cab[_0x3c50ad(0xc2)]('/')){const _0x348979=_0x960cab[_0x3c50ad(0x108)]('/');if(_0x348979[_0x3c50ad(0xd5)]===0x2){const [_0x42312f,_0xab5570]=_0x348979,_0x155683=await withSpinner('Resolving\x20project\x20\x27'+_0x42312f+_0x3c50ad(0x10b),()=>_0x41e4ca[_0x3c50ad(0xa5)]['resolveProjectId'](_0x42312f),{'verbose':_0x32da3a[_0x3c50ad(0xf0)]});_0x1c5477=_0x155683[_0x3c50ad(0xb5)],_0x197387=_0xab5570;}else throw new SDKError(ErrorCode[_0x3c50ad(0x11a)],'Invalid\x20path\x20syntax:\x20'+_0x960cab,undefined,{'helpText':_0x3c50ad(0x118)});}else _0x1c5477=await getProjectIdOrDefault(_0x36ca92),_0x197387=_0x960cab;const _0x5e856a=await withSpinner(_0x3c50ad(0x141)+_0x197387+'\x27...',()=>_0x41e4ca['llm'][_0x3c50ad(0x132)]({'name':_0x197387,'projectId':_0x1c5477,'modelType':_0x2ff1f3,'systemPrompt':_0x471c74,'starterMessage':_0x3d79de,'maxToolIterations':_0x43fc7b,'temperature':_0x5c71e5}),{'verbose':_0x32da3a[_0x3c50ad(0xf0)]});return console[_0x3c50ad(0x155)]('Agent\x20created:\x20'+_0x5e856a[_0x3c50ad(0xb5)]['id']),await handleSDKOutput([_0x5e856a['data']],_0x32da3a),0x0;}catch(_0x51bda8){return handleSDKError(_0x51bda8,_0x32da3a),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a29_0x1ee233(0xed)]=a29_0x1ee233(0x100);[a29_0x1ee233(0xad)]='Update\x20an\x20existing\x20agent';async[a29_0x1ee233(0xee)](_0x1d9054){const _0x132a1d=a29_0x1ee233,{options:_0x5abbc6,args:_0x59776c,tdx:_0x4b772d}=_0x1d9054;if(_0x59776c[_0x132a1d(0xd5)]===0x0)return console['error'](_0x132a1d(0xd8)),console[_0x132a1d(0x167)](_0x132a1d(0xae)),0x1;const _0x5814fe=_0x59776c[0x0],_0x94a917=_0x5abbc6,_0x103121=_0x94a917[_0x132a1d(0xed)],_0x546aeb=_0x94a917[_0x132a1d(0x16f)],_0x22ea80=_0x94a917[_0x132a1d(0xad)],_0x116488=_0x94a917[_0x132a1d(0xd3)];if(!_0x103121&&!_0x546aeb&&!_0x22ea80&&!_0x116488)return console[_0x132a1d(0x167)](_0x132a1d(0x140)),console['error'](_0x132a1d(0x156)),0x1;try{const _0x8b39ac=await getProjectIdOrDefault(_0x1d9054),_0x224f22=await withSpinner(_0x132a1d(0x133)+_0x5814fe+_0x132a1d(0x10b),()=>_0x4b772d[_0x132a1d(0xa5)]['resolveAgentId'](_0x5814fe,_0x8b39ac),{'verbose':_0x5abbc6['verbose']}),_0x106d32=_0x224f22[_0x132a1d(0xb5)],_0x52a75d=await withSpinner(_0x132a1d(0x139),()=>_0x4b772d[_0x132a1d(0xa5)]['updateAgent'](_0x106d32,{'name':_0x103121,'prompt':_0x546aeb,'description':_0x22ea80,'starterMessage':_0x116488}),{'verbose':_0x5abbc6[_0x132a1d(0xf0)]});return console[_0x132a1d(0x155)](_0x132a1d(0x122)+_0x52a75d['data']['id']),await handleSDKOutput([_0x52a75d['data']],_0x5abbc6),0x0;}catch(_0xb03fe8){return handleSDKError(_0xb03fe8,_0x5abbc6),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{['name']=a29_0x1ee233(0x91);[a29_0x1ee233(0xad)]=a29_0x1ee233(0xb9);async[a29_0x1ee233(0xee)](_0x3d2199){const _0x441ffe=a29_0x1ee233,{options:_0x4d2014,args:_0x451f38,tdx:_0x4b181f}=_0x3d2199;if(_0x451f38[_0x441ffe(0xd5)]===0x0)return console['error'](_0x441ffe(0xd8)),console[_0x441ffe(0x167)](_0x441ffe(0x146)),0x1;const _0x4b5343=_0x451f38[0x0];try{const _0x2c84e8=await getProjectIdOrDefault(_0x3d2199),_0x114555=await withSpinner(_0x441ffe(0x133)+_0x4b5343+_0x441ffe(0x10b),()=>_0x4b181f[_0x441ffe(0xa5)][_0x441ffe(0x104)](_0x4b5343,_0x2c84e8),{'verbose':_0x4d2014[_0x441ffe(0xf0)]}),_0x44b719=_0x114555['data'];return await withSpinner(_0x441ffe(0xf7),()=>_0x4b181f[_0x441ffe(0xa5)]['deleteAgent'](_0x44b719),{'verbose':_0x4d2014[_0x441ffe(0xf0)]}),console[_0x441ffe(0x155)](_0x441ffe(0x103)+_0x44b719),0x0;}catch(_0x4837ea){return handleSDKError(_0x4837ea,_0x4d2014),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a29_0x1ee233(0xed)]='llm:history';[a29_0x1ee233(0xad)]=a29_0x1ee233(0x8f);async['execute'](_0x57d764){const _0x3c1a70=a29_0x1ee233;return executeChatHistoryCommand(_0x57d764,_0x3c1a70(0xba));}}export class LLMUseCommand extends BaseCommand{['name']=a29_0x1ee233(0x143);[a29_0x1ee233(0xad)]='Set\x20current\x20project\x20context';async[a29_0x1ee233(0xee)](_0x15398a){const _0x2eb52b=a29_0x1ee233,{options:_0x27d272,args:_0x17d9f0,tdx:_0x534cc0}=_0x15398a;if(_0x17d9f0[_0x2eb52b(0xd5)]===0x0)return console[_0x2eb52b(0x167)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x2eb52b(0x9c)),0x1;const _0x709efb=_0x17d9f0[0x0];try{await withSpinner(_0x2eb52b(0xca)+_0x709efb+_0x2eb52b(0x10b),()=>_0x534cc0[_0x2eb52b(0xa5)][_0x2eb52b(0x158)](_0x709efb),{'verbose':_0x27d272[_0x2eb52b(0xf0)]}),saveSessionContext({'llm_project':_0x709efb},_0x27d272[_0x2eb52b(0x123)]);const _0x3fe486=getChalk(_0x27d272);return console[_0x2eb52b(0x155)](_0x2eb52b(0x116)+_0x3fe486[_0x2eb52b(0x16c)](_0x709efb)),0x0;}catch(_0x9e63e7){return handleSDKError(_0x9e63e7,_0x27d272),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{['name']=a29_0x1ee233(0x14d);['description']=a29_0x1ee233(0xb4);async[a29_0x1ee233(0xee)](_0x4b9759){const _0x43b95f=a29_0x1ee233,{options:_0x1ee832,args:_0xa81959,tdx:_0x25eb23}=_0x4b9759;if(_0xa81959[_0x43b95f(0xd5)]===0x0)return console[_0x43b95f(0x167)](_0x43b95f(0xf5)),console[_0x43b95f(0x167)]('Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]'),0x1;const _0x237a89=_0xa81959[0x0],_0x412f14=_0x1ee832,_0x43ea14=_0x412f14[_0x43b95f(0xad)];try{const _0x2eb722=await withSpinner(_0x43b95f(0xf1)+_0x237a89+'\x27...',()=>_0x25eb23[_0x43b95f(0xa5)]['createProject']({'name':_0x237a89,'description':_0x43ea14}),{'verbose':_0x1ee832['verbose']});console[_0x43b95f(0x155)]('Project\x20created:\x20'+_0x2eb722['data']['id']);const _0x43a3b8=toLLMProjectInfo(_0x2eb722[_0x43b95f(0xb5)]);return await handleSDKOutput([_0x43a3b8],_0x1ee832),0x0;}catch(_0x7532eb){return handleSDKError(_0x7532eb,_0x1ee832),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{['name']='llm:project:delete';[a29_0x1ee233(0xad)]=a29_0x1ee233(0xff);async[a29_0x1ee233(0xee)](_0x166562){const _0x347d77=a29_0x1ee233,{options:_0x3b53b5,args:_0x28dcd5,tdx:_0x1bd366}=_0x166562;if(_0x28dcd5['length']===0x0)return console[_0x347d77(0x167)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x347d77(0x167)](_0x347d77(0xef)),0x1;const _0x182f28=_0x28dcd5[0x0];try{return await withSpinner(_0x347d77(0x10a)+_0x182f28+_0x347d77(0x10b),()=>_0x1bd366[_0x347d77(0xa5)][_0x347d77(0x96)](_0x182f28),{'verbose':_0x3b53b5[_0x347d77(0xf0)]}),console[_0x347d77(0x155)](_0x347d77(0x14a)+_0x182f28),0x0;}catch(_0x204a0b){return handleSDKError(_0x204a0b,_0x3b53b5),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a29_0x1ee233(0xed)]='llm:project:backup';[a29_0x1ee233(0xad)]='Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)';async[a29_0x1ee233(0xee)](_0x354824){const _0x154656=a29_0x1ee233,{options:_0x4ceb76,args:_0x42ff31,tdx:_0xdc2e4b}=_0x354824,_0x43d752=getChalk(_0x4ceb76);console[_0x154656(0x155)](_0x43d752[_0x154656(0x101)]('⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.')),console['log'](_0x43d752[_0x154656(0x101)]('\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.')),console[_0x154656(0x155)](_0x43d752[_0x154656(0x9b)](_0x154656(0xaf))),console['log']();if(_0x42ff31[_0x154656(0xd5)]===0x0)return console['error'](_0x154656(0xf5)),console[_0x154656(0x167)](_0x154656(0x14b)),0x1;const _0x431794=_0x42ff31[0x0],_0x12b55b=_0x4ceb76,_0x2f6842=_0x12b55b[_0x154656(0x10d)],_0x1dd563=_0x12b55b[_0x154656(0xd2)];try{const _0x261cb5=_0x2f6842||_0x431794+_0x154656(0x97);if(a29_0x97a079[_0x154656(0x12b)](_0x261cb5)&&!_0x1dd563){if(!_0x4ceb76[_0x154656(0xea)]){const _0x1ebdb6=await confirm(_0x154656(0x12f)+_0x261cb5+'\x27\x20already\x20exists.\x20Overwrite?');if(!_0x1ebdb6)return console['log'](_0x154656(0x16b)),0x0;}a29_0x97a079[_0x154656(0x12e)](_0x261cb5,{'recursive':!![]});}const _0x4b8c08=await withSpinner(_0x1dd563?_0x154656(0x95)+_0x431794+_0x154656(0x10b):'Backing\x20up\x20project\x20\x27'+_0x431794+_0x154656(0x10b),()=>_0xdc2e4b[_0x154656(0xa5)][_0x154656(0x119)](_0x431794,_0x2f6842,{'dryRun':_0x1dd563}),{'verbose':_0x4ceb76[_0x154656(0xf0)]}),_0x14f4ad=_0x4b8c08['data'];return _0x1dd563?console[_0x154656(0x155)](_0x154656(0xbe)+_0x14f4ad[_0x154656(0xb1)]):console[_0x154656(0x155)](_0x154656(0x15f)+_0x14f4ad[_0x154656(0xb1)]),console['log']('\x20\x20Agents:\x20'+_0x14f4ad[_0x154656(0x11c)][_0x154656(0x169)]),console[_0x154656(0x155)](_0x154656(0x93)+_0x14f4ad['counts'][_0x154656(0xcd)]),console[_0x154656(0x155)](_0x154656(0x92)+_0x14f4ad['counts'][_0x154656(0x154)]),console['log']('\x20\x20Integrations:\x20'+_0x14f4ad[_0x154656(0x11c)]['integrations']),(_0x4ceb76[_0x154656(0x13c)]==='json'||_0x4ceb76['format']==='jsonl')&&await handleSDKOutput([_0x14f4ad],_0x4ceb76),0x0;}catch(_0x52e908){return handleSDKError(_0x52e908,_0x4ceb76),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a29_0x1ee233(0xed)]=a29_0x1ee233(0x90);['description']=a29_0x1ee233(0x137);async[a29_0x1ee233(0xee)](_0x5dc729){const _0x5a969e=a29_0x1ee233,{options:_0x2b7807,args:_0x248a38,tdx:_0x562c34}=_0x5dc729,_0x1db0db=getChalk(_0x2b7807);console[_0x5a969e(0x155)](_0x1db0db[_0x5a969e(0x101)](_0x5a969e(0x13f))),console['log'](_0x1db0db['yellow'](_0x5a969e(0x131))),console[_0x5a969e(0x155)](_0x1db0db[_0x5a969e(0x9b)](_0x5a969e(0xe9))),console[_0x5a969e(0x155)](_0x1db0db['dim']('\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/')),console[_0x5a969e(0x155)](_0x1db0db[_0x5a969e(0x9b)](_0x5a969e(0xa2))),console[_0x5a969e(0x155)]();if(_0x248a38['length']===0x0)return console[_0x5a969e(0x167)](_0x5a969e(0xce)),console['error'](_0x5a969e(0xbd)),0x1;const _0x1349a7=_0x248a38[0x0],_0x46acc5=_0x2b7807,_0x153ba8=_0x46acc5[_0x5a969e(0xed)],_0x5ef849=_0x46acc5[_0x5a969e(0xd2)];try{if(!_0x5ef849){const _0x3c354c=_0x562c34['llm'][_0x5a969e(0xc6)](_0x1349a7),_0x23ee28=_0x153ba8||_0x3c354c[_0x5a969e(0xe7)]['projectName'],_0x238c36=await withSpinner(_0x5a969e(0xde),()=>_0x562c34[_0x5a969e(0xa5)][_0x5a969e(0xc0)](),{'verbose':_0x2b7807[_0x5a969e(0xf0)]}),_0x2b8b89=_0x238c36[_0x5a969e(0xb5)][_0x5a969e(0xe1)](_0x35d144=>_0x35d144[_0x5a969e(0x138)][_0x5a969e(0xed)]===_0x23ee28);if(_0x2b8b89&&!_0x2b7807[_0x5a969e(0xea)]){const _0x40b2ad=await confirm(_0x5a969e(0x11b)+_0x23ee28+_0x5a969e(0x13b));if(!_0x40b2ad)return console[_0x5a969e(0x155)](_0x5a969e(0xf2)),0x0;}}const _0x2735d7=await withSpinner(_0x5ef849?_0x5a969e(0xb3)+_0x1349a7+_0x5a969e(0x10b):_0x5a969e(0xdf)+_0x1349a7+_0x5a969e(0x10b),()=>_0x562c34['llm'][_0x5a969e(0x151)](_0x1349a7,{'name':_0x153ba8,'dryRun':_0x5ef849}),{'verbose':_0x2b7807[_0x5a969e(0xf0)]}),_0x14cb3f=_0x2735d7[_0x5a969e(0xb5)];return _0x14cb3f['sourceSite']&&console[_0x5a969e(0x155)]('[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27'+_0x14cb3f[_0x5a969e(0x161)]+'\x27'),_0x5ef849?console[_0x5a969e(0x155)](_0x5a969e(0xf4)+_0x14cb3f[_0x5a969e(0xa0)]):console[_0x5a969e(0x155)](_0x5a969e(0x8d)+_0x14cb3f['projectName']+'\x20('+_0x14cb3f[_0x5a969e(0xc4)]+')'),console[_0x5a969e(0x155)]('\x20\x20Agents:\x20'+_0x14cb3f[_0x5a969e(0x11c)][_0x5a969e(0x169)]),console[_0x5a969e(0x155)](_0x5a969e(0x93)+_0x14cb3f[_0x5a969e(0x11c)][_0x5a969e(0xcd)]),console[_0x5a969e(0x155)](_0x5a969e(0x92)+_0x14cb3f['counts'][_0x5a969e(0x154)]),console[_0x5a969e(0x155)]('\x20\x20Integrations:\x20'+_0x14cb3f[_0x5a969e(0x11c)]['integrations']),(_0x2b7807[_0x5a969e(0x13c)]==='json'||_0x2b7807[_0x5a969e(0x13c)]===_0x5a969e(0x114))&&await handleSDKOutput([_0x14cb3f],_0x2b7807),0x0;}catch(_0x4dd8c6){return handleSDKError(_0x4dd8c6,_0x2b7807),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;function a29_0x1483(_0x5a8469,_0x43fc2e){_0x5a8469=_0x5a8469-0x8d;const _0x47efba=a29_0x47ef();let _0x148385=_0x47efba[_0x5a8469];return _0x148385;}async function selectChatInteractively(_0x150699,_0x149f54){const _0x5e1dea=a29_0x1ee233,_0x1f41e2=_0x149f54['limit']||CHAT_SELECTOR_PAGE_SIZE;let _0x5a0977=0x0,_0x24fafe=[];const _0x1d7339=(await import(_0x5e1dea(0x154)))['default'],_0x1d0e43=getChalk(_0x149f54);while(!![]){const _0x40d3de=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0x150699[_0x5e1dea(0xa5)][_0x5e1dea(0xe0)](_0x1f41e2+_0x5a0977),{'verbose':_0x149f54[_0x5e1dea(0xf0)]});_0x24fafe=_0x40d3de[_0x5e1dea(0xb5)];const _0x64c814=_0x24fafe[_0x5e1dea(0xfb)](_0x5a0977,_0x5a0977+_0x1f41e2),_0xd6a453=_0x24fafe[_0x5e1dea(0xd5)]>_0x5a0977+_0x1f41e2,_0x39f9ee=[...new Set(_0x64c814[_0x5e1dea(0x15d)](_0x180a1d=>_0x180a1d[_0x5e1dea(0x138)][_0x5e1dea(0xc7)])[_0x5e1dea(0x15a)](_0x548037=>_0x548037!==undefined))],_0x422594=new Map();await Promise[_0x5e1dea(0xd0)](_0x39f9ee[_0x5e1dea(0x15d)](async _0x138cf3=>{const _0xedfa57=_0x5e1dea;try{const _0xe852d5=await _0x150699[_0xedfa57(0xa5)][_0xedfa57(0x14e)](_0x138cf3);_0x422594[_0xedfa57(0x111)](_0x138cf3,_0xe852d5[_0xedfa57(0x138)][_0xedfa57(0xed)]);}catch{_0x422594[_0xedfa57(0x111)](_0x138cf3,_0x138cf3);}}));const _0x2cce79=_0x64c814[_0x5e1dea(0x15d)](_0x39e892=>{const _0x5d7ea2=_0x5e1dea,_0x40da4e=_0x39e892['attributes']['firstInputContent']||_0x5d7ea2(0x126),_0x516a8c=_0x40da4e['split']('\x0a')[0x0],_0x4c5264=_0x516a8c[_0x5d7ea2(0xd5)]>0x50?_0x516a8c[_0x5d7ea2(0x160)](0x0,0x4d)+'...':_0x516a8c,_0x48bce3=_0x39e892[_0x5d7ea2(0x138)][_0x5d7ea2(0xc7)]?_0x422594[_0x5d7ea2(0x10f)](_0x39e892[_0x5d7ea2(0x138)][_0x5d7ea2(0xc7)])||_0x39e892[_0x5d7ea2(0x138)][_0x5d7ea2(0xc7)]:_0x5d7ea2(0xa1),_0x59b88=_0x39e892[_0x5d7ea2(0x138)][_0x5d7ea2(0x16d)]||_0x39e892[_0x5d7ea2(0x138)][_0x5d7ea2(0x112)],_0x47b714=new Date(_0x59b88),_0x477001=new Date(),_0x3a862c=_0x477001[_0x5d7ea2(0xb7)]()-_0x47b714[_0x5d7ea2(0xb7)](),_0x476f6e=Math[_0x5d7ea2(0xe5)](_0x3a862c/0xea60),_0x7e98a1=Math[_0x5d7ea2(0xe5)](_0x3a862c/0x36ee80),_0x1d3362=Math['floor'](_0x3a862c/0x5265c00);let _0x474e80;if(_0x476f6e<0x1)_0x474e80=_0x5d7ea2(0xb6);else{if(_0x476f6e<0x3c)_0x474e80=_0x476f6e+_0x5d7ea2(0x152);else{if(_0x7e98a1<0x18)_0x474e80=_0x7e98a1+_0x5d7ea2(0x13a);else _0x1d3362<0x7?_0x474e80=_0x1d3362+_0x5d7ea2(0xe2):_0x474e80=_0x47b714[_0x5d7ea2(0x127)]('en-US',{'month':_0x5d7ea2(0xeb),'day':'numeric'});}}return{'title':_0x4c5264+'\x20'+_0x1d0e43[_0x5d7ea2(0x9b)]('['+_0x48bce3+']\x20'+_0x474e80),'value':_0x39e892['id']};});_0xd6a453&&_0x2cce79[_0x5e1dea(0x15e)]({'title':_0x1d0e43[_0x5e1dea(0x16e)](_0x5e1dea(0x144)),'value':'__load_more__'});const _0x762a43=await _0x1d7339({'type':_0x5e1dea(0x110),'name':'chatId','message':_0x5e1dea(0x12d),'choices':_0x2cce79,'hint':_0x5e1dea(0x145)});if(!_0x762a43[_0x5e1dea(0x10c)])return undefined;if(_0x762a43['chatId']===_0x5e1dea(0xa7)){_0x5a0977+=_0x1f41e2;continue;}return _0x762a43['chatId'];}}export class ChatsCommand extends BaseCommand{['name']=a29_0x1ee233(0xe0);[a29_0x1ee233(0xad)]='Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history';async[a29_0x1ee233(0xee)](_0x5c3e0b){const _0x44c98e=a29_0x1ee233;return executeChatHistoryCommand(_0x5c3e0b,_0x44c98e(0xa8));}}export class LLMLogCommand extends BaseCommand{[a29_0x1ee233(0xed)]=a29_0x1ee233(0x13d);['description']=a29_0x1ee233(0x113);async['execute'](_0x3ffe79){const _0x5abc6e=a29_0x1ee233,{options:_0x5dca6c,args:_0x2f492e,tdx:_0x5817ff}=_0x3ffe79,_0x2156d1=_0x2f492e[0x0];if(!_0x2156d1)return console[_0x5abc6e(0x167)](_0x5abc6e(0xec)),console[_0x5abc6e(0x167)](_0x5abc6e(0x170)),0x1;const _0xc9af18=await withSpinner(_0x5abc6e(0xaa)+_0x2156d1+_0x5abc6e(0x10b),()=>_0x5817ff[_0x5abc6e(0xa5)][_0x5abc6e(0x8e)](_0x2156d1),{'verbose':_0x5dca6c[_0x5abc6e(0xf0)]});return await handleSDKOutput(_0xc9af18[_0x5abc6e(0xb5)][_0x5abc6e(0xb5)],_0x5dca6c),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a30_0x52bb(){const _0x4fb92e=['site','TDX_SITE','message','../mcp/server.js','3724386bxJUgK','19713hcfYTC','context','description','80UqRGwc','accessToken','name','12935EoYiNs','9fyjPxM','850134JlajIS','apiKey','7394080uFlWlM','2975952vYRcHD','1028hZreDx','execute','TDX_PROFILE','error','profile','7187080ZlJheO','TDX_API_KEY'];a30_0x52bb=function(){return _0x4fb92e;};return a30_0x52bb();}const a30_0x255937=a30_0x1de9;(function(_0x2667d2,_0x2646f2){const _0x2abee1=a30_0x1de9,_0x22775f=_0x2667d2();while(!![]){try{const _0x4de92=parseInt(_0x2abee1(0x137))/0x1+-parseInt(_0x2abee1(0x132))/0x2*(parseInt(_0x2abee1(0x12f))/0x3)+parseInt(_0x2abee1(0x13b))/0x4*(-parseInt(_0x2abee1(0x135))/0x5)+-parseInt(_0x2abee1(0x12e))/0x6+-parseInt(_0x2abee1(0x13a))/0x7+-parseInt(_0x2abee1(0x140))/0x8*(-parseInt(_0x2abee1(0x136))/0x9)+parseInt(_0x2abee1(0x139))/0xa;if(_0x4de92===_0x2646f2)break;else _0x22775f['push'](_0x22775f['shift']());}catch(_0x4a27fd){_0x22775f['push'](_0x22775f['shift']());}}}(a30_0x52bb,0x7d939));import{BaseCommand}from'./command.js';function a30_0x1de9(_0x549140,_0x250997){_0x549140=_0x549140-0x129;const _0x52bbb0=a30_0x52bb();let _0x1de9d1=_0x52bbb0[_0x549140];return _0x1de9d1;}export class MCPCommand extends BaseCommand{[a30_0x255937(0x134)]='mcp';[a30_0x255937(0x131)]='Start\x20MCP\x20server\x20for\x20AI\x20tool\x20integration';async[a30_0x255937(0x13c)](_0x473b61){const _0x2d0dff=a30_0x255937,{tdx:_0x166174}=_0x473b61,_0x24f303={};if(process.env.TDX_PROFILE)_0x24f303[_0x2d0dff(0x13d)]=process.env.TDX_PROFILE;else{if(process.env.TDX_API_KEY)_0x24f303[_0x2d0dff(0x129)]=process.env.TDX_API_KEY,process.env.TDX_SITE&&(_0x24f303['TDX_SITE']=process.env.TDX_SITE);else{if(_0x166174[_0x2d0dff(0x130)]['accessToken'])_0x24f303['TDX_ACCESS_TOKEN']=_0x166174[_0x2d0dff(0x130)][_0x2d0dff(0x133)],_0x24f303[_0x2d0dff(0x12b)]=_0x166174[_0x2d0dff(0x130)][_0x2d0dff(0x12a)];else _0x166174[_0x2d0dff(0x130)][_0x2d0dff(0x138)]&&(_0x24f303[_0x2d0dff(0x129)]=_0x166174['context'][_0x2d0dff(0x138)],_0x24f303[_0x2d0dff(0x12b)]=_0x166174[_0x2d0dff(0x130)][_0x2d0dff(0x12a)]);}}_0x166174[_0x2d0dff(0x130)][_0x2d0dff(0x13f)]&&(_0x24f303[_0x2d0dff(0x13d)]=_0x166174[_0x2d0dff(0x130)][_0x2d0dff(0x13f)]);try{const {startMCPServer:_0x1e11ff}=await import(_0x2d0dff(0x12d));return await _0x1e11ff({'env':_0x24f303}),0x0;}catch(_0x333220){const _0x2e5578=_0x333220 instanceof Error?_0x333220[_0x2d0dff(0x12c)]:String(_0x333220);return console[_0x2d0dff(0x13e)]('MCP\x20server\x20error:\x20'+_0x2e5578),0x1;}}}
|