@treasuredata/tdx 2026.4.15 → 2026.4.16
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.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/tools/work-create-item.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/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x446af0=a48_0x5217;(function(_0x3cf210,_0x295508){const _0x257516=a48_0x5217,_0x21b5e2=_0x3cf210();while(!![]){try{const _0x47f17d=parseInt(_0x257516(0x125))/0x1+parseInt(_0x257516(0x121))/0x2+parseInt(_0x257516(0x11c))/0x3+-parseInt(_0x257516(0x127))/0x4*(-parseInt(_0x257516(0x111))/0x5)+-parseInt(_0x257516(0x12a))/0x6+parseInt(_0x257516(0x130))/0x7*(parseInt(_0x257516(0x135))/0x8)+-parseInt(_0x257516(0x12b))/0x9;if(_0x47f17d===_0x295508)break;else _0x21b5e2['push'](_0x21b5e2['shift']());}catch(_0x573297){_0x21b5e2['push'](_0x21b5e2['shift']());}}}(a48_0x5816,0x6d1c9));import{BaseCommand}from'./command.js';function a48_0x5816(){const _0x53e11c=['data','database','length','Or\x20use\x20--in\x20flag:','\x27\x20is\x20ambiguous.','table','307878ZlCsNG','database_name','limit','Note:\x20\x27','Listing\x20tables...','1530404aTkqlj','query','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','732628jsbvZI','.*\x22','16qFHSLV','✖\x20No\x20tables\x20found','name','3598122KFlTFO','14187573pzYbuI','✔\x20Found\x20','Error:\x20','cause','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','7WohAvE','message','error','validate','execute','1546856kxxXro','tables','description','Table\x20pattern:\x20','\x20table','includes','verbose','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Error:\x20Pattern\x20\x27','\x27\x20across\x20all\x20databases.','Database:\x20','listTables','1036490prnQwp','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','\x20\x20Cause:\x20','Database:\x20all'];a48_0x5816=function(){return _0x53e11c;};return a48_0x5816();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';function a48_0x5217(_0x4b9f5b,_0x537731){_0x4b9f5b=_0x4b9f5b-0x10a;const _0x581634=a48_0x5816();let _0x52172b=_0x581634[_0x4b9f5b];return _0x52172b;}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a48_0x446af0(0x129)]=a48_0x446af0(0x136);[a48_0x446af0(0x137)]='List\x20tables\x20in\x20a\x20database';async[a48_0x446af0(0x134)](_0x42f071){const _0x449a1d=a48_0x446af0,{options:_0x42e27a,args:_0x22afe5,tdx:_0x543543}=_0x42f071;let _0x38bc4b;if(_0x22afe5[_0x449a1d(0x118)]===0x0)_0x38bc4b={'database':undefined,'table':undefined,'original':''};else{if(_0x22afe5[_0x449a1d(0x118)]===0x1)try{_0x38bc4b=parseTableReference(_0x22afe5[0x0]);if(_0x38bc4b[_0x449a1d(0x11b)]&&!_0x38bc4b[_0x449a1d(0x117)]&&!_0x38bc4b[_0x449a1d(0x11b)][_0x449a1d(0x13a)]('*')&&!_0x38bc4b[_0x449a1d(0x11b)]['includes']('?'))return console['error'](_0x449a1d(0x10d)+_0x22afe5[0x0]+_0x449a1d(0x11a)),console[_0x449a1d(0x132)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x38bc4b[_0x449a1d(0x11b)]+'\x27?'),console[_0x449a1d(0x132)](_0x449a1d(0x123)+_0x38bc4b[_0x449a1d(0x11b)]+_0x449a1d(0x126)),console[_0x449a1d(0x132)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x38bc4b[_0x449a1d(0x11b)]),console[_0x449a1d(0x132)](_0x449a1d(0x12f)+_0x38bc4b[_0x449a1d(0x11b)]),console['error'](''),console['error'](_0x449a1d(0x11f)+_0x22afe5[0x0]+_0x449a1d(0x124)+_0x38bc4b[_0x449a1d(0x11b)]+_0x449a1d(0x10e)),0x1;}catch(_0x450d2e){return console[_0x449a1d(0x132)](_0x449a1d(0x12d)+_0x450d2e['message']),0x1;}else return console[_0x449a1d(0x132)](_0x449a1d(0x112)),console[_0x449a1d(0x132)]('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console[_0x449a1d(0x132)]('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console[_0x449a1d(0x132)](_0x449a1d(0x113)),console[_0x449a1d(0x132)]('\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases'),console[_0x449a1d(0x132)](_0x449a1d(0x119)),console['error'](_0x449a1d(0x10c)),0x1;}const _0x37a4e5=_0x42e27a[_0x449a1d(0x117)];!_0x38bc4b[_0x449a1d(0x117)]&&_0x37a4e5&&(_0x38bc4b[_0x449a1d(0x117)]=_0x37a4e5);try{const _0x46b29b=_0x581b09=>_0x581b09&&(_0x581b09[_0x449a1d(0x13a)]('*')||_0x581b09[_0x449a1d(0x13a)]('?')),_0x4b8b12=_0x46b29b(_0x38bc4b['database']);_0x42e27a[_0x449a1d(0x10a)]&&(console['error']('Site:\x20'+_0x42e27a['site']),_0x38bc4b['database']?_0x4b8b12?console[_0x449a1d(0x132)]('Database\x20pattern:\x20'+_0x38bc4b['database']):console[_0x449a1d(0x132)](_0x449a1d(0x10f)+_0x38bc4b['database']):console[_0x449a1d(0x132)](_0x449a1d(0x115)),_0x38bc4b[_0x449a1d(0x11b)]&&console['error'](_0x449a1d(0x138)+_0x38bc4b['table']));const _0x399de6=_0x38bc4b[_0x449a1d(0x117)]&&!_0x4b8b12?_0x38bc4b[_0x449a1d(0x117)]:undefined,_0x801100=_0x4b8b12?_0x38bc4b[_0x449a1d(0x117)]:undefined,_0xed6308=_0x38bc4b['table'],_0x1621fa=resolveLimit(_0x42e27a[_0x449a1d(0x11e)],DEFAULT_LISTING_LIMIT),_0x48fb1b=await withSpinner(_0x449a1d(0x120),()=>_0x543543[_0x449a1d(0x122)][_0x449a1d(0x110)](_0x399de6,_0xed6308,_0x801100,_0x1621fa),{'verbose':_0x42e27a[_0x449a1d(0x10a)]}),_0x123d2e=_0x48fb1b[_0x449a1d(0x116)];if(_0x123d2e[_0x449a1d(0x118)]===0x0&&_0x38bc4b[_0x449a1d(0x117)]&&!_0x4b8b12)return console[_0x449a1d(0x132)](_0x449a1d(0x128)),console[_0x449a1d(0x132)]('Database\x20\x27'+_0x38bc4b[_0x449a1d(0x117)]+_0x449a1d(0x10b)),0x1;console[_0x449a1d(0x132)](_0x449a1d(0x12c)+_0x123d2e[_0x449a1d(0x118)]+_0x449a1d(0x139)+(_0x123d2e[_0x449a1d(0x118)]!==0x1?'s':''));if(isStructuredFormat(_0x42e27a))await handleSDKOutput(_0x123d2e,{..._0x42e27a,'limit':_0x1621fa});else for(const _0x21e09e of _0x123d2e){const _0x4cc592=_0x21e09e[_0x449a1d(0x11d)]?_0x21e09e[_0x449a1d(0x11d)]+'.':'';console['log']('📋\x20'+_0x4cc592+_0x21e09e['table_name']);}return 0x0;}catch(_0x3c414c){if(_0x3c414c instanceof SDKError)return console[_0x449a1d(0x132)]('Error:\x20'+_0x3c414c[_0x449a1d(0x131)]),_0x3c414c[_0x449a1d(0x12e)]&&console['error'](_0x449a1d(0x114)+_0x3c414c[_0x449a1d(0x12e)]),0x1;throw _0x3c414c;}}[a48_0x446af0(0x133)](_0x55838c){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a49_0x53a2fb=a49_0x351a;function a49_0x4785(){const _0xfebadf=['composable_audience','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','profile','1497228XoKxhq','52DRwast','865ojvHNa','length','includes','engage_workspace','11DSsjxX','Default\x20site\x20','Invalid\x20resource:\x20','validate','3994548jFfLia','parent_segment','tdx.json','unset','llm_agent','140085VGpWqq','Error:\x20','640530QLKIYW','error','Default\x20profile\x20','8VdlwdL','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','cas','description','\x0aUpdated:\x20','24106QDwcHr','name','message','site','(session:\x20','agent','llm_project','green','dim','cleared','8BfqvOd','log','database','join','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20cas\x0a','default','1698yknwyD','4999848cArryj','session','Session\x20','Clear\x20session-level\x20or\x20default\x20context\x20values'];a49_0x4785=function(){return _0xfebadf;};return a49_0x4785();}(function(_0x2d18fe,_0x4a0765){const _0x365c65=a49_0x351a,_0x27d41b=_0x2d18fe();while(!![]){try{const _0x3c0fb8=-parseInt(_0x365c65(0x129))/0x1*(parseInt(_0x365c65(0x110))/0x2)+-parseInt(_0x365c65(0x128))/0x3*(-parseInt(_0x365c65(0x10b))/0x4)+parseInt(_0x365c65(0x12a))/0x5*(parseInt(_0x365c65(0x120))/0x6)+parseInt(_0x365c65(0x121))/0x7*(parseInt(_0x365c65(0x11a))/0x8)+parseInt(_0x365c65(0x137))/0x9+-parseInt(_0x365c65(0x108))/0xa*(parseInt(_0x365c65(0x12e))/0xb)+-parseInt(_0x365c65(0x132))/0xc;if(_0x3c0fb8===_0x4a0765)break;else _0x27d41b['push'](_0x27d41b['shift']());}catch(_0x1d904c){_0x27d41b['push'](_0x27d41b['shift']());}}}(a49_0x4785,0xb7e64));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_0x42ccf8 from'chalk';import*as a49_0x248466 from'node:path';function a49_0x351a(_0x310c22,_0x428e0d){_0x310c22=_0x310c22-0x108;const _0x47856c=a49_0x4785();let _0x351a03=_0x47856c[_0x310c22];return _0x351a03;}export class UnsetCommand extends BaseCommand{[a49_0x53a2fb(0x111)]=a49_0x53a2fb(0x135);[a49_0x53a2fb(0x10e)]=a49_0x53a2fb(0x124);[a49_0x53a2fb(0x131)](_0x25928b){const _0xcae667=a49_0x53a2fb,{args:_0x575967,options:_0x3d5246}=_0x25928b,_0x1d7242=_0x3d5246[_0xcae667(0x11f)];if(_0x575967[_0xcae667(0x12b)]===0x0)return'Usage:\x20tdx\x20unset\x20<resource>\x0a'+_0xcae667(0x10c)+_0xcae667(0x11e)+_0xcae667(0x126);const _0x45fceb=_0x575967[0x0],_0x494940=[_0xcae667(0x113),_0xcae667(0x11c),'parent_segment',_0xcae667(0x116),_0xcae667(0x115),_0xcae667(0x127),'engage_workspace',_0xcae667(0x10d),_0xcae667(0x125)];if(!_0x494940[_0xcae667(0x12c)](_0x45fceb))return _0xcae667(0x130)+_0x45fceb+'.\x20Must\x20be\x20one\x20of:\x20'+_0x494940[_0xcae667(0x11d)](',\x20');if(_0x1d7242&&_0x45fceb!==_0xcae667(0x113)&&_0x45fceb!==_0xcae667(0x127))return'--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.';return undefined;}async['execute'](_0x41aa48){const _0xcdb391=a49_0x53a2fb,{args:_0x1f58f4,options:_0x4e2459}=_0x41aa48,_0x38c976=_0x4e2459[_0xcdb391(0x11f)];cleanExpiredSessions();try{const _0x41be7c=_0x1f58f4[0x0],_0x5eabba=a49_0x248466[_0xcdb391(0x11d)](getConfigDir(),_0xcdb391(0x134));if(_0x38c976){if(_0x41be7c===_0xcdb391(0x113))return clearDefaultSiteFromUserConfig(),console[_0xcdb391(0x11b)](_0xcdb391(0x12f)+a49_0x42ccf8[_0xcdb391(0x117)](_0xcdb391(0x119))),console[_0xcdb391(0x11b)](a49_0x42ccf8['dim'](_0xcdb391(0x10f)+_0x5eabba)),0x0;if(_0x41be7c===_0xcdb391(0x127))return clearActiveProfileFromUserConfig(),console[_0xcdb391(0x11b)](_0xcdb391(0x10a)+a49_0x42ccf8[_0xcdb391(0x117)](_0xcdb391(0x119))),console['log'](a49_0x42ccf8['dim'](_0xcdb391(0x10f)+_0x5eabba)),0x0;}const _0x5386fe=getSessionID(_0x4e2459[_0xcdb391(0x122)]),_0x39eacf={'site':_0xcdb391(0x113),'database':'database','parent_segment':_0xcdb391(0x133),'llm_project':_0xcdb391(0x116),'agent':_0xcdb391(0x136),'profile':'profile','engage_workspace':_0xcdb391(0x12d),'cas':_0xcdb391(0x125),'composable_audience':_0xcdb391(0x125)},_0x4e82b6=_0x39eacf[_0x41be7c];return _0x4e82b6&&(clearSessionContextField(_0x4e82b6,_0x4e2459['session']),console[_0xcdb391(0x11b)](_0xcdb391(0x123)+_0x41be7c+'\x20'+a49_0x42ccf8[_0xcdb391(0x117)](_0xcdb391(0x119))+'\x20'+a49_0x42ccf8[_0xcdb391(0x118)](_0xcdb391(0x114)+_0x5386fe+')'))),0x0;}catch(_0x1bab61){return _0x1bab61 instanceof Error&&console[_0xcdb391(0x109)](_0xcdb391(0x138)+_0x1bab61[_0xcdb391(0x112)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a50_0x181722=a50_0x34ae;function a50_0x26c4(){const _0x3b1b29=['includes','red','610749wvaEth','green','cyan','inherit','join','Upgrade\x20tdx\x20to\x20the\x20latest\x20version','Target\x20version:','Running:','130JFBbPf','message','7563815Xxbxoe','pnpm','4XZOrta','name','upgrade','add','error','Latest\x20version:','.bun/','11HXLuPi','Current\x20version:\x20','2527rBFsFn','yellow','6827TfmctO','Successfully\x20upgraded\x20to\x20','Upgrade\x20failed\x20(exit\x20code\x20','...','log','execute','npm','execPath','Would\x20run:','Upgrade\x20is\x20not\x20available\x20for\x20development\x20versions.','close','replace','dryRun','bun','12669468HQJunS','dim','370SewoUZ','Failed\x20to\x20check\x20for\x20updates:\x20','967296BHJbIC','Already\x20up\x20to\x20date\x20(','install','16542REwxeb','yarn','3574677XHadaL','global','next'];a50_0x26c4=function(){return _0x3b1b29;};return a50_0x26c4();}function a50_0x34ae(_0x48b2cc,_0x59f715){_0x48b2cc=_0x48b2cc-0x1b7;const _0x26c46c=a50_0x26c4();let _0x34aef7=_0x26c46c[_0x48b2cc];return _0x34aef7;}(function(_0x1d4d45,_0x11ead9){const _0x3e2a16=a50_0x34ae,_0x49f222=_0x1d4d45();while(!![]){try{const _0x125f29=parseInt(_0x3e2a16(0x1b8))/0x1*(parseInt(_0x3e2a16(0x1c8))/0x2)+-parseInt(_0x3e2a16(0x1cf))/0x3+parseInt(_0x3e2a16(0x1e0))/0x4*(parseInt(_0x3e2a16(0x1de))/0x5)+-parseInt(_0x3e2a16(0x1cd))/0x6*(-parseInt(_0x3e2a16(0x1e9))/0x7)+parseInt(_0x3e2a16(0x1ca))/0x8+parseInt(_0x3e2a16(0x1d4))/0x9*(-parseInt(_0x3e2a16(0x1dc))/0xa)+-parseInt(_0x3e2a16(0x1e7))/0xb*(parseInt(_0x3e2a16(0x1c6))/0xc);if(_0x125f29===_0x11ead9)break;else _0x49f222['push'](_0x49f222['shift']());}catch(_0x4f00a6){_0x49f222['push'](_0x49f222['shift']());}}}(a50_0x26c4,0xba226));import{gt}from'semver';import a50_0x4e9cf5 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';export function detectPackageManager(){const _0x4aba75=a50_0x34ae,_0x1acee1=process[_0x4aba75(0x1bf)]['toLowerCase'](),_0x50f785=process['argv'][0x1]??'';if(_0x1acee1[_0x4aba75(0x1d2)](_0x4aba75(0x1c5))||_0x50f785[_0x4aba75(0x1d2)](_0x4aba75(0x1e6)))return'bun';if(_0x50f785[_0x4aba75(0x1d2)](_0x4aba75(0x1df)))return _0x4aba75(0x1df);if(_0x50f785[_0x4aba75(0x1d2)](_0x4aba75(0x1ce)))return'yarn';return _0x4aba75(0x1be);}export function buildInstallArgs(_0x221266,_0x1b6c7e){const _0x1c4e1c=a50_0x34ae;switch(_0x221266){case _0x1c4e1c(0x1ce):return[_0x1c4e1c(0x1d0),_0x1c4e1c(0x1e3),_0x1b6c7e];case _0x1c4e1c(0x1df):return[_0x1c4e1c(0x1e3),'-g',_0x1b6c7e];default:return[_0x1c4e1c(0x1cc),'-g',_0x1b6c7e];}}export class UpgradeCommand extends BaseCommand{[a50_0x181722(0x1e1)]=a50_0x181722(0x1e2);['description']=a50_0x181722(0x1d9);async[a50_0x181722(0x1bd)](_0x1feaa5){const _0x5d22cc=a50_0x181722,{options:_0x28c985,args:_0x24cfb9}=_0x1feaa5,_0x326b84=!!_0x28c985[_0x5d22cc(0x1c4)],{next:_0x388533,method:_0x489e8a}=_0x28c985,_0x227423=_0x388533?_0x5d22cc(0x1d1):loadReleaseChannel(),_0x1bb956=_0x227423===_0x5d22cc(0x1d1)?_0x5d22cc(0x1d1):'latest',_0xe9afc8=_0x24cfb9[0x0]?String(_0x24cfb9[0x0])[_0x5d22cc(0x1c3)](/^v/,''):undefined,_0x32b5ca=getVersion();if(isDevVersion())return console[_0x5d22cc(0x1e4)](a50_0x4e9cf5[_0x5d22cc(0x1b7)](_0x5d22cc(0x1c1))),console['error'](a50_0x4e9cf5[_0x5d22cc(0x1c7)](_0x5d22cc(0x1e8)+_0x32b5ca)),0x1;let _0x37f9f6;if(_0xe9afc8)_0x37f9f6=_0xe9afc8,console[_0x5d22cc(0x1bc)](a50_0x4e9cf5['dim']('Current\x20version:')+'\x20'+_0x32b5ca),console[_0x5d22cc(0x1bc)](a50_0x4e9cf5['dim'](_0x5d22cc(0x1da))+'\x20\x20'+a50_0x4e9cf5[_0x5d22cc(0x1d5)](_0xe9afc8)),console[_0x5d22cc(0x1bc)]();else{console[_0x5d22cc(0x1bc)](a50_0x4e9cf5[_0x5d22cc(0x1c7)]('Checking\x20'+PACKAGE_NAME+'@'+_0x1bb956+_0x5d22cc(0x1bb)));try{_0x37f9f6=await fetchLatestVersion(_0x227423);}catch(_0x523745){return console['error'](a50_0x4e9cf5[_0x5d22cc(0x1d3)](_0x5d22cc(0x1c9)+(_0x523745 instanceof Error?_0x523745['message']:String(_0x523745)))),0x1;}if(!gt(_0x37f9f6,_0x32b5ca))return console[_0x5d22cc(0x1bc)](a50_0x4e9cf5[_0x5d22cc(0x1d5)](_0x5d22cc(0x1cb)+_0x32b5ca+').')),0x0;console['log'](a50_0x4e9cf5[_0x5d22cc(0x1c7)]('Current\x20version:')+'\x20'+_0x32b5ca),console['log'](a50_0x4e9cf5[_0x5d22cc(0x1c7)](_0x5d22cc(0x1e5))+'\x20\x20'+a50_0x4e9cf5['green'](_0x37f9f6)),console[_0x5d22cc(0x1bc)]();}const _0x3653ba=_0x489e8a??detectPackageManager(),_0x1713c3=_0xe9afc8?PACKAGE_NAME+'@'+_0xe9afc8:PACKAGE_NAME+'@'+_0x1bb956,_0x484222=buildInstallArgs(_0x3653ba,_0x1713c3);if(_0x326b84)return console['log'](a50_0x4e9cf5[_0x5d22cc(0x1c7)](_0x5d22cc(0x1c0))),console[_0x5d22cc(0x1bc)]('\x20\x20'+a50_0x4e9cf5[_0x5d22cc(0x1d6)](_0x3653ba+'\x20'+_0x484222['join']('\x20'))),0x0;return console[_0x5d22cc(0x1bc)](a50_0x4e9cf5[_0x5d22cc(0x1c7)](_0x5d22cc(0x1db))+'\x20'+_0x3653ba+'\x20'+_0x484222[_0x5d22cc(0x1d8)]('\x20')),console[_0x5d22cc(0x1bc)](),new Promise(_0x35b19b=>{const _0x398769=_0x5d22cc,_0x2d0516=crossSpawn(_0x3653ba,_0x484222,{'stdio':_0x398769(0x1d7)});_0x2d0516['on'](_0x398769(0x1c2),_0x49b6fb=>{const _0x4f3582=_0x398769;console[_0x4f3582(0x1bc)](),_0x49b6fb===0x0?console['log'](a50_0x4e9cf5['green'](_0x4f3582(0x1b9)+_0x1713c3)):console[_0x4f3582(0x1e4)](a50_0x4e9cf5[_0x4f3582(0x1d3)](_0x4f3582(0x1ba)+_0x49b6fb+').')),_0x35b19b(_0x49b6fb??0x1);}),_0x2d0516['on'](_0x398769(0x1e4),_0x5c51fb=>{const _0x2265ac=_0x398769;console[_0x2265ac(0x1e4)](a50_0x4e9cf5[_0x2265ac(0x1d3)]('Failed\x20to\x20run\x20'+_0x3653ba+':\x20'+_0x5c51fb[_0x2265ac(0x1dd)])),_0x35b19b(0x1);});});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a51_0x25e38e=a51_0x4552;(function(_0x392a09,_0x24ad37){const _0x187bfd=a51_0x4552,_0x20fcbd=_0x392a09();while(!![]){try{const _0x5a79be=-parseInt(_0x187bfd(0x1f0))/0x1*(parseInt(_0x187bfd(0x1af))/0x2)+parseInt(_0x187bfd(0x1f2))/0x3*(parseInt(_0x187bfd(0x1d7))/0x4)+parseInt(_0x187bfd(0x1b8))/0x5*(-parseInt(_0x187bfd(0x1ba))/0x6)+-parseInt(_0x187bfd(0x1dd))/0x7+-parseInt(_0x187bfd(0x1ed))/0x8+parseInt(_0x187bfd(0x1c2))/0x9*(parseInt(_0x187bfd(0x1b2))/0xa)+-parseInt(_0x187bfd(0x1f4))/0xb*(-parseInt(_0x187bfd(0x1a5))/0xc);if(_0x5a79be===_0x24ad37)break;else _0x20fcbd['push'](_0x20fcbd['shift']());}catch(_0x66e78f){_0x20fcbd['push'](_0x20fcbd['shift']());}}}(a51_0x17eb,0x73349));function a51_0x4552(_0x3f9716,_0x51fcf8){_0x3f9716=_0x3f9716-0x1a4;const _0x17eb43=a51_0x17eb();let _0x4552be=_0x17eb43[_0x3f9716];return _0x4552be;}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_0x54478e from'chalk';import*as a51_0x151772 from'node:path';export class UseCommand extends BaseCommand{[a51_0x25e38e(0x1d8)]=a51_0x25e38e(0x1dc);[a51_0x25e38e(0x1cf)]=a51_0x25e38e(0x1e1);['validate'](_0x2194e7){const _0x12dee4=a51_0x25e38e,{args:_0x3c9955,options:_0x15f87e}=_0x2194e7,_0x3a421a=_0x15f87e[_0x12dee4(0x1df)];if(_0x3c9955[_0x12dee4(0x1db)]===0x0)return undefined;if(_0x3c9955['length']===0x1)return _0x12dee4(0x1bd)+_0x12dee4(0x1a8)+_0x12dee4(0x1e5)+_0x12dee4(0x1d6)+_0x12dee4(0x1cb)+_0x12dee4(0x1c7)+_0x12dee4(0x1b1)+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0xebc144=_0x3c9955[0x0],_0x4545f8=[_0x12dee4(0x1cc),_0x12dee4(0x1ca),_0x12dee4(0x1a4),_0x12dee4(0x1e8),_0x12dee4(0x1e0),_0x12dee4(0x1de),_0x12dee4(0x1d1),_0x12dee4(0x1bf),_0x12dee4(0x1ac),_0x12dee4(0x1c3)];if(!_0x4545f8[_0x12dee4(0x1e7)](_0xebc144))return _0x12dee4(0x1be)+_0xebc144+_0x12dee4(0x1d4)+_0x4545f8[_0x12dee4(0x1ea)](',\x20');if(_0x3a421a&&_0xebc144!=='site'&&_0xebc144!==_0x12dee4(0x1de)&&_0xebc144!=='release_channel')return _0x12dee4(0x1c1);if(_0xebc144===_0x12dee4(0x1c3)&&!_0x3a421a)return _0x12dee4(0x1e9);if(_0xebc144===_0x12dee4(0x1c3)){const _0x5cb879=_0x3c9955[0x1];if(_0x5cb879!==_0x12dee4(0x1f6)&&_0x5cb879!=='next')return'Invalid\x20release\x20channel:\x20'+_0x5cb879+_0x12dee4(0x1b4);}return undefined;}async['execute'](_0x41b034){const _0x7c1176=a51_0x25e38e,{args:_0x34bab1,options:_0xe58cdb}=_0x41b034,_0x4f9050=_0xe58cdb[_0x7c1176(0x1f5)],_0x30c5ef=_0xe58cdb['clear'],_0x1c2c7e=_0xe58cdb['default'];cleanExpiredSessions();try{if(_0x30c5ef){clearSessionContext(_0xe58cdb[_0x7c1176(0x1e3)]);const _0x5dc942=getSessionID(_0xe58cdb[_0x7c1176(0x1e3)]);return console['log'](_0x7c1176(0x1a6)+a51_0x54478e['green'](_0x7c1176(0x1a9))+'\x20'+a51_0x54478e[_0x7c1176(0x1e4)](_0x7c1176(0x1ab)+_0x5dc942+')')),0x0;}if(_0x34bab1['length']===0x0){const _0x55e483=new GlobalContext(_0xe58cdb);return _0x4f9050?_0x55e483['displayWithSources']():_0x55e483[_0x7c1176(0x1d5)](),console[_0x7c1176(0x1ef)](a51_0x54478e[_0x7c1176(0x1e4)](_0x7c1176(0x1b6))),console[_0x7c1176(0x1ef)](a51_0x54478e['dim'](_0x7c1176(0x1bb))),console[_0x7c1176(0x1ef)](a51_0x54478e['dim']('Use\x20--default\x20with\x20site,\x20profile,\x20or\x20release_channel\x20to\x20save\x20permanently')),0x0;}const _0x284ee1=_0x34bab1[0x0],_0x510aa1=_0x34bab1[0x1],_0x280e9e=a51_0x151772['join'](getConfigDir(),'tdx.json');if(_0x1c2c7e){if(_0x284ee1==='site')return saveDefaultSiteToUserConfig(_0x510aa1),console[_0x7c1176(0x1ef)](_0x7c1176(0x1f1)+a51_0x54478e['green'](_0x510aa1)),console[_0x7c1176(0x1ef)](a51_0x54478e[_0x7c1176(0x1e4)](_0x7c1176(0x1b0)+_0x280e9e)),0x0;if(_0x284ee1===_0x7c1176(0x1de)){if(!profileExists(_0x510aa1))return console[_0x7c1176(0x1d3)](_0x7c1176(0x1d2)+_0x510aa1+'\x27\x20does\x20not\x20exist'),console[_0x7c1176(0x1d3)](_0x7c1176(0x1b9)),0x1;return saveActiveProfileToUserConfig(_0x510aa1),console[_0x7c1176(0x1ef)](_0x7c1176(0x1eb)+a51_0x54478e[_0x7c1176(0x1b5)](_0x510aa1)),console[_0x7c1176(0x1ef)](a51_0x54478e['dim']('\x0aSaved\x20to:\x20'+_0x280e9e)),0x0;}if(_0x284ee1===_0x7c1176(0x1c3))return saveReleaseChannel(_0x510aa1),console['log'](_0x7c1176(0x1c8)+a51_0x54478e[_0x7c1176(0x1b5)](_0x510aa1)),console[_0x7c1176(0x1ef)](a51_0x54478e[_0x7c1176(0x1e4)](_0x7c1176(0x1b0)+_0x280e9e)),_0x510aa1===_0x7c1176(0x1c9)?(console[_0x7c1176(0x1ef)](a51_0x54478e[_0x7c1176(0x1e4)](_0x7c1176(0x1d0))),console[_0x7c1176(0x1ef)](a51_0x54478e[_0x7c1176(0x1e4)](_0x7c1176(0x1f3)))):console[_0x7c1176(0x1ef)](a51_0x54478e[_0x7c1176(0x1e4)](_0x7c1176(0x1c5))),0x0;}if(_0x284ee1===_0x7c1176(0x1cc)){const _0x52436e=getSessionID(_0xe58cdb[_0x7c1176(0x1e3)]);return saveSessionContext({'site':_0x510aa1},_0xe58cdb[_0x7c1176(0x1e3)]),console['log'](_0x7c1176(0x1c0)+a51_0x54478e[_0x7c1176(0x1b5)](_0x510aa1)+'\x20'+a51_0x54478e[_0x7c1176(0x1e4)]('(session:\x20'+_0x52436e+')')),console[_0x7c1176(0x1ef)](a51_0x54478e[_0x7c1176(0x1e4)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20'+_0x510aa1+'\x27\x20to\x20save\x20permanently')),0x0;}if(_0x284ee1==='profile'){if(!profileExists(_0x510aa1))return console[_0x7c1176(0x1d3)]('Error:\x20Profile\x20\x27'+_0x510aa1+_0x7c1176(0x1ae)),console[_0x7c1176(0x1d3)](_0x7c1176(0x1b9)),0x1;const _0x36e5ec=getSessionID(_0xe58cdb[_0x7c1176(0x1e3)]);return saveSessionContext({'profile':_0x510aa1},_0xe58cdb[_0x7c1176(0x1e3)]),console[_0x7c1176(0x1ef)](_0x7c1176(0x1c6)+a51_0x54478e[_0x7c1176(0x1b5)](_0x510aa1)+'\x20'+a51_0x54478e['dim']('(session:\x20'+_0x36e5ec+')')),console[_0x7c1176(0x1ef)](a51_0x54478e[_0x7c1176(0x1e4)](_0x7c1176(0x1ee)+_0x510aa1+'\x27\x20to\x20save\x20permanently')),0x0;}const _0x1223df={},_0x49bd2b=getSessionID(_0xe58cdb['session']);switch(_0x284ee1){case _0x7c1176(0x1ca):_0x1223df[_0x7c1176(0x1ca)]=_0x510aa1,console[_0x7c1176(0x1ef)](_0x7c1176(0x1bc)+a51_0x54478e[_0x7c1176(0x1b5)](_0x510aa1)+'\x20'+a51_0x54478e[_0x7c1176(0x1e4)](_0x7c1176(0x1ab)+_0x49bd2b+')'));break;case _0x7c1176(0x1a4):_0x1223df[_0x7c1176(0x1a4)]=_0x510aa1,console[_0x7c1176(0x1ef)](_0x7c1176(0x1d9)+a51_0x54478e[_0x7c1176(0x1b5)](_0x510aa1)+'\x20'+a51_0x54478e[_0x7c1176(0x1e4)](_0x7c1176(0x1ab)+_0x49bd2b+')'));break;case _0x7c1176(0x1e8):_0x1223df[_0x7c1176(0x1e8)]=_0x510aa1,console[_0x7c1176(0x1ef)](_0x7c1176(0x1aa)+a51_0x54478e['green'](_0x510aa1)+'\x20'+a51_0x54478e['dim'](_0x7c1176(0x1ab)+_0x49bd2b+')'));break;case _0x7c1176(0x1e0):{const {projectName:_0x12c6a4,agentName:_0x1a50fb}=parseAgentRef(_0x510aa1);_0x1a50fb?(_0x1223df['llm_project']=_0x12c6a4,_0x1223df[_0x7c1176(0x1da)]=_0x1a50fb,console[_0x7c1176(0x1ef)](_0x7c1176(0x1aa)+a51_0x54478e[_0x7c1176(0x1b5)](_0x12c6a4)+'\x20'+a51_0x54478e['dim'](_0x7c1176(0x1ab)+_0x49bd2b+')')),console[_0x7c1176(0x1ef)](_0x7c1176(0x1ec)+a51_0x54478e[_0x7c1176(0x1b5)](_0x1a50fb)+'\x20'+a51_0x54478e[_0x7c1176(0x1e4)](_0x7c1176(0x1ab)+_0x49bd2b+')'))):(_0x1223df[_0x7c1176(0x1da)]=_0x510aa1,console[_0x7c1176(0x1ef)]('Session\x20agent\x20set\x20to:\x20'+a51_0x54478e['green'](_0x510aa1)+'\x20'+a51_0x54478e['dim']('(session:\x20'+_0x49bd2b+')')));break;}case _0x7c1176(0x1bf):case _0x7c1176(0x1ac):_0x1223df[_0x7c1176(0x1ac)]=_0x510aa1,console['log'](_0x7c1176(0x1b3)+a51_0x54478e[_0x7c1176(0x1b5)](_0x510aa1)+'\x20'+a51_0x54478e[_0x7c1176(0x1e4)](_0x7c1176(0x1ab)+_0x49bd2b+')'));break;case _0x7c1176(0x1d1):{try{await withSpinner('Verifying\x20workspace\x20\x27'+_0x510aa1+_0x7c1176(0x1cd),()=>_0x41b034[_0x7c1176(0x1e2)]['engage']['resolveWorkspaceId'](_0x510aa1));}catch(_0x56143f){if(_0x56143f instanceof SDKError&&(_0x56143f[_0x7c1176(0x1e6)]===ErrorCode[_0x7c1176(0x1ad)]||_0x56143f['code']===ErrorCode['INVALID_ARGUMENT']))return console[_0x7c1176(0x1d3)](_0x7c1176(0x1b7)+_0x56143f[_0x7c1176(0x1c4)]),console[_0x7c1176(0x1d3)]('\x0aUse\x20\x27tdx\x20engage\x20workspace\x20list\x27\x20to\x20see\x20available\x20workspaces'),0x1;throw _0x56143f;}_0x1223df['engage_workspace']=_0x510aa1,console['log'](_0x7c1176(0x1ce)+a51_0x54478e[_0x7c1176(0x1b5)](_0x510aa1)+'\x20'+a51_0x54478e[_0x7c1176(0x1e4)](_0x7c1176(0x1ab)+_0x49bd2b+')'));break;}}return saveSessionContext(_0x1223df,_0xe58cdb[_0x7c1176(0x1e3)]),console[_0x7c1176(0x1ef)](a51_0x54478e[_0x7c1176(0x1e4)](_0x7c1176(0x1a7))),0x0;}catch(_0xaa0a67){return _0xaa0a67 instanceof Error&&console[_0x7c1176(0x1d3)](_0x7c1176(0x1b7)+_0xaa0a67[_0x7c1176(0x1c4)]),0x1;}}}function a51_0x17eb(){const _0x1c47f3=['composable_audience','NOT_FOUND','\x27\x20does\x20not\x20exist','1348838pwWxmc','\x0aSaved\x20to:\x20','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20cas,\x20release_channel\x0a','37860lQQlGa','Session\x20composable_audience\x20set\x20to:\x20','.\x20Must\x20be\x20\x27stable\x27\x20or\x20\x27next\x27.','green','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','Error:\x20','12655FsBPPC','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','1956szmsTY','Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel','Session\x20database\x20set\x20to:\x20','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','Invalid\x20resource:\x20','cas','Session\x20site\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.','207XwuTfi','release_channel','message','\x0aUpdate\x20notifications\x20will\x20check\x20the\x20@latest\x20(stable)\x20channel.','Session\x20profile\x20set\x20to:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>\x20\x20#\x20Set\x20release\x20channel\x0a','Release\x20channel\x20set\x20to:\x20','next','database','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a','site','\x27...','Session\x20engage_workspace\x20set\x20to:\x20','description','\x0aUpdate\x20notifications\x20will\x20now\x20check\x20the\x20@next\x20channel.','engage_workspace','Error:\x20Profile\x20\x27','error','.\x20Must\x20be\x20one\x20of:\x20','display','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a','16QCStHc','name','Session\x20parent_segment\x20set\x20to:\x20','llm_agent','length','use','2865968uSGuWj','profile','default','agent','Set\x20session-level\x20context','tdx','session','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','code','includes','llm_project','release_channel\x20requires\x20--default.\x20Usage:\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>','join','Default\x20profile\x20set\x20to:\x20','Session\x20agent\x20set\x20to:\x20','4427448lyrofG','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20','log','1zHKBTF','Default\x20site\x20set\x20to:\x20','497067acBZis','Install\x20the\x20latest\x20next\x20version:\x20npm\x20install\x20-g\x20@treasuredata/tdx@next','11BFaXxk','debug','stable','parent_segment','26213124UUuBjl','Session\x20context\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','\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','cleared','Session\x20llm_project\x20set\x20to:\x20','(session:\x20'];a51_0x17eb=function(){return _0x1c47f3;};return a51_0x17eb();}
|
|
1
|
+
function a51_0x4aa0(){const _0x1a1beb=['engage','execute','NOT_FOUND','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a','80504eUaXkQ','length','Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel','\x0aUse\x20\x27tdx\x20engage\x20workspace\x20list\x27\x20to\x20see\x20available\x20workspaces','\x0aUpdate\x20notifications\x20will\x20check\x20the\x20@latest\x20(stable)\x20channel.','green','663924GegyBr','parent_segment','Session\x20llm_project\x20set\x20to:\x20','\x0aSaved\x20to:\x20','\x27\x20to\x20save\x20permanently','11BPjSYE','7740081evowdz','session','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Session\x20engage_workspace\x20set\x20to:\x20','Verifying\x20workspace\x20\x27','llm_project','Session\x20context\x20','70PUgkyt','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20cas,\x20release_channel\x0a','Session\x20profile\x20set\x20to:\x20','engage_workspace','955050lbxLsK','stable','16394330ztROhV','Set\x20session-level\x20context','\x27...','Error:\x20Profile\x20\x27','.\x20Must\x20be\x20one\x20of:\x20','27485ADYFBl','Use\x20--default\x20with\x20site,\x20profile,\x20or\x20release_channel\x20to\x20save\x20permanently','Error:\x20','release_channel','\x27\x20does\x20not\x20exist','default','dim','Default\x20profile\x20set\x20to:\x20','tdx.json','Session\x20site\x20set\x20to:\x20','Session\x20composable_audience\x20set\x20to:\x20','Invalid\x20resource:\x20','Invalid\x20release\x20channel:\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','next','cas','Session\x20database\x20set\x20to:\x20','8uOqahN','debug','name','includes','log','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','522435lxjYmP','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','composable_audience','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a','llm_agent','database','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','resolveWorkspaceId','error','profile','message','Release\x20channel\x20set\x20to:\x20','\x0aUpdate\x20notifications\x20will\x20now\x20check\x20the\x20@next\x20channel.','agent','join','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','Session\x20agent\x20set\x20to:\x20','tdx','site','88zCDlGx','(session:\x20','Session\x20parent_segment\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.','use'];a51_0x4aa0=function(){return _0x1a1beb;};return a51_0x4aa0();}const a51_0x1a331b=a51_0x5372;function a51_0x5372(_0x5d32fa,_0x23bd81){_0x5d32fa=_0x5d32fa-0x86;const _0x4aa0a3=a51_0x4aa0();let _0x53721e=_0x4aa0a3[_0x5d32fa];return _0x53721e;}(function(_0x33c2d2,_0x322565){const _0x5a7bbf=a51_0x5372,_0xa666e9=_0x33c2d2();while(!![]){try{const _0x113aa1=parseInt(_0x5a7bbf(0xd1))/0x1+parseInt(_0x5a7bbf(0x97))/0x2+-parseInt(_0x5a7bbf(0xb5))/0x3+-parseInt(_0x5a7bbf(0xc8))/0x4*(parseInt(_0x5a7bbf(0x9e))/0x5)+parseInt(_0x5a7bbf(0x86))/0x6*(parseInt(_0x5a7bbf(0x93))/0x7)+parseInt(_0x5a7bbf(0xaf))/0x8*(parseInt(_0x5a7bbf(0x8c))/0x9)+parseInt(_0x5a7bbf(0x99))/0xa*(-parseInt(_0x5a7bbf(0x8b))/0xb);if(_0x113aa1===_0x322565)break;else _0xa666e9['push'](_0xa666e9['shift']());}catch(_0x3ca48b){_0xa666e9['push'](_0xa666e9['shift']());}}}(a51_0x4aa0,0x900f2));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_0x456808 from'chalk';import*as a51_0x6196c3 from'node:path';export class UseCommand extends BaseCommand{[a51_0x1a331b(0xb1)]=a51_0x1a331b(0xcc);['description']=a51_0x1a331b(0x9a);['validate'](_0x5d0150){const _0x3604f9=a51_0x1a331b,{args:_0x15a6ce,options:_0x18bd96}=_0x5d0150,_0x352ab1=_0x18bd96[_0x3604f9(0xa3)];if(_0x15a6ce[_0x3604f9(0xd2)]===0x0)return undefined;if(_0x15a6ce[_0x3604f9(0xd2)]===0x1)return _0x3604f9(0xb6)+_0x3604f9(0xab)+_0x3604f9(0xb4)+_0x3604f9(0xd0)+_0x3604f9(0xb8)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>\x20\x20#\x20Set\x20release\x20channel\x0a'+_0x3604f9(0x94)+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x88cf9d=_0x15a6ce[0x0],_0x1ce8a0=['site',_0x3604f9(0xba),_0x3604f9(0x87),_0x3604f9(0x91),_0x3604f9(0xc2),'profile',_0x3604f9(0x96),_0x3604f9(0xad),_0x3604f9(0xb7),_0x3604f9(0xa1)];if(!_0x1ce8a0[_0x3604f9(0xb2)](_0x88cf9d))return _0x3604f9(0xa9)+_0x88cf9d+_0x3604f9(0x9d)+_0x1ce8a0[_0x3604f9(0xc3)](',\x20');if(_0x352ab1&&_0x88cf9d!==_0x3604f9(0xc7)&&_0x88cf9d!=='profile'&&_0x88cf9d!==_0x3604f9(0xa1))return _0x3604f9(0xcb);if(_0x88cf9d===_0x3604f9(0xa1)&&!_0x352ab1)return'release_channel\x20requires\x20--default.\x20Usage:\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>';if(_0x88cf9d===_0x3604f9(0xa1)){const _0x2b28eb=_0x15a6ce[0x1];if(_0x2b28eb!==_0x3604f9(0x98)&&_0x2b28eb!=='next')return _0x3604f9(0xaa)+_0x2b28eb+'.\x20Must\x20be\x20\x27stable\x27\x20or\x20\x27next\x27.';}return undefined;}async[a51_0x1a331b(0xce)](_0x1227ae){const _0x295754=a51_0x1a331b,{args:_0x4f9239,options:_0x1b0029}=_0x1227ae,_0x25daf5=_0x1b0029[_0x295754(0xb0)],_0x253be8=_0x1b0029['clear'],_0x2ffec3=_0x1b0029[_0x295754(0xa3)];cleanExpiredSessions();try{if(_0x253be8){clearSessionContext(_0x1b0029[_0x295754(0x8d)]);const _0x29085c=getSessionID(_0x1b0029['session']);return console[_0x295754(0xb3)](_0x295754(0x92)+a51_0x456808[_0x295754(0xd6)]('cleared')+'\x20'+a51_0x456808['dim'](_0x295754(0xc9)+_0x29085c+')')),0x0;}if(_0x4f9239[_0x295754(0xd2)]===0x0){const _0x452c01=new GlobalContext(_0x1b0029);return _0x25daf5?_0x452c01['displayWithSources']():_0x452c01['display'](),console[_0x295754(0xb3)](a51_0x456808[_0x295754(0xa4)](_0x295754(0xc4))),console['log'](a51_0x456808[_0x295754(0xa4)](_0x295754(0xd3))),console[_0x295754(0xb3)](a51_0x456808[_0x295754(0xa4)](_0x295754(0x9f))),0x0;}const _0x14ddc0=_0x4f9239[0x0],_0x197689=_0x4f9239[0x1],_0x2d7b04=a51_0x6196c3['join'](getConfigDir(),_0x295754(0xa6));if(_0x2ffec3){if(_0x14ddc0===_0x295754(0xc7))return saveDefaultSiteToUserConfig(_0x197689),console[_0x295754(0xb3)]('Default\x20site\x20set\x20to:\x20'+a51_0x456808[_0x295754(0xd6)](_0x197689)),console['log'](a51_0x456808[_0x295754(0xa4)]('\x0aSaved\x20to:\x20'+_0x2d7b04)),0x0;if(_0x14ddc0===_0x295754(0xbe)){if(!profileExists(_0x197689))return console['error'](_0x295754(0x9c)+_0x197689+_0x295754(0xa2)),console['error']('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;return saveActiveProfileToUserConfig(_0x197689),console[_0x295754(0xb3)](_0x295754(0xa5)+a51_0x456808[_0x295754(0xd6)](_0x197689)),console[_0x295754(0xb3)](a51_0x456808['dim'](_0x295754(0x89)+_0x2d7b04)),0x0;}if(_0x14ddc0===_0x295754(0xa1))return saveReleaseChannel(_0x197689),console['log'](_0x295754(0xc0)+a51_0x456808[_0x295754(0xd6)](_0x197689)),console[_0x295754(0xb3)](a51_0x456808[_0x295754(0xa4)](_0x295754(0x89)+_0x2d7b04)),_0x197689===_0x295754(0xac)?(console['log'](a51_0x456808[_0x295754(0xa4)](_0x295754(0xc1))),console['log'](a51_0x456808[_0x295754(0xa4)]('Install\x20the\x20latest\x20next\x20version:\x20npm\x20install\x20-g\x20@treasuredata/tdx@next'))):console[_0x295754(0xb3)](a51_0x456808[_0x295754(0xa4)](_0x295754(0xd5))),0x0;}if(_0x14ddc0===_0x295754(0xc7)){const _0x5c5ec9=getSessionID(_0x1b0029['session']);return saveSessionContext({'site':_0x197689},_0x1b0029['session']),console['log'](_0x295754(0xa7)+a51_0x456808['green'](_0x197689)+'\x20'+a51_0x456808['dim'](_0x295754(0xc9)+_0x5c5ec9+')')),console[_0x295754(0xb3)](a51_0x456808['dim']('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20'+_0x197689+'\x27\x20to\x20save\x20permanently')),0x0;}if(_0x14ddc0===_0x295754(0xbe)){if(!profileExists(_0x197689))return console[_0x295754(0xbd)]('Error:\x20Profile\x20\x27'+_0x197689+'\x27\x20does\x20not\x20exist'),console[_0x295754(0xbd)](_0x295754(0xbb)),0x1;const _0x39a871=getSessionID(_0x1b0029[_0x295754(0x8d)]);return saveSessionContext({'profile':_0x197689},_0x1b0029[_0x295754(0x8d)]),console[_0x295754(0xb3)](_0x295754(0x95)+a51_0x456808[_0x295754(0xd6)](_0x197689)+'\x20'+a51_0x456808[_0x295754(0xa4)](_0x295754(0xc9)+_0x39a871+')')),console[_0x295754(0xb3)](a51_0x456808[_0x295754(0xa4)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20'+_0x197689+_0x295754(0x8a))),0x0;}const _0x138f96={},_0x4ca94b=getSessionID(_0x1b0029[_0x295754(0x8d)]);switch(_0x14ddc0){case _0x295754(0xba):_0x138f96[_0x295754(0xba)]=_0x197689,console[_0x295754(0xb3)](_0x295754(0xae)+a51_0x456808[_0x295754(0xd6)](_0x197689)+'\x20'+a51_0x456808[_0x295754(0xa4)](_0x295754(0xc9)+_0x4ca94b+')'));break;case _0x295754(0x87):_0x138f96['parent_segment']=_0x197689,console[_0x295754(0xb3)](_0x295754(0xca)+a51_0x456808[_0x295754(0xd6)](_0x197689)+'\x20'+a51_0x456808[_0x295754(0xa4)](_0x295754(0xc9)+_0x4ca94b+')'));break;case'llm_project':_0x138f96['llm_project']=_0x197689,console['log'](_0x295754(0x88)+a51_0x456808[_0x295754(0xd6)](_0x197689)+'\x20'+a51_0x456808[_0x295754(0xa4)]('(session:\x20'+_0x4ca94b+')'));break;case _0x295754(0xc2):{const {projectName:_0x3ff631,agentName:_0x10b46c}=parseAgentRef(_0x197689);_0x10b46c?(_0x138f96[_0x295754(0x91)]=_0x3ff631,_0x138f96[_0x295754(0xb9)]=_0x10b46c,console[_0x295754(0xb3)](_0x295754(0x88)+a51_0x456808['green'](_0x3ff631)+'\x20'+a51_0x456808[_0x295754(0xa4)](_0x295754(0xc9)+_0x4ca94b+')')),console[_0x295754(0xb3)]('Session\x20agent\x20set\x20to:\x20'+a51_0x456808['green'](_0x10b46c)+'\x20'+a51_0x456808['dim'](_0x295754(0xc9)+_0x4ca94b+')'))):(_0x138f96['llm_agent']=_0x197689,console[_0x295754(0xb3)](_0x295754(0xc5)+a51_0x456808[_0x295754(0xd6)](_0x197689)+'\x20'+a51_0x456808['dim'](_0x295754(0xc9)+_0x4ca94b+')')));break;}case _0x295754(0xad):case _0x295754(0xb7):_0x138f96[_0x295754(0xb7)]=_0x197689,console['log'](_0x295754(0xa8)+a51_0x456808['green'](_0x197689)+'\x20'+a51_0x456808[_0x295754(0xa4)]('(session:\x20'+_0x4ca94b+')'));break;case _0x295754(0x96):{try{await withSpinner(_0x295754(0x90)+_0x197689+_0x295754(0x9b),()=>_0x1227ae[_0x295754(0xc6)][_0x295754(0xcd)][_0x295754(0xbc)](_0x197689));}catch(_0x346a22){if(_0x346a22 instanceof SDKError&&(_0x346a22['code']===ErrorCode[_0x295754(0xcf)]||_0x346a22['code']===ErrorCode['INVALID_ARGUMENT']))return console['error'](_0x295754(0xa0)+_0x346a22[_0x295754(0xbf)]),console['error'](_0x295754(0xd4)),0x1;throw _0x346a22;}_0x138f96[_0x295754(0x96)]=_0x197689,console[_0x295754(0xb3)](_0x295754(0x8f)+a51_0x456808[_0x295754(0xd6)](_0x197689)+'\x20'+a51_0x456808[_0x295754(0xa4)](_0x295754(0xc9)+_0x4ca94b+')'));break;}}return saveSessionContext(_0x138f96,_0x1b0029[_0x295754(0x8d)]),console[_0x295754(0xb3)](a51_0x456808[_0x295754(0xa4)](_0x295754(0x8e))),0x0;}catch(_0x1d5573){return _0x1d5573 instanceof Error&&console[_0x295754(0xbd)](_0x295754(0xa0)+_0x1d5573[_0x295754(0xbf)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a52_0x34ea79=a52_0x276d;function a52_0x276d(_0x56bd89,_0x252c8c){_0x56bd89=_0x56bd89-0x128;const _0xe2c70b=a52_0xe2c7();let _0x276d71=_0xe2c70b[_0x56bd89];return _0x276d71;}(function(_0x5a60ad,_0x4e76e5){const _0x31bdf4=a52_0x276d,_0x371254=_0x5a60ad();while(!![]){try{const _0x4ed6bf=parseInt(_0x31bdf4(0x12c))/0x1+parseInt(_0x31bdf4(0x133))/0x2+-parseInt(_0x31bdf4(0x139))/0x3*(-parseInt(_0x31bdf4(0x13f))/0x4)+parseInt(_0x31bdf4(0x146))/0x5*(parseInt(_0x31bdf4(0x132))/0x6)+-parseInt(_0x31bdf4(0x12f))/0x7*(parseInt(_0x31bdf4(0x142))/0x8)+-parseInt(_0x31bdf4(0x13b))/0x9*(parseInt(_0x31bdf4(0x14d))/0xa)+parseInt(_0x31bdf4(0x145))/0xb*(-parseInt(_0x31bdf4(0x135))/0xc);if(_0x4ed6bf===_0x4e76e5)break;else _0x371254['push'](_0x371254['shift']());}catch(_0x5e5d2c){_0x371254['push'](_0x371254['shift']());}}}(a52_0xe2c7,0xeb424));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a52_0xe2c7(){const _0x3ed2a2=['Show\x20current\x20user\x20information','56tFIPTA','verbose','administrator','963852GeSJmR','2167072ezVbNP','data','17796cTraHH','getCurrent','execute','cause','11127YOwDcZ','Unknown','477MqzGMk','✔\x20Found\x20','length','Fetching\x20user\x20info...','92PhhCrv','message','Error:\x20','1261600HIwhjU','user','account_owner','9097KJpbSB','55DIHJQK','yellow','name','email','list','sort','👤\x20','43110zArRlJ','\x20(admin)','error','\x20\x20Cause:\x20','localeCompare','744239SLAEBP','log'];a52_0xe2c7=function(){return _0x3ed2a2;};return a52_0xe2c7();}import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import a52_0x1a2258 from'chalk';export class UserCommand extends BaseCommand{[a52_0x34ea79(0x148)]=a52_0x34ea79(0x143);['description']=a52_0x34ea79(0x12e);async[a52_0x34ea79(0x137)](_0x1cd1b5){const _0xf55d95=a52_0x34ea79,{options:_0x50ff45,tdx:_0x10b855}=_0x1cd1b5;try{const _0x51f368=await withSpinner(_0xf55d95(0x13e),()=>_0x10b855['user'][_0xf55d95(0x136)](),{'verbose':_0x50ff45['verbose']}),_0x4d8124=_0x51f368[_0xf55d95(0x134)];return await handleSingleObjectOutput(_0x4d8124,_0x50ff45),0x0;}catch(_0x52ba4e){if(_0x52ba4e instanceof SDKError)return console[_0xf55d95(0x129)](_0xf55d95(0x141)+_0x52ba4e[_0xf55d95(0x140)]),_0x52ba4e[_0xf55d95(0x138)]&&console['error'](_0xf55d95(0x12a)+_0x52ba4e[_0xf55d95(0x138)]),0x1;throw _0x52ba4e;}}}export class UserListCommand extends BaseCommand{[a52_0x34ea79(0x148)]='user\x20list';['description']='List\x20all\x20users\x20in\x20the\x20account';async['execute'](_0x247237){const _0x4e2b1b=a52_0x34ea79,{options:_0x49bdb7,tdx:_0x897d5d}=_0x247237;try{const _0x411f6c=await withSpinner('Listing\x20users...',()=>_0x897d5d['user'][_0x4e2b1b(0x14a)](),{'verbose':_0x49bdb7[_0x4e2b1b(0x130)]}),_0x15d761=_0x411f6c[_0x4e2b1b(0x134)];console[_0x4e2b1b(0x129)](_0x4e2b1b(0x13c)+_0x15d761[_0x4e2b1b(0x13d)]+'\x20user'+(_0x15d761[_0x4e2b1b(0x13d)]!==0x1?'s':''));if(isStructuredFormat(_0x49bdb7))await handleSDKOutput(_0x15d761,_0x49bdb7);else{const _0x334aba=[..._0x15d761][_0x4e2b1b(0x14b)]((_0x46d5ff,_0x3a3c66)=>String(_0x46d5ff[_0x4e2b1b(0x148)]??'')[_0x4e2b1b(0x12b)](String(_0x3a3c66[_0x4e2b1b(0x148)]??'')));for(const _0x582aa0 of _0x334aba){const _0x286d22=_0x582aa0[_0x4e2b1b(0x144)]?a52_0x1a2258[_0x4e2b1b(0x147)]('\x20(owner)'):_0x582aa0[_0x4e2b1b(0x131)]?a52_0x1a2258[_0x4e2b1b(0x147)](_0x4e2b1b(0x128)):'',_0x596f87=_0x582aa0[_0x4e2b1b(0x149)]&&_0x582aa0[_0x4e2b1b(0x149)]!==_0x582aa0['name']?a52_0x1a2258['dim']('\x20<'+_0x582aa0[_0x4e2b1b(0x149)]+'>'):'';console[_0x4e2b1b(0x12d)](_0x4e2b1b(0x14c)+(_0x582aa0[_0x4e2b1b(0x148)]??_0x4e2b1b(0x13a))+_0x596f87+_0x286d22);}}return 0x0;}catch(_0x85b066){if(_0x85b066 instanceof SDKError)return console['error']('Error:\x20'+_0x85b066['message']),_0x85b066['cause']&&console[_0x4e2b1b(0x129)]('\x20\x20Cause:\x20'+_0x85b066[_0x4e2b1b(0x138)]),0x1;throw _0x85b066;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a53_0x315d13=a53_0x291b;(function(_0x10d437,_0xf8d571){const _0x5120d1=a53_0x291b,_0x3a0af2=_0x10d437();while(!![]){try{const _0x4fbde0=-parseInt(_0x5120d1(0x1fa))/0x1+-parseInt(_0x5120d1(0x1f7))/0x2+-parseInt(_0x5120d1(0x21f))/0x3+parseInt(_0x5120d1(0x1ec))/0x4+parseInt(_0x5120d1(0x21d))/0x5+parseInt(_0x5120d1(0x1fc))/0x6+-parseInt(_0x5120d1(0x208))/0x7;if(_0x4fbde0===_0xf8d571)break;else _0x3a0af2['push'](_0x3a0af2['shift']());}catch(_0x4f5269){_0x3a0af2['push'](_0x3a0af2['shift']());}}}(a53_0x204b,0xd5102));function a53_0x291b(_0x404950,_0x310db9){_0x404950=_0x404950-0x1d0;const _0x204b51=a53_0x204b();let _0x291b7f=_0x204b51[_0x404950];return _0x291b7f;}import{getChalk}from'../utils/colors.js';const chalk=getChalk();import{execFileSync}from'node:child_process';import a53_0x15fcdb from'node:path';import{WorkspaceSDK,resolveWorkspacePath,normalizeTags}from'../sdk/workspace/index.js';import{STATUS_PHASES,ALL_STATUSES}from'../sdk/types/workspace.js';function buildStaleFilter(_0x53736c){const _0x5597f0=a53_0x291b;if(_0x53736c[_0x5597f0(0x204)])return{'includeStale':!![]};if(_0x53736c['days'])return{'updatedWithin':parseInt(_0x53736c[_0x5597f0(0x20b)],0xa)};return undefined;}const VALID_KINDS=new Set([a53_0x315d13(0x1f6),a53_0x315d13(0x1d9),a53_0x315d13(0x1ee),a53_0x315d13(0x1f8),a53_0x315d13(0x228),a53_0x315d13(0x22d),'template']),VALID_PRIORITIES=new Set([a53_0x315d13(0x1e8),a53_0x315d13(0x239),a53_0x315d13(0x1de),'low']),VALID_STATUSES=new Set(ALL_STATUSES);function getSDK(){const _0x5974ce=a53_0x315d13,_0x40267d=resolveWorkspacePath();return!_0x40267d&&(console[_0x5974ce(0x22c)](chalk['red'](_0x5974ce(0x1eb))+_0x5974ce(0x233)+chalk[_0x5974ce(0x1d7)](_0x5974ce(0x1f0))+'\x20to\x20create\x20one,\x20or\x20navigate\x20to\x20a\x20directory\x20containing\x20tdx.json.'),process[_0x5974ce(0x1da)](0x1)),new WorkspaceSDK(_0x40267d);}function a53_0x204b(){const _0xd827c2=['slug','gray','Outgoing','.\x20Valid:\x20','white','\x20Run\x20','log','progress','todo','Document\x20not\x20found:\x20','assignee','high','moveTask','fileName','bold','split','createDocument','backlog','entries','done','cyan','priority','goal','exit','Invalid\x20priority:\x20','Goals','resolveWikiLinks','medium','basename','No\x20tasks\x20yet.\x20Create\x20one\x20with:\x20tdx\x20work\x20new\x20<title>','in_progress','frontmatter','blue','title','No\x20outgoing\x20wiki-links','trim','status','critical','Links\x20for:\x20','length','No\x20workspace\x20found.','2830476uAHXmI','goals','guide','displayText','tdx\x20work\x20init\x20<name>','getBacklinks','underline','void','magenta','initAt','item','222134WEaBuu','note','body','227028xEOtxJ','Invalid\x20kind:\x20','6110472kTruzv','round','has','github','Workspace:\x20','filePath','tags','Workspace\x20initialized\x20in\x20current\x20directory','all','Moved:','cwd','map','8945013jgWlOU','resolvedPath','Invalid\x20status:\x20','days','Created:','design_review','name','Failed\x20to\x20open\x20editor:\x20','Backlinks','dim','Tasks','low','\x20\x20←\x20','join','green','template','repeat','flatMap','readDocument','Wiki-links','resolvedKind','4022065IxvJLl','\x20→\x20','125352MfiYHy','\x20[[','getTasksByStatus','yellow','\x20\x20(empty)','red','kind','Linked\x20to\x20GitHub:\x20','taskCounts','reference','workspacePath','isArray','init','error','workflow'];a53_0x204b=function(){return _0xd827c2;};return a53_0x204b();}function priorityDot(_0x215456){const _0x211dbe=a53_0x315d13;switch(_0x215456){case _0x211dbe(0x1e8):return chalk[_0x211dbe(0x224)]('●');case _0x211dbe(0x239):return chalk[_0x211dbe(0x222)]('●');case'medium':return chalk[_0x211dbe(0x1e3)]('●');case _0x211dbe(0x213):return chalk[_0x211dbe(0x22f)]('●');default:return chalk[_0x211dbe(0x1e3)]('●');}}function statusColor(_0xd9116){const _0x80f1a3=a53_0x315d13;switch(_0xd9116){case _0x80f1a3(0x1d6):return chalk[_0x80f1a3(0x216)](_0xd9116);case _0x80f1a3(0x1f3):return chalk[_0x80f1a3(0x22f)](_0xd9116);case _0x80f1a3(0x1e1):return chalk[_0x80f1a3(0x1d7)](_0xd9116);case'review':return chalk[_0x80f1a3(0x1f4)](_0xd9116);case'planning':case _0x80f1a3(0x20d):return chalk[_0x80f1a3(0x222)](_0xd9116);case _0x80f1a3(0x236):return chalk[_0x80f1a3(0x232)](_0xd9116);case _0x80f1a3(0x1d4):return chalk[_0x80f1a3(0x211)](_0xd9116);default:return _0xd9116;}}export async function workSummaryAction(_0x4b7c80){const _0x4dd169=a53_0x315d13,_0x2946b6=getSDK(),_0x371c10=buildStaleFilter(_0x4b7c80),_0x25c9fb=_0x2946b6['getSummary'](_0x371c10);console[_0x4dd169(0x234)](chalk[_0x4dd169(0x1d1)](_0x4dd169(0x200)+_0x25c9fb[_0x4dd169(0x20e)])),console['log'](chalk[_0x4dd169(0x211)](_0x25c9fb['path'])),console[_0x4dd169(0x234)]();const _0xad9379=Object['values'](_0x25c9fb[_0x4dd169(0x227)])['reduce']((_0x44ea3e,_0x334d5f)=>_0x44ea3e+_0x334d5f,0x0);if(_0xad9379===0x0)console[_0x4dd169(0x234)](chalk[_0x4dd169(0x211)](_0x4dd169(0x1e0)));else{console[_0x4dd169(0x234)](chalk[_0x4dd169(0x1d1)](_0x4dd169(0x212)));for(const [_0x1c5083,_0x286160]of Object[_0x4dd169(0x1d5)](_0x25c9fb['taskCounts'])){_0x286160>0x0&&console[_0x4dd169(0x234)]('\x20\x20'+statusColor(_0x1c5083)+':\x20'+_0x286160);}console[_0x4dd169(0x234)]();}if(_0x25c9fb[_0x4dd169(0x1ed)]['length']>0x0){console[_0x4dd169(0x234)](chalk[_0x4dd169(0x1d1)](_0x4dd169(0x1dc)));for(const _0x456891 of _0x25c9fb[_0x4dd169(0x1ed)]){const _0x2387ea=progressBar(_0x456891[_0x4dd169(0x235)]);console[_0x4dd169(0x234)]('\x20\x20'+_0x456891[_0x4dd169(0x1e4)]+'\x20'+_0x2387ea+'\x20'+_0x456891[_0x4dd169(0x235)]+'%');}}}function progressBar(_0x1b90a3){const _0x19d86f=a53_0x315d13,_0xbe876e=0x14,_0x55e96c=Math[_0x19d86f(0x1fd)](_0x1b90a3/0x64*_0xbe876e),_0x225a32=_0xbe876e-_0x55e96c;return chalk[_0x19d86f(0x216)]('█'[_0x19d86f(0x218)](_0x55e96c))+chalk[_0x19d86f(0x211)]('░'[_0x19d86f(0x218)](_0x225a32));}export async function workInitAction(_0xc09e92,_0x55a05d){const _0x38fea6=a53_0x315d13,_0x455186=_0xc09e92||a53_0x15fcdb[_0x38fea6(0x1df)](process[_0x38fea6(0x206)]());if(_0x55a05d[_0x38fea6(0x1ff)]){const _0x5e50de=WorkspaceSDK[_0x38fea6(0x1f5)](_0x455186,{'github':_0x55a05d[_0x38fea6(0x1ff)]});console[_0x38fea6(0x234)](chalk[_0x38fea6(0x216)]('Workspace\x20initialized:')+'\x20'+_0x5e50de[_0x38fea6(0x229)]),console[_0x38fea6(0x234)](chalk[_0x38fea6(0x211)](_0x38fea6(0x226)+_0x55a05d[_0x38fea6(0x1ff)]));}else{if(_0xc09e92){const _0x3327c1=WorkspaceSDK['initAt'](_0xc09e92);console[_0x38fea6(0x234)](chalk['green']('Workspace\x20initialized:')+'\x20'+_0x3327c1[_0x38fea6(0x229)]);}else{const _0x4f9785=new WorkspaceSDK(process['cwd']());_0x4f9785[_0x38fea6(0x22b)](_0x455186),console[_0x38fea6(0x234)](chalk[_0x38fea6(0x216)](_0x38fea6(0x203)));}}}export async function workNewAction(_0x2be3d1,_0x53dcae){const _0xed8885=a53_0x315d13,_0x39ae1c=getSDK(),_0x1f595a=_0x53dcae[_0xed8885(0x225)]||_0xed8885(0x1f6);!VALID_KINDS[_0xed8885(0x1fe)](_0x1f595a)&&(console['error'](chalk[_0xed8885(0x224)](_0xed8885(0x1fb)+_0x1f595a+_0xed8885(0x231)+[...VALID_KINDS][_0xed8885(0x215)](',\x20'))),process[_0xed8885(0x1da)](0x1));_0x53dcae['priority']&&!VALID_PRIORITIES[_0xed8885(0x1fe)](_0x53dcae[_0xed8885(0x1d8)])&&(console[_0xed8885(0x22c)](chalk['red'](_0xed8885(0x1db)+_0x53dcae[_0xed8885(0x1d8)]+_0xed8885(0x231)+[...VALID_PRIORITIES][_0xed8885(0x215)](',\x20'))),process[_0xed8885(0x1da)](0x1));_0x53dcae[_0xed8885(0x1e7)]&&!VALID_STATUSES[_0xed8885(0x1fe)](_0x53dcae[_0xed8885(0x1e7)])&&(console['error'](chalk['red'](_0xed8885(0x20a)+_0x53dcae[_0xed8885(0x1e7)]+'.\x20Valid:\x20'+[...VALID_STATUSES][_0xed8885(0x215)](',\x20'))),process[_0xed8885(0x1da)](0x1));const _0x114072=_0x53dcae[_0xed8885(0x202)]?_0x53dcae['tags'][_0xed8885(0x1d2)](',')[_0xed8885(0x207)](_0x458471=>_0x458471[_0xed8885(0x1e6)]()):undefined,_0x54f481=_0x39ae1c[_0xed8885(0x1d3)]({'title':_0x2be3d1,'kind':_0x1f595a,'tags':_0x114072,'priority':_0x53dcae[_0xed8885(0x1d8)],'body':_0x53dcae[_0xed8885(0x1f9)],'template':_0x53dcae[_0xed8885(0x217)],'status':_0x53dcae['status'],'assignee':_0x53dcae[_0xed8885(0x238)]});console[_0xed8885(0x234)](chalk[_0xed8885(0x216)](_0xed8885(0x20c))+'\x20'+_0x54f481['fileName']),console[_0xed8885(0x234)](chalk[_0xed8885(0x211)](_0x54f481[_0xed8885(0x201)]));}export async function workMoveAction(_0x2c5619,_0x3217dd){const _0x3675a0=a53_0x315d13;!VALID_STATUSES[_0x3675a0(0x1fe)](_0x3217dd)&&(console['error'](chalk[_0x3675a0(0x224)](_0x3675a0(0x20a)+_0x3217dd+_0x3675a0(0x231)+[...VALID_STATUSES][_0x3675a0(0x215)](',\x20'))),process[_0x3675a0(0x1da)](0x1));const _0x4127b3=getSDK(),_0x5870eb=_0x4127b3[_0x3675a0(0x23a)](_0x2c5619,_0x3217dd);!_0x5870eb&&(console['error'](chalk[_0x3675a0(0x224)](_0x3675a0(0x237)+_0x2c5619)),process['exit'](0x1));const _0x463106=_0x5870eb[_0x3675a0(0x1e2)][_0x3675a0(0x1e4)]||_0x5870eb['fileName'];console['log'](chalk['green'](_0x3675a0(0x205))+('\x20'+_0x463106+_0x3675a0(0x21e)+statusColor(_0x3217dd)));}export async function workBoardAction(_0x618c2e){const _0x43433e=a53_0x315d13,_0x370218=getSDK(),_0x13dfb7=buildStaleFilter(_0x618c2e),{grouped:_0xf244df}=_0x370218[_0x43433e(0x221)](_0x13dfb7);for(const [_0x4e9e59,_0x5f29f7]of Object[_0x43433e(0x1d5)](STATUS_PHASES)){const _0x535933=_0x5f29f7[_0x43433e(0x219)](_0x3d6cbb=>_0xf244df[_0x3d6cbb]||[]);console['log'](chalk['bold'][_0x43433e(0x1f2)](_0x4e9e59)+chalk[_0x43433e(0x211)]('\x20('+_0x535933[_0x43433e(0x1ea)]+')'));if(_0x535933['length']===0x0)console['log'](chalk[_0x43433e(0x211)](_0x43433e(0x223)));else for(const _0x2bd3c7 of _0x535933){const _0x374133=_0x2bd3c7['frontmatter'],_0x26e817=priorityDot(_0x374133['priority']),_0x5e988f=_0x374133[_0x43433e(0x1e4)]||_0x2bd3c7[_0x43433e(0x1d0)],_0x15cd07=normalizeTags(_0x374133[_0x43433e(0x202)]),_0x2063de=_0x15cd07[_0x43433e(0x1ea)]?chalk['dim']('\x20['+_0x15cd07['join'](',\x20')+']'):'',_0x3bddda=chalk[_0x43433e(0x211)]('('+_0x374133[_0x43433e(0x1e7)]+')');console[_0x43433e(0x234)]('\x20\x20'+_0x26e817+'\x20'+_0x5e988f+'\x20'+_0x3bddda+_0x2063de);}console['log']();}}export async function workShowAction(_0xff5762){const _0x508efd=a53_0x315d13,_0x1db1a2=getSDK(),_0x18735c=_0x1db1a2[_0x508efd(0x21a)](_0xff5762);!_0x18735c&&(console[_0x508efd(0x22c)](chalk[_0x508efd(0x224)](_0x508efd(0x237)+_0xff5762)),process['exit'](0x1));console[_0x508efd(0x234)](chalk[_0x508efd(0x1d1)](_0x18735c['frontmatter'][_0x508efd(0x1e4)]||_0x18735c['fileName'])),console[_0x508efd(0x234)](chalk[_0x508efd(0x211)](_0x18735c[_0x508efd(0x201)])),console['log']();const _0x30c1a3=_0x18735c['frontmatter'];for(const [_0x4266e5,_0x9a0315]of Object[_0x508efd(0x1d5)](_0x30c1a3)){if(_0x4266e5===_0x508efd(0x1e4))continue;if(_0x9a0315===undefined||_0x9a0315===null)continue;const _0x305a9b=Array[_0x508efd(0x22a)](_0x9a0315)?_0x9a0315['join'](',\x20'):String(_0x9a0315);console['log']('\x20\x20'+chalk[_0x508efd(0x1d7)](_0x4266e5)+':\x20'+_0x305a9b);}console[_0x508efd(0x234)]();_0x18735c[_0x508efd(0x1f9)][_0x508efd(0x1e6)]()&&(console[_0x508efd(0x234)](_0x18735c['body']['trim']()),console[_0x508efd(0x234)]());const _0x2db776=_0x1db1a2['resolveWikiLinks'](_0x18735c[_0x508efd(0x1f9)]);if(_0x2db776[_0x508efd(0x1ea)]>0x0){console['log'](chalk['bold'](_0x508efd(0x21b)));for(const _0x3f8d60 of _0x2db776){const _0x5673a8=_0x3f8d60[_0x508efd(0x209)]?chalk[_0x508efd(0x216)]('✓'):chalk[_0x508efd(0x224)]('✗'),_0x45b163=_0x3f8d60[_0x508efd(0x1ef)]||_0x3f8d60[_0x508efd(0x22e)];console['log']('\x20\x20'+_0x5673a8+_0x508efd(0x220)+_0x45b163+']]');}console[_0x508efd(0x234)]();}const _0x32f914=_0x1db1a2[_0x508efd(0x1f1)](_0x18735c[_0x508efd(0x1d0)]);if(_0x32f914[_0x508efd(0x1ea)]>0x0){console[_0x508efd(0x234)](chalk[_0x508efd(0x1d1)](_0x508efd(0x210)));for(const _0x30a78b of _0x32f914){console[_0x508efd(0x234)](_0x508efd(0x214)+_0x30a78b['title']+'\x20'+chalk['dim']('('+_0x30a78b['kind']+')'));}}}export async function workLinksAction(_0x58ef8b){const _0x220c02=a53_0x315d13,_0x171c7b=getSDK(),_0x337d07=_0x171c7b[_0x220c02(0x21a)](_0x58ef8b);!_0x337d07&&(console['error'](chalk['red'](_0x220c02(0x237)+_0x58ef8b)),process['exit'](0x1));const _0x16eddc=_0x337d07[_0x220c02(0x1e2)][_0x220c02(0x1e4)]||_0x337d07[_0x220c02(0x1d0)];console['log'](chalk[_0x220c02(0x1d1)](_0x220c02(0x1e9)+_0x16eddc)),console[_0x220c02(0x234)]();const _0x2d3810=_0x171c7b[_0x220c02(0x1dd)](_0x337d07[_0x220c02(0x1f9)]);if(_0x2d3810[_0x220c02(0x1ea)]>0x0){console['log'](chalk[_0x220c02(0x1d1)](_0x220c02(0x230)));for(const _0x244a78 of _0x2d3810){const _0xa9b4ef=_0x244a78[_0x220c02(0x209)]?chalk['green']('✓'):chalk['red']('✗'),_0x437b87=_0x244a78[_0x220c02(0x1ef)]||_0x244a78[_0x220c02(0x22e)],_0x21926=_0x244a78['resolvedKind']?chalk['dim']('\x20('+_0x244a78[_0x220c02(0x21c)]+')'):'';console['log']('\x20\x20'+_0xa9b4ef+_0x220c02(0x220)+_0x437b87+']]'+_0x21926);}}else console[_0x220c02(0x234)](chalk[_0x220c02(0x211)](_0x220c02(0x1e5)));console[_0x220c02(0x234)]();const _0x7b3b88=_0x171c7b[_0x220c02(0x1f1)](_0x337d07[_0x220c02(0x1d0)]);if(_0x7b3b88[_0x220c02(0x1ea)]>0x0){console['log'](chalk[_0x220c02(0x1d1)]('Incoming'));for(const _0x505353 of _0x7b3b88){console[_0x220c02(0x234)](_0x220c02(0x214)+_0x505353['title']+'\x20'+chalk[_0x220c02(0x211)]('('+_0x505353[_0x220c02(0x225)]+')'));}}else console[_0x220c02(0x234)](chalk[_0x220c02(0x211)]('No\x20incoming\x20backlinks'));}export async function workOpenAction(_0x5bcc0d){const _0x13c2df=a53_0x315d13,_0x3aecb1=getSDK(),_0x5e826c=_0x3aecb1[_0x13c2df(0x21a)](_0x5bcc0d);!_0x5e826c&&(console[_0x13c2df(0x22c)](chalk[_0x13c2df(0x224)](_0x13c2df(0x237)+_0x5bcc0d)),process['exit'](0x1));const _0x4b9c57=process.env.EDITOR||'vi';try{execFileSync(_0x4b9c57,[_0x5e826c[_0x13c2df(0x201)]],{'stdio':'inherit'});}catch{console[_0x13c2df(0x22c)](chalk[_0x13c2df(0x224)](_0x13c2df(0x20f)+_0x4b9c57)),process[_0x13c2df(0x1da)](0x1);}}
|
|
1
|
+
const a53_0x57c7d6=a53_0x51d5;(function(_0x21a875,_0x4ea3f9){const _0x6ae8f0=a53_0x51d5,_0x2ab0ab=_0x21a875();while(!![]){try{const _0x400008=-parseInt(_0x6ae8f0(0x222))/0x1*(parseInt(_0x6ae8f0(0x209))/0x2)+parseInt(_0x6ae8f0(0x22c))/0x3*(-parseInt(_0x6ae8f0(0x21a))/0x4)+-parseInt(_0x6ae8f0(0x246))/0x5*(-parseInt(_0x6ae8f0(0x23d))/0x6)+-parseInt(_0x6ae8f0(0x227))/0x7+parseInt(_0x6ae8f0(0x233))/0x8*(-parseInt(_0x6ae8f0(0x1ea))/0x9)+parseInt(_0x6ae8f0(0x21c))/0xa+parseInt(_0x6ae8f0(0x20f))/0xb;if(_0x400008===_0x4ea3f9)break;else _0x2ab0ab['push'](_0x2ab0ab['shift']());}catch(_0xce770){_0x2ab0ab['push'](_0x2ab0ab['shift']());}}}(a53_0x5596,0x4341c));import{getChalk}from'../utils/colors.js';const chalk=getChalk();import{execFileSync}from'node:child_process';import a53_0x2226ff from'node:path';import{WorkspaceSDK,resolveWorkspacePath,normalizeTags}from'../sdk/workspace/index.js';function a53_0x5596(){const _0x413bae=['workflow','reference','entries','magenta','Invalid\x20priority:\x20','github','map','bold','7386HSYgWg','Workspace\x20initialized:','\x20to\x20create\x20one,\x20or\x20navigate\x20to\x20a\x20directory\x20containing\x20tdx.json.','blue','red','error','repeat','critical','reduce','395AGbIjs','todo','taskCounts','Created:','flatMap','done','length','isArray','high','slug','3702249TWaqMI','priority','Links\x20for:\x20','getTasksByStatus','cyan','filePath','has','No\x20tasks\x20yet.\x20Create\x20one\x20with:\x20tdx\x20work\x20new\x20<title>','Incoming','Document\x20not\x20found:\x20','low','.\x20Valid:\x20','gray','path','\x20Run\x20','Workspace\x20initialized\x20in\x20current\x20directory','Invalid\x20status:\x20','white','yellow','initAt','Linked\x20to\x20GitHub:\x20','body','trim','frontmatter','goals','inherit','all','cwd','Goals','resolvedKind','join','94892ZfEwnV','\x20[[','createDocument','assignee','displayText','getBacklinks','6498965pGoyNP','medium','No\x20incoming\x20backlinks','status','tags','goal','kind','name','underline','resolvedPath','split','15692XbWjEx','backlog','4340560rmCADz','exit','review','Moved:','green','readDocument','2dcwYxA','fileName','Invalid\x20kind:\x20','dim','log','1339163kJnpVw','item','Outgoing','resolveWikiLinks','Tasks','114yCAwJy','title','planning','days','basename','Failed\x20to\x20open\x20editor:\x20','\x20\x20←\x20','8QadNsa','workspacePath'];a53_0x5596=function(){return _0x413bae;};return a53_0x5596();}import{STATUS_PHASES,ALL_STATUSES}from'../sdk/types/workspace.js';function buildStaleFilter(_0x3d2ffa){const _0x19f0a8=a53_0x51d5;if(_0x3d2ffa[_0x19f0a8(0x204)])return{'includeStale':!![]};if(_0x3d2ffa['days'])return{'updatedWithin':parseInt(_0x3d2ffa[_0x19f0a8(0x22f)],0xa)};return undefined;}const VALID_KINDS=new Set([a53_0x57c7d6(0x228),a53_0x57c7d6(0x214),'guide','note',a53_0x57c7d6(0x236),a53_0x57c7d6(0x235),'template']),VALID_PRIORITIES=new Set([a53_0x57c7d6(0x244),a53_0x57c7d6(0x1e8),'medium',a53_0x57c7d6(0x1f4)]),VALID_STATUSES=new Set(ALL_STATUSES);function getSDK(){const _0x23cae4=a53_0x57c7d6,_0x565a91=resolveWorkspacePath();return!_0x565a91&&(console[_0x23cae4(0x242)](chalk[_0x23cae4(0x241)]('No\x20workspace\x20found.')+_0x23cae4(0x1f8)+chalk[_0x23cae4(0x1ee)]('tdx\x20work\x20init\x20<name>')+_0x23cae4(0x23f)),process[_0x23cae4(0x21d)](0x1)),new WorkspaceSDK(_0x565a91);}function priorityDot(_0x2b3275){const _0x500cb3=a53_0x57c7d6;switch(_0x2b3275){case'critical':return chalk[_0x500cb3(0x241)]('●');case _0x500cb3(0x1e8):return chalk['yellow']('●');case _0x500cb3(0x210):return chalk[_0x500cb3(0x240)]('●');case'low':return chalk[_0x500cb3(0x1f6)]('●');default:return chalk[_0x500cb3(0x240)]('●');}}function statusColor(_0x2eec41){const _0x123530=a53_0x57c7d6;switch(_0x2eec41){case _0x123530(0x1e5):return chalk[_0x123530(0x220)](_0x2eec41);case'void':return chalk[_0x123530(0x1f6)](_0x2eec41);case'in_progress':return chalk[_0x123530(0x1ee)](_0x2eec41);case _0x123530(0x21e):return chalk[_0x123530(0x238)](_0x2eec41);case _0x123530(0x22e):case'design_review':return chalk[_0x123530(0x1fc)](_0x2eec41);case _0x123530(0x247):return chalk[_0x123530(0x1fb)](_0x2eec41);case _0x123530(0x21b):return chalk['dim'](_0x2eec41);default:return _0x2eec41;}}export async function workSummaryAction(_0x2a6da6){const _0x3f655e=a53_0x57c7d6,_0x2f6709=getSDK(),_0x12d547=buildStaleFilter(_0x2a6da6),_0x5966b1=_0x2f6709['getSummary'](_0x12d547);console[_0x3f655e(0x226)](chalk[_0x3f655e(0x23c)]('Workspace:\x20'+_0x5966b1[_0x3f655e(0x216)])),console[_0x3f655e(0x226)](chalk['dim'](_0x5966b1[_0x3f655e(0x1f7)])),console[_0x3f655e(0x226)]();const _0x244d7d=Object['values'](_0x5966b1[_0x3f655e(0x248)])[_0x3f655e(0x245)]((_0x575d8f,_0x4ff739)=>_0x575d8f+_0x4ff739,0x0);if(_0x244d7d===0x0)console[_0x3f655e(0x226)](chalk[_0x3f655e(0x225)](_0x3f655e(0x1f1)));else{console[_0x3f655e(0x226)](chalk[_0x3f655e(0x23c)](_0x3f655e(0x22b)));for(const [_0x50b38e,_0x366a07]of Object[_0x3f655e(0x237)](_0x5966b1[_0x3f655e(0x248)])){_0x366a07>0x0&&console['log']('\x20\x20'+statusColor(_0x50b38e)+':\x20'+_0x366a07);}console[_0x3f655e(0x226)]();}if(_0x5966b1[_0x3f655e(0x202)][_0x3f655e(0x1e6)]>0x0){console['log'](chalk[_0x3f655e(0x23c)](_0x3f655e(0x206)));for(const _0x38c7dd of _0x5966b1[_0x3f655e(0x202)]){const _0x253e33=progressBar(_0x38c7dd['progress']);console[_0x3f655e(0x226)]('\x20\x20'+_0x38c7dd[_0x3f655e(0x22d)]+'\x20'+_0x253e33+'\x20'+_0x38c7dd['progress']+'%');}}}function progressBar(_0x51eaa2){const _0x3ff745=a53_0x57c7d6,_0x1336df=0x14,_0xf38b79=Math['round'](_0x51eaa2/0x64*_0x1336df),_0x1f8531=_0x1336df-_0xf38b79;return chalk[_0x3ff745(0x220)]('█'[_0x3ff745(0x243)](_0xf38b79))+chalk['dim']('░'[_0x3ff745(0x243)](_0x1f8531));}export async function workInitAction(_0xe0bf70,_0xc1f82e){const _0x1b9ccd=a53_0x57c7d6,_0x47bf6e=_0xe0bf70||a53_0x2226ff[_0x1b9ccd(0x230)](process[_0x1b9ccd(0x205)]());if(_0xc1f82e[_0x1b9ccd(0x23a)]){const _0x9ec85d=WorkspaceSDK[_0x1b9ccd(0x1fd)](_0x47bf6e,{'github':_0xc1f82e[_0x1b9ccd(0x23a)]});console[_0x1b9ccd(0x226)](chalk[_0x1b9ccd(0x220)]('Workspace\x20initialized:')+'\x20'+_0x9ec85d[_0x1b9ccd(0x234)]),console[_0x1b9ccd(0x226)](chalk[_0x1b9ccd(0x225)](_0x1b9ccd(0x1fe)+_0xc1f82e['github']));}else{if(_0xe0bf70){const _0x293b4a=WorkspaceSDK[_0x1b9ccd(0x1fd)](_0xe0bf70);console[_0x1b9ccd(0x226)](chalk[_0x1b9ccd(0x220)](_0x1b9ccd(0x23e))+'\x20'+_0x293b4a['workspacePath']);}else{const _0x511d25=new WorkspaceSDK(process['cwd']());_0x511d25['init'](_0x47bf6e),console[_0x1b9ccd(0x226)](chalk[_0x1b9ccd(0x220)](_0x1b9ccd(0x1f9)));}}}export async function workNewAction(_0x276889,_0x3d2f7){const _0x589d05=a53_0x57c7d6,_0x2cfa8b=getSDK(),_0x579afe=_0x3d2f7[_0x589d05(0x215)]||'item';!VALID_KINDS['has'](_0x579afe)&&(console[_0x589d05(0x242)](chalk[_0x589d05(0x241)](_0x589d05(0x224)+_0x579afe+_0x589d05(0x1f5)+[...VALID_KINDS][_0x589d05(0x208)](',\x20'))),process[_0x589d05(0x21d)](0x1));_0x3d2f7['priority']&&!VALID_PRIORITIES[_0x589d05(0x1f0)](_0x3d2f7[_0x589d05(0x1eb)])&&(console['error'](chalk[_0x589d05(0x241)](_0x589d05(0x239)+_0x3d2f7[_0x589d05(0x1eb)]+'.\x20Valid:\x20'+[...VALID_PRIORITIES][_0x589d05(0x208)](',\x20'))),process[_0x589d05(0x21d)](0x1));_0x3d2f7[_0x589d05(0x212)]&&!VALID_STATUSES[_0x589d05(0x1f0)](_0x3d2f7[_0x589d05(0x212)])&&(console[_0x589d05(0x242)](chalk[_0x589d05(0x241)]('Invalid\x20status:\x20'+_0x3d2f7[_0x589d05(0x212)]+'.\x20Valid:\x20'+[...VALID_STATUSES][_0x589d05(0x208)](',\x20'))),process[_0x589d05(0x21d)](0x1));const _0x2f5409=_0x3d2f7[_0x589d05(0x213)]?_0x3d2f7[_0x589d05(0x213)][_0x589d05(0x219)](',')[_0x589d05(0x23b)](_0x412d0b=>_0x412d0b[_0x589d05(0x200)]()):undefined,_0xc91e36=_0x2cfa8b[_0x589d05(0x20b)]({'title':_0x276889,'kind':_0x579afe,'tags':_0x2f5409,'priority':_0x3d2f7[_0x589d05(0x1eb)],'body':_0x3d2f7[_0x589d05(0x1ff)],'template':_0x3d2f7['template'],'status':_0x3d2f7[_0x589d05(0x212)],'assignee':_0x3d2f7[_0x589d05(0x20c)]});console[_0x589d05(0x226)](chalk[_0x589d05(0x220)](_0x589d05(0x249))+'\x20'+_0xc91e36[_0x589d05(0x223)]),console['log'](chalk['dim'](_0xc91e36[_0x589d05(0x1ef)]));}function a53_0x51d5(_0x19a008,_0x18bcaf){_0x19a008=_0x19a008-0x1e4;const _0x5596cf=a53_0x5596();let _0x51d5b8=_0x5596cf[_0x19a008];return _0x51d5b8;}export async function workMoveAction(_0x3ec55c,_0x4449d7){const _0x2c39bc=a53_0x57c7d6;!VALID_STATUSES[_0x2c39bc(0x1f0)](_0x4449d7)&&(console[_0x2c39bc(0x242)](chalk[_0x2c39bc(0x241)](_0x2c39bc(0x1fa)+_0x4449d7+_0x2c39bc(0x1f5)+[...VALID_STATUSES]['join'](',\x20'))),process[_0x2c39bc(0x21d)](0x1));const _0x55283e=getSDK(),_0x57b66f=_0x55283e['moveTask'](_0x3ec55c,_0x4449d7);!_0x57b66f&&(console[_0x2c39bc(0x242)](chalk['red'](_0x2c39bc(0x1f3)+_0x3ec55c)),process[_0x2c39bc(0x21d)](0x1));const _0x986185=_0x57b66f[_0x2c39bc(0x201)][_0x2c39bc(0x22d)]||_0x57b66f[_0x2c39bc(0x223)];console[_0x2c39bc(0x226)](chalk[_0x2c39bc(0x220)](_0x2c39bc(0x21f))+('\x20'+_0x986185+'\x20→\x20'+statusColor(_0x4449d7)));}export async function workBoardAction(_0x308f07){const _0x29bbf4=a53_0x57c7d6,_0xb55476=getSDK(),_0x3d5e29=buildStaleFilter(_0x308f07),{grouped:_0x53ab4c}=_0xb55476[_0x29bbf4(0x1ed)](_0x3d5e29);for(const [_0x13668b,_0x59c1d5]of Object[_0x29bbf4(0x237)](STATUS_PHASES)){const _0xc50e91=_0x59c1d5[_0x29bbf4(0x1e4)](_0x19082d=>_0x53ab4c[_0x19082d]||[]);console['log'](chalk[_0x29bbf4(0x23c)][_0x29bbf4(0x217)](_0x13668b)+chalk[_0x29bbf4(0x225)]('\x20('+_0xc50e91['length']+')'));if(_0xc50e91[_0x29bbf4(0x1e6)]===0x0)console['log'](chalk[_0x29bbf4(0x225)]('\x20\x20(empty)'));else for(const _0x4fd11f of _0xc50e91){const _0x31f185=_0x4fd11f['frontmatter'],_0x15ae0c=priorityDot(_0x31f185['priority']),_0xb08d48=_0x31f185[_0x29bbf4(0x22d)]||_0x4fd11f[_0x29bbf4(0x223)],_0xabbfe0=normalizeTags(_0x31f185['tags']),_0x1576b9=_0xabbfe0[_0x29bbf4(0x1e6)]?chalk['dim']('\x20['+_0xabbfe0['join'](',\x20')+']'):'',_0x4d4a96=chalk['dim']('('+_0x31f185['status']+')');console[_0x29bbf4(0x226)]('\x20\x20'+_0x15ae0c+'\x20'+_0xb08d48+'\x20'+_0x4d4a96+_0x1576b9);}console['log']();}}export async function workShowAction(_0x3cf782){const _0x29c6fc=a53_0x57c7d6,_0x56df8d=getSDK(),_0x33110d=_0x56df8d[_0x29c6fc(0x221)](_0x3cf782);!_0x33110d&&(console[_0x29c6fc(0x242)](chalk[_0x29c6fc(0x241)](_0x29c6fc(0x1f3)+_0x3cf782)),process[_0x29c6fc(0x21d)](0x1));console[_0x29c6fc(0x226)](chalk[_0x29c6fc(0x23c)](_0x33110d['frontmatter'][_0x29c6fc(0x22d)]||_0x33110d['fileName'])),console['log'](chalk[_0x29c6fc(0x225)](_0x33110d[_0x29c6fc(0x1ef)])),console[_0x29c6fc(0x226)]();const _0x9a37ac=_0x33110d['frontmatter'];for(const [_0x4c9582,_0x1bcd51]of Object[_0x29c6fc(0x237)](_0x9a37ac)){if(_0x4c9582===_0x29c6fc(0x22d))continue;if(_0x1bcd51===undefined||_0x1bcd51===null)continue;const _0x385575=Array[_0x29c6fc(0x1e7)](_0x1bcd51)?_0x1bcd51[_0x29c6fc(0x208)](',\x20'):String(_0x1bcd51);console[_0x29c6fc(0x226)]('\x20\x20'+chalk[_0x29c6fc(0x1ee)](_0x4c9582)+':\x20'+_0x385575);}console[_0x29c6fc(0x226)]();_0x33110d['body'][_0x29c6fc(0x200)]()&&(console['log'](_0x33110d[_0x29c6fc(0x1ff)][_0x29c6fc(0x200)]()),console[_0x29c6fc(0x226)]());const _0x3ea995=_0x56df8d[_0x29c6fc(0x22a)](_0x33110d['body']);if(_0x3ea995[_0x29c6fc(0x1e6)]>0x0){console[_0x29c6fc(0x226)](chalk[_0x29c6fc(0x23c)]('Wiki-links'));for(const _0x1401bf of _0x3ea995){const _0x48cb0d=_0x1401bf[_0x29c6fc(0x218)]?chalk[_0x29c6fc(0x220)]('✓'):chalk['red']('✗'),_0x84acfd=_0x1401bf[_0x29c6fc(0x20d)]||_0x1401bf[_0x29c6fc(0x1e9)];console[_0x29c6fc(0x226)]('\x20\x20'+_0x48cb0d+_0x29c6fc(0x20a)+_0x84acfd+']]');}console[_0x29c6fc(0x226)]();}const _0x475713=_0x56df8d[_0x29c6fc(0x20e)](_0x33110d[_0x29c6fc(0x223)]);if(_0x475713[_0x29c6fc(0x1e6)]>0x0){console['log'](chalk[_0x29c6fc(0x23c)]('Backlinks'));for(const _0x3072c9 of _0x475713){console['log'](_0x29c6fc(0x232)+_0x3072c9[_0x29c6fc(0x22d)]+'\x20'+chalk['dim']('('+_0x3072c9['kind']+')'));}}}export async function workLinksAction(_0x47578a){const _0x2f3319=a53_0x57c7d6,_0x13a2ca=getSDK(),_0x37e35c=_0x13a2ca[_0x2f3319(0x221)](_0x47578a);!_0x37e35c&&(console['error'](chalk['red'](_0x2f3319(0x1f3)+_0x47578a)),process[_0x2f3319(0x21d)](0x1));const _0x118e36=_0x37e35c[_0x2f3319(0x201)][_0x2f3319(0x22d)]||_0x37e35c[_0x2f3319(0x223)];console[_0x2f3319(0x226)](chalk[_0x2f3319(0x23c)](_0x2f3319(0x1ec)+_0x118e36)),console['log']();const _0x2f7cc4=_0x13a2ca[_0x2f3319(0x22a)](_0x37e35c[_0x2f3319(0x1ff)]);if(_0x2f7cc4[_0x2f3319(0x1e6)]>0x0){console[_0x2f3319(0x226)](chalk[_0x2f3319(0x23c)](_0x2f3319(0x229)));for(const _0x168c8f of _0x2f7cc4){const _0x25d531=_0x168c8f[_0x2f3319(0x218)]?chalk[_0x2f3319(0x220)]('✓'):chalk['red']('✗'),_0x17b11d=_0x168c8f[_0x2f3319(0x20d)]||_0x168c8f[_0x2f3319(0x1e9)],_0x4019e4=_0x168c8f[_0x2f3319(0x207)]?chalk[_0x2f3319(0x225)]('\x20('+_0x168c8f['resolvedKind']+')'):'';console[_0x2f3319(0x226)]('\x20\x20'+_0x25d531+'\x20[['+_0x17b11d+']]'+_0x4019e4);}}else console[_0x2f3319(0x226)](chalk['dim']('No\x20outgoing\x20wiki-links'));console[_0x2f3319(0x226)]();const _0x3787c0=_0x13a2ca[_0x2f3319(0x20e)](_0x37e35c[_0x2f3319(0x223)]);if(_0x3787c0[_0x2f3319(0x1e6)]>0x0){console['log'](chalk[_0x2f3319(0x23c)](_0x2f3319(0x1f2)));for(const _0x443695 of _0x3787c0){console[_0x2f3319(0x226)](_0x2f3319(0x232)+_0x443695[_0x2f3319(0x22d)]+'\x20'+chalk[_0x2f3319(0x225)]('('+_0x443695[_0x2f3319(0x215)]+')'));}}else console['log'](chalk[_0x2f3319(0x225)](_0x2f3319(0x211)));}export async function workOpenAction(_0xdc5ec5){const _0xef1486=a53_0x57c7d6,_0x97456c=getSDK(),_0x149476=_0x97456c[_0xef1486(0x221)](_0xdc5ec5);!_0x149476&&(console[_0xef1486(0x242)](chalk[_0xef1486(0x241)](_0xef1486(0x1f3)+_0xdc5ec5)),process['exit'](0x1));const _0x48d36c=process.env.EDITOR||'vi';try{execFileSync(_0x48d36c,[_0x149476[_0xef1486(0x1ef)]],{'stdio':_0xef1486(0x203)});}catch{console[_0xef1486(0x242)](chalk[_0xef1486(0x241)](_0xef1486(0x231)+_0x48d36c)),process[_0xef1486(0x21d)](0x1);}}
|