@treasuredata/tdx 2026.3.50 → 2026.3.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/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.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.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.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.d.ts +1 -0
- package/dist/core/oauth.d.ts.map +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/oauth.js.map +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.d.ts +21 -4
- 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.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.js +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/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.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
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a48_0x34cb63=a48_0xe33b;(function(_0x560d24,_0x111c1e){const _0x108b38=a48_0xe33b,_0x3fb603=_0x560d24();while(!![]){try{const _0x440389=parseInt(_0x108b38(0x154))/0x1+parseInt(_0x108b38(0x141))/0x2*(parseInt(_0x108b38(0x131))/0x3)+parseInt(_0x108b38(0x14b))/0x4*(parseInt(_0x108b38(0x130))/0x5)+-parseInt(_0x108b38(0x147))/0x6*(parseInt(_0x108b38(0x125))/0x7)+parseInt(_0x108b38(0x13f))/0x8*(parseInt(_0x108b38(0x159))/0x9)+-parseInt(_0x108b38(0x13b))/0xa*(parseInt(_0x108b38(0x133))/0xb)+-parseInt(_0x108b38(0x157))/0xc;if(_0x440389===_0x111c1e)break;else _0x3fb603['push'](_0x3fb603['shift']());}catch(_0x35e029){_0x3fb603['push'](_0x3fb603['shift']());}}}(a48_0x4665,0x71437));function a48_0x4665(){const _0x17cd87=['.*\x22','includes','listTables','25wGwdOR','1167RITYqK','table_name','22dPgued','table','✖\x20No\x20tables\x20found','Table\x20pattern:\x20','data','cause','Error:\x20Pattern\x20\x27','validate','1453640lqCYre','✔\x20Found\x20','Database\x20pattern:\x20','\x20table','136uQsNHg','Listing\x20tables...','3388tFPOyx','Error:\x20','database','Database:\x20all','Note:\x20\x27','verbose','2517066IadnIU','description','Database\x20\x27','\x27\x20is\x20ambiguous.','531332VOViVx','length','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','Or\x20use\x20--in\x20flag:','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','\x20\x20Cause:\x20','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','📋\x20','\x27\x20across\x20all\x20databases.','10056bAKphS','limit','name','3049224DEJFXE','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','50337whUHDx','execute','Database:\x20','error','\x20\x20Use:\x20tdx\x20tables\x20\x22','database_name','7WAMrCj','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','message','tables','query','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','List\x20tables\x20in\x20a\x20database'];a48_0x4665=function(){return _0x17cd87;};return a48_0x4665();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';function a48_0xe33b(_0x33e0a7,_0x35714e){_0x33e0a7=_0x33e0a7-0x122;const _0x46657f=a48_0x4665();let _0xe33be9=_0x46657f[_0x33e0a7];return _0xe33be9;}import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a48_0x34cb63(0x156)]=a48_0x34cb63(0x129);[a48_0x34cb63(0x148)]=a48_0x34cb63(0x12c);async[a48_0x34cb63(0x15a)](_0x517d0a){const _0x4a1126=a48_0x34cb63,{options:_0x23f7ae,args:_0x904de1,tdx:_0x188ed4}=_0x517d0a;let _0x5ea196;if(_0x904de1[_0x4a1126(0x14c)]===0x0)_0x5ea196={'database':undefined,'table':undefined,'original':''};else{if(_0x904de1['length']===0x1)try{_0x5ea196=parseTableReference(_0x904de1[0x0]);if(_0x5ea196['table']&&!_0x5ea196[_0x4a1126(0x143)]&&!_0x5ea196[_0x4a1126(0x134)][_0x4a1126(0x12e)]('*')&&!_0x5ea196[_0x4a1126(0x134)]['includes']('?'))return console[_0x4a1126(0x122)](_0x4a1126(0x139)+_0x904de1[0x0]+_0x4a1126(0x14a)),console[_0x4a1126(0x122)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x5ea196[_0x4a1126(0x134)]+'\x27?'),console[_0x4a1126(0x122)](_0x4a1126(0x123)+_0x5ea196[_0x4a1126(0x134)]+_0x4a1126(0x12d)),console[_0x4a1126(0x122)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x5ea196['table']),console[_0x4a1126(0x122)](_0x4a1126(0x12b)+_0x5ea196[_0x4a1126(0x134)]),console[_0x4a1126(0x122)](''),console[_0x4a1126(0x122)](_0x4a1126(0x145)+_0x904de1[0x0]+_0x4a1126(0x14f)+_0x5ea196[_0x4a1126(0x134)]+_0x4a1126(0x153)),0x1;}catch(_0x2dbdeb){return console[_0x4a1126(0x122)](_0x4a1126(0x142)+_0x2dbdeb[_0x4a1126(0x128)]),0x1;}else return console['error'](_0x4a1126(0x14d)),console['error'](_0x4a1126(0x151)),console['error'](_0x4a1126(0x158)),console[_0x4a1126(0x122)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console['error'](_0x4a1126(0x127)),console['error'](_0x4a1126(0x14e)),console[_0x4a1126(0x122)](_0x4a1126(0x126)),0x1;}const _0x534717=_0x23f7ae[_0x4a1126(0x143)];!_0x5ea196[_0x4a1126(0x143)]&&_0x534717&&(_0x5ea196[_0x4a1126(0x143)]=_0x534717);try{const _0x331a65=_0x44f3b4=>_0x44f3b4&&(_0x44f3b4[_0x4a1126(0x12e)]('*')||_0x44f3b4[_0x4a1126(0x12e)]('?')),_0x3ef053=_0x331a65(_0x5ea196['database']);_0x23f7ae[_0x4a1126(0x146)]&&(console['error']('Site:\x20'+_0x23f7ae['site']),_0x5ea196[_0x4a1126(0x143)]?_0x3ef053?console['error'](_0x4a1126(0x13d)+_0x5ea196[_0x4a1126(0x143)]):console[_0x4a1126(0x122)](_0x4a1126(0x15b)+_0x5ea196[_0x4a1126(0x143)]):console[_0x4a1126(0x122)](_0x4a1126(0x144)),_0x5ea196[_0x4a1126(0x134)]&&console[_0x4a1126(0x122)](_0x4a1126(0x136)+_0x5ea196['table']));const _0x51eb8a=_0x5ea196[_0x4a1126(0x143)]&&!_0x3ef053?_0x5ea196[_0x4a1126(0x143)]:undefined,_0x96ea0f=_0x3ef053?_0x5ea196[_0x4a1126(0x143)]:undefined,_0x25bb1b=_0x5ea196[_0x4a1126(0x134)],_0xfd689a=resolveLimit(_0x23f7ae[_0x4a1126(0x155)],DEFAULT_LISTING_LIMIT),_0x3a5892=await withSpinner(_0x4a1126(0x140),()=>_0x188ed4[_0x4a1126(0x12a)][_0x4a1126(0x12f)](_0x51eb8a,_0x25bb1b,_0x96ea0f,_0xfd689a),{'verbose':_0x23f7ae[_0x4a1126(0x146)]}),_0xe4fef5=_0x3a5892[_0x4a1126(0x137)];if(_0xe4fef5[_0x4a1126(0x14c)]===0x0&&_0x5ea196[_0x4a1126(0x143)]&&!_0x3ef053)return console[_0x4a1126(0x122)](_0x4a1126(0x135)),console[_0x4a1126(0x122)](_0x4a1126(0x149)+_0x5ea196[_0x4a1126(0x143)]+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;console[_0x4a1126(0x122)](_0x4a1126(0x13c)+_0xe4fef5[_0x4a1126(0x14c)]+_0x4a1126(0x13e)+(_0xe4fef5[_0x4a1126(0x14c)]!==0x1?'s':''));if(isStructuredFormat(_0x23f7ae))await handleSDKOutput(_0xe4fef5,{..._0x23f7ae,'limit':_0xfd689a});else for(const _0x3b9b4d of _0xe4fef5){const _0x518f51=_0x3b9b4d[_0x4a1126(0x124)]?_0x3b9b4d['database_name']+'.':'';console['log'](_0x4a1126(0x152)+_0x518f51+_0x3b9b4d[_0x4a1126(0x132)]);}return 0x0;}catch(_0x1ad222){if(_0x1ad222 instanceof SDKError)return console[_0x4a1126(0x122)](_0x4a1126(0x142)+_0x1ad222[_0x4a1126(0x128)]),_0x1ad222[_0x4a1126(0x138)]&&console[_0x4a1126(0x122)](_0x4a1126(0x150)+_0x1ad222[_0x4a1126(0x138)]),0x1;throw _0x1ad222;}}[a48_0x34cb63(0x13a)](_0x494113){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a49_0x2657(){const _0x58d6c2=['\x0aUpdated:\x20','cleared','cas','6iaaRuO','profile','(session:\x20','4651506VdTOKf','error','Session\x20','.\x20Must\x20be\x20one\x20of:\x20','150690TVWsqS','unset','Invalid\x20resource:\x20','engage_workspace','composable_audience','Clear\x20session-level\x20or\x20default\x20context\x20values','description','includes','llm_agent','validate','name','563140trpbTz','join','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','dim','Usage:\x20tdx\x20unset\x20<resource>\x0a','4236960IfbYvR','session','default','site','16188210vVLWDF','40DtwWCo','agent','13vGribX','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20cas\x0a','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','parent_segment','green','message','1319877GpBxyZ','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','84934xeQGCp','Error:\x20','llm_project'];a49_0x2657=function(){return _0x58d6c2;};return a49_0x2657();}const a49_0x176025=a49_0x4ae3;(function(_0x42712b,_0x1c03ae){const _0x472351=a49_0x4ae3,_0x336d07=_0x42712b();while(!![]){try{const _0x558359=parseInt(_0x472351(0xaf))/0x1*(parseInt(_0x472351(0x8b))/0x2)+-parseInt(_0x472351(0x94))/0x3+parseInt(_0x472351(0xa3))/0x4+-parseInt(_0x472351(0x98))/0x5*(-parseInt(_0x472351(0x91))/0x6)+-parseInt(_0x472351(0xa8))/0x7+parseInt(_0x472351(0xad))/0x8*(parseInt(_0x472351(0xb5))/0x9)+parseInt(_0x472351(0xac))/0xa;if(_0x558359===_0x1c03ae)break;else _0x336d07['push'](_0x336d07['shift']());}catch(_0x8518cf){_0x336d07['push'](_0x336d07['shift']());}}}(a49_0x2657,0xe0702));import{BaseCommand}from'./command.js';import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import a49_0x5760b5 from'chalk';function a49_0x4ae3(_0x341629,_0x3bebcd){_0x341629=_0x341629-0x8b;const _0x26579a=a49_0x2657();let _0x4ae3f2=_0x26579a[_0x341629];return _0x4ae3f2;}import*as a49_0x16ecb4 from'node:path';export class UnsetCommand extends BaseCommand{[a49_0x176025(0xa2)]=a49_0x176025(0x99);[a49_0x176025(0x9e)]=a49_0x176025(0x9d);[a49_0x176025(0xa1)](_0x1b457a){const _0x371c22=a49_0x176025,{args:_0x870d08,options:_0x57453b}=_0x1b457a,_0x268b7f=_0x57453b[_0x371c22(0xaa)];if(_0x870d08['length']===0x0)return _0x371c22(0xa7)+_0x371c22(0xb6)+_0x371c22(0xb0)+_0x371c22(0xb1);const _0x167fa6=_0x870d08[0x0],_0x27aede=[_0x371c22(0xab),'database',_0x371c22(0xb2),_0x371c22(0x8d),_0x371c22(0xae),_0x371c22(0x92),'engage_workspace',_0x371c22(0x90),_0x371c22(0x9c)];if(!_0x27aede[_0x371c22(0x9f)](_0x167fa6))return _0x371c22(0x9a)+_0x167fa6+_0x371c22(0x97)+_0x27aede[_0x371c22(0xa4)](',\x20');if(_0x268b7f&&_0x167fa6!==_0x371c22(0xab)&&_0x167fa6!==_0x371c22(0x92))return _0x371c22(0xa5);return undefined;}async['execute'](_0x1d3f00){const _0x403b9f=a49_0x176025,{args:_0x291c47,options:_0x3fa9b3}=_0x1d3f00,_0x2ed23d=_0x3fa9b3[_0x403b9f(0xaa)];cleanExpiredSessions();try{const _0x4bf59d=_0x291c47[0x0],_0x5c8e85=a49_0x16ecb4['join'](getConfigDir(),'tdx.json');if(_0x2ed23d){if(_0x4bf59d==='site')return clearDefaultSiteFromUserConfig(),console['log']('Default\x20site\x20'+a49_0x5760b5[_0x403b9f(0xb3)](_0x403b9f(0x8f))),console['log'](a49_0x5760b5['dim'](_0x403b9f(0x8e)+_0x5c8e85)),0x0;if(_0x4bf59d===_0x403b9f(0x92))return clearActiveProfileFromUserConfig(),console['log']('Default\x20profile\x20'+a49_0x5760b5[_0x403b9f(0xb3)](_0x403b9f(0x8f))),console['log'](a49_0x5760b5[_0x403b9f(0xa6)](_0x403b9f(0x8e)+_0x5c8e85)),0x0;}const _0x508f5f=getSessionID(_0x3fa9b3[_0x403b9f(0xa9)]),_0x234451={'site':'site','database':'database','parent_segment':'parent_segment','llm_project':_0x403b9f(0x8d),'agent':_0x403b9f(0xa0),'profile':_0x403b9f(0x92),'engage_workspace':_0x403b9f(0x9b),'cas':_0x403b9f(0x9c),'composable_audience':_0x403b9f(0x9c)},_0x2efeb4=_0x234451[_0x4bf59d];return _0x2efeb4&&(clearSessionContextField(_0x2efeb4,_0x3fa9b3[_0x403b9f(0xa9)]),console['log'](_0x403b9f(0x96)+_0x4bf59d+'\x20'+a49_0x5760b5[_0x403b9f(0xb3)]('cleared')+'\x20'+a49_0x5760b5[_0x403b9f(0xa6)](_0x403b9f(0x93)+_0x508f5f+')'))),0x0;}catch(_0x3d4307){return _0x3d4307 instanceof Error&&console[_0x403b9f(0x95)](_0x403b9f(0x8c)+_0x3d4307[_0x403b9f(0xb4)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0x5a0ca3=a50_0x4cc2;(function(_0x39e2e6,_0x38aa67){const _0x3db610=a50_0x4cc2,_0x319ae8=_0x39e2e6();while(!![]){try{const _0x264ff9=-parseInt(_0x3db610(0x1e3))/0x1*(-parseInt(_0x3db610(0x1c8))/0x2)+-parseInt(_0x3db610(0x1c0))/0x3+-parseInt(_0x3db610(0x1d1))/0x4*(parseInt(_0x3db610(0x1dd))/0x5)+parseInt(_0x3db610(0x1d6))/0x6+parseInt(_0x3db610(0x1c9))/0x7+parseInt(_0x3db610(0x1bc))/0x8*(parseInt(_0x3db610(0x1cd))/0x9)+-parseInt(_0x3db610(0x1d5))/0xa*(parseInt(_0x3db610(0x1c7))/0xb);if(_0x264ff9===_0x38aa67)break;else _0x319ae8['push'](_0x319ae8['shift']());}catch(_0x5417b3){_0x319ae8['push'](_0x319ae8['shift']());}}}(a50_0x7b5d,0x607b1));import{gt}from'semver';import a50_0x52ea65 from'chalk';import{BaseCommand}from'./command.js';function a50_0x7b5d(){const _0x2477a7=['...','execute','yarn','description','join','173547xmAjKq','622fDZNto','1674141EoxlJM','Running:','argv','cyan','468fdcPmS','message','bun','includes','317336OzVyhm','dim','latest','npm','290EluYTN','2447220gLhJXG','.bun/','toLowerCase','replace','Target\x20version:','red','green','45GQcKcS','close','dryRun','Would\x20run:','pnpm','yellow','2143wiegpO','add','Checking\x20','error','inherit','execPath','name','@treasuredata/tdx','Already\x20up\x20to\x20date\x20(','Successfully\x20upgraded\x20to\x20','log','91088KeplFe','global','Upgrade\x20is\x20not\x20available\x20for\x20development\x20versions.','Upgrade\x20tdx\x20to\x20the\x20latest\x20version','1016562qYnFOV','next'];a50_0x7b5d=function(){return _0x2477a7;};return a50_0x7b5d();}import{getVersion,isDevVersion}from'../core/version.js';function a50_0x4cc2(_0x15e7b3,_0x414303){_0x15e7b3=_0x15e7b3-0x1b9;const _0x7b5d42=a50_0x7b5d();let _0x4cc238=_0x7b5d42[_0x15e7b3];return _0x4cc238;}import{loadReleaseChannel}from'../core/config.js';import{fetchLatestVersion}from'../utils/version-check.js';import{crossSpawn}from'../utils/process.js';const PACKAGE_NAME=a50_0x5a0ca3(0x1ea);export function detectPackageManager(){const _0xa0ebbd=a50_0x5a0ca3,_0x4d1ea5=process[_0xa0ebbd(0x1e8)][_0xa0ebbd(0x1d8)](),_0x45ea18=process[_0xa0ebbd(0x1cb)][0x1]??'';if(_0x4d1ea5[_0xa0ebbd(0x1d0)](_0xa0ebbd(0x1cf))||_0x45ea18[_0xa0ebbd(0x1d0)](_0xa0ebbd(0x1d7)))return'bun';if(_0x45ea18[_0xa0ebbd(0x1d0)](_0xa0ebbd(0x1e1)))return _0xa0ebbd(0x1e1);if(_0x45ea18['includes'](_0xa0ebbd(0x1c4)))return _0xa0ebbd(0x1c4);return _0xa0ebbd(0x1d4);}export function buildInstallArgs(_0x4598be,_0x4788e7){const _0x2bd16a=a50_0x5a0ca3;switch(_0x4598be){case _0x2bd16a(0x1c4):return[_0x2bd16a(0x1bd),_0x2bd16a(0x1e4),_0x4788e7];case _0x2bd16a(0x1e1):return[_0x2bd16a(0x1e4),'-g',_0x4788e7];default:return['install','-g',_0x4788e7];}}export class UpgradeCommand extends BaseCommand{[a50_0x5a0ca3(0x1e9)]='upgrade';[a50_0x5a0ca3(0x1c5)]=a50_0x5a0ca3(0x1bf);async[a50_0x5a0ca3(0x1c3)](_0xbd7a04){const _0x862735=a50_0x5a0ca3,{options:_0x161b80,args:_0x53e35e}=_0xbd7a04,_0x594eb3=!!_0x161b80[_0x862735(0x1df)],{next:_0x3b076d,method:_0x4e4371}=_0x161b80,_0x303a19=_0x3b076d?_0x862735(0x1c1):loadReleaseChannel(),_0x54b25f=_0x303a19==='next'?_0x862735(0x1c1):_0x862735(0x1d3),_0x41e3e4=_0x53e35e[0x0]?String(_0x53e35e[0x0])[_0x862735(0x1d9)](/^v/,''):undefined,_0x1a6ac0=getVersion();if(isDevVersion())return console[_0x862735(0x1e6)](a50_0x52ea65[_0x862735(0x1e2)](_0x862735(0x1be))),console['error'](a50_0x52ea65[_0x862735(0x1d2)]('Current\x20version:\x20'+_0x1a6ac0)),0x1;let _0x5ece90;if(_0x41e3e4)_0x5ece90=_0x41e3e4,console['log'](a50_0x52ea65[_0x862735(0x1d2)]('Current\x20version:')+'\x20'+_0x1a6ac0),console[_0x862735(0x1bb)](a50_0x52ea65[_0x862735(0x1d2)](_0x862735(0x1da))+'\x20\x20'+a50_0x52ea65['green'](_0x41e3e4)),console[_0x862735(0x1bb)]();else{console[_0x862735(0x1bb)](a50_0x52ea65[_0x862735(0x1d2)](_0x862735(0x1e5)+PACKAGE_NAME+'@'+_0x54b25f+_0x862735(0x1c2)));try{_0x5ece90=await fetchLatestVersion(_0x303a19);}catch(_0x5faec0){return console[_0x862735(0x1e6)](a50_0x52ea65[_0x862735(0x1db)]('Failed\x20to\x20check\x20for\x20updates:\x20'+(_0x5faec0 instanceof Error?_0x5faec0[_0x862735(0x1ce)]:String(_0x5faec0)))),0x1;}if(!gt(_0x5ece90,_0x1a6ac0))return console[_0x862735(0x1bb)](a50_0x52ea65[_0x862735(0x1dc)](_0x862735(0x1b9)+_0x1a6ac0+').')),0x0;console[_0x862735(0x1bb)](a50_0x52ea65[_0x862735(0x1d2)]('Current\x20version:')+'\x20'+_0x1a6ac0),console[_0x862735(0x1bb)](a50_0x52ea65['dim']('Latest\x20version:')+'\x20\x20'+a50_0x52ea65[_0x862735(0x1dc)](_0x5ece90)),console[_0x862735(0x1bb)]();}const _0x1073f2=_0x4e4371??detectPackageManager(),_0x1373b4=_0x41e3e4?PACKAGE_NAME+'@'+_0x41e3e4:PACKAGE_NAME+'@'+_0x54b25f,_0x34d0d4=buildInstallArgs(_0x1073f2,_0x1373b4);if(_0x594eb3)return console['log'](a50_0x52ea65[_0x862735(0x1d2)](_0x862735(0x1e0))),console[_0x862735(0x1bb)]('\x20\x20'+a50_0x52ea65[_0x862735(0x1cc)](_0x1073f2+'\x20'+_0x34d0d4[_0x862735(0x1c6)]('\x20'))),0x0;return console[_0x862735(0x1bb)](a50_0x52ea65[_0x862735(0x1d2)](_0x862735(0x1ca))+'\x20'+_0x1073f2+'\x20'+_0x34d0d4['join']('\x20')),console['log'](),new Promise(_0x1f1f7e=>{const _0x27fede=_0x862735,_0x41e873=crossSpawn(_0x1073f2,_0x34d0d4,{'stdio':_0x27fede(0x1e7)});_0x41e873['on'](_0x27fede(0x1de),_0x315ee7=>{const _0x3db2c9=_0x27fede;console[_0x3db2c9(0x1bb)](),_0x315ee7===0x0?console['log'](a50_0x52ea65[_0x3db2c9(0x1dc)](_0x3db2c9(0x1ba)+_0x1373b4)):console[_0x3db2c9(0x1e6)](a50_0x52ea65[_0x3db2c9(0x1db)]('Upgrade\x20failed\x20(exit\x20code\x20'+_0x315ee7+').')),_0x1f1f7e(_0x315ee7??0x1);}),_0x41e873['on']('error',_0x4cbdcc=>{const _0x380e72=_0x27fede;console['error'](a50_0x52ea65[_0x380e72(0x1db)]('Failed\x20to\x20run\x20'+_0x1073f2+':\x20'+_0x4cbdcc[_0x380e72(0x1ce)])),_0x1f1f7e(0x1);});});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a51_0x1b3df1=a51_0x35f5;(function(_0x4dfd2c,_0x494cfd){const _0x3f3dcc=a51_0x35f5,_0x37301a=_0x4dfd2c();while(!![]){try{const _0x3b1f24=parseInt(_0x3f3dcc(0xdf))/0x1*(-parseInt(_0x3f3dcc(0xc0))/0x2)+parseInt(_0x3f3dcc(0xbd))/0x3*(parseInt(_0x3f3dcc(0xcd))/0x4)+-parseInt(_0x3f3dcc(0xdd))/0x5+-parseInt(_0x3f3dcc(0xb2))/0x6*(-parseInt(_0x3f3dcc(0xa5))/0x7)+-parseInt(_0x3f3dcc(0xeb))/0x8*(parseInt(_0x3f3dcc(0xe4))/0x9)+-parseInt(_0x3f3dcc(0xbe))/0xa*(-parseInt(_0x3f3dcc(0xc7))/0xb)+-parseInt(_0x3f3dcc(0xa4))/0xc*(-parseInt(_0x3f3dcc(0xad))/0xd);if(_0x3b1f24===_0x494cfd)break;else _0x37301a['push'](_0x37301a['shift']());}catch(_0x118ca3){_0x37301a['push'](_0x37301a['shift']());}}}(a51_0x2f40,0x44059));function a51_0x35f5(_0x3a5a72,_0x44e806){_0x3a5a72=_0x3a5a72-0x9d;const _0x2f40fa=a51_0x2f40();let _0x35f5ee=_0x2f40fa[_0x3a5a72];return _0x35f5ee;}import{BaseCommand}from'./command.js';import{saveSessionContext,getSessionID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists,saveActiveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';function a51_0x2f40(){const _0x1ee85a=['Session\x20database\x20set\x20to:\x20','cas','tdx.json','database','log','resolveWorkspaceId','Session\x20agent\x20set\x20to:\x20','error','Invalid\x20resource:\x20','INVALID_ARGUMENT','\x27\x20to\x20save\x20permanently','2056575Mdzhta','Session\x20site\x20set\x20to:\x20','14019kCbqsV','default','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20cas,\x20release_channel\x0a','parent_segment','Session\x20llm_project\x20set\x20to:\x20','824013FXSmbF','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20','llm_project','name','\x0aUpdate\x20notifications\x20will\x20check\x20the\x20@latest\x20(stable)\x20channel.','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','code','24EFshGH','composable_audience','site','agent','.\x20Must\x20be\x20\x27stable\x27\x20or\x20\x27next\x27.','includes','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>\x20\x20#\x20Set\x20release\x20channel\x0a','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','Use\x20--default\x20with\x20site,\x20profile,\x20or\x20release_channel\x20to\x20save\x20permanently','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a','.\x20Must\x20be\x20one\x20of:\x20','\x27\x20does\x20not\x20exist','NOT_FOUND','\x0aSaved\x20to:\x20','Session\x20context\x20','7572rjqqmz','294Uotrlx','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','engage_workspace','(session:\x20','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','next','engage','Set\x20session-level\x20context','25597ChVEth','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','Session\x20engage_workspace\x20set\x20to:\x20','dim','message','23742QcbTXq','validate','Install\x20the\x20latest\x20next\x20version:\x20npm\x20install\x20-g\x20@treasuredata/tdx@next','profile','Default\x20site\x20set\x20to:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','Session\x20composable_audience\x20set\x20to:\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20','\x0aUpdate\x20notifications\x20will\x20now\x20check\x20the\x20@next\x20channel.','execute','Error:\x20Profile\x20\x27','177609sxRcnZ','77350pBhUMw','Session\x20profile\x20set\x20to:\x20','74VYVHEG','Release\x20channel\x20set\x20to:\x20','Error:\x20','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27,\x20\x27profile\x27,\x20or\x20\x27release_channel\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','Invalid\x20release\x20channel:\x20','\x27...','Session\x20parent_segment\x20set\x20to:\x20','22HVmMYf','llm_agent','release_channel','session','length','use','4tlRrCQ','clear','green','Default\x20profile\x20set\x20to:\x20','\x0aUse\x20\x27tdx\x20engage\x20workspace\x20list\x27\x20to\x20see\x20available\x20workspaces'];a51_0x2f40=function(){return _0x1ee85a;};return a51_0x2f40();}import{GlobalContext}from'../core/global-context.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{getConfigDir,saveReleaseChannel}from'../core/config.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import a51_0x128522 from'chalk';import*as a51_0x13410d from'node:path';export class UseCommand extends BaseCommand{[a51_0x1b3df1(0xe7)]=a51_0x1b3df1(0xcc);['description']=a51_0x1b3df1(0xac);[a51_0x1b3df1(0xb3)](_0x422e35){const _0x2ec6b5=a51_0x1b3df1,{args:_0x384bd1,options:_0x2a6552}=_0x422e35,_0xa2876f=_0x2a6552[_0x2ec6b5(0xe0)];if(_0x384bd1[_0x2ec6b5(0xcb)]===0x0)return undefined;if(_0x384bd1[_0x2ec6b5(0xcb)]===0x1)return _0x2ec6b5(0xf2)+_0x2ec6b5(0xb7)+_0x2ec6b5(0xa6)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a'+_0x2ec6b5(0x9e)+_0x2ec6b5(0xf1)+_0x2ec6b5(0xe1)+_0x2ec6b5(0xae);const _0x273706=_0x384bd1[0x0],_0x4a7002=[_0x2ec6b5(0xed),_0x2ec6b5(0xd5),_0x2ec6b5(0xe2),'llm_project',_0x2ec6b5(0xee),_0x2ec6b5(0xb5),_0x2ec6b5(0xa7),_0x2ec6b5(0xd3),_0x2ec6b5(0xec),'release_channel'];if(!_0x4a7002[_0x2ec6b5(0xf0)](_0x273706))return _0x2ec6b5(0xda)+_0x273706+_0x2ec6b5(0x9f)+_0x4a7002['join'](',\x20');if(_0xa2876f&&_0x273706!==_0x2ec6b5(0xed)&&_0x273706!=='profile'&&_0x273706!==_0x2ec6b5(0xc9))return _0x2ec6b5(0xc3);if(_0x273706==='release_channel'&&!_0xa2876f)return'release_channel\x20requires\x20--default.\x20Usage:\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>';if(_0x273706===_0x2ec6b5(0xc9)){const _0x23fa22=_0x384bd1[0x1];if(_0x23fa22!=='stable'&&_0x23fa22!==_0x2ec6b5(0xaa))return _0x2ec6b5(0xc4)+_0x23fa22+_0x2ec6b5(0xef);}return undefined;}async[a51_0x1b3df1(0xbb)](_0x3b8588){const _0x204445=a51_0x1b3df1,{args:_0x448c6d,options:_0x3e8a39}=_0x3b8588,_0x535002=_0x3e8a39['debug'],_0x59301f=_0x3e8a39[_0x204445(0xce)],_0x679850=_0x3e8a39[_0x204445(0xe0)];cleanExpiredSessions();try{if(_0x59301f){clearSessionContext(_0x3e8a39['session']);const _0x2e6205=getSessionID(_0x3e8a39[_0x204445(0xca)]);return console[_0x204445(0xd6)](_0x204445(0xa3)+a51_0x128522['green']('cleared')+'\x20'+a51_0x128522[_0x204445(0xb0)]('(session:\x20'+_0x2e6205+')')),0x0;}if(_0x448c6d[_0x204445(0xcb)]===0x0){const _0x27801c=new GlobalContext(_0x3e8a39);return _0x535002?_0x27801c['displayWithSources']():_0x27801c['display'](),console[_0x204445(0xd6)](a51_0x128522[_0x204445(0xb0)](_0x204445(0xe9))),console[_0x204445(0xd6)](a51_0x128522['dim']('Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel')),console[_0x204445(0xd6)](a51_0x128522['dim'](_0x204445(0x9d))),0x0;}const _0x4f6d65=_0x448c6d[0x0],_0x369089=_0x448c6d[0x1],_0x4f8083=a51_0x13410d['join'](getConfigDir(),_0x204445(0xd4));if(_0x679850){if(_0x4f6d65===_0x204445(0xed))return saveDefaultSiteToUserConfig(_0x369089),console['log'](_0x204445(0xb6)+a51_0x128522[_0x204445(0xcf)](_0x369089)),console[_0x204445(0xd6)](a51_0x128522[_0x204445(0xb0)](_0x204445(0xa2)+_0x4f8083)),0x0;if(_0x4f6d65==='profile'){if(!profileExists(_0x369089))return console['error']('Error:\x20Profile\x20\x27'+_0x369089+_0x204445(0xa0)),console[_0x204445(0xd9)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;return saveActiveProfileToUserConfig(_0x369089),console[_0x204445(0xd6)](_0x204445(0xd0)+a51_0x128522['green'](_0x369089)),console[_0x204445(0xd6)](a51_0x128522[_0x204445(0xb0)](_0x204445(0xa2)+_0x4f8083)),0x0;}if(_0x4f6d65==='release_channel')return saveReleaseChannel(_0x369089),console[_0x204445(0xd6)](_0x204445(0xc1)+a51_0x128522[_0x204445(0xcf)](_0x369089)),console[_0x204445(0xd6)](a51_0x128522[_0x204445(0xb0)](_0x204445(0xa2)+_0x4f8083)),_0x369089==='next'?(console[_0x204445(0xd6)](a51_0x128522[_0x204445(0xb0)](_0x204445(0xba))),console[_0x204445(0xd6)](a51_0x128522['dim'](_0x204445(0xb4)))):console['log'](a51_0x128522['dim'](_0x204445(0xe8))),0x0;}if(_0x4f6d65==='site'){const _0xd4a7b7=getSessionID(_0x3e8a39[_0x204445(0xca)]);return saveSessionContext({'site':_0x369089},_0x3e8a39[_0x204445(0xca)]),console[_0x204445(0xd6)](_0x204445(0xde)+a51_0x128522[_0x204445(0xcf)](_0x369089)+'\x20'+a51_0x128522['dim'](_0x204445(0xa8)+_0xd4a7b7+')')),console[_0x204445(0xd6)](a51_0x128522[_0x204445(0xb0)](_0x204445(0xb9)+_0x369089+_0x204445(0xdc))),0x0;}if(_0x4f6d65===_0x204445(0xb5)){if(!profileExists(_0x369089))return console['error'](_0x204445(0xbc)+_0x369089+_0x204445(0xa0)),console[_0x204445(0xd9)](_0x204445(0xa9)),0x1;const _0x18dcbd=getSessionID(_0x3e8a39['session']);return saveSessionContext({'profile':_0x369089},_0x3e8a39[_0x204445(0xca)]),console[_0x204445(0xd6)](_0x204445(0xbf)+a51_0x128522[_0x204445(0xcf)](_0x369089)+'\x20'+a51_0x128522[_0x204445(0xb0)](_0x204445(0xa8)+_0x18dcbd+')')),console[_0x204445(0xd6)](a51_0x128522[_0x204445(0xb0)](_0x204445(0xe5)+_0x369089+'\x27\x20to\x20save\x20permanently')),0x0;}const _0x1122b2={},_0x38320c=getSessionID(_0x3e8a39[_0x204445(0xca)]);switch(_0x4f6d65){case _0x204445(0xd5):_0x1122b2['database']=_0x369089,console[_0x204445(0xd6)](_0x204445(0xd2)+a51_0x128522[_0x204445(0xcf)](_0x369089)+'\x20'+a51_0x128522[_0x204445(0xb0)](_0x204445(0xa8)+_0x38320c+')'));break;case _0x204445(0xe2):_0x1122b2[_0x204445(0xe2)]=_0x369089,console['log'](_0x204445(0xc6)+a51_0x128522[_0x204445(0xcf)](_0x369089)+'\x20'+a51_0x128522[_0x204445(0xb0)](_0x204445(0xa8)+_0x38320c+')'));break;case _0x204445(0xe6):_0x1122b2['llm_project']=_0x369089,console['log']('Session\x20llm_project\x20set\x20to:\x20'+a51_0x128522[_0x204445(0xcf)](_0x369089)+'\x20'+a51_0x128522[_0x204445(0xb0)](_0x204445(0xa8)+_0x38320c+')'));break;case'agent':{const {projectName:_0xbe2446,agentName:_0x4d8b4e}=parseAgentRef(_0x369089);_0x4d8b4e?(_0x1122b2[_0x204445(0xe6)]=_0xbe2446,_0x1122b2[_0x204445(0xc8)]=_0x4d8b4e,console[_0x204445(0xd6)](_0x204445(0xe3)+a51_0x128522[_0x204445(0xcf)](_0xbe2446)+'\x20'+a51_0x128522[_0x204445(0xb0)](_0x204445(0xa8)+_0x38320c+')')),console['log'](_0x204445(0xd8)+a51_0x128522[_0x204445(0xcf)](_0x4d8b4e)+'\x20'+a51_0x128522[_0x204445(0xb0)](_0x204445(0xa8)+_0x38320c+')'))):(_0x1122b2[_0x204445(0xc8)]=_0x369089,console['log']('Session\x20agent\x20set\x20to:\x20'+a51_0x128522[_0x204445(0xcf)](_0x369089)+'\x20'+a51_0x128522[_0x204445(0xb0)](_0x204445(0xa8)+_0x38320c+')')));break;}case'cas':case _0x204445(0xec):_0x1122b2[_0x204445(0xec)]=_0x369089,console[_0x204445(0xd6)](_0x204445(0xb8)+a51_0x128522[_0x204445(0xcf)](_0x369089)+'\x20'+a51_0x128522['dim']('(session:\x20'+_0x38320c+')'));break;case _0x204445(0xa7):{try{await withSpinner('Verifying\x20workspace\x20\x27'+_0x369089+_0x204445(0xc5),()=>_0x3b8588['tdx'][_0x204445(0xab)][_0x204445(0xd7)](_0x369089));}catch(_0x5c3775){if(_0x5c3775 instanceof SDKError&&(_0x5c3775[_0x204445(0xea)]===ErrorCode[_0x204445(0xa1)]||_0x5c3775[_0x204445(0xea)]===ErrorCode[_0x204445(0xdb)]))return console[_0x204445(0xd9)](_0x204445(0xc2)+_0x5c3775['message']),console[_0x204445(0xd9)](_0x204445(0xd1)),0x1;throw _0x5c3775;}_0x1122b2['engage_workspace']=_0x369089,console['log'](_0x204445(0xaf)+a51_0x128522[_0x204445(0xcf)](_0x369089)+'\x20'+a51_0x128522[_0x204445(0xb0)](_0x204445(0xa8)+_0x38320c+')'));break;}}return saveSessionContext(_0x1122b2,_0x3e8a39['session']),console[_0x204445(0xd6)](a51_0x128522[_0x204445(0xb0)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}catch(_0x3f7ae0){return _0x3f7ae0 instanceof Error&&console['error'](_0x204445(0xc2)+_0x3f7ae0[_0x204445(0xb1)]),0x1;}}}
|
|
1
|
+
function a51_0x2a22(_0x390d1a,_0x1f6bdb){_0x390d1a=_0x390d1a-0x1cc;const _0x2caa1d=a51_0x2caa();let _0x2a2270=_0x2caa1d[_0x390d1a];return _0x2a2270;}const a51_0x2e24f0=a51_0x2a22;(function(_0x3d5241,_0x5baefe){const _0x5c588d=a51_0x2a22,_0x34f406=_0x3d5241();while(!![]){try{const _0x3cc608=parseInt(_0x5c588d(0x1d2))/0x1+parseInt(_0x5c588d(0x20e))/0x2+parseInt(_0x5c588d(0x20f))/0x3+parseInt(_0x5c588d(0x1f5))/0x4+-parseInt(_0x5c588d(0x1e6))/0x5+parseInt(_0x5c588d(0x209))/0x6+-parseInt(_0x5c588d(0x1e4))/0x7;if(_0x3cc608===_0x5baefe)break;else _0x34f406['push'](_0x34f406['shift']());}catch(_0x35612a){_0x34f406['push'](_0x34f406['shift']());}}}(a51_0x2caa,0x814e3));import{BaseCommand}from'./command.js';import{saveSessionContext,getSessionID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists,saveActiveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{getConfigDir,saveReleaseChannel}from'../core/config.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import a51_0x5b02e5 from'chalk';import*as a51_0x5e39f1 from'node:path';function a51_0x2caa(){const _0x151ffa=['\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20','Session\x20agent\x20set\x20to:\x20','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20cas,\x20release_channel\x0a','1054652QiqoGd','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a','engage_workspace','tdx','next','default','database','NOT_FOUND','stable','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','engage','session','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','description','dim','Session\x20context\x20','\x27\x20to\x20save\x20permanently','Invalid\x20release\x20channel:\x20','18003902ZOXUPO','green','354930JdHIam','agent','code','Install\x20the\x20latest\x20next\x20version:\x20npm\x20install\x20-g\x20@treasuredata/tdx@next','parent_segment','Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel','cas','Set\x20session-level\x20context','site','\x0aUpdate\x20notifications\x20will\x20check\x20the\x20@latest\x20(stable)\x20channel.','clear','\x0aUpdate\x20notifications\x20will\x20now\x20check\x20the\x20@next\x20channel.','message','displayWithSources','join','2624712pWPJKe','cleared','Error:\x20Profile\x20\x27','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','composable_audience','Session\x20profile\x20set\x20to:\x20','\x27...','validate','release_channel\x20requires\x20--default.\x20Usage:\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>','log','Default\x20profile\x20set\x20to:\x20','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27,\x20\x27profile\x27,\x20or\x20\x27release_channel\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','\x27\x20does\x20not\x20exist','profile','Error:\x20','length','llm_agent','display','Session\x20composable_audience\x20set\x20to:\x20','Session\x20database\x20set\x20to:\x20','1392996JzyLGy','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','error','Session\x20engage_workspace\x20set\x20to:\x20','752316VtAdfI','2560359yhSlZV','(session:\x20','execute','includes','INVALID_ARGUMENT','Verifying\x20workspace\x20\x27','tdx.json','Session\x20llm_project\x20set\x20to:\x20','\x0aSaved\x20to:\x20','.\x20Must\x20be\x20\x27stable\x27\x20or\x20\x27next\x27.','release_channel','llm_project'];a51_0x2caa=function(){return _0x151ffa;};return a51_0x2caa();}export class UseCommand extends BaseCommand{[a51_0x2e24f0(0x20a)]='use';[a51_0x2e24f0(0x1df)]=a51_0x2e24f0(0x1ed);[a51_0x2e24f0(0x1fc)](_0x2796fe){const _0x3b0234=a51_0x2e24f0,{args:_0x2f47ed,options:_0x484442}=_0x2796fe,_0x23346c=_0x484442[_0x3b0234(0x1d7)];if(_0x2f47ed['length']===0x0)return undefined;if(_0x2f47ed[_0x3b0234(0x204)]===0x1)return _0x3b0234(0x1f8)+_0x3b0234(0x20b)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+_0x3b0234(0x1d3)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>\x20\x20#\x20Set\x20release\x20channel\x0a'+_0x3b0234(0x1d1)+_0x3b0234(0x1db);const _0x3a6250=_0x2f47ed[0x0],_0xca2e8f=[_0x3b0234(0x1ee),_0x3b0234(0x1d8),_0x3b0234(0x1ea),_0x3b0234(0x1ce),_0x3b0234(0x1e7),_0x3b0234(0x202),_0x3b0234(0x1d4),_0x3b0234(0x1ec),_0x3b0234(0x1f9),_0x3b0234(0x1cd)];if(!_0xca2e8f[_0x3b0234(0x212)](_0x3a6250))return'Invalid\x20resource:\x20'+_0x3a6250+'.\x20Must\x20be\x20one\x20of:\x20'+_0xca2e8f[_0x3b0234(0x1f4)](',\x20');if(_0x23346c&&_0x3a6250!==_0x3b0234(0x1ee)&&_0x3a6250!=='profile'&&_0x3a6250!==_0x3b0234(0x1cd))return _0x3b0234(0x200);if(_0x3a6250===_0x3b0234(0x1cd)&&!_0x23346c)return _0x3b0234(0x1fd);if(_0x3a6250===_0x3b0234(0x1cd)){const _0x249ad2=_0x2f47ed[0x1];if(_0x249ad2!==_0x3b0234(0x1da)&&_0x249ad2!==_0x3b0234(0x1d6))return _0x3b0234(0x1e3)+_0x249ad2+_0x3b0234(0x1cc);}return undefined;}async[a51_0x2e24f0(0x211)](_0x1c761b){const _0x1de3b5=a51_0x2e24f0,{args:_0x1c9f6d,options:_0xb9e72c}=_0x1c761b,_0x16ac75=_0xb9e72c['debug'],_0x2daf6b=_0xb9e72c[_0x1de3b5(0x1f0)],_0x5c619a=_0xb9e72c[_0x1de3b5(0x1d7)];cleanExpiredSessions();try{if(_0x2daf6b){clearSessionContext(_0xb9e72c[_0x1de3b5(0x1dd)]);const _0x350ea4=getSessionID(_0xb9e72c[_0x1de3b5(0x1dd)]);return console[_0x1de3b5(0x1fe)](_0x1de3b5(0x1e1)+a51_0x5b02e5['green'](_0x1de3b5(0x1f6))+'\x20'+a51_0x5b02e5[_0x1de3b5(0x1e0)](_0x1de3b5(0x210)+_0x350ea4+')')),0x0;}if(_0x1c9f6d['length']===0x0){const _0x4a38b2=new GlobalContext(_0xb9e72c);return _0x16ac75?_0x4a38b2[_0x1de3b5(0x1f3)]():_0x4a38b2[_0x1de3b5(0x206)](),console[_0x1de3b5(0x1fe)](a51_0x5b02e5[_0x1de3b5(0x1e0)](_0x1de3b5(0x1de))),console[_0x1de3b5(0x1fe)](a51_0x5b02e5[_0x1de3b5(0x1e0)](_0x1de3b5(0x1eb))),console[_0x1de3b5(0x1fe)](a51_0x5b02e5[_0x1de3b5(0x1e0)]('Use\x20--default\x20with\x20site,\x20profile,\x20or\x20release_channel\x20to\x20save\x20permanently')),0x0;}const _0x3bc70b=_0x1c9f6d[0x0],_0x4579f3=_0x1c9f6d[0x1],_0x1624d4=a51_0x5e39f1[_0x1de3b5(0x1f4)](getConfigDir(),_0x1de3b5(0x215));if(_0x5c619a){if(_0x3bc70b===_0x1de3b5(0x1ee))return saveDefaultSiteToUserConfig(_0x4579f3),console[_0x1de3b5(0x1fe)]('Default\x20site\x20set\x20to:\x20'+a51_0x5b02e5[_0x1de3b5(0x1e5)](_0x4579f3)),console['log'](a51_0x5b02e5[_0x1de3b5(0x1e0)](_0x1de3b5(0x217)+_0x1624d4)),0x0;if(_0x3bc70b===_0x1de3b5(0x202)){if(!profileExists(_0x4579f3))return console[_0x1de3b5(0x20c)](_0x1de3b5(0x1f7)+_0x4579f3+_0x1de3b5(0x201)),console[_0x1de3b5(0x20c)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;return saveActiveProfileToUserConfig(_0x4579f3),console[_0x1de3b5(0x1fe)](_0x1de3b5(0x1ff)+a51_0x5b02e5[_0x1de3b5(0x1e5)](_0x4579f3)),console[_0x1de3b5(0x1fe)](a51_0x5b02e5['dim'](_0x1de3b5(0x217)+_0x1624d4)),0x0;}if(_0x3bc70b===_0x1de3b5(0x1cd))return saveReleaseChannel(_0x4579f3),console[_0x1de3b5(0x1fe)]('Release\x20channel\x20set\x20to:\x20'+a51_0x5b02e5[_0x1de3b5(0x1e5)](_0x4579f3)),console['log'](a51_0x5b02e5[_0x1de3b5(0x1e0)](_0x1de3b5(0x217)+_0x1624d4)),_0x4579f3===_0x1de3b5(0x1d6)?(console[_0x1de3b5(0x1fe)](a51_0x5b02e5[_0x1de3b5(0x1e0)](_0x1de3b5(0x1f1))),console[_0x1de3b5(0x1fe)](a51_0x5b02e5[_0x1de3b5(0x1e0)](_0x1de3b5(0x1e9)))):console[_0x1de3b5(0x1fe)](a51_0x5b02e5[_0x1de3b5(0x1e0)](_0x1de3b5(0x1ef))),0x0;}if(_0x3bc70b==='site'){const _0x6d1f08=getSessionID(_0xb9e72c[_0x1de3b5(0x1dd)]);return saveSessionContext({'site':_0x4579f3},_0xb9e72c[_0x1de3b5(0x1dd)]),console['log']('Session\x20site\x20set\x20to:\x20'+a51_0x5b02e5[_0x1de3b5(0x1e5)](_0x4579f3)+'\x20'+a51_0x5b02e5[_0x1de3b5(0x1e0)](_0x1de3b5(0x210)+_0x6d1f08+')')),console[_0x1de3b5(0x1fe)](a51_0x5b02e5['dim']('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20'+_0x4579f3+_0x1de3b5(0x1e2))),0x0;}if(_0x3bc70b==='profile'){if(!profileExists(_0x4579f3))return console[_0x1de3b5(0x20c)]('Error:\x20Profile\x20\x27'+_0x4579f3+'\x27\x20does\x20not\x20exist'),console[_0x1de3b5(0x20c)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x533675=getSessionID(_0xb9e72c[_0x1de3b5(0x1dd)]);return saveSessionContext({'profile':_0x4579f3},_0xb9e72c[_0x1de3b5(0x1dd)]),console['log'](_0x1de3b5(0x1fa)+a51_0x5b02e5['green'](_0x4579f3)+'\x20'+a51_0x5b02e5['dim'](_0x1de3b5(0x210)+_0x533675+')')),console[_0x1de3b5(0x1fe)](a51_0x5b02e5[_0x1de3b5(0x1e0)](_0x1de3b5(0x1cf)+_0x4579f3+'\x27\x20to\x20save\x20permanently')),0x0;}const _0x3eda65={},_0x3bdd3c=getSessionID(_0xb9e72c['session']);switch(_0x3bc70b){case _0x1de3b5(0x1d8):_0x3eda65[_0x1de3b5(0x1d8)]=_0x4579f3,console[_0x1de3b5(0x1fe)](_0x1de3b5(0x208)+a51_0x5b02e5[_0x1de3b5(0x1e5)](_0x4579f3)+'\x20'+a51_0x5b02e5['dim'](_0x1de3b5(0x210)+_0x3bdd3c+')'));break;case _0x1de3b5(0x1ea):_0x3eda65['parent_segment']=_0x4579f3,console[_0x1de3b5(0x1fe)]('Session\x20parent_segment\x20set\x20to:\x20'+a51_0x5b02e5['green'](_0x4579f3)+'\x20'+a51_0x5b02e5[_0x1de3b5(0x1e0)](_0x1de3b5(0x210)+_0x3bdd3c+')'));break;case _0x1de3b5(0x1ce):_0x3eda65[_0x1de3b5(0x1ce)]=_0x4579f3,console[_0x1de3b5(0x1fe)](_0x1de3b5(0x216)+a51_0x5b02e5['green'](_0x4579f3)+'\x20'+a51_0x5b02e5[_0x1de3b5(0x1e0)](_0x1de3b5(0x210)+_0x3bdd3c+')'));break;case _0x1de3b5(0x1e7):{const {projectName:_0xe7537a,agentName:_0x526413}=parseAgentRef(_0x4579f3);_0x526413?(_0x3eda65[_0x1de3b5(0x1ce)]=_0xe7537a,_0x3eda65[_0x1de3b5(0x205)]=_0x526413,console[_0x1de3b5(0x1fe)](_0x1de3b5(0x216)+a51_0x5b02e5[_0x1de3b5(0x1e5)](_0xe7537a)+'\x20'+a51_0x5b02e5[_0x1de3b5(0x1e0)]('(session:\x20'+_0x3bdd3c+')')),console[_0x1de3b5(0x1fe)](_0x1de3b5(0x1d0)+a51_0x5b02e5[_0x1de3b5(0x1e5)](_0x526413)+'\x20'+a51_0x5b02e5[_0x1de3b5(0x1e0)](_0x1de3b5(0x210)+_0x3bdd3c+')'))):(_0x3eda65[_0x1de3b5(0x205)]=_0x4579f3,console[_0x1de3b5(0x1fe)](_0x1de3b5(0x1d0)+a51_0x5b02e5[_0x1de3b5(0x1e5)](_0x4579f3)+'\x20'+a51_0x5b02e5['dim'](_0x1de3b5(0x210)+_0x3bdd3c+')')));break;}case'cas':case _0x1de3b5(0x1f9):_0x3eda65[_0x1de3b5(0x1f9)]=_0x4579f3,console[_0x1de3b5(0x1fe)](_0x1de3b5(0x207)+a51_0x5b02e5['green'](_0x4579f3)+'\x20'+a51_0x5b02e5[_0x1de3b5(0x1e0)](_0x1de3b5(0x210)+_0x3bdd3c+')'));break;case'engage_workspace':{try{await withSpinner(_0x1de3b5(0x214)+_0x4579f3+_0x1de3b5(0x1fb),()=>_0x1c761b[_0x1de3b5(0x1d5)][_0x1de3b5(0x1dc)]['resolveWorkspaceId'](_0x4579f3));}catch(_0x28e5e6){if(_0x28e5e6 instanceof SDKError&&(_0x28e5e6[_0x1de3b5(0x1e8)]===ErrorCode[_0x1de3b5(0x1d9)]||_0x28e5e6[_0x1de3b5(0x1e8)]===ErrorCode[_0x1de3b5(0x213)]))return console['error']('Error:\x20'+_0x28e5e6[_0x1de3b5(0x1f2)]),console[_0x1de3b5(0x20c)]('\x0aUse\x20\x27tdx\x20engage\x20workspace\x20list\x27\x20to\x20see\x20available\x20workspaces'),0x1;throw _0x28e5e6;}_0x3eda65[_0x1de3b5(0x1d4)]=_0x4579f3,console['log'](_0x1de3b5(0x20d)+a51_0x5b02e5[_0x1de3b5(0x1e5)](_0x4579f3)+'\x20'+a51_0x5b02e5[_0x1de3b5(0x1e0)](_0x1de3b5(0x210)+_0x3bdd3c+')'));break;}}return saveSessionContext(_0x3eda65,_0xb9e72c[_0x1de3b5(0x1dd)]),console[_0x1de3b5(0x1fe)](a51_0x5b02e5[_0x1de3b5(0x1e0)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}catch(_0x3cb840){return _0x3cb840 instanceof Error&&console[_0x1de3b5(0x20c)](_0x1de3b5(0x203)+_0x3cb840[_0x1de3b5(0x1f2)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a52_0x637a(_0x4ecf05,_0x19c918){_0x4ecf05=_0x4ecf05-0x66;const _0x4e3e9c=a52_0x4e3e();let _0x637a51=_0x4e3e9c[_0x4ecf05];return _0x637a51;}const a52_0x3023e0=a52_0x637a;(function(_0x38b8a6,_0x4b4685){const _0x2ab32d=a52_0x637a,_0x438f18=_0x38b8a6();while(!![]){try{const _0x5e1347=parseInt(_0x2ab32d(0x84))/0x1+-parseInt(_0x2ab32d(0x86))/0x2+-parseInt(_0x2ab32d(0x72))/0x3*(-parseInt(_0x2ab32d(0x6d))/0x4)+-parseInt(_0x2ab32d(0x81))/0x5+-parseInt(_0x2ab32d(0x82))/0x6+-parseInt(_0x2ab32d(0x78))/0x7*(parseInt(_0x2ab32d(0x75))/0x8)+parseInt(_0x2ab32d(0x7b))/0x9;if(_0x5e1347===_0x4b4685)break;else _0x438f18['push'](_0x438f18['shift']());}catch(_0x15ebb6){_0x438f18['push'](_0x438f18['shift']());}}}(a52_0x4e3e,0x68aac));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a52_0x4e3e(){const _0x4e7a3d=['message','16987212qtxniV','Error:\x20','dim','account_owner','List\x20all\x20users\x20in\x20the\x20account','description','460310SEFfcB','1829370naQBcD','Unknown','553154FszKWd','Show\x20current\x20user\x20information','1664410cdSczy','length','Listing\x20users...','user','Fetching\x20user\x20info...','log','name','sort','\x20(owner)','user\x20list','execute','\x20\x20Cause:\x20','744pWZpIu','cause','verbose','email','error','438vVpgTG','data','administrator','92560COGtUf','getCurrent','yellow','490ABIeFu','\x20user'];a52_0x4e3e=function(){return _0x4e7a3d;};return a52_0x4e3e();}import a52_0x51c975 from'chalk';export class UserCommand extends BaseCommand{[a52_0x3023e0(0x67)]=a52_0x3023e0(0x89);[a52_0x3023e0(0x80)]=a52_0x3023e0(0x85);async[a52_0x3023e0(0x6b)](_0x43775e){const _0x12471f=a52_0x3023e0,{options:_0x198c5c,tdx:_0x5d7c25}=_0x43775e;try{const _0x53786f=await withSpinner(_0x12471f(0x8a),()=>_0x5d7c25[_0x12471f(0x89)][_0x12471f(0x76)](),{'verbose':_0x198c5c[_0x12471f(0x6f)]}),_0x2c8da0=_0x53786f[_0x12471f(0x73)];return await handleSingleObjectOutput(_0x2c8da0,_0x198c5c),0x0;}catch(_0x55992f){if(_0x55992f instanceof SDKError)return console[_0x12471f(0x71)](_0x12471f(0x7c)+_0x55992f[_0x12471f(0x7a)]),_0x55992f[_0x12471f(0x6e)]&&console['error'](_0x12471f(0x6c)+_0x55992f[_0x12471f(0x6e)]),0x1;throw _0x55992f;}}}export class UserListCommand extends BaseCommand{[a52_0x3023e0(0x67)]=a52_0x3023e0(0x6a);['description']=a52_0x3023e0(0x7f);async['execute'](_0x42e2a8){const _0x5c0b08=a52_0x3023e0,{options:_0x14d273,tdx:_0x1a311c}=_0x42e2a8;try{const _0x28372e=await withSpinner(_0x5c0b08(0x88),()=>_0x1a311c[_0x5c0b08(0x89)]['list'](),{'verbose':_0x14d273[_0x5c0b08(0x6f)]}),_0x4163a6=_0x28372e[_0x5c0b08(0x73)];console[_0x5c0b08(0x71)]('✔\x20Found\x20'+_0x4163a6[_0x5c0b08(0x87)]+_0x5c0b08(0x79)+(_0x4163a6[_0x5c0b08(0x87)]!==0x1?'s':''));if(isStructuredFormat(_0x14d273))await handleSDKOutput(_0x4163a6,_0x14d273);else{const _0x115897=[..._0x4163a6][_0x5c0b08(0x68)]((_0xc45dbf,_0x2a25b1)=>String(_0xc45dbf['name']??'')['localeCompare'](String(_0x2a25b1[_0x5c0b08(0x67)]??'')));for(const _0x1bfe16 of _0x115897){const _0x98edf=_0x1bfe16[_0x5c0b08(0x7e)]?a52_0x51c975[_0x5c0b08(0x77)](_0x5c0b08(0x69)):_0x1bfe16[_0x5c0b08(0x74)]?a52_0x51c975['yellow']('\x20(admin)'):'',_0x1a44b1=_0x1bfe16[_0x5c0b08(0x70)]&&_0x1bfe16[_0x5c0b08(0x70)]!==_0x1bfe16['name']?a52_0x51c975[_0x5c0b08(0x7d)]('\x20<'+_0x1bfe16[_0x5c0b08(0x70)]+'>'):'';console[_0x5c0b08(0x66)]('👤\x20'+(_0x1bfe16[_0x5c0b08(0x67)]??_0x5c0b08(0x83))+_0x1a44b1+_0x98edf);}}return 0x0;}catch(_0x276645){if(_0x276645 instanceof SDKError)return console[_0x5c0b08(0x71)](_0x5c0b08(0x7c)+_0x276645['message']),_0x276645[_0x5c0b08(0x6e)]&&console[_0x5c0b08(0x71)]('\x20\x20Cause:\x20'+_0x276645[_0x5c0b08(0x6e)]),0x1;throw _0x276645;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a53_0x3cf9b1=a53_0x8df7;(function(_0xaf8cdb,_0x51a67b){const _0x3cf2f3=a53_0x8df7,_0xba742d=_0xaf8cdb();while(!![]){try{const _0x347526=-parseInt(_0x3cf2f3(0x191))/0x1+parseInt(_0x3cf2f3(0x1b4))/0x2*(parseInt(_0x3cf2f3(0x192))/0x3)+parseInt(_0x3cf2f3(0x18c))/0x4*(-parseInt(_0x3cf2f3(0x180))/0x5)+parseInt(_0x3cf2f3(0x18e))/0x6+parseInt(_0x3cf2f3(0x1c0))/0x7+parseInt(_0x3cf2f3(0x1b8))/0x8+-parseInt(_0x3cf2f3(0x1a3))/0x9;if(_0x347526===_0x51a67b)break;else _0xba742d['push'](_0xba742d['shift']());}catch(_0x4ab0dd){_0xba742d['push'](_0xba742d['shift']());}}}(a53_0x5700,0x72985));import{getChalk}from'../utils/colors.js';const chalk=getChalk();function a53_0x8df7(_0x4d5d9d,_0x54fb64){_0x4d5d9d=_0x4d5d9d-0x17f;const _0x57005b=a53_0x5700();let _0x8df752=_0x57005b[_0x4d5d9d];return _0x8df752;}function a53_0x5700(){const _0x48802f=['values','entries','1598558trCEGg','review','\x20→\x20','Backlinks','1177112pZSXrm','filePath','resolvedKind','isArray','critical','fileName','days','gray','3514182IwladS','Workspace:\x20','Invalid\x20status:\x20','has','getSummary','exit','No\x20outgoing\x20wiki-links','repeat','No\x20workspace\x20found.','kind','Invalid\x20kind:\x20','template','yellow','Wiki-links','github','\x20\x20(empty)','path','tdx\x20work\x20init\x20<name>','Incoming','round','high','readDocument','join','resolveWikiLinks','moveTask','bold','init','flatMap','length','Document\x20not\x20found:\x20','void','guide','createDocument','Goals','slug','error','.\x20Valid:\x20','backlog','\x20[[','13245KLhEcx','goals','magenta','inherit','taskCounts','No\x20incoming\x20backlinks','log','white','\x20to\x20create\x20one,\x20or\x20navigate\x20to\x20a\x20directory\x20containing\x20tdx.json.','Outgoing','title','Workspace\x20initialized:','44TzbcLS','tags','5285232rOPemu','priority','done','360808sVQbpU','3UOGKzg','assignee','cyan','green','note','dim','in_progress','map','getBacklinks','\x20\x20←\x20','underline','body','basename','all','Workspace\x20initialized\x20in\x20current\x20directory','cwd','medium','13229892otzOQq','workflow','red','status','reference','getTasksByStatus','Linked\x20to\x20GitHub:\x20','\x20Run\x20','frontmatter','workspacePath','initAt','blue','Tasks','trim','item'];a53_0x5700=function(){return _0x48802f;};return a53_0x5700();}import{execFileSync}from'node:child_process';import a53_0x3f2ffe from'node:path';import{WorkspaceSDK,resolveWorkspacePath,normalizeTags}from'../sdk/workspace/index.js';import{STATUS_PHASES,ALL_STATUSES}from'../sdk/types/workspace.js';function buildStaleFilter(_0x48f73){const _0x2e424a=a53_0x8df7;if(_0x48f73[_0x2e424a(0x19f)])return{'includeStale':!![]};if(_0x48f73[_0x2e424a(0x1be)])return{'updatedWithin':parseInt(_0x48f73[_0x2e424a(0x1be)],0xa)};return undefined;}const VALID_KINDS=new Set([a53_0x3cf9b1(0x1b1),'goal',a53_0x3cf9b1(0x1df),a53_0x3cf9b1(0x196),a53_0x3cf9b1(0x1a7),a53_0x3cf9b1(0x1a4),a53_0x3cf9b1(0x1cb)]),VALID_PRIORITIES=new Set([a53_0x3cf9b1(0x1bc),a53_0x3cf9b1(0x1d4),a53_0x3cf9b1(0x1a2),'low']),VALID_STATUSES=new Set(ALL_STATUSES);function getSDK(){const _0x5e8db0=a53_0x3cf9b1,_0x5897ae=resolveWorkspacePath();return!_0x5897ae&&(console[_0x5e8db0(0x1e3)](chalk[_0x5e8db0(0x1a5)](_0x5e8db0(0x1c8))+_0x5e8db0(0x1aa)+chalk[_0x5e8db0(0x194)](_0x5e8db0(0x1d1))+_0x5e8db0(0x188)),process[_0x5e8db0(0x1c5)](0x1)),new WorkspaceSDK(_0x5897ae);}function priorityDot(_0x427da3){const _0x572902=a53_0x3cf9b1;switch(_0x427da3){case'critical':return chalk['red']('●');case _0x572902(0x1d4):return chalk[_0x572902(0x1cc)]('●');case _0x572902(0x1a2):return chalk[_0x572902(0x1ae)]('●');case'low':return chalk[_0x572902(0x1bf)]('●');default:return chalk[_0x572902(0x1ae)]('●');}}function statusColor(_0x3a29d2){const _0x59e710=a53_0x3cf9b1;switch(_0x3a29d2){case _0x59e710(0x190):return chalk[_0x59e710(0x195)](_0x3a29d2);case _0x59e710(0x1de):return chalk[_0x59e710(0x1bf)](_0x3a29d2);case _0x59e710(0x198):return chalk[_0x59e710(0x194)](_0x3a29d2);case _0x59e710(0x1b5):return chalk[_0x59e710(0x182)](_0x3a29d2);case'planning':case'design_review':return chalk[_0x59e710(0x1cc)](_0x3a29d2);case'todo':return chalk[_0x59e710(0x187)](_0x3a29d2);case _0x59e710(0x1e5):return chalk[_0x59e710(0x197)](_0x3a29d2);default:return _0x3a29d2;}}export async function workSummaryAction(_0x5bb83a){const _0x2fe547=a53_0x3cf9b1,_0x2be3d1=getSDK(),_0x42da3a=buildStaleFilter(_0x5bb83a),_0x1ad27d=_0x2be3d1[_0x2fe547(0x1c4)](_0x42da3a);console[_0x2fe547(0x186)](chalk['bold'](_0x2fe547(0x1c1)+_0x1ad27d['name'])),console[_0x2fe547(0x186)](chalk[_0x2fe547(0x197)](_0x1ad27d[_0x2fe547(0x1d0)])),console[_0x2fe547(0x186)]();const _0x394a7f=Object[_0x2fe547(0x1b2)](_0x1ad27d[_0x2fe547(0x184)])['reduce']((_0x233695,_0x2262e5)=>_0x233695+_0x2262e5,0x0);if(_0x394a7f===0x0)console[_0x2fe547(0x186)](chalk[_0x2fe547(0x197)]('No\x20tasks\x20yet.\x20Create\x20one\x20with:\x20tdx\x20work\x20new\x20<title>'));else{console[_0x2fe547(0x186)](chalk['bold'](_0x2fe547(0x1af)));for(const [_0x51479d,_0x598a36]of Object[_0x2fe547(0x1b3)](_0x1ad27d[_0x2fe547(0x184)])){_0x598a36>0x0&&console['log']('\x20\x20'+statusColor(_0x51479d)+':\x20'+_0x598a36);}console['log']();}if(_0x1ad27d[_0x2fe547(0x181)]['length']>0x0){console[_0x2fe547(0x186)](chalk[_0x2fe547(0x1d9)](_0x2fe547(0x1e1)));for(const _0x268353 of _0x1ad27d[_0x2fe547(0x181)]){const _0x168324=progressBar(_0x268353['progress']);console[_0x2fe547(0x186)]('\x20\x20'+_0x268353[_0x2fe547(0x18a)]+'\x20'+_0x168324+'\x20'+_0x268353['progress']+'%');}}}function progressBar(_0x11dd21){const _0x5eba26=a53_0x3cf9b1,_0x1061f4=0x14,_0x2688ee=Math[_0x5eba26(0x1d3)](_0x11dd21/0x64*_0x1061f4),_0x173db1=_0x1061f4-_0x2688ee;return chalk[_0x5eba26(0x195)]('█'['repeat'](_0x2688ee))+chalk[_0x5eba26(0x197)]('░'[_0x5eba26(0x1c7)](_0x173db1));}export async function workInitAction(_0x4978a8,_0x437522){const _0x313048=a53_0x3cf9b1,_0x55d25f=_0x4978a8||a53_0x3f2ffe[_0x313048(0x19e)](process[_0x313048(0x1a1)]());if(_0x437522[_0x313048(0x1ce)]){const _0x35a973=WorkspaceSDK[_0x313048(0x1ad)](_0x55d25f,{'github':_0x437522['github']});console['log'](chalk[_0x313048(0x195)](_0x313048(0x18b))+'\x20'+_0x35a973[_0x313048(0x1ac)]),console[_0x313048(0x186)](chalk[_0x313048(0x197)](_0x313048(0x1a9)+_0x437522[_0x313048(0x1ce)]));}else{if(_0x4978a8){const _0x53beed=WorkspaceSDK['initAt'](_0x4978a8);console[_0x313048(0x186)](chalk['green'](_0x313048(0x18b))+'\x20'+_0x53beed[_0x313048(0x1ac)]);}else{const _0x431bbb=new WorkspaceSDK(process[_0x313048(0x1a1)]());_0x431bbb[_0x313048(0x1da)](_0x55d25f),console[_0x313048(0x186)](chalk['green'](_0x313048(0x1a0)));}}}export async function workNewAction(_0x595a78,_0x453df3){const _0x584442=a53_0x3cf9b1,_0x5e7e5e=getSDK(),_0x161a02=_0x453df3[_0x584442(0x1c9)]||_0x584442(0x1b1);!VALID_KINDS[_0x584442(0x1c3)](_0x161a02)&&(console[_0x584442(0x1e3)](chalk[_0x584442(0x1a5)](_0x584442(0x1ca)+_0x161a02+'.\x20Valid:\x20'+[...VALID_KINDS]['join'](',\x20'))),process[_0x584442(0x1c5)](0x1));_0x453df3[_0x584442(0x18f)]&&!VALID_PRIORITIES[_0x584442(0x1c3)](_0x453df3[_0x584442(0x18f)])&&(console[_0x584442(0x1e3)](chalk['red']('Invalid\x20priority:\x20'+_0x453df3[_0x584442(0x18f)]+'.\x20Valid:\x20'+[...VALID_PRIORITIES][_0x584442(0x1d6)](',\x20'))),process['exit'](0x1));_0x453df3[_0x584442(0x1a6)]&&!VALID_STATUSES['has'](_0x453df3[_0x584442(0x1a6)])&&(console[_0x584442(0x1e3)](chalk['red'](_0x584442(0x1c2)+_0x453df3[_0x584442(0x1a6)]+_0x584442(0x1e4)+[...VALID_STATUSES]['join'](',\x20'))),process[_0x584442(0x1c5)](0x1));const _0x557d62=_0x453df3[_0x584442(0x18d)]?_0x453df3[_0x584442(0x18d)]['split'](',')[_0x584442(0x199)](_0xbdc4c2=>_0xbdc4c2['trim']()):undefined,_0x398776=_0x5e7e5e[_0x584442(0x1e0)]({'title':_0x595a78,'kind':_0x161a02,'tags':_0x557d62,'priority':_0x453df3[_0x584442(0x18f)],'body':_0x453df3[_0x584442(0x19d)],'template':_0x453df3[_0x584442(0x1cb)],'status':_0x453df3[_0x584442(0x1a6)],'assignee':_0x453df3[_0x584442(0x193)]});console[_0x584442(0x186)](chalk[_0x584442(0x195)]('Created:')+'\x20'+_0x398776[_0x584442(0x1bd)]),console[_0x584442(0x186)](chalk[_0x584442(0x197)](_0x398776[_0x584442(0x1b9)]));}export async function workMoveAction(_0x7be052,_0x430128){const _0x19eff7=a53_0x3cf9b1;!VALID_STATUSES['has'](_0x430128)&&(console[_0x19eff7(0x1e3)](chalk['red']('Invalid\x20status:\x20'+_0x430128+_0x19eff7(0x1e4)+[...VALID_STATUSES][_0x19eff7(0x1d6)](',\x20'))),process[_0x19eff7(0x1c5)](0x1));const _0x337f99=getSDK(),_0x598632=_0x337f99[_0x19eff7(0x1d8)](_0x7be052,_0x430128);!_0x598632&&(console[_0x19eff7(0x1e3)](chalk[_0x19eff7(0x1a5)](_0x19eff7(0x1dd)+_0x7be052)),process[_0x19eff7(0x1c5)](0x1));const _0x300078=_0x598632[_0x19eff7(0x1ab)]['title']||_0x598632[_0x19eff7(0x1bd)];console[_0x19eff7(0x186)](chalk[_0x19eff7(0x195)]('Moved:')+('\x20'+_0x300078+_0x19eff7(0x1b6)+statusColor(_0x430128)));}export async function workBoardAction(_0x1714e2){const _0x54c94d=a53_0x3cf9b1,_0x53dc84=getSDK(),_0x25bdca=buildStaleFilter(_0x1714e2),{grouped:_0x1c6466}=_0x53dc84[_0x54c94d(0x1a8)](_0x25bdca);for(const [_0x1f72a4,_0x2b4eba]of Object[_0x54c94d(0x1b3)](STATUS_PHASES)){const _0x5ef807=_0x2b4eba[_0x54c94d(0x1db)](_0x53c4fe=>_0x1c6466[_0x53c4fe]||[]);console[_0x54c94d(0x186)](chalk[_0x54c94d(0x1d9)][_0x54c94d(0x19c)](_0x1f72a4)+chalk[_0x54c94d(0x197)]('\x20('+_0x5ef807[_0x54c94d(0x1dc)]+')'));if(_0x5ef807[_0x54c94d(0x1dc)]===0x0)console[_0x54c94d(0x186)](chalk[_0x54c94d(0x197)](_0x54c94d(0x1cf)));else for(const _0x223aa4 of _0x5ef807){const _0x5e4c1e=_0x223aa4[_0x54c94d(0x1ab)],_0x313343=priorityDot(_0x5e4c1e[_0x54c94d(0x18f)]),_0x2db89f=_0x5e4c1e['title']||_0x223aa4[_0x54c94d(0x1bd)],_0x1f2a2a=normalizeTags(_0x5e4c1e['tags']),_0x21e818=_0x1f2a2a[_0x54c94d(0x1dc)]?chalk[_0x54c94d(0x197)]('\x20['+_0x1f2a2a[_0x54c94d(0x1d6)](',\x20')+']'):'',_0x3cfeca=chalk[_0x54c94d(0x197)]('('+_0x5e4c1e['status']+')');console['log']('\x20\x20'+_0x313343+'\x20'+_0x2db89f+'\x20'+_0x3cfeca+_0x21e818);}console['log']();}}export async function workShowAction(_0x82581c){const _0x4bc8aa=a53_0x3cf9b1,_0x1664c2=getSDK(),_0x415d5d=_0x1664c2[_0x4bc8aa(0x1d5)](_0x82581c);!_0x415d5d&&(console[_0x4bc8aa(0x1e3)](chalk[_0x4bc8aa(0x1a5)](_0x4bc8aa(0x1dd)+_0x82581c)),process[_0x4bc8aa(0x1c5)](0x1));console[_0x4bc8aa(0x186)](chalk['bold'](_0x415d5d['frontmatter'][_0x4bc8aa(0x18a)]||_0x415d5d[_0x4bc8aa(0x1bd)])),console[_0x4bc8aa(0x186)](chalk[_0x4bc8aa(0x197)](_0x415d5d[_0x4bc8aa(0x1b9)])),console['log']();const _0x2c4f82=_0x415d5d[_0x4bc8aa(0x1ab)];for(const [_0x4923bd,_0x48982f]of Object[_0x4bc8aa(0x1b3)](_0x2c4f82)){if(_0x4923bd===_0x4bc8aa(0x18a))continue;if(_0x48982f===undefined||_0x48982f===null)continue;const _0x3e9817=Array[_0x4bc8aa(0x1bb)](_0x48982f)?_0x48982f[_0x4bc8aa(0x1d6)](',\x20'):String(_0x48982f);console[_0x4bc8aa(0x186)]('\x20\x20'+chalk[_0x4bc8aa(0x194)](_0x4923bd)+':\x20'+_0x3e9817);}console[_0x4bc8aa(0x186)]();_0x415d5d['body'][_0x4bc8aa(0x1b0)]()&&(console[_0x4bc8aa(0x186)](_0x415d5d['body'][_0x4bc8aa(0x1b0)]()),console[_0x4bc8aa(0x186)]());const _0x4fdbe9=_0x1664c2[_0x4bc8aa(0x1d7)](_0x415d5d[_0x4bc8aa(0x19d)]);if(_0x4fdbe9[_0x4bc8aa(0x1dc)]>0x0){console['log'](chalk[_0x4bc8aa(0x1d9)](_0x4bc8aa(0x1cd)));for(const _0x5a8580 of _0x4fdbe9){const _0x2667aa=_0x5a8580['resolvedPath']?chalk[_0x4bc8aa(0x195)]('✓'):chalk[_0x4bc8aa(0x1a5)]('✗'),_0x28bc1c=_0x5a8580['displayText']||_0x5a8580['slug'];console[_0x4bc8aa(0x186)]('\x20\x20'+_0x2667aa+_0x4bc8aa(0x17f)+_0x28bc1c+']]');}console[_0x4bc8aa(0x186)]();}const _0x40d890=_0x1664c2[_0x4bc8aa(0x19a)](_0x415d5d['fileName']);if(_0x40d890['length']>0x0){console[_0x4bc8aa(0x186)](chalk['bold'](_0x4bc8aa(0x1b7)));for(const _0x2b8cdf of _0x40d890){console[_0x4bc8aa(0x186)]('\x20\x20←\x20'+_0x2b8cdf['title']+'\x20'+chalk['dim']('('+_0x2b8cdf['kind']+')'));}}}export async function workLinksAction(_0x42268e){const _0x5a3870=a53_0x3cf9b1,_0x19b98c=getSDK(),_0x52695c=_0x19b98c['readDocument'](_0x42268e);!_0x52695c&&(console[_0x5a3870(0x1e3)](chalk[_0x5a3870(0x1a5)]('Document\x20not\x20found:\x20'+_0x42268e)),process['exit'](0x1));const _0x138ef2=_0x52695c[_0x5a3870(0x1ab)][_0x5a3870(0x18a)]||_0x52695c[_0x5a3870(0x1bd)];console[_0x5a3870(0x186)](chalk[_0x5a3870(0x1d9)]('Links\x20for:\x20'+_0x138ef2)),console[_0x5a3870(0x186)]();const _0x1ebbe0=_0x19b98c['resolveWikiLinks'](_0x52695c[_0x5a3870(0x19d)]);if(_0x1ebbe0[_0x5a3870(0x1dc)]>0x0){console[_0x5a3870(0x186)](chalk[_0x5a3870(0x1d9)](_0x5a3870(0x189)));for(const _0x2a8c27 of _0x1ebbe0){const _0x2e3363=_0x2a8c27['resolvedPath']?chalk[_0x5a3870(0x195)]('✓'):chalk['red']('✗'),_0x626069=_0x2a8c27['displayText']||_0x2a8c27[_0x5a3870(0x1e2)],_0x420524=_0x2a8c27[_0x5a3870(0x1ba)]?chalk[_0x5a3870(0x197)]('\x20('+_0x2a8c27[_0x5a3870(0x1ba)]+')'):'';console[_0x5a3870(0x186)]('\x20\x20'+_0x2e3363+_0x5a3870(0x17f)+_0x626069+']]'+_0x420524);}}else console[_0x5a3870(0x186)](chalk[_0x5a3870(0x197)](_0x5a3870(0x1c6)));console['log']();const _0xdda499=_0x19b98c[_0x5a3870(0x19a)](_0x52695c[_0x5a3870(0x1bd)]);if(_0xdda499[_0x5a3870(0x1dc)]>0x0){console['log'](chalk[_0x5a3870(0x1d9)](_0x5a3870(0x1d2)));for(const _0x20e9ce of _0xdda499){console['log'](_0x5a3870(0x19b)+_0x20e9ce['title']+'\x20'+chalk['dim']('('+_0x20e9ce['kind']+')'));}}else console[_0x5a3870(0x186)](chalk[_0x5a3870(0x197)](_0x5a3870(0x185)));}export async function workOpenAction(_0x209264){const _0x364ad0=a53_0x3cf9b1,_0x44e903=getSDK(),_0x746a95=_0x44e903['readDocument'](_0x209264);!_0x746a95&&(console[_0x364ad0(0x1e3)](chalk['red']('Document\x20not\x20found:\x20'+_0x209264)),process['exit'](0x1));const _0x562014=process.env.EDITOR||'vi';try{execFileSync(_0x562014,[_0x746a95[_0x364ad0(0x1b9)]],{'stdio':_0x364ad0(0x183)});}catch{console[_0x364ad0(0x1e3)](chalk['red']('Failed\x20to\x20open\x20editor:\x20'+_0x562014)),process[_0x364ad0(0x1c5)](0x1);}}
|
|
1
|
+
const a53_0x2dc3fe=a53_0x2790;(function(_0x214ae7,_0x14bf3d){const _0x5ce5b3=a53_0x2790,_0x42fa50=_0x214ae7();while(!![]){try{const _0x53d2d9=parseInt(_0x5ce5b3(0xb1))/0x1*(parseInt(_0x5ce5b3(0xa4))/0x2)+parseInt(_0x5ce5b3(0xd3))/0x3+parseInt(_0x5ce5b3(0xb3))/0x4+parseInt(_0x5ce5b3(0xc0))/0x5*(parseInt(_0x5ce5b3(0xac))/0x6)+parseInt(_0x5ce5b3(0xa0))/0x7+-parseInt(_0x5ce5b3(0x8b))/0x8*(-parseInt(_0x5ce5b3(0xb2))/0x9)+-parseInt(_0x5ce5b3(0xa8))/0xa*(parseInt(_0x5ce5b3(0xc4))/0xb);if(_0x53d2d9===_0x14bf3d)break;else _0x42fa50['push'](_0x42fa50['shift']());}catch(_0x2e98c5){_0x42fa50['push'](_0x42fa50['shift']());}}}(a53_0x2b53,0xb34b5));function a53_0x2790(_0x3346b3,_0x4b3aae){_0x3346b3=_0x3346b3-0x85;const _0x2b5391=a53_0x2b53();let _0x27906d=_0x2b5391[_0x3346b3];return _0x27906d;}import{getChalk}from'../utils/colors.js';const chalk=getChalk();import{execFileSync}from'node:child_process';import a53_0x54aa13 from'node:path';function a53_0x2b53(){const _0xf26b38=['trim','Outgoing','No\x20tasks\x20yet.\x20Create\x20one\x20with:\x20tdx\x20work\x20new\x20<title>','kind','white','join','flatMap','init','item','5LIhoGu','map','yellow','red','7259593cLSHfD','repeat','taskCounts','dim','underline','magenta','github','title','getBacklinks','\x20\x20(empty)','in_progress','green','Document\x20not\x20found:\x20','resolvedPath','Workspace\x20initialized:','2052504UOUteW','resolvedKind','assignee','inherit','resolveWikiLinks','frontmatter','workflow','goal','days','Workspace:\x20','goals','bold','\x20[[','log','design_review','progress','void','error','note','backlog','cwd','Invalid\x20status:\x20','createDocument','.\x20Valid:\x20','status','tags','isArray','No\x20incoming\x20backlinks','Invalid\x20kind:\x20','initAt','entries','\x20→\x20','basename','high','getSummary','No\x20outgoing\x20wiki-links','template','length','628744mokWdn','reduce','blue','fileName','cyan','split','critical','Created:','values','body','tdx\x20work\x20init\x20<name>','priority','Links\x20for:\x20','medium','low','getTasksByStatus','has','\x20\x20←\x20','\x20Run\x20','filePath','Incoming','3032309tIDPPE','Backlinks','displayText','Failed\x20to\x20open\x20editor:\x20','394866fvGGUe','No\x20workspace\x20found.','workspacePath','exit','60NqIIBa','reference','review','slug','7541934Fxpoip','Linked\x20to\x20GitHub:\x20','round','Moved:','Tasks','3dlNQFm','99Mqsxgh','3452004IPlQIn','readDocument','gray','guide'];a53_0x2b53=function(){return _0xf26b38;};return a53_0x2b53();}import{WorkspaceSDK,resolveWorkspacePath,normalizeTags}from'../sdk/workspace/index.js';import{STATUS_PHASES,ALL_STATUSES}from'../sdk/types/workspace.js';function buildStaleFilter(_0x56a839){const _0x3e45f0=a53_0x2790;if(_0x56a839['all'])return{'includeStale':!![]};if(_0x56a839[_0x3e45f0(0xdb)])return{'updatedWithin':parseInt(_0x56a839[_0x3e45f0(0xdb)],0xa)};return undefined;}const VALID_KINDS=new Set([a53_0x2dc3fe(0xbf),a53_0x2dc3fe(0xda),a53_0x2dc3fe(0xb6),a53_0x2dc3fe(0xe5),a53_0x2dc3fe(0xa9),a53_0x2dc3fe(0xd9),a53_0x2dc3fe(0x89)]),VALID_PRIORITIES=new Set([a53_0x2dc3fe(0x91),a53_0x2dc3fe(0x86),a53_0x2dc3fe(0x98),a53_0x2dc3fe(0x99)]),VALID_STATUSES=new Set(ALL_STATUSES);function getSDK(){const _0x3b3470=a53_0x2dc3fe,_0x2c158f=resolveWorkspacePath();return!_0x2c158f&&(console[_0x3b3470(0xe4)](chalk[_0x3b3470(0xc3)](_0x3b3470(0xa5))+_0x3b3470(0x9d)+chalk[_0x3b3470(0x8f)](_0x3b3470(0x95))+'\x20to\x20create\x20one,\x20or\x20navigate\x20to\x20a\x20directory\x20containing\x20tdx.json.'),process[_0x3b3470(0xa7)](0x1)),new WorkspaceSDK(_0x2c158f);}function priorityDot(_0x598955){const _0x53c2bc=a53_0x2dc3fe;switch(_0x598955){case _0x53c2bc(0x91):return chalk[_0x53c2bc(0xc3)]('●');case _0x53c2bc(0x86):return chalk[_0x53c2bc(0xc2)]('●');case _0x53c2bc(0x98):return chalk[_0x53c2bc(0x8d)]('●');case _0x53c2bc(0x99):return chalk[_0x53c2bc(0xb5)]('●');default:return chalk['blue']('●');}}function statusColor(_0x1259d6){const _0x1c6490=a53_0x2dc3fe;switch(_0x1259d6){case'done':return chalk[_0x1c6490(0xcf)](_0x1259d6);case _0x1c6490(0xe3):return chalk[_0x1c6490(0xb5)](_0x1259d6);case _0x1c6490(0xce):return chalk['cyan'](_0x1259d6);case _0x1c6490(0xaa):return chalk[_0x1c6490(0xc9)](_0x1259d6);case'planning':case _0x1c6490(0xe1):return chalk[_0x1c6490(0xc2)](_0x1259d6);case'todo':return chalk[_0x1c6490(0xbb)](_0x1259d6);case _0x1c6490(0xe6):return chalk[_0x1c6490(0xc7)](_0x1259d6);default:return _0x1259d6;}}export async function workSummaryAction(_0x3e7f17){const _0x5abde7=a53_0x2dc3fe,_0xd7c1b3=getSDK(),_0x283e3b=buildStaleFilter(_0x3e7f17),_0x2e598e=_0xd7c1b3[_0x5abde7(0x87)](_0x283e3b);console[_0x5abde7(0xe0)](chalk[_0x5abde7(0xde)](_0x5abde7(0xdc)+_0x2e598e['name'])),console['log'](chalk[_0x5abde7(0xc7)](_0x2e598e['path'])),console[_0x5abde7(0xe0)]();const _0x192d5e=Object[_0x5abde7(0x93)](_0x2e598e['taskCounts'])[_0x5abde7(0x8c)]((_0x2e3439,_0xcfcbfa)=>_0x2e3439+_0xcfcbfa,0x0);if(_0x192d5e===0x0)console['log'](chalk[_0x5abde7(0xc7)](_0x5abde7(0xb9)));else{console[_0x5abde7(0xe0)](chalk[_0x5abde7(0xde)](_0x5abde7(0xb0)));for(const [_0x3fd295,_0x370c01]of Object[_0x5abde7(0xf1)](_0x2e598e[_0x5abde7(0xc6)])){_0x370c01>0x0&&console['log']('\x20\x20'+statusColor(_0x3fd295)+':\x20'+_0x370c01);}console[_0x5abde7(0xe0)]();}if(_0x2e598e[_0x5abde7(0xdd)][_0x5abde7(0x8a)]>0x0){console[_0x5abde7(0xe0)](chalk[_0x5abde7(0xde)]('Goals'));for(const _0x4c013d of _0x2e598e[_0x5abde7(0xdd)]){const _0x3dcc7a=progressBar(_0x4c013d[_0x5abde7(0xe2)]);console[_0x5abde7(0xe0)]('\x20\x20'+_0x4c013d[_0x5abde7(0xcb)]+'\x20'+_0x3dcc7a+'\x20'+_0x4c013d[_0x5abde7(0xe2)]+'%');}}}function progressBar(_0x55abf0){const _0x22a502=a53_0x2dc3fe,_0x176e6e=0x14,_0x36b12e=Math[_0x22a502(0xae)](_0x55abf0/0x64*_0x176e6e),_0xca9a08=_0x176e6e-_0x36b12e;return chalk[_0x22a502(0xcf)]('█'['repeat'](_0x36b12e))+chalk[_0x22a502(0xc7)]('░'[_0x22a502(0xc5)](_0xca9a08));}export async function workInitAction(_0x40b3e4,_0x56b9e5){const _0xca4748=a53_0x2dc3fe,_0x39dbdf=_0x40b3e4||a53_0x54aa13[_0xca4748(0x85)](process[_0xca4748(0xe7)]());if(_0x56b9e5[_0xca4748(0xca)]){const _0x4cb69b=WorkspaceSDK[_0xca4748(0xf0)](_0x39dbdf,{'github':_0x56b9e5[_0xca4748(0xca)]});console['log'](chalk['green'](_0xca4748(0xd2))+'\x20'+_0x4cb69b[_0xca4748(0xa6)]),console[_0xca4748(0xe0)](chalk[_0xca4748(0xc7)](_0xca4748(0xad)+_0x56b9e5['github']));}else{if(_0x40b3e4){const _0x5207bf=WorkspaceSDK[_0xca4748(0xf0)](_0x40b3e4);console[_0xca4748(0xe0)](chalk[_0xca4748(0xcf)]('Workspace\x20initialized:')+'\x20'+_0x5207bf[_0xca4748(0xa6)]);}else{const _0x1663ee=new WorkspaceSDK(process[_0xca4748(0xe7)]());_0x1663ee[_0xca4748(0xbe)](_0x39dbdf),console[_0xca4748(0xe0)](chalk[_0xca4748(0xcf)]('Workspace\x20initialized\x20in\x20current\x20directory'));}}}export async function workNewAction(_0x497882,_0x209341){const _0x3051a4=a53_0x2dc3fe,_0x34f919=getSDK(),_0x5ba5ef=_0x209341[_0x3051a4(0xba)]||_0x3051a4(0xbf);!VALID_KINDS[_0x3051a4(0x9b)](_0x5ba5ef)&&(console[_0x3051a4(0xe4)](chalk[_0x3051a4(0xc3)](_0x3051a4(0xef)+_0x5ba5ef+_0x3051a4(0xea)+[...VALID_KINDS][_0x3051a4(0xbc)](',\x20'))),process[_0x3051a4(0xa7)](0x1));_0x209341[_0x3051a4(0x96)]&&!VALID_PRIORITIES['has'](_0x209341[_0x3051a4(0x96)])&&(console[_0x3051a4(0xe4)](chalk[_0x3051a4(0xc3)]('Invalid\x20priority:\x20'+_0x209341[_0x3051a4(0x96)]+_0x3051a4(0xea)+[...VALID_PRIORITIES][_0x3051a4(0xbc)](',\x20'))),process['exit'](0x1));_0x209341[_0x3051a4(0xeb)]&&!VALID_STATUSES[_0x3051a4(0x9b)](_0x209341[_0x3051a4(0xeb)])&&(console[_0x3051a4(0xe4)](chalk[_0x3051a4(0xc3)]('Invalid\x20status:\x20'+_0x209341[_0x3051a4(0xeb)]+_0x3051a4(0xea)+[...VALID_STATUSES][_0x3051a4(0xbc)](',\x20'))),process['exit'](0x1));const _0x4e5597=_0x209341[_0x3051a4(0xec)]?_0x209341[_0x3051a4(0xec)][_0x3051a4(0x90)](',')[_0x3051a4(0xc1)](_0x574450=>_0x574450['trim']()):undefined,_0x5cd333=_0x34f919[_0x3051a4(0xe9)]({'title':_0x497882,'kind':_0x5ba5ef,'tags':_0x4e5597,'priority':_0x209341['priority'],'body':_0x209341[_0x3051a4(0x94)],'template':_0x209341[_0x3051a4(0x89)],'status':_0x209341[_0x3051a4(0xeb)],'assignee':_0x209341[_0x3051a4(0xd5)]});console[_0x3051a4(0xe0)](chalk[_0x3051a4(0xcf)](_0x3051a4(0x92))+'\x20'+_0x5cd333['fileName']),console[_0x3051a4(0xe0)](chalk[_0x3051a4(0xc7)](_0x5cd333[_0x3051a4(0x9e)]));}export async function workMoveAction(_0x348ef1,_0x1d716d){const _0x53f160=a53_0x2dc3fe;!VALID_STATUSES[_0x53f160(0x9b)](_0x1d716d)&&(console[_0x53f160(0xe4)](chalk[_0x53f160(0xc3)](_0x53f160(0xe8)+_0x1d716d+_0x53f160(0xea)+[...VALID_STATUSES][_0x53f160(0xbc)](',\x20'))),process[_0x53f160(0xa7)](0x1));const _0x4b60ca=getSDK(),_0x1e016b=_0x4b60ca['moveTask'](_0x348ef1,_0x1d716d);!_0x1e016b&&(console['error'](chalk[_0x53f160(0xc3)](_0x53f160(0xd0)+_0x348ef1)),process[_0x53f160(0xa7)](0x1));const _0x123818=_0x1e016b[_0x53f160(0xd8)]['title']||_0x1e016b[_0x53f160(0x8e)];console[_0x53f160(0xe0)](chalk[_0x53f160(0xcf)](_0x53f160(0xaf))+('\x20'+_0x123818+_0x53f160(0xf2)+statusColor(_0x1d716d)));}export async function workBoardAction(_0x55c63e){const _0x272846=a53_0x2dc3fe,_0x3ac8e6=getSDK(),_0x5d6cb0=buildStaleFilter(_0x55c63e),{grouped:_0x34abf4}=_0x3ac8e6[_0x272846(0x9a)](_0x5d6cb0);for(const [_0x2fb199,_0x53d7d0]of Object[_0x272846(0xf1)](STATUS_PHASES)){const _0x4ab99d=_0x53d7d0[_0x272846(0xbd)](_0x59048d=>_0x34abf4[_0x59048d]||[]);console['log'](chalk[_0x272846(0xde)][_0x272846(0xc8)](_0x2fb199)+chalk[_0x272846(0xc7)]('\x20('+_0x4ab99d['length']+')'));if(_0x4ab99d['length']===0x0)console['log'](chalk[_0x272846(0xc7)](_0x272846(0xcd)));else for(const _0x2465ec of _0x4ab99d){const _0x2092c8=_0x2465ec[_0x272846(0xd8)],_0x574f0c=priorityDot(_0x2092c8[_0x272846(0x96)]),_0x5cd947=_0x2092c8['title']||_0x2465ec[_0x272846(0x8e)],_0x1fcec0=normalizeTags(_0x2092c8['tags']),_0x540c84=_0x1fcec0[_0x272846(0x8a)]?chalk[_0x272846(0xc7)]('\x20['+_0x1fcec0[_0x272846(0xbc)](',\x20')+']'):'',_0x15dfbb=chalk[_0x272846(0xc7)]('('+_0x2092c8[_0x272846(0xeb)]+')');console[_0x272846(0xe0)]('\x20\x20'+_0x574f0c+'\x20'+_0x5cd947+'\x20'+_0x15dfbb+_0x540c84);}console[_0x272846(0xe0)]();}}export async function workShowAction(_0x2627f2){const _0x2166e8=a53_0x2dc3fe,_0x4ade99=getSDK(),_0x307fca=_0x4ade99['readDocument'](_0x2627f2);!_0x307fca&&(console['error'](chalk[_0x2166e8(0xc3)](_0x2166e8(0xd0)+_0x2627f2)),process[_0x2166e8(0xa7)](0x1));console[_0x2166e8(0xe0)](chalk[_0x2166e8(0xde)](_0x307fca[_0x2166e8(0xd8)]['title']||_0x307fca[_0x2166e8(0x8e)])),console[_0x2166e8(0xe0)](chalk[_0x2166e8(0xc7)](_0x307fca[_0x2166e8(0x9e)])),console[_0x2166e8(0xe0)]();const _0x21c6ef=_0x307fca[_0x2166e8(0xd8)];for(const [_0x234ddc,_0x450edf]of Object['entries'](_0x21c6ef)){if(_0x234ddc===_0x2166e8(0xcb))continue;if(_0x450edf===undefined||_0x450edf===null)continue;const _0x4db806=Array[_0x2166e8(0xed)](_0x450edf)?_0x450edf['join'](',\x20'):String(_0x450edf);console[_0x2166e8(0xe0)]('\x20\x20'+chalk[_0x2166e8(0x8f)](_0x234ddc)+':\x20'+_0x4db806);}console[_0x2166e8(0xe0)]();_0x307fca[_0x2166e8(0x94)]['trim']()&&(console['log'](_0x307fca[_0x2166e8(0x94)][_0x2166e8(0xb7)]()),console[_0x2166e8(0xe0)]());const _0x3c709d=_0x4ade99[_0x2166e8(0xd7)](_0x307fca[_0x2166e8(0x94)]);if(_0x3c709d[_0x2166e8(0x8a)]>0x0){console[_0x2166e8(0xe0)](chalk[_0x2166e8(0xde)]('Wiki-links'));for(const _0x5eef4f of _0x3c709d){const _0x209999=_0x5eef4f[_0x2166e8(0xd1)]?chalk[_0x2166e8(0xcf)]('✓'):chalk[_0x2166e8(0xc3)]('✗'),_0x13dfd2=_0x5eef4f[_0x2166e8(0xa2)]||_0x5eef4f[_0x2166e8(0xab)];console['log']('\x20\x20'+_0x209999+_0x2166e8(0xdf)+_0x13dfd2+']]');}console[_0x2166e8(0xe0)]();}const _0x3f68c5=_0x4ade99[_0x2166e8(0xcc)](_0x307fca[_0x2166e8(0x8e)]);if(_0x3f68c5[_0x2166e8(0x8a)]>0x0){console[_0x2166e8(0xe0)](chalk[_0x2166e8(0xde)](_0x2166e8(0xa1)));for(const _0x532a9c of _0x3f68c5){console[_0x2166e8(0xe0)]('\x20\x20←\x20'+_0x532a9c['title']+'\x20'+chalk['dim']('('+_0x532a9c['kind']+')'));}}}export async function workLinksAction(_0x42a05a){const _0x2e609c=a53_0x2dc3fe,_0x4b93f8=getSDK(),_0x1de660=_0x4b93f8[_0x2e609c(0xb4)](_0x42a05a);!_0x1de660&&(console[_0x2e609c(0xe4)](chalk[_0x2e609c(0xc3)](_0x2e609c(0xd0)+_0x42a05a)),process[_0x2e609c(0xa7)](0x1));const _0x5a11e3=_0x1de660[_0x2e609c(0xd8)]['title']||_0x1de660[_0x2e609c(0x8e)];console[_0x2e609c(0xe0)](chalk[_0x2e609c(0xde)](_0x2e609c(0x97)+_0x5a11e3)),console[_0x2e609c(0xe0)]();const _0x24b8c8=_0x4b93f8[_0x2e609c(0xd7)](_0x1de660[_0x2e609c(0x94)]);if(_0x24b8c8[_0x2e609c(0x8a)]>0x0){console[_0x2e609c(0xe0)](chalk['bold'](_0x2e609c(0xb8)));for(const _0x4df2c4 of _0x24b8c8){const _0x2d42fd=_0x4df2c4[_0x2e609c(0xd1)]?chalk[_0x2e609c(0xcf)]('✓'):chalk[_0x2e609c(0xc3)]('✗'),_0x14a541=_0x4df2c4[_0x2e609c(0xa2)]||_0x4df2c4[_0x2e609c(0xab)],_0x55d8d4=_0x4df2c4[_0x2e609c(0xd4)]?chalk[_0x2e609c(0xc7)]('\x20('+_0x4df2c4[_0x2e609c(0xd4)]+')'):'';console[_0x2e609c(0xe0)]('\x20\x20'+_0x2d42fd+_0x2e609c(0xdf)+_0x14a541+']]'+_0x55d8d4);}}else console[_0x2e609c(0xe0)](chalk[_0x2e609c(0xc7)](_0x2e609c(0x88)));console[_0x2e609c(0xe0)]();const _0x5e8141=_0x4b93f8[_0x2e609c(0xcc)](_0x1de660[_0x2e609c(0x8e)]);if(_0x5e8141['length']>0x0){console[_0x2e609c(0xe0)](chalk[_0x2e609c(0xde)](_0x2e609c(0x9f)));for(const _0x292410 of _0x5e8141){console[_0x2e609c(0xe0)](_0x2e609c(0x9c)+_0x292410['title']+'\x20'+chalk[_0x2e609c(0xc7)]('('+_0x292410[_0x2e609c(0xba)]+')'));}}else console[_0x2e609c(0xe0)](chalk[_0x2e609c(0xc7)](_0x2e609c(0xee)));}export async function workOpenAction(_0xdc971f){const _0x3d7053=a53_0x2dc3fe,_0x41093a=getSDK(),_0x57bec8=_0x41093a[_0x3d7053(0xb4)](_0xdc971f);!_0x57bec8&&(console['error'](chalk['red'](_0x3d7053(0xd0)+_0xdc971f)),process[_0x3d7053(0xa7)](0x1));const _0x580d07=process.env.EDITOR||'vi';try{execFileSync(_0x580d07,[_0x57bec8[_0x3d7053(0x9e)]],{'stdio':_0x3d7053(0xd6)});}catch{console['error'](chalk['red'](_0x3d7053(0xa3)+_0x580d07)),process['exit'](0x1);}}
|