@treasuredata/tdx 2026.3.32 → 2026.3.33
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/auth-login-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.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/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.d.ts +1 -3
- package/dist/commands/work-command.d.ts.map +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/work-command.js.map +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/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/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.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/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.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/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/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/progress.js +1 -1
- package/dist/sdk/types/workspace.d.ts +42 -19
- package/dist/sdk/types/workspace.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/types/workspace.js.map +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.d.ts +15 -0
- package/dist/sdk/workspace/git.d.ts.map +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/git.js.map +1 -1
- package/dist/sdk/workspace/index.d.ts +38 -21
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.d.ts +49 -0
- package/dist/sdk/workspace/weekly.d.ts.map +1 -0
- package/dist/sdk/workspace/weekly.js +1 -0
- package/dist/sdk/workspace/weekly.js.map +1 -0
- package/dist/sdk/workspace/wikilinks.d.ts +7 -2
- package/dist/sdk/workspace/wikilinks.d.ts.map +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/sdk/workspace/wikilinks.js.map +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
- package/dist/sdk/workspace/skills.d.ts +0 -34
- package/dist/sdk/workspace/skills.d.ts.map +0 -1
- package/dist/sdk/workspace/skills.js +0 -1
- package/dist/sdk/workspace/skills.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x3f5e91=a30_0x583b;(function(_0x251f00,_0x241ab2){const _0x216ff8=a30_0x583b,_0x57405c=_0x251f00();while(!![]){try{const _0x542802=-parseInt(_0x216ff8(0x172))/0x1+parseInt(_0x216ff8(0x185))/0x2*(-parseInt(_0x216ff8(0x143))/0x3)+parseInt(_0x216ff8(0x1b5))/0x4+parseInt(_0x216ff8(0x1ca))/0x5+parseInt(_0x216ff8(0x10e))/0x6+-parseInt(_0x216ff8(0x122))/0x7+-parseInt(_0x216ff8(0x1b8))/0x8*(-parseInt(_0x216ff8(0x1de))/0x9);if(_0x542802===_0x241ab2)break;else _0x57405c['push'](_0x57405c['shift']());}catch(_0x445df7){_0x57405c['push'](_0x57405c['shift']());}}}(a30_0x19b6,0x2f948));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 a30_0x119a70 from'node:fs';function a30_0x583b(_0x1d66b4,_0x1a151b){_0x1d66b4=_0x1d66b4-0x101;const _0x19b6c8=a30_0x19b6();let _0x583b10=_0x19b6c8[_0x1d66b4];return _0x583b10;}function handleSDKError(_0x2c6019,_0x57c47f){const _0x8550e2=a30_0x583b;if(_0x2c6019 instanceof SDKError)console[_0x8550e2(0x1bf)](_0x8550e2(0x16b)+_0x2c6019[_0x8550e2(0x1bb)]),_0x57c47f[_0x8550e2(0x141)]&&(_0x2c6019[_0x8550e2(0x12a)]&&console[_0x8550e2(0x1bf)](_0x8550e2(0x15c)+_0x2c6019[_0x8550e2(0x12a)]),_0x2c6019[_0x8550e2(0x132)]&&(console[_0x8550e2(0x1bf)](_0x8550e2(0x13c)),console[_0x8550e2(0x1bf)](_0x2c6019[_0x8550e2(0x132)])));else throw _0x2c6019;}function formatChatHistoryEntry(_0x288275,_0x1b6dba){const _0x301f39=a30_0x583b,_0x5b879e=getChalk(_0x1b6dba),_0x33d9e2=_0x5b879e[_0x301f39(0x11e)](_0x288275['at']);if(_0x301f39(0x1e0)in _0x288275){const _0xc8ce=_0x5b879e[_0x301f39(0x1a7)](_0x301f39(0x162));return _0x33d9e2+'\x20'+_0xc8ce+':\x20'+_0x288275[_0x301f39(0x1e0)];}if(_0x301f39(0x17d)in _0x288275){const _0x4b6cfc=_0x5b879e['green'](_0x301f39(0x110));return _0x33d9e2+'\x20'+_0x4b6cfc+':\x20'+_0x288275[_0x301f39(0x17d)];}if('tool_call'in _0x288275){const _0x569af0=_0x5b879e[_0x301f39(0x186)](_0x301f39(0x1cf)),{functionName:_0x4aeb03,functionArguments:_0x36bfb2,targetFunction:_0x841150}=_0x288275[_0x301f39(0x113)];let _0x769a5b=_0x33d9e2+'\x20'+_0x569af0+':\x20'+_0x5b879e[_0x301f39(0x19e)](_0x4aeb03);if(_0x36bfb2&&Object[_0x301f39(0x17a)](_0x36bfb2)[_0x301f39(0x12e)]>0x0){const _0x1a31ae=Object[_0x301f39(0x1ab)](_0x36bfb2)[_0x301f39(0x148)](([_0x4d958a,_0x578b94])=>_0x4d958a+'='+JSON[_0x301f39(0x19d)](_0x578b94))['join'](',\x20');_0x769a5b+='('+_0x1a31ae+')';}_0x841150&&(_0x769a5b+=_0x5b879e[_0x301f39(0x11e)]('\x20['+_0x841150+']'));let _0x1ae512='';if(_0x288275[_0x301f39(0x113)][_0x301f39(0x111)])_0x1ae512=_0x301f39(0x157)+_0x288275['tool_call'][_0x301f39(0x111)][_0x301f39(0x1ce)];else{if(_0x288275[_0x301f39(0x113)][_0x301f39(0x14e)])_0x1ae512=_0x301f39(0x1c9)+_0x288275[_0x301f39(0x113)][_0x301f39(0x14e)][_0x301f39(0x1ce)];else{if(_0x288275[_0x301f39(0x113)][_0x301f39(0x194)])_0x1ae512=_0x301f39(0x136)+_0x288275[_0x301f39(0x113)]['targetWebSearchTool'][_0x301f39(0x1ce)];else _0x288275[_0x301f39(0x113)][_0x301f39(0x149)]&&(_0x1ae512=_0x301f39(0x198)+_0x288275['tool_call']['targetImageGenerator'][_0x301f39(0x1ce)]);}}return _0x769a5b+_0x1ae512;}if(_0x301f39(0x1d9)in _0x288275){const _0x37041e=_0x5b879e[_0x301f39(0x18b)]('[tool]\x20\x20\x20'),{functionName:_0x3fb059,functionArguments:_0x4abbdf,content:_0x34ae95,newChat:_0x3451ad}=_0x288275[_0x301f39(0x1d9)];let _0x3a5b31=_0x33d9e2+'\x20'+_0x37041e+':\x20'+_0x5b879e[_0x301f39(0x19e)](_0x3fb059);if(_0x4abbdf){const _0x579838=typeof _0x4abbdf===_0x301f39(0x10c)?_0x4abbdf:JSON[_0x301f39(0x19d)](_0x4abbdf);_0x3a5b31+='('+_0x579838+')';}return _0x34ae95&&(_0x3a5b31+='\x0a'+_0x5b879e[_0x301f39(0x11e)](_0x34ae95)),_0x3451ad&&(_0x3a5b31+=_0x5b879e['dim'](_0x301f39(0x1c6)+_0x3451ad['id'])),_0x3a5b31;}if(_0x301f39(0x11f)in _0x288275){const _0x3e0eb7=_0x5b879e[_0x301f39(0x1dc)](_0x301f39(0x1d6));return _0x33d9e2+'\x20'+_0x3e0eb7+':\x20'+_0x288275['output'][_0x301f39(0x1ce)]+'\x20('+_0x288275[_0x301f39(0x11f)][_0x301f39(0x17d)][_0x301f39(0x12e)]+'\x20bytes)';}if(_0x301f39(0x164)in _0x288275){const _0x25a2b0=_0x5b879e[_0x301f39(0x1dc)](_0x301f39(0x15e)),{width:_0x5c110b,height:_0x190a69,headerText:_0x1778c4}=_0x288275[_0x301f39(0x164)],_0x30c5d3=_0x1778c4?_0x301f39(0x17f)+_0x1778c4:'';return _0x33d9e2+'\x20'+_0x25a2b0+':\x20'+_0x5c110b+'x'+_0x190a69+_0x30c5d3;}if(_0x301f39(0x1bf)in _0x288275){const _0x561a5e=_0x5b879e[_0x301f39(0x1ba)]('[error]\x20\x20');return _0x33d9e2+'\x20'+_0x561a5e+':\x20'+_0x288275['error'];}return _0x33d9e2+'\x20'+_0x5b879e['dim'](_0x301f39(0x175))+':\x20'+JSON[_0x301f39(0x19d)](_0x288275);}async function executeChatHistoryCommand(_0x2c8117,_0x4ed016){const _0x55cebf=a30_0x583b,{options:_0x2f6157,args:_0x51a81a,tdx:_0x540f1f}=_0x2c8117,_0x1e96a9=_0x51a81a[0x0],_0x46ab4b=_0x2f6157,_0x589c66=_0x46ab4b[_0x55cebf(0x187)];try{if(_0x589c66&&_0x1e96a9)return console[_0x55cebf(0x1bf)](_0x55cebf(0x173)),console[_0x55cebf(0x1bf)]('Usage:\x20'+_0x4ed016+'\x20--last'),0x1;if(!_0x1e96a9&&!_0x589c66&&_0x2f6157[_0x55cebf(0x112)]!==undefined){const _0x26dea9=resolveLimit(_0x2f6157[_0x55cebf(0x189)],DEFAULT_LLM_LIMIT),_0x4557bb=await withSpinner(_0x55cebf(0x123),()=>_0x540f1f[_0x55cebf(0x1aa)][_0x55cebf(0x196)](_0x26dea9),{'verbose':_0x2f6157[_0x55cebf(0x141)]});return await handleSDKOutput(_0x4557bb[_0x55cebf(0x159)],_0x2f6157),0x0;}const _0xfc175=await getChatIdOrSelect(_0x540f1f,_0x2f6157,_0x589c66,_0x1e96a9);if(!_0xfc175)return 0x0;return await displayChatHistory(_0xfc175,_0x540f1f,_0x2f6157),0x0;}catch(_0x4cd1f4){return handleSDKError(_0x4cd1f4,_0x2f6157),0x1;}}async function displayChatHistory(_0x217411,_0x3827d8,_0xdd1fd){const _0x39f4d6=a30_0x583b,_0x39a358=await withSpinner('Fetching\x20chat\x20history\x20for\x20\x27'+_0x217411+_0x39f4d6(0x150),()=>_0x3827d8[_0x39f4d6(0x1aa)][_0x39f4d6(0x178)](_0x217411),{'verbose':_0xdd1fd[_0x39f4d6(0x141)]}),_0x389d7e=_0x39a358[_0x39f4d6(0x159)][_0x39f4d6(0x159)]??[];if(_0x389d7e[_0x39f4d6(0x12e)]===0x0){console[_0x39f4d6(0x138)](_0x39f4d6(0x16d));return;}if(_0xdd1fd[_0x39f4d6(0x112)]!==undefined)await handleSDKOutput(_0x389d7e,_0xdd1fd);else{const _0x4c297f=_0x389d7e[_0x39f4d6(0x148)](_0x23d121=>formatChatHistoryEntry(_0x23d121,_0xdd1fd)),_0x22fb4e=_0x4c297f[_0x39f4d6(0x1c2)]('\x0a');await writeOutput(_0x22fb4e,_0xdd1fd[_0x39f4d6(0x11f)],_0x39f4d6(0x1c5));}}async function getChatIdOrSelect(_0x1f6278,_0x542782,_0x40f3c0,_0x406c1c){const _0x5829d6=a30_0x583b;if(_0x406c1c)return _0x406c1c;if(_0x40f3c0){const _0x404ad2=await withSpinner(_0x5829d6(0x1ae),()=>_0x1f6278[_0x5829d6(0x1aa)][_0x5829d6(0x196)](0x1),{'verbose':_0x542782[_0x5829d6(0x141)]});if(_0x404ad2['data'][_0x5829d6(0x12e)]===0x0)return console[_0x5829d6(0x138)]('No\x20chat\x20sessions\x20found.'),undefined;return _0x404ad2[_0x5829d6(0x159)][0x0]['id'];}const _0x1389ec=await selectChatInteractively(_0x1f6278,_0x542782);if(!_0x1389ec)return console[_0x5829d6(0x138)]('\x0aCancelled'),undefined;return _0x1389ec;}async function getProjectIdOrDefault(_0x33b48f){const _0x8c9458=await getProjectWithName(_0x33b48f);return _0x8c9458['id'];}async function getProjectWithName(_0x1de405){const _0x33f378=a30_0x583b,{tdx:_0x5629c6,options:_0x5076ef}=_0x1de405,_0x4771c6=_0x5076ef[_0x33f378(0x1ac)];if(_0x4771c6){const _0x1eb6ea=await withSpinner(_0x33f378(0x13a)+_0x4771c6+_0x33f378(0x150),()=>_0x5629c6[_0x33f378(0x1aa)]['resolveProjectId'](_0x4771c6),{'verbose':_0x5076ef[_0x33f378(0x141)]});return{'id':_0x1eb6ea[_0x33f378(0x159)],'name':_0x4771c6};}const _0x2ac0eb=_0x5629c6[_0x33f378(0x1aa)][_0x33f378(0x14f)]();if(_0x2ac0eb){const _0x42b6bb=await _0x5629c6[_0x33f378(0x1aa)][_0x33f378(0x1b2)](),_0x5df12f=_0x42b6bb[_0x33f378(0x197)](_0xf69d2c=>_0xf69d2c['id']===_0x2ac0eb);return{'id':_0x2ac0eb,'name':_0x5df12f?.[_0x33f378(0x13e)][_0x33f378(0x1ce)]||_0x33f378(0x154)};}const _0x2e3735=await withSpinner(_0x33f378(0x11d),()=>_0x5629c6[_0x33f378(0x1aa)]['getOrCreateDefaultProject'](),{'verbose':_0x5076ef[_0x33f378(0x141)]});return{'id':_0x2e3735['data']['id'],'name':_0x2e3735['data'][_0x33f378(0x13e)]['name']};}function toLLMProjectInfo(_0x298fd4){const _0x583154=a30_0x583b;return{'name':_0x298fd4[_0x583154(0x13e)][_0x583154(0x1ce)],'description':_0x298fd4[_0x583154(0x13e)][_0x583154(0x146)],'createdAt':_0x298fd4[_0x583154(0x13e)][_0x583154(0x16a)],'updatedAt':_0x298fd4[_0x583154(0x13e)][_0x583154(0x1b7)]};}function toAgentInfo(_0x39f0a1){const _0x5c1d2c=a30_0x583b;return{'name':_0x39f0a1[_0x5c1d2c(0x13e)]['name'],'description':_0x39f0a1[_0x5c1d2c(0x13e)][_0x5c1d2c(0x146)],'prompt':truncatePrompt(_0x39f0a1['attributes']['prompt']),'createdAt':_0x39f0a1[_0x5c1d2c(0x13e)]['createdAt'],'updatedAt':_0x39f0a1[_0x5c1d2c(0x13e)][_0x5c1d2c(0x1b7)]};}function truncatePrompt(_0x30baee){const _0x1e4e7c=a30_0x583b;if(!_0x30baee)return undefined;const _0x1d9aa5=0x64;if(_0x30baee[_0x1e4e7c(0x12e)]<=_0x1d9aa5)return _0x30baee;return _0x30baee[_0x1e4e7c(0x169)](0x0,_0x1d9aa5)+'...';}export class LLMModelsCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]='llm:models';[a30_0x3f5e91(0x146)]='List\x20available\x20LLM\x20models';async[a30_0x3f5e91(0x1b6)](_0x29c121){const _0x339c06=a30_0x3f5e91,{options:_0x233885,tdx:_0x1e9188}=_0x29c121;try{const _0x57e76e=await withSpinner('Fetching\x20available\x20models...',()=>_0x1e9188[_0x339c06(0x1aa)][_0x339c06(0x107)](),{'verbose':_0x233885[_0x339c06(0x141)]});return await handleSDKOutput(_0x57e76e[_0x339c06(0x159)],_0x233885),0x0;}catch(_0x977e9e){return handleSDKError(_0x977e9e,_0x233885),0x1;}}}export class LLMProjectsCommand extends BaseCommand{['name']='llm:projects';['description']=a30_0x3f5e91(0x165);async['execute'](_0x64442b){const _0x439226=a30_0x3f5e91,{options:_0x455361,args:_0x37352d,tdx:_0x5d652b}=_0x64442b,_0x22bea1=getChalk(_0x455361),_0x4b85a3=_0x455361[_0x439226(0x1c4)];try{const _0x15f422=_0x37352d[0x0],_0x3d2df5=resolveLimit(_0x455361[_0x439226(0x189)],DEFAULT_LLM_LIMIT),_0xe1c941=await withSpinner(_0x439226(0x10a),()=>_0x5d652b[_0x439226(0x1aa)][_0x439226(0x1b2)](_0x3d2df5),{'verbose':_0x455361[_0x439226(0x141)]});let _0x717c6c=_0xe1c941[_0x439226(0x159)];_0x15f422&&(_0x717c6c=_0xe1c941[_0x439226(0x159)][_0x439226(0x140)](_0x222adf=>matchGlobPattern(_0x222adf[_0x439226(0x13e)]['name'],_0x15f422)));const _0x3f4a2c=_0x455361[_0x439226(0x112)]==='json'||_0x455361[_0x439226(0x112)]==='jsonl'||_0x455361[_0x439226(0x112)]===_0x439226(0x1c5)||_0x455361[_0x439226(0x112)]===_0x439226(0x106);if(_0x3f4a2c){const _0x24181e=_0x717c6c[_0x439226(0x148)](_0x53d81a=>({...toLLMProjectInfo(_0x53d81a),'url':getLLMProjectUrl(_0x4b85a3,_0x53d81a['id'])}));await handleSDKOutput(_0x24181e,_0x455361);}else{const _0x3f7f66=[];if(_0x717c6c[_0x439226(0x12e)]===0x0)_0x3f7f66['push'](_0x22bea1[_0x439226(0x11e)]('No\x20projects\x20found'));else{const _0xa6f5a8=[..._0x717c6c][_0x439226(0x1a1)]((_0x4680ff,_0x109f89)=>_0x4680ff[_0x439226(0x13e)][_0x439226(0x1ce)][_0x439226(0x1cb)](_0x109f89[_0x439226(0x13e)][_0x439226(0x1ce)]));for(const _0x424763 of _0xa6f5a8){const _0x43346a=getLLMProjectUrl(_0x4b85a3,_0x424763['id']),_0x1c8b3e=hyperlink(_0x424763[_0x439226(0x13e)][_0x439226(0x1ce)],_0x43346a);_0x3f7f66['push'](_0x439226(0x118)+_0x1c8b3e);}_0x3f7f66[_0x439226(0x190)](_0x22bea1[_0x439226(0x11e)](_0x717c6c[_0x439226(0x12e)]+'\x20project(s)'));}await writeOutput(_0x3f7f66['join']('\x0a'),_0x455361[_0x439226(0x11f)],_0x439226(0x1c5));}return 0x0;}catch(_0x4e6d49){return handleSDKError(_0x4e6d49,_0x455361),0x1;}}}export class LLMAgentsCommand extends BaseCommand{['name']='llm:agents';['description']=a30_0x3f5e91(0x1c0);async[a30_0x3f5e91(0x1b6)](_0x192d52){const _0x3b5e7b=a30_0x3f5e91,{options:_0x160ec3,args:_0x275d5c,tdx:_0x47f53f}=_0x192d52,_0x2dcd01=getChalk(_0x160ec3),_0x45f1a2=_0x160ec3[_0x3b5e7b(0x1c4)];try{const _0x5d6261=_0x275d5c[0x0];let _0x431fdc=_0x5d6261,_0x46fe56,_0x5b2070;if(_0x5d6261&&_0x5d6261[_0x3b5e7b(0x14a)]('/')){const _0x32ebe0=_0x5d6261[_0x3b5e7b(0x18d)]('/');if(_0x32ebe0['length']===0x2){const [_0x577e15,_0x2c1454]=_0x32ebe0,_0x460426=await _0x47f53f[_0x3b5e7b(0x1aa)][_0x3b5e7b(0x1b2)](),_0x17b5c5=_0x460426[_0x3b5e7b(0x197)](_0x21934e=>_0x21934e[_0x3b5e7b(0x13e)]['name'][_0x3b5e7b(0x15f)]()===_0x577e15[_0x3b5e7b(0x15f)]());if(!_0x17b5c5)throw new SDKError(ErrorCode[_0x3b5e7b(0x152)],'Project\x20not\x20found:\x20'+_0x577e15,undefined,{'helpText':'Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.'});_0x46fe56=_0x17b5c5['id'],_0x5b2070=_0x17b5c5[_0x3b5e7b(0x13e)][_0x3b5e7b(0x1ce)],_0x431fdc=_0x2c1454;}else throw new SDKError(ErrorCode[_0x3b5e7b(0x167)],_0x3b5e7b(0x117)+_0x5d6261,undefined,{'helpText':'Use\x20format:\x20project-name/agent-name'});}else{const _0x11dce9=await getProjectWithName(_0x192d52);_0x46fe56=_0x11dce9['id'],_0x5b2070=_0x11dce9[_0x3b5e7b(0x1ce)];}const _0x8ce25d=await withSpinner(_0x3b5e7b(0x137),()=>_0x47f53f[_0x3b5e7b(0x1aa)]['agents'](_0x46fe56),{'verbose':_0x160ec3[_0x3b5e7b(0x141)]});let _0x5b9bc3=_0x8ce25d['data'];_0x431fdc&&(_0x5b9bc3=_0x8ce25d[_0x3b5e7b(0x159)][_0x3b5e7b(0x140)](_0x129997=>matchGlobPattern(_0x129997[_0x3b5e7b(0x13e)][_0x3b5e7b(0x1ce)],_0x431fdc)));const _0x149b81=_0x160ec3[_0x3b5e7b(0x112)]==='json'||_0x160ec3[_0x3b5e7b(0x112)]==='jsonl'||_0x160ec3[_0x3b5e7b(0x112)]===_0x3b5e7b(0x1c5)||_0x160ec3['format']===_0x3b5e7b(0x106);if(_0x149b81){const _0x1cbe2b=_0x5b9bc3[_0x3b5e7b(0x148)](_0x5082a7=>({...toAgentInfo(_0x5082a7),'chatUrl':getLLMAgentChatUrl(_0x45f1a2,_0x46fe56,_0x5082a7['id'])}));await handleSDKOutput(_0x1cbe2b,_0x160ec3);}else{const _0x10a579=[];_0x10a579[_0x3b5e7b(0x190)](_0x2dcd01['dim']('['+_0x5b2070+']'));if(_0x5b9bc3[_0x3b5e7b(0x12e)]===0x0)_0x10a579['push'](_0x2dcd01[_0x3b5e7b(0x11e)](_0x3b5e7b(0x156)));else{const _0x12d6e6=[..._0x5b9bc3][_0x3b5e7b(0x1a1)]((_0x3417c0,_0x23c9c8)=>_0x3417c0[_0x3b5e7b(0x13e)][_0x3b5e7b(0x1ce)][_0x3b5e7b(0x1cb)](_0x23c9c8[_0x3b5e7b(0x13e)][_0x3b5e7b(0x1ce)]));for(const _0xae2692 of _0x12d6e6){const _0x5c6d79=getLLMAgentChatUrl(_0x45f1a2,_0x46fe56,_0xae2692['id']),_0x1f8a12=hyperlink(_0xae2692[_0x3b5e7b(0x13e)][_0x3b5e7b(0x1ce)],_0x5c6d79);_0x10a579[_0x3b5e7b(0x190)](_0x3b5e7b(0x124)+_0x1f8a12);}_0x10a579[_0x3b5e7b(0x190)](_0x2dcd01[_0x3b5e7b(0x11e)](_0x5b9bc3['length']+_0x3b5e7b(0x1c7)));}await writeOutput(_0x10a579[_0x3b5e7b(0x1c2)]('\x0a'),_0x160ec3[_0x3b5e7b(0x11f)],_0x3b5e7b(0x1c5));}return 0x0;}catch(_0x5d4432){return handleSDKError(_0x5d4432,_0x160ec3),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]='llm:agent:show';[a30_0x3f5e91(0x146)]=a30_0x3f5e91(0x1a4);async[a30_0x3f5e91(0x1b6)](_0x132e26){const _0x2f8165=a30_0x3f5e91,{options:_0xfeb42b,args:_0x2b5fe3,tdx:_0x532b23}=_0x132e26;if(_0x2b5fe3[_0x2f8165(0x12e)]===0x0)return console[_0x2f8165(0x1bf)]('Error:\x20Agent\x20name\x20is\x20required'),console[_0x2f8165(0x1bf)](_0x2f8165(0x181)),0x1;const _0x5d79c6=_0x2b5fe3[0x0];try{const _0xefe06d=await getProjectIdOrDefault(_0x132e26),_0x352747=await withSpinner(_0x2f8165(0x18a)+_0x5d79c6+_0x2f8165(0x150),()=>_0x532b23['llm']['resolveAgentId'](_0x5d79c6,_0xefe06d),{'verbose':_0xfeb42b[_0x2f8165(0x141)]}),_0x5e767c=await withSpinner(_0x2f8165(0x191),()=>_0x532b23[_0x2f8165(0x1aa)][_0x2f8165(0x1c1)](_0x352747['data']),{'verbose':_0xfeb42b[_0x2f8165(0x141)]});return await handleSDKOutput([_0x5e767c[_0x2f8165(0x159)]],_0xfeb42b),0x0;}catch(_0x1c2f8c){return handleSDKError(_0x1c2f8c,_0xfeb42b),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{['name']=a30_0x3f5e91(0x133);[a30_0x3f5e91(0x146)]='Create\x20a\x20new\x20agent\x20in\x20current\x20project';async[a30_0x3f5e91(0x1b6)](_0x189287){const _0x47cec2=a30_0x3f5e91,{options:_0x493ef2,args:_0x3fade0,tdx:_0x1034d8}=_0x189287;if(_0x3fade0[_0x47cec2(0x12e)]===0x0)return console['error']('Error:\x20Agent\x20name\x20is\x20required'),console[_0x47cec2(0x1bf)]('Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x446efc=_0x3fade0[0x0],_0x337e03=_0x493ef2,_0x1364a1=_0x337e03['systemPrompt'],_0x439e90=_0x337e03['model']||_0x47cec2(0x176),_0x22c9ed=_0x337e03[_0x47cec2(0x114)],_0x57ae31=_0x337e03['maxToolIterations']?Number(_0x337e03[_0x47cec2(0x160)]):undefined,_0x3eb7e1=_0x337e03[_0x47cec2(0x1d0)]?Number(_0x337e03[_0x47cec2(0x1d0)]):undefined;try{let _0x5e994b,_0x400c08;if(_0x446efc[_0x47cec2(0x14a)]('/')){const _0x1a71f0=_0x446efc[_0x47cec2(0x18d)]('/');if(_0x1a71f0[_0x47cec2(0x12e)]===0x2){const [_0x1a1b2f,_0x2679e4]=_0x1a71f0,_0x17467b=await withSpinner(_0x47cec2(0x13a)+_0x1a1b2f+'\x27...',()=>_0x1034d8[_0x47cec2(0x1aa)][_0x47cec2(0x1c8)](_0x1a1b2f),{'verbose':_0x493ef2[_0x47cec2(0x141)]});_0x5e994b=_0x17467b[_0x47cec2(0x159)],_0x400c08=_0x2679e4;}else throw new SDKError(ErrorCode[_0x47cec2(0x167)],_0x47cec2(0x117)+_0x446efc,undefined,{'helpText':_0x47cec2(0x109)});}else _0x5e994b=await getProjectIdOrDefault(_0x189287),_0x400c08=_0x446efc;const _0x525f93=await withSpinner(_0x47cec2(0x1a3)+_0x400c08+_0x47cec2(0x150),()=>_0x1034d8[_0x47cec2(0x1aa)][_0x47cec2(0x1d7)]({'name':_0x400c08,'projectId':_0x5e994b,'modelType':_0x439e90,'systemPrompt':_0x1364a1,'starterMessage':_0x22c9ed,'maxToolIterations':_0x57ae31,'temperature':_0x3eb7e1}),{'verbose':_0x493ef2[_0x47cec2(0x141)]});return console[_0x47cec2(0x138)](_0x47cec2(0x19a)+_0x525f93['data']['id']),await handleSDKOutput([_0x525f93[_0x47cec2(0x159)]],_0x493ef2),0x0;}catch(_0x1c4cfd){return handleSDKError(_0x1c4cfd,_0x493ef2),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]=a30_0x3f5e91(0x125);[a30_0x3f5e91(0x146)]='Update\x20an\x20existing\x20agent';async['execute'](_0x2b97e0){const _0x36494a=a30_0x3f5e91,{options:_0x1ffbcc,args:_0x48b581,tdx:_0x2d9346}=_0x2b97e0;if(_0x48b581['length']===0x0)return console['error'](_0x36494a(0x15a)),console[_0x36494a(0x1bf)](_0x36494a(0x18e)),0x1;const _0x18390b=_0x48b581[0x0],_0x4b0230=_0x1ffbcc,_0x9b8df9=_0x4b0230['name'],_0x459ef1=_0x4b0230[_0x36494a(0x101)],_0x379487=_0x4b0230[_0x36494a(0x146)],_0xee6707=_0x4b0230[_0x36494a(0x114)];if(!_0x9b8df9&&!_0x459ef1&&!_0x379487&&!_0xee6707)return console[_0x36494a(0x1bf)](_0x36494a(0x128)),console[_0x36494a(0x1bf)]('Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message'),0x1;try{const _0xb023f5=await getProjectIdOrDefault(_0x2b97e0),_0xa60144=await withSpinner(_0x36494a(0x18a)+_0x18390b+'\x27...',()=>_0x2d9346['llm']['resolveAgentId'](_0x18390b,_0xb023f5),{'verbose':_0x1ffbcc[_0x36494a(0x141)]}),_0x605416=_0xa60144[_0x36494a(0x159)],_0x3386ad=await withSpinner(_0x36494a(0x18c),()=>_0x2d9346[_0x36494a(0x1aa)][_0x36494a(0x182)](_0x605416,{'name':_0x9b8df9,'prompt':_0x459ef1,'description':_0x379487,'starterMessage':_0xee6707}),{'verbose':_0x1ffbcc['verbose']});return console[_0x36494a(0x138)]('Agent\x20updated:\x20'+_0x3386ad[_0x36494a(0x159)]['id']),await handleSDKOutput([_0x3386ad[_0x36494a(0x159)]],_0x1ffbcc),0x0;}catch(_0x43adca){return handleSDKError(_0x43adca,_0x1ffbcc),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]=a30_0x3f5e91(0x1cc);[a30_0x3f5e91(0x146)]=a30_0x3f5e91(0x12c);async[a30_0x3f5e91(0x1b6)](_0x540e57){const _0x4d385a=a30_0x3f5e91,{options:_0x4bbe45,args:_0xe76617,tdx:_0x20ba7d}=_0x540e57;if(_0xe76617[_0x4d385a(0x12e)]===0x0)return console[_0x4d385a(0x1bf)](_0x4d385a(0x15a)),console[_0x4d385a(0x1bf)](_0x4d385a(0x1b9)),0x1;const _0x59808d=_0xe76617[0x0];try{const _0x1fbe22=await getProjectIdOrDefault(_0x540e57),_0xf88732=await withSpinner(_0x4d385a(0x18a)+_0x59808d+_0x4d385a(0x150),()=>_0x20ba7d[_0x4d385a(0x1aa)]['resolveAgentId'](_0x59808d,_0x1fbe22),{'verbose':_0x4bbe45[_0x4d385a(0x141)]}),_0x5f5ddb=_0xf88732[_0x4d385a(0x159)];return await withSpinner('Deleting\x20agent...',()=>_0x20ba7d[_0x4d385a(0x1aa)][_0x4d385a(0x126)](_0x5f5ddb),{'verbose':_0x4bbe45[_0x4d385a(0x141)]}),console[_0x4d385a(0x138)](_0x4d385a(0x153)+_0x5f5ddb),0x0;}catch(_0x22f5b3){return handleSDKError(_0x22f5b3,_0x4bbe45),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]=a30_0x3f5e91(0x1a5);['description']=a30_0x3f5e91(0x1a8);async['execute'](_0x42d886){const _0x16b25b=a30_0x3f5e91;return executeChatHistoryCommand(_0x42d886,_0x16b25b(0x188));}}export class LLMUseCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]=a30_0x3f5e91(0x1df);[a30_0x3f5e91(0x146)]=a30_0x3f5e91(0x1a0);async['execute'](_0x5199f6){const _0x512950=a30_0x3f5e91,{options:_0x4d050e,args:_0x5d57fb,tdx:_0xe99024}=_0x5199f6;if(_0x5d57fb['length']===0x0)return console[_0x512950(0x1bf)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x512950(0x1bf)]('Usage:\x20tdx\x20llm\x20use\x20<project-name>'),0x1;const _0x38dc83=_0x5d57fb[0x0];try{await withSpinner(_0x512950(0x1db)+_0x38dc83+_0x512950(0x150),()=>_0xe99024[_0x512950(0x1aa)][_0x512950(0x1af)](_0x38dc83),{'verbose':_0x4d050e['verbose']}),saveSessionContext({'llm_project':_0x38dc83},_0x4d050e['session']);const _0x1593a8=getChalk(_0x4d050e);return console[_0x512950(0x138)](_0x512950(0x130)+_0x1593a8[_0x512950(0x192)](_0x38dc83)),0x0;}catch(_0x29c0ea){return handleSDKError(_0x29c0ea,_0x4d050e),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]=a30_0x3f5e91(0x134);['description']=a30_0x3f5e91(0x120);async['execute'](_0x5496ad){const _0x4ea100=a30_0x3f5e91,{options:_0x4ddc47,args:_0x578247,tdx:_0x28ed95}=_0x5496ad;if(_0x578247['length']===0x0)return console['error'](_0x4ea100(0x1a2)),console['error']('Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]'),0x1;const _0x203f37=_0x578247[0x0],_0x301182=_0x4ddc47,_0x137439=_0x301182[_0x4ea100(0x146)];try{const _0x5873ef=await withSpinner('Creating\x20project\x20\x27'+_0x203f37+_0x4ea100(0x150),()=>_0x28ed95[_0x4ea100(0x1aa)]['createProject']({'name':_0x203f37,'description':_0x137439}),{'verbose':_0x4ddc47[_0x4ea100(0x141)]});console[_0x4ea100(0x138)](_0x4ea100(0x15d)+_0x5873ef[_0x4ea100(0x159)]['id']);const _0xe60fab=toLLMProjectInfo(_0x5873ef[_0x4ea100(0x159)]);return await handleSDKOutput([_0xe60fab],_0x4ddc47),0x0;}catch(_0x289fc7){return handleSDKError(_0x289fc7,_0x4ddc47),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]='llm:project:delete';['description']='Delete\x20an\x20LLM\x20project';async[a30_0x3f5e91(0x1b6)](_0x391c40){const _0x45ec4f=a30_0x3f5e91,{options:_0x5c584d,args:_0x12c8f6,tdx:_0x54e69c}=_0x391c40;if(_0x12c8f6[_0x45ec4f(0x12e)]===0x0)return console[_0x45ec4f(0x1bf)](_0x45ec4f(0x1a2)),console['error'](_0x45ec4f(0x144)),0x1;const _0xdc142e=_0x12c8f6[0x0];try{return await withSpinner(_0x45ec4f(0x135)+_0xdc142e+_0x45ec4f(0x150),()=>_0x54e69c[_0x45ec4f(0x1aa)][_0x45ec4f(0x105)](_0xdc142e),{'verbose':_0x5c584d[_0x45ec4f(0x141)]}),console[_0x45ec4f(0x138)](_0x45ec4f(0x119)+_0xdc142e),0x0;}catch(_0x183010){return handleSDKError(_0x183010,_0x5c584d),0x1;}}}export class LLMProjectBackupCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]=a30_0x3f5e91(0x10d);[a30_0x3f5e91(0x146)]=a30_0x3f5e91(0x1e1);async['execute'](_0x3fdcfc){const _0xcc55f2=a30_0x3f5e91,{options:_0x2c3230,args:_0x322266,tdx:_0x3e731f}=_0x3fdcfc,_0x3e4747=getChalk(_0x2c3230);console['log'](_0x3e4747[_0xcc55f2(0x186)](_0xcc55f2(0x19b))),console[_0xcc55f2(0x138)](_0x3e4747[_0xcc55f2(0x186)](_0xcc55f2(0x1b4))),console[_0xcc55f2(0x138)](_0x3e4747['dim']('\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents')),console['log']();if(_0x322266[_0xcc55f2(0x12e)]===0x0)return console[_0xcc55f2(0x1bf)]('Error:\x20Project\x20name\x20is\x20required'),console[_0xcc55f2(0x1bf)](_0xcc55f2(0x104)),0x1;const _0x1a14ac=_0x322266[0x0],_0x26599e=_0x2c3230,_0x2a76b3=_0x26599e['output'],_0x4a2c7b=_0x26599e['dryRun'];try{const _0xe3402b=_0x2a76b3||_0x1a14ac+'.llm';if(a30_0x119a70[_0xcc55f2(0x16e)](_0xe3402b)&&!_0x4a2c7b){if(!_0x2c3230[_0xcc55f2(0x14d)]){const _0x3ae96e=await confirm(_0xcc55f2(0x1d8)+_0xe3402b+_0xcc55f2(0x14c));if(!_0x3ae96e)return console[_0xcc55f2(0x138)](_0xcc55f2(0x1b1)),0x0;}a30_0x119a70['rmSync'](_0xe3402b,{'recursive':!![]});}const _0xf7b439=await withSpinner(_0x4a2c7b?_0xcc55f2(0x1bd)+_0x1a14ac+_0xcc55f2(0x150):_0xcc55f2(0x1d3)+_0x1a14ac+_0xcc55f2(0x150),()=>_0x3e731f[_0xcc55f2(0x1aa)][_0xcc55f2(0x168)](_0x1a14ac,_0x2a76b3,{'dryRun':_0x4a2c7b}),{'verbose':_0x2c3230[_0xcc55f2(0x141)]}),_0x5a0ace=_0xf7b439[_0xcc55f2(0x159)];return _0x4a2c7b?console['log'](_0xcc55f2(0x11a)+_0x5a0ace[_0xcc55f2(0x1c3)]):console[_0xcc55f2(0x138)](_0xcc55f2(0x108)+_0x5a0ace[_0xcc55f2(0x1c3)]),console[_0xcc55f2(0x138)](_0xcc55f2(0x16f)+_0x5a0ace[_0xcc55f2(0x19c)]['agents']),console[_0xcc55f2(0x138)](_0xcc55f2(0x10f)+_0x5a0ace[_0xcc55f2(0x19c)]['knowledgeBases']),console[_0xcc55f2(0x138)](_0xcc55f2(0x1b3)+_0x5a0ace['counts'][_0xcc55f2(0x1b0)]),console[_0xcc55f2(0x138)](_0xcc55f2(0x13d)+_0x5a0ace[_0xcc55f2(0x19c)][_0xcc55f2(0x17c)]),(_0x2c3230['format']===_0xcc55f2(0x11b)||_0x2c3230[_0xcc55f2(0x112)]===_0xcc55f2(0x180))&&await handleSDKOutput([_0x5a0ace],_0x2c3230),0x0;}catch(_0x3786e3){return handleSDKError(_0x3786e3,_0x2c3230),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]='llm:project:restore';[a30_0x3f5e91(0x146)]=a30_0x3f5e91(0x129);async[a30_0x3f5e91(0x1b6)](_0x378bb2){const _0x1f62d1=a30_0x3f5e91,{options:_0x875098,args:_0x144b9a,tdx:_0x414d59}=_0x378bb2,_0x135d7f=getChalk(_0x875098);console[_0x1f62d1(0x138)](_0x135d7f[_0x1f62d1(0x186)](_0x1f62d1(0x1a6))),console[_0x1f62d1(0x138)](_0x135d7f[_0x1f62d1(0x186)](_0x1f62d1(0x199))),console[_0x1f62d1(0x138)](_0x135d7f['dim'](_0x1f62d1(0x127))),console[_0x1f62d1(0x138)](_0x135d7f[_0x1f62d1(0x11e)](_0x1f62d1(0x163))),console[_0x1f62d1(0x138)](_0x135d7f[_0x1f62d1(0x11e)](_0x1f62d1(0x174))),console[_0x1f62d1(0x138)]();if(_0x144b9a[_0x1f62d1(0x12e)]===0x0)return console['error'](_0x1f62d1(0x1a9)),console[_0x1f62d1(0x1bf)](_0x1f62d1(0x131)),0x1;const _0x29e7e2=_0x144b9a[0x0],_0x41974c=_0x875098,_0x1d9ba5=_0x41974c['name'],_0x40127c=_0x41974c[_0x1f62d1(0x170)];try{if(!_0x40127c){const _0x41ec9f=_0x414d59[_0x1f62d1(0x1aa)][_0x1f62d1(0x142)](_0x29e7e2),_0x4f0d0c=_0x1d9ba5||_0x41ec9f['exportedFrom'][_0x1f62d1(0x1d4)],_0xa216cf=await withSpinner(_0x1f62d1(0x183),()=>_0x414d59[_0x1f62d1(0x1aa)][_0x1f62d1(0x1b2)](),{'verbose':_0x875098['verbose']}),_0x5ac6f9=_0xa216cf['data'][_0x1f62d1(0x197)](_0x57a24b=>_0x57a24b['attributes'][_0x1f62d1(0x1ce)]===_0x4f0d0c);if(_0x5ac6f9&&!_0x875098['yes']){const _0x3e0113=await confirm(_0x1f62d1(0x10b)+_0x4f0d0c+'\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?');if(!_0x3e0113)return console[_0x1f62d1(0x138)](_0x1f62d1(0x13f)),0x0;}}const _0xca5c4a=await withSpinner(_0x40127c?_0x1f62d1(0x17e)+_0x29e7e2+_0x1f62d1(0x150):_0x1f62d1(0x1cd)+_0x29e7e2+_0x1f62d1(0x150),()=>_0x414d59[_0x1f62d1(0x1aa)][_0x1f62d1(0x179)](_0x29e7e2,{'name':_0x1d9ba5,'dryRun':_0x40127c}),{'verbose':_0x875098[_0x1f62d1(0x141)]}),_0x3237e4=_0xca5c4a[_0x1f62d1(0x159)];return _0x3237e4[_0x1f62d1(0x184)]&&console[_0x1f62d1(0x138)](_0x1f62d1(0x158)+_0x3237e4[_0x1f62d1(0x184)]+'\x27'),_0x40127c?console[_0x1f62d1(0x138)](_0x1f62d1(0x12f)+_0x3237e4[_0x1f62d1(0x1d4)]):console[_0x1f62d1(0x138)]('Project\x20restored:\x20'+_0x3237e4[_0x1f62d1(0x1d4)]+'\x20('+_0x3237e4['projectId']+')'),console[_0x1f62d1(0x138)](_0x1f62d1(0x16f)+_0x3237e4['counts'][_0x1f62d1(0x1d2)]),console[_0x1f62d1(0x138)](_0x1f62d1(0x10f)+_0x3237e4['counts'][_0x1f62d1(0x15b)]),console[_0x1f62d1(0x138)](_0x1f62d1(0x1b3)+_0x3237e4[_0x1f62d1(0x19c)][_0x1f62d1(0x1b0)]),console[_0x1f62d1(0x138)](_0x1f62d1(0x13d)+_0x3237e4[_0x1f62d1(0x19c)][_0x1f62d1(0x17c)]),(_0x875098['format']===_0x1f62d1(0x11b)||_0x875098[_0x1f62d1(0x112)]===_0x1f62d1(0x180))&&await handleSDKOutput([_0x3237e4],_0x875098),0x0;}catch(_0x3aee26){return handleSDKError(_0x3aee26,_0x875098),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;async function selectChatInteractively(_0x383dd0,_0x44046a){const _0x3735bd=a30_0x3f5e91,_0x2f05f8=_0x44046a[_0x3735bd(0x189)]||CHAT_SELECTOR_PAGE_SIZE;let _0xe93561=0x0,_0x29df33=[];const _0x531248=(await import(_0x3735bd(0x1b0)))[_0x3735bd(0x19f)],_0x134cf2=getChalk(_0x44046a);while(!![]){const _0x261379=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0x383dd0['llm'][_0x3735bd(0x196)](_0x2f05f8+_0xe93561),{'verbose':_0x44046a[_0x3735bd(0x141)]});_0x29df33=_0x261379['data'];const _0x86f8d0=_0x29df33[_0x3735bd(0x169)](_0xe93561,_0xe93561+_0x2f05f8),_0x64303b=_0x29df33[_0x3735bd(0x12e)]>_0xe93561+_0x2f05f8,_0x52cfbc=[...new Set(_0x86f8d0['map'](_0x5ac211=>_0x5ac211[_0x3735bd(0x13e)][_0x3735bd(0x145)])[_0x3735bd(0x140)](_0x12c79a=>_0x12c79a!==undefined))],_0x4bd9c7=new Map();await Promise[_0x3735bd(0x16c)](_0x52cfbc[_0x3735bd(0x148)](async _0x35a9f1=>{const _0x229e77=_0x3735bd;try{const _0x214844=await _0x383dd0['llm'][_0x229e77(0x1c1)](_0x35a9f1);_0x4bd9c7['set'](_0x35a9f1,_0x214844[_0x229e77(0x13e)][_0x229e77(0x1ce)]);}catch{_0x4bd9c7[_0x229e77(0x139)](_0x35a9f1,_0x35a9f1);}}));const _0x3c09a4=_0x86f8d0[_0x3735bd(0x148)](_0x6aafed=>{const _0x3b231f=_0x3735bd,_0x13804e=_0x6aafed[_0x3b231f(0x13e)][_0x3b231f(0x155)]||_0x3b231f(0x14b),_0x30820b=_0x13804e[_0x3b231f(0x18d)]('\x0a')[0x0],_0x39f38b=_0x30820b[_0x3b231f(0x12e)]>0x50?_0x30820b[_0x3b231f(0x195)](0x0,0x4d)+_0x3b231f(0x147):_0x30820b,_0x4ac811=_0x6aafed[_0x3b231f(0x13e)]['agentId']?_0x4bd9c7[_0x3b231f(0x193)](_0x6aafed[_0x3b231f(0x13e)][_0x3b231f(0x145)])||_0x6aafed[_0x3b231f(0x13e)][_0x3b231f(0x145)]:'(no\x20agent)',_0xf5cb9a=_0x6aafed['attributes']['lastConversationAt']||_0x6aafed[_0x3b231f(0x13e)][_0x3b231f(0x1b7)],_0x542d39=new Date(_0xf5cb9a),_0x47916a=new Date(),_0x41ebb3=_0x47916a[_0x3b231f(0x1ad)]()-_0x542d39['getTime'](),_0x1bdeb0=Math[_0x3b231f(0x12b)](_0x41ebb3/0xea60),_0x4572a2=Math[_0x3b231f(0x12b)](_0x41ebb3/0x36ee80),_0x11228a=Math['floor'](_0x41ebb3/0x5265c00);let _0x2d6dd0;if(_0x1bdeb0<0x1)_0x2d6dd0=_0x3b231f(0x161);else{if(_0x1bdeb0<0x3c)_0x2d6dd0=_0x1bdeb0+_0x3b231f(0x18f);else{if(_0x4572a2<0x18)_0x2d6dd0=_0x4572a2+_0x3b231f(0x1be);else _0x11228a<0x7?_0x2d6dd0=_0x11228a+_0x3b231f(0x1d1):_0x2d6dd0=_0x542d39[_0x3b231f(0x121)](_0x3b231f(0x102),{'month':_0x3b231f(0x1dd),'day':_0x3b231f(0x103)});}}return{'title':_0x39f38b+'\x20'+_0x134cf2[_0x3b231f(0x11e)]('['+_0x4ac811+']\x20'+_0x2d6dd0),'value':_0x6aafed['id']};});_0x64303b&&_0x3c09a4[_0x3735bd(0x190)]({'title':_0x134cf2[_0x3735bd(0x1a7)](_0x3735bd(0x171)),'value':_0x3735bd(0x115)});const _0x161492=await _0x531248({'type':_0x3735bd(0x13b),'name':_0x3735bd(0x177),'message':_0x3735bd(0x17b),'choices':_0x3c09a4,'hint':_0x3735bd(0x12d)});if(!_0x161492[_0x3735bd(0x177)])return undefined;if(_0x161492[_0x3735bd(0x177)]==='__load_more__'){_0xe93561+=_0x2f05f8;continue;}return _0x161492[_0x3735bd(0x177)];}}function a30_0x19b6(){const _0x5ca86b=['[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27','data','Error:\x20Agent\x20name\x20is\x20required','knowledgeBases','\x20\x20Cause:\x20','Project\x20created:\x20','[image]\x20\x20','toLowerCase','maxToolIterations','just\x20now','[input]\x20\x20','\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/','image','List\x20all\x20LLM\x20projects','llm:log','INVALID_ARGUMENT','backupProject','slice','createdAt','Error:\x20','all','No\x20messages\x20found\x20in\x20chat\x20history.','existsSync','\x20\x20Agents:\x20','dryRun','Load\x20more...','71431CGiASL','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','[unknown]','claude-4.5-haiku','chatId','history','restoreProject','keys','Select\x20a\x20chat\x20session:','integrations','content','Validating\x20backup\x20from\x20\x27','\x20-\x20','jsonl','Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>','updateAgent','Checking\x20for\x20existing\x20projects...','sourceSite','153848HNqcgI','yellow','last','tdx\x20llm\x20history','limit','Resolving\x20agent\x20\x27','magenta','Updating\x20agent...','split','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','m\x20ago','push','Fetching\x20agent...','green','get','targetWebSearchTool','substring','chats','find','\x20->\x20ImageGen:','\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.','Agent\x20created:\x20','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.','counts','stringify','bold','default','Set\x20current\x20project\x20context','sort','Error:\x20Project\x20name\x20is\x20required','Creating\x20agent\x20\x27','Show\x20agent\x20details','llm:history','⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.','cyan','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','Error:\x20Backup\x20folder\x20path\x20is\x20required','llm','entries','llmProject','getTime','Fetching\x20most\x20recent\x20chat...','setCurrentProject','prompts','Backup\x20cancelled.','projects','\x20\x20Prompts:\x20','\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.','1119328VXApdE','execute','updatedAt','1645272dkRmvG','Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>','red','message','Fetching\x20chat\x20log\x20for\x20\x27','Analyzing\x20project\x20\x27','h\x20ago','error','List\x20agents\x20in\x20current\x20project','agent','join','outputDir','site','table','\x20→\x20chat:\x20','\x20agent(s)','resolveProjectId','\x20->\x20Agent:','1561150VyPlZv','localeCompare','llm:agent:delete','Restoring\x20project\x20from\x20\x27','name','[tool_call]','temperature','d\x20ago','agents','Backing\x20up\x20project\x20\x27','projectName','Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history','[output]\x20','createAgent','Output\x20directory\x20\x27','tool','Usage:\x20TDX_EXPERIMENTAL=true\x20tdx\x20llm\x20log\x20<chat-id>','Setting\x20project\x20context\x20to\x20\x27','blue','short','9zUgRxw','llm:use','input','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)','prompt','en-US','numeric','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','deleteProject','tsv','models','Project\x20backed\x20up\x20to:\x20','Use\x20format:\x20project-name/agent-name','Fetching\x20projects...','A\x20project\x20named\x20\x27','string','llm:project:backup','933240zabpAU','\x20\x20Knowledge\x20Bases:\x20','[content]','targetKnowledgeBase','format','tool_call','starterMessage','__load_more__','tdx\x20chats','Invalid\x20path\x20syntax:\x20','⚒️\x20','Project\x20deleted:\x20','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','json','Error:\x20chat-id\x20is\x20required','Getting\x20default\x20project...','dim','output','Create\x20a\x20new\x20LLM\x20project','toLocaleDateString','2116254puqmsz','Fetching\x20chat\x20sessions...','🤖\x20','llm:agent:update','deleteAgent','\x20\x20\x20Examples:','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','cause','floor','Delete\x20an\x20agent','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','length','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','Session\x20llm_project\x20set\x20to:\x20','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','stack','llm:agent:create','llm:project:create','Deleting\x20project\x20\x27','\x20->\x20WebSearch:','Fetching\x20agents...','log','set','Resolving\x20project\x20\x27','select','\x0aStack\x20trace:','\x20\x20Integrations:\x20','attributes','Restore\x20cancelled.','filter','verbose','getBackupMetadata','15SxqusQ','Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>','agentId','description','...','map','targetImageGenerator','includes','(no\x20message)','\x27\x20already\x20exists.\x20Overwrite?','yes','targetAgent','getCurrentProject','\x27...','Show\x20chat\x20log','LLM_PROJECT_NOT_FOUND','Agent\x20deleted:\x20','Unknown','firstInputContent','No\x20agents\x20found','\x20->\x20KB:'];a30_0x19b6=function(){return _0x5ca86b;};return a30_0x19b6();}export class ChatsCommand extends BaseCommand{['name']=a30_0x3f5e91(0x196);[a30_0x3f5e91(0x146)]=a30_0x3f5e91(0x1d5);async[a30_0x3f5e91(0x1b6)](_0x45155a){const _0x14e193=a30_0x3f5e91;return executeChatHistoryCommand(_0x45155a,_0x14e193(0x116));}}export class LLMLogCommand extends BaseCommand{[a30_0x3f5e91(0x1ce)]=a30_0x3f5e91(0x166);[a30_0x3f5e91(0x146)]=a30_0x3f5e91(0x151);async[a30_0x3f5e91(0x1b6)](_0x3ba5d3){const _0x4f1388=a30_0x3f5e91,{options:_0x1576d8,args:_0xfea022,tdx:_0x150e99}=_0x3ba5d3,_0x477f2b=_0xfea022[0x0];if(!_0x477f2b)return console[_0x4f1388(0x1bf)](_0x4f1388(0x11c)),console['error'](_0x4f1388(0x1da)),0x1;const _0x242d2e=await withSpinner(_0x4f1388(0x1bc)+_0x477f2b+_0x4f1388(0x150),()=>_0x150e99[_0x4f1388(0x1aa)]['getChatLog'](_0x477f2b),{'verbose':_0x1576d8[_0x4f1388(0x141)]});return await handleSDKOutput(_0x242d2e[_0x4f1388(0x159)]['data'],_0x1576d8),0x0;}}
|
|
1
|
+
const a30_0x238769=a30_0x590e;(function(_0x536e41,_0x32d4ab){const _0x519b49=a30_0x590e,_0x2e196e=_0x536e41();while(!![]){try{const _0x32ba2a=-parseInt(_0x519b49(0x207))/0x1+-parseInt(_0x519b49(0x231))/0x2+parseInt(_0x519b49(0x294))/0x3+-parseInt(_0x519b49(0x1c8))/0x4+parseInt(_0x519b49(0x223))/0x5+parseInt(_0x519b49(0x210))/0x6+parseInt(_0x519b49(0x22f))/0x7*(parseInt(_0x519b49(0x246))/0x8);if(_0x32ba2a===_0x32d4ab)break;else _0x2e196e['push'](_0x2e196e['shift']());}catch(_0x25fb29){_0x2e196e['push'](_0x2e196e['shift']());}}}(a30_0x3e61,0xc2afe));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 a30_0x2f3340 from'node:fs';function handleSDKError(_0x320a7c,_0x34b8dd){const _0x252aaf=a30_0x590e;if(_0x320a7c instanceof SDKError)console[_0x252aaf(0x21e)](_0x252aaf(0x25a)+_0x320a7c[_0x252aaf(0x26c)]),_0x34b8dd[_0x252aaf(0x1eb)]&&(_0x320a7c[_0x252aaf(0x28f)]&&console[_0x252aaf(0x21e)](_0x252aaf(0x1f5)+_0x320a7c['cause']),_0x320a7c['stack']&&(console[_0x252aaf(0x21e)](_0x252aaf(0x1b6)),console[_0x252aaf(0x21e)](_0x320a7c[_0x252aaf(0x267)])));else throw _0x320a7c;}function formatChatHistoryEntry(_0x331358,_0x2bdd85){const _0x2e49dc=a30_0x590e,_0x4ea909=getChalk(_0x2bdd85),_0x864176=_0x4ea909[_0x2e49dc(0x1ce)](_0x331358['at']);if(_0x2e49dc(0x1ca)in _0x331358){const _0x585407=_0x4ea909[_0x2e49dc(0x1cf)](_0x2e49dc(0x255));return _0x864176+'\x20'+_0x585407+':\x20'+_0x331358[_0x2e49dc(0x1ca)];}if('content'in _0x331358){const _0x2938d4=_0x4ea909[_0x2e49dc(0x1ea)]('[content]');return _0x864176+'\x20'+_0x2938d4+':\x20'+_0x331358['content'];}if(_0x2e49dc(0x28e)in _0x331358){const _0x8e480d=_0x4ea909['yellow']('[tool_call]'),{functionName:_0x2d0d7a,functionArguments:_0x507971,targetFunction:_0x191672}=_0x331358[_0x2e49dc(0x28e)];let _0x5ab43c=_0x864176+'\x20'+_0x8e480d+':\x20'+_0x4ea909['bold'](_0x2d0d7a);if(_0x507971&&Object[_0x2e49dc(0x1cb)](_0x507971)['length']>0x0){const _0x1d768d=Object[_0x2e49dc(0x1df)](_0x507971)['map'](([_0x44f39b,_0x41273b])=>_0x44f39b+'='+JSON[_0x2e49dc(0x1ba)](_0x41273b))[_0x2e49dc(0x23d)](',\x20');_0x5ab43c+='('+_0x1d768d+')';}_0x191672&&(_0x5ab43c+=_0x4ea909[_0x2e49dc(0x1ce)]('\x20['+_0x191672+']'));let _0xa49107='';if(_0x331358[_0x2e49dc(0x28e)][_0x2e49dc(0x21b)])_0xa49107='\x20->\x20KB:'+_0x331358['tool_call'][_0x2e49dc(0x21b)][_0x2e49dc(0x1f9)];else{if(_0x331358[_0x2e49dc(0x28e)]['targetAgent'])_0xa49107=_0x2e49dc(0x1c9)+_0x331358['tool_call'][_0x2e49dc(0x20d)][_0x2e49dc(0x1f9)];else{if(_0x331358['tool_call']['targetWebSearchTool'])_0xa49107=_0x2e49dc(0x27f)+_0x331358['tool_call'][_0x2e49dc(0x1bb)][_0x2e49dc(0x1f9)];else _0x331358[_0x2e49dc(0x28e)]['targetImageGenerator']&&(_0xa49107=_0x2e49dc(0x281)+_0x331358[_0x2e49dc(0x28e)][_0x2e49dc(0x1fa)][_0x2e49dc(0x1f9)]);}}return _0x5ab43c+_0xa49107;}if('tool'in _0x331358){const _0x548a93=_0x4ea909[_0x2e49dc(0x1fc)]('[tool]\x20\x20\x20'),{functionName:_0x1a0aa0,functionArguments:_0x46795c,content:_0x45d4a0,newChat:_0x3e0847}=_0x331358[_0x2e49dc(0x26b)];let _0x3fef72=_0x864176+'\x20'+_0x548a93+':\x20'+_0x4ea909[_0x2e49dc(0x1f2)](_0x1a0aa0);if(_0x46795c){const _0x567194=typeof _0x46795c===_0x2e49dc(0x226)?_0x46795c:JSON['stringify'](_0x46795c);_0x3fef72+='('+_0x567194+')';}return _0x45d4a0&&(_0x3fef72+='\x0a'+_0x4ea909[_0x2e49dc(0x1ce)](_0x45d4a0)),_0x3e0847&&(_0x3fef72+=_0x4ea909[_0x2e49dc(0x1ce)](_0x2e49dc(0x27c)+_0x3e0847['id'])),_0x3fef72;}if(_0x2e49dc(0x249)in _0x331358){const _0x189cb9=_0x4ea909['blue'](_0x2e49dc(0x278));return _0x864176+'\x20'+_0x189cb9+':\x20'+_0x331358[_0x2e49dc(0x249)][_0x2e49dc(0x1f9)]+'\x20('+_0x331358[_0x2e49dc(0x249)][_0x2e49dc(0x1e4)][_0x2e49dc(0x24d)]+_0x2e49dc(0x1f0);}if(_0x2e49dc(0x1b8)in _0x331358){const _0x2580f2=_0x4ea909[_0x2e49dc(0x1ec)](_0x2e49dc(0x20e)),{width:_0x5389cc,height:_0x8a9c2d,headerText:_0x56ca24}=_0x331358[_0x2e49dc(0x1b8)],_0x2be75b=_0x56ca24?_0x2e49dc(0x252)+_0x56ca24:'';return _0x864176+'\x20'+_0x2580f2+':\x20'+_0x5389cc+'x'+_0x8a9c2d+_0x2be75b;}if(_0x2e49dc(0x21e)in _0x331358){const _0x39f51d=_0x4ea909[_0x2e49dc(0x22a)]('[error]\x20\x20');return _0x864176+'\x20'+_0x39f51d+':\x20'+_0x331358[_0x2e49dc(0x21e)];}return _0x864176+'\x20'+_0x4ea909[_0x2e49dc(0x1ce)]('[unknown]')+':\x20'+JSON[_0x2e49dc(0x1ba)](_0x331358);}async function executeChatHistoryCommand(_0x1c841d,_0x353331){const _0x38cd0b=a30_0x590e,{options:_0x2f8cf6,args:_0x1aad1a,tdx:_0x15d1d8}=_0x1c841d,_0x4da5c8=_0x1aad1a[0x0],_0x4d5e28=_0x2f8cf6,_0x54d264=_0x4d5e28[_0x38cd0b(0x22b)];try{if(_0x54d264&&_0x4da5c8)return console[_0x38cd0b(0x21e)](_0x38cd0b(0x1f8)),console['error'](_0x38cd0b(0x20c)+_0x353331+_0x38cd0b(0x260)),0x1;if(!_0x4da5c8&&!_0x54d264&&_0x2f8cf6['format']!==undefined){const _0x44d493=resolveLimit(_0x2f8cf6['limit'],DEFAULT_LLM_LIMIT),_0x242eee=await withSpinner('Fetching\x20chat\x20sessions...',()=>_0x15d1d8['llm']['chats'](_0x44d493),{'verbose':_0x2f8cf6[_0x38cd0b(0x1eb)]});return await handleSDKOutput(_0x242eee[_0x38cd0b(0x273)],_0x2f8cf6),0x0;}const _0x5dbf46=await getChatIdOrSelect(_0x15d1d8,_0x2f8cf6,_0x54d264,_0x4da5c8);if(!_0x5dbf46)return 0x0;return await displayChatHistory(_0x5dbf46,_0x15d1d8,_0x2f8cf6),0x0;}catch(_0x2258b7){return handleSDKError(_0x2258b7,_0x2f8cf6),0x1;}}async function displayChatHistory(_0x4a5e18,_0x43a340,_0x563928){const _0x1731e7=a30_0x590e,_0x51c441=await withSpinner(_0x1731e7(0x268)+_0x4a5e18+_0x1731e7(0x277),()=>_0x43a340[_0x1731e7(0x1d2)]['history'](_0x4a5e18),{'verbose':_0x563928[_0x1731e7(0x1eb)]}),_0x105354=_0x51c441[_0x1731e7(0x273)][_0x1731e7(0x273)]??[];if(_0x105354[_0x1731e7(0x24d)]===0x0){console[_0x1731e7(0x28a)](_0x1731e7(0x1cd));return;}if(_0x563928[_0x1731e7(0x1d1)]!==undefined)await handleSDKOutput(_0x105354,_0x563928);else{const _0x59d713=_0x105354['map'](_0x38e4ea=>formatChatHistoryEntry(_0x38e4ea,_0x563928)),_0x9aa040=_0x59d713[_0x1731e7(0x23d)]('\x0a');await writeOutput(_0x9aa040,_0x563928[_0x1731e7(0x249)],_0x1731e7(0x24a));}}async function getChatIdOrSelect(_0x108ad3,_0x3237e3,_0x117d85,_0x81db18){const _0x2ac2e3=a30_0x590e;if(_0x81db18)return _0x81db18;if(_0x117d85){const _0x1ee88b=await withSpinner(_0x2ac2e3(0x1ed),()=>_0x108ad3['llm'][_0x2ac2e3(0x1d4)](0x1),{'verbose':_0x3237e3[_0x2ac2e3(0x1eb)]});if(_0x1ee88b[_0x2ac2e3(0x273)][_0x2ac2e3(0x24d)]===0x0)return console[_0x2ac2e3(0x28a)](_0x2ac2e3(0x271)),undefined;return _0x1ee88b[_0x2ac2e3(0x273)][0x0]['id'];}const _0x33d8e2=await selectChatInteractively(_0x108ad3,_0x3237e3);if(!_0x33d8e2)return console['log'](_0x2ac2e3(0x240)),undefined;return _0x33d8e2;}async function getProjectIdOrDefault(_0x12338e){const _0x355383=await getProjectWithName(_0x12338e);return _0x355383['id'];}async function getProjectWithName(_0xaebf59){const _0x488c33=a30_0x590e,{tdx:_0x565998,options:_0x44526b}=_0xaebf59,_0x16ca10=_0x44526b[_0x488c33(0x242)];if(_0x16ca10){const _0x23af0f=await withSpinner(_0x488c33(0x205)+_0x16ca10+_0x488c33(0x277),()=>_0x565998[_0x488c33(0x1d2)]['resolveProjectId'](_0x16ca10),{'verbose':_0x44526b[_0x488c33(0x1eb)]});return{'id':_0x23af0f[_0x488c33(0x273)],'name':_0x16ca10};}const _0x540b56=_0x565998['llm'][_0x488c33(0x1cc)]();if(_0x540b56){const _0x22d21c=await _0x565998[_0x488c33(0x1d2)][_0x488c33(0x266)](),_0xb94ee4=_0x22d21c['find'](_0x3bac95=>_0x3bac95['id']===_0x540b56);return{'id':_0x540b56,'name':_0xb94ee4?.[_0x488c33(0x1d9)][_0x488c33(0x1f9)]||_0x488c33(0x289)};}const _0x283f30=await withSpinner('Getting\x20default\x20project...',()=>_0x565998[_0x488c33(0x1d2)][_0x488c33(0x1fe)](),{'verbose':_0x44526b['verbose']});return{'id':_0x283f30['data']['id'],'name':_0x283f30['data'][_0x488c33(0x1d9)][_0x488c33(0x1f9)]};}function toLLMProjectInfo(_0x3c76f2){const _0x2210a5=a30_0x590e;return{'name':_0x3c76f2[_0x2210a5(0x1d9)][_0x2210a5(0x1f9)],'description':_0x3c76f2[_0x2210a5(0x1d9)][_0x2210a5(0x284)],'createdAt':_0x3c76f2[_0x2210a5(0x1d9)][_0x2210a5(0x296)],'updatedAt':_0x3c76f2[_0x2210a5(0x1d9)][_0x2210a5(0x1dd)]};}function toAgentInfo(_0x11618f){const _0x23731e=a30_0x590e;return{'name':_0x11618f['attributes'][_0x23731e(0x1f9)],'description':_0x11618f['attributes'][_0x23731e(0x284)],'prompt':truncatePrompt(_0x11618f[_0x23731e(0x1d9)][_0x23731e(0x23b)]),'createdAt':_0x11618f[_0x23731e(0x1d9)][_0x23731e(0x296)],'updatedAt':_0x11618f[_0x23731e(0x1d9)][_0x23731e(0x1dd)]};}function truncatePrompt(_0x2e3937){const _0x994980=a30_0x590e;if(!_0x2e3937)return undefined;const _0x3f6d2f=0x64;if(_0x2e3937[_0x994980(0x24d)]<=_0x3f6d2f)return _0x2e3937;return _0x2e3937[_0x994980(0x264)](0x0,_0x3f6d2f)+_0x994980(0x1d0);}export class LLMModelsCommand extends BaseCommand{[a30_0x238769(0x1f9)]='llm:models';[a30_0x238769(0x284)]=a30_0x238769(0x287);async[a30_0x238769(0x1c5)](_0x5294f9){const _0x3d02aa=a30_0x238769,{options:_0x46f864,tdx:_0x2000c4}=_0x5294f9;try{const _0x56ee32=await withSpinner(_0x3d02aa(0x28d),()=>_0x2000c4[_0x3d02aa(0x1d2)]['models'](),{'verbose':_0x46f864[_0x3d02aa(0x1eb)]});return await handleSDKOutput(_0x56ee32['data'],_0x46f864),0x0;}catch(_0x1e35a4){return handleSDKError(_0x1e35a4,_0x46f864),0x1;}}}export class LLMProjectsCommand extends BaseCommand{[a30_0x238769(0x1f9)]=a30_0x238769(0x23f);[a30_0x238769(0x284)]=a30_0x238769(0x1e9);async['execute'](_0x210c42){const _0x304e3a=a30_0x238769,{options:_0x4447a3,args:_0x4b4d3a,tdx:_0x44f682}=_0x210c42,_0x51a39c=getChalk(_0x4447a3),_0x24ab16=_0x4447a3[_0x304e3a(0x253)];try{const _0x553b39=_0x4b4d3a[0x0],_0x18d2a6=resolveLimit(_0x4447a3[_0x304e3a(0x244)],DEFAULT_LLM_LIMIT),_0x5c1c46=await withSpinner(_0x304e3a(0x217),()=>_0x44f682[_0x304e3a(0x1d2)][_0x304e3a(0x266)](_0x18d2a6),{'verbose':_0x4447a3[_0x304e3a(0x1eb)]});let _0x3acb1d=_0x5c1c46[_0x304e3a(0x273)];_0x553b39&&(_0x3acb1d=_0x5c1c46[_0x304e3a(0x273)][_0x304e3a(0x1e0)](_0x578ae8=>matchGlobPattern(_0x578ae8[_0x304e3a(0x1d9)]['name'],_0x553b39)));const _0xd3fe84=_0x4447a3[_0x304e3a(0x1d1)]===_0x304e3a(0x203)||_0x4447a3[_0x304e3a(0x1d1)]===_0x304e3a(0x1c2)||_0x4447a3[_0x304e3a(0x1d1)]==='table'||_0x4447a3['format']===_0x304e3a(0x20f);if(_0xd3fe84){const _0x372da7=_0x3acb1d[_0x304e3a(0x257)](_0x5d567a=>({...toLLMProjectInfo(_0x5d567a),'url':getLLMProjectUrl(_0x24ab16,_0x5d567a['id'])}));await handleSDKOutput(_0x372da7,_0x4447a3);}else{const _0xa793c=[];if(_0x3acb1d[_0x304e3a(0x24d)]===0x0)_0xa793c[_0x304e3a(0x1bd)](_0x51a39c['dim'](_0x304e3a(0x26f)));else{const _0x330f27=[..._0x3acb1d]['sort']((_0x323ec2,_0x441214)=>_0x323ec2['attributes'][_0x304e3a(0x1f9)][_0x304e3a(0x219)](_0x441214[_0x304e3a(0x1d9)][_0x304e3a(0x1f9)]));for(const _0x3d2876 of _0x330f27){const _0x26b727=getLLMProjectUrl(_0x24ab16,_0x3d2876['id']),_0x5f1baa=hyperlink(_0x3d2876[_0x304e3a(0x1d9)]['name'],_0x26b727);_0xa793c['push'](_0x304e3a(0x293)+_0x5f1baa);}_0xa793c[_0x304e3a(0x1bd)](_0x51a39c[_0x304e3a(0x1ce)](_0x3acb1d[_0x304e3a(0x24d)]+_0x304e3a(0x25e)));}await writeOutput(_0xa793c[_0x304e3a(0x23d)]('\x0a'),_0x4447a3[_0x304e3a(0x249)],'table');}return 0x0;}catch(_0xd35580){return handleSDKError(_0xd35580,_0x4447a3),0x1;}}}export class LLMAgentsCommand extends BaseCommand{[a30_0x238769(0x1f9)]='llm:agents';['description']=a30_0x238769(0x285);async[a30_0x238769(0x1c5)](_0x4a4a24){const _0x14c40b=a30_0x238769,{options:_0x3a6f57,args:_0x561f24,tdx:_0x25f6d1}=_0x4a4a24,_0x1d7ef8=getChalk(_0x3a6f57),_0x1dd551=_0x3a6f57[_0x14c40b(0x253)];try{const _0x15702a=_0x561f24[0x0];let _0x53db71=_0x15702a,_0x427a1a,_0x1113d6;if(_0x15702a&&_0x15702a['includes']('/')){const _0x21a4e2=_0x15702a[_0x14c40b(0x298)]('/');if(_0x21a4e2['length']===0x2){const [_0x34a84e,_0x10f9a9]=_0x21a4e2,_0x473b78=await _0x25f6d1['llm']['projects'](),_0x44b395=_0x473b78[_0x14c40b(0x1c6)](_0x3baa14=>_0x3baa14[_0x14c40b(0x1d9)][_0x14c40b(0x1f9)][_0x14c40b(0x209)]()===_0x34a84e[_0x14c40b(0x209)]());if(!_0x44b395)throw new SDKError(ErrorCode[_0x14c40b(0x24b)],_0x14c40b(0x275)+_0x34a84e,undefined,{'helpText':_0x14c40b(0x212)});_0x427a1a=_0x44b395['id'],_0x1113d6=_0x44b395[_0x14c40b(0x1d9)][_0x14c40b(0x1f9)],_0x53db71=_0x10f9a9;}else throw new SDKError(ErrorCode[_0x14c40b(0x272)],'Invalid\x20path\x20syntax:\x20'+_0x15702a,undefined,{'helpText':_0x14c40b(0x21d)});}else{const _0x2b99b4=await getProjectWithName(_0x4a4a24);_0x427a1a=_0x2b99b4['id'],_0x1113d6=_0x2b99b4['name'];}const _0x4225b2=await withSpinner(_0x14c40b(0x299),()=>_0x25f6d1[_0x14c40b(0x1d2)]['agents'](_0x427a1a),{'verbose':_0x3a6f57[_0x14c40b(0x1eb)]});let _0x50fcc2=_0x4225b2[_0x14c40b(0x273)];_0x53db71&&(_0x50fcc2=_0x4225b2[_0x14c40b(0x273)][_0x14c40b(0x1e0)](_0x44594d=>matchGlobPattern(_0x44594d['attributes']['name'],_0x53db71)));const _0x4660c0=_0x3a6f57['format']==='json'||_0x3a6f57[_0x14c40b(0x1d1)]===_0x14c40b(0x1c2)||_0x3a6f57[_0x14c40b(0x1d1)]==='table'||_0x3a6f57[_0x14c40b(0x1d1)]===_0x14c40b(0x20f);if(_0x4660c0){const _0x4aa7e7=_0x50fcc2['map'](_0x1136d9=>({...toAgentInfo(_0x1136d9),'chatUrl':getLLMAgentChatUrl(_0x1dd551,_0x427a1a,_0x1136d9['id'])}));await handleSDKOutput(_0x4aa7e7,_0x3a6f57);}else{const _0x45e558=[];_0x45e558[_0x14c40b(0x1bd)](_0x1d7ef8[_0x14c40b(0x1ce)]('['+_0x1113d6+']'));if(_0x50fcc2['length']===0x0)_0x45e558['push'](_0x1d7ef8[_0x14c40b(0x1ce)](_0x14c40b(0x1e5)));else{const _0x5d8667=[..._0x50fcc2][_0x14c40b(0x206)]((_0x4c8793,_0x101c73)=>_0x4c8793[_0x14c40b(0x1d9)][_0x14c40b(0x1f9)][_0x14c40b(0x219)](_0x101c73[_0x14c40b(0x1d9)][_0x14c40b(0x1f9)]));for(const _0x8539ee of _0x5d8667){const _0x4521e0=getLLMAgentChatUrl(_0x1dd551,_0x427a1a,_0x8539ee['id']),_0x36f118=hyperlink(_0x8539ee[_0x14c40b(0x1d9)][_0x14c40b(0x1f9)],_0x4521e0);_0x45e558[_0x14c40b(0x1bd)]('🤖\x20'+_0x36f118);}_0x45e558[_0x14c40b(0x1bd)](_0x1d7ef8[_0x14c40b(0x1ce)](_0x50fcc2['length']+_0x14c40b(0x1bf)));}await writeOutput(_0x45e558[_0x14c40b(0x23d)]('\x0a'),_0x3a6f57[_0x14c40b(0x249)],_0x14c40b(0x24a));}return 0x0;}catch(_0x5747db){return handleSDKError(_0x5747db,_0x3a6f57),0x1;}}}export class LLMAgentShowCommand extends BaseCommand{[a30_0x238769(0x1f9)]=a30_0x238769(0x258);[a30_0x238769(0x284)]=a30_0x238769(0x23e);async[a30_0x238769(0x1c5)](_0x5998d7){const _0x47736c=a30_0x238769,{options:_0x13ee24,args:_0xce5ecd,tdx:_0x26456e}=_0x5998d7;if(_0xce5ecd[_0x47736c(0x24d)]===0x0)return console[_0x47736c(0x21e)](_0x47736c(0x1de)),console['error']('Usage:\x20tdx\x20llm\x20agent\x20show\x20<agent-name>'),0x1;const _0x522896=_0xce5ecd[0x0];try{const _0x495312=await getProjectIdOrDefault(_0x5998d7),_0x2f1f63=await withSpinner('Resolving\x20agent\x20\x27'+_0x522896+'\x27...',()=>_0x26456e[_0x47736c(0x1d2)]['resolveAgentId'](_0x522896,_0x495312),{'verbose':_0x13ee24[_0x47736c(0x1eb)]}),_0x423408=await withSpinner('Fetching\x20agent...',()=>_0x26456e[_0x47736c(0x1d2)]['agent'](_0x2f1f63['data']),{'verbose':_0x13ee24[_0x47736c(0x1eb)]});return await handleSDKOutput([_0x423408[_0x47736c(0x273)]],_0x13ee24),0x0;}catch(_0x3bed8e){return handleSDKError(_0x3bed8e,_0x13ee24),0x1;}}}export class LLMAgentCreateCommand extends BaseCommand{[a30_0x238769(0x1f9)]='llm:agent:create';['description']=a30_0x238769(0x1dc);async[a30_0x238769(0x1c5)](_0x4b471d){const _0xafc90c=a30_0x238769,{options:_0x236a2f,args:_0x225070,tdx:_0x4be2cf}=_0x4b471d;if(_0x225070['length']===0x0)return console[_0xafc90c(0x21e)](_0xafc90c(0x1de)),console['error'](_0xafc90c(0x262)),console[_0xafc90c(0x21e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20llm\x20agent\x20create\x20<project-name>/<agent-name>\x20[options]'),0x1;const _0x1064b1=_0x225070[0x0],_0xe769c1=_0x236a2f,_0x3db7a9=_0xe769c1[_0xafc90c(0x27a)],_0x28c7c7=_0xe769c1[_0xafc90c(0x1f4)]||_0xafc90c(0x202),_0x2bccfc=_0xe769c1[_0xafc90c(0x230)],_0x5d823a=_0xe769c1[_0xafc90c(0x276)]?Number(_0xe769c1[_0xafc90c(0x276)]):undefined,_0x43c313=_0xe769c1[_0xafc90c(0x254)]?Number(_0xe769c1[_0xafc90c(0x254)]):undefined;try{let _0x5c6308,_0x3c4cc1;if(_0x1064b1[_0xafc90c(0x274)]('/')){const _0x52d0da=_0x1064b1[_0xafc90c(0x298)]('/');if(_0x52d0da['length']===0x2){const [_0x538bac,_0x3dce1c]=_0x52d0da,_0x3fc065=await withSpinner(_0xafc90c(0x205)+_0x538bac+'\x27...',()=>_0x4be2cf['llm'][_0xafc90c(0x21c)](_0x538bac),{'verbose':_0x236a2f[_0xafc90c(0x1eb)]});_0x5c6308=_0x3fc065['data'],_0x3c4cc1=_0x3dce1c;}else throw new SDKError(ErrorCode[_0xafc90c(0x272)],'Invalid\x20path\x20syntax:\x20'+_0x1064b1,undefined,{'helpText':_0xafc90c(0x21d)});}else _0x5c6308=await getProjectIdOrDefault(_0x4b471d),_0x3c4cc1=_0x1064b1;const _0x34a778=await withSpinner(_0xafc90c(0x1ef)+_0x3c4cc1+_0xafc90c(0x277),()=>_0x4be2cf[_0xafc90c(0x1d2)][_0xafc90c(0x200)]({'name':_0x3c4cc1,'projectId':_0x5c6308,'modelType':_0x28c7c7,'systemPrompt':_0x3db7a9,'starterMessage':_0x2bccfc,'maxToolIterations':_0x5d823a,'temperature':_0x43c313}),{'verbose':_0x236a2f[_0xafc90c(0x1eb)]});return console[_0xafc90c(0x28a)](_0xafc90c(0x1f1)+_0x34a778[_0xafc90c(0x273)]['id']),await handleSDKOutput([_0x34a778[_0xafc90c(0x273)]],_0x236a2f),0x0;}catch(_0x5c7381){return handleSDKError(_0x5c7381,_0x236a2f),0x1;}}}export class LLMAgentUpdateCommand extends BaseCommand{['name']=a30_0x238769(0x1e6);[a30_0x238769(0x284)]='Update\x20an\x20existing\x20agent';async[a30_0x238769(0x1c5)](_0x4cd90c){const _0x1cf66b=a30_0x238769,{options:_0x2f8e11,args:_0x501895,tdx:_0x12aeec}=_0x4cd90c;if(_0x501895[_0x1cf66b(0x24d)]===0x0)return console[_0x1cf66b(0x21e)](_0x1cf66b(0x1de)),console[_0x1cf66b(0x21e)](_0x1cf66b(0x1b9)),0x1;const _0x3883ab=_0x501895[0x0],_0x30456f=_0x2f8e11,_0x3c73d5=_0x30456f[_0x1cf66b(0x1f9)],_0x166754=_0x30456f[_0x1cf66b(0x23b)],_0x5de938=_0x30456f['description'],_0x5b2b91=_0x30456f[_0x1cf66b(0x230)];if(!_0x3c73d5&&!_0x166754&&!_0x5de938&&!_0x5b2b91)return console[_0x1cf66b(0x21e)](_0x1cf66b(0x270)),console[_0x1cf66b(0x21e)](_0x1cf66b(0x241)),0x1;try{const _0x36383c=await getProjectIdOrDefault(_0x4cd90c),_0x301f41=await withSpinner('Resolving\x20agent\x20\x27'+_0x3883ab+_0x1cf66b(0x277),()=>_0x12aeec[_0x1cf66b(0x1d2)][_0x1cf66b(0x297)](_0x3883ab,_0x36383c),{'verbose':_0x2f8e11[_0x1cf66b(0x1eb)]}),_0x5f085b=_0x301f41[_0x1cf66b(0x273)],_0x1df114=await withSpinner(_0x1cf66b(0x1db),()=>_0x12aeec[_0x1cf66b(0x1d2)][_0x1cf66b(0x256)](_0x5f085b,{'name':_0x3c73d5,'prompt':_0x166754,'description':_0x5de938,'starterMessage':_0x5b2b91}),{'verbose':_0x2f8e11[_0x1cf66b(0x1eb)]});return console[_0x1cf66b(0x28a)](_0x1cf66b(0x215)+_0x1df114[_0x1cf66b(0x273)]['id']),await handleSDKOutput([_0x1df114[_0x1cf66b(0x273)]],_0x2f8e11),0x0;}catch(_0x45f52f){return handleSDKError(_0x45f52f,_0x2f8e11),0x1;}}}export class LLMAgentDeleteCommand extends BaseCommand{[a30_0x238769(0x1f9)]=a30_0x238769(0x1fb);[a30_0x238769(0x284)]='Delete\x20an\x20agent';async[a30_0x238769(0x1c5)](_0x37303d){const _0x3cfcca=a30_0x238769,{options:_0x38db9e,args:_0x44cc2f,tdx:_0xa2501e}=_0x37303d;if(_0x44cc2f[_0x3cfcca(0x24d)]===0x0)return console[_0x3cfcca(0x21e)](_0x3cfcca(0x1de)),console[_0x3cfcca(0x21e)]('Usage:\x20tdx\x20llm\x20agent\x20delete\x20<agent-name>'),0x1;const _0x56b3a9=_0x44cc2f[0x0];try{const _0x4e1e63=await getProjectIdOrDefault(_0x37303d),_0x1d3dd1=await withSpinner(_0x3cfcca(0x245)+_0x56b3a9+'\x27...',()=>_0xa2501e[_0x3cfcca(0x1d2)]['resolveAgentId'](_0x56b3a9,_0x4e1e63),{'verbose':_0x38db9e[_0x3cfcca(0x1eb)]}),_0xeda994=_0x1d3dd1['data'];return await withSpinner(_0x3cfcca(0x22c),()=>_0xa2501e['llm'][_0x3cfcca(0x225)](_0xeda994),{'verbose':_0x38db9e[_0x3cfcca(0x1eb)]}),console[_0x3cfcca(0x28a)]('Agent\x20deleted:\x20'+_0xeda994),0x0;}catch(_0x43c912){return handleSDKError(_0x43c912,_0x38db9e),0x1;}}}export class LLMHistoryCommand extends BaseCommand{[a30_0x238769(0x1f9)]=a30_0x238769(0x288);[a30_0x238769(0x284)]=a30_0x238769(0x21a);async[a30_0x238769(0x1c5)](_0x48be1c){const _0x26eddd=a30_0x238769;return executeChatHistoryCommand(_0x48be1c,_0x26eddd(0x1da));}}export class LLMUseCommand extends BaseCommand{[a30_0x238769(0x1f9)]=a30_0x238769(0x1e2);['description']=a30_0x238769(0x1c4);async[a30_0x238769(0x1c5)](_0x170325){const _0x493cd4=a30_0x238769,{options:_0x1b80e2,args:_0x487a4c,tdx:_0x534cdd}=_0x170325;if(_0x487a4c[_0x493cd4(0x24d)]===0x0)return console[_0x493cd4(0x21e)](_0x493cd4(0x229)),console[_0x493cd4(0x21e)]('Usage:\x20tdx\x20llm\x20use\x20<project-name>'),0x1;const _0x264f8a=_0x487a4c[0x0];try{await withSpinner(_0x493cd4(0x201)+_0x264f8a+_0x493cd4(0x277),()=>_0x534cdd[_0x493cd4(0x1d2)][_0x493cd4(0x1d8)](_0x264f8a),{'verbose':_0x1b80e2[_0x493cd4(0x1eb)]}),saveSessionContext({'llm_project':_0x264f8a},_0x1b80e2[_0x493cd4(0x216)]);const _0x102087=getChalk(_0x1b80e2);return console[_0x493cd4(0x28a)]('Session\x20llm_project\x20set\x20to:\x20'+_0x102087[_0x493cd4(0x1ea)](_0x264f8a)),0x0;}catch(_0xfa9b3b){return handleSDKError(_0xfa9b3b,_0x1b80e2),0x1;}}}export class LLMProjectCreateCommand extends BaseCommand{[a30_0x238769(0x1f9)]=a30_0x238769(0x1b7);[a30_0x238769(0x284)]=a30_0x238769(0x26e);async[a30_0x238769(0x1c5)](_0x1269c1){const _0x5f32d5=a30_0x238769,{options:_0x394a4d,args:_0x2a98e4,tdx:_0x4393c7}=_0x1269c1;if(_0x2a98e4[_0x5f32d5(0x24d)]===0x0)return console[_0x5f32d5(0x21e)](_0x5f32d5(0x229)),console['error']('Usage:\x20tdx\x20llm\x20project\x20create\x20<name>\x20[--description\x20<text>]'),0x1;const _0x26b88f=_0x2a98e4[0x0],_0x595b0a=_0x394a4d,_0x5500a7=_0x595b0a[_0x5f32d5(0x284)];try{const _0x261243=await withSpinner(_0x5f32d5(0x1ff)+_0x26b88f+'\x27...',()=>_0x4393c7[_0x5f32d5(0x1d2)]['createProject']({'name':_0x26b88f,'description':_0x5500a7}),{'verbose':_0x394a4d['verbose']});console[_0x5f32d5(0x28a)](_0x5f32d5(0x247)+_0x261243['data']['id']);const _0x2aef18=toLLMProjectInfo(_0x261243['data']);return await handleSDKOutput([_0x2aef18],_0x394a4d),0x0;}catch(_0xc3ea38){return handleSDKError(_0xc3ea38,_0x394a4d),0x1;}}}export class LLMProjectDeleteCommand extends BaseCommand{[a30_0x238769(0x1f9)]=a30_0x238769(0x290);[a30_0x238769(0x284)]='Delete\x20an\x20LLM\x20project';async['execute'](_0x472a9b){const _0x217872=a30_0x238769,{options:_0x289baf,args:_0x5ad3f6,tdx:_0x35846b}=_0x472a9b;if(_0x5ad3f6['length']===0x0)return console[_0x217872(0x21e)](_0x217872(0x229)),console[_0x217872(0x21e)]('Usage:\x20tdx\x20llm\x20project\x20delete\x20<name>'),0x1;const _0x14a0d9=_0x5ad3f6[0x0];try{return await withSpinner(_0x217872(0x1d3)+_0x14a0d9+_0x217872(0x277),()=>_0x35846b['llm'][_0x217872(0x213)](_0x14a0d9),{'verbose':_0x289baf[_0x217872(0x1eb)]}),console[_0x217872(0x28a)](_0x217872(0x20a)+_0x14a0d9),0x0;}catch(_0x536b7e){return handleSDKError(_0x536b7e,_0x289baf),0x1;}}}function a30_0x3e61(){const _0x5bfa9b=['Error:\x20Agent\x20name\x20is\x20required','entries','filter','just\x20now','llm:use','\x20\x20\x20Examples:','content','No\x20agents\x20found','llm:agent:update','knowledgeBases','numeric','List\x20all\x20LLM\x20projects','green','verbose','blue','Fetching\x20most\x20recent\x20chat...','agentId','Creating\x20agent\x20\x27','\x20bytes)','Agent\x20created:\x20','bold','\x20\x20\x20\x20\x20tdx\x20agent\x20clone\x20\x22SourceProject\x22\x20--name\x20\x22NewProject\x22','model','\x20\x20Cause:\x20','Fetching\x20chat\x20sessions...','short','Error:\x20Cannot\x20use\x20--last\x20flag\x20with\x20chat-id\x20argument','name','targetImageGenerator','llm:agent:delete','magenta','Restore\x20an\x20LLM\x20project\x20from\x20a\x20backup\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20push/clone`)','getOrCreateDefaultProject','Creating\x20project\x20\x27','createAgent','Setting\x20project\x20context\x20to\x20\x27','claude-4.5-haiku','json','.llm','Resolving\x20project\x20\x27','sort','1076958VgeZBP','[DRY\x20RUN]\x20Would\x20restore\x20project:\x20','toLowerCase','Project\x20deleted:\x20','Analyzing\x20project\x20\x27','Usage:\x20','targetAgent','[image]\x20\x20','tsv','2874612CTwbgq','\x20\x20Knowledge\x20Bases:\x20','Use\x20\x22tdx\x20llm\x20projects\x22\x20to\x20list\x20available\x20projects.','deleteProject','Usage:\x20tdx\x20llm\x20project\x20restore\x20<folder>\x20[--name\x20<new-name>]\x20[--dry-run]','Agent\x20updated:\x20','session','Fetching\x20projects...','Select\x20a\x20chat\x20session:','localeCompare','Show\x20chat\x20history\x20or\x20list\x20chat\x20sessions','targetKnowledgeBase','resolveProjectId','Use\x20format:\x20project-name/agent-name','error','Fetching\x20chat\x20log\x20for\x20\x27','Project\x20backed\x20up\x20to:\x20','floor','llm:project:backup','2930245ZbYfPr','\x20\x20\x20Example:\x20tdx\x20agent\x20pull\x20\x22MyProject\x22\x20-o\x20./my-agents','deleteAgent','string','exportedFrom','backupProject','Error:\x20Project\x20name\x20is\x20required','red','last','Deleting\x20agent...','__load_more__','llm:project:restore','46382QfffqB','starterMessage','1863594cEyLLg','integrations','dryRun','agent','set','sourceSite','Restore\x20cancelled.','d\x20ago','\x20\x20\x20Use\x20`tdx\x20agent\x20push`\x20to\x20sync\x20from\x20local\x20files,\x20or\x20`tdx\x20agent\x20clone`\x20to\x20copy\x20a\x20project.','lastConversationAt','prompt','firstInputContent','join','Show\x20agent\x20details','llm:projects','\x0aCancelled','Options:\x20--name,\x20--prompt,\x20--description,\x20--starter-message','llmProject','\x27\x20already\x20exists.\x20Overwrite?','limit','Resolving\x20agent\x20\x27','3208QYRrtD','Project\x20created:\x20','A\x20project\x20named\x20\x27','output','table','LLM_PROJECT_NOT_FOUND','Usage:\x20tdx\x20llm\x20project\x20backup\x20<name>\x20[-o\x20<output-folder>]\x20[--dry-run]','length','\x20\x20Agents:\x20','Error:\x20Backup\x20folder\x20path\x20is\x20required','\x27\x20already\x20exists.\x20Creating\x20will\x20fail.\x20Continue\x20anyway?','default','\x20-\x20','site','temperature','[input]\x20\x20','updateAgent','map','llm:agent:show','Show\x20chat\x20log','Error:\x20','prompts','Output\x20directory\x20\x27','all','\x20project(s)','substring','\x20--last','outputDir','Usage:\x20tdx\x20llm\x20agent\x20create\x20<name>\x20[options]','(no\x20message)','slice','restoreProject','projects','stack','Fetching\x20chat\x20history\x20for\x20\x27','\x20\x20Prompts:\x20','counts','tool','message','Use\x20arrow\x20keys\x20to\x20navigate,\x20Enter\x20to\x20select,\x20Esc\x20to\x20cancel','Create\x20a\x20new\x20LLM\x20project','No\x20projects\x20found','Error:\x20At\x20least\x20one\x20update\x20field\x20is\x20required','No\x20chat\x20sessions\x20found.','INVALID_ARGUMENT','data','includes','Project\x20not\x20found:\x20','maxToolIterations','\x27...','[output]\x20','chatId','systemPrompt','yellow','\x20→\x20chat:\x20','[DRY\x20RUN]\x20Would\x20backup\x20project\x20to:\x20','tdx\x20chats','\x20->\x20WebSearch:','h\x20ago','\x20->\x20ImageGen:','\x20\x20\x20Use\x20`tdx\x20agent\x20pull`\x20instead\x20for\x20Git-friendly\x20YAML/Markdown\x20format.','getTime','description','List\x20agents\x20in\x20current\x20project','\x20\x20Integrations:\x20','List\x20available\x20LLM\x20models','llm:history','Unknown','log','Project\x20restored:\x20','m\x20ago','Fetching\x20available\x20models...','tool_call','cause','llm:project:delete','Error:\x20chat-id\x20is\x20required','Load\x20more...','⚒️\x20','562380ptUVaN','Validating\x20backup\x20from\x20\x27','createdAt','resolveAgentId','split','Fetching\x20agents...','Backup\x20cancelled.','\x0aStack\x20trace:','llm:project:create','image','Usage:\x20tdx\x20llm\x20agent\x20update\x20<agent-name>\x20[options]','stringify','targetWebSearchTool','Backup\x20an\x20LLM\x20project\x20to\x20a\x20folder\x20(deprecated:\x20use\x20`tdx\x20agent\x20pull`)','push','rmSync','\x20agent(s)','(no\x20agent)','projectName','jsonl','yes','Set\x20current\x20project\x20context','execute','find','\x20\x20\x20\x20\x20tdx\x20agent\x20push\x20./my-agents/my-project/','4413776fQeOoS','\x20->\x20Agent:','input','keys','getCurrentProject','No\x20messages\x20found\x20in\x20chat\x20history.','dim','cyan','...','format','llm','Deleting\x20project\x20\x27','chats','getBackupMetadata','Usage:\x20TDX_EXPERIMENTAL=true\x20tdx\x20llm\x20log\x20<chat-id>','agents','setCurrentProject','attributes','tdx\x20llm\x20history','Updating\x20agent...','Create\x20a\x20new\x20agent\x20in\x20current\x20project','updatedAt'];a30_0x3e61=function(){return _0x5bfa9b;};return a30_0x3e61();}export class LLMProjectBackupCommand extends BaseCommand{['name']=a30_0x238769(0x222);[a30_0x238769(0x284)]=a30_0x238769(0x1bc);async[a30_0x238769(0x1c5)](_0x5d9210){const _0x4c0cbd=a30_0x238769,{options:_0xa9ea56,args:_0x592240,tdx:_0x3bc0dd}=_0x5d9210,_0x467a3d=getChalk(_0xa9ea56);console[_0x4c0cbd(0x28a)](_0x467a3d['yellow']('⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20backup`\x20is\x20deprecated.')),console[_0x4c0cbd(0x28a)](_0x467a3d[_0x4c0cbd(0x27b)](_0x4c0cbd(0x282))),console[_0x4c0cbd(0x28a)](_0x467a3d[_0x4c0cbd(0x1ce)](_0x4c0cbd(0x224))),console[_0x4c0cbd(0x28a)]();if(_0x592240[_0x4c0cbd(0x24d)]===0x0)return console['error'](_0x4c0cbd(0x229)),console[_0x4c0cbd(0x21e)](_0x4c0cbd(0x24c)),0x1;const _0x1464fe=_0x592240[0x0],_0x5814c9=_0xa9ea56,_0x240e01=_0x5814c9[_0x4c0cbd(0x249)],_0x2a14de=_0x5814c9['dryRun'];try{const _0x11865f=_0x240e01||_0x1464fe+_0x4c0cbd(0x204);if(a30_0x2f3340['existsSync'](_0x11865f)&&!_0x2a14de){if(!_0xa9ea56[_0x4c0cbd(0x1c3)]){const _0x8b7c54=await confirm(_0x4c0cbd(0x25c)+_0x11865f+_0x4c0cbd(0x243));if(!_0x8b7c54)return console['log'](_0x4c0cbd(0x29a)),0x0;}a30_0x2f3340[_0x4c0cbd(0x1be)](_0x11865f,{'recursive':!![]});}const _0x2f0190=await withSpinner(_0x2a14de?_0x4c0cbd(0x20b)+_0x1464fe+'\x27...':'Backing\x20up\x20project\x20\x27'+_0x1464fe+'\x27...',()=>_0x3bc0dd['llm'][_0x4c0cbd(0x228)](_0x1464fe,_0x240e01,{'dryRun':_0x2a14de}),{'verbose':_0xa9ea56['verbose']}),_0x243bd7=_0x2f0190[_0x4c0cbd(0x273)];return _0x2a14de?console[_0x4c0cbd(0x28a)](_0x4c0cbd(0x27d)+_0x243bd7[_0x4c0cbd(0x261)]):console['log'](_0x4c0cbd(0x220)+_0x243bd7[_0x4c0cbd(0x261)]),console['log'](_0x4c0cbd(0x24e)+_0x243bd7['counts'][_0x4c0cbd(0x1d7)]),console['log'](_0x4c0cbd(0x211)+_0x243bd7['counts'][_0x4c0cbd(0x1e7)]),console[_0x4c0cbd(0x28a)](_0x4c0cbd(0x269)+_0x243bd7[_0x4c0cbd(0x26a)][_0x4c0cbd(0x25b)]),console[_0x4c0cbd(0x28a)]('\x20\x20Integrations:\x20'+_0x243bd7['counts'][_0x4c0cbd(0x232)]),(_0xa9ea56[_0x4c0cbd(0x1d1)]==='json'||_0xa9ea56[_0x4c0cbd(0x1d1)]===_0x4c0cbd(0x1c2))&&await handleSDKOutput([_0x243bd7],_0xa9ea56),0x0;}catch(_0x19582d){return handleSDKError(_0x19582d,_0xa9ea56),0x1;}}}export class LLMProjectRestoreCommand extends BaseCommand{[a30_0x238769(0x1f9)]=a30_0x238769(0x22e);[a30_0x238769(0x284)]=a30_0x238769(0x1fd);async[a30_0x238769(0x1c5)](_0x3792b7){const _0x24efdb=a30_0x238769,{options:_0x14d517,args:_0xdccf40,tdx:_0x1d1141}=_0x3792b7,_0x352b2b=getChalk(_0x14d517);console[_0x24efdb(0x28a)](_0x352b2b[_0x24efdb(0x27b)]('⚠️\x20\x20DEPRECATED:\x20`tdx\x20llm\x20project\x20restore`\x20is\x20deprecated.')),console['log'](_0x352b2b['yellow'](_0x24efdb(0x239))),console[_0x24efdb(0x28a)](_0x352b2b[_0x24efdb(0x1ce)](_0x24efdb(0x1e3))),console[_0x24efdb(0x28a)](_0x352b2b['dim'](_0x24efdb(0x1c7))),console[_0x24efdb(0x28a)](_0x352b2b[_0x24efdb(0x1ce)](_0x24efdb(0x1f3))),console[_0x24efdb(0x28a)]();if(_0xdccf40['length']===0x0)return console[_0x24efdb(0x21e)](_0x24efdb(0x24f)),console['error'](_0x24efdb(0x214)),0x1;const _0x254569=_0xdccf40[0x0],_0x59e89a=_0x14d517,_0x11671a=_0x59e89a['name'],_0x4f8ebd=_0x59e89a[_0x24efdb(0x233)];try{if(!_0x4f8ebd){const _0x10a857=_0x1d1141[_0x24efdb(0x1d2)][_0x24efdb(0x1d5)](_0x254569),_0x3e9daf=_0x11671a||_0x10a857[_0x24efdb(0x227)][_0x24efdb(0x1c1)],_0x263043=await withSpinner('Checking\x20for\x20existing\x20projects...',()=>_0x1d1141[_0x24efdb(0x1d2)][_0x24efdb(0x266)](),{'verbose':_0x14d517[_0x24efdb(0x1eb)]}),_0x54fce1=_0x263043[_0x24efdb(0x273)][_0x24efdb(0x1c6)](_0x23101c=>_0x23101c[_0x24efdb(0x1d9)]['name']===_0x3e9daf);if(_0x54fce1&&!_0x14d517[_0x24efdb(0x1c3)]){const _0x176a1d=await confirm(_0x24efdb(0x248)+_0x3e9daf+_0x24efdb(0x250));if(!_0x176a1d)return console[_0x24efdb(0x28a)](_0x24efdb(0x237)),0x0;}}const _0xe8b691=await withSpinner(_0x4f8ebd?_0x24efdb(0x295)+_0x254569+'\x27...':'Restoring\x20project\x20from\x20\x27'+_0x254569+_0x24efdb(0x277),()=>_0x1d1141['llm'][_0x24efdb(0x265)](_0x254569,{'name':_0x11671a,'dryRun':_0x4f8ebd}),{'verbose':_0x14d517['verbose']}),_0x330fba=_0xe8b691[_0x24efdb(0x273)];return _0x330fba[_0x24efdb(0x236)]&&console[_0x24efdb(0x28a)]('[INFO]\x20Cross-site\x20restore:\x20backup\x20was\x20created\x20on\x20\x27'+_0x330fba['sourceSite']+'\x27'),_0x4f8ebd?console['log'](_0x24efdb(0x208)+_0x330fba['projectName']):console[_0x24efdb(0x28a)](_0x24efdb(0x28b)+_0x330fba['projectName']+'\x20('+_0x330fba['projectId']+')'),console[_0x24efdb(0x28a)](_0x24efdb(0x24e)+_0x330fba[_0x24efdb(0x26a)][_0x24efdb(0x1d7)]),console[_0x24efdb(0x28a)](_0x24efdb(0x211)+_0x330fba[_0x24efdb(0x26a)][_0x24efdb(0x1e7)]),console[_0x24efdb(0x28a)](_0x24efdb(0x269)+_0x330fba[_0x24efdb(0x26a)][_0x24efdb(0x25b)]),console[_0x24efdb(0x28a)](_0x24efdb(0x286)+_0x330fba[_0x24efdb(0x26a)][_0x24efdb(0x232)]),(_0x14d517[_0x24efdb(0x1d1)]==='json'||_0x14d517[_0x24efdb(0x1d1)]===_0x24efdb(0x1c2))&&await handleSDKOutput([_0x330fba],_0x14d517),0x0;}catch(_0x653a2){return handleSDKError(_0x653a2,_0x14d517),0x1;}}}const CHAT_SELECTOR_PAGE_SIZE=0xf;function a30_0x590e(_0x88531e,_0x16c15f){_0x88531e=_0x88531e-0x1b6;const _0x3e61a0=a30_0x3e61();let _0x590e86=_0x3e61a0[_0x88531e];return _0x590e86;}async function selectChatInteractively(_0x2fb4b6,_0x39253b){const _0x2901ab=a30_0x238769,_0x3943a7=_0x39253b[_0x2901ab(0x244)]||CHAT_SELECTOR_PAGE_SIZE;let _0x1d1043=0x0,_0x3f0831=[];const _0x86a5f5=(await import('prompts'))[_0x2901ab(0x251)],_0x494130=getChalk(_0x39253b);while(!![]){const _0x1ad07a=await withSpinner(_0x2901ab(0x1f6),()=>_0x2fb4b6['llm'][_0x2901ab(0x1d4)](_0x3943a7+_0x1d1043),{'verbose':_0x39253b[_0x2901ab(0x1eb)]});_0x3f0831=_0x1ad07a[_0x2901ab(0x273)];const _0x326356=_0x3f0831[_0x2901ab(0x264)](_0x1d1043,_0x1d1043+_0x3943a7),_0x105333=_0x3f0831['length']>_0x1d1043+_0x3943a7,_0x48583c=[...new Set(_0x326356[_0x2901ab(0x257)](_0x429e83=>_0x429e83['attributes'][_0x2901ab(0x1ee)])[_0x2901ab(0x1e0)](_0x44b933=>_0x44b933!==undefined))],_0x71f50c=new Map();await Promise[_0x2901ab(0x25d)](_0x48583c[_0x2901ab(0x257)](async _0x1e8bda=>{const _0x16d426=_0x2901ab;try{const _0x50c390=await _0x2fb4b6[_0x16d426(0x1d2)][_0x16d426(0x234)](_0x1e8bda);_0x71f50c[_0x16d426(0x235)](_0x1e8bda,_0x50c390[_0x16d426(0x1d9)][_0x16d426(0x1f9)]);}catch{_0x71f50c[_0x16d426(0x235)](_0x1e8bda,_0x1e8bda);}}));const _0x2ebaa1=_0x326356['map'](_0x573e73=>{const _0x9ca708=_0x2901ab,_0xa62830=_0x573e73[_0x9ca708(0x1d9)][_0x9ca708(0x23c)]||_0x9ca708(0x263),_0x13b5e6=_0xa62830['split']('\x0a')[0x0],_0x620b7b=_0x13b5e6[_0x9ca708(0x24d)]>0x50?_0x13b5e6[_0x9ca708(0x25f)](0x0,0x4d)+_0x9ca708(0x1d0):_0x13b5e6,_0x1a83ec=_0x573e73['attributes']['agentId']?_0x71f50c['get'](_0x573e73[_0x9ca708(0x1d9)][_0x9ca708(0x1ee)])||_0x573e73[_0x9ca708(0x1d9)]['agentId']:_0x9ca708(0x1c0),_0x5b2bca=_0x573e73[_0x9ca708(0x1d9)][_0x9ca708(0x23a)]||_0x573e73[_0x9ca708(0x1d9)][_0x9ca708(0x1dd)],_0x31b8ad=new Date(_0x5b2bca),_0x1c45c8=new Date(),_0x4f0be8=_0x1c45c8['getTime']()-_0x31b8ad[_0x9ca708(0x283)](),_0x51da8=Math[_0x9ca708(0x221)](_0x4f0be8/0xea60),_0x1689d3=Math[_0x9ca708(0x221)](_0x4f0be8/0x36ee80),_0xdc82e=Math[_0x9ca708(0x221)](_0x4f0be8/0x5265c00);let _0x450007;if(_0x51da8<0x1)_0x450007=_0x9ca708(0x1e1);else{if(_0x51da8<0x3c)_0x450007=_0x51da8+_0x9ca708(0x28c);else{if(_0x1689d3<0x18)_0x450007=_0x1689d3+_0x9ca708(0x280);else _0xdc82e<0x7?_0x450007=_0xdc82e+_0x9ca708(0x238):_0x450007=_0x31b8ad['toLocaleDateString']('en-US',{'month':_0x9ca708(0x1f7),'day':_0x9ca708(0x1e8)});}}return{'title':_0x620b7b+'\x20'+_0x494130['dim']('['+_0x1a83ec+']\x20'+_0x450007),'value':_0x573e73['id']};});_0x105333&&_0x2ebaa1[_0x2901ab(0x1bd)]({'title':_0x494130[_0x2901ab(0x1cf)](_0x2901ab(0x292)),'value':_0x2901ab(0x22d)});const _0x4223c0=await _0x86a5f5({'type':'select','name':'chatId','message':_0x2901ab(0x218),'choices':_0x2ebaa1,'hint':_0x2901ab(0x26d)});if(!_0x4223c0[_0x2901ab(0x279)])return undefined;if(_0x4223c0[_0x2901ab(0x279)]===_0x2901ab(0x22d)){_0x1d1043+=_0x3943a7;continue;}return _0x4223c0[_0x2901ab(0x279)];}}export class ChatsCommand extends BaseCommand{['name']=a30_0x238769(0x1d4);['description']='Interactive\x20chat\x20selector\x20or\x20show\x20chat\x20history';async[a30_0x238769(0x1c5)](_0x4742a9){const _0x289463=a30_0x238769;return executeChatHistoryCommand(_0x4742a9,_0x289463(0x27e));}}export class LLMLogCommand extends BaseCommand{['name']='llm:log';[a30_0x238769(0x284)]=a30_0x238769(0x259);async['execute'](_0x2a70f3){const _0x3de4d0=a30_0x238769,{options:_0x524a72,args:_0x50c779,tdx:_0x83d991}=_0x2a70f3,_0x37663c=_0x50c779[0x0];if(!_0x37663c)return console['error'](_0x3de4d0(0x291)),console[_0x3de4d0(0x21e)](_0x3de4d0(0x1d6)),0x1;const _0x3e1767=await withSpinner(_0x3de4d0(0x21f)+_0x37663c+'\x27...',()=>_0x83d991[_0x3de4d0(0x1d2)]['getChatLog'](_0x37663c),{'verbose':_0x524a72[_0x3de4d0(0x1eb)]});return await handleSDKOutput(_0x3e1767['data'][_0x3de4d0(0x273)],_0x524a72),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x4230a6=a31_0x3be3;(function(_0x2638ac,_0x12be45){const _0x2f51f7=a31_0x3be3,_0x30fec9=_0x2638ac();while(!![]){try{const _0x3053f7=-parseInt(_0x2f51f7(0x15c))/0x1*(parseInt(_0x2f51f7(0x165))/0x2)+parseInt(_0x2f51f7(0x15a))/0x3*(-parseInt(_0x2f51f7(0x162))/0x4)+parseInt(_0x2f51f7(0x163))/0x5*(parseInt(_0x2f51f7(0x160))/0x6)+-parseInt(_0x2f51f7(0x15b))/0x7*(parseInt(_0x2f51f7(0x159))/0x8)+-parseInt(_0x2f51f7(0x153))/0x9+-parseInt(_0x2f51f7(0x158))/0xa*(parseInt(_0x2f51f7(0x152))/0xb)+parseInt(_0x2f51f7(0x14d))/0xc*(parseInt(_0x2f51f7(0x15d))/0xd);if(_0x3053f7===_0x12be45)break;else _0x30fec9['push'](_0x30fec9['shift']());}catch(_0x52f15c){_0x30fec9['push'](_0x30fec9['shift']());}}}(a31_0x42df,0x89c30));import{BaseCommand}from'./command.js';function a31_0x3be3(_0x5154bc,_0x6c6c7){_0x5154bc=_0x5154bc-0x14d;const _0x42df1e=a31_0x42df();let _0x3be323=_0x42df1e[_0x5154bc];return _0x3be323;}export class MCPCommand extends BaseCommand{['name']=a31_0x4230a6(0x150);[a31_0x4230a6(0x14e)]=a31_0x4230a6(0x14f);async[a31_0x4230a6(0x151)](_0xe3c01b){const _0x309b8d=a31_0x4230a6,{tdx:_0x2fe2cc}=_0xe3c01b,_0x451aa5={};if(process.env.TDX_PROFILE)_0x451aa5['TDX_PROFILE']=process.env.TDX_PROFILE;else{if(process.env.TDX_API_KEY)_0x451aa5[_0x309b8d(0x155)]=process.env.TDX_API_KEY,process.env.TDX_SITE&&(_0x451aa5['TDX_SITE']=process.env.TDX_SITE);else{if(_0x2fe2cc[_0x309b8d(0x167)]['accessToken'])_0x451aa5['TDX_ACCESS_TOKEN']=_0x2fe2cc[_0x309b8d(0x167)][_0x309b8d(0x157)],_0x451aa5[_0x309b8d(0x168)]=_0x2fe2cc[_0x309b8d(0x167)]['site'];else _0x2fe2cc[_0x309b8d(0x167)][_0x309b8d(0x166)]&&(_0x451aa5[_0x309b8d(0x155)]=_0x2fe2cc[_0x309b8d(0x167)]['apiKey'],_0x451aa5['TDX_SITE']=_0x2fe2cc[_0x309b8d(0x167)][_0x309b8d(0x156)]);}}_0x2fe2cc[_0x309b8d(0x167)]['profile']&&(_0x451aa5[_0x309b8d(0x15f)]=_0x2fe2cc[_0x309b8d(0x167)][_0x309b8d(0x164)]);try{const {startMCPServer:_0x42e99d}=await import(_0x309b8d(0x154));return await _0x42e99d({'env':_0x451aa5}),0x0;}catch(_0x23797d){const _0x14be36=_0x23797d instanceof Error?_0x23797d['message']:String(_0x23797d);return console[_0x309b8d(0x15e)](_0x309b8d(0x161)+_0x14be36),0x1;}}}function a31_0x42df(){const _0x4c7569=['execute','22MHhbFY','9317574ZJbUZH','../mcp/server.js','TDX_API_KEY','site','accessToken','1512610cEdHXZ','2684144lJdghK','315AFFYWN','14hkAwNs','53pSsxqx','50653954wYscAD','error','TDX_PROFILE','804ciFvoX','MCP\x20server\x20error:\x20','33716nXhZDJ','3665hDttQA','profile','20246gZKgAK','apiKey','context','TDX_SITE','12hflLvr','description','Start\x20MCP\x20server\x20for\x20AI\x20tool\x20integration','mcp'];a31_0x42df=function(){return _0x4c7569;};return a31_0x42df();}
|