@treasuredata/tdx 2026.3.36 → 2026.3.37
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/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.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/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.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
|
-
const
|
|
1
|
+
const a49_0x1d77d7=a49_0x9cce;(function(_0x1c2324,_0x1a60bb){const _0x1812a3=a49_0x9cce,_0x8fc503=_0x1c2324();while(!![]){try{const _0x4a9938=-parseInt(_0x1812a3(0x1a3))/0x1+parseInt(_0x1812a3(0x193))/0x2+parseInt(_0x1812a3(0x17f))/0x3+-parseInt(_0x1812a3(0x199))/0x4*(-parseInt(_0x1812a3(0x1af))/0x5)+parseInt(_0x1812a3(0x17e))/0x6+-parseInt(_0x1812a3(0x192))/0x7*(parseInt(_0x1812a3(0x17d))/0x8)+-parseInt(_0x1812a3(0x1a0))/0x9;if(_0x4a9938===_0x1a60bb)break;else _0x8fc503['push'](_0x8fc503['shift']());}catch(_0x27bb07){_0x8fc503['push'](_0x8fc503['shift']());}}}(a49_0x6d45,0x9225d));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';function a49_0x9cce(_0x1d6906,_0xd388d){_0x1d6906=_0x1d6906-0x17d;const _0x6d4595=a49_0x6d45();let _0x9cce02=_0x6d4595[_0x1d6906];return _0x9cce02;}function a49_0x6d45(){const _0x1f638d=['\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','Listing\x20tables...','limit','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','104zWTfMa','length','message','database_name','table','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','log','11702079scODnd','Note:\x20\x27','database','302701QoFDiI','\x27\x20is\x20ambiguous.','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Database:\x20all','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','\x20\x20Cause:\x20','Error:\x20','Database:\x20','List\x20tables\x20in\x20a\x20database','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','verbose','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','160305yVIoJV','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','5208664BGuaKK','1272936ZAAqqR','2502558GCvddJ','includes','query','Site:\x20','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','\x20table','execute','Database\x20\x27','.*\x22','Error:\x20Pattern\x20\x27','📋\x20','listTables','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','validate','cause','✖\x20No\x20tables\x20found','description','error','Database\x20pattern:\x20','7VamSng','1945416VxDvsm','\x27\x20across\x20all\x20databases.'];a49_0x6d45=function(){return _0x1f638d;};return a49_0x6d45();}export class TablesCommand extends BaseCommand{['name']='tables';[a49_0x1d77d7(0x18f)]=a49_0x1d77d7(0x1ab);async[a49_0x1d77d7(0x185)](_0x58e2b0){const _0x3645c2=a49_0x1d77d7,{options:_0x169ff1,args:_0x582f0d,tdx:_0x2c303d}=_0x58e2b0;let _0x448d9e;if(_0x582f0d[_0x3645c2(0x19a)]===0x0)_0x448d9e={'database':undefined,'table':undefined,'original':''};else{if(_0x582f0d['length']===0x1)try{_0x448d9e=parseTableReference(_0x582f0d[0x0]);if(_0x448d9e[_0x3645c2(0x19d)]&&!_0x448d9e[_0x3645c2(0x1a2)]&&!_0x448d9e[_0x3645c2(0x19d)][_0x3645c2(0x180)]('*')&&!_0x448d9e[_0x3645c2(0x19d)][_0x3645c2(0x180)]('?'))return console[_0x3645c2(0x190)](_0x3645c2(0x188)+_0x582f0d[0x0]+_0x3645c2(0x1a4)),console[_0x3645c2(0x190)](_0x3645c2(0x1a7)+_0x448d9e[_0x3645c2(0x19d)]+'\x27?'),console[_0x3645c2(0x190)]('\x20\x20Use:\x20tdx\x20tables\x20\x22'+_0x448d9e[_0x3645c2(0x19d)]+_0x3645c2(0x187)),console[_0x3645c2(0x190)](_0x3645c2(0x198)+_0x448d9e[_0x3645c2(0x19d)]),console[_0x3645c2(0x190)](_0x3645c2(0x18b)+_0x448d9e[_0x3645c2(0x19d)]),console[_0x3645c2(0x190)](''),console[_0x3645c2(0x190)](_0x3645c2(0x1a1)+_0x582f0d[0x0]+_0x3645c2(0x195)+_0x448d9e['table']+_0x3645c2(0x194)),0x1;}catch(_0x2a0036){return console['error'](_0x3645c2(0x1a9)+_0x2a0036[_0x3645c2(0x19b)]),0x1;}else return console[_0x3645c2(0x190)](_0x3645c2(0x19e)),console[_0x3645c2(0x190)](_0x3645c2(0x183)),console['error'](_0x3645c2(0x1ac)),console[_0x3645c2(0x190)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x3645c2(0x190)](_0x3645c2(0x1ae)),console[_0x3645c2(0x190)]('Or\x20use\x20--in\x20flag:'),console[_0x3645c2(0x190)](_0x3645c2(0x1a5)),0x1;}const _0x151d4a=_0x169ff1[_0x3645c2(0x1a2)];!_0x448d9e[_0x3645c2(0x1a2)]&&_0x151d4a&&(_0x448d9e[_0x3645c2(0x1a2)]=_0x151d4a);try{const _0x3f429e=_0x173991=>_0x173991&&(_0x173991['includes']('*')||_0x173991[_0x3645c2(0x180)]('?')),_0x569fe6=_0x3f429e(_0x448d9e[_0x3645c2(0x1a2)]);_0x169ff1['verbose']&&(console[_0x3645c2(0x190)](_0x3645c2(0x182)+_0x169ff1['site']),_0x448d9e[_0x3645c2(0x1a2)]?_0x569fe6?console[_0x3645c2(0x190)](_0x3645c2(0x191)+_0x448d9e['database']):console[_0x3645c2(0x190)](_0x3645c2(0x1aa)+_0x448d9e[_0x3645c2(0x1a2)]):console[_0x3645c2(0x190)](_0x3645c2(0x1a6)),_0x448d9e[_0x3645c2(0x19d)]&&console[_0x3645c2(0x190)]('Table\x20pattern:\x20'+_0x448d9e[_0x3645c2(0x19d)]));const _0x4b194e=_0x448d9e[_0x3645c2(0x1a2)]&&!_0x569fe6?_0x448d9e[_0x3645c2(0x1a2)]:undefined,_0x1bd024=_0x569fe6?_0x448d9e['database']:undefined,_0x3e89ff=_0x448d9e['table'],_0x61500f=resolveLimit(_0x169ff1[_0x3645c2(0x197)],DEFAULT_LISTING_LIMIT),_0x4fd397=await withSpinner(_0x3645c2(0x196),()=>_0x2c303d[_0x3645c2(0x181)][_0x3645c2(0x18a)](_0x4b194e,_0x3e89ff,_0x1bd024,_0x61500f),{'verbose':_0x169ff1[_0x3645c2(0x1ad)]}),_0x17a220=_0x4fd397['data'];if(_0x17a220[_0x3645c2(0x19a)]===0x0&&_0x448d9e[_0x3645c2(0x1a2)]&&!_0x569fe6)return console[_0x3645c2(0x190)](_0x3645c2(0x18e)),console[_0x3645c2(0x190)](_0x3645c2(0x186)+_0x448d9e[_0x3645c2(0x1a2)]+_0x3645c2(0x1b0)),0x1;console['error']('✔\x20Found\x20'+_0x17a220[_0x3645c2(0x19a)]+_0x3645c2(0x184)+(_0x17a220[_0x3645c2(0x19a)]!==0x1?'s':''));if(isStructuredFormat(_0x169ff1))await handleSDKOutput(_0x17a220,{..._0x169ff1,'limit':_0x61500f});else for(const _0x54e72f of _0x17a220){const _0x5f1ba7=_0x54e72f[_0x3645c2(0x19c)]?_0x54e72f['database_name']+'.':'';console[_0x3645c2(0x19f)](_0x3645c2(0x189)+_0x5f1ba7+_0x54e72f['table_name']);}return 0x0;}catch(_0x1b79ab){if(_0x1b79ab instanceof SDKError)return console['error']('Error:\x20'+_0x1b79ab[_0x3645c2(0x19b)]),_0x1b79ab[_0x3645c2(0x18d)]&&console['error'](_0x3645c2(0x1a8)+_0x1b79ab[_0x3645c2(0x18d)]),0x1;throw _0x1b79ab;}}[a49_0x1d77d7(0x18c)](_0x393507){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0x2c4d4d=a50_0x3b50;function a50_0x3b50(_0x9e9dff,_0x278437){_0x9e9dff=_0x9e9dff-0x125;const _0xfd13f8=a50_0xfd13();let _0x3b5053=_0xfd13f8[_0x9e9dff];return _0x3b5053;}(function(_0x1ab545,_0x3fc53c){const _0x44fbce=a50_0x3b50,_0x117938=_0x1ab545();while(!![]){try{const _0x55f310=parseInt(_0x44fbce(0x139))/0x1*(parseInt(_0x44fbce(0x129))/0x2)+-parseInt(_0x44fbce(0x12a))/0x3*(-parseInt(_0x44fbce(0x141))/0x4)+-parseInt(_0x44fbce(0x13c))/0x5+parseInt(_0x44fbce(0x12b))/0x6*(parseInt(_0x44fbce(0x13a))/0x7)+-parseInt(_0x44fbce(0x148))/0x8+parseInt(_0x44fbce(0x135))/0x9+-parseInt(_0x44fbce(0x12f))/0xa;if(_0x55f310===_0x3fc53c)break;else _0x117938['push'](_0x117938['shift']());}catch(_0x5922de){_0x117938['push'](_0x117938['shift']());}}}(a50_0xfd13,0x8aed4));import{BaseCommand}from'./command.js';import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';function a50_0xfd13(){const _0x44708c=['execute','session','dim','Default\x20site\x20','profile','length','533774KGnxBk','81EghiBR','2724786DkKGRw','\x0aUpdated:\x20','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','message','6951270etplTM','validate','database','default','parent_segment','Invalid\x20resource:\x20','1618371eLAlVy','Default\x20profile\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20cas\x0a','3BlAnHj','14JoKTYv','join','3937605LHPNid','engage_workspace','Session\x20','site','log','25608WFfcMb','Clear\x20session-level\x20or\x20default\x20context\x20values','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','name','unset','composable_audience','green','79232JRXCKH','llm_project','cleared','tdx.json'];a50_0xfd13=function(){return _0x44708c;};return a50_0xfd13();}import{getConfigDir}from'../core/config.js';import a50_0x550dfa from'chalk';import*as a50_0x22f897 from'node:path';export class UnsetCommand extends BaseCommand{[a50_0x2c4d4d(0x144)]=a50_0x2c4d4d(0x145);['description']=a50_0x2c4d4d(0x142);[a50_0x2c4d4d(0x130)](_0x10b7d5){const _0x1ff649=a50_0x2c4d4d,{args:_0x26cf85,options:_0x42ca62}=_0x10b7d5,_0x3197f5=_0x42ca62[_0x1ff649(0x132)];if(_0x26cf85[_0x1ff649(0x128)]===0x0)return'Usage:\x20tdx\x20unset\x20<resource>\x0a'+_0x1ff649(0x137)+_0x1ff649(0x138)+_0x1ff649(0x143);const _0x3f1154=_0x26cf85[0x0],_0x54b6ca=[_0x1ff649(0x13f),_0x1ff649(0x131),_0x1ff649(0x133),_0x1ff649(0x149),'agent',_0x1ff649(0x127),_0x1ff649(0x13d),'cas',_0x1ff649(0x146)];if(!_0x54b6ca['includes'](_0x3f1154))return _0x1ff649(0x134)+_0x3f1154+'.\x20Must\x20be\x20one\x20of:\x20'+_0x54b6ca[_0x1ff649(0x13b)](',\x20');if(_0x3197f5&&_0x3f1154!==_0x1ff649(0x13f)&&_0x3f1154!=='profile')return _0x1ff649(0x12d);return undefined;}async[a50_0x2c4d4d(0x14c)](_0x40c2d4){const _0x41371f=a50_0x2c4d4d,{args:_0x2747c4,options:_0x35c6c0}=_0x40c2d4,_0x5224a9=_0x35c6c0[_0x41371f(0x132)];cleanExpiredSessions();try{const _0x5189d9=_0x2747c4[0x0],_0x1ed79b=a50_0x22f897[_0x41371f(0x13b)](getConfigDir(),_0x41371f(0x14b));if(_0x5224a9){if(_0x5189d9===_0x41371f(0x13f))return clearDefaultSiteFromUserConfig(),console[_0x41371f(0x140)](_0x41371f(0x126)+a50_0x550dfa['green'](_0x41371f(0x14a))),console['log'](a50_0x550dfa['dim'](_0x41371f(0x12c)+_0x1ed79b)),0x0;if(_0x5189d9==='profile')return clearActiveProfileFromUserConfig(),console[_0x41371f(0x140)](_0x41371f(0x136)+a50_0x550dfa[_0x41371f(0x147)](_0x41371f(0x14a))),console[_0x41371f(0x140)](a50_0x550dfa[_0x41371f(0x125)]('\x0aUpdated:\x20'+_0x1ed79b)),0x0;}const _0x5e83e1=getSessionID(_0x35c6c0['session']),_0x4a8f2b={'site':_0x41371f(0x13f),'database':_0x41371f(0x131),'parent_segment':_0x41371f(0x133),'llm_project':_0x41371f(0x149),'agent':'llm_agent','profile':_0x41371f(0x127),'engage_workspace':_0x41371f(0x13d),'cas':_0x41371f(0x146),'composable_audience':_0x41371f(0x146)},_0x14db5c=_0x4a8f2b[_0x5189d9];return _0x14db5c&&(clearSessionContextField(_0x14db5c,_0x35c6c0[_0x41371f(0x14d)]),console['log'](_0x41371f(0x13e)+_0x5189d9+'\x20'+a50_0x550dfa['green'](_0x41371f(0x14a))+'\x20'+a50_0x550dfa['dim']('(session:\x20'+_0x5e83e1+')'))),0x0;}catch(_0x1707a4){return _0x1707a4 instanceof Error&&console['error']('Error:\x20'+_0x1707a4[_0x41371f(0x12e)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a51_0x3e706b=a51_0x1c06;(function(_0x5d53eb,_0x243380){const _0x382623=a51_0x1c06,_0x1164e1=_0x5d53eb();while(!![]){try{const _0x5b5d3a=-parseInt(_0x382623(0x195))/0x1+parseInt(_0x382623(0x1a6))/0x2*(parseInt(_0x382623(0x187))/0x3)+-parseInt(_0x382623(0x1a0))/0x4+-parseInt(_0x382623(0x1af))/0x5+parseInt(_0x382623(0x19f))/0x6+parseInt(_0x382623(0x1a4))/0x7+-parseInt(_0x382623(0x1a8))/0x8;if(_0x5b5d3a===_0x243380)break;else _0x1164e1['push'](_0x1164e1['shift']());}catch(_0x522fb0){_0x1164e1['push'](_0x1164e1['shift']());}}}(a51_0x5112,0x9349f));import{gt}from'semver';import a51_0x401da7 from'chalk';import{BaseCommand}from'./command.js';import{getVersion,isDevVersion}from'../core/version.js';import{loadReleaseChannel}from'../core/config.js';import{fetchLatestVersion}from'../utils/version-check.js';import{crossSpawn}from'../utils/process.js';const PACKAGE_NAME='@treasuredata/tdx';function a51_0x1c06(_0x3a2082,_0xc6d06c){_0x3a2082=_0x3a2082-0x183;const _0x511231=a51_0x5112();let _0x1c06c3=_0x511231[_0x3a2082];return _0x1c06c3;}export function detectPackageManager(){const _0x419cb3=a51_0x1c06,_0x4712f4=process[_0x419cb3(0x1a3)][_0x419cb3(0x183)](),_0x11ad3f=process[_0x419cb3(0x196)][0x1]??'';if(_0x4712f4[_0x419cb3(0x19c)](_0x419cb3(0x185))||_0x11ad3f[_0x419cb3(0x19c)](_0x419cb3(0x19e)))return _0x419cb3(0x185);if(_0x11ad3f[_0x419cb3(0x19c)](_0x419cb3(0x1ac)))return'pnpm';if(_0x11ad3f[_0x419cb3(0x19c)](_0x419cb3(0x19a)))return _0x419cb3(0x19a);return _0x419cb3(0x192);}export function buildInstallArgs(_0x304bf8,_0x438ac1){const _0x42960e=a51_0x1c06;switch(_0x304bf8){case _0x42960e(0x19a):return[_0x42960e(0x18c),_0x42960e(0x190),_0x438ac1];case _0x42960e(0x1ac):return['add','-g',_0x438ac1];default:return[_0x42960e(0x1a2),'-g',_0x438ac1];}}function a51_0x5112(){const _0x202e6c=['log','3lwCwkK','Target\x20version:','error','close','name','global','Already\x20up\x20to\x20date\x20(','green','replace','add','inherit','npm','latest','Running:','573843vSIYjT','argv','Current\x20version:\x20','message','description','yarn','next','includes','execute','.bun/','5142570hxQiZG','801492JbcAew','...','install','execPath','4662952kUSqCF','Current\x20version:','324278kvQXFX','join','1972344JDOBCo','Upgrade\x20tdx\x20to\x20the\x20latest\x20version','dim','Failed\x20to\x20run\x20','pnpm','Checking\x20','Upgrade\x20is\x20not\x20available\x20for\x20development\x20versions.','306580ZiMztK','toLowerCase','red','bun'];a51_0x5112=function(){return _0x202e6c;};return a51_0x5112();}export class UpgradeCommand extends BaseCommand{[a51_0x3e706b(0x18b)]='upgrade';[a51_0x3e706b(0x199)]=a51_0x3e706b(0x1a9);async[a51_0x3e706b(0x19d)](_0x3a4902){const _0x4124b7=a51_0x3e706b,{options:_0x49bed7,args:_0x21a5c2}=_0x3a4902,_0x398beb=!!_0x49bed7['dryRun'],{next:_0x434e10,method:_0x293898}=_0x49bed7,_0x28628a=_0x434e10?'next':loadReleaseChannel(),_0x335e93=_0x28628a===_0x4124b7(0x19b)?'next':_0x4124b7(0x193),_0x2efc8d=_0x21a5c2[0x0]?String(_0x21a5c2[0x0])[_0x4124b7(0x18f)](/^v/,''):undefined,_0x4f8b58=getVersion();if(isDevVersion())return console[_0x4124b7(0x189)](a51_0x401da7['yellow'](_0x4124b7(0x1ae))),console[_0x4124b7(0x189)](a51_0x401da7['dim'](_0x4124b7(0x197)+_0x4f8b58)),0x1;let _0x280e30;if(_0x2efc8d)_0x280e30=_0x2efc8d,console[_0x4124b7(0x186)](a51_0x401da7[_0x4124b7(0x1aa)](_0x4124b7(0x1a5))+'\x20'+_0x4f8b58),console[_0x4124b7(0x186)](a51_0x401da7[_0x4124b7(0x1aa)](_0x4124b7(0x188))+'\x20\x20'+a51_0x401da7[_0x4124b7(0x18e)](_0x2efc8d)),console[_0x4124b7(0x186)]();else{console[_0x4124b7(0x186)](a51_0x401da7[_0x4124b7(0x1aa)](_0x4124b7(0x1ad)+PACKAGE_NAME+'@'+_0x335e93+_0x4124b7(0x1a1)));try{_0x280e30=await fetchLatestVersion(_0x28628a);}catch(_0x316c30){return console[_0x4124b7(0x189)](a51_0x401da7[_0x4124b7(0x184)]('Failed\x20to\x20check\x20for\x20updates:\x20'+(_0x316c30 instanceof Error?_0x316c30[_0x4124b7(0x198)]:String(_0x316c30)))),0x1;}if(!gt(_0x280e30,_0x4f8b58))return console[_0x4124b7(0x186)](a51_0x401da7[_0x4124b7(0x18e)](_0x4124b7(0x18d)+_0x4f8b58+').')),0x0;console[_0x4124b7(0x186)](a51_0x401da7['dim'](_0x4124b7(0x1a5))+'\x20'+_0x4f8b58),console[_0x4124b7(0x186)](a51_0x401da7[_0x4124b7(0x1aa)]('Latest\x20version:')+'\x20\x20'+a51_0x401da7[_0x4124b7(0x18e)](_0x280e30)),console[_0x4124b7(0x186)]();}const _0xec1e45=_0x293898??detectPackageManager(),_0x3ec62d=_0x2efc8d?PACKAGE_NAME+'@'+_0x2efc8d:PACKAGE_NAME+'@'+_0x335e93,_0x16d102=buildInstallArgs(_0xec1e45,_0x3ec62d);if(_0x398beb)return console[_0x4124b7(0x186)](a51_0x401da7[_0x4124b7(0x1aa)]('Would\x20run:')),console[_0x4124b7(0x186)]('\x20\x20'+a51_0x401da7['cyan'](_0xec1e45+'\x20'+_0x16d102[_0x4124b7(0x1a7)]('\x20'))),0x0;return console['log'](a51_0x401da7['dim'](_0x4124b7(0x194))+'\x20'+_0xec1e45+'\x20'+_0x16d102[_0x4124b7(0x1a7)]('\x20')),console['log'](),new Promise(_0x2bff8e=>{const _0x37dd03=_0x4124b7,_0x4e575b=crossSpawn(_0xec1e45,_0x16d102,{'stdio':_0x37dd03(0x191)});_0x4e575b['on'](_0x37dd03(0x18a),_0x14d1fb=>{const _0x3fe86b=_0x37dd03;console['log'](),_0x14d1fb===0x0?console[_0x3fe86b(0x186)](a51_0x401da7[_0x3fe86b(0x18e)]('Successfully\x20upgraded\x20to\x20'+_0x3ec62d)):console[_0x3fe86b(0x189)](a51_0x401da7[_0x3fe86b(0x184)]('Upgrade\x20failed\x20(exit\x20code\x20'+_0x14d1fb+').')),_0x2bff8e(_0x14d1fb??0x1);}),_0x4e575b['on'](_0x37dd03(0x189),_0x67f02e=>{const _0x28ee10=_0x37dd03;console[_0x28ee10(0x189)](a51_0x401da7[_0x28ee10(0x184)](_0x28ee10(0x1ab)+_0xec1e45+':\x20'+_0x67f02e['message'])),_0x2bff8e(0x1);});});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a52_0x37c6ee=a52_0x4098;(function(_0x2dbfb0,_0x380598){const _0x4a49b3=a52_0x4098,_0x2ccb74=_0x2dbfb0();while(!![]){try{const _0x1b3266=parseInt(_0x4a49b3(0x181))/0x1+-parseInt(_0x4a49b3(0x185))/0x2*(-parseInt(_0x4a49b3(0x16c))/0x3)+-parseInt(_0x4a49b3(0x175))/0x4+-parseInt(_0x4a49b3(0x172))/0x5*(parseInt(_0x4a49b3(0x167))/0x6)+parseInt(_0x4a49b3(0x19a))/0x7*(-parseInt(_0x4a49b3(0x190))/0x8)+-parseInt(_0x4a49b3(0x17a))/0x9*(-parseInt(_0x4a49b3(0x154))/0xa)+parseInt(_0x4a49b3(0x159))/0xb;if(_0x1b3266===_0x380598)break;else _0x2ccb74['push'](_0x2ccb74['shift']());}catch(_0x373933){_0x2ccb74['push'](_0x2ccb74['shift']());}}}(a52_0x2942,0xa5a92));function a52_0x4098(_0x467848,_0x4184e5){_0x467848=_0x467848-0x151;const _0x2942d9=a52_0x2942();let _0x4098a3=_0x2942d9[_0x467848];return _0x4098a3;}import{BaseCommand}from'./command.js';import{saveSessionContext,getSessionID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists,saveActiveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';function a52_0x2942(){const _0x91c2f6=['session','next','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20cas,\x20release_channel\x0a','Session\x20context\x20','Set\x20session-level\x20context','validate','\x27\x20does\x20not\x20exist','llm_agent','4686bJcXSV','Session\x20llm_project\x20set\x20to:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a','\x27\x20to\x20save\x20permanently','code','2403771OZxzuD','(session:\x20','Session\x20engage_workspace\x20set\x20to:\x20','release_channel','error','displayWithSources','7510RrAspZ','name','dim','3287368MWoEfa','log','Error:\x20Profile\x20\x27','join','cleared','81LczUzR','parent_segment','llm_project','\x0aUpdate\x20notifications\x20will\x20now\x20check\x20the\x20@next\x20channel.','Session\x20profile\x20set\x20to:\x20','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','1099952PIIMvZ','site','\x0aUse\x20\x27tdx\x20engage\x20workspace\x20list\x27\x20to\x20see\x20available\x20workspaces','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>\x20\x20#\x20Set\x20release\x20channel\x0a','2kaghDR','\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','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','NOT_FOUND','default','green','description','\x0aSaved\x20to:\x20','composable_audience','Session\x20database\x20set\x20to:\x20','clear','32vIsbBU','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','execute','stable','tdx.json','agent','Session\x20parent_segment\x20set\x20to:\x20','length','display','1540546aGLhut','use','engage_workspace','database','\x0aUpdate\x20notifications\x20will\x20check\x20the\x20@latest\x20(stable)\x20channel.','profile','message','debug','Verifying\x20workspace\x20\x27','1010370NPexaZ','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20','Release\x20channel\x20set\x20to:\x20','Default\x20profile\x20set\x20to:\x20','tdx','8175420LGPibk','Session\x20agent\x20set\x20to:\x20','Default\x20site\x20set\x20to:\x20','Install\x20the\x20latest\x20next\x20version:\x20npm\x20install\x20-g\x20@treasuredata/tdx@next','.\x20Must\x20be\x20\x27stable\x27\x20or\x20\x27next\x27.','Invalid\x20resource:\x20'];a52_0x2942=function(){return _0x91c2f6;};return a52_0x2942();}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 a52_0x591f7a from'chalk';import*as a52_0xe5fca4 from'node:path';export class UseCommand extends BaseCommand{[a52_0x37c6ee(0x173)]=a52_0x37c6ee(0x19b);[a52_0x37c6ee(0x18b)]=a52_0x37c6ee(0x163);[a52_0x37c6ee(0x164)](_0x1cc0fe){const _0x1483e1=a52_0x37c6ee,{args:_0x904d17,options:_0x58f488}=_0x1cc0fe,_0x512970=_0x58f488[_0x1483e1(0x189)];if(_0x904d17[_0x1483e1(0x198)]===0x0)return undefined;if(_0x904d17[_0x1483e1(0x198)]===0x1)return _0x1483e1(0x192)+_0x1483e1(0x186)+_0x1483e1(0x180)+_0x1483e1(0x169)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a'+_0x1483e1(0x184)+_0x1483e1(0x161)+_0x1483e1(0x187);const _0x3c8bf6=_0x904d17[0x0],_0x3b25dc=['site','database',_0x1483e1(0x17b),_0x1483e1(0x17c),_0x1483e1(0x196),_0x1483e1(0x19f),_0x1483e1(0x19c),'cas','composable_audience',_0x1483e1(0x16f)];if(!_0x3b25dc['includes'](_0x3c8bf6))return _0x1483e1(0x15e)+_0x3c8bf6+'.\x20Must\x20be\x20one\x20of:\x20'+_0x3b25dc[_0x1483e1(0x178)](',\x20');if(_0x512970&&_0x3c8bf6!==_0x1483e1(0x182)&&_0x3c8bf6!==_0x1483e1(0x19f)&&_0x3c8bf6!==_0x1483e1(0x16f))return'--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27,\x20\x27profile\x27,\x20or\x20\x27release_channel\x27.\x20Other\x20resources\x20are\x20session-level\x20only.';if(_0x3c8bf6==='release_channel'&&!_0x512970)return'release_channel\x20requires\x20--default.\x20Usage:\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>';if(_0x3c8bf6===_0x1483e1(0x16f)){const _0x5c062b=_0x904d17[0x1];if(_0x5c062b!==_0x1483e1(0x194)&&_0x5c062b!==_0x1483e1(0x160))return'Invalid\x20release\x20channel:\x20'+_0x5c062b+_0x1483e1(0x15d);}return undefined;}async[a52_0x37c6ee(0x193)](_0x393ef0){const _0x18dcd5=a52_0x37c6ee,{args:_0x32bcd9,options:_0x185efc}=_0x393ef0,_0x34bcaf=_0x185efc[_0x18dcd5(0x152)],_0x1d7281=_0x185efc[_0x18dcd5(0x18f)],_0x15486b=_0x185efc[_0x18dcd5(0x189)];cleanExpiredSessions();try{if(_0x1d7281){clearSessionContext(_0x185efc[_0x18dcd5(0x15f)]);const _0x3a61f9=getSessionID(_0x185efc[_0x18dcd5(0x15f)]);return console[_0x18dcd5(0x176)](_0x18dcd5(0x162)+a52_0x591f7a[_0x18dcd5(0x18a)](_0x18dcd5(0x179))+'\x20'+a52_0x591f7a[_0x18dcd5(0x174)](_0x18dcd5(0x16d)+_0x3a61f9+')')),0x0;}if(_0x32bcd9[_0x18dcd5(0x198)]===0x0){const _0x2797b8=new GlobalContext(_0x185efc);return _0x34bcaf?_0x2797b8[_0x18dcd5(0x171)]():_0x2797b8[_0x18dcd5(0x199)](),console[_0x18dcd5(0x176)](a52_0x591f7a[_0x18dcd5(0x174)]('\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>')),console['log'](a52_0x591f7a['dim']('Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel')),console[_0x18dcd5(0x176)](a52_0x591f7a[_0x18dcd5(0x174)]('Use\x20--default\x20with\x20site,\x20profile,\x20or\x20release_channel\x20to\x20save\x20permanently')),0x0;}const _0x49dc77=_0x32bcd9[0x0],_0xa451e7=_0x32bcd9[0x1],_0x2220fd=a52_0xe5fca4['join'](getConfigDir(),_0x18dcd5(0x195));if(_0x15486b){if(_0x49dc77===_0x18dcd5(0x182))return saveDefaultSiteToUserConfig(_0xa451e7),console[_0x18dcd5(0x176)](_0x18dcd5(0x15b)+a52_0x591f7a['green'](_0xa451e7)),console[_0x18dcd5(0x176)](a52_0x591f7a[_0x18dcd5(0x174)]('\x0aSaved\x20to:\x20'+_0x2220fd)),0x0;if(_0x49dc77===_0x18dcd5(0x19f)){if(!profileExists(_0xa451e7))return console[_0x18dcd5(0x170)](_0x18dcd5(0x177)+_0xa451e7+_0x18dcd5(0x165)),console[_0x18dcd5(0x170)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;return saveActiveProfileToUserConfig(_0xa451e7),console[_0x18dcd5(0x176)](_0x18dcd5(0x157)+a52_0x591f7a[_0x18dcd5(0x18a)](_0xa451e7)),console[_0x18dcd5(0x176)](a52_0x591f7a['dim'](_0x18dcd5(0x18c)+_0x2220fd)),0x0;}if(_0x49dc77===_0x18dcd5(0x16f))return saveReleaseChannel(_0xa451e7),console['log'](_0x18dcd5(0x156)+a52_0x591f7a[_0x18dcd5(0x18a)](_0xa451e7)),console[_0x18dcd5(0x176)](a52_0x591f7a['dim'](_0x18dcd5(0x18c)+_0x2220fd)),_0xa451e7==='next'?(console[_0x18dcd5(0x176)](a52_0x591f7a['dim'](_0x18dcd5(0x17d))),console[_0x18dcd5(0x176)](a52_0x591f7a[_0x18dcd5(0x174)](_0x18dcd5(0x15c)))):console['log'](a52_0x591f7a['dim'](_0x18dcd5(0x19e))),0x0;}if(_0x49dc77===_0x18dcd5(0x182)){const _0xf919a5=getSessionID(_0x185efc[_0x18dcd5(0x15f)]);return saveSessionContext({'site':_0xa451e7},_0x185efc[_0x18dcd5(0x15f)]),console[_0x18dcd5(0x176)]('Session\x20site\x20set\x20to:\x20'+a52_0x591f7a[_0x18dcd5(0x18a)](_0xa451e7)+'\x20'+a52_0x591f7a[_0x18dcd5(0x174)](_0x18dcd5(0x16d)+_0xf919a5+')')),console[_0x18dcd5(0x176)](a52_0x591f7a['dim']('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20'+_0xa451e7+_0x18dcd5(0x16a))),0x0;}if(_0x49dc77===_0x18dcd5(0x19f)){if(!profileExists(_0xa451e7))return console[_0x18dcd5(0x170)](_0x18dcd5(0x177)+_0xa451e7+_0x18dcd5(0x165)),console[_0x18dcd5(0x170)](_0x18dcd5(0x17f)),0x1;const _0x1ae767=getSessionID(_0x185efc[_0x18dcd5(0x15f)]);return saveSessionContext({'profile':_0xa451e7},_0x185efc[_0x18dcd5(0x15f)]),console[_0x18dcd5(0x176)](_0x18dcd5(0x17e)+a52_0x591f7a[_0x18dcd5(0x18a)](_0xa451e7)+'\x20'+a52_0x591f7a[_0x18dcd5(0x174)]('(session:\x20'+_0x1ae767+')')),console[_0x18dcd5(0x176)](a52_0x591f7a[_0x18dcd5(0x174)](_0x18dcd5(0x155)+_0xa451e7+'\x27\x20to\x20save\x20permanently')),0x0;}const _0x22d767={},_0x5f19d6=getSessionID(_0x185efc[_0x18dcd5(0x15f)]);switch(_0x49dc77){case _0x18dcd5(0x19d):_0x22d767[_0x18dcd5(0x19d)]=_0xa451e7,console['log'](_0x18dcd5(0x18e)+a52_0x591f7a[_0x18dcd5(0x18a)](_0xa451e7)+'\x20'+a52_0x591f7a[_0x18dcd5(0x174)](_0x18dcd5(0x16d)+_0x5f19d6+')'));break;case _0x18dcd5(0x17b):_0x22d767[_0x18dcd5(0x17b)]=_0xa451e7,console[_0x18dcd5(0x176)](_0x18dcd5(0x197)+a52_0x591f7a[_0x18dcd5(0x18a)](_0xa451e7)+'\x20'+a52_0x591f7a[_0x18dcd5(0x174)](_0x18dcd5(0x16d)+_0x5f19d6+')'));break;case'llm_project':_0x22d767[_0x18dcd5(0x17c)]=_0xa451e7,console[_0x18dcd5(0x176)](_0x18dcd5(0x168)+a52_0x591f7a[_0x18dcd5(0x18a)](_0xa451e7)+'\x20'+a52_0x591f7a[_0x18dcd5(0x174)]('(session:\x20'+_0x5f19d6+')'));break;case'agent':{const {projectName:_0x3a230b,agentName:_0x573e6f}=parseAgentRef(_0xa451e7);_0x573e6f?(_0x22d767[_0x18dcd5(0x17c)]=_0x3a230b,_0x22d767[_0x18dcd5(0x166)]=_0x573e6f,console['log'](_0x18dcd5(0x168)+a52_0x591f7a[_0x18dcd5(0x18a)](_0x3a230b)+'\x20'+a52_0x591f7a[_0x18dcd5(0x174)]('(session:\x20'+_0x5f19d6+')')),console[_0x18dcd5(0x176)](_0x18dcd5(0x15a)+a52_0x591f7a[_0x18dcd5(0x18a)](_0x573e6f)+'\x20'+a52_0x591f7a[_0x18dcd5(0x174)](_0x18dcd5(0x16d)+_0x5f19d6+')'))):(_0x22d767['llm_agent']=_0xa451e7,console['log'](_0x18dcd5(0x15a)+a52_0x591f7a[_0x18dcd5(0x18a)](_0xa451e7)+'\x20'+a52_0x591f7a['dim'](_0x18dcd5(0x16d)+_0x5f19d6+')')));break;}case'cas':case _0x18dcd5(0x18d):_0x22d767[_0x18dcd5(0x18d)]=_0xa451e7,console[_0x18dcd5(0x176)]('Session\x20composable_audience\x20set\x20to:\x20'+a52_0x591f7a[_0x18dcd5(0x18a)](_0xa451e7)+'\x20'+a52_0x591f7a[_0x18dcd5(0x174)](_0x18dcd5(0x16d)+_0x5f19d6+')'));break;case'engage_workspace':{try{await withSpinner(_0x18dcd5(0x153)+_0xa451e7+'\x27...',()=>_0x393ef0[_0x18dcd5(0x158)]['engage']['resolveWorkspaceId'](_0xa451e7));}catch(_0x16fb4d){if(_0x16fb4d instanceof SDKError&&(_0x16fb4d['code']===ErrorCode[_0x18dcd5(0x188)]||_0x16fb4d[_0x18dcd5(0x16b)]===ErrorCode['INVALID_ARGUMENT']))return console['error']('Error:\x20'+_0x16fb4d[_0x18dcd5(0x151)]),console[_0x18dcd5(0x170)](_0x18dcd5(0x183)),0x1;throw _0x16fb4d;}_0x22d767[_0x18dcd5(0x19c)]=_0xa451e7,console[_0x18dcd5(0x176)](_0x18dcd5(0x16e)+a52_0x591f7a[_0x18dcd5(0x18a)](_0xa451e7)+'\x20'+a52_0x591f7a[_0x18dcd5(0x174)](_0x18dcd5(0x16d)+_0x5f19d6+')'));break;}}return saveSessionContext(_0x22d767,_0x185efc['session']),console[_0x18dcd5(0x176)](a52_0x591f7a[_0x18dcd5(0x174)](_0x18dcd5(0x191))),0x0;}catch(_0x371537){return _0x371537 instanceof Error&&console[_0x18dcd5(0x170)]('Error:\x20'+_0x371537[_0x18dcd5(0x151)]),0x1;}}}
|
|
1
|
+
const a52_0x5416fb=a52_0x2159;(function(_0x38c147,_0x2c3058){const _0x207751=a52_0x2159,_0x13ca37=_0x38c147();while(!![]){try{const _0x4df284=parseInt(_0x207751(0xb5))/0x1+-parseInt(_0x207751(0x9a))/0x2+parseInt(_0x207751(0x9b))/0x3*(parseInt(_0x207751(0xc8))/0x4)+parseInt(_0x207751(0xa0))/0x5*(-parseInt(_0x207751(0xc9))/0x6)+parseInt(_0x207751(0xd5))/0x7*(parseInt(_0x207751(0x98))/0x8)+-parseInt(_0x207751(0x87))/0x9*(parseInt(_0x207751(0xc2))/0xa)+-parseInt(_0x207751(0x93))/0xb;if(_0x4df284===_0x2c3058)break;else _0x13ca37['push'](_0x13ca37['shift']());}catch(_0x1a953e){_0x13ca37['push'](_0x13ca37['shift']());}}}(a52_0x3bcd,0xbe3c8));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';function a52_0x2159(_0x38ebb5,_0x2a73fc){_0x38ebb5=_0x38ebb5-0x82;const _0x3bcd3d=a52_0x3bcd();let _0x215994=_0x3bcd3d[_0x38ebb5];return _0x215994;}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';function a52_0x3bcd(){const _0x14e874=['--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27,\x20\x27profile\x27,\x20or\x20\x27release_channel\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','log','\x27\x20does\x20not\x20exist','INVALID_ARGUMENT','\x0aUpdate\x20notifications\x20will\x20check\x20the\x20@latest\x20(stable)\x20channel.','8964813OjJiFT','dim','message','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','28360ORatcG','description','2315096EMPhQC','235527LnhHRn','Session\x20context\x20','Session\x20agent\x20set\x20to:\x20','error','Session\x20composable_audience\x20set\x20to:\x20','418360wgjZhp','debug','Session\x20profile\x20set\x20to:\x20','profile','agent','Session\x20database\x20set\x20to:\x20','default','use','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>\x20\x20#\x20Set\x20release\x20channel\x0a','llm_project','resolveWorkspaceId','tdx','\x0aUpdate\x20notifications\x20will\x20now\x20check\x20the\x20@next\x20channel.','Release\x20channel\x20set\x20to:\x20','Verifying\x20workspace\x20\x27','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20cas,\x20release_channel\x0a','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','join','.\x20Must\x20be\x20\x27stable\x27\x20or\x20\x27next\x27.','Error:\x20','green','1130078xRBIeS','site','release_channel','Session\x20llm_project\x20set\x20to:\x20','engage','parent_segment','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','session','NOT_FOUND','clear','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20','code','length','1795190RuMwVU','Session\x20parent_segment\x20set\x20to:\x20','tdx.json','validate','llm_agent','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','76rfzBwb','24dtPHvM','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20','Set\x20session-level\x20context','name','stable','Invalid\x20resource:\x20','Session\x20site\x20set\x20to:\x20','(session:\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','engage_workspace','Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel','\x27\x20to\x20save\x20permanently','1981pwlFUu','Install\x20the\x20latest\x20next\x20version:\x20npm\x20install\x20-g\x20@treasuredata/tdx@next','Default\x20site\x20set\x20to:\x20','composable_audience','database','display','27XDEGhZ','includes','\x0aSaved\x20to:\x20','next','execute','cas','.\x20Must\x20be\x20one\x20of:\x20'];a52_0x3bcd=function(){return _0x14e874;};return a52_0x3bcd();}import a52_0x601d28 from'chalk';import*as a52_0x3a9eed from'node:path';export class UseCommand extends BaseCommand{[a52_0x5416fb(0xcc)]=a52_0x5416fb(0xa7);[a52_0x5416fb(0x99)]=a52_0x5416fb(0xcb);[a52_0x5416fb(0xc5)](_0x113483){const _0xbe5ff=a52_0x5416fb,{args:_0x3dcaa8,options:_0xef4205}=_0x113483,_0x20ebc2=_0xef4205[_0xbe5ff(0xa6)];if(_0x3dcaa8[_0xbe5ff(0xc1)]===0x0)return undefined;if(_0x3dcaa8[_0xbe5ff(0xc1)]===0x1)return _0xbe5ff(0xbb)+_0xbe5ff(0xd1)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a'+_0xbe5ff(0x96)+_0xbe5ff(0xa8)+_0xbe5ff(0xaf)+_0xbe5ff(0x97);const _0x168633=_0x3dcaa8[0x0],_0x33715e=[_0xbe5ff(0xb6),'database',_0xbe5ff(0xba),_0xbe5ff(0xa9),_0xbe5ff(0xa4),'profile',_0xbe5ff(0xd2),_0xbe5ff(0x8c),_0xbe5ff(0x84),_0xbe5ff(0xb7)];if(!_0x33715e[_0xbe5ff(0x88)](_0x168633))return _0xbe5ff(0xce)+_0x168633+_0xbe5ff(0x8d)+_0x33715e[_0xbe5ff(0xb1)](',\x20');if(_0x20ebc2&&_0x168633!==_0xbe5ff(0xb6)&&_0x168633!==_0xbe5ff(0xa3)&&_0x168633!=='release_channel')return _0xbe5ff(0x8e);if(_0x168633===_0xbe5ff(0xb7)&&!_0x20ebc2)return'release_channel\x20requires\x20--default.\x20Usage:\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>';if(_0x168633==='release_channel'){const _0x1e5255=_0x3dcaa8[0x1];if(_0x1e5255!==_0xbe5ff(0xcd)&&_0x1e5255!==_0xbe5ff(0x8a))return'Invalid\x20release\x20channel:\x20'+_0x1e5255+_0xbe5ff(0xb2);}return undefined;}async[a52_0x5416fb(0x8b)](_0x26c926){const _0x43b750=a52_0x5416fb,{args:_0x5d7248,options:_0x134fda}=_0x26c926,_0x37ab7e=_0x134fda[_0x43b750(0xa1)],_0x353dc6=_0x134fda[_0x43b750(0xbe)],_0x298c1e=_0x134fda[_0x43b750(0xa6)];cleanExpiredSessions();try{if(_0x353dc6){clearSessionContext(_0x134fda['session']);const _0x7b9db5=getSessionID(_0x134fda[_0x43b750(0xbc)]);return console[_0x43b750(0x8f)](_0x43b750(0x9c)+a52_0x601d28[_0x43b750(0xb4)]('cleared')+'\x20'+a52_0x601d28[_0x43b750(0x94)](_0x43b750(0xd0)+_0x7b9db5+')')),0x0;}if(_0x5d7248['length']===0x0){const _0x5d4a5a=new GlobalContext(_0x134fda);return _0x37ab7e?_0x5d4a5a['displayWithSources']():_0x5d4a5a[_0x43b750(0x86)](),console[_0x43b750(0x8f)](a52_0x601d28[_0x43b750(0x94)](_0x43b750(0xb0))),console[_0x43b750(0x8f)](a52_0x601d28['dim'](_0x43b750(0xd3))),console['log'](a52_0x601d28['dim']('Use\x20--default\x20with\x20site,\x20profile,\x20or\x20release_channel\x20to\x20save\x20permanently')),0x0;}const _0x2f04fc=_0x5d7248[0x0],_0x30530b=_0x5d7248[0x1],_0x348df6=a52_0x3a9eed['join'](getConfigDir(),_0x43b750(0xc4));if(_0x298c1e){if(_0x2f04fc===_0x43b750(0xb6))return saveDefaultSiteToUserConfig(_0x30530b),console[_0x43b750(0x8f)](_0x43b750(0x83)+a52_0x601d28['green'](_0x30530b)),console[_0x43b750(0x8f)](a52_0x601d28['dim'](_0x43b750(0x89)+_0x348df6)),0x0;if(_0x2f04fc===_0x43b750(0xa3)){if(!profileExists(_0x30530b))return console['error']('Error:\x20Profile\x20\x27'+_0x30530b+_0x43b750(0x90)),console[_0x43b750(0x9e)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;return saveActiveProfileToUserConfig(_0x30530b),console['log']('Default\x20profile\x20set\x20to:\x20'+a52_0x601d28[_0x43b750(0xb4)](_0x30530b)),console[_0x43b750(0x8f)](a52_0x601d28['dim']('\x0aSaved\x20to:\x20'+_0x348df6)),0x0;}if(_0x2f04fc===_0x43b750(0xb7))return saveReleaseChannel(_0x30530b),console[_0x43b750(0x8f)](_0x43b750(0xad)+a52_0x601d28['green'](_0x30530b)),console[_0x43b750(0x8f)](a52_0x601d28[_0x43b750(0x94)](_0x43b750(0x89)+_0x348df6)),_0x30530b===_0x43b750(0x8a)?(console[_0x43b750(0x8f)](a52_0x601d28[_0x43b750(0x94)](_0x43b750(0xac))),console[_0x43b750(0x8f)](a52_0x601d28[_0x43b750(0x94)](_0x43b750(0x82)))):console['log'](a52_0x601d28[_0x43b750(0x94)](_0x43b750(0x92))),0x0;}if(_0x2f04fc===_0x43b750(0xb6)){const _0x1ea62e=getSessionID(_0x134fda[_0x43b750(0xbc)]);return saveSessionContext({'site':_0x30530b},_0x134fda[_0x43b750(0xbc)]),console[_0x43b750(0x8f)](_0x43b750(0xcf)+a52_0x601d28['green'](_0x30530b)+'\x20'+a52_0x601d28[_0x43b750(0x94)](_0x43b750(0xd0)+_0x1ea62e+')')),console['log'](a52_0x601d28[_0x43b750(0x94)](_0x43b750(0xbf)+_0x30530b+_0x43b750(0xd4))),0x0;}if(_0x2f04fc===_0x43b750(0xa3)){if(!profileExists(_0x30530b))return console['error']('Error:\x20Profile\x20\x27'+_0x30530b+_0x43b750(0x90)),console['error'](_0x43b750(0xc7)),0x1;const _0x51f99b=getSessionID(_0x134fda['session']);return saveSessionContext({'profile':_0x30530b},_0x134fda[_0x43b750(0xbc)]),console[_0x43b750(0x8f)](_0x43b750(0xa2)+a52_0x601d28['green'](_0x30530b)+'\x20'+a52_0x601d28['dim'](_0x43b750(0xd0)+_0x51f99b+')')),console[_0x43b750(0x8f)](a52_0x601d28[_0x43b750(0x94)](_0x43b750(0xca)+_0x30530b+_0x43b750(0xd4))),0x0;}const _0x53ee4b={},_0x1bd579=getSessionID(_0x134fda[_0x43b750(0xbc)]);switch(_0x2f04fc){case _0x43b750(0x85):_0x53ee4b[_0x43b750(0x85)]=_0x30530b,console['log'](_0x43b750(0xa5)+a52_0x601d28[_0x43b750(0xb4)](_0x30530b)+'\x20'+a52_0x601d28[_0x43b750(0x94)](_0x43b750(0xd0)+_0x1bd579+')'));break;case _0x43b750(0xba):_0x53ee4b[_0x43b750(0xba)]=_0x30530b,console[_0x43b750(0x8f)](_0x43b750(0xc3)+a52_0x601d28[_0x43b750(0xb4)](_0x30530b)+'\x20'+a52_0x601d28[_0x43b750(0x94)](_0x43b750(0xd0)+_0x1bd579+')'));break;case _0x43b750(0xa9):_0x53ee4b[_0x43b750(0xa9)]=_0x30530b,console[_0x43b750(0x8f)](_0x43b750(0xb8)+a52_0x601d28['green'](_0x30530b)+'\x20'+a52_0x601d28[_0x43b750(0x94)](_0x43b750(0xd0)+_0x1bd579+')'));break;case _0x43b750(0xa4):{const {projectName:_0x2a8c74,agentName:_0x5a4c62}=parseAgentRef(_0x30530b);_0x5a4c62?(_0x53ee4b[_0x43b750(0xa9)]=_0x2a8c74,_0x53ee4b['llm_agent']=_0x5a4c62,console['log'](_0x43b750(0xb8)+a52_0x601d28['green'](_0x2a8c74)+'\x20'+a52_0x601d28['dim']('(session:\x20'+_0x1bd579+')')),console[_0x43b750(0x8f)]('Session\x20agent\x20set\x20to:\x20'+a52_0x601d28[_0x43b750(0xb4)](_0x5a4c62)+'\x20'+a52_0x601d28[_0x43b750(0x94)]('(session:\x20'+_0x1bd579+')'))):(_0x53ee4b[_0x43b750(0xc6)]=_0x30530b,console[_0x43b750(0x8f)](_0x43b750(0x9d)+a52_0x601d28['green'](_0x30530b)+'\x20'+a52_0x601d28['dim'](_0x43b750(0xd0)+_0x1bd579+')')));break;}case _0x43b750(0x8c):case _0x43b750(0x84):_0x53ee4b[_0x43b750(0x84)]=_0x30530b,console[_0x43b750(0x8f)](_0x43b750(0x9f)+a52_0x601d28[_0x43b750(0xb4)](_0x30530b)+'\x20'+a52_0x601d28[_0x43b750(0x94)]('(session:\x20'+_0x1bd579+')'));break;case'engage_workspace':{try{await withSpinner(_0x43b750(0xae)+_0x30530b+'\x27...',()=>_0x26c926[_0x43b750(0xab)][_0x43b750(0xb9)][_0x43b750(0xaa)](_0x30530b));}catch(_0x1bee94){if(_0x1bee94 instanceof SDKError&&(_0x1bee94[_0x43b750(0xc0)]===ErrorCode[_0x43b750(0xbd)]||_0x1bee94['code']===ErrorCode[_0x43b750(0x91)]))return console[_0x43b750(0x9e)](_0x43b750(0xb3)+_0x1bee94[_0x43b750(0x95)]),console[_0x43b750(0x9e)]('\x0aUse\x20\x27tdx\x20engage\x20workspace\x20list\x27\x20to\x20see\x20available\x20workspaces'),0x1;throw _0x1bee94;}_0x53ee4b[_0x43b750(0xd2)]=_0x30530b,console[_0x43b750(0x8f)]('Session\x20engage_workspace\x20set\x20to:\x20'+a52_0x601d28[_0x43b750(0xb4)](_0x30530b)+'\x20'+a52_0x601d28[_0x43b750(0x94)](_0x43b750(0xd0)+_0x1bd579+')'));break;}}return saveSessionContext(_0x53ee4b,_0x134fda['session']),console[_0x43b750(0x8f)](a52_0x601d28[_0x43b750(0x94)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}catch(_0x496659){return _0x496659 instanceof Error&&console[_0x43b750(0x9e)](_0x43b750(0xb3)+_0x496659[_0x43b750(0x95)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a53_0x53c5eb=a53_0x4796;(function(_0x1ec5cb,_0x14a664){const _0x4c27c1=a53_0x4796,_0x5cfb54=_0x1ec5cb();while(!![]){try{const _0x30b834=-parseInt(_0x4c27c1(0x161))/0x1*(-parseInt(_0x4c27c1(0x16b))/0x2)+parseInt(_0x4c27c1(0x152))/0x3*(parseInt(_0x4c27c1(0x157))/0x4)+parseInt(_0x4c27c1(0x172))/0x5*(parseInt(_0x4c27c1(0x16e))/0x6)+parseInt(_0x4c27c1(0x15c))/0x7+parseInt(_0x4c27c1(0x173))/0x8*(parseInt(_0x4c27c1(0x153))/0x9)+parseInt(_0x4c27c1(0x162))/0xa*(-parseInt(_0x4c27c1(0x16c))/0xb)+-parseInt(_0x4c27c1(0x165))/0xc;if(_0x30b834===_0x14a664)break;else _0x5cfb54['push'](_0x5cfb54['shift']());}catch(_0x1d05a9){_0x5cfb54['push'](_0x5cfb54['shift']());}}}(a53_0x247c,0x69599));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a53_0x247c(){const _0x543e08=['message','21pkmzNz','470980waEcIl','dim','✔\x20Found\x20','17627268lKwklD','\x20user','localeCompare','List\x20all\x20users\x20in\x20the\x20account','execute','yellow','32546ePrZfV','66MxyGfA','error','4167294MXGlTc','👤\x20','length','log','5iZSLTI','2053096JExhRp','description','administrator','cause','Unknown','email','user','Show\x20current\x20user\x20information','3ksynVJ','9ePiheq','verbose','user\x20list','data','2384660ioeAQe','sort','\x20(admin)','Listing\x20users...','\x20(owner)','2057692YpkaUy','account_owner','name','Error:\x20'];a53_0x247c=function(){return _0x543e08;};return a53_0x247c();}import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a53_0x4796(_0x1a2463,_0x4e1b1a){_0x1a2463=_0x1a2463-0x14d;const _0x247c69=a53_0x247c();let _0x479693=_0x247c69[_0x1a2463];return _0x479693;}import a53_0x1db962 from'chalk';export class UserCommand extends BaseCommand{['name']=a53_0x53c5eb(0x150);[a53_0x53c5eb(0x174)]=a53_0x53c5eb(0x151);async[a53_0x53c5eb(0x169)](_0x33d40e){const _0x35513b=a53_0x53c5eb,{options:_0xc3fd64,tdx:_0x3906f9}=_0x33d40e;try{const _0x596bff=await withSpinner('Fetching\x20user\x20info...',()=>_0x3906f9['user']['getCurrent'](),{'verbose':_0xc3fd64[_0x35513b(0x154)]}),_0x153bb1=_0x596bff[_0x35513b(0x156)];return await handleSingleObjectOutput(_0x153bb1,_0xc3fd64),0x0;}catch(_0xda51af){if(_0xda51af instanceof SDKError)return console[_0x35513b(0x16d)](_0x35513b(0x15f)+_0xda51af[_0x35513b(0x160)]),_0xda51af[_0x35513b(0x14d)]&&console[_0x35513b(0x16d)]('\x20\x20Cause:\x20'+_0xda51af[_0x35513b(0x14d)]),0x1;throw _0xda51af;}}}export class UserListCommand extends BaseCommand{[a53_0x53c5eb(0x15e)]=a53_0x53c5eb(0x155);['description']=a53_0x53c5eb(0x168);async[a53_0x53c5eb(0x169)](_0x22eea){const _0xb27d61=a53_0x53c5eb,{options:_0x232e1c,tdx:_0x1a3a55}=_0x22eea;try{const _0x132e92=await withSpinner(_0xb27d61(0x15a),()=>_0x1a3a55[_0xb27d61(0x150)]['list'](),{'verbose':_0x232e1c[_0xb27d61(0x154)]}),_0x3c10c3=_0x132e92[_0xb27d61(0x156)];console[_0xb27d61(0x16d)](_0xb27d61(0x164)+_0x3c10c3[_0xb27d61(0x170)]+_0xb27d61(0x166)+(_0x3c10c3[_0xb27d61(0x170)]!==0x1?'s':''));if(isStructuredFormat(_0x232e1c))await handleSDKOutput(_0x3c10c3,_0x232e1c);else{const _0x4210b8=[..._0x3c10c3][_0xb27d61(0x158)]((_0x1f8504,_0x24d7b2)=>String(_0x1f8504[_0xb27d61(0x15e)]??'')[_0xb27d61(0x167)](String(_0x24d7b2[_0xb27d61(0x15e)]??'')));for(const _0x49dbdb of _0x4210b8){const _0x28224d=_0x49dbdb[_0xb27d61(0x15d)]?a53_0x1db962[_0xb27d61(0x16a)](_0xb27d61(0x15b)):_0x49dbdb[_0xb27d61(0x175)]?a53_0x1db962[_0xb27d61(0x16a)](_0xb27d61(0x159)):'',_0x346ad0=_0x49dbdb[_0xb27d61(0x14f)]&&_0x49dbdb['email']!==_0x49dbdb[_0xb27d61(0x15e)]?a53_0x1db962[_0xb27d61(0x163)]('\x20<'+_0x49dbdb['email']+'>'):'';console[_0xb27d61(0x171)](_0xb27d61(0x16f)+(_0x49dbdb[_0xb27d61(0x15e)]??_0xb27d61(0x14e))+_0x346ad0+_0x28224d);}}return 0x0;}catch(_0x543ada){if(_0x543ada instanceof SDKError)return console[_0xb27d61(0x16d)](_0xb27d61(0x15f)+_0x543ada['message']),_0x543ada['cause']&&console[_0xb27d61(0x16d)]('\x20\x20Cause:\x20'+_0x543ada['cause']),0x1;throw _0x543ada;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a54_0x1689d2=a54_0x32ec;(function(_0x1d7d1a,_0x58e716){const _0x4914af=a54_0x32ec,_0x40bff7=_0x1d7d1a();while(!![]){try{const _0x3ad14b=-parseInt(_0x4914af(0x10f))/0x1*(parseInt(_0x4914af(0x123))/0x2)+-parseInt(_0x4914af(0x148))/0x3+parseInt(_0x4914af(0x168))/0x4*(parseInt(_0x4914af(0x13e))/0x5)+parseInt(_0x4914af(0x117))/0x6+-parseInt(_0x4914af(0x146))/0x7*(parseInt(_0x4914af(0x125))/0x8)+-parseInt(_0x4914af(0x137))/0x9*(parseInt(_0x4914af(0x152))/0xa)+parseInt(_0x4914af(0x134))/0xb*(parseInt(_0x4914af(0x11e))/0xc);if(_0x3ad14b===_0x58e716)break;else _0x40bff7['push'](_0x40bff7['shift']());}catch(_0x5aa28e){_0x40bff7['push'](_0x40bff7['shift']());}}}(a54_0x5993,0xc4eff));import{getChalk}from'../utils/colors.js';const chalk=getChalk();import{execFileSync}from'node:child_process';import a54_0x2f067b from'node:path';function a54_0x5993(){const _0x16fc4f=['initAt','slug','displayText','\x20→\x20','split','reduce','resolveWikiLinks','goals','46Qcsrtj','note','readDocument','kind','blue','\x20\x20(empty)','.\x20Valid:\x20','moveTask','6408468EyoJBg','critical','join','workspacePath','void','reference','red','16440iAKcgy','progress','repeat','bold','\x20Run\x20','20510dUQqlA','gray','760TBdJLn','white','Incoming','green','design_review','Invalid\x20status:\x20','title','done','name','medium','frontmatter','high','guide','error','workflow','12364sMlPYS','No\x20incoming\x20backlinks','Failed\x20to\x20open\x20editor:\x20','45pJmcjT','magenta','Invalid\x20kind:\x20','inherit','Goals','Wiki-links','goal','25LYYbCT','Invalid\x20priority:\x20','\x20\x20←\x20','Links\x20for:\x20','getBacklinks','getSummary','cyan','fileName','70357zSWjIT','resolvedKind','4032504VJDUQT','taskCounts','init','Outgoing','tdx\x20work\x20init\x20<name>','Tasks','flatMap','in_progress','yellow','backlog','610620GFXOjf','assignee','status','priority','round','cwd','trim','resolvedPath','entries','exit','No\x20tasks\x20yet.\x20Create\x20one\x20with:\x20tdx\x20work\x20new\x20<title>','Moved:','todo','Document\x20not\x20found:\x20','has','github','getTasksByStatus','Workspace:\x20','log','length','body','map','1019800ueVPiV','path','Linked\x20to\x20GitHub:\x20','review','dim','low','\x20[[','tags','values','Created:','filePath'];a54_0x5993=function(){return _0x16fc4f;};return a54_0x5993();}import{WorkspaceSDK,resolveWorkspacePath,normalizeTags}from'../sdk/workspace/index.js';import{STATUS_PHASES,ALL_STATUSES}from'../sdk/types/workspace.js';const VALID_KINDS=new Set(['item',a54_0x1689d2(0x13d),a54_0x1689d2(0x131),a54_0x1689d2(0x110),a54_0x1689d2(0x11c),a54_0x1689d2(0x133),'template']),VALID_PRIORITIES=new Set([a54_0x1689d2(0x118),'high',a54_0x1689d2(0x12e),a54_0x1689d2(0x16d)]),VALID_STATUSES=new Set(ALL_STATUSES);function getSDK(){const _0x3c9f08=a54_0x1689d2,_0x11b0ba=resolveWorkspacePath();return!_0x11b0ba&&(console[_0x3c9f08(0x132)](chalk[_0x3c9f08(0x11d)]('No\x20workspace\x20found.')+_0x3c9f08(0x122)+chalk[_0x3c9f08(0x144)](_0x3c9f08(0x14c))+'\x20to\x20create\x20one,\x20or\x20navigate\x20to\x20a\x20directory\x20containing\x20tdx.json.'),process['exit'](0x1)),new WorkspaceSDK(_0x11b0ba);}function priorityDot(_0x346428){const _0x51426e=a54_0x1689d2;switch(_0x346428){case _0x51426e(0x118):return chalk[_0x51426e(0x11d)]('●');case _0x51426e(0x130):return chalk[_0x51426e(0x150)]('●');case'medium':return chalk[_0x51426e(0x113)]('●');case _0x51426e(0x16d):return chalk['gray']('●');default:return chalk['blue']('●');}}function statusColor(_0x68f334){const _0x101e9e=a54_0x1689d2;switch(_0x68f334){case _0x101e9e(0x12c):return chalk[_0x101e9e(0x128)](_0x68f334);case _0x101e9e(0x11b):return chalk[_0x101e9e(0x124)](_0x68f334);case _0x101e9e(0x14f):return chalk[_0x101e9e(0x144)](_0x68f334);case _0x101e9e(0x16b):return chalk[_0x101e9e(0x138)](_0x68f334);case'planning':case _0x101e9e(0x129):return chalk[_0x101e9e(0x150)](_0x68f334);case _0x101e9e(0x15e):return chalk[_0x101e9e(0x126)](_0x68f334);case _0x101e9e(0x151):return chalk[_0x101e9e(0x16c)](_0x68f334);default:return _0x68f334;}}export async function workSummaryAction(){const _0x5d4ac7=a54_0x1689d2,_0x51e7a6=getSDK(),_0x26e2f1=_0x51e7a6[_0x5d4ac7(0x143)]();console[_0x5d4ac7(0x164)](chalk[_0x5d4ac7(0x121)](_0x5d4ac7(0x163)+_0x26e2f1[_0x5d4ac7(0x12d)])),console['log'](chalk['dim'](_0x26e2f1[_0x5d4ac7(0x169)])),console[_0x5d4ac7(0x164)]();const _0x540647=Object[_0x5d4ac7(0x170)](_0x26e2f1['taskCounts'])[_0x5d4ac7(0x10c)]((_0x4591b1,_0xa99927)=>_0x4591b1+_0xa99927,0x0);if(_0x540647===0x0)console[_0x5d4ac7(0x164)](chalk['dim'](_0x5d4ac7(0x15c)));else{console['log'](chalk[_0x5d4ac7(0x121)](_0x5d4ac7(0x14d)));for(const [_0x1e04f5,_0xa1c6dc]of Object['entries'](_0x26e2f1[_0x5d4ac7(0x149)])){_0xa1c6dc>0x0&&console[_0x5d4ac7(0x164)]('\x20\x20'+statusColor(_0x1e04f5)+':\x20'+_0xa1c6dc);}console['log']();}if(_0x26e2f1[_0x5d4ac7(0x10e)][_0x5d4ac7(0x165)]>0x0){console[_0x5d4ac7(0x164)](chalk[_0x5d4ac7(0x121)](_0x5d4ac7(0x13b)));for(const _0x51946e of _0x26e2f1[_0x5d4ac7(0x10e)]){const _0x7670c2=progressBar(_0x51946e['progress']);console[_0x5d4ac7(0x164)]('\x20\x20'+_0x51946e['title']+'\x20'+_0x7670c2+'\x20'+_0x51946e[_0x5d4ac7(0x11f)]+'%');}}}function progressBar(_0x3bed36){const _0x54c722=a54_0x1689d2,_0xe915eb=0x14,_0x37b968=Math[_0x54c722(0x156)](_0x3bed36/0x64*_0xe915eb),_0x4d8f4c=_0xe915eb-_0x37b968;return chalk[_0x54c722(0x128)]('█'[_0x54c722(0x120)](_0x37b968))+chalk['dim']('░'[_0x54c722(0x120)](_0x4d8f4c));}export async function workInitAction(_0x5ba512,_0x34cbbb){const _0x98f265=a54_0x1689d2,_0x5b268e=_0x5ba512||a54_0x2f067b['basename'](process['cwd']());if(_0x34cbbb[_0x98f265(0x161)]){const _0x162e84=WorkspaceSDK['initAt'](_0x5b268e,{'github':_0x34cbbb[_0x98f265(0x161)]});console[_0x98f265(0x164)](chalk[_0x98f265(0x128)]('Workspace\x20initialized:')+'\x20'+_0x162e84['workspacePath']),console[_0x98f265(0x164)](chalk[_0x98f265(0x16c)](_0x98f265(0x16a)+_0x34cbbb['github']));}else{if(_0x5ba512){const _0x13fe53=WorkspaceSDK[_0x98f265(0x173)](_0x5ba512);console[_0x98f265(0x164)](chalk['green']('Workspace\x20initialized:')+'\x20'+_0x13fe53[_0x98f265(0x11a)]);}else{const _0x35c9e7=new WorkspaceSDK(process[_0x98f265(0x157)]());_0x35c9e7[_0x98f265(0x14a)](_0x5b268e),console['log'](chalk[_0x98f265(0x128)]('Workspace\x20initialized\x20in\x20current\x20directory'));}}}export async function workNewAction(_0x25a0a8,_0x5d3d33){const _0x3b3807=a54_0x1689d2,_0x19dcf3=getSDK(),_0x5a9560=_0x5d3d33['kind']||'item';!VALID_KINDS[_0x3b3807(0x160)](_0x5a9560)&&(console[_0x3b3807(0x132)](chalk[_0x3b3807(0x11d)](_0x3b3807(0x139)+_0x5a9560+_0x3b3807(0x115)+[...VALID_KINDS]['join'](',\x20'))),process[_0x3b3807(0x15b)](0x1));_0x5d3d33['priority']&&!VALID_PRIORITIES['has'](_0x5d3d33[_0x3b3807(0x155)])&&(console[_0x3b3807(0x132)](chalk['red'](_0x3b3807(0x13f)+_0x5d3d33[_0x3b3807(0x155)]+_0x3b3807(0x115)+[...VALID_PRIORITIES][_0x3b3807(0x119)](',\x20'))),process[_0x3b3807(0x15b)](0x1));_0x5d3d33['status']&&!VALID_STATUSES['has'](_0x5d3d33[_0x3b3807(0x154)])&&(console['error'](chalk[_0x3b3807(0x11d)](_0x3b3807(0x12a)+_0x5d3d33[_0x3b3807(0x154)]+'.\x20Valid:\x20'+[...VALID_STATUSES]['join'](',\x20'))),process[_0x3b3807(0x15b)](0x1));const _0x3350d1=_0x5d3d33[_0x3b3807(0x16f)]?_0x5d3d33[_0x3b3807(0x16f)][_0x3b3807(0x177)](',')[_0x3b3807(0x167)](_0x43f030=>_0x43f030['trim']()):undefined,_0x464c22=_0x19dcf3['createDocument']({'title':_0x25a0a8,'kind':_0x5a9560,'tags':_0x3350d1,'priority':_0x5d3d33[_0x3b3807(0x155)],'body':_0x5d3d33[_0x3b3807(0x166)],'template':_0x5d3d33['template'],'status':_0x5d3d33[_0x3b3807(0x154)],'assignee':_0x5d3d33[_0x3b3807(0x153)]});console[_0x3b3807(0x164)](chalk[_0x3b3807(0x128)](_0x3b3807(0x171))+'\x20'+_0x464c22[_0x3b3807(0x145)]),console[_0x3b3807(0x164)](chalk[_0x3b3807(0x16c)](_0x464c22['filePath']));}function a54_0x32ec(_0x48c3c9,_0x535d50){_0x48c3c9=_0x48c3c9-0x10c;const _0x59930b=a54_0x5993();let _0x32ec45=_0x59930b[_0x48c3c9];return _0x32ec45;}export async function workMoveAction(_0x24bf65,_0x26524a){const _0x4b7b96=a54_0x1689d2;!VALID_STATUSES['has'](_0x26524a)&&(console['error'](chalk[_0x4b7b96(0x11d)](_0x4b7b96(0x12a)+_0x26524a+_0x4b7b96(0x115)+[...VALID_STATUSES][_0x4b7b96(0x119)](',\x20'))),process[_0x4b7b96(0x15b)](0x1));const _0x1fea40=getSDK(),_0x4df60f=_0x1fea40[_0x4b7b96(0x116)](_0x24bf65,_0x26524a);!_0x4df60f&&(console['error'](chalk[_0x4b7b96(0x11d)](_0x4b7b96(0x15f)+_0x24bf65)),process['exit'](0x1));const _0x132e13=_0x4df60f['frontmatter'][_0x4b7b96(0x12b)]||_0x4df60f['fileName'];console[_0x4b7b96(0x164)](chalk[_0x4b7b96(0x128)](_0x4b7b96(0x15d))+('\x20'+_0x132e13+_0x4b7b96(0x176)+statusColor(_0x26524a)));}export async function workBoardAction(){const _0x41085f=a54_0x1689d2,_0x4609e0=getSDK(),_0x21c94a=_0x4609e0[_0x41085f(0x162)]();for(const [_0x59e0f9,_0x2993f9]of Object[_0x41085f(0x15a)](STATUS_PHASES)){const _0x5f3d4c=_0x2993f9[_0x41085f(0x14e)](_0x341873=>_0x21c94a[_0x341873]||[]);console[_0x41085f(0x164)](chalk[_0x41085f(0x121)]['underline'](_0x59e0f9)+chalk[_0x41085f(0x16c)]('\x20('+_0x5f3d4c['length']+')'));if(_0x5f3d4c[_0x41085f(0x165)]===0x0)console[_0x41085f(0x164)](chalk[_0x41085f(0x16c)](_0x41085f(0x114)));else for(const _0x375ae2 of _0x5f3d4c){const _0xc4b14b=_0x375ae2[_0x41085f(0x12f)],_0x49f89b=priorityDot(_0xc4b14b['priority']),_0x4f3264=_0xc4b14b[_0x41085f(0x12b)]||_0x375ae2[_0x41085f(0x145)],_0x4570b4=normalizeTags(_0xc4b14b[_0x41085f(0x16f)]),_0xfc8ec=_0x4570b4['length']?chalk['dim']('\x20['+_0x4570b4['join'](',\x20')+']'):'',_0x56f498=chalk['dim']('('+_0xc4b14b['status']+')');console[_0x41085f(0x164)]('\x20\x20'+_0x49f89b+'\x20'+_0x4f3264+'\x20'+_0x56f498+_0xfc8ec);}console[_0x41085f(0x164)]();}}export async function workShowAction(_0x476d1f){const _0x3d261e=a54_0x1689d2,_0xac4a36=getSDK(),_0x35a93e=_0xac4a36['readDocument'](_0x476d1f);!_0x35a93e&&(console['error'](chalk[_0x3d261e(0x11d)](_0x3d261e(0x15f)+_0x476d1f)),process[_0x3d261e(0x15b)](0x1));console[_0x3d261e(0x164)](chalk[_0x3d261e(0x121)](_0x35a93e[_0x3d261e(0x12f)]['title']||_0x35a93e[_0x3d261e(0x145)])),console[_0x3d261e(0x164)](chalk[_0x3d261e(0x16c)](_0x35a93e['filePath'])),console['log']();const _0x1e5276=_0x35a93e[_0x3d261e(0x12f)];for(const [_0x19af71,_0x8360e0]of Object[_0x3d261e(0x15a)](_0x1e5276)){if(_0x19af71===_0x3d261e(0x12b))continue;if(_0x8360e0===undefined||_0x8360e0===null)continue;const _0x55709e=Array['isArray'](_0x8360e0)?_0x8360e0[_0x3d261e(0x119)](',\x20'):String(_0x8360e0);console[_0x3d261e(0x164)]('\x20\x20'+chalk[_0x3d261e(0x144)](_0x19af71)+':\x20'+_0x55709e);}console[_0x3d261e(0x164)]();_0x35a93e[_0x3d261e(0x166)]['trim']()&&(console[_0x3d261e(0x164)](_0x35a93e[_0x3d261e(0x166)][_0x3d261e(0x158)]()),console[_0x3d261e(0x164)]());const _0x4ec461=_0xac4a36[_0x3d261e(0x10d)](_0x35a93e[_0x3d261e(0x166)]);if(_0x4ec461[_0x3d261e(0x165)]>0x0){console['log'](chalk[_0x3d261e(0x121)](_0x3d261e(0x13c)));for(const _0x30c172 of _0x4ec461){const _0xb63c40=_0x30c172['resolvedPath']?chalk[_0x3d261e(0x128)]('✓'):chalk[_0x3d261e(0x11d)]('✗'),_0x31ad35=_0x30c172[_0x3d261e(0x175)]||_0x30c172['slug'];console[_0x3d261e(0x164)]('\x20\x20'+_0xb63c40+_0x3d261e(0x16e)+_0x31ad35+']]');}console['log']();}const _0x47906b=_0xac4a36[_0x3d261e(0x142)](_0x35a93e[_0x3d261e(0x145)]);if(_0x47906b[_0x3d261e(0x165)]>0x0){console['log'](chalk[_0x3d261e(0x121)]('Backlinks'));for(const _0x151d0e of _0x47906b){console['log'](_0x3d261e(0x140)+_0x151d0e[_0x3d261e(0x12b)]+'\x20'+chalk[_0x3d261e(0x16c)]('('+_0x151d0e[_0x3d261e(0x112)]+')'));}}}export async function workLinksAction(_0x4b642d){const _0x4516f0=a54_0x1689d2,_0x5855a3=getSDK(),_0x203ebe=_0x5855a3[_0x4516f0(0x111)](_0x4b642d);!_0x203ebe&&(console[_0x4516f0(0x132)](chalk[_0x4516f0(0x11d)](_0x4516f0(0x15f)+_0x4b642d)),process[_0x4516f0(0x15b)](0x1));const _0x4cfaec=_0x203ebe[_0x4516f0(0x12f)][_0x4516f0(0x12b)]||_0x203ebe[_0x4516f0(0x145)];console[_0x4516f0(0x164)](chalk['bold'](_0x4516f0(0x141)+_0x4cfaec)),console['log']();const _0x19fbe6=_0x5855a3[_0x4516f0(0x10d)](_0x203ebe['body']);if(_0x19fbe6[_0x4516f0(0x165)]>0x0){console['log'](chalk[_0x4516f0(0x121)](_0x4516f0(0x14b)));for(const _0x503ecc of _0x19fbe6){const _0x517732=_0x503ecc[_0x4516f0(0x159)]?chalk['green']('✓'):chalk[_0x4516f0(0x11d)]('✗'),_0x559251=_0x503ecc[_0x4516f0(0x175)]||_0x503ecc[_0x4516f0(0x174)],_0x1dcd88=_0x503ecc[_0x4516f0(0x147)]?chalk[_0x4516f0(0x16c)]('\x20('+_0x503ecc[_0x4516f0(0x147)]+')'):'';console['log']('\x20\x20'+_0x517732+_0x4516f0(0x16e)+_0x559251+']]'+_0x1dcd88);}}else console[_0x4516f0(0x164)](chalk[_0x4516f0(0x16c)]('No\x20outgoing\x20wiki-links'));console[_0x4516f0(0x164)]();const _0x3becf8=_0x5855a3[_0x4516f0(0x142)](_0x203ebe[_0x4516f0(0x145)]);if(_0x3becf8[_0x4516f0(0x165)]>0x0){console[_0x4516f0(0x164)](chalk[_0x4516f0(0x121)](_0x4516f0(0x127)));for(const _0x1cc805 of _0x3becf8){console[_0x4516f0(0x164)](_0x4516f0(0x140)+_0x1cc805[_0x4516f0(0x12b)]+'\x20'+chalk[_0x4516f0(0x16c)]('('+_0x1cc805[_0x4516f0(0x112)]+')'));}}else console[_0x4516f0(0x164)](chalk['dim'](_0x4516f0(0x135)));}export async function workOpenAction(_0x348bb6){const _0x1f07a2=a54_0x1689d2,_0x777a0f=getSDK(),_0x3c5c8a=_0x777a0f[_0x1f07a2(0x111)](_0x348bb6);!_0x3c5c8a&&(console[_0x1f07a2(0x132)](chalk[_0x1f07a2(0x11d)](_0x1f07a2(0x15f)+_0x348bb6)),process['exit'](0x1));const _0x5424af=process.env.EDITOR||'vi';try{execFileSync(_0x5424af,[_0x3c5c8a[_0x1f07a2(0x172)]],{'stdio':_0x1f07a2(0x13a)});}catch{console['error'](chalk[_0x1f07a2(0x11d)](_0x1f07a2(0x136)+_0x5424af)),process[_0x1f07a2(0x15b)](0x1);}}
|
|
1
|
+
function a54_0xf345(_0xfb86b4,_0x22c185){_0xfb86b4=_0xfb86b4-0x1c2;const _0x274ada=a54_0x274a();let _0xf34553=_0x274ada[_0xfb86b4];return _0xf34553;}const a54_0x35b66b=a54_0xf345;(function(_0x3d70b1,_0x38d464){const _0x4bd287=a54_0xf345,_0x379378=_0x3d70b1();while(!![]){try{const _0x3e93a6=parseInt(_0x4bd287(0x206))/0x1*(parseInt(_0x4bd287(0x1de))/0x2)+-parseInt(_0x4bd287(0x223))/0x3*(-parseInt(_0x4bd287(0x205))/0x4)+-parseInt(_0x4bd287(0x21c))/0x5+parseInt(_0x4bd287(0x1e2))/0x6+-parseInt(_0x4bd287(0x1e6))/0x7*(parseInt(_0x4bd287(0x22b))/0x8)+-parseInt(_0x4bd287(0x210))/0x9+parseInt(_0x4bd287(0x1ca))/0xa;if(_0x3e93a6===_0x38d464)break;else _0x379378['push'](_0x379378['shift']());}catch(_0x4570ed){_0x379378['push'](_0x379378['shift']());}}}(a54_0x274a,0x787e4));import{getChalk}from'../utils/colors.js';const chalk=getChalk();import{execFileSync}from'node:child_process';import a54_0x4ba3bc from'node:path';import{WorkspaceSDK,resolveWorkspacePath,normalizeTags}from'../sdk/workspace/index.js';import{STATUS_PHASES,ALL_STATUSES}from'../sdk/types/workspace.js';function a54_0x274a(){const _0x5e0378=['underline','moveTask','cwd','review','split','Links\x20for:\x20','56792BGJLmN','Invalid\x20status:\x20','map','length','Goals','No\x20incoming\x20backlinks','assignee','\x20Run\x20','values','fileName','3365840qDwBZB','\x20to\x20create\x20one,\x20or\x20navigate\x20to\x20a\x20directory\x20containing\x20tdx.json.','\x20\x20(empty)','note','repeat','createDocument','frontmatter','bold','github','getSummary','init','\x20\x20←\x20','workflow','taskCounts','gray','cyan','No\x20workspace\x20found.','filePath','log','void','214ruVLAc','\x20[[','low','.\x20Valid:\x20','3216696UHclGD','No\x20outgoing\x20wiki-links','name','displayText','973UxNUiX','Document\x20not\x20found:\x20','Workspace\x20initialized:','Linked\x20to\x20GitHub:\x20','trim','medium','tags','slug','getBacklinks','Moved:','todo','dim','goal','critical','Tasks','red','entries','white','backlog','initAt','Backlinks','guide','readDocument','resolveWikiLinks','blue','progress','join','Created:','Wiki-links','getTasksByStatus','green','4FjCCxU','7342TKrKHE','Outgoing','Invalid\x20priority:\x20','resolvedKind','error','magenta','goals','Workspace:\x20','No\x20tasks\x20yet.\x20Create\x20one\x20with:\x20tdx\x20work\x20new\x20<title>','reduce','2959974NAwdyS','has','kind','exit','path','inherit','\x20→\x20','workspacePath','isArray','title','Failed\x20to\x20open\x20editor:\x20','template','877330SDekuj','yellow','body','resolvedPath','high','status','item','979077PSKjHa','priority'];a54_0x274a=function(){return _0x5e0378;};return a54_0x274a();}const VALID_KINDS=new Set([a54_0x35b66b(0x222),a54_0x35b66b(0x1f2),a54_0x35b66b(0x1fb),a54_0x35b66b(0x1cd),'reference',a54_0x35b66b(0x1d6),a54_0x35b66b(0x21b)]),VALID_PRIORITIES=new Set([a54_0x35b66b(0x1f3),a54_0x35b66b(0x220),a54_0x35b66b(0x1eb),'low']),VALID_STATUSES=new Set(ALL_STATUSES);function getSDK(){const _0x2b9663=a54_0x35b66b,_0x404e46=resolveWorkspacePath();return!_0x404e46&&(console[_0x2b9663(0x20a)](chalk[_0x2b9663(0x1f5)](_0x2b9663(0x1da))+_0x2b9663(0x1c7)+chalk[_0x2b9663(0x1d9)]('tdx\x20work\x20init\x20<name>')+_0x2b9663(0x1cb)),process[_0x2b9663(0x213)](0x1)),new WorkspaceSDK(_0x404e46);}function priorityDot(_0xb2e240){const _0x4d55c2=a54_0x35b66b;switch(_0xb2e240){case _0x4d55c2(0x1f3):return chalk[_0x4d55c2(0x1f5)]('●');case _0x4d55c2(0x220):return chalk[_0x4d55c2(0x21d)]('●');case _0x4d55c2(0x1eb):return chalk[_0x4d55c2(0x1fe)]('●');case _0x4d55c2(0x1e0):return chalk[_0x4d55c2(0x1d8)]('●');default:return chalk[_0x4d55c2(0x1fe)]('●');}}function statusColor(_0x3a4b54){const _0x4a15c0=a54_0x35b66b;switch(_0x3a4b54){case'done':return chalk[_0x4a15c0(0x204)](_0x3a4b54);case _0x4a15c0(0x1dd):return chalk['gray'](_0x3a4b54);case'in_progress':return chalk[_0x4a15c0(0x1d9)](_0x3a4b54);case _0x4a15c0(0x228):return chalk[_0x4a15c0(0x20b)](_0x3a4b54);case'planning':case'design_review':return chalk[_0x4a15c0(0x21d)](_0x3a4b54);case _0x4a15c0(0x1f0):return chalk[_0x4a15c0(0x1f7)](_0x3a4b54);case _0x4a15c0(0x1f8):return chalk[_0x4a15c0(0x1f1)](_0x3a4b54);default:return _0x3a4b54;}}export async function workSummaryAction(){const _0x44a399=a54_0x35b66b,_0x5998b0=getSDK(),_0x184c2a=_0x5998b0[_0x44a399(0x1d3)]();console[_0x44a399(0x1dc)](chalk['bold'](_0x44a399(0x20d)+_0x184c2a[_0x44a399(0x1e4)])),console[_0x44a399(0x1dc)](chalk[_0x44a399(0x1f1)](_0x184c2a[_0x44a399(0x214)])),console[_0x44a399(0x1dc)]();const _0x567f25=Object[_0x44a399(0x1c8)](_0x184c2a[_0x44a399(0x1d7)])[_0x44a399(0x20f)]((_0x373b1e,_0x2fc7e5)=>_0x373b1e+_0x2fc7e5,0x0);if(_0x567f25===0x0)console[_0x44a399(0x1dc)](chalk['dim'](_0x44a399(0x20e)));else{console[_0x44a399(0x1dc)](chalk['bold'](_0x44a399(0x1f4)));for(const [_0x35f5cc,_0x2da8d8]of Object[_0x44a399(0x1f6)](_0x184c2a[_0x44a399(0x1d7)])){_0x2da8d8>0x0&&console[_0x44a399(0x1dc)]('\x20\x20'+statusColor(_0x35f5cc)+':\x20'+_0x2da8d8);}console['log']();}if(_0x184c2a[_0x44a399(0x20c)][_0x44a399(0x1c3)]>0x0){console[_0x44a399(0x1dc)](chalk[_0x44a399(0x1d1)](_0x44a399(0x1c4)));for(const _0x33246d of _0x184c2a[_0x44a399(0x20c)]){const _0x138d0f=progressBar(_0x33246d[_0x44a399(0x1ff)]);console[_0x44a399(0x1dc)]('\x20\x20'+_0x33246d[_0x44a399(0x219)]+'\x20'+_0x138d0f+'\x20'+_0x33246d[_0x44a399(0x1ff)]+'%');}}}function progressBar(_0x4cdad5){const _0x4d90a1=a54_0x35b66b,_0x3b1f79=0x14,_0x1438c5=Math['round'](_0x4cdad5/0x64*_0x3b1f79),_0x30404e=_0x3b1f79-_0x1438c5;return chalk[_0x4d90a1(0x204)]('█'[_0x4d90a1(0x1ce)](_0x1438c5))+chalk[_0x4d90a1(0x1f1)]('░'['repeat'](_0x30404e));}export async function workInitAction(_0x2d8a06,_0x26f6d3){const _0x20bbf9=a54_0x35b66b,_0x33a314=_0x2d8a06||a54_0x4ba3bc['basename'](process[_0x20bbf9(0x227)]());if(_0x26f6d3[_0x20bbf9(0x1d2)]){const _0x243f4c=WorkspaceSDK['initAt'](_0x33a314,{'github':_0x26f6d3[_0x20bbf9(0x1d2)]});console[_0x20bbf9(0x1dc)](chalk[_0x20bbf9(0x204)](_0x20bbf9(0x1e8))+'\x20'+_0x243f4c[_0x20bbf9(0x217)]),console[_0x20bbf9(0x1dc)](chalk[_0x20bbf9(0x1f1)](_0x20bbf9(0x1e9)+_0x26f6d3[_0x20bbf9(0x1d2)]));}else{if(_0x2d8a06){const _0x3594bc=WorkspaceSDK[_0x20bbf9(0x1f9)](_0x2d8a06);console[_0x20bbf9(0x1dc)](chalk[_0x20bbf9(0x204)](_0x20bbf9(0x1e8))+'\x20'+_0x3594bc[_0x20bbf9(0x217)]);}else{const _0x37c191=new WorkspaceSDK(process[_0x20bbf9(0x227)]());_0x37c191[_0x20bbf9(0x1d4)](_0x33a314),console['log'](chalk[_0x20bbf9(0x204)]('Workspace\x20initialized\x20in\x20current\x20directory'));}}}export async function workNewAction(_0x5cdc13,_0x276a6c){const _0x203760=a54_0x35b66b,_0x4e1367=getSDK(),_0x2bce7e=_0x276a6c[_0x203760(0x212)]||_0x203760(0x222);!VALID_KINDS[_0x203760(0x211)](_0x2bce7e)&&(console[_0x203760(0x20a)](chalk[_0x203760(0x1f5)]('Invalid\x20kind:\x20'+_0x2bce7e+_0x203760(0x1e1)+[...VALID_KINDS][_0x203760(0x200)](',\x20'))),process['exit'](0x1));_0x276a6c[_0x203760(0x224)]&&!VALID_PRIORITIES['has'](_0x276a6c['priority'])&&(console[_0x203760(0x20a)](chalk[_0x203760(0x1f5)](_0x203760(0x208)+_0x276a6c[_0x203760(0x224)]+_0x203760(0x1e1)+[...VALID_PRIORITIES][_0x203760(0x200)](',\x20'))),process[_0x203760(0x213)](0x1));_0x276a6c[_0x203760(0x221)]&&!VALID_STATUSES['has'](_0x276a6c[_0x203760(0x221)])&&(console[_0x203760(0x20a)](chalk[_0x203760(0x1f5)]('Invalid\x20status:\x20'+_0x276a6c[_0x203760(0x221)]+_0x203760(0x1e1)+[...VALID_STATUSES][_0x203760(0x200)](',\x20'))),process[_0x203760(0x213)](0x1));const _0x8cf949=_0x276a6c[_0x203760(0x1ec)]?_0x276a6c[_0x203760(0x1ec)][_0x203760(0x229)](',')[_0x203760(0x1c2)](_0x1904bb=>_0x1904bb[_0x203760(0x1ea)]()):undefined,_0x3a2ccb=_0x4e1367[_0x203760(0x1cf)]({'title':_0x5cdc13,'kind':_0x2bce7e,'tags':_0x8cf949,'priority':_0x276a6c[_0x203760(0x224)],'body':_0x276a6c[_0x203760(0x21e)],'template':_0x276a6c[_0x203760(0x21b)],'status':_0x276a6c['status'],'assignee':_0x276a6c[_0x203760(0x1c6)]});console['log'](chalk[_0x203760(0x204)](_0x203760(0x201))+'\x20'+_0x3a2ccb['fileName']),console['log'](chalk[_0x203760(0x1f1)](_0x3a2ccb[_0x203760(0x1db)]));}export async function workMoveAction(_0x8aec73,_0x4105d6){const _0x33f540=a54_0x35b66b;!VALID_STATUSES[_0x33f540(0x211)](_0x4105d6)&&(console[_0x33f540(0x20a)](chalk['red'](_0x33f540(0x22c)+_0x4105d6+_0x33f540(0x1e1)+[...VALID_STATUSES]['join'](',\x20'))),process[_0x33f540(0x213)](0x1));const _0x23dd82=getSDK(),_0x562327=_0x23dd82[_0x33f540(0x226)](_0x8aec73,_0x4105d6);!_0x562327&&(console[_0x33f540(0x20a)](chalk[_0x33f540(0x1f5)](_0x33f540(0x1e7)+_0x8aec73)),process[_0x33f540(0x213)](0x1));const _0x273cae=_0x562327[_0x33f540(0x1d0)][_0x33f540(0x219)]||_0x562327['fileName'];console[_0x33f540(0x1dc)](chalk['green'](_0x33f540(0x1ef))+('\x20'+_0x273cae+_0x33f540(0x216)+statusColor(_0x4105d6)));}export async function workBoardAction(){const _0x4acc24=a54_0x35b66b,_0x4d0716=getSDK(),_0x10fe52=_0x4d0716[_0x4acc24(0x203)]();for(const [_0x31f7c4,_0xd004ca]of Object[_0x4acc24(0x1f6)](STATUS_PHASES)){const _0x2a437e=_0xd004ca['flatMap'](_0x1e6dac=>_0x10fe52[_0x1e6dac]||[]);console[_0x4acc24(0x1dc)](chalk[_0x4acc24(0x1d1)][_0x4acc24(0x225)](_0x31f7c4)+chalk['dim']('\x20('+_0x2a437e[_0x4acc24(0x1c3)]+')'));if(_0x2a437e[_0x4acc24(0x1c3)]===0x0)console[_0x4acc24(0x1dc)](chalk[_0x4acc24(0x1f1)](_0x4acc24(0x1cc)));else for(const _0x19cc5d of _0x2a437e){const _0x315493=_0x19cc5d[_0x4acc24(0x1d0)],_0x254ab7=priorityDot(_0x315493[_0x4acc24(0x224)]),_0x474a03=_0x315493[_0x4acc24(0x219)]||_0x19cc5d['fileName'],_0x14542d=normalizeTags(_0x315493[_0x4acc24(0x1ec)]),_0x5976d6=_0x14542d[_0x4acc24(0x1c3)]?chalk[_0x4acc24(0x1f1)]('\x20['+_0x14542d[_0x4acc24(0x200)](',\x20')+']'):'',_0x35e8fa=chalk[_0x4acc24(0x1f1)]('('+_0x315493[_0x4acc24(0x221)]+')');console[_0x4acc24(0x1dc)]('\x20\x20'+_0x254ab7+'\x20'+_0x474a03+'\x20'+_0x35e8fa+_0x5976d6);}console[_0x4acc24(0x1dc)]();}}export async function workShowAction(_0x2a6a55){const _0x5188ac=a54_0x35b66b,_0xc8fd93=getSDK(),_0x47d89a=_0xc8fd93['readDocument'](_0x2a6a55);!_0x47d89a&&(console[_0x5188ac(0x20a)](chalk[_0x5188ac(0x1f5)](_0x5188ac(0x1e7)+_0x2a6a55)),process[_0x5188ac(0x213)](0x1));console['log'](chalk['bold'](_0x47d89a[_0x5188ac(0x1d0)][_0x5188ac(0x219)]||_0x47d89a['fileName'])),console['log'](chalk[_0x5188ac(0x1f1)](_0x47d89a[_0x5188ac(0x1db)])),console['log']();const _0x607443=_0x47d89a[_0x5188ac(0x1d0)];for(const [_0x2a2b87,_0x477feb]of Object[_0x5188ac(0x1f6)](_0x607443)){if(_0x2a2b87===_0x5188ac(0x219))continue;if(_0x477feb===undefined||_0x477feb===null)continue;const _0x50b88c=Array[_0x5188ac(0x218)](_0x477feb)?_0x477feb[_0x5188ac(0x200)](',\x20'):String(_0x477feb);console[_0x5188ac(0x1dc)]('\x20\x20'+chalk['cyan'](_0x2a2b87)+':\x20'+_0x50b88c);}console[_0x5188ac(0x1dc)]();_0x47d89a[_0x5188ac(0x21e)][_0x5188ac(0x1ea)]()&&(console[_0x5188ac(0x1dc)](_0x47d89a[_0x5188ac(0x21e)][_0x5188ac(0x1ea)]()),console[_0x5188ac(0x1dc)]());const _0xcf1867=_0xc8fd93[_0x5188ac(0x1fd)](_0x47d89a[_0x5188ac(0x21e)]);if(_0xcf1867['length']>0x0){console['log'](chalk['bold'](_0x5188ac(0x202)));for(const _0x26604d of _0xcf1867){const _0x482152=_0x26604d[_0x5188ac(0x21f)]?chalk['green']('✓'):chalk['red']('✗'),_0xccb6ef=_0x26604d[_0x5188ac(0x1e5)]||_0x26604d[_0x5188ac(0x1ed)];console[_0x5188ac(0x1dc)]('\x20\x20'+_0x482152+_0x5188ac(0x1df)+_0xccb6ef+']]');}console['log']();}const _0x57ee2c=_0xc8fd93['getBacklinks'](_0x47d89a[_0x5188ac(0x1c9)]);if(_0x57ee2c[_0x5188ac(0x1c3)]>0x0){console['log'](chalk['bold'](_0x5188ac(0x1fa)));for(const _0x4abe65 of _0x57ee2c){console[_0x5188ac(0x1dc)](_0x5188ac(0x1d5)+_0x4abe65[_0x5188ac(0x219)]+'\x20'+chalk[_0x5188ac(0x1f1)]('('+_0x4abe65[_0x5188ac(0x212)]+')'));}}}export async function workLinksAction(_0x2ad97d){const _0x5744a9=a54_0x35b66b,_0xb3c7f6=getSDK(),_0x29248d=_0xb3c7f6[_0x5744a9(0x1fc)](_0x2ad97d);!_0x29248d&&(console[_0x5744a9(0x20a)](chalk[_0x5744a9(0x1f5)](_0x5744a9(0x1e7)+_0x2ad97d)),process[_0x5744a9(0x213)](0x1));const _0x439e62=_0x29248d[_0x5744a9(0x1d0)][_0x5744a9(0x219)]||_0x29248d[_0x5744a9(0x1c9)];console[_0x5744a9(0x1dc)](chalk[_0x5744a9(0x1d1)](_0x5744a9(0x22a)+_0x439e62)),console[_0x5744a9(0x1dc)]();const _0x37784e=_0xb3c7f6['resolveWikiLinks'](_0x29248d[_0x5744a9(0x21e)]);if(_0x37784e[_0x5744a9(0x1c3)]>0x0){console[_0x5744a9(0x1dc)](chalk[_0x5744a9(0x1d1)](_0x5744a9(0x207)));for(const _0x1f45b7 of _0x37784e){const _0x4f3c4a=_0x1f45b7[_0x5744a9(0x21f)]?chalk[_0x5744a9(0x204)]('✓'):chalk[_0x5744a9(0x1f5)]('✗'),_0x292c2a=_0x1f45b7['displayText']||_0x1f45b7['slug'],_0x1efacf=_0x1f45b7[_0x5744a9(0x209)]?chalk[_0x5744a9(0x1f1)]('\x20('+_0x1f45b7[_0x5744a9(0x209)]+')'):'';console[_0x5744a9(0x1dc)]('\x20\x20'+_0x4f3c4a+'\x20[['+_0x292c2a+']]'+_0x1efacf);}}else console['log'](chalk[_0x5744a9(0x1f1)](_0x5744a9(0x1e3)));console['log']();const _0x4bd378=_0xb3c7f6[_0x5744a9(0x1ee)](_0x29248d['fileName']);if(_0x4bd378[_0x5744a9(0x1c3)]>0x0){console['log'](chalk[_0x5744a9(0x1d1)]('Incoming'));for(const _0x51f937 of _0x4bd378){console['log']('\x20\x20←\x20'+_0x51f937[_0x5744a9(0x219)]+'\x20'+chalk[_0x5744a9(0x1f1)]('('+_0x51f937['kind']+')'));}}else console[_0x5744a9(0x1dc)](chalk[_0x5744a9(0x1f1)](_0x5744a9(0x1c5)));}export async function workOpenAction(_0xd83538){const _0x124f6e=a54_0x35b66b,_0x22f424=getSDK(),_0x213d7c=_0x22f424[_0x124f6e(0x1fc)](_0xd83538);!_0x213d7c&&(console[_0x124f6e(0x20a)](chalk[_0x124f6e(0x1f5)](_0x124f6e(0x1e7)+_0xd83538)),process[_0x124f6e(0x213)](0x1));const _0x38138a=process.env.EDITOR||'vi';try{execFileSync(_0x38138a,[_0x213d7c[_0x124f6e(0x1db)]],{'stdio':_0x124f6e(0x215)});}catch{console[_0x124f6e(0x20a)](chalk[_0x124f6e(0x1f5)](_0x124f6e(0x21a)+_0x38138a)),process['exit'](0x1);}}
|