@treasuredata/tdx 0.12.0 → 0.12.1
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 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-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/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-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/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-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/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.d.ts +2 -4
- package/dist/core/auth.d.ts.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/auth.js.map +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.d.ts +2 -1
- 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.d.ts +45 -0
- package/dist/core/version.d.ts.map +1 -0
- package/dist/core/version.js +1 -0
- package/dist/core/version.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.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/api.js +1 -1
- package/dist/sdk/client/cdp-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/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/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-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.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-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-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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.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/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/tree-formatter.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/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/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.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
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x3a022f=a36_0x5119;(function(_0x3c0ec1,_0x198b3a){const _0xaa075b=a36_0x5119,_0x4b8c51=_0x3c0ec1();while(!![]){try{const _0x4a0d8d=parseInt(_0xaa075b(0x11e))/0x1*(-parseInt(_0xaa075b(0x105))/0x2)+parseInt(_0xaa075b(0xfa))/0x3*(parseInt(_0xaa075b(0x119))/0x4)+parseInt(_0xaa075b(0x101))/0x5+parseInt(_0xaa075b(0x108))/0x6*(-parseInt(_0xaa075b(0x113))/0x7)+-parseInt(_0xaa075b(0x109))/0x8*(-parseInt(_0xaa075b(0x116))/0x9)+-parseInt(_0xaa075b(0x10d))/0xa+-parseInt(_0xaa075b(0xfb))/0xb*(-parseInt(_0xaa075b(0x102))/0xc);if(_0x4a0d8d===_0x198b3a)break;else _0x4b8c51['push'](_0x4b8c51['shift']());}catch(_0x416938){_0x4b8c51['push'](_0x4b8c51['shift']());}}}(a36_0x42df,0x71f23));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists}from'../core/profile.js';function a36_0x42df(){const _0x395916=['190860tTsJuU','12jCMDqA','displayWithSources','execute','1166kCmIlP','log','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','246BCFEic','1088tdyZUo','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','Session\x20llm_project\x20set\x20to:\x20','Invalid\x20resource:\x20','8448800ZjrbaR','dim','clear','green','profile','session','116501rztuMS','description','Session\x20parent_segment\x20set\x20to:\x20','9027WkMENB','Session\x20agent\x20set\x20to:\x20','debug','20jlGdmu','validate','toString','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','agent','471qUHhLI','llm_agent','error','llm_project','Error:\x20Profile\x20\x27','Session\x20database\x20set\x20to:\x20','message','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','database','join','use','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','length','engage_workspace','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','355698sctpkl','16512639BbyoeJ','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','\x27\x20does\x20not\x20exist','(session:\x20','parent_segment','includes'];a36_0x42df=function(){return _0x395916;};return a36_0x42df();}import{GlobalContext}from'../core/global-context.js';function a36_0x5119(_0x39bd88,_0x33a43c){_0x39bd88=_0x39bd88-0xec;const _0x42dfc2=a36_0x42df();let _0x511939=_0x42dfc2[_0x39bd88];return _0x511939;}import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import a36_0x585f57 from'chalk';export class UseCommand extends BaseCommand{['name']=a36_0x3a022f(0xf5);[a36_0x3a022f(0x114)]='Set\x20session-level\x20context';[a36_0x3a022f(0x11a)](_0x5971a9){const _0x374b4b=a36_0x3a022f,{args:_0x39b6f9}=_0x5971a9;if(_0x39b6f9['length']===0x0)return undefined;if(_0x39b6f9[_0x374b4b(0xf7)]===0x1)return _0x374b4b(0x11c)+'\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'+_0x374b4b(0xfc)+_0x374b4b(0xf9)+_0x374b4b(0xf2);const _0x2f9485=_0x39b6f9[0x0],_0x1da75b=['database',_0x374b4b(0xff),_0x374b4b(0xee),_0x374b4b(0x11d),_0x374b4b(0x111),_0x374b4b(0xf8)];if(!_0x1da75b[_0x374b4b(0x100)](_0x2f9485))return _0x374b4b(0x10c)+_0x2f9485+'.\x20Must\x20be\x20one\x20of:\x20'+_0x1da75b[_0x374b4b(0xf4)](',\x20');return undefined;}async[a36_0x3a022f(0x104)](_0x1e958a){const _0x15b229=a36_0x3a022f,{args:_0xeac5d8,options:_0x1cd54e}=_0x1e958a,_0x251262=_0x1cd54e[_0x15b229(0x118)],_0x4184f0=_0x1cd54e[_0x15b229(0x10f)];cleanExpiredSessions();try{if(_0x4184f0){clearSessionContext(_0x1cd54e['session']);const _0x5dc33a=_0x1cd54e[_0x15b229(0x112)]||getCurrentSessionPID()['toString']();return console[_0x15b229(0x106)]('Session\x20context\x20'+a36_0x585f57[_0x15b229(0x110)]('cleared')+'\x20'+a36_0x585f57[_0x15b229(0x10e)](_0x15b229(0xfe)+_0x5dc33a+')')),0x0;}if(_0xeac5d8['length']===0x0){const _0x153aef=new GlobalContext(_0x1cd54e);return _0x251262?_0x153aef[_0x15b229(0x103)]():_0x153aef['display'](),console['log'](a36_0x585f57[_0x15b229(0x10e)](_0x15b229(0x10a))),console[_0x15b229(0x106)](a36_0x585f57[_0x15b229(0x10e)]('Resources:\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace')),0x0;}const _0x4ad02e=_0xeac5d8[0x0],_0xbd1429=_0xeac5d8[0x1];if(_0x4ad02e===_0x15b229(0x111)){if(!profileExists(_0xbd1429))return console[_0x15b229(0xed)](_0x15b229(0xef)+_0xbd1429+_0x15b229(0xfd)),console[_0x15b229(0xed)](_0x15b229(0xf6)),0x1;const _0x41e02d=_0x1cd54e[_0x15b229(0x112)]||getCurrentSessionPID()[_0x15b229(0x11b)]();return saveSessionContext({'profile':_0xbd1429},_0x1cd54e['session']),console[_0x15b229(0x106)]('Session\x20profile\x20set\x20to:\x20'+a36_0x585f57[_0x15b229(0x110)](_0xbd1429)+'\x20'+a36_0x585f57['dim'](_0x15b229(0xfe)+_0x41e02d+')')),console[_0x15b229(0x106)](a36_0x585f57[_0x15b229(0x10e)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}const _0x1fbb6a={},_0x56728c=_0x1cd54e[_0x15b229(0x112)]||getCurrentSessionPID()[_0x15b229(0x11b)]();switch(_0x4ad02e){case _0x15b229(0xf3):_0x1fbb6a[_0x15b229(0xf3)]=_0xbd1429,console[_0x15b229(0x106)](_0x15b229(0xf0)+a36_0x585f57['green'](_0xbd1429)+'\x20'+a36_0x585f57[_0x15b229(0x10e)](_0x15b229(0xfe)+_0x56728c+')'));break;case _0x15b229(0xff):_0x1fbb6a[_0x15b229(0xff)]=_0xbd1429,console[_0x15b229(0x106)](_0x15b229(0x115)+a36_0x585f57['green'](_0xbd1429)+'\x20'+a36_0x585f57[_0x15b229(0x10e)](_0x15b229(0xfe)+_0x56728c+')'));break;case _0x15b229(0xee):_0x1fbb6a[_0x15b229(0xee)]=_0xbd1429,console['log'](_0x15b229(0x10b)+a36_0x585f57['green'](_0xbd1429)+'\x20'+a36_0x585f57[_0x15b229(0x10e)](_0x15b229(0xfe)+_0x56728c+')'));break;case _0x15b229(0x11d):{const {projectName:_0x4bbeb2,agentName:_0x529036}=parseAgentRef(_0xbd1429);_0x529036?(_0x1fbb6a['llm_project']=_0x4bbeb2,_0x1fbb6a[_0x15b229(0xec)]=_0x529036,console[_0x15b229(0x106)](_0x15b229(0x10b)+a36_0x585f57[_0x15b229(0x110)](_0x4bbeb2)+'\x20'+a36_0x585f57['dim'](_0x15b229(0xfe)+_0x56728c+')')),console[_0x15b229(0x106)](_0x15b229(0x117)+a36_0x585f57['green'](_0x529036)+'\x20'+a36_0x585f57[_0x15b229(0x10e)]('(session:\x20'+_0x56728c+')'))):(_0x1fbb6a[_0x15b229(0xec)]=_0xbd1429,console[_0x15b229(0x106)](_0x15b229(0x117)+a36_0x585f57[_0x15b229(0x110)](_0xbd1429)+'\x20'+a36_0x585f57['dim'](_0x15b229(0xfe)+_0x56728c+')')));break;}case _0x15b229(0xf8):_0x1fbb6a[_0x15b229(0xf8)]=_0xbd1429,console[_0x15b229(0x106)]('Session\x20engage_workspace\x20set\x20to:\x20'+a36_0x585f57[_0x15b229(0x110)](_0xbd1429)+'\x20'+a36_0x585f57[_0x15b229(0x10e)](_0x15b229(0xfe)+_0x56728c+')'));break;}return saveSessionContext(_0x1fbb6a,_0x1cd54e[_0x15b229(0x112)]),console[_0x15b229(0x106)](a36_0x585f57[_0x15b229(0x10e)](_0x15b229(0x107))),0x0;}catch(_0x537a38){return _0x537a38 instanceof Error&&console[_0x15b229(0xed)]('Error:\x20'+_0x537a38[_0x15b229(0xf1)]),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x4b2bf6=a37_0x5230;(function(_0x463e29,_0x9c4a2d){const _0x11c3cb=a37_0x5230,_0x580324=_0x463e29();while(!![]){try{const _0x43a4b7=parseInt(_0x11c3cb(0x1c0))/0x1*(-parseInt(_0x11c3cb(0x1bf))/0x2)+-parseInt(_0x11c3cb(0x1ba))/0x3+-parseInt(_0x11c3cb(0x1c4))/0x4+-parseInt(_0x11c3cb(0x1cb))/0x5+-parseInt(_0x11c3cb(0x1cc))/0x6+-parseInt(_0x11c3cb(0x1be))/0x7+parseInt(_0x11c3cb(0x1b6))/0x8;if(_0x43a4b7===_0x9c4a2d)break;else _0x580324['push'](_0x580324['shift']());}catch(_0x48b526){_0x580324['push'](_0x580324['shift']());}}}(a37_0x48a0,0xd3430));function a37_0x5230(_0x401edf,_0x7c28c4){_0x401edf=_0x401edf-0x1b6;const _0x48a02e=a37_0x48a0();let _0x523073=_0x48a02e[_0x401edf];return _0x523073;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a37_0x48a0(){const _0x44ae2b=['\x20user','length','user','\x20\x20Cause:\x20','description','verbose','5555120bDTizk','3830454inDLIf','53493648UIigeI','error','name','Fetching\x20user\x20info...','3786897JvtTEB','execute','Show\x20current\x20user\x20information','Error:\x20','8008077XPGDom','1794oUKkYI','269zfktjN','getCurrent','cause','message','5697368SdtjUY'];a37_0x48a0=function(){return _0x44ae2b;};return a37_0x48a0();}import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{['name']='user';[a37_0x4b2bf6(0x1c9)]=a37_0x4b2bf6(0x1bc);async[a37_0x4b2bf6(0x1bb)](_0x25f3f3){const _0x2ad02a=a37_0x4b2bf6,{options:_0x365d8c,tdx:_0xee73b2}=_0x25f3f3;try{const _0x671dfd=await withSpinner(_0x2ad02a(0x1b9),()=>_0xee73b2[_0x2ad02a(0x1c7)][_0x2ad02a(0x1c1)](),{'verbose':_0x365d8c[_0x2ad02a(0x1ca)]}),_0x18bf71=_0x671dfd['data'];return await handleSingleObjectOutput(_0x18bf71,_0x365d8c),0x0;}catch(_0x54bdd5){if(_0x54bdd5 instanceof SDKError)return console[_0x2ad02a(0x1b7)](_0x2ad02a(0x1bd)+_0x54bdd5[_0x2ad02a(0x1c3)]),_0x54bdd5[_0x2ad02a(0x1c2)]&&console['error']('\x20\x20Cause:\x20'+_0x54bdd5[_0x2ad02a(0x1c2)]),0x1;throw _0x54bdd5;}}}export class UserListCommand extends BaseCommand{[a37_0x4b2bf6(0x1b8)]='user\x20list';[a37_0x4b2bf6(0x1c9)]='List\x20all\x20users\x20in\x20the\x20account';async[a37_0x4b2bf6(0x1bb)](_0xc5bde8){const _0x5a47fd=a37_0x4b2bf6,{options:_0x12ffa0,tdx:_0x568138}=_0xc5bde8;try{const _0x3d37bc=await withSpinner('Listing\x20users...',()=>_0x568138[_0x5a47fd(0x1c7)]['list'](),{'verbose':_0x12ffa0[_0x5a47fd(0x1ca)]}),_0x85e04d=_0x3d37bc['data'];return console[_0x5a47fd(0x1b7)]('✔\x20Found\x20'+_0x85e04d[_0x5a47fd(0x1c6)]+_0x5a47fd(0x1c5)+(_0x85e04d[_0x5a47fd(0x1c6)]!==0x1?'s':'')),await handleSDKOutput(_0x85e04d,_0x12ffa0),0x0;}catch(_0x9fda23){if(_0x9fda23 instanceof SDKError)return console[_0x5a47fd(0x1b7)]('Error:\x20'+_0x9fda23[_0x5a47fd(0x1c3)]),_0x9fda23[_0x5a47fd(0x1c2)]&&console[_0x5a47fd(0x1b7)](_0x5a47fd(0x1c8)+_0x9fda23[_0x5a47fd(0x1c2)]),0x1;throw _0x9fda23;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a38_0x2b10d1=a38_0x4cce;(function(_0x69a56a,_0x370819){const _0xc928a9=a38_0x4cce,_0x2f6b0f=_0x69a56a();while(!![]){try{const _0x2586c4=-parseInt(_0xc928a9(0x170))/0x1*(-parseInt(_0xc928a9(0x19f))/0x2)+parseInt(_0xc928a9(0xca))/0x3*(parseInt(_0xc928a9(0xaa))/0x4)+parseInt(_0xc928a9(0xf5))/0x5+-parseInt(_0xc928a9(0xf0))/0x6+-parseInt(_0xc928a9(0xde))/0x7+-parseInt(_0xc928a9(0x13d))/0x8+parseInt(_0xc928a9(0x10e))/0x9;if(_0x2586c4===_0x370819)break;else _0x2f6b0f['push'](_0x2f6b0f['shift']());}catch(_0x1a89de){_0x2f6b0f['push'](_0x2f6b0f['shift']());}}}(a38_0x28eb,0xb7ee3));import a38_0x36276d from'chalk';import{existsSync}from'fs';import a38_0x239aea from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';function a38_0x28eb(){const _0xe40701=['workflow:secrets:list','Writing\x20files...','green','data','substring','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','stat','params','workflow:run','deleteSecret','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','summary','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','attempt','\x20\x20Revision:\x20','Start\x20a\x20workflow\x20run','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Session\x20time:\x20','Revision:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x20\x20Attempt\x20ID:\x20','Filter:\x20project=','\x22\x20to\x20new\x20project\x20\x22','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','✔\x20Push\x20complete','preparePushProject','includeRetried','utf-8','Pattern:\x20','json','unchanged','Tip:\x20cd\x20to\x20workflows/','workflow:attempt','2319592JTmeLc','filesExtracted','\x22\x20already\x20exists\x20(ID:\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','canceling','workflow:secrets:set','\x0a✔\x20Already\x20up\x20to\x20date','new','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','Listing\x20secrets...','task','Show\x20specific\x20attempt\x20details','revision:\x20','workflow:upload','Cloning\x20to\x20','Kill\x20a\x20running\x20attempt','isDirectory','error','diff','isArray','Error:','includes','name','From\x20task:\x20','New\x20project\x20name:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','parseProjectWorkflowPattern','Downloading\x20project\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','isNewProject','✔\x20Retry\x20started','Pulling\x20project\x20','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Source:\x20','Deleting\x20secret...','session:','Resume\x20from:\x20','relative','getTime','workflow:sessions','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Project\x20directory:\x20','No\x20log\x20content\x20found','param','Source\x20directory\x20is\x20required','Getting\x20attempt\x20tasks...','✔\x20Pull\x20complete','Task\x20name:\x20','4JoxDdh','sessionTime','projectId','Starting\x20workflow\x20run...','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Dry\x20run:\x20yes','workflowProject','✔\x20Pushed\x20','\x20\x20Changes:\x20','\x20task','Listing\x20workflow\x20attempts...','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','workflow:logs','Filter:\x20','finishedAt','key','createdAt','Listing\x20workflow\x20sessions...','Source\x20directory:\x20','indexOf','newProjectName','\x20\x20Location:\x20','Attempt\x20ID:\x20','\x20\x20Project\x20ID:\x20','No\x20workflows\x20found','format','projectName','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','modified','Project\x20filter:\x20','workflow:projects','Force:\x20yes','Expected\x20format:\x20--param\x20key=value','Files\x20to\x20upload:\x20','listSecrets','\x20workflow','...','Reason:\x20','retryAttempt','Error:\x20KEY=VALUE\x20is\x20required','showWorkflowConsoleUrl','jsonl','cyan','fileSize','\x20\x20Session\x20ID:\x20','sourceProjectName','✔\x20Downloaded\x20','528332IejkxN','\x27...','Setting\x20secret...','sourceDir','description','verbose','Output\x20directory:\x20','Status:\x20','Source\x20project:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','site','workflow:pull','index','taskName','/attempt/','\x20modified','message','join','List\x20workflow\x20execution\x20sessions','\x20project','running','Error:\x20Invalid\x20parameter\x20format:\x20','\x20is\x20not\x20a\x20directory','startsWith','yellow','success','force','logs','revision','\x20unchanged','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Error:\x20Project\x20name\x20is\x20required','Listing\x20workflows...','Select\x20a\x20workflow\x20to\x20run','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Workflow:\x20','\x0a✔\x20No\x20changes\x20to\x20push','Deleting\x20project\x20','Key:\x20','workflows','dryRun','Error:\x20Attempt\x20ID\x20is\x20required','\x22?\x20This\x20cannot\x20be\x20undone.','length','Retry\x20a\x20session\x20or\x20attempt','cancelRequested','workflow:retry','2325172TTrOIV','log','No\x20workflow\x20tdx.json\x20found','run','changes','Key\x20cannot\x20be\x20empty','workflow:secrets:delete','setSecret','keys','tdx.json','✔\x20Workflow\x20project\x20context\x20cleared.','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','\x20\x20Console:\x20','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Pushing\x20workflow\x20project...','\x20\x20Workflow:\x20','Including\x20subtasks:\x20yes','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','✔\x20Found\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','projects','Pull\x20workflow\x20project\x20to\x20local\x20folder','fileCount','\x0aUpdate\x20existing\x20project\x20\x22','\x22\x20with\x20new\x20revision?','includeSubtasks','Updating\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','/sessions/','Project\x20name\x20is\x20required','Pushing\x20project...','3fhcsbx','\x20secret','fs/promises','sessionId','clear','Params:\x20','✔\x20Secret\x20\x27','stringify','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','workflow:attempts','Cancelled','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20deleted','\x20\x20Project:\x20','List\x20all\x20workflow\x20projects','workflow:kill','yes','Fetching\x20log\x20files...','Select\x20a\x20task\x20to\x20view\x20logs:','pullProject','5832351ZenguW','select','workflow:workflows','session','existingProjectId','\x20session','Target\x20directory:\x20','prepareCloneProject','executeCloneProject','\x20new','map','workflow:push','Error:\x20Invalid\x20JSON\x20in\x20--params','Listing\x20workflow\x20projects...','path','Usage:\x20workflow:delete\x20<project-name-or-id>','cwd','skipValidation','6488850IRpupM','workflow','targetExists','Project:\x20','resolveProjectDir','3442750UmmEWv','\x0a⚠\x20Project\x20\x22','from','✔\x20Project:\x20','done','\x0aPush\x20these\x20changes?','attemptId','✔\x20New\x20project:\x20','---\x20','attempts','.\x20Expected\x20format:\x20KEY=VALUE','retryAttemptName','project','limit','dim','sessions','Error:\x20','workflow:tasks','fromTask','red','targetDir','\x0aDry\x20run\x20-\x20no\x20files\x20written','workflow:download','requireProject','\x20attempt','5683401RKEabf','\x20\x20Session\x20context\x20set\x20to:\x20','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','List\x20workflow\x20attempts','execute','retrySession','type','basename','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Validation:\x20skipped','resolveProject','✔\x20Workflow\x20run\x20started','workflow:use'];a38_0x28eb=function(){return _0xe40701;};return a38_0x28eb();}import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{formatBytes}from'../sdk/util/formatters.js';import{getWorkflowUrl,getConsoleUrl}from'../sdk/client/endpoints.js';import a38_0x126035 from'prompts';export class WorkflowBaseCommand extends BaseCommand{[a38_0x2b10d1(0x118)](_0x3b727c,_0x34a94f,_0x227a6e=0x0){const _0x5643a2=a38_0x2b10d1;return _0x3b727c[_0x227a6e]||_0x34a94f[_0x5643a2(0x176)];}[a38_0x2b10d1(0x10c)](_0xe540ee,_0x23adbe,_0x524cf8=0x0){const _0x1af81d=a38_0x2b10d1,_0x1a2bcb=this['resolveProject'](_0xe540ee,_0x23adbe,_0x524cf8);if(!_0x1a2bcb)return console['error'](a38_0x36276d[_0x1af81d(0x108)](_0x1af81d(0x151)),_0x1af81d(0xc8)),console[_0x1af81d(0x14e)](a38_0x36276d[_0x1af81d(0x103)](_0x1af81d(0x140))),null;return _0x1a2bcb;}['parseProjectWorkflowPattern'](_0x4fc606,_0x3e86b3){const _0x33a021=a38_0x2b10d1;if(_0x4fc606[0x0]){const _0x475053=_0x4fc606[0x0]['split']('.');if(_0x475053[_0x33a021(0xa6)]===0x1)return{'projectName':_0x475053[0x0],'workflowName':undefined};else return _0x475053[_0x33a021(0xa6)]===0x2?{'projectName':_0x475053[0x0],'workflowName':_0x475053[0x1]}:(console[_0x33a021(0x14e)](a38_0x36276d[_0x33a021(0x108)](_0x33a021(0x151)),_0x33a021(0xbe)),null);}return{'projectName':_0x3e86b3[_0x33a021(0x176)],'workflowName':undefined};}['resolveProjectDir'](_0x240070,_0x5d5543,_0xbc9cb9=0x0){const _0x272452=a38_0x2b10d1;if(_0x240070[_0xbc9cb9])return _0x240070[_0xbc9cb9];if(_0x5d5543[_0x272452(0x176)]){const _0x25023d=a38_0x239aea['join'](process[_0x272452(0xee)](),_0x272452(0xa2),_0x5d5543[_0x272452(0x176)]);if(existsSync(a38_0x239aea[_0x272452(0x8c)](_0x25023d,_0x272452(0xb3))))return _0x25023d;}return undefined;}async[a38_0x2b10d1(0x198)](_0x563470,_0xea8d37,_0x4fd8f3){const _0x129603=a38_0x2b10d1;try{const _0x544fca=await _0x563470[_0x129603(0xf1)][_0x129603(0xa2)](_0xea8d37,{'limit':0x1});if(_0x544fca[_0x129603(0xa6)]>0x0){const _0x1e105c=_0x544fca[0x0]['id'],_0x10f56f=getWorkflowUrl(_0x4fd8f3,_0x1e105c);console[_0x129603(0x14e)](_0x129603(0xb6)+a38_0x36276d['cyan'](_0x10f56f));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a38_0x2b10d1(0x153)]=a38_0x2b10d1(0x11a);[a38_0x2b10d1(0x7f)]=a38_0x2b10d1(0x15f);async[a38_0x2b10d1(0x112)](_0x41f2a7){const _0x34f9be=a38_0x2b10d1,{options:_0x4a4ccc,args:_0x98155a,tdx:_0x2cdf81}=_0x41f2a7,_0x558bf6=_0x98155a[0x0],_0x21eafe=_0x4a4ccc[_0x34f9be(0xce)];if(_0x21eafe)return saveSessionContext({'workflow_project':undefined},_0x4a4ccc[_0x34f9be(0xe1)]),console[_0x34f9be(0xab)](a38_0x36276d['green'](_0x34f9be(0xb4))),0x0;if(!_0x558bf6)return console[_0x34f9be(0x14e)](a38_0x36276d[_0x34f9be(0x108)](_0x34f9be(0x151)),_0x34f9be(0xc8)),console[_0x34f9be(0x14e)](a38_0x36276d['dim']('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x34f9be(0x14e)](a38_0x36276d[_0x34f9be(0x103)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x2eba31=await withSpinner('Resolving\x20project\x20\x27'+_0x558bf6+_0x34f9be(0x7c),()=>_0x2cdf81[_0x34f9be(0xf1)]['resolveProjectId'](_0x558bf6),{'verbose':_0x4a4ccc[_0x34f9be(0x80)]}),{name:_0x2fe680}=_0x2eba31[_0x34f9be(0x11e)];return saveSessionContext({'workflow_project':_0x2fe680},_0x4a4ccc[_0x34f9be(0xe1)]),console[_0x34f9be(0xab)](a38_0x36276d[_0x34f9be(0x11d)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a38_0x36276d[_0x34f9be(0x19a)](_0x2fe680))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a38_0x2b10d1(0x153)]=a38_0x2b10d1(0x18e);[a38_0x2b10d1(0x7f)]=a38_0x2b10d1(0xd8);async['execute'](_0x294bcb){const _0x28d2f3=a38_0x2b10d1,{options:_0x3b0ecd,args:_0x2bd288,tdx:_0x264a3c}=_0x294bcb,_0x4e80ef=_0x2bd288[0x0];_0x3b0ecd[_0x28d2f3(0x80)]&&_0x4e80ef&&console[_0x28d2f3(0x14e)](_0x28d2f3(0x138)+_0x4e80ef);const _0x2f8c7a=await withSpinner(_0x28d2f3(0xeb),()=>_0x264a3c[_0x28d2f3(0xf1)][_0x28d2f3(0xbf)](_0x4e80ef,{'limit':_0x3b0ecd[_0x28d2f3(0x102)]}),{'verbose':_0x3b0ecd[_0x28d2f3(0x80)]}),_0x282128=_0x2f8c7a[_0x28d2f3(0x11e)];return console[_0x28d2f3(0x14e)](_0x28d2f3(0xbd)+_0x282128['length']+_0x28d2f3(0x8e)+(_0x282128['length']!==0x1?'s':'')),await handleSDKOutput(_0x282128,_0x3b0ecd),0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a38_0x2b10d1(0xe0);[a38_0x2b10d1(0x7f)]='List\x20workflows';async[a38_0x2b10d1(0x112)](_0x55b1df){const _0x46ca0e=a38_0x2b10d1,{options:_0x18429f,args:_0x21ee39,tdx:_0x28e31f}=_0x55b1df,_0x36c626=this[_0x46ca0e(0x118)](_0x21ee39,_0x18429f);_0x18429f[_0x46ca0e(0x80)]&&_0x36c626&&console[_0x46ca0e(0x14e)](_0x46ca0e(0x18d)+_0x36c626);const _0x19d173=await withSpinner(_0x46ca0e(0x9b),()=>_0x28e31f[_0x46ca0e(0xf1)][_0x46ca0e(0xa2)](_0x36c626,{'limit':_0x18429f[_0x46ca0e(0x102)]}),{'verbose':_0x18429f[_0x46ca0e(0x80)]}),_0x335a45=_0x19d173[_0x46ca0e(0x11e)];return console['error'](_0x46ca0e(0xbd)+_0x335a45[_0x46ca0e(0xa6)]+_0x46ca0e(0x193)+(_0x335a45[_0x46ca0e(0xa6)]!==0x1?'s':'')),await handleSDKOutput(_0x335a45,_0x18429f),0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a38_0x2b10d1(0x153)]=a38_0x2b10d1(0x166);[a38_0x2b10d1(0x7f)]=a38_0x2b10d1(0x8d);async[a38_0x2b10d1(0x112)](_0x21c119){const _0x484702=a38_0x2b10d1,{options:_0x352b4b,args:_0x627734,tdx:_0x241221}=_0x21c119,_0x40f0b3=this[_0x484702(0x158)](_0x627734,_0x352b4b);if(!_0x40f0b3)return 0x1;const {projectName:_0x43b7d0,workflowName:_0x46b20a}=_0x40f0b3;if(_0x352b4b[_0x484702(0x80)]){if(_0x43b7d0&&_0x46b20a)console[_0x484702(0x14e)](_0x484702(0x17d)+_0x43b7d0+'.'+_0x46b20a);else _0x43b7d0&&console[_0x484702(0x14e)](_0x484702(0x131)+_0x43b7d0);const _0x312749=_0x352b4b['status'];_0x312749&&console['error'](_0x484702(0x82)+_0x312749);}const _0x72bfef=await withSpinner(_0x484702(0x181),()=>_0x241221[_0x484702(0xf1)][_0x484702(0x104)]({'projectName':_0x43b7d0,'workflowName':_0x46b20a,'status':_0x352b4b['status'],'fromTime':_0x352b4b[_0x484702(0xf7)],'toTime':_0x352b4b['to'],'limit':_0x352b4b[_0x484702(0x102)]}),{'verbose':_0x352b4b[_0x484702(0x80)]}),_0x1939c7=_0x72bfef[_0x484702(0x11e)];return console[_0x484702(0x14e)](_0x484702(0xbd)+_0x1939c7['length']+_0x484702(0xe3)+(_0x1939c7[_0x484702(0xa6)]!==0x1?'s':'')),await handleSDKOutput(_0x1939c7,_0x352b4b),0x0;}}function a38_0x4cce(_0x210bc0,_0x20b868){_0x210bc0=_0x210bc0-0x7c;const _0x28eba9=a38_0x28eb();let _0x4cce0b=_0x28eba9[_0x210bc0];return _0x4cce0b;}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a38_0x2b10d1(0x153)]=a38_0x2b10d1(0xd3);[a38_0x2b10d1(0x7f)]=a38_0x2b10d1(0x111);async[a38_0x2b10d1(0x112)](_0x103f0f){const _0x1e033e=a38_0x2b10d1,{options:_0x543b63,args:_0x59ee4c,tdx:_0x2a1e44}=_0x103f0f,_0x4a8262=this[_0x1e033e(0x158)](_0x59ee4c,_0x543b63);if(!_0x4a8262)return 0x1;const {projectName:_0x36f0df,workflowName:_0x2a4fe0}=_0x4a8262,_0x1b23e7=_0x543b63[_0x1e033e(0x136)];if(_0x543b63[_0x1e033e(0x80)]){if(_0x36f0df&&_0x2a4fe0)console[_0x1e033e(0x14e)](_0x1e033e(0x17d)+_0x36f0df+'.'+_0x2a4fe0);else _0x36f0df&&console[_0x1e033e(0x14e)](_0x1e033e(0x131)+_0x36f0df);_0x1b23e7&&console[_0x1e033e(0x14e)]('Include\x20retried:\x20yes');}const _0x9e64ba=await withSpinner(_0x1e033e(0x17a),()=>_0x2a1e44[_0x1e033e(0xf1)][_0x1e033e(0xfe)]({'projectName':_0x36f0df,'workflowName':_0x2a4fe0,'includeRetried':_0x1b23e7,'limit':_0x543b63[_0x1e033e(0x102)]}),{'verbose':_0x543b63['verbose']}),_0x14b2d0=_0x9e64ba['data'];return console[_0x1e033e(0x14e)]('✔\x20Found\x20'+_0x14b2d0[_0x1e033e(0xa6)]+_0x1e033e(0x10d)+(_0x14b2d0[_0x1e033e(0xa6)]!==0x1?'s':'')),await handleSDKOutput(_0x14b2d0,_0x543b63),0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a38_0x2b10d1(0x153)]=a38_0x2b10d1(0x13c);[a38_0x2b10d1(0x7f)]=a38_0x2b10d1(0x148);async[a38_0x2b10d1(0x112)](_0x5550d9){const _0x54b363=a38_0x2b10d1,{options:_0x4b8f43,args:_0x93bc8c,tdx:_0x24aeef}=_0x5550d9,_0x378020=_0x93bc8c[0x0];if(!_0x378020)return console[_0x54b363(0x14e)](_0x54b363(0xa4)),0x1;_0x4b8f43[_0x54b363(0x80)]&&console[_0x54b363(0x14e)](_0x54b363(0x186)+_0x378020);const _0x2bae14=await withSpinner('Getting\x20attempt\x20details...',()=>_0x24aeef['workflow'][_0x54b363(0x128)](_0x378020),{'verbose':_0x4b8f43[_0x54b363(0x80)]}),_0x2c0780=_0x2bae14[_0x54b363(0x11e)];let _0x41496e;!_0x2c0780[_0x54b363(0xf9)]?_0x41496e=_0x2c0780[_0x54b363(0xa8)]?_0x54b363(0x141):_0x54b363(0x8f):_0x41496e=_0x2c0780[_0x54b363(0x94)]?_0x54b363(0x94):_0x54b363(0x14e);let _0xa9fe62;if(_0x2c0780['createdAt']&&_0x2c0780[_0x54b363(0x17e)]){const _0x514f37=new Date(_0x2c0780[_0x54b363(0x180)])[_0x54b363(0x165)](),_0x579437=new Date(_0x2c0780[_0x54b363(0x17e)])[_0x54b363(0x165)]();_0xa9fe62=Math['round']((_0x579437-_0x514f37)/0x3e8);}const _0x2c9594={'attempt_id':_0x2c0780['id'],'status':_0x41496e,..._0x2c0780[_0x54b363(0x87)]!==undefined&&{'index':_0x2c0780['index']},..._0x2c0780['project']&&{'project':_0x2c0780[_0x54b363(0x101)]['name']},..._0x2c0780[_0x54b363(0xf1)]&&{'workflow':_0x2c0780[_0x54b363(0xf1)][_0x54b363(0x153)]},..._0x2c0780[_0x54b363(0xcd)]&&{'session_id':_0x2c0780['sessionId']},..._0x2c0780['sessionTime']&&{'session_time':_0x2c0780[_0x54b363(0x171)]},..._0x2c0780[_0x54b363(0x100)]&&{'retry_attempt':_0x2c0780[_0x54b363(0x100)]},..._0xa9fe62!==undefined&&{'duration_sec':_0xa9fe62},..._0x2c0780[_0x54b363(0x180)]&&{'created_at':_0x2c0780[_0x54b363(0x180)]},..._0x2c0780[_0x54b363(0x17e)]&&{'finished_at':_0x2c0780[_0x54b363(0x17e)]},...Object[_0x54b363(0xb2)](_0x2c0780[_0x54b363(0x122)])[_0x54b363(0xa6)]>0x0&&{'params':_0x2c0780[_0x54b363(0x122)]}};return await handleSingleObjectOutput(_0x2c9594,_0x4b8f43),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a38_0x2b10d1(0x106);['description']='Show\x20tasks\x20for\x20an\x20attempt';async[a38_0x2b10d1(0x112)](_0x409192){const _0x1e6be5=a38_0x2b10d1,{options:_0x1d1bec,args:_0x4abc02,tdx:_0x5a946f}=_0x409192,_0x45fd55=_0x4abc02[0x0];if(!_0x45fd55)return console[_0x1e6be5(0x14e)](_0x1e6be5(0xa4)),0x1;const _0x339bd7=_0x1d1bec[_0x1e6be5(0xc4)];_0x1d1bec[_0x1e6be5(0x80)]&&(console[_0x1e6be5(0x14e)]('Attempt\x20ID:\x20'+_0x45fd55),_0x339bd7&&console['error'](_0x1e6be5(0xba)));const _0x2dc9b2=await withSpinner(_0x1e6be5(0x16d),()=>_0x5a946f['workflow']['tasks'](_0x45fd55,_0x339bd7||![]),{'verbose':_0x1d1bec['verbose']}),_0x43805f=_0x2dc9b2[_0x1e6be5(0x11e)];return console[_0x1e6be5(0x14e)](_0x1e6be5(0xbd)+_0x43805f['length']+_0x1e6be5(0x179)+(_0x43805f[_0x1e6be5(0xa6)]!==0x1?'s':'')),await handleSDKOutput(_0x43805f,_0x1d1bec),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a38_0x2b10d1(0x17c);[a38_0x2b10d1(0x7f)]=a38_0x2b10d1(0x174);async[a38_0x2b10d1(0x112)](_0x1600a1){const _0x155a46=a38_0x2b10d1,{options:_0x42b8c3,args:_0x40bccd,tdx:_0x2b3326}=_0x1600a1,_0x2e35a2=_0x40bccd[0x0];let _0x45a38e=_0x40bccd[0x1];if(!_0x2e35a2)return console['error'](_0x155a46(0xa4)),0x1;_0x42b8c3[_0x155a46(0x80)]&&(console[_0x155a46(0x14e)](_0x155a46(0x186)+_0x2e35a2),_0x45a38e&&console[_0x155a46(0x14e)](_0x155a46(0x16f)+_0x45a38e));const _0x2cecc2=await withSpinner(_0x155a46(0xdb),()=>_0x2b3326[_0x155a46(0xf1)]['logFiles'](_0x2e35a2,_0x45a38e),{'verbose':_0x42b8c3[_0x155a46(0x80)]}),_0x273904=_0x2cecc2['data'];if(_0x273904[_0x155a46(0xa6)]===0x0)return console[_0x155a46(0x14e)](_0x155a46(0xbb)),0x0;if(!_0x45a38e&&(_0x42b8c3['json']||_0x42b8c3[_0x155a46(0x189)]))return await handleSDKOutput(_0x273904,_0x42b8c3),0x0;if(!_0x45a38e){const _0x2d8c8c=_0x273904['map'](_0x2f0de8=>({'title':_0x2f0de8[_0x155a46(0x88)]+'\x20('+formatBytes(_0x2f0de8[_0x155a46(0x19b)])+')','value':_0x2f0de8[_0x155a46(0x88)]})),_0x12fe3f=await a38_0x126035({'type':'select','name':_0x155a46(0x147),'message':_0x155a46(0xdc),'choices':_0x2d8c8c});if(!_0x12fe3f[_0x155a46(0x147)])return console[_0x155a46(0x14e)](_0x155a46(0xd4)),0x0;_0x45a38e=_0x12fe3f[_0x155a46(0x147)];}const _0x3c9fe6=await withSpinner('Downloading\x20logs...',()=>_0x2b3326['workflow'][_0x155a46(0x96)](_0x2e35a2,_0x45a38e),{'verbose':_0x42b8c3[_0x155a46(0x80)]}),_0x2b1355=_0x3c9fe6[_0x155a46(0x11e)];return _0x2b1355?console['log'](_0x2b1355):console[_0x155a46(0x14e)](_0x155a46(0x16a)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a38_0x2b10d1(0x153)]=a38_0x2b10d1(0xd9);[a38_0x2b10d1(0x7f)]=a38_0x2b10d1(0x14c);async['execute'](_0x345824){const _0x1473fe=a38_0x2b10d1,{options:_0x5256ab,args:_0x20a9ae,tdx:_0x20308d}=_0x345824,_0x903af0=_0x20a9ae[0x0];if(!_0x903af0)return console['error'](_0x1473fe(0xa4)),0x1;const _0x299eab=_0x5256ab['reason'];_0x5256ab[_0x1473fe(0x80)]&&(console[_0x1473fe(0x14e)](_0x1473fe(0x186)+_0x903af0),_0x299eab&&console[_0x1473fe(0x14e)](_0x1473fe(0x195)+_0x299eab));if(!_0x5256ab['yes']){const _0x3cf1ae=await confirmKey(_0x1473fe(0x12f)+_0x903af0+'?');if(!_0x3cf1ae)return console['error'](_0x1473fe(0xd4)),0x0;}const _0x5efe9d=await withSpinner('Killing\x20attempt...',()=>_0x20308d['workflow']['kill'](_0x903af0,_0x299eab),{'verbose':_0x5256ab[_0x1473fe(0x80)]}),_0x56ab62=_0x5efe9d[_0x1473fe(0x11e)];return console['error']('✔\x20'+_0x56ab62),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a38_0x2b10d1(0xa9);['description']=a38_0x2b10d1(0xa7);async[a38_0x2b10d1(0x112)](_0x3e97ed){const _0x39c8b9=a38_0x2b10d1,{options:_0x3c6324,args:_0x1fadc0,tdx:_0x46638e}=_0x3e97ed,_0x12955c=_0x1fadc0[0x0];if(!_0x12955c)return console[_0x39c8b9(0x14e)](_0x39c8b9(0x125)),console['error'](_0x39c8b9(0xc6)),0x1;let _0x13264a=![],_0x4f5489=_0x12955c;if(_0x12955c[_0x39c8b9(0x92)](_0x39c8b9(0x162)))_0x13264a=!![],_0x4f5489=_0x12955c[_0x39c8b9(0x11f)](0x8);else{if(_0x12955c[_0x39c8b9(0x92)]('attempt:'))_0x13264a=![],_0x4f5489=_0x12955c[_0x39c8b9(0x11f)](0x8);else return console['error'](_0x39c8b9(0xd2)),console[_0x39c8b9(0x14e)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x519bdd=_0x3c6324[_0x39c8b9(0x107)],_0x54aabf=_0x3c6324['resumeFrom'],_0x573ec2=_0x3c6324[_0x39c8b9(0x122)],_0x4d365a=_0x3c6324[_0x39c8b9(0x95)];_0x3c6324[_0x39c8b9(0x80)]&&(console[_0x39c8b9(0x14e)]('Target:\x20'+(_0x13264a?_0x39c8b9(0xe1):_0x39c8b9(0x128))+'\x20'+_0x4f5489),_0x519bdd&&console[_0x39c8b9(0x14e)](_0x39c8b9(0x154)+_0x519bdd),_0x54aabf&&console[_0x39c8b9(0x14e)](_0x39c8b9(0x163)+_0x54aabf),_0x573ec2&&console[_0x39c8b9(0x14e)](_0x39c8b9(0xcf)+_0x573ec2),_0x4d365a&&console[_0x39c8b9(0x14e)](_0x39c8b9(0x18f)));let _0x14da0c;if(_0x573ec2)try{if(_0x573ec2[_0x39c8b9(0x92)]('@')){const _0xf299fa=await import(_0x39c8b9(0xcc)),_0x38726d=_0x573ec2['substring'](0x1),_0x2ee03f=await _0xf299fa['readFile'](_0x38726d,_0x39c8b9(0x137));_0x14da0c=JSON['parse'](_0x2ee03f);}else _0x14da0c=JSON['parse'](_0x573ec2);}catch{return console[_0x39c8b9(0x14e)](_0x39c8b9(0xea)),0x1;}if(!_0x3c6324[_0x39c8b9(0xda)]){const _0x41121d=await confirmKey(_0x39c8b9(0x12b)+(_0x13264a?_0x39c8b9(0xe1):'attempt')+'\x20'+_0x4f5489+'?');if(!_0x41121d)return console[_0x39c8b9(0x14e)](_0x39c8b9(0xd4)),0x0;}let _0xab5247;_0x13264a?_0xab5247=await withSpinner('Retrying\x20session...',()=>_0x46638e[_0x39c8b9(0xf1)][_0x39c8b9(0x113)](_0x4f5489,{'fromTask':_0x519bdd,'retryParams':_0x14da0c}),{'verbose':_0x3c6324['verbose']}):_0xab5247=await withSpinner('Retrying\x20attempt...',()=>_0x46638e['workflow'][_0x39c8b9(0x196)](_0x4f5489,{'resumeFrom':_0x54aabf,'retryParams':_0x14da0c,'force':_0x4d365a}),{'verbose':_0x3c6324[_0x39c8b9(0x80)]});const _0x4382d8=_0xab5247[_0x39c8b9(0x11e)];return console[_0x39c8b9(0x14e)](_0x39c8b9(0x15c)),console['error']('\x20\x20New\x20attempt\x20ID:\x20'+_0x4382d8[_0x39c8b9(0xfb)]),console[_0x39c8b9(0x14e)](_0x39c8b9(0x19c)+_0x4382d8[_0x39c8b9(0xcd)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a38_0x2b10d1(0x153)]=a38_0x2b10d1(0x123);[a38_0x2b10d1(0x7f)]=a38_0x2b10d1(0x12a);async[a38_0x2b10d1(0x112)](_0x3e32c1){const _0x2d5e3d=a38_0x2b10d1,{options:_0x3dacb9,args:_0x3c846d,tdx:_0x50b311}=_0x3e32c1;let _0x37e37c=_0x3c846d[0x0];if(!_0x37e37c){const _0x1a3005=this[_0x2d5e3d(0x118)]([],_0x3dacb9),_0x445cb7=await withSpinner('Loading\x20workflows...',()=>_0x50b311[_0x2d5e3d(0xf1)][_0x2d5e3d(0xa2)](_0x1a3005,{'limit':_0x3dacb9[_0x2d5e3d(0x102)]}),{'verbose':_0x3dacb9['verbose']}),_0x314437=_0x445cb7[_0x2d5e3d(0x11e)];if(_0x314437['length']===0x0)return console[_0x2d5e3d(0x14e)](_0x2d5e3d(0x188)),!_0x1a3005&&console[_0x2d5e3d(0x14e)](a38_0x36276d[_0x2d5e3d(0x103)](_0x2d5e3d(0x140))),0x1;const _0xc6bcd0=_0x314437[_0x2d5e3d(0xe8)](_0x297ef2=>({'title':_0x297ef2[_0x2d5e3d(0x101)]?.[_0x2d5e3d(0x153)]+'.'+_0x297ef2[_0x2d5e3d(0x153)],'value':_0x297ef2['project']?.[_0x2d5e3d(0x153)]+'.'+_0x297ef2[_0x2d5e3d(0x153)],'description':_0x297ef2['revision']?_0x2d5e3d(0x149)+_0x297ef2[_0x2d5e3d(0x97)]:undefined})),_0x1fd3cc=await a38_0x126035({'type':_0x2d5e3d(0xdf),'name':'workflow','message':_0x2d5e3d(0x9c),'choices':_0xc6bcd0});if(!_0x1fd3cc['workflow'])return 0x1;_0x37e37c=_0x1fd3cc[_0x2d5e3d(0xf1)];}if(!_0x37e37c[_0x2d5e3d(0x152)]('.')){const _0x436303=this[_0x2d5e3d(0x118)]([],_0x3dacb9);if(_0x436303)_0x37e37c=_0x436303+'.'+_0x37e37c;else return console['error'](a38_0x36276d['red'](_0x2d5e3d(0x151)),_0x2d5e3d(0xbc)),console[_0x2d5e3d(0x14e)](a38_0x36276d[_0x2d5e3d(0x103)](_0x2d5e3d(0x140))),0x1;}const _0x17c937=_0x3dacb9[_0x2d5e3d(0x16b)],_0x209513=_0x3dacb9['sessionTime'],_0x468078={};if(_0x17c937&&Array[_0x2d5e3d(0x150)](_0x17c937))for(const _0x880542 of _0x17c937){const _0x18b6d7=_0x880542[_0x2d5e3d(0x183)]('=');if(_0x18b6d7===-0x1)return console[_0x2d5e3d(0x14e)](_0x2d5e3d(0x90)+_0x880542),console['error'](_0x2d5e3d(0x190)),0x1;const _0x3de4be=_0x880542['substring'](0x0,_0x18b6d7),_0x7746e9=_0x880542['substring'](_0x18b6d7+0x1);try{_0x468078[_0x3de4be]=JSON['parse'](_0x7746e9);}catch{_0x468078[_0x3de4be]=_0x7746e9;}}_0x3dacb9[_0x2d5e3d(0x80)]&&(console[_0x2d5e3d(0x14e)](_0x2d5e3d(0x9e)+_0x37e37c),Object[_0x2d5e3d(0xb2)](_0x468078)[_0x2d5e3d(0xa6)]>0x0&&console[_0x2d5e3d(0x14e)]('Parameters:\x20'+JSON[_0x2d5e3d(0xd1)](_0x468078)),_0x209513&&console[_0x2d5e3d(0x14e)](_0x2d5e3d(0x12c)+_0x209513));const _0x479c6a=await withSpinner(_0x2d5e3d(0x173),()=>_0x50b311[_0x2d5e3d(0xf1)][_0x2d5e3d(0xad)](_0x37e37c,_0x468078,{'sessionTime':_0x209513}),{'verbose':_0x3dacb9[_0x2d5e3d(0x80)]}),_0x315ecf=_0x479c6a[_0x2d5e3d(0x11e)];console['error'](_0x2d5e3d(0x119)),console['error'](_0x2d5e3d(0x130)+_0x315ecf['id']),console[_0x2d5e3d(0x14e)]('\x20\x20Session\x20ID:\x20'+_0x315ecf[_0x2d5e3d(0xcd)]),console['error'](_0x2d5e3d(0xd7)+_0x315ecf['project']?.[_0x2d5e3d(0x153)]),console[_0x2d5e3d(0x14e)](_0x2d5e3d(0xb9)+_0x315ecf[_0x2d5e3d(0xf1)]?.[_0x2d5e3d(0x153)]);if(_0x315ecf[_0x2d5e3d(0x101)]?.['id']&&_0x315ecf[_0x2d5e3d(0xcd)]&&_0x315ecf['id']){const _0x18549e=_0x3dacb9['site'],_0x18e598=getConsoleUrl(_0x18549e,'/app/workflows/'+_0x315ecf[_0x2d5e3d(0x101)]['id']+_0x2d5e3d(0xc7)+_0x315ecf[_0x2d5e3d(0xcd)]+_0x2d5e3d(0x89)+_0x315ecf['id']);console[_0x2d5e3d(0x14e)](_0x2d5e3d(0xb6)+a38_0x36276d[_0x2d5e3d(0x19a)](_0x18e598));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a38_0x2b10d1(0x153)]=a38_0x2b10d1(0x10b);[a38_0x2b10d1(0x7f)]=a38_0x2b10d1(0x99);async[a38_0x2b10d1(0x112)](_0x22e863){const _0x273b27=a38_0x2b10d1,{options:_0xee0f74,args:_0x57c236,tdx:_0x15d62f}=_0x22e863,_0x4fbd8e=_0x57c236[0x0],_0x30e849=_0x57c236[0x1]||'.';if(!_0x4fbd8e)return console[_0x273b27(0x14e)](_0x273b27(0x9a)),console[_0x273b27(0x14e)](_0x273b27(0x84)),0x1;const _0x28342e=_0xee0f74['revision'];_0xee0f74[_0x273b27(0x80)]&&(console[_0x273b27(0x14e)](_0x273b27(0xf3)+_0x4fbd8e),console['error'](_0x273b27(0x81)+_0x30e849),_0x28342e&&console['error'](_0x273b27(0x12d)+_0x28342e));const _0xe6ca45=await withSpinner(_0x273b27(0x159)+_0x4fbd8e+'...',()=>_0x15d62f[_0x273b27(0xf1)]['download'](_0x4fbd8e,_0x30e849,{'revision':_0x28342e}),{'verbose':_0xee0f74[_0x273b27(0x80)]}),_0x3d58e1=_0xe6ca45[_0x273b27(0x11e)];return console[_0x273b27(0x14e)](_0x273b27(0x19e)+_0x3d58e1[_0x273b27(0x18a)]),console[_0x273b27(0x14e)](_0x273b27(0x129)+_0x3d58e1['revision']),console['error']('\x20\x20Files\x20extracted:\x20'+_0x3d58e1[_0x273b27(0x13e)]),console['error'](_0x273b27(0x185)+_0x30e849+'/'+_0x3d58e1['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a38_0x2b10d1(0x153)]=a38_0x2b10d1(0x14a);[a38_0x2b10d1(0x7f)]=a38_0x2b10d1(0x9d);async[a38_0x2b10d1(0x112)](_0x5286cb){const _0x27f070=a38_0x2b10d1,{options:_0x3fa367,args:_0x26e276,tdx:_0x425fce}=_0x5286cb;let _0x41b3da='.',_0x5fa768=_0x3fa367['name'];if(_0x26e276[0x0]){const {promises:_0x579b41}=await import('fs');try{const _0xb8b0c1=await _0x579b41[_0x27f070(0x121)](_0x26e276[0x0]);if(_0xb8b0c1[_0x27f070(0x14d)]())_0x41b3da=_0x26e276[0x0];else return console['error'](_0x27f070(0x105)+_0x26e276[0x0]+_0x27f070(0x91)),0x1;}catch{_0x5fa768=_0x26e276[0x0],_0x41b3da='.';}}const _0x59f89c=_0x3fa367[_0x27f070(0x97)],_0x3ad779=_0x3fa367[_0x27f070(0xef)];_0x3fa367[_0x27f070(0x80)]&&(console['error'](_0x27f070(0x169)+_0x41b3da),_0x5fa768&&console[_0x27f070(0x14e)]('Project\x20name:\x20'+_0x5fa768),_0x59f89c&&console[_0x27f070(0x14e)]('Revision:\x20'+_0x59f89c),_0x3ad779&&console['error'](_0x27f070(0x117)));const _0x2309b9=await withSpinner(_0x27f070(0xb8),()=>_0x425fce['workflow']['push'](_0x41b3da,{'projectName':_0x5fa768,'revision':_0x59f89c,'skipValidation':_0x3ad779}),{'verbose':_0x3fa367[_0x27f070(0x80)]}),_0x1aff1d=_0x2309b9[_0x27f070(0x11e)];return console[_0x27f070(0x14e)](_0x27f070(0x177)+_0x1aff1d['projectName']),console[_0x27f070(0x14e)](_0x27f070(0x187)+_0x1aff1d['projectId']),console['error'](_0x27f070(0x129)+_0x1aff1d['revision']),await this[_0x27f070(0x198)](_0x425fce,_0x1aff1d['projectName'],_0x3fa367[_0x27f070(0x85)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a38_0x2b10d1(0x153)]=a38_0x2b10d1(0x86);['description']=a38_0x2b10d1(0xc0);async[a38_0x2b10d1(0x112)](_0x15641e){const _0x1fa112=a38_0x2b10d1,{options:_0x1a117f,args:_0xdbdae5,tdx:_0x10162b}=_0x15641e,_0x3202b1=_0xdbdae5[0x0],_0x4857b8=_0xdbdae5[0x1];if(!_0x3202b1)return console['error'](a38_0x36276d[_0x1fa112(0x108)](_0x1fa112(0x151)),_0x1fa112(0xc8)),console[_0x1fa112(0x14e)](a38_0x36276d[_0x1fa112(0x103)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x2cca26=_0x1a117f[_0x1fa112(0x97)];_0x1a117f['verbose']&&(console['error']('Project:\x20'+_0x3202b1),_0x4857b8&&console[_0x1fa112(0x14e)](_0x1fa112(0xe4)+_0x4857b8),_0x2cca26&&console[_0x1fa112(0x14e)]('Revision:\x20'+_0x2cca26),_0x1a117f[_0x1fa112(0xa3)]&&console[_0x1fa112(0x14e)](_0x1fa112(0x175)));const _0x3b6d0b=await withSpinner(_0x1fa112(0x15d)+_0x3202b1+_0x1fa112(0x194),()=>_0x10162b[_0x1fa112(0xf1)][_0x1fa112(0xdd)](_0x3202b1,{'targetDir':_0x4857b8,'revision':_0x2cca26}),{'verbose':_0x1a117f[_0x1fa112(0x80)]}),_0x3d910f=_0x3b6d0b[_0x1fa112(0x11e)];_0x3d910f[_0x1fa112(0x15b)]?console[_0x1fa112(0x14e)](_0x1fa112(0xfc)+_0x3d910f['projectName']):console['error']('✔\x20Project:\x20'+_0x3d910f[_0x1fa112(0x18a)]);console['error'](_0x1fa112(0x129)+_0x3d910f['revision']),console[_0x1fa112(0x14e)]('\x20\x20Target:\x20'+(a38_0x239aea[_0x1fa112(0x164)](process[_0x1fa112(0xee)](),_0x3d910f[_0x1fa112(0x109)])||'.')),console[_0x1fa112(0x14e)](_0x1fa112(0x178)+a38_0x36276d[_0x1fa112(0x11d)]('+'+_0x3d910f[_0x1fa112(0x126)][_0x1fa112(0x144)]+'\x20new')+',\x20'+(a38_0x36276d[_0x1fa112(0x93)]('~'+_0x3d910f['summary'][_0x1fa112(0x18c)]+_0x1fa112(0x8a))+',\x20')+(a38_0x36276d[_0x1fa112(0x108)]('-'+_0x3d910f[_0x1fa112(0x126)]['deleted']+_0x1fa112(0xd6))+',\x20')+(''+a38_0x36276d[_0x1fa112(0x103)](_0x3d910f['summary'][_0x1fa112(0x13a)]+_0x1fa112(0x98))));for(const _0x43ff2d of _0x3d910f[_0x1fa112(0xae)]){_0x43ff2d[_0x1fa112(0x114)]===_0x1fa112(0x18c)&&_0x43ff2d[_0x1fa112(0x14f)]&&(console['error']('\x0a'+a38_0x36276d[_0x1fa112(0x19a)](_0x1fa112(0xfd)+_0x43ff2d[_0x1fa112(0xec)])),console[_0x1fa112(0x14e)](_0x43ff2d[_0x1fa112(0x14f)]));}if(!_0x3d910f['hasChanges'])return saveSessionContext({'workflow_project':_0x3d910f[_0x1fa112(0x18a)]},_0x1a117f[_0x1fa112(0xe1)]),console[_0x1fa112(0x14e)](a38_0x36276d[_0x1fa112(0x11d)](_0x1fa112(0x143))),console[_0x1fa112(0x14e)](a38_0x36276d[_0x1fa112(0x103)](_0x1fa112(0x10f)+_0x3d910f[_0x1fa112(0x18a)])),0x0;if(_0x1a117f[_0x1fa112(0xa3)])return console[_0x1fa112(0x14e)](a38_0x36276d[_0x1fa112(0x93)](_0x1fa112(0x10a))),0x0;if(!_0x1a117f[_0x1fa112(0xda)]){const _0x1863dd=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x1863dd)return console[_0x1fa112(0x14e)]('Cancelled'),0x0;}await withSpinner(_0x1fa112(0x11c),()=>_0x10162b[_0x1fa112(0xf1)]['applyPullProject'](_0x3d910f,{'revision':_0x2cca26}),{'verbose':_0x1a117f['verbose']}),saveSessionContext({'workflow_project':_0x3d910f[_0x1fa112(0x18a)]},_0x1a117f[_0x1fa112(0xe1)]),console[_0x1fa112(0x14e)](a38_0x36276d['green'](_0x1fa112(0x16e)));const _0x29f5da=a38_0x239aea['relative'](process[_0x1fa112(0xee)](),_0x3d910f[_0x1fa112(0x109)])||'.';return console[_0x1fa112(0x14e)](a38_0x36276d[_0x1fa112(0x103)](_0x1fa112(0x185)+_0x29f5da)),console[_0x1fa112(0x14e)](a38_0x36276d[_0x1fa112(0x103)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x3d910f[_0x1fa112(0x18a)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a38_0x2b10d1(0x153)]=a38_0x2b10d1(0xe9);[a38_0x2b10d1(0x7f)]=a38_0x2b10d1(0x167);async[a38_0x2b10d1(0x112)](_0x59a12c){const _0x4c24ea=a38_0x2b10d1,{options:_0x149402,args:_0x1266db,tdx:_0x3006d3}=_0x59a12c,_0x31f65f=this[_0x4c24ea(0xf4)](_0x1266db,_0x149402),_0x165a1d=_0x149402[_0x4c24ea(0x97)],_0x33560f=_0x149402[_0x4c24ea(0xef)];_0x149402[_0x4c24ea(0x80)]&&(_0x31f65f&&console[_0x4c24ea(0x14e)](_0x4c24ea(0x182)+_0x31f65f),_0x165a1d&&console['error'](_0x4c24ea(0x12d)+_0x165a1d),_0x149402['dryRun']&&console[_0x4c24ea(0x14e)]('Dry\x20run:\x20yes'),_0x33560f&&console[_0x4c24ea(0x14e)](_0x4c24ea(0x117)));let _0x17a27b;try{_0x17a27b=await withSpinner('Analyzing\x20changes...',()=>_0x3006d3[_0x4c24ea(0xf1)][_0x4c24ea(0x135)]({'sourceDir':_0x31f65f,'revision':_0x165a1d,'skipValidation':_0x33560f}),{'verbose':_0x149402[_0x4c24ea(0x80)]});}catch(_0x24192b){if(_0x24192b instanceof Error&&_0x24192b[_0x4c24ea(0x8b)][_0x4c24ea(0x152)](_0x4c24ea(0xac)))return console['error'](a38_0x36276d[_0x4c24ea(0x108)](_0x4c24ea(0x151)),_0x4c24ea(0x110)),_0x149402[_0x4c24ea(0x176)]?console['error'](a38_0x36276d['dim'](_0x4c24ea(0x13b)+_0x149402[_0x4c24ea(0x176)]+_0x4c24ea(0xb5)+_0x149402['workflowProject']+'\x27')):console[_0x4c24ea(0x14e)](a38_0x36276d[_0x4c24ea(0x103)](_0x4c24ea(0x116))),0x1;throw _0x24192b;}const _0x467e01=_0x17a27b[_0x4c24ea(0x11e)];console[_0x4c24ea(0x14e)](_0x4c24ea(0xf8)+_0x467e01[_0x4c24ea(0x18a)]),console[_0x4c24ea(0x14e)]('\x20\x20Source:\x20'+_0x467e01[_0x4c24ea(0x7e)]),console[_0x4c24ea(0x14e)](_0x4c24ea(0x129)+_0x467e01[_0x4c24ea(0x97)]),console[_0x4c24ea(0x14e)](_0x4c24ea(0x178)+a38_0x36276d[_0x4c24ea(0x11d)]('+'+_0x467e01['summary']['new']+_0x4c24ea(0xe7))+',\x20'+(a38_0x36276d[_0x4c24ea(0x93)]('~'+_0x467e01[_0x4c24ea(0x126)][_0x4c24ea(0x18c)]+_0x4c24ea(0x8a))+',\x20')+(a38_0x36276d[_0x4c24ea(0x108)]('-'+_0x467e01[_0x4c24ea(0x126)]['deleted']+'\x20deleted')+',\x20')+(''+a38_0x36276d[_0x4c24ea(0x103)](_0x467e01[_0x4c24ea(0x126)][_0x4c24ea(0x13a)]+_0x4c24ea(0x98))));for(const _0x5cf6cf of _0x467e01[_0x4c24ea(0xae)]){_0x5cf6cf[_0x4c24ea(0x114)]===_0x4c24ea(0x18c)&&_0x5cf6cf[_0x4c24ea(0x14f)]&&(console['error']('\x0a'+a38_0x36276d[_0x4c24ea(0x19a)]('---\x20'+_0x5cf6cf[_0x4c24ea(0xec)])),console[_0x4c24ea(0x14e)](_0x5cf6cf[_0x4c24ea(0x14f)]));}if(!_0x467e01['hasChanges'])return console[_0x4c24ea(0x14e)](a38_0x36276d[_0x4c24ea(0x11d)](_0x4c24ea(0x9f))),await this[_0x4c24ea(0x198)](_0x3006d3,_0x467e01[_0x4c24ea(0x18a)],_0x149402[_0x4c24ea(0x85)]),0x0;if(_0x149402[_0x4c24ea(0xa3)])return console['error'](a38_0x36276d['yellow'](_0x4c24ea(0x15a))),0x0;if(!_0x149402['yes']){const _0x3eb320=await confirmKey(_0x4c24ea(0xfa));if(!_0x3eb320)return console[_0x4c24ea(0x14e)](_0x4c24ea(0xd4)),0x0;}const _0x219799=await withSpinner(_0x4c24ea(0xc9),()=>_0x3006d3[_0x4c24ea(0xf1)]['executePushProject'](_0x467e01),{'verbose':_0x149402['verbose']}),_0x48cc3f=_0x219799[_0x4c24ea(0x11e)];return console[_0x4c24ea(0x14e)](a38_0x36276d[_0x4c24ea(0x11d)](_0x4c24ea(0x134))),console[_0x4c24ea(0x14e)](_0x4c24ea(0x187)+_0x48cc3f[_0x4c24ea(0x172)]),console['error'](_0x4c24ea(0x129)+_0x48cc3f[_0x4c24ea(0x97)]),await this[_0x4c24ea(0x198)](_0x3006d3,_0x48cc3f[_0x4c24ea(0x18a)],_0x149402[_0x4c24ea(0x85)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a38_0x2b10d1(0x153)]='workflow:clone';['description']=a38_0x2b10d1(0xb7);async[a38_0x2b10d1(0x112)](_0xde3593){const _0x5827f5=a38_0x2b10d1,{options:_0x50c72d,args:_0x2c2c8d,tdx:_0x5abc4f}=_0xde3593,_0x50b580=this[_0x5827f5(0xf4)](_0x2c2c8d,_0x50c72d),_0x395bab=_0x50c72d[_0x5827f5(0x153)],_0x395e33=_0x50c72d[_0x5827f5(0x97)],_0x887c94=_0x50c72d[_0x5827f5(0xef)];if(!_0x50b580)return console[_0x5827f5(0x14e)](a38_0x36276d[_0x5827f5(0x108)](_0x5827f5(0x151)),_0x5827f5(0x16c)),console[_0x5827f5(0x14e)](a38_0x36276d[_0x5827f5(0x103)](_0x5827f5(0x133))),console[_0x5827f5(0x14e)](a38_0x36276d['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x395bab)return console[_0x5827f5(0x14e)](a38_0x36276d[_0x5827f5(0x108)](_0x5827f5(0x151)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x5827f5(0x14e)](a38_0x36276d[_0x5827f5(0x103)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x50c72d[_0x5827f5(0x80)]&&(console['error'](_0x5827f5(0x182)+_0x50b580),console['error']('New\x20project\x20name:\x20'+_0x395bab),_0x395e33&&console[_0x5827f5(0x14e)]('Revision:\x20'+_0x395e33),_0x50c72d['dryRun']&&console[_0x5827f5(0x14e)](_0x5827f5(0x175)),_0x887c94&&console['error'](_0x5827f5(0x117)));const _0x302e9b=await withSpinner('Analyzing\x20project...',()=>_0x5abc4f['workflow'][_0x5827f5(0xe5)](_0x50b580,_0x395bab,{'revision':_0x395e33,'skipValidation':_0x887c94}),{'verbose':_0x50c72d[_0x5827f5(0x80)]}),_0x1ccb63=_0x302e9b[_0x5827f5(0x11e)];console[_0x5827f5(0x14e)](_0x5827f5(0x160)+_0x1ccb63[_0x5827f5(0x7e)]);_0x1ccb63[_0x5827f5(0x19d)]&&console[_0x5827f5(0x14e)](_0x5827f5(0x83)+_0x1ccb63[_0x5827f5(0x19d)]);console[_0x5827f5(0x14e)](_0x5827f5(0x155)+_0x1ccb63[_0x5827f5(0x184)]),console[_0x5827f5(0x14e)](_0x5827f5(0x12d)+_0x1ccb63['revision']),console[_0x5827f5(0x14e)](_0x5827f5(0x191)+_0x1ccb63[_0x5827f5(0xc1)]);_0x1ccb63[_0x5827f5(0xf2)]&&(console[_0x5827f5(0x14e)](a38_0x36276d['yellow'](_0x5827f5(0xf6)+_0x1ccb63[_0x5827f5(0x184)]+_0x5827f5(0x13f)+_0x1ccb63[_0x5827f5(0xe2)]+')')),console[_0x5827f5(0x14e)](a38_0x36276d[_0x5827f5(0x93)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x50c72d['dryRun'])return console[_0x5827f5(0x14e)](a38_0x36276d[_0x5827f5(0x93)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x50c72d[_0x5827f5(0xda)]){const _0x4c75f9=_0x1ccb63[_0x5827f5(0x19d)]||a38_0x239aea[_0x5827f5(0x115)](_0x50b580),_0x5265dc=_0x1ccb63[_0x5827f5(0xf2)]?_0x5827f5(0xc2)+_0x395bab+_0x5827f5(0xc3):'\x0aClone\x20\x22'+_0x4c75f9+_0x5827f5(0x132)+_0x395bab+'\x22?',_0x4d7aa4=await confirmKey(_0x5265dc);if(!_0x4d7aa4)return console[_0x5827f5(0x14e)](_0x5827f5(0xd4)),0x0;}const _0xcda219=await withSpinner(_0x1ccb63[_0x5827f5(0xf2)]?_0x5827f5(0xc5)+_0x395bab+'...':_0x5827f5(0x14b)+_0x395bab+_0x5827f5(0x194),()=>_0x5abc4f[_0x5827f5(0xf1)][_0x5827f5(0xe6)](_0x1ccb63),{'verbose':_0x50c72d[_0x5827f5(0x80)]}),_0x58d902=_0xcda219[_0x5827f5(0x11e)];return console[_0x5827f5(0x14e)](a38_0x36276d[_0x5827f5(0x11d)](_0x1ccb63[_0x5827f5(0xf2)]?'✔\x20Project\x20updated':'✔\x20Clone\x20complete')),console[_0x5827f5(0x14e)](_0x5827f5(0xd7)+_0x58d902['newProjectName']),console[_0x5827f5(0x14e)](_0x5827f5(0x187)+_0x58d902['newProjectId']),console[_0x5827f5(0x14e)](_0x5827f5(0x129)+_0x58d902['revision']),await this[_0x5827f5(0x198)](_0x5abc4f,_0x58d902[_0x5827f5(0x184)],_0x50c72d[_0x5827f5(0x85)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a38_0x2b10d1(0x153)]='workflow:delete';['description']=a38_0x2b10d1(0x157);async['execute'](_0x22ad9d){const _0x37913c=a38_0x2b10d1,{options:_0x307dba,args:_0x3ff1d9,tdx:_0x2d7e70}=_0x22ad9d,_0x5e5e71=_0x3ff1d9[0x0];if(!_0x5e5e71)return console['error'](_0x37913c(0xd5)),console[_0x37913c(0x14e)](_0x37913c(0xed)),0x1;_0x307dba['verbose']&&console[_0x37913c(0x14e)](_0x37913c(0xf3)+_0x5e5e71);if(!_0x307dba['yes']){const _0x122e04=await confirmKey(_0x37913c(0x168)+_0x5e5e71+_0x37913c(0xa5));if(!_0x122e04)return console[_0x37913c(0x14e)](_0x37913c(0xd4)),0x0;}const _0x232032=await withSpinner(_0x37913c(0xa0)+_0x5e5e71+'...',()=>_0x2d7e70[_0x37913c(0xf1)]['delete'](_0x5e5e71),{'verbose':_0x307dba[_0x37913c(0x80)]}),_0x9ba168=_0x232032[_0x37913c(0x11e)];return console[_0x37913c(0x14e)]('✔\x20Deleted\x20project\x20'+_0x9ba168['projectName']),console[_0x37913c(0x14e)](_0x37913c(0x187)+_0x9ba168[_0x37913c(0x172)]),0x0;}}export function parseKeyValue(_0x253791){const _0x54b8f9=a38_0x2b10d1,_0xcf0199=_0x253791['indexOf']('=');if(_0xcf0199===-0x1)throw new Error('Invalid\x20format:\x20'+_0x253791+_0x54b8f9(0xff));const _0x5235c0=_0x253791[_0x54b8f9(0x11f)](0x0,_0xcf0199),_0x4edd11=_0x253791['substring'](_0xcf0199+0x1);if(!_0x5235c0)throw new Error(_0x54b8f9(0xaf));return{'key':_0x5235c0,'value':_0x4edd11};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a38_0x2b10d1(0x153)]=a38_0x2b10d1(0x11b);[a38_0x2b10d1(0x7f)]=a38_0x2b10d1(0x15e);async[a38_0x2b10d1(0x112)](_0x591d38){const _0x5bfaae=a38_0x2b10d1,{options:_0x1e8cde,args:_0x39ac9b,tdx:_0x1ce069}=_0x591d38,_0x32b010=this['requireProject'](_0x39ac9b,_0x1e8cde);if(!_0x32b010)return 0x1;_0x1e8cde[_0x5bfaae(0x80)]&&console[_0x5bfaae(0x14e)](_0x5bfaae(0xf3)+_0x32b010);const _0x34ed02=await withSpinner(_0x5bfaae(0x146),()=>_0x1ce069['workflow'][_0x5bfaae(0x192)](_0x32b010),{'verbose':_0x1e8cde['verbose']}),{secrets:_0x4f0583}=_0x34ed02[_0x5bfaae(0x11e)];return console[_0x5bfaae(0x14e)](_0x5bfaae(0xbd)+_0x4f0583[_0x5bfaae(0xa6)]+_0x5bfaae(0xcb)+(_0x4f0583[_0x5bfaae(0xa6)]!==0x1?'s':'')),await handleSDKOutput(_0x4f0583,_0x1e8cde),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a38_0x2b10d1(0x153)]=a38_0x2b10d1(0x142);[a38_0x2b10d1(0x7f)]=a38_0x2b10d1(0x127);async[a38_0x2b10d1(0x112)](_0x4d43d0){const _0xddc722=a38_0x2b10d1,{options:_0x5f0747,args:_0x416959,tdx:_0x57e3ff}=_0x4d43d0;let _0x48add2,_0x40317f;if(_0x416959[_0xddc722(0xa6)]>=0x2)_0x48add2=_0x416959[0x0],_0x40317f=_0x416959[0x1];else{if(_0x416959[_0xddc722(0xa6)]===0x1&&_0x5f0747[_0xddc722(0x176)])_0x48add2=_0x5f0747['workflowProject'],_0x40317f=_0x416959[0x0];else return _0x416959[_0xddc722(0xa6)]===0x1?(console['error'](_0xddc722(0x9a)),console['error']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0xddc722(0x14e)](_0xddc722(0x197)),console[_0xddc722(0x14e)](_0xddc722(0x145)),0x1);}let _0xf2a04f,_0x307acc;try{({key:_0xf2a04f,value:_0x307acc}=parseKeyValue(_0x40317f));}catch(_0x4ba4e2){return _0x4ba4e2 instanceof Error&&console[_0xddc722(0x14e)](a38_0x36276d[_0xddc722(0x108)]('Error:'),_0x4ba4e2[_0xddc722(0x8b)]),0x1;}_0x5f0747[_0xddc722(0x80)]&&(console[_0xddc722(0x14e)]('Project:\x20'+_0x48add2),console[_0xddc722(0x14e)](_0xddc722(0xa1)+_0xf2a04f));const _0x41c00c=await withSpinner(_0xddc722(0x7d),()=>_0x57e3ff[_0xddc722(0xf1)][_0xddc722(0xb1)](_0x48add2,_0xf2a04f,_0x307acc),{'verbose':_0x5f0747[_0xddc722(0x80)]}),_0x24fe76=_0x41c00c[_0xddc722(0x11e)];return console['error'](_0xddc722(0xd0)+_0x24fe76['key']+_0xddc722(0x18b)+_0x24fe76[_0xddc722(0x18a)]+'\x27'),(_0x5f0747[_0xddc722(0x139)]||_0x5f0747[_0xddc722(0x199)])&&await handleSingleObjectOutput(_0x24fe76,_0x5f0747),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a38_0x2b10d1(0x153)]=a38_0x2b10d1(0xb0);[a38_0x2b10d1(0x7f)]=a38_0x2b10d1(0x156);async[a38_0x2b10d1(0x112)](_0x2d83dc){const _0xebe6e=a38_0x2b10d1,{options:_0xce4121,args:_0x53ad9b,tdx:_0x313d30}=_0x2d83dc;let _0x462e47,_0x400cd9;if(_0x53ad9b['length']>=0x2)_0x462e47=_0x53ad9b[0x0],_0x400cd9=_0x53ad9b[0x1];else{if(_0x53ad9b[_0xebe6e(0xa6)]===0x1&&_0xce4121['workflowProject'])_0x462e47=_0xce4121[_0xebe6e(0x176)],_0x400cd9=_0x53ad9b[0x0];else return _0x53ad9b[_0xebe6e(0xa6)]===0x1?(console[_0xebe6e(0x14e)](_0xebe6e(0x9a)),console[_0xebe6e(0x14e)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0xebe6e(0x14e)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0xebe6e(0x14e)](_0xebe6e(0x12e)),0x1);}_0xce4121[_0xebe6e(0x80)]&&(console['error'](_0xebe6e(0xf3)+_0x462e47),console[_0xebe6e(0x14e)](_0xebe6e(0xa1)+_0x400cd9));if(!_0xce4121[_0xebe6e(0xda)]){const _0x3e1e92=await confirmKey(_0xebe6e(0x17b)+_0x400cd9+'\x27\x20from\x20project\x20\x27'+_0x462e47+'\x27?');if(!_0x3e1e92)return console[_0xebe6e(0x14e)](_0xebe6e(0xd4)),0x0;}const _0x34e926=await withSpinner(_0xebe6e(0x161),()=>_0x313d30['workflow'][_0xebe6e(0x124)](_0x462e47,_0x400cd9),{'verbose':_0xce4121[_0xebe6e(0x80)]}),_0x20a395=_0x34e926['data'];return console[_0xebe6e(0x14e)]('✔\x20Secret\x20\x27'+_0x20a395[_0xebe6e(0x17f)]+_0xebe6e(0x120)+_0x20a395[_0xebe6e(0x18a)]+'\x27'),(_0xce4121['json']||_0xce4121[_0xebe6e(0x199)])&&await handleSingleObjectOutput(_0x20a395,_0xce4121),0x0;}}
|
|
1
|
+
const a38_0x23c959=a38_0x4ceb;(function(_0x51694d,_0x1499c1){const _0x414cda=a38_0x4ceb,_0x28ee26=_0x51694d();while(!![]){try{const _0x1c6bd5=-parseInt(_0x414cda(0x132))/0x1*(parseInt(_0x414cda(0x1c2))/0x2)+parseInt(_0x414cda(0x151))/0x3+-parseInt(_0x414cda(0xec))/0x4+-parseInt(_0x414cda(0x17b))/0x5+-parseInt(_0x414cda(0x1a4))/0x6*(-parseInt(_0x414cda(0x152))/0x7)+parseInt(_0x414cda(0xbf))/0x8+-parseInt(_0x414cda(0x18e))/0x9*(-parseInt(_0x414cda(0x10d))/0xa);if(_0x1c6bd5===_0x1499c1)break;else _0x28ee26['push'](_0x28ee26['shift']());}catch(_0x29dad7){_0x28ee26['push'](_0x28ee26['shift']());}}}(a38_0x4df6,0x407e0));function a38_0x4ceb(_0x5e33d7,_0x370038){_0x5e33d7=_0x5e33d7-0xba;const _0x4df6b2=a38_0x4df6();let _0x4ceb79=_0x4df6b2[_0x5e33d7];return _0x4ceb79;}import a38_0x1f01e4 from'chalk';import{existsSync}from'fs';import a38_0x71a1fd from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{formatBytes}from'../sdk/util/formatters.js';import{getWorkflowUrl,getConsoleUrl}from'../sdk/client/endpoints.js';function a38_0x4df6(){const _0x417e82=['Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','workflow:kill','round','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Getting\x20attempt\x20tasks...','Starting\x20workflow\x20run...','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','1087248Ltjbnu','14HajAsK','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x20deleted','Source:\x20','Resolving\x20project\x20\x27','workflow:sessions','Project\x20name\x20is\x20required','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','type','From\x20task:\x20','cyan','Error:\x20Invalid\x20JSON\x20in\x20--params','targetExists','targetDir','done','json','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Error:\x20Secret\x20key\x20is\x20required','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','params','\x20\x20Project\x20ID:\x20','showWorkflowConsoleUrl','Dry\x20run:\x20yes','projectId','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','List\x20all\x20workflow\x20projects','Validation:\x20skipped','\x22?\x20This\x20cannot\x20be\x20undone.','Including\x20subtasks:\x20yes','Start\x20a\x20workflow\x20run','finishedAt','Workflow:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','select','\x20\x20Location:\x20','limit','existingProjectId','parse','green','projects','558715NnNLXV','\x0aDry\x20run\x20-\x20no\x20files\x20written','canceling','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','retrySession','/app/workflows/','tasks','\x20\x20Workflow:\x20','description','Getting\x20attempt\x20details...','path','taskName','Parameters:\x20','attempt:','---\x20','hasChanges','yes','startsWith','Revision:\x20','9kBQdIp','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Error:','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','Retry\x20a\x20session\x20or\x20attempt','workflow','data','parseProjectWorkflowPattern','revision','listSecrets','retryAttemptName','resolveProject','\x0a✔\x20No\x20changes\x20to\x20push','\x20is\x20not\x20a\x20directory','Error:\x20Attempt\x20ID\x20is\x20required','Pushing\x20project...','Key\x20cannot\x20be\x20empty','resolveProjectDir','isArray','\x20task','✔\x20Workflow\x20run\x20started','newProjectId','71202mtpXBq','site','Error:\x20KEY=VALUE\x20is\x20required','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Error:\x20Invalid\x20parameter\x20format:\x20','newProjectName','isNewProject','\x20\x20Project:\x20','red','Resume\x20from:\x20','✔\x20Workflow\x20project\x20context\x20cleared.','Usage:\x20workflow:delete\x20<project-name-or-id>','name','Params:\x20','workflow:delete','\x20\x20Attempt\x20ID:\x20','workflow:projects','Source\x20directory:\x20','workflow:tasks','revision:\x20','setSecret','✔\x20Pushed\x20','\x20\x20Revision:\x20','filesExtracted','\x20\x20Console:\x20','Force:\x20yes','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','project','workflow:use','/sessions/','787342ZqKNLd','\x20\x20Source:\x20','Show\x20specific\x20attempt\x20details','error','session','Project:\x20','...','\x20unchanged','No\x20log\x20content\x20found','\x20workflow','workflow:logs','workflowProject','\x20modified','Key:\x20','Fetching\x20log\x20files...','modified','pullProject','attempts','deleted','running','sourceProjectName','from','\x0a✔\x20Already\x20up\x20to\x20date','Retrying\x20attempt...','sessionId','jsonl','Listing\x20secrets...','✔\x20Deleted\x20project\x20','3993280xTHQKW','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','sessionTime','\x20attempt','Error:\x20Project\x20name\x20is\x20required','Cancelled','workflow:secrets:delete','Deleting\x20secret...','Cloning\x20to\x20','status','cwd','workflows','Project\x20directory:\x20','run','skipValidation','\x20\x20Target:\x20','Pulling\x20project\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','executeCloneProject','substring','preparePushProject','download','workflow:secrets:set','\x0a⚠\x20Project\x20\x22','index','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Files\x20to\x20upload:\x20','session:','Attempt\x20ID:\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','indexOf','sourceDir','✔\x20Project\x20updated','keys','message','No\x20workflows\x20found','getTime','resumeFrom','\x20new','changes','.\x20Expected\x20format:\x20KEY=VALUE','task','unchanged','dim','applyPullProject','1992496OiACJb','Reason:\x20','Status:\x20','\x20secret','Select\x20a\x20task\x20to\x20view\x20logs:','readFile','isDirectory','yellow','delete','List\x20workflow\x20attempts','\x20session','Deleting\x20project\x20','Downloading\x20logs...','Analyzing\x20project...','✔\x20Project:\x20','basename','relative','✔\x20New\x20project:\x20','log','Error:\x20','param','cancelRequested','success','workflow:secrets:list','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','✔\x20Secret\x20\x27','utf-8','Filter:\x20project=','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','logs','List\x20workflows','3823880UqBnDM','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','fileSize','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Source\x20project:\x20','logFiles','key','execute','retryAttempt','Expected\x20format:\x20--param\x20key=value','Usage:\x20tdx\x20wf\x20use\x20<project>','attempt','Filter:\x20','Updating\x20','force','verbose','requireProject','\x20project','dryRun','length','\x20\x20Session\x20context\x20set\x20to:\x20','Listing\x20workflow\x20attempts...','Target\x20directory:\x20','\x0aApply\x20these\x20changes?','summary','\x20\x20New\x20attempt\x20ID:\x20','projectName','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','✔\x20Pull\x20complete','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Analyzing\x20changes...','\x22\x20already\x20exists\x20(ID:\x20','stat','✔\x20Push\x20complete','\x0aUpdate\x20existing\x20project\x20\x22','Kill\x20a\x20running\x20attempt','Writing\x20files...','1DGGJZR','Project\x20filter:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x20\x20Changes:\x20','includes','\x20\x20Files\x20extracted:\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','map','Retrying\x20session...','includeSubtasks','\x20\x20Session\x20ID:\x20','Pattern:\x20','workflow:attempt','Listing\x20workflow\x20sessions...','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','fs/promises','workflow:download','✔\x20Found\x20','workflow:workflows','diff','Show\x20tasks\x20for\x20an\x20attempt'];a38_0x4df6=function(){return _0x417e82;};return a38_0x4df6();}import a38_0x52c2a2 from'prompts';export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x5c100d,_0x2829ef,_0x36c627=0x0){return _0x5c100d[_0x36c627]||_0x2829ef['workflowProject'];}['requireProject'](_0x913b2f,_0x564673,_0xc8926e=0x0){const _0x43e914=a38_0x4ceb,_0x3656fa=this[_0x43e914(0x199)](_0x913b2f,_0x564673,_0xc8926e);if(!_0x3656fa)return console[_0x43e914(0x1c5)](a38_0x1f01e4['red'](_0x43e914(0x190)),_0x43e914(0x158)),console[_0x43e914(0x1c5)](a38_0x1f01e4['dim'](_0x43e914(0x104))),null;return _0x3656fa;}['parseProjectWorkflowPattern'](_0x53a12f,_0x373a5f){const _0x1d9211=a38_0x4ceb;if(_0x53a12f[0x0]){const _0x22bd60=_0x53a12f[0x0]['split']('.');if(_0x22bd60[_0x1d9211(0x120)]===0x1)return{'projectName':_0x22bd60[0x0],'workflowName':undefined};else return _0x22bd60['length']===0x2?{'projectName':_0x22bd60[0x0],'workflowName':_0x22bd60[0x1]}:(console['error'](a38_0x1f01e4[_0x1d9211(0x1ac)](_0x1d9211(0x190)),_0x1d9211(0x142)),null);}return{'projectName':_0x373a5f['workflowProject'],'workflowName':undefined};}[a38_0x23c959(0x19f)](_0x4e6c5b,_0x2d45fc,_0x171332=0x0){const _0x3fc7ed=a38_0x23c959;if(_0x4e6c5b[_0x171332])return _0x4e6c5b[_0x171332];if(_0x2d45fc[_0x3fc7ed(0x1cd)]){const _0x2f9603=a38_0x71a1fd['join'](process[_0x3fc7ed(0xc9)](),_0x3fc7ed(0xca),_0x2d45fc[_0x3fc7ed(0x1cd)]);if(existsSync(a38_0x71a1fd['join'](_0x2f9603,'tdx.json')))return _0x2f9603;}return undefined;}async[a38_0x23c959(0x168)](_0x165155,_0x55501f,_0xad77c){const _0x4c88f7=a38_0x23c959;try{const _0x245184=await _0x165155['workflow']['workflows'](_0x55501f,{'limit':0x1});if(_0x245184[_0x4c88f7(0x120)]>0x0){const _0x52cbb7=_0x245184[0x0]['id'],_0x1b2f17=getWorkflowUrl(_0xad77c,_0x52cbb7);console['error']('\x20\x20Console:\x20'+a38_0x1f01e4[_0x4c88f7(0x15c)](_0x1b2f17));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a38_0x23c959(0x1b0)]=a38_0x23c959(0x1c0);['description']=a38_0x23c959(0x150);async[a38_0x23c959(0x114)](_0x133dbe){const _0xe67875=a38_0x23c959,{options:_0x135eb4,args:_0x1bf70a,tdx:_0x557e63}=_0x133dbe,_0x52404c=_0x1bf70a[0x0],_0x26b1e4=_0x135eb4['clear'];if(_0x26b1e4)return saveSessionContext({'workflow_project':undefined},_0x135eb4[_0xe67875(0x1c6)]),console[_0xe67875(0xfe)](a38_0x1f01e4[_0xe67875(0x179)](_0xe67875(0x1ae))),0x0;if(!_0x52404c)return console[_0xe67875(0x1c5)](a38_0x1f01e4[_0xe67875(0x1ac)]('Error:'),_0xe67875(0x158)),console[_0xe67875(0x1c5)](a38_0x1f01e4[_0xe67875(0xea)](_0xe67875(0x117))),console[_0xe67875(0x1c5)](a38_0x1f01e4[_0xe67875(0xea)](_0xe67875(0x163))),0x1;const _0x45bc9c=await withSpinner(_0xe67875(0x156)+_0x52404c+'\x27...',()=>_0x557e63[_0xe67875(0x193)]['resolveProjectId'](_0x52404c),{'verbose':_0x135eb4['verbose']}),{name:_0x4f1226}=_0x45bc9c[_0xe67875(0x194)];return saveSessionContext({'workflow_project':_0x4f1226},_0x135eb4['session']),console[_0xe67875(0xfe)](a38_0x1f01e4[_0xe67875(0x179)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a38_0x1f01e4[_0xe67875(0x15c)](_0x4f1226))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a38_0x23c959(0x1b4);[a38_0x23c959(0x183)]=a38_0x23c959(0x16c);async[a38_0x23c959(0x114)](_0x585b4c){const _0x5d1190=a38_0x23c959,{options:_0x164ea0,args:_0x5d026f,tdx:_0x24d3aa}=_0x585b4c,_0x204bfe=_0x5d026f[0x0];_0x164ea0[_0x5d1190(0x11c)]&&_0x204bfe&&console[_0x5d1190(0x1c5)](_0x5d1190(0x13f)+_0x204bfe);const _0x207ead=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x24d3aa[_0x5d1190(0x193)][_0x5d1190(0x17a)](_0x204bfe,{'limit':_0x164ea0[_0x5d1190(0x176)]}),{'verbose':_0x164ea0['verbose']}),_0x23ea75=_0x207ead[_0x5d1190(0x194)];return console['error'](_0x5d1190(0x145)+_0x23ea75['length']+_0x5d1190(0x11e)+(_0x23ea75[_0x5d1190(0x120)]!==0x1?'s':'')),await handleSDKOutput(_0x23ea75,_0x164ea0),0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a38_0x23c959(0x1b0)]=a38_0x23c959(0x146);[a38_0x23c959(0x183)]=a38_0x23c959(0x10c);async[a38_0x23c959(0x114)](_0x48f0d3){const _0x497962=a38_0x23c959,{options:_0xd7696c,args:_0xeab835,tdx:_0x376ccb}=_0x48f0d3,_0x50901f=this[_0x497962(0x199)](_0xeab835,_0xd7696c);_0xd7696c[_0x497962(0x11c)]&&_0x50901f&&console[_0x497962(0x1c5)](_0x497962(0x133)+_0x50901f);const _0x987ae9=await withSpinner('Listing\x20workflows...',()=>_0x376ccb[_0x497962(0x193)][_0x497962(0xca)](_0x50901f,{'limit':_0xd7696c['limit']}),{'verbose':_0xd7696c[_0x497962(0x11c)]}),_0x5528a9=_0x987ae9[_0x497962(0x194)];return console[_0x497962(0x1c5)]('✔\x20Found\x20'+_0x5528a9[_0x497962(0x120)]+_0x497962(0x1cb)+(_0x5528a9[_0x497962(0x120)]!==0x1?'s':'')),await handleSDKOutput(_0x5528a9,_0xd7696c),0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a38_0x23c959(0x157);[a38_0x23c959(0x183)]='List\x20workflow\x20execution\x20sessions';async[a38_0x23c959(0x114)](_0xc4589d){const _0x2b2d24=a38_0x23c959,{options:_0x1d769d,args:_0xff4348,tdx:_0x23dc2c}=_0xc4589d,_0x4fae71=this['parseProjectWorkflowPattern'](_0xff4348,_0x1d769d);if(!_0x4fae71)return 0x1;const {projectName:_0x44738d,workflowName:_0x3ca2c8}=_0x4fae71;if(_0x1d769d['verbose']){if(_0x44738d&&_0x3ca2c8)console[_0x2b2d24(0x1c5)](_0x2b2d24(0x119)+_0x44738d+'.'+_0x3ca2c8);else _0x44738d&&console[_0x2b2d24(0x1c5)]('Filter:\x20project='+_0x44738d);const _0x38a93e=_0x1d769d['status'];_0x38a93e&&console[_0x2b2d24(0x1c5)](_0x2b2d24(0xee)+_0x38a93e);}const _0x5164cf=await withSpinner(_0x2b2d24(0x141),()=>_0x23dc2c['workflow']['sessions']({'projectName':_0x44738d,'workflowName':_0x3ca2c8,'status':_0x1d769d[_0x2b2d24(0xc8)],'fromTime':_0x1d769d[_0x2b2d24(0x1d7)],'toTime':_0x1d769d['to'],'limit':_0x1d769d['limit']}),{'verbose':_0x1d769d[_0x2b2d24(0x11c)]}),_0x46047c=_0x5164cf['data'];return console[_0x2b2d24(0x1c5)]('✔\x20Found\x20'+_0x46047c[_0x2b2d24(0x120)]+_0x2b2d24(0xf6)+(_0x46047c['length']!==0x1?'s':'')),await handleSDKOutput(_0x46047c,_0x1d769d),0x0;}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']='workflow:attempts';[a38_0x23c959(0x183)]=a38_0x23c959(0xf5);async[a38_0x23c959(0x114)](_0x3876fe){const _0x139e6e=a38_0x23c959,{options:_0x210222,args:_0x445e74,tdx:_0x4e12e}=_0x3876fe,_0x4c9e8e=this[_0x139e6e(0x195)](_0x445e74,_0x210222);if(!_0x4c9e8e)return 0x1;const {projectName:_0x1d5f6b,workflowName:_0x2193ed}=_0x4c9e8e,_0x39ee6b=_0x210222['includeRetried'];if(_0x210222['verbose']){if(_0x1d5f6b&&_0x2193ed)console[_0x139e6e(0x1c5)](_0x139e6e(0x119)+_0x1d5f6b+'.'+_0x2193ed);else _0x1d5f6b&&console[_0x139e6e(0x1c5)](_0x139e6e(0x107)+_0x1d5f6b);_0x39ee6b&&console[_0x139e6e(0x1c5)]('Include\x20retried:\x20yes');}const _0x27b762=await withSpinner(_0x139e6e(0x122),()=>_0x4e12e[_0x139e6e(0x193)][_0x139e6e(0x1d3)]({'projectName':_0x1d5f6b,'workflowName':_0x2193ed,'includeRetried':_0x39ee6b,'limit':_0x210222[_0x139e6e(0x176)]}),{'verbose':_0x210222[_0x139e6e(0x11c)]}),_0x83ffbc=_0x27b762[_0x139e6e(0x194)];return console[_0x139e6e(0x1c5)]('✔\x20Found\x20'+_0x83ffbc[_0x139e6e(0x120)]+_0x139e6e(0xc2)+(_0x83ffbc[_0x139e6e(0x120)]!==0x1?'s':'')),await handleSDKOutput(_0x83ffbc,_0x210222),0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a38_0x23c959(0x1b0)]=a38_0x23c959(0x140);[a38_0x23c959(0x183)]=a38_0x23c959(0x1c4);async[a38_0x23c959(0x114)](_0x2008e5){const _0x1d3a21=a38_0x23c959,{options:_0xae9339,args:_0x530541,tdx:_0x51c958}=_0x2008e5,_0x38f866=_0x530541[0x0];if(!_0x38f866)return console['error'](_0x1d3a21(0x19c)),0x1;_0xae9339['verbose']&&console[_0x1d3a21(0x1c5)](_0x1d3a21(0xdb)+_0x38f866);const _0x2e8b49=await withSpinner(_0x1d3a21(0x184),()=>_0x51c958[_0x1d3a21(0x193)][_0x1d3a21(0x118)](_0x38f866),{'verbose':_0xae9339[_0x1d3a21(0x11c)]}),_0x28d669=_0x2e8b49[_0x1d3a21(0x194)];let _0x356558;!_0x28d669[_0x1d3a21(0x160)]?_0x356558=_0x28d669[_0x1d3a21(0x101)]?_0x1d3a21(0x17d):_0x1d3a21(0x1d5):_0x356558=_0x28d669[_0x1d3a21(0x102)]?_0x1d3a21(0x102):'error';let _0x211f4a;if(_0x28d669['createdAt']&&_0x28d669[_0x1d3a21(0x171)]){const _0x21180d=new Date(_0x28d669['createdAt'])[_0x1d3a21(0xe3)](),_0x2dbab6=new Date(_0x28d669['finishedAt'])[_0x1d3a21(0xe3)]();_0x211f4a=Math[_0x1d3a21(0x14b)]((_0x2dbab6-_0x21180d)/0x3e8);}const _0x51831f={'attempt_id':_0x28d669['id'],'status':_0x356558,..._0x28d669[_0x1d3a21(0xd7)]!==undefined&&{'index':_0x28d669['index']},..._0x28d669['project']&&{'project':_0x28d669[_0x1d3a21(0x1bf)][_0x1d3a21(0x1b0)]},..._0x28d669['workflow']&&{'workflow':_0x28d669['workflow'][_0x1d3a21(0x1b0)]},..._0x28d669[_0x1d3a21(0xbb)]&&{'session_id':_0x28d669[_0x1d3a21(0xbb)]},..._0x28d669[_0x1d3a21(0xc1)]&&{'session_time':_0x28d669[_0x1d3a21(0xc1)]},..._0x28d669[_0x1d3a21(0x198)]&&{'retry_attempt':_0x28d669[_0x1d3a21(0x198)]},..._0x211f4a!==undefined&&{'duration_sec':_0x211f4a},..._0x28d669['createdAt']&&{'created_at':_0x28d669['createdAt']},..._0x28d669[_0x1d3a21(0x171)]&&{'finished_at':_0x28d669[_0x1d3a21(0x171)]},...Object[_0x1d3a21(0xe0)](_0x28d669['params'])[_0x1d3a21(0x120)]>0x0&&{'params':_0x28d669[_0x1d3a21(0x166)]}};return await handleSingleObjectOutput(_0x51831f,_0xae9339),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a38_0x23c959(0x1b0)]=a38_0x23c959(0x1b6);[a38_0x23c959(0x183)]=a38_0x23c959(0x148);async[a38_0x23c959(0x114)](_0x2370e1){const _0x56eb62=a38_0x23c959,{options:_0x3151d2,args:_0x409ada,tdx:_0x59de32}=_0x2370e1,_0x2f369b=_0x409ada[0x0];if(!_0x2f369b)return console[_0x56eb62(0x1c5)](_0x56eb62(0x19c)),0x1;const _0x22bc5c=_0x3151d2[_0x56eb62(0x13d)];_0x3151d2[_0x56eb62(0x11c)]&&(console['error'](_0x56eb62(0xdb)+_0x2f369b),_0x22bc5c&&console['error'](_0x56eb62(0x16f)));const _0x5cad8b=await withSpinner(_0x56eb62(0x14d),()=>_0x59de32['workflow'][_0x56eb62(0x181)](_0x2f369b,_0x22bc5c||![]),{'verbose':_0x3151d2[_0x56eb62(0x11c)]}),_0x4396b6=_0x5cad8b[_0x56eb62(0x194)];return console[_0x56eb62(0x1c5)](_0x56eb62(0x145)+_0x4396b6[_0x56eb62(0x120)]+_0x56eb62(0x1a1)+(_0x4396b6[_0x56eb62(0x120)]!==0x1?'s':'')),await handleSDKOutput(_0x4396b6,_0x3151d2),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a38_0x23c959(0x1b0)]=a38_0x23c959(0x1cc);[a38_0x23c959(0x183)]=a38_0x23c959(0x138);async[a38_0x23c959(0x114)](_0x3aea75){const _0x1fbe78=a38_0x23c959,{options:_0x2fa035,args:_0x2fbc97,tdx:_0x15cb60}=_0x3aea75,_0xcb528b=_0x2fbc97[0x0];let _0x1b2a7f=_0x2fbc97[0x1];if(!_0xcb528b)return console[_0x1fbe78(0x1c5)](_0x1fbe78(0x19c)),0x1;_0x2fa035['verbose']&&(console['error']('Attempt\x20ID:\x20'+_0xcb528b),_0x1b2a7f&&console[_0x1fbe78(0x1c5)]('Task\x20name:\x20'+_0x1b2a7f));const _0x54d87d=await withSpinner(_0x1fbe78(0x1d0),()=>_0x15cb60[_0x1fbe78(0x193)][_0x1fbe78(0x112)](_0xcb528b,_0x1b2a7f),{'verbose':_0x2fa035[_0x1fbe78(0x11c)]}),_0x43454a=_0x54d87d[_0x1fbe78(0x194)];if(_0x43454a[_0x1fbe78(0x120)]===0x0)return console[_0x1fbe78(0x1c5)](_0x1fbe78(0x134)),0x0;if(!_0x1b2a7f&&(_0x2fa035['json']||_0x2fa035['format']))return await handleSDKOutput(_0x43454a,_0x2fa035),0x0;if(!_0x1b2a7f){const _0x95bb84=_0x43454a[_0x1fbe78(0x13b)](_0x196475=>({'title':_0x196475[_0x1fbe78(0x186)]+'\x20('+formatBytes(_0x196475[_0x1fbe78(0x10f)])+')','value':_0x196475['taskName']})),_0x213dde=await a38_0x52c2a2({'type':_0x1fbe78(0x174),'name':_0x1fbe78(0xe8),'message':_0x1fbe78(0xf0),'choices':_0x95bb84});if(!_0x213dde[_0x1fbe78(0xe8)])return console[_0x1fbe78(0x1c5)](_0x1fbe78(0xc4)),0x0;_0x1b2a7f=_0x213dde[_0x1fbe78(0xe8)];}const _0x5713c3=await withSpinner(_0x1fbe78(0xf8),()=>_0x15cb60[_0x1fbe78(0x193)][_0x1fbe78(0x10b)](_0xcb528b,_0x1b2a7f),{'verbose':_0x2fa035[_0x1fbe78(0x11c)]}),_0x41a511=_0x5713c3[_0x1fbe78(0x194)];return _0x41a511?console[_0x1fbe78(0xfe)](_0x41a511):console[_0x1fbe78(0x1c5)](_0x1fbe78(0x1ca)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a38_0x23c959(0x1b0)]=a38_0x23c959(0x14a);['description']=a38_0x23c959(0x130);async[a38_0x23c959(0x114)](_0x519826){const _0x50ffd5=a38_0x23c959,{options:_0x295133,args:_0x746fe4,tdx:_0x361772}=_0x519826,_0x2f667f=_0x746fe4[0x0];if(!_0x2f667f)return console[_0x50ffd5(0x1c5)](_0x50ffd5(0x19c)),0x1;const _0x12dd9a=_0x295133['reason'];_0x295133['verbose']&&(console[_0x50ffd5(0x1c5)]('Attempt\x20ID:\x20'+_0x2f667f),_0x12dd9a&&console[_0x50ffd5(0x1c5)](_0x50ffd5(0xed)+_0x12dd9a));if(!_0x295133[_0x50ffd5(0x18b)]){const _0x59738e=await confirmKey(_0x50ffd5(0x162)+_0x2f667f+'?');if(!_0x59738e)return console[_0x50ffd5(0x1c5)](_0x50ffd5(0xc4)),0x0;}const _0x4024cd=await withSpinner('Killing\x20attempt...',()=>_0x361772[_0x50ffd5(0x193)]['kill'](_0x2f667f,_0x12dd9a),{'verbose':_0x295133[_0x50ffd5(0x11c)]}),_0xa33552=_0x4024cd[_0x50ffd5(0x194)];return console[_0x50ffd5(0x1c5)]('✔\x20'+_0xa33552),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a38_0x23c959(0x1b0)]='workflow:retry';[a38_0x23c959(0x183)]=a38_0x23c959(0x192);async['execute'](_0x1d99a6){const _0x914d5f=a38_0x23c959,{options:_0x2cb06a,args:_0x6ab299,tdx:_0x4a6777}=_0x1d99a6,_0x40a9a2=_0x6ab299[0x0];if(!_0x40a9a2)return console['error'](_0x914d5f(0x110)),console[_0x914d5f(0x1c5)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x559c28=![],_0x153d1a=_0x40a9a2;if(_0x40a9a2[_0x914d5f(0x18c)](_0x914d5f(0xda)))_0x559c28=!![],_0x153d1a=_0x40a9a2[_0x914d5f(0xd2)](0x8);else{if(_0x40a9a2['startsWith'](_0x914d5f(0x188)))_0x559c28=![],_0x153d1a=_0x40a9a2[_0x914d5f(0xd2)](0x8);else return console['error'](_0x914d5f(0x10e)),console[_0x914d5f(0x1c5)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x4baab5=_0x2cb06a['fromTask'],_0x297d93=_0x2cb06a[_0x914d5f(0xe4)],_0x29db4a=_0x2cb06a[_0x914d5f(0x166)],_0x4fed6b=_0x2cb06a[_0x914d5f(0x11b)];_0x2cb06a[_0x914d5f(0x11c)]&&(console['error']('Target:\x20'+(_0x559c28?'session':_0x914d5f(0x118))+'\x20'+_0x153d1a),_0x4baab5&&console[_0x914d5f(0x1c5)](_0x914d5f(0x15b)+_0x4baab5),_0x297d93&&console['error'](_0x914d5f(0x1ad)+_0x297d93),_0x29db4a&&console[_0x914d5f(0x1c5)](_0x914d5f(0x1b1)+_0x29db4a),_0x4fed6b&&console[_0x914d5f(0x1c5)](_0x914d5f(0x1bd)));let _0x102534;if(_0x29db4a)try{if(_0x29db4a[_0x914d5f(0x18c)]('@')){const _0x14e05e=await import(_0x914d5f(0x143)),_0x47593c=_0x29db4a[_0x914d5f(0xd2)](0x1),_0x35fc53=await _0x14e05e[_0x914d5f(0xf1)](_0x47593c,_0x914d5f(0x106));_0x102534=JSON[_0x914d5f(0x178)](_0x35fc53);}else _0x102534=JSON[_0x914d5f(0x178)](_0x29db4a);}catch{return console[_0x914d5f(0x1c5)](_0x914d5f(0x15d)),0x1;}if(!_0x2cb06a[_0x914d5f(0x18b)]){const _0x5717cc=await confirmKey(_0x914d5f(0x1be)+(_0x559c28?_0x914d5f(0x1c6):_0x914d5f(0x118))+'\x20'+_0x153d1a+'?');if(!_0x5717cc)return console[_0x914d5f(0x1c5)](_0x914d5f(0xc4)),0x0;}let _0x41c8ea;_0x559c28?_0x41c8ea=await withSpinner(_0x914d5f(0x13c),()=>_0x4a6777[_0x914d5f(0x193)][_0x914d5f(0x17f)](_0x153d1a,{'fromTask':_0x4baab5,'retryParams':_0x102534}),{'verbose':_0x2cb06a['verbose']}):_0x41c8ea=await withSpinner(_0x914d5f(0xba),()=>_0x4a6777[_0x914d5f(0x193)][_0x914d5f(0x115)](_0x153d1a,{'resumeFrom':_0x297d93,'retryParams':_0x102534,'force':_0x4fed6b}),{'verbose':_0x2cb06a['verbose']});const _0x31c509=_0x41c8ea[_0x914d5f(0x194)];return console[_0x914d5f(0x1c5)]('✔\x20Retry\x20started'),console[_0x914d5f(0x1c5)](_0x914d5f(0x126)+_0x31c509['attemptId']),console['error'](_0x914d5f(0x13e)+_0x31c509[_0x914d5f(0xbb)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a38_0x23c959(0x1b0)]='workflow:run';[a38_0x23c959(0x183)]=a38_0x23c959(0x170);async['execute'](_0x3e6796){const _0x34abd8=a38_0x23c959,{options:_0x134d14,args:_0x4045f5,tdx:_0x226f91}=_0x3e6796;let _0x23179c=_0x4045f5[0x0];if(!_0x23179c){const _0x54f181=this[_0x34abd8(0x199)]([],_0x134d14),_0x2272e6=await withSpinner('Loading\x20workflows...',()=>_0x226f91[_0x34abd8(0x193)][_0x34abd8(0xca)](_0x54f181,{'limit':_0x134d14[_0x34abd8(0x176)]}),{'verbose':_0x134d14[_0x34abd8(0x11c)]}),_0x34c4ee=_0x2272e6['data'];if(_0x34c4ee['length']===0x0)return console[_0x34abd8(0x1c5)](_0x34abd8(0xe2)),!_0x54f181&&console[_0x34abd8(0x1c5)](a38_0x1f01e4['dim'](_0x34abd8(0x104))),0x1;const _0x25d955=_0x34c4ee[_0x34abd8(0x13b)](_0x507f6e=>({'title':_0x507f6e[_0x34abd8(0x1bf)]?.[_0x34abd8(0x1b0)]+'.'+_0x507f6e[_0x34abd8(0x1b0)],'value':_0x507f6e['project']?.[_0x34abd8(0x1b0)]+'.'+_0x507f6e['name'],'description':_0x507f6e[_0x34abd8(0x196)]?_0x34abd8(0x1b7)+_0x507f6e[_0x34abd8(0x196)]:undefined})),_0x20117c=await a38_0x52c2a2({'type':_0x34abd8(0x174),'name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x25d955});if(!_0x20117c['workflow'])return 0x1;_0x23179c=_0x20117c[_0x34abd8(0x193)];}if(!_0x23179c[_0x34abd8(0x136)]('.')){const _0x10f9ec=this[_0x34abd8(0x199)]([],_0x134d14);if(_0x10f9ec)_0x23179c=_0x10f9ec+'.'+_0x23179c;else return console[_0x34abd8(0x1c5)](a38_0x1f01e4[_0x34abd8(0x1ac)](_0x34abd8(0x190)),_0x34abd8(0xd8)),console[_0x34abd8(0x1c5)](a38_0x1f01e4[_0x34abd8(0xea)](_0x34abd8(0x104))),0x1;}const _0x10c9cd=_0x134d14[_0x34abd8(0x100)],_0x210a4a=_0x134d14['sessionTime'],_0x363bb4={};if(_0x10c9cd&&Array[_0x34abd8(0x1a0)](_0x10c9cd))for(const _0x17649a of _0x10c9cd){const _0x272f82=_0x17649a[_0x34abd8(0xdd)]('=');if(_0x272f82===-0x1)return console[_0x34abd8(0x1c5)](_0x34abd8(0x1a8)+_0x17649a),console[_0x34abd8(0x1c5)](_0x34abd8(0x116)),0x1;const _0x1c2938=_0x17649a[_0x34abd8(0xd2)](0x0,_0x272f82),_0x17b0ae=_0x17649a[_0x34abd8(0xd2)](_0x272f82+0x1);try{_0x363bb4[_0x1c2938]=JSON[_0x34abd8(0x178)](_0x17b0ae);}catch{_0x363bb4[_0x1c2938]=_0x17b0ae;}}_0x134d14['verbose']&&(console[_0x34abd8(0x1c5)](_0x34abd8(0x172)+_0x23179c),Object[_0x34abd8(0xe0)](_0x363bb4)[_0x34abd8(0x120)]>0x0&&console[_0x34abd8(0x1c5)](_0x34abd8(0x187)+JSON['stringify'](_0x363bb4)),_0x210a4a&&console[_0x34abd8(0x1c5)]('Session\x20time:\x20'+_0x210a4a));const _0x17383a=await withSpinner(_0x34abd8(0x14e),()=>_0x226f91[_0x34abd8(0x193)][_0x34abd8(0xcc)](_0x23179c,_0x363bb4,{'sessionTime':_0x210a4a}),{'verbose':_0x134d14[_0x34abd8(0x11c)]}),_0x31f4b4=_0x17383a[_0x34abd8(0x194)];console[_0x34abd8(0x1c5)](_0x34abd8(0x1a2)),console[_0x34abd8(0x1c5)](_0x34abd8(0x1b3)+_0x31f4b4['id']),console[_0x34abd8(0x1c5)](_0x34abd8(0x13e)+_0x31f4b4[_0x34abd8(0xbb)]),console[_0x34abd8(0x1c5)](_0x34abd8(0x1ab)+_0x31f4b4[_0x34abd8(0x1bf)]?.[_0x34abd8(0x1b0)]),console[_0x34abd8(0x1c5)](_0x34abd8(0x182)+_0x31f4b4[_0x34abd8(0x193)]?.['name']);if(_0x31f4b4[_0x34abd8(0x1bf)]?.['id']&&_0x31f4b4[_0x34abd8(0xbb)]&&_0x31f4b4['id']){const _0x4d6392=_0x134d14[_0x34abd8(0x1a5)],_0x458c21=getConsoleUrl(_0x4d6392,_0x34abd8(0x180)+_0x31f4b4['project']['id']+_0x34abd8(0x1c1)+_0x31f4b4[_0x34abd8(0xbb)]+'/attempt/'+_0x31f4b4['id']);console[_0x34abd8(0x1c5)](_0x34abd8(0x1bc)+a38_0x1f01e4['cyan'](_0x458c21));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a38_0x23c959(0x144);[a38_0x23c959(0x183)]=a38_0x23c959(0xd0);async[a38_0x23c959(0x114)](_0x284f1d){const _0x194ffb=a38_0x23c959,{options:_0x59c7ff,args:_0x420ceb,tdx:_0x2c919f}=_0x284f1d,_0x2676c0=_0x420ceb[0x0],_0x8bdd43=_0x420ceb[0x1]||'.';if(!_0x2676c0)return console[_0x194ffb(0x1c5)](_0x194ffb(0xc3)),console['error'](_0x194ffb(0x10a)),0x1;const _0x54a2fc=_0x59c7ff[_0x194ffb(0x196)];_0x59c7ff[_0x194ffb(0x11c)]&&(console[_0x194ffb(0x1c5)](_0x194ffb(0x1c7)+_0x2676c0),console[_0x194ffb(0x1c5)]('Output\x20directory:\x20'+_0x8bdd43),_0x54a2fc&&console['error'](_0x194ffb(0x18d)+_0x54a2fc));const _0x4b2737=await withSpinner('Downloading\x20project\x20'+_0x2676c0+_0x194ffb(0x1c8),()=>_0x2c919f['workflow'][_0x194ffb(0xd4)](_0x2676c0,_0x8bdd43,{'revision':_0x54a2fc}),{'verbose':_0x59c7ff[_0x194ffb(0x11c)]}),_0x52e797=_0x4b2737[_0x194ffb(0x194)];return console[_0x194ffb(0x1c5)]('✔\x20Downloaded\x20'+_0x52e797[_0x194ffb(0x127)]),console['error'](_0x194ffb(0x1ba)+_0x52e797[_0x194ffb(0x196)]),console['error'](_0x194ffb(0x137)+_0x52e797[_0x194ffb(0x1bb)]),console[_0x194ffb(0x1c5)](_0x194ffb(0x175)+_0x8bdd43+'/'+_0x52e797[_0x194ffb(0x127)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a38_0x23c959(0x1b0)]='workflow:upload';[a38_0x23c959(0x183)]=a38_0x23c959(0x128);async[a38_0x23c959(0x114)](_0x4bb2ff){const _0x2c411c=a38_0x23c959,{options:_0x5061a4,args:_0x554a57,tdx:_0x504e2d}=_0x4bb2ff;let _0x29f32b='.',_0x37ee31=_0x5061a4['name'];if(_0x554a57[0x0]){const {promises:_0x9c4c34}=await import('fs');try{const _0xf772d4=await _0x9c4c34[_0x2c411c(0x12d)](_0x554a57[0x0]);if(_0xf772d4[_0x2c411c(0xf2)]())_0x29f32b=_0x554a57[0x0];else return console[_0x2c411c(0x1c5)](_0x2c411c(0xff)+_0x554a57[0x0]+_0x2c411c(0x19b)),0x1;}catch{_0x37ee31=_0x554a57[0x0],_0x29f32b='.';}}const _0x4e521e=_0x5061a4[_0x2c411c(0x196)],_0x371321=_0x5061a4[_0x2c411c(0xcd)];_0x5061a4['verbose']&&(console[_0x2c411c(0x1c5)](_0x2c411c(0xcb)+_0x29f32b),_0x37ee31&&console['error']('Project\x20name:\x20'+_0x37ee31),_0x4e521e&&console['error']('Revision:\x20'+_0x4e521e),_0x371321&&console[_0x2c411c(0x1c5)]('Validation:\x20skipped'));const _0x30d71b=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x504e2d['workflow']['push'](_0x29f32b,{'projectName':_0x37ee31,'revision':_0x4e521e,'skipValidation':_0x371321}),{'verbose':_0x5061a4[_0x2c411c(0x11c)]}),_0x2ab856=_0x30d71b['data'];return console[_0x2c411c(0x1c5)](_0x2c411c(0x1b9)+_0x2ab856[_0x2c411c(0x127)]),console['error'](_0x2c411c(0x167)+_0x2ab856[_0x2c411c(0x16a)]),console[_0x2c411c(0x1c5)](_0x2c411c(0x1ba)+_0x2ab856[_0x2c411c(0x196)]),await this[_0x2c411c(0x168)](_0x504e2d,_0x2ab856[_0x2c411c(0x127)],_0x5061a4[_0x2c411c(0x1a5)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a38_0x23c959(0x1b0)]='workflow:pull';['description']='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a38_0x23c959(0x114)](_0x41f810){const _0x26a59e=a38_0x23c959,{options:_0xd8073d,args:_0x521465,tdx:_0x3c0513}=_0x41f810,_0x29f4b8=_0x521465[0x0],_0x48d573=_0x521465[0x1];if(!_0x29f4b8)return console[_0x26a59e(0x1c5)](a38_0x1f01e4[_0x26a59e(0x1ac)](_0x26a59e(0x190)),'Project\x20name\x20is\x20required'),console['error'](a38_0x1f01e4[_0x26a59e(0xea)](_0x26a59e(0x18f))),0x1;const _0x31e3ac=_0xd8073d[_0x26a59e(0x196)];_0xd8073d[_0x26a59e(0x11c)]&&(console[_0x26a59e(0x1c5)](_0x26a59e(0x1c7)+_0x29f4b8),_0x48d573&&console['error'](_0x26a59e(0x123)+_0x48d573),_0x31e3ac&&console['error']('Revision:\x20'+_0x31e3ac),_0xd8073d[_0x26a59e(0x11f)]&&console[_0x26a59e(0x1c5)]('Dry\x20run:\x20yes'));const _0xce58e6=await withSpinner(_0x26a59e(0xcf)+_0x29f4b8+'...',()=>_0x3c0513[_0x26a59e(0x193)][_0x26a59e(0x1d2)](_0x29f4b8,{'targetDir':_0x48d573,'revision':_0x31e3ac}),{'verbose':_0xd8073d['verbose']}),_0x55f50a=_0xce58e6[_0x26a59e(0x194)];_0x55f50a[_0x26a59e(0x1aa)]?console[_0x26a59e(0x1c5)](_0x26a59e(0xfd)+_0x55f50a[_0x26a59e(0x127)]):console['error'](_0x26a59e(0xfa)+_0x55f50a[_0x26a59e(0x127)]);console[_0x26a59e(0x1c5)](_0x26a59e(0x1ba)+_0x55f50a[_0x26a59e(0x196)]),console['error'](_0x26a59e(0xce)+(a38_0x71a1fd[_0x26a59e(0xfc)](process['cwd'](),_0x55f50a[_0x26a59e(0x15f)])||'.')),console[_0x26a59e(0x1c5)](_0x26a59e(0x135)+a38_0x1f01e4[_0x26a59e(0x179)]('+'+_0x55f50a['summary']['new']+_0x26a59e(0xe5))+',\x20'+(a38_0x1f01e4[_0x26a59e(0xf3)]('~'+_0x55f50a[_0x26a59e(0x125)]['modified']+'\x20modified')+',\x20')+(a38_0x1f01e4[_0x26a59e(0x1ac)]('-'+_0x55f50a['summary']['deleted']+_0x26a59e(0x154))+',\x20')+(''+a38_0x1f01e4[_0x26a59e(0xea)](_0x55f50a[_0x26a59e(0x125)][_0x26a59e(0xe9)]+_0x26a59e(0x1c9))));for(const _0x38902a of _0x55f50a[_0x26a59e(0xe6)]){_0x38902a[_0x26a59e(0x15a)]===_0x26a59e(0x1d1)&&_0x38902a[_0x26a59e(0x147)]&&(console[_0x26a59e(0x1c5)]('\x0a'+a38_0x1f01e4[_0x26a59e(0x15c)](_0x26a59e(0x189)+_0x38902a[_0x26a59e(0x185)])),console[_0x26a59e(0x1c5)](_0x38902a['diff']));}if(!_0x55f50a[_0x26a59e(0x18a)])return saveSessionContext({'workflow_project':_0x55f50a[_0x26a59e(0x127)]},_0xd8073d[_0x26a59e(0x1c6)]),console[_0x26a59e(0x1c5)](a38_0x1f01e4[_0x26a59e(0x179)](_0x26a59e(0x1d8))),console[_0x26a59e(0x1c5)](a38_0x1f01e4[_0x26a59e(0xea)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x55f50a[_0x26a59e(0x127)])),0x0;if(_0xd8073d[_0x26a59e(0x11f)])return console[_0x26a59e(0x1c5)](a38_0x1f01e4[_0x26a59e(0xf3)](_0x26a59e(0x17c))),0x0;if(!_0xd8073d['yes']){const _0x3aa547=await confirmKey(_0x26a59e(0x124));if(!_0x3aa547)return console[_0x26a59e(0x1c5)](_0x26a59e(0xc4)),0x0;}await withSpinner(_0x26a59e(0x131),()=>_0x3c0513[_0x26a59e(0x193)][_0x26a59e(0xeb)](_0x55f50a,{'revision':_0x31e3ac}),{'verbose':_0xd8073d['verbose']}),saveSessionContext({'workflow_project':_0x55f50a['projectName']},_0xd8073d[_0x26a59e(0x1c6)]),console[_0x26a59e(0x1c5)](a38_0x1f01e4[_0x26a59e(0x179)](_0x26a59e(0x129)));const _0xc6658a=a38_0x71a1fd[_0x26a59e(0xfc)](process[_0x26a59e(0xc9)](),_0x55f50a[_0x26a59e(0x15f)])||'.';return console['error'](a38_0x1f01e4[_0x26a59e(0xea)](_0x26a59e(0x175)+_0xc6658a)),console['error'](a38_0x1f01e4['dim'](_0x26a59e(0x121)+_0x55f50a[_0x26a59e(0x127)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a38_0x23c959(0x1b0)]='workflow:push';[a38_0x23c959(0x183)]=a38_0x23c959(0x139);async[a38_0x23c959(0x114)](_0x31a9fc){const _0x3f4621=a38_0x23c959,{options:_0x7fe56c,args:_0x374db8,tdx:_0x4466d7}=_0x31a9fc,_0x15f325=this[_0x3f4621(0x19f)](_0x374db8,_0x7fe56c),_0x1f34c9=_0x7fe56c[_0x3f4621(0x196)],_0x3bfa92=_0x7fe56c[_0x3f4621(0xcd)];_0x7fe56c[_0x3f4621(0x11c)]&&(_0x15f325&&console[_0x3f4621(0x1c5)](_0x3f4621(0x1b5)+_0x15f325),_0x1f34c9&&console['error'](_0x3f4621(0x18d)+_0x1f34c9),_0x7fe56c[_0x3f4621(0x11f)]&&console[_0x3f4621(0x1c5)](_0x3f4621(0x169)),_0x3bfa92&&console[_0x3f4621(0x1c5)](_0x3f4621(0x16d)));let _0x55595f;try{_0x55595f=await withSpinner(_0x3f4621(0x12b),()=>_0x4466d7[_0x3f4621(0x193)][_0x3f4621(0xd3)]({'sourceDir':_0x15f325,'revision':_0x1f34c9,'skipValidation':_0x3bfa92}),{'verbose':_0x7fe56c[_0x3f4621(0x11c)]});}catch(_0x18474e){if(_0x18474e instanceof Error&&_0x18474e[_0x3f4621(0xe1)]['includes']('No\x20workflow\x20tdx.json\x20found'))return console['error'](a38_0x1f01e4[_0x3f4621(0x1ac)](_0x3f4621(0x190)),_0x3f4621(0x1a7)),_0x7fe56c[_0x3f4621(0x1cd)]?console[_0x3f4621(0x1c5)](a38_0x1f01e4['dim']('Tip:\x20cd\x20to\x20workflows/'+_0x7fe56c['workflowProject']+_0x3f4621(0x108)+_0x7fe56c[_0x3f4621(0x1cd)]+'\x27')):console[_0x3f4621(0x1c5)](a38_0x1f01e4[_0x3f4621(0xea)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x18474e;}const _0x14a59b=_0x55595f['data'];console[_0x3f4621(0x1c5)]('✔\x20Project:\x20'+_0x14a59b[_0x3f4621(0x127)]),console['error'](_0x3f4621(0x1c3)+_0x14a59b[_0x3f4621(0xde)]),console[_0x3f4621(0x1c5)](_0x3f4621(0x1ba)+_0x14a59b['revision']),console[_0x3f4621(0x1c5)](_0x3f4621(0x135)+a38_0x1f01e4['green']('+'+_0x14a59b[_0x3f4621(0x125)]['new']+_0x3f4621(0xe5))+',\x20'+(a38_0x1f01e4[_0x3f4621(0xf3)]('~'+_0x14a59b[_0x3f4621(0x125)][_0x3f4621(0x1d1)]+_0x3f4621(0x1ce))+',\x20')+(a38_0x1f01e4[_0x3f4621(0x1ac)]('-'+_0x14a59b[_0x3f4621(0x125)][_0x3f4621(0x1d4)]+'\x20deleted')+',\x20')+(''+a38_0x1f01e4['dim'](_0x14a59b[_0x3f4621(0x125)][_0x3f4621(0xe9)]+_0x3f4621(0x1c9))));for(const _0xb7ad5 of _0x14a59b[_0x3f4621(0xe6)]){_0xb7ad5[_0x3f4621(0x15a)]==='modified'&&_0xb7ad5[_0x3f4621(0x147)]&&(console[_0x3f4621(0x1c5)]('\x0a'+a38_0x1f01e4[_0x3f4621(0x15c)]('---\x20'+_0xb7ad5['path'])),console['error'](_0xb7ad5[_0x3f4621(0x147)]));}if(!_0x14a59b[_0x3f4621(0x18a)])return console[_0x3f4621(0x1c5)](a38_0x1f01e4[_0x3f4621(0x179)](_0x3f4621(0x19a))),await this[_0x3f4621(0x168)](_0x4466d7,_0x14a59b[_0x3f4621(0x127)],_0x7fe56c[_0x3f4621(0x1a5)]),0x0;if(_0x7fe56c[_0x3f4621(0x11f)])return console['error'](a38_0x1f01e4[_0x3f4621(0xf3)](_0x3f4621(0xdc))),0x0;if(!_0x7fe56c[_0x3f4621(0x18b)]){const _0x295076=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x295076)return console[_0x3f4621(0x1c5)](_0x3f4621(0xc4)),0x0;}const _0x13aa29=await withSpinner(_0x3f4621(0x19d),()=>_0x4466d7[_0x3f4621(0x193)]['executePushProject'](_0x14a59b),{'verbose':_0x7fe56c[_0x3f4621(0x11c)]}),_0x2b9598=_0x13aa29[_0x3f4621(0x194)];return console[_0x3f4621(0x1c5)](a38_0x1f01e4[_0x3f4621(0x179)](_0x3f4621(0x12e))),console[_0x3f4621(0x1c5)](_0x3f4621(0x167)+_0x2b9598[_0x3f4621(0x16a)]),console[_0x3f4621(0x1c5)](_0x3f4621(0x1ba)+_0x2b9598[_0x3f4621(0x196)]),await this[_0x3f4621(0x168)](_0x4466d7,_0x2b9598[_0x3f4621(0x127)],_0x7fe56c[_0x3f4621(0x1a5)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']='workflow:clone';[a38_0x23c959(0x183)]=a38_0x23c959(0x159);async['execute'](_0x5ef110){const _0x3e5046=a38_0x23c959,{options:_0x532a4d,args:_0x58739f,tdx:_0x37339f}=_0x5ef110,_0x116ba5=this[_0x3e5046(0x19f)](_0x58739f,_0x532a4d),_0xc83e10=_0x532a4d[_0x3e5046(0x1b0)],_0x34840d=_0x532a4d[_0x3e5046(0x196)],_0x418edc=_0x532a4d[_0x3e5046(0xcd)];if(!_0x116ba5)return console['error'](a38_0x1f01e4[_0x3e5046(0x1ac)](_0x3e5046(0x190)),'Source\x20directory\x20is\x20required'),console[_0x3e5046(0x1c5)](a38_0x1f01e4['dim'](_0x3e5046(0x14f))),console[_0x3e5046(0x1c5)](a38_0x1f01e4[_0x3e5046(0xea)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0xc83e10)return console['error'](a38_0x1f01e4['red'](_0x3e5046(0x190)),_0x3e5046(0xc0)),console['error'](a38_0x1f01e4[_0x3e5046(0xea)](_0x3e5046(0x14f))),0x1;_0x532a4d[_0x3e5046(0x11c)]&&(console[_0x3e5046(0x1c5)]('Source\x20directory:\x20'+_0x116ba5),console['error']('New\x20project\x20name:\x20'+_0xc83e10),_0x34840d&&console['error'](_0x3e5046(0x18d)+_0x34840d),_0x532a4d[_0x3e5046(0x11f)]&&console['error'](_0x3e5046(0x169)),_0x418edc&&console[_0x3e5046(0x1c5)](_0x3e5046(0x16d)));const _0x261e8d=await withSpinner(_0x3e5046(0xf9),()=>_0x37339f['workflow']['prepareCloneProject'](_0x116ba5,_0xc83e10,{'revision':_0x34840d,'skipValidation':_0x418edc}),{'verbose':_0x532a4d[_0x3e5046(0x11c)]}),_0x22ec07=_0x261e8d['data'];console[_0x3e5046(0x1c5)](_0x3e5046(0x155)+_0x22ec07[_0x3e5046(0xde)]);_0x22ec07[_0x3e5046(0x1d6)]&&console[_0x3e5046(0x1c5)](_0x3e5046(0x111)+_0x22ec07[_0x3e5046(0x1d6)]);console[_0x3e5046(0x1c5)]('New\x20project\x20name:\x20'+_0x22ec07['newProjectName']),console[_0x3e5046(0x1c5)]('Revision:\x20'+_0x22ec07[_0x3e5046(0x196)]),console[_0x3e5046(0x1c5)](_0x3e5046(0xd9)+_0x22ec07['fileCount']);_0x22ec07[_0x3e5046(0x15e)]&&(console[_0x3e5046(0x1c5)](a38_0x1f01e4[_0x3e5046(0xf3)](_0x3e5046(0xd6)+_0x22ec07[_0x3e5046(0x1a9)]+_0x3e5046(0x12c)+_0x22ec07[_0x3e5046(0x177)]+')')),console[_0x3e5046(0x1c5)](a38_0x1f01e4[_0x3e5046(0xf3)](_0x3e5046(0x153))));if(_0x532a4d[_0x3e5046(0x11f)])return console['error'](a38_0x1f01e4['yellow']('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x532a4d[_0x3e5046(0x18b)]){const _0x13e6a2=_0x22ec07[_0x3e5046(0x1d6)]||a38_0x71a1fd[_0x3e5046(0xfb)](_0x116ba5),_0x424fbe=_0x22ec07[_0x3e5046(0x15e)]?_0x3e5046(0x12f)+_0xc83e10+'\x22\x20with\x20new\x20revision?':'\x0aClone\x20\x22'+_0x13e6a2+'\x22\x20to\x20new\x20project\x20\x22'+_0xc83e10+'\x22?',_0x446c08=await confirmKey(_0x424fbe);if(!_0x446c08)return console['error'](_0x3e5046(0xc4)),0x0;}const _0x2c082c=await withSpinner(_0x22ec07['targetExists']?_0x3e5046(0x11a)+_0xc83e10+'...':_0x3e5046(0xc7)+_0xc83e10+_0x3e5046(0x1c8),()=>_0x37339f[_0x3e5046(0x193)][_0x3e5046(0xd1)](_0x22ec07),{'verbose':_0x532a4d[_0x3e5046(0x11c)]}),_0x14e7c4=_0x2c082c['data'];return console[_0x3e5046(0x1c5)](a38_0x1f01e4['green'](_0x22ec07['targetExists']?_0x3e5046(0xdf):'✔\x20Clone\x20complete')),console[_0x3e5046(0x1c5)](_0x3e5046(0x1ab)+_0x14e7c4[_0x3e5046(0x1a9)]),console[_0x3e5046(0x1c5)](_0x3e5046(0x167)+_0x14e7c4[_0x3e5046(0x1a3)]),console[_0x3e5046(0x1c5)](_0x3e5046(0x1ba)+_0x14e7c4[_0x3e5046(0x196)]),await this['showWorkflowConsoleUrl'](_0x37339f,_0x14e7c4[_0x3e5046(0x1a9)],_0x532a4d['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a38_0x23c959(0x1b0)]=a38_0x23c959(0x1b2);[a38_0x23c959(0x183)]=a38_0x23c959(0x14c);async['execute'](_0x1cde46){const _0x568411=a38_0x23c959,{options:_0x2fe0b8,args:_0x375640,tdx:_0xbaa702}=_0x1cde46,_0x4804ed=_0x375640[0x0];if(!_0x4804ed)return console[_0x568411(0x1c5)](_0x568411(0x109)),console[_0x568411(0x1c5)](_0x568411(0x1af)),0x1;_0x2fe0b8[_0x568411(0x11c)]&&console[_0x568411(0x1c5)](_0x568411(0x1c7)+_0x4804ed);if(!_0x2fe0b8['yes']){const _0x5757ff=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x4804ed+_0x568411(0x16e));if(!_0x5757ff)return console[_0x568411(0x1c5)](_0x568411(0xc4)),0x0;}const _0x10e1a8=await withSpinner(_0x568411(0xf7)+_0x4804ed+'...',()=>_0xbaa702[_0x568411(0x193)][_0x568411(0xf4)](_0x4804ed),{'verbose':_0x2fe0b8[_0x568411(0x11c)]}),_0x2ce7fc=_0x10e1a8[_0x568411(0x194)];return console['error'](_0x568411(0xbe)+_0x2ce7fc[_0x568411(0x127)]),console[_0x568411(0x1c5)](_0x568411(0x167)+_0x2ce7fc[_0x568411(0x16a)]),0x0;}}export function parseKeyValue(_0x2c26e2){const _0x572e59=a38_0x23c959,_0x16453d=_0x2c26e2[_0x572e59(0xdd)]('=');if(_0x16453d===-0x1)throw new Error('Invalid\x20format:\x20'+_0x2c26e2+_0x572e59(0xe7));const _0x1aa21c=_0x2c26e2[_0x572e59(0xd2)](0x0,_0x16453d),_0x39acdb=_0x2c26e2['substring'](_0x16453d+0x1);if(!_0x1aa21c)throw new Error(_0x572e59(0x19e));return{'key':_0x1aa21c,'value':_0x39acdb};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a38_0x23c959(0x1b0)]=a38_0x23c959(0x103);[a38_0x23c959(0x183)]=a38_0x23c959(0x13a);async['execute'](_0xd2e14d){const _0x33f722=a38_0x23c959,{options:_0xd4e9f1,args:_0xcbd7b9,tdx:_0x32078b}=_0xd2e14d,_0x552343=this[_0x33f722(0x11d)](_0xcbd7b9,_0xd4e9f1);if(!_0x552343)return 0x1;_0xd4e9f1[_0x33f722(0x11c)]&&console[_0x33f722(0x1c5)]('Project:\x20'+_0x552343);const _0x18b995=await withSpinner(_0x33f722(0xbd),()=>_0x32078b[_0x33f722(0x193)][_0x33f722(0x197)](_0x552343),{'verbose':_0xd4e9f1[_0x33f722(0x11c)]}),{secrets:_0x116156}=_0x18b995[_0x33f722(0x194)];return console[_0x33f722(0x1c5)](_0x33f722(0x145)+_0x116156[_0x33f722(0x120)]+_0x33f722(0xef)+(_0x116156[_0x33f722(0x120)]!==0x1?'s':'')),await handleSDKOutput(_0x116156,_0xd4e9f1),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a38_0x23c959(0x1b0)]=a38_0x23c959(0xd5);[a38_0x23c959(0x183)]=a38_0x23c959(0x173);async[a38_0x23c959(0x114)](_0x1186ca){const _0x274fa0=a38_0x23c959,{options:_0x4cede4,args:_0x4b828b,tdx:_0x1b31a4}=_0x1186ca;let _0x2f27fd,_0x2b6bca;if(_0x4b828b[_0x274fa0(0x120)]>=0x2)_0x2f27fd=_0x4b828b[0x0],_0x2b6bca=_0x4b828b[0x1];else{if(_0x4b828b[_0x274fa0(0x120)]===0x1&&_0x4cede4[_0x274fa0(0x1cd)])_0x2f27fd=_0x4cede4[_0x274fa0(0x1cd)],_0x2b6bca=_0x4b828b[0x0];else return _0x4b828b[_0x274fa0(0x120)]===0x1?(console['error'](_0x274fa0(0xc3)),console[_0x274fa0(0x1c5)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error'](_0x274fa0(0x1a6)),console[_0x274fa0(0x1c5)](_0x274fa0(0x191)),0x1);}let _0x33a7a0,_0x142b21;try{({key:_0x33a7a0,value:_0x142b21}=parseKeyValue(_0x2b6bca));}catch(_0xa9138a){return _0xa9138a instanceof Error&&console['error'](a38_0x1f01e4[_0x274fa0(0x1ac)](_0x274fa0(0x190)),_0xa9138a[_0x274fa0(0xe1)]),0x1;}_0x4cede4[_0x274fa0(0x11c)]&&(console['error'](_0x274fa0(0x1c7)+_0x2f27fd),console[_0x274fa0(0x1c5)](_0x274fa0(0x1cf)+_0x33a7a0));const _0x256b1c=await withSpinner('Setting\x20secret...',()=>_0x1b31a4[_0x274fa0(0x193)][_0x274fa0(0x1b8)](_0x2f27fd,_0x33a7a0,_0x142b21),{'verbose':_0x4cede4[_0x274fa0(0x11c)]}),_0xde8500=_0x256b1c[_0x274fa0(0x194)];return console['error'](_0x274fa0(0x105)+_0xde8500[_0x274fa0(0x113)]+_0x274fa0(0x16b)+_0xde8500[_0x274fa0(0x127)]+'\x27'),(_0x4cede4['json']||_0x4cede4['jsonl'])&&await handleSingleObjectOutput(_0xde8500,_0x4cede4),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a38_0x23c959(0x1b0)]=a38_0x23c959(0xc5);['description']=a38_0x23c959(0x149);async[a38_0x23c959(0x114)](_0x197cec){const _0x2c45c0=a38_0x23c959,{options:_0x552c2a,args:_0x1e9a53,tdx:_0x464475}=_0x197cec;let _0x37b72c,_0x1bab18;if(_0x1e9a53['length']>=0x2)_0x37b72c=_0x1e9a53[0x0],_0x1bab18=_0x1e9a53[0x1];else{if(_0x1e9a53[_0x2c45c0(0x120)]===0x1&&_0x552c2a[_0x2c45c0(0x1cd)])_0x37b72c=_0x552c2a[_0x2c45c0(0x1cd)],_0x1bab18=_0x1e9a53[0x0];else return _0x1e9a53[_0x2c45c0(0x120)]===0x1?(console[_0x2c45c0(0x1c5)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x2c45c0(0x1c5)](_0x2c45c0(0x104)),0x1):(console['error'](_0x2c45c0(0x164)),console[_0x2c45c0(0x1c5)](_0x2c45c0(0x12a)),0x1);}_0x552c2a[_0x2c45c0(0x11c)]&&(console[_0x2c45c0(0x1c5)](_0x2c45c0(0x1c7)+_0x37b72c),console[_0x2c45c0(0x1c5)](_0x2c45c0(0x1cf)+_0x1bab18));if(!_0x552c2a['yes']){const _0x3c5bd2=await confirmKey(_0x2c45c0(0x165)+_0x1bab18+'\x27\x20from\x20project\x20\x27'+_0x37b72c+'\x27?');if(!_0x3c5bd2)return console[_0x2c45c0(0x1c5)](_0x2c45c0(0xc4)),0x0;}const _0xe9567c=await withSpinner(_0x2c45c0(0xc6),()=>_0x464475['workflow']['deleteSecret'](_0x37b72c,_0x1bab18),{'verbose':_0x552c2a['verbose']}),_0x2411d3=_0xe9567c[_0x2c45c0(0x194)];return console[_0x2c45c0(0x1c5)]('✔\x20Secret\x20\x27'+_0x2411d3[_0x2c45c0(0x113)]+_0x2c45c0(0x17e)+_0x2411d3['projectName']+'\x27'),(_0x552c2a[_0x2c45c0(0x161)]||_0x552c2a[_0x2c45c0(0xbc)])&&await handleSingleObjectOutput(_0x2411d3,_0x552c2a),0x0;}}
|
package/dist/core/auth.d.ts
CHANGED
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
* Manages API authentication headers and credentials
|
|
5
5
|
*/
|
|
6
6
|
import type { TDSite } from '../sdk/types/index.js';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
export declare function getVersion(): string;
|
|
7
|
+
export { getVersion, getBuildInfo, isDevVersion } from './version.js';
|
|
8
|
+
export type { BuildInfo } from './version.js';
|
|
11
9
|
/**
|
|
12
10
|
* Get User-Agent string
|
|
13
11
|
*
|
package/dist/core/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/core/auth.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/core/auth.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAKpD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACtE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAMrC;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACnC;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAgB1E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQ3E;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAerF;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAG/C"}
|
package/dist/core/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a39_0x5268(_0xa63048,_0x40b432){_0xa63048=_0xa63048-0x173;const _0x179677=a39_0x1796();let _0x526850=_0x179677[_0xa63048];return _0x526850;}function a39_0x1796(){const _0x1dd404=['11857970OGIYpb','835487nnVJDF','6bFAguy','360dGSvAP','tdx','10897621zqkXQE','replace','version','Authorization','78678HlUqCQ','3593505DiSWcn','tdx/',';\x20node/','622424owJZYs','1814418KoaZUO','X-Trino-User','TD1\x20','2jfYILy','entries'];a39_0x1796=function(){return _0x1dd404;};return a39_0x1796();}(function(_0x1403b0,_0x322dc8){const _0xd094e=a39_0x5268,_0x241fb7=_0x1403b0();while(!![]){try{const _0x40ae38=parseInt(_0xd094e(0x181))/0x1*(parseInt(_0xd094e(0x17e))/0x2)+parseInt(_0xd094e(0x17b))/0x3+parseInt(_0xd094e(0x17a))/0x4+parseInt(_0xd094e(0x177))/0x5*(-parseInt(_0xd094e(0x182))/0x6)+-parseInt(_0xd094e(0x185))/0x7+-parseInt(_0xd094e(0x183))/0x8*(-parseInt(_0xd094e(0x176))/0x9)+parseInt(_0xd094e(0x180))/0xa;if(_0x40ae38===_0x322dc8)break;else _0x241fb7['push'](_0x241fb7['shift']());}catch(_0x56ba96){_0x241fb7['push'](_0x241fb7['shift']());}}}(a39_0x1796,0xdb9fe));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0xb6b07b=a39_0x5268,_0x38b1f3=getVersion(),_0x482371=platform(),_0x47cad9=process[_0xb6b07b(0x174)][_0xb6b07b(0x173)]('v','');return _0xb6b07b(0x178)+_0x38b1f3+'\x20('+_0x482371+_0xb6b07b(0x179)+_0x47cad9+')';}export function getAuthHeaders(_0x105c48,_0xe1a531){const _0x11b08b=a39_0x5268,_0x5c1ab5=getVersion(),_0x34ec1c={'User-Agent':getUserAgent(),'X-TD-Client':_0x11b08b(0x184),'X-TD-Client-Version':_0x5c1ab5};return _0xe1a531&&(_0x34ec1c['Authorization']=_0x11b08b(0x17d)+_0xe1a531),_0x34ec1c;}export function toHeaderRecord(_0x25894e){const _0x52e5ee=a39_0x5268,_0x31834c={};for(const [_0x2e9de6,_0x16b605]of Object[_0x52e5ee(0x17f)](_0x25894e)){_0x16b605!==undefined&&(_0x31834c[_0x2e9de6]=_0x16b605);}return _0x31834c;}export function getTrinoHeaders(_0x5aa061,_0x283b6c){const _0x46d707=a39_0x5268,_0x889426=getAuthHeaders(_0x5aa061,_0x283b6c),_0x12d697=toHeaderRecord(_0x889426);return delete _0x12d697[_0x46d707(0x175)],_0x283b6c&&(_0x12d697[_0x46d707(0x17c)]=_0x283b6c),_0x12d697;}export function hasAPIKey(_0x3e6a1d){const _0x4ff4ad=getAPIKey(_0x3e6a1d);return _0x4ff4ad!==undefined&&_0x4ff4ad['length']>0x0;}
|
package/dist/core/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/core/auth.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/core/auth.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,yDAAyD;AACzD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGtE;;;;;GAKG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAC;IACtB,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAErD,OAAO,OAAO,OAAO,KAAK,EAAE,UAAU,WAAW,GAAG,CAAC;AACvD,CAAC;AAcD;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa,EAAE,MAAe;IAC3D,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAE7B,MAAM,OAAO,GAAgB;QAC3B,YAAY,EAAE,YAAY,EAAE;QAC5B,aAAa,EAAE,KAAK;QACpB,qBAAqB,EAAE,OAAO;KAC/B,CAAC;IAEF,wDAAwD;IACxD,+DAA+D;IAC/D,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,CAAC,aAAa,GAAG,OAAO,MAAM,EAAE,CAAC;IAC1C,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,OAAoB;IACjD,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACnD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACtB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,MAAe;IAC3D,kCAAkC;IAClC,MAAM,WAAW,GAAG,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAEjD,6DAA6D;IAC7D,MAAM,YAAY,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;IACjD,OAAO,YAAY,CAAC,aAAa,CAAC;IAElC,2CAA2C;IAC3C,kEAAkE;IAClE,IAAI,MAAM,EAAE,CAAC;QACX,YAAY,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;IACxC,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC/B,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x13f8c9,_0x5b4041){const _0x1cff4c=a40_0x9669,_0x292c36=_0x13f8c9();while(!![]){try{const _0x5aab9e=parseInt(_0x1cff4c(0x18d))/0x1+-parseInt(_0x1cff4c(0x18f))/0x2*(parseInt(_0x1cff4c(0x182))/0x3)+parseInt(_0x1cff4c(0x18e))/0x4+parseInt(_0x1cff4c(0x1ac))/0x5*(parseInt(_0x1cff4c(0x1ad))/0x6)+-parseInt(_0x1cff4c(0x183))/0x7*(-parseInt(_0x1cff4c(0x1bc))/0x8)+-parseInt(_0x1cff4c(0x1b2))/0x9*(-parseInt(_0x1cff4c(0x17f))/0xa)+-parseInt(_0x1cff4c(0x1b6))/0xb;if(_0x5aab9e===_0x5b4041)break;else _0x292c36['push'](_0x292c36['shift']());}catch(_0x1760cb){_0x292c36['push'](_0x292c36['shift']());}}}(a40_0x5687,0x4b365));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a40_0x555668 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0xd09fd){const _0x37f0ad=a40_0x9669;return _0xd09fd[_0x37f0ad(0x1be)]===_0x37f0ad(0x1a6)||_0xd09fd[_0x37f0ad(0x1be)]===_0x37f0ad(0x1aa)||_0xd09fd[_0x37f0ad(0x1be)]==='tsv'||_0xd09fd['format']===_0x37f0ad(0x17b)||_0xd09fd[_0x37f0ad(0x1a6)]===!![]||_0xd09fd[_0x37f0ad(0x1aa)]===!![]||_0xd09fd['tsv']===!![]||_0xd09fd[_0x37f0ad(0x17b)]===!![];}export function parseOutputOptions(_0x5d5a7c){const _0x33e0b2=a40_0x9669;return{'format':_0x5d5a7c['format']||_0x33e0b2(0x17b),'output':_0x5d5a7c[_0x33e0b2(0x17e)]||'','limit':_0x5d5a7c[_0x33e0b2(0x18b)],'color':_0x5d5a7c[_0x33e0b2(0x17c)],'noColor':_0x5d5a7c[_0x33e0b2(0x1a2)]};}function convertSDKResultToQueryResult(_0x3ccebe){const _0x15b483=a40_0x9669,_0x1e457f=[];if(_0x3ccebe[_0x15b483(0x1b0)]>0x0){const _0x5b6159=_0x3ccebe[0x0];for(const [_0x9e989b,_0x26a9ec]of Object[_0x15b483(0x1bd)](_0x5b6159)){let _0x309eed=_0x15b483(0x198);if(typeof _0x26a9ec==='number')_0x309eed=Number[_0x15b483(0x1a1)](_0x26a9ec)?_0x15b483(0x1b4):_0x15b483(0x1a3);else{if(typeof _0x26a9ec===_0x15b483(0x1a9))_0x309eed=_0x15b483(0x1a9);else _0x26a9ec===null&&(_0x309eed='varchar');}_0x1e457f[_0x15b483(0x1ae)]({'name':_0x9e989b,'type':_0x309eed});}}return{'queryId':_0x15b483(0x1b9),'columns':_0x1e457f,'data':_0x3ccebe,'stats':{'state':_0x15b483(0x195),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3ccebe[_0x15b483(0x1b0)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x436b77,_0x13d495){const _0x569fa6=convertSDKResultToQueryResult(_0x436b77);return formatQueryOutput(_0x569fa6,_0x13d495);}export async function formatQueryOutput(_0x1bad22,_0x14e118){const _0x58cb56=a40_0x9669,{format:_0x187eb1,limit:_0x5e7827,output:_0x1a7cbd,color:_0x413f7f,noColor:_0x55cf48}=_0x14e118,_0x11190a=Boolean(_0x1a7cbd)&&!_0x413f7f,_0x41c71c={'color':_0x413f7f,'noColor':_0x55cf48||_0x11190a};if(_0x187eb1===_0x58cb56(0x17b)){const _0x42dcf4=shouldUseLess(_0x187eb1,_0x1a7cbd);return formatAsTable(_0x1bad22,_0x5e7827,_0x42dcf4,_0x41c71c);}else{if(_0x187eb1===_0x58cb56(0x1a6))return formatAsJSON(_0x1bad22,_0x41c71c);else return _0x187eb1===_0x58cb56(0x1aa)?formatAsJSONL(_0x1bad22,_0x41c71c):formatQueryResult(_0x1bad22,_0x187eb1);}}function a40_0x9669(_0x859c96,_0x3ba1d3){_0x859c96=_0x859c96-0x17b;const _0x5687d8=a40_0x5687();let _0x9669ac=_0x5687d8[_0x859c96];return _0x9669ac;}function shouldUseLess(_0x505b0e,_0x20ebab){const _0x179817=a40_0x9669;return _0x505b0e===_0x179817(0x17b)&&process[_0x179817(0x19d)]['isTTY']&&!_0x20ebab;}export function resolveOutputOptions(_0x57d963){const _0x57f383=a40_0x9669,_0x422bbd=resolveOutputFormat(_0x57d963[_0x57f383(0x1be)],_0x57d963[_0x57f383(0x17e)],_0x57f383(0x17b));let _0x192294=typeof _0x57d963['limit']==='number'?_0x57d963[_0x57f383(0x18b)]:parseInt(_0x57d963[_0x57f383(0x18b)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x404808=_0x57d963[_0x57f383(0x17e)]||'';return shouldUseLess(_0x422bbd,_0x404808)&&(_0x192294=Infinity),{'format':_0x422bbd,'output':_0x404808,'limit':_0x192294,'color':_0x57d963[_0x57f383(0x17c)],'noColor':_0x57d963[_0x57f383(0x1a2)]};}export function writeOutput(_0x1c6b5e,_0x5e7039,_0x259c6b){const _0x55eb45=a40_0x9669;return _0x5e7039?(writeFileSync(_0x5e7039,_0x1c6b5e),console[_0x55eb45(0x1af)](_0x55eb45(0x187)+_0x5e7039),Promise['resolve']()):shouldUseLess(_0x259c6b||'','')?new Promise(_0x1621b6=>{const _0x15fd3e=_0x55eb45,_0x91c6b4=spawn(_0x15fd3e(0x188),[_0x15fd3e(0x189)],{'stdio':['pipe','inherit',_0x15fd3e(0x194)]});let _0x3263c7=![];_0x91c6b4['on'](_0x15fd3e(0x1af),()=>{const _0x4799c8=_0x15fd3e;!_0x3263c7&&(_0x3263c7=!![],console[_0x4799c8(0x185)](_0x1c6b5e),_0x1621b6());}),_0x91c6b4['on'](_0x15fd3e(0x19c),()=>{!_0x3263c7&&(_0x3263c7=!![],_0x1621b6());}),_0x91c6b4['on']('spawn',()=>{const _0x3aa240=_0x15fd3e;!_0x3263c7&&_0x91c6b4[_0x3aa240(0x192)]&&(_0x91c6b4[_0x3aa240(0x192)]['on'](_0x3aa240(0x1af),()=>{}),_0x91c6b4[_0x3aa240(0x192)][_0x3aa240(0x17d)](_0x1c6b5e),_0x91c6b4[_0x3aa240(0x192)]['end']());}),!_0x91c6b4[_0x15fd3e(0x192)]&&(!_0x3263c7&&(_0x3263c7=!![],console[_0x15fd3e(0x185)](_0x1c6b5e),_0x1621b6()));}):(console[_0x55eb45(0x185)](_0x1c6b5e),Promise[_0x55eb45(0x1a7)]());}export async function handleSDKOutput(_0x4334fa,_0x266f34){const _0x2568cb=a40_0x9669,_0x209992=resolveOutputOptions(_0x266f34),_0x1c7416=await formatSDKOutput(_0x4334fa,_0x209992);await writeOutput(_0x1c7416,_0x209992[_0x2568cb(0x17e)]||undefined,_0x209992[_0x2568cb(0x1be)]);}function a40_0x5687(){const _0x57f968=['1575831veMHxw','7ykwNpT','tsv','log','magenta','Results\x20saved\x20to\x20','less','-FXRSn','[params]','limit','forEach','536898moSIzD','1108780MWXBCz','2CrzVqO','string','[Object]','stdin','map','inherit','FINISHED','join','bold','varchar','rule','trim','[logs]','close','stdout','[query]','max','params','isInteger','noColor','double','cmdout','cyan','json','resolve','filter','boolean','jsonl','query','3585CmjHwJ','1476FBVvWW','push','error','length','keys','45jvehuI','stringify','bigint','blue','5441161mBYzrH','[rule]','split','sdk-result','object','stderr','86696kkFkdD','entries','format','table','color','write','output','653370tkCAaM','repeat','No\x20data'];a40_0x5687=function(){return _0x57f968;};return a40_0x5687();}export async function handleQueryOutput(_0x30d599,_0x15e11c){const _0x193b30=a40_0x9669,_0x2c166d=resolveOutputOptions(_0x15e11c),_0x4ca24e=await formatQueryOutput(_0x30d599,_0x2c166d);await writeOutput(_0x4ca24e,_0x2c166d['output']||undefined,_0x2c166d[_0x193b30(0x1be)]);}async function formatSingleObject(_0x34ad70,_0x3e27b9){const _0x4c641f=a40_0x9669,{format:_0x8a5949,color:_0x35ea8b,noColor:_0x1fbda2}=_0x3e27b9,_0x644c6a={'color':_0x35ea8b,'noColor':_0x1fbda2};if(_0x8a5949==='json'){if(shouldUseColor(_0x644c6a))return colorizeJSON(_0x34ad70,_0x644c6a);return JSON[_0x4c641f(0x1b3)](_0x34ad70,null,0x2);}else{if(_0x8a5949==='jsonl'){if(shouldUseColor(_0x644c6a))return colorizeJSONCompact(_0x34ad70,_0x644c6a);return JSON[_0x4c641f(0x1b3)](_0x34ad70);}else{if(_0x8a5949===_0x4c641f(0x184))return Object[_0x4c641f(0x1bd)](_0x34ad70)[_0x4c641f(0x193)](([_0x887c21,_0x4faab8])=>_0x887c21+'\x09'+_0x4faab8)[_0x4c641f(0x196)]('\x0a');else{const _0x344357=Object[_0x4c641f(0x1bd)](_0x34ad70);if(_0x344357[_0x4c641f(0x1b0)]===0x0)return _0x4c641f(0x181);const _0x4f0982=_0x34ad70['debug'],_0x21c023=_0x34ad70[_0x4c641f(0x1ab)],_0x27ae16=_0x34ad70[_0x4c641f(0x1a0)],_0x424b8c=_0x34ad70[_0x4c641f(0x199)],_0x40ff47=_0x21c023?typeof _0x21c023===_0x4c641f(0x190)?_0x21c023:JSON['stringify'](_0x21c023,null,0x2):undefined,_0x3963ad=_0x27ae16&&Object['keys'](_0x27ae16)[_0x4c641f(0x1b0)]>0x0?JSON[_0x4c641f(0x1b3)](_0x27ae16,null,0x2):undefined,_0x35a83a=_0x424b8c&&Object[_0x4c641f(0x1b1)](_0x424b8c)['length']>0x0?JSON[_0x4c641f(0x1b3)](_0x424b8c,null,0x2):undefined,_0x3dfa62=_0x344357[_0x4c641f(0x1a8)](([_0x25692d])=>_0x25692d!=='debug'&&_0x25692d!=='query'&&_0x25692d!==_0x4c641f(0x1a0)&&_0x25692d!==_0x4c641f(0x199)),_0x5d95ed=Math[_0x4c641f(0x19f)](..._0x3dfa62[_0x4c641f(0x193)](([_0x58d56a])=>_0x58d56a[_0x4c641f(0x1b0)])),_0x2d6016=Math[_0x4c641f(0x19f)](..._0x3dfa62[_0x4c641f(0x193)](([,_0x6a5e20])=>{const _0x3093be=_0x4c641f;try{const _0x185e71=_0x6a5e20===null||_0x6a5e20===undefined?'':typeof _0x6a5e20===_0x3093be(0x1ba)?JSON[_0x3093be(0x1b3)](_0x6a5e20):String(_0x6a5e20),_0x494bc1=_0x185e71[_0x3093be(0x1b8)]('\x0a');return Math[_0x3093be(0x19f)](..._0x494bc1[_0x3093be(0x193)](_0xc335b7=>_0xc335b7['length']),0x0);}catch{return 0x0;}}),0x14),_0x326783=[];_0x326783[_0x4c641f(0x1ae)](colorBorder('┌─'+'─'[_0x4c641f(0x180)](_0x5d95ed)+'─┬─'+'─'[_0x4c641f(0x180)](_0x2d6016)+'─┐',_0x644c6a)),_0x3dfa62[_0x4c641f(0x18c)](([_0x5ea45e,_0x13b778])=>{const _0x348401=_0x4c641f;let _0x25f242;try{_0x25f242=_0x13b778===null||_0x13b778===undefined?'':typeof _0x13b778==='object'?JSON[_0x348401(0x1b3)](_0x13b778):String(_0x13b778);}catch{_0x25f242=_0x348401(0x191);}const _0x3ee08e=_0x5ea45e['padEnd'](_0x5d95ed),_0x26f761=_0x25f242[_0x348401(0x1b8)]('\x0a');_0x26f761[_0x348401(0x18c)]((_0x2c055d,_0x27ff7b)=>{const _0x1a6be7=_0x348401,_0x1f7da5=colorBorder('│',_0x644c6a);_0x27ff7b===0x0?_0x326783[_0x1a6be7(0x1ae)](_0x1f7da5+'\x20'+_0x3ee08e+'\x20'+_0x1f7da5+'\x20'+_0x2c055d['padEnd'](_0x2d6016)+'\x20'+_0x1f7da5):_0x326783[_0x1a6be7(0x1ae)](_0x1f7da5+'\x20'+'\x20'['repeat'](_0x5d95ed)+'\x20'+_0x1f7da5+'\x20'+_0x2c055d['padEnd'](_0x2d6016)+'\x20'+_0x1f7da5);});}),_0x326783[_0x4c641f(0x1ae)](colorBorder('└─'+'─'['repeat'](_0x5d95ed)+'─┴─'+'─'[_0x4c641f(0x180)](_0x2d6016)+'─┘',_0x644c6a));_0x40ff47&&(_0x326783[_0x4c641f(0x1ae)](''),_0x326783['push'](String(a40_0x555668['yellow'][_0x4c641f(0x197)](_0x4c641f(0x19e)))),_0x326783[_0x4c641f(0x1ae)](_0x40ff47));_0x3963ad&&(_0x326783[_0x4c641f(0x1ae)](''),_0x326783[_0x4c641f(0x1ae)](String(a40_0x555668[_0x4c641f(0x1b5)][_0x4c641f(0x197)](_0x4c641f(0x18a)))),_0x326783[_0x4c641f(0x1ae)](_0x3963ad));_0x35a83a&&(_0x326783[_0x4c641f(0x1ae)](''),_0x326783[_0x4c641f(0x1ae)](String(a40_0x555668[_0x4c641f(0x186)][_0x4c641f(0x197)](_0x4c641f(0x1b7)))),_0x326783[_0x4c641f(0x1ae)](_0x35a83a));if(_0x4f0982){if(_0x4f0982['stderr']){_0x326783['push'](''),_0x326783[_0x4c641f(0x1ae)](String(a40_0x555668['red']['bold']('[error]')));const _0x510add=_0x4f0982[_0x4c641f(0x1bb)]['split']('\x0a');_0x510add['forEach'](_0x1347e6=>{const _0x418533=_0x4c641f;_0x1347e6[_0x418533(0x19a)]()&&_0x326783[_0x418533(0x1ae)](_0x1347e6);});}if(_0x4f0982[_0x4c641f(0x1a4)]){_0x326783[_0x4c641f(0x1ae)](''),_0x326783[_0x4c641f(0x1ae)](String(a40_0x555668[_0x4c641f(0x1a5)][_0x4c641f(0x197)](_0x4c641f(0x19b))));const _0xda6f14=_0x4f0982[_0x4c641f(0x1a4)][_0x4c641f(0x1b8)]('\x0a');_0xda6f14['forEach'](_0x22138c=>{const _0x3f0fd8=_0x4c641f;_0x22138c['trim']()&&_0x326783[_0x3f0fd8(0x1ae)](_0x22138c);});}}return _0x326783[_0x4c641f(0x196)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x2a6602,_0x5849dc){const _0x232e23=a40_0x9669;if(_0x5849dc[_0x232e23(0x1be)]===_0x232e23(0x17b)){await handleSDKOutput([_0x2a6602],_0x5849dc);return;}const _0x3022d0=resolveOutputOptions(_0x5849dc),_0x460c84=await formatSingleObject(_0x2a6602,_0x3022d0);await writeOutput(_0x460c84,_0x3022d0[_0x232e23(0x17e)]||undefined,_0x3022d0[_0x232e23(0x1be)]);}
|
|
1
|
+
(function(_0x20b55c,_0x3aabea){const _0x4f9a2d=a40_0x4caf,_0x49ff85=_0x20b55c();while(!![]){try{const _0x1fee16=-parseInt(_0x4f9a2d(0x12a))/0x1*(-parseInt(_0x4f9a2d(0xfa))/0x2)+parseInt(_0x4f9a2d(0x11a))/0x3*(-parseInt(_0x4f9a2d(0xf2))/0x4)+parseInt(_0x4f9a2d(0x123))/0x5*(-parseInt(_0x4f9a2d(0xfe))/0x6)+parseInt(_0x4f9a2d(0x103))/0x7+-parseInt(_0x4f9a2d(0xfc))/0x8*(-parseInt(_0x4f9a2d(0x107))/0x9)+-parseInt(_0x4f9a2d(0x102))/0xa*(-parseInt(_0x4f9a2d(0xf1))/0xb)+parseInt(_0x4f9a2d(0x11b))/0xc*(parseInt(_0x4f9a2d(0x10b))/0xd);if(_0x1fee16===_0x3aabea)break;else _0x49ff85['push'](_0x49ff85['shift']());}catch(_0x39c74f){_0x49ff85['push'](_0x49ff85['shift']());}}}(a40_0x238e,0x862b7));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a40_0x5e0462 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x4da580){const _0x2b4bd2=a40_0x4caf;return _0x4da580[_0x2b4bd2(0x101)]===_0x2b4bd2(0xf6)||_0x4da580[_0x2b4bd2(0x101)]===_0x2b4bd2(0xf3)||_0x4da580['format']===_0x2b4bd2(0x105)||_0x4da580[_0x2b4bd2(0x101)]===_0x2b4bd2(0x115)||_0x4da580[_0x2b4bd2(0xf6)]===!![]||_0x4da580[_0x2b4bd2(0xf3)]===!![]||_0x4da580[_0x2b4bd2(0x105)]===!![]||_0x4da580[_0x2b4bd2(0x115)]===!![];}export function parseOutputOptions(_0x367cc5){const _0x284446=a40_0x4caf;return{'format':_0x367cc5[_0x284446(0x101)]||_0x284446(0x115),'output':_0x367cc5[_0x284446(0xff)]||'','limit':_0x367cc5[_0x284446(0x118)],'color':_0x367cc5['color'],'noColor':_0x367cc5[_0x284446(0x127)]};}function convertSDKResultToQueryResult(_0x4af658){const _0x35cf79=a40_0x4caf,_0x1c9d9b=[];if(_0x4af658[_0x35cf79(0x11d)]>0x0){const _0x4faaee=_0x4af658[0x0];for(const [_0x346e1b,_0x5dd1fc]of Object['entries'](_0x4faaee)){let _0x273c2b=_0x35cf79(0x10d);if(typeof _0x5dd1fc===_0x35cf79(0x12b))_0x273c2b=Number[_0x35cf79(0xfb)](_0x5dd1fc)?_0x35cf79(0x11e):_0x35cf79(0x117);else{if(typeof _0x5dd1fc===_0x35cf79(0x114))_0x273c2b='boolean';else _0x5dd1fc===null&&(_0x273c2b='varchar');}_0x1c9d9b[_0x35cf79(0xf4)]({'name':_0x346e1b,'type':_0x273c2b});}}return{'queryId':'sdk-result','columns':_0x1c9d9b,'data':_0x4af658,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4af658[_0x35cf79(0x11d)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x42115a,_0xed802f){const _0x51fb65=convertSDKResultToQueryResult(_0x42115a);return formatQueryOutput(_0x51fb65,_0xed802f);}function a40_0x238e(){const _0x131edc=['json','No\x20data','keys','map','308hdBMYd','isInteger','8KLrygr','less','3606fiTrln','output','yellow','format','8560dxPAHb','3169390utFGtx','stdout','tsv','split','485073rqbiLm','rule','params','repeat','24973wJeEAf','max','varchar','filter','query','stdin','join','[logs]','string','boolean','table','stringify','double','limit','pipe','3025683QvqPzo','3420gIWKch','object','length','bigint','[params]','[rule]','cmdout','bold','5510CuNWJi','forEach','isTTY','[query]','noColor','padEnd','error','4655KqpqEx','number','-FXRSn','entries','inherit','log','magenta','trim','stderr','debug','resolve','5775ZyLADJ','4tidElN','jsonl','push','red'];a40_0x238e=function(){return _0x131edc;};return a40_0x238e();}export async function formatQueryOutput(_0x997b9e,_0x4db933){const _0xf5aa96=a40_0x4caf,{format:_0x3096a5,limit:_0x29beef,output:_0x757d0f,color:_0x3b5363,noColor:_0x160657}=_0x4db933,_0x577e33=Boolean(_0x757d0f)&&!_0x3b5363,_0x7b52b4={'color':_0x3b5363,'noColor':_0x160657||_0x577e33};if(_0x3096a5==='table'){const _0x5bd465=shouldUseLess(_0x3096a5,_0x757d0f);return formatAsTable(_0x997b9e,_0x29beef,_0x5bd465,_0x7b52b4);}else{if(_0x3096a5===_0xf5aa96(0xf6))return formatAsJSON(_0x997b9e,_0x7b52b4);else return _0x3096a5===_0xf5aa96(0xf3)?formatAsJSONL(_0x997b9e,_0x7b52b4):formatQueryResult(_0x997b9e,_0x3096a5);}}function shouldUseLess(_0x24bf5c,_0x1267a5){const _0x75534c=a40_0x4caf;return _0x24bf5c===_0x75534c(0x115)&&process[_0x75534c(0x104)][_0x75534c(0x125)]&&!_0x1267a5;}export function resolveOutputOptions(_0x15c0f6){const _0x2a8a9c=a40_0x4caf,_0x2a8a6b=resolveOutputFormat(_0x15c0f6['format'],_0x15c0f6[_0x2a8a9c(0xff)],_0x2a8a9c(0x115));let _0x4af3b2=typeof _0x15c0f6[_0x2a8a9c(0x118)]==='number'?_0x15c0f6['limit']:parseInt(_0x15c0f6[_0x2a8a9c(0x118)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x5345f5=_0x15c0f6[_0x2a8a9c(0xff)]||'';return shouldUseLess(_0x2a8a6b,_0x5345f5)&&(_0x4af3b2=Infinity),{'format':_0x2a8a6b,'output':_0x5345f5,'limit':_0x4af3b2,'color':_0x15c0f6['color'],'noColor':_0x15c0f6[_0x2a8a9c(0x127)]};}function a40_0x4caf(_0x4e2e66,_0x12a83a){_0x4e2e66=_0x4e2e66-0xe8;const _0x238e23=a40_0x238e();let _0x4cafbe=_0x238e23[_0x4e2e66];return _0x4cafbe;}export function writeOutput(_0x378c86,_0x29ac9a,_0x1e3f18){const _0x376959=a40_0x4caf;return _0x29ac9a?(writeFileSync(_0x29ac9a,_0x378c86),console[_0x376959(0x129)]('Results\x20saved\x20to\x20'+_0x29ac9a),Promise[_0x376959(0xf0)]()):shouldUseLess(_0x1e3f18||'','')?new Promise(_0x4f3934=>{const _0x2f978b=_0x376959,_0x2ed35a=spawn(_0x2f978b(0xfd),[_0x2f978b(0xe8)],{'stdio':[_0x2f978b(0x119),'inherit',_0x2f978b(0xea)]});let _0x2aeba9=![];_0x2ed35a['on']('error',()=>{const _0x40a814=_0x2f978b;!_0x2aeba9&&(_0x2aeba9=!![],console[_0x40a814(0xeb)](_0x378c86),_0x4f3934());}),_0x2ed35a['on']('close',()=>{!_0x2aeba9&&(_0x2aeba9=!![],_0x4f3934());}),_0x2ed35a['on']('spawn',()=>{const _0x4b207c=_0x2f978b;!_0x2aeba9&&_0x2ed35a['stdin']&&(_0x2ed35a['stdin']['on'](_0x4b207c(0x129),()=>{}),_0x2ed35a[_0x4b207c(0x110)]['write'](_0x378c86),_0x2ed35a[_0x4b207c(0x110)]['end']());}),!_0x2ed35a[_0x2f978b(0x110)]&&(!_0x2aeba9&&(_0x2aeba9=!![],console[_0x2f978b(0xeb)](_0x378c86),_0x4f3934()));}):(console[_0x376959(0xeb)](_0x378c86),Promise['resolve']());}export async function handleSDKOutput(_0x212e00,_0x140af9){const _0x25751=a40_0x4caf,_0x3c32c7=resolveOutputOptions(_0x140af9),_0x550dd5=await formatSDKOutput(_0x212e00,_0x3c32c7);await writeOutput(_0x550dd5,_0x3c32c7[_0x25751(0xff)]||undefined,_0x3c32c7[_0x25751(0x101)]);}export async function handleQueryOutput(_0x247d9e,_0x2d042f){const _0x53a087=a40_0x4caf,_0x520904=resolveOutputOptions(_0x2d042f),_0xf3122=await formatQueryOutput(_0x247d9e,_0x520904);await writeOutput(_0xf3122,_0x520904[_0x53a087(0xff)]||undefined,_0x520904[_0x53a087(0x101)]);}async function formatSingleObject(_0x52c6d9,_0x24783e){const _0x3bcf13=a40_0x4caf,{format:_0x5272f8,color:_0x4600a2,noColor:_0x485ebc}=_0x24783e,_0x46e43e={'color':_0x4600a2,'noColor':_0x485ebc};if(_0x5272f8===_0x3bcf13(0xf6)){if(shouldUseColor(_0x46e43e))return colorizeJSON(_0x52c6d9,_0x46e43e);return JSON[_0x3bcf13(0x116)](_0x52c6d9,null,0x2);}else{if(_0x5272f8===_0x3bcf13(0xf3)){if(shouldUseColor(_0x46e43e))return colorizeJSONCompact(_0x52c6d9,_0x46e43e);return JSON[_0x3bcf13(0x116)](_0x52c6d9);}else{if(_0x5272f8==='tsv')return Object[_0x3bcf13(0xe9)](_0x52c6d9)[_0x3bcf13(0xf9)](([_0x196216,_0x2c04ff])=>_0x196216+'\x09'+_0x2c04ff)['join']('\x0a');else{const _0x2e2c0d=Object[_0x3bcf13(0xe9)](_0x52c6d9);if(_0x2e2c0d[_0x3bcf13(0x11d)]===0x0)return _0x3bcf13(0xf7);const _0x41b393=_0x52c6d9[_0x3bcf13(0xef)],_0x22e0e5=_0x52c6d9[_0x3bcf13(0x10f)],_0x36d0b0=_0x52c6d9[_0x3bcf13(0x109)],_0x38719e=_0x52c6d9[_0x3bcf13(0x108)],_0x5c6c17=_0x22e0e5?typeof _0x22e0e5===_0x3bcf13(0x113)?_0x22e0e5:JSON[_0x3bcf13(0x116)](_0x22e0e5,null,0x2):undefined,_0x2f8378=_0x36d0b0&&Object[_0x3bcf13(0xf8)](_0x36d0b0)[_0x3bcf13(0x11d)]>0x0?JSON[_0x3bcf13(0x116)](_0x36d0b0,null,0x2):undefined,_0x303dc9=_0x38719e&&Object[_0x3bcf13(0xf8)](_0x38719e)[_0x3bcf13(0x11d)]>0x0?JSON[_0x3bcf13(0x116)](_0x38719e,null,0x2):undefined,_0x1798f1=_0x2e2c0d[_0x3bcf13(0x10e)](([_0xe74bdc])=>_0xe74bdc!=='debug'&&_0xe74bdc!==_0x3bcf13(0x10f)&&_0xe74bdc!==_0x3bcf13(0x109)&&_0xe74bdc!==_0x3bcf13(0x108)),_0x57b3da=Math[_0x3bcf13(0x10c)](..._0x1798f1['map'](([_0x3aa89b])=>_0x3aa89b['length'])),_0x241a16=Math['max'](..._0x1798f1[_0x3bcf13(0xf9)](([,_0x12c21b])=>{const _0x3ad41b=_0x3bcf13;try{const _0x3e6ee2=_0x12c21b===null||_0x12c21b===undefined?'':typeof _0x12c21b===_0x3ad41b(0x11c)?JSON[_0x3ad41b(0x116)](_0x12c21b):String(_0x12c21b),_0x172afc=_0x3e6ee2[_0x3ad41b(0x106)]('\x0a');return Math[_0x3ad41b(0x10c)](..._0x172afc[_0x3ad41b(0xf9)](_0x31f934=>_0x31f934['length']),0x0);}catch{return 0x0;}}),0x14),_0x369624=[];_0x369624['push'](colorBorder('┌─'+'─'[_0x3bcf13(0x10a)](_0x57b3da)+'─┬─'+'─'[_0x3bcf13(0x10a)](_0x241a16)+'─┐',_0x46e43e)),_0x1798f1['forEach'](([_0xf223cb,_0x48550a])=>{const _0x1dd4c2=_0x3bcf13;let _0x6d4bc;try{_0x6d4bc=_0x48550a===null||_0x48550a===undefined?'':typeof _0x48550a===_0x1dd4c2(0x11c)?JSON[_0x1dd4c2(0x116)](_0x48550a):String(_0x48550a);}catch{_0x6d4bc='[Object]';}const _0x2e0122=_0xf223cb[_0x1dd4c2(0x128)](_0x57b3da),_0x11fab3=_0x6d4bc[_0x1dd4c2(0x106)]('\x0a');_0x11fab3[_0x1dd4c2(0x124)]((_0x4f5be7,_0x128485)=>{const _0x4f6ee0=_0x1dd4c2,_0x37b19c=colorBorder('│',_0x46e43e);_0x128485===0x0?_0x369624['push'](_0x37b19c+'\x20'+_0x2e0122+'\x20'+_0x37b19c+'\x20'+_0x4f5be7[_0x4f6ee0(0x128)](_0x241a16)+'\x20'+_0x37b19c):_0x369624[_0x4f6ee0(0xf4)](_0x37b19c+'\x20'+'\x20'[_0x4f6ee0(0x10a)](_0x57b3da)+'\x20'+_0x37b19c+'\x20'+_0x4f5be7[_0x4f6ee0(0x128)](_0x241a16)+'\x20'+_0x37b19c);});}),_0x369624[_0x3bcf13(0xf4)](colorBorder('└─'+'─'[_0x3bcf13(0x10a)](_0x57b3da)+'─┴─'+'─'[_0x3bcf13(0x10a)](_0x241a16)+'─┘',_0x46e43e));_0x5c6c17&&(_0x369624[_0x3bcf13(0xf4)](''),_0x369624['push'](String(a40_0x5e0462[_0x3bcf13(0x100)][_0x3bcf13(0x122)](_0x3bcf13(0x126)))),_0x369624[_0x3bcf13(0xf4)](_0x5c6c17));_0x2f8378&&(_0x369624[_0x3bcf13(0xf4)](''),_0x369624[_0x3bcf13(0xf4)](String(a40_0x5e0462['blue'][_0x3bcf13(0x122)](_0x3bcf13(0x11f)))),_0x369624[_0x3bcf13(0xf4)](_0x2f8378));_0x303dc9&&(_0x369624[_0x3bcf13(0xf4)](''),_0x369624[_0x3bcf13(0xf4)](String(a40_0x5e0462[_0x3bcf13(0xec)]['bold'](_0x3bcf13(0x120)))),_0x369624[_0x3bcf13(0xf4)](_0x303dc9));if(_0x41b393){if(_0x41b393[_0x3bcf13(0xee)]){_0x369624['push'](''),_0x369624[_0x3bcf13(0xf4)](String(a40_0x5e0462[_0x3bcf13(0xf5)][_0x3bcf13(0x122)]('[error]')));const _0x8466e1=_0x41b393['stderr'][_0x3bcf13(0x106)]('\x0a');_0x8466e1[_0x3bcf13(0x124)](_0x72e65a=>{_0x72e65a['trim']()&&_0x369624['push'](_0x72e65a);});}if(_0x41b393[_0x3bcf13(0x121)]){_0x369624[_0x3bcf13(0xf4)](''),_0x369624[_0x3bcf13(0xf4)](String(a40_0x5e0462['cyan']['bold'](_0x3bcf13(0x112))));const _0x4b251c=_0x41b393[_0x3bcf13(0x121)][_0x3bcf13(0x106)]('\x0a');_0x4b251c['forEach'](_0x55b79f=>{const _0x328244=_0x3bcf13;_0x55b79f[_0x328244(0xed)]()&&_0x369624[_0x328244(0xf4)](_0x55b79f);});}}return _0x369624[_0x3bcf13(0x111)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x4af60d,_0x15e7b9){const _0x28fcdb=a40_0x4caf;if(_0x15e7b9['format']===_0x28fcdb(0x115)){await handleSDKOutput([_0x4af60d],_0x15e7b9);return;}const _0x3a5208=resolveOutputOptions(_0x15e7b9),_0x9f9b5c=await formatSingleObject(_0x4af60d,_0x3a5208);await writeOutput(_0x9f9b5c,_0x3a5208['output']||undefined,_0x3a5208[_0x28fcdb(0x101)]);}
|
package/dist/core/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5ee21e,_0x42d3a1){const _0x12f31c=a41_0x1093,_0x5a93a3=_0x5ee21e();while(!![]){try{const _0x5a369d=parseInt(_0x12f31c(0x9c))/0x1+parseInt(_0x12f31c(0x97))/0x2*(-parseInt(_0x12f31c(0xa7))/0x3)+parseInt(_0x12f31c(0x9e))/0x4*(parseInt(_0x12f31c(0x9b))/0x5)+-parseInt(_0x12f31c(0xaf))/0x6+-parseInt(_0x12f31c(0x9d))/0x7*(parseInt(_0x12f31c(0xb2))/0x8)+-parseInt(_0x12f31c(0xbd))/0x9+parseInt(_0x12f31c(0x92))/0xa;if(_0x5a369d===_0x42d3a1)break;else _0x5a93a3['push'](_0x5a93a3['shift']());}catch(_0x38fab9){_0x5a93a3['push'](_0x5a93a3['shift']());}}}(a41_0x7542,0x87244));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a41_0x33d34c from'node:fs';import*as a41_0x1e80c3 from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a41_0x369886 from'chalk';export function getConfigDir(){const _0x46d4dd=a41_0x1093;return process[_0x46d4dd(0xb7)][_0x46d4dd(0xa4)]||join(homedir(),_0x46d4dd(0xa3),_0x46d4dd(0x89));}export function getConfigFile(){const _0x1f93e9=a41_0x1093;return join(getConfigDir(),_0x1f93e9(0xbf));}export function getConfigFilePath(_0x483e62){const _0x6fb397=a41_0x1093,_0x2c32aa=getConfigDir();return _0x483e62?a41_0x1e80c3[_0x6fb397(0xd4)](_0x2c32aa,_0x6fb397(0xc5)+_0x483e62):getConfigFile();}export function getCacheDir(){const _0x576c7a=a41_0x1093;return process['env'][_0x576c7a(0xcc)]||join(homedir(),_0x576c7a(0x8c),_0x576c7a(0x89));}function a41_0x1093(_0x394537,_0x3b2065){_0x394537=_0x394537-0x87;const _0x7542e2=a41_0x7542();let _0x10930c=_0x7542e2[_0x394537];return _0x10930c;}export function getLLMProjectCacheFile(_0x176c1f){const _0x330e80=a41_0x1093,_0x2d2cc8=_0x176c1f?_0x330e80(0xc0)+_0x176c1f:_0x330e80(0xb1);return join(getCacheDir(),_0x2d2cc8);}export function readCachedLLMProject(_0x3785ef){const _0x245557=a41_0x1093;try{const _0x447469=getLLMProjectCacheFile(_0x3785ef);if(!existsSync(_0x447469))return null;const _0x17e44d=readFileSync(_0x447469,_0x245557(0xd5))[_0x245557(0xb5)]();try{const _0x13f3c6=JSON['parse'](_0x17e44d);if(_0x13f3c6&&typeof _0x13f3c6['id']==='string'&&typeof _0x13f3c6[_0x245557(0xd1)]===_0x245557(0xad))return _0x13f3c6;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x17349b,_0x34e1e9,_0x18d935){const _0x1406c6=a41_0x1093;try{const _0x23859f=getCacheDir(),_0x58e7e4=getLLMProjectCacheFile(_0x18d935);!existsSync(_0x23859f)&&mkdirSync(_0x23859f,{'recursive':!![]});const _0x320b2c={'name':_0x17349b,'id':_0x34e1e9};writeFileSync(_0x58e7e4,JSON[_0x1406c6(0xc7)](_0x320b2c),_0x1406c6(0xd5));}catch{}}export function getLLMAgentCacheFile(_0x22abbd){const _0x2caffc=_0x22abbd?'llm_default_agent.'+_0x22abbd:'llm_default_agent';return join(getCacheDir(),_0x2caffc);}export function readCachedLLMAgent(_0x53ea65){const _0x430b53=a41_0x1093;try{const _0x150f02=getLLMAgentCacheFile(_0x53ea65);if(!existsSync(_0x150f02))return null;const _0x2ade08=readFileSync(_0x150f02,_0x430b53(0xd5))[_0x430b53(0xb5)]();try{const _0x415e7c=JSON[_0x430b53(0xd0)](_0x2ade08);if(_0x415e7c&&typeof _0x415e7c['id']===_0x430b53(0xad)&&typeof _0x415e7c[_0x430b53(0xd1)]===_0x430b53(0xad)&&typeof _0x415e7c[_0x430b53(0xa2)]===_0x430b53(0xad))return _0x415e7c;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x5c7cc1,_0xcd1f07,_0x27034a,_0x5302b8){const _0x2e8f15=a41_0x1093;try{const _0x54735e=getCacheDir(),_0x4537de=getLLMAgentCacheFile(_0x5302b8);!existsSync(_0x54735e)&&mkdirSync(_0x54735e,{'recursive':!![]});const _0x11b727={'name':_0x5c7cc1,'id':_0xcd1f07,'projectId':_0x27034a};writeFileSync(_0x4537de,JSON[_0x2e8f15(0xc7)](_0x11b727),_0x2e8f15(0xd5));}catch{}}export function clearCachedLLMAgent(_0x489de2){try{const _0x56217a=getLLMAgentCacheFile(_0x489de2);existsSync(_0x56217a)&&unlinkSync(_0x56217a);}catch{}}export function getAccountInfoCacheFile(_0x2a711e){const _0x27c971=a41_0x1093,_0x4280b=_0x2a711e?'account_info.'+_0x2a711e+_0x27c971(0xd6):_0x27c971(0xa1);return join(getCacheDir(),_0x4280b);}export function readCachedAccountInfo(_0x4ca227){const _0x4af22c=a41_0x1093;try{const _0x58b40d=getAccountInfoCacheFile(_0x4ca227);if(!existsSync(_0x58b40d))return null;const _0x5d1993=readFileSync(_0x58b40d,_0x4af22c(0xd5))['trim'](),_0x49c5ef=JSON[_0x4af22c(0xd0)](_0x5d1993);if(_0x49c5ef&&typeof _0x49c5ef[_0x4af22c(0xb3)]===_0x4af22c(0xad)&&typeof _0x49c5ef[_0x4af22c(0xbb)]===_0x4af22c(0xb9))return _0x49c5ef;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x47b16c,_0x3348c9,_0x1d49e4){const _0x1c39b1=a41_0x1093;try{const _0x3092a1=getCacheDir(),_0x5130e2=getAccountInfoCacheFile(_0x1d49e4);!existsSync(_0x3092a1)&&mkdirSync(_0x3092a1,{'recursive':!![]});const _0x9462bf={'site':_0x47b16c,'accountId':_0x3348c9,'cachedAt':new Date()[_0x1c39b1(0xac)]()};writeFileSync(_0x5130e2,JSON[_0x1c39b1(0xc7)](_0x9462bf),_0x1c39b1(0xd5));}catch{}}export function parseEnvFile(_0x48fee6){const _0x2fe9d4=a41_0x1093,_0x12e4cf={};for(const _0x52e356 of _0x48fee6['split']('\x0a')){const _0x204590=_0x52e356[_0x2fe9d4(0xb5)]();if(!_0x204590||_0x204590[_0x2fe9d4(0x9a)]('#'))continue;const _0x5673d4=_0x204590['match'](/^([^=]+)=(.*)$/);if(_0x5673d4){const _0x2ee58d=_0x5673d4[0x1][_0x2fe9d4(0xb5)]();let _0x29c57a=_0x5673d4[0x2][_0x2fe9d4(0xb5)]();(_0x29c57a[_0x2fe9d4(0x9a)]('\x22')&&_0x29c57a[_0x2fe9d4(0xa5)]('\x22')||_0x29c57a[_0x2fe9d4(0x9a)]('\x27')&&_0x29c57a[_0x2fe9d4(0xa5)]('\x27'))&&(_0x29c57a=_0x29c57a[_0x2fe9d4(0xcf)](0x1,-0x1)),_0x12e4cf[_0x2ee58d]=_0x29c57a;}}return _0x12e4cf;}export function readUserConfig(){const _0xbe0efd=a41_0x1093,_0x4eb77d=getConfigFile();if(!existsSync(_0x4eb77d))return{};try{const _0x5ea2c5=readFileSync(_0x4eb77d,_0xbe0efd(0xd5));return parseEnvFile(_0x5ea2c5);}catch(_0xf6da39){return console['warn'](_0xbe0efd(0xaa)+_0x4eb77d+':',_0xf6da39),{};}}export function resolveSite(_0x22561c){const _0x8db456=a41_0x1093,_0x160a73=[_0x8db456(0x8b),'jp01',_0x8db456(0xae),'ap02',_0x8db456(0x99),'dev-us01',_0x8db456(0xa6),'stg-us01',_0x8db456(0xc1),'stg-ap03'];if(_0x160a73[_0x8db456(0xc8)](_0x22561c))return _0x22561c;if(_0x22561c in SITE_ALIASES)return SITE_ALIASES[_0x22561c];return console['warn'](_0x8db456(0xbc)+_0x22561c+_0x8db456(0xc2)),_0x8db456(0x8b);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x5404ef,_0x1b5e7a){const _0x734f6a=a41_0x1093,_0x5eef9f=_0x1b5e7a||getActiveProfileName();if(_0x5eef9f){const _0x1981c2=_0x734f6a(0xa8)+normalizeProfileForEnvVar(_0x5eef9f);if(process['env'][_0x1981c2])return process[_0x734f6a(0xb7)][_0x1981c2];}if(process[_0x734f6a(0xb7)][_0x734f6a(0x8a)])return process[_0x734f6a(0xb7)][_0x734f6a(0x8a)];if(process[_0x734f6a(0xb7)]['TD_API_KEY'])return process[_0x734f6a(0xb7)][_0x734f6a(0x94)];const _0x511cf1=_0x5404ef[_0x734f6a(0xb0)]()[_0x734f6a(0x95)](/-/g,'_'),_0x506118=_0x734f6a(0xc6)+_0x511cf1;if(_0x5eef9f){const _0x340bcb=loadProfileEnv(_0x5eef9f);if(_0x340bcb){if(_0x340bcb[_0x506118])return _0x340bcb[_0x506118];if(_0x340bcb[_0x734f6a(0x94)])return _0x340bcb[_0x734f6a(0x94)];}}const _0x53e204=loadUserConfigOnce();if(_0x53e204[_0x506118])return _0x53e204[_0x506118];if(_0x53e204['TD_API_KEY'])return _0x53e204[_0x734f6a(0x94)];return undefined;}export function normalizeProfileForEnvVar(_0xefd42b){const _0x1723ef=a41_0x1093;return _0xefd42b[_0x1723ef(0xb0)]()[_0x1723ef(0x95)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x55226a,_0x2a1b67){const _0x3b3561=a41_0x1093,_0x5a00f3=_0x2a1b67||getActiveProfileName()||undefined;if(_0x5a00f3){const _0x58e7af='TDX_API_KEY_'+normalizeProfileForEnvVar(_0x5a00f3);if(process[_0x3b3561(0xb7)][_0x58e7af])return{'apiKey':process['env'][_0x58e7af],'source':_0x58e7af+_0x3b3561(0xa9),'isDeprecated':![]};const _0x7a4e58=getCachedCredential(_0x55226a,_0x5a00f3);if(_0x7a4e58)return{'apiKey':_0x7a4e58,'source':_0x3b3561(0xba)+_0x5a00f3+')','isDeprecated':![]};const _0x42f11c=await getKeychainAPIKey(_0x5a00f3);if(_0x42f11c)return setCachedCredential(_0x42f11c,_0x55226a,_0x5a00f3),{'apiKey':_0x42f11c,'source':_0x3b3561(0xba)+_0x5a00f3+')','isDeprecated':![]};}if(process[_0x3b3561(0xb7)][_0x3b3561(0x8a)])return{'apiKey':process[_0x3b3561(0xb7)][_0x3b3561(0x8a)],'source':_0x3b3561(0x91),'isDeprecated':![]};if(!_0x5a00f3){const _0x1033c0=getCachedCredential(_0x55226a,undefined);if(_0x1033c0)return{'apiKey':_0x1033c0,'source':_0x3b3561(0x93),'isDeprecated':![]};const _0x193e72=await getKeychainAPIKey(undefined);if(_0x193e72)return setCachedCredential(_0x193e72,_0x55226a,undefined),{'apiKey':_0x193e72,'source':_0x3b3561(0x93),'isDeprecated':![]};}if(process[_0x3b3561(0xb7)][_0x3b3561(0x94)])return{'apiKey':process[_0x3b3561(0xb7)][_0x3b3561(0x94)],'source':_0x3b3561(0xb8),'isDeprecated':!![]};const _0x320e6c=getLegacyEnvAPIKey(_0x55226a,_0x5a00f3);if(_0x320e6c){const _0x10d739=await isKeychainAvailable();if(_0x10d739)try{await saveKeychainAPIKey(_0x320e6c,_0x5a00f3),setCachedCredential(_0x320e6c,_0x55226a,_0x5a00f3);const _0x277555=getConfigFilePath(_0x5a00f3);cleanupLegacyEnvFile(_0x277555)&&console[_0x3b3561(0xb6)](a41_0x369886[_0x3b3561(0xbe)]('⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage'));}catch(_0x287801){console['warn'](a41_0x369886[_0x3b3561(0xbe)]('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0x287801));}const _0x491a7b=_0x5a00f3?_0x3b3561(0x87)+_0x5a00f3+')':_0x3b3561(0xc9);return{'apiKey':_0x320e6c,'source':_0x491a7b,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x53730d,_0x19a2ef,_0x5ba8d2=!![]){const _0x254a2a=a41_0x1093,_0x40b9b8=await resolveAPIKeyAsync(_0x53730d,_0x19a2ef);if(!_0x40b9b8)return undefined;if(_0x5ba8d2&&_0x40b9b8['isDeprecated']&&_0x40b9b8[_0x254a2a(0xb4)][_0x254a2a(0xc8)]('TD_API_KEY')){const _0x231126=_0x19a2ef||getActiveProfileName()||undefined,_0x1d7917=_0x231126?_0x254a2a(0xa8)+normalizeProfileForEnvVar(_0x231126):_0x254a2a(0x9f);console[_0x254a2a(0xb6)](a41_0x369886[_0x254a2a(0xbe)](_0x254a2a(0x8e)+(_0x254a2a(0xd2)+_0x1d7917+').')));}return _0x40b9b8[_0x254a2a(0x96)];}function getLegacyEnvAPIKey(_0x4c5f81,_0xbc5da7){const _0x5d2d00=a41_0x1093,_0x16e262=_0x4c5f81[_0x5d2d00(0xb0)]()[_0x5d2d00(0x95)](/-/g,'_'),_0x3059d3=_0x5d2d00(0xc6)+_0x16e262;if(_0xbc5da7){const _0x536200=loadProfileEnv(_0xbc5da7);if(_0x536200){if(_0x536200[_0x3059d3])return _0x536200[_0x3059d3];if(_0x536200[_0x5d2d00(0x94)])return _0x536200[_0x5d2d00(0x94)];}}const _0x5bc3a8=loadUserConfigOnce();if(_0x5bc3a8[_0x3059d3])return _0x5bc3a8[_0x3059d3];if(_0x5bc3a8['TD_API_KEY'])return _0x5bc3a8[_0x5d2d00(0x94)];return undefined;}function cleanupLegacyEnvFile(_0x4d4d30){const _0x38698e=a41_0x1093;if(!existsSync(_0x4d4d30))return![];try{const _0x78e32=readFileSync(_0x4d4d30,'utf-8'),_0x24c55e=_0x78e32[_0x38698e(0xa0)]('\x0a'),_0x5a80f6=_0x24c55e[_0x38698e(0x8d)](_0x5f0aee=>{const _0xe7a5d7=_0x38698e,_0x1081b4=_0x5f0aee[_0xe7a5d7(0xb5)]();if(!_0x1081b4||_0x1081b4[_0xe7a5d7(0x9a)]('#'))return!![];const [_0x5d5ade]=_0x1081b4['split']('=');return!_0x5d5ade['startsWith'](_0xe7a5d7(0x94));}),_0x3a02be=_0x5a80f6[_0x38698e(0xc3)](_0x2a23f7=>{const _0x5ce260=_0x38698e,_0x27421b=_0x2a23f7[_0x5ce260(0xb5)]();return _0x27421b&&!_0x27421b[_0x5ce260(0x9a)]('#');});if(!_0x3a02be)return unlinkSync(_0x4d4d30),!![];return writeFileSync(_0x4d4d30,_0x5a80f6['join']('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x51f219){const _0x1931c1=a41_0x1093,_0x3fb77b=a41_0x1e80c3[_0x1931c1(0xd4)](getConfigDir(),_0x1931c1(0xc5)+_0x51f219);if(a41_0x33d34c[_0x1931c1(0xcd)](_0x3fb77b)){validateSecureFilePermissions(_0x3fb77b);try{const _0x53e718=a41_0x33d34c[_0x1931c1(0x8f)](_0x3fb77b,'utf-8');return parseEnvFile(_0x53e718);}catch(_0x3ae504){console[_0x1931c1(0xb6)]('Warning:\x20Failed\x20to\x20load\x20'+_0x3fb77b+':\x20'+_0x3ae504);}}const _0x35abcf=a41_0x1e80c3['join'](getConfigDir(),_0x1931c1(0x88),_0x51f219,_0x1931c1(0xbf));if(a41_0x33d34c['existsSync'](_0x35abcf)){validateSecureFilePermissions(_0x35abcf);try{const _0x2d32b0=a41_0x33d34c['readFileSync'](_0x35abcf,'utf-8');return parseEnvFile(_0x2d32b0);}catch(_0x20ae41){return console[_0x1931c1(0xb6)](_0x1931c1(0x90)+_0x35abcf+':\x20'+_0x20ae41),null;}}return null;}function getActiveProfileName(){const _0x2bf1f6=a41_0x1093,_0x59e587=a41_0x1e80c3['join'](getConfigDir(),_0x2bf1f6(0xca));if(!a41_0x33d34c[_0x2bf1f6(0xcd)](_0x59e587))return null;try{const _0x26dba7=a41_0x33d34c[_0x2bf1f6(0x8f)](_0x59e587,_0x2bf1f6(0xd5)),_0x1979a0=JSON[_0x2bf1f6(0xd0)](_0x26dba7);return _0x1979a0[_0x2bf1f6(0x98)]||null;}catch{return null;}}function a41_0x7542(){const _0x9a325b=['TD_API_KEY_','stringify','includes','legacy\x20.env\x20file','tdx.json','Warning:\x20Failed\x20to\x20read\x20','TDX_CACHE_DIR','existsSync','stg-ap03','slice','parse','name','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','join','utf-8','.json','legacy\x20.env\x20file\x20(profile:\x20','profiles','tdx','TDX_API_KEY','us01','.cache','filter','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','readFileSync','Warning:\x20Failed\x20to\x20load\x20','TDX_API_KEY\x20env\x20var','27634290CTfnRa','keychain','TD_API_KEY','replace','apiKey','1493578WAxcFe','profile','ap03','startsWith','5bSwkei','604479GNNjNZ','7fNdDSN','57828qbELCi','TDX_API_KEY_<PROFILE>','split','account_info.json','projectId','.config','TDX_CONFIG_DIR','endsWith','dev-eu01','3ZQmtSH','TDX_API_KEY_','\x20env\x20var','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','apiKeys','toISOString','string','eu01','1990548JuwieN','toUpperCase','llm_default_project','6503896rwpYPF','site','source','trim','warn','env','TD_API_KEY\x20env\x20var\x20(deprecated)','number','keychain\x20(profile:\x20','accountId','Warning:\x20Unknown\x20site\x20\x27','8435619lNsisM','yellow','.env','llm_default_project.','stg-jp01','\x27,\x20defaulting\x20to\x20us01','some','stg-us01','.env.'];a41_0x7542=function(){return _0x9a325b;};return a41_0x7542();}export function saveAPIKey(_0x3cdeda,_0x29c356,_0x298485){const _0x38ff89=a41_0x1093,_0x594396=getConfigDir(),_0x38e0a7=getConfigFilePath(_0x298485);!existsSync(_0x594396)&&mkdirSync(_0x594396,{'recursive':!![],'mode':0x1c0});let _0x5dc1bc={};if(existsSync(_0x38e0a7))try{const _0x32abb2=readFileSync(_0x38e0a7,_0x38ff89(0xd5));_0x5dc1bc=parseEnvFile(_0x32abb2);}catch(_0x5f2033){console[_0x38ff89(0xb6)](_0x38ff89(0xcb)+_0x38e0a7+':',_0x5f2033);}const _0x187795=_0x3cdeda[_0x38ff89(0xb0)]()['replace'](/-/g,'_');_0x5dc1bc[_0x38ff89(0xc6)+_0x187795]=_0x29c356;const _0x330008=Object['entries'](_0x5dc1bc)['map'](([_0x23bb37,_0x51c6ba])=>_0x23bb37+'='+_0x51c6ba);writeFileSync(_0x38e0a7,_0x330008[_0x38ff89(0xd4)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x541348,_0x44f39b,_0x53c668){const _0x1c23c8=a41_0x1093;await saveKeychainAPIKey(_0x541348,_0x53c668),setCachedCredential(_0x541348,_0x44f39b,_0x53c668);const _0x168fa1=getConfigFilePath(_0x53c668);cleanupLegacyEnvFile(_0x168fa1)&&console[_0x1c23c8(0xb6)](a41_0x369886[_0x1c23c8(0xbe)](_0x1c23c8(0xd3)));}export function loadConfig(){const _0x5999c7=a41_0x1093,_0xa837cb={'apiKeys':{},'defaultSite':_0x5999c7(0x8b)},_0xed6a73=[_0x5999c7(0x8b),'jp01',_0x5999c7(0xae),'ap02','ap03','dev-us01',_0x5999c7(0xa6),_0x5999c7(0xc4),'stg-jp01',_0x5999c7(0xce)];for(const _0x15ecd5 of _0xed6a73){const _0x3182d8=getAPIKey(_0x15ecd5);_0x3182d8&&(_0xa837cb[_0x5999c7(0xab)][_0x15ecd5]=_0x3182d8);}return _0xa837cb;}
|
|
1
|
+
(function(_0x53e799,_0x55c8a5){const _0x451e1d=a41_0x433b,_0x11f8b8=_0x53e799();while(!![]){try{const _0x1c9b04=parseInt(_0x451e1d(0x221))/0x1+parseInt(_0x451e1d(0x1fe))/0x2*(parseInt(_0x451e1d(0x207))/0x3)+-parseInt(_0x451e1d(0x1ed))/0x4+-parseInt(_0x451e1d(0x1f6))/0x5+parseInt(_0x451e1d(0x201))/0x6+parseInt(_0x451e1d(0x20e))/0x7+-parseInt(_0x451e1d(0x215))/0x8*(parseInt(_0x451e1d(0x1d8))/0x9);if(_0x1c9b04===_0x55c8a5)break;else _0x11f8b8['push'](_0x11f8b8['shift']());}catch(_0x506f17){_0x11f8b8['push'](_0x11f8b8['shift']());}}}(a41_0x59bd,0x5ead0));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a41_0x5212d5 from'node:fs';import*as a41_0xccfffe from'node:path';import{SITE_ALIASES}from'../sdk/types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';function a41_0x433b(_0x544a92,_0x3991c4){_0x544a92=_0x544a92-0x1d4;const _0x59bd9d=a41_0x59bd();let _0x433b5d=_0x59bd9d[_0x544a92];return _0x433b5d;}import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a41_0x2db06e from'chalk';export function getConfigDir(){const _0x8d6156=a41_0x433b;return process[_0x8d6156(0x214)]['TDX_CONFIG_DIR']||join(homedir(),_0x8d6156(0x200),_0x8d6156(0x20d));}export function getConfigFile(){const _0x3d6ac9=a41_0x433b;return join(getConfigDir(),_0x3d6ac9(0x220));}export function getConfigFilePath(_0x3ae1d4){const _0x48ba92=a41_0x433b,_0x5e0829=getConfigDir();return _0x3ae1d4?a41_0xccfffe[_0x48ba92(0x21d)](_0x5e0829,_0x48ba92(0x1f9)+_0x3ae1d4):getConfigFile();}export function getCacheDir(){const _0x421b14=a41_0x433b;return process['env']['TDX_CACHE_DIR']||join(homedir(),'.cache',_0x421b14(0x20d));}export function getLLMProjectCacheFile(_0x5a1d40){const _0x4f7121=a41_0x433b,_0x12f312=_0x5a1d40?_0x4f7121(0x1e3)+_0x5a1d40:_0x4f7121(0x1e6);return join(getCacheDir(),_0x12f312);}export function readCachedLLMProject(_0x1e0a6e){const _0x4acda6=a41_0x433b;try{const _0x2bb5dc=getLLMProjectCacheFile(_0x1e0a6e);if(!existsSync(_0x2bb5dc))return null;const _0x3dee5e=readFileSync(_0x2bb5dc,_0x4acda6(0x1e2))['trim']();try{const _0x61bcb=JSON[_0x4acda6(0x1ec)](_0x3dee5e);if(_0x61bcb&&typeof _0x61bcb['id']===_0x4acda6(0x209)&&typeof _0x61bcb[_0x4acda6(0x1df)]===_0x4acda6(0x209))return _0x61bcb;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x4fe3aa,_0x2d89ff,_0x5e28ba){const _0x424b4e=a41_0x433b;try{const _0x9ff887=getCacheDir(),_0xd91c2b=getLLMProjectCacheFile(_0x5e28ba);!existsSync(_0x9ff887)&&mkdirSync(_0x9ff887,{'recursive':!![]});const _0x1b175b={'name':_0x4fe3aa,'id':_0x2d89ff};writeFileSync(_0xd91c2b,JSON[_0x424b4e(0x1fd)](_0x1b175b),'utf-8');}catch{}}export function getLLMAgentCacheFile(_0x2b8a9d){const _0x19e3f5=_0x2b8a9d?'llm_default_agent.'+_0x2b8a9d:'llm_default_agent';return join(getCacheDir(),_0x19e3f5);}export function readCachedLLMAgent(_0x28da81){const _0x21042e=a41_0x433b;try{const _0x43b1f0=getLLMAgentCacheFile(_0x28da81);if(!existsSync(_0x43b1f0))return null;const _0x27a496=readFileSync(_0x43b1f0,'utf-8')['trim']();try{const _0xeae31a=JSON[_0x21042e(0x1ec)](_0x27a496);if(_0xeae31a&&typeof _0xeae31a['id']==='string'&&typeof _0xeae31a['name']===_0x21042e(0x209)&&typeof _0xeae31a[_0x21042e(0x208)]==='string')return _0xeae31a;}catch{}return null;}catch{return null;}}export function writeCachedLLMAgent(_0x1bafb2,_0x5b740b,_0x451e2d,_0x44169d){const _0x3def1c=a41_0x433b;try{const _0x227577=getCacheDir(),_0x1eaed3=getLLMAgentCacheFile(_0x44169d);!existsSync(_0x227577)&&mkdirSync(_0x227577,{'recursive':!![]});const _0x385544={'name':_0x1bafb2,'id':_0x5b740b,'projectId':_0x451e2d};writeFileSync(_0x1eaed3,JSON[_0x3def1c(0x1fd)](_0x385544),_0x3def1c(0x1e2));}catch{}}export function clearCachedLLMAgent(_0x11ea6e){try{const _0x22988d=getLLMAgentCacheFile(_0x11ea6e);existsSync(_0x22988d)&&unlinkSync(_0x22988d);}catch{}}export function getAccountInfoCacheFile(_0x4c0a38){const _0x477c16=a41_0x433b,_0x53b3d7=_0x4c0a38?_0x477c16(0x1ff)+_0x4c0a38+_0x477c16(0x1f7):_0x477c16(0x218);return join(getCacheDir(),_0x53b3d7);}export function readCachedAccountInfo(_0x4ed539){const _0x3af74f=a41_0x433b;try{const _0x5b5edb=getAccountInfoCacheFile(_0x4ed539);if(!existsSync(_0x5b5edb))return null;const _0x3db72d=readFileSync(_0x5b5edb,_0x3af74f(0x1e2))[_0x3af74f(0x213)](),_0x4e833d=JSON[_0x3af74f(0x1ec)](_0x3db72d);if(_0x4e833d&&typeof _0x4e833d[_0x3af74f(0x1e7)]===_0x3af74f(0x209)&&typeof _0x4e833d[_0x3af74f(0x1d4)]===_0x3af74f(0x1de))return _0x4e833d;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x5904e1,_0x2f2e5e,_0x32c322){const _0xf08c3c=a41_0x433b;try{const _0x81ba11=getCacheDir(),_0x13b5c5=getAccountInfoCacheFile(_0x32c322);!existsSync(_0x81ba11)&&mkdirSync(_0x81ba11,{'recursive':!![]});const _0x3cd357={'site':_0x5904e1,'accountId':_0x2f2e5e,'cachedAt':new Date()[_0xf08c3c(0x1e8)]()};writeFileSync(_0x13b5c5,JSON[_0xf08c3c(0x1fd)](_0x3cd357),_0xf08c3c(0x1e2));}catch{}}export function parseEnvFile(_0x1d002f){const _0x335fea=a41_0x433b,_0x1fd9f0={};for(const _0x3f86ef of _0x1d002f[_0x335fea(0x21c)]('\x0a')){const _0x48d0af=_0x3f86ef[_0x335fea(0x213)]();if(!_0x48d0af||_0x48d0af['startsWith']('#'))continue;const _0x5f1da2=_0x48d0af[_0x335fea(0x1e9)](/^([^=]+)=(.*)$/);if(_0x5f1da2){const _0x355ea1=_0x5f1da2[0x1][_0x335fea(0x213)]();let _0x30e0ab=_0x5f1da2[0x2][_0x335fea(0x213)]();(_0x30e0ab[_0x335fea(0x1f2)]('\x22')&&_0x30e0ab['endsWith']('\x22')||_0x30e0ab[_0x335fea(0x1f2)]('\x27')&&_0x30e0ab['endsWith']('\x27'))&&(_0x30e0ab=_0x30e0ab[_0x335fea(0x1e5)](0x1,-0x1)),_0x1fd9f0[_0x355ea1]=_0x30e0ab;}}return _0x1fd9f0;}export function readUserConfig(){const _0x5e95a1=a41_0x433b,_0x4bb96c=getConfigFile();if(!existsSync(_0x4bb96c))return{};try{const _0x1d77aa=readFileSync(_0x4bb96c,_0x5e95a1(0x1e2));return parseEnvFile(_0x1d77aa);}catch(_0x31a7b1){return console[_0x5e95a1(0x1f3)](_0x5e95a1(0x211)+_0x4bb96c+':',_0x31a7b1),{};}}export function resolveSite(_0xc58814){const _0x3ec07a=a41_0x433b,_0x2a26e1=['us01',_0x3ec07a(0x1ea),_0x3ec07a(0x1f5),_0x3ec07a(0x1fa),_0x3ec07a(0x1f1),'dev-us01',_0x3ec07a(0x1d9),_0x3ec07a(0x1ef),_0x3ec07a(0x20c),_0x3ec07a(0x205)];if(_0x2a26e1['includes'](_0xc58814))return _0xc58814;if(_0xc58814 in SITE_ALIASES)return SITE_ALIASES[_0xc58814];return console['warn'](_0x3ec07a(0x20a)+_0xc58814+'\x27,\x20defaulting\x20to\x20us01'),_0x3ec07a(0x1e1);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x13bec8,_0x2cb369){const _0x1a2eee=a41_0x433b,_0x350558=_0x2cb369||getActiveProfileName();if(_0x350558){const _0x559428=_0x1a2eee(0x1dc)+normalizeProfileForEnvVar(_0x350558);if(process[_0x1a2eee(0x214)][_0x559428])return process[_0x1a2eee(0x214)][_0x559428];}if(process[_0x1a2eee(0x214)][_0x1a2eee(0x1e4)])return process['env']['TDX_API_KEY'];if(process[_0x1a2eee(0x214)][_0x1a2eee(0x202)])return process['env'][_0x1a2eee(0x202)];const _0x1562b2=_0x13bec8[_0x1a2eee(0x1fb)]()['replace'](/-/g,'_'),_0x3efc54=_0x1a2eee(0x20f)+_0x1562b2;if(_0x350558){const _0x1efaa2=loadProfileEnv(_0x350558);if(_0x1efaa2){if(_0x1efaa2[_0x3efc54])return _0x1efaa2[_0x3efc54];if(_0x1efaa2['TD_API_KEY'])return _0x1efaa2[_0x1a2eee(0x202)];}}const _0x31db0b=loadUserConfigOnce();if(_0x31db0b[_0x3efc54])return _0x31db0b[_0x3efc54];if(_0x31db0b[_0x1a2eee(0x202)])return _0x31db0b[_0x1a2eee(0x202)];return undefined;}export function normalizeProfileForEnvVar(_0x30448b){const _0x1fdec4=a41_0x433b;return _0x30448b['toUpperCase']()[_0x1fdec4(0x1dd)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x505fd4,_0x3c40a6){const _0x3c326d=a41_0x433b,_0x69291e=_0x3c40a6||getActiveProfileName()||undefined;if(_0x69291e){const _0x4c7269=_0x3c326d(0x1dc)+normalizeProfileForEnvVar(_0x69291e);if(process['env'][_0x4c7269])return{'apiKey':process[_0x3c326d(0x214)][_0x4c7269],'source':_0x4c7269+_0x3c326d(0x1db),'isDeprecated':![]};const _0x4a18c9=getCachedCredential(_0x505fd4,_0x69291e);if(_0x4a18c9)return{'apiKey':_0x4a18c9,'source':_0x3c326d(0x1d7)+_0x69291e+')','isDeprecated':![]};const _0x48b17a=await getKeychainAPIKey(_0x69291e);if(_0x48b17a)return setCachedCredential(_0x48b17a,_0x505fd4,_0x69291e),{'apiKey':_0x48b17a,'source':'keychain\x20(profile:\x20'+_0x69291e+')','isDeprecated':![]};}if(process[_0x3c326d(0x214)][_0x3c326d(0x1e4)])return{'apiKey':process[_0x3c326d(0x214)][_0x3c326d(0x1e4)],'source':_0x3c326d(0x203),'isDeprecated':![]};if(!_0x69291e){const _0x1ef356=getCachedCredential(_0x505fd4,undefined);if(_0x1ef356)return{'apiKey':_0x1ef356,'source':_0x3c326d(0x21a),'isDeprecated':![]};const _0x3b70ce=await getKeychainAPIKey(undefined);if(_0x3b70ce)return setCachedCredential(_0x3b70ce,_0x505fd4,undefined),{'apiKey':_0x3b70ce,'source':'keychain','isDeprecated':![]};}if(process['env']['TD_API_KEY'])return{'apiKey':process[_0x3c326d(0x214)][_0x3c326d(0x202)],'source':_0x3c326d(0x1da),'isDeprecated':!![]};const _0x4a497d=getLegacyEnvAPIKey(_0x505fd4,_0x69291e);if(_0x4a497d){const _0x168840=await isKeychainAvailable();if(_0x168840)try{await saveKeychainAPIKey(_0x4a497d,_0x69291e),setCachedCredential(_0x4a497d,_0x505fd4,_0x69291e);const _0x360ed0=getConfigFilePath(_0x69291e);cleanupLegacyEnvFile(_0x360ed0)&&console[_0x3c326d(0x1f3)](a41_0x2db06e['yellow'](_0x3c326d(0x1eb)));}catch(_0x35fcc9){console['warn'](a41_0x2db06e['yellow']('⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20'+_0x35fcc9));}const _0x360d84=_0x69291e?'legacy\x20.env\x20file\x20(profile:\x20'+_0x69291e+')':_0x3c326d(0x1d5);return{'apiKey':_0x4a497d,'source':_0x360d84,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x3d3613,_0x54a3b4,_0x14e9f1=!![]){const _0x21efbe=a41_0x433b,_0x172889=await resolveAPIKeyAsync(_0x3d3613,_0x54a3b4);if(!_0x172889)return undefined;if(_0x14e9f1&&_0x172889[_0x21efbe(0x216)]&&_0x172889['source'][_0x21efbe(0x21f)](_0x21efbe(0x202))){const _0x149c4a=_0x54a3b4||getActiveProfileName()||undefined,_0x16c506=_0x149c4a?'TDX_API_KEY_'+normalizeProfileForEnvVar(_0x149c4a):_0x21efbe(0x21b);console[_0x21efbe(0x1f3)](a41_0x2db06e[_0x21efbe(0x217)](_0x21efbe(0x206)+(_0x21efbe(0x1d6)+_0x16c506+').')));}return _0x172889[_0x21efbe(0x21e)];}function getLegacyEnvAPIKey(_0x11512f,_0x3c6f87){const _0x44c15f=a41_0x433b,_0x2dda48=_0x11512f[_0x44c15f(0x1fb)]()[_0x44c15f(0x1dd)](/-/g,'_'),_0x7aedf4=_0x44c15f(0x20f)+_0x2dda48;if(_0x3c6f87){const _0x93ee9b=loadProfileEnv(_0x3c6f87);if(_0x93ee9b){if(_0x93ee9b[_0x7aedf4])return _0x93ee9b[_0x7aedf4];if(_0x93ee9b[_0x44c15f(0x202)])return _0x93ee9b[_0x44c15f(0x202)];}}const _0x275b72=loadUserConfigOnce();if(_0x275b72[_0x7aedf4])return _0x275b72[_0x7aedf4];if(_0x275b72[_0x44c15f(0x202)])return _0x275b72[_0x44c15f(0x202)];return undefined;}function cleanupLegacyEnvFile(_0x4656db){const _0x164b68=a41_0x433b;if(!existsSync(_0x4656db))return![];try{const _0x2442ff=readFileSync(_0x4656db,_0x164b68(0x1e2)),_0x1b7af6=_0x2442ff['split']('\x0a'),_0x19af0b=_0x1b7af6[_0x164b68(0x1f8)](_0x6097e0=>{const _0x2c2759=_0x164b68,_0x21c5ba=_0x6097e0[_0x2c2759(0x213)]();if(!_0x21c5ba||_0x21c5ba[_0x2c2759(0x1f2)]('#'))return!![];const [_0x23d318]=_0x21c5ba['split']('=');return!_0x23d318[_0x2c2759(0x1f2)]('TD_API_KEY');}),_0xa09771=_0x19af0b[_0x164b68(0x20b)](_0x5ac3c2=>{const _0x3c214e=_0x164b68,_0x115f2e=_0x5ac3c2['trim']();return _0x115f2e&&!_0x115f2e[_0x3c214e(0x1f2)]('#');});if(!_0xa09771)return unlinkSync(_0x4656db),!![];return writeFileSync(_0x4656db,_0x19af0b[_0x164b68(0x21d)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x2f7d9d){const _0x313e74=a41_0x433b,_0x52687a=a41_0xccfffe[_0x313e74(0x21d)](getConfigDir(),_0x313e74(0x1f9)+_0x2f7d9d);if(a41_0x5212d5[_0x313e74(0x1e0)](_0x52687a)){validateSecureFilePermissions(_0x52687a);try{const _0x28e37c=a41_0x5212d5[_0x313e74(0x212)](_0x52687a,_0x313e74(0x1e2));return parseEnvFile(_0x28e37c);}catch(_0x4b3ee1){console['warn'](_0x313e74(0x204)+_0x52687a+':\x20'+_0x4b3ee1);}}const _0x423163=a41_0xccfffe[_0x313e74(0x21d)](getConfigDir(),_0x313e74(0x1ee),_0x2f7d9d,_0x313e74(0x220));if(a41_0x5212d5['existsSync'](_0x423163)){validateSecureFilePermissions(_0x423163);try{const _0x331309=a41_0x5212d5['readFileSync'](_0x423163,_0x313e74(0x1e2));return parseEnvFile(_0x331309);}catch(_0x45fa7a){return console[_0x313e74(0x1f3)](_0x313e74(0x204)+_0x423163+':\x20'+_0x45fa7a),null;}}return null;}function a41_0x59bd(){const _0x4b7ca2=['Warning:\x20Failed\x20to\x20load\x20','stg-ap03','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','9TAWDYx','projectId','string','Warning:\x20Unknown\x20site\x20\x27','some','stg-jp01','tdx','1756321wjTtYi','TD_API_KEY_','profile','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','readFileSync','trim','env','353224mamdQt','isDeprecated','yellow','account_info.json','Warning:\x20Failed\x20to\x20read\x20','keychain','TDX_API_KEY_<PROFILE>','split','join','apiKey','includes','.env','766463qzWYZK','accountId','legacy\x20.env\x20file','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','keychain\x20(profile:\x20','198DdzzKK','dev-eu01','TD_API_KEY\x20env\x20var\x20(deprecated)','\x20env\x20var','TDX_API_KEY_','replace','number','name','existsSync','us01','utf-8','llm_default_project.','TDX_API_KEY','slice','llm_default_project','site','toISOString','match','jp01','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','parse','350896LWrsoH','profiles','stg-us01','entries','ap03','startsWith','warn','apiKeys','eu01','2373835mnTGZd','.json','filter','.env.','ap02','toUpperCase','map','stringify','260684XoGXvz','account_info.','.config','3079542LHgcdM','TD_API_KEY','TDX_API_KEY\x20env\x20var'];a41_0x59bd=function(){return _0x4b7ca2;};return a41_0x59bd();}function getActiveProfileName(){const _0x5ee06c=a41_0x433b,_0x452b45=a41_0xccfffe['join'](getConfigDir(),'tdx.json');if(!a41_0x5212d5['existsSync'](_0x452b45))return null;try{const _0x452fc5=a41_0x5212d5['readFileSync'](_0x452b45,_0x5ee06c(0x1e2)),_0x3416fb=JSON[_0x5ee06c(0x1ec)](_0x452fc5);return _0x3416fb[_0x5ee06c(0x210)]||null;}catch{return null;}}export function saveAPIKey(_0x471d17,_0x1b6dc7,_0x4065bd){const _0x2700f4=a41_0x433b,_0x2cc9ba=getConfigDir(),_0x2d0591=getConfigFilePath(_0x4065bd);!existsSync(_0x2cc9ba)&&mkdirSync(_0x2cc9ba,{'recursive':!![],'mode':0x1c0});let _0x3d2005={};if(existsSync(_0x2d0591))try{const _0x505575=readFileSync(_0x2d0591,_0x2700f4(0x1e2));_0x3d2005=parseEnvFile(_0x505575);}catch(_0x545d6f){console['warn'](_0x2700f4(0x219)+_0x2d0591+':',_0x545d6f);}const _0x6910d=_0x471d17['toUpperCase']()[_0x2700f4(0x1dd)](/-/g,'_');_0x3d2005['TD_API_KEY_'+_0x6910d]=_0x1b6dc7;const _0x22630b=Object[_0x2700f4(0x1f0)](_0x3d2005)[_0x2700f4(0x1fc)](([_0x3da5f7,_0x2866af])=>_0x3da5f7+'='+_0x2866af);writeFileSync(_0x2d0591,_0x22630b[_0x2700f4(0x21d)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x5dadb3,_0x479cd4,_0x1008fc){const _0x324757=a41_0x433b;await saveKeychainAPIKey(_0x5dadb3,_0x1008fc),setCachedCredential(_0x5dadb3,_0x479cd4,_0x1008fc);const _0x2be5a0=getConfigFilePath(_0x1008fc);cleanupLegacyEnvFile(_0x2be5a0)&&console[_0x324757(0x1f3)](a41_0x2db06e[_0x324757(0x217)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x49fbfa=a41_0x433b,_0x5462e6={'apiKeys':{},'defaultSite':_0x49fbfa(0x1e1)},_0x2ff0db=[_0x49fbfa(0x1e1),_0x49fbfa(0x1ea),_0x49fbfa(0x1f5),'ap02',_0x49fbfa(0x1f1),'dev-us01','dev-eu01','stg-us01','stg-jp01','stg-ap03'];for(const _0x6f8313 of _0x2ff0db){const _0x10b273=getAPIKey(_0x6f8313);_0x10b273&&(_0x5462e6[_0x49fbfa(0x1f4)][_0x6f8313]=_0x10b273);}return _0x5462e6;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x17ce2b,_0x21a149){const _0x21f218=a42_0x54fe,_0x2aafbc=_0x17ce2b();while(!![]){try{const _0x3a6469=-parseInt(_0x21f218(0x19c))/0x1+-parseInt(_0x21f218(0x19e))/0x2+parseInt(_0x21f218(0x196))/0x3*(parseInt(_0x21f218(0x194))/0x4)+-parseInt(_0x21f218(0x197))/0x5+-parseInt(_0x21f218(0x198))/0x6+-parseInt(_0x21f218(0x19a))/0x7*(-parseInt(_0x21f218(0x1a0))/0x8)+parseInt(_0x21f218(0x19f))/0x9;if(_0x3a6469===_0x21a149)break;else _0x2aafbc['push'](_0x2aafbc['shift']());}catch(_0x5d33da){_0x2aafbc['push'](_0x2aafbc['shift']());}}}(a42_0x35ab,0x29d2a));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function a42_0x54fe(_0x488c75,_0x5e4fc2){_0x488c75=_0x488c75-0x194;const _0x35abf5=a42_0x35ab();let _0x54fe40=_0x35abf5[_0x488c75];return _0x54fe40;}function a42_0x35ab(){const _0x1699cd=['1000704boXPAX','connections','3RrSZJE','1025260LhacPy','196986RUznKk','utf-8','14mZWApq','.json','73804jKBIHk','connections-','413644yRHNvC','3573117ZWoVkN','170504kMlgOi','now'];a42_0x35ab=function(){return _0x1699cd;};return a42_0x35ab();}function getCacheFilePath(_0xb32bc1){const _0x38e2b2=a42_0x54fe,_0x357f7f=_0xb32bc1||'default';return join(getCacheDir(),_0x38e2b2(0x19d)+_0x357f7f+_0x38e2b2(0x19b));}export function loadCachedConnections(_0x577ef6){const _0xc9e22a=a42_0x54fe,_0x60e491=getCacheFilePath(_0x577ef6);if(!existsSync(_0x60e491))return null;try{const _0xba3874=readFileSync(_0x60e491,_0xc9e22a(0x199)),_0x409b7a=JSON['parse'](_0xba3874);return _0x409b7a[_0xc9e22a(0x195)];}catch{return null;}}export function saveCachedConnections(_0x5eb8ef,_0x232676){const _0x235264=a42_0x54fe,_0x465c13=getCacheDir();!existsSync(_0x465c13)&&mkdirSync(_0x465c13,{'recursive':!![]});const _0x5befa4=getCacheFilePath(_0x5eb8ef),_0x4e730={'connections':_0x232676,'cachedAt':Date[_0x235264(0x1a1)]()};writeFileSync(_0x5befa4,JSON['stringify'](_0x4e730,null,0x2),_0x235264(0x199));}export function clearConnectionCache(_0x381a6a){const _0x5d9fa9=getCacheFilePath(_0x381a6a);if(existsSync(_0x5d9fa9))try{unlinkSync(_0x5d9fa9);}catch{}}
|
package/dist/core/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x123be6,_0x2cbbd2){const _0x42a993=a43_0x3c8b,_0x1d5812=_0x123be6();while(!![]){try{const _0xddbc64=-parseInt(_0x42a993(0x10c))/0x1+-parseInt(_0x42a993(0x107))/0x2*(-parseInt(_0x42a993(0x10a))/0x3)+-parseInt(_0x42a993(0x10e))/0x4*(parseInt(_0x42a993(0x10f))/0x5)+parseInt(_0x42a993(0x110))/0x6*(-parseInt(_0x42a993(0x111))/0x7)+parseInt(_0x42a993(0x109))/0x8*(parseInt(_0x42a993(0x10d))/0x9)+-parseInt(_0x42a993(0x108))/0xa+parseInt(_0x42a993(0x105))/0xb*(parseInt(_0x42a993(0x106))/0xc);if(_0xddbc64===_0x2cbbd2)break;else _0x1d5812['push'](_0x1d5812['shift']());}catch(_0x1dbeae){_0x1d5812['push'](_0x1d5812['shift']());}}}(a43_0x5208,0xdd4ea));function a43_0x5208(){const _0x13d4d3=['1398bACfck','23044tuPYXJ','25964367BgNXAx','12Fxmmcc','78752UTZgTz','10191330qgXNHq','24PCoSpp','48UCRRir','number','74594DfirlN','2137239iFprfb','3742356GyDKBp','5OUtGSd'];a43_0x5208=function(){return _0x13d4d3;};return a43_0x5208();}export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;function a43_0x3c8b(_0x4c3285,_0x192fa1){_0x4c3285=_0x4c3285-0x105;const _0x52081b=a43_0x5208();let _0x3c8bdf=_0x52081b[_0x4c3285];return _0x3c8bdf;}export function resolveLimit(_0x2c410c,_0x252def){const _0x45fb42=a43_0x3c8b;if(_0x2c410c===undefined)return _0x252def;if(typeof _0x2c410c===_0x45fb42(0x10b))return _0x2c410c;return parseInt(_0x2c410c,0xa);}
|