@treasuredata/tdx 2026.4.11 → 2026.4.13
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.d.ts +1 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +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.d.ts +6 -0
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +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.d.ts +2 -0
- package/dist/sdk/types/workspace.d.ts.map +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.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.d.ts.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/templates.js.map +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_0x4be63a=a48_0x27ca;(function(_0x494aca,_0x450575){const _0x51baac=a48_0x27ca,_0x3af042=_0x494aca();while(!![]){try{const _0x42baa2=parseInt(_0x51baac(0x8a))/0x1+parseInt(_0x51baac(0x8f))/0x2+-parseInt(_0x51baac(0x6e))/0x3*(parseInt(_0x51baac(0x72))/0x4)+-parseInt(_0x51baac(0x8d))/0x5+parseInt(_0x51baac(0x73))/0x6+parseInt(_0x51baac(0x8e))/0x7+parseInt(_0x51baac(0x96))/0x8*(-parseInt(_0x51baac(0x92))/0x9);if(_0x42baa2===_0x450575)break;else _0x3af042['push'](_0x3af042['shift']());}catch(_0x59053b){_0x3af042['push'](_0x3af042['shift']());}}}(a48_0x4c0a,0xd952b));function a48_0x27ca(_0x5076e7,_0x15d7b5){_0x5076e7=_0x5076e7-0x6a;const _0x4c0a00=a48_0x4c0a();let _0x27ca8c=_0x4c0a00[_0x5076e7];return _0x27ca8c;}function a48_0x4c0a(){const _0x35b79e=['1223110dOyldL','1966976LslxAu','includes','Database\x20pattern:\x20','549qMfmtS','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','\x20\x20Cause:\x20','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','10408SrRlbE','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','site','✖\x20No\x20tables\x20found','database_name','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','\x20table','39UPpIzW','verbose','table_name','tables','272516hYGJvG','7064628yVaRkg','database','limit','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','listTables','Error:\x20Pattern\x20\x27','Database:\x20all','Database:\x20','📋\x20','message','Listing\x20tables...','table','error','validate','Error:\x20','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','cause','\x27\x20is\x20ambiguous.','query','Or\x20use\x20--in\x20flag:','.*\x22','Note:\x20\x27','584347FgEXBw','data','length','5324050ksbFje'];a48_0x4c0a=function(){return _0x35b79e;};return a48_0x4c0a();}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';export class TablesCommand extends BaseCommand{['name']=a48_0x4be63a(0x71);['description']='List\x20tables\x20in\x20a\x20database';async['execute'](_0x1964bb){const _0x5d7f1c=a48_0x4be63a,{options:_0x485100,args:_0x1f55a8,tdx:_0x117274}=_0x1964bb;let _0x462388;if(_0x1f55a8['length']===0x0)_0x462388={'database':undefined,'table':undefined,'original':''};else{if(_0x1f55a8[_0x5d7f1c(0x8c)]===0x1)try{_0x462388=parseTableReference(_0x1f55a8[0x0]);if(_0x462388[_0x5d7f1c(0x7e)]&&!_0x462388['database']&&!_0x462388[_0x5d7f1c(0x7e)][_0x5d7f1c(0x90)]('*')&&!_0x462388[_0x5d7f1c(0x7e)][_0x5d7f1c(0x90)]('?'))return console[_0x5d7f1c(0x7f)](_0x5d7f1c(0x78)+_0x1f55a8[0x0]+_0x5d7f1c(0x85)),console[_0x5d7f1c(0x7f)](_0x5d7f1c(0x76)+_0x462388['table']+'\x27?'),console[_0x5d7f1c(0x7f)](_0x5d7f1c(0x82)+_0x462388[_0x5d7f1c(0x7e)]+_0x5d7f1c(0x88)),console['error'](_0x5d7f1c(0x97)+_0x462388[_0x5d7f1c(0x7e)]),console['error']('\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20'+_0x462388[_0x5d7f1c(0x7e)]),console[_0x5d7f1c(0x7f)](''),console[_0x5d7f1c(0x7f)](_0x5d7f1c(0x89)+_0x1f55a8[0x0]+_0x5d7f1c(0x6c)+_0x462388[_0x5d7f1c(0x7e)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x4e3324){return console[_0x5d7f1c(0x7f)]('Error:\x20'+_0x4e3324[_0x5d7f1c(0x7c)]),0x1;}else return console['error']('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console['error']('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console['error']('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console['error'](_0x5d7f1c(0x93)),console[_0x5d7f1c(0x7f)](_0x5d7f1c(0x83)),console[_0x5d7f1c(0x7f)](_0x5d7f1c(0x87)),console[_0x5d7f1c(0x7f)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0xdfa884=_0x485100[_0x5d7f1c(0x74)];!_0x462388[_0x5d7f1c(0x74)]&&_0xdfa884&&(_0x462388[_0x5d7f1c(0x74)]=_0xdfa884);try{const _0x1c0739=_0x4dd25c=>_0x4dd25c&&(_0x4dd25c[_0x5d7f1c(0x90)]('*')||_0x4dd25c['includes']('?')),_0x550549=_0x1c0739(_0x462388['database']);_0x485100[_0x5d7f1c(0x6f)]&&(console[_0x5d7f1c(0x7f)]('Site:\x20'+_0x485100[_0x5d7f1c(0x98)]),_0x462388[_0x5d7f1c(0x74)]?_0x550549?console[_0x5d7f1c(0x7f)](_0x5d7f1c(0x91)+_0x462388['database']):console[_0x5d7f1c(0x7f)](_0x5d7f1c(0x7a)+_0x462388[_0x5d7f1c(0x74)]):console[_0x5d7f1c(0x7f)](_0x5d7f1c(0x79)),_0x462388[_0x5d7f1c(0x7e)]&&console[_0x5d7f1c(0x7f)]('Table\x20pattern:\x20'+_0x462388[_0x5d7f1c(0x7e)]));const _0x28eba8=_0x462388[_0x5d7f1c(0x74)]&&!_0x550549?_0x462388['database']:undefined,_0xe21f26=_0x550549?_0x462388[_0x5d7f1c(0x74)]:undefined,_0x3bbc72=_0x462388['table'],_0xc932e6=resolveLimit(_0x485100[_0x5d7f1c(0x75)],DEFAULT_LISTING_LIMIT),_0x42cb8c=await withSpinner(_0x5d7f1c(0x7d),()=>_0x117274[_0x5d7f1c(0x86)][_0x5d7f1c(0x77)](_0x28eba8,_0x3bbc72,_0xe21f26,_0xc932e6),{'verbose':_0x485100[_0x5d7f1c(0x6f)]}),_0x2aee40=_0x42cb8c[_0x5d7f1c(0x8b)];if(_0x2aee40[_0x5d7f1c(0x8c)]===0x0&&_0x462388[_0x5d7f1c(0x74)]&&!_0x550549)return console[_0x5d7f1c(0x7f)](_0x5d7f1c(0x6a)),console[_0x5d7f1c(0x7f)]('Database\x20\x27'+_0x462388['database']+_0x5d7f1c(0x95)),0x1;console['error']('✔\x20Found\x20'+_0x2aee40['length']+_0x5d7f1c(0x6d)+(_0x2aee40['length']!==0x1?'s':''));if(isStructuredFormat(_0x485100))await handleSDKOutput(_0x2aee40,{..._0x485100,'limit':_0xc932e6});else for(const _0x547c6c of _0x2aee40){const _0x3e02a3=_0x547c6c[_0x5d7f1c(0x6b)]?_0x547c6c['database_name']+'.':'';console['log'](_0x5d7f1c(0x7b)+_0x3e02a3+_0x547c6c[_0x5d7f1c(0x70)]);}return 0x0;}catch(_0x3e2a03){if(_0x3e2a03 instanceof SDKError)return console[_0x5d7f1c(0x7f)](_0x5d7f1c(0x81)+_0x3e2a03[_0x5d7f1c(0x7c)]),_0x3e2a03['cause']&&console[_0x5d7f1c(0x7f)](_0x5d7f1c(0x94)+_0x3e2a03[_0x5d7f1c(0x84)]),0x1;throw _0x3e2a03;}}[a48_0x4be63a(0x80)](_0x12a4c6){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a49_0x19ab(_0x5d22c6,_0x15ab87){_0x5d22c6=_0x5d22c6-0x16c;const _0x2439c6=a49_0x2439();let _0x19ab75=_0x2439c6[_0x5d22c6];return _0x19ab75;}const a49_0x135b79=a49_0x19ab;(function(_0x510fa1,_0x4b93e5){const _0x2cb64c=a49_0x19ab,_0x32a9a8=_0x510fa1();while(!![]){try{const _0x43f4cc=-parseInt(_0x2cb64c(0x177))/0x1*(-parseInt(_0x2cb64c(0x194))/0x2)+parseInt(_0x2cb64c(0x18b))/0x3*(parseInt(_0x2cb64c(0x183))/0x4)+-parseInt(_0x2cb64c(0x193))/0x5+parseInt(_0x2cb64c(0x176))/0x6+-parseInt(_0x2cb64c(0x184))/0x7+parseInt(_0x2cb64c(0x174))/0x8*(-parseInt(_0x2cb64c(0x16e))/0x9)+-parseInt(_0x2cb64c(0x190))/0xa*(-parseInt(_0x2cb64c(0x195))/0xb);if(_0x43f4cc===_0x4b93e5)break;else _0x32a9a8['push'](_0x32a9a8['shift']());}catch(_0x50632c){_0x32a9a8['push'](_0x32a9a8['shift']());}}}(a49_0x2439,0x5d724));import{BaseCommand}from'./command.js';import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';function a49_0x2439(){const _0xaf73a8=['green','parent_segment','680Xdcorn','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','2033406yKCDwI','114574FubECo','join','agent','profile','(session:\x20','site','Default\x20site\x20','composable_audience','cas','engage_workspace','cleared','Default\x20profile\x20','8yPhmUf','1414742PdUCtl','Invalid\x20resource:\x20','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20cas\x0a','Error:\x20','\x0aUpdated:\x20','description','log','862377uctykR','dim','database','execute','Clear\x20session-level\x20or\x20default\x20context\x20values','300hRkHTk','.\x20Must\x20be\x20one\x20of:\x20','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','2601400eGSJAU','4VXepGE','144551nayACy','message','tdx.json','45747DUBjBO','error','llm_project','session'];a49_0x2439=function(){return _0xaf73a8;};return a49_0x2439();}import{getConfigDir}from'../core/config.js';import a49_0x56b596 from'chalk';import*as a49_0x548a41 from'node:path';export class UnsetCommand extends BaseCommand{['name']='unset';[a49_0x135b79(0x189)]=a49_0x135b79(0x18f);['validate'](_0x256c72){const _0x2ac51a=a49_0x135b79,{args:_0x5ba2e7,options:_0x392cdc}=_0x256c72,_0x185982=_0x392cdc['default'];if(_0x5ba2e7['length']===0x0)return'Usage:\x20tdx\x20unset\x20<resource>\x0a'+_0x2ac51a(0x175)+_0x2ac51a(0x186)+_0x2ac51a(0x192);const _0x291cf4=_0x5ba2e7[0x0],_0x103a5c=[_0x2ac51a(0x17c),_0x2ac51a(0x18d),_0x2ac51a(0x173),_0x2ac51a(0x170),_0x2ac51a(0x179),_0x2ac51a(0x17a),'engage_workspace',_0x2ac51a(0x17f),_0x2ac51a(0x17e)];if(!_0x103a5c['includes'](_0x291cf4))return _0x2ac51a(0x185)+_0x291cf4+_0x2ac51a(0x191)+_0x103a5c[_0x2ac51a(0x178)](',\x20');if(_0x185982&&_0x291cf4!==_0x2ac51a(0x17c)&&_0x291cf4!==_0x2ac51a(0x17a))return'--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.';return undefined;}async[a49_0x135b79(0x18e)](_0x599aaf){const _0x1356e9=a49_0x135b79,{args:_0x5a90df,options:_0x43e2fb}=_0x599aaf,_0x4647ae=_0x43e2fb['default'];cleanExpiredSessions();try{const _0x671e4b=_0x5a90df[0x0],_0x146010=a49_0x548a41[_0x1356e9(0x178)](getConfigDir(),_0x1356e9(0x16d));if(_0x4647ae){if(_0x671e4b===_0x1356e9(0x17c))return clearDefaultSiteFromUserConfig(),console[_0x1356e9(0x18a)](_0x1356e9(0x17d)+a49_0x56b596[_0x1356e9(0x172)](_0x1356e9(0x181))),console['log'](a49_0x56b596[_0x1356e9(0x18c)](_0x1356e9(0x188)+_0x146010)),0x0;if(_0x671e4b===_0x1356e9(0x17a))return clearActiveProfileFromUserConfig(),console['log'](_0x1356e9(0x182)+a49_0x56b596['green']('cleared')),console['log'](a49_0x56b596[_0x1356e9(0x18c)]('\x0aUpdated:\x20'+_0x146010)),0x0;}const _0x3808eb=getSessionID(_0x43e2fb[_0x1356e9(0x171)]),_0x3d8e00={'site':'site','database':_0x1356e9(0x18d),'parent_segment':_0x1356e9(0x173),'llm_project':_0x1356e9(0x170),'agent':'llm_agent','profile':'profile','engage_workspace':_0x1356e9(0x180),'cas':'composable_audience','composable_audience':_0x1356e9(0x17e)},_0x267434=_0x3d8e00[_0x671e4b];return _0x267434&&(clearSessionContextField(_0x267434,_0x43e2fb[_0x1356e9(0x171)]),console[_0x1356e9(0x18a)]('Session\x20'+_0x671e4b+'\x20'+a49_0x56b596[_0x1356e9(0x172)](_0x1356e9(0x181))+'\x20'+a49_0x56b596[_0x1356e9(0x18c)](_0x1356e9(0x17b)+_0x3808eb+')'))),0x0;}catch(_0xf62bf){return _0xf62bf instanceof Error&&console[_0x1356e9(0x16f)](_0x1356e9(0x187)+_0xf62bf[_0x1356e9(0x16c)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a50_0x2722ea=a50_0x4f83;(function(_0x3936d8,_0x2b4bda){const _0x57956c=a50_0x4f83,_0x3ca972=_0x3936d8();while(!![]){try{const _0x52c53b=parseInt(_0x57956c(0x1c3))/0x1+parseInt(_0x57956c(0x1b3))/0x2+-parseInt(_0x57956c(0x1b5))/0x3+-parseInt(_0x57956c(0x1ab))/0x4+-parseInt(_0x57956c(0x1c2))/0x5+-parseInt(_0x57956c(0x19e))/0x6+-parseInt(_0x57956c(0x1b7))/0x7*(-parseInt(_0x57956c(0x1b4))/0x8);if(_0x52c53b===_0x2b4bda)break;else _0x3ca972['push'](_0x3ca972['shift']());}catch(_0x5a4f41){_0x3ca972['push'](_0x3ca972['shift']());}}}(a50_0x51f1,0x24815));import{gt}from'semver';import a50_0x1d64f6 from'chalk';import{BaseCommand}from'./command.js';import{getVersion,isDevVersion}from'../core/version.js';function a50_0x51f1(){const _0x12a0e2=['latest','log','error','219296wLrqwb','green','execPath','@treasuredata/tdx','Upgrade\x20failed\x20(exit\x20code\x20','yellow','Target\x20version:','global','22352jAyELD','5045808LaFAvP','680460ZhtXTV','join','7rkfVDt','install','add','message','Successfully\x20upgraded\x20to\x20','Current\x20version:','pnpm','Upgrade\x20is\x20not\x20available\x20for\x20development\x20versions.','close','red','argv','1062635ICFIxm','117761EKgKMC','dryRun','next','includes','yarn','695802erqEpJ','bun','description','Running:','toLowerCase','Would\x20run:','dim','Failed\x20to\x20check\x20for\x20updates:\x20','...','Current\x20version:\x20'];a50_0x51f1=function(){return _0x12a0e2;};return a50_0x51f1();}import{loadReleaseChannel}from'../core/config.js';import{fetchLatestVersion}from'../utils/version-check.js';import{crossSpawn}from'../utils/process.js';const PACKAGE_NAME=a50_0x2722ea(0x1ae);export function detectPackageManager(){const _0x11036b=a50_0x2722ea,_0x5bacb9=process[_0x11036b(0x1ad)][_0x11036b(0x1a2)](),_0xd716cb=process[_0x11036b(0x1c1)][0x1]??'';if(_0x5bacb9[_0x11036b(0x19c)]('bun')||_0xd716cb[_0x11036b(0x19c)]('.bun/'))return _0x11036b(0x19f);if(_0xd716cb[_0x11036b(0x19c)](_0x11036b(0x1bd)))return _0x11036b(0x1bd);if(_0xd716cb[_0x11036b(0x19c)]('yarn'))return _0x11036b(0x19d);return'npm';}function a50_0x4f83(_0x40f02d,_0x48774e){_0x40f02d=_0x40f02d-0x19a;const _0x51f1dc=a50_0x51f1();let _0x4f8373=_0x51f1dc[_0x40f02d];return _0x4f8373;}export function buildInstallArgs(_0x3151e2,_0x419963){const _0x102728=a50_0x2722ea;switch(_0x3151e2){case'yarn':return[_0x102728(0x1b2),_0x102728(0x1b9),_0x419963];case _0x102728(0x1bd):return[_0x102728(0x1b9),'-g',_0x419963];default:return[_0x102728(0x1b8),'-g',_0x419963];}}export class UpgradeCommand extends BaseCommand{['name']='upgrade';[a50_0x2722ea(0x1a0)]='Upgrade\x20tdx\x20to\x20the\x20latest\x20version';async['execute'](_0x11f573){const _0x53939a=a50_0x2722ea,{options:_0x22e3c2,args:_0x412b99}=_0x11f573,_0x482f9c=!!_0x22e3c2[_0x53939a(0x19a)],{next:_0x4417ef,method:_0x37c3ec}=_0x22e3c2,_0x488468=_0x4417ef?'next':loadReleaseChannel(),_0x3ba945=_0x488468===_0x53939a(0x19b)?'next':_0x53939a(0x1a8),_0x497724=_0x412b99[0x0]?String(_0x412b99[0x0])['replace'](/^v/,''):undefined,_0x5edb95=getVersion();if(isDevVersion())return console['error'](a50_0x1d64f6[_0x53939a(0x1b0)](_0x53939a(0x1be))),console['error'](a50_0x1d64f6['dim'](_0x53939a(0x1a7)+_0x5edb95)),0x1;let _0x43d898;if(_0x497724)_0x43d898=_0x497724,console[_0x53939a(0x1a9)](a50_0x1d64f6[_0x53939a(0x1a4)](_0x53939a(0x1bc))+'\x20'+_0x5edb95),console['log'](a50_0x1d64f6[_0x53939a(0x1a4)](_0x53939a(0x1b1))+'\x20\x20'+a50_0x1d64f6[_0x53939a(0x1ac)](_0x497724)),console['log']();else{console[_0x53939a(0x1a9)](a50_0x1d64f6[_0x53939a(0x1a4)]('Checking\x20'+PACKAGE_NAME+'@'+_0x3ba945+_0x53939a(0x1a6)));try{_0x43d898=await fetchLatestVersion(_0x488468);}catch(_0xef908b){return console[_0x53939a(0x1aa)](a50_0x1d64f6[_0x53939a(0x1c0)](_0x53939a(0x1a5)+(_0xef908b instanceof Error?_0xef908b['message']:String(_0xef908b)))),0x1;}if(!gt(_0x43d898,_0x5edb95))return console[_0x53939a(0x1a9)](a50_0x1d64f6[_0x53939a(0x1ac)]('Already\x20up\x20to\x20date\x20('+_0x5edb95+').')),0x0;console['log'](a50_0x1d64f6[_0x53939a(0x1a4)](_0x53939a(0x1bc))+'\x20'+_0x5edb95),console[_0x53939a(0x1a9)](a50_0x1d64f6[_0x53939a(0x1a4)]('Latest\x20version:')+'\x20\x20'+a50_0x1d64f6['green'](_0x43d898)),console[_0x53939a(0x1a9)]();}const _0x4c1407=_0x37c3ec??detectPackageManager(),_0x57556e=_0x497724?PACKAGE_NAME+'@'+_0x497724:PACKAGE_NAME+'@'+_0x3ba945,_0x22dbbf=buildInstallArgs(_0x4c1407,_0x57556e);if(_0x482f9c)return console[_0x53939a(0x1a9)](a50_0x1d64f6[_0x53939a(0x1a4)](_0x53939a(0x1a3))),console['log']('\x20\x20'+a50_0x1d64f6['cyan'](_0x4c1407+'\x20'+_0x22dbbf[_0x53939a(0x1b6)]('\x20'))),0x0;return console[_0x53939a(0x1a9)](a50_0x1d64f6[_0x53939a(0x1a4)](_0x53939a(0x1a1))+'\x20'+_0x4c1407+'\x20'+_0x22dbbf[_0x53939a(0x1b6)]('\x20')),console[_0x53939a(0x1a9)](),new Promise(_0x1e3e70=>{const _0xa8a827=_0x53939a,_0x4d1b92=crossSpawn(_0x4c1407,_0x22dbbf,{'stdio':'inherit'});_0x4d1b92['on'](_0xa8a827(0x1bf),_0x4d3b8a=>{const _0x4f5e3c=_0xa8a827;console[_0x4f5e3c(0x1a9)](),_0x4d3b8a===0x0?console[_0x4f5e3c(0x1a9)](a50_0x1d64f6[_0x4f5e3c(0x1ac)](_0x4f5e3c(0x1bb)+_0x57556e)):console[_0x4f5e3c(0x1aa)](a50_0x1d64f6['red'](_0x4f5e3c(0x1af)+_0x4d3b8a+').')),_0x1e3e70(_0x4d3b8a??0x1);}),_0x4d1b92['on'](_0xa8a827(0x1aa),_0x59a4e3=>{const _0x5a8346=_0xa8a827;console[_0x5a8346(0x1aa)](a50_0x1d64f6[_0x5a8346(0x1c0)]('Failed\x20to\x20run\x20'+_0x4c1407+':\x20'+_0x59a4e3[_0x5a8346(0x1ba)])),_0x1e3e70(0x1);});});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a51_0x468e8e=a51_0x27bd;(function(_0x17425f,_0xc3775e){const _0x5e0c28=a51_0x27bd,_0x98ab3e=_0x17425f();while(!![]){try{const _0x55b79a=parseInt(_0x5e0c28(0x142))/0x1+-parseInt(_0x5e0c28(0x155))/0x2+-parseInt(_0x5e0c28(0x109))/0x3+parseInt(_0x5e0c28(0x138))/0x4+-parseInt(_0x5e0c28(0x131))/0x5*(parseInt(_0x5e0c28(0x13d))/0x6)+parseInt(_0x5e0c28(0x106))/0x7*(-parseInt(_0x5e0c28(0x11b))/0x8)+-parseInt(_0x5e0c28(0x12e))/0x9*(-parseInt(_0x5e0c28(0x111))/0xa);if(_0x55b79a===_0xc3775e)break;else _0x98ab3e['push'](_0x98ab3e['shift']());}catch(_0x2647a4){_0x98ab3e['push'](_0x98ab3e['shift']());}}}(a51_0x3914,0xe6e05));import{BaseCommand}from'./command.js';function a51_0x3914(){const _0x1b928f=['\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a','.\x20Must\x20be\x20\x27stable\x27\x20or\x20\x27next\x27.','\x27\x20does\x20not\x20exist','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>\x20\x20#\x20Set\x20release\x20channel\x0a','site','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a','next','tdx','Set\x20session-level\x20context','display','18ZZzvnT','execute','Session\x20composable_audience\x20set\x20to:\x20','10CRoefd','database','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','log','stable','resolveWorkspaceId','Error:\x20','2163588JEuvJr','NOT_FOUND','\x27...','join','release_channel\x20requires\x20--default.\x20Usage:\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>','5320992zKOxEA','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20','composable_audience','session','(session:\x20','829934zGqSNB','release_channel','length','message','displayWithSources','Default\x20site\x20set\x20to:\x20','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','profile','agent','Invalid\x20release\x20channel:\x20','use','default','dim','clear','Session\x20context\x20','INVALID_ARGUMENT','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27,\x20\x27profile\x27,\x20or\x20\x27release_channel\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','\x0aUpdate\x20notifications\x20will\x20check\x20the\x20@latest\x20(stable)\x20channel.','1832024uecHLx','391958GWokKY','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','1677582FpVAqX','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','Default\x20profile\x20set\x20to:\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20','tdx.json','Session\x20llm_project\x20set\x20to:\x20','green','\x0aUpdate\x20notifications\x20will\x20now\x20check\x20the\x20@next\x20channel.','17758150PTRtvF','\x0aSaved\x20to:\x20','includes','\x0aUse\x20\x27tdx\x20engage\x20workspace\x20list\x27\x20to\x20see\x20available\x20workspaces','.\x20Must\x20be\x20one\x20of:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','\x27\x20to\x20save\x20permanently','llm_project','code','Error:\x20Profile\x20\x27','104egOFOI','engage_workspace','engage','cas','llm_agent','Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel','Install\x20the\x20latest\x20next\x20version:\x20npm\x20install\x20-g\x20@treasuredata/tdx@next'];a51_0x3914=function(){return _0x1b928f;};return a51_0x3914();}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';function a51_0x27bd(_0x4557d0,_0x3c9ba6){_0x4557d0=_0x4557d0-0x106;const _0x3914b2=a51_0x3914();let _0x27bdec=_0x3914b2[_0x4557d0];return _0x27bdec;}import{getConfigDir,saveReleaseChannel}from'../core/config.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import a51_0x4e4dc7 from'chalk';import*as a51_0x459fcc from'node:path';export class UseCommand extends BaseCommand{[a51_0x468e8e(0x107)]=a51_0x468e8e(0x14c);['description']=a51_0x468e8e(0x12c);['validate'](_0x111655){const _0x5867f4=a51_0x468e8e,{args:_0x49e699,options:_0x1fca6c}=_0x111655,_0x56c971=_0x1fca6c[_0x5867f4(0x14d)];if(_0x49e699['length']===0x0)return undefined;if(_0x49e699[_0x5867f4(0x144)]===0x1)return _0x5867f4(0x10a)+_0x5867f4(0x108)+_0x5867f4(0x116)+_0x5867f4(0x123)+_0x5867f4(0x129)+_0x5867f4(0x126)+'\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20cas,\x20release_channel\x0a'+_0x5867f4(0x148);const _0x56cdd4=_0x49e699[0x0],_0x104bb5=[_0x5867f4(0x127),'database','parent_segment','llm_project',_0x5867f4(0x14a),_0x5867f4(0x149),'engage_workspace',_0x5867f4(0x11e),_0x5867f4(0x13f),_0x5867f4(0x143)];if(!_0x104bb5[_0x5867f4(0x113)](_0x56cdd4))return'Invalid\x20resource:\x20'+_0x56cdd4+_0x5867f4(0x115)+_0x104bb5['join'](',\x20');if(_0x56c971&&_0x56cdd4!==_0x5867f4(0x127)&&_0x56cdd4!==_0x5867f4(0x149)&&_0x56cdd4!==_0x5867f4(0x143))return _0x5867f4(0x152);if(_0x56cdd4===_0x5867f4(0x143)&&!_0x56c971)return _0x5867f4(0x13c);if(_0x56cdd4===_0x5867f4(0x143)){const _0x42686e=_0x49e699[0x1];if(_0x42686e!==_0x5867f4(0x135)&&_0x42686e!=='next')return _0x5867f4(0x14b)+_0x42686e+_0x5867f4(0x124);}return undefined;}async[a51_0x468e8e(0x12f)](_0x2eb1f7){const _0x2415a4=a51_0x468e8e,{args:_0x22cdf0,options:_0x11e15f}=_0x2eb1f7,_0x206368=_0x11e15f['debug'],_0x52b619=_0x11e15f[_0x2415a4(0x14f)],_0x82fc53=_0x11e15f[_0x2415a4(0x14d)];cleanExpiredSessions();try{if(_0x52b619){clearSessionContext(_0x11e15f['session']);const _0x22dc4e=getSessionID(_0x11e15f[_0x2415a4(0x140)]);return console['log'](_0x2415a4(0x150)+a51_0x4e4dc7[_0x2415a4(0x10f)]('cleared')+'\x20'+a51_0x4e4dc7['dim'](_0x2415a4(0x141)+_0x22dc4e+')')),0x0;}if(_0x22cdf0['length']===0x0){const _0x5bc3a7=new GlobalContext(_0x11e15f);return _0x206368?_0x5bc3a7[_0x2415a4(0x146)]():_0x5bc3a7[_0x2415a4(0x12d)](),console[_0x2415a4(0x134)](a51_0x4e4dc7[_0x2415a4(0x14e)](_0x2415a4(0x153))),console[_0x2415a4(0x134)](a51_0x4e4dc7[_0x2415a4(0x14e)](_0x2415a4(0x120))),console[_0x2415a4(0x134)](a51_0x4e4dc7[_0x2415a4(0x14e)]('Use\x20--default\x20with\x20site,\x20profile,\x20or\x20release_channel\x20to\x20save\x20permanently')),0x0;}const _0x2b0e18=_0x22cdf0[0x0],_0x6c4d23=_0x22cdf0[0x1],_0xb98203=a51_0x459fcc[_0x2415a4(0x13b)](getConfigDir(),_0x2415a4(0x10d));if(_0x82fc53){if(_0x2b0e18===_0x2415a4(0x127))return saveDefaultSiteToUserConfig(_0x6c4d23),console[_0x2415a4(0x134)](_0x2415a4(0x147)+a51_0x4e4dc7[_0x2415a4(0x10f)](_0x6c4d23)),console[_0x2415a4(0x134)](a51_0x4e4dc7[_0x2415a4(0x14e)](_0x2415a4(0x112)+_0xb98203)),0x0;if(_0x2b0e18===_0x2415a4(0x149)){if(!profileExists(_0x6c4d23))return console['error'](_0x2415a4(0x11a)+_0x6c4d23+'\x27\x20does\x20not\x20exist'),console[_0x2415a4(0x128)](_0x2415a4(0x133)),0x1;return saveActiveProfileToUserConfig(_0x6c4d23),console['log'](_0x2415a4(0x10b)+a51_0x4e4dc7[_0x2415a4(0x10f)](_0x6c4d23)),console[_0x2415a4(0x134)](a51_0x4e4dc7[_0x2415a4(0x14e)](_0x2415a4(0x112)+_0xb98203)),0x0;}if(_0x2b0e18===_0x2415a4(0x143))return saveReleaseChannel(_0x6c4d23),console[_0x2415a4(0x134)]('Release\x20channel\x20set\x20to:\x20'+a51_0x4e4dc7[_0x2415a4(0x10f)](_0x6c4d23)),console['log'](a51_0x4e4dc7[_0x2415a4(0x14e)]('\x0aSaved\x20to:\x20'+_0xb98203)),_0x6c4d23===_0x2415a4(0x12a)?(console[_0x2415a4(0x134)](a51_0x4e4dc7['dim'](_0x2415a4(0x110))),console[_0x2415a4(0x134)](a51_0x4e4dc7['dim'](_0x2415a4(0x121)))):console[_0x2415a4(0x134)](a51_0x4e4dc7[_0x2415a4(0x14e)](_0x2415a4(0x154))),0x0;}if(_0x2b0e18===_0x2415a4(0x127)){const _0x37d988=getSessionID(_0x11e15f[_0x2415a4(0x140)]);return saveSessionContext({'site':_0x6c4d23},_0x11e15f[_0x2415a4(0x140)]),console[_0x2415a4(0x134)]('Session\x20site\x20set\x20to:\x20'+a51_0x4e4dc7[_0x2415a4(0x10f)](_0x6c4d23)+'\x20'+a51_0x4e4dc7[_0x2415a4(0x14e)](_0x2415a4(0x141)+_0x37d988+')')),console[_0x2415a4(0x134)](a51_0x4e4dc7[_0x2415a4(0x14e)](_0x2415a4(0x10c)+_0x6c4d23+'\x27\x20to\x20save\x20permanently')),0x0;}if(_0x2b0e18===_0x2415a4(0x149)){if(!profileExists(_0x6c4d23))return console[_0x2415a4(0x128)](_0x2415a4(0x11a)+_0x6c4d23+_0x2415a4(0x125)),console[_0x2415a4(0x128)](_0x2415a4(0x133)),0x1;const _0x116a6b=getSessionID(_0x11e15f[_0x2415a4(0x140)]);return saveSessionContext({'profile':_0x6c4d23},_0x11e15f[_0x2415a4(0x140)]),console[_0x2415a4(0x134)]('Session\x20profile\x20set\x20to:\x20'+a51_0x4e4dc7['green'](_0x6c4d23)+'\x20'+a51_0x4e4dc7[_0x2415a4(0x14e)](_0x2415a4(0x141)+_0x116a6b+')')),console[_0x2415a4(0x134)](a51_0x4e4dc7['dim'](_0x2415a4(0x13e)+_0x6c4d23+_0x2415a4(0x117))),0x0;}const _0xd7638c={},_0x4763bf=getSessionID(_0x11e15f[_0x2415a4(0x140)]);switch(_0x2b0e18){case'database':_0xd7638c[_0x2415a4(0x132)]=_0x6c4d23,console[_0x2415a4(0x134)]('Session\x20database\x20set\x20to:\x20'+a51_0x4e4dc7[_0x2415a4(0x10f)](_0x6c4d23)+'\x20'+a51_0x4e4dc7['dim'](_0x2415a4(0x141)+_0x4763bf+')'));break;case'parent_segment':_0xd7638c['parent_segment']=_0x6c4d23,console['log']('Session\x20parent_segment\x20set\x20to:\x20'+a51_0x4e4dc7[_0x2415a4(0x10f)](_0x6c4d23)+'\x20'+a51_0x4e4dc7['dim']('(session:\x20'+_0x4763bf+')'));break;case _0x2415a4(0x118):_0xd7638c[_0x2415a4(0x118)]=_0x6c4d23,console['log'](_0x2415a4(0x10e)+a51_0x4e4dc7[_0x2415a4(0x10f)](_0x6c4d23)+'\x20'+a51_0x4e4dc7['dim'](_0x2415a4(0x141)+_0x4763bf+')'));break;case'agent':{const {projectName:_0x937b18,agentName:_0x3f22d4}=parseAgentRef(_0x6c4d23);_0x3f22d4?(_0xd7638c[_0x2415a4(0x118)]=_0x937b18,_0xd7638c[_0x2415a4(0x11f)]=_0x3f22d4,console[_0x2415a4(0x134)](_0x2415a4(0x10e)+a51_0x4e4dc7[_0x2415a4(0x10f)](_0x937b18)+'\x20'+a51_0x4e4dc7[_0x2415a4(0x14e)]('(session:\x20'+_0x4763bf+')')),console[_0x2415a4(0x134)]('Session\x20agent\x20set\x20to:\x20'+a51_0x4e4dc7[_0x2415a4(0x10f)](_0x3f22d4)+'\x20'+a51_0x4e4dc7[_0x2415a4(0x14e)]('(session:\x20'+_0x4763bf+')'))):(_0xd7638c[_0x2415a4(0x11f)]=_0x6c4d23,console[_0x2415a4(0x134)]('Session\x20agent\x20set\x20to:\x20'+a51_0x4e4dc7[_0x2415a4(0x10f)](_0x6c4d23)+'\x20'+a51_0x4e4dc7[_0x2415a4(0x14e)](_0x2415a4(0x141)+_0x4763bf+')')));break;}case _0x2415a4(0x11e):case'composable_audience':_0xd7638c[_0x2415a4(0x13f)]=_0x6c4d23,console['log'](_0x2415a4(0x130)+a51_0x4e4dc7['green'](_0x6c4d23)+'\x20'+a51_0x4e4dc7[_0x2415a4(0x14e)]('(session:\x20'+_0x4763bf+')'));break;case _0x2415a4(0x11c):{try{await withSpinner('Verifying\x20workspace\x20\x27'+_0x6c4d23+_0x2415a4(0x13a),()=>_0x2eb1f7[_0x2415a4(0x12b)][_0x2415a4(0x11d)][_0x2415a4(0x136)](_0x6c4d23));}catch(_0x50e05b){if(_0x50e05b instanceof SDKError&&(_0x50e05b[_0x2415a4(0x119)]===ErrorCode[_0x2415a4(0x139)]||_0x50e05b[_0x2415a4(0x119)]===ErrorCode[_0x2415a4(0x151)]))return console['error'](_0x2415a4(0x137)+_0x50e05b[_0x2415a4(0x145)]),console[_0x2415a4(0x128)](_0x2415a4(0x114)),0x1;throw _0x50e05b;}_0xd7638c[_0x2415a4(0x11c)]=_0x6c4d23,console[_0x2415a4(0x134)]('Session\x20engage_workspace\x20set\x20to:\x20'+a51_0x4e4dc7[_0x2415a4(0x10f)](_0x6c4d23)+'\x20'+a51_0x4e4dc7[_0x2415a4(0x14e)](_0x2415a4(0x141)+_0x4763bf+')'));break;}}return saveSessionContext(_0xd7638c,_0x11e15f[_0x2415a4(0x140)]),console[_0x2415a4(0x134)](a51_0x4e4dc7[_0x2415a4(0x14e)](_0x2415a4(0x122))),0x0;}catch(_0x318148){return _0x318148 instanceof Error&&console[_0x2415a4(0x128)](_0x2415a4(0x137)+_0x318148[_0x2415a4(0x145)]),0x1;}}}
|
|
1
|
+
const a51_0x2cf1a9=a51_0x2725;(function(_0x560591,_0xca3cfc){const _0x26ad5b=a51_0x2725,_0x269631=_0x560591();while(!![]){try{const _0x4f5a26=parseInt(_0x26ad5b(0x1d8))/0x1*(-parseInt(_0x26ad5b(0x1b0))/0x2)+-parseInt(_0x26ad5b(0x1c0))/0x3+-parseInt(_0x26ad5b(0x1c7))/0x4*(-parseInt(_0x26ad5b(0x1a0))/0x5)+parseInt(_0x26ad5b(0x1a6))/0x6+-parseInt(_0x26ad5b(0x1d7))/0x7*(-parseInt(_0x26ad5b(0x19e))/0x8)+-parseInt(_0x26ad5b(0x19a))/0x9*(-parseInt(_0x26ad5b(0x1d3))/0xa)+-parseInt(_0x26ad5b(0x197))/0xb;if(_0x4f5a26===_0xca3cfc)break;else _0x269631['push'](_0x269631['shift']());}catch(_0x1c4747){_0x269631['push'](_0x269631['shift']());}}}(a51_0x55b2,0xc740e));import{BaseCommand}from'./command.js';import{saveSessionContext,getSessionID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists,saveActiveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';function a51_0x55b2(){const _0x3e494e=['133msSmsR','277567Aiqqwe','\x0aUse\x20\x27tdx\x20engage\x20workspace\x20list\x27\x20to\x20see\x20available\x20workspaces','\x0aUpdate\x20notifications\x20will\x20check\x20the\x20@latest\x20(stable)\x20channel.','green','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27,\x20\x27profile\x27,\x20or\x20\x27release_channel\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','Session\x20profile\x20set\x20to:\x20','site','Session\x20agent\x20set\x20to:\x20','displayWithSources','message','.\x20Must\x20be\x20one\x20of:\x20','use','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a','Session\x20database\x20set\x20to:\x20','llm_project','(session:\x20','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20cas,\x20release_channel\x0a','Session\x20parent_segment\x20set\x20to:\x20','Session\x20engage_workspace\x20set\x20to:\x20','Session\x20composable_audience\x20set\x20to:\x20','display','21708126AKmwbP','composable_audience','log','2466hadmsP','dim','llm_agent','database','583592vlkJce','Use\x20--default\x20with\x20site,\x20profile,\x20or\x20release_channel\x20to\x20save\x20permanently','5haCfqp','parent_segment','tdx.json','engage_workspace','Error:\x20','join','5917596AswEZy','Error:\x20Profile\x20\x27','\x27\x20to\x20save\x20permanently','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','cas','\x0aSaved\x20to:\x20','engage','default','Verifying\x20workspace\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','2hLtdkN','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','Session\x20site\x20set\x20to:\x20','\x0aUpdate\x20notifications\x20will\x20now\x20check\x20the\x20@next\x20channel.','stable','execute','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','session','NOT_FOUND','release_channel\x20requires\x20--default.\x20Usage:\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>','Default\x20profile\x20set\x20to:\x20','Invalid\x20resource:\x20','error','clear','includes','code','2653206mLOKvE','name','Release\x20channel\x20set\x20to:\x20','\x27\x20does\x20not\x20exist','\x27...','profile','Session\x20context\x20','3942088gzEuTk','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20','agent','Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace,\x20release_channel','release_channel','description','INVALID_ARGUMENT','validate','next','Default\x20site\x20set\x20to:\x20','Session\x20llm_project\x20set\x20to:\x20','21670jrxfnD','Set\x20session-level\x20context','Invalid\x20release\x20channel:\x20','length'];a51_0x55b2=function(){return _0x3e494e;};return a51_0x55b2();}import{GlobalContext}from'../core/global-context.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{getConfigDir,saveReleaseChannel}from'../core/config.js';function a51_0x2725(_0x1eab38,_0x475d87){_0x1eab38=_0x1eab38-0x18b;const _0x55b2a5=a51_0x55b2();let _0x272527=_0x55b2a5[_0x1eab38];return _0x272527;}import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import a51_0x5a8606 from'chalk';import*as a51_0x3cf541 from'node:path';export class UseCommand extends BaseCommand{[a51_0x2cf1a9(0x1c1)]=a51_0x2cf1a9(0x18d);[a51_0x2cf1a9(0x1cd)]=a51_0x2cf1a9(0x1d4);[a51_0x2cf1a9(0x1cf)](_0x142b78){const _0x3ac5c7=a51_0x2cf1a9,{args:_0x3ee40b,options:_0x39bdf3}=_0x142b78,_0x418610=_0x39bdf3[_0x3ac5c7(0x1ad)];if(_0x3ee40b['length']===0x0)return undefined;if(_0x3ee40b['length']===0x1)return _0x3ac5c7(0x1a9)+'\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'+_0x3ac5c7(0x1af)+_0x3ac5c7(0x18e)+_0x3ac5c7(0x1c8)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20release_channel\x20<stable|next>\x20\x20#\x20Set\x20release\x20channel\x0a'+_0x3ac5c7(0x192)+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x573c7d=_0x3ee40b[0x0],_0x43ba05=[_0x3ac5c7(0x1de),_0x3ac5c7(0x19d),_0x3ac5c7(0x1a1),_0x3ac5c7(0x190),'agent',_0x3ac5c7(0x1c5),_0x3ac5c7(0x1a3),_0x3ac5c7(0x1aa),_0x3ac5c7(0x198),_0x3ac5c7(0x1cc)];if(!_0x43ba05[_0x3ac5c7(0x1be)](_0x573c7d))return _0x3ac5c7(0x1bb)+_0x573c7d+_0x3ac5c7(0x18c)+_0x43ba05['join'](',\x20');if(_0x418610&&_0x573c7d!==_0x3ac5c7(0x1de)&&_0x573c7d!=='profile'&&_0x573c7d!=='release_channel')return _0x3ac5c7(0x1dc);if(_0x573c7d===_0x3ac5c7(0x1cc)&&!_0x418610)return _0x3ac5c7(0x1b9);if(_0x573c7d===_0x3ac5c7(0x1cc)){const _0x43789d=_0x3ee40b[0x1];if(_0x43789d!==_0x3ac5c7(0x1b4)&&_0x43789d!==_0x3ac5c7(0x1d0))return _0x3ac5c7(0x1d5)+_0x43789d+'.\x20Must\x20be\x20\x27stable\x27\x20or\x20\x27next\x27.';}return undefined;}async[a51_0x2cf1a9(0x1b5)](_0xdef78b){const _0x23f65f=a51_0x2cf1a9,{args:_0x3500bc,options:_0x77676e}=_0xdef78b,_0x14be1c=_0x77676e['debug'],_0x355cc4=_0x77676e[_0x23f65f(0x1bd)],_0x2e51f1=_0x77676e[_0x23f65f(0x1ad)];cleanExpiredSessions();try{if(_0x355cc4){clearSessionContext(_0x77676e[_0x23f65f(0x1b7)]);const _0x44fc55=getSessionID(_0x77676e[_0x23f65f(0x1b7)]);return console['log'](_0x23f65f(0x1c6)+a51_0x5a8606[_0x23f65f(0x1db)]('cleared')+'\x20'+a51_0x5a8606[_0x23f65f(0x19b)](_0x23f65f(0x191)+_0x44fc55+')')),0x0;}if(_0x3500bc[_0x23f65f(0x1d6)]===0x0){const _0x2f13be=new GlobalContext(_0x77676e);return _0x14be1c?_0x2f13be[_0x23f65f(0x1e0)]():_0x2f13be[_0x23f65f(0x196)](),console['log'](a51_0x5a8606['dim']('\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>')),console[_0x23f65f(0x199)](a51_0x5a8606[_0x23f65f(0x19b)](_0x23f65f(0x1cb))),console['log'](a51_0x5a8606[_0x23f65f(0x19b)](_0x23f65f(0x19f))),0x0;}const _0x343365=_0x3500bc[0x0],_0x541439=_0x3500bc[0x1],_0x38d999=a51_0x3cf541[_0x23f65f(0x1a5)](getConfigDir(),_0x23f65f(0x1a2));if(_0x2e51f1){if(_0x343365===_0x23f65f(0x1de))return saveDefaultSiteToUserConfig(_0x541439),console[_0x23f65f(0x199)](_0x23f65f(0x1d1)+a51_0x5a8606[_0x23f65f(0x1db)](_0x541439)),console['log'](a51_0x5a8606[_0x23f65f(0x19b)](_0x23f65f(0x1ab)+_0x38d999)),0x0;if(_0x343365===_0x23f65f(0x1c5)){if(!profileExists(_0x541439))return console[_0x23f65f(0x1bc)](_0x23f65f(0x1a7)+_0x541439+_0x23f65f(0x1c3)),console[_0x23f65f(0x1bc)](_0x23f65f(0x1b1)),0x1;return saveActiveProfileToUserConfig(_0x541439),console[_0x23f65f(0x199)](_0x23f65f(0x1ba)+a51_0x5a8606[_0x23f65f(0x1db)](_0x541439)),console[_0x23f65f(0x199)](a51_0x5a8606[_0x23f65f(0x19b)](_0x23f65f(0x1ab)+_0x38d999)),0x0;}if(_0x343365==='release_channel')return saveReleaseChannel(_0x541439),console['log'](_0x23f65f(0x1c2)+a51_0x5a8606[_0x23f65f(0x1db)](_0x541439)),console[_0x23f65f(0x199)](a51_0x5a8606['dim'](_0x23f65f(0x1ab)+_0x38d999)),_0x541439==='next'?(console[_0x23f65f(0x199)](a51_0x5a8606[_0x23f65f(0x19b)](_0x23f65f(0x1b3))),console['log'](a51_0x5a8606[_0x23f65f(0x19b)]('Install\x20the\x20latest\x20next\x20version:\x20npm\x20install\x20-g\x20@treasuredata/tdx@next'))):console[_0x23f65f(0x199)](a51_0x5a8606[_0x23f65f(0x19b)](_0x23f65f(0x1da))),0x0;}if(_0x343365==='site'){const _0x50bedd=getSessionID(_0x77676e[_0x23f65f(0x1b7)]);return saveSessionContext({'site':_0x541439},_0x77676e[_0x23f65f(0x1b7)]),console[_0x23f65f(0x199)](_0x23f65f(0x1b2)+a51_0x5a8606[_0x23f65f(0x1db)](_0x541439)+'\x20'+a51_0x5a8606[_0x23f65f(0x19b)](_0x23f65f(0x191)+_0x50bedd+')')),console['log'](a51_0x5a8606[_0x23f65f(0x19b)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20'+_0x541439+_0x23f65f(0x1a8))),0x0;}if(_0x343365===_0x23f65f(0x1c5)){if(!profileExists(_0x541439))return console['error']('Error:\x20Profile\x20\x27'+_0x541439+_0x23f65f(0x1c3)),console[_0x23f65f(0x1bc)](_0x23f65f(0x1b1)),0x1;const _0xd23f8a=getSessionID(_0x77676e[_0x23f65f(0x1b7)]);return saveSessionContext({'profile':_0x541439},_0x77676e[_0x23f65f(0x1b7)]),console['log'](_0x23f65f(0x1dd)+a51_0x5a8606[_0x23f65f(0x1db)](_0x541439)+'\x20'+a51_0x5a8606[_0x23f65f(0x19b)]('(session:\x20'+_0xd23f8a+')')),console[_0x23f65f(0x199)](a51_0x5a8606[_0x23f65f(0x19b)](_0x23f65f(0x1c9)+_0x541439+_0x23f65f(0x1a8))),0x0;}const _0x353f7f={},_0x335df0=getSessionID(_0x77676e[_0x23f65f(0x1b7)]);switch(_0x343365){case _0x23f65f(0x19d):_0x353f7f['database']=_0x541439,console[_0x23f65f(0x199)](_0x23f65f(0x18f)+a51_0x5a8606['green'](_0x541439)+'\x20'+a51_0x5a8606[_0x23f65f(0x19b)](_0x23f65f(0x191)+_0x335df0+')'));break;case'parent_segment':_0x353f7f[_0x23f65f(0x1a1)]=_0x541439,console[_0x23f65f(0x199)](_0x23f65f(0x193)+a51_0x5a8606[_0x23f65f(0x1db)](_0x541439)+'\x20'+a51_0x5a8606[_0x23f65f(0x19b)](_0x23f65f(0x191)+_0x335df0+')'));break;case _0x23f65f(0x190):_0x353f7f['llm_project']=_0x541439,console['log'](_0x23f65f(0x1d2)+a51_0x5a8606[_0x23f65f(0x1db)](_0x541439)+'\x20'+a51_0x5a8606[_0x23f65f(0x19b)](_0x23f65f(0x191)+_0x335df0+')'));break;case _0x23f65f(0x1ca):{const {projectName:_0x4c1baa,agentName:_0x4d3aa4}=parseAgentRef(_0x541439);_0x4d3aa4?(_0x353f7f['llm_project']=_0x4c1baa,_0x353f7f[_0x23f65f(0x19c)]=_0x4d3aa4,console[_0x23f65f(0x199)](_0x23f65f(0x1d2)+a51_0x5a8606['green'](_0x4c1baa)+'\x20'+a51_0x5a8606[_0x23f65f(0x19b)]('(session:\x20'+_0x335df0+')')),console['log'](_0x23f65f(0x1df)+a51_0x5a8606['green'](_0x4d3aa4)+'\x20'+a51_0x5a8606[_0x23f65f(0x19b)]('(session:\x20'+_0x335df0+')'))):(_0x353f7f[_0x23f65f(0x19c)]=_0x541439,console[_0x23f65f(0x199)]('Session\x20agent\x20set\x20to:\x20'+a51_0x5a8606[_0x23f65f(0x1db)](_0x541439)+'\x20'+a51_0x5a8606['dim']('(session:\x20'+_0x335df0+')')));break;}case'cas':case _0x23f65f(0x198):_0x353f7f[_0x23f65f(0x198)]=_0x541439,console[_0x23f65f(0x199)](_0x23f65f(0x195)+a51_0x5a8606[_0x23f65f(0x1db)](_0x541439)+'\x20'+a51_0x5a8606[_0x23f65f(0x19b)](_0x23f65f(0x191)+_0x335df0+')'));break;case _0x23f65f(0x1a3):{try{await withSpinner(_0x23f65f(0x1ae)+_0x541439+_0x23f65f(0x1c4),()=>_0xdef78b['tdx'][_0x23f65f(0x1ac)]['resolveWorkspaceId'](_0x541439));}catch(_0x2647cc){if(_0x2647cc instanceof SDKError&&(_0x2647cc[_0x23f65f(0x1bf)]===ErrorCode[_0x23f65f(0x1b8)]||_0x2647cc['code']===ErrorCode[_0x23f65f(0x1ce)]))return console[_0x23f65f(0x1bc)](_0x23f65f(0x1a4)+_0x2647cc[_0x23f65f(0x18b)]),console[_0x23f65f(0x1bc)](_0x23f65f(0x1d9)),0x1;throw _0x2647cc;}_0x353f7f['engage_workspace']=_0x541439,console[_0x23f65f(0x199)](_0x23f65f(0x194)+a51_0x5a8606[_0x23f65f(0x1db)](_0x541439)+'\x20'+a51_0x5a8606[_0x23f65f(0x19b)](_0x23f65f(0x191)+_0x335df0+')'));break;}}return saveSessionContext(_0x353f7f,_0x77676e[_0x23f65f(0x1b7)]),console[_0x23f65f(0x199)](a51_0x5a8606['dim'](_0x23f65f(0x1b6))),0x0;}catch(_0x141d7e){return _0x141d7e instanceof Error&&console[_0x23f65f(0x1bc)](_0x23f65f(0x1a4)+_0x141d7e[_0x23f65f(0x18b)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a52_0x3e7bec=a52_0x3d4b;function a52_0x3d4b(_0x2c7267,_0x22fa6d){_0x2c7267=_0x2c7267-0x1bc;const _0x3f23a7=a52_0x3f23();let _0x3d4b18=_0x3f23a7[_0x2c7267];return _0x3d4b18;}(function(_0x253d54,_0x48981a){const _0x527d61=a52_0x3d4b,_0x33fecb=_0x253d54();while(!![]){try{const _0x5ac1b9=parseInt(_0x527d61(0x1dd))/0x1+parseInt(_0x527d61(0x1cf))/0x2*(parseInt(_0x527d61(0x1d0))/0x3)+-parseInt(_0x527d61(0x1bf))/0x4+-parseInt(_0x527d61(0x1d8))/0x5*(parseInt(_0x527d61(0x1cd))/0x6)+-parseInt(_0x527d61(0x1d6))/0x7+-parseInt(_0x527d61(0x1db))/0x8*(-parseInt(_0x527d61(0x1c5))/0x9)+parseInt(_0x527d61(0x1c2))/0xa*(parseInt(_0x527d61(0x1e0))/0xb);if(_0x5ac1b9===_0x48981a)break;else _0x33fecb['push'](_0x33fecb['shift']());}catch(_0x3eafcc){_0x33fecb['push'](_0x33fecb['shift']());}}}(a52_0x3f23,0xce305));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a52_0x3f23(){const _0x3234dd=['Error:\x20','log','list','6tnSvjT','description','39524iLoqkm','237RWzgKD','length','yellow','getCurrent','\x20(owner)','Fetching\x20user\x20info...','3312960sBQmtv','✔\x20Found\x20','7953655zjCMNY','\x20user','message','184QyAcFl','cause','870364cKCdaC','user','data','9936927bQVvWu','localeCompare','administrator','Listing\x20users...','5450664zutrdI','sort','name','10SufMzm','verbose','👤\x20','366381xEfZTW','\x20\x20Cause:\x20','email','error','execute'];a52_0x3f23=function(){return _0x3234dd;};return a52_0x3f23();}import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import a52_0x346651 from'chalk';export class UserCommand extends BaseCommand{[a52_0x3e7bec(0x1c1)]='user';[a52_0x3e7bec(0x1ce)]='Show\x20current\x20user\x20information';async[a52_0x3e7bec(0x1c9)](_0xa6d789){const _0x5d36be=a52_0x3e7bec,{options:_0x83fded,tdx:_0x2672b3}=_0xa6d789;try{const _0x34e481=await withSpinner(_0x5d36be(0x1d5),()=>_0x2672b3['user'][_0x5d36be(0x1d3)](),{'verbose':_0x83fded[_0x5d36be(0x1c3)]}),_0xad3ebc=_0x34e481[_0x5d36be(0x1df)];return await handleSingleObjectOutput(_0xad3ebc,_0x83fded),0x0;}catch(_0x47e1d6){if(_0x47e1d6 instanceof SDKError)return console['error']('Error:\x20'+_0x47e1d6[_0x5d36be(0x1da)]),_0x47e1d6[_0x5d36be(0x1dc)]&&console['error'](_0x5d36be(0x1c6)+_0x47e1d6[_0x5d36be(0x1dc)]),0x1;throw _0x47e1d6;}}}export class UserListCommand extends BaseCommand{[a52_0x3e7bec(0x1c1)]='user\x20list';[a52_0x3e7bec(0x1ce)]='List\x20all\x20users\x20in\x20the\x20account';async[a52_0x3e7bec(0x1c9)](_0x2af4b1){const _0x138867=a52_0x3e7bec,{options:_0x180d6d,tdx:_0x253149}=_0x2af4b1;try{const _0x5053ed=await withSpinner(_0x138867(0x1be),()=>_0x253149[_0x138867(0x1de)][_0x138867(0x1cc)](),{'verbose':_0x180d6d[_0x138867(0x1c3)]}),_0x4efaad=_0x5053ed[_0x138867(0x1df)];console[_0x138867(0x1c8)](_0x138867(0x1d7)+_0x4efaad[_0x138867(0x1d1)]+_0x138867(0x1d9)+(_0x4efaad[_0x138867(0x1d1)]!==0x1?'s':''));if(isStructuredFormat(_0x180d6d))await handleSDKOutput(_0x4efaad,_0x180d6d);else{const _0x56de5a=[..._0x4efaad][_0x138867(0x1c0)]((_0x174f6c,_0x2b3ff5)=>String(_0x174f6c['name']??'')[_0x138867(0x1bc)](String(_0x2b3ff5[_0x138867(0x1c1)]??'')));for(const _0x57c736 of _0x56de5a){const _0xb1d5e8=_0x57c736['account_owner']?a52_0x346651[_0x138867(0x1d2)](_0x138867(0x1d4)):_0x57c736[_0x138867(0x1bd)]?a52_0x346651[_0x138867(0x1d2)]('\x20(admin)'):'',_0x505ee5=_0x57c736[_0x138867(0x1c7)]&&_0x57c736['email']!==_0x57c736[_0x138867(0x1c1)]?a52_0x346651['dim']('\x20<'+_0x57c736[_0x138867(0x1c7)]+'>'):'';console[_0x138867(0x1cb)](_0x138867(0x1c4)+(_0x57c736['name']??'Unknown')+_0x505ee5+_0xb1d5e8);}}return 0x0;}catch(_0x2f28bc){if(_0x2f28bc instanceof SDKError)return console[_0x138867(0x1c8)](_0x138867(0x1ca)+_0x2f28bc[_0x138867(0x1da)]),_0x2f28bc[_0x138867(0x1dc)]&&console['error'](_0x138867(0x1c6)+_0x2f28bc[_0x138867(0x1dc)]),0x1;throw _0x2f28bc;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a53_0x1f4c9d=a53_0x3a2b;function a53_0x3a2b(_0x23c45a,_0x6c66fe){_0x23c45a=_0x23c45a-0xf0;const _0x1680a6=a53_0x1680();let _0x3a2b3b=_0x1680a6[_0x23c45a];return _0x3a2b3b;}(function(_0x875e28,_0x333a84){const _0x36a506=a53_0x3a2b,_0xe5f9c7=_0x875e28();while(!![]){try{const _0x13641f=-parseInt(_0x36a506(0x108))/0x1+parseInt(_0x36a506(0x129))/0x2+parseInt(_0x36a506(0x134))/0x3*(-parseInt(_0x36a506(0x10d))/0x4)+-parseInt(_0x36a506(0x13d))/0x5+-parseInt(_0x36a506(0x123))/0x6+parseInt(_0x36a506(0x116))/0x7*(-parseInt(_0x36a506(0x11d))/0x8)+parseInt(_0x36a506(0xf0))/0x9*(parseInt(_0x36a506(0x112))/0xa);if(_0x13641f===_0x333a84)break;else _0xe5f9c7['push'](_0xe5f9c7['shift']());}catch(_0x3e3476){_0xe5f9c7['push'](_0xe5f9c7['shift']());}}}(a53_0x1680,0xf065c));function a53_0x1680(){const _0x2b3cf=['No\x20outgoing\x20wiki-links','Wiki-links','name','isArray','flatMap','body','readDocument','trim','error','Created:','\x20→\x20','bold','review','Workspace\x20initialized:','taskCounts','template','getBacklinks','magenta','Invalid\x20kind:\x20','status','filePath','medium','540485KujYDH','exit','createDocument','round','inherit','5284UnIrCE','title','goals','init','red','250YlgRRK','Links\x20for:\x20','github','reduce','2479701MNYpTd','in_progress','\x20Run\x20','displayText','dim','todo','\x20to\x20create\x20one,\x20or\x20navigate\x20to\x20a\x20directory\x20containing\x20tdx.json.','40JZwWEm','\x20\x20(empty)','priority','slug','Document\x20not\x20found:\x20','join','4871994VLZQRa','Failed\x20to\x20open\x20editor:\x20','resolveWikiLinks','Workspace\x20initialized\x20in\x20current\x20directory','cyan','has','3144212HqDaZt','tags','resolvedPath','done','entries','.\x20Valid:\x20','initAt','fileName','underline','path','blue','2901zfuJIA','Backlinks','getSummary','workflow','kind','Invalid\x20priority:\x20','map','resolvedKind','gray','3854535zTcter','high','cwd','item','length','values','design_review','yellow','frontmatter','assignee','days','void','Invalid\x20status:\x20','workspacePath','log','\x20[[','low','repeat','split','\x20\x20←\x20','No\x20tasks\x20yet.\x20Create\x20one\x20with:\x20tdx\x20work\x20new\x20<title>','green','1650447awDzDt','white'];a53_0x1680=function(){return _0x2b3cf;};return a53_0x1680();}import{getChalk}from'../utils/colors.js';const chalk=getChalk();import{execFileSync}from'node:child_process';import a53_0x330ea6 from'node:path';import{WorkspaceSDK,resolveWorkspacePath,normalizeTags}from'../sdk/workspace/index.js';import{STATUS_PHASES,ALL_STATUSES}from'../sdk/types/workspace.js';function buildStaleFilter(_0x382bc8){const _0x1ef881=a53_0x3a2b;if(_0x382bc8['all'])return{'includeStale':!![]};if(_0x382bc8[_0x1ef881(0x147)])return{'updatedWithin':parseInt(_0x382bc8['days'],0xa)};return undefined;}const VALID_KINDS=new Set(['item','goal','guide','note','reference',a53_0x1f4c9d(0x137),a53_0x1f4c9d(0x101)]),VALID_PRIORITIES=new Set(['critical',a53_0x1f4c9d(0x13e),a53_0x1f4c9d(0x107),a53_0x1f4c9d(0x14d)]),VALID_STATUSES=new Set(ALL_STATUSES);function getSDK(){const _0x48ca4c=a53_0x1f4c9d,_0x5b701d=resolveWorkspacePath();return!_0x5b701d&&(console[_0x48ca4c(0xfa)](chalk[_0x48ca4c(0x111)]('No\x20workspace\x20found.')+_0x48ca4c(0x118)+chalk[_0x48ca4c(0x127)]('tdx\x20work\x20init\x20<name>')+_0x48ca4c(0x11c)),process['exit'](0x1)),new WorkspaceSDK(_0x5b701d);}function priorityDot(_0x336de7){const _0x46fbeb=a53_0x1f4c9d;switch(_0x336de7){case'critical':return chalk[_0x46fbeb(0x111)]('●');case _0x46fbeb(0x13e):return chalk['yellow']('●');case _0x46fbeb(0x107):return chalk[_0x46fbeb(0x133)]('●');case _0x46fbeb(0x14d):return chalk[_0x46fbeb(0x13c)]('●');default:return chalk[_0x46fbeb(0x133)]('●');}}function statusColor(_0x1ff1ed){const _0x22fb12=a53_0x1f4c9d;switch(_0x1ff1ed){case _0x22fb12(0x12c):return chalk[_0x22fb12(0x152)](_0x1ff1ed);case _0x22fb12(0x148):return chalk[_0x22fb12(0x13c)](_0x1ff1ed);case _0x22fb12(0x117):return chalk[_0x22fb12(0x127)](_0x1ff1ed);case _0x22fb12(0xfe):return chalk[_0x22fb12(0x103)](_0x1ff1ed);case'planning':case _0x22fb12(0x143):return chalk[_0x22fb12(0x144)](_0x1ff1ed);case _0x22fb12(0x11b):return chalk[_0x22fb12(0xf1)](_0x1ff1ed);case'backlog':return chalk['dim'](_0x1ff1ed);default:return _0x1ff1ed;}}export async function workSummaryAction(_0x550841){const _0x2e56e3=a53_0x1f4c9d,_0x20ac97=getSDK(),_0x3e439a=buildStaleFilter(_0x550841),_0x52e735=_0x20ac97[_0x2e56e3(0x136)](_0x3e439a);console[_0x2e56e3(0x14b)](chalk[_0x2e56e3(0xfd)]('Workspace:\x20'+_0x52e735[_0x2e56e3(0xf4)])),console[_0x2e56e3(0x14b)](chalk[_0x2e56e3(0x11a)](_0x52e735[_0x2e56e3(0x132)])),console[_0x2e56e3(0x14b)]();const _0x567d61=Object[_0x2e56e3(0x142)](_0x52e735[_0x2e56e3(0x100)])[_0x2e56e3(0x115)]((_0x543fcb,_0x15a187)=>_0x543fcb+_0x15a187,0x0);if(_0x567d61===0x0)console[_0x2e56e3(0x14b)](chalk['dim'](_0x2e56e3(0x151)));else{console[_0x2e56e3(0x14b)](chalk['bold']('Tasks'));for(const [_0x196066,_0x2c4504]of Object[_0x2e56e3(0x12d)](_0x52e735[_0x2e56e3(0x100)])){_0x2c4504>0x0&&console[_0x2e56e3(0x14b)]('\x20\x20'+statusColor(_0x196066)+':\x20'+_0x2c4504);}console[_0x2e56e3(0x14b)]();}if(_0x52e735[_0x2e56e3(0x10f)][_0x2e56e3(0x141)]>0x0){console[_0x2e56e3(0x14b)](chalk['bold']('Goals'));for(const _0x5758e6 of _0x52e735[_0x2e56e3(0x10f)]){const _0x475a11=progressBar(_0x5758e6['progress']);console[_0x2e56e3(0x14b)]('\x20\x20'+_0x5758e6[_0x2e56e3(0x10e)]+'\x20'+_0x475a11+'\x20'+_0x5758e6['progress']+'%');}}}function progressBar(_0x4c790b){const _0x35f15d=a53_0x1f4c9d,_0x5c6c5d=0x14,_0x28ae41=Math[_0x35f15d(0x10b)](_0x4c790b/0x64*_0x5c6c5d),_0x572c9d=_0x5c6c5d-_0x28ae41;return chalk[_0x35f15d(0x152)]('█'[_0x35f15d(0x14e)](_0x28ae41))+chalk[_0x35f15d(0x11a)]('░'[_0x35f15d(0x14e)](_0x572c9d));}export async function workInitAction(_0x2fb7ca,_0xb91b01){const _0x24ee7d=a53_0x1f4c9d,_0x34d66c=_0x2fb7ca||a53_0x330ea6['basename'](process[_0x24ee7d(0x13f)]());if(_0xb91b01['github']){const _0x48da89=WorkspaceSDK[_0x24ee7d(0x12f)](_0x34d66c,{'github':_0xb91b01[_0x24ee7d(0x114)]});console['log'](chalk['green'](_0x24ee7d(0xff))+'\x20'+_0x48da89[_0x24ee7d(0x14a)]),console['log'](chalk['dim']('Linked\x20to\x20GitHub:\x20'+_0xb91b01[_0x24ee7d(0x114)]));}else{if(_0x2fb7ca){const _0x4db0e2=WorkspaceSDK[_0x24ee7d(0x12f)](_0x2fb7ca);console[_0x24ee7d(0x14b)](chalk['green'](_0x24ee7d(0xff))+'\x20'+_0x4db0e2['workspacePath']);}else{const _0x46ccc6=new WorkspaceSDK(process['cwd']());_0x46ccc6[_0x24ee7d(0x110)](_0x34d66c),console[_0x24ee7d(0x14b)](chalk[_0x24ee7d(0x152)](_0x24ee7d(0x126)));}}}export async function workNewAction(_0x117c7e,_0x8d6709){const _0xebaa2=a53_0x1f4c9d,_0x436460=getSDK(),_0x2b0ce9=_0x8d6709['kind']||_0xebaa2(0x140);!VALID_KINDS['has'](_0x2b0ce9)&&(console[_0xebaa2(0xfa)](chalk[_0xebaa2(0x111)](_0xebaa2(0x104)+_0x2b0ce9+_0xebaa2(0x12e)+[...VALID_KINDS][_0xebaa2(0x122)](',\x20'))),process[_0xebaa2(0x109)](0x1));_0x8d6709[_0xebaa2(0x11f)]&&!VALID_PRIORITIES['has'](_0x8d6709['priority'])&&(console[_0xebaa2(0xfa)](chalk[_0xebaa2(0x111)](_0xebaa2(0x139)+_0x8d6709['priority']+_0xebaa2(0x12e)+[...VALID_PRIORITIES]['join'](',\x20'))),process[_0xebaa2(0x109)](0x1));_0x8d6709[_0xebaa2(0x105)]&&!VALID_STATUSES[_0xebaa2(0x128)](_0x8d6709[_0xebaa2(0x105)])&&(console[_0xebaa2(0xfa)](chalk[_0xebaa2(0x111)](_0xebaa2(0x149)+_0x8d6709['status']+_0xebaa2(0x12e)+[...VALID_STATUSES][_0xebaa2(0x122)](',\x20'))),process[_0xebaa2(0x109)](0x1));const _0x49677c=_0x8d6709['tags']?_0x8d6709[_0xebaa2(0x12a)][_0xebaa2(0x14f)](',')[_0xebaa2(0x13a)](_0x547c29=>_0x547c29[_0xebaa2(0xf9)]()):undefined,_0x891d7e=_0x436460[_0xebaa2(0x10a)]({'title':_0x117c7e,'kind':_0x2b0ce9,'tags':_0x49677c,'priority':_0x8d6709[_0xebaa2(0x11f)],'body':_0x8d6709[_0xebaa2(0xf7)],'template':_0x8d6709['template'],'status':_0x8d6709[_0xebaa2(0x105)],'assignee':_0x8d6709[_0xebaa2(0x146)]});console['log'](chalk[_0xebaa2(0x152)](_0xebaa2(0xfb))+'\x20'+_0x891d7e[_0xebaa2(0x130)]),console['log'](chalk['dim'](_0x891d7e[_0xebaa2(0x106)]));}export async function workMoveAction(_0x47bfb8,_0x500933){const _0x39986e=a53_0x1f4c9d;!VALID_STATUSES[_0x39986e(0x128)](_0x500933)&&(console[_0x39986e(0xfa)](chalk['red']('Invalid\x20status:\x20'+_0x500933+_0x39986e(0x12e)+[...VALID_STATUSES]['join'](',\x20'))),process[_0x39986e(0x109)](0x1));const _0x13756d=getSDK(),_0x34ee30=_0x13756d['moveTask'](_0x47bfb8,_0x500933);!_0x34ee30&&(console['error'](chalk[_0x39986e(0x111)](_0x39986e(0x121)+_0x47bfb8)),process[_0x39986e(0x109)](0x1));const _0x4644b7=_0x34ee30['frontmatter'][_0x39986e(0x10e)]||_0x34ee30['fileName'];console[_0x39986e(0x14b)](chalk['green']('Moved:')+('\x20'+_0x4644b7+_0x39986e(0xfc)+statusColor(_0x500933)));}export async function workBoardAction(_0x2ad277){const _0x524678=a53_0x1f4c9d,_0x429269=getSDK(),_0x736077=buildStaleFilter(_0x2ad277),{grouped:_0x12e90b}=_0x429269['getTasksByStatus'](_0x736077);for(const [_0x24a5b6,_0x20b0ad]of Object['entries'](STATUS_PHASES)){const _0x1aa617=_0x20b0ad[_0x524678(0xf6)](_0x5be326=>_0x12e90b[_0x5be326]||[]);console[_0x524678(0x14b)](chalk[_0x524678(0xfd)][_0x524678(0x131)](_0x24a5b6)+chalk[_0x524678(0x11a)]('\x20('+_0x1aa617[_0x524678(0x141)]+')'));if(_0x1aa617[_0x524678(0x141)]===0x0)console[_0x524678(0x14b)](chalk['dim'](_0x524678(0x11e)));else for(const _0x331ba3 of _0x1aa617){const _0x2b344d=_0x331ba3[_0x524678(0x145)],_0x38119b=priorityDot(_0x2b344d[_0x524678(0x11f)]),_0x26755c=_0x2b344d[_0x524678(0x10e)]||_0x331ba3[_0x524678(0x130)],_0x227eb3=normalizeTags(_0x2b344d['tags']),_0xf3fe17=_0x227eb3['length']?chalk[_0x524678(0x11a)]('\x20['+_0x227eb3[_0x524678(0x122)](',\x20')+']'):'',_0x483710=chalk['dim']('('+_0x2b344d[_0x524678(0x105)]+')');console[_0x524678(0x14b)]('\x20\x20'+_0x38119b+'\x20'+_0x26755c+'\x20'+_0x483710+_0xf3fe17);}console[_0x524678(0x14b)]();}}export async function workShowAction(_0x24933f){const _0x144ee3=a53_0x1f4c9d,_0x29c512=getSDK(),_0x2d6465=_0x29c512[_0x144ee3(0xf8)](_0x24933f);!_0x2d6465&&(console['error'](chalk[_0x144ee3(0x111)]('Document\x20not\x20found:\x20'+_0x24933f)),process[_0x144ee3(0x109)](0x1));console[_0x144ee3(0x14b)](chalk['bold'](_0x2d6465[_0x144ee3(0x145)][_0x144ee3(0x10e)]||_0x2d6465['fileName'])),console[_0x144ee3(0x14b)](chalk[_0x144ee3(0x11a)](_0x2d6465['filePath'])),console[_0x144ee3(0x14b)]();const _0x1399da=_0x2d6465[_0x144ee3(0x145)];for(const [_0xe3bde6,_0x11fd19]of Object[_0x144ee3(0x12d)](_0x1399da)){if(_0xe3bde6==='title')continue;if(_0x11fd19===undefined||_0x11fd19===null)continue;const _0x3408e8=Array[_0x144ee3(0xf5)](_0x11fd19)?_0x11fd19[_0x144ee3(0x122)](',\x20'):String(_0x11fd19);console['log']('\x20\x20'+chalk[_0x144ee3(0x127)](_0xe3bde6)+':\x20'+_0x3408e8);}console[_0x144ee3(0x14b)]();_0x2d6465[_0x144ee3(0xf7)][_0x144ee3(0xf9)]()&&(console[_0x144ee3(0x14b)](_0x2d6465['body']['trim']()),console['log']());const _0x2b40b6=_0x29c512[_0x144ee3(0x125)](_0x2d6465[_0x144ee3(0xf7)]);if(_0x2b40b6[_0x144ee3(0x141)]>0x0){console[_0x144ee3(0x14b)](chalk[_0x144ee3(0xfd)](_0x144ee3(0xf3)));for(const _0x2ec2f7 of _0x2b40b6){const _0x5a45c6=_0x2ec2f7[_0x144ee3(0x12b)]?chalk['green']('✓'):chalk[_0x144ee3(0x111)]('✗'),_0xadc039=_0x2ec2f7[_0x144ee3(0x119)]||_0x2ec2f7[_0x144ee3(0x120)];console[_0x144ee3(0x14b)]('\x20\x20'+_0x5a45c6+_0x144ee3(0x14c)+_0xadc039+']]');}console[_0x144ee3(0x14b)]();}const _0x3d7a1b=_0x29c512[_0x144ee3(0x102)](_0x2d6465[_0x144ee3(0x130)]);if(_0x3d7a1b['length']>0x0){console['log'](chalk[_0x144ee3(0xfd)](_0x144ee3(0x135)));for(const _0x4abca0 of _0x3d7a1b){console['log'](_0x144ee3(0x150)+_0x4abca0[_0x144ee3(0x10e)]+'\x20'+chalk['dim']('('+_0x4abca0[_0x144ee3(0x138)]+')'));}}}export async function workLinksAction(_0x962de0){const _0x27dad2=a53_0x1f4c9d,_0x242d77=getSDK(),_0x307960=_0x242d77[_0x27dad2(0xf8)](_0x962de0);!_0x307960&&(console[_0x27dad2(0xfa)](chalk[_0x27dad2(0x111)](_0x27dad2(0x121)+_0x962de0)),process['exit'](0x1));const _0x5bbb4e=_0x307960['frontmatter']['title']||_0x307960[_0x27dad2(0x130)];console[_0x27dad2(0x14b)](chalk[_0x27dad2(0xfd)](_0x27dad2(0x113)+_0x5bbb4e)),console[_0x27dad2(0x14b)]();const _0x34bd16=_0x242d77[_0x27dad2(0x125)](_0x307960[_0x27dad2(0xf7)]);if(_0x34bd16[_0x27dad2(0x141)]>0x0){console[_0x27dad2(0x14b)](chalk[_0x27dad2(0xfd)]('Outgoing'));for(const _0xe2cac2 of _0x34bd16){const _0x4d0700=_0xe2cac2[_0x27dad2(0x12b)]?chalk['green']('✓'):chalk[_0x27dad2(0x111)]('✗'),_0x2c8611=_0xe2cac2[_0x27dad2(0x119)]||_0xe2cac2[_0x27dad2(0x120)],_0x40c682=_0xe2cac2[_0x27dad2(0x13b)]?chalk['dim']('\x20('+_0xe2cac2[_0x27dad2(0x13b)]+')'):'';console[_0x27dad2(0x14b)]('\x20\x20'+_0x4d0700+_0x27dad2(0x14c)+_0x2c8611+']]'+_0x40c682);}}else console[_0x27dad2(0x14b)](chalk['dim'](_0x27dad2(0xf2)));console[_0x27dad2(0x14b)]();const _0x2a6862=_0x242d77[_0x27dad2(0x102)](_0x307960['fileName']);if(_0x2a6862[_0x27dad2(0x141)]>0x0){console[_0x27dad2(0x14b)](chalk[_0x27dad2(0xfd)]('Incoming'));for(const _0x238cbc of _0x2a6862){console[_0x27dad2(0x14b)](_0x27dad2(0x150)+_0x238cbc['title']+'\x20'+chalk['dim']('('+_0x238cbc[_0x27dad2(0x138)]+')'));}}else console[_0x27dad2(0x14b)](chalk[_0x27dad2(0x11a)]('No\x20incoming\x20backlinks'));}export async function workOpenAction(_0x46c306){const _0x2fe989=a53_0x1f4c9d,_0x30d308=getSDK(),_0x272849=_0x30d308[_0x2fe989(0xf8)](_0x46c306);!_0x272849&&(console['error'](chalk[_0x2fe989(0x111)]('Document\x20not\x20found:\x20'+_0x46c306)),process['exit'](0x1));const _0x44bd9a=process.env.EDITOR||'vi';try{execFileSync(_0x44bd9a,[_0x272849['filePath']],{'stdio':_0x2fe989(0x10c)});}catch{console[_0x2fe989(0xfa)](chalk['red'](_0x2fe989(0x124)+_0x44bd9a)),process[_0x2fe989(0x109)](0x1);}}
|
|
1
|
+
const a53_0x1bf039=a53_0x5b31;(function(_0xd7c401,_0x39117a){const _0x2b1f55=a53_0x5b31,_0x208748=_0xd7c401();while(!![]){try{const _0x5c3ce2=parseInt(_0x2b1f55(0x223))/0x1+-parseInt(_0x2b1f55(0x233))/0x2*(parseInt(_0x2b1f55(0x21b))/0x3)+parseInt(_0x2b1f55(0x1f3))/0x4+-parseInt(_0x2b1f55(0x234))/0x5+parseInt(_0x2b1f55(0x20f))/0x6+parseInt(_0x2b1f55(0x21a))/0x7+parseInt(_0x2b1f55(0x207))/0x8*(-parseInt(_0x2b1f55(0x1e3))/0x9);if(_0x5c3ce2===_0x39117a)break;else _0x208748['push'](_0x208748['shift']());}catch(_0x415066){_0x208748['push'](_0x208748['shift']());}}}(a53_0x4393,0xb71da));import{getChalk}from'../utils/colors.js';const chalk=getChalk();import{execFileSync}from'node:child_process';import a53_0x3e4f95 from'node:path';import{WorkspaceSDK,resolveWorkspacePath,normalizeTags}from'../sdk/workspace/index.js';function a53_0x4393(){const _0x231901=['yellow','initAt','filePath','priority','done','body','red','Wiki-links','days','gray','dim','github','.\x20Valid:\x20','133713ycFUMT','\x20to\x20create\x20one,\x20or\x20navigate\x20to\x20a\x20directory\x20containing\x20tdx.json.','\x20[[','map','frontmatter','isArray','void','\x20\x20←\x20','Invalid\x20priority:\x20','all','in_progress','Links\x20for:\x20','medium','taskCounts','resolvedPath','resolvedKind','2712656CaFjWA','guide','fileName','Invalid\x20status:\x20','reference','split','assignee','No\x20incoming\x20backlinks','trim','goals','getBacklinks','Incoming','planning','repeat','kind','log','moveTask','tags','path','green','472BIenwM','low','magenta','critical','progress','reduce','Workspace\x20initialized:','round','6567318HWJJlo','displayText','Document\x20not\x20found:\x20','status','workspacePath','bold','error','template','underline','entries','join','10085502mGpndX','51PUHRrz','Workspace\x20initialized\x20in\x20current\x20directory','has','Failed\x20to\x20open\x20editor:\x20','Workspace:\x20','No\x20workspace\x20found.','Moved:','No\x20outgoing\x20wiki-links','268611DTIKvB','todo','title','\x20Run\x20','slug','No\x20tasks\x20yet.\x20Create\x20one\x20with:\x20tdx\x20work\x20new\x20<title>','\x20\x20(empty)','tdx\x20work\x20init\x20<name>','readDocument','workflow','exit','\x20→\x20','getSummary','length','cwd','cyan','71590yGbSiD','6234970ytMfEF','blue'];a53_0x4393=function(){return _0x231901;};return a53_0x4393();}import{STATUS_PHASES,ALL_STATUSES}from'../sdk/types/workspace.js';function buildStaleFilter(_0x3a5016){const _0x57c0b7=a53_0x5b31;if(_0x3a5016[_0x57c0b7(0x1ec)])return{'includeStale':!![]};if(_0x3a5016[_0x57c0b7(0x23e)])return{'updatedWithin':parseInt(_0x3a5016[_0x57c0b7(0x23e)],0xa)};return undefined;}const VALID_KINDS=new Set(['item','goal',a53_0x1bf039(0x1f4),'note',a53_0x1bf039(0x1f7),a53_0x1bf039(0x22c),a53_0x1bf039(0x216)]),VALID_PRIORITIES=new Set([a53_0x1bf039(0x20a),'high',a53_0x1bf039(0x1ef),a53_0x1bf039(0x208)]),VALID_STATUSES=new Set(ALL_STATUSES);function getSDK(){const _0x5b24fc=a53_0x1bf039,_0xc47c6=resolveWorkspacePath();return!_0xc47c6&&(console[_0x5b24fc(0x215)](chalk[_0x5b24fc(0x23c)](_0x5b24fc(0x220))+_0x5b24fc(0x226)+chalk[_0x5b24fc(0x232)](_0x5b24fc(0x22a))+_0x5b24fc(0x1e4)),process[_0x5b24fc(0x22d)](0x1)),new WorkspaceSDK(_0xc47c6);}function priorityDot(_0x4db907){const _0x37f280=a53_0x1bf039;switch(_0x4db907){case _0x37f280(0x20a):return chalk[_0x37f280(0x23c)]('●');case'high':return chalk[_0x37f280(0x236)]('●');case _0x37f280(0x1ef):return chalk[_0x37f280(0x235)]('●');case'low':return chalk[_0x37f280(0x23f)]('●');default:return chalk[_0x37f280(0x235)]('●');}}function statusColor(_0x9334b9){const _0x2f071c=a53_0x1bf039;switch(_0x9334b9){case _0x2f071c(0x23a):return chalk['green'](_0x9334b9);case _0x2f071c(0x1e9):return chalk[_0x2f071c(0x23f)](_0x9334b9);case _0x2f071c(0x1ed):return chalk[_0x2f071c(0x232)](_0x9334b9);case'review':return chalk[_0x2f071c(0x209)](_0x9334b9);case _0x2f071c(0x1ff):case'design_review':return chalk[_0x2f071c(0x236)](_0x9334b9);case _0x2f071c(0x224):return chalk['white'](_0x9334b9);case'backlog':return chalk['dim'](_0x9334b9);default:return _0x9334b9;}}export async function workSummaryAction(_0x48b93d){const _0x5482f9=a53_0x1bf039,_0x294166=getSDK(),_0x41361f=buildStaleFilter(_0x48b93d),_0x3ea3a4=_0x294166[_0x5482f9(0x22f)](_0x41361f);console['log'](chalk['bold'](_0x5482f9(0x21f)+_0x3ea3a4['name'])),console[_0x5482f9(0x202)](chalk[_0x5482f9(0x1e0)](_0x3ea3a4[_0x5482f9(0x205)])),console['log']();const _0x7c2cb5=Object['values'](_0x3ea3a4[_0x5482f9(0x1f0)])[_0x5482f9(0x20c)]((_0x238d91,_0xa25b83)=>_0x238d91+_0xa25b83,0x0);if(_0x7c2cb5===0x0)console[_0x5482f9(0x202)](chalk[_0x5482f9(0x1e0)](_0x5482f9(0x228)));else{console[_0x5482f9(0x202)](chalk[_0x5482f9(0x214)]('Tasks'));for(const [_0x20360b,_0x4b20d8]of Object[_0x5482f9(0x218)](_0x3ea3a4[_0x5482f9(0x1f0)])){_0x4b20d8>0x0&&console['log']('\x20\x20'+statusColor(_0x20360b)+':\x20'+_0x4b20d8);}console[_0x5482f9(0x202)]();}if(_0x3ea3a4[_0x5482f9(0x1fc)]['length']>0x0){console[_0x5482f9(0x202)](chalk['bold']('Goals'));for(const _0x213eb8 of _0x3ea3a4['goals']){const _0x15b258=progressBar(_0x213eb8[_0x5482f9(0x20b)]);console[_0x5482f9(0x202)]('\x20\x20'+_0x213eb8[_0x5482f9(0x225)]+'\x20'+_0x15b258+'\x20'+_0x213eb8[_0x5482f9(0x20b)]+'%');}}}function a53_0x5b31(_0x11a8d0,_0x1ec5fb){_0x11a8d0=_0x11a8d0-0x1e0;const _0x43932d=a53_0x4393();let _0x5b3173=_0x43932d[_0x11a8d0];return _0x5b3173;}function progressBar(_0x30fcf4){const _0xd759bf=a53_0x1bf039,_0x316067=0x14,_0x3e035b=Math[_0xd759bf(0x20e)](_0x30fcf4/0x64*_0x316067),_0xed38d0=_0x316067-_0x3e035b;return chalk[_0xd759bf(0x206)]('█'[_0xd759bf(0x200)](_0x3e035b))+chalk['dim']('░'[_0xd759bf(0x200)](_0xed38d0));}export async function workInitAction(_0x479ba1,_0x2ea592){const _0x34f121=a53_0x1bf039,_0x3e0d4e=_0x479ba1||a53_0x3e4f95['basename'](process['cwd']());if(_0x2ea592[_0x34f121(0x1e1)]){const _0x3dee86=WorkspaceSDK[_0x34f121(0x237)](_0x3e0d4e,{'github':_0x2ea592[_0x34f121(0x1e1)]});console['log'](chalk[_0x34f121(0x206)]('Workspace\x20initialized:')+'\x20'+_0x3dee86[_0x34f121(0x213)]),console[_0x34f121(0x202)](chalk['dim']('Linked\x20to\x20GitHub:\x20'+_0x2ea592['github']));}else{if(_0x479ba1){const _0x38fa4b=WorkspaceSDK['initAt'](_0x479ba1);console[_0x34f121(0x202)](chalk['green'](_0x34f121(0x20d))+'\x20'+_0x38fa4b[_0x34f121(0x213)]);}else{const _0x4aa177=new WorkspaceSDK(process[_0x34f121(0x231)]());_0x4aa177['init'](_0x3e0d4e),console[_0x34f121(0x202)](chalk[_0x34f121(0x206)](_0x34f121(0x21c)));}}}export async function workNewAction(_0x26d520,_0x17af41){const _0x3b2c03=a53_0x1bf039,_0x3074d6=getSDK(),_0x5094c9=_0x17af41[_0x3b2c03(0x201)]||'item';!VALID_KINDS[_0x3b2c03(0x21d)](_0x5094c9)&&(console['error'](chalk[_0x3b2c03(0x23c)]('Invalid\x20kind:\x20'+_0x5094c9+_0x3b2c03(0x1e2)+[...VALID_KINDS][_0x3b2c03(0x219)](',\x20'))),process[_0x3b2c03(0x22d)](0x1));_0x17af41[_0x3b2c03(0x239)]&&!VALID_PRIORITIES[_0x3b2c03(0x21d)](_0x17af41['priority'])&&(console[_0x3b2c03(0x215)](chalk[_0x3b2c03(0x23c)](_0x3b2c03(0x1eb)+_0x17af41['priority']+_0x3b2c03(0x1e2)+[...VALID_PRIORITIES][_0x3b2c03(0x219)](',\x20'))),process['exit'](0x1));_0x17af41[_0x3b2c03(0x212)]&&!VALID_STATUSES['has'](_0x17af41[_0x3b2c03(0x212)])&&(console['error'](chalk[_0x3b2c03(0x23c)]('Invalid\x20status:\x20'+_0x17af41['status']+'.\x20Valid:\x20'+[...VALID_STATUSES][_0x3b2c03(0x219)](',\x20'))),process['exit'](0x1));const _0x471c68=_0x17af41[_0x3b2c03(0x204)]?_0x17af41['tags'][_0x3b2c03(0x1f8)](',')[_0x3b2c03(0x1e6)](_0x45c2bf=>_0x45c2bf[_0x3b2c03(0x1fb)]()):undefined,_0x57abae=_0x3074d6['createDocument']({'title':_0x26d520,'kind':_0x5094c9,'tags':_0x471c68,'priority':_0x17af41[_0x3b2c03(0x239)],'body':_0x17af41[_0x3b2c03(0x23b)],'template':_0x17af41[_0x3b2c03(0x216)],'status':_0x17af41[_0x3b2c03(0x212)],'assignee':_0x17af41[_0x3b2c03(0x1f9)]});console[_0x3b2c03(0x202)](chalk['green']('Created:')+'\x20'+_0x57abae[_0x3b2c03(0x1f5)]),console['log'](chalk[_0x3b2c03(0x1e0)](_0x57abae[_0x3b2c03(0x238)]));}export async function workMoveAction(_0x139b8c,_0x23572a){const _0x3c13c6=a53_0x1bf039;!VALID_STATUSES[_0x3c13c6(0x21d)](_0x23572a)&&(console[_0x3c13c6(0x215)](chalk[_0x3c13c6(0x23c)](_0x3c13c6(0x1f6)+_0x23572a+_0x3c13c6(0x1e2)+[...VALID_STATUSES][_0x3c13c6(0x219)](',\x20'))),process['exit'](0x1));const _0x2f3561=getSDK(),_0x2d9a13=_0x2f3561[_0x3c13c6(0x203)](_0x139b8c,_0x23572a);!_0x2d9a13&&(console['error'](chalk['red'](_0x3c13c6(0x211)+_0x139b8c)),process['exit'](0x1));const _0x2ac8f3=_0x2d9a13[_0x3c13c6(0x1e7)][_0x3c13c6(0x225)]||_0x2d9a13[_0x3c13c6(0x1f5)];console[_0x3c13c6(0x202)](chalk[_0x3c13c6(0x206)](_0x3c13c6(0x221))+('\x20'+_0x2ac8f3+_0x3c13c6(0x22e)+statusColor(_0x23572a)));}export async function workBoardAction(_0x39302c){const _0x1d60c1=a53_0x1bf039,_0x67b9c8=getSDK(),_0x11eb44=buildStaleFilter(_0x39302c),{grouped:_0x3ac008}=_0x67b9c8['getTasksByStatus'](_0x11eb44);for(const [_0x7f11b1,_0x2cd66f]of Object[_0x1d60c1(0x218)](STATUS_PHASES)){const _0x38cb7e=_0x2cd66f['flatMap'](_0x15eeb7=>_0x3ac008[_0x15eeb7]||[]);console[_0x1d60c1(0x202)](chalk[_0x1d60c1(0x214)][_0x1d60c1(0x217)](_0x7f11b1)+chalk[_0x1d60c1(0x1e0)]('\x20('+_0x38cb7e[_0x1d60c1(0x230)]+')'));if(_0x38cb7e['length']===0x0)console[_0x1d60c1(0x202)](chalk[_0x1d60c1(0x1e0)](_0x1d60c1(0x229)));else for(const _0xd7f38b of _0x38cb7e){const _0x43b8f3=_0xd7f38b['frontmatter'],_0x1be634=priorityDot(_0x43b8f3[_0x1d60c1(0x239)]),_0x40e5f2=_0x43b8f3[_0x1d60c1(0x225)]||_0xd7f38b[_0x1d60c1(0x1f5)],_0x51e7ee=normalizeTags(_0x43b8f3[_0x1d60c1(0x204)]),_0x5967f0=_0x51e7ee[_0x1d60c1(0x230)]?chalk[_0x1d60c1(0x1e0)]('\x20['+_0x51e7ee[_0x1d60c1(0x219)](',\x20')+']'):'',_0x6abce6=chalk[_0x1d60c1(0x1e0)]('('+_0x43b8f3[_0x1d60c1(0x212)]+')');console[_0x1d60c1(0x202)]('\x20\x20'+_0x1be634+'\x20'+_0x40e5f2+'\x20'+_0x6abce6+_0x5967f0);}console[_0x1d60c1(0x202)]();}}export async function workShowAction(_0x3ebcf4){const _0x1de422=a53_0x1bf039,_0x576878=getSDK(),_0x98ae82=_0x576878[_0x1de422(0x22b)](_0x3ebcf4);!_0x98ae82&&(console['error'](chalk['red']('Document\x20not\x20found:\x20'+_0x3ebcf4)),process[_0x1de422(0x22d)](0x1));console[_0x1de422(0x202)](chalk['bold'](_0x98ae82[_0x1de422(0x1e7)]['title']||_0x98ae82[_0x1de422(0x1f5)])),console[_0x1de422(0x202)](chalk[_0x1de422(0x1e0)](_0x98ae82[_0x1de422(0x238)])),console[_0x1de422(0x202)]();const _0x563458=_0x98ae82[_0x1de422(0x1e7)];for(const [_0xc3b093,_0x34b11f]of Object['entries'](_0x563458)){if(_0xc3b093===_0x1de422(0x225))continue;if(_0x34b11f===undefined||_0x34b11f===null)continue;const _0x5849c6=Array[_0x1de422(0x1e8)](_0x34b11f)?_0x34b11f[_0x1de422(0x219)](',\x20'):String(_0x34b11f);console[_0x1de422(0x202)]('\x20\x20'+chalk['cyan'](_0xc3b093)+':\x20'+_0x5849c6);}console[_0x1de422(0x202)]();_0x98ae82[_0x1de422(0x23b)][_0x1de422(0x1fb)]()&&(console[_0x1de422(0x202)](_0x98ae82[_0x1de422(0x23b)][_0x1de422(0x1fb)]()),console[_0x1de422(0x202)]());const _0x3879f4=_0x576878['resolveWikiLinks'](_0x98ae82[_0x1de422(0x23b)]);if(_0x3879f4[_0x1de422(0x230)]>0x0){console[_0x1de422(0x202)](chalk[_0x1de422(0x214)](_0x1de422(0x23d)));for(const _0x183829 of _0x3879f4){const _0x558576=_0x183829['resolvedPath']?chalk[_0x1de422(0x206)]('✓'):chalk[_0x1de422(0x23c)]('✗'),_0x29bc6d=_0x183829['displayText']||_0x183829[_0x1de422(0x227)];console[_0x1de422(0x202)]('\x20\x20'+_0x558576+_0x1de422(0x1e5)+_0x29bc6d+']]');}console[_0x1de422(0x202)]();}const _0x51cfc7=_0x576878['getBacklinks'](_0x98ae82[_0x1de422(0x1f5)]);if(_0x51cfc7[_0x1de422(0x230)]>0x0){console[_0x1de422(0x202)](chalk[_0x1de422(0x214)]('Backlinks'));for(const _0x44967b of _0x51cfc7){console[_0x1de422(0x202)](_0x1de422(0x1ea)+_0x44967b[_0x1de422(0x225)]+'\x20'+chalk[_0x1de422(0x1e0)]('('+_0x44967b['kind']+')'));}}}export async function workLinksAction(_0x8d0810){const _0x4d24b2=a53_0x1bf039,_0x5b6bb7=getSDK(),_0x351ce3=_0x5b6bb7[_0x4d24b2(0x22b)](_0x8d0810);!_0x351ce3&&(console[_0x4d24b2(0x215)](chalk[_0x4d24b2(0x23c)](_0x4d24b2(0x211)+_0x8d0810)),process['exit'](0x1));const _0x30684b=_0x351ce3[_0x4d24b2(0x1e7)]['title']||_0x351ce3['fileName'];console[_0x4d24b2(0x202)](chalk[_0x4d24b2(0x214)](_0x4d24b2(0x1ee)+_0x30684b)),console[_0x4d24b2(0x202)]();const _0x58e818=_0x5b6bb7['resolveWikiLinks'](_0x351ce3['body']);if(_0x58e818['length']>0x0){console[_0x4d24b2(0x202)](chalk[_0x4d24b2(0x214)]('Outgoing'));for(const _0x4c650a of _0x58e818){const _0x4f23bf=_0x4c650a[_0x4d24b2(0x1f1)]?chalk[_0x4d24b2(0x206)]('✓'):chalk[_0x4d24b2(0x23c)]('✗'),_0x2c8f29=_0x4c650a[_0x4d24b2(0x210)]||_0x4c650a[_0x4d24b2(0x227)],_0x3d0691=_0x4c650a[_0x4d24b2(0x1f2)]?chalk[_0x4d24b2(0x1e0)]('\x20('+_0x4c650a[_0x4d24b2(0x1f2)]+')'):'';console[_0x4d24b2(0x202)]('\x20\x20'+_0x4f23bf+'\x20[['+_0x2c8f29+']]'+_0x3d0691);}}else console[_0x4d24b2(0x202)](chalk['dim'](_0x4d24b2(0x222)));console[_0x4d24b2(0x202)]();const _0xe223ea=_0x5b6bb7[_0x4d24b2(0x1fd)](_0x351ce3[_0x4d24b2(0x1f5)]);if(_0xe223ea[_0x4d24b2(0x230)]>0x0){console[_0x4d24b2(0x202)](chalk['bold'](_0x4d24b2(0x1fe)));for(const _0x10f6ca of _0xe223ea){console[_0x4d24b2(0x202)]('\x20\x20←\x20'+_0x10f6ca[_0x4d24b2(0x225)]+'\x20'+chalk[_0x4d24b2(0x1e0)]('('+_0x10f6ca[_0x4d24b2(0x201)]+')'));}}else console['log'](chalk[_0x4d24b2(0x1e0)](_0x4d24b2(0x1fa)));}export async function workOpenAction(_0x534820){const _0x257e96=a53_0x1bf039,_0x231273=getSDK(),_0x15ca34=_0x231273[_0x257e96(0x22b)](_0x534820);!_0x15ca34&&(console[_0x257e96(0x215)](chalk[_0x257e96(0x23c)]('Document\x20not\x20found:\x20'+_0x534820)),process[_0x257e96(0x22d)](0x1));const _0x84b39a=process.env.EDITOR||'vi';try{execFileSync(_0x84b39a,[_0x15ca34[_0x257e96(0x238)]],{'stdio':'inherit'});}catch{console[_0x257e96(0x215)](chalk[_0x257e96(0x23c)](_0x257e96(0x21e)+_0x84b39a)),process['exit'](0x1);}}
|